blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
616
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
112
license_type
stringclasses
2 values
repo_name
stringlengths
5
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
777 values
visit_date
timestamp[us]date
2015-08-06 10:31:46
2023-09-06 10:44:38
revision_date
timestamp[us]date
1970-01-01 02:38:32
2037-05-03 13:00:00
committer_date
timestamp[us]date
1970-01-01 02:38:32
2023-09-06 01:08:06
github_id
int64
4.92k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-04 01:52:49
2023-09-14 21:59:50
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-21 12:35:19
gha_language
stringclasses
149 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
3
10.2M
extension
stringclasses
188 values
content
stringlengths
3
10.2M
authors
sequencelengths
1
1
author_id
stringlengths
1
132
27bbcd1397596207d47f148c356105873636a5e2
b76ae361ab277923d0fed969b795074a1ecb400b
/project/python_fullstack/day13/property.py
77fec9d5cf94c99f3b42f8fbcc1616c6cbd3e6c0
[]
no_license
RobotNo42/old_coed
995df921e31d5a9b65f1609380235330edb546ad
59f82e5d58965dd5c6340f4daf4ef43d1d311252
refs/heads/master
2021-07-18T00:07:33.450173
2020-06-16T13:51:11
2020-06-16T13:51:11
180,384,457
0
0
null
null
null
null
UTF-8
Python
false
false
321
py
class People: def __init__(self, name, age, weight, height): self.name = name self.age =age self.weight = weight self.height = height @property def dmi(self): d = self.weight / (self.height ** 2) return round(d, 2) g = People('wzc', 20, 75, 1.7) print(g.dmi)
22acc2dddc23d9c0fc2317a07bff8b04cb194b7e
580f9928174741d07720141107879878091a2640
/dlib-example/face-detector/cnn_face_detector.py
01f7d8ae4592d4d0937b596b43b56ea97a2940fc
[]
no_license
zengzhiying/machine_learning
08aa323e4bcf42f208ce81297249ceed9818844c
7b6a3c19580f000b1fa4ae54305749c3857b91a6
refs/heads/master
2023-02-27T20:08:43.384000
2021-02-07T14:20:48
2021-02-07T14:20:48
99,288,444
3
1
null
2020-10-12T22:02:52
2017-08-04T01:07:32
MATLAB
UTF-8
Python
false
false
3,819
py
#!/usr/bin/python3 # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example shows how to run a CNN based face detector using dlib. The # example loads a pretrained model and uses it to find faces in images. The # CNN model is much more accurate than the HOG based model shown in the # face_detector.py example, but takes much more computational power to # run, and is meant to be executed on a GPU to attain reasonable speed. # # You can download the pre-trained model from: # http://dlib.net/files/mmod_human_face_detector.dat.bz2 # # The examples/faces folder contains some jpg images of people. You can run # this program on them and see the detections by executing the # following command: # ./cnn_face_detector.py mmod_human_face_detector.dat ../examples/faces/*.jpg # # # COMPILING/INSTALLING THE DLIB PYTHON INTERFACE # You can install dlib using the command: # pip install dlib # # Alternatively, if you want to compile dlib yourself then go into the dlib # root folder and run: # python setup.py install # # Compiling dlib should work on any operating system so long as you have # CMake installed. On Ubuntu, this can be done easily by running the # command: # sudo apt-get install cmake # # Also note that this example requires Numpy which can be installed # via the command: # pip install numpy import os import sys import time import cv2 import dlib # if len(sys.argv) < 3: # print( # "Call this program like this:\n" # " ./cnn_face_detector.py mmod_human_face_detector.dat ../examples/faces/*.jpg\n" # "You can get the mmod_human_face_detector.dat file from:\n" # " http://dlib.net/files/mmod_human_face_detector.dat.bz2") # exit() cnn_face_detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat') # win = dlib.image_window() image_file = sys.argv[1] if os.path.isfile(image_file): print("Processing file: {}".format(image_file)) t1 = time.time() img = dlib.load_rgb_image(image_file) print("load image time: {:.3f}s".format(time.time() - t1)) t1 = time.time() # The 1 in the second argument indicates that we should upsample the image # 1 time. This will make everything bigger and allow us to detect more # faces. dets = cnn_face_detector(img, 1) print("detect image time: {:.3f}s".format(time.time() - t1)) t1 = time.time() ''' This detector returns a mmod_rectangles object. This object contains a list of mmod_rectangle objects. These objects can be accessed by simply iterating over the mmod_rectangles object The mmod_rectangle object has two member variables, a dlib.rectangle object, and a confidence score. It is also possible to pass a list of images to the detector. - like this: dets = cnn_face_detector([image list], upsample_num, batch_size = 128) In this case it will return a mmod_rectangless object. This object behaves just like a list of lists and can be iterated over. ''' print("Number of faces detected: {}".format(len(dets))) img = cv2.imread(image_file) for i, d in enumerate(dets): print("Detection {}: Left: {} Top: {} Right: {} Bottom: {} Confidence: {}".format( i, d.rect.left(), d.rect.top(), d.rect.right(), d.rect.bottom(), d.confidence)) cv2.rectangle(img, (d.rect.left(), d.rect.top()), (d.rect.right(), d.rect.bottom()), (0, 0, 255), 3) cv2.imwrite(f'{image_file[:-4]}_box.jpg', img) print("rect image time: {:.3f}s".format(time.time() - t1)) # rects = dlib.rectangles() # rects.extend([d.rect for d in dets]) # win.clear_overlay() # win.set_image(img) # win.add_overlay(rects) # dlib.hit_enter_to_continue()
5523a954cd910bce70946a3ab248b803adcc2d11
6413fe58b04ac2a7efe1e56050ad42d0e688adc6
/tempenv/lib/python3.7/site-packages/dash_html_components/Tbody.py
6c69bce7274c8ffc23ad59c3a25b5f69c48d2621
[ "MIT" ]
permissive
tytechortz/Denver_temperature
7f91e0ac649f9584147d59193568f6ec7efe3a77
9d9ea31cd7ec003e8431dcbb10a3320be272996d
refs/heads/master
2022-12-09T06:22:14.963463
2019-10-09T16:30:52
2019-10-09T16:30:52
170,581,559
1
0
MIT
2022-06-21T23:04:21
2019-02-13T21:22:53
Python
UTF-8
Python
false
false
5,310
py
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class Tbody(Component): """A Tbody component. Keyword arguments: - children (a list of or a singular dash component, string or number; optional): The children of this component - id (string; optional): The ID of this component, used to identify dash components in callbacks. The ID needs to be unique across all of the components in an app. - n_clicks (number; optional): An integer that represents the number of times that this element has been clicked on. - n_clicks_timestamp (number; optional): An integer that represents the time (in ms since 1970) at which n_clicks changed. This can be used to tell which button was changed most recently. - key (string; optional): A unique identifier for the component, used to improve performance by React.js while rendering components See https://reactjs.org/docs/lists-and-keys.html for more info - role (string; optional): The ARIA role attribute - data-* (string; optional): A wildcard data attribute - aria-* (string; optional): A wildcard aria attribute - accessKey (string; optional): Defines a keyboard shortcut to activate or add focus to the element. - className (string; optional): Often used with CSS to style elements with common properties. - contentEditable (string; optional): Indicates whether the element's content is editable. - contextMenu (string; optional): Defines the ID of a <menu> element which will serve as the element's context menu. - dir (string; optional): Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) - draggable (string; optional): Defines whether the element can be dragged. - hidden (string; optional): Prevents rendering of given element, while keeping child elements, e.g. script elements, active. - lang (string; optional): Defines the language used in the element. - spellCheck (string; optional): Indicates whether spell checking is allowed for the element. - style (dict; optional): Defines CSS styles which will override styles previously set. - tabIndex (string; optional): Overrides the browser's default tab order and follows the one specified instead. - title (string; optional): Text to be displayed in a tooltip when hovering over the element. Available events: 'click'""" @_explicitize_args def __init__(self, children=None, id=Component.UNDEFINED, n_clicks=Component.UNDEFINED, n_clicks_timestamp=Component.UNDEFINED, key=Component.UNDEFINED, role=Component.UNDEFINED, accessKey=Component.UNDEFINED, className=Component.UNDEFINED, contentEditable=Component.UNDEFINED, contextMenu=Component.UNDEFINED, dir=Component.UNDEFINED, draggable=Component.UNDEFINED, hidden=Component.UNDEFINED, lang=Component.UNDEFINED, spellCheck=Component.UNDEFINED, style=Component.UNDEFINED, tabIndex=Component.UNDEFINED, title=Component.UNDEFINED, **kwargs): self._prop_names = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title'] self._type = 'Tbody' self._namespace = 'dash_html_components' self._valid_wildcard_attributes = ['data-', 'aria-'] self.available_events = ['click'] self.available_properties = ['children', 'id', 'n_clicks', 'n_clicks_timestamp', 'key', 'role', 'data-*', 'aria-*', 'accessKey', 'className', 'contentEditable', 'contextMenu', 'dir', 'draggable', 'hidden', 'lang', 'spellCheck', 'style', 'tabIndex', 'title'] self.available_wildcard_properties = ['data-', 'aria-'] _explicit_args = kwargs.pop('_explicit_args') _locals = locals() _locals.update(kwargs) # For wildcard attrs args = {k: _locals[k] for k in _explicit_args if k != 'children'} for k in []: if k not in args: raise TypeError( 'Required argument `' + k + '` was not specified.') super(Tbody, self).__init__(children=children, **args) def __repr__(self): if(any(getattr(self, c, None) is not None for c in self._prop_names if c is not self._prop_names[0]) or any(getattr(self, c, None) is not None for c in self.__dict__.keys() if any(c.startswith(wc_attr) for wc_attr in self._valid_wildcard_attributes))): props_string = ', '.join([c+'='+repr(getattr(self, c, None)) for c in self._prop_names if getattr(self, c, None) is not None]) wilds_string = ', '.join([c+'='+repr(getattr(self, c, None)) for c in self.__dict__.keys() if any([c.startswith(wc_attr) for wc_attr in self._valid_wildcard_attributes])]) return ('Tbody(' + props_string + (', ' + wilds_string if wilds_string != '' else '') + ')') else: return ( 'Tbody(' + repr(getattr(self, self._prop_names[0], None)) + ')')
ad965770425ffb7514c7eae370f4dda72d70789c
a29b8d6ae6642ef80d04ae99d721b703de06db69
/maro/rl/rl_component/rl_component_bundle.py
cd18accdf0d03c47cf335a0de68f3444b0a88656
[ "LicenseRef-scancode-generic-cla", "MIT" ]
permissive
microsoft/maro
6aab1a4e86fddabf7f242f0d1020d985a5f7a5f3
b3c6a589ad9036b03221e776a6929b2bc1eb4680
refs/heads/master
2023-08-24T16:52:38.250279
2023-05-15T04:31:58
2023-05-15T04:31:58
230,389,247
764
158
MIT
2023-07-25T20:59:06
2019-12-27T06:48:27
Python
UTF-8
Python
false
false
4,598
py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from typing import Any, Dict, List from maro.rl.policy import AbsPolicy, RLPolicy from maro.rl.rollout import AbsEnvSampler from maro.rl.training import AbsTrainer from maro.rl.workflows.callback import Callback class RLComponentBundle: """Bundle of all necessary components to run a RL job in MARO. env_sampler (AbsEnvSampler): Environment sampler of the scenario. agent2policy (Dict[Any, str]): Agent name to policy name mapping of the RL job. For example: {agent1: policy1, agent2: policy1, agent3: policy2}. policies (List[AbsPolicy]): Policies. trainers (List[AbsTrainer]): Trainers. device_mapping (Dict[str, str], default=None): Device mapping that identifying which device to put each policy. If None, there will be no explicit device assignment. policy_trainer_mapping (Dict[str, str], default=None): Policy-trainer mapping which identifying which trainer to train each policy. If None, then a policy's trainer's name is the first segment of the policy's name, separated by dot. For example, "ppo_1.policy" is trained by "ppo_1". Only policies that provided in policy-trainer mapping are considered as trainable polices. Policies that not provided in policy-trainer mapping will not be trained. """ def __init__( self, env_sampler: AbsEnvSampler, agent2policy: Dict[Any, str], policies: List[AbsPolicy], trainers: List[AbsTrainer], device_mapping: Dict[str, str] = None, policy_trainer_mapping: Dict[str, str] = None, customized_callbacks: List[Callback] = [], ) -> None: self.env_sampler = env_sampler self.agent2policy = agent2policy self.policies = policies self.trainers = trainers self.customized_callbacks = customized_callbacks policy_set = set([policy.name for policy in self.policies]) not_found = [policy_name for policy_name in self.agent2policy.values() if policy_name not in policy_set] if len(not_found) > 0: raise ValueError(f"The following policies are required but cannot be found: [{', '.join(not_found)}]") # Remove unused policies kept_policies = [] for policy in self.policies: if policy.name not in self.agent2policy.values(): raise Warning(f"Policy {policy.name} is removed since it is not used by any agent.") else: kept_policies.append(policy) self.policies = kept_policies policy_set = set([policy.name for policy in self.policies]) self.device_mapping = ( {k: v for k, v in device_mapping.items() if k in policy_set} if device_mapping is not None else {} ) self.policy_trainer_mapping = ( policy_trainer_mapping if policy_trainer_mapping is not None else {policy_name: policy_name.split(".")[0] for policy_name in policy_set} ) # Check missing trainers self.policy_trainer_mapping = { policy_name: trainer_name for policy_name, trainer_name in self.policy_trainer_mapping.items() if policy_name in policy_set } trainer_set = set([trainer.name for trainer in self.trainers]) not_found = [ trainer_name for trainer_name in self.policy_trainer_mapping.values() if trainer_name not in trainer_set ] if len(not_found) > 0: raise ValueError(f"The following trainers are required but cannot be found: [{', '.join(not_found)}]") # Remove unused trainers kept_trainers = [] for trainer in self.trainers: if trainer.name not in self.policy_trainer_mapping.values(): raise Warning(f"Trainer {trainer.name} if removed since no policy is trained by it.") else: kept_trainers.append(trainer) self.trainers = kept_trainers @property def trainable_agent2policy(self) -> Dict[Any, str]: return { agent_name: policy_name for agent_name, policy_name in self.agent2policy.items() if policy_name in self.policy_trainer_mapping } @property def trainable_policies(self) -> List[RLPolicy]: policies = [] for policy in self.policies: if policy.name in self.policy_trainer_mapping: assert isinstance(policy, RLPolicy) policies.append(policy) return policies
cc0c55576ca8c77495cb64ff56021fd3e2852733
e3d9592ff05f225433e1689ec70253043a360ee2
/hackerrank/python/regex_and_parsing/roman_numerals.py
a754d0a19b5448bb11bc357181bcb56b1a1b9310
[]
no_license
jreiher2003/code_challenges
cad28cac57b6e14ffd30d2b7fe00abdba8b3fa47
ac03c868b28e1cfa22d8257366e7a0f8f757ad8c
refs/heads/master
2020-04-16T02:25:26.267418
2016-12-12T01:23:56
2016-12-12T01:23:56
58,969,218
1
0
null
null
null
null
UTF-8
Python
false
false
150
py
import re pattern = "^M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$" if re.search(pattern, "MMMM"): print "True" else: print "False"
40e89b7989c5e6d8f7aad0954bd436b90cc7752d
f62fd455e593a7ad203a5c268e23129473d968b6
/neutron-10.0.2/neutron/tests/functional/agent/l3/test_legacy_router.py
fe6f7135012ce38ba46e1d9bdbb27aacecd5bbf3
[ "Apache-2.0" ]
permissive
MinbinGong/OpenStack-Ocata
5d17bcd47a46d48ff9e71e2055f667836174242f
8b7650128cfd2fdf5d6c8bc4613ac2e396fb2fb3
refs/heads/master
2021-06-23T05:24:37.799927
2017-08-14T04:33:05
2017-08-14T04:33:05
99,709,985
0
2
null
2020-07-22T22:06:22
2017-08-08T15:48:44
Python
UTF-8
Python
false
false
19,223
py
# Copyright (c) 2014 Red Hat, Inc. # All Rights Reserved. # # 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 copy import mock from neutron_lib import constants as lib_constants from neutron.agent.l3 import namespace_manager from neutron.agent.l3 import namespaces from neutron.agent.linux import ip_lib from neutron.callbacks import events from neutron.callbacks import registry from neutron.callbacks import resources from neutron.common import utils from neutron.tests.common import machine_fixtures from neutron.tests.common import net_helpers from neutron.tests.functional.agent.l3 import framework class L3AgentTestCase(framework.L3AgentTestFramework): def test_agent_notifications_for_router_events(self): """Test notifications for router create, update, and delete. Make sure that when the agent sends notifications of router events for router create, update, and delete, that the correct handler is called with the right resource, event, and router information. """ event_handler = mock.Mock() registry.subscribe(event_handler, resources.ROUTER, events.BEFORE_CREATE) registry.subscribe(event_handler, resources.ROUTER, events.AFTER_CREATE) registry.subscribe(event_handler, resources.ROUTER, events.BEFORE_UPDATE) registry.subscribe(event_handler, resources.ROUTER, events.AFTER_UPDATE) registry.subscribe(event_handler, resources.ROUTER, events.BEFORE_DELETE) registry.subscribe(event_handler, resources.ROUTER, events.AFTER_DELETE) router_info = self.generate_router_info(enable_ha=False) router = self.manage_router(self.agent, router_info) self.agent._process_updated_router(router.router) self._delete_router(self.agent, router.router_id) expected_calls = [ mock.call('router', 'before_create', self.agent, router=router), mock.call('router', 'after_create', self.agent, router=router), mock.call('router', 'before_update', self.agent, router=router), mock.call('router', 'after_update', self.agent, router=router), mock.call('router', 'before_delete', self.agent, router=router), mock.call('router', 'after_delete', self.agent, router=router)] event_handler.assert_has_calls(expected_calls) def test_legacy_router_update_floatingip_statuses(self): self._test_update_floatingip_statuses( self.generate_router_info(enable_ha=False)) def test_legacy_router_lifecycle(self): self._router_lifecycle(enable_ha=False, dual_stack=True) def test_legacy_router_lifecycle_with_no_gateway_subnet(self): self.agent.conf.set_override('ipv6_gateway', 'fe80::f816:3eff:fe2e:1') self._router_lifecycle(enable_ha=False, dual_stack=True, v6_ext_gw_with_sub=False) def test_legacy_router_gateway_update_to_none(self): router_info = self.generate_router_info(False) router = self.manage_router(self.agent, router_info) gw_port = router.get_ex_gw_port() interface_name = router.get_external_device_name(gw_port['id']) device = ip_lib.IPDevice(interface_name, namespace=router.ns_name) self.assertIn('gateway', device.route.get_gateway()) # Make this copy, so that the agent will think there is change in # external gateway port. router.ex_gw_port = copy.deepcopy(router.ex_gw_port) for subnet in gw_port['subnets']: subnet['gateway_ip'] = None router.process() self.assertIsNone(device.route.get_gateway()) def _make_bridge(self): bridge = framework.get_ovs_bridge(utils.get_rand_name()) bridge.create() self.addCleanup(bridge.destroy) return bridge def test_external_network_bridge_change(self): bridge1, bridge2 = self._make_bridge(), self._make_bridge() self.agent.conf.set_override('external_network_bridge', bridge1.br_name) router_info = self.generate_router_info(False) router = self.manage_router(self.agent, router_info) gw_port = router.router['gw_port'] gw_inf_name = router.get_external_device_name(gw_port['id']) self.assertIn(gw_inf_name, [v.port_name for v in bridge1.get_vif_ports()]) # changeing the external_network_bridge should have no impact since # the interface exists. self.agent.conf.set_override('external_network_bridge', bridge2.br_name) self.manage_router(self.agent, router_info) self.assertIn(gw_inf_name, [v.port_name for v in bridge1.get_vif_ports()]) self.assertNotIn(gw_inf_name, [v.port_name for v in bridge2.get_vif_ports()]) namespaces.Namespace.delete(router.router_namespace) self.manage_router(self.agent, router_info) self.assertIn(gw_inf_name, [v.port_name for v in bridge2.get_vif_ports()]) self.assertNotIn(gw_inf_name, [v.port_name for v in bridge1.get_vif_ports()]) def test_legacy_router_ns_rebuild(self): router_info = self.generate_router_info(False) router = self.manage_router(self.agent, router_info) gw_port = router.router['gw_port'] gw_inf_name = router.get_external_device_name(gw_port['id']) gw_device = ip_lib.IPDevice(gw_inf_name, namespace=router.ns_name) router_ports = [gw_device] for i_port in router_info.get(lib_constants.INTERFACE_KEY, []): interface_name = router.get_internal_device_name(i_port['id']) router_ports.append( ip_lib.IPDevice(interface_name, namespace=router.ns_name)) namespaces.Namespace.delete(router.router_namespace) # l3 agent should be able to rebuild the ns when it is deleted self.manage_router(self.agent, router_info) # Assert the router ports are there in namespace self.assertTrue(all([port.exists() for port in router_ports])) self._delete_router(self.agent, router.router_id) def test_conntrack_disassociate_fip_legacy_router(self): self._test_conntrack_disassociate_fip(ha=False) def _test_periodic_sync_routers_task(self, routers_to_keep, routers_deleted, routers_deleted_during_resync): ns_names_to_retrieve = set() deleted_routers_info = [] for r in routers_to_keep: ri = self.manage_router(self.agent, r) ns_names_to_retrieve.add(ri.ns_name) for r in routers_deleted + routers_deleted_during_resync: ri = self.manage_router(self.agent, r) deleted_routers_info.append(ri) ns_names_to_retrieve.add(ri.ns_name) mocked_get_router_ids = self.mock_plugin_api.get_router_ids mocked_get_router_ids.return_value = [r['id'] for r in routers_to_keep + routers_deleted_during_resync] mocked_get_routers = self.mock_plugin_api.get_routers mocked_get_routers.return_value = (routers_to_keep + routers_deleted_during_resync) # clear agent router_info as it will be after restart self.agent.router_info = {} # Synchronize the agent with the plug-in with mock.patch.object(namespace_manager.NamespaceManager, 'list_all', return_value=ns_names_to_retrieve): self.agent.periodic_sync_routers_task(self.agent.context) # Mock the plugin RPC API so a known external network id is returned # when the router updates are processed by the agent external_network_id = framework._uuid() self.mock_plugin_api.get_external_network_id.return_value = ( external_network_id) # Plug external_gateway_info in the routers that are not going to be # deleted by the agent when it processes the updates. Otherwise, # _process_router_if_compatible in the agent fails for r in routers_to_keep: r['external_gateway_info'] = {'network_id': external_network_id} # while sync updates are still in the queue, higher priority # router_deleted events may be added there as well for r in routers_deleted_during_resync: self.agent.router_deleted(self.agent.context, r['id']) # make sure all events are processed while not self.agent._queue._queue.empty(): self.agent._process_router_update() for r in routers_to_keep: self.assertIn(r['id'], self.agent.router_info) self.assertTrue(self._namespace_exists(namespaces.NS_PREFIX + r['id'])) for ri in deleted_routers_info: self.assertNotIn(ri.router_id, self.agent.router_info) self._assert_router_does_not_exist(ri) def test_periodic_sync_routers_task(self): routers_to_keep = [] for i in range(2): routers_to_keep.append(self.generate_router_info(False)) self._test_periodic_sync_routers_task(routers_to_keep, routers_deleted=[], routers_deleted_during_resync=[]) def test_periodic_sync_routers_task_routers_deleted_while_agent_down(self): routers_to_keep = [] routers_deleted = [] for i in range(2): routers_to_keep.append(self.generate_router_info(False)) for i in range(2): routers_deleted.append(self.generate_router_info(False)) self._test_periodic_sync_routers_task(routers_to_keep, routers_deleted, routers_deleted_during_resync=[]) def test_periodic_sync_routers_task_routers_deleted_while_agent_sync(self): routers_to_keep = [] routers_deleted_during_resync = [] for i in range(2): routers_to_keep.append(self.generate_router_info(False)) for i in range(2): routers_deleted_during_resync.append( self.generate_router_info(False)) self._test_periodic_sync_routers_task( routers_to_keep, routers_deleted=[], routers_deleted_during_resync=routers_deleted_during_resync) def _setup_fip_with_fixed_ip_from_same_subnet(self, enable_snat): """Setup 2 FakeMachines from same subnet, one with floatingip associated. """ router_info = self.generate_router_info(enable_ha=False, enable_snat=enable_snat) router = self.manage_router(self.agent, router_info) router_ip_cidr = self._port_first_ip_cidr(router.internal_ports[0]) router_ip = router_ip_cidr.partition('/')[0] br_int = framework.get_ovs_bridge( self.agent.conf.ovs_integration_bridge) src_machine, dst_machine = self.useFixture( machine_fixtures.PeerMachines( br_int, net_helpers.increment_ip_cidr(router_ip_cidr), router_ip)).machines dst_fip = '19.4.4.10' router.router[lib_constants.FLOATINGIP_KEY] = [] self._add_fip(router, dst_fip, fixed_address=dst_machine.ip) router.process() return src_machine, dst_machine, dst_fip def test_fip_connection_from_same_subnet(self): '''Test connection to floatingip which is associated with fixed_ip on the same subnet of the source fixed_ip. In other words it confirms that return packets surely go through the router. ''' src_machine, dst_machine, dst_fip = ( self._setup_fip_with_fixed_ip_from_same_subnet(enable_snat=True)) protocol_port = net_helpers.get_free_namespace_port( lib_constants.PROTO_NAME_TCP, dst_machine.namespace) # client sends to fip netcat = net_helpers.NetcatTester( src_machine.namespace, dst_machine.namespace, dst_fip, protocol_port, protocol=net_helpers.NetcatTester.TCP) self.addCleanup(netcat.stop_processes) self.assertTrue(netcat.test_connectivity()) def test_ping_floatingip_reply_with_floatingip(self): src_machine, _, dst_fip = ( self._setup_fip_with_fixed_ip_from_same_subnet(enable_snat=False)) # Verify that the ping replys with fip ns_ip_wrapper = ip_lib.IPWrapper(src_machine.namespace) result = ns_ip_wrapper.netns.execute( ['ping', '-c', 1, '-W', 5, dst_fip]) self._assert_ping_reply_from_expected_address(result, dst_fip) def _setup_address_scope(self, internal_address_scope1, internal_address_scope2, gw_address_scope=None): router_info = self.generate_router_info(enable_ha=False, num_internal_ports=2) address_scope1 = { str(lib_constants.IP_VERSION_4): internal_address_scope1} address_scope2 = { str(lib_constants.IP_VERSION_4): internal_address_scope2} if gw_address_scope: router_info['gw_port']['address_scopes'] = { str(lib_constants.IP_VERSION_4): gw_address_scope} router_info[lib_constants.INTERFACE_KEY][0]['address_scopes'] = ( address_scope1) router_info[lib_constants.INTERFACE_KEY][1]['address_scopes'] = ( address_scope2) router = self.manage_router(self.agent, router_info) router_ip_cidr1 = self._port_first_ip_cidr(router.internal_ports[0]) router_ip1 = router_ip_cidr1.partition('/')[0] router_ip_cidr2 = self._port_first_ip_cidr(router.internal_ports[1]) router_ip2 = router_ip_cidr2.partition('/')[0] br_int = framework.get_ovs_bridge( self.agent.conf.ovs_integration_bridge) test_machine1 = self.useFixture( machine_fixtures.FakeMachine( br_int, net_helpers.increment_ip_cidr(router_ip_cidr1), router_ip1)) test_machine2 = self.useFixture( machine_fixtures.FakeMachine( br_int, net_helpers.increment_ip_cidr(router_ip_cidr2), router_ip2)) return test_machine1, test_machine2, router def test_connection_from_same_address_scope(self): test_machine1, test_machine2, _ = self._setup_address_scope( 'scope1', 'scope1') # Internal networks that are in the same address scope can connected # each other net_helpers.assert_ping(test_machine1.namespace, test_machine2.ip) net_helpers.assert_ping(test_machine2.namespace, test_machine1.ip) def test_connection_from_diff_address_scope(self): test_machine1, test_machine2, _ = self._setup_address_scope( 'scope1', 'scope2') # Internal networks that are not in the same address scope should # not reach each other test_machine1.assert_no_ping(test_machine2.ip) test_machine2.assert_no_ping(test_machine1.ip) def test_fip_connection_for_address_scope(self): (machine_same_scope, machine_diff_scope, router) = self._setup_address_scope('scope1', 'scope2', 'scope1') router.router[lib_constants.FLOATINGIP_KEY] = [] fip_same_scope = '19.4.4.10' self._add_fip(router, fip_same_scope, fixed_address=machine_same_scope.ip, fixed_ip_address_scope='scope1') fip_diff_scope = '19.4.4.11' self._add_fip(router, fip_diff_scope, fixed_address=machine_diff_scope.ip, fixed_ip_address_scope='scope2') router.process() br_ex = framework.get_ovs_bridge( self.agent.conf.external_network_bridge) src_machine = self.useFixture( machine_fixtures.FakeMachine(br_ex, '19.4.4.12/24')) # Floating ip should work no matter of address scope net_helpers.assert_ping(src_machine.namespace, fip_same_scope) net_helpers.assert_ping(src_machine.namespace, fip_diff_scope) def test_direct_route_for_address_scope(self): (machine_same_scope, machine_diff_scope, router) = self._setup_address_scope('scope1', 'scope2', 'scope1') gw_port = router.get_ex_gw_port() gw_ip = self._port_first_ip_cidr(gw_port).partition('/')[0] br_ex = framework.get_ovs_bridge( self.agent.conf.external_network_bridge) src_machine = self.useFixture( machine_fixtures.FakeMachine(br_ex, '19.4.4.12/24', gw_ip)) # For the internal networks that are in the same address scope as # external network, they can directly route to external network net_helpers.assert_ping(src_machine.namespace, machine_same_scope.ip) # For the internal networks that are not in the same address scope as # external networks. SNAT will be used. Direct route will not work # here. src_machine.assert_no_ping(machine_diff_scope.ip) def test_connection_from_diff_address_scope_with_fip(self): (machine_same_scope, machine_diff_scope, router) = self._setup_address_scope('scope1', 'scope2', 'scope1') router.router[lib_constants.FLOATINGIP_KEY] = [] fip = '19.4.4.11' self._add_fip(router, fip, fixed_address=machine_diff_scope.ip, fixed_ip_address_scope='scope2') router.process() # For the internal networks that are in the same address scope as # external network, they should be able to reach the floating ip net_helpers.assert_ping(machine_same_scope.namespace, fip) # For the port with fip, it should be able to reach the internal # networks that are in the same address scope as external network net_helpers.assert_ping(machine_diff_scope.namespace, machine_same_scope.ip)
5ae87f822d3e84a9ad09251271d260615c2fb3e0
913674143b4cbc8df4b93975169758c17e4d7972
/MyScrapyTencent/MyScrapyTencent/pipelines.py
58a79ba46c011cefb115bb334ef40f9692f9d9c6
[]
no_license
HeywoodKing/Scrapy-Examples
e8dca55767537609d5a6e5ba426c58dbb4669610
e6e5415cc42c234c25ce43ad0c4227364798af3c
refs/heads/master
2020-05-16T12:51:25.206950
2019-04-26T12:25:34
2019-04-26T12:25:34
183,056,875
2
2
null
null
null
null
UTF-8
Python
false
false
612
py
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import json class MyscrapytencentPipeline(object): """ 功能:保存item数据 """ def __init__(self): self.filename = open("tencent.json", "wb") def process_item(self, item, spider): text = json.dumps(dict(item), ensure_ascii=False) + ",\n" self.filename.write(text.encode("utf-8")) return item def close_spider(self, spider): self.filename.close()
6da511645e7a197feda5f07313d5b595c8da81ab
bb726031eb8ab8e690786a766b679f0666695c10
/urlhunter/blueprints/main.py
d01b118d39775b17480b5a7e51a603c41b8cc29b
[]
no_license
nsdown/urlhunter
01fd9348fc36b2e7f6cebb3488ea5fb021e54fef
1181d89d2f8c731e9693ec14a2fc4beee5b85d71
refs/heads/master
2020-04-13T01:18:56.216614
2018-12-23T04:17:52
2018-12-23T04:17:52
null
0
0
null
null
null
null
UTF-8
Python
false
false
6,085
py
import requests from more_itertools import flatten from flask import Blueprint, render_template, flash, redirect, url_for, request, current_app, Markup from flask_login import login_required, current_user from urlhunter.forms import URLForm, RegexForm from urlhunter.utils import links from urlhunter.models import Url, Regex from urlhunter.extensions import db bp = Blueprint('main', __name__) @bp.route('/') def index(): return render_template('main/index.html') @bp.route('/extract', methods=['GET', 'POST']) @login_required def extract(): form = URLForm() extracted_urls = None if form.validate_on_submit(): try: if Url.query.count() > current_app.config['URL_LIMIT']: raise Exception(f"URL超限了!请先清空![{Url.query.count()}/{current_app.config['URL_LIMIT']}]") urls = form.urls.data.split('\n') headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' } responses = [ requests.get(url.strip(), headers=headers) for url in urls ] if form.search.data: if form.use_regex.data is True: extracted_urls = [ links(resp, pattern=form.search.data) for resp in responses ] else: extracted_urls = [ links(resp, search=form.search.data) for resp in responses ] else: extracted_urls = [links(resp) for resp in responses] extracted_urls = list(flatten(extracted_urls)) if len(extracted_urls) == 0: raise Exception('啊嘞?啥都没捕捉到哦U_U') except Exception as e: flash(e, 'danger') else: flash( Markup( f"成功捕获到{len(extracted_urls)}条url XD <a href={url_for('main.show_urls')}>立即查看</a>" ), 'success') for extracted_url in extracted_urls: if not Url.query.filter_by(body=extracted_url).first(): url = Url( body=extracted_url, owner=current_user._get_current_object()) db.session.add(url) db.session.commit() return redirect(url_for('main.extract')) form.urls.data = request.args.get('urls') form.search.data = request.args.get('search') form.use_regex.data = bool(request.args.get('use_regex')) return render_template( 'main/extract.html', form=form, extracted_urls=extracted_urls) @bp.route('/urls') @login_required def show_urls(): page = request.args.get('page', 1, type=int) per_page = current_app.config['URL_PER_PAGE'] current_user_urls = Url.query.with_parent(current_user) pagination = current_user_urls.order_by( Url.timestamp.desc()).paginate(page, per_page) urls = pagination.items outputs = '\n'.join([url.body for url in current_user_urls.all()]) exclude_strings = request.args.get('exclude') if exclude_strings: urls, outputs = exclude_urls(exclude_strings, urls, current_user_urls) return render_template('main/urls.html', urls=urls, pagination=pagination, outputs=outputs) @bp.route('/urls/delete/all', methods=['POST']) @login_required def delete_urls(): urls = Url.query.with_parent(current_user._get_current_object()).all() db.session.execute('delete from url') db.session.commit() flash('操作成功!', 'success') return redirect(url_for('main.show_urls')) @bp.route('/urls/search') @login_required def search_urls(): q = request.args.get('q', '') if q == '': flash('请输入要搜索的URL', 'warning') return redirect(url_for('main.show_urls')) page = request.args.get('page', 1, type=int) per_page = current_app.config['SEARCH_PER_PAGE'] searched_urls = Url.query.with_parent(current_user).filter(Url.body.ilike(f'%{q}%')) pagination = searched_urls.paginate(page, per_page) results = pagination.items outputs = '\n'.join([url.body for url in searched_urls.all()]) exclude_strings = request.args.get('exclude') if exclude_strings: results, outputs = exclude_urls(exclude_strings, results, searched_urls) return render_template('main/search.html', pagination=pagination, results=results, q=q, outputs=outputs) @bp.route('/regexs') @login_required def show_regexs(): page = request.args.get('page', 1, type=int) per_page = current_app.config['REGEX_PER_PAGE'] pagination = Regex.query.with_parent(current_user).paginate(page, per_page) regexs = pagination.items return render_template('main/regexs.html', regexs=regexs, pagination=pagination) @bp.route('/regexs/upload', methods=['GET', 'POST']) @login_required def upload_regex(): form = RegexForm() if form.validate_on_submit(): name = form.name.data site = form.site.data body = form.body.data regex = Regex(name=name, site=site, body=body, author=current_user._get_current_object()) db.session.add(regex) db.session.commit() flash('添加成功!', 'success') return redirect(url_for('main.show_regexs')) return render_template('main/upload.html', form=form) @bp.route('/help') def show_help(): return render_template('main/help.html') @bp.app_template_global() def exclude_urls(exclude_strings, paginated_urls, all_urls): exclude_strings = exclude_strings.split(',') excluded_paginated_urls = [url for url in paginated_urls if not any(es in url.body for es in exclude_strings)] excluded_all_urls = [url for url in all_urls.all() if not any(es in url.body for es in exclude_strings)] excluded_outputs = '\n'.join([url.body for url in excluded_all_urls]) return excluded_paginated_urls, excluded_outputs
74a43811de7ca3ae9cbfc985a1b448131b33fde9
fe4f2aeb889f939ea6caf4a34371a3558064abcd
/vlmap_memft/model_vlmap_wordset_only_withatt.py
55a10294930c0cb98ffa90ac98ff4e0ca9d52a50
[ "MIT" ]
permissive
HyeonwooNoh/VQA-Transfer-ExternalData
cf9c1b82dd55389dfe5f52d8fd196780dd3d4629
d21b700bcdc3ba3c392ff793b3f5efe23eb68ed6
refs/heads/master
2021-10-25T22:58:00.318492
2019-04-08T04:52:46
2019-04-08T04:52:46
122,662,354
21
3
null
null
null
null
UTF-8
Python
false
false
28,746
py
import cPickle import os import tensorflow as tf from vlmap import modules TOP_K = 5 W_DIM = 300 # Word dimension L_DIM = 1024 # Language dimension V_DIM = 1024 class Model(object): def __init__(self, batch, config, is_train=True): self.batch = batch self.config = config self.data_cfg = config.data_cfg self.data_dir = config.data_dir self.is_train = is_train self.losses = {} self.report = {} self.mid_result = {} self.vis_image = {} vocab_path = os.path.join(self.data_dir, 'vocab.pkl') self.vocab = cPickle.load(open(vocab_path, 'rb')) answer_dict_path = os.path.join(self.data_dir, 'answer_dict.pkl') self.answer_dict = cPickle.load(open(answer_dict_path, 'rb')) self.num_answer = len(self.answer_dict['vocab']) ws_dict_path = os.path.join(self.data_dir, 'wordset_dict5.pkl') self.ws_dict = cPickle.load(open(ws_dict_path, 'rb')) self.num_ws = len(self.ws_dict['vocab']) self.wordset_map = modules.learn_embedding_map( self.ws_dict, scope='wordset_map') self.v_word_map = modules.LearnGloVe(self.vocab, scope='V_GloVe') self.l_word_map = modules.LearnGloVe(self.vocab, scope='L_GloVe') self.l_answer_word_map = modules.LearnAnswerGloVe(self.answer_dict) self.build() def filter_train_vars(self, trainable_vars): train_vars = [] for var in trainable_vars: if var.name.split('/')[0] == 'LearnAnswerGloVe': train_vars.append(var) else: train_vars.append(var) return train_vars def build(self): """ build network architecture and loss """ self.mid_result['v_linear_v'] = modules.fc_layer( self.batch['image_ft'], V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='v_linear_v') self.build_object_attention() self.build_attribute_attention() self.build_object_wordset() self.build_attribute_wordset() self.build_caption_attention() self.loss = 0 for loss in self.losses.values(): self.loss = self.loss + loss self.report['total_loss'] = self.loss # scalar summary for key, val in self.report.items(): tf.summary.scalar('train/{}'.format(key), val, collections=['heavy_train', 'train']) tf.summary.scalar('val/{}'.format(key), val, collections=['heavy_val', 'val']) # image summary for key, val in self.vis_image.items(): tf.summary.image('train-{}'.format(key), val, max_outputs=10, collections=['heavy_train']) tf.summary.image('val-{}'.format(key), val, max_outputs=10, collections=['heavy_val']) return self.loss def build_object_predict(self): """ object_predict """ # [#obj, #proposal] x [#proposal x feat_dim] -> [#obj,feat_dim] V_ft = tf.matmul(self.batch['obj_pred/weights'], self.batch['image_ft']) v_linear_l = modules.fc_layer( V_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='pooled_linear_l') dummy_l = tf.zeros_like(self.batch['obj_pred/labels'], dtype=tf.float32) dummy_l = tf.tile(tf.expand_dims(dummy_l, axis=-1), [1, 1, L_DIM]) l_linear_l = modules.fc_layer( dummy_l, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_l') joint = modules.fc_layer( v_linear_l * l_linear_l, L_DIM * 2, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='joint_fc') joint = tf.nn.dropout(joint, 0.5) logit = modules.fc_layer( joint, self.num_answer, use_bias=True, use_bn=False, use_ln=False, activation_fn=None, is_training=self.is_train, scope='classifier') self.mid_result['obj_pred/logit'] = logit # [bs, #obj, #answer] with tf.name_scope('loss/object_predict'): onehot_gt = tf.one_hot(self.batch['obj_pred/labels'], depth=self.num_answer) num_valid_entry = self.batch['obj_pred/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_obj_pred, dtype=tf.float32) loss, acc, top_k_acc = \ self.n_way_classification_loss(logit, onehot_gt, valid_mask) self.losses['object_pred'] = loss self.report['object_pred_loss'] = loss self.report['object_pred_acc'] = acc self.report['object_pred_top_{}_acc'.format(TOP_K)] = top_k_acc def build_attribute_predict(self): """ attribute_predict """ # [#attr, #proposal] x [#proposal x feat_dim] -> [#attr,feat_dim] V_ft = tf.matmul(self.batch['attr_pred/weights'], self.batch['image_ft']) v_linear_l = modules.fc_layer( V_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='pooled_linear_l') L_ft = tf.nn.embedding_lookup(self.l_answer_word_map, self.batch['attr_pred/object_labels']) reg_l_ft = modules.fc_layer( L_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.tanh, is_training=self.is_train, scope='attr_pred/encode_object_labels') self.mid_result['attr_pred/reg_l_ft'] = reg_l_ft l_linear_l = modules.fc_layer( reg_l_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_l') joint = modules.fc_layer( v_linear_l * l_linear_l, L_DIM * 2, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='joint_fc') joint = tf.nn.dropout(joint, 0.5) logit = modules.fc_layer( joint, self.num_answer, use_bias=True, use_bn=False, use_ln=False, activation_fn=None, is_training=self.is_train, scope='classifier') self.mid_result['attr_pred/logit'] = logit # [bs, #attr, #answer] with tf.name_scope('loss/attr_predict'): multilabel_gt = self.batch['attr_pred/labels'] num_valid_entry = self.batch['attr_pred/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_attr_pred, dtype=tf.float32) loss, acc, recall, precision, top_1_prec, top_k_recall = \ self.binary_classification_loss(logit, multilabel_gt, valid_mask, depth=self.num_answer) self.losses['attr_pred'] = loss self.report['attr_pred_loss'] = loss self.report['attr_pred_acc'] = acc self.report['attr_pred_recall'] = recall self.report['attr_pred_precision'] = precision self.report['attr_pred_top_1_prec'] = top_1_prec self.report['attr_pred_top_{}_recall'.format(TOP_K)] = top_k_recall def build_object_attention(self): """ object_attention """ num_V_ft = self.batch['num_boxes'] v_linear_v = self.mid_result['v_linear_v'] w_embed = tf.nn.embedding_lookup(self.v_word_map, self.batch['obj_att/word_tokens']) w_L_ft = modules.fc_layer( # [bs, #proposal, len, L_DIM] w_embed, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='v_word_fc') w_len = self.batch['obj_att/word_tokens_len'] mask = tf.sequence_mask( # [bs, #proposal, len] w_len, maxlen=tf.shape(w_L_ft)[-2], dtype=tf.float32) pooled_w_L_ft = tf.reduce_sum(w_L_ft * tf.expand_dims(mask, axis=-1), axis=-2) pooled_w_L_ft = pooled_w_L_ft / \ tf.expand_dims(tf.to_float(w_len), axis=-1) l_linear_v = modules.fc_layer( pooled_w_L_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_v') tile_v_linear_v = tf.tile(tf.expand_dims(v_linear_v, axis=1), [1, self.data_cfg.n_obj_att, 1, 1]) flat_tile_v_linear_v = tf.reshape(tile_v_linear_v, [-1, self.data_cfg.max_box_num, V_DIM]) tile_num_V_ft = tf.tile(tf.expand_dims(num_V_ft, axis=1), [1, self.data_cfg.n_obj_att]) flat_tile_num_V_ft = tf.reshape(tile_num_V_ft, [-1]) flat_l_linear_v = tf.reshape(l_linear_v, [-1, V_DIM]) # flat_att_logit: [bs * #obj, num_proposal] flat_att_logit = modules.hadamard_attention( flat_tile_v_linear_v, flat_tile_num_V_ft, flat_l_linear_v, use_ln=False, is_train=self.is_train, normalizer=None) n_entry = self.data_cfg.n_obj_att n_proposal = self.data_cfg.max_box_num logit = tf.reshape(flat_att_logit, [-1, n_entry, n_proposal]) with tf.name_scope('loss/object_attend'): multilabel_gt = tf.to_float( tf.greater(self.batch['obj_att/att_scores'], 0.5)) num_valid_entry = self.batch['obj_att/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_obj_att, dtype=tf.float32) loss, acc, recall, precision, top_1_prec, top_k_recall = \ self.binary_classification_loss(logit, multilabel_gt, valid_mask, depth=self.data_cfg.max_box_num) self.losses['object_att'] = loss self.report['object_att_loss'] = loss self.report['object_att_acc'] = acc self.report['object_att_recall'] = recall self.report['object_att_precision'] = precision self.report['object_att_top_1_prec'] = top_1_prec self.report['object_att_top_{}_recall'.format(TOP_K)] = top_k_recall def build_attribute_attention(self): """ attribute_attention """ num_V_ft = self.batch['num_boxes'] v_linear_v = self.mid_result['v_linear_v'] w_embed = tf.nn.embedding_lookup(self.v_word_map, self.batch['attr_att/word_tokens']) w_L_ft = modules.fc_layer( w_embed, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='v_word_fc') w_len = self.batch['attr_att/word_tokens_len'] mask = tf.sequence_mask( # [bs, #proposal, len] w_len, maxlen=tf.shape(w_L_ft)[-2], dtype=tf.float32) pooled_w_L_ft = tf.reduce_sum(w_L_ft * tf.expand_dims(mask, axis=-1), axis=-2) pooled_w_L_ft = pooled_w_L_ft / \ tf.expand_dims(tf.to_float(w_len), axis=-1) l_linear_v = modules.fc_layer( pooled_w_L_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_v') tile_v_linear_v = tf.tile(tf.expand_dims(v_linear_v, axis=1), [1, self.data_cfg.n_attr_att, 1, 1]) flat_tile_v_linear_v = tf.reshape(tile_v_linear_v, [-1, self.data_cfg.max_box_num, V_DIM]) tile_num_V_ft = tf.tile(tf.expand_dims(num_V_ft, axis=1), [1, self.data_cfg.n_attr_att]) flat_tile_num_V_ft = tf.reshape(tile_num_V_ft, [-1]) flat_l_linear_v = tf.reshape(l_linear_v, [-1, V_DIM]) # flat_att_logit: [bs * #attr, num_proposal] flat_att_logit = modules.hadamard_attention( flat_tile_v_linear_v, flat_tile_num_V_ft, flat_l_linear_v, use_ln=False, is_train=self.is_train, normalizer=None) n_entry = self.data_cfg.n_attr_att n_proposal = self.data_cfg.max_box_num logit = tf.reshape(flat_att_logit, [-1, n_entry, n_proposal]) with tf.name_scope('loss/attr_attend'): multilabel_gt = tf.to_float( tf.greater(self.batch['attr_att/att_scores'], 0.5)) num_valid_entry = self.batch['attr_att/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_attr_att, dtype=tf.float32) loss, acc, recall, precision, top_1_prec, top_k_recall = \ self.binary_classification_loss(logit, multilabel_gt, valid_mask, depth=self.data_cfg.max_box_num) self.losses['attr_att'] = loss self.report['attr_att_loss'] = loss self.report['attr_att_acc'] = acc self.report['attr_att_recall'] = recall self.report['attr_att_precision'] = precision self.report['attr_att_top_1_prec'] = top_1_prec self.report['attr_att_top_{}_recall'.format(TOP_K)] = top_k_recall def build_object_wordset(self): """ object_wordset """ V_ft = self.batch['image_ft'] # [bs, #proposal, #feat_dim] V_ft = tf.expand_dims(V_ft, axis=1) # [bs, 1, #proposal, #feat_dim] V_ft = tf.tile(V_ft, [1, self.data_cfg.n_obj_bf, 1, 1]) # [bs, #obj, #proposal, #feat_dim] V_ft = tf.reshape( V_ft, [-1, self.data_cfg.max_box_num, self.data_cfg.vfeat_dim]) # [bs * #obj, #proposal, #feat_dim] num_V_ft = self.batch['num_boxes'] # [bs] num_V_ft = tf.expand_dims(num_V_ft, axis=1) # [bs, 1] num_V_ft = tf.tile(num_V_ft, [1, self.data_cfg.n_obj_bf]) # [bs, #obj] num_V_ft = tf.reshape(num_V_ft, [-1]) # [bs * #obj] v_linear_v = modules.fc_layer( # [bs * #obj, #proposal, V_DIM] V_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='wordset_v_linear_v') wordset_embed = tf.tanh(tf.nn.embedding_lookup( # [bs, #obj, W_DIM] self.wordset_map, self.batch['obj_blank_fill/wordsets'])) wordset_ft = modules.fc_layer( # [bs, #obj, L_DIM] wordset_embed, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.tanh, is_training=self.is_train, scope='wordset_ft') q_linear_v = modules.fc_layer( # [bs, #obj, V_DIM] wordset_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='wordset_q_linear_v') flat_q_linear_v = tf.reshape(q_linear_v, [-1, V_DIM]) # [bs * #obj, V_DIM] att_score = modules.hadamard_attention( # [bs * #obj, len] v_linear_v, num_V_ft, flat_q_linear_v, use_ln=False, is_train=self.is_train, scope='wordset_att') flat_pooled_V_ft = modules.attention_pooling(V_ft, att_score) # [bs * #obj, vfeat_dim] pooled_V_ft = tf.reshape( flat_pooled_V_ft, [-1, self.data_cfg.n_obj_bf, self.data_cfg.vfeat_dim]) v_linear_l = modules.fc_layer( pooled_V_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='pooled_linear_l') l_linear_l = modules.fc_layer( wordset_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_l') joint = modules.fc_layer( v_linear_l * l_linear_l, L_DIM * 2, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='joint_fc') joint = tf.nn.dropout(joint, 0.5) logit = modules.fc_layer( joint, self.num_answer, use_bias=True, use_bn=False, use_ln=False, activation_fn=None, is_training=self.is_train, scope='classifier') self.mid_result['obj_blank_fill/logit'] = logit # [bs, #obj, #answer] with tf.name_scope('loss/obj_wordset'): onehot_gt = tf.one_hot(self.batch['obj_blank_fill/fills'], depth=self.num_answer) num_valid_entry = self.batch['obj_blank_fill/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_obj_bf, dtype=tf.float32) loss, acc, top_k_acc = \ self.n_way_classification_loss(logit, onehot_gt, valid_mask) self.losses['obj_wordset'] = loss self.report['obj_wordset_loss'] = loss self.report['obj_wordset_acc'] = acc self.report['obj_wordset_top_{}_acc'.format(TOP_K)] = top_k_acc def build_attribute_wordset(self): """ attribute_wordset """ V_ft = self.batch['image_ft'] # [bs, #proposal, #feat_dim] V_ft = tf.expand_dims(V_ft, axis=1) # [bs, 1, #proposal, #feat_dim] V_ft = tf.tile(V_ft, [1, self.data_cfg.n_attr_bf, 1, 1]) # [bs, #attr, #proposal, #feat_dim] V_ft = tf.reshape( V_ft, [-1, self.data_cfg.max_box_num, self.data_cfg.vfeat_dim]) # [bs * #attr, #proposal, #feat_dim] num_V_ft = self.batch['num_boxes'] # [bs] num_V_ft = tf.expand_dims(num_V_ft, axis=1) # [bs, 1] num_V_ft = tf.tile(num_V_ft, [1, self.data_cfg.n_attr_bf]) # [bs, #attr] num_V_ft = tf.reshape(num_V_ft, [-1]) # [bs * #attr] v_linear_v = modules.fc_layer( # [bs * #attr, #proposal, V_DIM] V_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='wordset_v_linear_v') wordset_embed = tf.tanh(tf.nn.embedding_lookup( self.wordset_map, self.batch['attr_blank_fill/wordsets'])) wordset_ft = modules.fc_layer( wordset_embed, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.tanh, is_training=self.is_train, scope='wordset_ft') q_linear_v = modules.fc_layer( # [bs, #attr, V_DIM] wordset_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='wordset_q_linear_v') flat_q_linear_v = tf.reshape(q_linear_v, [-1, V_DIM]) # [bs * #attr, V_DIM] att_score = modules.hadamard_attention( # [bs * #attr, len] v_linear_v, num_V_ft, flat_q_linear_v, use_ln=False, is_train=self.is_train, scope='wordset_att') flat_pooled_V_ft = modules.attention_pooling(V_ft, att_score) # [bs * #attr, V_DIM] pooled_V_ft = tf.reshape( flat_pooled_V_ft, [-1, self.data_cfg.n_attr_bf, self.data_cfg.vfeat_dim]) v_linear_l = modules.fc_layer( pooled_V_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='pooled_linear_l') l_linear_l = modules.fc_layer( wordset_ft, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_l') joint = modules.fc_layer( v_linear_l * l_linear_l, L_DIM * 2, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='joint_fc') joint = tf.nn.dropout(joint, 0.5) logit = modules.fc_layer( joint, self.num_answer, use_bias=True, use_bn=False, use_ln=False, activation_fn=None, is_training=self.is_train, scope='classifier') self.mid_result['attr_blank_fill/logit'] = logit # [bs, #attr, #answer] with tf.name_scope('loss/attr_wordset'): onehot_gt = tf.one_hot(self.batch['attr_blank_fill/fills'], depth=self.num_answer) num_valid_entry = self.batch['attr_blank_fill/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_attr_bf, dtype=tf.float32) loss, acc, top_k_acc = \ self.n_way_classification_loss(logit, onehot_gt, valid_mask) self.losses['attr_wordset'] = loss self.report['attr_wordset_loss'] = loss self.report['attr_wordset_acc'] = acc self.report['attr_wordset_top_{}_acc'.format(TOP_K)] = top_k_acc def build_caption_attention(self): """ caption_attention """ num_V_ft = self.batch['num_boxes'] v_linear_v = self.mid_result['v_linear_v'] w_embed = tf.nn.embedding_lookup(self.v_word_map, self.batch['cap_att/word_tokens']) w_L_ft = modules.fc_layer( # [bs, #proposal, len, L_DIM] w_embed, L_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='v_word_fc') w_len = self.batch['cap_att/word_tokens_len'] mask = tf.sequence_mask( # [bs, #proposal, len] w_len, maxlen=tf.shape(w_L_ft)[-2], dtype=tf.float32) pooled_w_L_ft = tf.reduce_sum(w_L_ft * tf.expand_dims(mask, axis=-1), axis=-2) pooled_w_L_ft = pooled_w_L_ft / \ tf.expand_dims(tf.to_float(w_len), axis=-1) l_linear_v = modules.fc_layer( pooled_w_L_ft, V_DIM, use_bias=True, use_bn=False, use_ln=True, activation_fn=tf.nn.relu, is_training=self.is_train, scope='q_linear_v') tile_v_linear_v = tf.tile(tf.expand_dims(v_linear_v, axis=1), [1, self.data_cfg.n_cap_att, 1, 1]) flat_tile_v_linear_v = tf.reshape(tile_v_linear_v, [-1, self.data_cfg.max_box_num, V_DIM]) tile_num_V_ft = tf.tile(tf.expand_dims(num_V_ft, axis=1), [1, self.data_cfg.n_cap_att]) flat_tile_num_V_ft = tf.reshape(tile_num_V_ft, [-1]) flat_l_linear_v = tf.reshape(l_linear_v, [-1, V_DIM]) # flat_att_logit: [bs * #obj, num_proposal] flat_att_logit = modules.hadamard_attention( flat_tile_v_linear_v, flat_tile_num_V_ft, flat_l_linear_v, use_ln=False, is_train=self.is_train, normalizer=None) n_entry = self.data_cfg.n_cap_att n_proposal = self.data_cfg.max_box_num logit = tf.reshape(flat_att_logit, [-1, n_entry, n_proposal]) with tf.name_scope('loss/caption_attend'): multilabel_gt = tf.to_float( tf.greater(self.batch['cap_att/att_scores'], 0.5)) num_valid_entry = self.batch['cap_att/num'] valid_mask = tf.sequence_mask( num_valid_entry, maxlen=self.data_cfg.n_cap_att, dtype=tf.float32) loss, acc, recall, precision, top_1_prec, top_k_recall = \ self.binary_classification_loss(logit, multilabel_gt, valid_mask, depth=self.data_cfg.max_box_num) self.losses['caption_att'] = loss self.report['caption_att_loss'] = loss self.report['caption_att_acc'] = acc self.report['caption_att_recall'] = recall self.report['caption_att_precision'] = precision self.report['caption_att_top_1_prec'] = top_1_prec self.report['caption_att_top_{}_recall'.format(TOP_K)] = top_k_recall def n_way_classification_loss(self, logits, labels, mask=None): # Loss cross_entropy = tf.nn.softmax_cross_entropy_with_logits_v2( labels=labels, logits=logits, dim=-1) if mask is None: loss = tf.reduce_mean(cross_entropy) else: loss = tf.reduce_sum(cross_entropy * mask) / tf.reduce_sum(mask) # Top-1 Accuracy label_token = tf.cast(tf.argmax(labels, axis=-1), tf.int32) logit_token = tf.cast(tf.argmax(logits, axis=-1), tf.int32) correct = tf.to_float(tf.equal(label_token, logit_token)) if mask is None: acc = tf.reduce_mean(correct) else: acc = tf.reduce_sum(correct * mask) / tf.reduce_sum(mask) # Top-K Accuracy _, top_k_pred = tf.nn.top_k(logits, k=TOP_K) k_label_token = tf.tile( tf.expand_dims(label_token, axis=-1), [1, 1, TOP_K]) top_k_correct = tf.to_float(tf.reduce_any( tf.equal(k_label_token, top_k_pred), axis=-1)) if mask is None: top_k_acc = tf.reduce_mean(top_k_correct) else: top_k_acc = tf.reduce_sum(top_k_correct * mask) / tf.reduce_sum(mask) return loss, acc, top_k_acc def binary_classification_loss(self, logits, labels, mask=None, depth=None): # Loss cross_entropy = tf.nn.sigmoid_cross_entropy_with_logits( labels=labels, logits=logits) cross_entropy = tf.reduce_sum(cross_entropy, axis=-1) # sum over dim if mask is None: loss = tf.reduce_mean(cross_entropy) else: loss = tf.reduce_sum(cross_entropy * mask) / tf.reduce_sum(mask) if depth is not None: pred = tf.cast(tf.argmax(logits, axis=-1), tf.int32) onehot_pred = tf.one_hot(pred, depth=depth, dtype=tf.float32) top_1_prec = tf.reduce_sum(onehot_pred * labels, axis=-1) if mask is None: top_1_prec = tf.reduce_mean(top_1_prec) else: top_1_prec = tf.reduce_sum(top_1_prec * mask) / \ tf.reduce_sum(mask) _, top_k_pred = tf.nn.top_k(logits, k=TOP_K) # [bs, n, TOP_K] onehot_top_k_pred = tf.one_hot( # [bs, n, TOP_K, depth] top_k_pred, depth=depth, dtype=tf.float32) top_k_hot_pred = tf.reduce_sum( onehot_top_k_pred, axis=2) # [bs, n, depth] n-hot vector num_correct_1 = tf.reduce_sum(top_k_hot_pred * labels, axis=-1) num_label_1 = tf.minimum( tf.reduce_sum(labels, axis=-1), TOP_K) top_k_recall = num_correct_1 / num_label_1 if mask is None: top_k_recall = tf.reduce_mean(top_k_recall) else: top_k_recall = tf.reduce_sum(top_k_recall * mask) / \ tf.reduce_sum(mask) binary_pred = tf.cast(tf.greater(logits, 0), tf.int32) binary_label = tf.cast(labels, tf.int32) tp = tf.to_float(tf.logical_and(tf.equal(binary_pred, 1), tf.equal(binary_label, 1))) fp = tf.to_float(tf.logical_and(tf.equal(binary_pred, 1), tf.equal(binary_label, 0))) tn = tf.to_float(tf.logical_and(tf.equal(binary_pred, 0), tf.equal(binary_label, 0))) fn = tf.to_float(tf.logical_and(tf.equal(binary_pred, 0), tf.equal(binary_label, 1))) if mask is not None: expand_mask = tf.expand_dims(mask, axis=-1) tp = tp * expand_mask fp = fp * expand_mask tn = tn * expand_mask fn = fn * expand_mask n_tp = tf.reduce_sum(tp) # true positive n_fp = tf.reduce_sum(fp) # false positive n_tn = tf.reduce_sum(tn) # true negative n_fn = tf.reduce_sum(fn) # false negative acc = (n_tp + n_tn) / (n_tp + n_fp + n_tn + n_fn + 1e-12) recall = (n_tp) / (n_tp + n_fn + 1e-12) precision = (n_tp) / (n_tp + n_fp + 1e-12) ret = [loss, acc, recall, precision] if depth is not None: ret.extend([top_1_prec, top_k_recall]) return tuple(ret)
b93b4f5be48c893c85210950d92f8401699b04e8
3e7acb0962da48f29875d581c424ebbd3a98437c
/test/test_timeslotpage.py
cff39a4c93196a3844ea72a47ba486249dc72d75
[]
no_license
crazypoo/geniusbar-reserver
ae02373bfaf24c5fdcd230c747c162ef259c2396
b5d1981b59d998d8f110c87e8c5aa7ebe067f96c
refs/heads/master
2021-01-21T08:14:52.607615
2014-12-13T05:41:14
2014-12-13T05:41:14
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,289
py
import sys if '../' not in sys.path: sys.path.append('../') from sites.apple_main import AppleGeniusBarReservation from sites.apple_genius_bar.store_page import GeniusbarPage import sys reload(sys) import os sys.setdefaultencoding('utf-8') cwd = os.path.abspath(os.getcwd()) # sites sys.path.append(os.path.join(cwd, '../gui')) sys.path.append(os.path.join(cwd, '../proxy')) sys.path.append(os.path.join(cwd, '../sites')) sys.path.append(os.path.join(cwd, '../utils')) def test_timeslotpage(): appleGeniusBarReservation = AppleGeniusBarReservation({}) page = GeniusbarPage('') f = open('timeslots.htm', 'r') data = f.read() f.close() data = data.encode('utf-8', 'ignore') ret, maxrow = appleGeniusBarReservation.buildTimeSlotsTable(page, data) return ret, maxrow #test_timeslotpage() # -*- coding: utf-8 -*- import sys import os from PyQt4 import QtGui from gui.uidesigner.taskviewwidget import TaskViewWidget def doubleclicked(timestr): print(timestr) def main(proxyServers=None): data, maxrow = test_timeslotpage() app = QtGui.QApplication(sys.argv) main = TaskViewWidget() main.fillTableWidget(data, maxrow) main.sigTimeSlot.connect(doubleclicked) main.show() app.exec_() if __name__ == "__main__": main()
dda50d0d9bf5a626f3b2921adbcb876a38c06129
2bdedcda705f6dcf45a1e9a090377f892bcb58bb
/src/main/output/temp_man/lombok_database_family/idea_family/game_head.py
8f2901d0914575e6572ca848757d9392e89f1bf6
[]
no_license
matkosoric/GenericNameTesting
860a22af1098dda9ea9e24a1fc681bb728aa2d69
03f4a38229c28bc6d83258e5a84fce4b189d5f00
refs/heads/master
2021-01-08T22:35:20.022350
2020-02-21T11:28:21
2020-02-21T11:28:21
242,123,053
1
0
null
null
null
null
UTF-8
Python
false
false
2,092
py
using System; using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.Translator.API; namespace CSharp_TranslateSample { public class Program { private const string SubscriptionKey = "774041bc63961f2d2f59c34b29325acd"; //Enter here the Key from your Microsoft Translator Text subscription on http://portal.azure.com public static string traducida; public static void Main(string[] args) { //TranslateAsync().Wait(); //Console.ReadKey(); } public static void iniciar() { TranslateAsync().Wait(); Console.ReadKey(); } /// Demonstrates getting an access token and using the token to translate. private static async Task TranslateAsync() { var translatorService = new TranslatorService.LanguageServiceClient(); var authTokenSource = new AzureAuthToken(SubscriptionKey); var token = string.Empty; try { token = await authTokenSource.GetAccessTokenAsync(); } catch (HttpRequestException) { switch (authTokenSource.RequestStatusCode) { case HttpStatusCode.Unauthorized: Console.WriteLine("Request to token service is not authorized (401). Check that the Azure subscription key is valid."); break; case HttpStatusCode.Forbidden: Console.WriteLine("Request to token service is not authorized (403). For accounts in the free-tier, check that the account quota is not exceeded."); break; } throw; } traducida = translatorService.Translate(token, "Hello World", "en", "fr", "text/plain", "general", string.Empty); //Console.WriteLine("Translated to French: {0}", translatorService.Translate(token, "Hello World", "en", "fr", "text/plain", "general", string.Empty)); } } }
656c9f58562a43a8ffa99171fc48c4ef5fad535a
de24f83a5e3768a2638ebcf13cbe717e75740168
/moodledata/vpl_data/177/usersdata/271/100509/submittedfiles/pico.py
392e7558a7b348a1605eca85241f40ce1d490a13
[]
no_license
rafaelperazzo/programacao-web
95643423a35c44613b0f64bed05bd34780fe2436
170dd5440afb9ee68a973f3de13a99aa4c735d79
refs/heads/master
2021-01-12T14:06:25.773146
2017-12-22T16:05:45
2017-12-22T16:05:45
69,566,344
0
0
null
null
null
null
UTF-8
Python
false
false
1,668
py
# -*- coding: utf-8 -*- #FUNÇÕES def crescente(lista) : if len(lista)==1 : return(False) cont = 0 for i in range(0,len(lista),1) : if (i==0) : if(lista[i]<lista[i+1]) : cont = cont+1 elif (i==len(lista)-1) : if lista[len(lista-2)] < lista[len(lista)-1] : cont = cont+1 else : if lista[i]<lista[i+1] : cont = cont+1 if cont == len(lista) : return(True) else : return(False) def decrescente(lista) : if len(lista)==1 : return(False) cont = 0 for i in range(0,len(lista),1) : if (i==0) : if(lista[i]>lista[i+1]) : cont = cont+1 elif (i==len(lista)-1) : if lista[len(lista-2)] > lista[len(lista)-1] : cont = cont+1 else : if lista[i]>lista[i+1] : cont = cont+1 if cont == len(lista) : return(True) else : return(False) def pico(lista): maior = max(lista) imaior = lista.index(maior) an = [] de = [] for i in range(0,imaior+1,1): elemento_an = lista[i] an.append (elemento_an) for i in range (maior+1,len(lista),1) : elemento_de = lista[i] de.append(elemento_de) if crescente (an) and decrescente(de) : return(True) else : return(False) #ENTRADA n = input('Digite a quantidade de elementos da lista: ') a = [] for i in range(0,n,1) : valor_a = float(input('Digite o elemento da lista a : ')) a.append(valor_a) if pico(a) : print('S') else : print('N')
567deda66b4abddd9fbccea623c2fb3c285bc502
21dd7d56c370ea9a02b66654525fd96a398a9e49
/apps/userprofile/migrations/0012_auto_20150706_1530.py
f76414aec2906f0309739ccb3346f2edf38718b3
[]
no_license
hqpr/fame
fdad5d03bf9ee7ca31ae8a4701ff05bafd49540f
8b77e3a822ae70ee6d79a8003e1d9f9bc5ba8355
refs/heads/master
2023-01-14T16:58:46.533090
2015-08-31T15:37:09
2015-08-31T15:37:09
35,205,330
0
0
null
null
null
null
UTF-8
Python
false
false
477
py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('userprofile', '0011_auto_20150705_1058'), ] operations = [ migrations.AlterField( model_name='userprofile', name='modified', field=models.DateTimeField(default=datetime.datetime(2015, 7, 6, 15, 30, 35, 789165)), ), ]
adf1685660cd92543833062dc2a15281ab6c7339
bd4dcd90d41aa228f0384c9ba03edd105a93d7ec
/products/migrations/0093_auto_20200221_2053.py
68291c6f83fef49583f1309c16f7b5252bc349da
[]
no_license
deganoth/mu-shop
0be0bb0cfa635986b37edbe371daf8373f09aefd
dc1a77ecf6217286c005d762b559fe3f61ef2f6d
refs/heads/master
2023-02-17T08:23:36.339586
2023-01-10T17:51:21
2023-01-10T17:51:21
243,972,792
0
1
null
2023-02-15T23:10:09
2020-02-29T13:22:02
Python
UTF-8
Python
false
false
6,720
py
# -*- coding: utf-8 -*- # Generated by Django 1.11.24 on 2020-02-21 20:53 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import djmoney.models.fields class Migration(migrations.Migration): dependencies = [ ('products', '0092_auto_20200221_2045'), ] operations = [ migrations.CreateModel( name='ProductName', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ], ), migrations.CreateModel( name='Review', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('published_date', models.DateTimeField(verbose_name='date published')), ('user_name', models.CharField(max_length=100)), ('comment', models.CharField(max_length=200)), ('rating', models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5')])), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.ProductName')), ], ), migrations.AlterField( model_name='product', name='price_currency', field=djmoney.models.fields.CurrencyField(choices=[('XUA', 'ADB Unit of Account'), ('AFN', 'Afghani'), ('DZD', 'Algerian Dinar'), ('ARS', 'Argentine Peso'), ('AMD', 'Armenian Dram'), ('AWG', 'Aruban Guilder'), ('AUD', 'Australian Dollar'), ('AZN', 'Azerbaijanian Manat'), ('BSD', 'Bahamian Dollar'), ('BHD', 'Bahraini Dinar'), ('THB', 'Baht'), ('PAB', 'Balboa'), ('BBD', 'Barbados Dollar'), ('BYN', 'Belarussian Ruble'), ('BYR', 'Belarussian Ruble'), ('BZD', 'Belize Dollar'), ('BMD', 'Bermudian Dollar (customarily known as Bermuda Dollar)'), ('BTN', 'Bhutanese ngultrum'), ('VEF', 'Bolivar Fuerte'), ('BOB', 'Boliviano'), ('XBA', 'Bond Markets Units European Composite Unit (EURCO)'), ('BRL', 'Brazilian Real'), ('BND', 'Brunei Dollar'), ('BGN', 'Bulgarian Lev'), ('BIF', 'Burundi Franc'), ('XOF', 'CFA Franc BCEAO'), ('XAF', 'CFA franc BEAC'), ('XPF', 'CFP Franc'), ('CAD', 'Canadian Dollar'), ('CVE', 'Cape Verde Escudo'), ('KYD', 'Cayman Islands Dollar'), ('CLP', 'Chilean peso'), ('XTS', 'Codes specifically reserved for testing purposes'), ('COP', 'Colombian peso'), ('KMF', 'Comoro Franc'), ('CDF', 'Congolese franc'), ('BAM', 'Convertible Marks'), ('NIO', 'Cordoba Oro'), ('CRC', 'Costa Rican Colon'), ('HRK', 'Croatian Kuna'), ('CUP', 'Cuban Peso'), ('CUC', 'Cuban convertible peso'), ('CZK', 'Czech Koruna'), ('GMD', 'Dalasi'), ('DKK', 'Danish Krone'), ('MKD', 'Denar'), ('DJF', 'Djibouti Franc'), ('STD', 'Dobra'), ('DOP', 'Dominican Peso'), ('VND', 'Dong'), ('XCD', 'East Caribbean Dollar'), ('EGP', 'Egyptian Pound'), ('SVC', 'El Salvador Colon'), ('ETB', 'Ethiopian Birr'), ('EUR', 'Euro'), ('XBB', 'European Monetary Unit (E.M.U.-6)'), ('XBD', 'European Unit of Account 17(E.U.A.-17)'), ('XBC', 'European Unit of Account 9(E.U.A.-9)'), ('FKP', 'Falkland Islands Pound'), ('FJD', 'Fiji Dollar'), ('HUF', 'Forint'), ('GHS', 'Ghana Cedi'), ('GIP', 'Gibraltar Pound'), ('XAU', 'Gold'), ('XFO', 'Gold-Franc'), ('PYG', 'Guarani'), ('GNF', 'Guinea Franc'), ('GYD', 'Guyana Dollar'), ('HTG', 'Haitian gourde'), ('HKD', 'Hong Kong Dollar'), ('UAH', 'Hryvnia'), ('ISK', 'Iceland Krona'), ('INR', 'Indian Rupee'), ('IRR', 'Iranian Rial'), ('IQD', 'Iraqi Dinar'), ('IMP', 'Isle of Man Pound'), ('JMD', 'Jamaican Dollar'), ('JOD', 'Jordanian Dinar'), ('KES', 'Kenyan Shilling'), ('PGK', 'Kina'), ('LAK', 'Kip'), ('KWD', 'Kuwaiti Dinar'), ('AOA', 'Kwanza'), ('MMK', 'Kyat'), ('GEL', 'Lari'), ('LVL', 'Latvian Lats'), ('LBP', 'Lebanese Pound'), ('ALL', 'Lek'), ('HNL', 'Lempira'), ('SLL', 'Leone'), ('LSL', 'Lesotho loti'), ('LRD', 'Liberian Dollar'), ('LYD', 'Libyan Dinar'), ('SZL', 'Lilangeni'), ('LTL', 'Lithuanian Litas'), ('MGA', 'Malagasy Ariary'), ('MWK', 'Malawian Kwacha'), ('MYR', 'Malaysian Ringgit'), ('TMM', 'Manat'), ('MUR', 'Mauritius Rupee'), ('MZN', 'Metical'), ('MXV', 'Mexican Unidad de Inversion (UDI)'), ('MXN', 'Mexican peso'), ('MDL', 'Moldovan Leu'), ('MAD', 'Moroccan Dirham'), ('BOV', 'Mvdol'), ('NGN', 'Naira'), ('ERN', 'Nakfa'), ('NAD', 'Namibian Dollar'), ('NPR', 'Nepalese Rupee'), ('ANG', 'Netherlands Antillian Guilder'), ('ILS', 'New Israeli Sheqel'), ('RON', 'New Leu'), ('TWD', 'New Taiwan Dollar'), ('NZD', 'New Zealand Dollar'), ('KPW', 'North Korean Won'), ('NOK', 'Norwegian Krone'), ('PEN', 'Nuevo Sol'), ('MRO', 'Ouguiya'), ('TOP', 'Paanga'), ('PKR', 'Pakistan Rupee'), ('XPD', 'Palladium'), ('MOP', 'Pataca'), ('PHP', 'Philippine Peso'), ('XPT', 'Platinum'), ('GBP', 'Pound Sterling'), ('BWP', 'Pula'), ('QAR', 'Qatari Rial'), ('GTQ', 'Quetzal'), ('ZAR', 'Rand'), ('OMR', 'Rial Omani'), ('KHR', 'Riel'), ('MVR', 'Rufiyaa'), ('IDR', 'Rupiah'), ('RUB', 'Russian Ruble'), ('RWF', 'Rwanda Franc'), ('XDR', 'SDR'), ('SHP', 'Saint Helena Pound'), ('SAR', 'Saudi Riyal'), ('RSD', 'Serbian Dinar'), ('SCR', 'Seychelles Rupee'), ('XAG', 'Silver'), ('SGD', 'Singapore Dollar'), ('SBD', 'Solomon Islands Dollar'), ('KGS', 'Som'), ('SOS', 'Somali Shilling'), ('TJS', 'Somoni'), ('SSP', 'South Sudanese Pound'), ('LKR', 'Sri Lanka Rupee'), ('XSU', 'Sucre'), ('SDG', 'Sudanese Pound'), ('SRD', 'Surinam Dollar'), ('SEK', 'Swedish Krona'), ('CHF', 'Swiss Franc'), ('SYP', 'Syrian Pound'), ('BDT', 'Taka'), ('WST', 'Tala'), ('TZS', 'Tanzanian Shilling'), ('KZT', 'Tenge'), ('XXX', 'The codes assigned for transactions where no currency is involved'), ('TTD', 'Trinidad and Tobago Dollar'), ('MNT', 'Tugrik'), ('TND', 'Tunisian Dinar'), ('TRY', 'Turkish Lira'), ('TMT', 'Turkmenistan New Manat'), ('TVD', 'Tuvalu dollar'), ('AED', 'UAE Dirham'), ('XFU', 'UIC-Franc'), ('USD', 'US Dollar'), ('USN', 'US Dollar (Next day)'), ('UGX', 'Uganda Shilling'), ('CLF', 'Unidad de Fomento'), ('COU', 'Unidad de Valor Real'), ('UYI', 'Uruguay Peso en Unidades Indexadas (URUIURUI)'), ('UYU', 'Uruguayan peso'), ('UZS', 'Uzbekistan Sum'), ('VUV', 'Vatu'), ('CHE', 'WIR Euro'), ('CHW', 'WIR Franc'), ('KRW', 'Won'), ('YER', 'Yemeni Rial'), ('JPY', 'Yen'), ('CNY', 'Yuan Renminbi'), ('ZMK', 'Zambian Kwacha'), ('ZMW', 'Zambian Kwacha'), ('ZWD', 'Zimbabwe Dollar A/06'), ('ZWN', 'Zimbabwe dollar A/08'), ('ZWL', 'Zimbabwe dollar A/09'), ('PLN', 'Zloty')], default=None, editable=False, max_length=3, null=True), ), migrations.AddField( model_name='productname', name='name', field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='products.Product'), ), ]
a3720504b0405edeb5fa1836f9f6c46354683a49
d094ba0c8a9b1217fbf014aa79a283a49aabe88c
/env/lib/python3.6/site-packages/kombu/utils/limits.py
833cb96a47fce4401f66851a80cdda399eb46c6a
[ "Apache-2.0" ]
permissive
Raniac/NEURO-LEARN
d9274e0baadd97bb02da54bdfcf6ca091fc1c703
3c3acc55de8ba741e673063378e6cbaf10b64c7a
refs/heads/master
2022-12-25T23:46:54.922237
2020-09-06T03:15:14
2020-09-06T03:15:14
182,013,100
9
2
Apache-2.0
2022-12-09T21:01:00
2019-04-18T03:57:00
CSS
UTF-8
Python
false
false
2,195
py
""" kombu.utils.limits ================== Token bucket implementation for rate limiting. """ from __future__ import absolute_import from kombu.five import monotonic __all__ = ['TokenBucket'] class TokenBucket(object): """Token Bucket Algorithm. See http://en.wikipedia.org/wiki/Token_Bucket Most of this code was stolen from an entry in the ASPN Python Cookbook: http://code.activestate.com/recipes/511490/ .. admonition:: Thread safety This implementation is not thread safe. Access to a `TokenBucket` instance should occur within the critical section of any multithreaded code. """ #: The rate in tokens/second that the bucket will be refilled. fill_rate = None #: Maximum number of tokens in the bucket. capacity = 1 #: Timestamp of the last time a token was taken out of the bucket. timestamp = None def __init__(self, fill_rate, capacity=1): self.capacity = float(capacity) self._tokens = capacity self.fill_rate = float(fill_rate) self.timestamp = monotonic() def can_consume(self, tokens=1): """Return :const:`True` if the number of tokens can be consumed from the bucket. If they can be consumed, a call will also consume the requested number of tokens from the bucket. Calls will only consume `tokens` (the number requested) or zero tokens -- it will never consume a partial number of tokens.""" if tokens <= self._get_tokens(): self._tokens -= tokens return True return False def expected_time(self, tokens=1): """Return the time (in seconds) when a new token is expected to be available. This will not consume any tokens from the bucket.""" _tokens = self._get_tokens() tokens = max(tokens, _tokens) return (tokens - _tokens) / self.fill_rate def _get_tokens(self): if self._tokens < self.capacity: now = monotonic() delta = self.fill_rate * (now - self.timestamp) self._tokens = min(self.capacity, self._tokens + delta) self.timestamp = now return self._tokens
395d5d325531f6a44e47ababe037cd9701a736b0
bc9f66258575dd5c8f36f5ad3d9dfdcb3670897d
/lib/surface/artifacts/files/__init__.py
efc655f736b989835c4478beee69c049eda522b7
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
google-cloud-sdk-unofficial/google-cloud-sdk
05fbb473d629195f25887fc5bfaa712f2cbc0a24
392abf004b16203030e6efd2f0af24db7c8d669e
refs/heads/master
2023-08-31T05:40:41.317697
2023-08-23T18:23:16
2023-08-23T18:23:16
335,182,594
9
2
NOASSERTION
2022-10-29T20:49:13
2021-02-02T05:47:30
Python
UTF-8
Python
false
false
1,222
py
# -*- coding: utf-8 -*- # # Copyright 2022 Google LLC. All Rights Reserved. # # 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. """Command group for Artifact Registry files.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from googlecloudsdk.calliope import base class Files(base.Group): """Manage Artifact Registry files. ## EXAMPLES To list all files in the current project and `artifacts/repository` and `artifacts/location` properties are set, run: $ {command} list To list files under repository my-repo in the current project and location, run: $ {command} list --repository=my-repo """ category = base.CI_CD_CATEGORY
d28b2ba189d4cd74c177b25d287aeae3ef6cade1
74091dce735f281188d38d2f00d1a68e1d38ff7a
/pytest_udemy_params_datadriven_crossbrowser/tests/conftest.py
8e184dcf876ae8b91e9a90573978768b1f73f6a5
[]
no_license
nbiadrytski-zz/python-training
96741aa0ef37bda32d049fde5938191025fe2924
559a64aae2db51e11812cea5ff602f25953e8070
refs/heads/master
2023-05-07T04:08:23.898161
2019-12-10T12:12:59
2019-12-10T12:12:59
null
0
0
null
null
null
null
UTF-8
Python
false
false
506
py
from pytest import fixture from selenium import webdriver import json data_path = 'test_data.json' def load_test_data(path): with open(path) as data_file: data = json.load(data_file) return data @fixture(params=load_test_data(data_path)) def tv_brand(request): data = request.param return data @fixture(params=[webdriver.Chrome, webdriver.Firefox], ids=['Chrome', 'FF']) def browser(request): driver = request.param drvr = driver() yield drvr drvr.quit()
e42d622c1426a68b75b5c9503972b27ca2794746
f04089bf7df2b7cd4058f8df3ffe747c349afd60
/multiply_strings.py
77836126e3b8f258f7bf2527d3d6e09eaf5f1475
[]
no_license
dbialon/LeetCode
d2a674f7c5ba51a3714ca46026d2a5d37681919d
d28c63779212519fe38e98b9f0e0cbf48137bc43
refs/heads/master
2023-01-12T06:27:32.516504
2020-11-18T11:35:00
2020-11-18T11:35:00
259,928,261
0
0
null
null
null
null
UTF-8
Python
false
false
1,033
py
# https://leetcode.com/problems/multiply-strings/ # given two non-negative integers num1 and num2 represented # as strings, return the product of num1 and num2, also # represented as a string. def multiply(num1: str, num2: str) -> str: if num1 == "0" or num2 == "0": return "0" table = {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6":6, "7": 7, "8": 8, "9": 9, "0": 0} n_1, n_2 = 0, 0 l1, l2 = len(num1), len(num2) for i in range(l1): n_1 += table[num1[i]] * 10 ** (l1 - i - 1) for i in range(l2): n_2 += table[num2[i]] * 10 ** (l2 - i - 1) result = n_1 * n_2 num3 = "" while result > 0: # for key, value in table.items(): # if result % 10 == value: # num3 = key + num3 num3 = chr(48 + result % 10) + num3 result //= 10 return num3 str_1 = "12312312312312312312313123123123123123123123123123123123" str_2 = "13213213213213213213232132132132132132132132132132132132" print(multiply(str_1, str_2))
be74904cdc25d4d4c7cf0e60588433a0cca13e45
c7cbbd4b1c1e281cef5f4a0c4e3d4a97cee2241e
/froide/foirequest/feeds.py
f7f5013a62598bd972ecd4613d1f94601890043d
[ "MIT" ]
permissive
manonthemat/froide
078cf78a6eb35226512c0bdfa2ac9043bcc81ad9
698c49935eaf2e922f3c9f6a46af0fd545ccbbbb
refs/heads/master
2020-08-14T08:19:36.215473
2019-10-14T19:43:16
2019-10-14T19:43:16
215,129,869
0
0
MIT
2019-10-14T19:35:49
2019-10-14T19:35:49
null
UTF-8
Python
false
false
4,189
py
import re from django.conf import settings from django.contrib.syndication.views import Feed from django.utils.feedgenerator import Atom1Feed from django.utils.translation import ugettext_lazy as _ from django.urls import reverse from django.shortcuts import get_object_or_404 from .models import FoiRequest from .filters import FOIREQUEST_FILTER_DICT CONTROLCHARS_RE = re.compile(r'[\x00-\x08\x0B-\x0C\x0E-\x1F]') def clean(val): return CONTROLCHARS_RE.sub('', val) class LatestFoiRequestsFeed(Feed): url_name = 'foirequest-list_feed' def __init__(self, items, data, make_url): self.items = items self.data = data self.make_url = make_url super(LatestFoiRequestsFeed, self).__init__() def get_filter_string(self): by = [] if self.data.get('q'): by.append(_('search for "%s"' % self.data['q'])) if self.data.get('category'): by.append(_('by category %(category)s') % {'category': self.data['category'].name}) if self.data.get('status'): by.append(_('by status %(status)s') % { 'status': FOIREQUEST_FILTER_DICT[self.data['status']][1] }) if self.data.get('tag'): by.append(_('by tag %(tag)s') % {'tag': self.data['tag'].name}) if self.data.get('jurisdiction'): by.append(_('for %(juris)s') % {'juris': self.data['jurisdiction'].name}) if self.data.get('publicbody'): by.append(_('to %(publicbody)s') % {'publicbody': self.data['publicbody'].name}) return ' '.join(str(x) for x in by) def title(self, obj): by = self.get_filter_string() if by: return clean(_("Freedom of Information Requests %(by)s on %(sitename)s") % { "sitename": settings.SITE_NAME, 'by': by }) return clean(_("Freedom of Information Requests on %(sitename)s") % { "sitename": settings.SITE_NAME }) def description(self, obj): by = self.get_filter_string() if by: return clean(_("This feed contains the Freedom of Information requests %(by)s" " that have been made through %(sitename)s.") % { "sitename": settings.SITE_NAME, 'by': by }) return clean(_("This feed contains the latest Freedom of Information requests" " that have been made through %(sitename)s.") % { "sitename": settings.SITE_NAME }) def link(self): return self.make_url(self.url_name) def items(self): return self.items.order_by("-first_message")[:15] def item_title(self, item): if item.public_body: pb_name = item.public_body.name else: pb_name = _("Not yet known") return clean(_("'%(title)s' to %(publicbody)s") % { "title": item.title, "publicbody": pb_name }) def item_description(self, item): return clean(item.description) def item_pubdate(self, item): return item.first_message class LatestFoiRequestsFeedAtom(LatestFoiRequestsFeed): feed_type = Atom1Feed subtitle = LatestFoiRequestsFeed.description url_name = 'foirequest-list_feed_atom' class FoiRequestFeed(Feed): def get_object(self, request, slug): return get_object_or_404(FoiRequest, slug=slug, public=True) def title(self, obj): return clean(obj.title) def link(self, obj): return reverse('foirequest-feed', kwargs={"slug": obj.slug}) def description(self, obj): return clean(obj.description) def items(self, obj): return obj.foievent_set.order_by("-timestamp")[:15] def item_title(self, item): return clean(item.as_text()) def item_description(self, item): return clean(item.as_text()) def item_pubdate(self, item): return item.timestamp class FoiRequestFeedAtom(FoiRequestFeed): feed_type = Atom1Feed subtitle = FoiRequestFeed.description def link(self, obj): return reverse('foirequest-feed_atom', kwargs={"slug": obj.slug})
e68fc4550c477bbbfcb9e72f120f12025db3050e
648411bd760b9c7018da516b4617b05a0d3a5dee
/core/config.py
15bb43be748390910230122b73bbe541489e7487
[ "Apache-2.0" ]
permissive
cartel32/ChefAPI
6de457a4e4f7fd0a2123da1c97058565ccdcdc34
bb622db1fb09feb85488438a6d840e0b6383b679
refs/heads/main
2023-06-09T15:09:27.923326
2021-06-26T02:03:38
2021-06-26T02:03:38
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,529
py
import secrets from typing import Any, Dict, List, Optional, Union from pydantic import AnyHttpUrl, BaseSettings, EmailStr, Field, HttpUrl, PostgresDsn, validator class Settings(BaseSettings): API_V1_STR = "/api/v1" SECRET_KEY: str = secrets.token_urlsafe(64) ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8 BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = [] PROJECT_NAME: str = "ChefAPI" # BACKEND_CORS_ORIGINS is a JSON-formatted list of origins # e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \ # "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]' POSTGRES_SERVER: str = Field(..., env="POSTGRES_SERVER") POSTGRES_USER: str = Field(..., env="POSTGRES_USER") POSTGRES_PASSWORD: str = Field(..., env="POSTGRES_PASSWORD") POSTGRES_DB: str = Field(..., env="POSTGRES_DB") SQLALCHEMY_DATABASE_URI: Optional[PostgresDsn] = None @validator("SQLALCHEMY_DATABASE_URI", pre=True) def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any: if isinstance(v, str): return v return PostgresDsn.build( scheme="postgresql", user=values.get("POSTGRES_USER"), password=values.get("POSTGRES_PASSWORD"), host=values.get("POSTGRES_SERVER"), path=f"/{values.get('POSTGRES_DB') or ''}", ) class Config: case_sensitive = True env_file = '.env' env_file_encoding = 'utf-8' settings = Settings()
d020b391aa17fab9770e8607e005440b02e93769
fbbe424559f64e9a94116a07eaaa555a01b0a7bb
/Keras_tensorflow_nightly/source2.7/google/protobuf/internal/factory_test1_pb2.py
8240f242a12b6b761056dc5e7317920be7dc0c1c
[ "MIT" ]
permissive
ryfeus/lambda-packs
6544adb4dec19b8e71d75c24d8ed789b785b0369
cabf6e4f1970dc14302f87414f170de19944bac2
refs/heads/master
2022-12-07T16:18:52.475504
2022-11-29T13:35:35
2022-11-29T13:35:35
71,386,735
1,283
263
MIT
2022-11-26T05:02:14
2016-10-19T18:22:39
Python
UTF-8
Python
false
true
7,816
py
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/factory_test1.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='google/protobuf/internal/factory_test1.proto', package='google.protobuf.python.internal', syntax='proto2', serialized_pb=_b('\n,google/protobuf/internal/factory_test1.proto\x12\x1fgoogle.protobuf.python.internal\"\xd5\x03\n\x0f\x46\x61\x63tory1Message\x12\x45\n\x0e\x66\x61\x63tory_1_enum\x18\x01 \x01(\x0e\x32-.google.protobuf.python.internal.Factory1Enum\x12\x62\n\x15nested_factory_1_enum\x18\x02 \x01(\x0e\x32\x43.google.protobuf.python.internal.Factory1Message.NestedFactory1Enum\x12h\n\x18nested_factory_1_message\x18\x03 \x01(\x0b\x32\x46.google.protobuf.python.internal.Factory1Message.NestedFactory1Message\x12\x14\n\x0cscalar_value\x18\x04 \x01(\x05\x12\x12\n\nlist_value\x18\x05 \x03(\t\x1a&\n\x15NestedFactory1Message\x12\r\n\x05value\x18\x01 \x01(\t\"P\n\x12NestedFactory1Enum\x12\x1c\n\x18NESTED_FACTORY_1_VALUE_0\x10\x00\x12\x1c\n\x18NESTED_FACTORY_1_VALUE_1\x10\x01*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02*<\n\x0c\x46\x61\x63tory1Enum\x12\x15\n\x11\x46\x41\x43TORY_1_VALUE_0\x10\x00\x12\x15\n\x11\x46\x41\x43TORY_1_VALUE_1\x10\x01') ) _FACTORY1ENUM = _descriptor.EnumDescriptor( name='Factory1Enum', full_name='google.protobuf.python.internal.Factory1Enum', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='FACTORY_1_VALUE_0', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( name='FACTORY_1_VALUE_1', index=1, number=1, options=None, type=None), ], containing_type=None, options=None, serialized_start=553, serialized_end=613, ) _sym_db.RegisterEnumDescriptor(_FACTORY1ENUM) Factory1Enum = enum_type_wrapper.EnumTypeWrapper(_FACTORY1ENUM) FACTORY_1_VALUE_0 = 0 FACTORY_1_VALUE_1 = 1 _FACTORY1MESSAGE_NESTEDFACTORY1ENUM = _descriptor.EnumDescriptor( name='NestedFactory1Enum', full_name='google.protobuf.python.internal.Factory1Message.NestedFactory1Enum', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='NESTED_FACTORY_1_VALUE_0', index=0, number=0, options=None, type=None), _descriptor.EnumValueDescriptor( name='NESTED_FACTORY_1_VALUE_1', index=1, number=1, options=None, type=None), ], containing_type=None, options=None, serialized_start=460, serialized_end=540, ) _sym_db.RegisterEnumDescriptor(_FACTORY1MESSAGE_NESTEDFACTORY1ENUM) _FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE = _descriptor.Descriptor( name='NestedFactory1Message', full_name='google.protobuf.python.internal.Factory1Message.NestedFactory1Message', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='value', full_name='google.protobuf.python.internal.Factory1Message.NestedFactory1Message.value', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=420, serialized_end=458, ) _FACTORY1MESSAGE = _descriptor.Descriptor( name='Factory1Message', full_name='google.protobuf.python.internal.Factory1Message', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='factory_1_enum', full_name='google.protobuf.python.internal.Factory1Message.factory_1_enum', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='nested_factory_1_enum', full_name='google.protobuf.python.internal.Factory1Message.nested_factory_1_enum', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='nested_factory_1_message', full_name='google.protobuf.python.internal.Factory1Message.nested_factory_1_message', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='scalar_value', full_name='google.protobuf.python.internal.Factory1Message.scalar_value', index=3, number=4, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='list_value', full_name='google.protobuf.python.internal.Factory1Message.list_value', index=4, number=5, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[_FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE, ], enum_types=[ _FACTORY1MESSAGE_NESTEDFACTORY1ENUM, ], options=None, is_extendable=True, syntax='proto2', extension_ranges=[(1000, 536870912), ], oneofs=[ ], serialized_start=82, serialized_end=551, ) _FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE.containing_type = _FACTORY1MESSAGE _FACTORY1MESSAGE.fields_by_name['factory_1_enum'].enum_type = _FACTORY1ENUM _FACTORY1MESSAGE.fields_by_name['nested_factory_1_enum'].enum_type = _FACTORY1MESSAGE_NESTEDFACTORY1ENUM _FACTORY1MESSAGE.fields_by_name['nested_factory_1_message'].message_type = _FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE _FACTORY1MESSAGE_NESTEDFACTORY1ENUM.containing_type = _FACTORY1MESSAGE DESCRIPTOR.message_types_by_name['Factory1Message'] = _FACTORY1MESSAGE DESCRIPTOR.enum_types_by_name['Factory1Enum'] = _FACTORY1ENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) Factory1Message = _reflection.GeneratedProtocolMessageType('Factory1Message', (_message.Message,), dict( NestedFactory1Message = _reflection.GeneratedProtocolMessageType('NestedFactory1Message', (_message.Message,), dict( DESCRIPTOR = _FACTORY1MESSAGE_NESTEDFACTORY1MESSAGE, __module__ = 'google.protobuf.internal.factory_test1_pb2' # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory1Message.NestedFactory1Message) )) , DESCRIPTOR = _FACTORY1MESSAGE, __module__ = 'google.protobuf.internal.factory_test1_pb2' # @@protoc_insertion_point(class_scope:google.protobuf.python.internal.Factory1Message) )) _sym_db.RegisterMessage(Factory1Message) _sym_db.RegisterMessage(Factory1Message.NestedFactory1Message) # @@protoc_insertion_point(module_scope)
549bed9daf0f4ef8d0ed86767a77ca00430090ef
5b70fbd53b534306c146ffb98a0f99d2343a948f
/src/Python/Problem587.py
2ba944f8d8d9652b2e76c40f120339f18f824584
[]
no_license
aniruddhamurali/Project-Euler
1f4ff3aa1e9c4efbc2a85026821e19a28b5edf90
408b3098fbc98ff3954679602c0468ddb56ea0ac
refs/heads/master
2020-03-20T23:07:22.178103
2018-07-27T01:40:46
2018-07-27T01:40:46
137,830,476
0
0
null
null
null
null
UTF-8
Python
false
false
673
py
# Problem 587 # Answer: 2240 import math import itertools def main(): # The indefinite integral of (1 - sqrt(2x - x^2)) dx. def integral(x): t = x - 1.0 return t - (math.sqrt(x * (2.0 - x)) * t + math.asin(t)) / 2.0 lsectionarea = 1.0 - math.pi/4.0 for i in itertools.count(1): slope = 1.0 / i a = slope**2 + 1.0 b = -2.0 * (slope + 1.0) c = 1.0 x = (2.0 * c) / (-b + math.sqrt(b * b - 4 * a * c)) concavetrianglearea = (x**2 * slope / 2) + (integral(1.0) - integral(x)) if concavetrianglearea/lsectionarea < 0.001: print(i) return str(i) main()
9827a807920d3270208ee5ee2d316ba711ac1c8e
85a9ffeccb64f6159adbd164ff98edf4ac315e33
/pysnmp-with-texts/ENTERASYS-SERVICE-LEVEL-REPORTING-MIB.py
5932cdfda88a0855bdbd278ce5d375e416b10dbd
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-unknown-license-reference" ]
permissive
agustinhenze/mibs.snmplabs.com
5d7d5d4da84424c5f5a1ed2752f5043ae00019fb
1fc5c07860542b89212f4c8ab807057d9a9206c7
refs/heads/master
2020-12-26T12:41:41.132395
2019-08-16T15:51:41
2019-08-16T15:53:57
237,512,469
0
0
Apache-2.0
2020-01-31T20:41:36
2020-01-31T20:41:35
null
UTF-8
Python
false
false
65,271
py
# # PySNMP MIB module ENTERASYS-SERVICE-LEVEL-REPORTING-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-SERVICE-LEVEL-REPORTING-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:04:36 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint") etsysModules, = mibBuilder.importSymbols("ENTERASYS-MIB-NAMES", "etsysModules") InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") TimeTicks, iso, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, ModuleIdentity, Integer32, Counter64, MibIdentifier, Bits, IpAddress, Counter32, Gauge32, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "iso", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "ModuleIdentity", "Integer32", "Counter64", "MibIdentifier", "Bits", "IpAddress", "Counter32", "Gauge32", "ObjectIdentity") RowStatus, TextualConvention, StorageType, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TextualConvention", "StorageType", "DisplayString") etsysServiceLevelReportingMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39)) etsysServiceLevelReportingMIB.setRevisions(('2003-11-06 15:15', '2003-10-24 19:02', '2003-10-22 23:32',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: etsysServiceLevelReportingMIB.setRevisionsDescriptions(('Corrected the postal code in the CONTACT-INFO clause.', "Changed the name of the bit at position zero in the EtsysSrvcLvlStandardMetrics textual convention from 'none' to 'reserved' and added a comment for it in the description clause.", 'Initial version of this MIB module.',)) if mibBuilder.loadTexts: etsysServiceLevelReportingMIB.setLastUpdated('200311061515Z') if mibBuilder.loadTexts: etsysServiceLevelReportingMIB.setOrganization('Enterasys Networks Inc.') if mibBuilder.loadTexts: etsysServiceLevelReportingMIB.setContactInfo('Postal: Enterasys Networks 50 Minuteman Rd. Andover, MA 01810-1008 USA Phone: +1 978 684 1000 E-mail: [email protected] WWW: http://www.enterasys.com') if mibBuilder.loadTexts: etsysServiceLevelReportingMIB.setDescription('This memo defines a portion of the Management Information Base (MIB) for use with network management protocols in TCP/IP-based internets. In particular, it specifies the objects used for managing the results of the service level metrics measurements.') class EtsysSrvcLvlOwnerString(TextualConvention, OctetString): description = 'An OwnerString. The string length is limited to 32 octets.' status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 32) class TimeUnit(TextualConvention, Integer32): description = 'A enumerated list of time units.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9)) namedValues = NamedValues(("year", 1), ("month", 2), ("week", 3), ("day", 4), ("hour", 5), ("second", 6), ("millisecond", 7), ("microsecond", 8), ("nanosecond", 9)) class EtsysSrvcLvlStandardMetrics(TextualConvention, Bits): description = " Each standard metric is identified below. In order to allow for several metrics to be calculated in a single measure, there is a need to describe in a bit string the metrics to be measured. This textual convention defines a BITS construct that gathers in a bit string a sequence of bits. The bit order corresponds to the order of the metric identifiers in the registry. The first bit (most significant bit) of the string has the index 0. The index 1 corresponds to the first metric of the registry (instantaneousUnidirectionalConnectivity ). Example: One-way-Delay(6) is identified as 6. One-way-Packet-Loss(12) is as 12. A network measure performing both One-way-Delay(6) and One-way-Packet-Loss(12) will be described as '0000001000001000'b, '208'B. Below is a list of defined metrics: reserved (0) Setting this reserved bit has no effect. instantUnidirectionConnectivity (1) The identifier for the Type-P-Instantaneous-Unidirectional- Connectivity metric. REFERENCE RFC2678, section 2. instantBidirectionConnectivity (2) The identifier for the Type-P-Instantaneous-Bidirectional- Connectivity metric. REFERENCE RFC2678, section 3. intervalUnidirectionConnectivity (3) The identifier for the Type-P-Interval-Unidirectional- Connectivity metric. REFERENCE RFC2678, section 4. intervalBidirectionConnectivity (4) The identifier for the Type-P-Interval-Bidirectional- Connectivity metric. REFERENCE RFC2678, section 5. intervalTemporalConnectivity (5) The identifier for the Type-P1-P2-Interval-Temporal- Connectivity metric. REFERENCE RFC2678, section 6. oneWayDelay (6) The identifier for the Type-P-One-way-Delay metric. REFERENCE RFC2679, section 3. oneWayDelayPoissonStream (7) The identifier for the Type-P-One-way-Delay-Poisson-Stream metric. REFERENCE RFC2679, section 4. oneWayDelayPercentile (8) The identifier for the Type-P-One-way-Delay-Percentile metric. REFERENCE RFC2679, section 5.1. oneWayDelayMedian (9) The identifier for the Type-P-One-way-Delay-Median metric. REFERENCE RFC2679, section 5.2. oneWayDelayMinimum (10) The identifier for the Type-P-One-way-Delay-Minimum metric. REFERENCE RFC2679, section 5.3. oneWayDelayInversePercentile (11) The identifier for the Type-P-One-way-Delay-Inverse- Percentile metric. REFERENCE RFC2679, section 5.4. oneWayPacketLoss (12) The identifier for the Type-P-One-way-Packet-Loss metric. REFERENCE RFC2680, section 2. oneWayPacketLossPoissonStream (13) The identifier for the Type-P-One-way-Packet-Loss-Poisson- Stream metric. REFERENCE RFC2680, section 3. oneWayPacketLossAverage (14) The identifier for the Type-P-One-way-Packet-Loss-Average metric. REFERENCE RFC2680, section 4. roundtripDelay (15) The identifier for the Type-P-Round-trip-Delay metric. REFERENCE section 2 of the rfc2681. roundtripDelayPoissonStream (16) The identifier for the Type-P-Round-trip-Delay-Poisson-Stream metric. REFERENCE RFC2681, section 4. roundtripDelayPercentile (17) The identifier for the Type-P-Round-trip-Delay-Percentile metric. REFERENCE RFC2681, section 4.1. roundtripDelayMedian (18) The identifier for the Type-P-Round-trip-Delay-Median metric. REFERENCE RFC2681, section 4.2. roundtripDelayMinimum (19) The identifier for the Type-P-Round-trip-Delay-Minimum metric. REFERENCE RFC2681, section 4.3. roundtripDelayInversePercentile (20) The identifier for the Type-P-Round-trip-Inverse-Percentile metric. REFERENCE RFC2681, section 4.4. oneWayLossDistanceStream (21) The identifier for the Type-P-One-Way-Loss-Distance-Stream metric. REFERENCE RFC3357, section 5.4.1. oneWayLossPeriodStream (22) The identifier for the Type-P-One-Way-Loss-Period-Stream metric. REFERENCE RFC3357, section 5.4.2. oneWayLossNoticeableRate (23) The identifier for the Type-P-One-Way-Loss-Noticeable-Rate metric. REFERENCE RFC3357, section 6.1. oneWayLossPeriodTotal (24) The identifier for the Type-P-One-Way-Loss-Period-Total metric. REFERENCE RFC3357, section 6.2. oneWayLossPeriodLengths (25) The identifier for the Type-P-One-Way-Loss-Period-Lengths metric. REFERENCE RFC3357, section 6.3. oneWayInterLossPeriodLengths (26) The identifier for the Type-P-One-Way-Inter-Loss-Period- Lengths metric. REFERENCE RFC3357, section 6.4. oneWayIpdv (27) The identifier for the Type-P-One-way-ipdv metric. REFERENCE RFC3393, section 2. oneWayIpdvPoissonStream (28) The identifier for the Type-P-One-way-ipdv-Poisson-stream metric. REFERENCE RFC3393, section 3. oneWayIpdvPercentile (29) The identifier for the Type-P-One-way-ipdv-percentile metric. REFERENCE RFC3393, section 4.3. oneWayIpdvInversePercentile (30) The identifier for the Type-P-One-way-ipdv-inverse-percentile metric. REFERENCE RFC3393, section 4.4. oneWayIpdvJitter (31) The identifier for the Type-P-One-way-ipdv-jitter metric. REFERENCE RFC3393, section 4.5. oneWayPeakToPeakIpdv (32) The identifier for the Type-P-One-way-peak-to-peak-ipdv metric. REFERENCE RFC3393, section 4.6. oneWayDelayPeriodicStream (33) The identifier for the Type-P-One-way-Delay-Periodic-Stream metric. REFERENCE RFC3432, section 4. roundtripDelayAverage (34) The identifier for the Type-P-Round-trip-Delay-Average metric. roundtripPacketLoss (35) The identifier for the Type-P-Round-trip-Packet-Loss metric. roundtripPacketLossAverage (36) The identifier for the Type-P-Round-trip-Packet-Loss-Average metric. roundtripIpdv (37) The identifier for the Type-P-Round-trip-ipdv metric." status = 'current' namedValues = NamedValues(("reserved", 0), ("instantUnidirectionConnectivity", 1), ("instantBidirectionConnectivity", 2), ("intervalUnidirectionConnectivity", 3), ("intervalBidirectionConnectivity", 4), ("intervalTemporalConnectivity", 5), ("oneWayDelay", 6), ("oneWayDelayPoissonStream", 7), ("oneWayDelayPercentile", 8), ("oneWayDelayMedian", 9), ("oneWayDelayMinimum", 10), ("oneWayDelayInversePercentile", 11), ("oneWayPacketLoss", 12), ("oneWayPacketLossPoissonStream", 13), ("oneWayPacketLossAverage", 14), ("roundtripDelay", 15), ("roundtripDelayPoissonStream", 16), ("roundtripDelayPercentile", 17), ("roundtripDelayMedian", 18), ("roundtripDelayMinimum", 19), ("roundtripDelayInversePercentile", 20), ("oneWayLossDistanceStream", 21), ("oneWayLossPeriodStream", 22), ("oneWayLossNoticeableRate", 23), ("oneWayLossPeriodTotal", 24), ("oneWayLossPeriodLengths", 25), ("oneWayInterLossPeriodLengths", 26), ("oneWayIpdv", 27), ("oneWayIpdvPoissonStream", 28), ("oneWayIpdvPercentile", 29), ("oneWayIpdvInversePercentile", 30), ("oneWayIpdvJitter", 31), ("oneWayPeakToPeakIpdv", 32), ("oneWayDelayPeriodicStream", 33), ("roundtripDelayAverage", 34), ("roundtripPacketLoss", 35), ("roundtripPacketLossAverage", 36), ("roundtripIpdv", 37)) class GMTTimeStamp(TextualConvention, OctetString): description = 'The value at which a specific occurrence happened. The specific occurrence must be defined in the description of any object defined using this type. field octets contents range ----- ------ -------- ----- 1 1-4 second since 1 Jan 2000 0H00* 0..2^31 - 1 2 5-8 fractional part of the second* 0..2^32 - 1 * the value is in network-byte order The timestamp format is directly inspired from the NTP timestamp format. It differs because it counts the second since 1 Jan 2000 0H00 instead of 1 Jan 1900 0H00. The most significant bit of the part that represents the second is reserved. It will wrap in year 2068 (The NTP timestamp will wrap in year 2036). This bit is set to indicate if the fractional part of the second contains a precision field and a synchronization field. When this bit is not set the resolution is maximal. The maximal resolution is close to 250 picoseconds. The precision of the timestamp is provided in etsysSrvcLvlSystemClockResolution.' status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8) fixedLength = 8 class TypeP(TextualConvention, OctetString): description = "This textual convention is a display string used to describe the protocol encapsulation list of a packet, and is used as the value of the SYNTAX clause for the type of the Src and Dst of a measure. The RFC2895 specifies a macro named PROTOCOL-IDENTIFIER for the definition of protocol identifiers, while its companion document, the RFC2896 defines a set of protocol identifiers. TypeP is defined as a display string. It consists of a list of dot separated protocol names. Each protocol name has been previously defined using the macro PROTOCOL-IDENTIFIER of the RFC 2895. Examples: The RFC2896 defines the protocol identifiers 'ether2', 'ip', 'ipip4', 'udp', 'tcp', 'telnet'... The TypeP of the source address corresponding to telnet is the string 'ip.tcp.telnet'. The TypeP of the source address corresponding to UDP packets sent in an IP tunnel is the string 'ip.ipip4.udp'. Note: A performance measure is active, so generally a TypeP value does not describe the link layer (i.e. ether2...). Valid Internet packets are sent from Src to Dst. Then the choice of the link layer relies on the Internet stack." status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 512) class TypePaddress(TextualConvention, OctetString): description = "This textual convention is a Display string used to describe the parameters of the protocol encapsulation list of a packet, basically the address. TypePaddress is defined as a display string. It consists in a list of space separated parameter list. Each parameter in the list corresponds to a parameter of a PROTOCOL-IDENTIFIER of the TypeP. Example: The TypeP 'ip.ipip4' has 2 parameters. A valid TypePaddress value is '192.168.1.1 128.2.6.7'." status = 'current' displayHint = '255a' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 512) etsysSrvcLvlConfigObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1)) etsysSrvcLvlSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1)) etsysSrvcLvlOwners = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2)) etsysSrvcLvlHistory = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3)) etsysSrvcLvlMeasure = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4)) etsysSrvcLvlSystemTime = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 1), GMTTimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlSystemTime.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlSystemTime.setDescription('The current time of the system.') etsysSrvcLvlSystemClockResolution = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 2), Integer32()).setUnits('picoseconds').setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlSystemClockResolution.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlSystemClockResolution.setDescription('etsysSrvcLvlSystemClockResolution provides the precision of the clock used for the measures . The unit is the picosecond. For example, the clock on an old Unix host might advance only once every msec, and thus have a resolution of 1 msec. So its resolution is 1,000,000,000 picosecond and the value of etsysSrvcLvlSystemClockResolution is 1000000000.') etsysSrvcLvlMetricTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3), ) if mibBuilder.loadTexts: etsysSrvcLvlMetricTable.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricTable.setDescription('This table is mandatory. It describes the current implementation. Each defined metric must be described in the table. etsysSrvcLvlMetricTable content is read only.') etsysSrvcLvlMetricEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3, 1), ).setIndexNames((0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlMetricIndex")) if mibBuilder.loadTexts: etsysSrvcLvlMetricEntry.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricEntry.setDescription('An entry describes the static capabilities of a metric implementation.') etsysSrvcLvlMetricIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37))).clone(namedValues=NamedValues(("instantUnidirectionConnectivity", 1), ("instantBidirectionConnectivity", 2), ("intervalUnidirectionConnectivity", 3), ("intervalBidirectionConnectivity", 4), ("intervalTemporalConnectivity", 5), ("oneWayDelay", 6), ("oneWayDelayPoissonStream", 7), ("oneWayDelayPercentile", 8), ("oneWayDelayMedian", 9), ("oneWayDelayMinimum", 10), ("oneWayDelayInversePercentile", 11), ("oneWayPacketLoss", 12), ("oneWayPacketLossPoissonStream", 13), ("oneWayPacketLossAverage", 14), ("roundtripDelay", 15), ("roundtripDelayPoissonStream", 16), ("roundtripDelayPercentile", 17), ("roundtripDelayMedian", 18), ("roundtripDelayMinimum", 19), ("roundtripDelayInversePercentile", 20), ("oneWayLossDistanceStream", 21), ("oneWayLossPeriodStream", 22), ("oneWayLossNoticeableRate", 23), ("oneWayLossPeriodTotal", 24), ("oneWayLossPeriodLengths", 25), ("oneWayInterLossPeriodLengths", 26), ("oneWayIpdv", 27), ("oneWayIpdvPoissonStream", 28), ("oneWayIpdvPercentile", 29), ("oneWayIpdvInversePercentile", 30), ("oneWayIpdvJitter", 31), ("oneWayPeakToPeakIpdv", 32), ("oneWayDelayPeriodicStream", 33), ("roundtripDelayAverage", 34), ("roundtripPacketLoss", 35), ("roundtripPacketLossAverage", 36), ("roundtripIpdv", 37)))) if mibBuilder.loadTexts: etsysSrvcLvlMetricIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricIndex.setDescription("etsysSrvcLvlMetricIndex defines an unambiguous index for each standardized metric. It identifies a metric. Its value is defined above. This value is the same in any implementation of the ENTERASYS-SERVICE-LEVEL-REPORTING-MIB. See EtsysSrvcLvlStandardMetrics for description of the metrics. Example: onewayPacketLossAverage is defined as the 14. Consequently the index of the metric onewayPacketLossAverage in the EtsysSrvcLvlMetricTable will always be '14'") etsysSrvcLvlMetricCapabilities = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("notImplemented", 0), ("implemented", 1))).clone('implemented')).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlMetricCapabilities.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricCapabilities.setDescription('A value of notImplemented implies the metric is not implemented. A value of implemented implies the metric is implemented.') etsysSrvcLvlMetricType = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("network", 0), ("aggregated", 1))).clone('aggregated')).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlMetricType.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricType.setDescription('Indicates the metric type, whether it is network or aggregated') etsysSrvcLvlMetricUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("noUnit", 0), ("second", 1), ("millisecond", 2), ("microsecond", 3), ("nanosecond", 4), ("percentage", 5), ("packet", 6), ("byte", 7), ("kilobyte", 8), ("megabyte", 9)))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlMetricUnit.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricUnit.setDescription('The unit used in the current entity for the results of the measurement of this metric.') etsysSrvcLvlMetricDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 1, 3, 1, 5), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlMetricDescription.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMetricDescription.setDescription('A textual description of the metric implementation following the exact name of this metric in the registry. For example: oneWayDelay: text .') etsysSrvcLvlOwnersTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1), ) if mibBuilder.loadTexts: etsysSrvcLvlOwnersTable.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersTable.setDescription("A management entity wishing to create and activate remote EtsysSrvcLvl measurements in an agent must previously be registered in the etsysSrvcLvlOwnersTable. etsysSrvcLvlOwnersTable content is read-create. It contains at least the owner 'monitor'.") etsysSrvcLvlOwnersEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1), ).setIndexNames((0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersIndex")) if mibBuilder.loadTexts: etsysSrvcLvlOwnersEntry.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersEntry.setDescription("The description of the resources granted to an SNMP application. For example, an instance of etsysSrvcLvlOwnersOwner with an EtsysSrvcLvlOwnerString 'acme', which represents the 14th owner created in etsysSrvcLvlOwnersTable would be named etsysSrvcLvlOwnersEntryOwner.14. Notes: The etsysSrvcLvlOwnersIndex value is a local index managed directly by the agent. The management application must poll to get the next available index value. It is not used in anyway in other tables.") etsysSrvcLvlOwnersIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: etsysSrvcLvlOwnersIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersIndex.setDescription('An arbitrary index that identifies an entry in the owners table.') etsysSrvcLvlOwnersOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 2), EtsysSrvcLvlOwnerString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersOwner.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersOwner.setDescription('The owner described by this entry.') etsysSrvcLvlOwnersGrantedMetrics = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 3), EtsysSrvcLvlStandardMetrics()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersGrantedMetrics.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersGrantedMetrics.setDescription('Defines the metrics granted to an owner for which measurements can be performed.') etsysSrvcLvlOwnersQuota = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 4), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersQuota.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersQuota.setDescription('The maximum number of records that this owner may have in the history table.') etsysSrvcLvlOwnersIpAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 5), InetAddressType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersIpAddressType.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersIpAddressType.setDescription('The IP address type of the management entity corresponding to this owner. InetAddressType is restricted to ipv4(1),ipv6(2)and dns(16).') etsysSrvcLvlOwnersIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 6), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(1, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersIpAddress.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersIpAddress.setDescription('The IP address of the management entity corresponding to this owner.') etsysSrvcLvlOwnersEmail = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 7), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersEmail.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersEmail.setDescription('The email address of the management entity corresponding to this owner.') etsysSrvcLvlOwnersSMS = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 8), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersSMS.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersSMS.setDescription('The SMS phone number of the management entity corresponding to this owner.') etsysSrvcLvlOwnersStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 2, 1, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlOwnersStatus.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersStatus.setDescription('The status of this table entry.') etsysSrvcLvlHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1), ) if mibBuilder.loadTexts: etsysSrvcLvlHistoryTable.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryTable.setDescription('The table containing the measurement results.') etsysSrvcLvlHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1), ).setIndexNames((0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryMeasureOwner"), (0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryMeasureIndex"), (0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryMetricIndex"), (0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryIndex")) if mibBuilder.loadTexts: etsysSrvcLvlHistoryEntry.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryEntry.setDescription('An etsysSrvcLvlHistoryEntry entry is one of the results of a measure identified by etsysSrvcLvlHistoryMeasureOwner, etsysSrvcLvlHistoryMeasureIndex, etsysSrvcLvlHistoryMetricIndex and etsysSrvcLvlHistoryIndex. In the index : + etsysSrvcLvlHistoryMeasureOwner identifies the owner of the measure + etsysSrvcLvlHistoryMeasureIndex identifies the measure in the owner namespace + etsysSrvcLvlHistoryMetricIndex identifies the metric measured by the measure. The metric is described in the corresponding entry of the n etsysSrvcLvlMetricTable + etsysSrvcLvlHistoryIndex is the local index of the result on the history table.') etsysSrvcLvlHistoryMeasureOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 1), EtsysSrvcLvlOwnerString()) if mibBuilder.loadTexts: etsysSrvcLvlHistoryMeasureOwner.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryMeasureOwner.setDescription('The owner of the measure that produced this result.') etsysSrvcLvlHistoryMeasureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: etsysSrvcLvlHistoryMeasureIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryMeasureIndex.setDescription(" The index (in owner's namespace) of the measure that produced this result.") etsysSrvcLvlHistoryMetricIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: etsysSrvcLvlHistoryMetricIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryMetricIndex.setDescription(' etsysSrvcLvlHistoryMetricIndex identifies the metric measured by the measure. The metric is described in the corresponding entry of the etsysSrvcLvlMetricTable.') etsysSrvcLvlHistoryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: etsysSrvcLvlHistoryIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryIndex.setDescription(' A local index that identifies a result in the history table.') etsysSrvcLvlHistorySequence = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlHistorySequence.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistorySequence.setDescription("etsysSrvcLvlHistorySequence is the sequence index of the measurement results for a metric. Network metrics: It's the sequence index of a measurement packet. Typically, it identifies the order of the packet in the stream of packets sends by the source. Aggregated metrics: It is the sequence index of the computed aggregated metric result.") etsysSrvcLvlHistoryTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 6), GMTTimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlHistoryTimestamp.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryTimestamp.setDescription('The timestamp when the measurement occurred.') etsysSrvcLvlHistoryValue = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 3, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlHistoryValue.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryValue.setDescription('The observed value of the measurement.') etsysSrvcLvlNetMeasureTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1), ) if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTable.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTable.setDescription('An entry is a measurement that performs network measures and provides results. It performs several metric measurements per packet exchange. Each step of a measure produces a singleton result per metric. The time of the measurement and the value of the metric are saved in the etsysSrvcLvlHistoryTable.') etsysSrvcLvlNetMeasureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1), ).setIndexNames((0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureOwner"), (0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureIndex")) if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureEntry.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureEntry.setDescription('The EtsysSrvcLvlNetMeasureTable is mandatory. The etsysSrvcLvlNetMeasureMetrics is set to a list of metrics to be computed from the same raw packet exchange. Each step of measurement delivers a singleton per chosen metric. Results are timestamped and saved in the etsysSrvcLvlHistoryTable. The etsysSrvcLvlNetMeasureTable typical usage consists in providing network measure indices in order to allow aggregated measures to perform aggregation on the results of network measures.') etsysSrvcLvlNetMeasureOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 1), EtsysSrvcLvlOwnerString()) if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureOwner.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureOwner.setDescription('The owner of the network measurement.') etsysSrvcLvlNetMeasureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureIndex.setDescription("The index (in owner's namespace) of the network measure. ") etsysSrvcLvlNetMeasureName = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 3), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureName.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureName.setDescription('The name of the metric instance. It illustrates the specificity of the metric and includes the metric and the TypeP. Example: IP-TCP-HTTP-One-way-Delay: free text ') etsysSrvcLvlNetMeasureMetrics = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 4), EtsysSrvcLvlStandardMetrics()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureMetrics.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureMetrics.setDescription('Defines the metrics to compute within this measure. ONLY network metrics of the same type are allowed in this field. A measure may be configured for the result of different metric singletons to be archived in the etsysSrvcLvlHistoryTable. The etsysSrvcLvlMetricIndex of the created result has the value of the bit index of the corresponding etsysSrvcLvlMeasureMetrics as explained above in the etsysSrvcLvlMetricIndex definition. Example: A measure asking for One-way-Delay(6) and One-way-Packet-Loss(12) generated a flow of singletons which are logged in the etsysSrvcLvlHistoryTable. The singletons created for the One-way-Delay measure have a value of etsysSrvcLvlMetricIndex of 6 while the created singletons for the One-way-Packet-Loss measure have a value of etsysSrvcLvlMetricIndex of 12. One measure may perform simultaneously either several network metrics either several aggregated metrics') etsysSrvcLvlNetMeasureBeginTime = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 5), GMTTimeStamp()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureBeginTime.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureBeginTime.setDescription('Specifies the time at which the measurement begins.') etsysSrvcLvlNetMeasureDurationUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 6), TimeUnit().clone('second')).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDurationUnit.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDurationUnit.setDescription('Specifies the measurement duration unit.') etsysSrvcLvlNetMeasureDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 7), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDuration.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDuration.setDescription('Specifies the measurement duration.') etsysSrvcLvlNetMeasureHistorySize = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 8), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureHistorySize.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureHistorySize.setDescription('Specifies the maximum number of results saved for each metric of this measure. Overflow condition will be managed by the object etsysSrvcLvlNetMeasureResultsMgmt.') etsysSrvcLvlNetMeasureFailureMgmtMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("auto", 1), ("manual", 2), ("discarded", 3))).clone('auto')).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureFailureMgmtMode.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureFailureMgmtMode.setDescription("This object defines whether this row is discarded on failure. 'auto' the failure is handled automatically depending on the implementation. 'manual' the entry should be discarded manually. 'discarded' the entry is discarded all the time.") etsysSrvcLvlNetMeasureResultsMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("wrap", 1), ("suspend", 2), ("delete", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureResultsMgmt.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureResultsMgmt.setDescription(" Action to take when the log is full. The user may choose to either wrap, in which case the agent writes over existing records. The user may choose to suspend writing to the log in the event that he wishes to archive the data. The delete action causes the agent to begin to write in the log, and assumes the data has been cleared. This object indicates the way the measurement results are managed when the owner quota has been exceeded: 'wrap' continue the measurement and erase the older entries in the history. 'suspend' stop the measure and keep the results in the history. 'delete' remove the results from the history.") etsysSrvcLvlNetMeasureSrcTypeP = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 11), TypeP().clone('ip')).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureSrcTypeP.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureSrcTypeP.setDescription('Defines the type P of the source address of the packets sent by the measure.') etsysSrvcLvlNetMeasureSrc = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 12), TypePaddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureSrc.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureSrc.setDescription('Specifies the address of the source of the measure. It is represented as a list of parameters corresponding to those of the PROTOCOL IDENTIFIER sets in etsysSrvcLvlNetMeasureSrcTypeP.') etsysSrvcLvlNetMeasureDstTypeP = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 13), TypeP().clone('ip')).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDstTypeP.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDstTypeP.setDescription('Defines the type P of the destination address of the packets sent by the measure.') etsysSrvcLvlNetMeasureDst = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 14), TypePaddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDst.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDst.setDescription('Specifies the address of the destination of the measure. It is represented as a list of parameters corresponding to those of the PROTOCOL IDENTIFIER set in etsysSrvcLvlNetMeasureDstTypeP.') etsysSrvcLvlNetMeasureTxMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("other", 0), ("periodic", 1), ("poisson", 2), ("multiburst", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTxMode.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTxMode.setDescription("The transmit mode used to send the packets: 'other' The rule used to send the packets is unknown. 'periodic' Packets are sent periodically at etsysSrvcLvlNetMeasureTxPacketRate rate. 'poisson' Packets are sent using a Poisson law, the median is the value of etsysSrvcLvlNetMeasureMedOrIntBurstSize, the deviation is etsysSrvcLvlNetMeasureDevtnOrBurstSize. 'multiburst' Packets are sent bursty at etsysSrvcLvlNetMeasureTxPacketRate. The size of the burst is made of etsysSrvcLvlNetMeasureDevtnOrBurstSize packets.") etsysSrvcLvlNetMeasureTxPacketRateUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 16), TimeUnit()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTxPacketRateUnit.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTxPacketRateUnit.setDescription('The packet rate unit used to send the packets.') etsysSrvcLvlNetMeasureTxPacketRate = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 17), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTxPacketRate.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureTxPacketRate.setDescription('The rate the packets are sent.') etsysSrvcLvlNetMeasureDevtnOrBurstSize = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 18), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDevtnOrBurstSize.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDevtnOrBurstSize.setDescription('Indicates the average number of packets per seconds sent using a poisson law.') etsysSrvcLvlNetMeasureMedOrIntBurstSize = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 19), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureMedOrIntBurstSize.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureMedOrIntBurstSize.setDescription('According to the transmit mode, this value indicates the average number of packets per seconds sent using a poisson law, or the number of packets to wait between consecutive bursts.') etsysSrvcLvlNetMeasureLossTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 20), Integer32()).setUnits('Milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureLossTimeout.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureLossTimeout.setDescription('Specifies the delay after which the packet is considered lost by the sink.') etsysSrvcLvlNetMeasureL3PacketSize = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 21), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureL3PacketSize.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureL3PacketSize.setDescription("Specifies the size of the packets counted at the IP network layer in regards to the TypeP definition. Example: For a TypeP 'ip ipip4' the L3 size will be the size of the packet at ipip4 level.") etsysSrvcLvlNetMeasureDataPattern = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 22), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDataPattern.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureDataPattern.setDescription('The pattern used to fill the payload of the packet.') etsysSrvcLvlNetMeasureMap = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 23), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureMap.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureMap.setDescription('An administrative name of a network management map to which the measure belongs.') etsysSrvcLvlNetMeasureSingletons = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureSingletons.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureSingletons.setDescription('Reports the number of singletons performed per metric by the measure since the beginning of the measure. This parameters is required for aggregation.') etsysSrvcLvlNetMeasureOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("unknown", 0), ("running", 1), ("stopped", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureOperState.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlNetMeasureOperState.setDescription('Reports the operational status of the network measure.') etsysSrvcLvlAggrMeasureTable = MibTable((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2), ) if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureTable.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureTable.setDescription(' An aggregated measure summarizes the results of previous network or aggregated measures. The results may be saved in the etsysSrvcLvlHistoryTable. Each step of the calculation for the measure produces a singleton result per metric.') etsysSrvcLvlAggrMeasureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1), ).setIndexNames((0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureOwner"), (0, "ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureIndex")) if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureEntry.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureEntry.setDescription('Typically the configuration operation sets the value of the EtsysSrvcLvlAggrMeasureEntry. etsysSrvcLvlAggrMeasureTable is mandatory. The etsysSrvcLvlAggrMeasureMetrics defines the metric to compute. The results of the measure to summarize are identified by: + etsysSrvcLvlAggrMeasureHistoryOwner, + etsysSrvcLvlAggrMeasureHistoryOwnerIndex and + etsysSrvcLvlAggrMeasureHistoryMetric The aggregated task starts at etsysSrvcLvlAggrMeasureBeginTime and ends after etsysSrvcLvlAggrMeasureDuration. An aggregated result is performed and saved in the etsysSrvcLvlHistoryTable for each etsysSrvcLvlAggrMeasureAggrPeriod.') etsysSrvcLvlAggrMeasureOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 1), EtsysSrvcLvlOwnerString()) if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureOwner.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureOwner.setDescription('The owner who has configured this entry.') etsysSrvcLvlAggrMeasureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureIndex.setDescription("The index (in owner's namespace) of the measure. The value is managed by the owner.") etsysSrvcLvlAggrMeasureName = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 3), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureName.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureName.setDescription('The name of the instance of the metric. It illustrates the specificity of the metric and includes the metric and the typeP. example: IP-port-HTTP-connectivity') etsysSrvcLvlAggrMeasureMetrics = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 4), EtsysSrvcLvlStandardMetrics()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureMetrics.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureMetrics.setDescription('Defines the metrics to compute within this aggregated measure. ONLY aggregated metrics of the same type are allowed in this field. A measure may be configured for the result of different metric singletons to be archived in the etsysSrvcLvlHistoryTable. The etsysSrvcLvlMetricIndex of the created result has the value of the bit index of the corresponding etsysSrvcLvlAggrMeasureMetrics as explained above in the etsysSrvcLvlMetricIndex definition. Example: A measure asking for One-way-Delay(6) and One-way-Packet-Loss(12) generated a flow of singletons which are logged in the etsysSrvcLvlHistoryTable. The singletons created for the One-way-Delay measure have a value of etsysSrvcLvlMetricIndex of 6 while the created singletons for the One-way-Packet-Loss measure have a value of etsysSrvcLvlMetricIndex of 12.') etsysSrvcLvlAggrMeasureBeginTime = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 5), GMTTimeStamp()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureBeginTime.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureBeginTime.setDescription('Specifies the time at which the aggregated measure starts.') etsysSrvcLvlAggrMeasureAggrPeriodUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 6), TimeUnit().clone('second')).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureAggrPeriodUnit.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureAggrPeriodUnit.setDescription('Specifies the unit of the aggregated measure period.') etsysSrvcLvlAggrMeasureAggrPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 7), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureAggrPeriod.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureAggrPeriod.setDescription('Specifies the amount of time between 2 measurement action intervals. The action is specific to the semantic of the measure. They are performed periodically on a sequence of results of other measures. The period corresponds to the interval between two successive computations of the metric. The value of etsysSrvcLvlHistoryTimestamp result of a aggregated metric computed corresponds to the value of the etsysSrvcLvlHistoryTimestamp of the last metric result of the sequence used in to compute the aggregated metric.') etsysSrvcLvlAggrMeasureDurationUnit = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 8), TimeUnit().clone('second')).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureDurationUnit.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureDurationUnit.setDescription('Specifies the unit of the measure duration.') etsysSrvcLvlAggrMeasureDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 9), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureDuration.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureDuration.setDescription('Specifies the duration of the measure.') etsysSrvcLvlAggrMeasureHistorySize = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 10), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistorySize.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistorySize.setDescription('Specifies the maximum number of results saved for each metric of this measure. Overflow condition will be managed by the object etsysSrvcLvlAggrMeasureResultsMgmt. ') etsysSrvcLvlAggrMeasureStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 11), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureStorageType.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureStorageType.setDescription('This object defines whether this row and the corresponding entry in the etsysSrvcLvlNetMeasureTable is kept in volatile storage and lost upon reboot or if this row is backed up by non-volatile or permanent storage. Possible values are: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5).') etsysSrvcLvlAggrMeasureResultsMgmt = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("wrap", 1), ("suspend", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureResultsMgmt.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureResultsMgmt.setDescription("This object displays the way the history of the aggregated measure is managed. 'wrap' continue the measure and erase the older entries in the history. 'suspend' stop the measure and keep the results in the history. ") etsysSrvcLvlAggrMeasureHistoryOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 13), EtsysSrvcLvlOwnerString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistoryOwner.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistoryOwner.setDescription('The owner of the measure to summarize. ') etsysSrvcLvlAggrMeasureHistoryOwnerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistoryOwnerIndex.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistoryOwnerIndex.setDescription("The index (in owner's namespace) of the measure to summarize. ") etsysSrvcLvlAggrMeasureHistoryMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 15), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistoryMetric.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureHistoryMetric.setDescription('The metric of the measure to summarize. ') etsysSrvcLvlAggrMeasureAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("start", 0), ("stop", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureAdminState.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureAdminState.setDescription("This object controls the activity of the aggregated measure. 'start' The aggregated measure is started. 'stop' The aggregated measure is stopped. ") etsysSrvcLvlAggrMeasureMap = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 17), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureMap.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureMap.setDescription('This object allows for classification of the measure. It is typically the name of an administrative map. ') etsysSrvcLvlAggrMeasureStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 1, 4, 2, 1, 18), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureStatus.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlAggrMeasureStatus.setDescription('The status of this table entry. Once the entry status is set to active, the associate entry cannot be modified. The creation of an aggregated measure forced the creation of the corresponding entry in etsysSrvcLvlNetMeasureTable.') etsysSrvcLvlReportingConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2)) etsysSrvcLvlReportingGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 1)) etsysSrvcLvlReportingCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 2)) etsysSrvcLvlSystemGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 1, 1)).setObjects(("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlSystemTime"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlSystemClockResolution"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlMetricCapabilities"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlMetricType"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlMetricUnit"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlMetricDescription")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysSrvcLvlSystemGroup = etsysSrvcLvlSystemGroup.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlSystemGroup.setDescription('The System Group.') etsysSrvcLvlOwnersGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 1, 2)).setObjects(("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersOwner"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersGrantedMetrics"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersQuota"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersIpAddressType"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersIpAddress"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersEmail"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersSMS"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysSrvcLvlOwnersGroup = etsysSrvcLvlOwnersGroup.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlOwnersGroup.setDescription('The Owners Group.') etsysSrvcLvlHistoryGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 1, 3)).setObjects(("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistorySequence"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryTimestamp"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryValue")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysSrvcLvlHistoryGroup = etsysSrvcLvlHistoryGroup.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlHistoryGroup.setDescription('The History Group.') etsysSrvcLvlMeasureGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 1, 4)).setObjects(("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureName"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureMetrics"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureBeginTime"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureDurationUnit"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureDuration"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureHistorySize"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureFailureMgmtMode"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureResultsMgmt"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureSrcTypeP"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureSrc"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureDstTypeP"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureDst"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureTxMode"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureTxPacketRateUnit"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureTxPacketRate"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureDevtnOrBurstSize"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureMedOrIntBurstSize"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureLossTimeout"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureL3PacketSize"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureDataPattern"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureMap"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureSingletons"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlNetMeasureOperState"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureName"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureMetrics"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureBeginTime"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureAggrPeriodUnit"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureAggrPeriod"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureDurationUnit"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureDuration"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureHistorySize"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureStorageType"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureResultsMgmt"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureHistoryOwner"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureHistoryOwnerIndex"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureHistoryMetric"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureAdminState"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureMap"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlAggrMeasureStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysSrvcLvlMeasureGroup = etsysSrvcLvlMeasureGroup.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlMeasureGroup.setDescription('The Network and Aggregate Measures Group.') etsysSrvcLvlReportingCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 5624, 1, 2, 39, 2, 2, 1)).setObjects(("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlSystemGroup"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlOwnersGroup"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlHistoryGroup"), ("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", "etsysSrvcLvlMeasureGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): etsysSrvcLvlReportingCompliance = etsysSrvcLvlReportingCompliance.setStatus('current') if mibBuilder.loadTexts: etsysSrvcLvlReportingCompliance.setDescription('The compliance statement for devices that support the etsysSrvcLvlReportingMib.') mibBuilder.exportSymbols("ENTERASYS-SERVICE-LEVEL-REPORTING-MIB", etsysSrvcLvlSystemTime=etsysSrvcLvlSystemTime, etsysSrvcLvlHistory=etsysSrvcLvlHistory, etsysSrvcLvlAggrMeasureDurationUnit=etsysSrvcLvlAggrMeasureDurationUnit, etsysSrvcLvlHistorySequence=etsysSrvcLvlHistorySequence, etsysSrvcLvlNetMeasureSrc=etsysSrvcLvlNetMeasureSrc, etsysSrvcLvlAggrMeasureAggrPeriod=etsysSrvcLvlAggrMeasureAggrPeriod, etsysSrvcLvlNetMeasureHistorySize=etsysSrvcLvlNetMeasureHistorySize, etsysSrvcLvlNetMeasureDstTypeP=etsysSrvcLvlNetMeasureDstTypeP, etsysSrvcLvlNetMeasureBeginTime=etsysSrvcLvlNetMeasureBeginTime, etsysSrvcLvlAggrMeasureOwner=etsysSrvcLvlAggrMeasureOwner, etsysSrvcLvlNetMeasureResultsMgmt=etsysSrvcLvlNetMeasureResultsMgmt, etsysSrvcLvlHistoryTimestamp=etsysSrvcLvlHistoryTimestamp, etsysSrvcLvlOwnersEmail=etsysSrvcLvlOwnersEmail, etsysSrvcLvlNetMeasureName=etsysSrvcLvlNetMeasureName, etsysSrvcLvlMetricCapabilities=etsysSrvcLvlMetricCapabilities, etsysSrvcLvlOwnersIpAddress=etsysSrvcLvlOwnersIpAddress, etsysSrvcLvlAggrMeasureResultsMgmt=etsysSrvcLvlAggrMeasureResultsMgmt, etsysSrvcLvlNetMeasureEntry=etsysSrvcLvlNetMeasureEntry, GMTTimeStamp=GMTTimeStamp, etsysSrvcLvlNetMeasureOperState=etsysSrvcLvlNetMeasureOperState, etsysSrvcLvlOwnersEntry=etsysSrvcLvlOwnersEntry, TypeP=TypeP, TypePaddress=TypePaddress, etsysSrvcLvlHistoryIndex=etsysSrvcLvlHistoryIndex, etsysSrvcLvlOwnersIndex=etsysSrvcLvlOwnersIndex, etsysSrvcLvlHistoryValue=etsysSrvcLvlHistoryValue, etsysSrvcLvlNetMeasureOwner=etsysSrvcLvlNetMeasureOwner, etsysSrvcLvlNetMeasureFailureMgmtMode=etsysSrvcLvlNetMeasureFailureMgmtMode, etsysSrvcLvlNetMeasureSrcTypeP=etsysSrvcLvlNetMeasureSrcTypeP, etsysSrvcLvlReportingConformance=etsysSrvcLvlReportingConformance, etsysSrvcLvlHistoryGroup=etsysSrvcLvlHistoryGroup, etsysSrvcLvlNetMeasureSingletons=etsysSrvcLvlNetMeasureSingletons, etsysSrvcLvlNetMeasureDst=etsysSrvcLvlNetMeasureDst, etsysSrvcLvlOwnersTable=etsysSrvcLvlOwnersTable, etsysSrvcLvlAggrMeasureHistoryOwnerIndex=etsysSrvcLvlAggrMeasureHistoryOwnerIndex, etsysSrvcLvlNetMeasureMap=etsysSrvcLvlNetMeasureMap, etsysSrvcLvlHistoryTable=etsysSrvcLvlHistoryTable, etsysSrvcLvlReportingCompliances=etsysSrvcLvlReportingCompliances, etsysSrvcLvlMetricEntry=etsysSrvcLvlMetricEntry, etsysSrvcLvlNetMeasureTxMode=etsysSrvcLvlNetMeasureTxMode, etsysSrvcLvlMeasure=etsysSrvcLvlMeasure, etsysSrvcLvlNetMeasureTxPacketRateUnit=etsysSrvcLvlNetMeasureTxPacketRateUnit, etsysSrvcLvlNetMeasureL3PacketSize=etsysSrvcLvlNetMeasureL3PacketSize, EtsysSrvcLvlStandardMetrics=EtsysSrvcLvlStandardMetrics, etsysSrvcLvlAggrMeasureDuration=etsysSrvcLvlAggrMeasureDuration, etsysSrvcLvlNetMeasureTable=etsysSrvcLvlNetMeasureTable, EtsysSrvcLvlOwnerString=EtsysSrvcLvlOwnerString, etsysSrvcLvlAggrMeasureHistoryMetric=etsysSrvcLvlAggrMeasureHistoryMetric, etsysSrvcLvlMeasureGroup=etsysSrvcLvlMeasureGroup, etsysSrvcLvlMetricType=etsysSrvcLvlMetricType, etsysSrvcLvlHistoryMetricIndex=etsysSrvcLvlHistoryMetricIndex, etsysSrvcLvlNetMeasureMetrics=etsysSrvcLvlNetMeasureMetrics, etsysSrvcLvlNetMeasureLossTimeout=etsysSrvcLvlNetMeasureLossTimeout, etsysSrvcLvlMetricDescription=etsysSrvcLvlMetricDescription, etsysSrvcLvlAggrMeasureStorageType=etsysSrvcLvlAggrMeasureStorageType, etsysSrvcLvlAggrMeasureStatus=etsysSrvcLvlAggrMeasureStatus, etsysSrvcLvlMetricIndex=etsysSrvcLvlMetricIndex, etsysSrvcLvlOwnersQuota=etsysSrvcLvlOwnersQuota, etsysSrvcLvlAggrMeasureMap=etsysSrvcLvlAggrMeasureMap, etsysSrvcLvlAggrMeasureName=etsysSrvcLvlAggrMeasureName, etsysSrvcLvlNetMeasureDevtnOrBurstSize=etsysSrvcLvlNetMeasureDevtnOrBurstSize, etsysSrvcLvlSystemGroup=etsysSrvcLvlSystemGroup, etsysSrvcLvlHistoryMeasureIndex=etsysSrvcLvlHistoryMeasureIndex, etsysSrvcLvlHistoryEntry=etsysSrvcLvlHistoryEntry, TimeUnit=TimeUnit, etsysSrvcLvlAggrMeasureHistoryOwner=etsysSrvcLvlAggrMeasureHistoryOwner, etsysServiceLevelReportingMIB=etsysServiceLevelReportingMIB, etsysSrvcLvlNetMeasureDataPattern=etsysSrvcLvlNetMeasureDataPattern, etsysSrvcLvlHistoryMeasureOwner=etsysSrvcLvlHistoryMeasureOwner, etsysSrvcLvlNetMeasureDuration=etsysSrvcLvlNetMeasureDuration, etsysSrvcLvlOwners=etsysSrvcLvlOwners, etsysSrvcLvlNetMeasureTxPacketRate=etsysSrvcLvlNetMeasureTxPacketRate, etsysSrvcLvlAggrMeasureAggrPeriodUnit=etsysSrvcLvlAggrMeasureAggrPeriodUnit, etsysSrvcLvlOwnersSMS=etsysSrvcLvlOwnersSMS, etsysSrvcLvlAggrMeasureAdminState=etsysSrvcLvlAggrMeasureAdminState, etsysSrvcLvlAggrMeasureTable=etsysSrvcLvlAggrMeasureTable, etsysSrvcLvlAggrMeasureIndex=etsysSrvcLvlAggrMeasureIndex, etsysSrvcLvlNetMeasureMedOrIntBurstSize=etsysSrvcLvlNetMeasureMedOrIntBurstSize, etsysSrvcLvlOwnersStatus=etsysSrvcLvlOwnersStatus, etsysSrvcLvlConfigObjects=etsysSrvcLvlConfigObjects, etsysSrvcLvlMetricTable=etsysSrvcLvlMetricTable, etsysSrvcLvlAggrMeasureHistorySize=etsysSrvcLvlAggrMeasureHistorySize, etsysSrvcLvlMetricUnit=etsysSrvcLvlMetricUnit, etsysSrvcLvlOwnersGrantedMetrics=etsysSrvcLvlOwnersGrantedMetrics, etsysSrvcLvlAggrMeasureEntry=etsysSrvcLvlAggrMeasureEntry, etsysSrvcLvlReportingCompliance=etsysSrvcLvlReportingCompliance, etsysSrvcLvlSystem=etsysSrvcLvlSystem, etsysSrvcLvlOwnersIpAddressType=etsysSrvcLvlOwnersIpAddressType, etsysSrvcLvlOwnersGroup=etsysSrvcLvlOwnersGroup, etsysSrvcLvlNetMeasureIndex=etsysSrvcLvlNetMeasureIndex, etsysSrvcLvlNetMeasureDurationUnit=etsysSrvcLvlNetMeasureDurationUnit, etsysSrvcLvlAggrMeasureMetrics=etsysSrvcLvlAggrMeasureMetrics, etsysSrvcLvlReportingGroups=etsysSrvcLvlReportingGroups, etsysSrvcLvlOwnersOwner=etsysSrvcLvlOwnersOwner, etsysSrvcLvlAggrMeasureBeginTime=etsysSrvcLvlAggrMeasureBeginTime, PYSNMP_MODULE_ID=etsysServiceLevelReportingMIB, etsysSrvcLvlSystemClockResolution=etsysSrvcLvlSystemClockResolution)
f8772b8d3610eba283c33f7c31d167ed869482c9
7f29e2c30e047ec59fb104d4f0953a8a8bbead51
/rb/complexity/rhythm/usage.py
6c65f3db5628a3b48d6c2209ab3f4b4d85d86f6e
[ "Apache-2.0" ]
permissive
rwth-acis/readerbenchpy
69597dc1f2d500aea2be49981799aa20a0e6ea68
1a070ae678f58ccd6f358c0802bdf0b3b3dde9d3
refs/heads/main
2023-07-17T11:57:25.507494
2021-09-03T12:49:10
2021-09-03T12:49:10
348,343,445
1
0
null
null
null
null
UTF-8
Python
false
false
2,049
py
from rb.core.document import Document from rb.core.lang import Lang from rb.core.text_element_type import TextElementType from rb.complexity.measure_function import MeasureFunction from rb.complexity.rhythm.no_alliterations import NoAlliterations from rb.complexity.rhythm.no_assonances import NoAssonances # import nltk # nltk.download() txt1 = """ This is a sample document. It can contain, multiple sentences and paragraphs and repeating sentences. This is considered a new block (paragraph). Therefore in total are 3 blocks. """ txt2 = """ S-a născut repede la 1 februarie 1852,[3] în satul Haimanale (care astăzi îi poartă numele), fiind primul născut al lui Luca Ștefan Caragiale și al Ecaterinei Chiriac Karaboas. Conform unor surse, familia sa ar fi fost de origine aromână.[6] Tatăl său, Luca (1812 - 1870), și frații acestuia, Costache și Iorgu, s-au născut la Constantinopol, fiind fiii lui Ștefan, un bucătar angajat la sfârșitul anului 1812 de Ioan Vodă Caragea în suita sa. """ alliteration1 = """ Greedy goats gobbled up gooseberries, getting good at grabbing the goodies. """ alliteration2 = """ Up the aisle the moans and screams merged with the sickening smell of woolen black clothes worn in summer weather and green leaves wilting over yellow flowers. """ alliteration3 = """ When the canary keeled over the coal miners left the cave. """ alliteration4 = """ I forgot my flip phone but felt free. """ assonance1 = """ That solitude which suits abstruser musings. """ assonance2 = """ I must confess that in my quest I felt depressed and restless. """ # element = Document(Lang.EN, alliteration2) # index = NoAlliterations(element.lang, TextElementType.SENT.value, None) # index.process(element) # element = Document(Lang.EN, assonance1) # index = NoAssonances(element.lang, TextElementType.SENT.value, None) # index.process(element) element = Document(Lang.RO, txt2)
e29ee6ad0af2ac05c635f6f43c64c1d6f67ddf13
c9ab605cdd2dbf92c9de05768ade0ecf1718be02
/api 활용/rest.py
5edba3b8356a963deb8a80da2fff32a437fe3817
[]
no_license
PyeongGang-Kim/TIL
42d69308cf99d2e07644b51d7636e1b64551a697
8711501d131ee7d78fdaac544dda2008adf820a1
refs/heads/master
2023-01-12T21:10:38.027946
2021-10-23T07:19:48
2021-10-23T07:19:48
195,937,990
10
1
null
2023-01-07T11:25:30
2019-07-09T05:22:45
HTML
UTF-8
Python
false
false
977
py
import requests, json def ans(): global data data["yourAnswer"] = input() def seturl(): global url url = urlbase+res.json()['nextUrl'] r = [] data = { "nickname": "구미1반김평강", "yourAnswer":"1" } urlbase = "http://13.125.222.176/quiz/" idx = "jordan" url = urlbase+idx header = { "Accept": "application/json", "Content-Type": "application/json" } tmp = '' while 1: res = requests.post(url, data=json.dumps(data), headers=header) if res.status_code == 200: r.append(data["yourAnswer"]) r.append(res.json()) if res.json()['nextUrl'] == "수고하셨습니다.": break print(res.json()['question']) if res.json()['code'] == 600: print("오답입니다.") print(tmp) ans() continue seturl() ans() tmp = res.json()['question'] else: print(res) ans() for rr in r: print(rr)
aa790bc34441cd4186ce10350ab783afe7095ad8
1edd52cf197e5ae67b5939a3beb3e70761334e62
/Notes/Notes/Udemy/Aws_boto3_refresh/Session-5-Waiters/tags1.py
81cc86fb506d96deb89eae42df117690eaa4687a
[]
no_license
sandeepmchary/Devops_wordpress_Notes
bdcd85d526780d03c494ecb93e714e7ffe0a4d58
ffd2092162073e1e7342c6066d023d04e6ca8c1c
refs/heads/master
2022-06-18T21:33:02.471025
2022-06-12T11:14:47
2022-06-12T11:14:47
154,679,658
1
4
null
2022-05-19T16:59:57
2018-10-25T13:51:40
HTML
UTF-8
Python
false
false
517
py
import boto3 from pprint import pprint ec2_re = boto3.resource('ec2',) ec2_cli = boto3.client('ec2',) response=ec2_cli.describe_tags() values_list=[] for each_in in ec2_cli.describe_instances()['Reservations']: for each_res in each_in['Instances']: for each_tag in response['Tags']: values_list.append(each_tag) #print("id:{0}\nState:{1}\nPublic_Dns_name:{2}\ntag:{3}".format(each_res['InstanceId'],each_res['State']['Name'],each_res['PublicDnsName'],each_tag['Value'])) print(values_list[0]['Value'])
ae83b1bf593af03cf04cf0ad76ea4689908db278
e3d061e3692c4003b616dfc9b7655ad7889b5b10
/apps/strawberry_fields_listener.py
b3c6c3d0731862f381a18fc1bda242ac3335093e
[ "Apache-2.0" ]
permissive
nuzumco/blackbird
515a84a40e4a98eefb18e7c98cbc358d848f45d9
1e78aa210d9c1acfabf12ee12d25b22bafbe51e1
refs/heads/master
2020-05-18T08:55:42.843764
2019-04-26T18:57:56
2019-04-26T18:57:56
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,349
py
# Copyright 2019 Xanadu Quantum Technologies Inc. # 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. # pylint: disable=too-many-return-statements,too-many-branches,too-many-instance-attributes """Strawberry Fields Blackbird parser""" import sys import antlr4 import numpy as np import strawberryfields as sf import strawberryfields.ops as sfo from blackbird import BlackbirdListener, RegRefTransform, parse class StrawberryFieldsListener(BlackbirdListener): """Listener to run a Blackbird program using Strawberry Fields""" def __init__(self): super().__init__() self.eng = None self.q = None self.state = None self.result = [] def run(self): if self.target is None: raise ValueError("Blackbird program has no target backend") self.eng, self.q = sf.Engine( len(self.active_modes), hbar=self.target['options'].get('hbar', 2) ) self.target['options'].pop('hbar', None) with self.eng: for statement in self.queue: modes = statement['modes'] if 'args' in statement: args = statement['args'] kwargs = statement['kwargs'] for idx, a in enumerate(args): if isinstance(a, RegRefTransform): regrefs = [self.q[i] for i in a.regrefs] args[idx] = sf.engine.RegRefTransform(regrefs, a.func, a.func_str) op = getattr(sfo, statement['op'])(*args, **kwargs) else: op = getattr(sfo, statement['op']) op | [self.q[i] for i in modes] #pylint:disable=pointless-statement shots = self.target['options'].get('shots', 1) self.target['options'].pop('shots', None) for _ in range(shots): self.eng.reset(keep_history=True) self.state = self.eng.run(self.target['name'], **self.target['options']) self.result.append([q.val for q in self.q]) def print_results(self): """Print the results of the blackbird program execution""" print('Program') print('-------') self.eng.print_applied() print() print('Results') print('-------') for row in self.result: print(row) def run(file): """Parse and run a blackbird program using Strawberry Fields. Args: file (str): location of the .xbb blackbird file to run Returns: list: list of size ``[shots, num_subsystems]``, representing the measured qumode values for each shot """ simulation = parse(antlr4.FileStream(file), listener=StrawberryFieldsListener) simulation.run() simulation.print_results() if __name__ == '__main__': run(sys.argv[1])
e52af5f18448cc2cbf4a1ceababf69ed635d5df8
a17cf805fc6a4dc187355e62c9480c6b3c834d53
/dashboard/dashboard/pinpoint/models/quest/read_value.py
a2f98a65c2c6352536ec5730b49f6da453b9f51d
[ "BSD-3-Clause" ]
permissive
shreya99oak/catapult
6a42740bfea5eb7513e0054b66b13fab3ffd26b7
8d2c28ec7666a034afe50a59f862ea94cef42d9a
refs/heads/master
2020-03-21T14:53:09.065230
2018-06-22T23:30:37
2018-06-25T16:57:52
null
0
0
null
null
null
null
UTF-8
Python
false
false
9,414
py
# 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. import json from dashboard.common import histogram_helpers from dashboard.pinpoint.models.quest import execution from dashboard.pinpoint.models.quest import quest from dashboard.services import isolate from tracing.value import histogram_set from tracing.value.diagnostics import diagnostic_ref from tracing.value.diagnostics import reserved_infos class ReadValueError(Exception): pass class ReadHistogramsJsonValue(quest.Quest): def __init__(self, results_filename, hist_name=None, tir_label=None, story=None, statistic=None): self._results_filename = results_filename self._hist_name = hist_name self._tir_label = tir_label self._story = story self._statistic = statistic def __eq__(self, other): return (isinstance(other, type(self)) and self._results_filename == other._results_filename and self._hist_name == other._hist_name and self._tir_label == other._tir_label and self._story == other._story and self._statistic == other._statistic) def __str__(self): return 'Values' def Start(self, change, isolate_server=None, isolate_hash=None): del change # TODO(dtu): Remove after data migration. # isolate_server and isolate_hash are required arguments. assert isolate_hash if not isolate_server: isolate_server = 'https://isolateserver.appspot.com' return _ReadHistogramsJsonValueExecution( self._results_filename, self._hist_name, self._tir_label, self._story, self._statistic, isolate_server, isolate_hash) @classmethod def FromDict(cls, arguments): benchmark = arguments.get('benchmark') if not benchmark: raise TypeError('Missing "benchmark" argument.') if arguments.get('target') == 'performance_test_suite': results_filename = benchmark + '/perf_results.json' else: # TODO: Remove this hack when all builders build performance_test_suite. results_filename = 'chartjson-output.json' chart = arguments.get('chart') tir_label = arguments.get('tir_label') trace = arguments.get('trace') statistic = arguments.get('statistic') return cls(results_filename, chart, tir_label, trace, statistic) class _ReadHistogramsJsonValueExecution(execution.Execution): def __init__(self, results_filename, hist_name, tir_label, story, statistic, isolate_server, isolate_hash): super(_ReadHistogramsJsonValueExecution, self).__init__() self._results_filename = results_filename self._hist_name = hist_name self._tir_label = tir_label self._story = story self._statistic = statistic self._isolate_server = isolate_server self._isolate_hash = isolate_hash self._trace_urls = [] def _AsDict(self): return [{ 'key': 'trace', 'value': trace_url['name'], 'url': trace_url['url'], } for trace_url in self._trace_urls] def _Poll(self): # TODO(dtu): Remove after data migration. if not hasattr(self, '_isolate_server'): self._isolate_server = 'https://isolateserver.appspot.com' if not hasattr(self, '_results_filename'): self._results_filename = 'chartjson-output.json' histogram_dicts = _RetrieveOutputJson( self._isolate_server, self._isolate_hash, self._results_filename) histograms = histogram_set.HistogramSet() histograms.ImportDicts(histogram_dicts) histograms.ResolveRelatedHistograms() matching_histograms = histograms.GetHistogramsNamed(self._hist_name) # Get and cache any trace URLs. unique_trace_urls = set() for hist in histograms: trace_urls = hist.diagnostics.get(reserved_infos.TRACE_URLS.name) # TODO(simonhatch): Remove this sometime after May 2018. We had a # brief period where the histograms generated by tests had invalid # trace_urls diagnostics. If the diagnostic we get back is just a ref, # then skip. # https://github.com/catapult-project/catapult/issues/4243 if trace_urls and not isinstance( trace_urls, diagnostic_ref.DiagnosticRef): unique_trace_urls.update(trace_urls) sorted_urls = sorted(unique_trace_urls) self._trace_urls = [ {'name': t.split('/')[-1], 'url': t} for t in sorted_urls] # Filter the histograms by tir_label and story. Getting either the # tir_label or the story from a histogram involves pulling out and # examining various diagnostics associated with the histogram. tir_label = self._tir_label or '' matching_histograms = [ h for h in matching_histograms if tir_label == histogram_helpers.GetTIRLabelFromHistogram(h)] # If no story is supplied, we're looking for a summary metric so just match # on name and tir_label. This is equivalent to the chartjson condition that # if no story is specified, look for "summary". if self._story: matching_histograms = [ h for h in matching_histograms if self._story == _GetStoryFromHistogram(h)] # Have to pull out either the raw sample values, or the statistic result_values = [] for h in matching_histograms: result_values.extend(self._GetValuesOrStatistic(h)) if not result_values and self._hist_name: conditions = {'histogram': self._hist_name} if tir_label: conditions['tir_label'] = tir_label if self._story: conditions['story'] = self._story raise ReadValueError('Could not find values matching: %s' % conditions) self._Complete(result_values=tuple(result_values)) def _GetValuesOrStatistic(self, hist): if not self._statistic: return hist.sample_values if not hist.sample_values: return [] # TODO(simonhatch): Use Histogram.getStatisticScalar when it's ported from # js. if self._statistic == 'avg': return [hist.running.mean] elif self._statistic == 'min': return [hist.running.min] elif self._statistic == 'max': return [hist.running.max] elif self._statistic == 'sum': return [hist.running.sum] elif self._statistic == 'std': return [hist.running.stddev] elif self._statistic == 'count': return [hist.running.count] raise ReadValueError('Unknown statistic type: %s' % self._statistic) class ReadGraphJsonValue(quest.Quest): def __init__(self, chart, trace): self._chart = chart self._trace = trace def __eq__(self, other): return (isinstance(other, type(self)) and self._chart == other._chart and self._trace == other._trace) def __str__(self): return 'Values' def Start(self, change, isolate_server=None, isolate_hash=None): del change # TODO(dtu): Remove after data migration. # isolate_server and isolate_hash are required arguments. assert isolate_hash if not isolate_server: isolate_server = 'https://isolateserver.appspot.com' return _ReadGraphJsonValueExecution( self._chart, self._trace, isolate_server, isolate_hash) @classmethod def FromDict(cls, arguments): chart = arguments.get('chart') trace = arguments.get('trace') if not (chart or trace): return None if chart and not trace: raise TypeError('"chart" specified but no "trace" given.') if trace and not chart: raise TypeError('"trace" specified but no "chart" given.') return cls(chart, trace) class _ReadGraphJsonValueExecution(execution.Execution): def __init__(self, chart, trace, isolate_server, isolate_hash): super(_ReadGraphJsonValueExecution, self).__init__() self._chart = chart self._trace = trace self._isolate_server = isolate_server self._isolate_hash = isolate_hash def _AsDict(self): # TODO(dtu): Remove after data migration. if not hasattr(self, '_isolate_server'): self._isolate_server = 'https://isolateserver.appspot.com' return {'isolate_server': self._isolate_server} def _Poll(self): # TODO(dtu): Remove after data migration. if not hasattr(self, '_isolate_server'): self._isolate_server = 'https://isolateserver.appspot.com' graphjson = _RetrieveOutputJson( self._isolate_server, self._isolate_hash, 'chartjson-output.json') if self._chart not in graphjson: raise ReadValueError('The chart "%s" is not in the results.' % self._chart) if self._trace not in graphjson[self._chart]['traces']: raise ReadValueError('The trace "%s" is not in the results.' % self._trace) result_value = float(graphjson[self._chart]['traces'][self._trace][0]) self._Complete(result_values=(result_value,)) def _RetrieveOutputJson(isolate_server, isolate_hash, filename): output_files = json.loads(isolate.Retrieve( isolate_server, isolate_hash))['files'] if filename not in output_files: raise ReadValueError("The test didn't produce %s." % filename) output_json_isolate_hash = output_files[filename]['h'] return json.loads(isolate.Retrieve(isolate_server, output_json_isolate_hash)) def _GetStoryFromHistogram(hist): stories = hist.diagnostics.get(reserved_infos.STORIES.name) if stories and len(stories) == 1: return list(stories)[0] return None
c8f7dcd011aa4533b5ba8dec9e3a4ed1b8232057
12362aa3c315e2b72ed29193ee24e3fd7f1a57db
/LeetCode/0780-Reaching Points/main.py
0176d04c47bb9471fbfb6eb85d0b18ce9355da7a
[]
no_license
PRKKILLER/Algorithm_Practice
f2f4662352516965777605ccf116dd7945c4b94a
73654b6567fdb282af84a868608929be234075c5
refs/heads/master
2023-07-03T23:24:15.081892
2021-08-09T03:55:12
2021-08-09T03:55:12
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,773
py
""" A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given a starting point (sx, sy) and a target point (tx, ty), return True if and only if a sequence of moves exists to transform the point (sx, sy) to (tx, ty). Otherwise, return False. Examples: Input: sx = 1, sy = 1, tx = 3, ty = 5 Output: True Explanation: One series of moves that transforms the starting point to the target is: (1, 1) -> (1, 2) (1, 2) -> (3, 2) (3, 2) -> (3, 5) Input: sx = 1, sy = 1, tx = 2, ty = 2 Output: False Input: sx = 1, sy = 1, tx = 1, ty = 1 Output: True """ class Solution: """ 1. 方法1: Top-down approach 对于任意moment (x, y), 它有两个选择进行状态转移: (1) (x, x+y) (2) (x+y, x) 这就构成了二叉树 """ def reachingPoints(self, sx, sy, tx, ty): if sx == tx and sy == ty: return True if sx > tx or sy > ty: return False return self.reachingPoints(sx, sx + sy, tx, ty) or self.reachingPoints(sx + sy, sy, tx, ty) """ 2. 方法2: Bottom-up approach 观察可知,对于任意child node, 只有一条路可以reach its parent,eventually to the root of the binary tree 这就意味着,我们不需要从(sx, sy)出发,而是从(tx, ty)出发,一直向上搜索,直到碰到 conditions like: sx >= tx or sy >= ty """ def reachingPoints2(self, sx, sy, tx, ty): while sx < tx and sy < ty: if tx < ty: ty %= tx else: tx %= ty if sx == tx and sy <= ty and (ty - sy) % sx == 0: return True if sy == ty and sx <= tx and (tx - sx) % sy == 0: return True return False
bf5db3fd4ad992f0cb25f1ba501df5f3e33e269f
1797576f7ebc6eea049fea3ff91831cb140afa35
/Assignments/Assignment-2/list/insert.py
a16c82d590cd0399dd5378f5613687032f77a77f
[]
no_license
Ayushd70/OCF-Python
8dd44f9ec08509d9610a6d8310622354e88097c2
bea41d997056235051db9f54f66790f66d7d8a2a
refs/heads/master
2023-06-03T20:38:52.701002
2021-06-23T15:38:56
2021-06-23T15:39:46
367,636,185
1
0
null
null
null
null
UTF-8
Python
false
false
50
py
array = [1, 2, 3] array.insert(3, 4) print(array)
d9633abec836d4892c3fe68ab2a30b5749261f2b
7952f66758b685f4bf045c7eb28efa3a22412a89
/백준/1922.py
d83d5726dbf2078356865eda4bbcbadf8e1a0325
[]
no_license
PingPingE/Algorithm
b418fa13528c27840bb220e305933800c5b4c00a
89a55309c44320f01d2d6fe5480181a4c5816fd2
refs/heads/master
2023-08-31T01:43:09.690729
2023-08-27T13:12:22
2023-08-27T13:12:22
172,465,200
1
0
null
null
null
null
UTF-8
Python
false
false
2,481
py
''' 문제) 도현이는 컴퓨터와 컴퓨터를 모두 연결하는 네트워크를 구축하려 한다. 하지만 아쉽게도 허브가 있지 않아 컴퓨터와 컴퓨터를 직접 연결하여야 한다. 그런데 모두가 자료를 공유하기 위해서는 모든 컴퓨터가 연결이 되어 있어야 한다. (a와 b가 연결이 되어 있다는 말은 a에서 b로의 경로가 존재한다는 것을 의미한다. a에서 b를 연결하는 선이 있고, b와 c를 연결하는 선이 있으면 a와 c는 연결이 되어 있다.) 그런데 이왕이면 컴퓨터를 연결하는 비용을 최소로 하여야 컴퓨터를 연결하는 비용 외에 다른 곳에 돈을 더 쓸 수 있을 것이다. 이제 각 컴퓨터를 연결하는데 필요한 비용이 주어졌을 때 모든 컴퓨터를 연결하는데 필요한 최소비용을 출력하라. 모든 컴퓨터를 연결할 수 없는 경우는 없다. 입력) 첫째 줄에 컴퓨터의 수 N (1 ≤ N ≤ 1000)가 주어진다. 둘째 줄에는 연결할 수 있는 선의 수 M (1 ≤ M ≤ 100,000)가 주어진다. 셋째 줄부터 M+2번째 줄까지 총 M개의 줄에 각 컴퓨터를 연결하는데 드는 비용이 주어진다. 이 비용의 정보는 세 개의 정수로 주어지는데, 만약에 a b c 가 주어져 있다고 하면 a컴퓨터와 b컴퓨터를 연결하는데 비용이 c (1 ≤ c ≤ 10,000) 만큼 든다는 것을 의미한다. a와 b는 같을 수도 있다. 출력) 모든 컴퓨터를 연결하는데 필요한 최소비용을 첫째 줄에 출력한다. ''' #137432kb 340ms(cnt 추가 후) #137820kb 712ms(cnt 추가 전) import sys,heapq def find(x,links): #부모찾기 if links[x] == x: return x links[x] = find(links[x], links) return links[x] def union(a,b,links): a = find(a,links) b = find(b,links) if a>b: links[a] = b else: links[b] = a N = int(input()) M = int(input()) links = {i:i for i in range(1,N+1)} que = [] heapq.heapify(que) ans = 0 cnt =0 #연결한 간선 개수 count해서 N-1이면 중단하기 위함 (추가 후 712ms -> 340ms) for _ in range(M): a,b,c = map(int,sys.stdin.readline().split()) heapq.heappush(que,[c,a,b])#비용, a컴, b컴 while que: cost, from_ , to_ = heapq.heappop(que) if find(from_,links) == find(to_,links): continue else: union(from_, to_, links) ans += cost cnt += 1 if cnt == N-1:break print(ans)
037faa78b61a3f33646a5ddad2d55b313f992ef0
f42863aac5aa5cf41fea07a155b3d24cdec94847
/oop/system_split/main.py
445d75ab1065151f742ef12ba46fb48c28a93c28
[]
no_license
stanislavkozlovski/python_exercises
bd03a50fd724b0e084cb816560a69359a228358b
6c8e75d692c92f15d42e71cbf6a9f8da6bf802cb
refs/heads/master
2023-05-15T00:19:48.305862
2019-04-17T13:49:34
2019-04-17T13:49:34
64,744,975
3
2
null
2021-06-11T17:43:53
2016-08-02T09:48:16
Python
UTF-8
Python
false
false
4,944
py
import re from hardware import PowerHardware, HeavyHardware from software import ExpressSoftwareComponent, LightSoftwareComponent class TheSystem: def __init__(self): self.hardwares = {} def register_power_hardware(self, name, capacity, memory): self.hardwares[name] = PowerHardware(name, capacity, memory) def register_heavy_hardware(self, name, capacity, memory): self.hardwares[name] = HeavyHardware(name, capacity, memory) def register_express_software(self, hardware_component_name, name, capacity, memory): if hardware_component_name not in self.hardwares: return soft_comp = ExpressSoftwareComponent(name, capacity, memory) self.hardwares[hardware_component_name].register_software_component(soft_comp) def register_light_software(self, hardware_component_name, name, capacity, memory): if hardware_component_name not in self.hardwares: return soft_comp = LightSoftwareComponent(name, capacity, memory) self.hardwares[hardware_component_name].register_software_component(soft_comp) def release_software_component(self, hardware_component_name, software_component_name): if hardware_component_name not in self.hardwares: return False self.hardwares[hardware_component_name].release_software_component(software_component_name) return True def analyze(self): print(f"""Software Components Hardware Components: {len(self.hardwares)} Software Components: {sum(len(hardware.software_components) for hardware in self.hardwares.values())} Total Operational Memory: {sum(hardware.used_memory for hardware in self.hardwares.values())} / {sum(hardware.max_memory for hardware in self.hardwares.values())} Total Capacity Taken: {sum(hardware.used_capacity for hardware in self.hardwares.values())} / {sum(hardware.max_capacity for hardware in self.hardwares.values())}""") def split(self): ordered_hardware_components = ([pow_comp for pow_comp in self.hardwares.values() if isinstance(pow_comp, PowerHardware)] + [heavy_comp for heavy_comp in self.hardwares.values() if isinstance(heavy_comp, HeavyHardware)]) for comp in ordered_hardware_components: express_soft_count = len([None for soft_comp in comp.software_components.values() if isinstance(soft_comp, ExpressSoftwareComponent)]) light_soft_count = len([None for light_comp in comp.software_components.values() if isinstance(light_comp, LightSoftwareComponent)]) print(f'Hardware Component - {comp.name}') print(f'Express Software Components: {express_soft_count}') print(f'Light Software Components: {light_soft_count}') print(f'Memory Usage: {comp.used_memory} / {comp.max_memory}') print(f'Capacity Usage: {comp.used_capacity} / {comp.max_capacity}') print(f'Type: {"Power" if isinstance(comp, PowerHardware) else "Heavy"}') print(f'Software Components {{{", ".join([s_comp.name for s_comp in comp.software_components.values()]) or "None"}}}') def main(): re_pattern = r'.+\((?P<args>.+)\)' command = input() system = TheSystem() while command != 'System Split': if command.startswith('RegisterPowerHardware') or command.startswith('RegisterHeavyHardware'): args = re.match(re_pattern, command).group('args').split(', ') name = args[0] capacity = int(args[1]) memory = int(args[2]) if command.startswith('RegisterPowerHardware'): system.register_power_hardware(name, capacity, memory) else: system.register_heavy_hardware(name, capacity, memory) elif command.startswith('RegisterLightSoftware') or command.startswith('RegisterExpressSoftware'): args = re.match(re_pattern, command).group('args').split(', ') hardware_name = args[0] name = args[1] capacity = int(args[2]) memory = int(args[3]) if command.startswith('RegisterLightSoftware'): system.register_light_software(hardware_name, name, capacity, memory) else: system.register_express_software(hardware_name, name, capacity, memory) elif command.startswith('Analyze'): system.analyze() elif command.startswith('ReleaseSoftwareComponent'): args = re.match(re_pattern, command).group('args').split(', ') hardware_name = args[0] software_name = args[1] system.release_software_component(hardware_name, software_name) command = input() system.split() if __name__ == '__main__': main()
b8db621f5d1e3979942cd6b63d3b82486aabdd35
ba602dc67ad7bb50133aeb312f3c6c54627b3dec
/data/3943/WA_py/518940.py
3b0b14e911ecd75205e252df366bd906589fb946
[]
no_license
Dearyyyyy/TCG
0d21d89275906157372d775f33309ce337e6bc95
7b80de16de2d3f5d95a7c4ed95d45a9e38882e67
refs/heads/master
2020-12-27T23:19:44.845918
2020-02-04T01:59:23
2020-02-04T01:59:23
238,101,032
0
0
null
null
null
null
UTF-8
Python
false
false
633
py
# coding=utf-8 q=[] def order(n,begin,end): global q if begin>=end: q+=n else : i=begin for num in range(begin,end): n[num],n[i]=n[i],n[num] order(n,begin+1,end) n[num],n[i]=n[i],n[num] while True : n=int(input()) if n==0: break list1=[] for i in range(1,n+1): list1.append(i) order(list1,0,n) list2=[] temp=1 for h in range(1,n+1): temp*=h for j in range(0,temp): list2.append(q[j*n:j*n+n]) s=sorted(list2) for r in s : for c in r: print(c,end=' ') print()
d6619223f734f4b59730aa074511c946bf2bf25b
649bd422025e421d86025743eac324c9b882a2e8
/exam/1_three-dimensional_atomic_system/dump/phasetrans/temp210_7500.py
ab7b4126c72afe657e76d8c4e239c1fa696ad9df
[]
no_license
scheuclu/atom_class
36ddee1f6a5995872e858add151c5942c109847c
0c9a8c63d9b38898c1869fe8983126cef17662cd
refs/heads/master
2021-01-21T10:52:28.448221
2017-03-07T23:04:41
2017-03-07T23:04:41
83,489,471
0
0
null
null
null
null
UTF-8
Python
false
false
68,841
py
ITEM: TIMESTEP 7500 ITEM: NUMBER OF ATOMS 2048 ITEM: BOX BOUNDS pp pp pp -1.6751876986904989e+02 2.1471876986909422e+02 -1.6751876986904989e+02 2.1471876986909422e+02 -1.6751876986904989e+02 2.1471876986909422e+02 ITEM: ATOMS id type xs ys zs 1964 1 0.200108 0.00740567 0.00345244 1335 1 0.797577 0.0218471 0.00283992 331 1 0.213718 0.0246749 0.007579 1225 1 0.34213 0.4808 0.321975 920 1 0.299836 0.0017889 0.0447632 1520 1 0.371494 0.077337 0.0105003 1556 1 0.310132 0.491589 0.00899019 940 1 0.768714 0.136578 0.0175722 1927 1 0.259495 0.158982 0.0481686 1269 1 0.633356 0.448352 0.478957 1458 1 0.736026 0.173066 0.0105248 102 1 0.456141 0.176554 0.0447537 719 1 0.583739 0.232066 0.0227482 595 1 0.0102215 0.108973 0.486361 1175 1 0.66075 0.383669 0.0176891 822 1 0.482158 0.0125286 0.277931 1199 1 0.582467 0.459971 0.0223366 909 1 0.0268781 0.0388786 0.0602621 2007 1 0.590082 0.0949762 0.0050172 884 1 0.787608 0.0422579 0.01592 245 1 0.988695 0.0589331 0.0386776 200 1 0.0021273 0.00727619 0.0380782 618 1 0.45405 0.0491546 0.0203707 286 1 0.410939 0.0729194 0.00762353 1716 1 0.111553 0.428123 0.484482 1334 1 0.129491 0.108587 0.0100434 1333 1 0.053189 0.152622 0.0604354 40 1 0.371979 0.254572 0.0174301 272 1 0.238399 0.251948 0.0366234 912 1 0.582199 0.262362 0.0567317 2008 1 0.342145 0.302332 0.00599254 1468 1 0.706775 0.283006 0.0618811 1537 1 0.00356347 0.306004 0.00797172 342 1 0.924279 0.358431 0.0188858 134 1 0.353457 0.445942 0.0174339 1449 1 0.354324 0.394792 0.0211679 35 1 0.691759 0.431722 0.0395577 531 1 0.924772 0.428403 0.023685 1036 1 0.843839 0.476669 0.0199039 1130 1 0.135158 0.0304676 0.0591977 1342 1 0.767879 0.0122292 0.0785911 1644 1 0.806014 0.0187034 0.0469686 692 1 0.907295 0.00441136 0.355509 1011 1 0.197701 0.0573967 0.0527809 1069 1 0.456177 0.0699134 0.0476877 638 1 0.163416 0.0688578 0.0682531 829 1 0.718085 0.0532112 0.0606074 711 1 0.241353 0.0852093 0.057392 1600 1 0.615134 0.0731946 0.021086 1695 1 0.43383 0.123871 0.00814566 129 1 0.606032 0.0941601 0.0505562 1147 1 0.026432 0.147648 0.0133484 1180 1 0.934096 0.158644 0.0573456 805 1 0.765324 0.228424 0.00669384 301 1 0.0136311 0.246832 0.00862155 1132 1 0.136896 0.314864 0.0489271 1272 1 0.466368 0.286258 0.0288807 1197 1 0.154009 0.343954 0.0698933 1813 1 0.423276 0.306208 0.0484077 1054 1 0.36424 0.343319 0.0091319 1243 1 0.376681 0.367632 0.049936 332 1 0.491638 0.35061 0.017458 1319 1 0.0962595 0.424938 0.0411498 1263 1 0.0566523 0.421829 0.0066547 1937 1 0.070472 0.413598 0.0406825 230 1 0.0398843 0.423716 0.0624845 1074 1 0.507872 0.0683894 0.0509024 751 1 0.593449 0.069565 0.041391 675 1 0.944051 0.0654902 0.0746505 1670 1 0.535533 0.147528 0.0451959 1703 1 0.741399 0.175271 0.0768902 528 1 0.477945 0.214057 0.0402564 1747 1 0.543196 0.202151 0.084719 1576 1 0.994776 0.247926 0.00941834 212 1 0.481476 0.256084 0.0376377 941 1 0.483255 0.284964 0.0781237 1838 1 0.981187 0.271675 0.0916433 562 1 0.245159 0.304287 0.0718431 937 1 0.928454 0.339916 0.0807391 1595 1 0.265276 0.368208 0.0472158 554 1 0.269847 0.383824 0.0652641 590 1 0.33853 0.357103 0.0614597 860 1 0.945179 0.384171 0.0759013 1387 1 0.452533 0.404437 0.0574226 572 1 0.267941 0.435344 0.0565661 1680 1 0.518877 0.457922 0.0714505 1198 1 0.517663 0.488725 0.037209 1817 1 0.675407 0.00301702 0.0873842 883 1 0.752238 0.0219229 0.059784 413 1 0.0913108 0.0128784 0.0885691 943 1 0.751673 0.0821988 0.0777843 1246 1 0.252364 0.119021 0.0823193 1679 1 0.870418 0.160911 0.0834834 568 1 0.0974377 0.110248 0.0944935 348 1 0.219858 0.186211 0.0921359 1271 1 0.351235 0.160682 0.0760464 393 1 0.0381173 0.191231 0.0987226 887 1 0.378618 0.195313 0.0767406 1710 1 0.874453 0.169339 0.0901016 155 1 0.581523 0.236481 0.126694 870 1 0.315563 0.244352 0.049169 1947 1 0.483057 0.240213 0.0531062 1805 1 0.730525 0.278685 0.0847725 1093 1 0.532248 0.304067 0.0873734 981 1 0.534811 0.367827 0.0730454 448 1 0.267087 0.0066594 0.116792 312 1 0.408392 0.123953 0.115303 1455 1 0.147703 0.109554 0.119742 743 1 0.112827 0.109786 0.100286 1195 1 0.0460429 0.186745 0.123121 982 1 0.308923 0.160187 0.122014 1176 1 0.527406 0.166013 0.142025 640 1 0.304741 0.174088 0.112345 380 1 0.50556 0.192365 0.0743423 16 1 0.493681 0.179805 0.127443 510 1 0.0425638 0.209418 0.0873611 576 1 0.130548 0.219981 0.134585 1804 1 0.456182 0.322855 0.126071 1910 1 0.578199 0.320512 0.114789 1669 1 0.946324 0.312941 0.0889171 709 1 0.873933 0.326601 0.0843649 697 1 0.946644 0.321757 0.0981081 1818 1 0.791406 0.391835 0.0863452 1743 1 0.57536 0.426545 0.0809678 1056 1 0.381923 0.433275 0.136519 1625 1 0.590935 0.487525 0.126945 1774 1 0.41162 0.0473931 0.107419 1133 1 0.644484 0.0321503 0.119815 1073 1 0.88212 0.0685665 0.127343 105 1 0.022647 0.106675 0.0769772 1128 1 0.473745 0.152657 0.145268 1020 1 0.427012 0.224451 0.104703 1841 1 0.0475018 0.227976 0.126136 1257 1 0.175377 0.215456 0.12691 1589 1 0.191101 0.242342 0.122997 1254 1 0.967451 0.230522 0.0764862 1714 1 0.618519 0.24536 0.0987072 1032 1 0.885306 0.265193 0.135859 1633 1 0.0353666 0.369379 0.124761 1757 1 0.0699781 0.348612 0.135153 990 1 0.852616 0.435905 0.113614 1802 1 0.00700254 0.440657 0.153631 965 1 0.954315 0.450446 0.120683 1518 1 0.120529 0.0252592 0.153272 517 1 0.444162 0.0249024 0.130389 532 1 0.382201 0.0364324 0.128854 1234 1 0.342872 0.188735 0.136813 1157 1 0.876275 0.179321 0.125681 408 1 0.654625 0.164585 0.144688 616 1 0.944586 0.295431 0.104777 156 1 0.945695 0.295547 0.153015 1991 1 0.8941 0.39423 0.178758 1218 1 0.213375 0.377874 0.15801 1673 1 0.383794 0.422973 0.135997 1433 1 0.377754 0.457536 0.157189 604 1 0.462605 0.42288 0.128582 1843 1 0.940456 0.475589 0.171161 374 1 0.839466 0.487253 0.164566 28 1 0.634786 0.0476982 0.101152 577 1 0.446813 0.0719659 0.166922 1314 1 0.307351 0.0975179 0.183115 1028 1 0.278276 0.157196 0.151947 1418 1 0.962969 0.210431 0.174157 1724 1 0.548683 0.199655 0.136423 250 1 0.209911 0.207463 0.163088 834 1 0.356712 0.247199 0.152662 137 1 0.864028 0.220768 0.15558 854 1 0.872947 0.321541 0.128988 1580 1 0.012429 0.330366 0.165534 1778 1 0.842234 0.300044 0.141578 1961 1 0.783932 0.386499 0.144959 645 1 0.85822 0.371903 0.15566 355 1 0.945664 0.400907 0.115078 1309 1 0.12605 0.371982 0.116173 542 1 0.36171 0.452574 0.116151 1052 1 0.688591 0.457487 0.160583 1967 1 0.87027 0.471785 0.160407 440 1 0.464961 0.464994 0.176152 19 1 0.775045 0.497092 0.175027 1722 1 0.0221377 0.00873063 0.155403 1379 1 0.744356 0.471031 0.493638 1976 1 0.725517 0.0257433 0.162033 753 1 0.462407 0.00517325 0.17117 228 1 0.638923 0.0490501 0.140568 1613 1 0.690798 0.113085 0.149871 505 1 0.608232 0.161943 0.16964 1544 1 0.422816 0.151178 0.168446 1178 1 0.441272 0.209742 0.213598 1591 1 0.562478 0.159551 0.162424 1629 1 0.801894 0.153852 0.183927 648 1 0.792618 0.20337 0.140063 1377 1 0.823 0.209368 0.168718 1944 1 0.834121 0.227715 0.168485 1957 1 0.251576 0.240233 0.170496 420 1 0.690758 0.245733 0.191171 1945 1 0.420111 0.264605 0.164288 56 1 0.439897 0.275307 0.177532 1699 1 0.660945 0.309252 0.198636 352 1 0.542045 0.343943 0.183314 986 1 0.66931 0.305244 0.188618 771 1 0.621461 0.346413 0.15143 1282 1 0.00706019 0.330776 0.206685 1277 1 0.343106 0.341832 0.13808 895 1 0.0427551 0.381834 0.183194 1420 1 0.771473 0.379853 0.161228 1278 1 0.814019 0.413344 0.185151 320 1 0.862067 0.406219 0.157064 1565 1 0.924358 0.462202 0.189756 1330 1 0.283541 0.481943 0.173369 1814 1 0.313452 0.0106842 0.00565678 1265 1 0.114767 0.0309862 0.158568 1426 1 0.210334 0.0615767 0.178643 689 1 0.0676287 0.0482594 0.224808 1584 1 0.228076 0.0732518 0.181291 667 1 0.028369 0.0672377 0.175207 972 1 0.530749 0.106598 0.203525 335 1 0.702389 0.0880258 0.192405 1502 1 0.391705 0.103208 0.203113 138 1 0.387756 0.168456 0.183542 202 1 0.828809 0.17243 0.214698 304 1 0.835943 0.170238 0.205865 464 1 0.633781 0.20982 0.16798 715 1 0.0150723 0.214364 0.202566 642 1 0.304137 0.267571 0.157405 1905 1 0.981207 0.346084 0.166562 746 1 0.227386 0.419456 0.194735 1663 1 0.250704 0.427682 0.199695 637 1 0.40823 0.0226447 0.23801 802 1 0.993209 0.492304 0.331192 1483 1 0.662339 0.0159913 0.214346 2036 1 0.67698 0.0095986 0.241148 953 1 0.756899 0.0587817 0.212681 101 1 0.382706 0.0696953 0.225513 1651 1 0.801528 0.0959824 0.209257 1122 1 0.0978399 0.131563 0.211917 1033 1 0.527459 0.129213 0.237772 1698 1 0.0821334 0.175949 0.225751 418 1 0.0639426 0.216434 0.180719 622 1 0.150546 0.237853 0.200298 866 1 0.894243 0.268867 0.227228 556 1 0.871277 0.27646 0.232019 1911 1 0.577556 0.291946 0.226873 1429 1 0.680763 0.302313 0.173598 1652 1 0.34085 0.39091 0.22603 1505 1 0.0106382 0.42971 0.239739 476 1 0.277399 0.466199 0.220161 364 1 0.578146 0.427877 0.193113 1729 1 0.72671 0.479175 0.19248 797 1 0.882125 0.00524648 0.204228 443 1 0.933561 0.079919 0.209547 546 1 0.977202 0.0572684 0.209753 63 1 0.296032 0.0618585 0.185916 644 1 0.176896 0.0929868 0.240324 455 1 0.43732 0.107296 0.249612 706 1 0.669871 0.110965 0.228573 385 1 0.428248 0.183197 0.234091 555 1 0.58918 0.16442 0.218472 435 1 0.0090394 0.165423 0.21161 17 1 0.514585 0.158267 0.272183 1072 1 0.095454 0.2168 0.222414 1569 1 0.342764 0.273852 0.237829 864 1 0.556716 0.316285 0.209177 919 1 0.538624 0.285018 0.279862 1258 1 0.660934 0.298568 0.189879 997 1 0.00377135 0.292015 0.228992 1165 1 0.171574 0.352055 0.242293 1588 1 0.308871 0.319732 0.237214 1776 1 0.303603 0.326395 0.229656 284 1 0.569876 0.354577 0.255463 716 1 0.199964 0.429764 0.217966 1249 1 0.594615 0.463776 0.260053 98 1 0.550444 0.00559517 0.256024 513 1 0.732263 0.0246243 0.271488 2030 1 0.853481 0.000447168 0.251289 38 1 0.649485 0.0269311 0.243481 128 1 0.429072 0.0872772 0.265273 890 1 0.54173 0.139944 0.25838 195 1 0.0404493 0.173016 0.277573 672 1 0.938304 0.231116 0.260324 708 1 0.245069 0.229233 0.234448 780 1 0.296061 0.207322 0.26514 1411 1 0.189464 0.26339 0.235532 37 1 0.319393 0.296576 0.258562 1444 1 0.657398 0.290091 0.252744 370 1 0.789868 0.319335 0.27707 1471 1 0.100821 0.31512 0.272388 1376 1 0.190856 0.340553 0.260536 87 1 0.276844 0.388139 0.23106 757 1 0.227807 0.410006 0.268818 1416 1 0.0273283 0.453752 0.23902 154 1 0.568827 0.461308 0.296152 1789 1 0.481286 0.449708 0.269296 2005 1 0.662482 0.0280821 0.28565 1098 1 0.180704 0.110246 0.272434 1325 1 0.254797 0.106092 0.265719 1362 1 0.958186 0.164706 0.277816 795 1 0.995963 0.172398 0.265239 1636 1 0.928472 0.170309 0.276208 119 1 0.797959 0.20769 0.292244 1570 1 0.309251 0.269702 0.290918 1142 1 0.622952 0.294385 0.28967 1466 1 0.435266 0.307291 0.285333 233 1 0.578656 0.331097 0.265855 185 1 0.821956 0.383722 0.266106 656 1 0.294964 0.367356 0.255122 1355 1 0.442974 0.40121 0.28855 369 1 0.535825 0.409944 0.27628 1396 1 0.103016 0.440768 0.281604 237 1 0.303203 0.486273 0.446673 654 1 0.926536 0.0409661 0.276117 1562 1 0.20971 0.0369185 0.305714 1671 1 0.16468 0.0723091 0.271934 1413 1 0.106015 0.0939985 0.278431 1050 1 0.280222 0.12932 0.247198 1009 1 0.699604 0.125138 0.326698 1266 1 0.303278 0.182418 0.306293 837 1 0.886797 0.319873 0.293833 961 1 0.879573 0.371857 0.268601 1908 1 0.638755 0.357921 0.289123 180 1 0.0728267 0.41415 0.272169 1992 1 0.379446 0.441702 0.29769 738 1 0.363162 0.425479 0.286146 20 1 0.0931087 0.45674 0.322622 1034 1 0.944623 0.468861 0.289614 1983 1 0.466143 0.486129 0.12682 1799 1 0.131176 0.0599953 0.305569 1329 1 0.774755 0.0902933 0.30873 1457 1 0.262906 0.146299 0.30075 303 1 0.681019 0.18728 0.315245 807 1 0.607588 0.27452 0.30128 1013 1 0.503044 0.327247 0.319453 1984 1 0.613882 0.335549 0.337397 361 1 0.210853 0.421999 0.327494 1893 1 0.669307 0.423451 0.281904 939 1 0.13421 0.466726 0.294203 6 1 0.403573 0.457575 0.326227 926 1 0.814535 0.000372042 0.0896044 1899 1 0.754038 0.181077 0.313818 454 1 0.318528 0.151305 0.353519 541 1 0.698452 0.160057 0.306235 1696 1 0.194331 0.198775 0.327058 1194 1 0.0280747 0.250581 0.34306 1688 1 0.834714 0.272379 0.326651 1681 1 0.569702 0.329891 0.344497 65 1 0.616343 0.346509 0.289689 366 1 0.835239 0.339063 0.331365 1968 1 0.940143 0.368842 0.326771 867 1 0.106633 0.415139 0.319215 111 1 0.658691 0.392603 0.349418 136 1 0.717293 0.415837 0.338789 522 1 0.222591 0.455729 0.326296 966 1 0.658301 0.0151681 0.048888 609 1 0.554566 0.0513675 0.353909 261 1 0.878609 0.0277377 0.363706 2032 1 0.172345 0.0328893 0.338054 172 1 0.302748 0.0419785 0.332633 819 1 0.84826 0.0872327 0.369854 1954 1 0.864693 0.0969894 0.33533 1067 1 0.950002 0.137871 0.321629 1363 1 0.590522 0.119813 0.362475 407 1 0.419119 0.176569 0.356472 549 1 0.957837 0.187712 0.363346 625 1 0.285247 0.328825 0.327604 174 1 0.119238 0.392271 0.335452 181 1 0.656779 0.380294 0.376539 1051 1 0.510735 0.40531 0.349461 782 1 0.718998 0.402243 0.331157 1933 1 0.201307 0.498473 0.355215 653 1 0.211963 0.0179482 0.360767 896 1 0.872893 0.214554 0.00984737 1741 1 0.502977 0.00466826 0.0230473 1622 1 0.192289 0.0240806 0.359762 1955 1 0.479859 0.0678173 0.346159 2009 1 0.876085 0.0365636 0.356574 1830 1 0.0566649 0.0876587 0.373445 2017 1 0.794987 0.0704374 0.387564 1672 1 0.438817 0.0860509 0.320012 410 1 0.735542 0.0789818 0.349215 1236 1 0.41219 0.140913 0.38847 636 1 0.543513 0.132866 0.367768 1206 1 0.959459 0.155198 0.373236 673 1 0.998899 0.212692 0.34877 1000 1 0.186242 0.202708 0.33788 1045 1 0.722236 0.259696 0.330823 1273 1 0.364326 0.279701 0.351508 1621 1 0.792847 0.265422 0.332297 94 1 0.392218 0.279371 0.371465 489 1 0.433892 0.279404 0.360304 1530 1 0.527862 0.256302 0.380145 122 1 0.670968 0.320306 0.374274 215 1 0.0867463 0.37101 0.361591 722 1 0.905614 0.362414 0.36262 1010 1 0.0156633 0.411688 0.348813 1925 1 0.0873797 0.388133 0.381138 1040 1 0.700169 0.071232 0.499325 1348 1 0.196871 0.459386 0.352694 1855 1 0.923908 0.0104796 0.434528 1004 1 0.414905 0.120891 0.377705 1491 1 0.343828 0.139401 0.387298 544 1 0.302557 0.1597 0.398268 244 1 0.942265 0.197297 0.370002 1806 1 0.913763 0.3011 0.384274 825 1 0.104384 0.322979 0.368976 660 1 0.0878618 0.34967 0.380014 745 1 0.735798 0.376739 0.394901 68 1 0.27583 0.453076 0.383076 1890 1 0.303304 0.414102 0.386071 847 1 0.565542 0.48347 0.362624 1557 1 0.614467 0.489996 0.395635 942 1 0.62537 0.0345138 0.388132 1554 1 0.141251 0.0691021 0.392622 918 1 0.779391 0.00965231 0.392857 995 1 0.0129345 0.0586691 0.377755 308 1 0.101767 0.0545408 0.357779 114 1 0.460099 0.0522983 0.398376 446 1 0.105762 0.0821211 0.409365 1686 1 0.960721 0.153338 0.417712 1952 1 0.201176 0.173863 0.412696 1863 1 0.640715 0.201376 0.391851 22 1 0.744114 0.247497 0.416752 387 1 0.510498 0.274233 0.409183 217 1 0.856032 0.303167 0.393494 882 1 0.698879 0.286464 0.413131 1760 1 0.314763 0.325681 0.408651 1301 1 0.604101 0.321031 0.388207 1172 1 0.547834 0.335502 0.3944 710 1 0.456292 0.402726 0.396511 438 1 0.295847 0.40487 0.378554 1365 1 0.541835 0.434118 0.405 2024 1 0.624512 0.409546 0.387613 1654 1 0.00585065 0.399933 0.367764 701 1 0.675564 0.441127 0.388055 828 1 0.207219 0.470389 0.400221 1436 1 0.495508 0.0494935 0.422875 1 1 0.0457733 0.0762051 0.435331 1242 1 0.29171 0.0943338 0.438832 1474 1 0.179458 0.105012 0.396127 1782 1 0.582304 0.120354 0.417594 1219 1 0.757346 0.128566 0.417089 33 1 0.0538394 0.194088 0.407335 5 1 0.937242 0.186376 0.409957 700 1 0.67371 0.224294 0.394165 1656 1 0.112209 0.231887 0.438367 682 1 0.300165 0.27449 0.383964 1228 1 0.101771 0.32201 0.404254 550 1 0.597205 0.324671 0.376377 48 1 0.215379 0.293609 0.444013 880 1 0.125605 0.335168 0.396018 300 1 0.519763 0.351815 0.436503 849 1 0.753536 0.38943 0.394016 1171 1 0.367388 0.424994 0.407027 1465 1 0.545329 0.463613 0.440639 1415 1 0.913461 0.443102 0.444343 1080 1 0.876757 0.457116 0.425109 629 1 0.0810427 0.00584169 0.284528 674 1 0.290728 0.0933456 0.417899 812 1 0.54661 0.101537 0.468223 492 1 0.0569462 0.153346 0.446061 1538 1 0.276589 0.163348 0.445472 1075 1 0.573728 0.172068 0.445288 1187 1 0.424702 0.21647 0.40519 1708 1 0.440438 0.188511 0.43228 1501 1 0.646628 0.197789 0.406572 1614 1 0.351999 0.229803 0.396737 1154 1 0.293254 0.351287 0.449593 316 1 0.837034 0.367799 0.436466 330 1 0.201534 0.414943 0.44881 614 1 0.494305 0.390163 0.413052 1675 1 0.00597982 0.459526 0.438824 564 1 0.943426 0.0248631 0.454174 1328 1 0.547947 0.0627052 0.435911 1140 1 0.477706 0.0720631 0.419992 1953 1 0.322746 0.0724696 0.43355 177 1 0.536687 0.111322 0.476443 1721 1 0.688992 0.0888214 0.431471 273 1 0.131535 0.140126 0.457751 1422 1 0.667211 0.122359 0.449574 382 1 0.230204 0.206121 0.487622 1540 1 0.444946 0.197226 0.441737 574 1 0.670309 0.192383 0.468292 543 1 0.877795 0.197544 0.459782 187 1 0.155302 0.216212 0.446815 1215 1 0.755716 0.263496 0.471289 1343 1 0.897889 0.230699 0.462429 647 1 0.648039 0.297132 0.490566 379 1 0.597188 0.304381 0.423478 601 1 0.589919 0.336867 0.426201 1506 1 0.565633 0.307306 0.469485 1280 1 0.574187 0.411681 0.445232 794 1 0.17815 0.467073 0.472301 1340 1 0.546326 0.436204 0.439897 1141 1 0.00370328 0.44254 0.485551 394 1 0.869535 0.432011 0.469331 2047 1 0.156125 0.0396637 0.468738 367 1 0.273744 0.358441 0.0178112 263 1 0.772141 0.0690898 0.469914 999 1 0.271192 0.167735 0.453121 1134 1 0.313762 0.0987148 0.462453 1978 1 0.137233 0.191814 0.471515 45 1 0.147873 0.273563 0.499871 1536 1 0.0979948 0.476345 0.476669 663 1 0.772019 0.439718 0.483939 1777 1 0.927283 0.4264 0.487575 1829 1 0.877075 0.491958 0.463211 502 1 0.561415 0.491705 0.1667 1473 1 0.0986506 0.0841046 0.44862 1977 1 0.837942 0.0836069 0.476615 1628 1 0.697467 0.422194 0.478307 1472 1 0.436161 0.126899 0.493141 1746 1 0.770424 0.16277 0.491598 602 1 0.206898 0.230774 0.488392 421 1 0.417551 0.0269083 0.369518 1551 1 0.607272 0.276171 0.483277 1485 1 0.99798 0.47089 0.485885 1275 1 0.356693 0.276338 0.495418 1996 1 0.117074 0.262167 0.0133785 279 1 0.368185 0.356707 0.484121 2010 1 0.764806 0.373706 0.476084 186 1 0.571036 0.292158 0.0226558 1323 1 0.112332 0.0501302 0.523689 748 1 0.65387 0.0571156 0.533058 635 1 0.246632 0.00540832 0.979128 1608 1 0.598216 0.0101001 0.502721 262 1 0.8251 0.139934 0.517734 1480 1 0.167659 0.179088 0.532709 1500 1 0.138848 0.166852 0.526175 881 1 0.947778 0.180899 0.505075 1106 1 0.0514909 0.242849 0.508311 1173 1 0.721777 0.216513 0.515166 1661 1 0.67907 0.250117 0.512647 1241 1 0.446284 0.310995 0.520439 18 1 0.561415 0.310203 0.514132 786 1 0.831788 0.299177 0.508741 639 1 0.128524 0.350202 0.513847 7 1 0.460276 0.476633 0.53529 1006 1 0.383657 0.397413 0.501954 1951 1 0.16148 0.0440971 0.525654 649 1 0.122315 0.0289169 0.526022 24 1 0.543059 0.0518306 0.506306 1888 1 0.385579 0.089231 0.571028 607 1 0.00446794 0.0959225 0.528737 620 1 0.109688 0.0952344 0.513314 1404 1 0.853502 0.108336 0.526084 857 1 0.880849 0.0957938 0.51589 388 1 0.409675 0.173822 0.542185 1771 1 0.665965 0.309761 0.524991 459 1 0.112741 0.326132 0.539681 1097 1 0.498059 0.379867 0.556486 260 1 0.137823 0.433959 0.535232 1512 1 0.586634 0.395229 0.52674 566 1 0.515803 0.433791 0.517108 1767 1 0.908045 0.00699702 0.735354 1479 1 0.399187 0.43934 0.511369 661 1 0.859204 0.487127 0.528556 1783 1 0.995224 0.493486 0.534058 781 1 0.50113 0.0627169 0.545366 915 1 0.824594 0.0925896 0.513438 1026 1 0.0915735 0.156807 0.546833 1496 1 0.551252 0.156687 0.515406 655 1 0.83058 0.178313 0.548927 1935 1 0.257591 0.227115 0.531101 1845 1 0.300994 0.257971 0.551637 2013 1 0.679118 0.293609 0.571557 1427 1 0.199091 0.324073 0.552723 561 1 0.531416 0.332471 0.56495 1174 1 0.316647 0.443151 0.557677 234 1 0.557328 0.451458 0.539189 547 1 0.0599629 0.493122 0.530619 646 1 0.809125 0.492552 0.555919 1260 1 0.611764 0.0247201 0.581143 534 1 0.649262 0.0385038 0.559436 12 1 0.0181552 0.127628 0.580447 204 1 0.760133 0.149545 0.552907 1849 1 0.556447 0.142435 0.569357 2011 1 0.0149224 0.171467 0.581026 1403 1 0.530691 0.199543 0.548704 221 1 0.0428378 0.240184 0.5485 633 1 0.304113 0.286966 0.543524 873 1 0.957106 0.27167 0.543198 787 1 0.270948 0.383873 0.517871 194 1 0.467171 0.350448 0.565916 429 1 0.645762 0.336445 0.540877 1665 1 0.00919319 0.441366 0.568697 558 1 0.903739 0.480497 0.581483 1635 1 0.92981 0.468516 0.579361 458 1 0.639226 0.0212404 0.594482 77 1 0.575491 0.0985368 0.563452 306 1 0.149403 0.146423 0.564935 1508 1 0.854927 0.160472 0.588249 1096 1 0.253816 0.251368 0.607198 1563 1 0.838803 0.244654 0.567809 1744 1 0.523711 0.236948 0.618487 657 1 0.195679 0.301777 0.592705 1918 1 0.643617 0.329121 0.604886 1788 1 0.490554 0.392135 0.559319 1261 1 0.34978 0.441517 0.559229 1583 1 0.24912 0.458143 0.566746 1754 1 0.566716 0.448745 0.581228 1599 1 0.362339 0.0292922 0.635261 1657 1 0.928305 0.0142852 0.608019 486 1 0.436937 0.122538 0.614987 362 1 0.144098 0.198969 0.60236 1643 1 0.862677 0.196263 0.604673 752 1 0.61633 0.261059 0.629298 66 1 0.237078 0.276142 0.597506 106 1 0.800843 0.297113 0.573953 885 1 0.225833 0.382221 0.565388 1616 1 0.517336 0.407233 0.619761 1374 1 0.62494 0.460813 0.608161 565 1 0.508361 0.0329147 0.636289 239 1 0.537945 0.0179961 0.637733 894 1 0.170855 0.0744712 0.59683 759 1 0.265433 0.039378 0.616195 1689 1 0.359623 0.0857285 0.625122 1878 1 0.437343 0.0981777 0.636429 62 1 0.522872 0.0943899 0.602566 879 1 0.291421 0.216677 0.605921 789 1 0.791535 0.191295 0.612449 1634 1 0.0896381 0.263442 0.5897 1784 1 0.392215 0.271368 0.627288 321 1 0.678601 0.292008 0.600696 1678 1 0.0547661 0.339243 0.618389 1281 1 0.205312 0.336963 0.615247 821 1 0.590599 0.370968 0.610098 163 1 0.283483 0.411115 0.622488 460 1 0.749846 0.414553 0.624489 843 1 0.402602 0.46591 0.606197 1368 1 0.668181 0.0593783 0.63555 1956 1 0.0224771 0.112211 0.622149 911 1 0.0626034 0.141212 0.610066 1572 1 0.701826 0.146197 0.634083 419 1 0.235727 0.123399 0.637816 148 1 0.903804 0.151046 0.643147 295 1 0.688319 0.190597 0.605522 580 1 0.274265 0.219076 0.640803 365 1 0.471351 0.222186 0.638449 1424 1 0.0673602 0.236429 0.623388 1322 1 0.226468 0.305927 0.624741 761 1 0.185949 0.288825 0.64513 390 1 0.880633 0.304329 0.612224 669 1 0.242043 0.312573 0.617252 1446 1 0.686467 0.347138 0.645904 688 1 0.294178 0.395104 0.673312 441 1 0.339478 0.393567 0.633718 1384 1 0.0457686 0.470022 0.628805 1311 1 0.857948 0.472335 0.647622 109 1 0.151165 0.490375 0.523564 1913 1 0.657919 0.0674333 0.51791 1819 1 0.817156 0.0549136 0.647806 358 1 0.120957 0.0604376 0.668843 354 1 0.560844 0.0475057 0.696179 1383 1 0.696374 0.0734135 0.671497 1736 1 0.87516 0.0479276 0.627722 1833 1 0.670532 0.139341 0.646517 412 1 0.985905 0.176477 0.678757 1835 1 0.619425 0.186413 0.663455 224 1 0.142437 0.18948 0.627219 1884 1 0.917339 0.233461 0.686106 1711 1 0.944272 0.252588 0.659189 588 1 0.221194 0.264961 0.692592 463 1 0.931759 0.320301 0.652348 1638 1 0.223933 0.302587 0.681614 980 1 0.824335 0.39269 0.647068 836 1 0.593275 0.356935 0.674209 968 1 0.248174 0.411747 0.649195 2006 1 0.663116 0.398935 0.654236 1450 1 0.034559 0.415577 0.667606 863 1 0.821815 0.478086 0.659642 1025 1 0.770394 0.458125 0.654297 1409 1 0.874968 0.447517 0.981057 469 1 0.253039 0.0389631 0.683776 579 1 0.173259 0.0579588 0.651809 1922 1 0.548561 0.117298 0.671575 146 1 0.99006 0.103967 0.668299 1285 1 0.748786 0.146101 0.702215 1763 1 0.848457 0.151457 0.673503 1528 1 0.576464 0.144363 0.658627 1720 1 0.500631 0.2197 0.663895 78 1 0.730775 0.203379 0.669345 188 1 0.890921 0.222971 0.662674 49 1 0.919212 0.204026 0.685714 340 1 0.608476 0.310008 0.675636 326 1 0.0316727 0.231 0.666685 339 1 0.128129 0.275266 0.660192 29 1 0.55539 0.312087 0.68242 255 1 0.93821 0.344401 0.6823 969 1 0.520502 0.393834 0.674632 1251 1 0.731409 0.391344 0.688201 705 1 0.0227438 0.43341 0.674532 1823 1 0.0736916 0.414458 0.662434 1303 1 0.638256 0.462593 0.667557 1339 1 0.293285 0.011249 0.728666 253 1 0.232166 0.146529 0.679381 1764 1 0.702375 0.12423 0.678391 723 1 0.734542 0.175327 0.684127 1221 1 0.308235 0.202839 0.703358 267 1 0.728065 0.26275 0.68312 1730 1 0.62286 0.306854 0.719821 1510 1 0.06899 0.31589 0.668289 1640 1 0.267909 0.322933 0.684041 1224 1 0.888226 0.344683 0.745975 1717 1 0.34298 0.356337 0.706989 149 1 0.625608 0.37326 0.699921 297 1 0.362835 0.445495 0.704653 872 1 0.0217991 0.429405 0.651035 1412 1 0.853687 0.402957 0.714234 1393 1 0.261345 0.0129221 0.721224 1810 1 0.269393 0.0368638 0.712109 2004 1 0.649783 0.0959132 0.727579 886 1 0.854208 0.145053 0.714313 788 1 0.479079 0.224852 0.712379 1949 1 0.339458 0.249828 0.71337 1880 1 0.65363 0.263564 0.711967 1421 1 0.372679 0.324288 0.723767 573 1 0.430608 0.357258 0.737678 1302 1 0.0814049 0.347713 0.719883 359 1 0.185917 0.374881 0.70198 1082 1 0.836646 0.363521 0.732025 1751 1 0.774295 0.38546 0.740916 499 1 0.332204 0.421572 0.707436 2002 1 0.0407077 0.465595 0.680372 869 1 0.592754 0.477643 0.734266 1981 1 0.248 0.223016 0.999045 240 1 0.36805 0.0965529 0.756412 1163 1 0.993933 0.127177 0.7443 1432 1 0.643315 0.142003 0.738528 411 1 0.574706 0.152226 0.696867 1055 1 0.286709 0.247593 0.744323 594 1 0.0129027 0.203921 0.760378 979 1 0.818802 0.24658 0.7279 275 1 0.954075 0.260191 0.683225 704 1 0.167315 0.260143 0.736609 118 1 0.912805 0.257723 0.738798 43 1 0.200955 0.302677 0.710157 1148 1 0.374636 0.285553 0.745382 963 1 0.663485 0.375975 0.706095 173 1 0.910978 0.385554 0.7302 1139 1 0.472204 0.474489 0.734022 1336 1 0.843103 0.493695 0.716118 726 1 0.3331 0.0307829 0.744198 21 1 0.269369 0.0185537 0.740986 231 1 0.768526 0.0441267 0.764303 1658 1 0.756839 0.0717537 0.741637 1664 1 0.952133 0.0462846 0.731212 1121 1 0.00390479 0.0605509 0.759217 1136 1 0.220213 0.0989645 0.79984 1552 1 0.440585 0.1818 0.720348 1834 1 0.429565 0.328488 0.755218 858 1 0.4474 0.314104 0.775767 1212 1 0.244435 0.341581 0.771667 1338 1 0.975704 0.301737 0.774995 96 1 0.00542608 0.455576 0.748868 480 1 0.192201 0.00422673 0.795316 1160 1 0.550847 0.447369 0.76635 2033 1 0.555815 0.439739 0.760814 1245 1 0.48016 0.0503302 0.983214 1891 1 0.223831 0.467864 0.732512 1566 1 0.815166 0.419396 0.982412 1233 1 0.947315 0.0414699 0.75868 1367 1 0.287586 0.0680924 0.761569 670 1 0.274916 0.0513105 0.739884 714 1 0.419822 0.0268397 0.758168 1019 1 0.854436 0.0810497 0.769429 779 1 0.957763 0.19853 0.800881 1049 1 0.446397 0.260205 0.766222 766 1 0.991673 0.288745 0.784079 481 1 0.398518 0.302194 0.770061 845 1 0.487363 0.291306 0.763956 424 1 0.400443 0.287201 0.778177 1452 1 0.282928 0.346812 0.790643 1615 1 0.31873 0.341666 0.749373 605 1 0.639117 0.358008 0.768084 257 1 0.603505 0.395432 0.774526 64 1 0.279389 0.419719 0.76663 199 1 0.19012 0.432786 0.775875 1253 1 0.259631 0.448863 0.785161 686 1 0.836917 0.431682 0.754606 1858 1 0.0149577 0.11636 0.81365 615 1 0.59815 0.0737007 0.792098 2035 1 0.132931 0.105802 0.804828 696 1 0.295545 0.110104 0.790974 2027 1 0.0734301 0.173108 0.818154 680 1 0.564034 0.125875 0.802124 865 1 0.607313 0.17749 0.770451 428 1 0.747422 0.189578 0.784903 150 1 0.831978 0.245497 0.803841 1705 1 0.241479 0.277483 0.783413 1691 1 0.33852 0.257738 0.778544 1138 1 0.290672 0.313126 0.787751 1773 1 0.416871 0.338492 0.780064 349 1 0.727895 0.326995 0.801449 329 1 0.588162 0.383587 0.783607 97 1 0.325765 0.418716 0.792798 141 1 0.233627 0.423359 0.790151 1620 1 0.943499 0.48391 0.506512 929 1 0.374995 0.479596 0.761503 1092 1 0.66185 0.498013 0.754937 816 1 0.679503 0.00980527 0.800968 437 1 0.205895 0.0536271 0.840441 1883 1 0.535314 0.0393246 0.795279 1463 1 0.951486 0.0156224 0.827473 3 1 0.256249 0.0312585 0.769144 1223 1 0.573591 0.087223 0.800596 327 1 0.650161 0.0905974 0.839868 1095 1 0.550366 0.114073 0.805897 1960 1 0.110266 0.132911 0.801538 1360 1 0.557273 0.131527 0.813948 307 1 0.86642 0.116471 0.810732 2012 1 0.67034 0.129088 0.782026 1489 1 0.830731 0.161947 0.786436 1462 1 0.676328 0.208179 0.806924 193 1 0.0499336 0.286801 0.815514 218 1 0.966777 0.26957 0.805478 1087 1 0.959745 0.286118 0.786776 876 1 0.360247 0.341387 0.853649 650 1 0.591373 0.436498 0.81207 1394 1 0.572127 0.443436 0.805537 1053 1 0.183883 0.493703 0.794017 524 1 0.49126 0.0459675 0.997879 998 1 0.344756 0.0306002 0.811942 404 1 0.821732 0.0809799 0.817044 1381 1 0.882913 0.0959613 0.848503 1543 1 0.251151 0.135103 0.807091 1298 1 0.496645 0.143893 0.810858 826 1 0.554328 0.160653 0.809863 734 1 0.677797 0.253539 0.82599 1820 1 0.255997 0.242532 0.841205 1297 1 0.873668 0.315605 0.809345 993 1 0.95007 0.364063 0.828136 1078 1 0.738228 0.381418 0.803936 1090 1 0.294889 0.490082 0.827247 1932 1 0.700367 0.00621194 0.830197 1755 1 0.775476 0.0226848 0.807384 1423 1 0.768699 0.141782 0.846938 219 1 0.696845 0.162633 0.840767 1842 1 0.124044 0.208688 0.880833 184 1 0.98183 0.188684 0.855389 1315 1 0.52413 0.221592 0.845192 571 1 0.876097 0.275369 0.824427 875 1 0.553969 0.34519 0.844093 1318 1 0.88205 0.295 0.840384 1262 1 0.280933 0.346179 0.812998 1974 1 0.23884 0.344541 0.861464 1012 1 0.877314 0.372038 0.835569 850 1 0.691711 0.389197 0.846392 2023 1 0.479926 0.404113 0.843562 1091 1 0.310596 0.454853 0.835551 1190 1 0.478281 0.484199 0.836518 491 1 0.0730799 0.0310585 0.876796 774 1 0.151323 0.0101372 0.858387 978 1 0.525656 0.015373 0.815672 1761 1 0.232922 0.0432094 0.852666 1124 1 0.738144 0.00545268 0.865446 1601 1 0.183463 0.0259814 0.853699 2016 1 0.191432 0.0662542 0.859279 1494 1 0.356177 0.132581 0.877798 917 1 0.17675 0.169395 0.876041 1759 1 0.121029 0.263384 0.856092 955 1 0.545359 0.274356 0.844183 536 1 0.571867 0.303415 0.879317 740 1 0.0649457 0.360618 0.860323 1320 1 0.0921803 0.399557 0.844685 1149 1 0.749817 0.414035 0.866247 1021 1 0.88482 0.415117 0.838734 921 1 0.171388 0.452463 0.871215 1264 1 0.28798 0.0224804 0.866767 1470 1 0.230123 0.178088 0.890078 1795 1 0.602877 0.188854 0.896915 1573 1 0.633853 0.243539 0.904436 147 1 0.781898 0.268237 0.889694 1126 1 0.98758 0.254673 0.874707 391 1 0.11929 0.301559 0.879876 1292 1 0.393957 0.299606 0.890393 1904 1 0.443444 0.267682 0.864203 338 1 0.436203 0.407883 0.872515 268 1 0.559772 0.356686 0.87298 600 1 0.952382 0.393209 0.892945 254 1 0.100149 0.485146 0.977097 1085 1 0.905126 0.0627885 0.918416 1220 1 0.233338 0.0491877 0.914094 1959 1 0.259304 0.0749763 0.904682 462 1 0.4594 0.0859112 0.87241 1364 1 0.853053 0.130252 0.875537 519 1 0.940428 0.137759 0.918004 1295 1 0.530034 0.156294 0.898118 1844 1 0.927326 0.173092 0.918461 957 1 0.971235 0.194106 0.894789 853 1 0.666709 0.246343 0.924636 731 1 0.977685 0.239255 0.883613 1692 1 0.103477 0.31041 0.861454 992 1 0.895139 0.323394 0.887255 281 1 0.219973 0.298599 0.910745 936 1 0.920618 0.379792 0.894006 1598 1 0.969579 0.376816 0.885461 85 1 0.70807 0.411017 0.893842 662 1 0.929846 0.466813 0.904813 713 1 0.945845 0.491438 0.817092 2031 1 0.686208 0.482079 0.96824 1286 1 0.484696 0.0577073 0.897118 699 1 0.359856 0.12889 0.939847 603 1 0.585056 0.160937 0.913626 1969 1 0.0103485 0.183065 0.902711 1217 1 0.668004 0.158726 0.937526 229 1 0.116041 0.198089 0.90325 1742 1 0.243012 0.226543 0.92338 46 1 0.285948 0.229492 0.976505 1070 1 0.394101 0.25488 0.901139 246 1 0.94159 0.292883 0.920203 1889 1 0.904527 0.278785 0.933823 1114 1 0.621829 0.349742 0.909408 1618 1 0.680795 0.346287 0.908336 1439 1 0.274294 0.433736 0.918217 166 1 0.96122 0.375244 0.898191 470 1 0.109294 0.485532 0.905521 1016 1 0.0155333 0.459282 0.912751 436 1 0.110225 0.488562 0.871282 1865 1 0.310681 0.494142 0.912147 703 1 0.645026 0.472569 0.925983 70 1 0.493295 0.497867 0.619531 319 1 0.824452 0.051166 0.950128 1641 1 0.681745 0.0329605 0.917946 553 1 0.973025 0.0871164 0.956961 472 1 0.294686 0.161585 0.94683 1895 1 0.590165 0.172331 0.961269 1642 1 0.289748 0.240876 0.942033 717 1 0.379181 0.244391 0.958426 1291 1 0.23457 0.369061 0.918424 1885 1 0.624546 0.378807 0.940552 1024 1 0.728385 0.360152 0.948436 1901 1 0.945519 0.394389 0.971624 117 1 0.344107 0.428465 0.913966 494 1 0.0663062 0.455272 0.916677 1740 1 0.653843 0.446061 0.933936 1490 1 0.208672 0.464755 0.944494 859 1 0.284646 0.500007 0.91468 1701 1 0.246042 0.0149226 0.938675 908 1 0.855196 0.0220072 0.943924 487 1 0.838666 0.0925796 0.955385 4 1 0.0936244 0.134208 0.952516 124 1 0.698662 0.150792 0.952676 82 1 0.483366 0.202077 0.944689 1064 1 0.593529 0.138835 0.945751 1317 1 0.476692 0.192176 0.936576 1522 1 0.152763 0.255325 0.926204 684 1 0.210419 0.261779 0.970247 1914 1 0.880294 0.269452 0.951596 1785 1 0.500055 0.267578 0.907911 1874 1 0.838304 0.333872 0.936202 384 1 0.55701 0.34853 0.936882 1371 1 0.40824 0.427634 0.97542 971 1 0.327961 0.479755 0.950372 496 1 0.0409352 0.0465146 0.980317 791 1 0.989859 0.0488645 0.982915 1555 1 0.180978 0.0934252 0.979964 900 1 0.695426 0.113531 0.959264 1839 1 0.820646 0.124678 0.954719 1931 1 0.890073 0.183531 0.972225 1108 1 0.952424 0.236328 0.97246 161 1 0.107959 0.282882 0.96234 844 1 0.65654 0.268685 0.966061 934 1 0.650346 0.336144 0.99386 1525 1 0.766182 0.356523 0.955021 346 1 0.445342 0.441742 0.980467 529 1 0.205023 0.495363 0.707887 954 1 0.251958 0.00770358 0.80828 1079 1 0.29321 0.448739 0.986373 1875 1 0.835566 0.0304387 0.971472 835 1 0.227767 0.0649599 0.992355 1405 1 0.695633 0.485998 0.847506 1399 1 0.0302261 0.0798107 0.984026 830 1 0.368379 0.0943774 0.975727 1851 1 0.28573 0.0993941 0.989159 1923 1 0.73855 0.0951633 0.983366 1612 1 0.285176 0.14323 0.968129 2026 1 0.784182 0.145717 0.991944 1084 1 0.191028 0.264957 0.510467 1928 1 0.232465 0.237955 0.978378 1909 1 0.984561 0.39014 0.995708 1930 1 0.907257 0.0116616 0.885283 1577 1 0.99257 0.339531 0.510736 1440 1 0.712748 0.262748 0.97388 1321 1 0.653713 0.352743 0.980792 611 1 0.198491 0.386718 0.993268 1201 1 0.189213 0.275193 0.509279 922 1 0.0371261 0.471403 0.516504 1827 1 0.105329 0.362908 0.537782 298 1 0.0834476 0.0685496 0.973244 1015 1 0.17474 0.0653184 0.99539 539 1 0.289268 0.032308 0.52179 2 1 0.252434 0.474289 0.857673 1781 1 0.872259 0.458888 0.988279 1973 1 0.0710963 0.00584345 0.744493 269 1 0.45866 0.49795 0.971506 386 1 0.835627 0.323279 0.998904 1331 1 0.886162 0.00466014 0.605674 55 1 0.303583 0.0972765 0.999614 1532 1 0.609829 0.499641 0.585099 351 1 0.070664 0.54552 0.481671 1650 1 0.795196 0.543565 0.00311644 133 1 0.930897 0.595236 0.0248411 1779 1 0.510887 0.60283 0.0381341 868 1 0.708759 0.634424 0.0206156 1431 1 0.795797 0.649764 0.00690967 1982 1 0.418035 0.66896 1.14359e-05 515 1 0.897979 0.697518 0.00185973 947 1 0.803206 0.716863 0.00782476 1127 1 0.297035 0.823936 0.000767058 1531 1 0.944216 0.512894 0.280211 1001 1 0.186895 0.722438 0.00287541 1229 1 0.442563 0.848578 0.0157844 1571 1 0.0170215 0.989784 0.35356 1395 1 0.426448 0.979595 0.45483 36 1 0.0473562 0.513664 0.0168722 1299 1 0.570026 0.641143 0.036697 1159 1 0.779078 0.60485 0.0018953 392 1 0.533724 0.62057 0.00371211 832 1 0.587487 0.692474 0.0352865 79 1 0.659678 0.686303 0.0492688 810 1 0.830185 0.690798 0.0481667 1445 1 0.0261196 0.688642 0.0387649 401 1 0.910601 0.736096 0.0395269 1917 1 0.811565 0.750616 0.0213498 778 1 0.118665 0.784935 0.00528766 1547 1 0.320172 0.792053 0.0190295 1235 1 0.798505 0.872128 0.0677414 1151 1 0.737728 0.850639 0.0502541 26 1 0.296299 0.957003 0.0349159 520 1 0.45564 0.931326 0.0253541 651 1 0.768089 0.894304 0.0295861 855 1 0.135041 0.919661 0.0335843 960 1 0.0678214 0.567245 0.0537475 1752 1 0.736988 0.559559 0.0392752 74 1 0.0379143 0.606755 0.0537168 75 1 0.620717 0.634916 0.0680333 1143 1 0.761113 0.640613 0.050323 1649 1 0.312677 0.689198 0.0699834 1519 1 0.0588352 0.757677 0.0590706 949 1 0.158827 0.748877 0.0469476 171 1 0.575982 0.501729 0.322103 623 1 0.792605 0.894985 0.0708213 772 1 0.076368 0.94205 0.0384745 1022 1 0.527826 0.887915 0.0393918 818 1 0.147617 0.972813 0.0450884 1248 1 0.0648145 0.504374 0.361571 1153 1 0.591524 0.67332 0.484407 694 1 0.874462 0.560028 0.0682579 170 1 0.735121 0.600199 0.060459 1476 1 0.727206 0.623255 0.0900812 1856 1 0.806141 0.578181 0.0407036 2042 1 0.902678 0.617341 0.0729459 57 1 0.129651 0.683261 0.108387 1852 1 0.491535 0.685791 0.0677806 2040 1 0.0931653 0.706115 0.032594 1308 1 0.133187 0.759937 0.0281871 402 1 0.458134 0.782804 0.0542196 81 1 0.484707 0.747488 0.085742 1738 1 0.731833 0.798248 0.0660256 447 1 0.661741 0.791934 0.0646498 1796 1 0.132141 0.876856 0.0700067 1410 1 0.556486 0.854563 0.0737174 987 1 0.675758 0.890446 0.0686454 1168 1 0.255684 0.835761 0.0583707 1023 1 0.398347 0.919064 0.0283319 145 1 0.699752 0.525727 0.103368 265 1 0.397729 0.550155 0.0775654 1881 1 0.832217 0.573335 0.0369484 1609 1 0.867548 0.677784 0.0711661 108 1 0.855825 0.64093 0.104463 50 1 0.578899 0.72314 0.0475182 1213 1 0.60867 0.779863 0.0865442 765 1 0.616423 0.776135 0.0746215 1497 1 0.804581 0.792689 0.0935108 1756 1 0.407536 0.799246 0.100599 1304 1 0.00452424 0.83153 0.0686304 372 1 0.0172594 0.855051 0.0661649 1924 1 0.359267 0.816736 0.107647 512 1 0.0642614 0.8909 0.0757343 1482 1 0.80519 0.888437 0.0702982 1385 1 0.347819 0.924059 0.0652075 1712 1 0.8911 0.934697 0.0876665 932 1 0.231153 0.962447 0.0421381 1184 1 0.650754 0.964312 0.108621 88 1 0.694153 0.962553 0.102844 525 1 0.781883 0.964294 0.115766 988 1 0.342514 0.979832 0.0766142 1101 1 0.0887842 0.510002 0.496804 612 1 0.13324 0.528121 0.126663 1398 1 0.71775 0.525963 0.115553 1840 1 0.990092 0.519485 0.085895 899 1 0.799778 0.538457 0.0937061 211 1 0.914451 0.596885 0.102133 1469 1 0.147595 0.63534 0.0630677 1800 1 0.742265 0.615678 0.124343 1791 1 0.142846 0.700343 0.0954764 115 1 0.53753 0.713307 0.122852 214 1 0.96531 0.727157 0.107858 1232 1 0.499422 0.788901 0.0933221 143 1 0.970167 0.794251 0.113279 1058 1 0.997871 0.832308 0.127307 729 1 0.28372 0.823434 0.106342 490 1 0.699008 0.879789 0.103607 557 1 0.201517 0.960706 0.0923756 1146 1 0.918376 0.946205 0.131124 1887 1 0.824167 0.672143 0.00392323 27 1 0.952883 0.589063 0.145127 1227 1 0.846094 0.654458 0.0896791 1183 1 0.934667 0.653358 0.128621 52 1 0.957755 0.654163 0.148342 1359 1 0.243522 0.756183 0.119256 309 1 0.351042 0.82544 0.133735 1105 1 0.78425 0.861048 0.133928 1853 1 0.373583 0.928554 0.12781 59 1 0.548125 0.988458 0.109197 1894 1 0.303151 0.562756 0.116507 681 1 0.0232192 0.608735 0.0978039 1553 1 0.0928666 0.652283 0.182602 950 1 0.701868 0.679026 0.164171 552 1 0.851453 0.657015 0.125446 456 1 0.17162 0.719016 0.158671 270 1 0.238254 0.736189 0.134564 928 1 0.393732 0.73461 0.165231 1406 1 0.594556 0.746127 0.157774 725 1 0.991128 0.774704 0.125356 467 1 0.709926 0.843043 0.114319 984 1 0.120181 0.852258 0.138107 991 1 0.960363 0.887659 0.140089 107 1 0.671314 0.509173 0.164838 416 1 0.235333 0.545691 0.172055 1460 1 0.329875 0.579405 0.130543 1727 1 0.374781 0.572714 0.140195 665 1 0.740565 0.56459 0.132689 1003 1 0.958493 0.587923 0.13541 1854 1 0.934995 0.659287 0.143728 1920 1 0.311588 0.662412 0.163739 383 1 0.615257 0.684117 0.163317 363 1 0.602174 0.676854 0.136343 100 1 0.465671 0.78314 0.190756 1428 1 0.323396 0.770051 0.126667 619 1 0.589501 0.810902 0.201249 1356 1 0.967295 0.877293 0.166536 1370 1 0.224082 0.867699 0.112025 1970 1 0.408196 0.956233 0.161131 809 1 0.195092 0.974528 0.145808 1975 1 0.98109 0.977548 0.136535 861 1 0.301858 0.991697 0.138272 313 1 0.41902 0.524101 0.145864 511 1 0.808275 0.520566 0.485324 488 1 0.860072 0.515312 0.189149 1327 1 0.847936 0.520257 0.182974 1662 1 0.822512 0.551715 0.180342 258 1 0.618869 0.585585 0.143657 698 1 0.00970109 0.6257 0.167717 1632 1 0.107458 0.633457 0.177213 203 1 0.269777 0.592672 0.123983 241 1 0.104534 0.641677 0.164884 287 1 0.562132 0.688859 0.184988 1549 1 0.409009 0.766227 0.132589 1007 1 0.858298 0.764457 0.199988 702 1 0.472945 0.758146 0.144402 1152 1 0.413566 0.796462 0.182857 1164 1 0.543675 0.833742 0.161271 1903 1 0.48032 0.812309 0.147268 2014 1 0.941506 0.825984 0.153641 1521 1 0.582032 0.912486 0.171322 1732 1 0.838099 0.944757 0.175327 1936 1 0.974757 0.522064 0.184724 323 1 0.506996 0.568996 0.189739 2038 1 0.814476 0.570254 0.17675 1047 1 0.678261 0.587185 0.218164 683 1 0.561517 0.687911 0.232689 500 1 0.980404 0.72523 0.188345 479 1 0.066364 0.718743 0.172423 1647 1 0.201421 0.746075 0.195542 1821 1 0.0889707 0.785415 0.196689 1442 1 0.353744 0.810635 0.183133 878 1 0.0487425 0.796327 0.22383 548 1 0.984542 0.78555 0.178681 1156 1 0.422662 0.835439 0.205698 962 1 0.529782 0.856347 0.160494 1859 1 0.463035 0.894613 0.216355 1541 1 0.513275 0.902647 0.187543 400 1 0.708378 0.937627 0.206058 1697 1 0.701575 0.985057 0.1902 34 1 0.948836 0.975036 0.193003 1768 1 0.412759 0.513917 0.220983 744 1 0.91703 0.545343 0.222401 1389 1 0.971995 0.546793 0.209619 1252 1 0.295195 0.58494 0.249489 1862 1 0.19251 0.571259 0.208301 1316 1 0.493511 0.61546 0.216009 893 1 0.979899 0.619067 0.171558 1828 1 0.231456 0.631278 0.242963 823 1 0.238112 0.649053 0.233347 1038 1 0.800556 0.690206 0.213109 225 1 0.341302 0.755475 0.203904 206 1 0.891164 0.764502 0.247772 1066 1 0.406203 0.748681 0.215131 86 1 0.993923 0.770981 0.205223 736 1 0.0601163 0.874476 0.224248 749 1 0.43285 0.880353 0.191469 450 1 0.621944 0.883501 0.195638 1868 1 0.664903 0.939231 0.227239 259 1 0.42094 0.969182 0.199306 223 1 0.699112 0.973989 0.21839 1797 1 0.587374 0.527333 0.23122 1372 1 0.0812967 0.569821 0.213245 1065 1 0.469298 0.575312 0.249414 1503 1 0.668072 0.547155 0.242794 935 1 0.0719366 0.5676 0.209907 376 1 0.650248 0.548469 0.228498 1504 1 0.296239 0.696087 0.222667 90 1 0.424526 0.722591 0.243443 1942 1 0.473899 0.725008 0.243435 353 1 0.149581 0.79166 0.229455 1864 1 0.867585 0.744151 0.226154 948 1 0.73785 0.781271 0.220245 1369 1 0.0161999 0.787893 0.216797 414 1 0.115165 0.817477 0.265812 227 1 0.765912 0.82104 0.217644 1912 1 0.874905 0.816989 0.269634 1035 1 0.549705 0.843425 0.228586 1060 1 0.955824 0.867471 0.221036 389 1 0.820435 0.896367 0.214038 1832 1 0.251031 0.907337 0.231998 347 1 0.692544 0.927157 0.258651 1811 1 0.374297 0.979784 0.227057 72 1 0.0255927 0.510755 0.223565 483 1 0.218152 0.548344 0.233388 333 1 0.339643 0.58923 0.256624 1361 1 0.890004 0.626475 0.234569 73 1 0.172601 0.60788 0.220774 527 1 0.707226 0.636723 0.264035 495 1 0.981467 0.66469 0.267302 1214 1 0.910665 0.706945 0.276227 589 1 0.879609 0.71489 0.250131 423 1 0.439153 0.742894 0.239061 1702 1 0.331806 0.79033 0.232498 201 1 0.660157 0.783856 0.252117 1438 1 0.393356 0.912582 0.252688 1687 1 0.972218 0.928355 0.241682 790 1 0.142645 0.969347 0.226062 591 1 0.396109 0.961635 0.216203 1350 1 0.631058 0.966537 0.233566 578 1 0.653277 0.974366 0.250366 1300 1 0.931971 0.98756 0.227779 1102 1 0.884825 0.546925 0.273181 1940 1 0.0190258 0.5949 0.270917 252 1 0.260269 0.630259 0.303921 213 1 0.544068 0.641956 0.275614 478 1 0.41966 0.653061 0.246886 422 1 0.637567 0.693369 0.266116 395 1 0.338528 0.697574 0.247921 906 1 0.620882 0.781323 0.282901 42 1 0.621016 0.787057 0.25506 760 1 0.167398 0.781232 0.288277 61 1 0.577673 0.761009 0.251813 294 1 0.327524 0.806912 0.258446 840 1 0.664438 0.819528 0.265864 1731 1 0.00948261 0.943122 0.270063 769 1 0.212768 0.895628 0.237064 777 1 0.0767706 0.919311 0.261462 1113 1 0.130063 0.927273 0.244048 140 1 0.0604694 0.941297 0.235093 152 1 0.437645 0.998328 0.367999 755 1 0.637146 0.502913 0.298033 741 1 0.319881 0.526637 0.316499 1534 1 0.435224 0.571967 0.237713 824 1 0.407454 0.642859 0.257041 1238 1 0.663645 0.674528 0.285084 1111 1 0.660743 0.651093 0.287478 793 1 0.64479 0.671979 0.274147 507 1 0.133515 0.68115 0.28745 983 1 0.814721 0.678887 0.295303 192 1 0.695682 0.75828 0.278271 1585 1 0.776439 0.772436 0.286042 1950 1 0.318861 0.800212 0.296595 1185 1 0.427574 0.835149 0.293419 1723 1 0.193981 0.903203 0.258684 839 1 0.758039 0.916515 0.305397 197 1 0.61162 0.919641 0.314791 474 1 0.401718 0.565442 0.484663 324 1 0.558877 0.943431 0.476828 1402 1 0.393824 0.508687 0.298598 1351 1 0.257244 0.591171 0.312523 944 1 0.510047 0.571207 0.30699 851 1 0.0624205 0.62544 0.302707 1478 1 0.53063 0.583622 0.304588 1836 1 0.379751 0.575896 0.346808 624 1 0.386787 0.628419 0.310638 1492 1 0.230745 0.670618 0.333257 477 1 0.89499 0.713689 0.278911 1059 1 0.607437 0.732063 0.296051 220 1 0.660382 0.767093 0.32275 2048 1 0.107557 0.857985 0.327575 461 1 0.196259 0.859395 0.304889 627 1 0.745354 0.883972 0.329976 112 1 0.371661 0.898074 0.293016 1793 1 0.469441 0.910671 0.32973 1017 1 0.869723 0.914611 0.303236 1825 1 0.936029 0.932144 0.310694 1926 1 0.133768 0.957899 0.287295 1498 1 0.897013 0.941755 0.312179 344 1 0.582938 0.915669 0.283877 1879 1 0.805064 0.971729 0.31146 1145 1 0.956124 0.968491 0.288062 1683 1 0.373494 0.539633 0.288234 976 1 0.270749 0.542913 0.32935 399 1 0.531519 0.532434 0.324339 567 1 0.512398 0.499856 0.317381 1099 1 0.89803 0.564029 0.322211 1407 1 0.060959 0.559914 0.304409 889 1 0.846209 0.580508 0.326453 1602 1 0.0885573 0.584502 0.335856 762 1 0.367331 0.61095 0.341262 598 1 0.703988 0.607459 0.300183 1693 1 0.746757 0.660521 0.34315 956 1 0.852259 0.690604 0.328824 1753 1 0.178014 0.702135 0.349923 1707 1 0.191549 0.751606 0.315553 946 1 0.3969 0.763122 0.341641 1690 1 0.751874 0.781143 0.327036 1558 1 0.0526435 0.820304 0.319576 1524 1 0.302179 0.823383 0.345748 1706 1 0.265914 0.858651 0.326074 730 1 0.254263 0.901438 0.283407 1607 1 0.356388 0.94339 0.308868 1993 1 0.598701 0.939889 0.289038 1837 1 0.546691 0.908171 0.472347 1239 1 0.978337 0.504875 0.344759 1631 1 0.364465 0.629538 0.364613 451 1 0.395124 0.62496 0.29521 1208 1 0.211311 0.619148 0.370069 1929 1 0.199248 0.651798 0.34383 2046 1 0.956997 0.668977 0.337482 1484 1 0.501184 0.717036 0.311523 1247 1 0.511543 0.776066 0.358031 2039 1 0.508906 0.756989 0.283977 545 1 0.128925 0.797697 0.34354 356 1 0.761174 0.76734 0.367994 1268 1 0.343334 0.865213 0.329513 1210 1 0.858774 0.833643 0.326733 732 1 0.0120951 0.873043 0.329916 249 1 0.869768 0.90263 0.35347 1987 1 0.876781 0.900355 0.346256 1119 1 0.376832 0.946042 0.333406 277 1 0.767962 0.923689 0.344118 827 1 0.978443 0.935479 0.347068 377 1 0.311666 0.9268 0.326395 427 1 0.386472 0.942348 0.327436 593 1 0.487029 0.944347 0.382149 563 1 0.496637 0.953224 0.373219 811 1 0.170957 0.505327 0.298044 871 1 0.370854 0.50869 0.352616 484 1 0.477802 0.598855 0.369431 693 1 0.66547 0.594864 0.355479 1587 1 0.689246 0.599287 0.366221 1493 1 0.693652 0.595432 0.379317 888 1 0.850986 0.625727 0.317315 973 1 0.764446 0.661031 0.359526 2021 1 0.75326 0.678566 0.346633 501 1 0.888253 0.705286 0.367971 409 1 0.189087 0.756091 0.351426 1867 1 0.499767 0.749115 0.338821 1581 1 0.905306 0.813326 0.328197 582 1 0.858001 0.819875 0.373573 1306 1 0.0350942 0.811914 0.368978 773 1 0.413919 0.817702 0.350201 1081 1 0.861573 0.876198 0.378751 1167 1 0.707887 0.8733 0.370913 1380 1 0.602151 0.935251 0.344364 280 1 0.738496 0.95147 0.343794 1564 1 0.796079 0.984743 0.0052535 792 1 0.411619 0.566481 0.0115149 1207 1 0.780568 0.533261 0.377075 587 1 0.0509195 0.539369 0.397813 559 1 0.274943 0.596712 0.360502 1762 1 0.561127 0.606829 0.309569 1256 1 0.437637 0.654967 0.374537 800 1 0.692081 0.669871 0.385586 1882 1 0.059725 0.673076 0.362878 1177 1 0.639422 0.671943 0.388481 728 1 0.742617 0.712913 0.407171 1610 1 0.131671 0.810129 0.403087 93 1 0.919257 0.800422 0.359737 302 1 0.0262304 0.846257 0.371428 1129 1 0.783402 0.898501 0.382081 368 1 0.843867 0.896086 0.393012 690 1 0.203153 0.929344 0.40845 1031 1 0.0231102 0.919006 0.402746 1682 1 0.288932 0.92175 0.376925 1860 1 0.737002 0.944246 0.352503 189 1 0.0465522 0.997098 0.35851 1550 1 0.675999 0.980748 0.397367 1366 1 0.257956 0.551903 0.396998 1029 1 0.535336 0.574017 0.410173 159 1 0.927885 0.581778 0.436067 1226 1 0.269904 0.639755 0.391855 533 1 0.0859727 0.639806 0.39318 1815 1 0.587561 0.704707 0.418816 426 1 0.774725 0.715999 0.383672 1943 1 0.358443 0.736428 0.404561 504 1 0.857812 0.694119 0.38798 310 1 0.418284 0.733391 0.379153 767 1 0.599578 0.76427 0.395654 897 1 0.468803 0.779662 0.377154 630 1 0.204541 0.839837 0.399707 282 1 0.592105 0.828084 0.429766 1083 1 0.780803 0.83028 0.372615 1617 1 0.966203 0.808776 0.37308 1592 1 0.373961 0.818266 0.430922 586 1 0.487769 0.824016 0.368627 668 1 0.359376 0.858431 0.428574 449 1 0.470321 0.891633 0.398548 1481 1 0.175574 0.852207 0.395795 1516 1 0.816929 0.855572 0.389535 1653 1 0.219179 0.907128 0.392276 378 1 0.551728 0.940064 0.395143 226 1 0.900912 0.990801 0.385663 1527 1 0.0223339 0.516519 0.398231 695 1 0.163489 0.508419 0.420184 1523 1 0.33188 0.564478 0.418688 989 1 0.338281 0.556717 0.404785 509 1 0.606816 0.69511 0.431161 1259 1 0.0403312 0.704613 0.423654 677 1 0.135932 0.697455 0.391036 874 1 0.746366 0.722619 0.446116 1790 1 0.661303 0.750059 0.438949 132 1 0.014922 0.788636 0.425098 783 1 0.223138 0.758273 0.430708 530 1 0.757236 0.773514 0.423564 1728 1 0.548915 0.817341 0.390153 314 1 0.637526 0.795138 0.414745 1715 1 0.300914 0.874027 0.422958 31 1 0.700728 0.868255 0.445368 318 1 0.0123086 0.903491 0.423707 131 1 0.932308 0.953516 0.426432 521 1 0.0937709 0.524871 0.409049 632 1 0.198807 0.523193 0.4869 1801 1 0.946423 0.532768 0.461018 158 1 0.839184 0.559043 0.422293 430 1 0.224116 0.583151 0.4543 182 1 0.779674 0.568677 0.416992 178 1 0.991119 0.610282 0.432998 526 1 0.739524 0.594087 0.456914 1062 1 0.928839 0.675633 0.398734 296 1 0.114825 0.664859 0.430113 345 1 0.430588 0.69331 0.386443 1733 1 0.0532027 0.699236 0.440391 685 1 0.687451 0.756628 0.445987 608 1 0.189254 0.812779 0.401202 1061 1 0.719973 0.929905 0.413611 1044 1 0.721286 0.929505 0.42574 1639 1 0.418969 0.998221 0.427729 1907 1 0.35139 0.575998 0.459119 1048 1 0.0990975 0.631404 0.435781 902 1 0.715857 0.667184 0.468139 276 1 0.85285 0.610975 0.438086 1456 1 0.641943 0.683658 0.438179 1869 1 0.719619 0.711523 0.416807 238 1 0.271588 0.648703 0.44077 1155 1 0.490442 0.688641 0.438147 1041 1 0.764264 0.670023 0.458515 1582 1 0.547054 0.723231 0.454516 251 1 0.422239 0.72355 0.438902 1018 1 0.401205 0.768017 0.448957 1414 1 0.177517 0.807625 0.487233 785 1 0.270334 0.798003 0.429898 14 1 0.861071 0.834532 0.433006 901 1 0.761256 0.823332 0.452545 1871 1 0.0652352 0.869627 0.456588 1046 1 0.141845 0.852352 0.401845 570 1 0.00373068 0.922177 0.463444 485 1 0.349803 0.974343 0.466022 25 1 0.435475 0.933648 0.45808 2001 1 0.554888 0.932671 0.442869 91 1 0.494617 0.966994 0.460418 1039 1 0.0351078 0.996176 0.45661 9 1 0.0864709 0.967121 0.461405 1798 1 0.764887 0.979738 0.416834 1347 1 0.767754 0.973239 0.0387426 1103 1 0.182807 0.582681 0.465144 235 1 0.629312 0.594874 0.460336 877 1 0.871078 0.672527 0.485543 2018 1 0.132124 0.664761 0.490255 160 1 0.0407953 0.886453 0.489421 1240 1 0.221468 0.894717 0.492768 852 1 0.57203 0.884667 0.475731 1963 1 0.571127 0.879494 0.498428 2029 1 0.635422 0.888272 0.45275 1560 1 0.873236 0.923853 0.471191 110 1 0.482821 0.521608 0.486586 804 1 0.546613 0.520247 0.47704 153 1 0.464785 0.92333 0.49269 247 1 0.61115 0.521212 0.468675 1965 1 0.610975 0.91567 0.493031 938 1 0.472333 0.574162 0.48782 1443 1 0.626836 0.993563 0.167677 58 1 0.859206 0.997918 0.355443 1231 1 0.0758177 0.663881 0.484474 1378 1 0.897498 0.613228 0.496501 13 1 0.0760965 0.649249 0.46659 1772 1 0.710128 0.662009 0.493392 1758 1 0.623798 0.691961 0.489182 814 1 0.226963 0.669808 0.496701 1202 1 0.917657 0.72217 0.471765 1353 1 0.0330815 0.741711 0.484025 628 1 0.716507 0.532913 0.475615 371 1 0.115549 0.992587 0.163765 290 1 0.969987 0.743095 0.475455 1808 1 0.327421 0.770139 0.451105 1685 1 0.660173 0.851279 0.474264 1648 1 0.538378 0.767486 0.498093 631 1 0.0825611 0.820709 0.482255 1150 1 0.548618 0.817048 0.483136 664 1 0.112966 0.747808 0.00564444 1037 1 0.672867 0.962499 0.0101065 1116 1 0.291257 0.805006 0.489734 1179 1 0.651849 0.814735 0.00692351 1593 1 0.516541 0.995567 0.00350567 243 1 0.658916 0.996914 0.211309 1076 1 0.986043 0.824465 0.495798 162 1 0.420331 0.735699 0.000943306 1042 1 0.256737 0.998288 0.328254 1125 1 0.302976 0.501918 0.531058 1919 1 0.169955 0.835263 0.984414 139 1 0.649805 0.509963 0.52131 1803 1 0.785746 0.908549 0.996707 1645 1 0.594321 0.920327 0.973974 1514 1 0.944331 0.584194 0.556987 1694 1 0.389287 0.507608 0.746564 775 1 0.930391 0.538695 0.522645 2019 1 0.531153 0.569383 0.508038 1660 1 0.770318 0.572384 0.537214 904 1 0.0510656 0.586298 0.516662 1454 1 0.70979 0.56867 0.505909 1542 1 0.901381 0.583952 0.500537 60 1 0.950629 0.632927 0.513145 116 1 0.0296908 0.638244 0.535518 831 1 0.599011 0.976064 0.883894 727 1 0.306124 0.737646 0.504625 2045 1 0.621921 0.732367 0.545058 1999 1 0.31208 0.733484 0.52797 540 1 0.222403 0.502538 0.90125 1495 1 0.711592 0.74474 0.50485 473 1 0.668539 0.916742 0.519193 164 1 0.791018 0.729257 0.516748 1637 1 0.40986 0.542599 0.516192 210 1 0.423943 0.978085 0.992382 925 1 0.131795 0.539039 0.523669 191 1 0.9343 0.523078 0.520603 1437 1 0.268608 0.608342 0.515189 1725 1 0.551535 0.707828 0.546919 1792 1 0.362965 0.731781 0.507418 1391 1 0.484866 0.702855 0.537471 123 1 0.486615 0.721942 0.531828 92 1 0.795747 0.750671 0.552733 930 1 0.526295 0.744254 0.530245 977 1 0.0873705 0.731286 0.552475 406 1 0.473323 0.771339 0.54631 1448 1 0.54682 0.804712 0.565616 1962 1 0.90052 0.787561 0.516923 381 1 0.0682286 0.504732 0.736554 1674 1 0.802619 0.817896 0.54768 99 1 0.25277 0.854509 0.509461 750 1 0.646015 0.857354 0.527597 817 1 0.483102 0.551747 0.528007 848 1 0.704131 0.606708 0.533123 1289 1 0.540172 0.669164 0.52194 44 1 0.118236 0.646665 0.544057 403 1 0.877688 0.732842 0.533783 1255 1 0.234764 0.782676 0.564856 996 1 0.679934 0.743229 0.581008 1745 1 0.346705 0.780873 0.561309 721 1 0.485744 0.997717 0.882073 1267 1 0.868953 0.863609 0.557301 209 1 0.94452 0.923269 0.514815 606 1 0.37079 0.960577 0.550548 1866 1 0.385786 0.593529 0.571074 758 1 0.5531 0.56914 0.565847 1123 1 0.684779 0.588993 0.569693 1517 1 0.82075 0.671606 0.562473 784 1 0.566269 0.662679 0.559006 1283 1 0.435797 0.678132 0.616235 916 1 0.411445 0.651117 0.568611 1948 1 0.0887268 0.730945 0.574501 15 1 0.1181 0.773473 0.582517 508 1 0.441882 0.780295 0.563648 1892 1 0.435873 0.808548 0.552358 815 1 0.955431 0.844969 0.569681 1619 1 0.823476 0.857946 0.567616 1196 1 0.22241 0.878244 0.550797 135 1 0.968254 0.935297 0.550161 1812 1 0.100901 0.914242 0.991068 405 1 0.721396 0.953733 0.519456 266 1 0.395915 0.520775 0.556811 856 1 0.159176 0.832682 0.501405 466 1 0.40818 0.52158 0.590271 1971 1 0.554059 0.514985 0.585443 763 1 0.659216 0.549934 0.570452 841 1 0.0255718 0.611918 0.578931 1166 1 0.26655 0.555832 0.581114 1934 1 0.573436 0.590077 0.522006 1077 1 0.0559655 0.625023 0.568565 289 1 0.312754 0.641863 0.570323 1533 1 0.334634 0.616935 0.581357 617 1 0.573371 0.667829 0.572461 53 1 0.955301 0.691454 0.570276 1850 1 0.925406 0.676628 0.577768 1189 1 0.739397 0.731789 0.584548 1117 1 0.792205 0.714322 0.584559 535 1 0.263192 0.77782 0.612591 113 1 0.638571 0.827955 0.57338 1749 1 0.998414 0.939103 0.60878 2043 1 0.543926 0.884701 0.56183 597 1 0.685725 0.923166 0.632558 1668 1 0.755456 0.973039 0.553538 1290 1 0.781607 0.963724 0.572868 1216 1 0.470492 0.992231 0.600512 1846 1 0.608393 0.511721 0.602064 89 1 0.826681 0.516548 0.601325 1831 1 0.72861 0.56418 0.62469 2025 1 0.05104 0.608087 0.587333 2034 1 0.314668 0.642317 0.605937 1766 1 0.30476 0.644313 0.580741 315 1 0.60218 0.648711 0.599021 1941 1 0.00627765 0.753514 0.600731 737 1 0.830654 0.720865 0.585064 1293 1 0.828638 0.854916 0.633388 1594 1 0.88064 0.822872 0.626281 125 1 0.125721 0.84837 0.545407 205 1 0.810267 0.90816 0.615862 1809 1 0.351386 0.88188 0.60877 1748 1 0.44429 0.874218 0.597779 903 1 0.763039 0.89206 0.613951 1170 1 0.855785 0.950354 0.552238 1535 1 0.774122 0.508866 0.614523 497 1 0.974761 0.516906 0.603489 1611 1 0.243257 0.542487 0.572722 1630 1 0.152358 0.566703 0.606427 1574 1 0.510056 0.579838 0.656521 444 1 0.143453 0.600459 0.645485 1575 1 0.15509 0.645048 0.624285 198 1 0.632188 0.640398 0.668823 1313 1 0.672064 0.675675 0.645186 1972 1 0.667283 0.702028 0.619123 676 1 0.164766 0.776544 0.612856 1896 1 0.18802 0.829139 0.633303 452 1 0.538228 0.84593 0.627509 1430 1 0.921174 0.871006 0.597532 274 1 0.639595 0.933154 0.641594 1966 1 0.722986 0.910796 0.643886 1419 1 0.75106 0.939034 0.596768 1807 1 0.750009 0.949824 0.634514 256 1 0.799891 0.916087 0.604533 1872 1 0.978844 0.903622 0.609457 687 1 0.263084 0.990441 0.61712 1486 1 0.0411324 0.504667 0.73252 1358 1 0.786425 0.555358 0.633857 724 1 0.0665321 0.550363 0.654635 1354 1 0.109305 0.644314 0.603015 47 1 0.118632 0.651245 0.624208 1002 1 0.0229105 0.730771 0.61117 952 1 0.549144 0.739297 0.637875 1088 1 0.761871 0.733771 0.641852 1193 1 0.487922 0.739734 0.647259 1107 1 0.304009 0.767611 0.626538 1822 1 0.748508 0.767346 0.626125 1144 1 0.649674 0.795012 0.636748 1567 1 0.872004 0.799832 0.622884 813 1 0.902398 0.774864 0.64638 396 1 0.738365 0.849684 0.614276 32 1 0.926051 0.898014 0.643289 1014 1 0.240519 0.973617 0.655412 1115 1 0.265755 0.982004 0.67641 283 1 0.681757 0.544844 0.674414 1467 1 0.228588 0.598999 0.665105 1488 1 0.383835 0.604516 0.658826 1719 1 0.0431328 0.653941 0.673389 585 1 0.538714 0.673462 0.653735 305 1 0.0792533 0.783633 0.69525 1737 1 0.293779 0.760603 0.639464 1181 1 0.989867 0.764372 0.651954 1005 1 0.0619878 0.795438 0.642873 1310 1 0.724725 0.811737 0.667706 1341 1 0.832346 0.801414 0.662287 1200 1 0.366379 0.909508 0.644824 1626 1 0.68784 0.854022 0.616336 1870 1 0.427924 0.95288 0.633619 397 1 0.164263 0.968476 0.665148 1274 1 0.318364 0.947775 0.697043 434 1 0.73214 0.990728 0.695328 1068 1 0.515705 0.982649 0.68213 801 1 0.954625 0.985281 0.681923 1770 1 0.24855 0.547947 0.641299 2003 1 0.890686 0.569016 0.69691 1086 1 0.0628473 0.604045 0.663503 1487 1 0.391931 0.658653 0.652589 1623 1 0.584233 0.665237 0.699972 95 1 0.954314 0.673163 0.67978 328 1 0.478619 0.695229 0.71305 679 1 0.67766 0.717058 0.691244 179 1 0.78567 0.730179 0.690715 11 1 0.24179 0.746852 0.694301 1958 1 0.247675 0.770668 0.683107 985 1 0.410795 0.88398 0.687339 1995 1 0.899836 0.890658 0.665857 442 1 0.12934 0.97315 0.696309 71 1 0.853112 0.958901 0.681697 1094 1 0.824586 0.553492 0.676142 1986 1 0.34759 0.534608 0.694735 1873 1 0.0989314 0.638191 0.671896 537 1 0.0956761 0.667107 0.689559 285 1 0.621915 0.678655 0.709677 1898 1 0.995312 0.6501 0.707557 76 1 0.000868351 0.679008 0.699323 1646 1 0.596904 0.751803 0.713214 506 1 0.4387 0.781396 0.714164 1561 1 0.800322 0.785351 0.683535 678 1 0.703327 0.819313 0.687144 1063 1 0.843731 0.797473 0.688361 292 1 0.265201 0.828961 0.664222 8 1 0.55024 0.854411 0.678387 1390 1 0.338125 0.885568 0.702077 1546 1 0.123884 0.96529 0.736162 51 1 0.352826 0.973349 0.700045 475 1 0.0220439 0.984931 0.699669 103 1 0.324061 0.986346 0.692514 1158 1 0.919743 0.54375 0.709916 862 1 0.937116 0.575987 0.703171 337 1 0.112374 0.606048 0.682099 357 1 0.294882 0.652278 0.69489 222 1 0.931807 0.607579 0.727098 975 1 0.755278 0.690698 0.716989 1568 1 0.268392 0.660511 0.730862 768 1 0.666946 0.677297 0.716098 1578 1 0.625411 0.791581 0.735237 1270 1 0.941368 0.832256 0.703814 584 1 0.0905352 0.835949 0.72492 1988 1 0.226585 0.826225 0.708898 54 1 0.0612605 0.851452 0.704616 1161 1 0.667981 0.85232 0.696526 325 1 0.131953 0.900103 0.697221 613 1 0.929648 0.858227 0.703958 1775 1 0.188568 0.887368 0.73405 538 1 0.679095 0.864714 0.73987 41 1 0.449694 0.92821 0.700262 157 1 0.440891 0.930971 0.709102 1548 1 0.0701623 0.569146 0.738394 1985 1 0.909506 0.669093 0.73362 190 1 0.2199 0.665256 0.737334 10 1 0.854668 0.699227 0.745776 1826 1 0.520625 0.71398 0.720434 967 1 0.0623604 0.748202 0.746055 482 1 0.352309 0.743822 0.708473 1186 1 0.55129 0.740728 0.736586 803 1 0.950842 0.738642 0.756894 516 1 0.141532 0.865142 0.727572 964 1 0.545833 0.912462 0.716381 1388 1 0.0103232 0.920391 0.777896 514 1 0.883059 0.514146 0.508579 1169 1 0.8932 0.565556 0.756313 1750 1 0.361203 0.518487 0.736712 80 1 0.0450049 0.616108 0.761285 360 1 0.339164 0.577544 0.740019 1726 1 0.13914 0.62183 0.73838 1071 1 0.757303 0.645562 0.77048 242 1 0.687422 0.715418 0.752281 1900 1 0.108601 0.709274 0.758197 898 1 0.777681 0.745875 0.748843 833 1 0.426648 0.760431 0.772728 311 1 0.89493 0.802718 0.732534 641 1 0.606719 0.80192 0.751832 626 1 0.950893 0.807598 0.724101 207 1 0.547479 0.815571 0.739981 735 1 0.698191 0.83584 0.76197 1204 1 0.870216 0.844416 0.771969 1704 1 0.904941 0.827009 0.751554 754 1 0.843733 0.887787 0.735281 842 1 0.0907229 0.954572 0.762641 913 1 0.280233 0.942477 0.759729 583 1 0.537726 0.981105 0.735782 1030 1 0.562031 0.90829 0.994615 1526 1 0.092785 0.565238 0.765597 1787 1 0.0657553 0.599872 0.797175 465 1 0.281078 0.626796 0.788027 756 1 0.857443 0.651065 0.787333 970 1 0.448627 0.645879 0.778222 503 1 0.562197 0.732739 0.788577 1110 1 0.681094 0.742544 0.753728 1990 1 0.0764644 0.710167 0.767769 776 1 0.481919 0.716602 0.764757 471 1 0.611343 0.728948 0.789017 336 1 0.911987 0.791388 0.732649 1946 1 0.865815 0.853108 0.779599 1104 1 0.251167 0.883013 0.742781 67 1 0.229647 0.935785 0.761005 1847 1 0.680312 0.949167 0.749679 838 1 0.230248 0.945129 0.809642 1120 1 0.255454 0.553001 0.800454 923 1 0.39059 0.512606 0.733647 1916 1 0.252896 0.566356 0.810995 770 1 0.766085 0.601448 0.792056 1939 1 0.987576 0.622132 0.793239 291 1 0.877508 0.640171 0.78641 248 1 0.202259 0.648795 0.747128 299 1 0.308681 0.659079 0.774221 322 1 0.514325 0.668965 0.795131 196 1 0.898506 0.700668 0.800211 1848 1 0.00216077 0.70207 0.817859 1296 1 0.61846 0.733138 0.80054 1112 1 0.66812 0.804172 0.792408 659 1 0.763008 0.787723 0.785978 1441 1 0.362533 0.793922 0.756721 293 1 0.771864 0.783205 0.786197 1769 1 0.901836 0.803362 0.746943 799 1 0.27158 0.821299 0.780324 1579 1 0.663979 0.831856 0.843622 1027 1 0.872934 0.833451 0.788414 671 1 0.801303 0.877826 0.774056 1089 1 0.336122 0.926719 0.795308 1989 1 0.202444 0.957141 0.780313 1417 1 0.661585 0.973594 0.770323 1203 1 0.44896 0.977516 0.791415 951 1 0.514904 0.975401 0.788012 417 1 0.41674 0.51105 0.974971 432 1 0.355161 0.76014 0.975565 142 1 0.39369 0.504102 0.776844 264 1 0.3921 0.997082 0.738423 1346 1 0.206404 0.640139 0.802236 643 1 0.325176 0.576517 0.774426 1373 1 0.0766572 0.679303 0.793782 1709 1 0.236637 0.622315 0.821213 931 1 0.590076 0.645155 0.812964 288 1 0.30921 0.672149 0.812188 1475 1 0.108089 0.758568 0.801598 658 1 0.768079 0.767569 0.784043 130 1 0.461633 0.804697 0.814817 1386 1 0.981088 0.799989 0.772017 1921 1 0.217613 0.830005 0.822473 1344 1 0.210781 0.834143 0.814762 974 1 0.391885 0.833947 0.818996 165 1 0.726978 0.815122 0.792862 1137 1 0.831285 0.830593 0.834228 1188 1 0.716568 0.860992 0.806475 933 1 0.746461 0.883689 0.834477 1876 1 0.395453 0.914874 0.827877 1461 1 0.847714 0.982033 0.831079 1655 1 0.850839 0.96854 0.819274 2044 1 0.0110651 0.510079 0.636969 1513 1 0.427565 0.977698 0.834536 666 1 0.589365 0.522404 0.809954 1861 1 0.202459 0.5231 0.831771 216 1 0.505398 0.557872 0.822023 945 1 0.588035 0.606454 0.824592 1392 1 0.843619 0.672634 0.797245 1515 1 0.0123809 0.694373 0.813202 169 1 0.211952 0.721736 0.803789 175 1 0.848998 0.716105 0.803222 1734 1 0.317271 0.774142 0.851243 30 1 0.738844 0.759567 0.809607 1677 1 0.882369 0.772441 0.83811 718 1 0.193137 0.798396 0.830283 126 1 0.687305 0.790885 0.835447 433 1 0.13416 0.875541 0.825452 1287 1 0.738788 0.892311 0.837679 1590 1 0.488684 0.878485 0.849672 1902 1 0.801126 0.919318 0.8478 1877 1 0.875136 0.998425 0.804198 914 1 0.550195 0.624138 0.874551 747 1 0.611119 0.670043 0.853193 1700 1 0.38157 0.736316 0.840737 560 1 0.117496 0.707466 0.807687 439 1 0.362614 0.722893 0.801377 1980 1 0.589822 0.783167 0.843233 1352 1 0.890348 0.798965 0.865026 1205 1 0.755801 0.848702 0.878281 453 1 0.972796 0.812779 0.839442 652 1 0.828882 0.908594 0.855042 104 1 0.891762 0.970102 0.802969 1451 1 0.0237941 0.842178 0.51011 1109 1 0.573113 0.524688 0.963001 1349 1 0.476841 0.565299 0.839167 1605 1 0.603237 0.570337 0.873903 1288 1 0.771074 0.621975 0.847972 1667 1 0.811719 0.617166 0.866521 1425 1 0.123337 0.621422 0.844058 910 1 0.7766 0.619636 0.894783 1305 1 0.23532 0.623424 0.864166 1326 1 0.553157 0.708177 0.880612 994 1 0.613321 0.681032 0.862944 691 1 0.669566 0.683849 0.851265 523 1 0.963315 0.705935 0.824993 1824 1 0.120239 0.783294 0.882642 120 1 0.259536 0.810031 0.864974 924 1 0.76208 0.840312 0.848024 569 1 0.363075 0.819654 0.887592 796 1 0.578476 0.84296 0.848715 927 1 0.787812 0.856444 0.856445 1886 1 0.943207 0.886516 0.856659 425 1 0.745765 0.894533 0.868211 707 1 0.934323 0.92052 0.830698 415 1 0.399886 0.924982 0.898362 498 1 0.460231 0.976134 0.850175 1735 1 0.268879 0.987971 0.87443 1118 1 0.28173 0.997555 0.872276 1477 1 0.78382 0.520943 0.913271 1400 1 0.206647 0.536874 0.884746 1192 1 0.962648 0.5957 0.887276 2022 1 0.697928 0.612638 0.898612 373 1 0.195524 0.648926 0.895588 1382 1 0.127514 0.744756 0.866455 278 1 0.328554 0.754178 0.894037 1357 1 0.777759 0.732018 0.848541 808 1 0.0122503 0.733976 0.888121 798 1 0.668484 0.714413 0.868148 398 1 0.799707 0.758305 0.873647 712 1 0.0971365 0.769313 0.878337 317 1 0.342171 0.778775 0.864922 1294 1 0.308386 0.795016 0.876936 1182 1 0.884989 0.816283 0.895508 599 1 0.965502 0.846572 0.863713 518 1 0.758374 0.886315 0.867548 236 1 0.635278 0.957881 0.896633 2037 1 0.297319 0.938652 0.856529 1897 1 0.00245052 0.521597 0.943253 891 1 0.166197 0.583118 0.897756 1684 1 0.896891 0.60505 0.897968 1375 1 0.746138 0.602815 0.884074 208 1 0.581064 0.628902 0.88894 905 1 0.8853 0.619796 0.860265 2041 1 0.721116 0.708374 0.863494 1586 1 0.615092 0.710757 0.932699 621 1 0.593914 0.718128 0.923139 1539 1 0.582231 0.887699 0.886907 69 1 0.813578 0.816938 0.875375 1606 1 0.0976567 0.906368 0.889452 1162 1 0.648697 0.961813 0.859179 1244 1 0.0831955 0.619323 0.502937 1915 1 0.273478 0.961732 0.882747 1279 1 0.282755 0.985095 0.99339 1507 1 0.483966 0.52769 0.957882 1718 1 0.710539 0.538576 0.918434 1659 1 0.9094 0.522737 0.915087 1459 1 0.909465 0.499971 0.904911 1345 1 0.86522 0.515923 0.931857 1135 1 0.137168 0.566034 0.886478 1509 1 0.359375 0.565336 0.887 1312 1 0.927665 0.559915 0.897055 1284 1 0.600902 0.57741 0.917002 551 1 0.197338 0.591337 0.926778 2028 1 0.17881 0.623285 0.919478 892 1 0.497546 0.635162 0.888929 581 1 0.0581359 0.63928 0.899925 1559 1 0.151932 0.657365 0.928064 610 1 0.4977 0.671287 0.89059 83 1 0.518956 0.656329 0.907579 84 1 0.899763 0.709686 0.980068 1906 1 0.925667 0.792828 0.925486 375 1 0.218341 0.806049 0.940303 958 1 0.38742 0.819368 0.895402 1596 1 0.0555351 0.849238 0.898291 1222 1 0.0468635 0.842725 0.905032 457 1 0.580502 0.867237 0.926916 742 1 0.564844 0.867951 0.909621 1237 1 0.816971 0.912441 0.898727 168 1 0.267031 0.96141 0.914214 1786 1 0.799036 0.951434 0.914852 121 1 0.922612 0.941278 0.925575 1511 1 0.744768 0.950116 0.920429 232 1 0.00249237 0.531734 0.922486 1401 1 0.103739 0.565533 0.962211 2020 1 0.47897 0.535971 0.92117 1057 1 0.329343 0.534212 0.93694 1131 1 0.0261821 0.544941 0.954789 1453 1 0.946506 0.568056 0.939772 846 1 0.556155 0.559118 0.933353 1529 1 0.451734 0.659961 0.932928 1332 1 0.951424 0.712403 0.934311 271 1 0.528275 0.728646 0.904077 1008 1 0.344633 0.774092 0.937707 144 1 0.584459 0.833115 0.956867 634 1 0.216762 0.795198 0.945539 334 1 0.110622 0.861626 0.942488 1464 1 0.730674 0.87967 0.919002 1100 1 0.368477 0.904225 0.940022 575 1 0.481338 0.957157 0.924473 596 1 0.390318 0.947313 0.919725 1739 1 0.399522 0.971263 0.977673 1337 1 0.44272 0.946993 0.943414 1545 1 0.239295 0.976152 0.960054 720 1 0.480631 0.971185 0.910841 1666 1 0.954348 0.981824 0.947352 1998 1 0.27651 0.509442 0.983591 820 1 0.556693 0.526001 0.941937 1765 1 0.42408 0.574256 0.962988 1938 1 0.467039 0.628271 0.962386 39 1 0.482165 0.606164 0.926258 1499 1 0.728029 0.640662 0.950552 1435 1 0.737095 0.665538 0.921748 733 1 0.403653 0.636727 0.955919 2000 1 0.550318 0.691029 0.975247 1624 1 0.288233 0.691053 0.965678 1780 1 0.725608 0.71383 0.986741 1857 1 0.760078 0.74749 0.961882 1603 1 0.0262217 0.781832 0.970297 431 1 0.395918 0.747421 0.950466 1434 1 0.321357 0.758752 0.965193 1676 1 0.111527 0.824388 0.970196 1397 1 0.383507 0.846807 0.93888 151 1 0.976699 0.831578 0.940184 176 1 0.573043 0.848873 0.953096 1324 1 0.0122903 0.843349 0.939349 1211 1 0.756671 0.896675 0.935926 1209 1 0.593527 0.964885 0.941435 1230 1 0.914255 0.500571 0.786766 1713 1 0.11119 0.988529 0.649116 1794 1 0.451167 0.546585 0.952011 592 1 0.652853 0.528671 0.975912 127 1 0.301476 0.570297 0.986695 341 1 0.464381 0.600408 0.924981 1447 1 0.395721 0.649077 0.993611 739 1 0.267275 0.678443 0.952758 959 1 0.510909 0.661209 0.976262 2015 1 0.902407 0.733089 0.937947 1997 1 0.81927 0.72827 0.981704 1994 1 0.383451 0.785384 0.978035 183 1 0.633763 0.751632 0.939205 1627 1 0.936267 0.775407 0.991057 1408 1 0.338771 0.778569 0.946097 907 1 0.916449 0.754046 0.929046 1979 1 0.0667883 0.842966 0.996469 343 1 0.471176 0.799865 0.970939 1597 1 0.749143 0.702228 0.96855 1191 1 0.862572 0.82901 0.986154 1250 1 0.94542 0.926221 0.949554 1604 1 0.291671 0.901453 0.967178 445 1 0.23503 0.937682 0.976088 1816 1 0.0598245 0.506976 0.765005 1276 1 0.138327 0.974518 0.957729 1307 1 0.493971 0.507006 0.893875 1043 1 0.224808 0.820694 0.999111 350 1 0.631191 0.507369 0.893662 764 1 0.611963 0.55093 0.998338 167 1 0.444799 0.502135 0.66044 806 1 0.768969 0.711351 0.996526 493 1 0.18704 0.90577 0.971887 468 1 0.1425 0.729258 0.984541 23 1 0.39408 0.892855 0.997787
8603cf60ef58ca914e68ca90dc7218b1cb8c56d1
9e567b8241ce00e9d53843f5aba11c4a119b079f
/tags/basemap_v0_1_1/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
5a5f2e8a998ca09e38a45384a108347f6f0e0790
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-us-govt-public-domain", "MIT" ]
permissive
neilpanchal/matplotlib
3d2a7133e858c4eefbb6c2939eb3f7a328b18118
7565d1f2943e0e7b4a3f11ce692dfb9b548d0b83
refs/heads/master
2020-06-11T09:20:43.941323
2011-01-21T21:50:16
2011-01-21T21:50:16
null
0
0
null
null
null
null
UTF-8
Python
false
false
25,037
py
from matplotlib.collections import LineCollection from matplotlib.patches import Polygon from matplotlib.lines import Line2D import numarray as N from numarray import nd_image import sys, os, MLab from proj import Proj _datadir = os.path.join(sys.prefix,'share/basemap') class Basemap: """ Set up a basemap with a given map projection (cylindrical equidistant, mercator, lambert conformal conic, lambert azimuthal equal area, albers equal area conic and stereographic are currently available). Doesn't actually draw anything, but sets up the map projection class and creates the coastline and political boundary polygons in native map projection coordinates. Requires matplotlib and numarray. Uses a pyrex interface to C-code from proj.4 (http://proj.maptools.org). Useful instance variables: projection - map projection ('cyl','merc','lcc','aea','laea' or 'stere') aspect - map aspect ratio (size of y dimension / size of x dimension). llcrnrlon - longitude of lower left hand corner of the desired map domain. llcrnrlon - latitude of lower left hand corner of the desired map domain. urcrnrlon - longitude of upper right hand corner of the desired map domain. urcrnrlon - latitude of upper right hand corner of the desired map domain. llcrnrx,llcrnry,urcrnrx,urcrnry - corners of map domain in projection coordinates. Example Usage: (this example plus others can be run by running test.py in the examples dir) >>> from matplotlib.toolkits.basemap import Basemap >>> import cPickle >>> from pylab import * >>> # read in topo data from pickle (on a regular lat/lon grid) >>> topodict = cPickle.load(open('etopo20.pickle','rb')) >>> etopo = topodict['data']; lons = topodict['lons']; lats = topodict['lats'] >>> m = Basemap(lons[0],lats[0],lons[-1],lats[-1]) >>> xsize = rcParams['figure.figsize'][0] >>> fig=figure(figsize=(xsize,m.aspect*xsize)) >>> fig.add_axes([0.1,0.1,0.8,0.8]) >>> im = imshow(etopo,extent=(m.llcrnrx,m.urcrnrx,m.llcrnry,m.urcrnry),origin='lower') >>> ax = gca() # get current axis instance >>> # draw coastlines and fill continents. >>> m.drawcoastlines(ax) >>> m.fillcontinents(ax) >>> # draw parallels >>> circles = arange(-90.,120.,30.) >>> m.drawparallels(ax,circles) >>> # draw meridians >>> meridians = arange(0.,390.,60.) >>> m.drawmeridians(ax,meridians) >>> ax.set_xticks([]) # no ticks >>> ax.set_yticks([]) >>> title('Cylindrical Equidistant') >>> show() Version: 0.1 (20050203) Contact: Jeff Whitaker <[email protected]> """ def __init__(self,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat,\ resolution='c',area_thresh=10000.,projection='cyl',rsphere=6371009.,\ lat_ts=None,lat_1=None,lat_2=None,lat_0=None,lon_0=None): """ create a Basemap instance. mandatory input arguments: llcrnrlon - longitude of lower left hand corner of the desired map domain. llcrnrlon - latitude of lower left hand corner of the desired map domain. urcrnrlon - longitude of upper right hand corner of the desired map domain. urcrnrlon - latitude of upper right hand corner of the desired map domain. optional keyword parameters: resolution - resolution of coastline database to use. Can be 'c' (crude, roughly 25 km resolution) or 'l' (low, roughly 5 km resolution). Default 'c'. Coastline data is from the GSHHS (http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html). area_thresh - coastline with an area smaller than area_thresh in km^2 will not be plotted. Default 10,000. projection - map projection. 'cyl' - cylindrical equidistant, 'merc' - mercator, 'lcc' - lambert conformal conic, 'stere' - stereographic, 'aea' - albers equal area conic, and 'laea' - lambert azimuthal equal area currently available. Default 'cyl'. rsphere - radius of the sphere used to define map projection (default 6371009 meters, close to the arithmetic mean radius of the earth). The following parameters are map projection parameters which all default to None. Not all parameters are used by all projections, some are ignored. lat_ts - latitude of natural origin (used for mercator and stereographic projections). lat_1 - first standard parallel for lambert conformal and albers equal area projections. lat_2 - second standard parallel for lambert conformal and albers equal area projections. lat_0 - central latitude (y-axis origin) - used by stereographic and lambert azimuthal projections). lon_0 - central meridian (x-axis origin - used by lambert conformal and lambert azimuthal and stereographic projections). """ # read in coastline data. coastlons = []; coastlats = []; coastsegind = []; coastsegarea = [] i = 0 # the current ind for line in open(os.path.join(_datadir,'gshhs_'+resolution+'.txt')): linesplit = line.split() if line.startswith('P'): coastsegind.append(i) coastsegarea.append(float(linesplit[5])) continue # lon/lat lon, lat = [float(val) for val in linesplit] coastlons.append(lon) coastlats.append(lat) i += 1 # read in country boundary data. cntrylons = []; cntrylats = []; cntrysegind = [] i = 0 # the current ind for line in open(os.path.join(_datadir,'countries_'+resolution+'.txt')): linesplit = line.split() if line.startswith('>'): cntrysegind.append(i) continue # lon/lat lon, lat = [float(val) for val in linesplit] cntrylons.append(lon) cntrylats.append(lat) i += 1 # read in state boundaries (Americas only). statelons = []; statelats = []; statesegind = [] i = 0 # the current ind for line in open(os.path.join(_datadir,'states_'+resolution+'.txt')): linesplit = line.split() if line.startswith('>'): statesegind.append(i) continue # lon/lat lon, lat = [float(val) for val in linesplit] statelons.append(lon) statelats.append(lat) i += 1 # extend longitudes around the earth a second time # (in case projection region straddles Greenwich meridian). coastlons2 = [lon+360. for lon in coastlons] cntrylons2 = [lon+360. for lon in cntrylons] statelons2 = [lon+360. for lon in statelons] # set up projections using Proj class. self.projection = projection self.llcrnrlon = llcrnrlon self.llcrnrlat = llcrnrlat self.urcrnrlon = urcrnrlon self.urcrnrlat = urcrnrlat projparams = {} projparams['proj'] = projection projparams['R'] = rsphere self.rsphere = rsphere if projection == 'lcc': if lat_1 is None or lon_0 is None: raise ValueError, 'must specify lat_1 and lon_0 for Lambert Conformal basemap' projparams['lat_1'] = lat_1 if lat_2 != None: projparams['lat_2'] = lat_2 projparams['lon_0'] = lon_0 proj = Proj(projparams,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat) elif projection == 'aea': if lat_1 is None or lat_2 is None or lon_0 is None: raise ValueError, 'must specify lat_1, lat_2 and lon_0 for Albers Equal Area basemap' projparams['lat_1'] = lat_1 projparams['lat_2'] = lat_2 projparams['lon_0'] = lon_0 proj = Proj(projparams,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat) elif projection == 'stere': if lat_ts is None or lat_0 is None or lon_0 is None: raise ValueError, 'must specify lat_ts,lat_0 and lon_0 for Stereographic basemap' projparams['lat_ts'] = lat_ts projparams['lat_0'] = lat_0 projparams['lon_0'] = lon_0 proj = Proj(projparams,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat) elif projection == 'laea': if None or lat_0 is None or lon_0 is None: raise ValueError, 'must specify lat_0 and lon_0 for Lambert Azimuthal basemap' projparams['lat_0'] = lat_0 projparams['lon_0'] = lon_0 proj = Proj(projparams,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat) elif projection == 'merc': if lat_ts is None: raise ValueError, 'must specify lat_ts for Mercator basemap' projparams['lat_ts'] = lat_ts proj = Proj(projparams,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat) elif projection == 'cyl': proj = Proj(projparams,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat) else: raise ValueError, 'unsupported projection' # make Proj instance a Basemap instance variable. self.projtran = proj # set instance variables defining map region. self.xmin = proj.xmin self.xmax = proj.xmax self.ymin = proj.ymin self.ymax = proj.ymax if projection == 'cyl' or projection == 'merc': self.aspect = (urcrnrlat-llcrnrlat)/(urcrnrlon-llcrnrlon) else: self.aspect = (proj.ymax-proj.ymin)/(proj.xmax-proj.xmin) self.llcrnrx = proj.llcrnrx self.llcrnry = proj.llcrnry self.urcrnrx = proj.urcrnrx self.urcrnry = proj.urcrnry # transform coastline polygons to native map coordinates. xc,yc = proj(N.array(coastlons,'f'),N.array(coastlats,'f')) xc2,yc2 = proj(N.array(coastlons2,'f'),N.array(coastlats,'f')) if projection == 'merc': yc2=yc # set up segments in form needed for LineCollection, # ignoring 'inf' values that are off the map, and skipping # polygons that have an area > area_thresh.. segments = [zip(xc[i0:i1],yc[i0:i1]) for a,i0,i1 in zip(coastsegarea[:-1],coastsegind[:-1],coastsegind[1:]) if a > area_thresh] segments2 = [zip(xc2[i0:i1],yc2[i0:i1]) for a,i0,i1 in zip(coastsegarea[:-1],coastsegind[:-1],coastsegind[1:]) if a > area_thresh and max(xc2[i0:i1]) < 1.e20 and max(yc2[i0:i1]) < 1.e20] self.coastsegs = segments+segments2 # same as above for country polygons. xc,yc = proj(N.array(cntrylons,'f'),N.array(cntrylats,'f')) xc2,yc2 = proj(N.array(cntrylons2,'f'),N.array(cntrylats,'f')) segments = [zip(xc[i0:i1],yc[i0:i1]) for i0,i1 in zip(cntrysegind[:-1],cntrysegind[1:])] segments2 = [zip(xc2[i0:i1],yc2[i0:i1]) for i0,i1 in zip(cntrysegind[:-1],cntrysegind[1:]) if max(xc2[i0:i1]) < 1.e20 and max(yc2[i0:i1]) < 1.e20] self.cntrysegs = segments+segments2 # same as above for state polygons. xc,yc = proj(N.array(statelons,'f'),N.array(statelats,'f')) xc2,yc2 = proj(N.array(statelons2,'f'),N.array(statelats,'f')) segments = [zip(xc[i0:i1],yc[i0:i1]) for i0,i1 in zip(statesegind[:-1],statesegind[1:])] segments2 = [zip(xc2[i0:i1],yc2[i0:i1]) for i0,i1 in zip(statesegind[:-1],statesegind[1:]) if max(xc2[i0:i1]) < 1.e20 and max(yc2[i0:i1]) < 1.e20] self.statesegs = segments+segments2 # store coast polygons for filling. # special treatment (kludge) for Antarctica. self.coastpolygons=[] if projection == 'merc': xsp,ysp = proj(0.,-89.9) # s. pole coordinates. xa,ya = proj(0.,-68.0) # edge of antarctica. for seg in self.coastsegs: x = [lon for lon,lat in seg] y = [lat for lon,lat in seg] # the antarctic polygon is a nuisance, since it # spans all longitudes, it's not closed and will not be filled # without some projection dependant tweaking. if projection == 'cyl': if x[-1] == 0.000 and y[-1] < -68.: # close antarctica x.append(0.) y.append(-90.0000) x.insert(0,360.) y.insert(0,-90) if x[-1] == 360.000 and y[-1] < -68.: x.append(360.) y.append(-90) x.insert(0,720.) y.insert(0,-90) elif projection == 'merc': if x[-1] == 0.000 and y[-1] < ya: # close antarctica x.append(0.) y.append(ysp) x.insert(0,360.) y.insert(0,ysp) if x[-1] == 360.000 and y[-1] < ya: x.append(360.) y.append(ysp) x.insert(0,720.) y.insert(0,ysp) self.coastpolygons.append((x,y)) def __call__(self,x,y,inverse=False): """ Calling a Basemap class instance with the arguments lon, lat will convert lon/lat (in degrees) to x/y native map projection coordinates (in meters). If optional keyword 'inverse' is True (default is False), the inverse transformation from x/y to lon/lat is performed. For cylindrical equidistant projection ('cyl'), this does nothing (i.e. x,y == lon,lat). For mercator projection ('merc'), x == lon, but y has units of meters. lon,lat can be either scalar floats or N arrays. """ return self.projtran(x,y,inverse=inverse) def makegrid(self,nx,ny): """ return arrays of shape (ny,nx) containing lon,lat coordinates of an equally spaced native projection grid. """ return self.projtran.makegrid(nx,ny) def fillcontinents(self,ax,color=0.8): """ Fill continents. ax - current axis instance. color - color to fill continents (default gray). """ # define corners of map domain. p1 = (self.llcrnrx,self.llcrnry); p2 = (self.urcrnrx,self.urcrnry) p3 = (self.llcrnrx,self.urcrnry); p4 = (self.urcrnrx,self.llcrnry) for x,y in self.coastpolygons: xa = N.array(x,'f') ya = N.array(y,'f') # clip to map domain. xa = N.clip(xa, self.xmin, self.xmax) ya = N.clip(ya, self.ymin, self.ymax) # check to see if all four corners of domain in polygon (if so, # don't draw since it will just fill in the whole map). test1 = N.fabs(xa-self.xmax) < 10. test2 = N.fabs(xa-self.xmin) < 10. test3 = N.fabs(ya-self.ymax) < 10. test4 = N.fabs(ya-self.ymin) < 10. hasp1 = sum(test1*test3) hasp2 = sum(test2*test3) hasp4 = sum(test2*test4) hasp3 = sum(test1*test4) if not hasp1 or not hasp2 or not hasp3 or not hasp4: xy = zip(xa.tolist(),ya.tolist()) poly = Polygon(xy,facecolor=color,edgecolor=color,linewidth=0) ax.add_patch(poly) def drawcoastlines(self,ax,linewidth=1.,color='k',antialiased=1): """ Draw coastlines. ax - current axis instance. linewidth - coastline width (default 1.) color - coastline color (default black) antialiased - antialiasing switch for coastlines (default True). """ coastlines = LineCollection(self.coastsegs,antialiaseds=(antialiased,)) try: coastlines.set_color(color) except: # this was a typo that existed in matplotlib-0.71 and earlier coastlines.color(color) coastlines.set_linewidth(linewidth) ax.add_collection(coastlines) def drawcountries(self,ax,linewidth=0.5,color='k',antialiased=1): """ Draw country boundaries. ax - current axis instance. linewidth - country boundary line width (default 0.5) color - country boundary line color (default black) antialiased - antialiasing switch for country boundaries (default True). """ coastlines = LineCollection(self.cntrysegs,antialiaseds=(antialiased,)) try: coastlines.set_color(color) except: # this was a typo that existed in matplotlib-0.71 and earlier coastlines.color(color) coastlines.set_linewidth(linewidth) ax.add_collection(coastlines) def drawstates(self,ax,linewidth=0.5,color='k',antialiased=1): """ Draw state boundaries in Americas. ax - current axis instance. linewidth - state boundary line width (default 0.5) color - state boundary line color (default black) antialiased - antialiasing switch for state boundaries (default True). """ coastlines = LineCollection(self.statesegs,antialiaseds=(antialiased,)) try: coastlines.set_color(color) except: # this was a typo that existed in matplotlib-0.71 and earlier coastlines.color(color) coastlines.set_linewidth(linewidth) ax.add_collection(coastlines) def drawparallels(self,ax,circles,color='k',linewidth=1., \ linestyle='--',dashes=[1,1]): """ draw parallels (latitude lines). ax - current axis instance. circles - list containing latitude values to draw (in degrees). color - color to draw parallels (default black). linewidth - line width for parallels (default 1.) linestyle - line style for parallels (default '--', i.e. dashed). dashes - dash pattern for parallels (default [1,1], i.e. 1 pixel on, 1 pixel off). """ if self.projection in ['merc','cyl']: lons = N.arange(self.llcrnrlon,self.urcrnrlon,1).astype('f') else: lons = N.arange(0,362,1).astype('f') # make sure 80 degree parallel is drawn if projection not merc or cyl try: circlesl = circles.tolist() except: circlesl = circles if self.projection not in ['merc','cyl'] and 80. not in circlesl: circlesl.append(80.) xdelta = 0.1*(self.xmax-self.xmin) ydelta = 0.1*(self.ymax-self.ymin) for circ in circlesl: lats = circ*N.ones(len(lons),'f') x,y = self(lons,lats) # remove points outside domain. testx = N.logical_and(x>=self.xmin-xdelta,x<=self.xmax+xdelta) x = N.compress(testx, x) y = N.compress(testx, y) testy = N.logical_and(y>=self.ymin-ydelta,y<=self.ymax+ydelta) x = N.compress(testy, x) y = N.compress(testy, y) if len(x) > 1 and len(y) > 1: # split into separate line segments if necessary. # (not necessary for mercator or cylindrical). xd = (x[1:]-x[0:-1])**2 yd = (y[1:]-y[0:-1])**2 dist = N.sqrt(xd+yd) split = dist > 500000. if N.sum(split) and self.projection not in ['merc','cyl']: ind = (N.compress(split,MLab.squeeze(split*N.indices(xd.shape)))+1).tolist() xl = [] yl = [] iprev = 0 ind.append(len(xd)) for i in ind: xl.append(x[iprev:i]) yl.append(y[iprev:i]) iprev = i else: xl = [x] yl = [y] # draw each line segment. for x,y in zip(xl,yl): # skip if only a point. if len(x) > 1 and len(y) > 1: l = Line2D(x,y,linewidth=linewidth,linestyle=linestyle) l.set_color(color) l.set_dashes(dashes) ax.add_line(l) def drawmeridians(self,ax,meridians,color='k',linewidth=1., \ linestyle='--',dashes=[1,1]): """ draw meridians (longitude lines). ax - current axis instance. meridians - list containing longitude values to draw (in degrees). color - color to draw meridians (default black). linewidth - line width for meridians (default 1.) linestyle - line style for meridians (default '--', i.e. dashed). dashes - dash pattern for meridians (default [1,1], i.e. 1 pixel on, 1 pixel off). """ if self.projection not in ['merc','cyl']: lats = N.arange(-80,81).astype('f') else: lats = N.arange(-90,91).astype('f') xdelta = 0.1*(self.xmax-self.xmin) ydelta = 0.1*(self.ymax-self.ymin) for merid in meridians: lons = merid*N.ones(len(lats),'f') x,y = self(lons,lats) # remove points outside domain. testx = N.logical_and(x>=self.xmin-xdelta,x<=self.xmax+xdelta) x = N.compress(testx, x) y = N.compress(testx, y) testy = N.logical_and(y>=self.ymin-ydelta,y<=self.ymax+ydelta) x = N.compress(testy, x) y = N.compress(testy, y) if len(x) > 1 and len(y) > 1: # split into separate line segments if necessary. # (not necessary for mercator or cylindrical). xd = (x[1:]-x[0:-1])**2 yd = (y[1:]-y[0:-1])**2 dist = N.sqrt(xd+yd) split = dist > 500000. if N.sum(split) and self.projection not in ['merc','cyl']: ind = (N.compress(split,MLab.squeeze(split*N.indices(xd.shape)))+1).tolist() xl = [] yl = [] iprev = 0 ind.append(len(xd)) for i in ind: xl.append(x[iprev:i]) yl.append(y[iprev:i]) iprev = i else: xl = [x] yl = [y] # draw each line segment. for x,y in zip(xl,yl): # skip if only a point. if len(x) > 1 and len(y) > 1: l = Line2D(x,y,linewidth=linewidth,linestyle=linestyle) l.set_color(color) l.set_dashes(dashes) ax.add_line(l) def interp(datain,lonsin,latsin,lonsout,latsout,checkbounds=False,mode='nearest',cval=0.0,order=3): """ dataout = interp(datain,lonsin,latsin,lonsout,latsout,mode='constant',cval=0.0,order=3) interpolate data (datain) on a regularly spaced lat/lon grid (with lons=lonsin lats=latsin) to a grid with lons=lonsout, lats=latsout. datain is a rank-2 array with 1st dimension corresponding to longitude, 2nd dimension latitude. lonsin, latsin are rank-1 Numeric arrays containing longitudes and latitudes of datain grid in increasing order (i.e. from Greenwich meridian eastward, and South Pole northward) lonsout, latsout are rank-2 Numeric arrays containing lons and lats out desired output grid (typically a native map projection grid). If checkbounds=True, values of lonsout and latsout are checked to see that they lie within the range specified by lonsin and latsing. Default is False, and values outside the borders are handled in the manner described by the 'mode' parameter (default mode='nearest', which means the nearest boundary value is used). See section 20.2 of the numarray docs for information on the 'mode' keyword. See numarray.nd_image.map_coordinates documentation for information on the other optional keyword parameters. The order keyword can be 0 for nearest neighbor interpolation (nd_image only allows 1-6) - if order=0 bounds checking is done even if checkbounds=False. """ # lons and lats must be monotonically increasing. # lonsin, latsin assumed equally spaced. # make sure lonsin, latsin increasing. if lonsin[-1]-lonsin[0] < 0 or latsin[-1]-latsin[0] < 0: raise ValueError, 'lonsin and latsin must be increasing!' # make sure lonsin, latsin are regularly spaced. delon = lonsin[1:]-lonsin[0:-1] delat = latsin[1:]-latsin[0:-1] if max(delat)-min(delat) > 1.e-4 or max(delon)-min(delon) > 1.e-4: raise ValueError, 'lat/lon grid must be uniform!' # optionally, check that lonsout,latsout are # within region defined by lonsin,latsin. if checkbounds or order == 0: if min(N.ravel(lonsout)) < min(lonsin) or \ max(N.ravel(lonsout)) > max(lonsin) or \ min(N.ravel(latsout)) < min(latsin) or \ max(N.ravel(latsout)) > max(latsin): raise ValueError, 'latsout or lonsout outside range of latsin or lonsin' xcoords = (len(lonsin)-1)*(lonsout-lonsin[0])/(lonsin[-1]-lonsin[0]) ycoords = (len(latsin)-1)*(latsout-latsin[0])/(latsin[-1]-latsin[0]) coords = [ycoords,xcoords] # interpolate to projection grid using numarray.nd_image spline filter. if order: return nd_image.map_coordinates(datain,coords,mode=mode,cval=cval,order=order) else: # nearest neighbor interpolation if order=0. # uses index arrays, so first convert to numarray. datatmp = N.array(datain,datain.typecode()) xi = N.around(xcoords).astype('i') yi = N.around(ycoords).astype('i') return datatmp[yi,xi]
[ "(no author)@f61c4167-ca0d-0410-bb4a-bb21726e55ed" ]
(no author)@f61c4167-ca0d-0410-bb4a-bb21726e55ed
e7eef688a513394c0ad13daa03a804f5f7b78d13
4610d0284416361643095ca9c3f404ad82ca63c2
/src/sploitego/xmltools/__init__.py
794eae10734f7233002fc04e4d2c183fdddf298b
[]
no_license
mshelton/sploitego
165a32874d955621c857552fb9692ecf79e77b7e
3944451a110f851a626459767d114569d80a158c
refs/heads/master
2020-12-25T03:11:58.071280
2012-08-16T22:33:10
2012-08-16T22:33:10
null
0
0
null
null
null
null
UTF-8
Python
false
false
307
py
#!/usr/bin/env python __author__ = 'Nadeem Douba' __copyright__ = 'Copyright 2012, Sploitego Project' __credits__ = ['Nadeem Douba'] __license__ = 'GPL' __version__ = '0.1' __maintainer__ = 'Nadeem Douba' __email__ = '[email protected]' __status__ = 'Development' __all__ = [ 'objectify', 'oxml' ]
ad6e4a658bf93bbdaa02f01a60c6f4f8f44bb105
8f9b10acd4b7b8c94ee65c21e6bdb06555d8f669
/anti/migrations/0001_initial.py
a78244a7828ec5d6f51faee450d03d6a3de23072
[]
no_license
leezichanga/unmask-corruption
d848d814118ab785482b57a2c5fcebd5067c2183
231cdb517a2c5a0c2a8bd2a0d9cbec9349106a56
refs/heads/master
2020-03-18T23:26:41.418951
2018-06-04T12:59:28
2018-06-04T12:59:28
135,403,201
0
0
null
null
null
null
UTF-8
Python
false
false
1,560
py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-06-03 10:32 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='categories', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=30)), ], ), migrations.CreateModel( name='report', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=60)), ('location', models.CharField(max_length=60)), ('description', models.TextField()), ('email', models.EmailField(max_length=254)), ('time_uploaded', models.DateTimeField(auto_now_add=True, null=True)), ('report', models.TextField()), ('category', models.ManyToManyField(to='anti.categories')), ('editor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['-time_uploaded'], }, ), ]
a30eee4d854f094ff7638bc79860ddac7bac2068
73e939e797cc28aa33a4f55c234237c47167033e
/ynab_api/model/accounts_response.py
7de75c556b7c9e317bf693bd9bcb8b75435ccea8
[]
no_license
dmlerner/ynab-api
b883a086e6ce7c5d2bdb5b17f3f0a40dbb380046
df94b620d9ec626eacb9ce23bfd313f1c589b03a
refs/heads/master
2023-08-17T14:22:17.606633
2023-07-03T17:05:16
2023-07-03T17:05:16
223,287,209
27
13
null
2023-08-05T18:58:58
2019-11-21T23:58:22
Python
UTF-8
Python
false
false
11,661
py
""" YNAB API Endpoints Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com # noqa: E501 The version of the OpenAPI document: 2.0.3 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from ynab_api.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal, ModelSimple, cached_property, change_keys_js_to_python, convert_js_args_to_python_args, date, datetime, file_type, none_type, validate_get_composed_info, ) from ..model_utils import OpenApiModel from ynab_api.exceptions import ApiAttributeError def lazy_import(): from ynab_api.model.accounts_response_data import AccountsResponseData globals()['AccountsResponseData'] = AccountsResponseData class AccountsResponse(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Attributes: allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a capitalized key describing the allowed value and an allowed value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name and the value is json key in definition. discriminator_value_class_map (dict): A dict to go from the discriminator variable value to the discriminator class name. validations (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict that stores validations for max_length, min_length, max_items, min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, inclusive_minimum, and regex. additional_properties_type (tuple): A tuple of classes accepted as additional properties values. """ allowed_values = {} validations = {} @cached_property def additional_properties_type(): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ lazy_import() return ( bool, date, datetime, dict, float, int, list, str, none_type, ) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ lazy_import() return { 'data': (AccountsResponseData, ), # noqa: E501 } @cached_property def discriminator(): return None attribute_map = { 'data': 'data', # noqa: E501 } read_only_vars = {} _composed_schemas = {} @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 """AccountsResponse - a model defined in OpenAPI Args: data (AccountsResponseData): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. Defaults to True _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response _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) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. _visited_composed_classes (tuple): This stores a tuple of classes that we have traveled through so that if we see that class again we will not use its discriminator again. When traveling through a discriminator, the composed schema that is is traveled through is added to this set. For example if Animal has a discriminator petType and we pass in "Dog", and the class Dog allOf includes Animal, we move through Animal once using the discriminator, and pick Dog. Then in Dog, we will make an instance of the Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) """ _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) _configuration = kwargs.pop('_configuration', None) _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, ), path_to_item=_path_to_item, valid_classes=(self.__class__, ), ) self._data_store = {} self._check_type = _check_type self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + ( self.__class__, ) self.data = data for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self required_properties = set([ '_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args def __init__(self, data, *args, **kwargs): # noqa: E501 """AccountsResponse - a model defined in OpenAPI Args: data (AccountsResponseData): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. Defaults to True _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response _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) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. _visited_composed_classes (tuple): This stores a tuple of classes that we have traveled through so that if we see that class again we will not use its discriminator again. When traveling through a discriminator, the composed schema that is is traveled through is added to this set. For example if Animal has a discriminator petType and we pass in "Dog", and the class Dog allOf includes Animal, we move through Animal once using the discriminator, and pick Dog. Then in Dog, we will make an instance of the Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) """ _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) _configuration = kwargs.pop('_configuration', None) _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) if args: raise ApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, ), path_to_item=_path_to_item, valid_classes=(self.__class__, ), ) self._data_store = {} self._check_type = _check_type self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + ( self.__class__, ) self.data = data for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: raise ApiAttributeError( f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " f"class with read only attributes.")
7caf461078f991bbcf206acdbbaa9a22473746a1
c913c952cf4019d67f02bf1971917116da375c81
/Data/OMIMresults/omimResults1080to1100.py
0089d41eff4948e4c4d053e3541df062149e7619
[]
no_license
jiangchb/OMIMscraping
57afa5b2f8b7ca975e7459814e0410a872f71990
27d4ac8faea526b1c70937317caec064bed00a0a
refs/heads/master
2022-03-14T21:35:56.102665
2019-11-22T15:48:48
2019-11-22T15:48:48
null
0
0
null
null
null
null
UTF-8
Python
false
false
83,915
py
omim = {'omim': { 'version': '1.0', 'searchResponse': { 'search': '*', 'expandedSearch': '*:*', 'parsedSearch': '+*:* ()', 'searchSuggestion': None, 'searchSpelling': None, 'filter': '', 'expandedFilter': None, 'fields': '', 'searchReport': None, 'totalResults': 7368, 'startIndex': 1080, 'endIndex': 1099, 'sort': '', 'operator': '', 'searchTime': 1.0, 'clinicalSynopsisList': [ {'clinicalSynopsis': { 'mimNumber': 119500, 'prefix': '#', 'preferredTitle': 'POPLITEAL PTERYGIUM SYNDROME; PPS', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckEyes': 'Congenital ankyloblepharon filiforme {UMLS C1861543}', 'headAndNeckMouth': '''Lower lip pits {UMLS C1861544 HP:0000196};\nCleft lip {SNOMEDCT:80281008} {ICD10CM:Q36.9,Q36} {ICD9CM:749.1,749.10} {UMLS C0008924,C4321245 HP:0000204,HP:0410030} {HPO HP:0410030};\nCleft palate {SNOMEDCT:87979003,63567004} {ICD10CM:Q35.5,Q35,Q35.9} {ICD9CM:749.0,749.00} {UMLS C2981150,C0008925,C2240378 HP:0000175} {HPO HP:0000175 C0008925,C2981150};\nLower lip cysts {UMLS C1861545};\nSyngnathia {SNOMEDCT:403772000} {UMLS C0795898}''', 'genitourinaryExternalGenitaliaMale': '''Bifid scrotum {SNOMEDCT:236780002} {UMLS C0341787 HP:0000048} {HPO HP:0000048 C0341787};\nHypoplastic scrotum {SNOMEDCT:204912007} {UMLS C0431659 HP:0030276,HP:0000046} {HPO HP:0000046 C0431659}''', 'genitourinaryExternalGenitaliaFemale': 'Hypoplastic labia majora {SNOMEDCT:289469003} {UMLS C0566899 HP:0000059} {HPO HP:0000059 C0566899}', 'genitourinaryInternalGenitaliaMale': 'Cryptorchidism {SNOMEDCT:204878001} {ICD10CM:Q53.9} {ICD9CM:752.51} {UMLS C0010417 HP:0000028} {HPO HP:0000028 C0010417}', 'genitourinaryInternalGenitaliaFemale': '''Hypoplastic vagina {SNOMEDCT:253836009} {UMLS C0345309 HP:0008726} {HPO HP:0008726 C0345309,C1442988};\nHypoplastic uterus {SNOMEDCT:35850006} {ICD10CM:Q51.811} {ICD9CM:752.32} {UMLS C0266399 HP:0000013} {HPO HP:0000013 C0266399}''', 'skeletalSpine': 'Spina bifida occulta {SNOMEDCT:76916001} {ICD10CM:Q76.0} {ICD9CM:756.17} {UMLS C0080174 HP:0003298} {HPO HP:0003298 C0080174}', 'skeletalFeet': 'Talipes equinovarus {SNOMEDCT:397932003} {ICD10CM:Q66.89,Q66.0} {ICD9CM:754.51} {UMLS C0009081 HP:0001762} {HPO HP:0001762 C0009081}', 'skinNailsHairSkin': '''Popliteal pterygium {UMLS C3805420 HP:0009756} {HPO HP:0009756 C3805420};\nIntercrural pterygium {UMLS C3810471 HP:0009757} {HPO HP:0009757 C3810471};\nVariable skin syndactyly fingers and toes {UMLS C3805421};\nPyramidal skinfold of halluces {UMLS C3805422}''', 'skinNailsHairHair': 'Unusual distribution of pubic hair with extension to inner aspect of thigh {UMLS C3805423}', 'miscellaneous': '''Clinical variability {UMLS C1842176};\nIncidence of 1 in 300,000 {UMLS C3549578}''', 'molecularBasis': 'Caused by mutation in the interferon regulatory factor 6 gene (IRF6, {607199.0003})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': True, 'genitourinaryExternalGenitaliaMaleExists': True, 'genitourinaryExternalGenitaliaFemaleExists': True, 'genitourinaryInternalGenitaliaMaleExists': True, 'genitourinaryInternalGenitaliaFemaleExists': True, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': True, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': True, 'skinNailsHairExists': True, 'skinNailsHairSkinExists': True, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': True, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119530, 'prefix': '%', 'preferredTitle': 'OROFACIAL CLEFT 1; OFC1', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckMouth': 'Nonsyndromic cleft lip with or without cleft palate {UMLS C1861538}', 'miscellaneous': '''Genetic heterogeneity, probably determined by major and minor genes, environmental factors, and developmental threshold {UMLS C1861540};\nDivided into isolated cases (75-80%), familial (10-15%), and syndromal (1-5%) {UMLS C1861541}''', 'molecularBasis': 'Caused by mutation in the homolog of the Drosophila muscle segment homeo box (MSX1, {142983.0004})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119540, 'prefix': '%', 'preferredTitle': 'CLEFT PALATE, ISOLATED; CPI', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckMouth': 'Cleft palate, isolated {UMLS C1837218}', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119550, 'prefix': '%', 'preferredTitle': 'SYNGNATHIA', 'oldFormat': { 'Mouth': 'Cleft palate {SNOMEDCT:87979003,63567004} {ICD10CM:Q35.5,Q35,Q35.9} {ICD9CM:749.0,749.00} {UMLS C2981150,C0008925,C2240378 HP:0000175} {HPO HP:0000175 C0008925,C2981150}; Lateral synechia; Cord-like adhesions between tongue and floor of mouth;', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119570, 'preferredTitle': 'CLEFT SOFT PALATE', 'oldFormat': { 'Mouth': 'Cleft soft palate {SNOMEDCT:253997002} {ICD10CM:Q35.3} {UMLS C0432098 HP:0000185} {HPO HP:0000185 C0432098};', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119580, 'prefix': '#', 'preferredTitle': 'BLEPHAROCHEILODONTIC SYNDROME 1; BCDS1', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckFace': '''Flat face {UMLS C1853241 HP:0012368} {HPO HP:0012368 C1853241} {EOM ID:e19b32be420aa391 IMG:Face,Flat-small.jpg};\nHigh forehead {UMLS C0239676 HP:0000348} {HPO HP:0000348 C0239676,C2677762} {EOM ID:f635aa5bd991cae4 IMG:Hairline,High_Anterior-small.jpg};\nAsymmetric face (in some patients) {UMLS C4538387};\nHigh anterior hairline (in some patients) {UMLS C4538388} {HPO HP:0009890 C3276036} {EOM ID:f635aa5bd991cae4 IMG:Hairline,High_Anterior-small.jpg}''', 'headAndNeckEyes': '''Hypertelorism {SNOMEDCT:22006008} {ICD10CM:Q75.2} {ICD9CM:376.41} {UMLS C0020534 HP:0000316} {HPO HP:0000316 C0020534} {EOM ID:71d9f1be67c7f8b6 IMG:Eyes,Widely_Spaced-small.jpg};\nEctropion of lower eyelids {SNOMEDCT:95758006} {UMLS C0521736 HP:0007651} {HPO HP:0007651 C0521736,C4020808};\nLagophthalmia (incomplete closure of eyelids) {SNOMEDCT:60735000} {ICD10CM:H02.20,H02.2} {ICD9CM:374.2,374.20} {UMLS C0152226};\nMegaloblepharon {UMLS C4538389};\nDistichiasis (double row of eyelashes) {SNOMEDCT:95339000} {UMLS C0423848 HP:0008496,HP:0009743} {HPO HP:0009743 C0423848}''', 'headAndNeckNose': 'Choanal atresia (rare) {UMLS C4315078} {HPO HP:0000453 C0008297}', 'headAndNeckMouth': 'Cleft lip and/or palate {UMLS C3279262}', 'headAndNeckTeeth': '''Conical teeth {SNOMEDCT:29553002} {UMLS C0266037 HP:0000698} {HPO HP:0000698 C0266037,C4012359};\nHypodontia {SNOMEDCT:64969001} {ICD10CM:K00.0} {UMLS C0020608 HP:0000668} {HPO HP:0000668 C0020608};\nDelayed dentition (rare) {UMLS C3549588}''', 'abdomenGastrointestinal': 'Imperforate anus (in some patients) {UMLS C3279691} {HPO HP:0002023 C0003466}', 'skeletalHands': '''Clinodactyly {SNOMEDCT:17268007} {UMLS C4551485,C0265610 HP:0030084,HP:0040019} {HPO HP:0030084 C0265610,C4280304} {EOM ID:483af428f909c76c IMG:Clinodactyly-small.jpg};\nSyndactyly, cutaneous (in some patients) {UMLS C3280633} {HPO HP:0012725 C1861921}''', 'skinNailsHairNails': 'Hypoplastic nails {SNOMEDCT:11375002} {UMLS C0263523 HP:0001792} {HPO HP:0001792 C0263523}', 'skinNailsHairHair': '''Distichiasis {SNOMEDCT:95339000} {UMLS C0423848 HP:0008496,HP:0009743} {HPO HP:0009743 C0423848};\nSparse hair {SNOMEDCT:53602002} {UMLS C0020678,C1837770 HP:0008070} {HPO HP:0008070 C1837770,C1860844}''', 'neurologicCentralNervousSystem': 'Neural tube defect (uncommon) {UMLS C4538384} {HPO HP:0045005 C0027794}', 'endocrineFeatures': 'Thyroid hypoplasia or agenesis (uncommon) {UMLS C4538383}', 'miscellaneous': 'Incomplete penetrance observed in some families {UMLS C4538386}', 'molecularBasis': 'Caused by mutation in the cadherin 1 gene (CDH1, {192090.0024})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': True, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': True, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': True, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': True, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': True, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': True, 'skeletalFeetExists': False, 'skinNailsHairExists': True, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': True, 'skinNailsHairHairExists': True, 'muscleSoftTissueExists': False, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': True, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': True, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119600, 'prefix': '#', 'preferredTitle': 'CLEIDOCRANIAL DYSPLASIA; CCD', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'growthHeight': 'Short stature, moderate {UMLS C1861519 HP:0008848} {HPO HP:0008848 C1861519}', 'headAndNeckHead': '''Delayed fontanelle closure {SNOMEDCT:82779003} {UMLS C0277828 HP:0000270} {HPO HP:0000270 C0277828};\nParietal bossing {UMLS C1857126 HP:0000242} {HPO HP:0000242 C1857126};\nAnterior fontanelle open in adults {UMLS C1849537 HP:0004474} {HPO HP:0004474 C1849537}''', 'headAndNeckFace': '''Frontal bossing {SNOMEDCT:90145001} {UMLS C0221354 HP:0002007} {HPO HP:0002007 C0221354} {EOM ID:a223995bdef3e8d6 IMG:Frontal_Bossing-small.jpg};\nMetopic groove {UMLS C1861521};\nMidface hypoplasia {UMLS C1853242 HP:0011800} {HPO HP:0011800 C1853242,C2673410,C4280320,C4280321} {EOM ID:5b7ad34ab35682b5 IMG:Midface_Retrusion-small.jpg};\nMicrognathia {SNOMEDCT:32958008} {UMLS C0025990 HP:0000347} {HPO HP:0000347 C0025990,C0240295,C1857130} {EOM ID:8bbf61b4ad7ca2ef IMG:Micrognathia-small.jpg}''', 'headAndNeckEars': 'Deafness {SNOMEDCT:343087000} {ICD10CM:H91.9} {UMLS C0018772,C0011053 HP:0000365} {HPO HP:0000365 C0011053,C0018772,C0339789,C1384666}', 'headAndNeckEyes': 'Hypertelorism {SNOMEDCT:22006008} {ICD10CM:Q75.2} {ICD9CM:376.41} {UMLS C0020534 HP:0000316} {HPO HP:0000316 C0020534} {EOM ID:71d9f1be67c7f8b6 IMG:Eyes,Widely_Spaced-small.jpg}', 'headAndNeckNose': 'Low nasal bridge {UMLS C1836542 HP:0005280} {HPO HP:0005280 C1836542,C3550546,C4280495} {EOM ID:000fb29123c16757 IMG:Nasal_Bridge,Depressed-small.jpg}', 'headAndNeckMouth': '''Cleft palate {SNOMEDCT:87979003,63567004} {ICD10CM:Q35.5,Q35,Q35.9} {ICD9CM:749.0,749.00} {UMLS C2981150,C0008925,C2240378 HP:0000175} {HPO HP:0000175 C0008925,C2981150};\nNarrow, high-arched palate {UMLS C1837404 HP:0002705} {HPO HP:0002705 C1837404}''', 'headAndNeckTeeth': '''Delayed eruption of deciduous teeth {UMLS C1849538 HP:0000680} {HPO HP:0000680 C1849538};\nDelayed eruption of permanent teeth {UMLS C1849540 HP:0000696} {HPO HP:0000696 C1849540};\nSupernumerary teeth {SNOMEDCT:367534004,8666004,266414008} {ICD10CM:K00.1} {ICD9CM:520.1} {UMLS C0040457 HP:0011067,HP:0011069} {HPO HP:0011069 C0040457} {EOM ID:60888cccac8e54b6 IMG:Tooth,Supernumerary-small.jpg};\nRetention cysts {SNOMEDCT:367645008} {UMLS C0035281};\nEnamel hypoplasia {SNOMEDCT:26597004,699421005,699382004} {UMLS C0011351 HP:0006297} {HPO HP:0006297 C0011351,C1851854,C4280456,C4280457}''', 'respiratoryAirways': 'Respiratory distress in early infancy {UMLS C1861533}', 'chestExternalFeatures': '''Narrow thorax {SNOMEDCT:249671009} {UMLS C0426790 HP:0000774} {HPO HP:0000774 C0426790};\nAbnormal facility in opposing the shoulders {UMLS C1861517 HP:0005259} {HPO HP:0005259 C1861517}''', 'chestRibsSternumClaviclesAndScapulae': '''Small scapula {SNOMEDCT:298759002} {UMLS C1846434,C0575530 HP:0000882} {HPO HP:0000882 C1846434};\nHypoplastic clavicles {SNOMEDCT:93250003} {UMLS C0426799 HP:0000894} {HPO HP:0000894 C0426799};\nAplastic clavicles {UMLS C1857665 HP:0006660} {HPO HP:0006660 C1857665};\nShort ribs {SNOMEDCT:249696007} {UMLS C0426817 HP:0000773} {HPO HP:0000773 C0426817};\nCervical ribs {SNOMEDCT:72535009} {ICD10CM:Q76.5} {ICD9CM:756.2} {UMLS C0158779 HP:0000891} {HPO HP:0000891 C0158779}''', 'skeletal': '''Osteosclerosis {SNOMEDCT:49347007} {ICD10CM:Q78.2} {UMLS C0029464 HP:0011001} {HPO HP:0011001 C0029464};\nIncreased bone fragility {UMLS C1390474 HP:0002659} {HPO HP:0002659 C1390474}''', 'skeletalSkull': '''Wormian bones {SNOMEDCT:113194005} {UMLS C0222716 HP:0002645} {HPO HP:0002645 C0222716};\nBossing of frontal bone {UMLS C1861524};\nBossing of occipital bone {UMLS C1861525};\nBossing of parietal bone {UMLS C1857126 HP:0000242} {HPO HP:0000242 C1857126};\nCalvarial thickening {UMLS C1858452 HP:0002684} {HPO HP:0002684 C1858452,C4280560};\nAbsent frontal sinuses {UMLS C1855669 HP:0002688} {HPO HP:0002688 C1855669,C4280559};\nAbsent paranasal sinuses {UMLS C1857131 HP:0002689} {HPO HP:0002689 C1857131,C3804986,C4072844};\nHypoplastic frontal sinuses {UMLS C1859682 HP:0002738} {HPO HP:0002738 C1859682,C4280548,C4280549};\nHypoplastic paranasal sinuses {UMLS C1861527};\nLarge foramen magnum {UMLS C1844508 HP:0002700} {HPO HP:0002700 C1844508,C4073291,C4280554,C4280555}''', 'skeletalSpine': '''Spondylolysis {SNOMEDCT:240221008} {ICD10CM:M43.0,M43.00} {UMLS C0038018 HP:0003304} {HPO HP:0003304 C0038018};\nSpondylolisthesis {SNOMEDCT:274152003,13236000,203681002} {ICD10CM:M43.1,M43.10,Q76.2} {ICD9CM:738.4,756.12} {UMLS C0038017,C0038016,C2242765 HP:0003302} {HPO HP:0003302 C0038016};\nScoliosis {SNOMEDCT:298382003,20944008,111266001} {ICD10CM:Q67.5,M41,M41.9} {UMLS C0559260,C0036439,C4552773,C0700208 HP:0002650} {HPO HP:0002650 C0037932,C0700208};\nKyphosis {SNOMEDCT:71311003,413428007,414564002} {ICD10CM:M40.20,Q76.41} {ICD9CM:737.1} {UMLS C0022822,C0022821,C2115817,C0265673,C4552747 HP:0002808} {HPO HP:0002808 C0022821,C1845112}''', 'skeletalPelvis': '''Wide pubic symphysis {UMLS C1857190 HP:0003183} {HPO HP:0003183 C1857190};\nDelayed mineralization of pubic bone {UMLS C1861528 HP:0008788} {HPO HP:0008788 C1861528,C1866710,C4280411};\nBroad femoral head with short femoral neck {UMLS C1861529};\nCoxa vara {SNOMEDCT:74820003,12067001} {ICD10CM:Q65.82} {ICD9CM:736.32,755.62} {UMLS C0152431,C0158481,C0239138 HP:0002812} {HPO HP:0002812 C0239138};\nHypoplastic iliac wing {UMLS C1865027 HP:0002866} {HPO HP:0002866 C1865027}''', 'skeletalHands': '''Brachydactyly {SNOMEDCT:43476002} {UMLS C0221357 HP:0001156} {HPO HP:0001156 C0221357};\nLong second metacarpal {UMLS C1861531 HP:0006040} {HPO HP:0006040 C1861531};\nShort middle phalanges of second and fifth fingers {UMLS C1861532};\nCone-shaped phalangeal epiphyses {UMLS C1859480 HP:0010230} {HPO HP:0010230 C1859480}''', 'neurologicPeripheralNervousSystem': 'Syringomyelia {SNOMEDCT:111496009,192894009} {ICD10CM:G95.0} {ICD9CM:336.0} {UMLS C0039144,C0039145 HP:0003396} {HPO HP:0003396 C0039144}', 'miscellaneous': 'One third of patients represent new mutations {UMLS C1861535}', 'molecularBasis': 'Caused by mutation in the runt-related transcription factor 2 gene (RUNX2, {600211.0001})', 'inheritanceExists': True, 'growthExists': True, 'growthHeightExists': True, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': True, 'headAndNeckFaceExists': True, 'headAndNeckEarsExists': True, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': True, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': True, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': True, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': True, 'respiratoryLungExists': False, 'chestExists': True, 'chestExternalFeaturesExists': True, 'chestRibsSternumClaviclesAndScapulaeExists': True, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': True, 'skeletalSpineExists': True, 'skeletalPelvisExists': True, 'skeletalLimbsExists': False, 'skeletalHandsExists': True, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': True, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119650, 'preferredTitle': 'CLEIDORHIZOMELIC SYNDROME', 'oldFormat': { 'Growth': 'Rhizomelic short stature {UMLS C1866730 HP:0008905} {HPO HP:0008905 C1866730};', 'Thorax': 'Lateral clavicular defects;', 'Joints': 'Abnormal acromioclavicular joints;', 'Limbs': 'Fifth finger clinodactyly {UMLS C1850049 HP:0004209} {HPO HP:0004209 C1850049,C4280538}; Hypoplastic fifth finger middle phalanx {UMLS C1834060 HP:0004220} {HPO HP:0004220 C1834060};', 'Radiology': 'Bifid lateral third of clavicles;', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': True, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': False, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': True, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': True, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119800, 'prefix': '#', 'preferredTitle': 'CLUBFOOT, CONGENITAL, WITH OR WITHOUT DEFICIENCY OF LONG BONES AND/OR MIRROR-IMAGE POLYDACTYLY; CCF', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'skeletalLimbs': '''Tibial hemimelia (in some patients) {UMLS C3549589};\nPatellar hypoplasia, bilateral (in some patients) {UMLS C3549590} {HPO HP:0003065 C1840068};\nNo anomalies of upper limbs {UMLS C3549591}''', 'skeletalFeet': '''Talipes equinovarus (clubfoot) {SNOMEDCT:397932003} {ICD10CM:Q66.89,Q66.0} {ICD9CM:754.51} {UMLS C0009081 HP:0001762} {HPO HP:0001762 C0009081};\nOblique talus (in some patients) {UMLS C3549592};\nPreaxial mirror-image polydactyly (in some patients) {UMLS C3549593}''', 'miscellaneous': '''Clubfoot is bilateral in most patients {UMLS C3549595};\nIncomplete penetrance {UMLS C1836598 HP:0003829} {HPO HP:0003829 C1836598}''', 'molecularBasis': 'Caused by mutation in the paired-like homeodomain transcription factor-1 gene (PITX1, {602149.0001})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': False, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': True, 'skeletalHandsExists': False, 'skeletalFeetExists': True, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119900, 'prefix': '#', 'preferredTitle': 'DIGITAL CLUBBING, ISOLATED CONGENITAL', 'inheritance': 'Autosomal recessive {SNOMEDCT:258211005} {UMLS C0441748 HP:0000007} {HPO HP:0000007 C0441748,C4020899}', 'skeletalHands': '''Digital clubbing {SNOMEDCT:30760008,367004} {ICD10CM:R68.3} {ICD9CM:781.5} {UMLS C0149651,C0009080 HP:0001217,HP:0100759} {HPO HP:0001217 C0149651};\nAcropachy {SNOMEDCT:239055005,203357004} {ICD10CM:M89.4} {ICD9CM:731.2} {UMLS C0029412,C0345408}''', 'skeletalFeet': 'Digital clubbing (in some patients) {UMLS C4478174} {HPO HP:0001217 C0149651}', 'skinNailsHairNails': 'Incurved nails {UMLS C4478175}', 'molecularBasis': 'Caused by mutation in the hydroxyprostaglandin dehydrogenase 15-(NAD) gene (HPGD, {119900.0004})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': False, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': True, 'skeletalFeetExists': True, 'skinNailsHairExists': True, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': True, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 119915, 'prefix': '%', 'preferredTitle': 'CLUSTER HEADACHE, FAMILIAL', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckFace': '''Facial sweating ipsilateral {UMLS C2675803};\nForehead sweating, ipsilateral {UMLS C2675804}''', 'headAndNeckEyes': '''Eyelid edema, ipsilateral {UMLS C2675805};\nConjunctival injection, ipsilateral {UMLS C2675806};\nLacrimation, ipsilateral {UMLS C2675807};\nMiosis, ipsilateral {UMLS C2675808};\nPtosis, ipsilateral {UMLS C2675809}''', 'respiratoryNasopharynx': '''Nasal congestion, ipsilateral {UMLS C2675810};\nRhinorrhea, ipsilateral {UMLS C2675811}''', 'neurologicCentralNervousSystem': '''Headaches, severe, unilateral {UMLS C2675799} {HPO HP:0002315 C0018681};\nPain (sharp, boring, drilling, piercing) {UMLS C2675800} {HPO HP:0012531 C0030193};\nEpisodic subtype, headaches occur in clusters {UMLS C2675801};\nChronic subtype, headaches occur without remission for 1 year {UMLS C2675802}''', 'neurologicBehavioralPsychiatricManifestations': '''Agitation {SNOMEDCT:24199005} {UMLS C0085631,C1963060,C4552855 HP:0000713} {HPO HP:0000713 C0085631};\nRestlessness {SNOMEDCT:47295007,162221009,24199005} {UMLS C3887612,C4551939,C3887611,C0085631 HP:0000711,HP:0000713} {HPO HP:0000711 C3887611};\nExhaustion {SNOMEDCT:60119000} {UMLS C0392674}''', 'miscellaneous': '''Onset 10-20 years of age {UMLS C2675812};\nAutosomal recessive inheritance has been suggested {UMLS C2675813};\nTwo subtypes, episodic (85% of patients) and chronic (15%) {UMLS C2675814};\nAutonomic symptoms occur with headaches {UMLS C2675815}''', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': True, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': True, 'respiratoryNasopharynxExists': True, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': True, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': True, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': True, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120000, 'preferredTitle': 'COARCTATION OF AORTA', 'oldFormat': { 'Cardiac': 'Coarctation of aorta {SNOMEDCT:7305005} {ICD10CM:Q25.1} {ICD9CM:747.1,747.10} {UMLS C0003492 HP:0001680} {HPO HP:0001680 C0003492}; Congenital heart defect {SNOMEDCT:13213009} {ICD10CM:Q24.9} {ICD9CM:746.9} {UMLS C0018798 HP:0001627,HP:0030680} {HPO HP:0001627 C0018798,C0152021}; Hypoplastic left heart {SNOMEDCT:62067003} {ICD10CM:Q23.4} {ICD9CM:746.7} {UMLS C0152101 HP:0004383} {HPO HP:0004383 C0152101}; Narrow aortic isthmus;', 'Inheritance': 'Most likely multifactorial; ? autosomal dominant;' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': False, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': False, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': True, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120040, 'preferredTitle': 'COCHLEOSACCULAR DEGENERATION WITH PROGRESSIVE CATARACTS', 'oldFormat': { 'Ears': 'Congenital deafness {SNOMEDCT:95828007} {ICD10CM:H90.5} {UMLS C0339789 HP:0000365} {HPO HP:0000365 C0011053,C0018772,C0339789,C1384666}; Cochleosaccular dysplasia of inner ear;', 'Eyes': 'Progressive cataracts;', 'Neuro': 'Staggering gait {SNOMEDCT:78691002} {ICD10CM:R26.0} {UMLS C0701824,C0231690 HP:0030187};', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120100, 'prefix': '#', 'preferredTitle': 'FAMILIAL COLD AUTOINFLAMMATORY SYNDROME 1; FCAS1', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckEyes': 'Conjunctivitis {SNOMEDCT:9826008} {ICD10CM:H10,H10.9} {ICD9CM:372.30} {UMLS C4553305,C0009763 HP:0000509} {HPO HP:0000509 C0009763,C1864156}', 'genitourinaryKidneys': 'Renal amyloidosis, late-onset (uncommon) {UMLS C2675792}', 'skeletal': 'Arthralgia, episodic {UMLS C2674038} {HPO HP:0002829 C0003862}', 'skinNailsHairSkin': '''Maculopapular rash, episodic {UMLS C2674040};\nRash may or may not be pruritic {UMLS C2674041}''', 'muscleSoftTissue': '''Myalgia, episodic {UMLS C2674035} {HPO HP:0003326 C0231528};\nSwelling of the extremities, episodic {UMLS C2675793}''', 'neurologicCentralNervousSystem': 'Headache, episodic {UMLS C2675791} {HPO HP:0002315 C0018681}', 'metabolicFeatures': 'Fever, episodic {SNOMEDCT:77957000} {UMLS C0277799 HP:0001954} {HPO HP:0001945 C0015967}', 'laboratoryAbnormalities': '''Polymorphonuclear leukocytosis, episodic {UMLS C2674036};\nIncreased serum C-reactive protein, episodic {UMLS C2675794}''', 'miscellaneous': '''Onset in infancy or early childhood {UMLS C1837138};\nEpisodes occur 30 minutes to 3 hours after exposure to cold {UMLS C2675796};\nEpisodes usually last 1 to 2 days {UMLS C2675797};\nSee also Muckle-Wells syndrome ({191900}), an allelic disorder with overlapping features''', 'molecularBasis': 'Caused by mutation in the NLR family, pyrin-domain containing 3 gene (NLRP3, {606416.0001})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': True, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': True, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': True, 'skinNailsHairSkinExists': True, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': True, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': True, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': True, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': True, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120200, 'prefix': '#', 'preferredTitle': 'COLOBOMA, OCULAR, AUTOSOMAL DOMINANT', 'oldFormat': { 'Eyes': 'Coloboma of iris, choroid and retina {SNOMEDCT:93390002} {ICD10CM:Q13.0} {UMLS C0009363 HP:0000589};', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120300, 'prefix': '%', 'preferredTitle': 'COLOBOMA OF MACULA', 'oldFormat': { 'Eyes': 'Agenesis of macula {SNOMEDCT:737579002} {UMLS C1852767 HP:0001116}; Coloboma of macula {SNOMEDCT:737579002} {UMLS C1852767 HP:0001116};', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120330, 'prefix': '#', 'preferredTitle': 'PAPILLORENAL SYNDROME; PAPRS', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckEars': 'Sensorineural hearing loss (rare) {UMLS C3805430} {HPO HP:0000407 C0018784}', 'headAndNeckEyes': '''Retinal coloboma {SNOMEDCT:204173008,39302008} {ICD10CM:Q14.8} {ICD9CM:743.52} {UMLS C0240896,C3540764 HP:0000567,HP:0000480} {HPO HP:0000480 C0240896};\nOptic nerve coloboma {SNOMEDCT:44295002} {ICD10CM:Q14.2,H47.31,H47.319} {ICD9CM:377.23} {UMLS C0155299 HP:0000588} {HPO HP:0000588 C0155299};\nOptic disc dysplasia {SNOMEDCT:722604002} {UMLS C1846467};\nExcavation of optic disc (pits) {UMLS C3549614};\nOptic disc hyperplasia {UMLS C3549615};\nMorning glory optic disc {UMLS C3554721 HP:0025514} {HPO HP:0025514};\nHypoplastic optic disc {SNOMEDCT:373650004} {UMLS C1298695 HP:0007766};\nOrbital cysts {SNOMEDCT:31021007} {ICD10CM:H05.81} {ICD9CM:376.81} {UMLS C0155285 HP:0001144} {HPO HP:0001144 C0155285};\nMicrophthalmia {SNOMEDCT:61142002,204108000} {ICD10CM:Q11.2} {ICD9CM:743.1,743.11,743.10} {UMLS C0026010 HP:0000568} {HPO HP:0000568 C0026010,C4280625,C4280808};\nGliosis of optic nerve {UMLS C3549617};\nAbsent optic nerve head {UMLS C3549618};\nAbnormal retinal pigment epithelium {UMLS C3549619};\nAbnormal retinal vessels {UMLS C3549620};\nChorioretinal degeneration {SNOMEDCT:247177004} {UMLS C0521683 HP:0200065} {HPO HP:0200065 C0521683};\nRetinal detachment (rare) {UMLS C3549621} {HPO HP:0000541 C0035305};\nRetinal staphyloma (rare) {UMLS C3549622};\nRetinal edema (rare) {UMLS C3549623};\nMacular degeneration (rare) {UMLS C3549624} {HPO HP:0000608 C0024437};\nPapillomacular detachment (rare) {UMLS C3549625};\nHyperpigmentation of the macula (rare) {UMLS C3549626};\nCystic degeneration of the macula (rare) {UMLS C3549627};\nPosterior lens luxation (rare) {UMLS C3549628};\nLens opacity (rare) {UMLS C3549629} {HPO HP:0000518 C0086543,C1510497}''', 'genitourinaryKidneys': '''Congenital anomalies of the kidney and urinary tract (CAKUT) {UMLS C1968949};\nRenal hypoplasia {SNOMEDCT:32659003} {ICD10CM:Q60.5} {UMLS C0266295 HP:0000089} {HPO HP:0000089 C0266295};\nEnd stage renal failure {SNOMEDCT:90688005,433146000,46177005} {ICD10CM:N18.9,N18.6,N18.5} {ICD9CM:585.6} {UMLS C0022661,C2316810 HP:0003774} {HPO HP:0003774 C2316810};\nRenal cysts {SNOMEDCT:722223000} {UMLS C3887499 HP:0000107} {HPO HP:0000107 C0022679,C3887499};\nMulticystic dysplastic kidneys {SNOMEDCT:82525005,737562008} {ICD10CM:Q61.4} {UMLS C3714581 HP:0000003};\nMedullary sponge kidney (rare) {UMLS C3549606};\nHorseshoe kidney (rare) {UMLS C3549607} {HPO HP:0000085 C0221353};\nNephrolithiasis (rare) {UMLS C3549608} {HPO HP:0000787 C0392525};\nRenal malrotation (rare) {UMLS C3549609} {HPO HP:0004712 C0238210};\nAnomalous renal pelvis (rare) {UMLS C3549610}''', 'genitourinaryUreters': '''Vesicoureteral reflux {SNOMEDCT:197811007} {ICD10CM:N13.7,N13.70} {ICD9CM:593.7} {UMLS C0042580 HP:0000076} {HPO HP:0000076 C0042580};\nPyeloureteral duplication (rare) {UMLS C3549611}''', 'skeletal': 'Joint laxity {SNOMEDCT:298203008} {UMLS C0086437 HP:0001388} {HPO HP:0001388 C0086437,C0158359}', 'skinNailsHairSkin': '''Hyperextensible skin {UMLS C0241074 HP:0000974} {HPO HP:0000974 C0241074};\nSoft skin {UMLS C1844592 HP:0000977} {HPO HP:0000977 C0241178,C1844592}''', 'neurologicCentralNervousSystem': '''Normal intelligence {SNOMEDCT:26941006} {UMLS C0423900};\nMental retardation (one patient) {UMLS C1852760} {HPO HP:0001249 C0025362,C0423903,C0917816,C1843367,C3714756,C4020876};\nSeizure disorder {SNOMEDCT:84757009,128613002} {ICD10CM:G40.9,G40.909} {ICD9CM:345.9} {UMLS C0014544 HP:0001250};\nArnold Chiari type I malformation {SNOMEDCT:253185002} {UMLS C0750929 HP:0007099} {HPO HP:0007099 C0750929}''', 'laboratoryAbnormalities': 'Proteinuria {SNOMEDCT:29738008,231860006} {ICD10CM:R80,R80.9} {ICD9CM:791.0} {UMLS C4554346,C1279888,C0033687,C1962972 HP:0000093} {HPO HP:0000093 C0033687}', 'miscellaneous': '''Onset in infancy {UMLS C1848924 HP:0003593} {HPO HP:0003593 C1848924};\nVariable phenotype {UMLS C1837514 HP:0003812} {HPO HP:0003812 C1837514,C1839039,C1850667,C1866210};\nOcular abnormalities may be very mild {UMLS C3805429};\nEnd-stage renal disease (CKD Stage 5) requiring kidney transplantation is commonly reported {UMLS C3549613}''', 'molecularBasis': 'Caused by mutation in the paired box homeotic gene 2 (PAX2, {167409.0001})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': True, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': True, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': True, 'genitourinaryUretersExists': True, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': True, 'skinNailsHairSkinExists': True, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': True, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': True, 'miscellaneousExists': True, 'molecularBasisExists': True, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120400, 'preferredTitle': 'COLOBOMA OF MACULA WITH TYPE B BRACHYDACTYLY', 'oldFormat': { 'Eyes': 'Coloboma of macula {SNOMEDCT:737579002} {UMLS C1852767 HP:0001116};', 'Limbs': 'Type B brachydactyly {UMLS C1862112 HP:0005831} {HPO HP:0005831 C1862112}; Absent distal phalanx; Broad or bifid thumb distal phalanx;', 'GU': 'Renal agenesis {SNOMEDCT:41962002,204942005,204938007} {ICD10CM:Q60,Q60.1,Q60.2} {ICD9CM:753.0} {UMLS C1609433,C0158699,C0542519 HP:0000104,HP:0010958} {HPO HP:0000104 C0542519};', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147};' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': True, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': True, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': True, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120430, 'prefix': '#', 'preferredTitle': 'COLOBOMA OF OPTIC NERVE', 'oldFormat': { 'Eyes': 'Bilateral coloboma of optic nerve; Retinal detachment {SNOMEDCT:42059000} {ICD10CM:H33.2} {ICD9CM:361.9} {UMLS C1963229,C4552652,C0035305 HP:0000541} {HPO HP:0000541 C0035305};', 'Inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}; ? same as 120200;' } , 'oldFormatExists': True, 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': False, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': False, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': False, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': False, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': False, 'neurologicCentralNervousSystemExists': False, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': False, 'matches': '' } }, {'clinicalSynopsis': { 'mimNumber': 120433, 'prefix': '#', 'preferredTitle': 'COLOBOMA, OCULAR, WITH OR WITHOUT HEARING IMPAIRMENT, CLEFT LIP/PALATE, AND/OR MENTAL RETARDATION; COB1', 'inheritance': 'Autosomal dominant {SNOMEDCT:263681008} {UMLS C0443147 HP:0000006} {HPO HP:0000006 C0443147}', 'headAndNeckEars': 'Hearing loss, sensorineural, mid-frequency (in some patients) {UMLS C3805435}', 'headAndNeckEyes': '''Uveal coloboma {UMLS C3810479};\nMicrophthalmia (in some patients) {UMLS C3279369} {HPO HP:0000568 C0026010,C4280625,C4280808};\nImpairment of extraocular movement (in some patients) {UMLS C3805436};\nCataract (in some patients) {UMLS C3275329} {HPO HP:0000518 C0086543,C1510497};\nPtosis (rare) {UMLS C1848468} {HPO HP:0000508 C0005745} {EOM ID:1bd157b764ec7aea IMG:Ptosis-small.jpg}''', 'headAndNeckMouth': '''Cleft lip (in some patients) {UMLS C3549747} {HPO HP:0410030};\nCleft palate (in some patients) {UMLS C3275332} {HPO HP:0000175 C0008925,C2981150}''', 'genitourinaryKidneys': 'Hematuria (in some patients) {UMLS C3805433} {HPO HP:0000790 C0018965}', 'neurologicCentralNervousSystem': 'Mental retardation (in some patients) {UMLS C1968646} {HPO HP:0001249 C0025362,C0423903,C0917816,C1843367,C3714756,C4020876}', 'molecularBasis': 'Caused by mutation in the 65-kd YES-associated protein-1 gene (YAP1, {606608.0001})', 'inheritanceExists': True, 'growthExists': False, 'growthHeightExists': False, 'growthWeightExists': False, 'growthOtherExists': False, 'headAndNeckExists': True, 'headAndNeckHeadExists': False, 'headAndNeckFaceExists': False, 'headAndNeckEarsExists': True, 'headAndNeckEyesExists': True, 'headAndNeckNoseExists': False, 'headAndNeckMouthExists': True, 'headAndNeckTeethExists': False, 'headAndNeckNeckExists': False, 'cardiovascularExists': False, 'cardiovascularHeartExists': False, 'cardiovascularVascularExists': False, 'respiratoryExists': False, 'respiratoryNasopharynxExists': False, 'respiratoryLarynxExists': False, 'respiratoryAirwaysExists': False, 'respiratoryLungExists': False, 'chestExists': False, 'chestExternalFeaturesExists': False, 'chestRibsSternumClaviclesAndScapulaeExists': False, 'chestBreastsExists': False, 'chestDiaphragmExists': False, 'abdomenExists': False, 'abdomenExternalFeaturesExists': False, 'abdomenLiverExists': False, 'abdomenPancreasExists': False, 'abdomenBiliaryTractExists': False, 'abdomenSpleenExists': False, 'abdomenGastrointestinalExists': False, 'genitourinaryExists': True, 'genitourinaryExternalGenitaliaMaleExists': False, 'genitourinaryExternalGenitaliaFemaleExists': False, 'genitourinaryInternalGenitaliaMaleExists': False, 'genitourinaryInternalGenitaliaFemaleExists': False, 'genitourinaryKidneysExists': True, 'genitourinaryUretersExists': False, 'genitourinaryBladderExists': False, 'skeletalExists': False, 'skeletalSkullExists': False, 'skeletalSpineExists': False, 'skeletalPelvisExists': False, 'skeletalLimbsExists': False, 'skeletalHandsExists': False, 'skeletalFeetExists': False, 'skinNailsHairExists': False, 'skinNailsHairSkinExists': False, 'skinNailsHairSkinHistologyExists': False, 'skinNailsHairSkinElectronMicroscopyExists': False, 'skinNailsHairNailsExists': False, 'skinNailsHairHairExists': False, 'muscleSoftTissueExists': False, 'neurologicExists': True, 'neurologicCentralNervousSystemExists': True, 'neurologicPeripheralNervousSystemExists': False, 'neurologicBehavioralPsychiatricManifestationsExists': False, 'voiceExists': False, 'metabolicFeaturesExists': False, 'endocrineFeaturesExists': False, 'hematologyExists': False, 'immunologyExists': False, 'neoplasiaExists': False, 'prenatalManifestationsExists': False, 'prenatalManifestationsMovementExists': False, 'prenatalManifestationsAmnioticFluidExists': False, 'prenatalManifestationsPlacentaAndUmbilicalCordExists': False, 'prenatalManifestationsMaternalExists': False, 'prenatalManifestationsDeliveryExists': False, 'laboratoryAbnormalitiesExists': False, 'miscellaneousExists': False, 'molecularBasisExists': True, 'matches': '' } } ] } } }
a88be202976fb580308f95fcb529d4d3e32b61d1
1b764845ceab76ab91d12a4a067cb49fa3296001
/interface testing/tests/test_laGou.py
c3ed52590ca07ee3d1a11b689e4723a7cfee59d2
[ "Apache-2.0" ]
permissive
mychristopher/test
c5e11aef178d025d25d54afde4fb836a18001a23
9977d36bab3fcc47f0e1dd42bbf5a99b39112a2f
refs/heads/master
2023-07-31T14:58:22.303817
2020-09-05T04:26:07
2020-09-05T04:26:07
276,136,931
0
0
Apache-2.0
2023-07-14T16:39:16
2020-06-30T15:21:29
HTML
UTF-8
Python
false
false
1,394
py
#!/use/bin/env python #coding:utf-8 #Author:WuYa import unittest import json from base.method import Method,IsContent from page.laGou import * from utils.public import * from utils.operationExcel import OperationExcel from utils.operationJson import OperationJson class LaGou(unittest.TestCase): def setUp(self): self.obj=Method() self.p=IsContent() self.execl=OperationExcel() self.operationJson=OperationJson() def statusCode(self,r): self.assertEqual(r.status_code, 200) self.assertEqual(r.json()['code'], 0) def isContent(self,r,row): self.statusCode(r=r) self.assertTrue(self.p.isContent(row=row,str2=r.text)) def test_laGou_001(self): '''拉钩:测试翻页''' r = self.obj.post(row=1,data=self.operationJson.getRequestsData(1)) self.isContent(r=r,row=1) self.execl.writeResult(1,'pass') def test_laGou_002(self): '''拉钩:测试关键字的职位搜索''' r =self.obj.post(row=1,data=setSo('Python开发工程师')) list1=[] for i in range(0,15): positionId=r.json()['content']['positionResult']['result'][i]['positionId'] list1.append(positionId) writePositionId(json.dumps(list1)) def test_lgGou_003(self): '''访问搜索到的每个职位的详情页信息''' for i in range(15): r=self.obj.get(url=getUrl()[i]) self.assertTrue(self.p.isContent(2,r.text)) if __name__ == '__main__': unittest.main(verbosity=2)
b96ea4e4315057da353749698369e86cf59a095c
601533bee6393d550fdf60e66599d9c69fb31a68
/tools/nvme_utils/configshell-fb-1.1.fb18/setup.py
cb4827ef1b1ab44c478077dbde709c53cba74c99
[ "Apache-2.0" ]
permissive
truenas/chelsiouwire
7043978301e0e28be6c39ac39bbf483af370464f
4739d295d543fc8164c96356d4cb1ed63e091a90
refs/heads/master
2023-08-21T16:54:22.911750
2022-07-13T18:26:48
2022-07-13T18:26:48
383,461,654
1
0
null
2022-07-13T18:29:13
2021-07-06T12:30:41
C
UTF-8
Python
false
false
1,181
py
#! /usr/bin/env python ''' This file is part of ConfigShell. Copyright (c) 2011-2013 by Datera, Inc 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 setuptools import setup setup( name = 'configshell-fb', version = '1.1.18', description = 'A framework to implement simple but nice CLIs.', license = 'Apache 2.0', maintainer = 'Andy Grover', maintainer_email = '[email protected]', url = 'http://github.com/agrover/configshell-fb', packages = ['configshell', 'configshell_fb'], classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "License :: OSI Approved :: Apache Software License", ], )
93c606579fc91423361e30cfdc8a82a968dbac37
326a026bcc6bad962159677110d78d3d836532ed
/wsgi.py
6574317bc1bf00a24d2f009827fb1d6f7d1c3299
[ "MIT" ]
permissive
Frederick-S/markote
f63a5007fd0a70ce4b3ae9d03425ae9f9c8b54f3
095dabe3da83b5d8809593758661eb78fa527f49
refs/heads/master
2023-03-04T16:50:30.541147
2022-08-12T01:24:43
2022-08-12T01:24:43
110,396,888
9
2
MIT
2023-03-04T13:11:38
2017-11-12T02:04:32
Vue
UTF-8
Python
false
false
115
py
from markote.bootstrap import create_app app = create_app('production') if __name__ == '__main__': app.run()
73947b723523e74ea45af363ab25a8f80eeaccd7
bbc1001ec110c7cd0bf873bcff8519f8e713b42e
/dy/asgi.py
c700249231a0301e1efd89aab2d973a8372f4911
[]
no_license
zamanehsani/dy
b141f98ab52bcdc21bfec593fe971b054e2f74f6
675915430e20f5c137f00016d99946f5cd814aa9
refs/heads/master
2023-03-16T18:53:38.416480
2021-03-05T14:13:45
2021-03-05T14:13:45
324,432,296
0
0
null
null
null
null
UTF-8
Python
false
false
381
py
""" ASGI config for dy project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dy.settings') application = get_asgi_application()
2385a5660b0dce3abf0c6aac0db65604a5708974
93e631e4558f5ae5731dd2e35b1ddc6d4ba91506
/yaldevtools/source_generators/interface.py
0edc0d192d38e2a2576b41239712a650d08cc152
[ "Apache-2.0" ]
permissive
xpoy1/libyal
2744bff33ce53e70678966ed0c372e2a5f654cc3
d4a7bded52eb6fa2dc20160ee75905b897827cf1
refs/heads/main
2023-04-26T02:00:50.310037
2021-05-22T09:51:56
2021-05-22T09:52:15
null
0
0
null
null
null
null
UTF-8
Python
false
false
26,606
py
# -*- coding: utf-8 -*- """The source file generator interface.""" from __future__ import unicode_literals import abc import datetime import io import logging import os import string import time from yaldevtools import source_file from yaldevtools import source_formatter class SourceFileGenerator(object): """Source file generator.""" def __init__( self, projects_directory, data_directory, template_directory, experimental=False): """Initializes a source file generator. Args: projects_directory (str): path of the projects directory. data_directory (str): path of the data directory. template_directory (str): path of the template directory. experimental (bool): True if experimental features should be enabled. """ super(SourceFileGenerator, self).__init__() self._data_directory = data_directory self._definitions_include_header_file = None self._definitions_include_header_path = None self._experimental = experimental self._has_tests = None self._library_include_header_file = None self._library_include_header_path = None self._library_makefile_am_file = None self._library_makefile_am_path = None self._library_path = None self._library_type_header_files = {} self._projects_directory = projects_directory self._python_module_path = None self._template_directory = template_directory self._tests_path = None self._tools_path = None self._types_include_header_file = None self._types_include_header_path = None def _CorrectDescriptionSpelling(self, name, output_filename): """Corrects the spelling of a type or value decription. Args: name (str): type or value name. output_filename (str): path of the output file. """ if not name or name[0] not in ('a', 'e', 'i', 'o', ''): return with io.open(output_filename, 'r', encoding='utf8') as file_object: lines = file_object.readlines() name = name.replace('_', ' ') description = ' a {0:s}'.format(name) corrected_description = ' an {0:s}'.format(name) with io.open(output_filename, 'w', encoding='utf8') as file_object: for line in lines: line = line.replace(description, corrected_description) file_object.write(line) def _GenerateSection( self, template_filename, template_mappings, output_writer, output_filename, access_mode='w'): """Generates a section from template filename. Args: template_filename (str): name of the template file. template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. output_writer (OutputWriter): output writer. output_filename (str): name of the output file. access_mode (Optional[str]): output file access mode. """ template_string = self._ReadTemplateFile(template_filename) try: output_data = template_string.substitute(template_mappings) except (KeyError, ValueError) as exception: logging.error( 'Unable to format template: {0:s} with error: {1!s}'.format( template_filename, exception)) return output_writer.WriteFile( output_filename, output_data, access_mode=access_mode) def _GenerateSections( self, template_filenames, template_mappings, output_writer, output_filename, access_mode='w'): """Generates a section from template filenames. Args: template_filenames (list[str])): names of the template files. template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. output_writer (OutputWriter): output writer. output_filename (str): name of the output file. access_mode (Optional[str]): output file access mode. """ for template_filename in template_filenames: self._GenerateSection( template_filename, template_mappings, output_writer, output_filename, access_mode=access_mode) access_mode = 'a' def _GetDefinitionsIncludeHeaderFile(self, project_configuration): """Retrieves the definitions include header file. Args: project_configuration (ProjectConfiguration): project configuration. Returns: DefinitionsIncludeHeaderFile: definitions include header file or None if the definitions include header file cannot be found. """ if not self._definitions_include_header_file: self._definitions_include_header_path = os.path.join( self._projects_directory, project_configuration.library_name, 'include', project_configuration.library_name, 'definitions.h.in') if os.path.exists(self._definitions_include_header_path): self._definitions_include_header_file = ( source_file.DefinitionsIncludeHeaderFile( self._definitions_include_header_path)) self._definitions_include_header_file.Read(project_configuration) return self._definitions_include_header_file def _GetLibraryIncludeHeaderFile(self, project_configuration): """Retrieves the library include header file. Args: project_configuration (ProjectConfiguration): project configuration. Returns: LibraryIncludeHeaderFile: library include header file or None if the library include header file cannot be found. """ if not self._library_include_header_file: self._library_include_header_path = '{0:s}.h.in'.format( project_configuration.library_name) self._library_include_header_path = os.path.join( self._projects_directory, project_configuration.library_name, 'include', self._library_include_header_path) if os.path.exists(self._library_include_header_path): self._library_include_header_file = ( source_file.LibraryIncludeHeaderFile( self._library_include_header_path)) self._library_include_header_file.Read(project_configuration) return self._library_include_header_file def _GetLibraryMakefileAM(self, project_configuration): """Retrieves the library Makefile.am file. Args: project_configuration (ProjectConfiguration): project configuration. Returns: LibraryMakefileAMFile: library Makefile.am file or None if the library Makefile.am file cannot be found. """ if not self._library_makefile_am_file: self._library_makefile_am_path = os.path.join( self._projects_directory, project_configuration.library_name, project_configuration.library_name, 'Makefile.am') if os.path.exists(self._library_makefile_am_path): self._library_makefile_am_file = source_file.LibraryMakefileAMFile( self._library_makefile_am_path) self._library_makefile_am_file.Read(project_configuration) return self._library_makefile_am_file def _GetMainMakefileAM(self, project_configuration): """Retrieves the main Makefile.am file. Args: project_configuration (ProjectConfiguration): project configuration. Returns: MainMakefileAMFile: main Makefile.am file or None if the main Makefile.am file cannot be found. """ # TODO: cache MainMakefileAMFile object and makefile_am_path makefile_am_path = os.path.join( self._projects_directory, project_configuration.library_name, 'Makefile.am') makefile_am_file = source_file.MainMakefileAMFile(makefile_am_path) makefile_am_file.Read(project_configuration) return makefile_am_file def _GetTemplateMappings(self, project_configuration, authors_separator=', '): """Retrieves the template mappings. Args: project_configuration (ProjectConfiguration): project configuration. authors_separator (Optional[str]): authors separator. Returns: dict[str, str]: string template mappings, where the key maps to the name of a template variable. Raises: ValueError: if the year of creation value is out of bounds. """ date = datetime.date.today() if project_configuration.project_year_of_creation > date.year: raise ValueError('Year of creation value out of bounds.') if project_configuration.project_year_of_creation == date.year: project_copyright = '{0:d}'.format( project_configuration.project_year_of_creation) else: project_copyright = '{0:d}-{1:d}'.format( project_configuration.project_year_of_creation, date.year) if project_configuration.python_module_year_of_creation == date.year: python_module_copyright = '{0:d}'.format( project_configuration.python_module_year_of_creation) else: python_module_copyright = '{0:d}-{1:d}'.format( project_configuration.python_module_year_of_creation, date.year) authors = authors_separator.join(project_configuration.project_authors) python_module_authors = authors_separator.join( project_configuration.python_module_authors) tools_authors = authors_separator.join(project_configuration.tools_authors) tests_authors = authors_separator.join(project_configuration.tests_authors) library_description_lower_case = '{0:s}{1:s}'.format( project_configuration.library_description[0].lower(), project_configuration.library_description[1:]) library_version = time.strftime('%Y%m%d', time.gmtime()) template_mappings = { 'authors': authors, 'copyright': project_copyright, 'library_name': project_configuration.library_name, 'library_name_upper_case': project_configuration.library_name.upper(), 'library_name_suffix': project_configuration.library_name_suffix, 'library_name_suffix_upper_case': ( project_configuration.library_name_suffix.upper()), 'library_description': project_configuration.library_description, 'library_description_lower_case': library_description_lower_case, 'library_version': library_version, 'python_module_authors': python_module_authors, 'python_module_name': project_configuration.python_module_name, 'python_module_name_upper_case': ( project_configuration.python_module_name.upper()), 'python_module_copyright': python_module_copyright, 'tools_authors': tools_authors, 'tools_name': project_configuration.tools_directory, 'tools_name_upper_case': project_configuration.tools_directory.upper(), 'tools_description': project_configuration.tools_description, 'tests_authors': tests_authors, } return template_mappings def _GetTypeLibraryHeaderFile(self, project_configuration, type_name): """Retrieves a type specific library include header file. Args: project_configuration (ProjectConfiguration): project configuration. type_name (str): name of the type. Returns: LibraryHeaderFile: library header file or None if the library header file cannot be found or read. """ header_file = self._library_type_header_files.get(type_name, None) if not header_file: if not self._library_path: self._library_path = os.path.join( self._projects_directory, project_configuration.library_name, project_configuration.library_name) header_file_path = '{0:s}_{1:s}.h'.format( project_configuration.library_name, type_name) header_file_path = os.path.join(self._library_path, header_file_path) header_file = source_file.LibraryHeaderFile(header_file_path) # TODO: handle types in non-matching header files. try: header_file.Read(project_configuration) except IOError: logging.warning('Unable to read library header file: {0:s}'.format( header_file.path)) return None self._library_type_header_files[type_name] = header_file return header_file def _GetTypesIncludeHeaderFile(self, project_configuration): """Retrieves the types include header file. Args: project_configuration (ProjectConfiguration): project configuration. Returns: TypesIncludeHeaderFile: types include header file or None if the types include header file cannot be found. """ if not self._types_include_header_file: self._types_include_header_path = os.path.join( self._projects_directory, project_configuration.library_name, 'include', project_configuration.library_name, 'types.h.in') if os.path.exists(self._types_include_header_path): self._types_include_header_file = source_file.TypesIncludeHeaderFile( self._types_include_header_path) self._types_include_header_file.Read(project_configuration) return self._types_include_header_file def _HasGlob(self, project_configuration, type_name): """Determines if the type has a glob function. Args: project_configuration (ProjectConfiguration): project configuration. type_name (str): name of type. Returns: bool: True if the type needs a glob function. """ # TODO: determine needs_glog based on function prototypes if (type_name == 'handle' and project_configuration.library_name in ( 'libewf', 'libsmraw')): return True return False def _HasTests(self, project_configuration): """Determines if the project has tests. Args: project_configuration (ProjectConfiguration): project configuration. Returns: bool: True if the tests path exits. """ if not self._tests_path: self._tests_path = os.path.join( self._projects_directory, project_configuration.library_name, 'tests') self._has_tests = os.path.exists(self._tests_path) return self._has_tests def _ReadTemplateFile(self, filename): """Reads a template string from file. Args: filename (str): name of the file containing the template string. Returns: string.Template: template string. """ # Read with binary mode to make sure end of line characters are # not converted. with io.open(filename, 'rb') as file_object: file_data = file_object.read() file_data = file_data.decode('utf8') return string.Template(file_data) def _SetSequenceTypeNameInTemplateMappings( self, template_mappings, type_name): """Sets the sequence type name in template mappings. Args: template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. type_name (str): sequence type name. """ if not type_name: template_mappings['sequence_type_description'] = '' template_mappings['sequence_type_name'] = '' template_mappings['sequence_type_name_camel_case'] = '' template_mappings['sequence_type_name_upper_case'] = '' else: template_mappings['sequence_type_description'] = type_name.replace( '_', ' ') template_mappings['sequence_type_name'] = type_name template_mappings['sequence_type_name_camel_case'] = ''.join([ word.title() for word in type_name.split('_')]) template_mappings['sequence_type_name_upper_case'] = type_name.upper() def _SetSequenceValueNameInTemplateMappings( self, template_mappings, value_name): """Sets the sequence value name in template mappings. Args: template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. value_name (str): sequence value name. """ if not value_name: template_mappings['sequence_value_description'] = '' template_mappings['sequence_value_name'] = '' template_mappings['sequence_value_name_upper_case'] = '' else: template_mappings['sequence_value_description'] = value_name.replace( '_', ' ') template_mappings['sequence_value_name'] = value_name template_mappings['sequence_value_name_upper_case'] = value_name.upper() def _SetTypeFunctionInTemplateMappings( self, template_mappings, type_function): """Sets the type function in template mappings. Args: template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. type_function (str): type function. """ if not type_function: template_mappings['type_function'] = '' template_mappings['type_function_upper_case'] = '' else: template_mappings['type_function'] = type_function template_mappings['type_function_upper_case'] = type_function.upper() def _SetTypeNameInTemplateMappings(self, template_mappings, type_name): """Sets the type name in template mappings. Args: template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. type_name (str): type name. """ if not type_name: template_mappings['type_description'] = '' template_mappings['type_name'] = '' template_mappings['type_name_camel_case'] = '' template_mappings['type_name_upper_case'] = '' else: template_mappings['type_description'] = type_name.replace('_', ' ') template_mappings['type_name'] = type_name template_mappings['type_name_camel_case'] = ''.join([ word.title() for word in type_name.split('_')]) template_mappings['type_name_upper_case'] = type_name.upper() def _SetValueNameInTemplateMappings(self, template_mappings, value_name): """Sets value name in template mappings. Args: template_mappings (dict[str, str]): template mappings, where the key maps to the name of a template variable. value_name (str): value name. """ if not value_name: template_mappings['value_description'] = '' template_mappings['value_name'] = '' template_mappings['value_name_upper_case'] = '' else: template_mappings['value_description'] = value_name.replace('_', ' ') template_mappings['value_name'] = value_name template_mappings['value_name_upper_case'] = value_name.upper() def _SetValueTypeInTemplateMappings(self, template_mappings, value_type): """Sets value type in template mappings. Args: template_mappings (dict[str, str]): template mappings, where the key maps to the type of a template variable. value_type (str): value type. """ if not value_type: template_mappings['value_type'] = '' template_mappings['value_type_description'] = '' template_mappings['value_type_upper_case'] = '' else: template_mappings['value_type'] = value_type template_mappings['value_type_description'] = value_type.replace( '_', ' ') template_mappings['value_type_upper_case'] = value_type.upper() def _SortIncludeHeaders(self, project_configuration, output_filename): """Sorts the include headers within a source file. Args: project_configuration (ProjectConfiguration): project configuration. output_filename (str): path of the output file. """ with io.open(output_filename, 'r', encoding='utf8') as file_object: lines = file_object.readlines() library_include_header_start = '#include "{0:s}_'.format( project_configuration.library_name) python_module_include_header_start = '#include "{0:s}_'.format( project_configuration.python_module_name) test_include_header_start = '#include "{0:s}_test_'.format( project_configuration.library_name_suffix) tools_include_header_start = '#include "{0:s}tools_'.format( project_configuration.library_name_suffix) include_headers = [] in_include_headers = False with io.open(output_filename, 'w', encoding='utf8') as file_object: for line in lines: if (line.startswith(library_include_header_start) or line.startswith(python_module_include_header_start) or line.startswith(test_include_header_start) or line.startswith(tools_include_header_start) or line.startswith('#include "info_') or line.startswith('#include "mount_')): include_headers.append(line) in_include_headers = True elif in_include_headers: file_object.writelines(sorted(include_headers)) file_object.write(line) in_include_headers = False else: file_object.write(line) def _SortVariableDeclarations(self, output_filename): """Sorts the variable declarations within a source file. Args: output_filename (str): path of the output file. """ with io.open(output_filename, 'r', encoding='utf8') as file_object: lines = file_object.readlines() formatter = source_formatter.SourceFormatter() variable_declarations = None in_variable_declarations = False with io.open(output_filename, 'w', encoding='utf8') as file_object: for line in lines: stripped_line = line.rstrip() if stripped_line == '{': file_object.write(line) variable_declarations = [] in_variable_declarations = True elif in_variable_declarations: if ('(' not in stripped_line or stripped_line.startswith('#if defined(')): variable_declarations.append(line) else: # TODO: remove the need for FormatSourceOld. sorted_lines = formatter.FormatSourceOld(variable_declarations) file_object.writelines(sorted_lines) file_object.write(line) in_variable_declarations = False else: file_object.write(line) lines = formatter.FormatSource(lines) def _VerticalAlignAssignmentStatements(self, output_filename): """Vertically aligns assignment statements. Args: output_filename (str): path of the output file. """ with io.open(output_filename, 'r', encoding='utf8') as file_object: lines = file_object.readlines() assigment_statements = [] in_assigment_statements_block = False with io.open(output_filename, 'w', encoding='utf8') as file_object: for line in lines: if ' = ' in line: if not in_assigment_statements_block: in_assigment_statements_block = True assigment_statements.append(line) continue if in_assigment_statements_block: if len(assigment_statements) == 1: file_object.write(assigment_statements[0]) else: alignment_offset = 0 for assigment_statement in assigment_statements: prefix, _, _ = assigment_statement.rpartition('=') prefix = prefix.rstrip() alignment_offset = max(alignment_offset, len(prefix) + 1) for assigment_statement in assigment_statements: prefix, _, suffix = assigment_statement.rpartition('=') prefix = prefix.rstrip() alignment_length = alignment_offset - len(prefix) assigment_statement_line = '{0:s}{1:s}={2:s}'.format( prefix, ' ' * alignment_length, suffix) file_object.write(assigment_statement_line) in_assigment_statements_block = False assigment_statements = [] file_object.write(line) def _VerticalAlignFunctionArguments(self, output_filename): """Vertically aligns function arguments. Note this is a very basic approach that should suffice for the yaltools and pyyal Python module source files. Args: output_filename (str): path of the output file. """ with io.open(output_filename, 'r', encoding='utf8') as file_object: lines = file_object.readlines() alignment_number_of_spaces = 0 alignment_number_of_tabs = 0 in_function_call = False with io.open(output_filename, 'w', encoding='utf8') as file_object: for line in lines: if not line.startswith('\t'): file_object.write(line) continue stripped_line = line.rstrip() if in_function_call: if stripped_line.endswith(')') or stripped_line.endswith(');'): in_function_call = False stripped_line = line.lstrip() line = '{0:s}{1:s}{2:s}'.format( '\t' * alignment_number_of_tabs, ' ' * alignment_number_of_spaces, stripped_line) elif stripped_line.endswith('('): in_function_call = True stripped_line = line.lstrip() alignment_number_of_spaces = stripped_line.rfind(' ') if alignment_number_of_spaces == -1: alignment_number_of_spaces = 1 else: alignment_number_of_spaces += 2 alignment_number_of_tabs = len(line) - len(stripped_line) file_object.write(line) def _VerticalAlignTabs(self, output_filename): """Vertically aligns tabs. Args: output_filename (str): path of the output file. """ with io.open(output_filename, 'r', encoding='utf8') as file_object: lines = file_object.readlines() alignment_offset = 0 for line in lines: if '\t' not in line.lstrip('\t'): continue prefix, _, suffix = line.rpartition('\t') prefix = prefix.rstrip('\t') formatted_prefix = prefix.replace('\t', ' ' * 8) equal_sign_offset = len(formatted_prefix) + 8 equal_sign_offset, _ = divmod(equal_sign_offset, 8) equal_sign_offset *= 8 if alignment_offset == 0: alignment_offset = equal_sign_offset else: alignment_offset = max(alignment_offset, equal_sign_offset) with io.open(output_filename, 'w', encoding='utf8') as file_object: for line in lines: if '\t' in line.lstrip('\t'): prefix, _, suffix = line.rpartition('\t') prefix = prefix.rstrip('\t') formatted_prefix = prefix.replace('\t', ' ' * 8) alignment_size = alignment_offset - len(formatted_prefix) alignment_size, remainder = divmod(alignment_size, 8) if remainder > 0: alignment_size += 1 alignment = '\t' * alignment_size line = '{0:s}{1:s}{2:s}'.format(prefix, alignment, suffix) file_object.write(line) @abc.abstractmethod def Generate(self, project_configuration, output_writer): """Generates the source file. Args: project_configuration (ProjectConfiguration): project configuration. output_writer (OutputWriter): output writer. """
3c2631144ed941c39aba487fac120978f680355c
183e4126b2fdb9c4276a504ff3ace42f4fbcdb16
/I семестр/Програмування (Python)/Лабораторні/Братун 6305/Labs/LABA7/counter/counter_2.py
f72f5c76c3f4a527bff955d3e92c75781b03a0c9
[]
no_license
Computer-engineering-FICT/Computer-engineering-FICT
ab625e2ca421af8bcaff74f0d37ac1f7d363f203
80b64b43d2254e15338060aa4a6d946e8bd43424
refs/heads/master
2023-08-10T08:02:34.873229
2019-06-22T22:06:19
2019-06-22T22:06:19
193,206,403
3
0
null
2023-07-22T09:01:05
2019-06-22T07:41:22
HTML
UTF-8
Python
false
false
554
py
import os os.chdir('C:\lab7\Bratun') def get_line(): with open( r'v5.txt', "r", encoding="cp1251") as f: tmp = f.readlines() f.close() return tmp def change(): core = round(len(fileinline) / 2) for i in range(core): fileinline[i], fileinline[-i - 1] = fileinline[-i - 1], fileinline[i] with open( r'v5.txt', "w", encoding="utf-8") as f: for i in fileinline: f.write(i) f.close() fileinline = get_line() change() os.rename( r'v5.txt', r'v51.txt')
fa9d0ee477d8f85e5679caa53d6217ad43c68753
6cd3de9d6aa0c52602010aa857966d5dc4d57442
/mlprodict/onnxrt/validate/data/__init__.py
68432ec182456d8c49ed21a9d675ee84cce8bc08
[ "MIT" ]
permissive
xadupre/mlprodict
2307ca96eafeeafff08d5322184399bb5dc1c37e
f82c8a26a60104948c67849b1c4af95ca812c153
refs/heads/master
2022-12-10T18:50:36.953032
2020-09-03T08:53:58
2020-09-03T08:53:58
292,824,744
1
0
NOASSERTION
2020-09-04T10:56:45
2020-09-04T10:56:44
null
UTF-8
Python
false
false
555
py
""" @file @brief Datasets to tests models. """ import os from pandas import read_csv def load_audit(): """ Use to test conversion of :epkg:`sklearn:ensemble:GradientBoostingClassifier` into :epkg:`ONNX`. .. runpython:: :showcode: from mlprodict.onnxrt.validate.data import load_audit df = load_audit() print(df.head()) """ name = os.path.dirname(__file__) name = os.path.join(name, 'audit.csv') df = read_csv(name).drop(['ID', 'index'], axis=1, inplace=False).dropna() return df
83f94bd9c3c121ff9ada41cf8536eca2c0433b1e
4e29395020ce78f435e75e0b3f1e09b227f6f4d8
/ataraxia/algorithm/Eval/lib/io_hybrid.py
32928d5b699ae213791d6a62d1a611549f9ab357
[]
no_license
luoyangustc/argus
8b332d94af331a2594f5b1715ef74a4dd98041ad
2ad0df5d7355c3b81484f6625b82530b38b248f3
refs/heads/master
2020-05-25T21:57:37.815370
2019-05-22T09:42:40
2019-05-22T09:42:40
188,005,059
5
3
null
null
null
null
UTF-8
Python
false
false
17,763
py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import logging import mxnet as mx import cv2 import numpy as np from config import cfg class empty_image(Exception): ''' catch empty image error ''' pass def check_dir(path): ''' ''' dirname = os.path.dirname(path) if not os.path.exists(dirname): logging.info("{} does not exist, and it is now created.".format(dirname)) os.mkdir(dirname) def inst_iterators(data_train, data_dev, batch_size=1, data_shape=(3,224,224), resize=(-1,-1), resize_scale=(1,1), resize_area=(1,1), use_svm_label=False, use_dali=False): ''' Instantiate specified training and developing data iterators :params: data_train training rec/lst data_dev developing rec/lst batch_size mini batch size, sum of all device data_shape input shape resize resize shorter edge of (train,dev) data, -1 means no resize resize_scale resize train-data into (width*s, height*s), with s randomly chosen from this range resize_area Change the area (namely width * height) to a random value in [min_random_area, max_random_area]. Ignored if random_resized_crop is False use_svm_label set as True if classifier needs svm label name use_dali set as True if nvidia dali is supposed to be used :return: train, dev tuple of 2 iterators ''' # initialization assert data_train and data_dev, logging.error("Please input training or developing data") mean, std = cfg.TRAIN.MEAN_RGB, cfg.TRAIN.STD_RGB assert len(mean)==3 and len(std)==3, logging.error("Mean or Std should be a list of 3 items") mean_r, mean_g, mean_b, std_r, std_g, std_b = mean[:] + std[:] min_random_scale, max_random_scale = resize_scale min_random_area, max_random_area = resize_area min_aspect_ratio = cfg.TRAIN.MIN_ASPECT_RATIO if cfg.TRAIN.MIN_ASPECT_RATIO else None logging.info('Input normalization : Mean-RGB {}, Std-RGB {}'.format([mean_r, mean_g, mean_b],[std_r, std_g, std_b])) logging.info('Input scale augmentation : Max-random-sclae {}, Min-random-scale {}'.format(max_random_scale, min_random_scale)) logging.info('Input area augmentation : Max-random-area {}, Min-random-area {}'.format(max_random_area, min_random_area)) resize_train, resize_dev = resize label_name = 'softmax_label' if not use_svm_label else 'svm_label' # build iterators if not cfg.TRAIN.USE_DALI and cfg.TRAIN.USE_REC: logging.info("Creating recordio iterators") train = mx.io.ImageRecordIter( dtype = cfg.TRAIN.DATA_TYPE, path_imgrec = data_train, preprocess_threads = cfg.TRAIN.PROCESS_THREAD, data_name = 'data', label_name = label_name, label_width = cfg.TRAIN.LABEL_WIDTH, data_shape = data_shape, batch_size = batch_size, resize = resize_train, max_random_scale = max_random_scale, min_random_scale = min_random_scale, shuffle = cfg.TRAIN.SHUFFLE, rand_crop = cfg.TRAIN.RAND_CROP, rand_mirror = cfg.TRAIN.RAND_MIRROR, max_rotate_angle = cfg.TRAIN.MAX_ROTATE_ANGLE, max_aspect_ratio = cfg.TRAIN.MAX_ASPECT_RATIO, min_aspect_ratio = min_aspect_ratio, random_resized_crop = cfg.TRAIN.RANDOM_RESIZED_CROP, max_random_area = max_random_area, min_random_area = min_random_area, max_img_size = cfg.TRAIN.MAX_IMG_SIZE, min_img_size = cfg.TRAIN.MIN_IMG_SIZE, max_shear_ratio = cfg.TRAIN.MAX_SHEAR_RATIO, brightness = cfg.TRAIN.BRIGHTNESS_JITTER, contrast = cfg.TRAIN.CONTRAST_JITTER, saturation = cfg.TRAIN.SATURATION_JITTER, hue = cfg.TRAIN.HUE_JITTER, pca_noise = cfg.TRAIN.PCA_NOISE, random_h = cfg.TRAIN.RANDOM_H, random_s = cfg.TRAIN.RANDOM_S, random_l = cfg.TRAIN.RANDOM_L, mean_r = mean_r, mean_g = mean_g, mean_b = mean_b, std_r = std_r, std_g = std_g, std_b = std_b, inter_method = cfg.TRAIN.INTERPOLATION_METHOD ) dev = mx.io.ImageRecordIter( dtype = cfg.TRAIN.DATA_TYPE, path_imgrec = data_dev, preprocess_threads = cfg.TRAIN.PROCESS_THREAD, data_name = 'data', label_name = label_name, label_width = cfg.TRAIN.LABEL_WIDTH, batch_size = batch_size, data_shape = data_shape, resize = resize_dev, shuffle = False, rand_crop = False, # center crop rand_mirror = False, mean_r = mean_r, mean_g = mean_g, mean_b = mean_b, std_r = std_r, std_g = std_g, std_b = std_b, inter_method = cfg.TRAIN.INTERPOLATION_METHOD ) elif not cfg.TRAIN.USE_DALI and not cfg.TRAIN.USE_REC: logging.info("Creating image iterators") # set decoding thread number os.environ['MXNET_CPU_WORKER_NTHREADS'] = str(cfg.TRAIN.PROCESS_THREAD) # set rand_crop and rand_resize as default, and append separately aug_list_train = mx.image.CreateAugmenter( data_shape = data_shape, resize = resize_train, rand_mirror = cfg.TRAIN.RAND_MIRROR, mean = np.asarray(mean), std = np.asarray(std), brightness = cfg.TRAIN.BRIGHTNESS_JITTER, contrast = cfg.TRAIN.CONTRAST_JITTER, saturation = cfg.TRAIN.SATURATION_JITTER, hue = cfg.TRAIN.HUE_JITTER, pca_noise = cfg.TRAIN.PCA_NOISE, inter_method = cfg.TRAIN.INTERPOLATION_METHOD ) if cfg.TRAIN.RAND_CROP and min_random_scale != 1: aug_list_train.append(mx.image.RandomSizedCropAug( (data_shape[2],data_shape[1]), min_random_scale**2, (1-cfg.TRAIN.MAX_ASPECT_RATIO, 1+cfg.TRAIN.MAX_ASPECT_RATIO), cfg.TRAIN.INTERPOLATION_METHOD)) elif cfg.TRAIN.RAND_CROP: aug_list_train.append(mx.image.RandomCropAug( (data_shape[2],data_shape[1]), cfg.TRAIN.INTERPOLATION_METHOD)) # set rand_crop and rand_resize as default to use center-crop aug_list_dev = mx.image.CreateAugmenter( data_shape = data_shape, resize = resize_dev, mean = np.asarray(mean), std = np.asarray(std), inter_method = cfg.TRAIN.INTERPOLATION_METHOD ) train = mx.image.ImageIter( dtype = cfg.TRAIN.DATA_TYPE, path_imglist = data_train, data_name = 'data', label_name = label_name, label_width = cfg.TRAIN.LABEL_WIDTH, data_shape = data_shape, batch_size = batch_size, path_root = cfg.TRAIN.TRAIN_IMG_PREFIX, shuffle = cfg.TRAIN.SHUFFLE, last_batch_handle = cfg.TRAIN.LAST_BATCH_HANDLE, aug_list = aug_list_train ) dev = mx.image.ImageIter( dtype = cfg.TRAIN.DATA_TYPE, path_imglist = data_dev, data_name = 'data', label_name = label_name, label_width = cfg.TRAIN.LABEL_WIDTH, data_shape = data_shape, batch_size = batch_size, path_root = cfg.TRAIN.DEV_IMG_PREFIX, shuffle = cfg.TRAIN.SHUFFLE, last_batch_handle = cfg.TRAIN.LAST_BATCH_HANDLE, aug_list = aug_list_dev ) elif cfg.TRAIN.USE_DALI and cfg.TRAIN.USE_REC: from dali_util import HybridTrainPipe, HybridValPipe from nvidia.dali.plugin.mxnet import DALIClassificationIterator num_gpus = len(cfg.TRAIN.GPU_IDX) batch_size /= num_gpus train_pipes = [HybridTrainPipe(batch_size=batch_size, num_threads=cfg.TRAIN.PROCESS_THREAD, device_id = i, num_gpus = num_gpus) for i in range(num_gpus)] dev_pipes = [HybridValPipe(batch_size=batch_size, num_threads=cfg.TRAIN.PROCESS_THREAD, device_id = i, num_gpus = num_gpus) for i in range(num_gpus)] train_pipes[0].build() dev_pipes[0].build() train = DALIClassificationIterator(train_pipes, train_pipes[0].epoch_size("Reader")) dev = DALIClassificationIterator(dev_pipes, dev_pipes[0].epoch_size("Reader")) else: logging.error('Invalid data loader type') pass logging.info("Data iters created successfully") return train, dev def np_img_preprocessing(img, as_float=True, **kwargs): ''' ''' assert isinstance(img, np.ndarray), logging.error("Input images should be type of numpy.ndarray") img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) if as_float: img = img.astype(float) # reshape if 'resize_w_h' in kwargs and not kwargs['keep_aspect_ratio']: img = cv2.resize(img, (kwargs['resize_w_h'][0], kwargs['resize_w_h'][1])) if 'resize_min_max' in kwargs and kwargs['keep_aspect_ratio']: ratio = float(max(img.shape[:2]))/min(img.shape[:2]) min_len, max_len = kwargs['resize_min_max'] if min_len*ratio <= max_len or max_len == 0: # resize by min if img.shape[0] > img.shape[1]: # h > w img = cv2.resize(img, (min_len, int(min_len*ratio))) elif img.shape[0] <= img.shape[1]: # h <= w img = cv2.resize(img, (int(min_len*ratio), min_len)) elif min_len*ratio > max_len: # resize by max if img.shape[0] > img.shape[1]: # h > w img = cv2.resize(img, (int(max_len/ratio), max_len)) elif img.shape[0] <= img.shape[1]: # h <= w img = cv2.resize(img, (max_len, int(max_len/ratio))) # normalization if 'mean_rgb' in kwargs: img -= kwargs['mean_rgb'][:] if 'std_rgb' in kwargs: img /= kwargs['std_rgb'][:] # (h,w,c) => (c,h,w) img = np.swapaxes(img, 0, 2) img = np.swapaxes(img, 1, 2) logging.debug('img value: \n{}'.format(img)) return img def np_img_center_crop(img, crop_width): ''' ''' _, height, width = img.shape # (c,h,w) assert (height >= crop_width and width >= crop_width), logging.error('crop size should be larger than image size') top = int(float(height) / 2 - float(crop_width) / 2) left = int(float(width) / 2 - float(crop_width) / 2) crop = img[:, top:(top + crop_width), left:(left + crop_width)] return crop def np_img_multi_crop(img, crop_width, crop_number=3): _, height, width = img.shape assert crop_number in [3,5], logging.error('crop number should be 3 or 5 for now') assert (height >= crop_width and width >= crop_width), logging.error('image size should be larger than crop size') assert crop_width == min(height, width), logging.error('crop size should be equal to short edge for now') if height > width: cent_crop = np_img_center_crop(img, crop_width) top_crop = img[:, :crop_width, :] bottom_crop = img[:, -crop_width:, :] if crop_number == 3: return [top_crop, cent_crop, bottom_crop] elif crop_number == 5: stride = int((float(height)-float(crop_width))/4) top_crop_2 = img[:, stride:(stride + crop_width), :] bottom_crop_2 = img[:, (-crop_width - stride):-stride, :] return [top_crop, top_crop_2, cent_crop, bottom_crop_2, bottom_crop] elif width > height: cent_crop = np_img_center_crop(img, crop_width) left_crop = img[:, :, :crop_width] right_crop = img[:, :, -crop_width:] if crop_number == 3: return [left_crop, cent_crop, right_crop] elif crop_number == 5: stride = int((float(width)-float(crop_width))/4) left_crop_2 = img[:, :, stride:(stride + crop_width)] right_crop_2 = img[:, :, (-crop_width - stride):-stride] return [left_crop, left_crop_2, cent_crop, right_crop_2, right_crop] else: logging.info('input image gets 1:1 aspect ratio, return {} crops with exactly the same pixels'.format(crop_number)) return[img for x in range(crop_number)] def load_model(model_prefix, load_epoch, gluon_style=False): ''' Load existing model :params: model_prefix prefix of model with path load_epoch which epoch to load gluon_style set True to load model saved by gluon :return: sym, arg, aux symbol, arg_params, aux_params of this model aux_params will be an empty dict in gluon style ''' assert model_prefix and load_epoch is not None, logging.error('Missing valid pretrained model prefix') assert load_epoch is not None, logging.error('Missing epoch of pretrained model to load') if not gluon_style: sym, arg, aux = mx.model.load_checkpoint(model_prefix, load_epoch) else: sym = mx.sym.load(model_prefix+'-symbol.json') save_dict = mx.nd.load('%s-%04d.params'%(model_prefix, load_epoch)) arg, aux = dict(), dict() for k, v in save_dict.items(): arg[k] = v logging.info('Loaded model: {}-{:0>4}.params'.format(model_prefix, load_epoch)) return sym, arg, aux def load_model_gluon(symbol, arg_params, aux_params, ctx, layer_name=None): ''' Use to load net and params with gluon after load_model() ''' def _init_gluon_style_params(raw_params, net_params, ctx): ''' ''' for param in raw_params: if param in net_params: net_params[param]._load_init(raw_params[param], ctx=ctx) return net_params if layer_name: net = symbol.get_internals()[layer_name + '_output'] else: net = symbol net_hybrid = mx.gluon.nn.SymbolBlock(outputs=net, inputs=mx.sym.var('data')) net_params = net_hybrid.collect_params() net_params = _init_gluon_style_params(arg_params,net_params,ctx) net_params = _init_gluon_style_params(aux_params,net_params,ctx) return net_hybrid def save_model(model_prefix, rank=0): ''' ''' assert model_prefix, logging.error('Model-prefix is needed to save model') dst_dir = os.path.dirname(model_prefix) if not os.path.isdir(dst_dir): os.mkdir(dst_dir) return mx.callback.do_checkpoint(model_prefix if rank == 0 else "%s-%d"%(model_prefix, rank)) def save_model_gluon(net, model_prefix, rank=0): ''' ''' net.collect_params().save("{}-{:0>4}.params".format(model_prefix, rank)) net(mx.sym.Variable('data')).save("{}-symbol.json".format(model_prefix)) logging.info('Saved checkpoint to \"{}-{:0>4}.params\"'.format(model_prefix, rank)) return 0 def load_image_list(image_list_file): ''' read image path file with syntax as follows(label is trivial): /path/to/image1.jpg (label) /path/to/image2.jpg (label) ... :params: :return: ''' image_list = list() label_list = list() with open(image_list_file, 'r') as f: for buff in f: if len(buff.strip().split()) == 1: # image path only image_list.append(buff.strip()) elif len(buff.strip().split()) == 2: # with labels image_list.append(buff.strip().split()[0]) label_list.append(buff.strip().split()[1]) else: logging.error("Image list syntax error!") return image_list, label_list def load_category_list(cat_file, name_position=1, split=None): ''' load category file file syntax: 0 category_name 1 category_name :params: :return: ''' tup_list = list() with open(cat_file,'r') as f: for buff in f.readlines(): if ' ' in buff.strip(): split = ' ' elif ',' in buff.strip(): split = ',' tup_list.append(buff.strip().split(split)) category_list = [tup[name_position] for tup in sorted(tup_list, key=lambda x:int(x[1-name_position]))] logging.debug(category_list) return category_list
518d213b2c92fa19522c41e572a3645a8ff0e7a6
3a9f2b3d79cf214704829427ee280f4b49dca70a
/saigon/rat/RuckusAutoTest/tests/fm/FM_ManageUsers.py
ce9d8d8d13ce6dfefd8d1b6b16a7cc23900bf55b
[]
no_license
jichunwei/MyGitHub-1
ae0c1461fe0a337ef459da7c0d24d4cf8d4a4791
f826fc89a030c6c4e08052d2d43af0b1b4b410e3
refs/heads/master
2021-01-21T10:19:22.900905
2016-08-20T03:34:52
2016-08-20T03:34:52
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,994
py
''' Testsuite 1.1.10.2 Administration - Users 1.1.10.2.4 Create many user(over 100 user account) MODELING FOR NORMAL CASES ------------------------- Inputs - totalUsers Internal Variables - name_prefix: likes 'user_' Expected Results - able to create more than a hundred of users Testscript + Config: - Initialize the input config - Delete all current (delete-able) users + Test: - Create users (by the given totalUsers) - Go through the list make sure the created users are there + Clean up: - Delete all the users ''' import os, time, logging, re, random from datetime import * from pprint import pprint, pformat from RuckusAutoTest.common.utils import * from RuckusAutoTest.models import Test from RuckusAutoTest.components.RuckusAP import RuckusAP from RuckusAutoTest.components import Helpers as lib from RuckusAutoTest.tests.fm.lib_FM import * class FM_ManageUsers(Test): required_components=['FM', 'APs'] parameter_description = dict( totalUsers = '', ) def config(self, conf): self.errmsg = None self.aliases = init_aliases(testbed=self.testbed) self._cfgTestParams(**conf) logging.info('Delete all delete-able users') lib.fm.userMgmt.delete_all_users(self.aliases.fm) def test(self): self._create_users() if self.errmsg: return ('FAIL', self.errmsg) self._testCreatedUsers() if self.errmsg: return ('FAIL', self.errmsg) return ('PASS', '') def cleanup(self): logging.info('Delete all delete-able users') lib.fm.userMgmt.delete_all_users(self.aliases.fm) self.aliases.fm.logout() def _cfgTestParams(self, **kwa): self.p = dict( totalUsers = 11, prefix = 'user', roles = ['Network Administrator', 'Group Administrator', 'Group Operator', 'Device Operator'], ) self.p.update(kwa) logging.debug('Test Configs:\n%s' % pformat(self.p)) def _generateUsers(self, **kwa): ''' kwa: - prefix - total - roles return: - something likes 'user_015' ''' role_len = int(kwa['total'] / len(kwa['roles'])) for i in range(1, kwa['total'] + 1): role_idx = int(i/role_len) if role_idx >= len(kwa['roles']): role_idx = len(kwa['roles']) - 1 yield '%s_%03i' % (kwa['prefix'], i), kwa['roles'][role_idx] def _create_users(self): ''' return: . self.accounts: a list of (name, role) ''' self.accounts = [] logging.info('Creating Users: prefix=%s, totalUsers=%s' % \ (self.p['prefix'], self.p['totalUsers'])) for name, role in self._generateUsers(prefix=self.p['prefix'], total=self.p['totalUsers'], roles=self.p['roles']): self.accounts.append((name, role)) lib.fm.userMgmt.add_user(self.aliases.fm, username=name, password=name, role=role) def _testCreatedUsers(self): logging.info('Test the list of created users') allAccs = lib.fm.userMgmt.get_all_users(self.aliases.fm) for a in self.accounts: if not self._find_user(user=a, list=allAccs): self.errmsg = 'User created but not found: (name=%s, role=%s)' % a return def _find_user(self, **kwa): ''' kwa: - user: (name, role) - list: the list of users from FM Users table ''' for i in kwa['list']: if i['username'] == kwa['user'][0]: if i['userrole'] == kwa['user'][1]: return True return False # same user name, but different role return False
f494dcb113132af32c65f8eef89c23905b98c3fe
53fab060fa262e5d5026e0807d93c75fb81e67b9
/backup/user_150/ch14_2020_03_16_15_58_26_897959.py
886c16b139252dc0fd5ccfdbc257e43fc08191ee
[]
no_license
gabriellaec/desoft-analise-exercicios
b77c6999424c5ce7e44086a12589a0ad43d6adca
01940ab0897aa6005764fc220b900e4d6161d36b
refs/heads/main
2023-01-31T17:19:42.050628
2020-12-16T05:21:31
2020-12-16T05:21:31
306,735,108
0
0
null
null
null
null
UTF-8
Python
false
false
207
py
import math def calcula_distancia_do_projetil(v, θ, y0, g): parte1 = (v**2)/2*g parte2 = (1+(1+(2*g*y0)/(v**2*(math.sin(θ))**2))**(1/2)) parte3 = math.sin(2*θ) return parte1*parte2*parte3
bea3144283716bdbdbe71f6b44d09fa8d6a03de0
b59bc650ae07b18757b455e1b5cb7cfde91714a4
/.env/local/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/base.py
01589adb44061010c8af1db52d5e2584728f1cb0
[]
no_license
jhashubham28/BE_Project_SpeakerRecognition
d07c584359a5ebc6b524b3b4617b072c58724d17
ede8fd53e79973e4116030e5a36f9deaa61dcc63
refs/heads/master
2020-05-29T20:42:15.055659
2019-05-30T20:17:30
2019-05-30T20:17:30
189,354,351
0
0
null
null
null
null
UTF-8
Python
false
false
129
py
/home/pi/Downloads/BE_Project-SpeakerRecognition-master/.env/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/base.py
8f84d88db14358d73e9ecb453a7653f76aa97d00
43e11969cddd18fea322ce5de8a40de0eae8c47c
/clients/python/test/test_stats_history.py
05dfe605166afc8f031a9af367d96fb721d96ce4
[]
no_license
bottlecapper/api-connectors
60b03de028a45f2a1dee0d41c7a899afeff07333
b202c2889d59979c80386875f53d031b9ad430e7
refs/heads/master
2021-07-17T07:33:34.650031
2017-10-20T08:55:07
2017-10-20T08:55:07
106,418,690
1
0
null
2017-10-10T13:09:53
2017-10-10T13:09:53
null
UTF-8
Python
false
false
2,296
py
# coding: utf-8 """ BitMEX API ## REST API for the BitMEX Trading Platform [View Changelog](/app/apiChangelog) #### Getting Started ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. Most table queries accept `count`, `start`, and `reverse` params. Set `reverse=true` to get rows newest-first. Additional documentation regarding filters, timestamps, and authentication is available in [the main API documentation](https://www.bitmex.com/app/restAPI). *All* table data is available via the [Websocket](/app/wsAPI). We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits. ##### Return Types By default, all data is returned as JSON. Send `?_format=csv` to get CSV data or `?_format=xml` to get XML data. ##### Trade Data Queries *This is only a small subset of what is available, to get you started.* Fill in the parameters and click the `Try it out!` button to try any of these queries. * [Pricing Data](#!/Quote/Quote_get) * [Trade Data](#!/Trade/Trade_get) * [OrderBook Data](#!/OrderBook/OrderBook_getL2) * [Settlement Data](#!/Settlement/Settlement_get) * [Exchange Statistics](#!/Stats/Stats_history) Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available. ##### Swagger Specification [⇩ Download Swagger JSON](swagger.json) ## All API Endpoints Click to expand a section. OpenAPI spec version: 1.2.0 Contact: [email protected] Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import swagger_client from swagger_client.rest import ApiException from swagger_client.models.stats_history import StatsHistory class TestStatsHistory(unittest.TestCase): """ StatsHistory unit test stubs """ def setUp(self): pass def tearDown(self): pass def testStatsHistory(self): """ Test StatsHistory """ # FIXME: construct object with mandatory attributes with example values #model = swagger_client.models.stats_history.StatsHistory() pass if __name__ == '__main__': unittest.main()
081bf346fd7fa7c71ec3a2819deb97613cfcba02
e37a1aab1dde2339c7e34ac7e7a158767fcd9023
/Solutions/solution_018.py
61dd1f757ab7cd414491e152fa2e956eceff3651
[ "WTFPL" ]
permissive
idayat092/Project-Euler
f90ffa71e12a80b6f54de4f469e898fedc9877fe
8fcd0d4cb126612d238516e88778a4bfd685ccf2
refs/heads/master
2022-03-07T18:21:38.103277
2019-11-09T05:30:01
2019-11-09T05:30:01
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,436
py
"""Problem 18: Maximum path sum I By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below: NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o)""" triangle = [ [75], [95, 64], [17, 47, 82], [18, 35, 87, 10], [20, 4, 82, 47, 65], [19, 1, 23, 75, 3, 34], [88, 2, 77, 73, 7, 63, 67], [99, 65, 4, 28, 6, 16, 70, 92], [41, 41, 26, 56, 83, 40, 80, 70, 33], [41, 48, 72, 33, 47, 32, 37, 16, 94, 29], [53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14], [70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57], [91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48], [63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31], [4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23] ] max_sequence = triangle[0][0] last_index = 0 for _ in triangle[1:]: max_num = max([_[last_index], _[last_index + 1]]) for i, j in enumerate(_): if j == max_num and i in [last_index, last_index + 1]: last_index = i max_sequence += j print(max_sequence)
af69540816f7419ffc2f77af3c390426b6e34f54
f08e50d55bbbb90e4c8f9a8811eaede98ede2694
/erpbee/accounts/doctype/pricing_rule/test_pricing_rule.py
6c4c239ce0ed4aa6d247e7e5efd87cdbd727019e
[]
no_license
mohrezbak/erpbee
bc48472a99a7f4357aa7b82ff3a9c1a4c98ba017
1134156ad337fd472e14cf347479c17bd8db7b33
refs/heads/main
2023-02-12T01:32:07.858555
2021-01-08T17:25:23
2021-01-08T17:25:23
327,872,762
0
0
null
null
null
null
UTF-8
Python
false
false
18,469
py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe from erpbee.selling.doctype.sales_order.test_sales_order import make_sales_order from erpbee.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpbee.stock.get_item_details import get_item_details from frappe import MandatoryError from erpbee.stock.doctype.item.test_item import make_item from erpbee.healthcare.doctype.lab_test_template.lab_test_template import make_item_price class TestPricingRule(unittest.TestCase): def setUp(self): delete_existing_pricing_rules() def tearDown(self): delete_existing_pricing_rules() def test_pricing_rule_for_discount(self): from erpbee.stock.get_item_details import get_item_details from frappe import MandatoryError test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", "apply_on": "Item Code", "items": [{ "item_code": "_Test Item" }], "currency": "USD", "selling": 1, "rate_or_discount": "Discount Percentage", "rate": 0, "discount_percentage": 10, "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() args = frappe._dict({ "item_code": "_Test Item", "company": "_Test Company", "price_list": "_Test Price List", "currency": "_Test Currency", "doctype": "Sales Order", "conversion_rate": 1, "price_list_currency": "_Test Currency", "plc_conversion_rate": 1, "order_type": "Sales", "customer": "_Test Customer", "name": None }) details = get_item_details(args) self.assertEqual(details.get("discount_percentage"), 10) prule = frappe.get_doc(test_record.copy()) prule.applicable_for = "Customer" prule.title = "_Test Pricing Rule for Customer" self.assertRaises(MandatoryError, prule.insert) prule.customer = "_Test Customer" prule.discount_percentage = 20 prule.insert() details = get_item_details(args) self.assertEqual(details.get("discount_percentage"), 20) prule = frappe.get_doc(test_record.copy()) prule.apply_on = "Item Group" prule.items = [] prule.append('item_groups', { 'item_group': "All Item Groups" }) prule.title = "_Test Pricing Rule for Item Group" prule.discount_percentage = 15 prule.insert() args.customer = "_Test Customer 1" details = get_item_details(args) self.assertEqual(details.get("discount_percentage"), 10) prule = frappe.get_doc(test_record.copy()) prule.applicable_for = "Campaign" prule.campaign = "_Test Campaign" prule.title = "_Test Pricing Rule for Campaign" prule.discount_percentage = 5 prule.priority = 8 prule.insert() args.campaign = "_Test Campaign" details = get_item_details(args) self.assertEqual(details.get("discount_percentage"), 5) frappe.db.sql("update `tabPricing Rule` set priority=NULL where campaign='_Test Campaign'") from erpbee.accounts.doctype.pricing_rule.utils import MultiplePricingRuleConflict self.assertRaises(MultiplePricingRuleConflict, get_item_details, args) args.item_code = "_Test Item 2" details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 15) def test_pricing_rule_for_margin(self): from erpbee.stock.get_item_details import get_item_details from frappe import MandatoryError test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", "apply_on": "Item Code", "items": [{ "item_code": "_Test FG Item 2", }], "selling": 1, "currency": "USD", "rate_or_discount": "Discount Percentage", "rate": 0, "margin_type": "Percentage", "margin_rate_or_amount": 10, "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() item_price = frappe.get_doc({ "doctype": "Item Price", "price_list": "_Test Price List 2", "item_code": "_Test FG Item 2", "price_list_rate": 100 }) item_price.insert(ignore_permissions=True) args = frappe._dict({ "item_code": "_Test FG Item 2", "company": "_Test Company", "price_list": "_Test Price List", "currency": "_Test Currency", "doctype": "Sales Order", "conversion_rate": 1, "price_list_currency": "_Test Currency", "plc_conversion_rate": 1, "order_type": "Sales", "customer": "_Test Customer", "name": None }) details = get_item_details(args) self.assertEquals(details.get("margin_type"), "Percentage") self.assertEquals(details.get("margin_rate_or_amount"), 10) def test_mixed_conditions_for_item_group(self): for item in ["Mixed Cond Item 1", "Mixed Cond Item 2"]: make_item(item, {"item_group": "Products"}) make_item_price(item, "_Test Price List", 100) test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule for Item Group", "apply_on": "Item Group", "item_groups": [ { "item_group": "Products", }, { "item_group": "Seed", }, ], "selling": 1, "mixed_conditions": 1, "currency": "USD", "rate_or_discount": "Discount Percentage", "discount_percentage": 10, "applicable_for": "Customer Group", "customer_group": "All Customer Groups", "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() args = frappe._dict({ "item_code": "Mixed Cond Item 1", "item_group": "Products", "company": "_Test Company", "price_list": "_Test Price List", "currency": "_Test Currency", "doctype": "Sales Order", "conversion_rate": 1, "price_list_currency": "_Test Currency", "plc_conversion_rate": 1, "order_type": "Sales", "customer": "_Test Customer", "customer_group": "_Test Customer Group", "name": None }) details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) def test_pricing_rule_for_variants(self): from erpbee.stock.get_item_details import get_item_details from frappe import MandatoryError if not frappe.db.exists("Item", "Test Variant PRT"): frappe.get_doc({ "doctype": "Item", "item_code": "Test Variant PRT", "item_name": "Test Variant PRT", "description": "Test Variant PRT", "item_group": "_Test Item Group", "is_stock_item": 1, "variant_of": "_Test Variant Item", "default_warehouse": "_Test Warehouse - _TC", "stock_uom": "_Test UOM", "attributes": [ { "attribute": "Test Size", "attribute_value": "Medium" } ], }).insert() frappe.get_doc({ "doctype": "Pricing Rule", "title": "_Test Pricing Rule 1", "apply_on": "Item Code", "currency": "USD", "items": [{ "item_code": "_Test Variant Item", }], "selling": 1, "rate_or_discount": "Discount Percentage", "rate": 0, "discount_percentage": 7.5, "company": "_Test Company" }).insert() args = frappe._dict({ "item_code": "Test Variant PRT", "company": "_Test Company", "price_list": "_Test Price List", "currency": "_Test Currency", "doctype": "Sales Order", "conversion_rate": 1, "price_list_currency": "_Test Currency", "plc_conversion_rate": 1, "order_type": "Sales", "customer": "_Test Customer", "name": None }) details = get_item_details(args) self.assertEqual(details.get("discount_percentage"), 7.5) # add a new pricing rule for that item code, it should take priority frappe.get_doc({ "doctype": "Pricing Rule", "title": "_Test Pricing Rule 2", "apply_on": "Item Code", "items": [{ "item_code": "Test Variant PRT", }], "currency": "USD", "selling": 1, "rate_or_discount": "Discount Percentage", "rate": 0, "discount_percentage": 17.5, "company": "_Test Company" }).insert() details = get_item_details(args) self.assertEqual(details.get("discount_percentage"), 17.5) def test_pricing_rule_for_stock_qty(self): test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", "apply_on": "Item Code", "currency": "USD", "items": [{ "item_code": "_Test Item", }], "selling": 1, "rate_or_discount": "Discount Percentage", "rate": 0, "min_qty": 5, "max_qty": 7, "discount_percentage": 17.5, "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() if not frappe.db.get_value('UOM Conversion Detail', {'parent': '_Test Item', 'uom': 'box'}): item = frappe.get_doc('Item', '_Test Item') item.append('uoms', { 'uom': 'Box', 'conversion_factor': 5 }) item.save(ignore_permissions=True) # With pricing rule so = make_sales_order(item_code="_Test Item", qty=1, uom="Box", do_not_submit=True) so.items[0].price_list_rate = 100 so.submit() so = frappe.get_doc('Sales Order', so.name) self.assertEqual(so.items[0].discount_percentage, 17.5) self.assertEqual(so.items[0].rate, 82.5) # Without pricing rule so = make_sales_order(item_code="_Test Item", qty=2, uom="Box", do_not_submit=True) so.items[0].price_list_rate = 100 so.submit() so = frappe.get_doc('Sales Order', so.name) self.assertEqual(so.items[0].discount_percentage, 0) self.assertEqual(so.items[0].rate, 100) def test_pricing_rule_with_margin_and_discount(self): frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule') make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10, discount_percentage=10) si = create_sales_invoice(do_not_save=True) si.items[0].price_list_rate = 1000 si.payment_schedule = [] si.insert(ignore_permissions=True) item = si.items[0] self.assertEquals(item.margin_rate_or_amount, 10) self.assertEquals(item.rate_with_margin, 1100) self.assertEqual(item.discount_percentage, 10) self.assertEquals(item.discount_amount, 110) self.assertEquals(item.rate, 990) def test_pricing_rule_for_product_discount_on_same_item(self): frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule') test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", "apply_on": "Item Code", "currency": "USD", "items": [{ "item_code": "_Test Item", }], "selling": 1, "rate_or_discount": "Discount Percentage", "rate": 0, "min_qty": 0, "max_qty": 7, "discount_percentage": 17.5, "price_or_product_discount": "Product", "same_item": 1, "free_qty": 1, "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() # With pricing rule so = make_sales_order(item_code="_Test Item", qty=1) so.load_from_db() self.assertEqual(so.items[1].is_free_item, 1) self.assertEqual(so.items[1].item_code, "_Test Item") def test_pricing_rule_for_product_discount_on_different_item(self): frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule') test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", "apply_on": "Item Code", "currency": "USD", "items": [{ "item_code": "_Test Item", }], "selling": 1, "rate_or_discount": "Discount Percentage", "rate": 0, "min_qty": 0, "max_qty": 7, "discount_percentage": 17.5, "price_or_product_discount": "Product", "same_item": 0, "free_item": "_Test Item 2", "free_qty": 1, "company": "_Test Company" } frappe.get_doc(test_record.copy()).insert() # With pricing rule so = make_sales_order(item_code="_Test Item", qty=1) so.load_from_db() self.assertEqual(so.items[1].is_free_item, 1) self.assertEqual(so.items[1].item_code, "_Test Item 2") def test_cumulative_pricing_rule(self): frappe.delete_doc_if_exists('Pricing Rule', '_Test Cumulative Pricing Rule') test_record = { "doctype": "Pricing Rule", "title": "_Test Cumulative Pricing Rule", "apply_on": "Item Code", "currency": "USD", "items": [{ "item_code": "_Test Item", }], "is_cumulative": 1, "selling": 1, "applicable_for": "Customer", "customer": "_Test Customer", "rate_or_discount": "Discount Percentage", "rate": 0, "min_amt": 0, "max_amt": 10000, "discount_percentage": 17.5, "price_or_product_discount": "Price", "company": "_Test Company", "valid_from": frappe.utils.nowdate(), "valid_upto": frappe.utils.nowdate() } frappe.get_doc(test_record.copy()).insert() args = frappe._dict({ "item_code": "_Test Item", "company": "_Test Company", "price_list": "_Test Price List", "currency": "_Test Currency", "doctype": "Sales Invoice", "conversion_rate": 1, "price_list_currency": "_Test Currency", "plc_conversion_rate": 1, "order_type": "Sales", "customer": "_Test Customer", "name": None, "transaction_date": frappe.utils.nowdate() }) details = get_item_details(args) self.assertTrue(details) def test_pricing_rule_for_condition(self): frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule") make_pricing_rule(selling=1, margin_type="Percentage", \ condition="customer=='_Test Customer 1' and is_return==0", discount_percentage=10) # Incorrect Customer and Correct is_return value si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 2", is_return=0) si.items[0].price_list_rate = 1000 si.submit() item = si.items[0] self.assertEquals(item.rate, 100) # Correct Customer and Incorrect is_return value si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", is_return=1, qty=-1) si.items[0].price_list_rate = 1000 si.submit() item = si.items[0] self.assertEquals(item.rate, 100) # Correct Customer and correct is_return value si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", is_return=0) si.items[0].price_list_rate = 1000 si.submit() item = si.items[0] self.assertEquals(item.rate, 900) def test_multiple_pricing_rules(self): make_pricing_rule(discount_percentage=20, selling=1, priority=1, apply_multiple_pricing_rules=1, title="_Test Pricing Rule 1") make_pricing_rule(discount_percentage=10, selling=1, title="_Test Pricing Rule 2", priority=2, apply_multiple_pricing_rules=1) si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1) self.assertEqual(si.items[0].discount_percentage, 30) si.delete() frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 1") frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 2") def test_multiple_pricing_rules_with_apply_discount_on_discounted_rate(self): frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule") make_pricing_rule(discount_percentage=20, selling=1, priority=1, apply_multiple_pricing_rules=1, title="_Test Pricing Rule 1") make_pricing_rule(discount_percentage=10, selling=1, priority=2, apply_discount_on_rate=1, title="_Test Pricing Rule 2", apply_multiple_pricing_rules=1) si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1) self.assertEqual(si.items[0].discount_percentage, 28) si.delete() frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 1") frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 2") def test_item_price_with_pricing_rule(self): item = make_item("Water Flask") make_item_price("Water Flask", "_Test Price List", 100) pricing_rule_record = { "doctype": "Pricing Rule", "title": "_Test Water Flask Rule", "apply_on": "Item Code", "items": [{ "item_code": "Water Flask", }], "selling": 1, "currency": "INR", "rate_or_discount": "Rate", "rate": 0, "margin_type": "Percentage", "margin_rate_or_amount": 2, "company": "_Test Company" } rule = frappe.get_doc(pricing_rule_record) rule.insert() si = create_sales_invoice(do_not_save=True, item_code="Water Flask") si.selling_price_list = "_Test Price List" si.save() # If rate in Rule is 0, give preference to Item Price if it exists self.assertEqual(si.items[0].price_list_rate, 100) self.assertEqual(si.items[0].margin_rate_or_amount, 2) self.assertEqual(si.items[0].rate_with_margin, 102) self.assertEqual(si.items[0].rate, 102) si.delete() rule.delete() frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete() item.delete() def test_pricing_rule_for_transaction(self): make_item("Water Flask 1") frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule') make_pricing_rule(selling=1, min_qty=5, price_or_product_discount="Product", apply_on="Transaction", free_item="Water Flask 1", free_qty=1, free_item_rate=10) si = create_sales_invoice(qty=5, do_not_submit=True) self.assertEquals(len(si.items), 2) self.assertEquals(si.items[1].rate, 10) si1 = create_sales_invoice(qty=2, do_not_submit=True) self.assertEquals(len(si1.items), 1) for doc in [si, si1]: doc.delete() def make_pricing_rule(**args): args = frappe._dict(args) doc = frappe.get_doc({ "doctype": "Pricing Rule", "title": args.title or "_Test Pricing Rule", "company": args.company or "_Test Company", "apply_on": args.apply_on or "Item Code", "applicable_for": args.applicable_for, "selling": args.selling or 0, "currency": "USD", "apply_discount_on_rate": args.apply_discount_on_rate or 0, "buying": args.buying or 0, "min_qty": args.min_qty or 0.0, "max_qty": args.max_qty or 0.0, "rate_or_discount": args.rate_or_discount or "Discount Percentage", "discount_percentage": args.discount_percentage or 0.0, "rate": args.rate or 0.0, "margin_rate_or_amount": args.margin_rate_or_amount or 0.0, "condition": args.condition or '', "apply_multiple_pricing_rules": args.apply_multiple_pricing_rules or 0 }) for field in ["free_item", "free_qty", "free_item_rate", "priority", "margin_type", "price_or_product_discount"]: if args.get(field): doc.set(field, args.get(field)) apply_on = doc.apply_on.replace(' ', '_').lower() child_table = {'Item Code': 'items', 'Item Group': 'item_groups', 'Brand': 'brands'} if doc.apply_on != "Transaction": doc.append(child_table.get(doc.apply_on), { apply_on: args.get(apply_on) or "_Test Item" }) doc.insert(ignore_permissions=True) if args.get(apply_on) and apply_on != "item_code": doc.db_set(apply_on, args.get(apply_on)) applicable_for = doc.applicable_for.replace(' ', '_').lower() if args.get(applicable_for): doc.db_set(applicable_for, args.get(applicable_for)) def delete_existing_pricing_rules(): for doctype in ["Pricing Rule", "Pricing Rule Item Code", "Pricing Rule Item Group", "Pricing Rule Brand"]: frappe.db.sql("delete from `tab{0}`".format(doctype))
8edb1fa30b3189a1ec7c551c9d73c662805ee0de
ddd002cff6b4668c47a14e740ec780f2c03dcbd9
/algorithms/quicksort.py
30e026c5c0a83e1f09bff25e8aea55ff0667aaab
[]
no_license
wangonya/python_practice
53b93bdf93b7a586df75040d4c26d25793b59ed9
70f45f950fb6e9619e4054cb1ea5f8d8db988f0e
refs/heads/master
2020-04-02T07:33:06.647605
2018-12-19T07:25:26
2018-12-19T07:25:26
154,202,248
2
0
null
2018-12-16T05:02:05
2018-10-22T19:19:43
Python
UTF-8
Python
false
false
526
py
def quickSort(arr): less = [] pivotList = [] more = [] if len(arr) <= 1: return arr else: pivot = arr[0] for i in arr: if i < pivot: less.append(i) elif i > pivot: more.append(i) else: pivotList.append(i) less = quickSort(less) more = quickSort(more) return less + pivotList + more if __name__ == '__main__': arr = map(int, input().split()) print(quickSort(list(arr)))
a956c5437ef70e9646509d41f4eb1a179730eac6
ca0c3c1cdfdd714c7780c27fcecd4a2ae39d1474
/src/fmf/apps/core/migrations/0001_initial.py
19696394a44e5650c93214f629650c85c09d6a98
[]
no_license
vasyabigi/fmf
fce88a45fb47f3f7652995af40b567ffdf27a4a0
988ba668f3ce6da2670b987a1eeae3c87761eac5
refs/heads/master
2021-01-23T07:29:52.185306
2012-08-27T13:11:51
2012-08-27T13:11:51
2,803,493
1
1
null
null
null
null
UTF-8
Python
false
false
3,435
py
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'IndexSliderImage' db.create_table('core_indexsliderimage', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('page', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['flatpages.FlatPage'], unique=True)), ('image', self.gf('sorl.thumbnail.fields.ImageField')(max_length=100)), ('position', self.gf('django.db.models.fields.IntegerField')(default=-1)), ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), )) db.send_create_signal('core', ['IndexSliderImage']) def backwards(self, orm): # Deleting model 'IndexSliderImage' db.delete_table('core_indexsliderimage') models = { 'core.indexsliderimage': { 'Meta': {'ordering': "('position',)", 'object_name': 'IndexSliderImage'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'image': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'page': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['flatpages.FlatPage']", 'unique': 'True'}), 'position': ('django.db.models.fields.IntegerField', [], {'default': '-1'}) }, 'flatpages.flatpage': { 'Meta': {'ordering': "('url',)", 'object_name': 'FlatPage', 'db_table': "'django_flatpage'"}, 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'content_en': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'content_uk': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'enable_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'registration_required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sites.Site']", 'symmetrical': 'False'}), 'template_name': ('django.db.models.fields.CharField', [], {'max_length': '70', 'blank': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}), 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'title_uk': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'}) }, 'sites.site': { 'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"}, 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) } } complete_apps = ['core']
61a6e75b11db9f3519abe6b262fd42d9f9963545
1f63dde39fcc5f8be29f2acb947c41f1b6f1683e
/Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/tfprof/python/tools/tfprof/print_model_analysis_test.py
c3e9fc9cc099f144f81235a944221fa05b6b398c
[ "MIT", "Apache-2.0" ]
permissive
koobonil/Boss2D
09ca948823e0df5a5a53b64a10033c4f3665483a
e5eb355b57228a701495f2660f137bd05628c202
refs/heads/master
2022-10-20T09:02:51.341143
2019-07-18T02:13:44
2019-07-18T02:13:44
105,999,368
7
2
MIT
2022-10-04T23:31:12
2017-10-06T11:57:07
C++
UTF-8
Python
false
false
7,110
py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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. # ============================================================================== """print_model_analysis test.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from google.protobuf import text_format from tensorflow.python.client import session from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import init_ops from tensorflow.python.ops import nn_ops from tensorflow.python.ops import variable_scope from tensorflow.python.platform import test from tensorflow.tools.tfprof import tfprof_options_pb2 from tensorflow.tools.tfprof import tfprof_output_pb2 # XXX: this depends on pywrap_tensorflow and must come later from tensorflow.contrib.tfprof.python.tools.tfprof import pywrap_tensorflow_print_model_analysis_lib as print_mdl # pylint: disable=bad-whitespace # pylint: disable=bad-continuation TEST_OPTIONS = { 'max_depth': 10000, 'min_bytes': 0, 'min_micros': 0, 'min_params': 0, 'min_float_ops': 0, 'device_regexes': ['.*'], 'order_by': 'name', 'account_type_regexes': ['.*'], 'start_name_regexes': ['.*'], 'trim_name_regexes': [], 'show_name_regexes': ['.*'], 'hide_name_regexes': [], 'account_displayed_op_only': True, 'select': ['params'], 'output': 'stdout', } # pylint: enable=bad-whitespace # pylint: enable=bad-continuation class PrintModelAnalysisTest(test.TestCase): def _BuildSmallModel(self): image = array_ops.zeros([2, 6, 6, 3]) kernel = variable_scope.get_variable( 'DW', [6, 6, 3, 6], dtypes.float32, initializer=init_ops.random_normal_initializer(stddev=0.001)) x = nn_ops.conv2d(image, kernel, [1, 2, 2, 1], padding='SAME') return x def testPrintModelAnalysis(self): opts = tfprof_options_pb2.OptionsProto() opts.max_depth = TEST_OPTIONS['max_depth'] opts.min_bytes = TEST_OPTIONS['min_bytes'] opts.min_micros = TEST_OPTIONS['min_micros'] opts.min_params = TEST_OPTIONS['min_params'] opts.min_float_ops = TEST_OPTIONS['min_float_ops'] for p in TEST_OPTIONS['device_regexes']: opts.device_regexes.append(p) opts.order_by = TEST_OPTIONS['order_by'] for p in TEST_OPTIONS['account_type_regexes']: opts.account_type_regexes.append(p) for p in TEST_OPTIONS['start_name_regexes']: opts.start_name_regexes.append(p) for p in TEST_OPTIONS['trim_name_regexes']: opts.trim_name_regexes.append(p) for p in TEST_OPTIONS['show_name_regexes']: opts.show_name_regexes.append(p) for p in TEST_OPTIONS['hide_name_regexes']: opts.hide_name_regexes.append(p) opts.account_displayed_op_only = TEST_OPTIONS['account_displayed_op_only'] for p in TEST_OPTIONS['select']: opts.select.append(p) opts.output = TEST_OPTIONS['output'] with session.Session() as sess, ops.device('/cpu:0'): _ = self._BuildSmallModel() tfprof_pb = tfprof_output_pb2.TFGraphNodeProto() tfprof_pb.ParseFromString( print_mdl.PrintModelAnalysis( sess.graph.as_graph_def().SerializeToString(), b'', b'', b'scope', opts.SerializeToString())) expected_pb = tfprof_output_pb2.TFGraphNodeProto() text_format.Merge(r"""name: "_TFProfRoot" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 648 children { name: "Conv2D" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } children { name: "DW" exec_micros: 0 requested_bytes: 0 parameters: 648 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 648 children { name: "DW/Assign" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } children { name: "DW/Initializer" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 children { name: "DW/Initializer/random_normal" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 children { name: "DW/Initializer/random_normal/RandomStandardNormal" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } children { name: "DW/Initializer/random_normal/mean" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } children { name: "DW/Initializer/random_normal/mul" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } children { name: "DW/Initializer/random_normal/shape" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } children { name: "DW/Initializer/random_normal/stddev" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } float_ops: 0 total_float_ops: 0 } float_ops: 0 total_float_ops: 0 } children { name: "DW/read" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } float_ops: 0 total_float_ops: 0 } children { name: "zeros" exec_micros: 0 requested_bytes: 0 total_exec_micros: 0 total_requested_bytes: 0 total_parameters: 0 float_ops: 0 total_float_ops: 0 } float_ops: 0 total_float_ops: 0""", expected_pb) self.assertEqual(expected_pb, tfprof_pb) if __name__ == '__main__': test.main()
eabe3ee069129823ec57dca7dea81d3a8c2f7f0f
de64b143a346585f51590bd674e8d13bbc672386
/algorithm/2023/0530_743_Network_Delay_Time/Euihyun.py
7b37ba25dc97c748f4d9722f0e74732f52b04da8
[]
no_license
ai-kmu/etc
304ec20f59e4026025abdcbcae21863c80630dcb
9c29941e19b7dd2a2037b110dd6e16690e9a0cc2
refs/heads/master
2023-08-21T16:30:31.149956
2023-08-21T16:26:19
2023-08-21T16:26:19
199,843,899
3
24
null
2023-05-31T09:56:59
2019-07-31T11:36:16
Jupyter Notebook
UTF-8
Python
false
false
1,766
py
# 흠 오랜만에 다익스트라 푸니까 못풀겠네요... 솔루션 봤습니다. # 그래서 리뷰는 괜찮아요! import heapq class Solution(object): def networkDelayTime(self, times, n, k): # 그래프 초기화 # 인접 리스트로 그래프 표현 graph = [[] for _ in range(n+1)] for u, v, w in times: # u에서 v로 가는 간선의 정보 저장 graph[u].append((v, w)) # 최단 거리 초기화 dist = [float('inf')] * (n+1) # 출발 노드의 최단 거리 0 dist[k] = 0 # 우선순위 큐 초기화 # (거리, 노드) 쌍을 저장하는 우선순위 큐 pq = [(0, k)] while pq: # 우선순위 큐에서 가장 작은 거리를 가지는 노드 선택 d, node = heapq.heappop(pq) # 이미 처리된 노드 스킵 if d > dist[node]: continue # 인접 노드 순회 for neighbor, delay in graph[node]: # 현재 노드를 거쳐 인접 노드로 가는 거리 계산 new_dist = d + delay # 더 짧은 거리를 찾은 경우 if new_dist < dist[neighbor]: # 최단 거리 업데이트 # 우선순위 큐에 삽입 dist[neighbor] = new_dist heapq.heappush(pq, (new_dist, neighbor)) # 모든 노드의 최단 거리 중 가장 큰 값을 찾음 max_delay = max(dist[1:]) # 모든 노드에 도달할 수 없는 경우 0 아님 max리턴 if max_delay == float('inf'): return -1 else: return max_delay
fa5e2514f9cf03fda65eafbc2e83da73caeab49e
3abe579ffc36cffef882bd23139c8112dc18b5eb
/nodeeditor/node_edge.py
7380edde1767614f6725da1367c056ef702d0e36
[]
no_license
huazhicai/nodeEditor
3663950221a2fa8ee9a9aa9f5718d20722d9ecf4
cb9ed8c1e57614c9bc2242b948ce8361d71fa4be
refs/heads/master
2020-07-06T05:34:55.186396
2019-09-02T08:12:38
2019-09-02T08:12:38
202,908,526
0
0
null
null
null
null
UTF-8
Python
false
false
3,970
py
from nodeeditor.node_graphics_edge import * EDGE_TYPE_DIRECT = 1 EDGE_TYPE_BEZIER = 2 DEBUG = False class Edge(Serializable): def __init__(self, scene, start_socket=None, end_socket=None, edge_type=EDGE_TYPE_DIRECT): super().__init__() self.scene = scene # default init self._start_socket = None self._end_socket = None self.start_socket = start_socket self.end_socket = end_socket self.edge_type = edge_type self.scene.addEdge(self) def __str__(self): return "<Edge %s..%s>" % (hex(id(self))[2:5], hex(id(self))[-3:]) @property def start_socket(self): return self._start_socket @start_socket.setter def start_socket(self, value): # if we were assigned to some socket before, delete us from the socket if self._start_socket is not None: self._start_socket.removeEdge(self) # assign new start socket self._start_socket = value # addEdge to the Socket class if self.start_socket is not None: self.start_socket.addEdge(self) @property def end_socket(self): return self._end_socket @end_socket.setter def end_socket(self, value): # if we were assigned to some socket before, delete us from the socket if self._end_socket is not None: self._end_socket.removeEdge(self) # assign new end socket self._end_socket = value # addEdge to the Socket class if self.end_socket is not None: self.end_socket.addEdge(self) @property def edge_type(self): return self._edge_type @edge_type.setter def edge_type(self, value): if hasattr(self, 'grEdge') and self.grEdge is not None: self.scene.grScene.removeItem(self.grEdge) self._edge_type = value if self.edge_type == EDGE_TYPE_DIRECT: self.grEdge = QDMGraphicsEdgeDirect(self) elif self.edge_type == EDGE_TYPE_BEZIER: self.grEdge = QDMGraphicsEdgeBezier(self) else: self.grEdge = QDMGraphicsEdgeBezier(self) self.scene.grScene.addItem(self.grEdge) if self.start_socket is not None: self.updatePositions() def updatePositions(self): source_pos = self.start_socket.getSocketPosition() source_pos[0] += self.start_socket.node.grNode.pos().x() source_pos[1] += self.start_socket.node.grNode.pos().y() self.grEdge.setSource(*source_pos) if self.end_socket is not None: end_pos = self.end_socket.getSocketPosition() end_pos[0] += self.end_socket.node.grNode.pos().x() end_pos[1] += self.end_socket.node.grNode.pos().y() self.grEdge.setDestination(*end_pos) else: self.grEdge.setDestination(*source_pos) self.grEdge.update() def remove_from_sockets(self): self.end_socket = None self.start_socket = None def remove(self): if DEBUG: print("# Removing Edge", self) if DEBUG: print(" - remove edge from all sockets") self.remove_from_sockets() if DEBUG: print(" - remove grEdge") self.scene.grScene.removeItem(self.grEdge) self.grEdge = None if DEBUG: print(" - remove edge from scene") try: self.scene.removeEdge(self) except ValueError: pass if DEBUG: print(" - everything is done.") def serialize(self): return OrderedDict([ ('id', self.id), ('edge_type', self.edge_type), ('start', self.start_socket.id), ('end', self.end_socket.id), ]) def deserialize(self, data, hashmap={}, restore_id=True): if restore_id: self.id = data['id'] self.start_socket = hashmap[data['start']] self.end_socket = hashmap[data['end']] self.edge_type = data['edge_type']
c6a43174111768e064e7f6c251e16fa309e4c6ac
057d2d1e2a78fc89851154e87b0b229e1e1f003b
/venv/Lib/site-packages/keystoneauth1/tests/unit/k2k_fixtures.py
f78cb0ef084ac7c36a3534ff0e66d62666f5d365
[ "Apache-2.0" ]
permissive
prasoon-uta/IBM-Cloud-Secure-File-Storage
276dcbd143bd50b71121a73bc01c8e04fe3f76b0
82a6876316715efbd0b492d0d467dde0ab26a56b
refs/heads/master
2022-12-13T00:03:31.363281
2018-02-22T02:24:11
2018-02-22T02:24:11
122,420,622
0
2
Apache-2.0
2022-12-08T05:15:19
2018-02-22T02:26:48
Python
UTF-8
Python
false
false
5,454
py
# 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. UNSCOPED_TOKEN_HEADER = 'UNSCOPED_TOKEN' UNSCOPED_TOKEN = { "token": { "issued_at": "2014-06-09T09:48:59.643406Z", "extras": {}, "methods": ["token"], "expires_at": "2014-06-09T10:48:59.643375Z", "user": { "OS-FEDERATION": { "identity_provider": { "id": "testshib" }, "protocol": { "id": "saml2" }, "groups": [ {"id": "1764fa5cf69a49a4918131de5ce4af9a"} ] }, "id": "testhib%20user", "name": "testhib user" } } } SAML_ENCODING = "<?xml version='1.0' encoding='UTF-8'?>" TOKEN_SAML_RESPONSE = """ <ns2:Response Destination="http://beta.example.com/Shibboleth.sso/POST/ECP" ID="8c21de08d2f2435c9acf13e72c982846" IssueInstant="2015-03-25T14:43:21Z" Version="2.0"> <saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"> http://keystone.idp/v3/OS-FEDERATION/saml2/idp </saml:Issuer> <ns2:Status> <ns2:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/> </ns2:Status> <saml:Assertion ID="a5f02efb0bff4044b294b4583c7dfc5d" IssueInstant="2015-03-25T14:43:21Z" Version="2.0"> <saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"> http://keystone.idp/v3/OS-FEDERATION/saml2/idp</saml:Issuer> <xmldsig:Signature> <xmldsig:SignedInfo> <xmldsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <xmldsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <xmldsig:Reference URI="#a5f02efb0bff4044b294b4583c7dfc5d"> <xmldsig:Transforms> <xmldsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig# enveloped-signature"/> <xmldsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </xmldsig:Transforms> <xmldsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <xmldsig:DigestValue> 0KH2CxdkfzU+6eiRhTC+mbObUKI= </xmldsig:DigestValue> </xmldsig:Reference> </xmldsig:SignedInfo> <xmldsig:SignatureValue> m2jh5gDvX/1k+4uKtbb08CHp2b9UWsLw </xmldsig:SignatureValue> <xmldsig:KeyInfo> <xmldsig:X509Data> <xmldsig:X509Certificate>...</xmldsig:X509Certificate> </xmldsig:X509Data> </xmldsig:KeyInfo> </xmldsig:Signature> <saml:Subject> <saml:NameID>admin</saml:NameID> <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <saml:SubjectConfirmationData NotOnOrAfter="2015-03-25T15:43:21.172385Z" Recipient="http://beta.example.com/Shibboleth.sso/POST/ECP"/> </saml:SubjectConfirmation> </saml:Subject> <saml:AuthnStatement AuthnInstant="2015-03-25T14:43:21Z" SessionIndex="9790eb729858456f8a33b7a11f0a637e" SessionNotOnOrAfter="2015-03-25T15:43:21.172385Z"> <saml:AuthnContext> <saml:AuthnContextClassRef> urn:oasis:names:tc:SAML:2.0:ac:classes:Password </saml:AuthnContextClassRef> <saml:AuthenticatingAuthority> http://keystone.idp/v3/OS-FEDERATION/saml2/idp </saml:AuthenticatingAuthority> </saml:AuthnContext> </saml:AuthnStatement> <saml:AttributeStatement> <saml:Attribute Name="openstack_user" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"> <saml:AttributeValue xsi:type="xs:string">admin</saml:AttributeValue> </saml:Attribute> <saml:Attribute Name="openstack_roles" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"> <saml:AttributeValue xsi:type="xs:string">admin</saml:AttributeValue> </saml:Attribute> <saml:Attribute Name="openstack_project" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"> <saml:AttributeValue xsi:type="xs:string">admin</saml:AttributeValue> </saml:Attribute> </saml:AttributeStatement> </saml:Assertion> </ns2:Response> """ TOKEN_BASED_SAML = ''.join([SAML_ENCODING, TOKEN_SAML_RESPONSE]) ECP_ENVELOPE = """ <ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp" xmlns:ns2="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xmldsig="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ns0:Header> <ns1:RelayState ns0:actor="http://schemas.xmlsoap.org/soap/actor/next" ns0:mustUnderstand="1"> ss:mem:1ddfe8b0f58341a5a840d2e8717b0737 </ns1:RelayState> </ns0:Header> <ns0:Body> {0} </ns0:Body> </ns0:Envelope> """.format(TOKEN_SAML_RESPONSE) TOKEN_BASED_ECP = ''.join([SAML_ENCODING, ECP_ENVELOPE])
620722b8e666fc4571d412bce02d149322242609
07b41bc2423e5d073ddcd1da47e534d981ccbe78
/backend/marjan_fashion_24858/wsgi.py
73586b0a2cd945c35d8ed73ebf117886439c5c00
[]
no_license
crowdbotics-apps/marjan-fashion-24858
e1fe2cba555d9fef7b17d74e31cd9dc7b72f8a80
aafa62f5fb59466ce4028e774d7e401dc712294f
refs/heads/master
2023-03-21T15:28:10.057904
2021-03-05T04:12:52
2021-03-05T04:12:52
344,690,632
0
0
null
null
null
null
UTF-8
Python
false
false
417
py
""" WSGI config for marjan_fashion_24858 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "marjan_fashion_24858.settings") application = get_wsgi_application()
148a6f9052995914110fda1fdc097a42f961f4ed
bc5c8585b401ebcb90932571cae11b9603e2ef56
/tests/test_modules/test_pmac/test_rawmotorcspart.py
fd4179ec25a4cec13f729c1f71ef46e207b2dd2c
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jamesmudd/pymalcolm
8e22a9e20868d9f0d04dfb3a6b276aaa3e202590
66993756c802cadca70ea07b437c5c2395af3f67
refs/heads/master
2020-04-19T10:54:38.766494
2019-01-29T12:48:22
2019-01-29T12:48:22
168,153,411
0
0
null
2019-01-29T12:46:41
2019-01-29T12:46:41
null
UTF-8
Python
false
false
2,817
py
import unittest from mock import patch from malcolm.core import Process, AlarmSeverity from malcolm.modules.builtin.controllers import StatefulController from malcolm.modules.pmac.parts import RawMotorCSPart class castr(str): ok = True severity = 0 class caenum(int): ok = True severity = 0 enums = ["ANYTHING", "BRICK1CS1", "BRICK1CS2"] @patch("malcolm.modules.ca.util.catools") class TestRawMotorCSPart(unittest.TestCase): def setUp(self): self.process = Process("proc") self.o = RawMotorCSPart("cs", "PV:PRE") c = StatefulController("mri") c.add_part(self.o) self.process.add_controller(c) self.b = self.process.block_view("mri") self.addCleanup(self.process.stop) def do_init(self, catools): catools.caget.side_effect = [[ caenum(2), castr("I"), caenum(1), castr("A") ]] self.process.start() def test_init(self, catools): self.do_init(catools) catools.caget.assert_called_once_with( ["PV:PRE:CsPort", "PV:PRE:CsAxis", "PV:PRE:CsPort_RBV", "PV:PRE:CsAxis_RBV"], format=catools.FORMAT_CTRL) assert list(self.b) == [ 'meta', 'health', 'state', 'disable', 'reset', 'cs'] assert self.b.cs.value == "BRICK1CS1,A" def test_update_axis(self, catools): self.do_init(catools) update = castr("I") self.o._update_value(update, 1) assert self.b.cs.value == "BRICK1CS1,I" def test_update_port(self, catools): self.do_init(catools) update = caenum(2) self.o._update_value(update, 0) assert self.b.cs.value == "BRICK1CS2,A" def test_update_disconnect(self, catools): self.do_init(catools) update = caenum(0) self.o._update_value(update, 0) assert self.b.cs.value == "" def test_update_bad(self, catools): self.do_init(catools) update = castr("") update.ok = False self.o._update_value(update, 1) assert self.b.cs.value == "" assert self.b.cs.alarm.severity == AlarmSeverity.INVALID_ALARM def test_caput(self, catools): self.do_init(catools) catools.caget.side_effect = [[caenum(2), castr("Y")]] self.o.caput("BRICK1CS2,X") catools.caput.assert_called_once_with( ['PV:PRE:CsPort', 'PV:PRE:CsAxis'], (2, 'X'), wait=True ) assert self.b.cs.value == "BRICK1CS2,Y" def test_caput_none(self, catools): self.do_init(catools) catools.caget.side_effect = [[caenum(0), castr("")]] self.o.caput("") catools.caput.assert_called_once_with( ['PV:PRE:CsPort', 'PV:PRE:CsAxis'], (0, ''), wait=True ) assert self.b.cs.value == ""
b1abce58ea0b8c1778eb52d4460c4b39051b3a84
5e381364c2ab31ff3618369085afffba6caa8edb
/recipes/vulkan-memory-allocator/all/test_package/conanfile.py
7ef741773e9b018c9294979a6fd565987ff4c823
[ "MIT" ]
permissive
CAMOBAP/conan-center-index
16aea68a6d22da22831ba985773125e8eda08f00
67d57532bdad549fef3fa6cb8fcdfa86bc55e4f1
refs/heads/master
2023-07-30T08:58:57.285571
2021-10-02T14:57:54
2021-10-02T14:57:54
323,262,699
1
0
MIT
2021-05-29T13:37:04
2020-12-21T07:30:02
Python
UTF-8
Python
false
false
453
py
import os from conans import ConanFile, CMake, tools class VulkanMemoryAllocatorTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "example") self.run(bin_path, run_environment=True)
28a9ef3e533c226aefda479bb8b0e46a24cb8edb
781e2692049e87a4256320c76e82a19be257a05d
/all_data/exercism_data/python/point-mutations/4b3ba2b7e4d141ba80593132e1355e5f.py
353661c3c32ce019cb5d2a587d707fb05742eeeb
[]
no_license
itsolutionscorp/AutoStyle-Clustering
54bde86fe6dbad35b568b38cfcb14c5ffaab51b0
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
refs/heads/master
2020-12-11T07:27:19.291038
2016-03-16T03:18:00
2016-03-16T03:18:42
59,454,921
4
0
null
2016-05-23T05:40:56
2016-05-23T05:40:56
null
UTF-8
Python
false
false
453
py
class DNA(object): """Class representing DNA strand.""" def __init__(self, strand): self.strand = strand def hamming_distance(self, strand): """Method calculating Hamming distance between object's DNA strand and given one.""" n = min(len(self.strand), len(strand)) k = 0 for i in range(0, n): if self.strand[i] != strand[i]: k += 1 return k
7aeec444fe3ba90e5d5ed5656787c5901123d63e
f3179576d85369e9834df0810d57289c04c0b929
/account/migrations/0001_initial.py
a779a9f50a0b638e654c6fe796a6aac162e6f182
[]
no_license
kolamor/template_django_site
cadd75931b460790a162ee6d5e3371140fd2098e
ee7972ca1a65e006a750bbe67f6605ac89248956
refs/heads/master
2022-12-11T00:43:17.809358
2020-09-16T20:21:27
2020-09-16T20:21:27
295,774,229
0
0
null
null
null
null
UTF-8
Python
false
false
845
py
# Generated by Django 3.1.1 on 2020-09-14 20:20 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Profile', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('date_of_birth', models.DateField(blank=True, null=True)), ('photo', models.ImageField(blank=True, upload_to='users/%Y/%m/%d/')), ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), ]
ebf4a1a93a43e70e379c629e7655ea0504e22e52
649bd422025e421d86025743eac324c9b882a2e8
/exam/1_three-dimensional_atomic_system/dump/phasetrans/temp210_10000.py
082ba610673f7da75273657839b7b5ca28e987a1
[]
no_license
scheuclu/atom_class
36ddee1f6a5995872e858add151c5942c109847c
0c9a8c63d9b38898c1869fe8983126cef17662cd
refs/heads/master
2021-01-21T10:52:28.448221
2017-03-07T23:04:41
2017-03-07T23:04:41
83,489,471
0
0
null
null
null
null
UTF-8
Python
false
false
68,768
py
ITEM: TIMESTEP 10000 ITEM: NUMBER OF ATOMS 2048 ITEM: BOX BOUNDS pp pp pp -1.7253288531241989e+02 2.1973288531246422e+02 -1.7253288531241989e+02 2.1973288531246422e+02 -1.7253288531241989e+02 2.1973288531246422e+02 ITEM: ATOMS id type xs ys zs 1454 1 0.695244 0.477366 0.481338 1279 1 0.312395 0.0513861 0.0145019 437 1 0.304166 0.227645 0.035772 1555 1 0.199406 0.0658642 0.0228105 1485 1 0.00850367 0.314375 0.489059 496 1 0.997456 0.195937 0.0340957 1458 1 0.660345 0.146648 0.00672957 1235 1 0.873803 0.0864834 0.172646 741 1 0.41321 0.472298 0.432778 786 1 0.785758 0.209448 0.481834 342 1 0.0572125 0.221187 0.00185297 519 1 0.943445 0.12996 0.0512407 899 1 0.851662 0.495324 0.0302205 40 1 0.438798 0.400294 0.0144851 861 1 0.28304 0.00435151 0.0164769 876 1 0.46394 0.389669 0.116138 1175 1 0.554281 0.358782 0.0139523 73 1 0.263947 0.466213 0.0718706 346 1 0.435167 0.383729 0.0243973 572 1 0.129436 0.456354 0.0146444 1131 1 0.916192 0.441993 0.0595906 1842 1 0.971055 0.200152 0.0225143 553 1 0.0778543 0.0690825 0.0587625 2007 1 0.57979 0.0692342 0.0332274 1069 1 0.391388 0.154662 0.010039 699 1 0.332556 0.246682 0.0936877 77 1 0.521748 0.0969312 0.477632 853 1 0.520699 0.181018 0.0819865 717 1 0.4056 0.230029 0.06709 987 1 0.606545 0.0528533 0.0836582 1132 1 0.221097 0.35265 0.0267901 627 1 0.774901 0.00438502 0.462437 238 1 0.39515 0.446942 0.347548 1937 1 0.0658047 0.394787 0.00629857 1371 1 0.362161 0.391279 0.0561307 1243 1 0.367564 0.466525 0.0228114 1752 1 0.713377 0.367169 0.0302757 531 1 0.985743 0.428195 0.0440591 1024 1 0.742234 0.341831 0.00873548 472 1 0.341768 0.177097 0.0286794 1743 1 0.639456 0.46986 0.006425 557 1 0.154927 0.0261693 0.0143668 26 1 0.310074 0.0409502 0.0494753 943 1 0.692821 0.0552959 0.0314224 1895 1 0.451387 0.0275121 0.117325 1011 1 0.118213 0.13909 0.0462753 896 1 0.894307 0.189667 0.0852813 684 1 0.147262 0.287034 0.0850401 1020 1 0.3836 0.242923 0.0515319 709 1 0.839706 0.305725 0.0238699 1199 1 0.689342 0.28446 0.0619491 981 1 0.508358 0.406985 0.0359357 1275 1 0.227894 0.238557 0.4872 1741 1 0.713734 0.0592674 0.0883285 1774 1 0.556869 0.0370058 0.0370315 1644 1 0.901024 0.0503293 0.0795708 818 1 0.0134109 0.112764 0.0710522 1130 1 0.0909747 0.0977567 0.0805969 920 1 0.441621 0.108453 0.0642677 711 1 0.100633 0.0945463 0.0707501 1520 1 0.231189 0.0750411 0.0903268 129 1 0.603712 0.0820673 0.0611947 635 1 0.33346 0.183301 0.126439 966 1 0.664388 0.215425 0.0592592 887 1 0.346203 0.155529 0.0602407 940 1 0.770966 0.21239 0.0870766 1996 1 0.0768091 0.203259 0.102658 648 1 0.937532 0.237072 0.00186892 642 1 0.338221 0.267831 0.0140516 1079 1 0.318675 0.228998 0.11557 771 1 0.538599 0.347201 0.00266545 590 1 0.371257 0.394507 0.0627141 934 1 0.698058 0.387656 0.116153 1998 1 0.285699 0.460361 0.131076 532 1 0.457943 0.0369451 0.0543785 675 1 0.979902 0.00820361 0.0919382 517 1 0.590037 0.0854222 0.067278 1246 1 0.172794 0.14743 0.0812459 245 1 0.95461 0.193173 0.125261 1271 1 0.280115 0.182719 0.078631 1157 1 0.0304855 0.196678 0.0494958 1258 1 0.537369 0.21231 0.0618081 1429 1 0.590349 0.168559 0.0248763 1778 1 0.858008 0.220979 0.0315444 272 1 0.0562498 0.282377 0.115955 464 1 0.536998 0.297027 0.00533706 230 1 0.050242 0.310161 0.105599 320 1 0.921244 0.397417 0.0367281 1901 1 0.181609 0.417239 0.151665 287 1 0.530595 0.472546 0.211904 926 1 0.606822 0.0125218 0.118049 1976 1 0.681399 0.0738482 0.0648576 59 1 0.66488 0.129822 0.0904973 1613 1 0.694416 0.0663175 0.062947 1591 1 0.448492 0.133419 0.0672736 1180 1 0.914213 0.137283 0.116991 719 1 0.577778 0.138713 0.143555 1724 1 0.529917 0.233199 0.0733365 418 1 0.0381496 0.222467 0.0408483 562 1 0.285244 0.221279 0.133027 1905 1 0.888694 0.188483 0.0607784 367 1 0.417239 0.265785 0.139662 1805 1 0.672589 0.338553 0.11768 1669 1 0.939777 0.361096 0.0995972 697 1 0.943864 0.350276 0.105118 186 1 0.605156 0.410669 0.154963 990 1 0.827408 0.495084 0.10847 427 1 0.327849 0.0397032 0.296957 449 1 0.442525 0.0064502 0.416594 1722 1 0.0205388 0.0437592 0.0986726 829 1 0.989476 0.0249325 0.152432 1426 1 0.0920683 0.0900933 0.0877871 640 1 0.372385 0.18613 0.135925 1589 1 0.125463 0.31244 0.113682 348 1 0.324819 0.339897 0.14317 941 1 0.313047 0.353613 0.149322 1420 1 0.726722 0.331992 0.0855878 72 1 0.982637 0.227115 0.0423507 1983 1 0.361558 0.304887 0.143349 604 1 0.419238 0.344919 0.121919 1093 1 0.578975 0.417766 0.137944 965 1 0.0541946 0.366013 0.115215 1961 1 0.887637 0.411181 0.0979383 265 1 0.458007 0.493029 0.0574836 1680 1 0.664929 0.461952 0.144623 790 1 0.0710356 0.0416018 0.0921973 321 1 0.754771 0.152585 0.462719 1584 1 0.262069 0.116263 0.113354 1265 1 0.0298909 0.185171 0.132478 1257 1 0.084936 0.145312 0.132056 1028 1 0.360118 0.177033 0.128437 1927 1 0.208505 0.248699 0.205514 1957 1 0.208601 0.17714 0.109184 46 1 0.239477 0.214675 0.252606 1703 1 0.730031 0.233727 0.172114 1945 1 0.456522 0.227006 0.132193 1944 1 0.881276 0.284212 0.129851 364 1 0.507804 0.181664 0.107151 1468 1 0.705685 0.314028 0.188335 912 1 0.618459 0.322224 0.183563 834 1 0.199307 0.376864 0.145404 1234 1 0.244171 0.40473 0.134573 860 1 0.0923399 0.369464 0.170286 1197 1 0.220103 0.412029 0.175192 1673 1 0.393374 0.355149 0.120919 1729 1 0.696116 0.415618 0.096039 34 1 0.914978 0.0417478 0.142103 638 1 0.159303 0.0803874 0.210565 408 1 0.731512 0.0213421 0.177505 1073 1 0.814649 0.0767907 0.157341 1333 1 0.151452 0.10236 0.21697 443 1 0.918226 0.157938 0.138828 102 1 0.375489 0.142766 0.209068 137 1 0.902586 0.0757734 0.154097 1050 1 0.198841 0.210202 0.0870232 312 1 0.433232 0.215617 0.189034 138 1 0.362353 0.206715 0.151195 555 1 0.561939 0.269646 0.113445 393 1 0.115619 0.266825 0.189498 1841 1 0.0566077 0.279093 0.198748 1195 1 0.944865 0.292398 0.191713 1747 1 0.493153 0.308138 0.199225 1377 1 0.780013 0.307052 0.138288 1838 1 0.95911 0.26464 0.199931 645 1 0.822231 0.307154 0.164315 937 1 0.820486 0.415728 0.192741 864 1 0.532203 0.456294 0.129027 502 1 0.47861 0.435774 0.139232 145 1 0.715692 0.407175 0.196459 1478 1 0.450166 0.468966 0.306724 1342 1 0.759947 0.0240586 0.230652 577 1 0.598863 0.038111 0.190609 909 1 0.96422 0.150467 0.230362 982 1 0.400016 0.13991 0.222366 1544 1 0.354856 0.113757 0.179673 435 1 0.932629 0.145878 0.156038 505 1 0.531191 0.246796 0.165237 56 1 0.556485 0.196894 0.187968 1411 1 0.119005 0.247649 0.145407 622 1 0.161835 0.273276 0.161219 1032 1 0.891237 0.265674 0.212075 1072 1 0.0666848 0.34533 0.137901 716 1 0.268778 0.290066 0.144342 1910 1 0.707068 0.400081 0.199521 1580 1 0.985459 0.39731 0.197713 156 1 0.81032 0.454215 0.193985 895 1 0.151566 0.434173 0.173912 87 1 0.378724 0.459022 0.142409 107 1 0.705342 0.454648 0.176141 1697 1 0.684963 0.120029 0.193132 1455 1 0.175756 0.0945479 0.228184 1672 1 0.421731 0.185974 0.103068 250 1 0.24643 0.152282 0.221329 16 1 0.438942 0.187894 0.248883 1710 1 0.745047 0.211077 0.265477 1128 1 0.476207 0.244828 0.230717 1757 1 0.986416 0.342538 0.241033 1804 1 0.494764 0.368807 0.230708 746 1 0.281928 0.423114 0.181838 352 1 0.625449 0.388358 0.210886 1893 1 0.62514 0.42525 0.14405 376 1 0.700757 0.359705 0.183009 1052 1 0.854646 0.468533 0.220178 1502 1 0.173119 0.0600653 0.219099 335 1 0.641542 0.145283 0.218763 1651 1 0.744869 0.131874 0.215825 972 1 0.569242 0.214135 0.231485 708 1 0.218766 0.174088 0.200916 997 1 0.952928 0.162628 0.201438 385 1 0.441373 0.275885 0.207369 1418 1 0.980645 0.344866 0.233569 1218 1 0.211267 0.352756 0.254322 1056 1 0.327853 0.423841 0.271577 440 1 0.559457 0.492225 0.229994 1797 1 0.58316 0.435256 0.206542 411 1 0.548242 0.138191 0.496522 1685 1 0.536238 0.0697461 0.403026 1926 1 0.251018 0.0515038 0.172839 38 1 0.628262 0.00650375 0.227001 591 1 0.250123 0.00344107 0.0364946 953 1 0.785614 0.0915752 0.239277 654 1 0.0226244 0.0975686 0.223327 1671 1 0.237406 0.121641 0.20252 1122 1 0.14472 0.124408 0.245235 1176 1 0.649597 0.168233 0.295754 576 1 0.121905 0.18313 0.284473 715 1 0.981351 0.241993 0.247968 986 1 0.764929 0.282226 0.24989 1699 1 0.810539 0.285923 0.250009 656 1 0.431751 0.334265 0.225173 961 1 0.944557 0.385582 0.219104 1663 1 0.390078 0.422845 0.242658 1278 1 0.834741 0.480435 0.255226 1625 1 0.625853 0.49777 0.287354 1565 1 0.0231325 0.497806 0.288741 308 1 0.243109 0.0152248 0.217857 429 1 0.539087 0.193093 0.453917 1731 1 0.961139 0.177039 0.233183 1067 1 0.902473 0.156207 0.192321 1444 1 0.531295 0.213308 0.240334 420 1 0.659484 0.261624 0.279573 795 1 0.967468 0.303138 0.251023 1911 1 0.456715 0.257781 0.261755 1908 1 0.428882 0.232075 0.228442 284 1 0.610004 0.212047 0.222328 233 1 0.630136 0.271051 0.234201 1776 1 0.313519 0.280647 0.260787 1045 1 0.745881 0.347088 0.20146 65 1 0.651384 0.322809 0.220413 1588 1 0.385695 0.377652 0.247884 180 1 0.111579 0.363204 0.226333 374 1 0.90344 0.429227 0.310136 1802 1 0.0591418 0.496644 0.298891 939 1 0.977423 0.458053 0.236472 1934 1 0.601242 0.468221 0.260013 1843 1 0.0142032 0.486361 0.262241 639 1 0.959992 0.367939 0.488603 1607 1 0.459676 0.0753618 0.245527 1325 1 0.136884 0.0160822 0.271294 1413 1 0.0530421 0.0664224 0.269852 101 1 0.46993 0.093968 0.307824 1457 1 0.300267 0.0728629 0.2384 541 1 0.648382 0.187095 0.233511 304 1 0.746061 0.200698 0.270613 1282 1 0.0420961 0.209848 0.266563 1098 1 0.272867 0.33353 0.278279 1569 1 0.249842 0.266005 0.276093 155 1 0.3441 0.341474 0.355559 738 1 0.602656 0.308309 0.249102 1165 1 0.155234 0.4555 0.282947 106 1 0.719068 0.388016 0.476745 629 1 0.0513042 0.0521656 0.281193 189 1 0.809591 0.0520308 0.248653 1634 1 0.199022 0.278477 0.457759 1799 1 0.262764 0.0577808 0.261492 1314 1 0.225243 0.0675591 0.345187 1698 1 0.0193362 0.0589355 0.323058 1955 1 0.495345 0.162221 0.25211 1000 1 0.225562 0.094889 0.265502 202 1 0.702713 0.205551 0.321953 890 1 0.673002 0.249951 0.306235 1621 1 0.695956 0.18269 0.322332 1614 1 0.385102 0.245372 0.204133 682 1 0.343536 0.232653 0.211944 556 1 0.930692 0.243624 0.314952 1899 1 0.78855 0.404881 0.266612 1376 1 0.0656036 0.319309 0.317142 37 1 0.281564 0.346348 0.301221 1013 1 0.539981 0.30642 0.219201 866 1 0.856963 0.356852 0.31443 1654 1 0.161657 0.342534 0.244883 488 1 0.807958 0.441439 0.35295 275 1 0.967748 0.235591 0.471765 1119 1 0.335651 0.0293085 0.298705 1859 1 0.490631 0.0708598 0.349125 644 1 0.170433 0.0367052 0.33849 637 1 0.392317 0.0780215 0.344591 455 1 0.442121 0.169957 0.329038 780 1 0.307209 0.112147 0.345528 1636 1 0.0125402 0.215954 0.301805 807 1 0.628729 0.207388 0.319262 672 1 0.0446666 0.268173 0.385444 880 1 0.255887 0.273907 0.245042 837 1 0.952462 0.326857 0.321773 550 1 0.566148 0.359564 0.272687 625 1 0.227038 0.393371 0.291469 782 1 0.667273 0.357587 0.273798 1402 1 0.284741 0.356143 0.300959 567 1 0.548303 0.350701 0.300119 306 1 0.278647 0.0815968 0.490194 1992 1 0.447203 0.49327 0.3086 513 1 0.807333 0.0846851 0.36451 995 1 0.842886 0.0551195 0.288862 822 1 0.477806 0.145142 0.364092 1954 1 0.885311 0.0912082 0.324685 128 1 0.49072 0.132376 0.370329 1696 1 0.212085 0.0899819 0.311602 1501 1 0.497051 0.132518 0.258484 673 1 0.925702 0.161957 0.349638 379 1 0.608694 0.228783 0.263774 1187 1 0.35758 0.292254 0.281931 1466 1 0.434011 0.255215 0.364035 1362 1 0.0348851 0.360061 0.341446 119 1 0.692392 0.368923 0.347144 1396 1 0.118133 0.315484 0.353179 438 1 0.271495 0.341728 0.287417 1178 1 0.409298 0.481477 0.392726 802 1 0.0104724 0.363999 0.326459 1010 1 0.0312867 0.439715 0.301669 174 1 0.127232 0.443611 0.297392 1789 1 0.60628 0.436515 0.354196 755 1 0.680565 0.461127 0.326919 653 1 0.100128 0.0149652 0.31935 823 1 0.123122 0.439403 0.395864 703 1 0.692133 0.446838 0.00764651 2005 1 0.503417 0.079759 0.394252 692 1 0.924727 0.116855 0.349158 1474 1 0.382095 0.0554879 0.30157 1473 1 0.116988 0.149479 0.267465 195 1 0.0532753 0.124385 0.377433 303 1 0.698009 0.118761 0.369215 489 1 0.620016 0.174597 0.347055 1273 1 0.360149 0.304696 0.341987 614 1 0.45904 0.273934 0.298023 1142 1 0.707257 0.433286 0.368612 1968 1 0.0762374 0.422638 0.371184 2024 1 0.595845 0.401887 0.327133 825 1 0.158926 0.471641 0.308097 1355 1 0.422621 0.429696 0.386701 1505 1 0.902124 0.409979 0.361609 701 1 0.756495 0.43042 0.324639 522 1 0.244446 0.493017 0.385936 1085 1 0.00397712 0.243957 0.0100915 849 1 0.780719 0.499825 0.306093 1933 1 0.163327 0.45813 0.339604 154 1 0.610912 0.475505 0.33309 1249 1 0.677142 0.472151 0.383979 182 1 0.821078 0.387468 0.308495 1224 1 0.674704 0.424516 0.0201999 989 1 0.365116 0.436987 0.312789 827 1 0.92554 0.0291464 0.382117 1622 1 0.0425493 0.063427 0.357151 226 1 0.87507 0.113682 0.330456 609 1 0.60496 0.0969309 0.365947 636 1 0.488024 0.0816873 0.368774 1688 1 0.827321 0.132693 0.385626 244 1 0.932802 0.177749 0.34645 700 1 0.734339 0.196926 0.33669 1471 1 0.00824075 0.165298 0.408707 1225 1 0.23623 0.329226 0.383106 369 1 0.520687 0.402559 0.428827 217 1 0.963534 0.458984 0.343857 215 1 0.973177 0.426979 0.401239 361 1 0.262054 0.440201 0.391988 237 1 0.213556 0.402616 0.32208 136 1 0.672622 0.451658 0.376119 1171 1 0.408256 0.488537 0.343907 191 1 0.10946 0.383466 0.4926 942 1 0.618985 0.0248995 0.37228 261 1 0.942565 0.0372047 0.368939 17 1 0.449659 0.0248579 0.452929 674 1 0.328966 0.152987 0.370038 33 1 0.0126795 0.131711 0.346708 1004 1 0.426101 0.197211 0.390733 1708 1 0.355008 0.158369 0.351087 1266 1 0.346732 0.207573 0.440055 94 1 0.534204 0.190836 0.397426 999 1 0.317173 0.298916 0.337922 1570 1 0.445342 0.305299 0.431971 370 1 0.848065 0.260258 0.433738 366 1 0.887103 0.295041 0.404568 1301 1 0.562046 0.337117 0.436905 1228 1 0.109559 0.359763 0.384978 665 1 0.671516 0.491707 0.120321 1051 1 0.554942 0.472831 0.350075 1796 1 0.0139203 0.05243 0.148871 1261 1 0.260541 0.459395 0.433575 1436 1 0.63248 0.0588542 0.357292 1639 1 0.41798 0.134337 0.393806 595 1 0.0296908 0.111946 0.334755 1554 1 0.174199 0.144412 0.404666 1830 1 0.105284 0.15785 0.415077 421 1 0.481163 0.212927 0.427145 5 1 0.904019 0.0992161 0.381547 407 1 0.441137 0.153981 0.426347 1219 1 0.654264 0.165943 0.397262 1206 1 0.0183634 0.170033 0.411257 1863 1 0.6001 0.152201 0.407949 1194 1 0.958173 0.151576 0.433369 919 1 0.504587 0.17773 0.480632 1984 1 0.690752 0.186878 0.4519 122 1 0.766934 0.278862 0.426403 1925 1 0.075562 0.278561 0.406886 1172 1 0.601903 0.313431 0.40834 111 1 0.632896 0.336501 0.439601 722 1 0.872017 0.375718 0.417388 1340 1 0.517249 0.486323 0.399534 68 1 0.316541 0.49568 0.408324 247 1 0.550818 0.471675 0.339817 628 1 0.765755 0.471552 0.343133 1170 1 0.84377 0.116825 0.315682 1422 1 0.849856 0.0408336 0.393695 1009 1 0.904202 0.101642 0.481878 454 1 0.211273 0.123226 0.461971 1540 1 0.552894 0.266416 0.392204 1681 1 0.566482 0.260371 0.478322 20 1 0.302221 0.354703 0.478817 6 1 0.510876 0.348951 0.471292 1280 1 0.569194 0.400797 0.402796 695 1 0.0606545 0.369914 0.427988 828 1 0.278184 0.44272 0.425731 276 1 0.943269 0.469788 0.330621 1512 1 0.699357 0.384477 0.479816 1328 1 0.466914 0.0665775 0.496111 915 1 0.523287 0.0547341 0.381012 1952 1 0.0859465 0.103699 0.438731 549 1 0.129471 0.0816239 0.493896 1491 1 0.250148 0.11228 0.461348 1530 1 0.595168 0.025606 0.48046 1782 1 0.636999 0.140912 0.444225 1977 1 0.901011 0.162603 0.414186 187 1 0.113213 0.174867 0.421301 1496 1 0.55664 0.244787 0.382884 1551 1 0.686545 0.289177 0.410105 1760 1 0.151414 0.294414 0.462281 660 1 0.175347 0.321836 0.47006 1890 1 0.383376 0.302084 0.457983 1620 1 0.806898 0.267407 0.379714 511 1 0.781125 0.405171 0.402863 1970 1 0.222348 0.0154258 0.145969 236 1 0.499559 0.102071 0.071955 446 1 0.983108 0.00371977 0.46913 263 1 0.804861 0.0436412 0.447584 2047 1 0.0591849 0.0903062 0.432791 353 1 0.0763216 0.0369668 0.222805 620 1 0.0423538 0.047591 0.399118 2017 1 0.811707 0.0820688 0.487725 273 1 0.165466 0.118408 0.4419 602 1 0.154336 0.259021 0.439499 882 1 0.785642 0.304151 0.49297 2010 1 0.706865 0.360121 0.445939 316 1 0.0328537 0.388588 0.470014 885 1 0.166498 0.411345 0.378061 689 1 0.919623 0.00331722 0.430874 566 1 0.508431 0.409497 0.425955 1269 1 0.664605 0.43165 0.431214 1716 1 0.203867 0.486906 0.433984 490 1 0.724111 0.0310893 0.150691 1611 1 0.397115 0.45379 0.382176 1345 1 0.853288 0.438653 0.0334564 1935 1 0.267134 0.24496 0.486291 1039 1 0.00192149 0.133563 0.468537 630 1 0.190719 0.0541243 0.449285 91 1 0.312368 0.00170131 0.47647 1350 1 0.621336 0.00515455 0.187472 1542 1 0.871288 0.492692 0.487472 873 1 0.813329 0.242017 0.418551 221 1 0.00375024 0.295629 0.4373 387 1 0.572851 0.30514 0.498827 1106 1 0.0602788 0.35178 0.457833 1080 1 0.868635 0.249162 0.493932 1479 1 0.309214 0.266984 0.44331 279 1 0.34762 0.431212 0.474973 1675 1 0.856711 0.428091 0.498392 817 1 0.603207 0.429621 0.423472 547 1 0.0590445 0.487774 0.426876 991 1 0.937064 0.00700478 0.0813708 1040 1 0.563735 0.0104149 0.474437 857 1 0.763404 0.0513648 0.480607 1668 1 0.706165 0.167141 0.450335 1404 1 0.913642 0.0683644 0.47155 1978 1 0.228709 0.102518 0.490166 1583 1 0.208971 0.357532 0.470682 881 1 0.989556 0.133004 0.476097 633 1 0.39734 0.374942 0.454895 944 1 0.400021 0.464483 0.303428 1108 1 0.0860425 0.352961 0.000851142 204 1 0.775321 0.264753 0.499056 347 1 0.70322 0.000384842 0.371527 1560 1 0.824271 0.000681671 0.436172 1472 1 0.395224 0.0890998 0.520984 1115 1 0.23126 0.0206596 0.846462 492 1 0.0530797 0.126309 0.541124 1075 1 0.598569 0.149364 0.540168 1656 1 0.0240237 0.156792 0.556015 48 1 0.185352 0.155417 0.557757 1173 1 0.65926 0.217745 0.512608 1909 1 0.906073 0.443349 0.993693 1714 1 0.587052 0.257228 0.946835 1006 1 0.2837 0.217388 0.514507 1215 1 0.568489 0.305687 0.537033 925 1 0.0507807 0.477862 0.54336 724 1 0.946539 0.484573 0.693875 1415 1 0.944355 0.343102 0.561823 1236 1 0.433329 0.232045 0.550897 1154 1 0.358562 0.458871 0.555691 1813 1 0.395845 0.299928 0.980799 330 1 0.189865 0.466066 0.5574 574 1 0.671824 0.170147 0.51887 177 1 0.382074 0.00359471 0.555689 1242 1 0.159603 0.0837224 0.578005 485 1 0.346121 0.153287 0.56072 607 1 0.949857 0.0670665 0.536016 854 1 0.814277 0.367158 0.976189 1403 1 0.746519 0.197428 0.499803 707 1 0.877371 0.020234 0.681582 181 1 0.604841 0.401454 0.502912 262 1 0.840291 0.222935 0.533308 295 1 0.733316 0.2092 0.508785 1746 1 0.938711 0.252997 0.537868 1506 1 0.653191 0.17254 0.567889 1661 1 0.782579 0.222197 0.514375 1563 1 0.885288 0.273371 0.513774 18 1 0.610109 0.332825 0.549847 1241 1 0.642428 0.373317 0.537707 394 1 0.864508 0.294929 0.553737 663 1 0.55874 0.429998 0.563529 234 1 0.559024 0.425267 0.514496 1951 1 0.243602 0.0306997 0.552385 1419 1 0.80546 0.101525 0.500224 894 1 0.267191 0.0811798 0.510279 1956 1 0.0971975 0.121016 0.511538 1500 1 0.0449566 0.131806 0.573817 911 1 0.193557 0.141657 0.500719 781 1 0.396511 0.192741 0.551651 1026 1 0.0334738 0.222807 0.553519 1572 1 0.738618 0.194497 0.510267 1845 1 0.299875 0.252646 0.539618 67 1 0.201361 0.00494459 0.738889 1084 1 0.249108 0.275111 0.554872 669 1 0.459502 0.28875 0.506876 1771 1 0.687393 0.310688 0.544377 390 1 0.886592 0.32613 0.510245 1788 1 0.500683 0.29763 0.546386 194 1 0.55358 0.333592 0.543429 1777 1 0.973197 0.312726 0.591467 1141 1 0.944391 0.368702 0.597834 139 1 0.46475 0.39632 0.527806 1166 1 0.180858 0.451084 0.523237 1074 1 0.498042 0.148459 0.968738 772 1 0.97613 0.0392051 0.983935 1323 1 0.0797572 0.0575193 0.604037 812 1 0.361213 0.0339142 0.630405 62 1 0.475736 0.0959578 0.5286 388 1 0.428643 0.162462 0.570811 224 1 0.241868 0.209695 0.519432 1201 1 0.215568 0.163572 0.594665 45 1 0.131692 0.213954 0.609664 821 1 0.587242 0.324632 0.548284 1577 1 0.951972 0.377048 0.587205 1174 1 0.399017 0.352397 0.578301 70 1 0.573272 0.432598 0.565135 1665 1 0.00765017 0.478151 0.563405 843 1 0.414303 0.472701 0.529337 1783 1 0.94648 0.482577 0.589577 579 1 0.13566 0.0635409 0.55055 1726 1 0.219984 0.496807 0.698745 1508 1 0.910798 0.148853 0.590265 1480 1 0.128063 0.279938 0.597706 879 1 0.266344 0.251964 0.554717 1427 1 0.367371 0.16697 0.609784 655 1 0.0107228 0.271421 0.600731 1510 1 0.109031 0.29203 0.532464 459 1 0.0296956 0.298854 0.62141 1678 1 0.112915 0.281754 0.559612 1754 1 0.529547 0.31941 0.593452 529 1 0.103542 0.411781 0.499972 1630 1 0.0652989 0.421874 0.562608 923 1 0.495493 0.479927 0.503535 646 1 0.721492 0.472979 0.60481 514 1 0.741813 0.446738 0.633447 1533 1 0.299841 0.402597 0.573925 1343 1 0.854561 0.111267 0.513925 748 1 0.40039 0.024556 0.645095 1849 1 0.63473 0.0781047 0.638279 789 1 0.671066 0.0291938 0.606728 1819 1 0.747607 0.120371 0.578159 1643 1 0.741503 0.101088 0.592728 1424 1 0.0835628 0.17823 0.574983 362 1 0.0881381 0.234828 0.608438 1552 1 0.508137 0.239981 0.549087 66 1 0.0691818 0.240018 0.594043 188 1 0.0202008 0.267487 0.570032 339 1 0.13129 0.256285 0.55957 647 1 0.721334 0.379723 0.662658 163 1 0.379452 0.356322 0.601133 968 1 0.25969 0.464847 0.584621 1097 1 0.39998 0.474063 0.628011 466 1 0.397521 0.482363 0.604446 1971 1 0.439286 0.461465 0.602062 22 1 0.727082 0.351383 0.531658 1384 1 0.948937 0.496356 0.609515 687 1 0.354203 0.0739186 0.634946 1973 1 0.00387534 0.123946 0.533256 1528 1 0.634554 0.0321777 0.586902 1764 1 0.869797 0.116327 0.594039 2011 1 0.994238 0.16375 0.65141 365 1 0.491688 0.146759 0.585491 382 1 0.24051 0.333086 0.695227 2013 1 0.658391 0.280782 0.609628 1322 1 0.0795488 0.326089 0.602153 1281 1 0.207938 0.301864 0.624474 441 1 0.362607 0.292679 0.61061 657 1 0.115485 0.37326 0.652705 1823 1 0.102974 0.325167 0.604502 7 1 0.301761 0.310528 0.67405 1374 1 0.307751 0.395051 0.612353 1303 1 0.703344 0.377164 0.620203 1532 1 0.601552 0.420465 0.64517 510 1 0.830909 0.185378 0.983038 419 1 0.354596 0.0267036 0.633114 1368 1 0.676929 0.0422471 0.652197 486 1 0.388139 0.0973073 0.664334 1689 1 0.29979 0.14527 0.641644 12 1 0.125801 0.199611 0.672319 253 1 0.223137 0.231444 0.620284 580 1 0.156975 0.277944 0.625179 561 1 0.59446 0.199614 0.680217 1720 1 0.627396 0.336419 0.670074 267 1 0.619884 0.308809 0.604086 963 1 0.714811 0.374159 0.59779 969 1 0.633368 0.37186 0.626153 1025 1 0.814904 0.328133 0.639117 463 1 0.960642 0.431644 0.632925 1446 1 0.674123 0.414683 0.611379 2006 1 0.749112 0.441446 0.637914 44 1 0.0402307 0.439511 0.556205 1312 1 0.88915 0.491212 0.816285 1664 1 0.91773 0.0466477 0.615446 1686 1 0.998287 0.196032 0.513449 1922 1 0.532381 0.0752061 0.643561 1749 1 0.952778 0.180256 0.690773 148 1 0.0263385 0.117077 0.678958 1835 1 0.667639 0.197382 0.662703 723 1 0.749231 0.287896 0.631208 1096 1 0.316559 0.334611 0.69593 1918 1 0.766067 0.318944 0.692537 1640 1 0.242835 0.35328 0.628102 460 1 0.562353 0.280422 0.658483 1616 1 0.505901 0.37001 0.673617 1311 1 0.85264 0.460196 0.667893 21 1 0.384373 0.0471857 0.634127 274 1 0.710878 0.128929 0.7092 1888 1 0.353236 0.162714 0.756561 1784 1 0.238007 0.148961 0.700858 78 1 0.782053 0.250739 0.67381 1827 1 0.109854 0.216433 0.761521 761 1 0.123607 0.247473 0.703255 43 1 0.169413 0.253219 0.644666 359 1 0.11088 0.436851 0.66075 705 1 0.0263611 0.438123 0.685354 1986 1 0.234164 0.383553 0.678232 643 1 0.313155 0.425555 0.587367 360 1 0.385752 0.478628 0.739888 978 1 0.336679 0.0447035 0.61322 1417 1 0.663852 0.108226 0.659634 1807 1 0.766185 0.117865 0.736975 469 1 0.16204 0.0848958 0.708999 565 1 0.642553 0.0708858 0.720664 1878 1 0.532109 0.064802 0.739201 1755 1 0.699763 0.126102 0.60723 1949 1 0.273853 0.0900025 0.682298 1833 1 0.778239 0.158893 0.739065 1658 1 0.808604 0.221391 0.666267 1763 1 0.915635 0.16328 0.706485 1744 1 0.39256 0.186487 0.750458 1880 1 0.617899 0.192247 0.679179 1711 1 0.0680728 0.308856 0.708238 1615 1 0.500465 0.271134 0.678617 788 1 0.80011 0.427032 0.676685 1014 1 0.138048 0.0904783 0.75834 358 1 0.970187 0.0723853 0.753183 1767 1 0.638026 0.0972773 0.703087 1383 1 0.601681 0.103563 0.731346 886 1 0.923645 0.168624 0.70707 865 1 0.65725 0.160989 0.683009 1221 1 0.300468 0.24686 0.70571 255 1 0.982049 0.342815 0.742646 1450 1 0.0456918 0.33376 0.75197 686 1 0.878553 0.314194 0.700594 173 1 0.95506 0.342981 0.699429 1891 1 0.228795 0.345427 0.690111 1750 1 0.276974 0.324891 0.692117 499 1 0.436159 0.412121 0.721065 929 1 0.50972 0.403277 0.674784 863 1 0.962683 0.482324 0.754289 1057 1 0.385184 0.496674 0.900747 2012 1 0.774789 0.0229309 0.707879 726 1 0.293014 0.116528 0.72535 1331 1 0.875883 0.145976 0.820965 49 1 0.787786 0.157927 0.747655 979 1 0.745659 0.157267 0.718123 1049 1 0.537859 0.28141 0.712394 29 1 0.54088 0.252122 0.772577 752 1 0.742891 0.396377 0.798427 1717 1 0.35837 0.36906 0.696919 1773 1 0.328937 0.371716 0.73923 1078 1 0.723455 0.388377 0.685624 149 1 0.596246 0.416355 0.749737 1452 1 0.397721 0.446259 0.680841 142 1 0.551114 0.435375 0.706067 1367 1 0.440504 0.0557818 0.735355 1638 1 0.193787 0.00265559 0.80844 1543 1 0.304934 0.164405 0.701419 1489 1 0.83629 0.160978 0.723818 412 1 0.0677256 0.23213 0.80821 1884 1 0.876659 0.235986 0.787374 1087 1 0.861492 0.189827 0.736383 1691 1 0.388031 0.253797 0.737196 1705 1 0.204637 0.30177 0.723901 1302 1 0.058919 0.393282 0.756955 1834 1 0.433085 0.403128 0.748057 836 1 0.670639 0.410064 0.803947 1251 1 0.689744 0.373525 0.79114 1053 1 0.292815 0.479329 0.707007 1349 1 0.443181 0.428823 0.689184 1233 1 0.857546 0.0403774 0.763764 1285 1 0.775832 0.0707117 0.807814 1223 1 0.659808 0.137676 0.757793 2004 1 0.691624 0.16655 0.791501 404 1 0.883298 0.172 0.743858 1298 1 0.486477 0.197042 0.738886 118 1 0.927186 0.121128 0.776353 704 1 0.161652 0.147878 0.798914 1148 1 0.357373 0.122346 0.786524 826 1 0.548025 0.247691 0.754705 424 1 0.325631 0.173174 0.762384 1297 1 0.862009 0.228195 0.748819 955 1 0.52642 0.306462 0.725744 1421 1 0.273396 0.283784 0.812956 845 1 0.345005 0.316159 0.758487 1692 1 0.306398 0.34464 0.718611 1412 1 0.841473 0.281352 0.812985 688 1 0.382565 0.407587 0.832316 257 1 0.64158 0.378659 0.7518 1021 1 0.958893 0.443064 0.713523 998 1 0.28432 0.0494696 0.760862 1883 1 0.507117 0.0581035 0.776813 434 1 0.825286 0.0678557 0.856256 1019 1 0.982201 0.0558023 0.783803 1360 1 0.461786 0.064485 0.779986 1124 1 0.912974 0.23866 0.744941 1432 1 0.737214 0.158446 0.814172 428 1 0.747618 0.131998 0.79339 571 1 0.00606014 0.136472 0.755032 1163 1 0.0707211 0.276855 0.802695 1785 1 0.423839 0.173468 0.722471 605 1 0.685531 0.319882 0.809262 1730 1 0.785062 0.357536 0.817253 329 1 0.683914 0.346143 0.786625 141 1 0.117779 0.352444 0.787294 1138 1 0.207113 0.45902 0.795842 64 1 0.318719 0.405531 0.79363 1190 1 0.504408 0.464374 0.766578 666 1 0.617958 0.471845 0.768913 816 1 0.815447 0.00358833 0.797581 354 1 0.693111 0.00188415 0.866883 480 1 0.348787 0.0627954 0.810159 954 1 0.328068 0.122537 0.811632 462 1 0.406166 0.0591704 0.770802 615 1 0.516115 0.0517331 0.799393 1264 1 0.143051 0.111217 0.749476 1095 1 0.617568 0.0561624 0.789584 1960 1 0.149242 0.0987602 0.807636 696 1 0.13739 0.137415 0.800213 1904 1 0.5386 0.107061 0.758451 1055 1 0.382701 0.316091 0.846143 588 1 0.226571 0.336252 0.883682 481 1 0.322864 0.375481 0.841615 2033 1 0.513805 0.277709 0.851593 1751 1 0.738173 0.3146 0.862722 1082 1 0.777931 0.336647 0.86224 1320 1 0.0547123 0.403833 0.78634 1212 1 0.194247 0.441431 0.837637 1394 1 0.52561 0.391025 0.792338 1253 1 0.1016 0.400661 0.807828 1679 1 0.87514 0.191732 0.95006 1203 1 0.532581 0.0419648 0.860218 1761 1 0.202973 0.0930177 0.804193 1364 1 0.847863 0.0669445 0.790779 1286 1 0.497871 0.141694 0.772748 231 1 0.772431 0.141796 0.864238 594 1 0.082839 0.0726968 0.874716 1462 1 0.673589 0.204034 0.818957 734 1 0.604619 0.261312 0.819399 218 1 0.943453 0.246328 0.821213 349 1 0.689571 0.251993 0.837294 740 1 0.0357069 0.29483 0.814152 2 1 0.181848 0.214783 0.802816 1160 1 0.520404 0.283107 0.846714 1012 1 0.838497 0.39527 0.814386 193 1 0.927113 0.441192 0.827104 1405 1 0.770084 0.379038 0.819676 199 1 0.243244 0.474549 0.841742 1091 1 0.326206 0.444912 0.822819 117 1 0.427145 0.477128 0.767864 869 1 0.657262 0.471285 0.871626 774 1 0.175734 0.0398434 0.817843 307 1 0.0374496 0.00165129 0.865917 1930 1 0.811019 0.0915041 0.82743 491 1 0.138449 0.125674 0.809158 240 1 0.201293 0.0704028 0.891133 2035 1 0.137028 0.147197 0.855438 1315 1 0.596499 0.188319 0.842714 1126 1 0.933168 0.174143 0.827151 1759 1 0.193155 0.217541 0.839001 1576 1 0.981998 0.218715 0.730882 1522 1 0.191584 0.277013 0.790696 150 1 0.811941 0.289244 0.854799 766 1 0.866073 0.320705 0.876322 268 1 0.575524 0.271818 0.814981 858 1 0.367048 0.415452 0.873469 875 1 0.649753 0.407172 0.857015 713 1 0.0474515 0.327206 0.863107 993 1 0.854883 0.467172 0.855705 1090 1 0.391669 0.460978 0.861509 494 1 0.951799 0.495226 0.802904 1459 1 0.930408 0.475124 0.80234 2016 1 0.0313923 0.0949004 0.860059 1820 1 0.270399 0.0489122 0.882273 219 1 0.585923 0.0833261 0.860904 731 1 0.957189 0.173009 0.834794 1318 1 0.0666458 0.121661 0.867798 1292 1 0.347619 0.222514 0.844398 2023 1 0.355868 0.232661 0.865946 1618 1 0.682315 0.276019 0.838671 1598 1 0.877052 0.283093 0.832815 166 1 0.872296 0.282813 0.844112 1070 1 0.357879 0.400967 0.856488 850 1 0.631637 0.397239 0.84339 85 1 0.77955 0.375561 0.853078 1149 1 0.815174 0.38644 0.87823 1263 1 0.0604042 0.447647 0.786606 89 1 0.867526 0.497287 0.61285 611 1 0.110889 0.474387 0.998905 1277 1 0.393095 0.261548 0.919761 1250 1 0.0248942 0.14347 0.83565 229 1 0.109046 0.0168004 0.859327 1423 1 0.843792 0.0786516 0.908402 1245 1 0.457849 0.167763 0.80984 957 1 0.95769 0.166091 0.86582 1612 1 0.364965 0.178886 0.831147 1969 1 0.927105 0.201058 0.864756 1338 1 0.0128878 0.155809 0.950445 391 1 0.0655422 0.348461 0.87899 1262 1 0.3501 0.359235 0.920809 992 1 0.794998 0.430291 0.86686 936 1 0.77677 0.418305 0.877027 1291 1 0.181516 0.447837 0.8578 1016 1 0.107866 0.431776 0.843871 1861 1 0.199174 0.439144 0.909916 921 1 0.390505 0.487815 0.894978 1118 1 0.175371 0.00679835 0.919639 1735 1 0.367427 0.0367373 0.899039 1209 1 0.523923 0.0482717 0.860538 575 1 0.470618 0.0772287 0.893547 543 1 0.0371375 0.16083 0.514983 168 1 0.300239 0.101938 0.890819 1839 1 0.77928 0.06509 0.865886 779 1 0.982305 0.117727 0.947683 830 1 0.198073 0.257755 0.87265 1295 1 0.452596 0.184963 0.896559 1147 1 0.125474 0.223127 0.826176 301 1 0.065012 0.227305 0.817432 1858 1 0.118575 0.371653 0.962771 1114 1 0.519529 0.258524 0.88221 147 1 0.6878 0.342416 0.909972 1525 1 0.705209 0.324449 0.860484 384 1 0.495548 0.475398 0.877041 1874 1 0.888671 0.480919 0.866312 1556 1 0.0839025 0.453078 0.98723 1959 1 0.282504 0.0909301 0.912057 184 1 0.01955 0.0763507 0.951887 1494 1 0.242245 0.135836 0.909586 900 1 0.673491 0.169489 0.898567 82 1 0.557023 0.127104 0.895933 2027 1 0.118256 0.171405 0.975688 1695 1 0.465396 0.208151 0.84253 1317 1 0.406733 0.205813 0.909455 805 1 0.73979 0.179106 0.850989 1254 1 0.0638048 0.228052 0.829889 1440 1 0.818001 0.235904 0.885645 1914 1 0.813278 0.232691 0.907485 332 1 0.620476 0.27061 0.861681 1054 1 0.315269 0.369395 0.853267 1321 1 0.760971 0.429429 0.888653 819 1 0.855205 0.0562118 0.522308 1409 1 0.796651 0.47082 0.886941 846 1 0.668609 0.462689 0.893134 210 1 0.376333 0.0215519 0.896345 298 1 0.979844 0.0314785 0.962832 1220 1 0.0084299 0.0330193 0.95011 286 1 0.18025 0.0847839 0.902897 1381 1 0.943586 0.0737683 0.998169 1875 1 0.793403 0.149292 0.909344 327 1 0.76691 0.133427 1.00046 603 1 0.620475 0.111873 0.938771 1470 1 0.289297 0.180656 0.966727 1795 1 0.579615 0.160486 0.973593 917 1 0.227638 0.220874 0.966165 1642 1 0.172459 0.251844 0.944475 1742 1 0.231389 0.349537 0.959463 1974 1 0.36307 0.292493 0.988822 844 1 0.659462 0.327271 0.903201 536 1 0.370792 0.336123 0.986807 600 1 0.935759 0.439414 0.95392 1566 1 0.694625 0.454479 0.894844 254 1 0.953292 0.42228 0.893704 971 1 0.383656 0.452071 0.911601 269 1 0.530912 0.455109 0.920527 1781 1 0.794572 0.484069 0.885679 544 1 0.320816 0.215771 0.50855 28 1 0.755283 0.0986494 0.847906 1399 1 0.12414 0.096885 0.905306 4 1 0.0913445 0.100794 0.953014 1923 1 0.686518 0.178614 0.931502 198 1 0.669512 0.466364 0.907119 1844 1 0.0778343 0.17066 0.989959 281 1 0.112892 0.100962 0.976392 1573 1 0.656712 0.1857 0.987811 1928 1 0.21661 0.208669 0.942887 1947 1 0.532049 0.244891 0.880912 1537 1 0.0237481 0.289537 0.916428 2008 1 0.347227 0.359597 0.932134 246 1 0.887898 0.369418 0.963539 161 1 0.222572 0.478327 0.957448 1885 1 0.690692 0.462908 0.962323 1740 1 0.749101 0.416246 0.951685 205 1 0.657485 0.0422356 0.682672 1334 1 0.0682848 0.126931 0.986426 55 1 0.314874 0.144007 0.965206 1851 1 0.323299 0.150336 0.969216 319 1 0.667409 0.190082 0.996179 124 1 0.714389 0.152304 0.970246 105 1 0.895216 0.18939 0.899941 835 1 0.231581 0.24939 0.963717 2026 1 0.747116 0.224154 0.956871 606 1 0.377104 0.00743532 0.603924 1378 1 0.0103188 0.470162 0.511323 487 1 0.74799 0.23637 0.981229 528 1 0.501112 0.157858 0.93009 212 1 0.503047 0.188583 0.925129 380 1 0.478296 0.254683 0.917575 1931 1 0.921356 0.26401 0.983685 1981 1 0.255422 0.279754 0.968289 870 1 0.296332 0.276499 0.916412 1889 1 0.80298 0.314361 0.995782 1272 1 0.492646 0.389495 0.919532 2031 1 0.655287 0.364214 0.971678 1490 1 0.362476 0.419972 0.983014 1449 1 0.266232 0.285658 0.996337 36 1 0.141739 0.453298 0.945174 300 1 0.530163 0.34791 0.540058 1650 1 0.757642 0.458928 0.951053 1574 1 0.553731 0.458701 0.845144 1335 1 0.879836 0.00241193 0.993411 616 1 0.052704 0.412583 0.944955 751 1 0.52665 0.0603334 0.966062 884 1 0.707902 0.083245 0.984067 883 1 0.715171 0.112825 0.951406 1670 1 0.636576 0.0624737 0.948 127 1 0.438952 0.367094 0.966319 1309 1 0.161757 0.175761 0.933629 386 1 0.724365 0.27589 0.977226 1818 1 0.754376 0.418602 0.996559 1387 1 0.388187 0.361812 0.981973 733 1 0.227964 0.458572 0.965226 397 1 0.265549 0.010754 0.719543 1856 1 0.808801 0.478215 0.91263 1539 1 0.60641 0.0217654 0.950729 1836 1 0.400423 0.410215 0.536095 618 1 0.435464 0.064036 0.99552 596 1 0.536255 0.0206915 0.747435 1 1 0.144321 0.119029 0.514512 985 1 0.273965 0.0074065 0.709364 599 1 0.120021 0.0102063 0.762745 587 1 0.0330247 0.456528 0.505366 1538 1 0.28024 0.0881139 0.50211 337 1 0.182583 0.498556 0.554306 526 1 0.748411 0.499096 0.58255 592 1 0.79678 0.517753 0.0358284 134 1 0.475847 0.664105 0.0292695 1477 1 0.721623 0.616735 0.0563391 1624 1 0.315394 0.54696 0.0236912 417 1 0.437338 0.597448 0.0636042 959 1 0.64119 0.560532 0.0408538 947 1 0.712751 0.643474 0.0114388 1430 1 0.91037 0.963079 0.455605 1997 1 0.983545 0.804555 0.0355959 1191 1 0.0932502 0.841529 0.0156747 1721 1 0.898971 0.969135 0.358457 1043 1 0.221329 0.94686 0.00346626 1030 1 0.593799 0.876769 0.0310902 1205 1 0.710557 0.938364 0.094389 1676 1 0.136229 0.985907 0.0321437 520 1 0.566653 0.90912 0.00842749 331 1 0.218383 0.951194 0.0141089 1036 1 0.823914 0.520348 0.0238586 757 1 0.263706 0.513988 0.317997 764 1 0.521935 0.513717 0.0475227 868 1 0.798265 0.59818 0.0466383 1401 1 0.133269 0.717866 0.0640003 1887 1 0.842867 0.693395 0.0508167 949 1 0.105304 0.752479 0.0185283 806 1 0.801351 0.764272 0.0392147 403 1 0.891059 0.875453 0.494981 1994 1 0.408285 0.796156 0.046934 651 1 0.600289 0.702412 0.0163001 24 1 0.637059 0.992036 0.444026 1348 1 0.160096 0.502396 0.344268 144 1 0.708475 0.86243 0.0815439 512 1 0.105854 0.954871 0.00864398 791 1 0.954508 0.993014 0.0146732 1814 1 0.449602 0.915715 0.0508957 1319 1 0.148445 0.59936 0.0370768 1897 1 0.0903114 0.55625 0.126828 1894 1 0.276851 0.51974 0.00222087 133 1 0.0219379 0.572261 0.0581158 170 1 0.840137 0.616852 0.032978 1447 1 0.411229 0.587266 0.0714946 838 1 0.306475 0.846405 0.0404288 706 1 0.779727 0.995035 0.252847 2000 1 0.524748 0.675065 0.0906571 1168 1 0.195305 0.615128 0.0374455 1586 1 0.564351 0.704185 0.119807 1428 1 0.23021 0.720789 0.00870688 1229 1 0.535579 0.642911 0.0471412 664 1 0.23457 0.784092 0.0855246 162 1 0.551705 0.797948 0.0897682 467 1 0.850788 0.793295 0.00998945 1022 1 0.497163 0.784198 0.0366759 1545 1 0.299186 0.886919 0.0883675 1979 1 0.0884077 0.999116 0.0822097 848 1 0.602756 0.580777 0.492916 867 1 0.158948 0.510837 0.266797 960 1 0.0265181 0.509378 0.0804492 74 1 0.327194 0.524081 0.0661472 1727 1 0.274915 0.619149 0.0287285 1507 1 0.424217 0.63814 0.127167 1445 1 0.0926804 0.612455 0.0839954 792 1 0.310106 0.683473 0.0891106 258 1 0.509035 0.68571 0.00309222 1001 1 0.141037 0.637844 0.105156 702 1 0.490599 0.616542 0.00751687 1903 1 0.640447 0.638315 0.0192468 447 1 0.62122 0.707489 0.0578933 1780 1 0.651418 0.759154 0.113978 855 1 0.108196 0.66518 0.0651771 832 1 0.571561 0.823986 0.0931905 1627 1 0.0783888 0.808889 0.113742 1299 1 0.520902 0.898797 0.078421 765 1 0.594744 0.841603 0.0579392 1213 1 0.592064 0.850594 0.0507028 200 1 0.963754 0.853029 0.0862988 988 1 0.334707 0.965637 0.0625879 63 1 0.313911 0.937608 0.00413176 228 1 0.603999 0.963711 0.0204002 1975 1 0.908688 0.993373 0.00275075 1416 1 0.0400256 0.500472 0.194249 694 1 0.809044 0.594413 0.0879545 313 1 0.466055 0.6538 0.043503 552 1 0.720054 0.578243 0.0549571 2042 1 0.851463 0.595491 0.0895824 211 1 0.950991 0.640882 0.0736096 363 1 0.636164 0.621127 0.0628686 79 1 0.651691 0.616578 0.112325 1143 1 0.897994 0.624283 0.103208 810 1 0.794438 0.630472 0.118232 1791 1 0.151016 0.747839 0.0725759 1232 1 0.558161 0.692845 0.0736876 725 1 0.0156873 0.783898 0.0490425 729 1 0.142142 0.772687 0.0832961 1151 1 0.644325 0.775074 0.106726 401 1 0.879386 0.864231 0.115916 1482 1 0.803709 0.847281 0.0870825 962 1 0.421593 0.879699 0.0206225 1410 1 0.617464 0.910872 0.0898326 1738 1 0.750182 0.979136 0.0998412 1739 1 0.33742 0.974917 0.14359 1330 1 0.303369 0.510114 0.151656 1329 1 0.676755 0.958625 0.359762 1564 1 0.895029 0.986546 0.130272 1779 1 0.566682 0.5321 0.153129 1852 1 0.527251 0.711675 0.118592 270 1 0.201148 0.73618 0.0843775 1850 1 0.812934 0.537534 0.498448 2014 1 0.0688471 0.71969 0.0956893 749 1 0.274917 0.98789 0.046474 1133 1 0.578176 0.879254 0.0956322 371 1 0.0788379 0.924597 0.0512883 1037 1 0.817536 0.940141 0.167132 35 1 0.692431 0.509261 0.108342 568 1 0.111364 0.910993 0.101969 601 1 0.543439 0.518385 0.295848 1633 1 0.0352789 0.516719 0.108487 1762 1 0.307015 0.511332 0.00309961 2038 1 0.666616 0.564876 0.0726185 75 1 0.494403 0.590749 0.147267 1398 1 0.752366 0.674309 0.10785 698 1 0.814318 0.703805 0.115773 1649 1 0.425746 0.723906 0.144074 1854 1 0.689567 0.826738 0.100773 143 1 0.938619 0.732252 0.119937 548 1 0.958125 0.811493 0.084463 1519 1 0.0162931 0.864093 0.145519 1179 1 0.796726 0.862803 0.20839 1164 1 0.538453 0.945923 0.0799476 450 1 0.656734 0.950175 0.0848056 1712 1 0.807631 0.887461 0.153567 797 1 0.887163 0.92143 0.0548625 1817 1 0.594057 0.945103 0.144659 1938 1 0.57252 0.824214 0.0160693 413 1 0.0440519 0.969013 0.144076 649 1 0.0448916 0.878581 0.491337 1372 1 0.0487868 0.581697 0.0967836 108 1 0.786658 0.535204 0.157034 1327 1 0.785643 0.617346 0.106635 27 1 0.0123233 0.566613 0.14821 1003 1 0.835174 0.712383 0.112135 1183 1 0.908973 0.737618 0.151906 1632 1 0.0741104 0.796584 0.125751 214 1 0.87408 0.737682 0.167999 1359 1 0.223292 0.784843 0.15957 57 1 0.243134 0.860787 0.124551 984 1 0.194214 0.837669 0.142686 1497 1 0.844638 0.867295 0.15913 809 1 0.250708 0.959276 0.120323 1603 1 0.967205 0.913658 0.00821566 1518 1 0.190135 0.970013 0.113194 1134 1 0.243433 0.938729 0.402886 935 1 0.124538 0.518302 0.126155 1920 1 0.336717 0.628555 0.15555 1476 1 0.739437 0.688747 0.212457 395 1 0.233745 0.658381 0.100214 115 1 0.585896 0.664113 0.188278 500 1 0.92846 0.742779 0.126075 1924 1 0.329681 0.699136 0.214954 730 1 0.267016 0.821462 0.0902873 1521 1 0.421431 0.78783 0.162952 623 1 0.808365 0.871548 0.219926 753 1 0.408943 0.818654 0.143443 1105 1 0.741495 0.877295 0.17761 448 1 0.471774 0.874111 0.197289 88 1 0.710461 0.881022 0.182636 259 1 0.517012 0.976771 0.117338 1443 1 0.484918 0.960683 0.157342 140 1 0.877776 0.979975 0.112019 1354 1 0.103497 0.574453 0.464654 1433 1 0.310651 0.562816 0.201759 1936 1 0.947068 0.55037 0.175095 323 1 0.440871 0.565795 0.171845 888 1 0.860901 0.631932 0.069166 824 1 0.450496 0.653742 0.112864 81 1 0.536722 0.633908 0.222876 241 1 0.142039 0.730422 0.181101 86 1 0.00752306 0.681303 0.170866 383 1 0.643648 0.726183 0.170531 84 1 0.870519 0.715234 0.290741 1756 1 0.315793 0.701445 0.212101 1702 1 0.336996 0.781746 0.146915 309 1 0.317541 0.873483 0.210298 227 1 0.500836 0.921798 0.154426 389 1 0.746747 0.908023 0.155871 1060 1 0.898716 0.899882 0.138879 769 1 0.255087 0.891338 0.126886 1853 1 0.430737 0.859017 0.204719 1442 1 0.462372 0.985478 0.156793 1993 1 0.588416 0.936485 0.112749 1300 1 0.76936 0.974844 0.135883 1347 1 0.919775 0.974402 0.26398 1967 1 0.871759 0.53685 0.208856 745 1 0.670451 0.524213 0.448239 1662 1 0.889648 0.567777 0.210864 1389 1 0.960887 0.609158 0.169437 1800 1 0.852001 0.608811 0.24003 478 1 0.529006 0.647907 0.159076 52 1 0.0196062 0.705474 0.239105 1369 1 0.0584353 0.678157 0.188262 451 1 0.393865 0.761402 0.118176 1361 1 0.992637 0.759326 0.170931 948 1 0.778901 0.742443 0.193416 1732 1 0.759765 0.710957 0.201857 1058 1 0.972119 0.884551 0.244717 1541 1 0.403891 0.90552 0.186634 1184 1 0.612816 0.880726 0.259311 1687 1 0.968688 0.896142 0.155641 1356 1 0.992767 0.951826 0.226905 1113 1 0.976189 0.952196 0.146861 1723 1 0.417133 0.95581 0.152176 243 1 0.768354 0.923997 0.182776 483 1 0.338941 0.511914 0.193084 416 1 0.305762 0.547147 0.235579 1862 1 0.0521479 0.554766 0.208838 612 1 0.144224 0.633269 0.268451 1038 1 0.691916 0.560756 0.219567 479 1 0.0131311 0.621828 0.264977 1683 1 0.320807 0.728817 0.154458 950 1 0.584631 0.650001 0.24944 423 1 0.438994 0.629068 0.208746 1504 1 0.208486 0.737265 0.199145 1066 1 0.420523 0.717487 0.224288 1864 1 0.959086 0.678284 0.202062 456 1 0.159908 0.749157 0.23671 1406 1 0.677877 0.728101 0.253464 1647 1 0.14973 0.756749 0.21665 294 1 0.222027 0.709784 0.192094 225 1 0.231143 0.783578 0.204564 477 1 0.881477 0.799845 0.178833 1152 1 0.421746 0.774406 0.244705 1821 1 0.21435 0.848652 0.237085 42 1 0.406788 0.847475 0.189267 1146 1 0.946824 0.885449 0.258924 1483 1 0.783141 0.906002 0.214318 1734 1 0.393482 0.899414 0.0284592 598 1 0.769957 0.566624 0.194241 1316 1 0.417693 0.649011 0.237531 61 1 0.622065 0.676977 0.208959 201 1 0.701408 0.727428 0.224588 1035 1 0.446158 0.796567 0.220484 344 1 0.509335 0.753754 0.1825 1832 1 0.270281 0.802074 0.219211 1156 1 0.397836 0.840799 0.261844 777 1 0.0420229 0.895567 0.220198 736 1 0.0866277 0.907789 0.245453 1581 1 0.936505 0.951229 0.165135 19 1 0.810327 0.500543 0.244987 1811 1 0.342934 0.921429 0.246051 525 1 0.68751 0.947862 0.317568 2030 1 0.760494 0.966036 0.221008 1407 1 0.049493 0.547055 0.199742 476 1 0.329593 0.58336 0.258135 744 1 0.920777 0.613338 0.27795 1484 1 0.637111 0.56725 0.19401 793 1 0.600731 0.749135 0.234413 928 1 0.466177 0.700629 0.295981 1942 1 0.578127 0.737382 0.260838 1238 1 0.63427 0.783331 0.232082 1059 1 0.552567 0.790339 0.223882 192 1 0.642174 0.794298 0.223566 840 1 0.795816 0.786032 0.254304 1860 1 0.707757 0.862712 0.197954 112 1 0.244022 0.914857 0.21805 223 1 0.754301 0.924204 0.249472 1145 1 0.965831 0.89848 0.239132 98 1 0.637103 0.984807 0.246984 1768 1 0.237382 0.513729 0.294631 1034 1 0.976849 0.543505 0.242872 171 1 0.505179 0.549447 0.242455 345 1 0.343749 0.643929 0.181092 589 1 0.807656 0.632228 0.268229 90 1 0.575612 0.647402 0.274316 1867 1 0.484778 0.763844 0.20947 1585 1 0.754739 0.742898 0.247931 1046 1 0.962646 0.744935 0.181035 1438 1 0.427576 0.784462 0.280238 1868 1 0.574355 0.861579 0.300598 400 1 0.621411 0.907294 0.308451 578 1 0.787684 0.899349 0.276751 1503 1 0.742588 0.503039 0.313264 1531 1 0.039798 0.598547 0.303723 1047 1 0.715995 0.550731 0.327655 624 1 0.34224 0.555475 0.285078 333 1 0.428009 0.582198 0.298913 1828 1 0.188375 0.572303 0.314736 1102 1 0.898496 0.640741 0.304987 1940 1 0.158216 0.670643 0.297276 507 1 0.0257878 0.736985 0.283123 773 1 0.459328 0.684865 0.254769 213 1 0.489057 0.788088 0.295904 1007 1 0.89928 0.747603 0.33699 878 1 0.0728396 0.804976 0.330469 1558 1 0.177946 0.799081 0.268812 1707 1 0.15628 0.85692 0.264807 1617 1 0.963481 0.801245 0.223027 586 1 0.553271 0.828672 0.231282 732 1 0.979658 0.814775 0.252796 461 1 0.25487 0.855347 0.267903 1083 1 0.676471 0.898987 0.251914 377 1 0.300533 0.925845 0.262473 410 1 0.53678 0.936253 0.258676 1770 1 0.168317 0.571248 0.435386 743 1 0.177261 0.948928 0.137193 1099 1 0.854885 0.617293 0.299391 1351 1 0.218493 0.649495 0.305756 527 1 0.644646 0.620998 0.330948 495 1 0.0265606 0.65074 0.327137 1065 1 0.46385 0.669453 0.354898 1882 1 0.182444 0.646942 0.267073 1111 1 0.768646 0.665615 0.322145 1553 1 0.998208 0.680557 0.37796 677 1 0.0645875 0.657911 0.244094 422 1 0.780365 0.706152 0.341771 851 1 0.126278 0.770365 0.316534 1062 1 0.00600341 0.805511 0.255197 93 1 0.841473 0.758786 0.273224 1210 1 0.952894 0.821879 0.290223 1380 1 0.504265 0.86394 0.27838 1879 1 0.639051 0.874535 0.309214 1268 1 0.402334 0.96647 0.283144 1017 1 0.933579 0.952853 0.318178 1798 1 0.831017 0.949098 0.25927 1825 1 0.938907 0.996671 0.297157 334 1 0.0937953 0.769732 0.0148025 521 1 0.131893 0.543744 0.279463 1652 1 0.326385 0.549647 0.278025 871 1 0.217052 0.562258 0.30316 559 1 0.339223 0.513847 0.286026 811 1 0.162731 0.610417 0.333652 889 1 0.846056 0.659825 0.346944 2046 1 0.0351598 0.641258 0.306228 683 1 0.553101 0.65301 0.390153 2021 1 0.735667 0.675546 0.316804 619 1 0.542633 0.663336 0.398274 1808 1 0.390483 0.749073 0.240811 897 1 0.517979 0.716814 0.289753 1690 1 0.816374 0.753278 0.329581 1185 1 0.387634 0.788361 0.346172 100 1 0.545859 0.818734 0.398262 1869 1 0.671185 0.871189 0.269828 1728 1 0.612908 0.849244 0.282634 608 1 0.142994 0.926826 0.269238 1706 1 0.244805 0.951549 0.321044 1042 1 0.244103 0.851673 0.321493 280 1 0.699532 0.911145 0.31494 2032 1 0.125652 0.889106 0.321814 172 1 0.330713 0.89303 0.325976 2036 1 0.628715 0.948563 0.3809 914 1 0.589612 0.677182 0.00177594 1239 1 0.999233 0.500659 0.325828 399 1 0.718763 0.539667 0.344522 1527 1 0.167931 0.552195 0.29574 976 1 0.155282 0.587303 0.361285 1602 1 0.0770377 0.597485 0.35198 693 1 0.60503 0.614148 0.343663 310 1 0.359972 0.551208 0.335294 983 1 0.944589 0.654565 0.37378 1929 1 0.0507322 0.707957 0.351172 426 1 0.926729 0.76253 0.322827 409 1 0.0532694 0.784447 0.338387 1950 1 0.305672 0.806015 0.379375 545 1 0.118514 0.845968 0.339703 414 1 0.0986789 0.861882 0.407064 906 1 0.606358 0.906725 0.383515 1987 1 0.84273 0.836561 0.281226 277 1 0.670579 0.942335 0.329133 58 1 0.713829 0.918423 0.317116 1498 1 0.952511 0.92806 0.322998 546 1 0.98849 0.987163 0.098109 1140 1 0.495742 0.971455 0.288688 1207 1 0.850839 0.569591 0.361032 762 1 0.324525 0.571304 0.383894 1753 1 0.197351 0.571363 0.325097 484 1 0.464611 0.640468 0.368863 1252 1 0.37268 0.658941 0.443457 1248 1 0.983258 0.731032 0.347279 760 1 0.199713 0.695423 0.427415 956 1 0.798783 0.753915 0.350085 220 1 0.623872 0.751818 0.39352 1516 1 0.85803 0.700087 0.340733 1912 1 0.766234 0.783355 0.427413 206 1 0.997238 0.845619 0.435591 14 1 0.843425 0.804328 0.316816 1076 1 0.0532604 0.898122 0.26652 302 1 0.0866804 0.901262 0.345521 1682 1 0.494209 0.869849 0.339049 1571 1 0.830259 0.869435 0.360079 1129 1 0.80595 0.968346 0.36073 1579 1 0.672422 0.758502 0.101044 1365 1 0.470965 0.523647 0.465794 1991 1 0.0173608 0.528457 0.337032 1366 1 0.0796755 0.589443 0.381385 504 1 0.78067 0.549589 0.382687 252 1 0.375452 0.7197 0.437803 973 1 0.681278 0.680531 0.385818 1256 1 0.324073 0.779968 0.371302 785 1 0.295464 0.722737 0.336949 1116 1 0.269916 0.707426 0.317169 1214 1 0.90632 0.763049 0.449504 1226 1 0.340033 0.862798 0.354915 946 1 0.358311 0.760688 0.395265 767 1 0.52736 0.757137 0.371881 1456 1 0.694956 0.838173 0.344731 1306 1 0.0737477 0.797423 0.400048 405 1 0.745485 0.80975 0.288962 1044 1 0.680097 0.894522 0.361959 1061 1 0.678099 0.886706 0.355954 249 1 0.813515 0.921226 0.419574 378 1 0.562597 0.941488 0.370323 1953 1 0.278854 0.89921 0.355192 839 1 0.916825 0.996949 0.41625 1562 1 0.11876 0.957746 0.422027 152 1 0.321902 0.982528 0.397118 1363 1 0.596656 0.904739 0.36501 847 1 0.501953 0.601351 0.453879 1587 1 0.716641 0.501585 0.415661 351 1 0.270201 0.574986 0.34878 1048 1 0.225794 0.568329 0.368332 158 1 0.748488 0.622425 0.38523 13 1 0.861104 0.632498 0.361454 251 1 0.280683 0.61243 0.374966 800 1 0.883618 0.733213 0.381799 501 1 0.865547 0.685594 0.420886 1492 1 0.404991 0.768365 0.430444 1202 1 0.937825 0.725751 0.354599 125 1 0.156903 0.679295 0.299948 1481 1 0.149507 0.750117 0.391917 2048 1 0.358991 0.889972 0.448622 1653 1 0.24476 0.924621 0.393516 918 1 0.949304 0.980797 0.434896 1837 1 0.565013 0.998521 0.329763 1493 1 0.589396 0.54144 0.439522 296 1 0.0576989 0.575497 0.399466 474 1 0.59302 0.644805 0.369512 1101 1 0.924946 0.683703 0.368234 1155 1 0.496932 0.674052 0.406215 1693 1 0.7321 0.684389 0.449426 1631 1 0.389552 0.734861 0.435985 1018 1 0.362299 0.751485 0.408422 1943 1 0.327546 0.812067 0.409406 1524 1 0.465378 0.776345 0.453727 2029 1 0.589667 0.763222 0.380043 1167 1 0.596413 0.794356 0.442159 209 1 0.834717 0.853065 0.39472 582 1 0.950722 0.901297 0.415168 1793 1 0.343679 0.935449 0.480998 2001 1 0.535985 0.915848 0.391113 114 1 0.601875 0.868004 0.429274 197 1 0.740532 0.953592 0.48674 2009 1 0.805545 0.874982 0.445025 710 1 0.497185 0.520909 0.42287 554 1 0.149707 0.504674 0.0229347 804 1 0.630051 0.593414 0.403734 1523 1 0.482667 0.609147 0.458587 235 1 0.804846 0.604573 0.404184 1029 1 0.519618 0.639327 0.456512 1153 1 0.760965 0.573642 0.40525 178 1 0.00539758 0.636899 0.451167 1733 1 0.0166684 0.592124 0.447871 1033 1 0.50294 0.99499 0.324369 314 1 0.591344 0.608654 0.444951 1177 1 0.645306 0.685629 0.469809 356 1 0.771521 0.631463 0.447723 901 1 0.765737 0.679745 0.461323 290 1 0.969167 0.695793 0.408671 1353 1 0.0780074 0.7085 0.376292 1247 1 0.586639 0.808091 0.465057 99 1 0.344124 0.79414 0.375334 132 1 0.9181 0.85313 0.440631 1081 1 0.988444 0.846153 0.467686 318 1 0.180345 0.882529 0.429683 1965 1 0.564096 0.904127 0.403925 131 1 0.0454626 0.977787 0.443868 375 1 0.162821 0.564087 0.0229281 667 1 0.0176878 0.965413 0.0600329 1557 1 0.671812 0.510075 0.49471 1829 1 0.790651 0.565464 0.453289 1103 1 0.362858 0.554416 0.441073 1041 1 0.696682 0.568429 0.46064 1259 1 0.0694695 0.682934 0.482411 509 1 0.456732 0.733557 0.457815 783 1 0.115139 0.730791 0.464772 1648 1 0.589102 0.719355 0.443395 631 1 0.0893987 0.760981 0.473997 685 1 0.527793 0.79067 0.482798 1871 1 0.192189 0.795204 0.461947 1715 1 0.219987 0.945753 0.47115 1629 1 0.936916 0.991013 0.255716 415 1 0.335101 0.99186 0.0229923 1550 1 0.816234 0.930253 0.478483 1136 1 0.183565 0.99083 0.00215081 110 1 0.444127 0.607117 0.423412 1536 1 0.0728685 0.649715 0.472227 1907 1 0.428954 0.580886 0.491867 2022 1 0.669806 0.640311 0.0294033 1437 1 0.195274 0.67335 0.422679 1289 1 0.394003 0.734071 0.444834 1595 1 0.286406 0.513992 0.00840832 1150 1 0.611723 0.690181 0.464502 1582 1 0.572436 0.799368 0.471475 1902 1 0.678886 0.923821 0.0134686 530 1 0.945135 0.801524 0.494238 1792 1 0.249332 0.853472 0.443063 2043 1 0.509991 0.799053 0.410394 787 1 0.352154 0.545205 0.301913 373 1 0.216969 0.631296 0.0141682 153 1 0.532272 0.89392 0.455995 9 1 0.173536 0.894694 0.493997 570 1 0.0130619 0.948646 0.485674 185 1 0.745219 0.538938 0.228186 872 1 0.0659002 0.5027 0.425374 564 1 0.0192828 0.990718 0.471803 1892 1 0.464439 0.695719 0.476418 933 1 0.618609 0.804297 0.0151649 1637 1 0.344982 0.593961 0.489235 1806 1 0.957185 0.522396 0.378544 938 1 0.683547 0.735829 0.498799 1231 1 0.0434607 0.74136 0.48824 1962 1 0.845402 0.656783 0.467242 727 1 0.188526 0.744351 0.480762 902 1 0.832065 0.834249 0.49681 1626 1 0.678023 0.732663 0.420996 1196 1 0.188146 0.789249 0.446117 1628 1 0.614897 0.550687 0.323155 324 1 0.587427 0.896935 0.492162 2025 1 0.0833013 0.617276 0.471612 910 1 0.73466 0.584536 0.0307051 621 1 0.521473 0.692138 0.0197689 1217 1 0.406684 0.965242 0.0654253 1137 1 0.818942 0.687063 0.0039072 266 1 0.454036 0.511197 0.519826 1801 1 0.94272 0.522715 0.551992 1208 1 0.986626 0.631829 0.534981 573 1 0.458533 0.565678 0.837042 1547 1 0.327937 0.745092 0.978063 814 1 0.258522 0.608303 0.544685 60 1 0.941797 0.67807 0.51225 372 1 0.0294424 0.8973 0.976792 1758 1 0.323268 0.783625 0.525824 1227 1 0.855735 0.75429 0.923819 852 1 0.741313 0.831483 0.53172 1395 1 0.327075 0.807967 0.552837 680 1 0.739994 0.953513 0.958367 534 1 0.654495 0.9798 0.565303 338 1 0.387286 0.553494 0.84199 1534 1 0.456739 0.53556 0.996578 1379 1 0.823579 0.578283 0.55258 794 1 0.24595 0.600329 0.551106 2019 1 0.567815 0.547789 0.526602 368 1 0.763911 0.973731 0.505113 1260 1 0.513093 0.990842 0.628072 904 1 0.960778 0.612702 0.533123 1736 1 0.822178 0.985089 0.518927 1766 1 0.272146 0.623864 0.508614 1772 1 0.593021 0.639554 0.544781 2018 1 0.16245 0.68102 0.549655 1391 1 0.564489 0.681934 0.500986 874 1 0.85148 0.67467 0.569885 1790 1 0.591363 0.728097 0.581008 1495 1 0.493535 0.739553 0.558282 1517 1 0.816703 0.79238 0.515671 877 1 0.00190284 0.839698 0.570283 1592 1 0.468106 0.823212 0.578989 113 1 0.628725 0.825806 0.507787 31 1 0.621294 0.810955 0.565994 282 1 0.699335 0.919632 0.605586 135 1 0.886689 0.860442 0.516797 1608 1 0.639124 0.902618 0.531026 497 1 0.0474766 0.544185 0.500744 1964 1 0.111973 0.90146 0.990412 661 1 0.89567 0.57577 0.565677 159 1 0.0114446 0.545727 0.616404 763 1 0.687372 0.612431 0.531022 289 1 0.265307 0.615909 0.510205 737 1 0.759916 0.602937 0.525508 617 1 0.608272 0.730833 0.533415 53 1 0.974117 0.685049 0.517575 1002 1 0.0845064 0.768076 0.510676 930 1 0.572054 0.739961 0.560676 1451 1 0.186012 0.855438 0.583221 750 1 0.519185 0.825913 0.570367 160 1 0.121189 0.847634 0.585517 1619 1 0.828733 0.858998 0.537017 856 1 0.14868 0.90986 0.57746 1240 1 0.180353 0.863809 0.595086 396 1 0.807051 0.93147 0.502719 473 1 0.554424 0.90801 0.568798 1290 1 0.933931 0.967639 0.530853 758 1 0.68276 0.525814 0.577179 260 1 0.097226 0.651076 0.583395 916 1 0.294798 0.499917 0.569777 922 1 0.102803 0.643147 0.562019 47 1 0.954563 0.640949 0.514693 1077 1 0.079088 0.652569 0.554042 1244 1 0.031891 0.663846 0.613874 123 1 0.458821 0.656231 0.591804 841 1 0.850438 0.728959 0.544903 784 1 0.625708 0.729201 0.594234 1189 1 0.702157 0.776856 0.560001 1822 1 0.805938 0.737712 0.518276 164 1 0.841876 0.748963 0.609782 1414 1 0.29677 0.728445 0.625584 1107 1 0.2959 0.761035 0.538459 1674 1 0.813649 0.836386 0.546838 15 1 0.149128 0.895393 0.541535 1963 1 0.4291 0.815018 0.599103 1872 1 0.128382 0.880603 0.52196 815 1 0.0862985 0.942929 0.578447 1125 1 0.318005 0.505509 0.613954 1535 1 0.72141 0.506899 0.552787 1846 1 0.533447 0.552063 0.580431 775 1 0.885485 0.579053 0.610513 1866 1 0.399105 0.629317 0.59028 1117 1 0.886044 0.62898 0.575601 406 1 0.489415 0.639914 0.594901 1948 1 0.013562 0.697006 0.597789 1941 1 0.882925 0.730926 0.585319 1725 1 0.591423 0.785633 0.617759 1737 1 0.401978 0.763521 0.534753 1567 1 0.855028 0.71468 0.574002 1267 1 0.868488 0.841691 0.593567 508 1 0.458327 0.901619 0.581633 256 1 0.898216 0.901672 0.566431 1713 1 0.0271845 0.949393 0.530877 670 1 0.380381 0.991862 0.612856 1870 1 0.366133 0.996068 0.546769 1434 1 0.527307 0.753946 0.996348 2002 1 0.937253 0.570721 0.544257 1460 1 0.326186 0.738959 0.9938 2044 1 0.0516023 0.588591 0.587224 1094 1 0.787503 0.557046 0.559639 1660 1 0.717158 0.618614 0.657187 1123 1 0.677428 0.65557 0.620463 315 1 0.51537 0.643854 0.58891 2034 1 0.367426 0.66068 0.611829 1487 1 0.3932 0.731413 0.559721 1005 1 0.0795655 0.709446 0.58061 1769 1 0.911785 0.768367 0.520862 1748 1 0.512239 0.770314 0.613648 1255 1 0.278305 0.899039 0.57332 759 1 0.218625 0.957566 0.605292 1855 1 0.951786 0.991788 0.703279 1635 1 0.862285 0.533982 0.662585 1086 1 0.0886987 0.511829 0.605303 109 1 0.108048 0.653066 0.680475 1358 1 0.697404 0.641925 0.623126 1873 1 0.0506226 0.602978 0.595829 977 1 0.0726992 0.591329 0.667275 116 1 0.888527 0.627976 0.690113 1575 1 0.188306 0.685103 0.615224 1999 1 0.215821 0.638662 0.679349 1745 1 0.344839 0.758403 0.653211 292 1 0.237286 0.778756 0.641148 1809 1 0.282003 0.789312 0.638711 1144 1 0.815992 0.822133 0.597725 1657 1 0.00644656 0.853068 0.625256 1913 1 0.615106 0.916583 0.686436 458 1 0.437385 0.968523 0.645679 1092 1 0.686059 0.547048 0.574943 558 1 0.912283 0.557221 0.66107 248 1 0.0363664 0.608414 0.610066 585 1 0.60624 0.663143 0.621061 1193 1 0.516402 0.665029 0.644028 1972 1 0.578585 0.767605 0.670054 1088 1 0.727267 0.718299 0.636156 2045 1 0.57267 0.734564 0.682993 336 1 0.886427 0.805415 0.55918 676 1 0.15145 0.855168 0.662458 92 1 0.657784 0.867291 0.688356 8 1 0.556386 0.824384 0.614163 678 1 0.793069 0.888655 0.617006 668 1 0.34002 0.911208 0.541135 632 1 0.303241 0.504093 0.764937 1486 1 0.923553 0.642819 0.612097 1831 1 0.784132 0.625098 0.691655 1181 1 0.0374795 0.706352 0.646459 357 1 0.291525 0.775481 0.634645 1896 1 0.187737 0.726844 0.688381 952 1 0.336846 0.796706 0.665883 1441 1 0.50895 0.749125 0.607444 1448 1 0.451994 0.780277 0.716016 482 1 0.19403 0.838506 0.639051 452 1 0.438762 0.818541 0.676971 32 1 0.146976 0.827241 0.66112 903 1 0.721139 0.894788 0.686183 1995 1 0.991494 0.923347 0.667756 325 1 0.0732372 0.971284 0.641261 146 1 0.0986758 0.928953 0.640382 1216 1 0.520657 0.984402 0.685556 355 1 0.00838127 0.552292 0.888259 563 1 0.486 0.954015 0.534506 1336 1 0.934967 0.589066 0.660106 1488 1 0.374791 0.618532 0.671832 439 1 0.344783 0.600325 0.609077 813 1 0.831745 0.641377 0.685199 1063 1 0.693017 0.753864 0.66972 1561 1 0.750053 0.770342 0.669879 157 1 0.336734 0.714832 0.663288 626 1 0.958931 0.84563 0.638956 1161 1 0.511835 0.86788 0.658705 613 1 0.898578 0.936593 0.633276 754 1 0.889367 0.935725 0.652877 54 1 0.916809 0.955394 0.650732 71 1 0.814011 0.932716 0.667691 104 1 0.911312 0.94555 0.601568 103 1 0.247434 0.967896 0.665312 381 1 0.142483 0.584611 0.659945 1467 1 0.179014 0.580452 0.726258 862 1 0.933261 0.676738 0.694401 996 1 0.754333 0.621139 0.777953 537 1 0.0146356 0.71475 0.687564 1594 1 0.795264 0.706867 0.74525 1341 1 0.963088 0.727044 0.704968 1826 1 0.39711 0.85122 0.676162 1310 1 0.852105 0.816219 0.700267 516 1 0.230927 0.839659 0.680329 1386 1 0.00192858 0.850628 0.651953 1988 1 0.288463 0.881702 0.670457 1104 1 0.327946 0.879577 0.659445 311 1 0.871674 0.946191 0.659891 964 1 0.605483 0.923464 0.707507 583 1 0.591696 0.896542 0.662546 728 1 0.956523 0.800913 0.507865 1031 1 0.883781 0.839324 0.532745 1139 1 0.48443 0.525652 0.701548 167 1 0.519432 0.521171 0.739682 283 1 0.551292 0.516776 0.72913 533 1 0.262165 0.633723 0.506641 444 1 0.0293519 0.580111 0.761345 1719 1 0.997576 0.601029 0.733355 95 1 0.883911 0.623355 0.742894 1985 1 0.989392 0.725678 0.709799 1270 1 0.956162 0.734132 0.70905 535 1 0.438626 0.818006 0.78383 207 1 0.735931 0.79335 0.709573 179 1 0.77191 0.84319 0.721029 1110 1 0.624632 0.906245 0.690759 1390 1 0.442768 0.872765 0.729273 1293 1 0.855758 0.885057 0.759249 1847 1 0.542917 0.900308 0.670481 1966 1 0.731579 0.956875 0.747236 475 1 0.00302847 0.937732 0.723778 51 1 0.413441 0.941747 0.723631 41 1 0.410329 0.970157 0.723817 239 1 0.453358 0.950732 0.761489 97 1 0.229454 0.546579 0.922226 96 1 0.84322 0.543364 0.706625 1158 1 0.0532753 0.542949 0.737627 1816 1 0.0883809 0.612676 0.695632 297 1 0.35296 0.644434 0.750844 905 1 0.928147 0.59825 0.662166 560 1 0.169404 0.586417 0.706471 1990 1 0.130069 0.595248 0.683352 658 1 0.725115 0.600568 0.700794 523 1 0.0527908 0.668258 0.660331 768 1 0.671332 0.694058 0.734659 76 1 0.0934977 0.743031 0.753713 898 1 0.805612 0.681231 0.735465 1186 1 0.445871 0.710881 0.722204 1392 1 0.0267183 0.799799 0.693566 975 1 0.549333 0.822069 0.753739 799 1 0.213857 0.827618 0.702215 1958 1 0.340131 0.84549 0.761786 714 1 0.326733 0.818008 0.697993 1068 1 0.534744 0.961216 0.771853 1127 1 0.0431875 0.829478 0.986511 1599 1 0.3281 0.979803 0.802852 1694 1 0.39678 0.528344 0.781618 1230 1 0.903875 0.536212 0.73255 1898 1 0.131453 0.518379 0.770873 436 1 0.165468 0.612533 0.66266 222 1 0.950818 0.551242 0.774874 1514 1 0.100451 0.586115 0.861774 1548 1 0.996622 0.630539 0.774726 190 1 0.146209 0.638462 0.765681 1313 1 0.64496 0.638346 0.80393 299 1 0.578275 0.690198 0.743989 776 1 0.543407 0.649649 0.73399 175 1 0.685788 0.701178 0.721317 169 1 0.199119 0.738233 0.709808 506 1 0.437926 0.7142 0.773987 641 1 0.61479 0.756987 0.752324 679 1 0.825473 0.866986 0.777359 1704 1 0.931912 0.777793 0.73767 11 1 0.260464 0.873038 0.781431 671 1 0.869615 0.916006 0.727306 264 1 0.383742 0.909804 0.766972 1162 1 0.76876 0.958084 0.690246 1393 1 0.281594 0.931408 0.778152 801 1 0.983264 0.963791 0.808949 442 1 0.0491512 0.999544 0.776038 690 1 0.294966 0.976943 0.535142 1877 1 0.918842 0.998461 0.723724 542 1 0.313929 0.528209 0.872824 2003 1 0.89603 0.560129 0.804704 1568 1 0.145799 0.545846 0.786693 1526 1 0.0701548 0.620286 0.771902 1169 1 0.857332 0.674499 0.764571 1283 1 0.541927 0.718881 0.862491 1475 1 0.174972 0.697274 0.739714 1623 1 0.819876 0.717632 0.805684 285 1 0.688499 0.794986 0.828657 2041 1 0.676205 0.774822 0.717208 30 1 0.704374 0.753786 0.736104 10 1 0.86211 0.770088 0.791746 1373 1 0.106451 0.850507 0.774336 1578 1 0.665305 0.824698 0.805569 1357 1 0.932938 0.86539 0.717058 1027 1 0.99584 0.839272 0.754125 584 1 0.0976822 0.838145 0.803915 242 1 0.786027 0.942315 0.766645 1775 1 0.128181 0.900044 0.810512 1989 1 0.216308 0.997946 0.760345 1465 1 0.670459 0.530013 0.522445 951 1 0.544775 0.978508 0.752953 770 1 0.817402 0.592352 0.78557 80 1 0.982521 0.6376 0.807013 1515 1 0.151731 0.687725 0.780552 1900 1 0.176827 0.682395 0.802439 1646 1 0.520941 0.735516 0.84743 1188 1 0.674538 0.753673 0.785523 293 1 0.818021 0.836958 0.797925 913 1 0.151553 0.826617 0.808837 735 1 0.637747 0.914663 0.801745 2037 1 0.292262 0.912444 0.753121 1112 1 0.690773 0.997453 0.784704 597 1 0.919371 0.967672 0.887709 842 1 0.191396 0.999491 0.816963 1932 1 0.932913 0.969681 0.764561 1917 1 0.573475 0.772112 0.985774 39 1 0.436352 0.585863 0.735726 341 1 0.477277 0.585864 0.741731 1939 1 0.027621 0.621818 0.821725 970 1 0.37342 0.593797 0.819084 291 1 0.91767 0.604096 0.821233 892 1 0.415892 0.628575 0.756495 691 1 0.741603 0.604156 0.77588 1288 1 0.845077 0.754216 0.77823 1346 1 0.161829 0.806431 0.79761 322 1 0.730427 0.762761 0.821315 538 1 0.685453 0.780683 0.838171 165 1 0.58567 0.791525 0.822845 2015 1 0.901955 0.881049 0.733939 967 1 0.00897235 0.909221 0.843454 659 1 0.81502 0.868442 0.819855 1274 1 0.493953 0.860132 0.879946 1121 1 0.0356463 0.840415 0.834927 831 1 0.603119 0.922218 0.71554 402 1 0.402784 0.871443 0.996167 498 1 0.600102 0.988933 0.782671 650 1 0.5964 0.581574 0.843895 859 1 0.328604 0.627552 0.780702 1509 1 0.33975 0.607105 0.770657 1425 1 0.131968 0.62361 0.781614 1135 1 0.113613 0.606997 0.791474 216 1 0.649635 0.638113 0.829692 1071 1 0.543629 0.59928 0.853277 328 1 0.46504 0.672128 0.894375 907 1 0.969561 0.630306 0.750949 271 1 0.528835 0.685803 0.77012 471 1 0.514729 0.685507 0.833474 798 1 0.88298 0.670896 0.786271 945 1 0.812527 0.772233 0.830206 803 1 0.759858 0.698708 0.854674 317 1 0.260762 0.707813 0.807147 69 1 0.923933 0.666206 0.775902 503 1 0.378674 0.811552 0.853108 305 1 0.927511 0.827138 0.903633 1382 1 0.0580186 0.903078 0.78126 796 1 0.504418 0.88541 0.802453 1946 1 0.831966 0.844598 0.86005 1886 1 0.946473 0.823879 0.813343 924 1 0.633004 0.893737 0.796734 1339 1 0.397342 0.879777 0.896342 1089 1 0.550694 0.956741 0.829323 893 1 0.930933 0.64507 0.964632 1304 1 0.969906 0.790886 0.98931 1787 1 0.0967246 0.599851 0.820547 465 1 0.255282 0.628452 0.893092 610 1 0.405475 0.628023 0.806034 1375 1 0.96681 0.658005 0.828678 756 1 0.989224 0.681813 0.864234 183 1 0.448761 0.680814 0.786755 1435 1 0.735068 0.75478 0.784953 453 1 0.924639 0.665764 0.842397 718 1 0.251329 0.736668 0.848961 433 1 0.167111 0.769526 0.843437 1344 1 0.14788 0.859844 0.864298 1921 1 0.143153 0.866349 0.87185 1700 1 0.274419 0.936982 0.857278 398 1 0.76057 0.93237 0.811017 974 1 0.48721 0.897351 0.844436 1237 1 0.841892 0.903039 0.809911 1601 1 0.16161 0.92131 0.787171 1915 1 0.196059 0.888778 0.858688 1812 1 0.163146 0.977941 0.754565 581 1 0.954301 0.53953 0.867656 1305 1 0.25692 0.576647 0.846317 1667 1 0.765067 0.632153 0.873915 1120 1 0.169222 0.706142 0.910289 288 1 0.36394 0.614652 0.887625 208 1 0.424248 0.632514 0.84899 931 1 0.443633 0.677425 0.878106 747 1 0.549284 0.658728 0.86837 994 1 0.661267 0.654775 0.856003 196 1 0.89463 0.683704 0.89072 1296 1 0.623324 0.725885 0.911109 712 1 0.0968803 0.77829 0.842143 833 1 0.361283 0.758987 0.914562 927 1 0.9265 0.707668 0.878187 120 1 0.377031 0.768623 0.852236 958 1 0.352476 0.787789 0.839929 1204 1 0.935032 0.822527 0.912208 1596 1 0.0299251 0.856913 0.820564 1606 1 0.257706 0.805423 0.853541 1222 1 0.011063 0.844069 0.832146 1980 1 0.56989 0.899901 0.878571 425 1 0.834149 0.857178 0.83153 130 1 0.366522 0.941837 0.880343 720 1 0.570432 0.827396 0.818493 1287 1 0.817157 0.854177 0.832885 518 1 0.740101 0.898454 0.863518 1655 1 0.947491 0.958094 0.87869 1641 1 0.765369 0.94293 0.821506 1400 1 0.344347 0.504052 0.858576 350 1 0.710229 0.556544 0.864791 232 1 0.910324 0.555391 0.845405 540 1 0.175337 0.605627 0.862206 1916 1 0.151714 0.598701 0.925833 1684 1 0.803294 0.751979 0.871277 126 1 0.639668 0.702558 0.89855 1677 1 0.881678 0.719676 0.894557 1408 1 0.307486 0.761081 0.847476 742 1 0.558243 0.766028 0.851746 1464 1 0.789382 0.834174 0.851302 652 1 0.823315 0.837426 0.894512 151 1 0.898372 0.919405 0.872464 1593 1 0.527987 0.863183 0.809117 1876 1 0.272136 0.935929 0.910735 1211 1 0.786215 0.955116 0.831316 1786 1 0.820606 0.968636 0.864394 1546 1 0.233681 0.983371 0.963704 1461 1 0.853601 0.964605 0.918042 1463 1 0.829379 0.972482 0.911022 2020 1 0.397365 0.554481 0.88925 1284 1 0.533261 0.553989 0.894935 820 1 0.623059 0.605905 0.870812 470 1 0.0327142 0.632805 0.891512 1709 1 0.11328 0.557932 0.940636 1865 1 0.210285 0.638795 0.891845 1307 1 0.306276 0.647246 0.91204 83 1 0.458709 0.565092 0.890241 1881 1 0.0127432 0.610615 0.797739 739 1 0.0760264 0.663342 0.847768 1848 1 0.0134623 0.695049 0.954572 808 1 0.917543 0.71128 0.919465 1294 1 0.109897 0.736758 0.901414 1276 1 0.248406 0.896461 0.849114 1023 1 0.476839 0.9581 0.823612 1513 1 0.332523 0.948627 0.949421 1701 1 0.300203 0.96647 0.871541 1600 1 0.743743 0.994372 0.917654 1439 1 0.307042 0.597382 0.947194 2028 1 0.219932 0.53805 0.912856 1159 1 0.919894 0.540795 0.872312 891 1 0.255356 0.565649 0.93113 1794 1 0.525179 0.603219 0.881863 1718 1 0.654663 0.676176 0.910397 1597 1 0.795091 0.559018 0.874601 1192 1 0.794373 0.630606 0.942764 50 1 0.626171 0.711588 0.839939 1326 1 0.725461 0.75742 0.952051 1590 1 0.629653 0.704797 0.971652 1919 1 0.314022 0.744409 0.880546 1308 1 0.217642 0.873514 0.839052 278 1 0.353048 0.955503 0.93701 908 1 0.893566 0.796822 0.893433 1388 1 0.868706 0.880063 0.995658 721 1 0.507751 0.858886 0.950983 121 1 0.934755 0.916752 0.932286 1397 1 0.259445 0.982964 0.94123 1645 1 0.660764 0.982486 0.873397 3 1 0.226685 0.980804 0.634569 662 1 0.0665953 0.561587 0.940858 1605 1 0.6361 0.538315 0.965592 1659 1 0.931127 0.580543 0.960842 1453 1 0.77916 0.600097 0.941192 1529 1 0.399522 0.647001 0.94241 431 1 0.456656 0.714975 0.938164 1824 1 0.0991337 0.736353 0.956428 432 1 0.229261 0.723352 0.907316 593 1 0.693276 0.961281 0.505402 1352 1 0.857666 0.742532 0.98854 1906 1 0.00518995 0.779273 0.903756 1324 1 0.948665 0.810468 0.948649 1332 1 0.930588 0.908697 0.93126 1610 1 0.106351 0.954212 0.505796 1604 1 0.054273 0.807489 0.907762 493 1 0.2706 0.859884 0.896878 176 1 0.6646 0.8697 0.922382 457 1 0.526635 0.883227 0.946395 524 1 0.402352 0.868256 0.884304 539 1 0.371038 0.994452 0.729475 551 1 0.302322 0.560139 0.971658 392 1 0.582936 0.523972 0.925556 203 1 0.216914 0.588744 0.849559 1982 1 0.44288 0.677633 0.896833 1109 1 0.5173 0.743784 0.954469 1810 1 0.235112 0.998405 0.751846 778 1 0.188927 0.683795 0.936084 1008 1 0.347613 0.689985 0.955006 2040 1 0.966034 0.792251 0.892662 569 1 0.461158 0.717728 0.992706 343 1 0.526647 0.789048 0.94834 468 1 0.128944 0.73406 0.986802 1182 1 0.845654 0.889499 0.980332 1549 1 0.421495 0.711804 0.941104 23 1 0.356537 0.891501 0.915669 1337 1 0.402198 0.873663 0.96232 1511 1 0.908155 0.87193 0.965033 1100 1 0.362557 0.925959 0.970589 1385 1 0.307286 0.944499 0.995548 932 1 0.168194 0.917702 0.886056 1803 1 0.769452 0.898774 0.992026 1198 1 0.295469 0.549977 0.939335 1765 1 0.414518 0.503104 0.982048 980 1 0.794046 0.541512 0.587103 340 1 0.657002 0.580088 0.602782 1840 1 0.862688 0.517248 0.987344 1559 1 0.159788 0.649377 0.99622 1499 1 0.743 0.673905 0.975857 1431 1 0.726969 0.673148 0.963373 681 1 0.986511 0.717421 0.881151 1469 1 0.22773 0.748799 0.909086 634 1 0.197844 0.704069 0.987447 1857 1 0.708035 0.896416 0.992322 445 1 0.274322 0.902551 0.965263 1015 1 0.161616 0.857873 0.953228 1666 1 0.0529894 0.956754 0.994495 25 1 0.574896 0.94671 0.516162 1064 1 0.498917 0.950985 0.805843 515 1 0.103542 0.6638 0.969134 1370 1 0.938453 0.816945 0.926102 1815 1 0.461423 0.743886 0.507913 326 1 0.0840224 0.976811 0.661316 1609 1 0.866423 0.838337 0.992914 430 1 0.146838 0.69128 0.504505 1200 1 0.248898 0.996771 0.61887 2039 1 0.388301 0.707973 0.997852
85665dbe43d1c321ad12f2506b472e4a46306b5e
ac32e4a76b519a4f9d043ebb3835ad42b9ff6a3c
/tests/tokenize/test_tokenize_json.py
80ca3e3ae813a3479c5e0bcd38471a72225a6e8e
[ "BSD-3-Clause" ]
permissive
rubbish822/typesystem
e63286f43672aa2d860c7dffe18431e3984f7439
fe201aecf871b3995b2d73ef647d34c1fedb36f1
refs/heads/master
2023-04-02T15:11:43.780011
2019-03-11T14:07:46
2019-03-11T14:07:46
null
0
0
null
null
null
null
UTF-8
Python
false
false
4,167
py
from json.decoder import JSONDecodeError import pytest from typesystem.tokenize.tokenize_json import tokenize_json from typesystem.tokenize.tokens import DictToken, ListToken, ScalarToken def test_tokenize_object(): token = tokenize_json('{"a": [1, 2, 3], "b": "test"}') expected = DictToken( { ScalarToken("a", 1, 3): ListToken( [ScalarToken(1, 7, 7), ScalarToken(2, 10, 10), ScalarToken(3, 13, 13)], 6, 14, ), ScalarToken("b", 17, 19): ScalarToken("test", 22, 27), }, 0, 28, ) assert repr(token) == 'DictToken(\'{"a": [1, 2, 3], "b": "test"}\')' assert token == expected assert token.value == {"a": [1, 2, 3], "b": "test"} assert token.lookup(["a"]).value == [1, 2, 3] assert token.lookup(["a"]).string == "[1, 2, 3]" assert token.lookup(["a"]).start.line_no == 1 assert token.lookup(["a"]).start.column_no == 7 assert token.lookup_key(["a"]).value == "a" assert token.lookup_key(["a"]).string == '"a"' assert token.lookup_key(["a"]).start.char_index == 1 assert token.lookup_key(["a"]).end.char_index == 3 def test_tokenize_list(): token = tokenize_json("[true, false, null]") expected = ListToken( [ScalarToken(True, 1, 4), ScalarToken(False, 7, 11), ScalarToken(None, 14, 17)], 0, 18, ) assert token == expected assert token.value == [True, False, None] assert token.lookup([0]).value is True assert token.lookup([0]).string == "true" assert token.lookup([0]).start.char_index == 1 assert token.lookup([0]).end.char_index == 4 def test_tokenize_floats(): token = tokenize_json("[100.0, 1.0E+2, 1E+2]") expected = ListToken( [ ScalarToken(100.0, 1, 5), ScalarToken(100.0, 8, 13), ScalarToken(100.0, 16, 19), ], 0, 20, ) assert token == expected assert token.value == [100.0, 1.0e2, 1e2] assert token.lookup([0]).value == 100.0 assert token.lookup([0]).string == "100.0" assert token.lookup([0]).start.char_index == 1 assert token.lookup([0]).end.char_index == 5 def test_tokenize_whitespace(): token = tokenize_json("{ }") expected = DictToken({}, 0, 2) assert token == expected assert token.value == {} assert token.string == "{ }" token = tokenize_json('{ "a" : 1 }') expected = DictToken({ScalarToken("a", 2, 4): ScalarToken(1, 9, 9)}, 0, 11) assert token == expected assert token.value == {"a": 1} assert token.lookup(["a"]).value == 1 assert token.lookup(["a"]).string == "1" assert token.lookup(["a"]).start.char_index == 9 assert token.lookup(["a"]).end.char_index == 9 assert token.lookup_key(["a"]).value == "a" assert token.lookup_key(["a"]).string == '"a"' assert token.lookup_key(["a"]).start.char_index == 2 assert token.lookup_key(["a"]).end.char_index == 4 def test_tokenize_parse_errors(): with pytest.raises(JSONDecodeError) as exc_info: tokenize_json("{") exc = exc_info.value assert exc.msg == "Expecting property name enclosed in double quotes" assert exc.pos == 1 with pytest.raises(JSONDecodeError) as exc_info: tokenize_json('{"a"') exc = exc_info.value assert exc.msg == "Expecting ':' delimiter" assert exc.pos == 4 with pytest.raises(JSONDecodeError) as exc_info: tokenize_json('{"a":') exc = exc_info.value assert exc.msg == "Expecting value" assert exc.pos == 5 with pytest.raises(JSONDecodeError) as exc_info: tokenize_json('{"a":1') exc = exc_info.value assert exc.msg == "Expecting ',' delimiter" assert exc.pos == 6 with pytest.raises(JSONDecodeError) as exc_info: tokenize_json('{"a":1,1') exc = exc_info.value assert exc.msg == "Expecting property name enclosed in double quotes" assert exc.pos == 7 with pytest.raises(JSONDecodeError) as exc_info: tokenize_json('{"a":1 "b"') exc = exc_info.value assert exc.msg == "Expecting ',' delimiter" assert exc.pos == 7
e8eed13eedde2a1f73d5dd4d40462d475f7aef3f
a367a015dbc36287ca933955ded1ee58b5a2a61a
/swagger_client/models/fluid_consumption_rate_through_nozzle.py
925475d390d001c905e9a980b4d6954c0d2df360
[]
no_license
kerniee/inno_intership_1_test_task
70211e153450011c427df595a02e3574dfe7ed9f
fc0619ef54b00806a3b59f3c07c1c1684682d65b
refs/heads/master
2023-05-23T02:24:40.083723
2021-06-21T16:15:04
2021-06-21T16:15:04
365,855,831
0
0
null
null
null
null
UTF-8
Python
false
false
6,525
py
# coding: utf-8 """ Teleagronom No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class FluidConsumptionRateThroughNozzle(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'id': 'int', 'nozzle_color': 'AllOfFluidConsumptionRateThroughNozzleNozzleColor', 'nozzle_pressure': 'AllOfFluidConsumptionRateThroughNozzleNozzlePressure', 'fluid_consumption_rate': 'float' } attribute_map = { 'id': 'id', 'nozzle_color': 'nozzle_color', 'nozzle_pressure': 'nozzle_pressure', 'fluid_consumption_rate': 'fluid_consumption_rate' } def __init__(self, id=None, nozzle_color=None, nozzle_pressure=None, fluid_consumption_rate=None): # noqa: E501 """FluidConsumptionRateThroughNozzle - a model defined in Swagger""" # noqa: E501 self._id = None self._nozzle_color = None self._nozzle_pressure = None self._fluid_consumption_rate = None self.discriminator = None self.id = id self.nozzle_color = nozzle_color self.nozzle_pressure = nozzle_pressure self.fluid_consumption_rate = fluid_consumption_rate @property def id(self): """Gets the id of this FluidConsumptionRateThroughNozzle. # noqa: E501 :return: The id of this FluidConsumptionRateThroughNozzle. # noqa: E501 :rtype: int """ return self._id @id.setter def id(self, id): """Sets the id of this FluidConsumptionRateThroughNozzle. :param id: The id of this FluidConsumptionRateThroughNozzle. # noqa: E501 :type: int """ if id is None: raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id @property def nozzle_color(self): """Gets the nozzle_color of this FluidConsumptionRateThroughNozzle. # noqa: E501 :return: The nozzle_color of this FluidConsumptionRateThroughNozzle. # noqa: E501 :rtype: AllOfFluidConsumptionRateThroughNozzleNozzleColor """ return self._nozzle_color @nozzle_color.setter def nozzle_color(self, nozzle_color): """Sets the nozzle_color of this FluidConsumptionRateThroughNozzle. :param nozzle_color: The nozzle_color of this FluidConsumptionRateThroughNozzle. # noqa: E501 :type: AllOfFluidConsumptionRateThroughNozzleNozzleColor """ if nozzle_color is None: raise ValueError("Invalid value for `nozzle_color`, must not be `None`") # noqa: E501 self._nozzle_color = nozzle_color @property def nozzle_pressure(self): """Gets the nozzle_pressure of this FluidConsumptionRateThroughNozzle. # noqa: E501 :return: The nozzle_pressure of this FluidConsumptionRateThroughNozzle. # noqa: E501 :rtype: AllOfFluidConsumptionRateThroughNozzleNozzlePressure """ return self._nozzle_pressure @nozzle_pressure.setter def nozzle_pressure(self, nozzle_pressure): """Sets the nozzle_pressure of this FluidConsumptionRateThroughNozzle. :param nozzle_pressure: The nozzle_pressure of this FluidConsumptionRateThroughNozzle. # noqa: E501 :type: AllOfFluidConsumptionRateThroughNozzleNozzlePressure """ if nozzle_pressure is None: raise ValueError("Invalid value for `nozzle_pressure`, must not be `None`") # noqa: E501 self._nozzle_pressure = nozzle_pressure @property def fluid_consumption_rate(self): """Gets the fluid_consumption_rate of this FluidConsumptionRateThroughNozzle. # noqa: E501 :return: The fluid_consumption_rate of this FluidConsumptionRateThroughNozzle. # noqa: E501 :rtype: float """ return self._fluid_consumption_rate @fluid_consumption_rate.setter def fluid_consumption_rate(self, fluid_consumption_rate): """Sets the fluid_consumption_rate of this FluidConsumptionRateThroughNozzle. :param fluid_consumption_rate: The fluid_consumption_rate of this FluidConsumptionRateThroughNozzle. # noqa: E501 :type: float """ if fluid_consumption_rate is None: raise ValueError("Invalid value for `fluid_consumption_rate`, must not be `None`") # noqa: E501 self._fluid_consumption_rate = fluid_consumption_rate def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value if issubclass(FluidConsumptionRateThroughNozzle, dict): for key, value in self.items(): result[key] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, FluidConsumptionRateThroughNozzle): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
7ab87edf7fb834a8eaaf7973e70732fa4778a974
9dd33333caebc0b6f516ededa9aeebe707476852
/qc/qc/middlewares.py
78bd401ea4445eed71a7954552fa2c3aba118b7f
[]
no_license
zx490336534/spider-review
4ef0cebd9d92bce0a42f4aeef5b03ae9695c2364
c7a3cdf7abc74732c556bc4b8c9928a20e7c4c78
refs/heads/master
2020-04-09T02:20:26.533103
2018-12-03T15:04:15
2018-12-03T15:04:15
159,937,120
13
0
null
null
null
null
UTF-8
Python
false
false
1,150
py
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://doc.scrapy.org/en/latest/topics/spider-middleware.html import random import redis import hashlib from scrapy import signals from scrapy.exceptions import IgnoreRequest from qc.settings import USER_AGENT as ua_list class QcSpiderMiddleware(object): """ 给每一个请求随机切换一个User-Agent """ def process_request(self, request, spider): user_agent = random.choice(ua_list) request.headers['User-Agent'] = user_agent class QcRedisMiddleware(object): """ 把每一个URL放到redis.set中,防止重复爬取 """ def __init__(self): self.sr = redis.StrictRedis(host='localhost', port=6379, db=1) def process_request(self, request, spider): if request.url.startswith('https://jobs.51job.com/'): # MD5压缩详情页链接(必须是bytes类型数据) url_md5 = hashlib.md5(request.url.encode()).hexdigest() result = self.sr.sadd('qc_url', url_md5) if not result: raise IgnoreRequest
a1be92f9773850b2fb15a33da32c81a191883f7c
2c8c415c1b386eb7e168a7cb17d55a73ab08ac36
/UrlHandler/migrations/0001_initial.py
a28550bdde5c621735367268f25788211c6fe269
[ "MIT" ]
permissive
TanimSk/Help-The-Helpless
888b72b3faca9d307f5a0e41c05424050bc2c423
bdf6ad2c1d873831cb80f09cb62e068cba43e203
refs/heads/main
2023-02-02T13:37:27.407966
2020-12-23T07:25:22
2020-12-23T07:25:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
583
py
# Generated by Django 3.1.4 on 2020-12-23 06:42 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='UrlLinks', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('facebook_url', models.URLField()), ('youtube_url', models.URLField()), ('gmail_url', models.URLField()), ], ), ]
c85721734e624cc87ceb5ad6f0d8bd65975de78a
c1e87e9a7f0f2e81e3113821c21378f7b6436b6f
/Щелчок/24/24_52.py
69e3935c47b9be84d6bb1164ad23e1c9dffd7548
[]
no_license
Pochemu/Activity
8e2a7ec4f6b7fd233c0ee48e893733b077aac7a4
1b21e674635ff95104e18e93241c30020032e26a
refs/heads/main
2023-07-09T04:04:06.337321
2021-07-06T21:38:26
2021-07-06T21:38:26
337,492,398
1
0
null
null
null
null
UTF-8
Python
false
false
237
py
f = open('shkolkovo_2.txt') cnt = 0 cnt_max = 0 for s in f: if s.count('A') < 25: for i in range(ord('A'), ord('Z')+1): cnt = s.rindex(chr(i)) - s.index(chr(i)) cnt_max = max(cnt, cnt_max) print(cnt_max)
7916f1c0dcf1066cc49205d234ec76a5db1cf997
4e30c855c253cc1d972d29e83edb9d5ef662d30a
/daybook/forms.py
78fc660f041185c9829b162003142e5d49f5e0cc
[ "MIT" ]
permissive
rajeshr188/django-onex
8b531fc2f519d004d1da64f87b10ffacbd0f2719
0a190ca9bcf96cf44f7773686205f2c1f83f3769
refs/heads/master
2023-08-21T22:36:43.898564
2023-08-15T12:08:24
2023-08-15T12:08:24
163,012,755
2
0
NOASSERTION
2023-07-22T09:47:28
2018-12-24T17:46:35
Python
UTF-8
Python
false
false
168
py
from django import forms from django.contrib.admin.widgets import AdminDateWidget class daybookform(forms.Form): date = forms.DateField(widget=AdminDateWidget())
d16b1b41a1fb590da1c4bb249c860c9a341c9b6b
830465731dfda87b4141546262f20d74c29297bf
/CRYPTO/BambooFox/AttackOnHash/secret.py
d3cf7e8f7cd06fa222aa2906c4912017de846386
[]
no_license
jchen8tw-research/CTF
f559d7ca0e16a730335b11caeeae208c42e8bf17
f49615c24437a9cc6a2c20d6b30cb5abf7a32b71
refs/heads/master
2023-03-17T12:29:08.630613
2021-03-23T06:31:26
2021-03-23T06:31:26
null
0
0
null
null
null
null
UTF-8
Python
false
false
30
py
flag = 'FAKE' salt = 'a' * 40
f20c8a872358b9fb3614dae96f4a639ff2d38ed1
9b20743ec6cd28d749a4323dcbadb1a0cffb281b
/13_Deep_Learning_with_Python/13/decay_drop_based.py
7a7df9ff76b941850db37b74bf66d0353ae9cb4f
[]
no_license
jggrimesdc-zz/MachineLearningExercises
6e1c7e1f95399e69bba95cdfe17c4f8d8c90d178
ee265f1c6029c91daff172b3e7c1a96177646bc5
refs/heads/master
2023-03-07T19:30:26.691659
2021-02-19T08:00:49
2021-02-19T08:00:49
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,252
py
# Drop-Based Learning Rate Decay import math from keras.callbacks import LearningRateScheduler from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD from pandas import read_csv from sklearn.preprocessing import LabelEncoder # learning rate schedule def step_decay(epoch): initial_lrate = 0.1 drop = 0.5 epochs_drop = 10.0 lrate = initial_lrate * math.pow(drop, math.floor((1 + epoch) / epochs_drop)) return lrate # load dataset dataframe = read_csv("ionosphere.csv", header=None) dataset = dataframe.values # split into input (X) and output (Y) variables X = dataset[:, 0:34].astype(float) Y = dataset[:, 34] # encode class values as integers encoder = LabelEncoder() encoder.fit(Y) Y = encoder.transform(Y) # create model model = Sequential() model.add(Dense(34, input_dim=34, activation='relu')) model.add(Dense(1, activation='sigmoid')) # Compile model sgd = SGD(lr=0.0, momentum=0.9) model.compile(loss='binary_crossentropy', optimizer=sgd, metrics=['accuracy']) # learning schedule callback lrate = LearningRateScheduler(step_decay) callbacks_list = [lrate] # Fit the model model.fit(X, Y, validation_split=0.33, epochs=50, batch_size=28, callbacks=callbacks_list, verbose=2)
7b703bc2896e3cd0f8b426c39ecbb5420161c927
d17a8870ff8ac77b82d0d37e20c85b23aa29ca74
/lite/tests/unittest_py/op/backends/host/test_relu6_op.py
e47927da98e69c262b7712e29005b73d40fe45f7
[ "Apache-2.0" ]
permissive
PaddlePaddle/Paddle-Lite
4ab49144073451d38da6f085a8c56822caecd5b2
e241420f813bd91f5164f0d9ee0bc44166c0a172
refs/heads/develop
2023-09-02T05:28:14.017104
2023-09-01T10:32:39
2023-09-01T10:32:39
104,208,128
2,545
1,041
Apache-2.0
2023-09-12T06:46:10
2017-09-20T11:41:42
C++
UTF-8
Python
false
false
1,680
py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # 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 sys sys.path.append('../../common') sys.path.append('../../../') import test_relu6_op_base from auto_scan_test import AutoScanTest, IgnoreReasons from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place import unittest import hypothesis from hypothesis import given, settings, seed, example, assume import hypothesis.strategies as st class TestRelu6Op(AutoScanTest): def is_program_valid(self, program_config: ProgramConfig) -> bool: return True def sample_program_configs(self, draw): return test_relu6_op_base.sample_program_configs(draw) def sample_predictor_configs(self): config = CxxConfig() config.set_valid_places( {Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.NCHW)}) yield config, ["relu6"], (1e-5, 1e-5) def add_ignore_pass_case(self): pass def test(self, *args, **kwargs): self.run_and_statis(quant=False, max_examples=25) if __name__ == "__main__": unittest.main()
c96ebeab3ec93603bfbe70fbec041ad533547e03
e0980f704a573894350e285f66f4cf390837238e
/.history/news/models_20201125123239.py
55e05516581b090c070f2f6ce249d636eccf8f32
[]
no_license
rucpata/WagtailWebsite
28008474ec779d12ef43bceb61827168274a8b61
5aa44f51592f49c9a708fc5515ad877c6a29dfd9
refs/heads/main
2023-02-09T15:30:02.133415
2021-01-05T14:55:45
2021-01-05T14:55:45
303,961,094
0
0
null
null
null
null
UTF-8
Python
false
false
1,782
py
from django.db import models from modelcluster.models import ParentalKey from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField from wagtail.admin.edit_handlers import FieldPanel, InlinePanel from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.core.fields import RichTextField # Create your models here. class CustomAbstractFormField(AbstractFormField): field_type = models.CharField( vebose_name= 'Field Type', max_ ) class FormField(AbstractFormField): page = ParentalKey( 'NewsPage', on_delete=models.CASCADE, related_name='form_fields', ) class NewsPage(AbstractEmailForm): tempalte ='news/news_page.html' leanding_page_template = 'news/news_page_leading.html' subpage_types = [] max_coun = 1 intro = RichTextField(blank=True, features=['bold', 'italic', 'ol', 'ul']) thank_you_text = RichTextField( blank=True, features=['bold', 'italic', 'ol', 'ul']) map_image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=False, on_delete=models.SET_NULL, help_text='Obrazek będzie przycięty do rozmairu 588px na 355 px', related_name='+', ) map_url = models.URLField( blank=True, help_text='Opcjonalne. Jeśli podasz tutaj łączę, obraz stanie się łączem.' ) content_panels = AbstractEmailForm.content_panels + [ FieldPanel('intro'), ImageChooserPanel('map_image'), FieldPanel('map_url'), InlinePanel('form_fields', label="Form Fields"), FieldPanel('thank_you_text'), FieldPanel('from_address'), FieldPanel('to_address'), FieldPanel('subject'), ]
99b8d312c2b0f1dd950dc13681e497b85cb2db8b
de24f83a5e3768a2638ebcf13cbe717e75740168
/moodledata/vpl_data/303/usersdata/305/78885/submittedfiles/testes.py
c9fd898511eec6ab3f5fd5d3e4799a1e4e204ad4
[]
no_license
rafaelperazzo/programacao-web
95643423a35c44613b0f64bed05bd34780fe2436
170dd5440afb9ee68a973f3de13a99aa4c735d79
refs/heads/master
2021-01-12T14:06:25.773146
2017-12-22T16:05:45
2017-12-22T16:05:45
69,566,344
0
0
null
null
null
null
UTF-8
Python
false
false
142
py
# -*- coding: utf-8 -*- import math #COMECE A PARTIR DAQUI! h = float(input('digite o valor de : ')) P = ((72.7*h) - 58) print('%.2f' %P)
5d83e9f566fba4eac5dbe32b32a2a952e9f7359a
53fab060fa262e5d5026e0807d93c75fb81e67b9
/backup/user_049/ch71_2019_06_07_01_05_04_054986.py
288d8e6e8a79edcd51e9bbbaa024bd8e1f5605da
[]
no_license
gabriellaec/desoft-analise-exercicios
b77c6999424c5ce7e44086a12589a0ad43d6adca
01940ab0897aa6005764fc220b900e4d6161d36b
refs/heads/main
2023-01-31T17:19:42.050628
2020-12-16T05:21:31
2020-12-16T05:21:31
306,735,108
0
0
null
null
null
null
UTF-8
Python
false
false
81
py
def esconde_senha(string): senha_nova="*" * len(string) return senha_nova
96494d65b735f2b56baa0d19449ddb69bcacc03f
f03bd5bd7873c5cc33b4ef5199f219539f3a340e
/CAAPR/CAAPR_AstroMagic/PTS/pts/core/plot/scatter.py
9fe0c5fd106f27cc39c302f413694a7e00a06ed3
[ "MIT", "GPL-1.0-or-later", "AGPL-3.0-only", "AGPL-3.0-or-later", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-philippe-de-muyter" ]
permissive
Stargrazer82301/CAAPR
5f8a7033b16792f23abd5d07021b53b9228a5db4
62b2339beb2eb956565e1605d44d92f934361ad7
refs/heads/master
2022-08-29T02:53:33.658022
2022-08-05T19:06:46
2022-08-05T19:06:46
49,977,601
8
1
MIT
2022-08-05T19:06:47
2016-01-19T19:32:42
Python
UTF-8
Python
false
false
10,466
py
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ## \package pts.modeling.plotting.scatter Contains the ScatterPlotter class. # ----------------------------------------------------------------- # Ensure Python 3 compatibility from __future__ import absolute_import, division, print_function # Import standard modules from collections import OrderedDict from textwrap import wrap import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.stats import gaussian_kde # Import the relevant PTS classes and modules from ..tools.logging import log # ----------------------------------------------------------------- line_styles = ['-', '--', '-.', ':'] filled_markers = ['o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd'] pretty_colors = ["dodgerblue", "r", "purple", "darkorange", "lawngreen", "yellow", "darkblue", "teal", "darkgreen", "lightcoral", "crimson", "saddlebrown"] # ----------------------------------------------------------------- class ScatterPlotter(object): """ This class ... """ def __init__(self, title=None, data=None): """ This function ... :return: """ # Set the title self.title = title if data is None: self.x = [] self.y = [] self.z = [] else: self.x = data[0] self.y = data[1] self.z = data[2] # The axes labels self.x_label = None self.y_label = None self.z_label = None # The axes limits self.x_limits = [None, None] self.y_limits = [None, None] self.z_limits = [None, None] # Store the figure and its axes as references self._figure = None # Properties self.color_map = "viridis" self.format = None self.transparent = False self.density = True # ----------------------------------------------------------------- def set_title(self, title): """ This function ... :param title: :return: """ self.title = title # ----------------------------------------------------------------- def add_point(self, x, y, z): """ This function ... :param x: :param y: :param z: :return: """ self.x.append(x) self.y.append(y) self.z.append(z) # ----------------------------------------------------------------- def set_x_limits(self, x_min, x_max): """ This function ... :param x_min: :param x_max: :return: """ self.x_limits[0] = x_min self.x_limits[1] = x_max # ----------------------------------------------------------------- def set_y_limits(self, y_min, y_max): """ This function ... :param y_min: :param y_max: :return: """ self.y_limits[0] = y_min self.y_limits[1] = y_max # ----------------------------------------------------------------- def set_z_limits(self, z_min, z_max): """ This function ... :param z_min: :param z_max: :return: """ self.z_limits[0] = z_min self.z_limits[1] = z_max # ----------------------------------------------------------------- def set_x_label(self, label): """ This function ... :param label: :return: """ self.x_label = label # ----------------------------------------------------------------- def set_y_label(self, label): """ This function ... :param label: :return: """ self.y_label = label # ----------------------------------------------------------------- def set_z_label(self, label): """ This function ... :param label: :return: """ self.z_label = label # ----------------------------------------------------------------- def run(self, output_path): """ This function ... :param output_path: :return: """ # Make the plot if self.density: self.plot_with_density(output_path) else: self.plot_simple(output_path) # ----------------------------------------------------------------- def clear(self): """ This function clears everything :return: """ # Inform the user log.info("Clearing the scatter plotter ...") # ----------------------------------------------------------------- def clear_figure(self): """ This function ... :return: """ # Inform the user log.info("Clearing the scatter plotter figure ...") # The axes labels self.x_label = None self.y_label = None self.z_label = None # The axes limits self.x_limits = [None, None] self.y_limits = [None, None] self.z_limits = [None, None] # Store the figure and its axes as references self._figure = None # Properties self.color_map = "viridis" self.format = None self.transparent = False self.density = True # ----------------------------------------------------------------- def plot_simple(self, path): """ This function ... :param path: :return: """ # Inform the user log.info("Making the scatter plot ...") # Create the figure self._figure = plt.figure(figsize=(10, 10)) # Add first subplot ax = self._figure.add_subplot(1, 1, 1, projection='3d') ax.scatter(self.x, self.y, self.z) ax.set_xlim(self.x_limits) ax.set_ylim(self.y_limits) ax.set_zlim(self.z_limits) ax.set_xlabel(self.x_label) ax.set_ylabel(self.y_label) ax.set_zlabel(self.z_label) # Set the title if self.title is not None: plt.suptitle("\n".join(wrap(self.title, 60))) plt.tight_layout() # Debugging if type(path).__name__ == "BytesIO": log.debug("Saving the scatter plot to a buffer ...") else: log.debug("Saving the scatter plot to " + str(path) + " ...") # Save the figure plt.savefig(path, bbox_inches='tight', pad_inches=0.25, format=self.format, transparent=self.transparent) plt.close() # ----------------------------------------------------------------- def plot_with_density(self, path): """ This function ... :param path: :return: """ # Inform the user log.info("Making the scatter plot ...") # Create the figure self._figure = plt.figure(figsize=(15, 15)) # Add first subplot ax = self._figure.add_subplot(2, 2, 1, projection='3d') ax.scatter(self.x, self.y, self.z) ax.set_xlim(self.x_limits) ax.set_ylim(self.y_limits) ax.set_zlim(self.z_limits) ax.set_xlabel(self.x_label) ax.set_ylabel(self.y_label) ax.set_zlabel(self.z_label) # To draw projected points against the axis planes: # ax.plot(self.x, self.z, 'r+', zdir='y', zs=self.y_limits[1]) # ax.plot(self.y, self.z, 'g+', zdir='x', zs=self.x_limits[0]) # ax.plot(self.x, self.y, 'k+', zdir='z', zs=self.z_limits[0) # Add second subplot ax = self._figure.add_subplot(2, 2, 2) # Density plot of FUV young vs. FUV ionizing if len(self.x) > 4: x = np.array(self.x) y = np.array(self.y) xy = np.vstack([x, y]) z = gaussian_kde(xy)(xy) # Sort the points by density, so that the densest points are plotted last idx = z.argsort() x, y, z = x[idx], y[idx], z[idx] ax.scatter(x, y, c=z, s=100, edgecolor='', cmap=self.color_map) else: ax.scatter([],[]) ax.set_xlabel(self.x_label) ax.set_ylabel(self.y_label) ax.set_xlim(self.x_limits) ax.set_ylim(self.y_limits) # Add third subplot ax = self._figure.add_subplot(2, 2, 3) # Density plot of FUV young vs. dust mass if len(self.x) > 4: x = np.array(self.x) y = np.array(self.z) xy = np.vstack([x, y]) z = gaussian_kde(xy)(xy) # Sort the points by density, so that the densest points are plotted last idx = z.argsort() x, y, z = x[idx], y[idx], z[idx] ax.scatter(x, y, c=z, s=100, edgecolor='', cmap=self.color_map) else: ax.scatter([],[]) ax.set_xlabel(self.x_label) ax.set_ylabel(self.z_label) ax.set_xlim(self.x_limits) ax.set_ylim(self.z_limits) # Add fourth subplot ax = self._figure.add_subplot(2, 2, 4) # Density plot of FUV ionizing vs. dust mass if len(self.x) > 4: x = np.array(self.y) y = np.array(self.z) xy = np.vstack([x, y]) z = gaussian_kde(xy)(xy) # Sort the points by density, so that the densest points are plotted last idx = z.argsort() x, y, z = x[idx], y[idx], z[idx] ax.scatter(x, y, c=z, s=100, edgecolor='', cmap=self.color_map) else: ax.scatter([],[]) ax.set_xlabel(self.y_label) ax.set_ylabel(self.z_label) ax.set_xlim(self.y_limits) ax.set_ylim(self.z_limits) # Set the title if self.title is not None: plt.suptitle("\n".join(wrap(self.title, 60))) plt.tight_layout() # Debugging if type(path).__name__ == "BytesIO": log.debug("Saving the scatter plot to a buffer ...") else: log.debug("Saving the scatter plot to " + str(path) + " ...") # Save the figure plt.savefig(path, bbox_inches='tight', pad_inches=0.25, format=self.format, transparent=self.transparent) plt.close() # -----------------------------------------------------------------
82037c643ef27e2ed8ebad5f7e521367051eb0fd
cc382cc8fc521c3427f582adedc1ff7b93a754de
/Python/Quiz/P_sum.py
2797c7c578f859d95f4094f7d758468e6d29fb69
[]
no_license
jbro321/Python
c33e899145ea47db41038fcc117789ce821c4131
36854890aefd0384567b05600cbb849094cd9f91
refs/heads/main
2023-06-05T19:53:40.144922
2021-06-24T13:29:24
2021-06-24T13:29:24
331,165,120
2
3
null
2021-04-05T03:46:58
2021-01-20T02:06:00
Python
UTF-8
Python
false
false
755
py
# 문제 # ***a,b,c,d 변수 4개를 초기 입력으로 받는다 # *** 출력문 작성 시 a+b를 직접 사용해서 합을 출력하지 않는다. # *** 아래 출력을 그대로 출력한다. 대신 []안에 내용은 출력하지 않아도 된다. # *** 수1 + 수2 = 합 문장을 출력하면 된다. # 출력 # -------------------- # a[입력받은 값] + b[입력받은값] = 합 # c[입력받은 값] + d[입력받은값] = 합 #1 from datetime import datetime now = datetime.now() print(now) import sys a = list(map(int, sys.stdin.readline().split())) # a, b, c, d = map(int, input().split()) print("{} + {} = {}".format(a[0], a[1], sum(a[:2]))) print("{} + {} = {}".format(a[2], a[3], sum(a[2:]))) now = datetime.now() print(now)
d80ec6633dabfba7c9a1e14b38c97b6429cd2a70
c9ddbdb5678ba6e1c5c7e64adf2802ca16df778c
/cases/pa2/sample/stmt_list_assign-28.py
c3f3f4a22b92fb70cf62afd2003cfb3858329b4a
[]
no_license
Virtlink/ccbench-chocopy
c3f7f6af6349aff6503196f727ef89f210a1eac8
c7efae43bf32696ee2b2ee781bdfe4f7730dec3f
refs/heads/main
2023-04-07T15:07:12.464038
2022-02-03T15:42:39
2022-02-03T15:42:39
451,969,776
0
0
null
null
null
null
UTF-8
Python
false
false
88
py
x:[int] = None y:[object] = None x = [$Literal, 2] y = [None] x[0] = 3 x[1] = y[0] = 4
0f4e7e981575a48924e04e71394b1f46bc2b670b
2e643989fad07bb54b75e178998bb1546540317a
/securetea/lib/auto_server_patcher/patcher.py
9181df1b1a141221e9970c3cb444903c1c5dc750
[ "MIT" ]
permissive
fijimunkii/SecureTea-Project
4fa89c3a28120cc4dbdd4fc6adac204a3c1ae99a
e3752e358d9837ed4677984e1b29a2dd3818dfe6
refs/heads/master
2020-06-23T00:19:49.464335
2019-07-23T09:12:51
2019-07-23T09:12:51
198,443,213
1
0
MIT
2019-07-23T14:05:36
2019-07-23T14:05:35
null
UTF-8
Python
false
false
7,457
py
# -*- coding: utf-8 -*- u"""Patcher for SecureTea Auto Server Patcher Project: ╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐ ╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤ ╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴ Author: Abhishek Sharma <[email protected]> , Jun 20 2019 Version: 1.4 Module: SecureTea """ import json from securetea.lib.auto_server_patcher.patch_logger import PatchLogger from securetea.lib.auto_server_patcher import utils class ConfigPatcher(object): """ConfigPatcher class.""" def __init__(self, debug=False, to_patch=None): """ Initialize ConfigPatcher. Args: debug (bool): Log on terminal or not Raises: None Returns: None """ # Initialize logger self.logger = PatchLogger( __name__, debug=debug ) # Configuration file path self._CONFIG_PATH = "securetea/lib/auto_server_patcher/configs/config.json" # Load configuration self.config_data = self.open_json(self._CONFIG_PATH) # Categorize OS os_name = utils.categorize_os() if os_name: try: self.os_config_data = self.config_data[os_name] # if OS in configuration except KeyError: self.logger.log( "Could not load OS specific configuration.", logtype="error" ) else: self.logger.log( "Operating system cannot be determined.", logtype="error" ) sys.exit(0) # List of files to patch if to_patch: self.to_patch = to_patch else: self.to_patch = [] def open_file(self, path): """ Open the file and return the data as list. Args: path (str): Path of the file Raises: None Returns: None """ try: with open(path, "r") as f: return f.readlines() except Exception as e: self.logger.log( "Error occured: " + str(e), logtype="error" ) def open_json(self, path): """ Open the JSON file and return the data as dict. Args: path (str): Path of the file Raises: None Returns: None """ try: with open(path, "r") as json_data_file: data = json.load(json_data_file) return data except Exception as e: self.logger.log( "Error occured: " + str(e), logtype="error" ) def write_data(self, path, data): """ Write the data into the file. Args: path (str): Path of the file data (list): List of data to write Raises: None Returns: None """ try: with open(path, "w") as wf: for line in data: wf.write(line + "\n") except Exception as e: self.logger.log( "Error occured: " + str(e), logtype="error" ) def patch(self): """ Patch the configuration file based on the configuration data stored. Args: None Raises: None Returns: None """ for path in self.os_config_data: # iterate over the configuration patch_this = False # patch this file or not for req_patch in self.to_patch: if req_patch in path: patch_this = True if patch_this: self.logger.log( "Patching: " + str(path), logtype="info" ) file_data = self.open_file(path) # open the file to configure new_data = [] # new data to over-write config_added = [] # successfully configured parameters config_not_added = [] # not configured parameters sep = self.os_config_data[path]["sep"] # separator for index, line in enumerate(file_data): flag = 0 # write the original line for rep_text in self.os_config_data[path]["config"].keys(): hold = False # forward refrencing not needed in_front = False # not found in forward refrence if rep_text in line: if line.strip(" ").strip("\n").startswith("#"): # found comment hold = True # hold, prepare for forward refrence if hold: # if forward refrence is needed for _, nf_line in enumerate(file_data, start=index+1): if (rep_text in nf_line and not nf_line.strip(" ").strip("\n").startswith("#")): in_front = True # found in forward refrencing if not in_front: # not in forward refrencing self.logger.log( "Old config line: " + line.strip("\n"), logtype="info" ) new_config_line = rep_text + sep + \ self.os_config_data[path]["config"][rep_text] new_data.append(new_config_line) config_added.append(rep_text) flag = 1 # write the new line self.logger.log( "New config line: " + new_config_line, logtype="info" ) if flag == 0: # write the original line new_data.append(line.strip(" ").strip("\n")) elif flag == 1: # already written flag = 0 # reset flag # Look which parameters were not over-written # as they were not found in the config file for rep_text in self.os_config_data[path]["config"].keys(): if rep_text not in config_added: new_config_line = rep_text + sep + \ self.os_config_data[path]["config"][rep_text] config_not_added.append(new_config_line) # Extend the new configuration new_data.extend(config_not_added) # Write the data (overwrite) the config file self.write_data(path=path, data=new_data) self.logger.log( "Patched: " + str(path), logtype="info" ) # Empty the list for the next configuration file new_data.clear() config_added.clear() config_not_added.clear()
77b5f4f0d26d396c24550978a83d7223fbf2497e
a3d6556180e74af7b555f8d47d3fea55b94bcbda
/third_party/wpt_tools/wpt/tools/manifest/__init__.py
8c8f189070eaa3201bf0d8e7a37618cf39a65743
[ "BSD-3-Clause", "GPL-1.0-or-later", "MIT", "LGPL-2.0-or-later", "Apache-2.0" ]
permissive
chromium/chromium
aaa9eda10115b50b0616d2f1aed5ef35d1d779d6
a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c
refs/heads/main
2023-08-24T00:35:12.585945
2023-08-23T22:01:11
2023-08-23T22:01:11
120,360,765
17,408
7,102
BSD-3-Clause
2023-09-10T23:44:27
2018-02-05T20:55:32
null
UTF-8
Python
false
false
63
py
from . import item, manifest, sourcefile, update # noqa: F401
d6a216950d956f0368d07afdb48bf084b58ff7e5
8e3a3c845ca3320483b233e8a0db4081aa3b8664
/clases/migrations/0007_contadorpreguntas.py
4a29e06d54f68db53637390cbb6553b607a32b13
[]
no_license
sofide/loiprocesos
7d56398395e6f3302f4d9ec3627ed1b4c24bc17a
4047fa02d0cfbcf744c80d59e3402215f8b294d3
refs/heads/master
2021-07-08T03:26:55.171459
2020-08-04T03:23:10
2020-08-04T03:23:10
61,167,908
0
0
null
null
null
null
UTF-8
Python
false
false
1,089
py
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-24 02:12 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('clases', '0006_auto_20160623_0041'), ] operations = [ migrations.CreateModel( name='ContadorPreguntas', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('cantidad', models.IntegerField()), ('primero', models.BooleanField(default=False)), ('ultimo', models.BooleanField(default=False)), ('clase', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='clases.Clase')), ('exposicion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='clases.Exposicion')), ('preguntador', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='clases.Grupo')), ], ), ]
0ae9d9691f12345ae7d85bd3246ba0ddd6639a08
d525935af3c80584fb2175623591a1fc86349db5
/Problems/Arithmetic mean/tests.py
381339f215755dd7874bf71a568020d119169d2b
[]
no_license
TonyNewbie/CoffeeMachine
63822ffdec8570166ebf44c0ffe51bfa14d33810
319c41189ede6a2e6e33bd15ae675101c3377b62
refs/heads/master
2022-04-22T13:23:47.904126
2020-04-26T07:25:44
2020-04-26T07:25:44
258,960,677
0
0
null
null
null
null
UTF-8
Python
false
false
116
py
from test_helper import check_samples if __name__ == '__main__': check_samples(samples=[["10 15 1 6 3","7.0"]])
ede826fd675c4a60c307a3e7000c07f5f2902746
12f83344cdfe561db39ad9106dbf263ccd919f7e
/Projects/miami_metro/platformdatafetcher/producturlsextractor.py
544ed8554122d5443bb722cf9841e792d34c5f67
[]
no_license
TopWebGhost/Angular-Influencer
ebcd28f83a77a92d240c41f11d82927b98bcea9e
2f15c4ddd8bbb112c407d222ae48746b626c674f
refs/heads/master
2021-01-19T10:45:47.039673
2016-12-05T01:59:26
2016-12-05T01:59:26
82,214,998
1
0
null
null
null
null
UTF-8
Python
false
false
3,071
py
import logging import time import baker from celery.decorators import task import requests import lxml.html from django.conf import settings from selenium.webdriver.support.ui import WebDriverWait from xpathscraper import utils from xpathscraper import xbrowser log = logging.getLogger('platformdatafetcher.producturlsextractor') class ProductUrlsExtractor(object): supported_domains = [] def extract_product_urls(self, url): raise NotImplementedError() class LiketkExtractor(ProductUrlsExtractor): supported_domains = ['liketoknow.it', 'liketk.it'] def extract_product_urls(self, url): try: with xbrowser.XBrowser(headless_display=settings.AUTOCREATE_HEADLESS_DISPLAY) as xb: xb.load_url(url) anchors = WebDriverWait(xb.driver, 10).until( lambda _: xb.els_by_xpath('//div[@class="hoverflow"]//a') ) anchors = [a for a in anchors if a.get_attribute('href') and \ utils.domain_from_url(a.get_attribute('href')) == 'rstyle.me'] urls = utils.unique_sameorder(a.get_attribute('href') for a in anchors) return urls except Exception as e: log.exception(e, extra={'url': url}) return None CLASSES = [ LiketkExtractor, ] ALL_SUPPORTED_DOMAINS = {dom for cls in CLASSES for dom in cls.supported_domains} @baker.command def do_extract_product_urls(url): domain = utils.domain_from_url(url) matching_classes = [cls for cls in CLASSES if domain in cls.supported_domains] res = [] for cls in matching_classes: e = cls() e_res = e.extract_product_urls(url) log.info('%r extracted product urls: %r', e, e_res) res += e_res res = utils.unique_sameorder(res) log.info('All product urls extracted from %r: %r', url, res) return res def get_blog_url_from_liketoknowit(liketoknowit_url=None, xb=None): """ Function to extract user's blog url from her http://liketoknow.it/<username> page. :param liketoknowit_url: url to liketoknowit page :return: blog url """ def get_the_blog_url(xb, liketoknowit_url): xb.load_url(liketoknowit_url) anchors = WebDriverWait(xb.driver, 10).until( lambda _: xb.els_by_xpath('//publisher-header//h5//a') ) anchors = [a for a in anchors if a.get_attribute('href')] urls = utils.unique_sameorder(a.get_attribute('href') for a in anchors) return urls[0] if len(urls) > 0 else None if liketoknowit_url is None: return None try: if xb is None: with xbrowser.XBrowser(headless_display=settings.AUTOCREATE_HEADLESS_DISPLAY) as xb: return get_the_blog_url(xb, liketoknowit_url) else: return get_the_blog_url(xb, liketoknowit_url) except Exception as e: log.exception(e, extra={'url': liketoknowit_url}) return None if __name__ == '__main__': utils.log_to_stderr() baker.run()
60e328a06c3e1fdb001548de48de55c0eb23e0fb
15f321878face2af9317363c5f6de1e5ddd9b749
/solutions_python/Problem_95/2722.py
d7f75c386beda85c91ab2587d1ef7524e8e9592a
[]
no_license
dr-dos-ok/Code_Jam_Webscraper
c06fd59870842664cd79c41eb460a09553e1c80a
26a35bf114a3aa30fc4c677ef069d95f41665cc0
refs/heads/master
2020-04-06T08:17:40.938460
2018-10-14T10:12:47
2018-10-14T10:12:47
null
0
0
null
null
null
null
UTF-8
Python
false
false
843
py
#Author: Alexander Peel a = open("small-a.gen.in", "r") b = open("small-a.gen.out", "r") charMap = {'z': 'q', 'q': 'z'} revCharMap = {'q': 'z'} j=0 for x in range(3): line = a.readline() gLine = b.readline() for i in range(min(len(gLine),len(line))): if line[i] not in charMap.keys(): charMap[line[i]] = gLine[i] revCharMap[gLine[i]] = line[i] for x in sorted(revCharMap.keys()): print(x, revCharMap[x]) a.close() b.close() print("size:", len(charMap)) inp = open("A-small-attempt1.in", 'r') out = open("small-a.out", 'w') #for x in charMap.keys(): #print(x, charMap[x]) T = int (inp.readline()) i = 1 for x in range(T): out.write("Case #" + str(i) + ": ") line = inp.readline() for c in line: out.write(charMap[c]) i+=1
31e3583bf955816d864b8e81b269523797df9360
4275e285b5868d7709d4d491f79906824d7a2770
/test_site/__init__.py
c3ff3b7a2975204be2289bbc87f166225f6f0680
[ "MIT" ]
permissive
MarkLark/dstore-test-site
3bde86b88437bda45672d6c86c413bf4bd1de85c
c353179f65a502412ce3f696d87a47537f2f6143
refs/heads/master
2021-01-23T04:53:09.250107
2017-01-30T10:38:13
2017-01-30T10:38:13
80,403,314
0
0
null
null
null
null
UTF-8
Python
false
false
39
py
from . import app __all__ = [ "app" ]
6a33b0bb6c094e98d634895bdc96a009efda9df4
5e8d86f6ddfd516b9768e8617ced0baca8112f4c
/core-python/Core_Python/regexpkg/Regex_As_3.py
d04581509fb9cb7e606dd55ed7907e899e3dc795
[ "MIT" ]
permissive
bharat-kadchha/tutorials
0a96ce5a3da1a0ceb39a0d464c8f3e2ff397da7c
cd77b0373c270eab923a6db5b9f34c52543b8664
refs/heads/master
2022-12-23T11:49:34.042820
2020-10-06T03:51:20
2020-10-06T03:51:20
272,891,375
1
0
MIT
2020-06-17T06:04:33
2020-06-17T06:04:33
null
UTF-8
Python
false
false
1,211
py
''' The contains_acronym function checks the text for the presence of 2 or more characters or digits surrounded by parentheses, with at least the first character in uppercase (if it's a letter), returning True if the condition is met, or False otherwise. For example, "Instant messaging (IM) is a set of communication technologies used for text-based communication" should return True since (IM) satisfies the match conditions." Fill in the regular expression in this function: ''' import re def contains_acronym(text): pattern = r"[(\^[A-Z0-9][a-zA-Z]{2,}[)\]]" result = re.search(pattern, text) return result != None print(contains_acronym("Instant messaging (IM) is a set of communication technologies used for text-based communication")) # True print(contains_acronym("American Standard Code for Information Interchange (ASCII) is a character encoding standard for electronic communication")) # True print(contains_acronym("Please do NOT enter without permission!")) # False print(contains_acronym("PostScript is a fourth-generation programming language (4GL)")) # True print(contains_acronym("Have fun using a self-contained underwater breathing apparatus (Scuba)!")) # True
bada444bc3e6bdb38b1d1eb129778f62c66ec57a
c50e7eb190802d7849c0d0cea02fb4d2f0021777
/src/storage-preview/azext_storage_preview/vendored_sdks/azure_storagev2/blob/v2022_11_02/_generated/operations/_service_operations.py
75e0f8a8f2f9fde88e1833572a315c4220a645db
[ "LicenseRef-scancode-generic-cla", "MIT" ]
permissive
Azure/azure-cli-extensions
c1615b19930bba7166c282918f166cd40ff6609c
b8c2cf97e991adf0c0a207d810316b8f4686dc29
refs/heads/main
2023-08-24T12:40:15.528432
2023-08-24T09:17:25
2023-08-24T09:17:25
106,580,024
336
1,226
MIT
2023-09-14T10:48:57
2017-10-11T16:27:31
Python
UTF-8
Python
false
false
50,925
py
# pylint: disable=too-many-lines # 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 typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error, ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from .. import models as _models from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False def build_set_properties_request( url: str, *, content: Any, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "properties")) # type: str content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, content=content, **kwargs) def build_get_properties_request( url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "properties")) # type: str version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_statistics_request( url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "stats")) # type: str version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_containers_segment_request( url: str, *, prefix: Optional[str] = None, marker: Optional[str] = None, maxresults: Optional[int] = None, include: Optional[List[Union[str, "_models.ListContainersIncludeType"]]] = None, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp = kwargs.pop("comp", _params.pop("comp", "list")) # type: str version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["comp"] = _SERIALIZER.query("comp", comp, "str") if prefix is not None: _params["prefix"] = _SERIALIZER.query("prefix", prefix, "str") if marker is not None: _params["marker"] = _SERIALIZER.query("marker", marker, "str") if maxresults is not None: _params["maxresults"] = _SERIALIZER.query("maxresults", maxresults, "int", minimum=1) if include is not None: _params["include"] = _SERIALIZER.query("include", include, "[str]", div=",") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_user_delegation_key_request( url: str, *, content: Any, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "userdelegationkey")) # type: str content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "account")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "properties")) # type: str version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["restype"] = _SERIALIZER.query("restype", restype, "str") _params["comp"] = _SERIALIZER.query("comp", comp, "str") # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_submit_batch_request( url: str, *, content_length: int, content: IO, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp = kwargs.pop("comp", _params.pop("comp", "batch")) # type: str multipart_content_type = kwargs.pop( "multipart_content_type", _headers.pop("Content-Type", None) ) # type: Optional[str] version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["comp"] = _SERIALIZER.query("comp", comp, "str") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) # Construct headers _headers["Content-Length"] = _SERIALIZER.header("content_length", content_length, "int") if multipart_content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("multipart_content_type", multipart_content_type, "str") _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) def build_filter_blobs_request( url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, where: Optional[str] = None, marker: Optional[str] = None, maxresults: Optional[int] = None, include: Optional[List[Union[str, "_models.FilterBlobsIncludeItem"]]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp = kwargs.pop("comp", _params.pop("comp", "blobs")) # type: str version = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02")) # type: str accept = _headers.pop("Accept", "application/xml") # Construct URL _url = kwargs.pop("template_url", "{url}") path_format_arguments = { "url": _SERIALIZER.url("url", url, "str", skip_quote=True), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters _params["comp"] = _SERIALIZER.query("comp", comp, "str") if timeout is not None: _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0) if where is not None: _params["where"] = _SERIALIZER.query("where", where, "str") if marker is not None: _params["marker"] = _SERIALIZER.query("marker", marker, "str") if maxresults is not None: _params["maxresults"] = _SERIALIZER.query("maxresults", maxresults, "int", minimum=1) if include is not None: _params["include"] = _SERIALIZER.query("include", include, "[str]", div=",") # Construct headers _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str") if request_id_parameter is not None: _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) class ServiceOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.storage.blob.AzureBlobStorage`'s :attr:`service` attribute. """ models = _models def __init__(self, *args, **kwargs): input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def set_properties( # pylint: disable=inconsistent-return-statements self, storage_service_properties: _models.StorageServiceProperties, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> None: """Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. :param storage_service_properties: The StorageService properties. Required. :type storage_service_properties: ~azure.storage.blob.models.StorageServiceProperties :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :keyword restype: restype. Default value is "service". Note that overriding this default value may result in unsupported behavior. :paramtype restype: str :keyword comp: comp. Default value is "properties". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "properties")) # type: str content_type = kwargs.pop("content_type", _headers.pop("Content-Type", "application/xml")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[None] _content = self._serialize.body(storage_service_properties, "StorageServiceProperties", is_xml=True) request = build_set_properties_request( url=self._config.url, timeout=timeout, request_id_parameter=request_id_parameter, restype=restype, comp=comp, content_type=content_type, version=self._config.version, content=_content, template_url=self.set_properties.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) if cls: return cls(pipeline_response, None, response_headers) set_properties.metadata = {"url": "{url}"} # type: ignore @distributed_trace def get_properties( self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> _models.StorageServiceProperties: """gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :keyword restype: restype. Default value is "service". Note that overriding this default value may result in unsupported behavior. :paramtype restype: str :keyword comp: comp. Default value is "properties". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageServiceProperties or the result of cls(response) :rtype: ~azure.storage.blob.models.StorageServiceProperties :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "properties")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.StorageServiceProperties] request = build_get_properties_request( url=self._config.url, timeout=timeout, request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, template_url=self.get_properties.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) deserialized = self._deserialize("StorageServiceProperties", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized get_properties.metadata = {"url": "{url}"} # type: ignore @distributed_trace def get_statistics( self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> _models.StorageServiceStats: """Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account. :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :keyword restype: restype. Default value is "service". Note that overriding this default value may result in unsupported behavior. :paramtype restype: str :keyword comp: comp. Default value is "stats". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StorageServiceStats or the result of cls(response) :rtype: ~azure.storage.blob.models.StorageServiceStats :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "stats")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.StorageServiceStats] request = build_get_statistics_request( url=self._config.url, timeout=timeout, request_id_parameter=request_id_parameter, restype=restype, comp=comp, version=self._config.version, template_url=self.get_statistics.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) deserialized = self._deserialize("StorageServiceStats", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized get_statistics.metadata = {"url": "{url}"} # type: ignore @distributed_trace def list_containers_segment( self, prefix: Optional[str] = None, marker: Optional[str] = None, maxresults: Optional[int] = None, include: Optional[List[Union[str, "_models.ListContainersIncludeType"]]] = None, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> _models.ListContainersSegmentResponse: """The List Containers Segment operation returns a list of the containers under the specified account. :param prefix: Filters the results to return only containers whose name begins with the specified prefix. Default value is None. :type prefix: str :param marker: A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client. Default value is None. :type marker: str :param maxresults: Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000. Default value is None. :type maxresults: int :param include: Include this parameter to specify that the container's metadata be returned as part of the response body. Default value is None. :type include: list[str or ~azure.storage.blob.models.ListContainersIncludeType] :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :keyword comp: comp. Default value is "list". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ListContainersSegmentResponse or the result of cls(response) :rtype: ~azure.storage.blob.models.ListContainersSegmentResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp = kwargs.pop("comp", _params.pop("comp", "list")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ListContainersSegmentResponse] request = build_list_containers_segment_request( url=self._config.url, prefix=prefix, marker=marker, maxresults=maxresults, include=include, timeout=timeout, request_id_parameter=request_id_parameter, comp=comp, version=self._config.version, template_url=self.list_containers_segment.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) deserialized = self._deserialize("ListContainersSegmentResponse", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized list_containers_segment.metadata = {"url": "{url}"} # type: ignore @distributed_trace def get_user_delegation_key( self, key_info: _models.KeyInfo, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> _models.UserDelegationKey: """Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token authentication. :param key_info: Key information. Required. :type key_info: ~azure.storage.blob.models.KeyInfo :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :keyword restype: restype. Default value is "service". Note that overriding this default value may result in unsupported behavior. :paramtype restype: str :keyword comp: comp. Default value is "userdelegationkey". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserDelegationKey or the result of cls(response) :rtype: ~azure.storage.blob.models.UserDelegationKey :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "service")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "userdelegationkey")) # type: str content_type = kwargs.pop("content_type", _headers.pop("Content-Type", "application/xml")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.UserDelegationKey] _content = self._serialize.body(key_info, "KeyInfo", is_xml=True) request = build_get_user_delegation_key_request( url=self._config.url, timeout=timeout, request_id_parameter=request_id_parameter, restype=restype, comp=comp, content_type=content_type, version=self._config.version, content=_content, template_url=self.get_user_delegation_key.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) deserialized = self._deserialize("UserDelegationKey", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized get_user_delegation_key.metadata = {"url": "{url}"} # type: ignore @distributed_trace def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Returns the sku name and account kind. :keyword restype: restype. Default value is "account". Note that overriding this default value may result in unsupported behavior. :paramtype restype: str :keyword comp: comp. Default value is "properties". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) restype = kwargs.pop("restype", _params.pop("restype", "account")) # type: str comp = kwargs.pop("comp", _params.pop("comp", "properties")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_get_account_info_request( url=self._config.url, restype=restype, comp=comp, version=self._config.version, template_url=self.get_account_info.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name")) response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind")) response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled")) if cls: return cls(pipeline_response, None, response_headers) get_account_info.metadata = {"url": "{url}"} # type: ignore @distributed_trace def submit_batch( self, content_length: int, body: IO, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any ) -> Iterator[bytes]: """The Batch operation allows multiple API calls to be embedded into a single HTTP request. :param content_length: The length of the request. Required. :type content_length: int :param body: Initial data. Required. :type body: IO :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :keyword comp: comp. Default value is "batch". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Iterator of the response bytes or the result of cls(response) :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp = kwargs.pop("comp", _params.pop("comp", "batch")) # type: str multipart_content_type = kwargs.pop( "multipart_content_type", _headers.pop("Content-Type", "application/xml") ) # type: str cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] _content = body request = build_submit_batch_request( url=self._config.url, content_length=content_length, timeout=timeout, request_id_parameter=request_id_parameter, comp=comp, multipart_content_type=multipart_content_type, version=self._config.version, content=_content, template_url=self.submit_batch.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=True, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["Content-Type"] = self._deserialize("str", response.headers.get("Content-Type")) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) deserialized = response.stream_download(self._client._pipeline) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized submit_batch.metadata = {"url": "{url}"} # type: ignore @distributed_trace def filter_blobs( self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, where: Optional[str] = None, marker: Optional[str] = None, maxresults: Optional[int] = None, include: Optional[List[Union[str, "_models.FilterBlobsIncludeItem"]]] = None, **kwargs: Any ) -> _models.FilterBlobSegment: """The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search expression. Filter blobs searches across all containers within a storage account but can be scoped within the expression to a single container. :param timeout: The timeout parameter is expressed in seconds. For more information, see :code:`<a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a>`. Default value is None. :type timeout: int :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Default value is None. :type request_id_parameter: str :param where: Filters the results to return only to return only blobs whose tags match the specified expression. Default value is None. :type where: str :param marker: A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client. Default value is None. :type marker: str :param maxresults: Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000. Default value is None. :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. Default value is None. :type include: list[str or ~azure.storage.blob.models.FilterBlobsIncludeItem] :keyword comp: comp. Default value is "blobs". Note that overriding this default value may result in unsupported behavior. :paramtype comp: str :keyword callable cls: A custom type or function that will be passed the direct response :return: FilterBlobSegment or the result of cls(response) :rtype: ~azure.storage.blob.models.FilterBlobSegment :raises ~azure.core.exceptions.HttpResponseError: """ error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) comp = kwargs.pop("comp", _params.pop("comp", "blobs")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FilterBlobSegment] request = build_filter_blobs_request( url=self._config.url, timeout=timeout, request_id_parameter=request_id_parameter, where=where, marker=marker, maxresults=maxresults, include=include, comp=comp, version=self._config.version, template_url=self.filter_blobs.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers["x-ms-client-request-id"] = self._deserialize( "str", response.headers.get("x-ms-client-request-id") ) response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id")) response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version")) response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date")) deserialized = self._deserialize("FilterBlobSegment", pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized filter_blobs.metadata = {"url": "{url}"} # type: ignore
dc5ce011053d51bc444a7a253c7fd41a38ec9dfb
74eafe55252eff97fd9a2e1e6564ecf243f7c058
/print_numbers.py
905050698fd2de935082c1635734d8584b74115a
[]
no_license
srikanthpragada/demo_24_june_2019
c5ddef71eb721367d656924d312e9ca7ac80c34a
fa7aca273d1ffe6ded34795a639910ab91ce66a0
refs/heads/master
2020-06-11T10:19:22.384096
2019-08-01T15:28:26
2019-08-01T15:28:26
193,929,558
0
0
null
null
null
null
UTF-8
Python
false
false
115
py
# print numbers from 1 to 10 n = 1 while n <= 10: print(n) n += 1 for n in range(1, 11, 2): print(n)
97f89bd27f13c0f02aecc8b7b6338f2d4ceb35d4
aa9a0acc85a7328969a81527f3ed7c155a245727
/chapter_7/mountain_poll.py
1cbe3e263c36adbf0e5ad45eaf8e28e5f361de72
[]
no_license
mwnickerson/python-crash-course
7035e21e1ee60c05d1d475ebcf04bd6a93c5967a
18784c7e3abfb74f85f8c96cb0f8e606cab6dccc
refs/heads/main
2023-08-03T20:14:49.883626
2021-09-25T05:31:12
2021-09-25T05:31:12
400,644,375
0
0
null
null
null
null
UTF-8
Python
false
false
738
py
# mountain poll # set a flag to indicate that polling is active responses = {} # set a flag to stop polling_active = True while polling_active: # prompt for the person's name and response name = input("\nWhat is your name? ") response = input("Which mountain would you like to climb someday? ") # store the response in the dictionary responses[name] = response # find out if anyone else is going to take the poll repeat = input("Would you like to let another person respond? (yes/ no) " ) if repeat == 'no': polling_active = False # polling is complete. show the results print("\n--- Poll Results ---") for name, response in responses.items(): print(f"{name} would like to climb {response}")
f61d55e3301a8e2accce79dfa29797592506b149
01ebe45440f08158c796466cca679dec9687d93c
/tests/cx_devices/devices_test.py
c069a3a600767508066fdd74089c959fea2e6c90
[ "MIT" ]
permissive
ilarrain/controllerx
694211a247055d2a7417ba3648cdb099468c857b
0a1ef68b3fd2b6dbb2a499b6b9920e6b3bfa2185
refs/heads/master
2023-02-01T00:50:23.731673
2020-09-19T22:00:14
2020-09-19T22:00:14
297,980,184
0
0
null
2020-09-23T13:33:42
2020-09-23T13:33:41
null
UTF-8
Python
false
false
1,911
py
import cx_devices as devices_module from cx_core import Controller from cx_core.controller import ReleaseHoldController from tests.test_utils import get_instances def check_mapping(mapping, all_possible_actions, device): device_name = device.__class__.__name__ if mapping is None: return if issubclass(device.__class__, ReleaseHoldController): delay = device.default_delay() if delay < 0: raise ValueError( f"`default_delay` should be a positive integer and the value is `{delay}`. " f"Device class: {device_name}" ) for k, v in mapping.items(): if not isinstance(v, str): raise ValueError( "The value from the mapping should be a string, matching " "one of the actions from the controller. " f"The possible actions are: {all_possible_actions}. " f"Device class: {device_name}" ) if v not in all_possible_actions: raise ValueError( f"{device_name}: `{v}` not found in the list of possible action from the controller. " + f"The possible actions are: {all_possible_actions}" ) def test_devices(hass_mock): devices = get_instances( devices_module.__file__, devices_module.__package__, Controller ) for device in devices: type_actions_mapping = device.get_type_actions_mapping() if type_actions_mapping is None: continue possible_actions = list(type_actions_mapping.keys()) integration_mappings_funcs = [ device.get_z2m_actions_mapping, device.get_deconz_actions_mapping, device.get_zha_actions_mapping, ] for func in integration_mappings_funcs: mappings = func() check_mapping(mappings, possible_actions, device)
a357e72273bb8edb1f639d91c440f562df43333f
9743d5fd24822f79c156ad112229e25adb9ed6f6
/xai/brain/wordbase/otherforms/_stagehands.py
1e2b38dd0830cac5b9bb7439a49fbae6ba2fda40
[ "MIT" ]
permissive
cash2one/xai
de7adad1758f50dd6786bf0111e71a903f039b64
e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6
refs/heads/master
2021-01-19T12:33:54.964379
2017-01-28T02:00:50
2017-01-28T02:00:50
null
0
0
null
null
null
null
UTF-8
Python
false
false
234
py
#calss header class _STAGEHANDS(): def __init__(self,): self.name = "STAGEHANDS" self.definitions = stagehand self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} self.basic = ['stagehand']
f6f1ad958285f676ec5c7f6800454799dbcb29b6
c77148a25435b50a35fceab36112fba18dbb0866
/backup/Jun13/units/ZemoraVoidbringer.py
2e0ac05310a366bbc1dee0479db209f1851a9f09
[]
no_license
SozBroz/PrismataBot
51fbecf90950d13eb52606a5b18984b5474746ba
f375ca8dc396abbca4134f70cb262fc78b90a17e
refs/heads/master
2020-05-31T13:37:50.102010
2019-06-06T02:48:01
2019-06-06T02:48:01
136,826,949
0
0
null
null
null
null
UTF-8
Python
false
false
803
py
#!/usr/bin.python3.6 class ZemoraVoidbringer: def __init__(self,owner): self.owner=owner self.lifespan=-1 self.frontline=False self.cooldown=6 self.defaultBlocking=False self.assignedBlocking=False self.health=20 self.fragile=True self.attack=8 self.startTurnDict={ } self.onClickDict={ "gold":8, "attack":8 } self.onClickCost={ "green":8 } def __str__(self): return "Zemora Voidbringer" def startTurn(self): return True def canClick(self): for i in self.OnClickCost if owner.resDict[i]<=onClickCost: return False return True def onClick(self): for i in self.onClickCost: player.resDict[i]-=self.onClickCost[i] def ZemoraVoidbringerCost(): buyCostDict={ "gold":5, "green":3 } return buyCostDict,True,1,[],"Zemora Voidbringer"
28338e414ad6403322decc57220ab896441e6b99
11078f43584f75608e86cc4dcbaa37a5a13f24db
/bulk/management/commands/bulk_export.py
448929cc4f0c74d2896e2f1b63dc5e46a14aa12a
[ "MIT" ]
permissive
tophers42/openstates.org
90d8cb217f21421c1284fa831c522e90125e5e04
76708aa255e3e646ea4f8351a38cf01e286ca7a7
refs/heads/master
2022-09-27T08:25:46.413675
2020-05-19T15:27:29
2020-05-19T15:27:29
266,882,535
0
0
MIT
2020-05-25T21:21:20
2020-05-25T21:21:20
null
UTF-8
Python
false
false
9,960
py
import os import csv import json import datetime import tempfile import zipfile import uuid import boto3 import base62 from django.core.management.base import BaseCommand from django.db.models import F from openstates_metadata import STATES_BY_NAME from openstates.data.models import ( LegislativeSession, Bill, BillAbstract, BillAction, BillTitle, BillIdentifier, RelatedBill, BillSponsorship, BillDocument, BillVersion, BillDocumentLink, BillVersionLink, BillSource, VoteEvent, PersonVote, VoteCount, VoteSource, ) from ...models import DataExport from utils.common import abbr_to_jid def _str_uuid(): return base62.encode(uuid.uuid4().int) def export_csv(filename, data, zf): num = len(data) if not num: return headers = data[0].keys() with tempfile.NamedTemporaryFile("w") as f: print("writing", filename, num, "records") of = csv.DictWriter(f, headers) of.writeheader() of.writerows(data) f.flush() zf.write(f.name, filename) return num def export_json(filename, data, zf): num = len(data) if not num: return with tempfile.NamedTemporaryFile("w") as f: print("writing", filename, num, "records") json.dump(data, f) f.flush() zf.write(f.name, filename) return num def _docver_to_json(dv): return { "note": dv.note, "date": dv.date, "links": list(dv.links.values("url", "media_type")), } def _vote_to_json(v): return { "identifier": v.identifier, "motion_text": v.motion_text, "motion_classification": v.motion_classification, "start_date": v.start_date, "result": v.result, "organization__classification": v.organization.classification, "counts": list(v.counts.values("option", "value")), "votes": list(v.votes.values("option", "voter_name")), } def _bill_to_json(b): d = { "id": b.id, "legislative_session": b.legislative_session.identifier, "jurisdiction_name": b.legislative_session.jurisdiction.name, "identifier": b.identifier, "title": b.title, "chamber": b.from_organization.classification, "classification": b.classification, "subject": b.subject, "abstracts": list(b.abstracts.values("abstract", "note", "date")), "other_titles": list(b.other_titles.values("title", "note")), "other_identifiers": list( b.other_identifiers.values("note", "identifier", "scheme") ), "actions": list( b.actions.values( "organization__name", "description", "date", "classification", "order" ) ), # TODO: action related entities "related_bills": list(b.related_bills.values("related_bill_id")), "sponsors": list(b.sponsorships.values("name", "primary", "classification")), "documents": [_docver_to_json(d) for d in b.documents.all()], "versions": [_docver_to_json(d) for d in b.versions.all()], "sources": list(b.sources.values("url")), # votes "votes": [_vote_to_json(v) for v in b.votes.all()], } try: d["raw_text"] = b.searchable.raw_text d["raw_text_url"] = b.searchable.version_link.url except Exception: pass return d def export_session_csv(state, session): sobj = LegislativeSession.objects.get( jurisdiction_id=abbr_to_jid(state), identifier=session ) bills = Bill.objects.filter(legislative_session=sobj).values( "id", "identifier", "title", "classification", "subject", session_identifier=F("legislative_session__identifier"), jurisdiction=F("legislative_session__jurisdiction__name"), organization_classification=F("from_organization__classification"), ) if not bills.count(): print(f"no bills for {state} {session}") return random = _str_uuid() filename = f"/tmp/{state}_{session}_csv_{random}.zip" zf = zipfile.ZipFile(filename, "w") ts = datetime.datetime.utcnow() zf.writestr( "README", f"""Open States Data Export State: {state} Session: {session} Generated At: {ts} CSV Format Version: 2.0 """, ) export_csv(f"{state}/{session}/{state}_{session}_bills.csv", bills, zf) for Model, fname in ( (BillAbstract, "bill_abstracts"), (BillTitle, "bill_titles"), (BillIdentifier, "bill_identifiers"), (BillAction, "bill_actions"), (BillSource, "bill_sources"), (RelatedBill, "bill_related_bills"), (BillSponsorship, "bill_sponsorships"), (BillDocument, "bill_documents"), (BillVersion, "bill_versions"), ): subobjs = Model.objects.filter(bill__legislative_session=sobj).values() export_csv(f"{state}/{session}/{state}_{session}_{fname}.csv", subobjs, zf) subobjs = BillDocumentLink.objects.filter( document__bill__legislative_session=sobj ).values() export_csv( f"{state}/{session}/{state}_{session}_bill_document_links.csv", subobjs, zf ) subobjs = BillVersionLink.objects.filter( version__bill__legislative_session=sobj ).values() export_csv( f"{state}/{session}/{state}_{session}_bill_version_links.csv", subobjs, zf ) # TODO: BillActionRelatedEntity # Votes votes = VoteEvent.objects.filter(legislative_session=sobj).values( "id", "identifier", "motion_text", "motion_classification", "start_date", "result", "organization_id", "bill_id", "bill_action_id", jurisdiction=F("legislative_session__jurisdiction__name"), session_identifier=F("legislative_session__identifier"), ) export_csv(f"{state}/{session}/{state}_{session}_votes.csv", votes, zf) for Model, fname in ( (PersonVote, "vote_people"), (VoteCount, "vote_counts"), (VoteSource, "vote_sources"), ): subobjs = Model.objects.filter(vote_event__legislative_session=sobj).values() export_csv(f"{state}/{session}/{state}_{session}_{fname}.csv", subobjs, zf) return filename def export_session_json(state, session): sobj = LegislativeSession.objects.get( jurisdiction_id=abbr_to_jid(state), identifier=session ) bills = [ _bill_to_json(b) for b in Bill.objects.filter(legislative_session=sobj) .select_related( "legislative_session", "legislative_session__jurisdiction", "from_organization", "searchable", ) .prefetch_related( "abstracts", "other_titles", "other_identifiers", "actions", "related_bills", "sponsorships", "documents", "documents__links", "versions", "versions__links", "sources", "votes", "votes__counts", "votes__votes", ) ] random = _str_uuid() filename = f"/tmp/{state}_{session}_json_{random}.zip" zf = zipfile.ZipFile(filename, "w") ts = datetime.datetime.utcnow() zf.writestr( "README", f"""Open States Data Export State: {state} Session: {session} Generated At: {ts} JSON Format Version: 1.0 """, ) if export_json(f"{state}/{session}/{state}_{session}_bills.json", bills, zf): return filename def upload_and_publish(state, session, filename, data_type): sobj = LegislativeSession.objects.get( jurisdiction_id=abbr_to_jid(state), identifier=session ) s3 = boto3.client("s3") BULK_S3_BUCKET = "data.openstates.org" basename = os.path.basename(filename) s3_path = f"{data_type}/latest/" s3_url = f"https://{BULK_S3_BUCKET}/{s3_path}{basename}" s3.upload_file( filename, BULK_S3_BUCKET, s3_path + basename, ExtraArgs={"ACL": "public-read"} ) print("uploaded", s3_url) obj, created = DataExport.objects.update_or_create( session=sobj, data_type=data_type, defaults=dict(url=s3_url), ) def get_available_sessions(state): return sorted( s.identifier for s in LegislativeSession.objects.filter(jurisdiction_id=abbr_to_jid(state)) ) def export_data(state, session, data_type): if data_type == "csv": filename = export_session_csv(state, session) else: filename = export_session_json(state, session) if filename: upload_and_publish(state, session, filename, data_type) def export_all_states(data_type): for state in STATES_BY_NAME.values(): for session in get_available_sessions(state.abbr): export_data(state.abbr, session, data_type) class Command(BaseCommand): help = "export data as CSV" def add_arguments(self, parser): parser.add_argument("state") parser.add_argument("sessions", nargs="*") parser.add_argument("--all-sessions", action="store_true") parser.add_argument("--format") def handle(self, *args, **options): data_type = options["format"] if data_type not in ("csv", "json"): raise ValueError("--format must be csv or json") state = options["state"] # special case if state == "all": export_all_states(data_type) return sessions = get_available_sessions(state) if options["all_sessions"]: options["sessions"] = sessions if not options["sessions"]: print("available sessions:") for session in sessions: print(" ", session) else: for session in options["sessions"]: if session in sessions: export_data(state, session, data_type)
ac6069daea455c23cbfa5a901efeccb900fd13c5
5785d7ed431b024dd910b642f10a6781df50e4aa
/revise-daily/google/educative/dp/10_subset_sum_partition.py
8731a79078aa769c5036698c2d03b4fcc1f54262
[]
no_license
kashyapa/interview-prep
45d77324446da34d99bf8efedb3544b367b5523e
7060c090c40602fb9c4778eace2078e1b51e235b
refs/heads/master
2023-07-28T13:12:49.515299
2021-09-06T14:33:25
2021-09-06T14:33:25
403,706,510
0
0
null
null
null
null
UTF-8
Python
false
false
1,050
py
# Given a set of positive numbers, find if we can partition it into two subsets such that the sum of elements in both the subsets is equal. def equal_subset_sum_partition(nums): s = sum(nums) def rec(idx, remaining_sum): if idx == len(nums): return remaining_sum == 0 if remaining_sum == 0: return True if nums[idx] < remaining_sum: with_num = rec(idx+1, remaining_sum-nums[idx]) if with_num: return True return rec(idx+1, remaining_sum) return rec(0, s) def equal_subset_sum_dp(nums): s = sum(nums) // 2 dp = [[False for _ in range(s+1)] for _ in range(len(nums))] for i in range(len(nums)): dp[i][0] = True for i in range(s+1): dp[0][i] = True if nums[0] == i else False for i in range(len(nums)): for j in range(s+1): if dp[i-1][j]: dp[i][j] = True if nums[i] <= j: dp[i][j] = dp[i-1][j-nums[i]] return dp[len(nums)-1][s]
b85f0c1051c650952f431887a123586c06dde8a1
dae8e0070b093d662fdeea026e3eb48814af73c5
/Autosampler/startRHX.py
aef73c56a5e8509ca416b314aa8ee12e017a7281
[]
no_license
clipo/RHX
43d3dc8e0f2a4d90a8c83ec2a9e4fc0be30fddae
93286e17df1ec05d98d791671d641d86b7f588b9
refs/heads/master
2021-01-02T23:06:23.023476
2013-04-27T21:42:01
2013-04-27T21:42:01
null
0
0
null
null
null
null
UTF-8
Python
false
false
80,221
py
###Simple program that moves the motors and the arms - used for finding positions. ##Imports import sys import easygui # comment while on Mac OS X #sys.path.insert(0, "/usr/local/lib/python2.7/site-packages/") import easygui import logging import communication from Tkinter import * import tkFileDialog from tkMessageBox import * from tkColorChooser import askcolor from tkFileDialog import askopenfilename import time from datetime import datetime from datetime import timedelta import os import io import re import serial from ctypes import * from time import sleep import DataReadWrite import xyzRobot import math import communication LOGINT = 5 logger = logging.getLogger("AutoSampler-startRHX") logger.setLevel(logging.DEBUG) # create file handler which logs even debug messages today_date = datetime.today() datestring = today_date.strftime("%Y-%m-%d-%H-%M") if sys.platform == "darwin": ## Mac OS X debugfilename = "/Users/Clipo/Dropbox/Rehydroxylation/Logger/Logs/rhx-startRHX" + datestring + "_debug.log" else: debugfilename = "c:/Users/Archy/Dropbox/Rehydroxylation/Logger/Logs/rhx-startRHX" + datestring + "_debug.log" fh = logging.FileHandler(debugfilename) fh.setLevel(logging.DEBUG) # create console handler with a higher log level ch = logging.StreamHandler() ch.setLevel(logging.ERROR) # create formatter and add it to the handlers formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh.setFormatter(formatter) ch.setFormatter(formatter) # add the handlers to the logger logger.addHandler(fh) logger.addHandler(ch) ##Establish GUI ### make these global root = Tk() root.wm_title("RHX Measurement") init = Toplevel() init.withdraw() prefire = Toplevel() prefire.withdraw() postfire = Toplevel() postfire.withdraw() robotStatus = Toplevel() robotStatus.wm_title("Robot Status") robotStatus.withdraw() moveArm = Toplevel() moveArm.wm_title("Move Arm") moveArm.withdraw() setupCrucibles = Toplevel() setupCrucibles.withdraw() ## CONSTANTS HOME = 0 INSIDE_BALANCE_POSITION = 10000 OUTSIDE_BALANCE_POSITION = 20000 #### These are all variables for the displays. Ive made them global so that I can access them anywhere here. Kludgy LOCATION_TEMPERATURE = DoubleVar() ASSEMBLAGE = StringVar() MAXPOSITIONS = IntVar() MAXPOSITIONS.set(25) ## this is a constant for the max # of sample position (now 25) POSITION_NAME = StringVar() ## this is the name of the position -- HOME, SAMPLE, OUTSIDE_BALANCE, INSIDE_BALANCE are possibilities ARM_STATUS = StringVar() ## status for arm TOP, SAMPLE or BALANCE LIGHTSTATUS = StringVar() ### ON OR OFF LIGHTSTATUS.set("OFF") XZERO = StringVar() YZERO = StringVar() ZZERO = StringVar() RESUBMIT = StringVar() RUNINFOSTATUS = StringVar() RUNID = IntVar() INITIALS = StringVar() DURATION = IntVar() NUMBEROFSAMPLES = IntVar() START_POSITION = IntVar() START_POSITION.set(1) XMOTORPOSITION = StringVar() YMOTORPOSITION = StringVar() ZMOTORPOSITION = StringVar() GRIPPERPOSITION = StringVar() BALANCEWEIGHT = DoubleVar() BALANCESTATUS = StringVar() ABSOLUTEXPOSITION = StringVar() ABSOLUTEYPOSITION = StringVar() ABSOLUTEZPOSITION = StringVar() CRUCIBLEYESNO = StringVar() MOTORSTEP = StringVar() MOTORSTEP.set("5000") ZMOTORSTEP = StringVar() ZMOTORSTEP.set("5000") BALANCEDOOR = StringVar() SAMPLEPOSITION = StringVar() POSITION = IntVar() TEMP = DoubleVar() HUMIDITY = DoubleVar() REPS = IntVar() INTERVAL = IntVar() INTERVAL.set(5) RUNID = IntVar() RUNID.set(1) DATEOFFIRING = StringVar() TIMEOFFIRING = StringVar() DURATIONOFFIRING = IntVar() RATEOFHEATING = IntVar() TEMPOFFIRING = IntVar() CURRENTPOSITION = IntVar() CURRENTREP = IntVar() NAME = StringVar() LOCATION = StringVar() POSITION = IntVar() SAMPLE_POSITION = IntVar() MCOUNT = IntVar() CURRENTSTEP = StringVar() STATUS = StringVar() DURATION = IntVar() LOGGERINTERVAL = IntVar() RUNID = IntVar() NUMBEROFSAMPLES = IntVar() STANDARD_BALANCE = DoubleVar() TIMEREMAINING = IntVar() TIMEELAPSEDMIN = DoubleVar() TEMPERATURE = DoubleVar() HUMIDITY = DoubleVar() SAMPLENUM = IntVar() FILENAME = StringVar() RHTEMP2000TEMP = DoubleVar() RHTEMP2000HUMIDITY = DoubleVar() CYCLE = IntVar() PRECISIONTEMP = DoubleVar() DATABASENAME = StringVar() DBDIRECTORY = StringVar() #DBDIRECTORY.set("c:/Users/Archy/Dropbox/Rehydroxylation/") tempCorrection = 0.0 rhCorrection = 0.0 fileName = "RHX.sqlite" dirname = "/Users/Archy/Dropbox/Rehydroxylation/" CRUCIBLEWEIGHT = DoubleVar() CRUCIBLEWEIGHTSTDDEV = DoubleVar() SAMPLEWEIGHT = DoubleVar() CURRENTSAMPLE = IntVar() ABSOLUTEXZERO = IntVar() ABSOLUTEYZERO = IntVar() ABSOLUTEXZERO.set(3) ABSOLUTEYZERO.set(230) COUNTSFORSTATS = IntVar() COUNTSFORSTATS.set(3) MEAN = DoubleVar() STDEV = DoubleVar() VARIANCE = DoubleVar() SETRUNID = IntVar() POSTFIREWEIGHT = DoubleVar() POSTFIREWEIGHTSTDDEV = DoubleVar() CURRENTSAMPLE = IntVar() INITIALWEIGHT = DoubleVar() INITIALWEIGHTSTDDEV = DoubleVar() NOTES = StringVar() INITIALSHERDWEIGHTSTDDEV = DoubleVar() INITIALWEIGHTSTDDEV = DoubleVar() SAMPLEWEIGHTSTDDEV = DoubleVar() SAMPLEZPOSITION = IntVar() BALANCEZPOSITION = IntVar() MAXXMOTORVELOCITY = DoubleVar() MAXYMOTORVELOCITY = DoubleVar() MAXZMOTORVELOCITY = DoubleVar() USINGSTANDARDBALANCE = BooleanVar() ZTOPPOSITION = BooleanVar() def quit(): value = DataReadWrite.closeDatabase() if value is False: logger.error("There has been an error since closeDatabase returned FALSE") errorMessage("There has been a problem. Cannot close the current sample database file") value = DataReadWrite.closeXYDatabase() if value is False: logger.error("There has been an error since closeXYDatabase returned FALSE") errorMessage("There has been a problem. Cannot close XY database (RHX.sqlite)") return False prefire.quit() postfire.quit() init.quit() root.quit() xyzRobot.KillMotors() sys.exit(1) def errorMessage(message): title = "Error! Continue?" if easygui.ccbox(message, title): # show a Continue/Cancel dialog pass # user chose Continue else: return False return True def are_you_sure(message): msg = "Do you really want to do this: %s " % message title = "Continue?" if easygui.ccbox(msg, title): # show a Continue/Cancel dialog pass # user chose Continue else: return False return True #Program Controls def restart_program(): try: xyzRobot.KillMotors() except: pass python = sys.executable os.execl(python, python, *sys.argv) return True def KillProgram(): logger.debug("Quit has been requested by users. So quitting.") logger.debug("KillProgram!") try: xyzRobot.KillMotors() except: pass #DataReadWrite.tempHumidity.close() DataReadWrite.balance.close() #if (DataReadWrite.conn is not None): # DataReadWrite.closeDatabase() DataReadWrite.closeDatabase() DataReadWrite.closeXYDatabase() DataReadWrite.standard_balance.close() root.quit() init.quit() prefire.quit() postfire.quit() return True def update_windows(): ## To prevent negative values. ## so set the motor to 0 and the abs coordinate value to 0 ## for each dimension separately. if xyzRobot.getAbsoluteXPosition() < 0: xyzRobot.setXCoordinate(HOME) ABSOLUTEXPOSITION.set(HOME) if xyzRobot.getAbsoluteYPosition() < 0: xyzRobot.setYCoordinate(HOME) ABSOLUTEYPOSITION.set(HOME) if xyzRobot.getXCoordinate() < 0: xyzRobot.setXMotorPosition(HOME) XMOTORPOSITION.set(HOME) if xyzRobot.getYCoordinate() < 0: xyzRobot.setYMotorPosition(HOME) YMOTORPOSITION.set(HOME) USINGSTANDARDBALANCE.set(DataReadWrite.STANDARDBALANCE) XMOTORPOSITION.set(xyzRobot.getXMotorPosition()) YMOTORPOSITION.set(xyzRobot.getYMotorPosition()) ZMOTORPOSITION.set(xyzRobot.getZMotorPosition()) XZERO.set(xyzRobot.atXZero()) YZERO.set(xyzRobot.atYZero()) ZZERO.set(xyzRobot.atZZero()) PRECISIONTEMP.set(xyzRobot.getTemperature()) weight, status = DataReadWrite.readInstantWeightFromBalance() #TODO: renable the standard balance standardBalance = 0.0 if DataReadWrite.STANDARDBALANCE is True: standardBalance = float(DataReadWrite.readStandardBalance()) STANDARD_BALANCE.set(standardBalance) BALANCEWEIGHT.set(weight) BALANCESTATUS.set(status) ## only check the setting if we are supposedly at HOME ## this is because sample positions really close to home might still trigger the sensors if SAMPLE_POSITION.get() == HOME: if xyzRobot.atXZero() == "TRUE" and xyzRobot.atYZero() == "TRUE": value = xyzRobot.setAbsZeroXY() POSITION_NAME.set("HOME") SAMPLE_POSITION.set(HOME) XMOTORPOSITION.set(HOME) YMOTORPOSITION.set(HOME) if XZERO.get() == "TRUE": ## reset the Absolute Zero points value = xyzRobot.setXMotorPosition(HOME) if YZERO.get() == "TRUE": value = xyzRobot.setYMotorPosition(HOME) if xyzRobot.atXZero() == "TRUE": XZERO.set("TRUE") XMOTORPOSITION.set(HOME) value = xyzRobot.setXMotorPosition(HOME) value = xyzRobot.setXCoordinate(HOME) if xyzRobot.atYZero() == "TRUE": YZERO.set("TRUE") YMOTORPOSITION.set(HOME) value = xyzRobot.setYMotorPosition(HOME) value = xyzRobot.setYCoordinate(HOME) ## check Z separately if xyzRobot.atZZero() == "TRUE": ZZERO.set("TRUE") ARM_STATUS.set("TOP") ZMOTORPOSITION.set(0) value = xyzRobot.setZMotorPosition(0) value = xyzRobot.setZCoordinate(0) ABSOLUTEXPOSITION.set(xyzRobot.getAbsoluteXPosition()) ABSOLUTEYPOSITION.set(xyzRobot.getAbsoluteYPosition()) ABSOLUTEZPOSITION.set(xyzRobot.getAbsoluteZPosition()) #logger.debug("Going to read the temp and humidity") TEMPERATURE.set(xyzRobot.getTemperature()) HUMIDITY.set(xyzRobot.getHumidity()) value = xyzRobot.isGripperHoldingSomething() if value is True: CRUCIBLEYESNO.set("Yes") else: CRUCIBLEYESNO.set("No") xlimit = xyzRobot.getXMotorVelocityLimit() ylimit = xyzRobot.getYMotorVelocityLimit() zlimit = xyzRobot.getZMotorVelocityLimit() MAXXMOTORVELOCITY.set(xlimit) MAXYMOTORVELOCITY.set(ylimit) MAXZMOTORVELOCITY.set(zlimit) def initialize(): root.withdraw() init.deiconify() init.wm_title("Initialize and Weigh Crucibles") ## first go home! xyzRobot.goHome() ## assume starting point is 0 setMotorXToZero() setMotorYToZero() setAbsZeroXY() #Create Menus menubar = Menu(init) #File Bar filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=restart_program) filemenu.add_separator() filemenu.add_command(label="Exit", command=KillProgram) menubar.add_cascade(label="File", menu=filemenu) RHTEMP2000TEMP.set(xyzRobot.getTemperature()) RHTEMP2000HUMIDITY.set(xyzRobot.getHumidity()) PRECISIONTEMP.set(xyzRobot.getTemperature()) #Help Menu helpmenu = Menu(menubar, tearoff=0) menubar.add_cascade(label="Help", menu=helpmenu) #Display the Menus START_POSITION.set(1) ################################# ## GUI BUILD #################### init.config(menu=menubar) Label(init, text="Initials:").grid(row=1, column=0, sticky=W) Entry(init, textvariable=INITIALS, width=4).grid(row=1, column=1, sticky=W) Label(init, text="Number of Crucibles:").grid(row=3, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=NUMBEROFSAMPLES, width=3).grid(row=3, column=1, sticky=W, padx=2, pady=2) Label(init, text="Start Position:").grid(row=4, column=0, sticky=W) Entry(init, textvariable=START_POSITION, width=3).grid(row=4, column=1, sticky=W) Label(init, text="Duration of Measurements:").grid(row=5, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=DURATION, width=4).grid(row=5, column=1, sticky=W, padx=2, pady=2) Label(init, text="Madge Tech Temperature:").grid(row=6, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=RHTEMP2000TEMP, width=8).grid(row=6, column=1, sticky=W, padx=2, pady=2) Label(init, text="Madge Tech RH:").grid(row=7, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=RHTEMP2000HUMIDITY, width=8).grid(row=7, column=1, sticky=W, padx=2, pady=2) Label(init, text="Precision Temp:").grid(row=8, column=0, sticky=W) Label(init, text=PRECISIONTEMP.get()).grid(row=8, column=1, sticky=W) Label(init, text="Humidity:").grid(row=9, column=0, sticky=W) Label(init, text=HUMIDITY.get()).grid(row=9, column=1, sticky=W) Button(init, text="Start Initialize", command=go_initialize).grid(row=12, column=2, sticky=W, padx=2, pady=2) Button(init, text="Quit", command=quit_init).grid(row=12, column=0, sticky=W, padx=2, pady=2) ################################# ## GUI BUILD #################### update_windows() def quit_init(): root.deiconify() DataReadWrite.closeDatabase() init.withdraw() def go_initialize(): status = "Initialize" logger.debug('go_initialize: initialize function running. pre-weigh crucibles') logger.debug("XMotor: %i YMotor: %i" % (xyzRobot.getXMotorPosition(), xyzRobot.getYMotorPosition())) logger.debug("Set the current position of motors to zero ... ") standardTemp = float(RHTEMP2000TEMP.get()) standardRH = float(RHTEMP2000HUMIDITY.get()) ## initially use the 0,0 as the correction to see what we need to adjust to match the MadgeTech 2000 ## Note these are GLOBAL so that we can read the corrections when running the other stuff temp = xyzRobot.getTemperature() tempCorrection = standardTemp - temp rhCorrection = standardRH - xyzRobot.getHumidity() numberOfSamples = int(NUMBEROFSAMPLES.get()) duration = int(DURATION.get()) startPosition = int(START_POSITION.get()) xyzRobot.resetXYValuesToZero() setInitials = INITIALS.get() timeToCompletion = (duration * numberOfSamples) + numberOfSamples end = timedelta(minutes=timeToCompletion) now = datetime.today() endOfRunTime = now + end endOfRun = endOfRunTime.strftime("%m-%d-%y %H:%M:%S") print "This run will end ca. ", endOfRun logger.debug("Now going to move and measure each of the crucibles... ") logger.debug( "xyzRobot.weighAllCrucibles(%s,%d,%d,%d,%d)" % (setInitials, numberOfSamples, LOGINT, duration, startPosition)) returnValue = xyzRobot.weighAllCrucibles(setInitials, numberOfSamples, LOGINT, duration, startPosition, tempCorrection, rhCorrection, robotStatus, SAMPLE_POSITION, MCOUNT, CURRENTSTEP, STATUS, DURATION, LOGGERINTERVAL, RUNID, NUMBEROFSAMPLES, TIMEREMAINING) if returnValue is False: logger.error("There has been an error since weighAllCrucibles returned FALSE") errorMessage("There has been a problem weighing the crucibles (weighAllCrucibles). ") return False ##DataReadWrite.updateTempRHCorrection(tempCorrection,rhCorrection,runID) logger.debug("Initialize Crucibles: Done! ") init.withdraw() root.update() root.deiconify() ## first go home! xyzRobot.goHome() value = DataReadWrite.closeDatabase() communication.sendEmail("RHX Status Change", "Initialization is complete!") return True def setup(): root.withdraw() init.deiconify() init.wm_title("Setup and Data Entry") #Create Menus menubar = Menu(init) #File Bar filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=restart_program) filemenu.add_separator() filemenu.add_command(label="Exit", command=KillProgram) menubar.add_cascade(label="File", menu=filemenu) RHTEMP2000TEMP.set(xyzRobot.getTemperature()) RHTEMP2000HUMIDITY.set(xyzRobot.getHumidity()) PRECISIONTEMP.set(xyzRobot.getTemperature()) #Help Menu helpmenu = Menu(menubar, tearoff=0) menubar.add_cascade(label="Help", menu=helpmenu) #Display the Menus START_POSITION.set(1) dbfilename = easygui.fileopenbox(msg='Open file for this set of samples.', title='Open Database', default="C:/Users/Archy/Dropbox/Rehydroxylation/Logger/Data/*.sqlite", filetypes='*.sqlite') if dbfilename is None: return DATABASENAME.set(dbfilename) value = DataReadWrite.openDatabase(dbfilename) if value is False: logger.error("There has been an error since openDatabase returned FALSE") errorMessage("There has been a problem. Cannot read database (openDatabase).") return False dt = datetime t_assemblageName = str v_locationCode = str i_numberOfSamples = int f_locationTemperature = float f_locationHumidity = float d_dateTimefiring = datetime i_durationOfFiring = int i_temperatureOfFiring = int v_operatorName = str try: (v_locationCode, i_numberOfSamples, t_assemblageName, f_locationTemperature, f_locationHumidity, d_dateTimeFiring, i_durationOfFiring, i_temperatureOfFiring, v_operatorName, t_notes) = DataReadWrite.getRunInfo( 1) except: logger.error("There has been an error since DataReadWrite.getRunInfo(1) returned FALSE") errorMessage("There has been a problem with getRunInfo. Cannot read database") return False NOTES.set(t_notes) NUMBEROFSAMPLES.set(i_numberOfSamples) INITIALS.set(v_operatorName) LOCATION.set(v_locationCode) ASSEMBLAGE.set(t_assemblageName) LOCATION_TEMPERATURE.set(f_locationTemperature) DURATIONOFFIRING.set(i_durationOfFiring) TEMPOFFIRING.set(i_temperatureOfFiring) #print "d_dateTimeFiring: ",d_dateTimeFiring if d_dateTimeFiring is not None: try: dt = datetime.strptime(d_dateTimeFiring, "%Y-%m-%d %H:%M:%S") except: dt = datetime.strptime(d_dateTimeFiring, "%m-%d-%y %H:%M") DATEOFFIRING.set(dt.strftime("%m-%d-%y")) TIMEOFFIRING.set(dt.strftime("%H:%M:%S")) RUNINFOSTATUS.set("Please enter the required information to set up the run.") setupGUI() def setupGUI(): ################################# ## GUI BUILD #################### init.config(menu=menubar) Label(init, text="Initials (e.g., CPL):").grid(row=1, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=INITIALS, width=3).grid(row=1, column=1, sticky=W, padx=2, pady=2) Label(init, text="Source Location (e.g., LMV):").grid(row=2, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=LOCATION, width=40).grid(row=2, column=1, sticky=W, padx=2, pady=2) Label(init, text="Name of Assemblage (e.g., Belle Meade):").grid(row=3, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=ASSEMBLAGE, width=40).grid(row=3, column=1, sticky=W, padx=2, pady=2) Label(init, text="Lifetime Effective Temperature (C):").grid(row=4, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=LOCATION_TEMPERATURE, width=6).grid(row=4, column=1, sticky=W, padx=2, pady=2) Label(init, text="Number of Samples (n):").grid(row=5, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=NUMBEROFSAMPLES, width=3).grid(row=5, column=1, sticky=W, padx=2, pady=2) Label(init, text="Notes:").grid(row=6, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=NOTES, width=60).grid(row=6, column=1, sticky=W, padx=2, pady=2) Label(init, text="Start Position (1-N):").grid(row=7, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=START_POSITION, width=3).grid(row=7, column=1, sticky=W, padx=2, pady=2) Label(init, text="Firing Temperature (C):").grid(row=8, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=TEMPOFFIRING, width=6).grid(row=8, column=1, sticky=W, padx=2, pady=2) Label(init, text="Start Date of Firing (mm-dd-yy):").grid(row=9, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=DATEOFFIRING, width=12).grid(row=9, column=1, sticky=W, padx=2, pady=2) Label(init, text="Start Time of Firing (HH:MM):").grid(row=10, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=TIMEOFFIRING, width=12).grid(row=10, column=1, sticky=W, padx=2, pady=2) Label(init, text="Firing Duration (m):").grid(row=11, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=DURATIONOFFIRING, width=6).grid(row=11, column=1, sticky=W, padx=2, pady=2) Label(init, text="Madge Tech Temperature (C):").grid(row=12, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=RHTEMP2000TEMP, width=8).grid(row=12, column=1, sticky=W, padx=2, pady=2) Label(init, text="Madge Tech Humidity (%RH):").grid(row=13, column=0, sticky=W, padx=2, pady=2) Entry(init, text=RHTEMP2000HUMIDITY, width=8).grid(row=13, column=1, sticky=W, padx=2, pady=2) Label(init, text="Current Precision Temp (C):").grid(row=14, column=0, sticky=W, padx=2, pady=2) Label(init, text=PRECISIONTEMP.get()).grid(row=14, column=1, sticky=W, padx=2, pady=2) Label(init, text="Current Humidity (%RH):").grid(row=15, column=0, sticky=W, padx=2, pady=2) Label(init, text=HUMIDITY.get()).grid(row=15, column=1, sticky=W, padx=2, pady=2) Label(init, text="Database filename to use:").grid(row=16, column=0, sticky=W, padx=2, pady=2) Entry(init, textvariable=DATABASENAME, width=60).grid(row=16, column=1, sticky=W, padx=2, pady=2) Button(init, text="Setup Run", command=go_setup).grid(row=17, column=2, sticky=W, padx=2, pady=2) Button(init, text="Quit", command=quit_init).grid(row=17, column=0, sticky=W, padx=2, pady=2) Label(init, textvariable=RUNINFOSTATUS).grid(row=18, column=0, sticky=W, padx=2, pady=2) ################################# update_windows() def go_setup(): status = "Setup" logger.debug('go_setup: initialize function running. pre-weigh crucibles') if DATEOFFIRING.get() is None or TIMEOFFIRING.get() is None or DURATIONOFFIRING.get() is None: RUNINFOSTATUS.set( "Date of firing, Time of firing and Duration of Firing are all required. Please enter these data.") RESUBMIT.set("resubmission") setupGUI() standardTemp = float(RHTEMP2000TEMP.get()) standardRH = float(RHTEMP2000HUMIDITY.get()) ## initially use the 0,0 as the correction to see what we need to adjust to match the MadgeTech 2000 ## Note these are GLOBAL so that we can read the corrections when running the other stuff temp = xyzRobot.getTemperature() tempCorrection = standardTemp - temp rhCorrection = standardRH - xyzRobot.getHumidity() numberOfSamples = int(NUMBEROFSAMPLES.get()) startPosition = int(START_POSITION.get()) setInitials = INITIALS.get() now = datetime.today() today = now.strftime("%m-%d-%y %H:%M:%S") #first create a new run so we have an ID. runID = DataReadWrite.getLastRunID() if runID is False: logger.error("There has been an error since insertRun returned FALSE") errorMessage("There has been a problem. Cannot find a run. Must set up measures ahead of time.") return False statustext = "Run ID is %d" % int(runID) dt = datetime datetimeOfFiring = DATEOFFIRING.get() + " " + TIMEOFFIRING.get() try: dt = datetime.strptime(datetimeOfFiring, "%m-%d-%y %H:%M") except: RUNINFOSTATUS.set("Date and time formats are incorrect. Reenter.") return False DataReadWrite.updateTempRHCorrection(tempCorrection, rhCorrection, runID) DataReadWrite.updateRunInformation(int(NUMBEROFSAMPLES.get()), INITIALS.get(), LOCATION.get(), ASSEMBLAGE.get(), float(LOCATION_TEMPERATURE.get()), NOTES.get(), runID) DataReadWrite.updateRunInfoWithFiringInformation(dt, float(TEMPOFFIRING.get()), int(DURATIONOFFIRING.get()), runID) logger.debug(statustext) RUNID.set(int(runID)) CURRENTSAMPLE.set(1) init.update() go_setupPart2() def go_setupPart2(): count = CURRENTSAMPLE.get() if count > NUMBEROFSAMPLES.get(): quit_setup() return True runID = int(RUNID.get()) if runID < 1: errorMessage("You must have a RunID to continue.") logger.debug("You must have a RunID entered in order to continue.") return False setInitials = str(INITIALS.get()) setLocation = str(LOCATION.get()) numberOfSamples = int(NUMBEROFSAMPLES.get()) setHumidity = float(HUMIDITY.get()) locationTemperature = LOCATION_TEMPERATURE.get() status = "prefire" assemblage = ASSEMBLAGE.get() value = DataReadWrite.updateRunPreFire(runID, setInitials, assemblage, setLocation, locationTemperature, setHumidity, status, numberOfSamples) if value is False: logger.error("There has been an error since updateRunPreFire returned FALSE") errorMessage("There has been a problem.updateRunPreFire has returned FALSE.") return False setupCrucibles.deiconify() setupCrucibles.wm_title("Crucible Entry") #Create Menus menubar = Menu(setupCrucibles) #File Bar filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=restart_program) filemenu.add_separator() filemenu.add_command(label="Exit", command=KillProgram) menubar.add_cascade(label="File", menu=filemenu) #Help Menu helpmenu = Menu(menubar, tearoff=0) menubar.add_cascade(label="Help", menu=helpmenu) #Display the Menus setupCrucibles.config(menu=menubar) crucibleWeight, crucibleStdDev, weightCount = DataReadWrite.getEmptyCrucible(count, runID) CRUCIBLEWEIGHT.set(crucibleWeight) CRUCIBLEWEIGHTSTDDEV.set(crucibleStdDev) sherdWeight, sherdStdDev = DataReadWrite.getInitialSherd(count, runID) INITIALWEIGHT.set(sherdWeight) INITIALWEIGHTSTDDEV.set(sherdStdDev) sherd105Weight, sherd105StdDev = DataReadWrite.getPreFireSherd(count, runID) SAMPLEWEIGHT.set(sherd105Weight) SAMPLEWEIGHTSTDDEV.set(sherd105StdDev) sherd550Weight, sherd550StdDev = DataReadWrite.getPostFireSherd(count, runID) POSTFIREWEIGHT.set(sherd550Weight) POSTFIREWEIGHTSTDDEV.set(sherd550StdDev) Label(setupCrucibles, text="CHECK AND VERIFY THESE VALUES").grid(row=0, column=0, sticky=W) Label(setupCrucibles, text="Mean").grid(row=2, column=1, sticky=W) Label(setupCrucibles, text="StdDev").grid(row=2, column=2, sticky=W) Label(setupCrucibles, text="Current Sample Number").grid(row=1, column=0, sticky=W) Entry(setupCrucibles, textvariable=CURRENTSAMPLE).grid(row=1, column=1, sticky=W) ctext = "Crucible #" + str(count) + " Empty Weight (g)" Label(setupCrucibles, text=ctext).grid(row=3, column=0, sticky=W) Entry(setupCrucibles, textvariable=CRUCIBLEWEIGHT).grid(row=3, column=1, sticky=W) Entry(setupCrucibles, textvariable=CRUCIBLEWEIGHTSTDDEV).grid(row=3, column=2, sticky=W) smtext = "Sample #" + str(count) + " Initial weight of sherd (g):" Label(setupCrucibles, text=smtext).grid(row=4, column=0, sticky=W) Entry(setupCrucibles, textvariable=INITIALWEIGHT).grid(row=4, column=1, sticky=W) Entry(setupCrucibles, textvariable=INITIALWEIGHTSTDDEV).grid(row=4, column=2, sticky=W) smtext = "Sample #" + str(count) + " 105 degree weight of sherd (g): " Label(setupCrucibles, text=smtext).grid(row=5, column=0, sticky=W) Entry(setupCrucibles, textvariable=SAMPLEWEIGHT).grid(row=5, column=1, sticky=W) Entry(setupCrucibles, textvariable=SAMPLEWEIGHTSTDDEV).grid(row=5, column=2, sticky=W) sftext = "Sample #" + str(count) + " Post-Fire Weight of sherd (g):" Label(setupCrucibles, text=sftext).grid(row=6, column=0, sticky=W) Entry(setupCrucibles, textvariable=POSTFIREWEIGHT).grid(row=6, column=1, sticky=W) Entry(setupCrucibles, textvariable=POSTFIREWEIGHTSTDDEV).grid(row=6, column=2, sticky=W) Button(setupCrucibles, text="Submit Weight Data for Sample/Crucible", command=updateCrucibleAndSample).grid(row=7, column=0, sticky=W, padx=2, pady=2) Button(setupCrucibles, text="End (No more samples)", command=quit_setup).grid(row=7, column=1, sticky=W, padx=2, pady=2) update_windows() def updateCrucibleAndSample(): setupCrucibles.withdraw() runID = RUNID.get() now = datetime.today() today = now.strftime("%m-%d-%y %H:%M:%S") position = CURRENTSAMPLE.get() preOrPost = 1 setInitials = str(INITIALS.get()) startPosition = int(START_POSITION.get()) setName = str(NAME.get()) setLocation = str(LOCATION.get()) numberOfSamples = int(NUMBEROFSAMPLES.get()) setTemperature = float(PRECISIONTEMP.get()) setHumidity = float(HUMIDITY.get()) standardTemp = float(RHTEMP2000TEMP.get()) standardRH = float(RHTEMP2000HUMIDITY.get()) initialSherdWeight = float(INITIALWEIGHT.get()) initialSherdWeightStdDev = float(INITIALWEIGHTSTDDEV.get()) status = "prefire" value = DataReadWrite.updateCrucible(position, CRUCIBLEWEIGHT.get(), CRUCIBLEWEIGHTSTDDEV.get(), RHTEMP2000TEMP.get(), 0.0, RHTEMP2000HUMIDITY.get(), 0.0, today, runID, position) if value is False: errorMessage("updateCrucible returned an error") return False prefireSampleWeight = SAMPLEWEIGHT.get() prefireSampleWeightStdDev = SAMPLEWEIGHTSTDDEV.get() value = DataReadWrite.updateSamplePreFire(runID, position, initialSherdWeight, initialSherdWeightStdDev, prefireSampleWeight, prefireSampleWeightStdDev, RHTEMP2000TEMP.get(), 0.0, RHTEMP2000HUMIDITY.get(), 0.0) if value is False: errorMessage("You must have a RunID to continue: updateSamplePrefire returned an error") return False postfireSampleWeight = POSTFIREWEIGHT.get() postfireSampleWeightStdDev = POSTFIREWEIGHTSTDDEV.get() value = DataReadWrite.updateSamplePostFireWeight(runID, position, postfireSampleWeight, postfireSampleWeightStdDev) CURRENTSAMPLE.set(position + 1) root.update() go_setupPart2() def quit_setup(): init.withdraw() setupCrucibles.withdraw() logger.debug("Setup is done ") DataReadWrite.closeDatabase() root.update() root.deiconify() return True def backToMainWindowFromMoveArm(): """ backToMainWinodwFromMoveArm destroys the moveArm window and brings the root back to focus. """ #moveArm.withdraw() root.deiconify() return True def backToMainWindow(): """ backToMainWindow() removes other windows and bring the root window to the focus """ root.update() root.deiconify() return True def postFire(): logger.debug("Now running postFire function") preOrPost = 2 status = "Post-fired" root.withdraw() postfire.deiconify() postfire.wm_title("Post-Fire") ## first go home! xyzRobot.goHome() setMotorXToZero() setMotorYToZero() setAbsZeroXY() #Create Menus menubar = Menu(postfire) #File Bar filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=restart_program) filemenu.add_separator() filemenu.add_command(label="Exit", command=KillProgram) menubar.add_cascade(label="File", menu=filemenu) #Help Menu helpmenu = Menu(menubar, tearoff=0) menubar.add_cascade(label="Help", menu=helpmenu) #Display the Menus init.config(menu=menubar) dbfilename = easygui.fileopenbox(msg='Open file for this set of samples.', title='Open Database', default="C:/Users/Archy/Dropbox/Rehydroxylation/Logger/Data/*.sqlite", filetypes='*.sqlite') if dbfilename is None: return DATABASENAME.set(dbfilename) value = DataReadWrite.openDatabase(dbfilename) if value is False: logger.error("There has been an error since openDatabase returned FALSE") errorMessage("There has been a problem. Cannot open database") return False RHTEMP2000TEMP.set(xyzRobot.getTemperature()) RHTEMP2000HUMIDITY.set(xyzRobot.getHumidity()) PRECISIONTEMP.set(xyzRobot.getTemperature()) HUMIDITY.set(xyzRobot.getHumidity()) RUNID.set(1) t_assemblageName = str v_locationCode = str i_numberOfSamples = int f_locationTemperature = float f_locationHumidity = float d_dateTimefiring = datetime i_durationOfFiring = int i_temperatureOfFiring = int v_operatorName = str try: (v_locationCode, i_numberOfSamples, t_assemblageName, f_locationTemperature, f_locationHumidity, d_dateTimeFiring, i_durationOfFiring, i_temperatureOfFiring, v_operatorName, t_notes) = DataReadWrite.getRunInfo( 1) except: logger.error("There has been an error since DataReadWrite.getRunInfo(1) returned FALSE") errorMessage("There has been a problem with getRunInfo. Cannot read database") return False NUMBEROFSAMPLES.set(i_numberOfSamples) TEMP.set(f_locationTemperature) LOCATION_TEMPERATURE.set(f_locationTemperature) LOCATION.set(v_locationCode) ASSEMBLAGE.set(t_assemblageName) INITIALS.set(v_operatorName) NOTES.set(t_notes) (numberOfSamples, duration, interval, repetitions) = DataReadWrite.getPostfireAttributes() if duration is None: duration = int(60 / numberOfSamples) if interval is None or interval == 0: interval = 5 if repetitions is None: repetitions = 4 * 24 START_POSITION.set(1) DURATION.set(duration) INTERVAL.set(interval) REPS.set(repetitions) ################################# ################################# Label(postfire, text="Location:").grid(row=0, column=0, sticky=W, padx=2, pady=2) Label(postfire, text=LOCATION.get()).grid(row=0, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Assemblage:").grid(row=1, column=0, sticky=W, padx=2, pady=2) Label(postfire, text=ASSEMBLAGE.get()).grid(row=1, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Effective Lifetime Temperature (C):").grid(row=2, column=0, sticky=W, padx=2, pady=2) Label(postfire, text=LOCATION_TEMPERATURE.get()).grid(row=2, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Number of samples (e.g., 3):").grid(row=3, column=0, sticky=W, padx=2, pady=2) Label(postfire, text=NUMBEROFSAMPLES.get()).grid(row=3, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Starting position (e.g., 1):").grid(row=4, column=0, sticky=W) Entry(postfire, textvariable=START_POSITION, width=3).grid(row=4, column=1, sticky=W) Label(postfire, text="Duration of measurements per cycle (min):").grid(row=10, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=DURATION, width=4).grid(row=10, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Sampling interval for weight measurements in seconds (e.g., 5):").grid(row=11, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=INTERVAL, width=3).grid(row=11, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Cycles (e.g., 10):").grid(row=12, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=REPS, width=3).grid(row=12, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Set temperature of RHX chamber (C):").grid(row=13, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=TEMP, width=15).grid(row=13, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Set RH% of RHX chamber (%RH):").grid(row=14, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=HUMIDITY, width=15).grid(row=14, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Enter Madge Tech Temperature (C)):").grid(row=15, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=RHTEMP2000TEMP, width=15).grid(row=15, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Enter Madge Tech Humidity (%RH):").grid(row=16, column=0, sticky=W, padx=2, pady=2) Entry(postfire, text=RHTEMP2000HUMIDITY, width=15).grid(row=16, column=1, sticky=W, padx=2, pady=2) Label(postfire, text="Current Temperature of Chamber (C):").grid(row=17, column=0, sticky=W) Label(postfire, text=PRECISIONTEMP.get()).grid(row=17, column=1, sticky=W) Label(postfire, text="Current Humidity of Chamber (%RH):").grid(row=18, column=0, sticky=W) Label(postfire, text=HUMIDITY.get()).grid(row=18, column=1, sticky=W) Label(postfire, text="Operator Initials (e.g., CPL):").grid(row=21, column=0, sticky=W, padx=2, pady=2) Entry(postfire, textvariable=INITIALS.get(), width=4).grid(row=21, column=1, sticky=W, padx=2, pady=2) Button(postfire, text="Start Post Fire", command=go_postFire).grid(row=22, column=1, padx=2, pady=2) Button(postfire, text="Quit", command=quit_postfire).grid(row=22, column=0, padx=0, pady=2) ######################### update_windows() def quit_postfire(): root.deiconfiy() DataReadWrite.closeDatabase() postfire.withdraw() def go_postFire(): runID = int(RUNID.get()) if runID < 1: errorMessage("You must have a RunID to continue.") logger.debug("You must have a RunID entered in order to continue.") return False message = "You are going to run %d samples. Have you set up and weighed %d empty crucibles yet? If not, hit cancel. Otherwise, continue. " % ( NUMBEROFSAMPLES.get(), NUMBEROFSAMPLES.get()) if easygui.ccbox(msg=message, title='Check for empty crucibles'): pass else: return setInitials = str(INITIALS.get()) duration = int(DURATION.get()) setTemperature = float(LOCATION_TEMPERATURE.get()) setHumidity = float(HUMIDITY.get()) standardTemp = float(RHTEMP2000TEMP.get()) standardRH = float(RHTEMP2000HUMIDITY.get()) temp = xyzRobot.getTemperature() tempCorrection = standardTemp - temp rhCorrection = standardRH - xyzRobot.getHumidity() preOrPost = 2 status = "postfire" numberOfSamples = NUMBEROFSAMPLES.get() startPosition = START_POSITION.get() intervalsec = int(INTERVAL.get()) postMeasurementTimeInterval = int(DURATION.get()) repetitions = int(REPS.get()) value = DataReadWrite.updateRunPostFire(runID, status, postMeasurementTimeInterval, duration, repetitions, intervalsec, setHumidity) if value is False: logger.error("There has been an error since updateRunPostFire returned FALSE") errorMessage("There has been a problem with updateRunPostFire") return False d_dateTimeFiring = datetime try: (v_locationCode, i_numberOfSamples, t_assemblageName, f_locationTemperature, f_locationHumidity, d_dateTimeFiring, i_durationOfFiring, i_temperatureOfFiring, v_operatorName, t_notes) = DataReadWrite.getRunInfo( 1) except: logger.error("There has been an error since DataReadWrite.getRunInfo(1) returned FALSE") errorMessage("There has been a problem with getRunInfo. Cannot read database") return False print "Date of Firing: ", d_dateTimeFiring dt = datetime try: dt = datetime.strptime(d_dateTimeFiring, "%Y-%m-%d %H:%M:%S") except: errorMessage("There has been a problem. The time/date for firing is not correct.") RUNINFOSTATUS.set("Date and/or time formats are incorrect. Reenter.") print "There is a problem with the date format..." return False end = timedelta(minutes=int(DURATIONOFFIRING.get())) endOfFiring = dt + end timeToCompletion = ((duration * numberOfSamples) + numberOfSamples) * repetitions end = timedelta(minutes=timeToCompletion) now = datetime.today() endOfRunTime = now + end endOfRun = endOfRunTime.strftime("%m-%d-%y %H:%M:%S") print "This run will end ca. ", endOfRun count = 0 repeat = 1 CYCLE.set(repeat) while repeat < (repetitions + 1): root.update() CYCLE.set(repeat) xyzRobot.weighAllSamplesPostFire(runID, duration, intervalsec, numberOfSamples, startPosition, endOfFiring, tempCorrection, rhCorrection, repeat, robotStatus, SAMPLE_POSITION, MCOUNT, CURRENTSTEP, STATUS, DURATION, LOGGERINTERVAL, RUNID, NUMBEROFSAMPLES, TIMEREMAINING, TIMEELAPSEDMIN, REPS, CYCLE) repeat += 1 update_windows() root.update() root.deiconify() postfire.withdraw() value = DataReadWrite.closeDatabase() communication.sendEmail("RHX Status Change", "Postfire is complete!") ## now go home! xyzRobot.goHome() update_windows() return True def moveMotorX(): logger.debug("moveMotorX to %i", int(XMOTORPOSITION.get())) xyzRobot.moveMotorXToPosition(int(XMOTORPOSITION.get())) POSITION_NAME.set("UNKNOWN") sleep(2) logger.debug( "now located at x: %d y: %d z: %d" % ( xyzRobot.getXPosition(), xyzRobot.getYPosition(), xyzRobot.getZPosition())) DataReadWrite.updatePosition(xyzRobot.getXPosition(), xyzRobot.getYPosition(), xyzRobot.getZPosition()) update_windows() return True def moveMotorY(): logger.debug("moveMotorY to %i", int(YMOTORPOSITION.get())) xyzRobot.moveMotorYToPosition(int(YMOTORPOSITION.get())) POSITION_NAME.set("UNKNOWN") sleep(2) logger.debug( "now located at x: %d y: %d z: %d" % ( xyzRobot.getXPosition(), xyzRobot.getYPosition(), xyzRobot.getZPosition())) DataReadWrite.updatePosition(xyzRobot.getXPosition(), xyzRobot.getYPosition(), xyzRobot.getZPosition()) update_windows() return True def setMotorXToZero(): logger.debug("setMotorXToZero") xyzRobot.setXMotorPosition(0) XMOTORPOSITION.set("0") update_windows() return True def setMotorYToZero(): logger.debug("setMotorYToZero") xyzRobot.setYMotorPosition(0) YMOTORPOSITION.set("0") update_windows() return True def setMotorsToZero(motorNumber): logger.debug("setMotorsToZero: %d", motorNumber) if motorNumber == 0: xyzRobot.setXMotorPosition(0) XMOTORPOSITION.set("0") elif motorNumber == 2: xyzRobot.setYMotorPosition(0) YMOTORPOSITION.set("0") else: logger.critical("Error - no such motor number: %d ", motorNumber) POSITION_NAME.set("HOME") update_windows() return True def moveArmToPosition(): logger.debug("moveArmToPosition: %d", int(ZMOTORPOSITION.get())) xyzRobot.moveArmToPosition(int(ZMOTORPOSITION.get())) update_windows() return True def bumpXMotorUp(): logger.debug("bumpXMotorUp: %d", int(MOTORSTEP.get())) xyzRobot.bumpXMotorUp(int(MOTORSTEP.get())) update_windows() def bumpYMotorRight(): logger.debug("bumpYMotorRight: %d", int(MOTORSTEP.get())) xyzRobot.bumpYMotorRight(int(MOTORSTEP.get())) update_windows() def bumpYMotorLeft(): logger.debug("bumpYMotorLeft: %d", int(MOTORSTEP.get())) xyzRobot.bumpYMotorLeft(int(MOTORSTEP.get())) update_windows() def bumpXMotorDown(): logger.debug("bumpXMotorDown: %d", int(MOTORSTEP.get())) xyzRobot.bumpXMotorDown(int(MOTORSTEP.get())) update_windows() def bumpMotorNE(): logger.debug("bumpMotorNE") logger.debug("bumpXMotorUp: %d", int(MOTORSTEP.get())) xyzRobot.bumpXMotorUp(int(MOTORSTEP.get())) logger.debug("bumpYMotorLeft: %d", int(MOTORSTEP.get())) xyzRobot.bumpYMotorLeft(int(MOTORSTEP.get())) update_windows() def bumpMotorNW(): logger.debug("bumpMotorNW") logger.debug("bumpXMotorUp: %d", int(MOTORSTEP.get())) xyzRobot.bumpXMotorUp(int(MOTORSTEP.get())) #update_windows() logger.debug("bumpYMotorRight: %d", int(MOTORSTEP.get())) xyzRobot.bumpYMotorRight(int(MOTORSTEP.get())) update_windows() def bumpMotorSE(): logger.debug("bumpMotorSE") logger.debug("bumpXMotorDown: %d", int(MOTORSTEP.get())) xyzRobot.bumpXMotorDown(int(MOTORSTEP.get())) #update_windows() logger.debug("bumpYMotorRight: %s", int(MOTORSTEP.get())) xyzRobot.bumpYMotorRight(int(MOTORSTEP.get())) update_windows() def bumpMotorSW(): logger.debug("bumpMotorSW") logger.debug("bumpXMotorDown: %d", int(MOTORSTEP.get())) xyzRobot.bumpXMotorDown(int(MOTORSTEP.get())) #update_windows() logger.debug("bumpYMotorLeft: %d", int(MOTORSTEP.get())) xyzRobot.bumpYMotorLeft(int(MOTORSTEP.get())) update_windows() def bumpZMotorUp(): logger.debug("bumpZMotorUp") logger.debug("bumpZMotorUp: %d", int(ZMOTORSTEP.get())) if int(ZMOTORSTEP.get()) > 100000: print "Too dangerous to move that far up in one move. Ignoring..." else: xyzRobot.bumpZMotorUp(int(ZMOTORSTEP.get())) update_windows() def bumpZMotorDown(): logger.debug("bumpZMotorDown") logger.debug("bumpZMotorDown: %d", int(ZMOTORSTEP.get())) if int(ZMOTORSTEP.get()) > 100000: print "Too dangerous to move that far down in one move. Ignoring..." else: # print ("bumpZMotorDown") #print ("bumpZMotorDown: %d",int(ZMOTORSTEP.get())) xyzRobot.bumpZMotorDown(int(ZMOTORSTEP.get())) update_windows() def lowerArmToSample(): xyzRobot.lowerArmToSample() ARM_STATUS.set("SAMPLE") update_windows() def raiseArmToTop(): xyzRobot.raiseArmToTop() ARM_STATUS.set("TOP") update_windows() def lowerArmToBalance(): (xpos, ypos) = xyzRobot.getCurrentXYCoordinates() (bal_xpos, bal_ypos) = DataReadWrite.getXYCoordinatesForInsideBalance() if ypos < (bal_ypos - 300): ## we are not on the balance so we cannot descend. print "Error: we are not in a position to descend. Please move to the balance." else: xyzRobot.lowerArmToBalance() ARM_STATUS.set("BALANCE") update_windows() def goHome(): logger.debug("goHome: Go to Home Position") value = xyzRobot.goHome() if value == False: print "There has been an error going home -- we have not zero'd on one of the axes. Quitting." quit() SAMPLE_POSITION.set(0) XMOTORPOSITION.set(xyzRobot.getXMotorPosition()) YMOTORPOSITION.set(xyzRobot.getYMotorPosition()) ZMOTORPOSITION.set(xyzRobot.getZMotorPosition()) XZERO.set(xyzRobot.atXZero()) YZERO.set(xyzRobot.atYZero()) ZZERO.set(xyzRobot.atZZero()) sleep(1) if xyzRobot.atXZero() == "TRUE": XZERO.set("TRUE") XMOTORPOSITION.set(0) ARM_STATUS.set("TOP") value = xyzRobot.setXMotorPosition(0) value = xyzRobot.setXCoordinate(0) if xyzRobot.atYZero() == "TRUE": YZERO.set("TRUE") YMOTORPOSITION.set(0) value = xyzRobot.setYMotorPosition(0) value = xyzRobot.setYCoordinate(0) if xyzRobot.atZZero() == "TRUE": ZZERO.set("TRUE") ZMOTORPOSITION.set(0) value = xyzRobot.setZMotorPosition(0) value = xyzRobot.setZCoordinate(0) POSITION_NAME.set("HOME") update_windows() def turnLightOn(): logger.debug("turnLightOn") xyzRobot.turnLightOn() LIGHTSTATUS.set("ON") update_windows() def turnLightOff(): logger.debug("turnLightOff") xyzRobot.turnLightOff() LIGHTSTATUS.set("OFF") update_windows() def openGripper(): logger.debug("openGripper: Open gripper") xyzRobot.openGripper() GRIPPERPOSITION.set("OPEN - DISENGAGED") update_windows() def closeGripper(): logger.debug("closeGripper: Close gripper") xyzRobot.closeGripper() GRIPPERPOSITION.set("CLOSED - ENGAGED") update_windows() def BZero(): logger.debug("BZero: Zero the balance") DataReadWrite.BZero() update_windows() def openBalanceDoor(): logger.debug("openBalanceDoor: Open the balance door") DataReadWrite.openBalanceDoor() BALANCEDOOR.set("OPEN") update_windows() def closeBalanceDoor(): logger.debug("closeBalanceDoor: Close the balance door") (xpos, ypos) = xyzRobot.getCurrentXYCoordinates() (bal_xpos, bal_ypos) = DataReadWrite.getXYCoordinatesForOutsideBalance() if ypos <= bal_ypos: DataReadWrite.closeBalanceDoor() BALANCEDOOR.set("CLOSED") else: logger.warn("Cannot close door. Arm is inside balance.") #update_windows() update_windows() def goToPosition(): pos = SAMPLE_POSITION.get() if pos > MAXPOSITIONS.get(): update_windows() return else: POSITION_NAME.set("SAMPLE") logger.debug("goToPosition: Go to position: %i", int(pos)) xyzRobot.goToSamplePosition(int(pos), startWindow=1) update_windows() def refine(): pos = SAMPLE_POSITION.get() if pos < MAXPOSITIONS.get() + 1: logger.debug("refine sample position: %i", int(pos)) xyzRobot.refineSamplePosition(pos) elif pos == INSIDE_BALANCE_POSITION: logger.debug("refine inside balance position: %i", int(pos)) xyzRobot.refineInsideBalancePosition() else: pass update_windows() def goToBalance(): SAMPLE_POSITION.set(INSIDE_BALANCE_POSITION) logger.debug("goToBalance: Go to point outside of balance") xyzRobot.goToOutsideBalanceFromOutside() POSITION_NAME.set("OUTSIDE_BALANCE") #make sure balance door is open openBalanceDoor() BALANCEDOOR.set("OPEN") #update_windows() logger.debug("Go to inside of balance") SAMPLE_POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION.set(OUTSIDE_BALANCE_POSITION) xyzRobot.goToInsideBalanceFromOutside() POSITION_NAME.set("INSIDE_BALANCE") POSITION.set(INSIDE_BALANCE_POSITION) update_windows() def getSampleFromBalance(): logger.debug("getSampleFromBalance: %d", SAMPLENUM.get()) sampleNum = SAMPLENUM.get() if sampleNum < 1: errorMessage("You must enter a sample number to continue.") logger.warning("You must have a sample number in order to continue.") return False else: xyzRobot.goToOutsideBalanceFromOutside() SAMPLE_POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION_NAME.set("OUTSIDE_BALANCE") openBalanceDoor() BALANCEDOOR.set("CLOSED") val = xyzRobot.goToInsideBalanceFromOutside() POSITION_NAME.set("INSIDE_BALANCE") SAMPLE_POSITION.set(INSIDE_BALANCE_POSITION) POSITION.set(INSIDE_BALANCE_POSITION) val = xyzRobot.pickUpSampleFromBalance() val = xyzRobot.goToOutsideBalanceFromInside() POSITION_NAME.set("OUTSIDE_BALANCE") SAMPLE_POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION.set(OUTSIDE_BALANCE_POSITION) closeBalanceDoor() BALANCEDOOR.set("CLOSED") val = xyzRobot.goHome() POSITION_NAME.set("HOME") SAMPLE_POSITION.set(0) POSITION.set(0) val = xyzRobot.goToSamplePosition(sampleNum, startWindow=1) POSITION_NAME.set("SAMPLE") SAMPLE_POSITION.set(sampleNum) POSITION.set(sampleNum) val = xyzRobot.samplePutDown() val = xyzRobot.goHome() POSITION_NAME.set("HOME") POSITION.set(0) SAMPLE_POSITION.set(0) update_windows() return True def fileDialog(): dirname = tkFileDialog.askdirectory(parent=root, initialdir="/Users/Archy/Dropbox/Rehydroxylation/", title="Pick a directory ...") update_windows() return True def findHome(): logger.debug("first find zero on the X axis") xyzRobot.moveXUntilZero() logger.debug("first find zero on the Y axis") xyzRobot.moveYUntilZero() logger.debug("Now reset motors to Zero") xyzRobot.resetXYValuesToZero() POSITION_NAME.set("HOME") SAMPLE_POSITION.set(0) POSITION.set(0) update_windows() return True def setAbsZeroXY(): sampleLocation = SAMPLE_POSITION.get() position = POSITION.get() t = (sampleLocation, position) message = "Check that the arm is in the HOME Position. If okay, I will set HOME position to this spot." message += "I am currently at %s and position number %d." % t if xyzRobot.atXZero() == "TRUE" and xyzRobot.atYZero() == "TRUE": message += " Note that the X and Y sensors are NOT both TRUE. Are you absolutely certain? " value = are_you_sure(message) if value is True: SAMPLE_POSITION.set(HOME) POSITION_NAME.set("HOME") POSITION.set(HOME) XMOTORPOSITION.set(HOME) YMOTORPOSITION.set(HOME) returnValue = xyzRobot.setAbsZeroXY() update_windows() return True else: return False def setXYForSampleLocation(): sampleLocation = SAMPLE_POSITION.get() message = "Set the XY for sample position: %d " % sampleLocation value = are_you_sure(message) if value is True: x = int(xyzRobot.getXPosition()) y = int(xyzRobot.getYPosition()) value = DataReadWrite.updateXYForSampleLocation(sampleLocation, x, y) xD, yD = xyzRobot.getCurrentXYCoordinates() value = DataReadWrite.updateXYCoordinatesForSampleLocation(sampleLocation, xD, yD) update_windows() return value return False def setZForSampleLocation(): sampleZPosition = ZMOTORPOSITION.get() message = "Set Z position for samples to %s?" % sampleZPosition value = are_you_sure(message) if value is True: sampleLocation = SAMPLE_POSITION.get() value = DataReadWrite.updateZForSampleLocation(sampleLocation, sampleZPosition) update_windows() return value return False def setZForBalanceLocation(): balanceZPosition = ZMOTORPOSITION.get() message = "Set the Z position for the balance %s?" % balanceZPosition value = are_you_sure(message) if value is True: value = DataReadWrite.updateZForBalanceLocation(balanceZPosition) update_windows() return value return False def setXYForAllLocations(): message = "Set the X: %d Y: %d values for all locations?" value = are_you_sure(message) if value is True: sampleLocation = SAMPLE_POSITION.get() originalX = 0 originalY = 0 (originalX, originalY) = DataReadWrite.getXYForSampleLocation(sampleLocation) x = int(xyzRobot.getXPosition()) y = int(xyzRobot.getYPosition()) diffX = originalX - x diffY = originalY - y pos = sampleLocation value = DataReadWrite.updateXYForSampleLocation(sampleLocation, x, y) while pos < MAXPOSITIONS.get() + 1: (originalX, originalY) = DataReadWrite.getXYForSampleLocation(pos) newX = originalX - diffX newY = originalY - diffY value = DataReadWrite.updateXYForSampleLocation(pos, newX, newY) pos += 1 update_windows() return value return False def setXYForInsideBalance(): message = "Set the Inside Balance point here?" value = are_you_sure(message) if value is True: x = int(xyzRobot.getXPosition()) y = int(xyzRobot.getYPosition()) value = DataReadWrite.updateXYForInsideBalance(x, y) xC, yC = xyzRobot.getCurrentXYCoordinates() DataReadWrite.updateXYCoordinatesForInsideBalance(xC, yC) update_windows() return value return False def setXYForOutsideBalance(): message = "Set the Outside Balance point here?" value = are_you_sure(message) if value is True: x = int(xyzRobot.getXPosition()) y = int(xyzRobot.getYPosition()) value = DataReadWrite.updateXYForOutsideBalance(x, y) xC, yC = xyzRobot.getCurrentXYCoordinates() DataReadWrite.updateXYCoordinatesForOutsideBalance(xC, yC) update_windows() return value return False def moveToNextSampleLocation(): sampleLocation = int(SAMPLE_POSITION.get()) ## first go home to set the position to ZERO then move to the point... xyzRobot.goHome() POSITION_NAME.set("HOME") ##print("Now at position %d" % (sampleLocation)) sampleLocation += 1 SAMPLE_POSITION.set(sampleLocation) POSITION_NAME.set("SAMPLE") POSITION.set(sampleLocation) value = 0 if sampleLocation > MAXPOSITIONS.get(): sampleLocation = 1 ##print("Moving to position %d" % (sampleLocation)) SAMPLE_POSITION.set(sampleLocation) goToPosition() POSITION_NAME.set("SAMPLE") update_windows() return True def resetZMotorToZeroPosition(): xyzRobot.resetZMotorToZeroPosition() update_windows() return True def resetZToZero(): xyzRobot.resetZToZero() update_windows() return True def goToOutsideBalance(): xyzRobot.goToOutsideBalanceFromOutside() POSITION_NAME.set("OUTSIDE_BALANCE") SAMPLE_POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION.set(OUTSIDE_BALANCE_POSITION) update_windows() return True def goToInsideBalance(): xyzRobot.goToOutsideBalanceFromOutside() POSITION_NAME.set("OUTSIDE_BALANCE") SAMPLE_POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION.set(OUTSIDE_BALANCE_POSITION) update_windows() xyzRobot.goToInsideBalanceFromOutside() POSITION_NAME.set("INSIDE_BALANCE") POSITION.set(INSIDE_BALANCE_POSITION) update_windows() SAMPLE_POSITION.set(INSIDE_BALANCE_POSITION) return True def setOutsideBalance(): setXYForOutsideBalance() POSITION_NAME.set("OUTSIDE_BALANCE") SAMPLE_POSITION.set(OUTSIDE_BALANCE_POSITION) POSITION.set(OUTSIDE_BALANCE_POSITION) update_windows() return True def setInsideBalance(): setXYForInsideBalance() POSITION_NAME.set("INSIDE_BALANCE") SAMPLE_POSITION.set(INSIDE_BALANCE_POSITION) POSITION.set(INSIDE_BALANCE_POSITION) update_windows() return True def checkEachSamplePosition(): print "Ill only check the first 5 sample locations" sampleLocation = 1 print "First, go home." value = xyzRobot.goHome() POSITION_NAME.set("HOME") POSITION.set(HOME) SAMPLE_POSITION(HOME) print "make sure gripper is open..." value = xyzRobot.openGripper() GRIPPERPOSITION.set("OPEN - DISENGAGED") while sampleLocation < MAXPOSITIONS.get() + 1: print "Going to location: ", sampleLocation value = xyzRobot.goToSamplePosition(sampleLocation, startWindow=1) POSITION_NAME.set("SAMPLE") POSITION.set(sampleLocation) SAMPLE_POSITION.set(sampleLocation) print "Lower arm to sample" value = xyzRobot.lowerArmToSample() ARM_STATUS.set("SAMPLE") print "Close gripper" value = xyzRobot.closeGripper() GRIPPERPOSITION.set("CLOSED - ENGAGED") print "Open gripper" value = xyzRobot.openGripper() GRIPPERPOSITION.set("OPEN - DISENGAGED") print "Raise arm to top" value = xyzRobot.raiseArmToTop() ARM_STATUS.set("TOP") print "Next..." sampleLocation += 1 print "Now go home" value = xyzRobot.goHome() POSITION_NAME.set("HOME") POSITION.set(HOME) SAMPLE_POSITION.set(HOME) print "Done." update_windows() def visitEachSampleLocation(): """ visitEachSampleLocation() function will move the robot arm to each location one at a time. It'll pause at each location and ask whether the location is good. Then it will allow one to "bump" the location one direction or another. One can then "save" the new location. This will require switching the locations of the crucibles to the XY database. """ xyzRobot.goHome() SAMPLE_POSITION.set(HOME) POSITION.set(HOME) POSITION_NAME.set("HOME") sampleLocation = 1 if sampleLocation > 0: value = xyzRobot.goToSamplePosition(sampleLocation, 1) POSITION_NAME.set("SAMPLE") POSITION.set(sampleLocation) SAMPLE_POSITION.set(sampleLocation) if value is False: errorMessage("There was a problem going to position 1.") return False moveArm.deiconify() SAMPLE_POSITION.set(sampleLocation) POSITION.set(sampleLocation) Button(moveArm, text="+X Axis", command=bumpXMotorUp).grid(row=1, column=1) Button(moveArm, text="-Y Axis", command=bumpYMotorLeft).grid(row=2, column=0, sticky=E) Button(moveArm, text="+Y Axis", command=bumpYMotorRight).grid(row=2, column=2, sticky=W) Button(moveArm, text="-X Axis", command=bumpXMotorDown).grid(row=3, column=1) Button(moveArm, text="NE", command=bumpMotorNE).grid(row=1, column=0, sticky=E) Button(moveArm, text="NW", command=bumpMotorNW).grid(row=1, column=2, sticky=W) Label(moveArm, textvariable=POSITION).grid(row=2, column=1) Button(moveArm, text="SE", command=bumpMotorSE).grid(row=3, column=2, sticky=W) Button(moveArm, text="SW", command=bumpMotorSW).grid(row=3, column=0, sticky=E) Label(moveArm, text="Step Size").grid(row=4, column=0, sticky=W) Entry(moveArm, textvariable=MOTORSTEP).grid(row=4, column=1, sticky=W) Button(moveArm, text="Set XY for this crucible position", command=setXYForSampleLocation).grid(row=5, column=0) Button(moveArm, text="Update all XYs based on this position", command=setXYForAllLocations).grid(row=5, column=1) Button(moveArm, text="Next position", command=moveToNextSampleLocation).grid(row=5, column=2) Button(moveArm, text="Go to Outside Balance Point", command=goToOutsideBalance).grid(row=6, column=0) Button(moveArm, text="Set Outside Balance Point", command=setOutsideBalance).grid(row=6, column=1) Button(moveArm, text="Go to Home Position(0,0)", command=goHome).grid(row=6, column=2) Button(moveArm, text="Go to Inside Balance Point", command=goToInsideBalance).grid(row=7, column=0) Button(moveArm, text="Set Inside Balance Point", command=setInsideBalance).grid(row=7, column=1) Button(moveArm, text="Cancel", command=backToMainWindowFromMoveArm).grid(row=8, column=2) update_windows() moveArm.update() def lasersOn(): output = xyzRobot.turnLasersOn() update_windows() return output def lasersOff(): output = xyzRobot.turnLasersOff() update_windows() return output def reloadFile(): file = tkFileDialog.askopenfilename(filetypes=[('sqlite files', '.sqlite')], initialdir='C:\\Users\\Archy\\Dropbox\\Rehydroxylation\\', parent=root, title='Choose a Sqlite database file') if file is None: return value = DataReadWrite.reopenDatabase(file) runID = DataReadWrite.getLastRunID() RUNID.set(runID) update_windows() return value def refinePosition(): position = SAMPLE_POSITION.get() xyzRobot.refinePosition(position) update_windows() return def loadRun(): RUNID.set(SETRUNID.get()) update_windows() return True def setXMaxVelocity(): maxvelocity = MAXXMOTORVELOCITY.get() xyzRobot.setXMotorVelocityLimit(maxvelocity) #MAXXMOTORVELOCITY.set(xyzRobot.getXMotorVelocityLimit()) update_windows() return def setYMaxVelocity(): maxvelocity = MAXYMOTORVELOCITY.get() xyzRobot.setYMotorVelocityLimit(maxvelocity) #MAXYMOTORVELOCITY.get(xyzRobot.getYMotorVelocityLimit()) update_windows() return def setZMaxVelocity(): maxvelocity = MAXZMOTORVELOCITY.get() xyzRobot.setZMotorVelocityLimit(maxvelocity) #MAXYMOTORVELOCITY.get(xyzRobot.getYMotorVelocityLimit()) update_windows() return def moveUntilXZero(): xyzRobot.moveXUntilZero() sleep(1) update_windows() return def moveUntilYZero(): xyzRobot.moveYUntilZero() sleep(1) update_windows() return ############################################################### ###GUI Program################################################# ############################################################## update_windows() #Create Menus menubar = Menu(root) #File Bar filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=restart_program) filemenu.add_separator() filemenu.add_command(label="Exit", command=KillProgram) menubar.add_cascade(label="File", menu=filemenu) #Help Menu helpmenu = Menu(menubar, tearoff=0) menubar.add_cascade(label="Help", menu=helpmenu) #Display the Menus root.config(menu=menubar) ## always use Run #1 unless otherwise stated.. if RUNID.get() is None: RUNID.set(1) ##Motor X Controls Label(root, text="X-Axis").grid(row=1, column=0, sticky=E, padx=2, pady=2) Entry(root, textvariable=XMOTORPOSITION, width=6).grid(row=1, column=1, sticky=W, padx=2, pady=2) Button(root, text="Move X", command=moveMotorX).grid(row=1, column=2, padx=2, pady=2, sticky=W) Button(root, text="Set Current Position of X to 0", command=setMotorXToZero).grid(row=1, column=3, padx=2, pady=2, sticky=W) Button(root, text="Move X until zero", command=moveUntilXZero).grid(row=1, column=4, padx=2, pady=1) ##Motor Y Controls Label(root, text="Y-Axis").grid(row=3, column=0, sticky=E, padx=2, pady=2) Entry(root, textvariable=YMOTORPOSITION, width=6).grid(row=3, column=1, sticky=W) Button(root, text="Move Y", command=moveMotorY).grid(row=3, column=2, padx=2, pady=2, sticky=W) Button(root, text="Set Current Position of Y to 0", command=setMotorYToZero).grid(row=3, column=3, padx=2, pady=2, sticky=W) Button(root, text="Move Y until zero", command=moveUntilYZero).grid(row=3, column=4, padx=2, pady=2) ##Motor Z Controls Label(root, text="Z-Axis").grid(row=4, column=0, sticky=E, padx=2, pady=2) Entry(root, textvariable=ZMOTORPOSITION, width=6).grid(row=4, column=1, sticky=W, padx=2, pady=2) Button(root, text="Move Z", command=moveArmToPosition).grid(row=4, column=2, sticky=W, padx=2, pady=2) Button(root, text="Set Current Position of Z to 0", command=resetZToZero).grid(row=4, column=3, padx=2, pady=2, sticky=W) Button(root, text="Move Z until zero", command=resetZMotorToZeroPosition).grid(row=4, column=4, padx=2, pady=2) Button(root, text="+Y Axis", command=bumpYMotorRight).grid(row=5, column=1, padx=2, pady=2) Button(root, text="-X Axis", command=bumpXMotorDown).grid(row=6, column=0, sticky=E, padx=2, pady=2) Spinbox(root, textvariable=MOTORSTEP, width=6).grid(row=6, column=1, padx=2, pady=2) Button(root, text="+X Axis", command=bumpXMotorUp).grid(row=6, column=2, sticky=W) Button(root, text="-Y Axis", command=bumpYMotorLeft).grid(row=7, column=1, padx=2, pady=2) Button(root, text="Up Z", command=bumpZMotorUp).grid(row=5, column=3, padx=2, pady=2) Button(root, text="Raise to Top", command=raiseArmToTop).grid(row=5, column=4, padx=2, pady=2) Entry(root, textvariable=ZMOTORSTEP, width=6).grid(row=6, column=3, padx=2, pady=2) Button(root, text="Lower to Sample", command=lowerArmToSample).grid(row=6, column=4, padx=2, pady=2) Button(root, text="Down Z", command=bumpZMotorDown).grid(row=7, column=3, padx=2, pady=2) Button(root, text="Lower to Balance", command=lowerArmToBalance).grid(row=7, column=4, padx=2, pady=2) ##Balance Door controller Label(root, text="Balance Door").grid(row=11, column=0, sticky=E, padx=2, pady=2) Button(root, text="Open", command=openBalanceDoor).grid(row=11, column=1, sticky=E, padx=2, pady=2) Button(root, text="Close", command=closeBalanceDoor).grid(row=11, column=2, sticky=W, padx=2, pady=2) Label(root, text="Balance Door").grid(row=11, column=3, sticky=E, padx=2, pady=2) Label(root, textvariable=BALANCEDOOR).grid(row=11, column=4, sticky=W, padx=2, pady=2) ##Balance Zeroing Label(root, text="Tare the Balance").grid(row=12, column=0, sticky=E, padx=2, pady=2) Button(root, text="Tare", command=BZero).grid(row=12, column=1, sticky=W, padx=2, pady=2) Label(root, text="Balance Reading (g) ").grid(row=13, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=BALANCEWEIGHT).grid(row=13, column=1, sticky=W, padx=2, pady=2) Label(root, textvariable=BALANCESTATUS).grid(row=13, column=2, sticky=W, padx=2, pady=2) Label(root, text="Low Precision Temp (C)").grid(row=14, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=TEMPERATURE).grid(row=14, column=1, sticky=W, padx=2, pady=2) Label(root, text="Humidity (%RH)").grid(row=14, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=HUMIDITY).grid(row=14, column=3, sticky=W, padx=2, pady=2) Label(root, text="Precision Temp C").grid(row=15, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=PRECISIONTEMP).grid(row=15, column=1, sticky=W, padx=2, pady=2) Label(root, text="Standard Balance (g)").grid(row=15, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=STANDARD_BALANCE).grid(row=15, column=3, sticky=W, padx=2, pady=2) Label(root, text="Using Standard Balance").grid(row=16, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=USINGSTANDARDBALANCE).grid(row=16, column=1, sticky=W, padx=2, pady=2) Label(root, text="Starting Sample Position").grid(row=17, column=0, sticky=E, padx=2, pady=2) Spinbox(root, textvariable=START_POSITION, from_=1, to=25).grid(row=17, column=1, sticky=W, padx=2, pady=2) listOfLocations = ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 10000, 20000) Label(root, text="Go To Sample Position Number").grid(row=18, column=0, sticky=E, padx=2, pady=2) Spinbox(root, textvariable=SAMPLE_POSITION, values=listOfLocations, borderwidth=2).grid(row=18, column=1, sticky=W, padx=2, pady=2) Button(root, text="GO", command=goToPosition).grid(row=18, column=2, sticky=W, padx=2, pady=2) Button(root, text="Refine Position", command=refine).grid(row=18, column=3, sticky=W, padx=2, pady=2) Label(root, text="Retrieve Sample from Balance").grid(row=19, column=0, sticky=E, padx=2, pady=2) Spinbox(root, textvariable=SAMPLENUM, from_=1, to=25).grid(row=19, column=1, sticky=W, padx=2, pady=2) Button(root, text="GO", command=getSampleFromBalance).grid(row=19, column=2, sticky=W, padx=2, pady=2) Label(root, text="Current Position:").grid(row=20, column=1, sticky=E, padx=2, pady=2) Label(root, textvariable=POSITION_NAME).grid(row=20, column=2, sticky=W, padx=2, pady=2) Label(root, text="Arm Location (Z)").grid(row=20, column=3, sticky=E, padx=2, pady=2) Label(root, textvariable=ARM_STATUS).grid(row=20, column=4, sticky=W, padx=2, pady=2) Label(root, text="X Coordinate (roller)").grid(row=21, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=ABSOLUTEXPOSITION).grid(row=21, column=1, sticky=W, padx=2, pady=2) Label(root, text="Y Coordinate (roller)").grid(row=21, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=ABSOLUTEYPOSITION).grid(row=21, column=3, sticky=W, padx=2, pady=2) Label(root, text="Z Coordinate (roller)").grid(row=21, column=4, sticky=E, padx=2, pady=2) Label(root, textvariable=ABSOLUTEZPOSITION).grid(row=21, column=5, sticky=W, padx=2, pady=2) Label(root, text="X Zero?").grid(row=22, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=XZERO).grid(row=22, column=1, sticky=W, padx=2, pady=2) Label(root, text="Y Zero?").grid(row=22, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=YZERO).grid(row=22, column=3, sticky=W, padx=2, pady=2) Label(root, text="Z Zero?").grid(row=22, column=4, sticky=E, padx=2, pady=2) Label(root, textvariable=ZZERO).grid(row=22, column=5, sticky=W, padx=2, pady=2) Label(root, text="X Motor Position").grid(row=23, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=XMOTORPOSITION).grid(row=23, column=1, sticky=W, padx=2, pady=2) Label(root, text="Y Motor Position").grid(row=23, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=YMOTORPOSITION).grid(row=23, column=3, sticky=W, padx=2, pady=2) Label(root, text="Z Motor Position").grid(row=23, column=4, sticky=W, padx=2, pady=2) Label(root, textvariable=ZMOTORPOSITION).grid(row=23, column=5, sticky=W, padx=2, pady=2) Button(root, text="Release Crucible/Close Gripper", command=openGripper).grid(row=24, sticky=E, column=0, padx=2, pady=2) Button(root, text="Engage Crucible/Open Gripper", command=closeGripper).grid(row=24, sticky=W, column=1, padx=2, pady=2) Label(root, text="Gripper Position").grid(row=24, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=GRIPPERPOSITION).grid(row=24, column=3, sticky=W, padx=2, pady=2) #Button(root, text="Lasers On", command=lasersOn).grid(row=25, column=0, padx=2, pady=2) #Button(root, text="Lasers Off", command=lasersOff).grid(row=25, column=1, padx=2, pady=2) Button(root, text="Chamber Lights On", command=turnLightOn).grid(row=25, column=0, sticky=E, padx=2, pady=2) Button(root, text="Chamber Lights Off", command=turnLightOff).grid(row=25, column=1, sticky=W, padx=2, pady=2) Label(root, text="Lights").grid(row=25, column=2, sticky=E, padx=2, pady=2) Label(root, textvariable=LIGHTSTATUS).grid(row=25, column=3, sticky=W, padx=2, pady=2) Label(root, text="X Motor Max").grid(row=26, column=0, padx=2, pady=2) Entry(root, textvariable=MAXXMOTORVELOCITY, width=8).grid(row=26, column=1, padx=2, pady=2) Button(root, text="Set X Motor Max", command=setXMaxVelocity).grid(row=26, column=2, padx=2, pady=2) Button(root, text="Disengage Steppers", command=xyzRobot.disengageMotors).grid(row=26, column=3, padx=2, pady=2) Label(root, text="Y Motor Max").grid(row=27, column=0, padx=2, pady=2) Entry(root, textvariable=MAXYMOTORVELOCITY, width=8).grid(row=27, column=1, padx=2, pady=2) Button(root, text="Set Y Motor Max Velocity", command=setYMaxVelocity).grid(row=27, column=2, padx=2, pady=2) Label(root, text="Z Motor Max").grid(row=28, column=0, padx=2, pady=2) Entry(root, textvariable=MAXZMOTORVELOCITY, width=8).grid(row=28, column=1, padx=2, pady=2) Button(root, text="Set Z Motor Max", command=setZMaxVelocity).grid(row=28, column=2, padx=2, pady=2) Button(root, text="Go Directly to Balance", command=goToBalance).grid(row=29, column=0, padx=2, pady=2) Button(root, text="Update this Window", command=update_windows).grid(row=29, column=2, padx=2, pady=2) Button(root, text="Find XY Home Position", command=findHome).grid(row=30, column=0, padx=2, pady=2) Button(root, text="Set Positions", command=visitEachSampleLocation).grid(row=30, column=1, padx=2, pady=2) Button(root, text="Check Positions", command=checkEachSamplePosition).grid(row=30, column=2, padx=2, pady=2) Button(root, text="Set Home to this XY Location", command=setAbsZeroXY).grid(row=30, column=3, padx=2, pady=2) Button(root, text="Go Home", command=goHome).grid(row=31, column=0, padx=2, pady=2) Button(root, text="Set XY for this sample position", command=setXYForSampleLocation).grid(row=31, column=3, padx=2, pady=2) Button(root, text="Go to Outside Balance Point", command=goToOutsideBalance).grid(row=32, column=0, padx=2, pady=2) Button(root, text="Set Z for Sample Position", command=setZForSampleLocation).grid(row=32, column=2, padx=2, pady=2) Button(root, text="Set XY for Outside Balance Point", command=setOutsideBalance).grid(row=32, column=3, padx=2, pady=2) Button(root, text="Go to Inside Balance Point", command=goToInsideBalance).grid(row=33, column=0, padx=2, pady=2) Button(root, text="Set XY for Inside Balance Point", command=setInsideBalance).grid(row=33, column=3, padx=2, pady=2) Button(root, text="Set Z for Balance Position", command=setZForBalanceLocation).grid(row=33, column=2, padx=2, pady=2) Label(root, text="Run ID:").grid(row=34, column=0, sticky=E, padx=2, pady=2) Label(root, textvariable=SETRUNID).grid(row=34, column=1, sticky=W, padx=2, pady=2) Button(root, text="Refine Position", command=refinePosition).grid(row=34, column=3, padx=2, pady=2) ##start the other scripts Button(root, text="1. Empty Crucibles", command=initialize).grid(row=35, column=0, padx=2, pady=2) Button(root, text="2. Setup Samples", command=setup).grid(row=35, column=1, padx=2, pady=2) Button(root, text="3. Post-Fire RHX", command=postFire).grid(row=35, column=2, padx=2, pady=2) Button(root, text="<Quit>", command=quit).grid(row=35, column=3, padx=2, pady=2) root.mainloop()
497f21accdf90e5db6cfc9b223630ab19336cddb
85fc4fcd841226c30b1a5824468eae95e6da3cd1
/oddities.py
3aadbd44e0062fdb114cb855a0e00371b739b293
[]
no_license
a5vh/kattis
1676060acfc6eef1d7c558299063646f3b7fcbf3
093cbeba31149fa0182ecc1bc8a43c60cdb1fa36
refs/heads/master
2020-08-17T19:54:11.754205
2019-11-26T01:34:29
2019-11-26T01:34:29
215,705,247
0
0
null
null
null
null
UTF-8
Python
false
false
171
py
times = int(input()) for i in range(times): num = int(input()) if num % 2 == 0: print(num, " is even") elif num % 2 != 0: print(num, " is odd")
23452b8aa23ec30902431afb8e033d9650a11a27
62e58c051128baef9452e7e0eb0b5a83367add26
/x12/4050/186004050.py
0ef5e94fd43a44abe1431659b10050e7af9dfadf
[]
no_license
dougvanhorn/bots-grammars
2eb6c0a6b5231c14a6faf194b932aa614809076c
09db18d9d9bd9d92cefbf00f1c0de1c590fe3d0d
refs/heads/master
2021-05-16T12:55:58.022904
2019-05-17T15:22:23
2019-05-17T15:22:23
105,274,633
0
0
null
2017-09-29T13:21:21
2017-09-29T13:21:21
null
UTF-8
Python
false
false
4,983
py
from bots.botsconfig import * from records004050 import recorddefs syntax = { 'version' : '00403', #version of ISA to send 'functionalgroup' : 'UW', } structure = [ {ID: 'ST', MIN: 1, MAX: 1, LEVEL: [ {ID: 'BGN', MIN: 1, MAX: 1}, {ID: 'CUR', MIN: 0, MAX: 1}, {ID: 'LTR', MIN: 0, MAX: 99}, {ID: 'NM1', MIN: 0, MAX: 2, LEVEL: [ {ID: 'N3', MIN: 0, MAX: 3}, {ID: 'N4', MIN: 0, MAX: 1}, {ID: 'REF', MIN: 0, MAX: 9}, {ID: 'PER', MIN: 0, MAX: 3}, ]}, {ID: 'ACT', MIN: 1, MAX: 99999, LEVEL: [ {ID: 'LX', MIN: 1, MAX: 99999, LEVEL: [ {ID: 'NM1', MIN: 1, MAX: 99999, LEVEL: [ {ID: 'REF', MIN: 0, MAX: 99999}, {ID: 'N3', MIN: 0, MAX: 1}, {ID: 'N4', MIN: 0, MAX: 1}, {ID: 'DMG', MIN: 0, MAX: 1}, {ID: 'DTP', MIN: 0, MAX: 5}, {ID: 'AM1', MIN: 0, MAX: 9}, {ID: 'PWK', MIN: 0, MAX: 1}, {ID: 'MSG', MIN: 0, MAX: 99999}, {ID: 'DMA', MIN: 0, MAX: 1}, {ID: 'QTY', MIN: 0, MAX: 99999}, ]}, {ID: 'BOR', MIN: 1, MAX: 99999, LEVEL: [ {ID: 'DTP', MIN: 0, MAX: 99999}, {ID: 'MSG', MIN: 0, MAX: 99999}, {ID: 'NM1', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'REF', MIN: 0, MAX: 99999}, {ID: 'PER', MIN: 0, MAX: 1}, {ID: 'N3', MIN: 0, MAX: 1}, {ID: 'N4', MIN: 0, MAX: 1}, {ID: 'DMA', MIN: 0, MAX: 1}, {ID: 'REL', MIN: 0, MAX: 1}, ]}, {ID: 'SPK', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'CD2', MIN: 0, MAX: 9}, {ID: 'DTP', MIN: 0, MAX: 9}, {ID: 'REF', MIN: 0, MAX: 1}, {ID: 'MSG', MIN: 0, MAX: 99999}, {ID: 'NM1', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'N4', MIN: 0, MAX: 1}, ]}, ]}, {ID: 'LTR', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'CD2', MIN: 0, MAX: 9}, {ID: 'DTP', MIN: 0, MAX: 9}, {ID: 'NM1', MIN: 0, MAX: 9}, {ID: 'MSG', MIN: 0, MAX: 99999}, ]}, {ID: 'UC', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'HL', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'UQS', MIN: 0, MAX: 1}, {ID: 'NM1', MIN: 0, MAX: 1}, {ID: 'N1', MIN: 0, MAX: 1}, {ID: 'N3', MIN: 0, MAX: 1}, {ID: 'N4', MIN: 0, MAX: 1}, {ID: 'DTP', MIN: 0, MAX: 99999}, {ID: 'QTY', MIN: 0, MAX: 99999}, {ID: 'MSG', MIN: 0, MAX: 99999}, {ID: 'DMA', MIN: 0, MAX: 1}, {ID: 'AM1', MIN: 0, MAX: 1}, {ID: 'DMG', MIN: 0, MAX: 1}, {ID: 'AMT', MIN: 0, MAX: 1}, {ID: 'EC', MIN: 0, MAX: 1}, {ID: 'PER', MIN: 0, MAX: 1}, {ID: 'REF', MIN: 0, MAX: 1}, {ID: 'IN1', MIN: 0, MAX: 1}, {ID: 'EMS', MIN: 0, MAX: 1}, {ID: 'ASL', MIN: 0, MAX: 99999}, {ID: 'TOA', MIN: 0, MAX: 1}, {ID: 'TOV', MIN: 0, MAX: 1}, {ID: 'III', MIN: 0, MAX: 99999}, {ID: 'SIN', MIN: 0, MAX: 1}, {ID: 'UCS', MIN: 0, MAX: 1}, {ID: 'FH', MIN: 0, MAX: 1}, {ID: 'UD', MIN: 0, MAX: 1}, {ID: 'CDS', MIN: 0, MAX: 1}, {ID: 'CED', MIN: 0, MAX: 1}, {ID: 'YNQ', MIN: 0, MAX: 1}, {ID: 'MPI', MIN: 0, MAX: 1}, {ID: 'EFI', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'BIN', MIN: 1, MAX: 1}, ]}, ]}, ]}, {ID: 'LS', MIN: 0, MAX: 1, LEVEL: [ {ID: 'UD', MIN: 1, MAX: 99999, LEVEL: [ {ID: 'NM1', MIN: 0, MAX: 1}, {ID: 'N4', MIN: 0, MAX: 1}, {ID: 'REL', MIN: 0, MAX: 1}, {ID: 'DTP', MIN: 0, MAX: 1}, {ID: 'EFI', MIN: 0, MAX: 99999, LEVEL: [ {ID: 'BIN', MIN: 1, MAX: 1}, ]}, ]}, {ID: 'LE', MIN: 1, MAX: 1}, ]}, ]}, ]}, ]}, {ID: 'SE', MIN: 1, MAX: 1}, ]} ]
5f656012f1f9e8a1142bd5fbe97e5773232143b6
f35259cdae65259d41d5c86f09351d6888a81de6
/module6.py
87ce2236305191b49e11e2aa5db13fd19e0d7fba
[ "MIT" ]
permissive
RajeshKumar-1998/python-web
9dbc71da656baec7946b9dae9f36919ac60be0ca
a4a7823752ce91a7a5bd3aaa1210c9ddad7ea55e
refs/heads/master
2022-04-18T04:57:12.274235
2020-04-23T12:28:14
2020-04-23T12:28:14
null
0
0
null
null
null
null
UTF-8
Python
false
false
702
py
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Rajesh # # Created: 26-12-2019 # Copyright: (c) Rajesh 2019 # Licence: <your licence> #------------------------------------------------------------------------------- import os import threading from threading import Thread import time def usr(): print("Wait for few secs") time.sleep(5) mypath = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) print(mypath) return def main(): inp = input("Enter the query") print(inp) print("Your Query is being processing !!!") usr() if __name__ == '__main__': main()