hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
7931c609a56ad449420d03f2cd0e99105b5827f2
33
py
Python
src/aceinna/framework/__init__.py
LukaszChl/ros_openimu
1bcf547fa42ee7c7dcc856c1d4eb5702d301b059
[ "Apache-2.0" ]
6
2021-03-18T16:18:53.000Z
2022-01-18T15:32:15.000Z
src/aceinna/framework/__init__.py
LukaszChl/ros_openimu
1bcf547fa42ee7c7dcc856c1d4eb5702d301b059
[ "Apache-2.0" ]
11
2020-12-22T16:19:20.000Z
2022-02-11T11:03:25.000Z
src/aceinna/framework/__init__.py
LukaszChl/ros_openimu
1bcf547fa42ee7c7dcc856c1d4eb5702d301b059
[ "Apache-2.0" ]
11
2021-04-12T03:00:28.000Z
2022-03-25T19:53:43.000Z
from .app_logger import AppLogger
33
33
0.878788
5
33
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
33
1
33
33
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
f70d90d6d3226de3373ba626ee5ba1d83ff5c2ce
229
py
Python
backend/src/hatchling/builders/plugin/hooks.py
daobook/hatch
1cf39ad1a11ce90bc77fb7fdc4b9202433509179
[ "MIT" ]
null
null
null
backend/src/hatchling/builders/plugin/hooks.py
daobook/hatch
1cf39ad1a11ce90bc77fb7fdc4b9202433509179
[ "MIT" ]
null
null
null
backend/src/hatchling/builders/plugin/hooks.py
daobook/hatch
1cf39ad1a11ce90bc77fb7fdc4b9202433509179
[ "MIT" ]
null
null
null
from ...plugin import hookimpl from ..custom import CustomBuilder from ..sdist import SdistBuilder from ..wheel import WheelBuilder @hookimpl def hatch_register_builder(): return [CustomBuilder, SdistBuilder, WheelBuilder]
22.9
54
0.799127
25
229
7.24
0.6
0
0
0
0
0
0
0
0
0
0
0
0.126638
229
9
55
25.444444
0.905
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
true
0
0.571429
0.142857
0.857143
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
1
1
0
0
6
f76f6042ce6217c7713d4e9883b5e9de5541e42d
42
py
Python
k_thinning/full_knowledge/RL/__init__.py
varikakasandor/dissertation-balls-into-bins
fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e
[ "Apache-2.0" ]
null
null
null
k_thinning/full_knowledge/RL/__init__.py
varikakasandor/dissertation-balls-into-bins
fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e
[ "Apache-2.0" ]
null
null
null
k_thinning/full_knowledge/RL/__init__.py
varikakasandor/dissertation-balls-into-bins
fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e
[ "Apache-2.0" ]
null
null
null
from k_thinning.full_knowledge.RL import *
42
42
0.857143
7
42
4.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
42
1
42
42
0.871795
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
f79b2fdab5421943091c0fc50e2631078435f500
214
py
Python
meta_mb/optimizers/__init__.py
iclavera/meta-mb
a1204e573c1415161129403cfb287bf120488fd0
[ "MIT" ]
4
2021-01-07T08:22:51.000Z
2021-12-27T10:53:14.000Z
meta_mb/optimizers/__init__.py
iclavera/meta-mb
a1204e573c1415161129403cfb287bf120488fd0
[ "MIT" ]
null
null
null
meta_mb/optimizers/__init__.py
iclavera/meta-mb
a1204e573c1415161129403cfb287bf120488fd0
[ "MIT" ]
null
null
null
from meta_mb.optimizers.base import Optimizer from meta_mb.optimizers.conjugate_gradient_optimizer import ConjugateGradientOptimizer from meta_mb.optimizers.maml_first_order_optimizer import MAMLFirstOrderOptimizer
71.333333
86
0.920561
26
214
7.269231
0.538462
0.126984
0.15873
0.31746
0
0
0
0
0
0
0
0
0.051402
214
3
87
71.333333
0.931034
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e3a276b0291c98baa8d0c46ba8f6d48210972eb0
55,450
py
Python
test/hummingbot/connector/exchange/bitmart/test_bitmart_exchange.py
cardosofede/hummingbot
d1df085bb879a06a7dc77d4fdc8ff6f13d8726ca
[ "Apache-2.0" ]
542
2021-12-17T22:34:31.000Z
2022-03-31T14:36:23.000Z
test/hummingbot/connector/exchange/bitmart/test_bitmart_exchange.py
cardosofede/hummingbot
d1df085bb879a06a7dc77d4fdc8ff6f13d8726ca
[ "Apache-2.0" ]
291
2021-12-17T20:07:53.000Z
2022-03-31T11:07:23.000Z
test/hummingbot/connector/exchange/bitmart/test_bitmart_exchange.py
cardosofede/hummingbot
d1df085bb879a06a7dc77d4fdc8ff6f13d8726ca
[ "Apache-2.0" ]
220
2021-12-17T12:41:23.000Z
2022-03-31T23:03:22.000Z
import asyncio import json import re import unittest from decimal import Decimal from typing import Dict, Awaitable, List from unittest.mock import AsyncMock, patch, MagicMock from aioresponses import aioresponses from hummingbot.connector.exchange.bitmart.bitmart_exchange import BitmartExchange from hummingbot.connector.exchange.bitmart import bitmart_constants as CONSTANTS from hummingbot.core.event.event_logger import EventLogger from hummingbot.connector.trading_rule import TradingRule from hummingbot.connector.exchange.bitmart.bitmart_utils import HBOT_BROKER_ID from hummingbot.core.clock import Clock, ClockMode from hummingbot.core.event.events import MarketEvent from hummingbot.core.data_type.common import OrderType, TradeType from hummingbot.core.network_iterator import NetworkStatus from hummingbot.core.time_iterator import TimeIterator from test.hummingbot.connector.network_mocking_assistant import NetworkMockingAssistant class BitmartExchangeTests(unittest.TestCase): # the level is required to receive logs from the data source logger level = 0 @classmethod def setUpClass(cls) -> None: super().setUpClass() cls.base_asset = "COINALPHA" cls.quote_asset = "HBOT" cls.trading_pair = f"{cls.base_asset}-{cls.quote_asset}" cls.exchange_trading_pair = f"{cls.base_asset}_{cls.quote_asset}" def setUp(self) -> None: super().setUp() self.tracker_task = None self.exchange_task = None self.log_records = [] self.return_values_queue = asyncio.Queue() self.resume_test_event = asyncio.Event() self.exchange = BitmartExchange( bitmart_api_key="someKey", bitmart_secret_key="someSecret", bitmart_memo="someMemo", trading_pairs=[self.trading_pair], ) self.exchange.logger().setLevel(1) self.exchange.logger().addHandler(self) self.mocking_assistant = NetworkMockingAssistant() self.ev_loop = asyncio.get_event_loop() self.buy_order_created_logger: EventLogger = EventLogger() self.sell_order_created_logger: EventLogger = EventLogger() self.buy_order_completed_logger: EventLogger = EventLogger() self.order_cancelled_logger: EventLogger = EventLogger() self.order_failure_logger: EventLogger = EventLogger() self.order_filled_logger: EventLogger = EventLogger() self.exchange.add_listener(MarketEvent.BuyOrderCreated, self.buy_order_created_logger) self.exchange.add_listener(MarketEvent.SellOrderCreated, self.sell_order_created_logger) self.exchange.add_listener(MarketEvent.BuyOrderCompleted, self.buy_order_completed_logger) self.exchange.add_listener(MarketEvent.OrderCancelled, self.order_cancelled_logger) self.exchange.add_listener(MarketEvent.OrderFailure, self.order_failure_logger) self.exchange.add_listener(MarketEvent.OrderFilled, self.order_filled_logger) def tearDown(self) -> None: self.tracker_task and self.tracker_task.cancel() self.exchange_task and self.exchange_task.cancel() super().tearDown() def handle(self, record): self.log_records.append(record) def is_logged(self, log_level: str, message: str) -> bool: logged = any( record.levelname == log_level and record.getMessage() == message for record in self.log_records ) return logged async def return_queued_values_and_unlock_with_event(self): val = await self.return_values_queue.get() self.resume_test_event.set() return val def create_exception_and_unlock_with_event(self, exception): self.resume_test_event.set() raise exception def async_run_with_timeout(self, coroutine: Awaitable, timeout: float = 1): ret = self.ev_loop.run_until_complete(asyncio.wait_for(coroutine, timeout)) return ret def simulate_trading_rules_initialized(self): self.exchange._trading_rules = { self.trading_pair: TradingRule( trading_pair=self.trading_pair, min_order_size=Decimal("0.01"), min_price_increment=Decimal("0.0001"), min_base_amount_increment=Decimal("0.000001"), ) } @staticmethod def authentication_response(authenticated: bool) -> str: if authenticated: resp = {"event": "login"} else: resp = {"event": "login", "errorMessage": "", "errorCode": "91002"} return json.dumps(resp) @staticmethod def get_system_status_reply_mock() -> Dict: status_reply = { "code": 1000, "trace": "886fb6ae-456b-4654-b4e0-d681ac05cea1", "message": "OK", "data": { "service": [ { "title": "Spot API Stop", "service_type": "spot", "status": "2", "start_time": 1527777538000, "end_time": 1527777538000 }, ] } } return status_reply def get_symbols_details_reply_mock(self, min_order_size: str) -> Dict: details = { "code": 1000, "trace": "886fb6ae-456b-4654-b4e0-d681ac05cea1", "message": "OK", "data": { "symbols": [ { "symbol": self.exchange_trading_pair, "symbol_id": 1024, "base_currency": self.base_asset, "quote_currency": self.quote_asset, "quote_increment": "1.00000000", "base_min_size": min_order_size, "base_max_size": "10000000.00000000", "price_min_precision": 6, "price_max_precision": 8, "expiration": "NA", "min_buy_amount": "0.00010000", "min_sell_amount": "0.00010000" }, ] } } return details @staticmethod def get_order_placed_response_mock(exchange_order_id: int) -> Dict: response = { "code": 1000, "trace": "886fb6ae-456b-4654-b4e0-d681ac05cea1", "message": "OK", "data": { "order_id": exchange_order_id } } return response @staticmethod def get_order_cancelled_response_mock(success: bool) -> Dict: response = { "code": 1000, "trace": "886fb6ae-456b-4654-b4e0-d681ac05cea1", "message": "OK", "data": { "result": success } } return response @staticmethod def get_account_balances_response_mock(wallet: List[Dict[str, str]]) -> Dict: response = { "code": 1000, "trace": "886fb6ae-456b-4654-b4e0-d681ac05cea1", "message": "OK", "data": { "wallet": wallet } } return response @aioresponses() def test_check_network_succeeds_on_reply(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CHECK_NETWORK_PATH_URL}" resp = self.get_system_status_reply_mock() mocked_api.get(url, body=json.dumps(resp)) result = self.async_run_with_timeout(self.exchange.check_network()) self.assertEqual(NetworkStatus.CONNECTED, result) @aioresponses() def test_check_network_fails_on_error(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CHECK_NETWORK_PATH_URL}" mocked_api.get(url, body="", status=501) result = self.async_run_with_timeout(self.exchange.check_network()) self.assertEqual(NetworkStatus.NOT_CONNECTED, result) @aioresponses() def test_trading_rules_polling_loop(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_TRADING_RULES_PATH_URL}" min_order_size = "1.10000000" resp = self.get_symbols_details_reply_mock(min_order_size) mocked_api.get( url, body=json.dumps(resp), callback=lambda *args, **kwargs: self.resume_test_event.set() ) self.exchange_task = self.ev_loop.create_task(self.exchange._trading_rules_polling_loop()) self.async_run_with_timeout(self.resume_test_event.wait()) self.assertIn(self.trading_pair, self.exchange.trading_rules) trading_rules = self.exchange.trading_rules[self.trading_pair] self.assertTrue(isinstance(trading_rules, TradingRule)) self.assertEqual(Decimal(min_order_size), trading_rules.min_order_size) @aioresponses() def test_trading_rules_polling_loop_stops_on_asyncio_cancelled_error(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_TRADING_RULES_PATH_URL}" mocked_api.get(url, exception=asyncio.CancelledError) with self.assertRaises(asyncio.CancelledError): self.async_run_with_timeout(self.exchange._trading_rules_polling_loop()) @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._update_trading_rules") def test_trading_rules_polling_loop_logs_other_exceptions(self, update_trading_rules_mock: AsyncMock): update_trading_rules_mock.side_effect = lambda: self.create_exception_and_unlock_with_event( Exception("Dummy test error") ) self.exchange_task = self.ev_loop.create_task(self.exchange._trading_rules_polling_loop()) self.async_run_with_timeout(self.resume_test_event.wait()) self.resume_test_event.clear() self.assertTrue( self.is_logged("NETWORK", "Unexpected error while fetching trading rules. Error: Dummy test error") ) def test_get_order_price_quantum(self): self.simulate_trading_rules_initialized() price_quantum = self.exchange.get_order_price_quantum(self.trading_pair, price=Decimal("1")) self.assertEqual(Decimal("0.0001"), price_quantum) def test_get_order_size_quantum(self): self.simulate_trading_rules_initialized() size_quantum = self.exchange.get_order_size_quantum(self.trading_pair, order_size=Decimal("1")) self.assertEqual(Decimal("0.000001"), size_quantum) @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._create_order") @patch("hummingbot.connector.exchange.bitmart.bitmart_utils.get_tracking_nonce") def test_buy(self, get_tracking_nonce_mock: MagicMock, create_order_mock: AsyncMock): nonce = "1234" amount = Decimal("1") price = Decimal("1000") get_tracking_nonce_mock.return_value = nonce order_id = self.exchange.buy(self.trading_pair, amount, OrderType.LIMIT, price) create_order_mock.assert_called_with( TradeType.BUY, order_id, self.trading_pair, amount, OrderType.LIMIT, price ) self.assertEqual(f"{HBOT_BROKER_ID}B-{self.trading_pair}-{nonce}", order_id) @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._create_order") @patch("hummingbot.connector.exchange.bitmart.bitmart_utils.get_tracking_nonce") def test_sell(self, get_tracking_nonce_mock: MagicMock, create_order_mock: AsyncMock): nonce = "1234" amount = Decimal("1") price = Decimal("1000") get_tracking_nonce_mock.return_value = nonce order_id = self.exchange.sell(self.trading_pair, amount, OrderType.LIMIT, price) create_order_mock.assert_called_with( TradeType.SELL, order_id, self.trading_pair, amount, OrderType.LIMIT, price ) self.assertEqual(f"{HBOT_BROKER_ID}S-{self.trading_pair}-{nonce}", order_id) @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._execute_cancel") def test_cancel(self, execute_cancel_mock: AsyncMock): order_id = "someId" ret = self.exchange.cancel(self.trading_pair, order_id) execute_cancel_mock.assert_called_with(self.trading_pair, order_id) self.assertEqual(order_id, ret) @aioresponses() def test_create_buy_order(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CREATE_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") exchange_id = 1234 resp = self.get_order_placed_response_mock(exchange_id) mocked_api.post(regex_url, body=json.dumps(resp)) self.simulate_trading_rules_initialized() order_id = "someId" amount = Decimal("1") price = Decimal("1000") self.async_run_with_timeout( self.exchange._create_order( TradeType.BUY, order_id, self.trading_pair, amount, OrderType.LIMIT, price ) ) self.assertEqual(1, len(self.exchange.in_flight_orders)) order = self.exchange.in_flight_orders[order_id] self.assertEqual(amount, order.amount) self.assertEqual(TradeType.BUY, order.trade_type) created_orders_events = self.buy_order_created_logger.event_log self.assertEqual(1, len(created_orders_events)) event = created_orders_events[0] self.assertEqual(order_id, event.order_id) @aioresponses() def test_create_sell_order(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CREATE_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") exchange_id = 1234 resp = self.get_order_placed_response_mock(exchange_id) mocked_api.post(regex_url, body=json.dumps(resp)) self.simulate_trading_rules_initialized() order_id = "someId" amount = Decimal("1") price = Decimal("1000") self.async_run_with_timeout( self.exchange._create_order( TradeType.SELL, order_id, self.trading_pair, amount, OrderType.LIMIT, price ) ) self.assertEqual(1, len(self.exchange.in_flight_orders)) order = self.exchange.in_flight_orders[order_id] self.assertEqual(amount, order.amount) self.assertEqual(TradeType.SELL, order.trade_type) created_orders_events = self.sell_order_created_logger.event_log self.assertEqual(1, len(created_orders_events)) event = created_orders_events[0] self.assertEqual(order_id, event.order_id) @aioresponses() def test_create_order_raises_on_asyncio_cancelled_error(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CREATE_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") mocked_api.post(regex_url, exception=asyncio.CancelledError) self.simulate_trading_rules_initialized() order_id = "someId" amount = Decimal("1") price = Decimal("1000") with self.assertRaises(asyncio.CancelledError): self.async_run_with_timeout( self.exchange._create_order( TradeType.SELL, order_id, self.trading_pair, amount, OrderType.LIMIT, price ) ) @aioresponses() def test_create_order_handles_other_exceptions(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CREATE_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") mocked_api.post(regex_url, exception=Exception("Dummy test error")) self.simulate_trading_rules_initialized() trade_type = TradeType.BUY order_id = "someId" amount = Decimal("1") order_type = OrderType.LIMIT price = Decimal("1000") self.async_run_with_timeout( self.exchange._create_order( trade_type, order_id, self.trading_pair, amount, order_type, price ) ) self.assertEqual(0, len(self.exchange.in_flight_orders)) error_msg = ( f"Error submitting {trade_type.name} {order_type.name} order to BitMart for" f" {self.exchange.quantize_order_amount(self.trading_pair, amount)} {self.trading_pair}" f" {self.exchange.quantize_order_price(self.trading_pair, price)}." ) self.assertTrue(self.is_logged("NETWORK", error_msg)) def test_start_tracking_order(self): order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) self.assertEqual(1, len(self.exchange.in_flight_orders)) order = self.exchange.in_flight_orders[order_id] self.assertEqual(order_id, order.client_order_id) def test_stop_tracking_order(self): order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) self.exchange.stop_tracking_order("anotherId") # should be ignored self.assertEqual(1, len(self.exchange.in_flight_orders)) self.exchange.stop_tracking_order(order_id) self.assertEqual(0, len(self.exchange.in_flight_orders)) @aioresponses() def test_execute_cancel(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CANCEL_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") resp = self.get_order_cancelled_response_mock(success=True) mocked_api.post(regex_url, body=json.dumps(resp)) order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) ret = self.async_run_with_timeout(self.exchange._execute_cancel(self.trading_pair, order_id)) self.assertEqual(order_id, ret) @aioresponses() def test_execute_cancel_failed_is_logged(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CANCEL_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") resp = self.get_order_cancelled_response_mock(success=False) mocked_api.post(regex_url, body=json.dumps(resp)) order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) self.async_run_with_timeout(self.exchange._execute_cancel(self.trading_pair, order_id)) logged_msg = ( f"Failed to cancel order {order_id}:" f" Failed to cancel order - {order_id}. Order was already matched or canceled on the exchange." ) self.assertTrue(self.is_logged("NETWORK", logged_msg)) @aioresponses() def test_execute_cancel_raises_on_asyncio_cancelled_error(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CANCEL_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") mocked_api.post(regex_url, exception=asyncio.CancelledError) order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) with self.assertRaises(asyncio.CancelledError): self.async_run_with_timeout(self.exchange._execute_cancel(self.trading_pair, order_id)) @aioresponses() def test_execute_cancel_other_exceptions_are_logged(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CANCEL_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") mocked_api.post(regex_url, exception=Exception("Dummy test error")) order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) self.async_run_with_timeout(self.exchange._execute_cancel(self.trading_pair, order_id)) logged_msg = f"Failed to cancel order {order_id}: Dummy test error" self.assertTrue(self.is_logged("NETWORK", logged_msg)) @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._update_balances") @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._update_order_status") def test_status_polling_loop(self, update_order_status_mock: AsyncMock, update_balances_mock: AsyncMock): update_order_status_mock.side_effect = self.return_queued_values_and_unlock_with_event self.return_values_queue.put_nowait("") self.exchange_task = self.ev_loop.create_task(self.exchange._status_polling_loop()) self.exchange._poll_notifier.set() self.async_run_with_timeout(self.resume_test_event.wait()) update_balances_mock.assert_called() update_order_status_mock.assert_called() @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._update_balances") def test_status_polling_loop_raises_on_asyncio_cancelled_error(self, update_balances_mock: AsyncMock): update_balances_mock.side_effect = lambda: self.create_exception_and_unlock_with_event( exception=asyncio.CancelledError ) self.exchange._poll_notifier.set() with self.assertRaises(asyncio.CancelledError): self.async_run_with_timeout(self.exchange._status_polling_loop()) @patch("hummingbot.connector.exchange.bitmart.bitmart_exchange.BitmartExchange._update_balances") def test_status_polling_loop_logs_other_exceptions(self, update_balances_mock: AsyncMock): update_balances_mock.side_effect = lambda: self.create_exception_and_unlock_with_event( exception=Exception("Dummy test error") ) self.exchange._poll_notifier.set() self.exchange_task = self.ev_loop.create_task(self.exchange._status_polling_loop()) self.async_run_with_timeout(self.resume_test_event.wait()) self.assertTrue(self.is_logged("ERROR", "Dummy test error")) self.assertTrue( self.is_logged("NETWORK", "Unexpected error while fetching account updates.") ) @aioresponses() def test_update_balances_adds_new_balances(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ACCOUNT_SUMMARY_PATH_URL}" regex_url = re.compile(f"^{url}") wallet = [ { "id": self.base_asset, "available": "10.000000", "name": "CoinAlpha", "frozen": "5.000000", }, ] resp = self.get_account_balances_response_mock(wallet) mocked_api.get(regex_url, body=json.dumps(resp)) self.async_run_with_timeout(self.exchange._update_balances()) self.assertIn(self.base_asset, self.exchange.available_balances) self.assertEqual(Decimal("10"), self.exchange.available_balances[self.base_asset]) self.assertEqual(Decimal("15"), self.exchange.get_balance(self.base_asset)) @aioresponses() def test_update_balances_updates_balances(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ACCOUNT_SUMMARY_PATH_URL}" regex_url = re.compile(f"^{url}") wallet = [ { "id": self.base_asset, "available": "10.000000", "name": "CoinAlpha", "frozen": "5.000000", }, ] resp = self.get_account_balances_response_mock(wallet) mocked_api.get(regex_url, body=json.dumps(resp)) self.exchange.available_balances[self.base_asset] = Decimal("1") self.exchange._account_balances[self.base_asset] = Decimal("2") self.async_run_with_timeout(self.exchange._update_balances()) self.assertIn(self.base_asset, self.exchange.available_balances) self.assertEqual(Decimal("10"), self.exchange.available_balances[self.base_asset]) self.assertEqual(Decimal("15"), self.exchange.get_balance(self.base_asset)) @aioresponses() def test_update_balances_removes_balances(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ACCOUNT_SUMMARY_PATH_URL}" regex_url = re.compile(f"^{url}") wallet = [ { "id": self.base_asset, "available": "10.000000", "name": "CoinAlpha", "frozen": "5.000000", }, ] resp = self.get_account_balances_response_mock(wallet) mocked_api.get(regex_url, body=json.dumps(resp)) self.exchange.available_balances[self.quote_asset] = Decimal("1") self.exchange._account_balances[self.quote_asset] = Decimal("2") self.async_run_with_timeout(self.exchange._update_balances()) self.assertNotIn(self.quote_asset, self.exchange.available_balances) @aioresponses() def test_update_order_status_logs_missing_data_in_response(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ORDER_DETAIL_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "a27c2cb5-ead4-471d-8455-1cfeda054ea6", } mocked_api.get(regex_url, body=json.dumps(resp)) clock = Clock( ClockMode.BACKTEST, start_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL, end_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL * 2, ) TimeIterator.start(self.exchange, clock) order_id = "someId" self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) self.async_run_with_timeout(self.exchange._update_order_status()) self.assertTrue( self.is_logged("INFO", f"_update_order_status data not in resp: {resp}") ) @aioresponses() def test_update_order_status_order_fill(self, mocked_api): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ORDER_DETAIL_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "a27c2cb5-ead4-471d-8455-1cfeda054ea6", "data": { "order_id": int(exchange_order_id), "symbol": self.exchange_trading_pair, "create_time": 1591096004000, "side": "buy", "type": "limit", "price": price, "price_avg": price, "size": amount, "notional": "0.00000000", "filled_notional": str(Decimal(price) / 2), "filled_size": str(Decimal(amount) / 2), "status": "5", # partially filled } } mocked_api.get(regex_url, body=json.dumps(resp)) clock = Clock( ClockMode.BACKTEST, start_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL, end_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL * 2, ) TimeIterator.start(self.exchange, clock) self.exchange.start_tracking_order( order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) self.async_run_with_timeout(self.exchange._update_order_status()) order = self.exchange.in_flight_orders[order_id] order_completed_events = self.buy_order_completed_logger.event_log orders_filled_events = self.order_filled_logger.event_log self.assertFalse(order.is_done or order.is_failure or order.is_cancelled) self.assertEqual(0, len(order_completed_events)) self.assertEqual(1, len(orders_filled_events)) self.assertEqual(order_id, orders_filled_events[0].order_id) @aioresponses() def test_update_order_status_order_filled(self, mocked_api): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ORDER_DETAIL_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "a27c2cb5-ead4-471d-8455-1cfeda054ea6", "data": { "order_id": int(exchange_order_id), "symbol": self.exchange_trading_pair, "create_time": 1591096004000, "side": "buy", "type": "limit", "price": price, "price_avg": price, "size": amount, "notional": "0.00000000", "filled_notional": price, "filled_size": amount, "status": "6", # filled } } mocked_api.get(regex_url, body=json.dumps(resp)) clock = Clock( ClockMode.BACKTEST, start_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL, end_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL * 2, ) TimeIterator.start(self.exchange, clock) self.exchange.start_tracking_order( order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) order = self.exchange.in_flight_orders[order_id] self.async_run_with_timeout(self.exchange._update_order_status()) order_completed_events = self.buy_order_completed_logger.event_log orders_filled_events = self.order_filled_logger.event_log self.assertTrue(order.is_done) self.assertFalse(order.is_failure or order.is_cancelled) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(1, len(order_completed_events)) self.assertEqual(order_id, order_completed_events[0].order_id) self.assertEqual(1, len(orders_filled_events)) self.assertEqual(order_id, orders_filled_events[0].order_id) @aioresponses() def test_update_order_status_cancelled_event(self, mocked_api): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ORDER_DETAIL_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "a27c2cb5-ead4-471d-8455-1cfeda054ea6", "data": { "order_id": int(exchange_order_id), "symbol": self.exchange_trading_pair, "create_time": 1591096004000, "side": "buy", "type": "limit", "price": price, "price_avg": "0", "size": amount, "notional": "0.00000000", "filled_notional": "0", "filled_size": "0", "status": "8", # cancelled } } mocked_api.get(regex_url, body=json.dumps(resp)) clock = Clock( ClockMode.BACKTEST, start_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL, end_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL * 2, ) TimeIterator.start(self.exchange, clock) self.exchange.start_tracking_order( order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) order = self.exchange.in_flight_orders[order_id] self.async_run_with_timeout(self.exchange._update_order_status()) order_completed_events = self.buy_order_completed_logger.event_log order_cancelled_events = self.order_cancelled_logger.event_log self.assertTrue(order.is_cancelled and order.is_done) self.assertFalse(order.is_failure) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(0, len(order_completed_events)) self.assertEqual(1, len(order_cancelled_events)) self.assertEqual(order_id, order_cancelled_events[0].order_id) @aioresponses() def test_update_order_status_order_failed_event(self, mocked_api): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_ORDER_DETAIL_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "a27c2cb5-ead4-471d-8455-1cfeda054ea6", "data": { "order_id": int(exchange_order_id), "symbol": self.exchange_trading_pair, "create_time": 1591096004000, "side": "buy", "type": "limit", "price": price, "price_avg": "0", "size": amount, "notional": "0.00000000", "filled_notional": "0", "filled_size": "0", "status": "3", # failure } } mocked_api.get(regex_url, body=json.dumps(resp)) clock = Clock( ClockMode.BACKTEST, start_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL, end_time=self.exchange.UPDATE_ORDER_STATUS_MIN_INTERVAL * 2, ) TimeIterator.start(self.exchange, clock) self.exchange.start_tracking_order( order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) order = self.exchange.in_flight_orders[order_id] self.async_run_with_timeout(self.exchange._update_order_status()) order_completed_events = self.buy_order_completed_logger.event_log order_failure_events = self.order_failure_logger.event_log self.assertTrue(order.is_failure and order.is_done) self.assertFalse(order.is_cancelled) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(0, len(order_completed_events)) self.assertEqual(1, len(order_failure_events)) self.assertEqual(order_id, order_failure_events[0].order_id) def test_user_stream_event_queue_error_is_logged(self): self.exchange_task = self.ev_loop.create_task(self.exchange._user_stream_event_listener()) dummy_user_stream = AsyncMock() dummy_user_stream.get.side_effect = lambda: self.create_exception_and_unlock_with_event( Exception("Dummy test error") ) self.exchange._user_stream_tracker._user_stream = dummy_user_stream self.async_run_with_timeout(self.resume_test_event.wait()) self.resume_test_event.clear() self.assertTrue(self.is_logged("NETWORK", "Unknown error. Retrying after 1 seconds.")) def test_user_stream_event_queue_notifies_async_cancel_errors(self): self.tracker_task = self.ev_loop.create_task(self.exchange._user_stream_event_listener()) dummy_user_stream = AsyncMock() dummy_user_stream.get.side_effect = lambda: self.create_exception_and_unlock_with_event( asyncio.CancelledError() ) self.exchange._user_stream_tracker._user_stream = dummy_user_stream with self.assertRaises(asyncio.CancelledError): self.async_run_with_timeout(self.tracker_task) def test_user_stream_order_event_registers_partial_fill_event(self): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" message = { "data": [ { "symbol": self.exchange_trading_pair, "side": "buy", "type": "limit", "notional": "", "size": amount, "ms_t": "1609926028000", "price": price, "filled_notional": str(Decimal(price) / 2), "filled_size": str(Decimal(amount) / 2), "margin_trading": "0", "state": "5", # partially filled "order_id": exchange_order_id, "order_type": "0", "last_fill_time": "1609926039226", "last_fill_price": price, "last_fill_count": str(Decimal(amount) / 2) } ], "table": "spot/user/order" } self.return_values_queue.put_nowait(message) dummy_user_stream = AsyncMock() dummy_user_stream.get.side_effect = self.return_queued_values_and_unlock_with_event self.exchange._user_stream_tracker._user_stream = dummy_user_stream self.tracker_task = self.ev_loop.create_task(self.exchange._user_stream_event_listener()) self.exchange.start_tracking_order( order_id=order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) self.async_run_with_timeout(self.resume_test_event.wait()) self.resume_test_event.clear() order = self.exchange.in_flight_orders[order_id] order_completed_events = self.buy_order_completed_logger.event_log orders_filled_events = self.order_filled_logger.event_log self.assertFalse(order.is_done or order.is_failure or order.is_cancelled) self.assertEqual(0, len(order_completed_events)) self.assertEqual(1, len(orders_filled_events)) self.assertEqual(order_id, orders_filled_events[0].order_id) def test_user_stream_order_event_registers_filled_event(self): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" message = { "data": [ { "symbol": self.exchange_trading_pair, "side": "buy", "type": "limit", "notional": "", "size": amount, "ms_t": "1609926028000", "price": price, "filled_notional": price, "filled_size": amount, "margin_trading": "0", "state": "6", # filled "order_id": exchange_order_id, "order_type": "0", "last_fill_time": "1609926039226", "last_fill_price": price, "last_fill_count": amount } ], "table": "spot/user/order" } self.return_values_queue.put_nowait(message) dummy_user_stream = AsyncMock() dummy_user_stream.get.side_effect = self.return_queued_values_and_unlock_with_event self.exchange._user_stream_tracker._user_stream = dummy_user_stream self.tracker_task = self.ev_loop.create_task(self.exchange._user_stream_event_listener()) self.exchange.start_tracking_order( order_id=order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) order = self.exchange.in_flight_orders[order_id] self.async_run_with_timeout(self.resume_test_event.wait()) self.resume_test_event.clear() order_completed_events = self.buy_order_completed_logger.event_log orders_filled_events = self.order_filled_logger.event_log self.assertTrue(order.is_done) self.assertFalse(order.is_failure or order.is_cancelled) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(1, len(order_completed_events)) self.assertEqual(order_id, order_completed_events[0].order_id) self.assertEqual(1, len(orders_filled_events)) self.assertEqual(order_id, orders_filled_events[0].order_id) def test_user_stream_order_event_registers_cancelled_event(self): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" message = { "data": [ { "symbol": self.exchange_trading_pair, "side": "buy", "type": "limit", "notional": "", "size": amount, "ms_t": "1609926028000", "price": price, "filled_notional": "0", "filled_size": "0", "margin_trading": "0", "state": "8", # cancelled "order_id": exchange_order_id, "order_type": "0", "last_fill_time": "1609926039226", "last_fill_price": "0", "last_fill_count": "0" } ], "table": "spot/user/order" } self.return_values_queue.put_nowait(message) dummy_user_stream = AsyncMock() dummy_user_stream.get.side_effect = self.return_queued_values_and_unlock_with_event self.exchange._user_stream_tracker._user_stream = dummy_user_stream self.tracker_task = self.ev_loop.create_task(self.exchange._user_stream_event_listener()) self.exchange.start_tracking_order( order_id=order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) order = self.exchange.in_flight_orders[order_id] self.async_run_with_timeout(self.resume_test_event.wait()) self.resume_test_event.clear() order_completed_events = self.buy_order_completed_logger.event_log order_cancelled_events = self.order_cancelled_logger.event_log self.assertTrue(order.is_cancelled and order.is_done) self.assertFalse(order.is_failure) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(0, len(order_completed_events)) self.assertEqual(1, len(order_cancelled_events)) self.assertEqual(order_id, order_cancelled_events[0].order_id) def test_user_stream_order_event_registers_failed_event(self): exchange_order_id = "2147857398" order_id = "someId" price = "46100.0000000000" amount = "1.0000000000" message = { "data": [ { "symbol": self.exchange_trading_pair, "side": "buy", "type": "limit", "notional": "", "size": amount, "ms_t": "1609926028000", "price": price, "filled_notional": "0", "filled_size": "0", "margin_trading": "0", "state": "3", # failure "order_id": exchange_order_id, "order_type": "0", "last_fill_time": "1609926039226", "last_fill_price": "0", "last_fill_count": "0" } ], "table": "spot/user/order" } self.return_values_queue.put_nowait(message) dummy_user_stream = AsyncMock() dummy_user_stream.get.side_effect = self.return_queued_values_and_unlock_with_event self.exchange._user_stream_tracker._user_stream = dummy_user_stream self.tracker_task = self.ev_loop.create_task(self.exchange._user_stream_event_listener()) self.exchange.start_tracking_order( order_id=order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal(amount), order_type=OrderType.LIMIT, ) order = self.exchange.in_flight_orders[order_id] self.async_run_with_timeout(self.resume_test_event.wait()) self.resume_test_event.clear() order_completed_events = self.buy_order_completed_logger.event_log order_failure_events = self.order_failure_logger.event_log self.assertTrue(order.is_failure and order.is_done) self.assertFalse(order.is_cancelled) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(0, len(order_completed_events)) self.assertEqual(1, len(order_failure_events)) self.assertEqual(order_id, order_failure_events[0].order_id) @aioresponses() def test_get_open_orders(self, mocked_api): exchange_order_id = "2147857398" order_id = "someId" price = "9000.00" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_OPEN_ORDERS_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "70e7d427-7436-4fb8-8cdd-97e1f5eadbe9", "data": { "current_page": 1, "orders": [ { "order_id": int(exchange_order_id), "symbol": self.exchange_trading_pair, "create_time": 1591099963000, "side": "buy", "type": "limit", "price": price, "price_avg": "0.00", "size": "1.00000", "notional": "9000.00000000", "filled_notional": "0.00000000", "filled_size": "0.00000", "status": "4" }, { "order_id": 2147601252, "symbol": "BTC_USDT", "create_time": 1591099964000, "side": "sell", "type": "limit", "price": "10000.00", "price_avg": "0.00", "size": "2.00000", "notional": "10000.00000000", "filled_notional": "0.00000000", "filled_size": "0.00000", "status": "4" } ] } } mocked_api.get(regex_url, body=json.dumps(resp)) self.exchange.start_tracking_order( order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal("1"), order_type=OrderType.LIMIT, ) orders = self.async_run_with_timeout(self.exchange.get_open_orders()) self.assertEqual(1, len(orders)) order = orders[0] self.assertEqual(order_id, order.client_order_id) self.assertEqual(Decimal(price), order.price) @aioresponses() def test_get_open_orders_fetches_next_page(self, mocked_api): exchange_order_id = "2147857398" order_id = "someId" price = "9000.00" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_OPEN_ORDERS_PATH_URL}" regex_url = re.compile(f"^{url}") orders_list = [ { "order_id": 2147601252, "symbol": "BTC_USDT", "create_time": 1591099964000, "side": "sell", "type": "limit", "price": "10000.00", "price_avg": "0.00", "size": "2.00000", "notional": "10000.00000000", "filled_notional": "0.00000000", "filled_size": "0.00000", "status": "4" } ] resp = { "message": "OK", "code": 1000, "trace": "70e7d427-7436-4fb8-8cdd-97e1f5eadbe9", "data": { "current_page": 1, "orders": orders_list * 100 } } mocked_api.get(regex_url, body=json.dumps(resp)) # first page resp = { "message": "OK", "code": 1000, "trace": "70e7d427-7436-4fb8-8cdd-97e1f5eadbe9", "data": { "current_page": 2, "orders": [ { "order_id": int(exchange_order_id), "symbol": self.exchange_trading_pair, "create_time": 1591099963000, "side": "buy", "type": "limit", "price": price, "price_avg": "0.00", "size": "1.00000", "notional": "9000.00000000", "filled_notional": "0.00000000", "filled_size": "0.00000", "status": "4" }, ] } } mocked_api.get(regex_url, body=json.dumps(resp)) # second page self.exchange.start_tracking_order( order_id, exchange_order_id=exchange_order_id, trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal(price), amount=Decimal("1"), order_type=OrderType.LIMIT, ) orders = self.async_run_with_timeout(self.exchange.get_open_orders()) self.assertEqual(1, len(orders)) def test_cancel_all_raises_on_no_trading_pairs(self): self.exchange._trading_pairs = None with self.assertRaises(Exception): self.async_run_with_timeout(self.exchange.cancel_all(timeout_seconds=1)) @aioresponses() def test_cancel_all(self, mocked_api): order_id = "someId" url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CANCEL_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") resp = self.get_order_cancelled_response_mock(success=True) mocked_api.post(regex_url, body=json.dumps(resp)) url = f"{CONSTANTS.REST_URL}/{CONSTANTS.GET_OPEN_ORDERS_PATH_URL}" regex_url = re.compile(f"^{url}") resp = { "message": "OK", "code": 1000, "trace": "70e7d427-7436-4fb8-8cdd-97e1f5eadbe9", "data": { "current_page": 1, "orders": [] } } mocked_api.get(regex_url, body=json.dumps(resp)) self.exchange.start_tracking_order( order_id, exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) cancellation_results = self.async_run_with_timeout(self.exchange.cancel_all(timeout_seconds=1)) order_cancelled_events = self.order_cancelled_logger.event_log self.assertEqual(1, len(order_cancelled_events)) self.assertEqual(order_id, order_cancelled_events[0].order_id) self.assertNotIn(order_id, self.exchange.in_flight_orders) self.assertEqual(1, len(cancellation_results)) self.assertEqual(order_id, cancellation_results[0].order_id) @aioresponses() def test_cancel_all_logs_exceptions(self, mocked_api): url = f"{CONSTANTS.REST_URL}/{CONSTANTS.CANCEL_ORDER_PATH_URL}" regex_url = re.compile(f"^{url}") mocked_api.post(regex_url, exception=Exception("Dummy test error")) self.exchange.start_tracking_order( order_id="someId", exchange_order_id="1234", trading_pair=self.trading_pair, trade_type=TradeType.BUY, price=Decimal("10000"), amount=Decimal("1"), order_type=OrderType.LIMIT, ) self.async_run_with_timeout(self.exchange.cancel_all(timeout_seconds=1)) self.assertTrue(self.is_logged("NETWORK", "Failed to cancel all orders.")) def test_tick_no_poll(self): timestamp = self.exchange.POLL_INTERVAL self.exchange._last_timestamp = self.exchange.POLL_INTERVAL self.exchange.tick(timestamp) self.assertTrue(not self.exchange._poll_notifier.is_set()) def test_tick_sets_poll(self): timestamp = self.exchange.POLL_INTERVAL * 2 self.exchange._last_timestamp = self.exchange.POLL_INTERVAL self.exchange.tick(timestamp) self.assertTrue(self.exchange._poll_notifier.is_set()) def test_get_fee(self): fee = self.exchange.get_fee( self.base_asset, self.quote_asset, OrderType.LIMIT, TradeType.BUY, amount=Decimal("1"), price=Decimal("10"), ) self.assertEqual(Decimal("0.0025"), fee.percent) fee = self.exchange.get_fee( self.base_asset, self.quote_asset, OrderType.LIMIT_MAKER, TradeType.BUY, amount=Decimal("1"), price=Decimal("10"), ) self.assertEqual(Decimal("0.0025"), fee.percent)
38.560501
111
0.613309
6,094
55,450
5.244175
0.062028
0.039865
0.023938
0.021403
0.857219
0.813849
0.782903
0.760968
0.745291
0.733338
0
0.037447
0.283877
55,450
1,437
112
38.587335
0.767358
0.003427
0
0.69028
0
0
0.13217
0.054682
0
0
0
0
0.092257
1
0.0486
false
0
0.015651
0
0.073311
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e3b80b31e1cfb082405e42ff6d9408750083597f
6,326
py
Python
tests/system/presenter/test_check_mediafile_id.py
ostcar/openslides-backend
e6ceac497c37a1e3e7f408c6cfb29cf21d985b4c
[ "MIT" ]
null
null
null
tests/system/presenter/test_check_mediafile_id.py
ostcar/openslides-backend
e6ceac497c37a1e3e7f408c6cfb29cf21d985b4c
[ "MIT" ]
19
2021-11-22T16:25:54.000Z
2021-11-25T13:38:13.000Z
tests/system/presenter/test_check_mediafile_id.py
ostcar/openslides-backend
e6ceac497c37a1e3e7f408c6cfb29cf21d985b4c
[ "MIT" ]
null
null
null
from openslides_backend.permissions.permissions import Permissions from .base import BasePresenterTestCase class TestCheckMediafileId(BasePresenterTestCase): def test_simple(self) -> None: self.create_model( "mediafile/1", {"filename": "the filename", "is_directory": False, "meeting_id": 1}, ) self.create_model("meeting/1") status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) self.assertEqual(data, {"ok": True, "filename": "the filename"}) def test_is_directory(self) -> None: self.create_model( "mediafile/1", {"filename": "the filename", "is_directory": True} ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) self.assertEqual(data, {"ok": False}) def test_non_existent(self) -> None: status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 400) def test_request_without_token(self) -> None: self.create_model( "mediafile/1", {"filename": "the filename", "is_directory": False, "meeting_id": 1}, ) self.create_model("meeting/1") self.client.headers.clear() status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) self.assertEqual(data, {"ok": True, "filename": "the filename"}) def test_no_permissions(self) -> None: self.set_models( { "mediafile/1": {"filename": "the filename", "is_directory": False}, "user/1": {"organization_management_level": None}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 403) def test_permission_in_admin_group(self) -> None: self.set_models( { "mediafile/1": { "filename": "the filename", "is_directory": False, "meeting_id": 1, }, "meeting/1": {"admin_group_id": 2}, "group/2": {"user_ids": [1]}, "user/1": {"organization_management_level": None, "group_$1_ids": [2]}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) def test_permission_logo(self) -> None: self.set_models( { "mediafile/1": { "filename": "the filename", "is_directory": False, "meeting_id": 1, "used_as_logo_$_in_meeting_id": ["test"], "used_as_logo_$test_in_meeting_id": 1, }, "meeting/1": {"enable_anonymous": True}, "user/1": {"organization_management_level": None}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) def test_permission_font(self) -> None: self.set_models( { "mediafile/1": { "filename": "the filename", "is_directory": False, "meeting_id": 1, "used_as_font_$_in_meeting_id": ["test"], "used_as_font_$test_in_meeting_id": 1, }, "meeting/1": {"enable_anonymous": True}, "user/1": {"organization_management_level": None}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) def test_permission_projector_can_see(self) -> None: self.set_models( { "mediafile/1": { "filename": "the filename", "is_directory": False, "meeting_id": 1, "projection_ids": [1], }, "meeting/1": {"default_group_id": 2}, "group/2": { "user_ids": [1], "permissions": [Permissions.Projector.CAN_SEE], }, "user/1": {"organization_management_level": None, "group_$1_ids": [2]}, "projection/1": {"meeting_id": 1, "current_projector_id": 1}, "projector/1": {"meeting_id": 1, "current_projection_ids": [1]}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) def test_can_see_and_is_public(self) -> None: self.set_models( { "mediafile/1": { "filename": "the filename", "is_directory": False, "meeting_id": 1, "is_public": True, }, "meeting/1": {"default_group_id": 2}, "group/2": { "user_ids": [1], "permissions": [Permissions.Mediafile.CAN_SEE], }, "user/1": {"organization_management_level": None, "group_$1_ids": [2]}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200) def test_can_see_and_inherited_groups(self) -> None: self.set_models( { "mediafile/1": { "filename": "the filename", "is_directory": False, "meeting_id": 1, "inherited_access_group_ids": [2], }, "meeting/1": {"default_group_id": 2}, "group/2": { "user_ids": [1], "permissions": [Permissions.Mediafile.CAN_SEE], }, "user/1": {"organization_management_level": None, "group_$1_ids": [2]}, } ) status_code, data = self.request("check_mediafile_id", {"mediafile_id": 1}) self.assertEqual(status_code, 200)
39.291925
87
0.513437
621
6,326
4.921095
0.117552
0.02356
0.029777
0.064791
0.848822
0.834424
0.820681
0.820681
0.813482
0.813482
0
0.026098
0.351881
6,326
160
88
39.5375
0.719268
0
0
0.557823
0
0
0.268732
0.058647
0
0
0
0
0.095238
1
0.07483
false
0
0.013605
0
0.095238
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e3b8a8d22dd50ff0085b46a988dd2d199ba885fc
22,200
py
Python
tests/test_views.py
wq1308786830/danjac-newsmeme
43a9a52775530c02de4fb540c827bf0c82860c01
[ "BSD-3-Clause" ]
48
2015-01-23T07:24:37.000Z
2022-03-22T05:27:33.000Z
tests/test_views.py
wq1308786830/danjac-newsmeme
43a9a52775530c02de4fb540c827bf0c82860c01
[ "BSD-3-Clause" ]
null
null
null
tests/test_views.py
wq1308786830/danjac-newsmeme
43a9a52775530c02de4fb540c827bf0c82860c01
[ "BSD-3-Clause" ]
22
2015-01-30T14:46:12.000Z
2020-03-28T03:13:59.000Z
# -*- coding: utf-8 -*- """ test_views.py ~~~~~~~~ NewsMeme tests :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ from newsmeme.signals import comment_added from newsmeme.models import User, Post, Comment from newsmeme.extensions import db, mail from tests import TestCase class TestApi(TestCase): def create_user(self): user = User(username="tester", email="tester@example.com", password="test") db.session.add(user) db.session.commit() return user def create_post(self): post = Post(author=self.create_user(), title="test") db.session.add(post) db.session.commit() return post def test_get_post(self): post = self.create_post() response = self.client.get("/api/post/%d/" % post.id) self.assert_200(response) assert response.json['post_id'] == post.id assert response.json['title'] == "test" assert response.json['author'] == "tester" def test_search(self): self.create_post() response = self.client.get("/api/search/?keywords=test") self.assert_200(response) assert len(response.json['results']) == 1 def test_user(self): self.create_post() response = self.client.get("/api/user/tester/") self.assert_200(response) assert len(response.json['posts']) == 1 class TestComment(TestCase): def create_comment(self): user = User(username="tester", email="tester@example.com", password="test") post = Post(author=user, title="test") comment = Comment(post=post, author=user, comment="test") db.session.add_all([user, post, comment]) db.session.commit() comment_added.send(post) return comment def test_edit_comment_not_logged_in(self): comment = self.create_comment() response = self.client.get("/comment/%d/edit/" % comment.id) self.assert_401(response) def test_edit_comment_not_logged_in_as_author(self): comment = self.create_comment() user = User(username="tester2", email="tester2@example.com", password="test") db.session.add(user) db.session.commit() self.login(login="tester2", password="test") response = self.client.get("/comment/%d/edit/" % comment.id) self.assert_403(response) def test_edit_comment_logged_in_as_author(self): comment = self.create_comment() self.login(login="tester", password="test") response = self.client.get("/comment/%d/edit/" % comment.id) self.assert_200(response) def test_update_comment_logged_in_as_author(self): comment = self.create_comment() self.login(login="tester", password="test") response = self.client.post("/comment/%d/edit/" % comment.id, data={"comment":"test2"}) self.assert_redirects(response, comment.url) comment = Comment.query.get(comment.id) assert comment.comment == "test2" def test_delete_comment_not_logged_in(self): comment = self.create_comment() response = self.client.get("/comment/%d/delete/" % comment.id) self.assert_405(response) def test_delete_comment_not_logged_in_as_author(self): comment = self.create_comment() response = self.client.post("/comment/%d/delete/" % comment.id) self.assert_401(response) user = User(username="tester2", email="tester2@example.com", password="test") db.session.add(user) db.session.commit() self.login(login="tester2", password="test") response = self.client.post("/comment/%d/delete/" % comment.id) self.assert_403(response) def test_delete_comment_logged_in_as_author(self): comment = self.create_comment() self.login(login="tester", password="test") response = self.client.post("/comment/%d/delete/" % comment.id) assert Comment.query.count() == 0 post = Post.query.get(comment.post.id) assert post.num_comments == 0 assert response.json['success'] assert response.json['comment_id'] == comment.id class TestFrontend(TestCase): def test_tags(self): user = User(username="tester", email="tester@example.com", password="test") db.session.add(user) db.session.commit() for i in xrange(20): post = Post(author=user, tags="IT Crowd, funny, TV", title="test") db.session.add(post) db.session.commit() response = self.client.get("/tags/") self.assert_200(response) def test_rules(self): response = self.client.get("/rules/") self.assert_200(response) def test_index(self): response = self.client.get("/") self.assert_200(response) user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) for i in xrange(100): post = Post(author=user, link="http://reddit.com", title="test post") db.session.add(post) db.session.commit() response = self.client.get("/") self.assert_200(response) def test_latest(self): user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) for i in xrange(100): post = Post(author=user, link="http://reddit.com", title="test post") db.session.add(post) db.session.commit() def test_submit_not_logged_in(self): response = self.client.get("/submit/") self.assert_401(response) def test_post_submit_not_logged_in(self): data = { "title" : "testing", "description" : "a test" } response = self.client.post("/submit/", data=data) self.assert_401(response) def test_submit_logged_in(self): user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) db.session.commit() self.login(login="tester", password="test") response = self.client.get("/submit/") self.assert_200(response) def test_post_submit_logged_in(self): user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) db.session.commit() self.login(login="tester", password="test") data = { "title" : "testing", "description" : "a test" } response = self.client.post("/submit/", data=data) self.assert_redirects(response, "/latest/") assert Post.query.count() == 1 class TestPost(TestCase): def create_user(self, login=False): user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) db.session.commit() if login: self.login(login="tester", password="test") return user def test_delete_post_via_get(self): response = self.client.get("/post/1/delete/") self.assert_405(response) def test_delete_non_existing_post_not_logged_in(self): response = self.client.post("/post/1/delete/") self.assert_401(response) def test_delete_non_existing_post_logged_in(self): user = self.create_user(True) response = self.client.post("/post/1/delete/") self.assert_404(response) def test_delete_existing_post_not_logged_in(self): user = self.create_user(False) post = Post(author=user, title="test", description="test") db.session.add(post) db.session.commit() response = self.client.post("/post/%d/delete/" % post.id) self.assert_401(response) def test_delete_existing_post_logged_in_as_author(self): user = self.create_user(True) post = Post(author=user, title="test", description="test") db.session.add(post) db.session.commit() response = self.client.post("/post/%d/delete/" % post.id) self.assert_200(response) assert response.json['success'] assert Post.query.count() == 0 def test_delete_post_not_logged_in_as_author(self): user = self.create_user(False) post = Post(author=user, title="test", description="test") db.session.add(post) db.session.commit() user = User(username="tester2", password="test", email="tester2@example.com") db.session.add(user) db.session.commit() self.login(login="tester2", password="test") response = self.client.post("/post/%d/delete/" % post.id) self.assert_403(response) def test_delete_post_logged_in_as_admin(self): user = self.create_user(False) admin_user = User(username="admin", email="admin@newsmeme.com", password="admin1", role=User.ADMIN) db.session.add(admin_user) db.session.commit() self.login(login="admin", password="admin1") post = Post(author=user, title="test", description="test") db.session.add(post) db.session.commit() with mail.record_messages() as outbox: response = self.client.post("/post/%d/delete/" % post.id) assert response.json['success'] assert Post.query.count() == 0 assert len(outbox) == 1 def test_edit_non_existing_post_not_logged_in(self): response = self.client.get("/post/1/edit/") self.assert_401(response) def test_edit_non_existing_post_logged_in(self): user = self.create_user(True) response = self.client.get("/post/1/edit/") self.assert_404(response) def test_edit_existing_post_not_logged_in(self): post = Post(author=self.create_user(False), title="test", description="test") db.session.add(post) db.session.commit() response = self.client.get("/post/%d/edit/" % post.id) self.assert_401(response) def test_edit_existing_post_not_logged_in_as_author(self): post = Post(author=self.create_user(False), title="test", description="test") db.session.add(post) db.session.commit() user = User(username="tester2", password="test", email="tester2@example.com") db.session.add(user) db.session.commit() self.login(login="tester2", password="test") response = self.client.get("/post/%d/edit/" % post.id) self.assert_403(response) def test_edit_existing_post_logged_in_as_author(self): post = Post(author=self.create_user(True), title="test", description="test") db.session.add(post) db.session.commit() response = self.client.get("/post/%d/edit/" % post.id) self.assert_200(response) def test_update_existing_post_logged_in_as_author(self): post = Post(author=self.create_user(True), title="test", description="test") db.session.add(post) db.session.commit() data = { "title" : "testing 123", "description" : "a test 123" } response = self.client.post("/post/%d/edit/" % post.id, data=data) self.assert_redirects(response, "/post/%d/" % post.id) post = Post.query.first() assert post.title == "testing 123" assert post.description == "a test 123" def test_update_existing_post_logged_in_as_admin(self): post = Post(author=self.create_user(False), title="test", description="test") db.session.add(post) db.session.commit() admin_user = User(username="admin", email="admin@newsmeme.com", password="admin1", role=User.ADMIN) db.session.add(admin_user) db.session.commit() self.login(login="admin", password="admin1") data = { "title" : "testing 123", "description" : "a test 123" } with mail.record_messages() as outbox: response = self.client.post("/post/%d/edit/" % post.id, data=data) self.assert_redirects(response, "/post/%d/" % post.id) assert len(outbox) == 1 post = Post.query.first() assert post.title == "testing 123" assert post.description == "a test 123" def test_view_post(self): response = self.client.get("/post/1/") self.assert_404(response) user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) db.session.commit() post = Post(author=user, title="test", description="test") db.session.add(post) db.session.commit() response = self.client.get("/post/%d/" % post.id) self.assert_200(response) for i in xrange(100): user = User(username="tester-%d" % i, email="tester=%d.gmail.com" % i, password="test") comment = Comment(post=post, author=user, comment="a comment") db.session.add(user) db.session.add(comment) db.session.commit() response = self.client.get("/post/%d/" % post.id) self.assert_200(response) def test_add_comment(self): response = self.client.get("/post/1/addcomment/") self.assert_401(response) user = User(username="tester", email="tester@example.com", password="test") db.session.add(user) db.session.commit() self.login(login="tester", password="test") response = self.client.get("/post/1/addcomment/") self.assert_404(response) post = Post(author=user, title="test", link="http://reddit.com") db.session.add(post) db.session.commit() response = self.client.get("/post/%d/addcomment/" % post.id) self.assert_200(response) response = self.client.get("/post/%d/1/reply/" % post.id) with mail.record_messages() as outbox: response = self.client.post("/post/%d/addcomment/" % post.id, data={"comment" : "testing"}) assert len(outbox) == 0 comment = Comment.query.first() self.assert_redirects(response, comment.url) # reply to this comment response = self.client.get("/post/%d/%d/reply/" % (post.id, comment.id)) self.assert_200(response) with mail.record_messages() as outbox: response = self.client.post("/post/%d/%d/reply/" % ( post.id, comment.id), data={'comment':'hello'}) assert len(outbox) == 0 assert Comment.query.count() == 2 reply = Comment.query.filter( Comment.parent_id==comment.id).first() assert reply.comment == "hello" self.assert_redirects(response, reply.url) # another user user2 = User(username="tester2", email="tester2@example.com", password="test") db.session.add(user2) db.session.commit() self.login(login="tester2", password="test") with mail.record_messages() as outbox: response = self.client.post("/post/%d/addcomment/" % post.id, data={"comment" : "testing"}) assert len(outbox) == 0 user.email_alerts = True db.session.add(user) db.session.commit() assert User.query.filter(User.email_alerts==True).count() == 1 with mail.record_messages() as outbox: response = self.client.post("/post/%d/addcomment/" % post.id, data={"comment" : "testing"}) assert len(outbox) == 1 with mail.record_messages() as outbox: response = self.client.post( "/post/%d/%d/reply/" % (post.id, comment.id), data={"comment" : "testing"}) assert len(outbox) == 1 # double check author doesn't receive own emails self.login(login="tester", password="test") with mail.record_messages() as outbox: response = self.client.post("/post/%d/%d/reply/" % ( post.id, comment.id), data={'comment':'hello'}) assert len(outbox) == 0 class TestFeeds(TestCase): def setUp(self): super(TestFeeds, self).setUp() user = User(username="tester", email="tester@example.com", password="test") db.session.add(user) db.session.commit() for i in xrange(20): post = Post(author=user, tags="programming", title="TESTING", description="test") db.session.add(post) db.session.commit() def test_posts(self): response = self.client.get("/feeds/") self.assert_200(response) def test_latest(self): response = self.client.get("/feeds/latest/") self.assert_200(response) def test_user(self): response = self.client.get("/feeds/user/danjac/") self.assert_404(response) response = self.client.get("/feeds/user/tester/") self.assert_200(response) def test_tag(self): response = self.client.get("/feeds/tag/foo/") self.assert_404(response) response = self.client.get("/feeds/tag/programming/") self.assert_200(response) class TestAccount(TestCase): def test_delete_account(self): response = self.client.get("/acct/delete/") self.assert_401(response) user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) db.session.commit() self.login(login="tester@example.com", password="test") response = self.client.get("/acct/delete/") self.assert_200(response) response = self.client.post("/acct/delete/", data={'recaptcha_challenge_field':'test', 'recaptcha_response_field':'test'}) self.assert_redirects(response, "/") assert User.query.count() == 0 def test_login(self): response = self.client.get("/acct/login/") self.assert_200(response) response = self.client.post("/acct/login/", data={"login" : "tester", "password" : "test"}) self.assert_200(response) assert "invalid login" in response.data user = User(username="tester", password="test", email="tester@example.com") db.session.add(user) db.session.commit() response = self.client.post("/acct/login/", data={"login" : "tester", "password" : "test"}) self.assert_redirects(response, "/user/tester/") response = self.client.post("/acct/login/", data={"login" : "tester", "password" : "test", "next" : "/submit/"}) self.assert_redirects(response, "/submit/") def test_logout(self): response = self.client.get("/acct/logout/") self.assert_redirects(response, "/") class TestUser(TestCase): def setUp(self): super(TestUser, self).setUp() self.user = User(username="tester", email="tester@example.com", password="test") db.session.add(self.user) for i in xrange(10): post = Post(author=self.user, title="test") db.session.add(post) comment = Comment(post=post, author=self.user, comment="test comment") db.session.add(comment) db.session.commit() def test_posts(self): response = self.client.get("/user/tester/") self.assert_200(response) def test_comments(self): response = self.client.get("/user/tester/comments/") self.assert_200(response) class TestOpenId(TestCase): def test_login(self): response = self.client.get("/openid/login/") self.assert_200(response) def test_signup(self): response = self.client.get("/openid/signup/") self.assert_403(response)
26.65066
80
0.541982
2,419
22,200
4.856966
0.06945
0.060516
0.099583
0.073283
0.850881
0.810537
0.746106
0.703805
0.624308
0.554515
0
0.015934
0.327162
22,200
832
81
26.682692
0.770637
0.01009
0
0.72973
0
0
0.115698
0.005468
0
0
0
0
0.173745
1
0.098456
false
0.079151
0.007722
0
0.129344
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
6
e3deafc16f732a32a7106e19d46a7c2af9dfe7d2
21
py
Python
ranzen/torch/transforms/__init__.py
predictive-analytics-lab/palk
64bcb36af07ee54df90e96c0b3a7cc6276dd4a06
[ "Apache-2.0" ]
null
null
null
ranzen/torch/transforms/__init__.py
predictive-analytics-lab/palk
64bcb36af07ee54df90e96c0b3a7cc6276dd4a06
[ "Apache-2.0" ]
11
2021-02-18T11:01:22.000Z
2021-09-27T14:47:42.000Z
ranzen/torch/transforms/__init__.py
predictive-analytics-lab/palkit
64bcb36af07ee54df90e96c0b3a7cc6276dd4a06
[ "Apache-2.0" ]
null
null
null
from .mixup import *
10.5
20
0.714286
3
21
5
1
0
0
0
0
0
0
0
0
0
0
0
0.190476
21
1
21
21
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
581c4757d07549d7cb71ff39048487e8a4299c12
5,663
py
Python
configs/deepim/lmPbrSO/FlowNet512_1.5AugAAE_Flat_lmPbr_SO/FlowNet512_1.5AugAAE_Flat_Pbr_05_can.py
THU-DA-6D-Pose-Group/self6dpp
c267cfa55e440e212136a5e9940598720fa21d16
[ "Apache-2.0" ]
33
2021-12-15T07:11:47.000Z
2022-03-29T08:58:32.000Z
configs/deepim/lmPbrSO/FlowNet512_1.5AugAAE_Flat_lmPbr_SO/FlowNet512_1.5AugAAE_Flat_Pbr_05_can.py
THU-DA-6D-Pose-Group/self6dpp
c267cfa55e440e212136a5e9940598720fa21d16
[ "Apache-2.0" ]
3
2021-12-15T11:39:54.000Z
2022-03-29T07:24:23.000Z
configs/deepim/lmPbrSO/FlowNet512_1.5AugAAE_Flat_lmPbr_SO/FlowNet512_1.5AugAAE_Flat_Pbr_05_can.py
THU-DA-6D-Pose-Group/self6dpp
c267cfa55e440e212136a5e9940598720fa21d16
[ "Apache-2.0" ]
null
null
null
_base_ = ["./FlowNet512_1.5AugAAE_Flat_Pbr_01_ape.py"] OUTPUT_DIR = "output/deepim/lmPbrSO/FlowNet512_1.5AugAAE_Flat_lmPbr_SO/can" DATASETS = dict(TRAIN=("lm_pbr_can_train",), TEST=("lm_real_can_test",)) # bbnc5 # objects can Avg(1) │··············································································································· # ad_2 26.08 26.08 │··············································································································· # ad_5 93.80 93.80 │··············································································································· # ad_10 99.90 99.90 │··············································································································· # rete_2 97.83 97.83 │··············································································································· # rete_5 100.00 100.00 │··············································································································· # rete_10 100.00 100.00 │··············································································································· # re_2 97.93 97.93 │··············································································································· # re_5 100.00 100.00 │··············································································································· # re_10 100.00 100.00 │··············································································································· # te_2 99.80 99.80 │··············································································································· # te_5 100.00 100.00 │··············································································································· # te_10 100.00 100.00 │··············································································································· # proj_2 52.17 52.17 │··············································································································· # proj_5 98.82 98.82 │··············································································································· # proj_10 100.00 100.00 │··············································································································· # re 0.91 0.91 │··············································································································· # te 0.01 0.01
209.740741
318
0.07187
155
5,663
14.696774
0.322581
0.030729
0.024583
0.030729
0.384109
0.384109
0.110623
0
0
0
0
0.075031
0.576373
5,663
26
319
217.807692
0.080867
0.956384
0
0
0
0
0.585903
0.444934
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
582c46b81b52ea58dcb89904f82c50c921559e60
441
py
Python
terrascript/logicmonitor/r.py
hugovk/python-terrascript
08fe185904a70246822f5cfbdc9e64e9769ec494
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
terrascript/logicmonitor/r.py
hugovk/python-terrascript
08fe185904a70246822f5cfbdc9e64e9769ec494
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
terrascript/logicmonitor/r.py
hugovk/python-terrascript
08fe185904a70246822f5cfbdc9e64e9769ec494
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# terrascript/logicmonitor/r.py import terrascript class logicmonitor_collector(terrascript.Resource): pass class logicmonitor_collector_group(terrascript.Resource): pass class logicmonitor_dashboard(terrascript.Resource): pass class logicmonitor_dashboard_group(terrascript.Resource): pass class logicmonitor_device(terrascript.Resource): pass class logicmonitor_device_group(terrascript.Resource): pass
16.333333
57
0.804989
45
441
7.688889
0.266667
0.294798
0.398844
0.404624
0.693642
0.578035
0
0
0
0
0
0
0.131519
441
26
58
16.961538
0.903394
0.06576
0
0.461538
0
0
0
0
0
0
0
0
0
1
0
true
0.461538
0.076923
0
0.538462
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
1
0
0
6
5839e9aa0e093677ecb796f18d4c6c87861463e5
368
py
Python
app/util.py
Bello-Bello/open-rank-tracker
7a393b37961f4261b417c7745e3f9c5043a61376
[ "MIT" ]
null
null
null
app/util.py
Bello-Bello/open-rank-tracker
7a393b37961f4261b417c7745e3f9c5043a61376
[ "MIT" ]
null
null
null
app/util.py
Bello-Bello/open-rank-tracker
7a393b37961f4261b417c7745e3f9c5043a61376
[ "MIT" ]
1
2022-02-21T23:52:22.000Z
2022-02-21T23:52:22.000Z
import os def create_db_uri(): pguser = os.environ.get("POSTGRES_USER", "") pgpass = os.environ.get("POSTGRES_PASSWORD", "") pghost = os.environ.get("POSTGRES_HOST", "") pgdb = os.environ.get("POSTGRES_DB", "") return "postgresql://{}:{}@{}/{}".format(pguser, pgpass, pghost, pgdb) def create_testing_db_uri(): return "sqlite:///:memory:"
24.533333
74
0.63587
45
368
5
0.488889
0.16
0.213333
0.355556
0
0
0
0
0
0
0
0
0.157609
368
14
75
26.285714
0.725806
0
0
0
0
0
0.26087
0.065217
0
0
0
0
0
1
0.222222
false
0.222222
0.111111
0.111111
0.555556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
6
58474dfa853f7715f104bcfef74e4282ac0ef6f9
11,282
py
Python
tests/test_order_with_partial_refund.py
Iceberg-Marketplace/Iceberg-API-PYTHON
5f8314376ebb6e5a8099253ec79fd40ea835beac
[ "MIT" ]
null
null
null
tests/test_order_with_partial_refund.py
Iceberg-Marketplace/Iceberg-API-PYTHON
5f8314376ebb6e5a8099253ec79fd40ea835beac
[ "MIT" ]
2
2015-01-26T10:22:41.000Z
2015-01-26T10:22:41.000Z
tests/test_order_with_partial_refund.py
Iceberg-Marketplace/Iceberg-API-PYTHON
5f8314376ebb6e5a8099253ec79fd40ea835beac
[ "MIT" ]
3
2016-12-30T15:08:57.000Z
2019-09-24T14:13:44.000Z
# -*- coding: utf-8 -*- from decimal import Decimal from helper import IcebergUnitTestCase class ClientOrder(IcebergUnitTestCase): def test_01_anonymous_add_to_cart(self): """ Add to cart as anonymous """ self.login_anonymous() cart = self.api_handler.Cart() cart.save() offer = self.get_random_offer() if hasattr(offer, 'variations') and len(offer.variations) > 0: for variation in offer.variations: print variation print variation.to_JSON() if variation.stock > 0: cart.addVariation(variation, offer) break else: cart.addOffer(offer) cart.fetch() def test_02_full_order(self): """ Full order """ self.direct_login_iceberg_staff() application = self.api_handler.Application.findWhere({ "namespace":self.api_handler.conf.ICEBERG_APPLICATION_NAMESPACE }) self.my_context_dict['application'] = application self.full_order(number_of_offers=3, application=application) def test_03_confirm_merchant_order(self): """ Confirm merchant order """ self.login() merchant_order = self.my_context_dict['merchant_order'] merchant_order.confirm() def test_04_create_return(self): """ Create Return """ self.login() merchant_order = self.my_context_dict['merchant_order'] return_requests = [] items_to_return = merchant_order.items[:-1] ## we return everything except 1 item order_item_not_refunded = merchant_order.items[-1] for order_item in items_to_return: return_request = self.api_handler.Return() return_request.merchant = merchant_order.merchant return_request.order_item = order_item return_request.reason = 6 return_request.return_type = 2 # return_request.comment = u"Test Message With No Special Chars" return_request.comment = u"Têst Mèssâge Rétürn Çômmënt" return_request.save() return_requests.append(return_request) self.my_context_dict['return_requests'] = return_requests self.my_context_dict['order_item_not_refunded'] = order_item_not_refunded def test_05_accept_return(self): """ Accept Return Requests """ self.login() return_requests = self.my_context_dict['return_requests'] for return_request in return_requests: return_request.accept() def test_06_create_first_refund(self): """ Create First Refund """ self.direct_login_iceberg_staff() return_requests = self.my_context_dict['return_requests'] merchant_order = self.my_context_dict['merchant_order'] refund = self.api_handler.Refund() refund.return_requests = return_requests refund.merchant_order = merchant_order refund.merchant = merchant_order.merchant refund.user = self.api_handler.User.me() refund.partial_refund = False ## total refund of n-1 items refund.shipping = merchant_order.shipping_vat_included refund.adjustment = 0 refund.memo = u"Mémô" refund.seller_note = u"Séllèr Nötè" refund.sync = True refund.save() self.my_context_dict['refund'] = refund theoretical_amount = sum([Decimal(return_request.order_item.amount_vat_included) for return_request in return_requests]) self.assertEqual(Decimal(refund.amount), theoretical_amount) self.assertEqual(refund.status, "complete") def test_07_check_transactions(self): """ Check First Partial Refund Transactions """ self.direct_login_iceberg_staff() order = self.my_context_dict['order'] refund = self.my_context_dict['refund'] order_item_not_refunded = self.my_context_dict['order_item_not_refunded'] refund_transaction = self.api_handler.Transaction.findWhere({"order":order.id, "transaction_type":2}) app_transactions = self.api_handler.ApplicationTransaction.search(args={"transaction":refund_transaction.id})[0] self.assertEqual(len(app_transactions), 1) app_refund_transaction = app_transactions[0] merchant_transactions = self.api_handler.MerchantTransaction.search(args={"transaction":refund_transaction.id})[0] self.assertEqual(len(merchant_transactions), 1) merchant_refund_transaction = merchant_transactions[0] mp_transactions = self.api_handler.MarketPlaceTransaction.search(args={"transaction":refund_transaction.id})[0] ## if we find some mp_transactions, there should be revenue sharing # TODO make a call to know if revenue sharing has_revenue_sharing = len(mp_transactions) > 0 if has_revenue_sharing: self.assertEqual(len(mp_transactions), 1) mp_refund_transaction = mp_transactions[0] transaction_sum = Decimal(app_refund_transaction.amount) + Decimal(merchant_refund_transaction.amount) if has_revenue_sharing: transaction_sum += Decimal(mp_refund_transaction.amount) transaction_sum = - transaction_sum total_refund_amount = Decimal(refund.total_refund_amount) self.assertEqual(total_refund_amount, transaction_sum) theoretical_refund_amount = Decimal(order.amount_vat_included) - Decimal(order_item_not_refunded.amount_vat_included) # self.assertEqual(total_refund_amount, theoretical_refund_amount) amount_diff = abs(abs(total_refund_amount) - abs(theoretical_refund_amount)) self.assertTrue(amount_diff <= Decimal("0.01")) ## This was the checks for Full Refund : TODO do other checks ? # sell_transaction = self.api_handler.Transaction.findWhere({"order":order.id, "transaction_type":1}) # app_transactions = self.api_handler.ApplicationTransaction.search(args={"transaction":sell_transaction.id})[0] # self.assertEqual(len(app_transactions), 1) # app_sell_transaction = app_transactions[0] # merchant_transactions = self.api_handler.MerchantTransaction.search(args={"transaction":sell_transaction.id})[0] # self.assertEqual(len(merchant_transactions), 1) # merchant_sell_transaction = merchant_transactions[0] # mp_transactions = self.api_handler.MarketPlaceTransaction.search(args={"transaction":sell_transaction.id})[0] # self.assertEqual(len(mp_transactions), 1) # mp_sell_transaction = mp_transactions[0] # self.assertEqual(Decimal(merchant_sell_transaction.amount), -Decimal(merchant_refund_transaction.amount)) # self.assertEqual(Decimal(app_sell_transaction.amount), -Decimal(app_refund_transaction.amount)) # self.assertEqual(Decimal(mp_sell_transaction.amount), -Decimal(mp_refund_transaction.amount)) def test_08_create_return(self): """ Create another Return to refund the last item """ self.login() merchant_order = self.my_context_dict['merchant_order'] return_requests = [] return_request = self.api_handler.Return() return_request.merchant = merchant_order.merchant return_request.order_item = self.my_context_dict['order_item_not_refunded'] return_request.reason = 6 return_request.return_type = 2 # return_request.comment = u"Test Message With No Special Chars" return_request.comment = u"Têst Mèssâge Rétürn Çômmënt" return_request.save() return_requests.append(return_request) self.my_context_dict['return_requests'] = return_requests def test_09_accept_return(self): """ Accept the other Return Requests """ self.login() return_requests = self.my_context_dict['return_requests'] for return_request in return_requests: return_request.accept() def test_10_create_partial_refund(self): """ Create Partial Refund """ self.direct_login_iceberg_staff() return_requests = self.my_context_dict['return_requests'] merchant_order = self.my_context_dict['merchant_order'] refund = self.api_handler.Refund() refund.return_requests = return_requests refund.merchant_order = merchant_order refund.merchant = merchant_order.merchant refund.user = self.api_handler.User.me() refund.partial_refund = False refund.shipping = 0 refund.adjustment = 0 refund.memo = u"Mémô" refund.seller_note = u"Séllèr Nötè" refund.sync = True refund.save() self.my_context_dict['refund'] = refund theoretical_amount = sum([Decimal(return_request.order_item.amount_vat_included) for return_request in return_requests]) self.assertEqual(Decimal(refund.amount), theoretical_amount) self.assertEqual(refund.status, "complete") def test_11_check_transactions(self): """ Check Second Partial Refund Transactions """ self.direct_login_iceberg_staff() order = self.my_context_dict['order'] refund = self.my_context_dict['refund'] order_item_not_refunded = self.my_context_dict['order_item_not_refunded'] refund_transactions = self.api_handler.Transaction.search({"order":order.id, "transaction_type":2})[0] self.assertEqual(len(refund_transactions), 2) refund_transaction = refund_transactions[0] ## ordered by -timestamp so should be the first one app_transactions = self.api_handler.ApplicationTransaction.search(args={"transaction":refund_transaction.id})[0] self.assertEqual(len(app_transactions), 1) app_refund_transaction = app_transactions[0] merchant_transactions = self.api_handler.MerchantTransaction.search(args={"transaction":refund_transaction.id})[0] self.assertEqual(len(merchant_transactions), 1) merchant_refund_transaction = merchant_transactions[0] mp_transactions = self.api_handler.MarketPlaceTransaction.search(args={"transaction":refund_transaction.id})[0] ## if we find some mp_transactions, there should be revenue sharing # TODO make a call to know if revenue sharing has_revenue_sharing = len(mp_transactions) > 0 if has_revenue_sharing: self.assertEqual(len(mp_transactions), 1) mp_refund_transaction = mp_transactions[0] transaction_sum = Decimal(app_refund_transaction.amount) + Decimal(merchant_refund_transaction.amount) if has_revenue_sharing: transaction_sum += Decimal(mp_refund_transaction.amount) transaction_sum = - transaction_sum total_refund_amount = Decimal(refund.total_refund_amount) self.assertEqual(total_refund_amount, transaction_sum) theoretical_refund_amount = Decimal(order_item_not_refunded.amount_vat_included) self.assertEqual(total_refund_amount, theoretical_refund_amount)
41.025455
128
0.683567
1,279
11,282
5.713839
0.131353
0.049808
0.039135
0.051177
0.76861
0.759168
0.746032
0.73618
0.726054
0.719075
0
0.008625
0.229215
11,282
274
129
41.175182
0.831762
0.142085
0
0.685185
0
0
0.058073
0.010119
0
0
0
0.007299
0.092593
0
null
null
0
0.012346
null
null
0.012346
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
6
587facad996ec3c8b121d54bd6b2a94ab717beb2
35
py
Python
1c_GT_Computer_Networks/Project-1/__init__.py
yevheniyc/Python
262842477793d65c2b382ca810867fd24a415576
[ "MIT" ]
4
2016-08-28T03:21:36.000Z
2021-01-19T01:59:17.000Z
1c_GT_Computer_Networks/Project-1/__init__.py
yevheniyc/Python
262842477793d65c2b382ca810867fd24a415576
[ "MIT" ]
null
null
null
1c_GT_Computer_Networks/Project-1/__init__.py
yevheniyc/Python
262842477793d65c2b382ca810867fd24a415576
[ "MIT" ]
1
2018-05-20T12:33:23.000Z
2018-05-20T12:33:23.000Z
"CS244 Assignment #1: Parking Lot"
17.5
34
0.742857
5
35
5.2
1
0
0
0
0
0
0
0
0
0
0
0.133333
0.142857
35
1
35
35
0.733333
0.914286
0
0
0
0
0.914286
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
6
5434fa34763d0fed8fbe06c42c25b266363089fd
71
py
Python
ovl/partials/filter_applier.py
SerpentBit/ovl
e11baa551f4e8e9682518e595de2f3b81aae8848
[ "Apache-2.0" ]
2
2022-03-07T20:32:23.000Z
2022-03-29T19:10:03.000Z
ovl/partials/filter_applier.py
SerpentBit/ovl
e11baa551f4e8e9682518e595de2f3b81aae8848
[ "Apache-2.0" ]
null
null
null
ovl/partials/filter_applier.py
SerpentBit/ovl
e11baa551f4e8e9682518e595de2f3b81aae8848
[ "Apache-2.0" ]
2
2022-02-07T18:34:50.000Z
2022-02-23T19:41:32.000Z
def apply(input_data, data_filter): return data_filter(input_data)
23.666667
35
0.788732
11
71
4.727273
0.545455
0.346154
0
0
0
0
0
0
0
0
0
0
0.126761
71
2
36
35.5
0.83871
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
544c368332d2c35bbe660bf79a09d70df374999d
14,474
py
Python
tests/networking/arista/test_snmp.py
QualiSystems/cloudshell-networking-arista-
011ff605244a98bb488fec985bd0e053af9855d0
[ "Apache-2.0" ]
null
null
null
tests/networking/arista/test_snmp.py
QualiSystems/cloudshell-networking-arista-
011ff605244a98bb488fec985bd0e053af9855d0
[ "Apache-2.0" ]
9
2018-04-03T12:02:29.000Z
2021-07-08T09:07:29.000Z
tests/networking/arista/test_snmp.py
QualiSystems/cloudshell-networking-arista-
011ff605244a98bb488fec985bd0e053af9855d0
[ "Apache-2.0" ]
2
2017-02-08T23:52:21.000Z
2018-07-04T15:33:36.000Z
from mock import MagicMock, patch from cloudshell.networking.arista.runners.arista_autoload_runner import ( AristaAutoloadRunner, ) from cloudshell.networking.arista.snmp.arista_snmp_handler import AristaSnmpHandler from tests.networking.arista.base_test import ( CONFIG_PROMPT, ENABLE_PROMPT, BaseAristaTestCase, CliEmulator, Command, ) @patch("cloudshell.devices.snmp_handler.QualiSnmp", MagicMock()) @patch( "cloudshell.networking.arista.flows.arista_autoload_flow.AristaSNMPAutoload", MagicMock(), ) @patch("cloudshell.cli.session.ssh_session.paramiko", MagicMock()) @patch( "cloudshell.cli.session.ssh_session.SSHSession._clear_buffer", MagicMock(return_value=""), ) class TestEnableDisableSnmp(BaseAristaTestCase): def _setUp(self, attrs=None): attrs = attrs or {} snmp_attrs = { "SNMP Version": "v2c", "SNMP Read Community": "public", "SNMP V3 User": "quali_user", "SNMP V3 Password": "password", "SNMP V3 Private Key": "private_key", "SNMP V3 Authentication Protocol": "No Authentication Protocol", "SNMP V3 Privacy Protocol": "No Privacy Protocol", "Enable SNMP": "True", "Disable SNMP": "False", } snmp_attrs.update(attrs) super(TestEnableDisableSnmp, self)._setUp(snmp_attrs) self.snmp_handler = AristaSnmpHandler( self.resource_config, self.logger, self.api, self.cli_handler ) self.runner = AristaAutoloadRunner( self.resource_config, self.logger, self.snmp_handler ) @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_enable_snmp_v2(self, send_mock, recv_mock): self._setUp() emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("snmp-server community public ro", CONFIG_PROMPT), Command( "show snmp community", "Community name: public\n" "Community access: read-only\n" "{}".format(CONFIG_PROMPT), ), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_enable_snmp_v2_with_vrf(self, send_mock, recv_mock): self._setUp( { "VRF Management Name": "management", } ) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command( "show snmp", "0 SNMP packets input\n" " 0 Bad SNMP version errors\n" " 0 Unknown community name\n" " 0 Illegal operation for community name supplied\n" " 0 Encoding errors\n" " 0 Number of requested variables\n" " 0 Number of altered variables\n" " 0 Get-request PDUs\n" " 0 Get-next PDUs\n" " 0 Set-request PDUs\n" "...\n" "SNMP logging: disabled\n" "SNMP agent enabled in VRFs: default\n" "{}".format(CONFIG_PROMPT), ), Command("snmp-server vrf management", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("snmp-server community public ro", CONFIG_PROMPT), Command( "show snmp community", "Community name: public\n" "Community access: read-only\n" "{}".format(CONFIG_PROMPT), ), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_enable_snmp_v2_with_vrf_already_enabled(self, send_mock, recv_mock): self._setUp( { "VRF Management Name": "management", } ) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command( "show snmp", "0 SNMP packets input\n" " 0 Bad SNMP version errors\n" " 0 Unknown community name\n" " 0 Illegal operation for community name supplied\n" " 0 Encoding errors\n" " 0 Number of requested variables\n" " 0 Number of altered variables\n" " 0 Get-request PDUs\n" " 0 Get-next PDUs\n" " 0 Set-request PDUs\n" "...\n" "SNMP logging: disabled\n" "SNMP agent enabled in VRFs: default, management\n" "{}".format(CONFIG_PROMPT), ), Command("show snmp community", CONFIG_PROMPT), Command("snmp-server community public ro", CONFIG_PROMPT), Command( "show snmp community", "Community name: public\n" "Community access: read-only\n" "{}".format(CONFIG_PROMPT), ), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_enable_snmp_v2_already_enabled(self, send_mock, recv_mock): self._setUp() emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command( "show snmp community", "Community name: public\n" "Community access: read-only\n" "{}".format(CONFIG_PROMPT), ), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_enable_snmp_v2_not_enabled(self, send_mock, recv_mock): self._setUp() emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("snmp-server community public ro", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all with self.assertRaisesRegexp(Exception, "Failed to create SNMP community"): self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_enable_snmp_v2_write_community(self, send_mock, recv_mock): self._setUp({"SNMP Write Community": "private"}) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("snmp-server community private ro", CONFIG_PROMPT), Command( "show snmp community", "Community name: private\n" "Community access: read-only\n" "{}".format(CONFIG_PROMPT), ), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("tests.networking.arista.base_test.AristaCliHandler") def test_enable_snmp_without_community(self, cli_handler_mock): self._setUp({"SNMP Read Community": ""}) with self.assertRaisesRegexp(Exception, "SNMP community cannot be empty"): self.runner.discover() cli_handler_mock.get_cli_service.assert_not_called() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_disable_snmp_v2(self, send_mock, recv_mock): self._setUp( { "Enable SNMP": "False", "Disable SNMP": "True", } ) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("no snmp-server community public", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("tests.networking.arista.base_test.AristaCliHandler") def test_disable_snmp_without_community(self, cli_handler_mock): self._setUp( { "Enable SNMP": "False", "Disable SNMP": "True", "SNMP Read Community": "", } ) with self.assertRaisesRegexp(Exception, "SNMP community cannot be empty"): self.runner.discover() cli_handler_mock.get_cli_service.assert_not_called() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_disable_snmp_v2_already_disabled(self, send_mock, recv_mock): self._setUp( { "Enable SNMP": "False", "Disable SNMP": "True", } ) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("no snmp-server community public", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_disable_snmp_v2_is_not_disabled(self, send_mock, recv_mock): self._setUp( { "Enable SNMP": "False", "Disable SNMP": "True", } ) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("no snmp-server community public", CONFIG_PROMPT), Command( "show snmp community", "Community name: public\n" "Community access: read-only\n" "{}".format(CONFIG_PROMPT), ), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all with self.assertRaisesRegexp(Exception, "Failed to remove SNMP community"): self.runner.discover() emu.check_calls() @patch("cloudshell.cli.session.ssh_session.SSHSession._receive_all") @patch("cloudshell.cli.session.ssh_session.SSHSession.send_line") def test_disable_snmp_v2_write_community(self, send_mock, recv_mock): self._setUp( { "Enable SNMP": "False", "Disable SNMP": "True", "SNMP Write Community": "private", } ) emu = CliEmulator( [ Command("configure terminal", CONFIG_PROMPT), Command("no snmp-server community private", CONFIG_PROMPT), Command("show snmp community", CONFIG_PROMPT), Command("end", ENABLE_PROMPT), ] ) send_mock.side_effect = emu.send_line recv_mock.side_effect = emu.receive_all self.runner.discover() emu.check_calls() @patch("tests.networking.arista.base_test.AristaCliHandler") def test_enable_snmp_v3(self, cli_handler_mock): cli_instance_mock = MagicMock() cli_handler_mock.return_value = cli_instance_mock self._setUp({"SNMP Version": "v3"}) with self.assertRaisesRegexp(Exception, "Do not support SNMP V3"): self.runner.discover() cli_instance_mock.get_cli_service.assert_not_called() @patch("tests.networking.arista.base_test.AristaCliHandler") def test_disable_snmp_v3(self, cli_handler_mock): cli_instance_mock = MagicMock() cli_handler_mock.return_value = cli_instance_mock self._setUp( { "SNMP Version": "v3", "SNMP V3 Authentication Protocol": "SHA", "SNMP V3 Privacy Protocol": "AES-128", "Enable SNMP": "False", "Disable SNMP": "True", } ) with self.assertRaisesRegexp(Exception, "Do not support SNMP V3"): self.runner.discover() cli_instance_mock.get_cli_service.assert_not_called()
35.915633
83
0.564322
1,446
14,474
5.412863
0.10166
0.05826
0.089817
0.07027
0.87096
0.861761
0.849751
0.83723
0.83723
0.818704
0
0.004893
0.336327
14,474
402
84
36.004975
0.80991
0
0
0.635838
0
0
0.296739
0.106881
0
0
0
0
0.028902
1
0.043353
false
0.00289
0.011561
0
0.057803
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
544c81e36d4d6ebf7666ee4a00cabde09be98d35
34
py
Python
myre/__init__.py
TonyFlury/myre
04b55fbd3baf59c0d46fa6ee987fb294aad7a7b9
[ "MIT" ]
null
null
null
myre/__init__.py
TonyFlury/myre
04b55fbd3baf59c0d46fa6ee987fb294aad7a7b9
[ "MIT" ]
null
null
null
myre/__init__.py
TonyFlury/myre
04b55fbd3baf59c0d46fa6ee987fb294aad7a7b9
[ "MIT" ]
null
null
null
# coding=utf-8 from .myre import *
17
19
0.705882
6
34
4
1
0
0
0
0
0
0
0
0
0
0
0.034483
0.147059
34
2
19
17
0.793103
0.352941
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
54645c804bb9635acabceb078b6c85dd90f764f7
68,157
py
Python
api_tests/nodes/views/test_node_contributors_list.py
sf2ne/Playground
95b2d222d7ac43baca0249acbfc34e043d6a95b3
[ "Apache-2.0" ]
null
null
null
api_tests/nodes/views/test_node_contributors_list.py
sf2ne/Playground
95b2d222d7ac43baca0249acbfc34e043d6a95b3
[ "Apache-2.0" ]
13
2020-03-24T15:29:41.000Z
2022-03-11T23:15:28.000Z
api_tests/nodes/views/test_node_contributors_list.py
sf2ne/Playground
95b2d222d7ac43baca0249acbfc34e043d6a95b3
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from website.models import NodeLog from framework.auth.core import Auth from tests.base import ApiTestCase from tests.factories import ( ProjectFactory, AuthUserFactory, UserFactory, RegistrationFactory, RetractedRegistrationFactory ) from tests.utils import assert_logs from website.util import permissions class NodeCRUDTestCase(ApiTestCase): def setUp(self): super(NodeCRUDTestCase, self).setUp() self.user = AuthUserFactory() self.user_two = AuthUserFactory() self.title = 'Cool Project' self.new_title = 'Super Cool Project' self.description = 'A Properly Cool Project' self.new_description = 'An even cooler project' self.category = 'data' self.new_category = 'project' self.public_project = ProjectFactory(title=self.title, description=self.description, category=self.category, is_public=True, creator=self.user) self.public_url = '/{}nodes/{}/'.format(API_BASE, self.public_project._id) self.private_project = ProjectFactory(title=self.title, description=self.description, category=self.category, is_public=False, creator=self.user) self.private_url = '/{}nodes/{}/'.format(API_BASE, self.private_project._id) self.fake_url = '/{}nodes/{}/'.format(API_BASE, '12345') def make_node_payload(node, attributes): return { 'data': { 'id': node._id, 'type': 'nodes', 'attributes': attributes, } } class TestNodeContributorList(NodeCRUDTestCase): def setUp(self): super(TestNodeContributorList, self).setUp() self.private_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.private_project._id) self.public_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.public_project._id) def test_return_public_contributor_list_logged_out(self): self.public_project.add_contributor(self.user_two, save=True) res = self.app.get(self.public_url) assert_equal(res.status_code, 200) assert_equal(res.content_type, 'application/vnd.api+json') assert_equal(len(res.json['data']), 2) assert_equal(res.json['data'][0]['id'], self.user._id) assert_equal(res.json['data'][1]['id'], self.user_two._id) def test_return_public_contributor_list_logged_in(self): res = self.app.get(self.public_url, auth=self.user_two.auth) assert_equal(res.status_code, 200) assert_equal(res.content_type, 'application/vnd.api+json') assert_equal(len(res.json['data']), 1) assert_equal(res.json['data'][0]['id'], self.user._id) def test_return_private_contributor_list_logged_out(self): res = self.app.get(self.private_url, expect_errors=True) assert_equal(res.status_code, 401) assert 'detail' in res.json['errors'][0] def test_return_private_contributor_list_logged_in_contributor(self): self.private_project.add_contributor(self.user_two) self.private_project.save() res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(res.status_code, 200) assert_equal(res.content_type, 'application/vnd.api+json') assert_equal(len(res.json['data']), 2) assert_equal(res.json['data'][0]['id'], self.user._id) assert_equal(res.json['data'][1]['id'], self.user_two._id) def test_return_private_contributor_list_logged_in_non_contributor(self): res = self.app.get(self.private_url, auth=self.user_two.auth, expect_errors=True) assert_equal(res.status_code, 403) assert 'detail' in res.json['errors'][0] def test_can_not_access_retracted_contributors(self): registration = RegistrationFactory(creator=self.user, project=self.public_project) url = '/{}nodes/{}/contributors/'.format(API_BASE, registration._id) retraction = RetractedRegistrationFactory(registration=registration, user=registration.creator) res = self.app.get(url, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 404) def test_filtering_on_obsolete_fields(self): # regression test for changes in filter fields url_fullname = '{}?filter[fullname]=foo'.format(self.public_url) res = self.app.get(url_fullname, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) errors = res.json['errors'] assert_equal(len(errors), 1) assert_equal(errors[0]['detail'], u"'fullname' is not a valid field for this endpoint.") # middle_name is now middle_names url_middle_name = '{}?filter[middle_name]=foo'.format(self.public_url) res = self.app.get(url_middle_name, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) errors = res.json['errors'] assert_equal(len(errors), 1) assert_equal(errors[0]['detail'], "'middle_name' is not a valid field for this endpoint.") class TestNodeContributorFiltering(ApiTestCase): def setUp(self): super(TestNodeContributorFiltering, self).setUp() self.user = AuthUserFactory() self.project = ProjectFactory(creator=self.user) def test_filtering_full_name_field(self): url = '/{}nodes/{}/contributors/?filter[full_name]=Freddie'.format(API_BASE, self.project._id) res = self.app.get(url, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) errors = res.json['errors'] assert_equal(len(errors), 1) assert_equal(errors[0]['detail'], "'full_name' is not a valid field for this endpoint.") def test_filtering_permission_field(self): url = '/{}nodes/{}/contributors/?filter[permission]=admin'.format(API_BASE, self.project._id) res = self.app.get(url, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 200) assert_equal(len(res.json['data']), 1) assert_equal(res.json['data'][0]['attributes'].get('permission'), 'admin') def test_filtering_node_with_only_bibliographic_contributors(self): base_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.project._id) # no filter res = self.app.get(base_url, auth=self.user.auth) assert_equal(res.status_code, 200) assert_equal(len(res.json['data']), 1) # filter for bibliographic contributors url = base_url + '?filter[bibliographic]=True' res = self.app.get(url, auth=self.user.auth) assert_equal(res.status_code, 200) assert_equal(len(res.json['data']), 1) assert_true(res.json['data'][0]['attributes'].get('bibliographic', None)) # filter for non-bibliographic contributors url = base_url + '?filter[bibliographic]=False' res = self.app.get(url, auth=self.user.auth) assert_equal(len(res.json['data']), 0) def test_filtering_node_with_non_bibliographic_contributor(self): non_bibliographic_contrib = UserFactory() self.project.add_contributor(non_bibliographic_contrib, visible=False) self.project.save() base_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.project._id) # no filter res = self.app.get(base_url, auth=self.user.auth) assert_equal(res.status_code, 200) assert_equal(len(res.json['data']), 2) # filter for bibliographic contributors url = base_url + '?filter[bibliographic]=True' res = self.app.get(url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) assert_true(res.json['data'][0]['attributes'].get('bibliographic', None)) # filter for non-bibliographic contributors url = base_url + '?filter[bibliographic]=False' res = self.app.get(url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) assert_false(res.json['data'][0]['attributes'].get('bibliographic', None)) def test_filtering_on_invalid_field(self): url = '/{}nodes/{}/contributors/?filter[invalid]=foo'.format(API_BASE, self.project._id) res = self.app.get(url, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) errors = res.json['errors'] assert_equal(len(errors), 1) assert_equal(errors[0]['detail'], "'invalid' is not a valid field for this endpoint.") class TestNodeContributorAdd(NodeCRUDTestCase): def setUp(self): super(TestNodeContributorAdd, self).setUp() self.private_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.private_project._id) self.public_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.public_project._id) self.user_three = AuthUserFactory() self.data_user_two = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, }, 'relationships': { 'users': { 'data': { 'type': 'users', 'id': self.user_two._id, } } } } } self.data_user_three = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, }, 'relationships': { 'users': { 'data': { 'type': 'users', 'id': self.user_three._id, } } } } } def test_add_node_contributors_relationships_is_a_list(self): data = { 'data': { 'type': 'contributors', 'relationships': [{'contributor_id': self.user_three._id}] } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], "Malformed request.") def test_contributor_create_invalid_data(self): res = self.app.post_json_api(self.public_url, "Incorrect data", auth=self.user_three.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], "Malformed request.") res = self.app.post_json_api(self.public_url, ["Incorrect data"], auth=self.user_three.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], "Malformed request.") def test_add_contributor_no_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/relationships') def test_add_contributor_empty_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': {} } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/relationships') def test_add_contributor_no_user_key_in_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'id': self.user_two._id, 'type': 'users' } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Malformed request.') def test_add_contributor_no_data_in_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'id': self.user_two._id } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Request must include /data.') def test_add_contributor_no_target_type_in_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id } } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Request must include /type.') def test_add_contributor_no_target_id_in_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'type': 'users' } } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/id') def test_add_contributor_incorrect_target_id_in_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'type': 'users', 'id': '12345' } } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 404) def test_add_contributor_incorrect_target_type_in_relationships(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'type': 'Incorrect!', 'id': self.user_two._id } } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 409) def test_add_contributor_no_type(self): data = { 'data': { 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['source']['pointer'], "/data/type") def test_add_contributor_incorrect_type(self): data = { 'data': { 'type': 'Incorrect type', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.public_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 409) @assert_logs(NodeLog.CONTRIB_ADDED, 'public_project') def test_add_contributor_is_visible_by_default(self): del self.data_user_two['data']['attributes']['bibliographic'] res = self.app.post_json_api(self.public_url, self.data_user_two, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) self.public_project.reload() assert_in(self.user_two, self.public_project.contributors) assert_true(self.public_project.get_visible(self.user_two)) @assert_logs(NodeLog.CONTRIB_ADDED, 'public_project') def test_adds_bibliographic_contributor_public_project_admin(self): res = self.app.post_json_api(self.public_url, self.data_user_two, auth=self.user.auth) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) self.public_project.reload() assert_in(self.user_two, self.public_project.contributors) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_non_bibliographic_contributor_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': False }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) assert_equal(res.json['data']['attributes']['bibliographic'], False) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) assert_false(self.private_project.get_visible(self.user_two)) def test_adds_contributor_public_project_non_admin(self): self.public_project.add_contributor(self.user_two, permissions=[permissions.READ, permissions.WRITE], auth=Auth(self.user), save=True) res = self.app.post_json_api(self.public_url, self.data_user_three, auth=self.user_two.auth, expect_errors=True) assert_equal(res.status_code, 403) self.public_project.reload() assert_not_in(self.user_three, self.public_project.contributors) def test_adds_contributor_public_project_non_contributor(self): res = self.app.post_json_api(self.public_url, self.data_user_three, auth=self.user_two.auth, expect_errors=True) assert_equal(res.status_code, 403) assert_not_in(self.user_three, self.public_project.contributors) def test_adds_contributor_public_project_not_logged_in(self): res = self.app.post_json_api(self.public_url, self.data_user_two, expect_errors=True) assert_equal(res.status_code, 401) assert_not_in(self.user_two, self.public_project.contributors) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_contributor_private_project_admin(self): res = self.app.post_json_api(self.private_url, self.data_user_two, auth=self.user.auth) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_contributor_without_bibliographic_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 201) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_admin_contributor_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': permissions.ADMIN }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) assert_equal(self.private_project.get_permissions(self.user_two), [permissions.READ, permissions.WRITE, permissions.ADMIN]) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_write_contributor_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': permissions.WRITE }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) assert_equal(self.private_project.get_permissions(self.user_two), [permissions.READ, permissions.WRITE]) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_read_contributor_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': permissions.READ }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth) assert_equal(res.status_code, 201) assert_equal(res.json['data']['id'], self.user_two._id) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) assert_equal(self.private_project.get_permissions(self.user_two), [permissions.READ]) def test_adds_invalid_permission_contributor_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': 'invalid', }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) self.private_project.reload() assert_not_in(self.user_two, self.private_project.contributors) @assert_logs(NodeLog.CONTRIB_ADDED, 'private_project') def test_adds_none_permission_contributor_private_project_admin_uses_default_permissions(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': None }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth) assert_equal(res.status_code, 201) self.private_project.reload() assert_in(self.user_two, self.private_project.contributors) for permission in permissions.DEFAULT_CONTRIBUTOR_PERMISSIONS: assert_true(self.private_project.has_permission(self.user_two, permission)) def test_adds_already_existing_contributor_private_project_admin(self): self.private_project.add_contributor(self.user_two, auth=Auth(self.user), save=True) self.private_project.reload() res = self.app.post_json_api(self.private_url, self.data_user_two, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 400) def test_adds_non_existing_user_private_project_admin(self): data = { 'data': { 'type': 'contributors', 'attributes': { 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'id': 'FAKE', 'type': 'users' } } } } } res = self.app.post_json_api(self.private_url, data, auth=self.user.auth, expect_errors=True) assert_equal(res.status_code, 404) self.private_project.reload() assert_equal(len(self.private_project.contributors), 1) def test_adds_contributor_private_project_non_admin(self): self.private_project.add_contributor(self.user_two, permissions=[permissions.READ, permissions.WRITE], auth=Auth(self.user)) res = self.app.post_json_api(self.private_url, self.data_user_three, auth=self.user_two.auth, expect_errors=True) assert_equal(res.status_code, 403) self.private_project.reload() assert_not_in(self.user_three, self.private_project.contributors) def test_adds_contributor_private_project_non_contributor(self): res = self.app.post_json_api(self.private_url, self.data_user_three, auth=self.user_two.auth, expect_errors=True) assert_equal(res.status_code, 403) self.private_project.reload() assert_not_in(self.user_three, self.private_project.contributors) def test_adds_contributor_private_project_not_logged_in(self): res = self.app.post_json_api(self.private_url, self.data_user_two, expect_errors=True) assert_equal(res.status_code, 401) self.private_project.reload() assert_not_in(self.user_two, self.private_project.contributors) class TestNodeContributorBulkCreate(NodeCRUDTestCase): def setUp(self): super(TestNodeContributorBulkCreate, self).setUp() self.user_three = AuthUserFactory() self.private_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.private_project._id) self.public_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.public_project._id) self.payload_one = { 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': "admin" }, 'relationships': { 'users': { 'data': { 'id': self.user_two._id, 'type': 'users' } } } } self.payload_two = { 'type': 'contributors', 'attributes': { 'bibliographic': False, 'permission': "read" }, 'relationships': { 'users': { 'data': { 'id': self.user_three._id, 'type': 'users' } } } } def test_bulk_create_contributors_blank_request(self): res = self.app.post_json_api(self.public_url, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) def test_node_contributor_bulk_create_contributor_exists(self): self.public_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) res = self.app.post_json_api(self.public_url, {'data': [self.payload_two, self.payload_one]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert "is already a contributor" in res.json['errors'][0]['detail'] res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 2) def test_node_contributor_bulk_create_logged_out_public_project(self): res = self.app.post_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_node_contributor_bulk_create_logged_in_public_project_project(self): res = self.app.post_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 201) assert_items_equal([res.json['data'][0]['attributes']['bibliographic'], res.json['data'][1]['attributes']['bibliographic']], [True, False]) assert_items_equal([res.json['data'][0]['attributes']['permission'], res.json['data'][1]['attributes']['permission']], ['admin', 'read']) assert_equal(res.content_type, 'application/vnd.api+json') res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_node_contributor_bulk_create_logged_out_private_project(self): res = self.app.post_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_node_contributor_bulk_create_logged_in_contrib_private_project(self): res = self.app.post_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 201) assert_equal(len(res.json['data']), 2) assert_items_equal([res.json['data'][0]['attributes']['bibliographic'], res.json['data'][1]['attributes']['bibliographic']], [True, False]) assert_items_equal([res.json['data'][0]['attributes']['permission'], res.json['data'][1]['attributes']['permission']], ['admin', 'read']) assert_equal(res.content_type, 'application/vnd.api+json') res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_node_contributor_bulk_create_logged_in_non_contrib_private_project(self): res = self.app.post_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_two.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_node_contributor_bulk_create_logged_in_read_only_contrib_private_project(self): self.private_project.add_contributor(self.user_two, permissions=[permissions.READ], save=True) res = self.app.post_json_api(self.private_url, {'data': [self.payload_two]}, auth=self.user_two.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_node_contributor_bulk_create_all_or_nothing(self): invalid_id_payload = { 'type': 'contributors', 'relationships': { 'users': { 'data': { 'type': 'users', 'id': '12345' } } } } res = self.app.post_json_api(self.public_url, {'data': [self.payload_one, invalid_id_payload]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 404) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_node_contributor_bulk_create_limits(self): node_contrib_create_list = {'data': [self.payload_one] * 101} res = self.app.post_json_api(self.public_url, node_contrib_create_list, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.json['errors'][0]['detail'], 'Bulk operation limit is 100, got 101.') assert_equal(res.json['errors'][0]['source']['pointer'], '/data') def test_node_contributor_bulk_create_no_type(self): payload = {'data': [{'relationships': {'users': {'data': {'type': 'users', 'id': self.user_two._id}}}}]} res = self.app.post_json_api(self.public_url, payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/0/type') def test_node_contributor_bulk_create_incorrect_type(self): payload = { 'data': [{ 'type': 'contributors', 'relationships': { 'users': { 'data': { 'type': 'Wrong type.', 'id': self.user_two._id } } } }] } res = self.app.post_json_api(self.public_url, payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 409) def test_node_contributor_bulk_create_no_relationships(self): payload = { 'data': [{ 'type': 'contributors', 'id': self.user_two._id }] } res = self.app.post_json_api(self.public_url, payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/relationships') def test_node_contributor_ugly_payload(self): payload = 'sdf;jlasfd' res = self.app.post_json_api(self.public_url, payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Malformed request.') def test_node_contributor_bulk_create_invalid_permissions_all_or_nothing(self): payload = { 'type': 'contributors', 'attributes': { 'permission': 'super-user', 'bibliographic': True }, 'relationships': { 'users': { 'data': { 'type': 'users', 'id': self.user_two._id } } } } payload = {'data': [self.payload_two, payload]} res = self.app.post_json_api(self.public_url, payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) class TestNodeContributorBulkUpdate(NodeCRUDTestCase): def setUp(self): super(TestNodeContributorBulkUpdate, self).setUp() self.user_three = AuthUserFactory() self.user_four = AuthUserFactory() self.public_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) self.public_project.add_contributor(self.user_three, permissions=[permissions.READ], visible=True, save=True) self.private_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) self.private_project.add_contributor(self.user_three, permissions=[permissions.READ], visible=True, save=True) self.private_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.private_project._id) self.public_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.public_project._id) self.payload_one = { 'id': self.user_two._id, 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': "admin" } } self.payload_two = { 'id': self.user_three._id, 'type': 'contributors', 'attributes': { 'bibliographic': False, 'permission': "write" } } def test_bulk_update_contributors_blank_request(self): res = self.app.patch_json_api(self.public_url, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) def test_bulk_update_contributors_dict_instead_of_list(self): res = self.app.put_json_api(self.public_url, {'data': self.payload_one}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) def test_bulk_update_contributors_public_project_one_not_found(self): invalid_id = { 'id': '12345', 'type': 'contributors', 'attributes': {} } empty_payload = {'data': [invalid_id, self.payload_one]} res = self.app.put_json_api(self.public_url, empty_payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Could not find all objects to update.') res = self.app.get(self.public_url) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read'] ) def test_bulk_update_contributors_public_projects_logged_out(self): res = self.app.put_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.public_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_update_contributors_public_projects_logged_in(self): res = self.app.put_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 200) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission']], ['admin', 'write']) def test_bulk_update_contributors_private_projects_logged_out(self): res = self.app.put_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.private_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_update_contributors_private_projects_logged_in_contrib(self): res = self.app.put_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 200) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission']], ['admin', 'write']) def test_bulk_update_contributors_private_projects_logged_in_non_contrib(self): res = self.app.put_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_four.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.private_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_update_contributors_private_projects_logged_in_read_only_contrib(self): res = self.app.put_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_two.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.private_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_update_contributors_projects_send_dictionary_not_list(self): res = self.app.put_json_api(self.public_url, {'data': self.payload_one}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Expected a list of items but got type "dict".') def test_bulk_update_contributors_id_not_supplied(self): res = self.app.put_json_api(self.public_url, {'data': [{'type': 'contributors', 'attributes': {}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(len(res.json['errors']), 1) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/0/id') assert_equal(res.json['errors'][0]['detail'], "This field may not be null.") def test_bulk_update_contributors_type_not_supplied(self): res = self.app.put_json_api(self.public_url, {'data': [{'id': self.user_two._id, 'attributes': {}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(len(res.json['errors']), 1) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/0/type') assert_equal(res.json['errors'][0]['detail'], "This field may not be null.") def test_bulk_update_contributors_wrong_type(self): invalid_type = { 'id': self.user_two._id, 'type': 'Wrong type.', 'attributes': {} } res = self.app.put_json_api(self.public_url, {'data': [invalid_type]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 409) def test_bulk_update_contributors_wrong_id(self): invalid_id = { 'id': '12345', 'type': 'contributors', 'attributes': {} } res = self.app.put_json_api(self.public_url, {'data': [invalid_id]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Could not find all objects to update.') def test_bulk_update_contributors_limits(self): contrib_update_list = {'data': [self.payload_one] * 101} res = self.app.put_json_api(self.public_url, contrib_update_list, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.json['errors'][0]['detail'], 'Bulk operation limit is 100, got 101.') assert_equal(res.json['errors'][0]['source']['pointer'], '/data') def test_bulk_update_contributors_invalid_permissions(self): res = self.app.put_json_api(self.public_url, {'data': [self.payload_two, {'id': self.user_two._id, 'type': 'contributors', 'attributes': {'permission': 'super-user'}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], '"super-user" is not a valid choice.') res = self.app.get(self.public_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_update_contributors_invalid_bibliographic(self): res = self.app.put_json_api(self.public_url, {'data': [self.payload_two, {'id': self.user_two._id, 'type': 'contributors', 'attributes': {'bibliographic': 'true and false'}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], '"true and false" is not a valid boolean.') res = self.app.get(self.public_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) class TestNodeContributorBulkPartialUpdate(NodeCRUDTestCase): def setUp(self): super(TestNodeContributorBulkPartialUpdate, self).setUp() self.user_three = AuthUserFactory() self.user_four = AuthUserFactory() self.public_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) self.public_project.add_contributor(self.user_three, permissions=[permissions.READ], visible=True, save=True) self.private_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) self.private_project.add_contributor(self.user_three, permissions=[permissions.READ], visible=True, save=True) self.private_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.private_project._id) self.public_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.public_project._id) self.payload_one = { 'id': self.user_two._id, 'type': 'contributors', 'attributes': { 'bibliographic': True, 'permission': "admin" } } self.payload_two = { 'id': self.user_three._id, 'type': 'contributors', 'attributes': { 'bibliographic': False, 'permission': "write" } } def test_bulk_partial_update_contributors_blank_request(self): res = self.app.patch_json_api(self.public_url, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) def test_bulk_partial_update_contributors_public_project_one_not_found(self): invalid_id = { 'id': '12345', 'type': 'contributors', 'attributes': {} } empty_payload = {'data': [invalid_id, self.payload_one]} res = self.app.patch_json_api(self.public_url, empty_payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Could not find all objects to update.') res = self.app.get(self.public_url) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read'] ) def test_bulk_partial_update_contributors_public_projects_logged_out(self): res = self.app.patch_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, bulk=True, expect_errors=True) assert_equal(res.status_code, 401) res = self.app.get(self.public_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_partial_update_contributors_public_projects_logged_in(self): res = self.app.patch_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 200) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission']], ['admin', 'write']) def test_bulk_partial_update_contributors_private_projects_logged_out(self): res = self.app.patch_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.private_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_partial_update_contributors_private_projects_logged_in_contrib(self): res = self.app.patch_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 200) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission']], ['admin', 'write']) def test_bulk_partial_update_contributors_private_projects_logged_in_non_contrib(self): res = self.app.patch_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_four.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.private_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_partial_update_contributors_private_projects_logged_in_read_only_contrib(self): res = self.app.patch_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_two.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.private_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_partial_update_contributors_projects_send_dictionary_not_list(self): res = self.app.patch_json_api(self.public_url, {'data': self.payload_one}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Expected a list of items but got type "dict".') def test_bulk_partial_update_contributors_id_not_supplied(self): res = self.app.patch_json_api(self.public_url, {'data': [{'type': 'contributors', 'attributes': {}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(len(res.json['errors']), 1) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/0/id') assert_equal(res.json['errors'][0]['detail'], "This field may not be null.") def test_bulk_partial_update_contributors_type_not_supplied(self): res = self.app.patch_json_api(self.public_url, {'data': [{'id': self.user_two._id, 'attributes': {}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(len(res.json['errors']), 1) assert_equal(res.json['errors'][0]['source']['pointer'], '/data/0/type') assert_equal(res.json['errors'][0]['detail'], "This field may not be null.") def test_bulk_partial_update_contributors_wrong_type(self): invalid_type = { 'id': self.user_two._id, 'type': 'Wrong type.', 'attributes': {} } res = self.app.patch_json_api(self.public_url, {'data': [invalid_type]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 409) def test_bulk_partial_update_contributors_wrong_id(self): invalid_id = { 'id': '12345', 'type': 'contributors', 'attributes': {} } res = self.app.patch_json_api(self.public_url, {'data': [invalid_id]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Could not find all objects to update.') def test_bulk_partial_update_contributors_limits(self): contrib_update_list = {'data': [self.payload_one] * 101} res = self.app.patch_json_api(self.public_url, contrib_update_list, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.json['errors'][0]['detail'], 'Bulk operation limit is 100, got 101.') assert_equal(res.json['errors'][0]['source']['pointer'], '/data') def test_bulk_partial_update_invalid_permissions(self): res = self.app.patch_json_api(self.public_url, {'data': [self.payload_two, {'id': self.user_two._id, 'type': 'contributors', 'attributes': {'permission': 'super-user'}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], '"super-user" is not a valid choice.') res = self.app.get(self.public_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) def test_bulk_partial_update_invalid_bibliographic(self): res = self.app.patch_json_api(self.public_url, {'data': [self.payload_two, {'id': self.user_two._id, 'type': 'contributors', 'attributes': {'bibliographic': 'true and false'}}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], '"true and false" is not a valid boolean.') res = self.app.get(self.public_url, auth=self.user.auth) data = res.json['data'] assert_items_equal([data[0]['attributes']['permission'], data[1]['attributes']['permission'], data[2]['attributes']['permission']], ['admin', 'read', 'read']) class TestNodeContributorBulkDelete(NodeCRUDTestCase): def setUp(self): super(TestNodeContributorBulkDelete, self).setUp() self.user_three = AuthUserFactory() self.user_four = AuthUserFactory() self.public_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) self.public_project.add_contributor(self.user_three, permissions=[permissions.READ], visible=True, save=True) self.private_project.add_contributor(self.user_two, permissions=[permissions.READ], visible=True, save=True) self.private_project.add_contributor(self.user_three, permissions=[permissions.READ], visible=True, save=True) self.private_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.private_project._id) self.public_url = '/{}nodes/{}/contributors/'.format(API_BASE, self.public_project._id) self.payload_one = { 'id': self.user_two._id, 'type': 'contributors', } self.payload_two = { 'id': self.user_three._id, 'type': 'contributors', } def test_bulk_delete_contributors_blank_request(self): res = self.app.delete_json_api(self.public_url, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) def test_bulk_delete_invalid_id(self): res = self.app.delete_json_api(self.public_url, {'data': [{'id': '12345', 'type':'contributors'}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Could not find all objects to delete.') def test_bulk_delete_non_contributor(self): res = self.app.delete_json_api(self.public_url, {'data': [{'id': self.user_four._id, 'type':'contributors'}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 404) def test_bulk_delete_all_contributors(self): res = self.app.delete_json_api(self.public_url, {'data': [self.payload_one, self.payload_two, {'id': self.user._id, 'type': 'contributors'}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_in(res.json['errors'][0]['detail'], ['Must have at least one registered admin contributor', 'Must have at least one visible contributor']) self.public_project.reload() assert_equal(len(self.public_project.contributors), 3) def test_bulk_delete_contributors_no_id(self): res = self.app.delete_json_api(self.public_url, {'data': [{'type': 'contributors'}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Request must include /data/id.') def test_bulk_delete_contributors_no_type(self): res = self.app.delete_json_api(self.public_url, {'data': [{'id': self.public_project._id}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Request must include /type.') def test_bulk_delete_contributors_invalid_type(self): res = self.app.delete_json_api(self.public_url, {'data': [{'type': 'Wrong type', 'id': self.user_two._id}]}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 409) def test_bulk_delete_dict_inside_data(self): res = self.app.delete_json_api(self.public_url, {'data': {'id': self.public_project._id, 'type': 'contributors'}}, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Expected a list of items but got type "dict".') def test_bulk_delete_contributors_public_project_logged_in(self): res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) res = self.app.delete_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 204) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_bulk_delete_contributors_public_projects_logged_out(self): res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) res = self.app.delete_json_api(self.public_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_bulk_delete_contributors_private_projects_logged_in_contributor(self): res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) res = self.app.delete_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user.auth, bulk=True) assert_equal(res.status_code, 204) res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 1) def test_bulk_delete_contributors_private_projects_logged_out(self): res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) res = self.app.delete_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, expect_errors=True, bulk=True) assert_equal(res.status_code, 401) res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_bulk_delete_contributors_private_projects_logged_in_non_contributor(self): res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) res = self.app.delete_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_four.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_bulk_delete_contributors_private_projects_logged_in_read_only_contributor(self): res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) res = self.app.delete_json_api(self.private_url, {'data': [self.payload_one, self.payload_two]}, auth=self.user_two.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 403) res = self.app.get(self.private_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_bulk_delete_contributors_all_or_nothing(self): res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) invalid_id = { 'id': '12345', 'type': 'contributors', } new_payload = {'data': [self.payload_one, invalid_id]} res = self.app.delete_json_api(self.public_url, new_payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Could not find all objects to delete.') res = self.app.get(self.public_url, auth=self.user.auth) assert_equal(len(res.json['data']), 3) def test_bulk_delete_contributors_limits(self): new_payload = {'data': [self.payload_one] * 101 } res = self.app.delete_json_api(self.public_url, new_payload, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400) assert_equal(res.json['errors'][0]['detail'], 'Bulk operation limit is 100, got 101.') assert_equal(res.json['errors'][0]['source']['pointer'], '/data') def test_bulk_delete_contributors_no_payload(self): res = self.app.delete_json_api(self.public_url, auth=self.user.auth, expect_errors=True, bulk=True) assert_equal(res.status_code, 400)
45.958867
186
0.586411
7,773
68,157
4.877911
0.029204
0.051904
0.062401
0.050638
0.917818
0.897563
0.867154
0.857422
0.847347
0.825615
0
0.011639
0.282744
68,157
1,482
187
45.989879
0.763961
0.00427
0
0.655698
0
0
0.121437
0.01179
0
0
0
0
0.223114
1
0.093098
false
0
0.006421
0.000803
0.106742
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
547b0aaaa3af418ed845a47d6d06241ee33196c3
30
py
Python
tests/unit_tests/test_for_test.py
kottenator/django-polyfill-js
a082bc84bf367c8c2e1ff8757c23b27456eb00b8
[ "MIT" ]
null
null
null
tests/unit_tests/test_for_test.py
kottenator/django-polyfill-js
a082bc84bf367c8c2e1ff8757c23b27456eb00b8
[ "MIT" ]
null
null
null
tests/unit_tests/test_for_test.py
kottenator/django-polyfill-js
a082bc84bf367c8c2e1ff8757c23b27456eb00b8
[ "MIT" ]
null
null
null
def test_for_test(): pass
10
20
0.666667
5
30
3.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.233333
30
2
21
15
0.782609
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
0
0
6
548e2172ee590e2c9cbcf3fb85bff7d5512fa71e
2,342
py
Python
17.py
mheden/adventofcode2020
17440bb4dff6abf771b594f488e0c9e7ff363d1b
[ "MIT" ]
null
null
null
17.py
mheden/adventofcode2020
17440bb4dff6abf771b594f488e0c9e7ff363d1b
[ "MIT" ]
null
null
null
17.py
mheden/adventofcode2020
17440bb4dff6abf771b594f488e0c9e7ff363d1b
[ "MIT" ]
null
null
null
from utils import read_file from grid import Grid def part1(data, num=6): def iterate(g): g.update_limits() result = Grid(dim=g.dim, emptyvalue=g.emptyvalue) for z in range(g.limits["min"][2] - 1, g.limits["max"][2] + 2): for y in range(g.limits["min"][1] - 1, g.limits["max"][1] + 2): for x in range(g.limits["min"][0] - 1, g.limits["max"][0] + 2): n = g.neighbours((x, y, z)) value = g.get((x, y, z)) if value == "#" and (2 <= n.count("#") <= 3): result.set((x, y, z), "#") elif value == "." and n.count("#") == 3: result.set((x, y, z), "#") else: result.set((x, y, z), ".") return result g = Grid(dim=3, emptyvalue=".") y = 0 for row in data: for x, c in enumerate(row): g.set((x, y, 0), c) y += 1 for _ in range(num): g = iterate(g) return g.items["#"] def part2(data, num=6): def iterate(g): g.update_limits() result = Grid(dim=g.dim, emptyvalue=g.emptyvalue) for w in range(g.limits["min"][3] - 1, g.limits["max"][3] + 2): for z in range(g.limits["min"][2] - 1, g.limits["max"][2] + 2): for y in range(g.limits["min"][1] - 1, g.limits["max"][1] + 2): for x in range(g.limits["min"][0] - 1, g.limits["max"][0] + 2): n = g.neighbours((x, y, z, w)) value = g.get((x, y, z, w)) if value == "#" and (2 <= n.count("#") <= 3): result.set((x, y, z, w), "#") elif value == "." and n.count("#") == 3: result.set((x, y, z, w), "#") else: result.set((x, y, z, w), ".") return result g = Grid(dim=4, emptyvalue=".") y = 0 for row in data: for x, c in enumerate(row): g.set((x, y, 0, 0), c) y += 1 for _ in range(num): g = iterate(g) return g.items["#"] print("#--- Conway Cubes: part1 ---#") print(part1(read_file("17.txt"))) print("#--- Conway Cubes: part2 ---#") print(part2(read_file("17.txt")))
32.527778
83
0.412895
327
2,342
2.93578
0.16208
0.102083
0.03125
0.102083
0.829167
0.769792
0.710417
0.710417
0.710417
0.708333
0
0.038381
0.38813
2,342
71
84
32.985915
0.631542
0
0
0.666667
0
0
0.055508
0
0
0
0
0
0
1
0.070175
false
0
0.035088
0
0.175439
0.070175
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
49ffbcf0377ca009d36c218cc246eb3ac3e8997c
134
py
Python
laboratory/__init__.py
thiagolcmelo/dynamic
9e4e71dd25ce3c778b17b62ef4062273d244a5ac
[ "MIT" ]
null
null
null
laboratory/__init__.py
thiagolcmelo/dynamic
9e4e71dd25ce3c778b17b62ef4062273d244a5ac
[ "MIT" ]
null
null
null
laboratory/__init__.py
thiagolcmelo/dynamic
9e4e71dd25ce3c778b17b62ef4062273d244a5ac
[ "MIT" ]
null
null
null
# third-party imports from flask import Blueprint laboratory = Blueprint('laboratory', __name__) # local imports from . import views
19.142857
46
0.783582
16
134
6.3125
0.6875
0.217822
0
0
0
0
0
0
0
0
0
0
0.141791
134
7
47
19.142857
0.878261
0.246269
0
0
0
0
0.10101
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
1
0
6
b718428005cb2ac70ef7e866c075944c181f124a
73
py
Python
test_main.py
AratioD/demo-github-actions
04b6345177e61dfca6c6959d1a1ac3006f2bc378
[ "MIT" ]
null
null
null
test_main.py
AratioD/demo-github-actions
04b6345177e61dfca6c6959d1a1ac3006f2bc378
[ "MIT" ]
28
2021-06-04T09:39:34.000Z
2021-06-14T10:39:57.000Z
test_main.py
AratioD/demo-github-actions
04b6345177e61dfca6c6959d1a1ac3006f2bc378
[ "MIT" ]
null
null
null
import pytest import main def test_main(): assert 2 == main.main()
10.428571
27
0.671233
11
73
4.363636
0.636364
0
0
0
0
0
0
0
0
0
0
0.017544
0.219178
73
6
28
12.166667
0.824561
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
true
0
0.5
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
6
b71bb0773deb5b7c8f4fe755395656e413f6cfef
196
py
Python
BlinkerAdapters/__init__.py
Victor-He/blinker-py
52eefadd382cd82124883d58e032b7cf7298264f
[ "MIT" ]
1,267
2018-04-12T07:07:04.000Z
2022-03-31T06:30:32.000Z
BlinkerAdapters/__init__.py
Victor-He/blinker-py
52eefadd382cd82124883d58e032b7cf7298264f
[ "MIT" ]
16
2020-01-31T00:44:29.000Z
2022-03-19T12:05:03.000Z
BlinkerAdapters/__init__.py
Victor-He/blinker-py
52eefadd382cd82124883d58e032b7cf7298264f
[ "MIT" ]
25
2018-07-26T02:39:31.000Z
2022-03-24T08:29:11.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- from .BlinkerLinuxWS import * from .BlinkerMQTT import * from .BlinkerBLE import * from .bluez_components import * from .bluezutils import *
21.777778
32
0.693878
23
196
5.869565
0.652174
0.296296
0
0
0
0
0
0
0
0
0
0.00625
0.183673
196
8
33
24.5
0.8375
0.214286
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
b7210bda76ba3013fd84e8b9442728d909c4eb02
92
py
Python
examples/relationship_many_to_many_models.py
codingjoe/OpenAlchemy
a899c05b11209d9d23f81c2638f501e5147c90b8
[ "Apache-2.0" ]
null
null
null
examples/relationship_many_to_many_models.py
codingjoe/OpenAlchemy
a899c05b11209d9d23f81c2638f501e5147c90b8
[ "Apache-2.0" ]
null
null
null
examples/relationship_many_to_many_models.py
codingjoe/OpenAlchemy
a899c05b11209d9d23f81c2638f501e5147c90b8
[ "Apache-2.0" ]
null
null
null
from open_alchemy import init_yaml init_yaml("relationship-many-to-many-example-spec.yml")
23
55
0.826087
15
92
4.866667
0.8
0.219178
0
0
0
0
0
0
0
0
0
0
0.065217
92
3
56
30.666667
0.848837
0
0
0
0
0
0.456522
0.456522
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
b741ed02bc995cdc72298baa43f8747c65303bb9
36
py
Python
problem_14/__init__.py
oltionzefi/daily-coding-problem
4fe3ec53e1f3c7d299849671fdfead462d548cd3
[ "MIT" ]
null
null
null
problem_14/__init__.py
oltionzefi/daily-coding-problem
4fe3ec53e1f3c7d299849671fdfead462d548cd3
[ "MIT" ]
null
null
null
problem_14/__init__.py
oltionzefi/daily-coding-problem
4fe3ec53e1f3c7d299849671fdfead462d548cd3
[ "MIT" ]
null
null
null
from .problem_14 import estimate_pi
18
35
0.861111
6
36
4.833333
1
0
0
0
0
0
0
0
0
0
0
0.0625
0.111111
36
1
36
36
0.84375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
3f9c73464fe49a1212ae0a1c40f1828ba92485c8
70
py
Python
example.py
mrchrisadams/poetry-with-dotenvs
1811988db9e02f35cfa7e1c714fd87a28fd787ed
[ "Apache-2.0" ]
1
2021-01-06T00:15:05.000Z
2021-01-06T00:15:05.000Z
example.py
mrchrisadams/poetry-with-dotenvs
1811988db9e02f35cfa7e1c714fd87a28fd787ed
[ "Apache-2.0" ]
null
null
null
example.py
mrchrisadams/poetry-with-dotenvs
1811988db9e02f35cfa7e1c714fd87a28fd787ed
[ "Apache-2.0" ]
null
null
null
from poetry_with_dotenvs import access_some_envs access_some_envs()
14
48
0.871429
11
70
5
0.727273
0.363636
0.509091
0
0
0
0
0
0
0
0
0
0.1
70
4
49
17.5
0.873016
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
3fa578434a36e5fbb857c06718aef57f54eff4b7
4,967
py
Python
tests/test_models/test_kinematics.py
floodlight-sports/floodlight
37f088d90265bed5aa987a3e5aacfea0552f933b
[ "MIT" ]
26
2022-01-25T22:15:22.000Z
2022-03-02T11:06:29.000Z
tests/test_models/test_kinematics.py
floodlight-sports/floodlight
37f088d90265bed5aa987a3e5aacfea0552f933b
[ "MIT" ]
12
2021-11-17T15:42:28.000Z
2022-03-28T19:59:24.000Z
tests/test_models/test_kinematics.py
floodlight-sports/floodlight
37f088d90265bed5aa987a3e5aacfea0552f933b
[ "MIT" ]
8
2021-11-03T09:01:22.000Z
2022-03-23T10:43:14.000Z
import pytest import numpy as np from floodlight.models.kinematics import DistanceModel, VelocityModel, AccelerationModel # Differences in the kinematic models can be calculated via central or backward # difference methode. This is specified in the respective models .fit()-method. # As this has no impact on the calculations in the other class methods, only the # .fit()-methods are tested with both difference methods. The other class methods are # tested with the default difference methode (i.e., 'central'). @pytest.mark.unit def test_distance_model_fit_difference_central(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act dist_model = DistanceModel() dist_model.fit(xy) distance_covered = dist_model._distance_euclidean_ # Assert assert np.array_equal( np.round(distance_covered, 3), np.array(((1, np.NaN), (1.118, 1.414), (1.414, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_distance_model_fit_difference_backward(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act dist_model = DistanceModel() dist_model.fit(xy, difference="backward") distance_covered = dist_model._distance_euclidean_ # Assert assert np.array_equal( np.round(distance_covered, 3), np.array(((0, 1.414), (1, np.NaN), (1.414, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_distance_covered(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act dist_model = DistanceModel() dist_model.fit(xy) distance_covered = dist_model.distance_covered() # Assert assert np.array_equal( np.round(distance_covered, 3), np.array(((1, np.NaN), (1.118, 1.414), (1.414, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_cumulative_distance_covered(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act dist_model = DistanceModel() dist_model.fit(xy) distance_covered = dist_model.cumulative_distance_covered() # Assert assert np.array_equal( np.round(distance_covered, 3), np.array(((1, 0), (2.118, 1.414), (3.532, 1.414))), equal_nan=True, ) @pytest.mark.unit def test_velocity_model_fit_difference_central(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act vel_model = VelocityModel() vel_model.fit(xy) velocity = vel_model._velocity_ # Assert assert np.array_equal( np.round(velocity, 3), np.array(((20, np.NaN), (22.361, 28.284), (28.284, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_velocity_model_fit_difference_backward(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act vel_model = VelocityModel() vel_model.fit(xy, difference="backward") velocity = vel_model._velocity_ # Assert assert np.array_equal( np.round(velocity, 3), np.array(((0, 28.284), (20, np.NaN), (28.284, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_velocity(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act vel_model = VelocityModel() vel_model.fit(xy) velocity = vel_model.velocity() # Assert assert np.array_equal( np.round(velocity, 3), np.array(((20, np.NaN), (22.361, 28.284), (28.284, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_acceleration_model_difference_central(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act acc_model = AccelerationModel() acc_model.fit(xy) acceleration = acc_model._acceleration_ # Assert assert np.array_equal( np.round(acceleration, 3), np.array(((47.214, np.NaN), (82.843, np.NaN), (118.472, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_acceleration_model_difference_backward(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act acc_model = AccelerationModel() acc_model.fit(xy, difference="backward") acceleration = acc_model._acceleration_ # Assert assert np.array_equal( np.round(acceleration, 3), np.array(((400, np.NaN), (165.685, np.NaN), (-565.685, np.NaN))), equal_nan=True, ) @pytest.mark.unit def test_acceleration(example_xy_object_kinematics) -> None: # Arrange xy = example_xy_object_kinematics # Act acc_model = AccelerationModel() acc_model.fit(xy) acceleration = acc_model.acceleration() # Assert assert np.array_equal( np.round(acceleration, 3), np.array(((47.214, np.NaN), (82.843, np.NaN), (118.472, np.NaN))), equal_nan=True, )
25.869792
88
0.674049
657
4,967
4.837139
0.143075
0.03304
0.094399
0.157332
0.843927
0.826935
0.826935
0.826935
0.826935
0.81781
0
0.040337
0.211395
4,967
191
89
26.005236
0.770998
0.114757
0
0.699115
0
0
0.005503
0
0
0
0
0
0.088496
1
0.088496
false
0
0.026549
0
0.115044
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
3ff84b8f6a3fc3eb5cd145e0dcae24ad95fc640c
46
py
Python
runPlotAppDev.py
maldata/matplotlib_qtquick_playground
f7da94093315d8f540124d5037406d004574dede
[ "MIT" ]
null
null
null
runPlotAppDev.py
maldata/matplotlib_qtquick_playground
f7da94093315d8f540124d5037406d004574dede
[ "MIT" ]
null
null
null
runPlotAppDev.py
maldata/matplotlib_qtquick_playground
f7da94093315d8f540124d5037406d004574dede
[ "MIT" ]
null
null
null
from plotapp import __main__ __main__.main()
11.5
28
0.804348
6
46
4.833333
0.666667
0.551724
0
0
0
0
0
0
0
0
0
0
0.130435
46
3
29
15.333333
0.725
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
b20581182cf49c2ec957aea47c9f86fb21c3a5a0
99
py
Python
test/tabs.py
f1x3d/git-tabs-spaces-converter
2192f8804de414b2a54c5d55c3aada8a1be43825
[ "MIT" ]
1
2020-10-31T13:37:12.000Z
2020-10-31T13:37:12.000Z
test/tabs.py
f1x3d/git-tabs-spaces-converter
2192f8804de414b2a54c5d55c3aada8a1be43825
[ "MIT" ]
3
2020-10-31T13:16:07.000Z
2020-10-31T13:27:24.000Z
test/tabs.py
f1x3d/git-tabs-spaces-converter
2192f8804de414b2a54c5d55c3aada8a1be43825
[ "MIT" ]
null
null
null
def print_hello_world(n): while n > 0: print('Hello, world!') n = n - 1 print_hello_world(3)
14.142857
25
0.646465
18
99
3.333333
0.5
0.5
0.75
0.533333
0
0
0
0
0
0
0
0.037975
0.20202
99
6
26
16.5
0.721519
0
0
0
0
0
0.131313
0
0
0
0
0
0
1
0.2
false
0
0
0
0.2
0.6
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
6
b208c249a1f7a6c2a452cdd3d68e9fb991e55722
17,627
py
Python
moncli/entities/update.py
rstrblstr/moncli
0262b58b3d7932f8c9905247ebd48172f96654e2
[ "BSD-3-Clause" ]
1
2021-05-01T11:26:33.000Z
2021-05-01T11:26:33.000Z
moncli/entities/update.py
rstrblstr/moncli
0262b58b3d7932f8c9905247ebd48172f96654e2
[ "BSD-3-Clause" ]
null
null
null
moncli/entities/update.py
rstrblstr/moncli
0262b58b3d7932f8c9905247ebd48172f96654e2
[ "BSD-3-Clause" ]
null
null
null
from schematics import types from schematics.models import Model from .. import api_v2 as client, config, entities as en from ..api_v2 import constants class _Update(Model): """Update base model""" id = types.StringType(required=True) creator_id = types.StringType(required=True) item_id = types.StringType(required=True) body = types.StringType() created_at = types.StringType() text_body = types.StringType() updated_at = types.StringType() class Update(_Update): """An update __________ Properties assets : `list[moncli.entities.Asset]` The update's assets/files. body: `str` The update's html formatted body. created_at: `str` The update's creation date. creator : `moncli.entities.User` The update's creator. creator_id : `str` The unique identifier of the update creator. id : `str` The update's unique identifier. item_id : `str` The update's item ID. replies : `list[moncli.entities.Reply] The update's replies. text_body : `str` The update's text body. updated_at : `str` The update's last edit date. _______ Methods get_creator : `moncli.entities.User` Get the update's creator. add_reply : `moncli.entities.Reply` Add reply to update. get_replies : `list[moncli.entities.Reply]` Get update replies. add_file : `moncli.entities.Asset` Add a file to update. get_files : `list[moncli.entities.Asset] Get update's files. delete : `moncli.entity.Update` Delete an update. """ def __init__(self, **kwargs): self.__creds = kwargs.pop('creds') self.__creator = None creator = kwargs.pop('creator', None) if creator: self.__creator = en.User(cred=self.__creds, **creator) self.__replies = None replies = kwargs.pop('replies', None) if replies: self.__replies = [Reply(creds=self.__creds, item_id=kwargs['item_id'], **reply) for reply in replies] self.__assets = None assets = kwargs.pop('assets', None) if assets: self.__assets = [en.Asset(creds=self.__creds, **asset) for asset in assets] super(Update, self).__init__(kwargs) def __repr__(self): o = self.to_primitive() if len(self.__replies) > 0: o['replies'] = self.__replies return str(o) @property def creator(self): """The update's creator.""" if not self.__creator: self.__creator = self.get_creator() return self.__creator @property def replies(self): """The update's replies.""" if not self.__replies: self.__replies = self.get_replies() return self.__replies @property def assets(self): """The update's assets/files.""" return self.__assets def get_creator(self, *args): """Get the update's creator. __________ Parameters args : `tuple` The list of user fields to return. _______ Returns user : `moncli.entities.User` The update's creator. _____________ Return Fields account : `moncli.entities.Account` The user's account. birthday : `str` The user's birthday. country_code : `str` The user's country code. created_at : `str` The user's creation date. email : `str` The user's email. enabled : `bool` Is the user enabled or not. id : `str` The user's unique identifier. is_guest : `bool` Is the user a guest or not. is_pending : `bool` Is the user a pending user. is_view_only : `bool` Is the user a view only user or not. join_date : `str` The date the user joined the account. location : `str` The user' location. mobile_phone : `str` The user's mobile phone number. name : `str` The user's name. phone : `str` The user's phone number. photo_original : `str` The user's photo in the original size. photo_small : `str` The user's photo in small size (150x150). photo_thumb : `str` The user's photo in thumbnail size (100x100). photo_thumb_small : `str` The user's photo in small thumbnail size (50x50). photo_tiny : `str` The user's photo in tiny size (30x30). teams : `list[moncli.entities.Team]` The teams the user is a member in. time_zone_identifier : `str` The user's time zone identifier. title : `str` The user's title. url : `str` The user's profile url. utc_hours_diff : `int` The user's UTC hours difference. """ args = client.get_field_list(constants.DEFAULT_USER_QUERY_FIELDS) user_data = client.get_users( self.__creds.api_key_v2, *args, ids=[int(self.creator_id)])[0] return en.User(creds=self.__creds, **user_data) def add_reply(self, body: str, *args): """Add reply to update. __________ Parameters body : `str` The text body of the reply. args : `tuple` The list of reply fields to return. _______ Returns update : `moncli.entities.Update` The updated update. _____________ Return Fields assets : `list[moncli.entities.Asset]` The update's assets/files. body: `str` The update's html formatted body. created_at: `str` The update's creation date. creator : `moncli.entities.User` The update's creator creator_id : `str` The unique identifier of the update creator. id : `str` The update's unique identifier. item_id : `str` The update's item ID. replies : `list[moncli.entities.Reply] The update's replies. text_body : `str` The update's text body. updated_at : `str` The update's last edit date. """ update_data = client.create_update( self.__creds.api_key_v2, body, self.item_id, *args, parent_id=self.id) return en.Update(creds=self.__creds, **update_data) def get_replies(self, *args): """Get update replies. __________ Parameters args : `tuple` The list of update fields to return. _______ Returns replies : `list[moncli.entities.Reply]` The update's replies. _____________ Return Fields body : `str` The reply's html formatted body. created_at : `str` The reply's creation date. creator : `moncli.entities.User` The reply's creator. creator_id : `str` The unique identifier of the reply creator. id : `str` The reply's unique identifier. text_body : `str` The reply's text body. updated_at : `str` The reply's last edit date. """ # Hard configure the pagination rate. page = 1 page_limit = 500 record_count = 500 args = ['replies.{}'.format(arg) for arg in constants.DEFAULT_REPLY_QUERY_FIELDS] while record_count >= page_limit: updates_data = client.get_updates( self.__creds.api_key_v2, 'id', 'item_id', *args, limit=page_limit, page=page) try: target_update = [update for update in updates_data if update['id'] == self.id][0] return [Reply(creds=self.__creds, item_id=target_update['item_id'], **reply_data) for reply_data in target_update['replies']] except KeyError: if len(target_update) == 0: page += 1 record_count = len(updates_data) continue return [] def add_file(self, file_path: str, *args): """Add a file to update. __________ Parameters file_path : `str` The path to the file to upload. args : `tuple` The list of update fields to return. _______ Returns asset : `moncli.entities.Asset` The newly created asset. _____________ Return Fields created_at : `str` The file's creation date. file_extension : `str` The file's extension. file_size : `int` The file's size in bytes. id : `str` The file's unique identifier. name : `str` The file's name. public_url : `str` Public url to the asset, valid for 1 hour. uploaded_by : `moncli.entities.user.User` The user who uploaded the file url : `str` The user who uploaded the file url_thumbnail : `str` Url to view the asset in thumbnail mode. Only available for images. """ asset_data = client.add_file_to_update( self.__creds.api_key_v2, self.id, file_path, *args) return en.Asset(**asset_data) def get_files(self, *args): """Get update's files. __________ Parameters args : `tuple` The list of asset fields to return. _______ Returns assets : `list[moncli.entities.Asset]` The update's files. _____________ Return Fields created_at : `str` The file's creation date. file_extension : `str` The file's extension. file_size : `int` The file's size in bytes. id : `str` The file's unique identifier. name : `str` The file's name. public_url : `str` Public url to the asset, valid for 1 hour. uploaded_by : `moncli.entities.user.User` The user who uploaded the file url : `str` The user who uploaded the file url_thumbnail : `str` Url to view the asset in thumbnail mode. Only available for images. """ # Hard configure the pagination rate. page = 1 page_limit = 500 record_count = 500 args = ['assets.{}'.format(arg) for arg in constants.DEFAULT_ASSET_QUERY_FIELDS] while record_count >= page_limit: updates_data = client.get_updates( self.__creds.api_key_v2, 'id', *args, limit=page_limit, page=page) try: target_update = [update for update in updates_data if update['id'] == self.id][0] return [en.Asset(creds=self.__creds, **asset_data) for asset_data in target_update['assets']] except KeyError: if len(target_update) == 0: page += 1 record_count = len(updates_data) continue return [] def delete(self, *args): """Delete the selected update. __________ Parameters args : `tuple` The list of update fields to return. _______ Returns update : `moncli.entities.Update` The deleted update. _____________ Return Fields assets : `list[moncli.entities.asset.Asset]` The update's assets/files. body: `str` The update's html formatted body. created_at: `str` The update's creation date. creator : `moncli.entities.user.User` The update's creator creator_id : `str` The unique identifier of the update creator. id : `str` The update's unique identifier. item_id : `str` The update's item ID. replies : `list[moncli.entities.reply.Reply] The update's replies. text_body : `str` The update's text body. updated_at : `str` The update's last edit date. """ update_data = client.delete_update( self.__creds.api_key_v2, self.id, *args) return Update(creds=self.__creds, **update_data) class _Reply(Model): """Reply base model""" id = types.StringType(required=True) creator_id = types.StringType(required=True) body = types.StringType() created_at = types.StringType() text_body = types.StringType() updated_at = types.StringType() class Reply(_Reply): """A reply for an update __________ Properties body : `str` The reply's html formatted body. created_at : `str` The reply's creation date. creator : `moncli.entities.User` The reply's creator. creator_id : `str` The unique identifier of the reply creator. id : `str` The reply's unique identifier. text_body : `str` The reply's text body. updated_at : `str` The reply's last edit date. _______ Methods get_creator : `moncli.entities.User` Get the reply's creator. """ def __init__(self, **kwargs): self.__creds = kwargs.pop('creds') self.__item_id = kwargs.pop('item_id') self.__creator = None super(Reply, self).__init__(kwargs) def __repr__(self): return str(self.to_primitive()) @property def creator(self): """The reply's creator.""" if not self.__creator: self.__creator = self.get_creator() return self.__creator def get_creator(self, *args): """Get the reply's creator. __________ Parameters args : `tuple` List of user return fields. _______ Returns creator : `moncli.entities.User` The creator of this update. _____________ Return Fields account : `moncli.entities.Account` The user's account. birthday : `str` The user's birthday. country_code : `str` The user's country code. created_at : `str` The user's creation date. email : `str` The user's email. enabled : `bool` Is the user enabled or not. id : `str` The user's unique identifier. is_guest : `bool` Is the user a guest or not. is_pending : `bool` Is the user a pending user. is_view_only : `bool` Is the user a view only user or not. join_date : `str` The date the user joined the account. location : `str` The user' location. mobile_phone : `str` The user's mobile phone number. name : `str` The user's name. phone : `str` The user's phone number. photo_original : `str` The user's photo in the original size. photo_small : `str` The user's photo in small size (150x150). photo_thumb : `str` The user's photo in thumbnail size (100x100). photo_thumb_small : `str` The user's photo in small thumbnail size (50x50). photo_tiny : `str` The user's photo in tiny size (30x30). teams : `list[moncli.entities.Team]` The teams the user is a member in. time_zone_identifier : `str` The user's time zone identifier. title : `str` The user's title. url : `str` The user's profile url. utc_hours_diff : `int` The user's UTC hours difference. """ args = client.get_field_list(constants.DEFAULT_USER_QUERY_FIELDS) user_data = client.get_users( self.__creds.api_key_v2, *args, ids=[int(self.creator_id)])[0] return en.User(creds=self.__creds, **user_data)
30.549393
141
0.515062
1,932
17,627
4.42029
0.089027
0.056909
0.033724
0.041218
0.808899
0.779391
0.745316
0.727166
0.708197
0.693443
0
0.007049
0.404436
17,627
576
142
30.602431
0.806439
0.540591
0
0.609929
0
0
0.018777
0
0
0
0
0
0
1
0.106383
false
0
0.028369
0.007092
0.361702
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
b763088cf1763dac98829a4f51a1f65ebd1ee163
18
py
Python
pssp.py
himanshuhat21/mcd
2603f7eb0926e2b47464e6913ea665d5dca6b767
[ "MIT" ]
null
null
null
pssp.py
himanshuhat21/mcd
2603f7eb0926e2b47464e6913ea665d5dca6b767
[ "MIT" ]
null
null
null
pssp.py
himanshuhat21/mcd
2603f7eb0926e2b47464e6913ea665d5dca6b767
[ "MIT" ]
null
null
null
x = 12 print(x>32)
9
11
0.611111
5
18
2.2
0.8
0
0
0
0
0
0
0
0
0
0
0.266667
0.166667
18
2
11
9
0.466667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
6
b77ea7b5139668b6fadf33ad937ec1e71abd1780
73,637
py
Python
project/editorial/views/assets.py
ProjectFacet/facet
dc6bc79d450f7e2bdf59cfbcd306d05a736e4db9
[ "MIT" ]
25
2015-07-13T22:16:36.000Z
2021-11-11T02:45:32.000Z
project/editorial/views/assets.py
ProjectFacet/facet
dc6bc79d450f7e2bdf59cfbcd306d05a736e4db9
[ "MIT" ]
74
2015-12-01T18:57:47.000Z
2022-03-11T23:25:47.000Z
project/editorial/views/assets.py
ProjectFacet/facet
dc6bc79d450f7e2bdf59cfbcd306d05a736e4db9
[ "MIT" ]
6
2016-01-08T21:12:43.000Z
2019-05-20T16:07:56.000Z
""" Media Asset handling views for editorial app. editorial/views/assetviews.py """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import redirect, get_object_or_404 from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views.generic import View, TemplateView, UpdateView, DetailView, ListView, CreateView, FormView, DeleteView, RedirectView from actstream import action from braces.views import LoginRequiredMixin, FormMessagesMixin from editorial.forms import ( ImageAssetForm, DocumentAssetForm, AudioAssetForm, VideoAssetForm, SimpleImageForm, SimpleDocumentForm, SimpleAudioForm, SimpleVideoForm, LibraryImageAssociateForm, LibraryDocumentAssociateForm, LibraryAudioAssociateForm, LibraryVideoAssociateForm, SimpleImageLibraryAssociateForm, SimpleDocumentLibraryAssociateForm, SimpleAudioLibraryAssociateForm, SimpleVideoLibraryAssociateForm, ) from editorial.models import ( Facet, Call, Pitch, Assignment, Project, Story, Event, Task, Organization, Network, ImageAsset, DocumentAsset, AudioAsset, VideoAsset, SimpleImage, SimpleDocument, SimpleAudio, SimpleVideo, ) #----------------------------------------------------------------------# # Asset Library Views #----------------------------------------------------------------------# # ACCESS: Only an org's users should be able to see an organization's asset library # FUTURE TODO: This is likely another place to add organization/ to url class AssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization assets.""" template_name = 'editorial/assets/asset_list.html' def get_context_data(self): """Return all the (complex) assets associated with an organization.""" organization = self.request.user.organization tab = "Recent Assets" recentassets = organization.get_org_recent_media() return {'recentassets': recentassets, 'tab': tab,} class ImageAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization image assets.""" template_name = 'editorial/assets/asset_list.html' def get_context_data(self): """Return all the (complex) assets associated with an organization.""" tab = "Image Assets" organization = self.request.user.organization images = organization.get_org_image_library() return {'images': images, 'tab': tab,} class DocumentAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization document assets.""" template_name = 'editorial/assets/asset_list.html' def get_context_data(self): """Return all the (complex) assets associated with an organization.""" tab = "Document Assets" organization = self.request.user.organization documents = organization.get_org_document_library() return {'documents': documents, 'tab': tab,} class AudioAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization audio assets.""" template_name = 'editorial/assets/asset_list.html' def get_context_data(self): """Return all the (complex) assets associated with an organization.""" tab = "Audio Assets" organization = self.request.user.organization audio = organization.get_org_audio_library() return {'audio': audio, 'tab': tab,} class VideoAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization video assets.""" template_name = 'editorial/assets/asset_list.html' def get_context_data(self): """Return all the (complex) assets associated with an organization.""" tab = "Video Assets" organization = self.request.user.organization video = organization.get_org_video_library() return {'video': video, 'tab': tab,} #----------------------------------------------------------------------# # Image Asset Views #----------------------------------------------------------------------# # ACCESS: Any org user, or user from an organization that is in collaborate_with # should be able to create an asset for P, Sr, St, F # Contractors should only be able to do so for PSSF that they have access to # That should be handled by limiting which PSSF they have access to. class ImageAssetCreateView(LoginRequiredMixin, CreateView): """ Upload image to a facet.""" model = ImageAsset form_class = ImageAssetForm def form_valid(self, form): """Save -- but first add owner and organization to the image and add the image to the facet. """ self.object = image = form.save(commit=False) facet_id = self.request.POST.get('facet') facet = get_object_or_404(Facet, id=facet_id) # set request based attributes image.owner = self.request.user image.organization = self.request.user.organization image.save() # add image asset to facet image_assets facet.image_assets.add(image) facet.save() # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class LibraryImageAssociateView(LoginRequiredMixin, FormView): """ Add existing image(s) in the library to another facet.""" form_class = LibraryImageAssociateForm template_name = "editorial/assets/_libraryimage.html" def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(LibraryImageAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Handle submission of form.""" facet = self.kwargs['facet'] images = form.cleaned_data['images'] facet = get_object_or_404(Facet, id=facet) facet.image_assets.add(*images) action.send(self.request.user, verb="added image", target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to remove an asset for a F # A user from an organization that is in collaborate_with or # contractors should be able to do this as it is easily reversed. class ImageAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove an image from a facet.""" def post(self, request, facet, image): """ Retrieve facet and image from kwargs and remove image from facet imageasset_set.""" facet_id = self.kwargs['facet'] image_id = self.kwargs['image'] facet = Facet.objects.get(id=facet_id) image = ImageAsset.objects.get(id=image_id) facet.image_assets.remove(image) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to update an asset # A user from an organization that is in collaborate_with should be able to update # assets they are the owner of. # contractors should only be able to do this with assets they are the owner of. class ImageAssetUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific image asset.""" model = ImageAsset form_class = ImageAssetForm template_name = 'editorial/assets/imageasset_form.html' def image_usage(self): """Get all facets an image is associated with.""" return self.object.get_image_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(ImageAssetUpdateView, self).get_success_url() # ACCESS: Only users with access to an organization's media library should be # able to delete items in it. class ImageAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of an image asset. Assets can only be deleted from the library. """ model = ImageAsset template_name = "editorial/assets/imageasset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('asset_library') #----------------------------------------------------------------------# # Document Asset Views #----------------------------------------------------------------------# # ACCESS: Any org user, or user from an organization that is in collaborate_with # should be able to create an asset for P, Sr, St, F # Contractors should only be able to do so for PSSF that they have access to # That should be handled by limiting which PSSF they have access to. class DocumentAssetCreateView(LoginRequiredMixin, CreateView): """Upload a document to a facet.""" model = DocumentAsset form_class = DocumentAssetForm def form_valid(self, form): """Save -- but first add owner and organization to the document and add the document to the facet. """ self.object = document = form.save(commit=False) facet_id = self.request.POST.get('facet') facet = get_object_or_404(Facet, id=facet_id) # set request based attributes document.owner = self.request.user document.organization = self.request.user.organization document.save() # add document asset to facet document_assets facet.document_assets.add(document) facet.save() # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class LibraryDocumentAssociateView(LoginRequiredMixin, FormView): """ Add existing document(s) in the library to another facet.""" form_class = LibraryDocumentAssociateForm template_name = "editorial/assets/_librarydocument.html" def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(LibraryDocumentAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Handle submission of form.""" facet = self.kwargs['facet'] documents = form.cleaned_data['documents'] facet = get_object_or_404(Facet, id=facet) facet.document_assets.add(*documents) action.send(self.request.user, verb="added document", target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to remove an asset for a F # A user from an organization that is in collaborate_with or # contractors should be able to do this as it is easily reversed. class DocumentAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove a document from a facet.""" def post(self, request, facet, document): """ Retrieve facet and document from kwargs and remove document from facet document_assets.""" facet_id = self.kwargs['facet'] doc_id = self.kwargs['document'] facet = Facet.objects.get(id=facet_id) document = DocumentAsset.objects.get(id=doc_id) facet.document_assets.remove(document) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to update an asset # A user from an organization that is in collaborate_with should be able to update # assets they are the owner of. # contractors should only be able to do this with assets they are the owner of. class DocumentAssetUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific document asset.""" model = DocumentAsset form_class = DocumentAssetForm template_name = 'editorial/assets/documentasset_form.html' def document_usage(self): """Get all facets a document is associated with.""" return self.object.get_document_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(DocumentAssetUpdateView, self).get_success_url() # ACCESS: Only users with access to an organization's media library should be # able to delete items in it. class DocumentAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of a document asset. Assets can only be deleted from the library. """ model = DocumentAsset template_name = "editorial/assets/documentasset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('asset_library') #----------------------------------------------------------------------# # Audio Asset Views #----------------------------------------------------------------------# # ACCESS: Any org user, or user from an organization that is in collaborate_with # should be able to create an asset for P, Sr, St, F # Contractors should only be able to do so for PSSF that they have access to # That should be handled by limiting which PSSF they have access to. class AudioAssetCreateView(LoginRequiredMixin, CreateView): """ Upload audio to a facet.""" model = AudioAsset form_class = AudioAssetForm def form_valid(self, form): """Save -- but first add owner and organization to the audio and add the audio to the facet. """ self.object = audio = form.save(commit=False) facet_id = self.request.POST.get('facet') facet = get_object_or_404(Facet, id=facet_id) # set request based attributes audio.owner = self.request.user audio.organization = self.request.user.organization audio.save() # add audio asset to facet audio_assets facet.audio_assets.add(audio) facet.save() # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class LibraryAudioAssociateView(LoginRequiredMixin, FormView): """ Add existing audio in the library to another facet.""" form_class = LibraryAudioAssociateForm template_name = "editorial/assets/_libraryaudio.html" def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(LibraryAudioAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Handle submission of form.""" facet = self.kwargs['facet'] audio = form.cleaned_data['audio'] facet = get_object_or_404(Facet, id=facet) facet.audio_assets.add(*audio) action.send(self.request.user, verb="added audio", target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to remove an asset for a F # A user from an organization that is in collaborate_with or # contractors should be able to do this as it is easily reversed. class AudioAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove an audio file from a facet.""" def post(self, request, facet, audio): """ Retrieve facet and audio from kwargs and remove audio from facet audio_assets.""" facet_id = self.kwargs['facet'] audio_id = self.kwargs['audio'] facet = Facet.objects.get(id=facet_id) audio = AudioAsset.objects.get(id=audio_id) facet.audio_assets.remove(audio) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to update an asset # A user from an organization that is in collaborate_with should be able to update # assets they are the owner of. # contractors should only be able to do this with assets they are the owner of. class AudioAssetUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific audio asset.""" model = AudioAsset form_class = AudioAssetForm template_name = 'editorial/assets/audioasset_form.html' def audio_usage(self): """Get all facets a audio is associated with.""" return self.object.get_audio_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(AudioAssetUpdateView, self).get_success_url() # ACCESS: Only users with access to an organization's media library should be # able to delete items in it. class AudioAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of an audio asset. Assets can only be deleted from the library. """ model = AudioAsset template_name = "editorial/assets/audioasset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('asset_library') #----------------------------------------------------------------------# # Video Asset Views #----------------------------------------------------------------------# # ACCESS: Any org user, or user from an organization that is in collaborate_with # should be able to create an asset for P, Sr, St, F # Contractors should only be able to do so for PSSF that they have access to # That should be handled by limiting which PSSF they have access to. class VideoAssetCreateView(LoginRequiredMixin, CreateView): """ Upload video to a facet.""" model = VideoAsset form_class = VideoAssetForm def form_valid(self, form): """Save -- but first add owner and organization to the video and add the video to the facet. """ self.object = video = form.save(commit=False) facet_id = self.request.POST.get('facet') facet = get_object_or_404(Facet, id=facet_id) # set request based attributes video.owner = self.request.user video.organization = self.request.user.organization video.save() # add video asset to facet video_assets facet.video_assets.add(video) facet.save() # record action for activity stream action.send(self.request.user, verb="created video", action_object=video, target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class LibraryVideoAssociateView(LoginRequiredMixin, FormView): """ Add existing video(s) in the library to another facet.""" form_class = LibraryVideoAssociateForm template_name = "editorial/assets/_libraryvideo.html" def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(LibraryVideoAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Handle submission of form.""" facet = self.kwargs['facet'] video = form.cleaned_data['video'] facet = get_object_or_404(Facet, id=facet) facet.video_assets.add(*video) action.send(self.request.user, verb="added video", target=facet) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to remove an asset for a F # A user from an organization that is in collaborate_with or # contractors should be able to do this as it is easily reversed. class VideoAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove a video file from a facet.""" def post(self, request, facet, video): """ Retrieve facet and video from kwargs and remove video from facet video_assets.""" facet_id = self.kwargs['facet'] video_id = self.kwargs['video'] facet = Facet.objects.get(id=facet_id) video = VideoAsset.objects.get(id=video_id) facet.video_assets.remove(video) return redirect('facet_edit', pk=facet.id, story=facet.story.id) # ACCESS: Any org user should be able to update an asset # A user from an organization that is in collaborate_with should be able to update # assets they are the owner of. # contractors should only be able to do this with assets they are the owner of. class VideoAssetUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific video asset.""" model = VideoAsset form_class = VideoAssetForm template_name = 'editorial/assets/videoasset_form.html' def video_usage(self): """Get all facets an video is associated with.""" return self.object.get_video_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(VideoAssetUpdateView, self).get_success_url() # ACCESS: Only users with access to an organization's media library should be # able to delete items in it. class VideoAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of a video asset. Assets can only be deleted from the library. """ model = VideoAsset template_name = "editorial/assets/videoasset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('asset_library') #----------------------------------------------------------------------# # Simple Asset Views #----------------------------------------------------------------------# # Simple Asset Library Views # ACCESS: Only an org's users should be able to see an organization's internal asset library class SimpleAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization assets.""" template_name = 'editorial/assets/simple_asset_list.html' def get_context_data(self, org): """Return all the (complex) assets associated with an organization.""" tab = "Recent Internal Assets" org_id = self.kwargs['org'] organization = Organization.objects.get(id=org_id) simpleassets = organization.get_org_simple_asset_library() return {'simpleassets': simpleassets, 'tab': tab,} class SimpleImageAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization simple image assets.""" template_name = 'editorial/assets/simple_asset_list.html' def get_context_data(self, org): """Return all the simple assets associated with an organization.""" tab = "Internal Images" org_id = self.kwargs['org'] organization = Organization.objects.get(id=org_id) images = organization.get_org_simple_image_library() return {'images': images, 'tab': tab,} class SimpleDocumentAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization simple document assets.""" template_name = 'editorial/assets/simple_asset_list.html' def get_context_data(self, org): """Return all the simple assets associated with an organization.""" tab = "Internal Documents" org_id = self.kwargs['org'] organization = Organization.objects.get(id=org_id) documents = organization.get_org_simple_document_library() return {'documents': documents, 'tab': tab,} class SimpleAudioAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization simple audio assets.""" template_name = 'editorial/assets/simple_asset_list.html' def get_context_data(self, org): """Return all the simple assets associated with an organization.""" tab = "Internal Audio" org_id = self.kwargs['org'] organization = Organization.objects.get(id=org_id) audio = organization.get_org_simple_audio_library() return {'audio': audio, 'tab': tab,} class SimpleVideoAssetLibraryTemplateView(LoginRequiredMixin, TemplateView): """ Display media library of all organization simple video assets.""" template_name = 'editorial/assets/simple_asset_list.html' def get_context_data(self, org): """Return all the simple assets associated with an organization.""" tab = "Internal Video" org_id = self.kwargs['org'] organization = Organization.objects.get(id=org_id) videos = organization.get_org_simple_video_library() return {'videos': videos, 'tab': tab,} # ACCESS: Any org user, or user from an organization that is in collaborate_with # should be able to create a simple asset for P, Sr, St, F # Contractors should only be able to do so for PSSF that they have access to # That should be handled by limiting which PSSF they have access to. class SimpleImageCreateView(LoginRequiredMixin, CreateView): """Upload a simple image.""" model = SimpleImage form_class = SimpleImageForm def form_valid(self,form): """Save -- but first add owner and org to the image. And then connect the image to whatever object it is associated with. Simple images can be connected to Projects, Stories, Tasks, Events. Pitches, Calls and Assignments. """ self.object = image = form.save(commit=False) # set request based attributes image.owner = self.request.user if self.request.user.organization: image.organization = self.request.user.organization image.save() # get thing that the image is being associated with associated_object = self.request.POST.get('association') if associated_object == 'project': project_id = self.request.POST.get('project') project = get_object_or_404(Project, id=project_id) # add simple image to the associated object project.simple_image_assets.add(image) project.save() action_target = project # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('project_detail', args=(project.id,))) elif associated_object == 'story': story_id = self.request.POST.get('story') story = get_object_or_404(Story, id=story_id) # add simple image to the associated object story.simple_image_assets.add(image) story.save() action_target = story # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('story_detail', args=(story.id,))) elif associated_object == 'organization': org_id = self.request.POST.get('organization') organization = Organization.objects.get(id=org_id) # add simple image to the associated object organization.simple_image_assets.add(image) organization.save() action_target = organization # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('org_detail', args=(organization.id,))) elif associated_object == 'network': network_id = self.request.POST.get('network') network = Network.objects.get(id=network_id) # add simple image to the associated object network.simple_image_assets.add(image) network.save() action_target = network # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('network_detail', args=(network.id,))) elif associated_object == 'task': task_id = self.request.POST.get('task') task = get_object_or_404(Task, id=task_id) # add simple image to the associated object task.simple_image_assets.add(image) task.save() action_target = task # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('task_detail', args=(task.id,))) elif associated_object == 'event': event_id = self.request.POST.get('event') event = get_object_or_404(Event, id=event_id) # add simple image to the associated object event.simple_image_assets.add(image) event.save() action_target = event # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('event_detail', args=(event.id,))) elif associated_object == 'pitch': pitch_id = self.request.POST.get('pitch') pitch = get_object_or_404(Pitch, id=pitch_id) # add simple image to the associated object pitch.simple_image_assets.add(image) pitch.save() action_target = pitch # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('pitch_detail', args=(pitch.id,))) elif associated_object == 'call': call_id = self.request.POST.get('call') call = get_object_or_404(Call, id=call_id) # add simple image to the associated object call.simple_image_assets.add(image) call.save() action_target = call # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('call_detail', args=(call.id,))) elif associated_object == 'Assignment': assignment_id = self.request.POST.get('assignment') assignment = get_object_or_404(Assignment, id=assignment_id) # add simple image to the associated object assignment.simple_image_assets.add(image) assignment.save() action_target = assignment # record action for activity stream action.send(self.request.user, verb="uploaded image", action_object=image, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('assignment_detail', args=(assignment.id,))) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class SimpleImageLibraryAssociateView(LoginRequiredMixin, FormView): """ Add existing simple image(s) in the library to another object.""" form_class = SimpleImageLibraryAssociateForm def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(SimpleImageLibraryAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Process form to associate simple image.""" # get thing that the image is being associated with association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simpleimages = form.cleaned_data['simpleimages'] if association == "organization": organization = Organization.objects.get(id=association_id) organization.simple_image_assets.add(*simpleimages) action.send(self.request.user, verb="added simple images", target=organization) return redirect('org_detail', pk=organization.id) if association == "network": network = Network.objects.get(id=association_id) network.simple_image_assets.add(*simpleimages) action.send(self.request.user, verb="added simple images", target=network) return redirect('network_detail', pk=network.id) if association == "project": project = Project.objects.get(id=association_id) project.simple_image_assets.add(*simpleimages) action.send(self.request.user, verb="added simple images", target=project) return redirect('project_detail', pk=project.id) if association == "task": task = Task.objects.get(id=association_id) task.simple_image_assets.add(*simpleimages) action.send(self.request.user, verb="added simple images", target=task) return redirect('task_detail', pk=task.id) if association == "event": event = Event.objects.get(id=association_id) event.simple_image_assets.add(*simpleimages) action.send(self.request.user, verb="added simple images", target=event) return redirect('event_detail', pk=event.id) class SimpleImageUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific simple asset.""" model = SimpleImage form_class = SimpleImageForm template_name = "editorial/assets/simple_asset_form.html" def usage(self): """Get all facets the simple asset is associated with.""" return self.object.get_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(SimpleImageUpdateView, self).get_success_url() class SimpleImageAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of a simple asset. Assets can only be deleted from the library. """ model = SimpleImage template_name = "editorial/assets/simple_asset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('simple_asset_library', kwargs={'org': self.request.user.organization.id}) class SimpleImageAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove a simple asset from an associated Organization, Network, Project, Story, Task or Event. """ def post(self, request, simpleimage): """ Retrieve facet and image from kwargs and remove image from facet imageasset_set.""" association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simple_image_id = self.kwargs['simpleimage'] simpleimage = SimpleImage.objects.get(id=simple_image_id) if association == 'organization': organization = Organization.objects.get(id=association_id) organization.simple_image_assets.remove(simpleimage) return redirect('org_detail', pk=organization.id) elif association == 'network': network = Network.objects.get(id=association_id) network.simple_image_assets.remove(simpleimage) return redirect('network_detail', pk=network.id) elif association == 'project': project = Project.objects.get(id=association_id) project.simple_image_assets.remove(simpleimage) return redirect('project_detail', pk=project.id) elif association == 'task': task = Task.objects.get(id=association_id) task.simple_image_assets.remove(simpleimage) return redirect('task_detail', pk=task.id) elif association == 'event': event = Event.objects.get(id=association_id) event.simple_image_assets.remove(simpleimage) return redirect('event_detail', pk=event.id) # SAA class SimpleDocumentCreateView(LoginRequiredMixin, CreateView): """Upload a simple document.""" model = SimpleDocument form_class = SimpleDocumentForm def form_valid(self,form): """Save -- but first add owner and org to the document. And then connect the document to whatever object it is associated with. Simple documents can be connected to Projects, Stories, Tasks, Events. Pitches, Calls and Assignments. """ self.object = document = form.save(commit=False) # set request based attributes document.owner = self.request.user if self.request.user.organization: document.organization = self.request.user.organization document.save() # get thing that the document is being associated with associated_object = self.request.POST.get('association') if associated_object == 'project': project_id = self.request.POST.get('project') project = get_object_or_404(Project, id=project_id) # add simple document to the associated object project.simple_document_assets.add(document) project.save() action_target = project # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('project_detail', args=(project.id,))) elif associated_object == 'story': story_id = self.request.POST.get('story') story = get_object_or_404(Story, id=story_id) # add simple document to the associated object story.simple_document_assets.add(document) story.save() action_target = story # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('story_detail', args=(story.id,))) elif associated_object == 'organization': org_id = self.request.POST.get('organization') organization = Organization.objects.get(id=org_id) # add simple document to the associated object organization.simple_document_assets.add(document) organization.save() action_target = organization # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('org_detail', args=(organization.id,))) elif associated_object == 'network': network_id = self.request.POST.get('network') network = Network.objects.get(id=network_id) # add simple document to the associated object network.simple_document_assets.add(document) network.save() action_target = network # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('network_detail', args=(network.id,))) elif associated_object == 'task': task_id = self.request.POST.get('task') task = get_object_or_404(Task, id=task_id) # add simple document to the associated object task.simple_document_assets.add(document) task.save() action_target = task # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('task_detail', args=(task.id,))) elif associated_object == 'event': event_id = self.request.POST.get('event') event = get_object_or_404(Event, id=event_id) # add simple document to the associated object event.simple_document_assets.add(document) event.save() action_target = event # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('event_detail', args=(event.id,))) elif associated_object == 'pitch': pitch_id = self.request.POST.get('pitch') pitch = get_object_or_404(Pitch, id=pitch_id) # add simple document to the associated object pitch.simple_document_assets.add(document) pitch.save() action_target = pitch # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('pitch_detail', args=(pitch.id,))) elif associated_object == 'call': call_id = self.request.POST.get('call') call = get_object_or_404(Call, id=call_id) # add simple document to the associated object call.simple_document_assets.add(document) call.save() action_target = call # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('call_detail', args=(call.id,))) elif associated_object == 'assignment': assignment_id = self.request.POST.get('assignment') assignment = get_object_or_404(Assignment, id=assignment_id) # add simple document to the associated object assignment.simple_document_assets.add(document) assignment.save() action_target = assignment # record action for activity stream action.send(self.request.user, verb="uploaded document", action_object=document, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('assignment_detail', args=(assignment.id,))) class SimpleDocumentUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific simple asset.""" model = SimpleDocument form_class = SimpleDocumentForm template_name = "editorial/assets/simple_asset_form.html" def extension(self): name, extension = os.path.splitext(self.file.name) return extension def usage(self): """Get all facets the simple asset is associated with.""" return self.object.get_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(SimpleDocumentUpdateView, self).get_success_url() class SimpleDocumentAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of a simple asset. Assets can only be deleted from the library. """ model = SimpleDocument template_name = "editorial/assets/simple_asset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('simple_asset_library', kwargs={'org': self.request.user.organization.id}) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class SimpleDocumentLibraryAssociateView(LoginRequiredMixin, FormView): """ Add existing simple document(s) in the library to another object.""" form_class = SimpleDocumentLibraryAssociateForm def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(SimpleDocumentLibraryAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Process form to associate simple document.""" # get thing that the document is being associated with association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simpledocuments = form.cleaned_data['simpledocuments'] if association == "organization": organization = Organization.objects.get(id=association_id) organization.simple_document_assets.add(*simpledocuments) action.send(self.request.user, verb="added simple documents", target=organization) return redirect('org_detail', pk=organization.id) if association == "network": network = Network.objects.get(id=association_id) network.simple_document_assets.add(*simpledocuments) action.send(self.request.user, verb="added simple documents", target=network) return redirect('network_detail', pk=network.id) if association == "project": project = Project.objects.get(id=association_id) project.simple_document_assets.add(*simpledocuments) action.send(self.request.user, verb="added simple documents", target=project) return redirect('project_detail', pk=project.id) if association == "task": task = Task.objects.get(id=association_id) task.simple_document_assets.add(*simpledocuments) action.send(self.request.user, verb="added simple documents", target=task) return redirect('task_detail', pk=task.id) if association == "event": event = Event.objects.get(id=association_id) event.simple_document_assets.add(*simpledocuments) action.send(self.request.user, verb="added simple documents", target=event) return redirect('event_detail', pk=event.id) class SimpleDocumentAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove a simple asset from an associated Organization, Network, Project, Story, Task or Event. """ def post(self, request, simpledocument): """ Retrieve facet and image from kwargs and remove image from facet imageasset_set.""" association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simple_document_id = self.kwargs['simpledocument'] simpledocument = SimpleDocument.objects.get(id=simple_document_id) if association == 'organization': organization = Organization.objects.get(id=association_id) organization.simple_document_assets.remove(simpledocument) return redirect('org_detail', pk=organization.id) elif association == 'network': network = Network.objects.get(id=association_id) network.simple_document_assets.remove(simpledocument) return redirect('network_detail', pk=network.id) elif association == 'project': project = Project.objects.get(id=association_id) project.simple_document_assets.remove(simpledocument) return redirect('project_detail', pk=project.id) elif association == 'task': task = Task.objects.get(id=association_id) task.simple_document_assets.remove(simpledocument) return redirect('task_detail', pk=task.id) elif association == 'event': event = Event.objects.get(id=association_id) event.simple_document_assets.remove(simpledocument) return redirect('event_detail', pk=event.id) # SAA class SimpleAudioCreateView(LoginRequiredMixin, CreateView): """Upload a simple audio.""" model = SimpleAudio form_class = SimpleAudioForm def form_valid(self,form): """Save -- but first add owner and org to the audio. And then connect the audio to whatever object it is associated with. Simple audio can be connected to Projects, Stories, Tasks, Events. Pitches, Calls and Assignments. """ self.object = audio = form.save(commit=False) # set request based attributes audio.owner = self.request.user if self.request.user.organization: audio.organization = self.request.user.organization audio.save() # get thing that the audio is being associated with associated_object = self.request.POST.get('association') if associated_object == 'project': project_id = self.request.POST.get('project') project = get_object_or_404(Project, id=project_id) # add simple audio to the associated object project.simple_audio_assets.add(audio) project.save() action_target = project # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('project_detail', args=(project.id,))) elif associated_object == 'story': story_id = self.request.POST.get('story') story = get_object_or_404(Story, id=story_id) # add simple audio to the associated object story.simple_audio_assets.add(audio) story.save() action_target = story # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('story_detail', args=(story.id,))) elif associated_object == 'task': task_id = self.request.POST.get('task') task = get_object_or_404(Task, id=task_id) # add simple audio to the associated object task.simple_audio_assets.add(audio) task.save() action_target = task # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('task_detail', args=(task.id,))) elif associated_object == 'event': event_id = self.request.POST.get('event') event = get_object_or_404(Event, id=event_id) # add simple audio to the associated object event.simple_audio_assets.add(audio) event.save() action_target = event # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('event_detail', args=(event.id,))) elif associated_object == 'pitch': pitch_id = self.request.POST.get('pitch') pitch = get_object_or_404(Pitch, id=pitch_id) # add simple audio to the associated object pitch.simple_audio_assets.add(audio) pitch.save() action_target = pitch # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('pitch_detail', args=(pitch.id,))) elif associated_object == 'call': call_id = self.request.POST.get('call') call = get_object_or_404(Call, id=call_id) # add simple audio to the associated object call.simple_audio_assets.add(audio) call.save() action_target = call # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('call_detail', args=(call.id,))) elif associated_object == 'assignment': assignment_id = self.request.POST.get('assignment') assignment = get_object_or_404(Assignment, id=assignment_id) # add simple audio to the associated object assignment.simple_audio_assets.add(audio) assignment.save() action_target = assignment # record action for activity stream action.send(self.request.user, verb="uploaded audio", action_object=audio, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('assignment_detail', args=(assignment.id,))) class SimpleAudioUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific simple asset.""" model = SimpleAudio form_class = SimpleAudioForm template_name = "editorial/assets/simple_asset_form.html" def usage(self): """Get all facets the simple asset is associated with.""" return self.object.get_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(SimpleAudioUpdateView, self).get_success_url() class SimpleAudioAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of a simple asset. Assets can only be deleted from the library. """ model = SimpleAudio template_name = "editorial/assets/simple_asset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('simple_asset_library', kwargs={'org': self.request.user.organization.id}) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class SimpleAudioLibraryAssociateView(LoginRequiredMixin, FormView): """ Add existing simple audio(s) in the library to another object.""" form_class = SimpleAudioLibraryAssociateForm template_name = "editorial/assets/_simpleaudio_library.html" def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(SimpleAudioLibraryAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Process form to associate simple audio.""" # get thing that the audio is being associated with association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simpleaudio = form.cleaned_data['simpleaudio'] if association == "organization": organization = Organization.objects.get(id=association_id) organization.simple_audio_assets.add(*simpleaudio) action.send(self.request.user, verb="added simple audios", target=organization) return redirect('org_detail', pk=organization.id) if association == "network": network = Network.objects.get(id=association_id) network.simple_audio_assets.add(*simpleaudio) action.send(self.request.user, verb="added simple audios", target=network) return redirect('network_detail', pk=network.id) if association == "project": project = Project.objects.get(id=association_id) project.simple_audio_assets.add(*simpleaudio) action.send(self.request.user, verb="added simple audios", target=project) return redirect('project_detail', pk=project.id) if association == "task": task = Task.objects.get(id=association_id) task.simple_audio_assets.add(*simpleaudio) action.send(self.request.user, verb="added simple audios", target=task) return redirect('task_detail', pk=task.id) if association == "event": event = Event.objects.get(id=association_id) event.simple_audio_assets.add(*simpleaudio) action.send(self.request.user, verb="added simple audios", target=event) return redirect('event_detail', pk=event.id) class SimpleAudioAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove a simple asset from an associated Organization, Network, Project, Story, Task or Event. """ def post(self, request, simpleaudio): """ Retrieve facet and image from kwargs and remove image from facet imageasset_set.""" association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simple_audio_id = self.kwargs['simpleaudio'] simpleaudio = SimpleAudio.objects.get(id=simple_audio_id) if association == 'organization': organization = Organization.objects.get(id=association_id) organization.simple_audio_assets.remove(simpleaudio) return redirect('org_detail', pk=organization.id) elif association == 'network': network = Network.objects.get(id=association_id) network.simple_audio_assets.remove(simpleaudio) return redirect('network_detail', pk=network.id) elif association == 'project': project = Project.objects.get(id=association_id) project.simple_audio_assets.remove(simpleaudio) return redirect('project_detail', pk=project.id) elif association == 'task': task = Task.objects.get(id=association_id) task.simple_audio_assets.remove(simpleaudio) return redirect('task_detail', pk=task.id) elif association == 'event': event = Event.objects.get(id=association_id) event.simple_audio_assets.remove(simpleaudio) return redirect('event_detail', pk=event.id) # SAA class SimpleVideoCreateView(LoginRequiredMixin, CreateView): """Upload a simple video.""" model = SimpleVideo form_class = SimpleVideoForm def form_valid(self,form): """Save -- but first add owner and org to the video. And then connect the video to whatever object it is associated with. Simple videos can be connected to Projects, Stories, Tasks, Events. Pitches, Calls and Assignments. """ self.object = video = form.save(commit=False) # set request based attributes video.owner = self.request.user if self.request.user.organization: video.organization = self.request.user.organization video.save() # get thing that the video is being associated with associated_object = self.request.POST.get('association') if associated_object == 'project': project_id = self.request.POST.get('project') project = get_object_or_404(Project, id=project_id) # add simple video to the associated object project.simple_video_assets.add(video) project.save() action_target = project # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('project_detail', args=(project.id,))) elif associated_object == 'story': story_id = self.request.POST.get('story') story = get_object_or_404(Story, id=story_id) # add simple video to the associated object story.simple_video_assets.add(video) story.save() action_target = story # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('story_detail', args=(story.id,))) elif associated_object == 'task': task_id = self.request.POST.get('task') task = get_object_or_404(Task, id=task_id) # add simple video to the associated object task.simple_video_assets.add(video) task.save() action_target = task # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('task_detail', args=(task.id,))) elif associated_object == 'event': event_id = self.request.POST.get('event') event = get_object_or_404(Event, id=event_id) # add simple video to the associated object event.simple_video_assets.add(video) event.save() action_target = event # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('event_detail', args=(event.id,))) elif associated_object == 'pitch': pitch_id = self.request.POST.get('pitch') pitch = get_object_or_404(Pitch, id=pitch_id) # add simple video to the associated object pitch.simple_video_assets.add(video) pitch.save() action_target = pitch # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('pitch_detail', args=(pitch.id,))) elif associated_object == 'call': call_id = self.request.POST.get('call') call = get_object_or_404(Call, id=call_id) # add simple video to the associated object call.simple_video_assets.add(video) call.save() action_target = call # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('call_detail', args=(call.id,))) elif associated_object == 'Assignment': assignment_id = self.request.POST.get('assignment') assignment = get_object_or_404(Assignment, id=assignment_id) # add simple video to the associated object assignment.simple_video_assets.add(video) assignment.save() action_target = assignment # record action for activity stream action.send(self.request.user, verb="uploaded video", action_object=video, target=action_target) # redirect to the associated object return HttpResponseRedirect(reverse('assignment_detail', args=(assignment.id,))) class SimpleVideoUpdateView(LoginRequiredMixin, UpdateView): """ Display editable detail information for a specific simple asset.""" model = SimpleVideo form_class = SimpleVideoForm template_name = "editorial/assets/simple_asset_form.html" def usage(self): """Get all facets the simple asset is associated with.""" return self.object.get_usage() def get_success_url(self): """Record edit activity for activity stream.""" action.send(self.request.user, verb="edited", action_object=self.object) return super(SimpleVideoUpdateView, self).get_success_url() class SimpleVideoAssetDeleteView(LoginRequiredMixin, FormMessagesMixin, DeleteView): """View for handling deletion of a simple asset. Assets can only be deleted from the library. """ model = SimpleVideo template_name = "editorial/assets/simple_asset_delete.html" form_valid_message = "Deleted." form_invalid_message = "Please check form." def get_success_url(self): """Post deletion return to the media library.""" return reverse('simple_asset_library', kwargs={'org': self.request.user.organization.id}) # ACCESS: Any org user should be able to add an asset for a P, Sr, St, F # A user from an organization that is in collaborate_with or # contractors should not be able to do this because doing so requires access to # an org's entire asset library. class SimpleVideoLibraryAssociateView(LoginRequiredMixin, FormView): """ Add existing simple video(s) in the library to another object.""" form_class = SimpleVideoLibraryAssociateForm template_name = "editorial/assets/_simplevideo_library.html" def get_form_kwargs(self): """Pass some initial things to scaffold form.""" kwargs = super(SimpleVideoLibraryAssociateView, self).get_form_kwargs() kwargs['organization'] = self.request.user.organization return kwargs def form_valid(self, form): """Process form to associate simple video.""" # get thing that the video is being associated with association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simplevideo = form.cleaned_data['simplevideo'] if association == "organization": organization = Organization.objects.get(id=association_id) organization.simple_video_assets.add(*simplevideo) action.send(self.request.user, verb="added simple videos", target=organization) return redirect('org_detail', pk=organization.id) if association == "network": network = Network.objects.get(id=association_id) network.simple_video_assets.add(*simplevideo) action.send(self.request.user, verb="added simple videos", target=network) return redirect('network_detail', pk=network.id) if association == "project": project = Project.objects.get(id=association_id) project.simple_video_assets.add(*simplevideo) action.send(self.request.user, verb="added simple videos", target=project) return redirect('project_detail', pk=project.id) if association == "task": task = Task.objects.get(id=association_id) task.simple_video_assets.add(*simplevideo) action.send(self.request.user, verb="added simple videos", target=task) return redirect('task_detail', pk=task.id) if association == "event": event = Event.objects.get(id=association_id) event.simple_video_assets.add(*simplevideo) action.send(self.request.user, verb="added simple videos", target=event) return redirect('event_detail', pk=event.id) class SimpleVideoAssetDisassociateView(LoginRequiredMixin, View): """ Process form to remove a simple asset from an associated Organization, Network, Project, Story, Task or Event. """ def post(self, request, simplevideo): """ Retrieve facet and image from kwargs and remove image from facet imageasset_set.""" association = self.request.POST.get('association') association_id = self.request.POST.get('association_id') simple_video_id = self.kwargs['simplevideo'] simplevideo = SimpleVideo.objects.get(id=simple_video_id) if association == 'organization': organization = Organization.objects.get(id=association_id) organization.simple_video_assets.remove(simplevideo) return redirect('org_detail', pk=organization.id) elif association == 'network': network = Network.objects.get(id=association_id) network.simple_video_assets.remove(simplevideo) return redirect('network_detail', pk=network.id) elif association == 'project': project = Project.objects.get(id=association_id) project.simple_video_assets.remove(simplevideo) return redirect('project_detail', pk=project.id) elif association == 'task': task = Task.objects.get(id=association_id) task.simple_video_assets.remove(simplevideo) return redirect('task_detail', pk=task.id) elif association == 'event': event = Event.objects.get(id=association_id) event.simple_video_assets.remove(simplevideo) return redirect('event_detail', pk=event.id)
44.094012
134
0.65573
8,443
73,637
5.597655
0.036125
0.039335
0.033326
0.030215
0.868602
0.821629
0.804194
0.78149
0.735871
0.691458
0
0.002017
0.246045
73,637
1,669
135
44.120431
0.849241
0.252781
0
0.667022
0
0
0.0975
0.023234
0
0
0
0.000599
0
1
0.071505
false
0
0.009605
0
0.372465
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
b7824f342407eca9c1f2c355f6724948a4dc8719
98
py
Python
terrascript/local/__init__.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
terrascript/local/__init__.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
terrascript/local/__init__.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
# terrascript/local/__init__.py import terrascript class local(terrascript.Provider): pass
12.25
34
0.77551
11
98
6.545455
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.142857
98
7
35
14
0.857143
0.295918
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6
b784c4b383c6a462a8068e02563abf3756b58103
13,495
py
Python
PythonAPI/examples/TestBench/Environments/Assertions_case_study.py
TSL-UOB/CAV-Game
056e39992dd1431cb324c1fa336e91a1172b26a7
[ "MIT" ]
null
null
null
PythonAPI/examples/TestBench/Environments/Assertions_case_study.py
TSL-UOB/CAV-Game
056e39992dd1431cb324c1fa336e91a1172b26a7
[ "MIT" ]
null
null
null
PythonAPI/examples/TestBench/Environments/Assertions_case_study.py
TSL-UOB/CAV-Game
056e39992dd1431cb324c1fa336e91a1172b26a7
[ "MIT" ]
null
null
null
import random import numpy as np from Agents.pedestrian import pedestrian from Agents.vehicle import vehicle from TB_common_functions import log, calculateDistance # from Agents.traffic_light import traffic_light def interpolate_path(path_tuple, increments_resolution): path_tuple_interpolated = [] path_tuple_interpolated.append(path_tuple[0]) for i in range(len(path_tuple)-1): diff = abs(np.subtract(path_tuple[i], path_tuple[i+1])) dist = np.hypot(diff[0],diff[1]) if dist > increments_resolution: num_points_remainder = dist%increments_resolution num_points = int(np.ceil((dist - num_points_remainder)/increments_resolution)) + 1 if num_points_remainder > 0: num_points = num_points + 1 x = np.linspace(path_tuple[i][0], path_tuple[i+1][0], num_points) x = x[1:] x = [round(num, 1) for num in x] y = np.linspace(path_tuple[i][1], path_tuple[i+1][1], num_points) y = y[1:] y = [round(num, 1) for num in y] interolated_points = list(zip(x, y)) path_tuple_interpolated = path_tuple_interpolated + interolated_points # print(path_tuple_interpolated) return(path_tuple_interpolated) # ================================================================================================================================================= # Overtaking # ================================================================================================================================================= class Assertions_case_study_overtaking(): def __init__(self,world): # self.actors_list = [] # self.veh1 = vehicle(1) # self.veh2 = vehicle(2) # self.veh3 = vehicle(3) # self.actors_list.append(self.veh1) # self.actors_list.append(self.veh2) # self.actors_list.append(self.veh3) self.spawn_height = 8 self.tests_ended = False self.world = world self.logging_time_increment = 0.1 self.tests_logs = log(self.logging_time_increment) self.i = 0 def set(self): self.actors_list = [] self.veh1 = vehicle(1) self.veh2 = vehicle(2) self.veh3 = vehicle(3) self.actors_list.append(self.veh1) self.actors_list.append(self.veh2) self.actors_list.append(self.veh3) self.test_ended = False self.tests_logs = log(self.logging_time_increment) # spawn(self,x,y,z,yaw): # Setting Veh 1 # self.veh1_path = [[-6.44,-42.19],[-2.94,-61.59],[-6.44,-79.05]] self.veh1_path = [(-368.2,209.8),(-342.6,197.1),(-334.4,197.1),(-317.9,189.1),(-314.5,183.3),(-280.1,166.3)] self.veh2_path = [[-328.4,190.3]] # self.veh3_path = [(-242.3,151.6),(-365.6,212.7)] # Safe Trajectory # self.veh3_path = [(-258.6,159.4),(-365.6,212.7)] # Near miss Trajectory # self.veh3_path = [(-279.0,169.4),(-365.6,212.7)] # Crash Trajectory # self.veh3_path = [(-302.0,181.4),(-365.6,212.7)] # Ending Interolation Trajectory if self.i == 0: # Creating several paths for contious runs veh3_path_series_start = [-242.3, 151.6] # Start of Trajectory series for vehicle with varying starting point veh3_path_series_end = [-322.6, 191.2] # End of Trajectory series for vehicle with varying starting point step = 5 self.timeout_thresh = 32 x = [-veh3_path_series_start[0], -veh3_path_series_end[0]] x_new = np.arange(x[0],x[1],step) y = [veh3_path_series_start[1], veh3_path_series_end[1]] self.y_new = np.interp(x_new, x, y) self.y_new = np.append(self.y_new,veh3_path_series_end[1]) self.x_new = x_new * -1 self.x_new = np.append(self.x_new,veh3_path_series_end[0]) self.veh3_path = [(self.x_new[self.i],self.y_new[self.i]),(-365.6,212.7)] self.i = self.i + 1 if self.i == len(self.x_new): self.tests_ended = True # interpolate path(s) interpolation_resolution_min = 1 self.veh1_path_interpolated = interpolate_path(self.veh1_path, interpolation_resolution_min) self.veh2_path_interpolated = interpolate_path(self.veh2_path, interpolation_resolution_min) self.veh3_path_interpolated = interpolate_path(self.veh3_path, interpolation_resolution_min) self.veh1.set_path(self.veh1_path_interpolated) self.veh2.set_path(self.veh3_path_interpolated) self.veh3.set_path(self.veh3_path_interpolated) self.veh1.spawn(self.veh1_path[0][0],self.veh1_path[0][1], self.spawn_height, -25) self.veh2.spawn(self.veh2_path[0][0],self.veh2_path[0][1], self.spawn_height, -25) self.veh3.spawn(self.veh3_path[0][0],self.veh3_path[0][1], self.spawn_height, 155) # self.veh1_speed = 5 # self.veh2_speed = 0 # self.veh3_speed = 5 def step(self): self.veh1.step() self.veh2.step() self.veh3.step() self.veh2.stop = True # Log t = self.world.get_snapshot().timestamp.elapsed_seconds fps = 1 / (self.world.get_snapshot().timestamp.frame_count) self.tests_logs.append(0,0,self.actors_list,t,fps) if self.tests_logs.time_array[-1] >= self.timeout_thresh: self.test_ended = True pass def destroy(self): self.veh1.destroy() self.veh2.destroy() self.veh3.destroy() self.tests_logs.write_file("Overtaking_TestID"+str(self.i)+".txt") # self.tests_logs.write_file("AssertionCheckingCaseStudyLogs_NearMiss.txt") # self.tests_logs.write_file("AssertionCheckingCaseStudyLogs_Crash.txt") pass # ================================================================================================================================================= # Left turn at intersection # ================================================================================================================================================= class Assertions_case_study_left_turn_at_intersection(): def __init__(self,world): self.spawn_height = 8 self.tests_ended = False self.world = world self.logging_time_increment = 0.1 self.tests_logs = log(self.logging_time_increment) self.i = 0 def set(self): self.actors_list = [] self.veh1 = vehicle(1) # vehicle going straight self.veh2 = vehicle(2) # vehicle turning left self.actors_list.append(self.veh1) self.actors_list.append(self.veh2) self.test_ended = False self.tests_logs = log(self.logging_time_increment) # spawn(self,x,y,z,yaw): # Setting Veh 1 # self.veh1_path = [[-6.44,-42.19],[-2.94,-61.59],[-6.44,-79.05]] # self.veh1_path = [(-368.2,209.8),(-342.6,197.1),(-334.4,197.1),(-317.9,189.1),(-314.5,183.3),(-280.1,166.3)] self.veh2_path = [[-288.7,144.1], [-285.20,152.10], [-281.60,159.20],[-278.90,163.50], [-275.70,164.40], [-243.60,148.80]] # self.veh3_path = [(-242.3,151.6),(-365.6,212.7)] # Safe Trajectory # self.veh3_path = [(-258.6,159.4),(-365.6,212.7)] # Near miss Trajectory # self.veh3_path = [(-279.0,169.4),(-365.6,212.7)] # Crash Trajectory # self.veh3_path = [(-302.0,181.4),(-365.6,212.7)] # Ending Interolation Trajectory if self.i == 0: # Creating several paths for contious runs veh1_path_series_start = [-310.30, 181.50] # Start of Trajectory series for vehicle with varying starting point veh1_path_series_end = [-286.10, 170.00] # End of Trajectory series for vehicle with varying starting point step = 2 self.timeout_thresh = 10 x = [veh1_path_series_start[0], veh1_path_series_end[0]] print("x[0] = ",x[0]) print("x[1] = ",x[1]) print("step = ",step) x_new = np.arange(x[0],x[1],step) y = [veh1_path_series_start[1], veh1_path_series_end[1]] self.y_new = np.interp(x_new, x, y) self.y_new = np.append(self.y_new,veh1_path_series_end[1]) self.x_new = x_new #* -1 self.x_new = np.append(self.x_new,veh1_path_series_end[0]) self.veh1_path = [(self.x_new[self.i],self.y_new[self.i]),(-254.30, 153.70)] self.i = self.i + 1 if self.i == len(self.x_new): self.tests_ended = True print("i",self.i) print("self.x_new",self.x_new) print("length of x_new",len(self.x_new)) # interpolate path(s) interpolation_resolution_min = 1 self.veh1_path_interpolated = interpolate_path(self.veh1_path, interpolation_resolution_min) self.veh2_path_interpolated = interpolate_path(self.veh2_path, interpolation_resolution_min) # self.veh3_path_interpolated = interpolate_path(self.veh3_path, interpolation_resolution_min) self.veh1.set_path(self.veh1_path_interpolated) self.veh2.set_path(self.veh2_path_interpolated) # self.veh3.set_path(self.veh3_path_interpolated) self.veh1.spawn(self.veh1_path[0][0],self.veh1_path[0][1], self.spawn_height, -25) self.veh2.spawn(self.veh2_path[0][0],self.veh2_path[0][1], self.spawn_height, 65) # self.veh3.spawn(self.veh3_path[0][0],self.veh3_path[0][1], self.spawn_height, 155) # self.veh1_speed = 5 # self.veh2_speed = 0 # self.veh3_speed = 5 def step(self): self.veh1.step() self.veh2.step() # self.veh3.step() self.veh2.stop = False # Log t = self.world.get_snapshot().timestamp.elapsed_seconds fps = 1 / (self.world.get_snapshot().timestamp.frame_count) self.tests_logs.append(0,0,self.actors_list,t,fps) if self.tests_logs.time_array[-1] >= self.timeout_thresh: self.test_ended = True pass def destroy(self): self.veh1.destroy() self.veh2.destroy() # self.veh3.destroy() self.tests_logs.write_file("Left_Turn_At_Intersection_TestID"+str(self.i)+".txt") # self.tests_logs.write_file("AssertionCheckingCaseStudyLogs_NearMiss.txt") # self.tests_logs.write_file("AssertionCheckingCaseStudyLogs_Crash.txt") pass # ================================================================================================================================================= # Right turn at intersection, pedestrian crossing # (pedestrian replaced by vehicle due to map needs upadating to match carla udates) # ================================================================================================================================================= class Assertions_case_study_right_turn_at_intersection_pedestrian_crossing(): def __init__(self,world): self.spawn_height = 8 self.tests_ended = False self.world = world self.logging_time_increment = 0.1 self.tests_logs = log(self.logging_time_increment) self.i = 0 def set(self): self.actors_list = [] self.veh1 = vehicle(1) # vehicle turning right self.ped1 = vehicle(2)#pedestrian(2,"adult") # pedestrian crossing zebra line self.ped1.vehicle_speed = 1.5 self.actors_list.append(self.veh1) self.actors_list.append(self.ped1) self.test_ended = False self.tests_logs = log(self.logging_time_increment) # spawn(self,x,y,z,yaw): # Setting Veh 1 self.veh1_path = [[-284.20,153.90], [-279.50,162.90], [-278.40,166.50], [-279.80,170.10],[-323.50,192.20]] # Setting Ped 1 if self.i == 0: # Creating several paths for contious runs ped1_path_series_start = [-283.90, 176.50] # Start of Trajectory series for pedestrian with varying starting point ped1_path_series_end = [-295.80,182.10] # End of Trajectory series for pedestrian with varying starting point step = 2 self.timeout_thresh = 30 x = [-ped1_path_series_start[0], -ped1_path_series_end[0]] print("x[0] = ",x[0]) print("x[1] = ",x[1]) print("step = ",step) x_new = np.arange(x[0],x[1],step) print("x_new = ",x_new) y = [ped1_path_series_start[1], ped1_path_series_end[1]] self.y_new = np.interp(x_new, x, y) self.y_new = np.append(self.y_new,ped1_path_series_end[1]) self.x_new = x_new * -1 self.x_new = np.append(self.x_new,ped1_path_series_end[0]) self.ped1_path = [(self.x_new[self.i],self.y_new[self.i]),(-295.80,182.10), (-300.50,172.50), (-288.30,165.70)] # self.ped1_path = [[-279.80,170.10], [-310.50,185.40]] self.i = self.i + 1 if self.i == len(self.x_new): self.tests_ended = True print("i",self.i) print("self.x_new",self.x_new) print("length of x_new",len(self.x_new)) # interpolate path(s) interpolation_resolution_min = 1 self.veh1_path_interpolated = interpolate_path(self.veh1_path, interpolation_resolution_min) self.ped1_path_interpolated = interpolate_path(self.ped1_path, interpolation_resolution_min) # self.veh3_path_interpolated = interpolate_path(self.veh3_path, interpolation_resolution_min) self.veh1.set_path(self.veh1_path_interpolated) self.ped1.set_path(self.ped1_path_interpolated) # self.veh3.set_path(self.veh3_path_interpolated) self.veh1.spawn(self.veh1_path[0][0],self.veh1_path[0][1], self.spawn_height, 65) self.ped1.spawn(self.ped1_path[0][0],self.ped1_path[0][1], self.spawn_height, -115) # self.veh3.spawn(self.veh3_path[0][0],self.veh3_path[0][1], self.spawn_height, 155) # self.veh1_speed = 5 # self.veh2_speed = 0 # self.veh3_speed = 5 def step(self): self.veh1.step() self.ped1.step() # self.veh3.step() # Log t = self.world.get_snapshot().timestamp.elapsed_seconds fps = 1 / (self.world.get_snapshot().timestamp.frame_count) self.tests_logs.append(0,0,self.actors_list,t,fps) if self.tests_logs.time_array[-1] >= self.timeout_thresh: self.test_ended = True pass def destroy(self): self.veh1.destroy() self.ped1.destroy() # self.veh3.destroy() self.tests_logs.write_file("Right_turn_at_intersection_pedestrian_crossing_TestID"+str(self.i)+".txt") # self.tests_logs.write_file("AssertionCheckingCaseStudyLogs_NearMiss.txt") # self.tests_logs.write_file("AssertionCheckingCaseStudyLogs_Crash.txt") pass
37.074176
147
0.651056
2,033
13,495
4.099852
0.117068
0.042232
0.035993
0.023995
0.808278
0.778044
0.742651
0.742172
0.740972
0.717696
0
0.072915
0.145313
13,495
364
148
37.074176
0.649731
0.327899
0
0.601896
0
0
0.024059
0.009468
0
0
0
0
0.014218
1
0.061611
false
0.028436
0.023697
0
0.099526
0.061611
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
b7ad3470270ff297ac3f90d5f7008b62cee6b81e
6,262
py
Python
tests/test_coptmod.py
dsei210s19-applied-ml-and-dm/OPTMOD
85edea79284097cfaeeaa8eb0be3c9595b4a733f
[ "BSD-2-Clause" ]
3
2019-02-14T23:45:06.000Z
2019-08-23T19:20:31.000Z
tests/test_coptmod.py
dsei210s19-applied-ml-and-dm/OPTMOD
85edea79284097cfaeeaa8eb0be3c9595b4a733f
[ "BSD-2-Clause" ]
21
2019-01-17T07:30:42.000Z
2020-04-11T18:26:43.000Z
tests/test_coptmod.py
dsei210s19-applied-ml-and-dm/OPTMOD
85edea79284097cfaeeaa8eb0be3c9595b4a733f
[ "BSD-2-Clause" ]
1
2022-01-21T23:56:42.000Z
2022-01-21T23:56:42.000Z
import optmod import unittest import numpy as np class TestCoptmod(unittest.TestCase): def test_module(self): c = optmod.coptmod self.assertTrue(hasattr(c, 'Evaluator')) self.assertListEqual([c.NODE_TYPE_UNKNOWN, c.NODE_TYPE_CONSTANT, c.NODE_TYPE_VARIABLE, c.NODE_TYPE_ADD, c.NODE_TYPE_SUBTRACT, c.NODE_TYPE_NEGATE, c.NODE_TYPE_MULTIPLY, c.NODE_TYPE_SIN, c.NODE_TYPE_COS], list(range(9))) def test_evaluator_construct(self): x = optmod.VariableScalar(name='x', value=3.) y = optmod.VariableScalar(name='y', value=4.) f = 4*(x + 1) + optmod.sin(-y) E = optmod.coptmod.Evaluator(2, 20) self.assertEqual(E.max_nodes, 20) self.assertEqual(E.num_nodes, 0) self.assertEqual(E.num_inputs, 2) self.assertEqual(E.num_outputs, 20) self.assertTupleEqual(E.shape, (1, 20)) self.assertFalse(E.scalar_output) f.__fill_evaluator__(E) self.assertEqual(E.max_nodes, 20) self.assertEqual(E.num_nodes, 8) self.assertEqual(E.num_inputs, 2) self.assertEqual(E.num_outputs, 20) f = 4*x + y + 10 + 2*(x+y) E = optmod.coptmod.Evaluator(2, 20) self.assertEqual(E.max_nodes, 20) self.assertEqual(E.num_nodes, 0) self.assertEqual(E.num_inputs, 2) self.assertEqual(E.num_outputs, 20) self.assertTupleEqual(E.shape, (1, 20)) self.assertFalse(E.scalar_output) f.__fill_evaluator__(E) self.assertEqual(E.max_nodes, 20) self.assertEqual(E.num_nodes, 9) self.assertEqual(E.num_inputs, 2) self.assertEqual(E.num_outputs, 20) def test_evaluator_dynamic_resize(self): x = optmod.VariableScalar(name='x', value=3.) y = optmod.VariableScalar(name='y', value=4.) f = 4*(x + 1) + optmod.sin(-y) E = optmod.coptmod.Evaluator(2, 5) self.assertEqual(E.max_nodes, 5) self.assertEqual(E.num_nodes, 0) self.assertEqual(E.num_inputs, 2) self.assertEqual(E.num_outputs, 5) self.assertTupleEqual(E.shape, (1, 5)) self.assertFalse(E.scalar_output) f.__fill_evaluator__(E) self.assertEqual(E.max_nodes, 10) self.assertEqual(E.num_nodes, 8) self.assertEqual(E.num_inputs, 2) self.assertEqual(E.num_outputs, 5) def test_evaluator_eval_single_output(self): x = optmod.VariableScalar(name='x', value=3.) y = optmod.VariableScalar(name='y', value=4.) # var f = x e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([5.]) self.assertEqual(e.get_value(), 5.) # constant f = optmod.constant.Constant(11.) e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([5.]) self.assertEqual(e.get_value(), 11.) # add f = x + 3 e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([9.]) self.assertEqual(e.get_value(), 12.) # sub f = x - 3 e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([9.]) self.assertEqual(e.get_value(), 6.) # negate f = -(x+10.) e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([9.]) self.assertEqual(e.get_value(), -19.) # multiply f = y*(x + 3) e = optmod.coptmod.Evaluator(2, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_input_var(1, id(y)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([9., -20.]) self.assertEqual(e.get_value(), -20.*(9.+3.)) # sin f = optmod.sin(x + 3) e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([9.]) self.assertEqual(e.get_value(), np.sin(12.)) # cos f = optmod.cos(3*y) e = optmod.coptmod.Evaluator(1, 1, scalar_output=True) f.__fill_evaluator__(e) e.set_input_var(0, id(y)) e.set_output_node(0, id(f)) self.assertEqual(e.get_value(), 0.) e.eval([5.]) self.assertEqual(e.get_value(), np.cos(15.)) def test_evaluator_eval_multi_output(self): x = optmod.VariableScalar(name='x', value=3.) y = optmod.VariableScalar(name='y', value=4.) # var f1 = 3*(x+optmod.sin(y)) f2 = optmod.sum([x,y]) e = optmod.coptmod.Evaluator(2, 2) f1.__fill_evaluator__(e) f2.__fill_evaluator__(e) e.set_input_var(0, id(x)) e.set_input_var(1, id(y)) e.set_output_node(0, id(f1)) e.set_output_node(1, id(f2)) val = e.get_value() self.assertTupleEqual(val.shape, (1,2)) self.assertTrue(isinstance(val, np.matrix)) e.eval([5., 8.]) val = e.get_value() self.assertAlmostEqual(val[0,0], 3.*(5.+np.sin(8.))) self.assertAlmostEqual(val[0,1], 5.+8.)
31.94898
62
0.55206
858
6,262
3.805361
0.100233
0.183767
0.196018
0.104747
0.779479
0.746095
0.737213
0.728943
0.728943
0.728943
0
0.038728
0.30725
6,262
195
63
32.112821
0.713923
0.007665
0
0.610738
0
0
0.00274
0
0
0
0
0
0.348993
1
0.033557
false
0
0.020134
0
0.060403
0
0
0
0
null
0
1
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
b7af6b4e882749dd157956056ef4d906b8bbfd1e
36
py
Python
r7insight/__init__.py
ErichMoraga/r7insight_python
fef0efad33471d216455b23cbac4885b38ac040d
[ "MIT" ]
2
2021-02-05T16:49:47.000Z
2022-01-27T16:28:53.000Z
r7insight/__init__.py
ErichMoraga/r7insight_python
fef0efad33471d216455b23cbac4885b38ac040d
[ "MIT" ]
null
null
null
r7insight/__init__.py
ErichMoraga/r7insight_python
fef0efad33471d216455b23cbac4885b38ac040d
[ "MIT" ]
7
2019-01-03T02:45:56.000Z
2021-01-13T11:58:33.000Z
from .utils import R7InsightHandler
18
35
0.861111
4
36
7.75
1
0
0
0
0
0
0
0
0
0
0
0.03125
0.111111
36
1
36
36
0.9375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
4d07c6cde7e8d39d03410963619451a914c5169e
42
py
Python
depConfusionTest/__init__.py
Moneypulation/depConfusionTest
79af71366e2e613d991df4dac2429805df0f1dc6
[ "MIT" ]
null
null
null
depConfusionTest/__init__.py
Moneypulation/depConfusionTest
79af71366e2e613d991df4dac2429805df0f1dc6
[ "MIT" ]
null
null
null
depConfusionTest/__init__.py
Moneypulation/depConfusionTest
79af71366e2e613d991df4dac2429805df0f1dc6
[ "MIT" ]
null
null
null
from depConfusionTest.foo import foo123
42
42
0.833333
5
42
7
1
0
0
0
0
0
0
0
0
0
0
0.083333
0.142857
42
1
42
42
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
4d91736a55855f7981c33ab197e516d81f3b79f6
107
py
Python
UniSim/unisim/config.py
RDC4Smart-Mobility/UniSim
872a22ccdac859b9a12f11a9f5d20467e9db18ee
[ "MIT" ]
null
null
null
UniSim/unisim/config.py
RDC4Smart-Mobility/UniSim
872a22ccdac859b9a12f11a9f5d20467e9db18ee
[ "MIT" ]
null
null
null
UniSim/unisim/config.py
RDC4Smart-Mobility/UniSim
872a22ccdac859b9a12f11a9f5d20467e9db18ee
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import, unicode_literals
35.666667
82
0.775701
13
107
5.846154
0.923077
0
0
0
0
0
0
0
0
0
0
0.010526
0.11215
107
2
83
53.5
0.789474
0.196262
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
1
0
6
4de58a778587b8d616e320e2ec59025e9d18e542
45
py
Python
tests/basic/while.py
treeform/pystorm
3a2224bcdaccc5a2abf6a820c0bcf7afa3e6fed4
[ "MIT" ]
50
2015-03-24T19:45:34.000Z
2022-02-20T04:34:26.000Z
tests/basic/while.py
MoonStarCZW/py2js
6cda2b1d3cf281a5ca92c18b08ac9fa1c389cbea
[ "MIT" ]
2
2017-02-26T09:43:07.000Z
2017-03-06T20:04:24.000Z
tests/flow/while.py
Slater-Victoroff/pyjaco
89c4e3c46399c5023b0e160005d855a01241c58a
[ "MIT" ]
12
2016-03-07T09:30:49.000Z
2021-09-05T20:38:47.000Z
x = 1 while x<10: print x x = x + 1
7.5
13
0.422222
10
45
1.9
0.5
0.210526
0
0
0
0
0
0
0
0
0
0.166667
0.466667
45
5
14
9
0.625
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.25
1
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
6
12a7b8352b96cc6ee5a68e7b856b729ad82b07d2
25,483
py
Python
galpopfm/dustfm.py
IQcollaboratory/galpopFM
1b30abc1cc2fd1119d0f34a237b0c1112d7afc9d
[ "MIT" ]
1
2020-02-08T17:36:06.000Z
2020-02-08T17:36:06.000Z
galpopfm/dustfm.py
IQcollaboratory/galpopFM
1b30abc1cc2fd1119d0f34a237b0c1112d7afc9d
[ "MIT" ]
35
2020-02-07T19:02:27.000Z
2021-02-04T14:28:05.000Z
galpopfm/dustfm.py
IQcollaboratory/galpopFM
1b30abc1cc2fd1119d0f34a237b0c1112d7afc9d
[ "MIT" ]
null
null
null
''' foward modeling dust with empirical prescriptions for assigning attenuation curves for forward modeled galaxies ''' import numpy as np from scipy.stats import truncnorm def Attenuate(theta, lam, spec_noneb, spec_neb, logmstar, logsfr, dem='slab_calzetti'): ''' DEM attenuation wrapper. Imposes the following attenuation Fo = Fi^star * 10^{-0.4 A(lambda)} + Fi^neb * 10^{-0.4 A_neb(lambda)} A_neb = f_neb x A(lambda) :param theta: 8 free parameter of the slab + Noll+(2009) model theta: m_tau1 m_tau2 c_tau m_delta1 m_delta2 c_delta m_E c_E f_nebular :param lam: wavelength in angstrom :param spec_noneb: sed without nebular emission lines :param spec_neb: sed with emission lines :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param dem: string specifying the name of DEM ''' nspec = spec_noneb.shape[0] assert spec_neb.shape[0] == nspec nwave = lam.shape[0] assert spec_neb.shape[1] == nwave assert spec_noneb.shape[1] == nwave assert logmstar.shape[0] == nspec assert logsfr.shape[0] == nspec if dem == 'slab_calzetti': mdust = DEM_slabcalzetti elif dem == 'slab_noll_m': mdust = DEM_slab_noll_m elif dem == 'slab_noll_msfr': mdust = DEM_slab_noll_msfr elif dem == 'slab_noll_simple': mdust = DEM_slab_noll_simple elif dem == 'tnorm_noll_msfr': mdust = DEM_tnorm_noll_msfr elif dem == 'slab_noll_msfr_fixbump': mdust = DEM_slab_noll_msfr_fixbump elif dem == 'tnorm_noll_msfr_fixbump': mdust = DEM_tnorm_noll_msfr_fixbump elif dem == 'slab_noll_msfr_kink_fixbump': mdust = DEM_slab_noll_msfr_kink_fixbump elif dem == 'slab_noll_mssfr_fixbump': mdust = DEM_slab_noll_mssfr_fixbump else: raise NotImplementedError if dem in ['slab_noll_msfr_fixbump', 'slab_noll_mssfr_fixbump']: spec_dusty = mdust(theta, lam, spec_noneb, logmstar, logsfr) else: # apply attenuation curve to spectra without nebular emissoin spec_noneb_dusty = mdust(theta, lam, spec_noneb, logmstar, logsfr, nebular=False) spec_neb_dusty = mdust(theta, lam, spec_neb, logmstar, logsfr, nebular=True) spec_dusty = spec_noneb_dusty + spec_neb_dusty return spec_dusty def DEM_slab_noll_mssfr_fixbump(theta, lam, flux_i, logmstar, logsfr, incl=None): ''' Dust empirical model that combines the slab model with Noll+(2009) but keeps the **UV bump relation to delta fixed** This model is a function of SSFR not SFR. A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta tauV = m_tau1 (log M* - 10.) + m_tau2 (logSSFR + 10) + c_tau delta = m_delta1 (log M* - 10.) + m_delta2 (logSSFR + 10) + c_delta -2.2 < delta < 0.4 E_b = -1.9 * delta + 0.85 (Kriek & Conroy 2013) :param theta: 6 free parameter of the slab + Noll+(2009) model theta: m_tau1 m_tau2 c_tau m_delta1 m_delta2 c_delta :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. Notes ----- * 12/23/2020: cos(inclination) rather than inclination should be uniformly sampled from 0 to 1. See http://keatonb.github.io/archivers/uniforminclination for explanation ''' assert theta.shape[0] == 6, print(theta) logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) logssfr = logsfr - logmstar # ssfr zerosfr = (logsfr == -999.) _logmstar = logmstar[~zerosfr] _logssfr = logssfr[~zerosfr] tauV = np.clip(theta[0] * (_logmstar - 10.) + theta[1] * (_logssfr + 10.) + theta[2], 1e-3, None) delta = theta[3] * (_logmstar - 10.) + theta[4] * (_logssfr + 10.) + theta[5] # Kriek & Conroy (2013) E_b = -1.9 * delta + 0.85 # Narayanan+(2018) # E_b = -0.46 * delta + 0.69 if incl is None: # defunct: randomly sample the inclinatiion angle from 0 - pi/2 # defunct: incl = np.random.uniform(0., 0.5*np.pi, size=_logmstar.shape[0]) # randomly sample cos(incl) from [0, 1] cosi = np.random.uniform(0, 1, size=_logmstar.shape[0]) else: cosi = np.cos(incl) sec_incl = 1./cosi #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.all(np.isfinite(A_V)) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b[:,None] * ((lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2)) # calzetti is already normalized to k_V A_lambda = A_V[:,None] * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta[:,None] _T_lam = 10.0**(-0.4 * A_lambda) T_lam = np.ones((len(logmstar), len(lam))) T_lam[~zerosfr] = _T_lam return flux_i * T_lam def DEM_slab_noll_msfr_kink_fixbump(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' Dust empirical model that combines the slab model with Noll+(2009) but keeps the **UV bump relation to delta fixed** A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta tauV = m_tau,M* (log M* - 10.) + m_tau,SFR logSFR + c_tau except m_tau,M* = m_tau,M*0 for log M* < 10 m_tau,M* = m_tau,M*1 for log M* > 10 m_tau,SFR = m_tau,SFR0 for log SFR < 0 m_tau,SFR = m_tau,SFR1 for log SFR > 0 delta = m_delta1 (log M* - 10.) + m_delta2 logSFR + c_delta -2.2 < delta < 0.4 E_b = -1.9 * delta + 0.85 (Kriek & Conroy 2013) :param theta: 9 free parameter of the slab + Noll+(2009) model theta: m_tau,M*0 m_tau,M*1 m_tau,SFR0 m_tau,SFR1 c_tau m_delta1 m_delta2 c_delta f_nebular :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 9, print(theta) if isinstance(logsfr, float): if logsfr == -999.: raise ValueError else: if -999. in logsfr: raise ValueError logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) # get m_tau, M* lowmass = (logmstar < 10.) m_tauMs = np.repeat(theta[1], logmstar.shape[0]) m_tauMs[lowmass] = theta[0] # get m_tau, SFR lowsfr = (logsfr < 0.) m_tauSFRs = np.repeat(theta[3], logmstar.shape[0]) m_tauSFRs[lowsfr] = theta[2] tauV = np.clip(m_tauMs * (logmstar - 10.) + m_tauSFRs * logsfr + theta[4], 1e-3, None) delta = theta[5] * (logmstar - 10.) + theta[6] * logsfr + theta[7] # Kriek & Conroy (2013) E_b = -1.9 * delta + 0.85 # Narayanan+(2018) # E_b = -0.46 * delta + 0.69 # randomly sample the inclinatiion angle from 0 - pi/2 incl = np.random.uniform(0., 0.5*np.pi, size=logmstar.shape[0]) sec_incl = 1./np.cos(incl) #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.all(np.isfinite(A_V)), print(tauV, logmstar, logsfr) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b[:,None] * ((lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2)) # calzetti is already normalized to k_V A_lambda = A_V[:,None] * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta[:,None] if not nebular: factor = 1. else: factor = theta[8] T_lam = 10.0**(-0.4 * A_lambda * factor) return flux_i * T_lam def DEM_slab_noll_msfr_fixbump(theta, lam, flux_i, logmstar, logsfr, incl=None): ''' Dust empirical model that combines the slab model with Noll+(2009) but keeps the **UV bump relation to delta fixed** A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta tauV = m_tau1 (log M* - 10.) + m_tau2 logSFR + c_tau delta = m_delta1 (log M* - 10.) + m_delta2 logSFR + c_delta -2.2 < delta < 0.4 E_b = -1.9 * delta + 0.85 (Kriek & Conroy 2013) :param theta: 6 free parameter of the slab + Noll+(2009) model theta: m_tau1 m_tau2 c_tau m_delta1 m_delta2 c_delta :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 6, print(theta) logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) zerosfr = (logsfr == -999.) _logmstar = logmstar[~zerosfr] _logsfr = logsfr[~zerosfr] tauV = np.clip(theta[0] * (_logmstar - 10.) + theta[1] * _logsfr + theta[2], 1e-3, None) delta = theta[3] * (_logmstar - 10.) + theta[4] * _logsfr + theta[5] # Kriek & Conroy (2013) E_b = -1.9 * delta + 0.85 # Narayanan+(2018) # E_b = -0.46 * delta + 0.69 # randomly sample the inclinatiion angle from 0 - pi/2 if incl is None: incl = np.random.uniform(0., 0.5*np.pi, size=_logmstar.shape[0]) sec_incl = 1./np.cos(incl) #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.all(np.isfinite(A_V)) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b[:,None] * ((lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2)) # calzetti is already normalized to k_V A_lambda = A_V[:,None] * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta[:,None] _T_lam = 10.0**(-0.4 * A_lambda) T_lam = np.ones((len(logmstar), len(lam))) T_lam[~zerosfr] = _T_lam return flux_i * T_lam def DEM_slab_noll_msfr(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' Dust empirical model that combines the slab model with Noll+(2009) A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta tauV = m_tau1 (log M* - 10.) + m_tau2 logSFR + c_tau delta = m_delta1 (log M* - 10.) + m_delta2 logSFR + c_delta -2.2 < delta < 0.4 E_b = m_E delta + c_E :param theta: 9 free parameter of the slab + Noll+(2009) model theta: m_tau1 m_tau2 c_tau m_delta1 m_delta2 c_delta m_E c_E f_nebular :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 9, print(theta) if isinstance(logsfr, float): if logsfr == -999.: raise ValueError else: if -999. in logsfr: raise ValueError logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) tauV = np.clip(theta[0] * (logmstar - 10.) + theta[1] * logsfr + theta[2], 1e-3, None) delta = theta[3] * (logmstar - 10.) + theta[4] * logsfr + theta[5] E_b = theta[6] * delta + theta[7] # randomly sample the inclinatiion angle from 0 - pi/2 incl = np.random.uniform(0., 0.5*np.pi, size=logmstar.shape[0]) sec_incl = 1./np.cos(incl) #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.all(np.isfinite(A_V)), print(tauV, logmstar, logsfr) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b[:,None] * ((lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2)) # calzetti is already normalized to k_V A_lambda = A_V[:,None] * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta[:,None] if not nebular: factor = 1. else: factor = theta[8] T_lam = 10.0**(-0.4 * A_lambda * factor) return flux_i * T_lam def DEM_slab_noll_m(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' Dust empirical model that combines the slab model with Noll+(2009) A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta tauV = m_tau (log M* - 10.) + c_tau delta = m_delta (log M* - 10.) + c_delta -2.2 < delta < 0.4 E_b = m_E delta + c_E :param theta: 7 free parameter of the slab + Noll+(2009) model theta: m_tau c_tau m_delta c_delta m_E c_E f_nebular :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: logmstar of galaxy :param logsfr: logSFR of galaxy (not used in this DEM :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 7, print(theta) logmstar = np.atleast_1d(logmstar) tauV = np.clip(theta[0] * (logmstar - 10.) + theta[1], 1e-3, None) delta = theta[2] * (logmstar - 10.) + theta[3] E_b = theta[4] * delta + theta[5] # randomly sample the inclinatiion angle from 0 - pi/2 incl = np.random.uniform(0., 0.5*np.pi, size=logmstar.shape[0]) sec_incl = 1./np.cos(incl) #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.isfinite(A_V), print(tauV, slab, logmstar, logsfr) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b * (lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2) A_lambda = A_V * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta if not nebular: factor = 1. else: factor = theta[6] T_lam = 10.0**(-0.4 * A_lambda * factor) return flux_i * T_lam def DEM_slabcalzetti(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' Dust Empirical Model that uses the slab model with tauV(theta, mstar) parameterization with inclinations randomly sampled A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) / k_V) :param theta: parameter of the DEM model that specifies the M* dep. V-band optical depth (slope, offset) as well as the nebular flux attenuatoin fraction :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. notes ----- * slab model to apply dust attenuation Eq.14 (Somerville+1999) ''' logmstar = np.atleast_1d(logmstar) tauV = np.clip(theta[0] * (logmstar - 10.) + theta[1], 1e-3, None) # randomly sample the inclinatiion angle from 0 - pi/2 incl = np.random.uniform(0., 0.5*np.pi, size=logmstar.shape[0]) sec_incl = 1./np.cos(incl) #cosis = 1.0 - np.cos(np.random.uniform(low=0, high=0.5*np.pi, size=mstar.shape[0])) if not nebular: factor = 1. else: factor = theta[2] #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.isfinite(A_V), print(tauV, logmstar, logsfr) # minimum attenuation from Romeel's paper (which one?) A_V = np.clip(A_V, 0.1, None) T_lam = 10.0**(A_V * -0.4 * calzetti_absorption(lam) * factor) return flux_i * T_lam def DEM_slab_noll_simple(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' simplified version of the Dust empirical model that combines the slab model with Noll+(2009). This is to better understand the distance metrics A(lambda) = -2.5 log10( (1 - exp(-tauV sec(i))) / (tauV sec(i)) ) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta tauV = c_tau delta = c_delta -2.2 < delta < 0.4 E_b = constant :param theta: 2 free parameter of the simplified slab + Noll+(2009) model theta: c_tau c_delta f_nebular :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 2, print(theta) logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) tauV = np.clip(theta[0], 1e-3, None) delta = theta[1] E_b = 0.85 # randomly sample the inclinatiion angle from 0 - pi/2 incl = np.random.uniform(0., 0.5*np.pi, size=logmstar.shape[0]) sec_incl = 1./np.cos(incl) #Eq. 14 of Somerville+(1999) A_V = -2.5 * np.log10((1.0 - np.exp(-tauV * sec_incl)) / (tauV * sec_incl)) assert np.isfinite(A_V), print(tauV, logmstar, logsfr) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b * (lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2) # calzetti is already normalized to k_V A_lambda = A_V * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta T_lam = 10.0**(-0.4 * A_lambda) return flux_i * T_lam def DEM_tnorm_noll_msfr_fixbump(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' Dust empirical model that uses Av sampled from a truncated normal distribution (instead of the slab model) and with Noll+(2009) parameterization with the **UV bump relation to delta fixed** A(lambda) = N_trunc(mu_Av, sig_Av) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta mu_Av = m_mu1 (log M* - 10.) + m_mu2 logSFR + c_mu sig_Av = m_sig1 (log M* - 10.) + m_sig2 logSFR + c_sig delta = m_delta1 (log M* - 10.) + m_delta2 logSFR + c_delta -2.2 < delta < 0.4 E_b = -1.9 * delta + 0.85 (Kriek & Conroy 2013) :param theta: 10 free parameter of the truncated norm + Noll+(2009) model theta: [m_mu1, m_mu2, c_mu, m_sig1, m_sig2, c_sig, m_delta1, m_delta2, c_delta, f_nebular] :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 10, print(theta) if logsfr == -999.: # if SFR = 0 no attenuation return flux_i logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) m_mu1, m_mu2, c_mu = theta[0], theta[1], theta[2] m_sig1, m_sig2, c_sig = theta[3], theta[4], theta[5] m_delta1, m_delta2, c_delta = theta[6], theta[7], theta[8] f_nebular = theta[9] mu_Av = np.clip(m_mu1 * (logmstar - 10.) + m_mu2 * logsfr + c_mu, 0., None) sig_Av = np.clip(m_sig1 * (logmstar - 10.) + m_sig2 * logsfr + c_sig, 0.1, None) # can't be too narrow delta = m_delta1 * (logmstar - 10.) + m_delta2 * logsfr + c_delta # Kriek & Conroy (2013) E_b = -1.9 * delta + 0.85 # Narayanan+(2018) # E_b = -0.46 * delta + 0.69 # truncated normal distribution trunc_lim = (0. - mu_Av)/sig_Av A_V = truncnorm.rvs(trunc_lim, np.inf, loc=mu_Av, scale=sig_Av, size=logmstar.shape[0]) assert np.isfinite(A_V), print(mu_Av, sig_Av, logmstar, logsfr) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b * (lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2) # calzetti is already normalized to k_V A_lambda = A_V * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta if not nebular: factor = 1. else: factor = theta[8] T_lam = 10.0**(-0.4 * A_lambda * factor) return flux_i * T_lam def DEM_tnorm_noll_msfr(theta, lam, flux_i, logmstar, logsfr, nebular=True): ''' Dust empirical model that uses Av sampled from a truncated normal distribution (instead of the slab model) and with Noll+(2009) parameterization. A(lambda) = N_trunc(mu_Av, sig_Av) x (k'(lambda) + D(lambda, E_b))/k_V x (lambda / lambda_V)^delta mu_Av = m_mu1 (log M* - 10.) + m_mu2 logSFR + c_mu sig_Av = m_sig1 (log M* - 10.) + m_sig2 logSFR + c_sig delta = m_delta1 (log M* - 10.) + m_delta2 logSFR + c_delta -2.2 < delta < 0.4 E_b = m_E delta + c_E :param theta: 12 free parameter of the truncated norm + Noll+(2009) model theta: [m_mu1, m_mu2, c_mu, m_sig1, m_sig2, c_sig, m_delta1, m_delta2, c_delta, m_E, c_E, f_nebular] :param lam: wavelength in angstrom :param flux_i: intrinsic flux of sed (units don't matter) :param logmstar: log M* of galaxies :param logsfr: log SFR of galaxies :param nebular: if True nebular flux has an attenuation that is scaled from the continuum attenuation. ''' assert theta.shape[0] == 12, print(theta) if logsfr == -999.: # if SFR = 0 no attenuation return flux_i logmstar = np.atleast_1d(logmstar) logsfr = np.atleast_1d(logsfr) m_mu1, m_mu2, c_mu = theta[0], theta[1], theta[2] m_sig1, m_sig2, c_sig = theta[3], theta[4], theta[5] m_delta1, m_delta2, c_delta = theta[6], theta[7], theta[8] m_E, c_E, f_nebular = theta[9], theta[10], theta[11] mu_Av = np.clip(m_mu1 * (logmstar - 10.) + m_mu2 * logsfr + c_mu, 0., None) sig_Av = np.clip(m_sig1 * (logmstar - 10.) + m_sig2 * logsfr + c_sig, 0.1, None) # can't be too narrow delta = m_delta1 * (logmstar - 10.) + m_delta2 * logsfr + c_delta E_b = m_E * delta + c_E # truncated normal distribution trunc_lim = (0. - mu_Av)/sig_Av A_V = truncnorm.rvs(trunc_lim, np.inf, loc=mu_Av, scale=sig_Av, size=logmstar.shape[0]) assert np.isfinite(A_V), print(mu_Av, sig_Av, logmstar, logsfr) dlam = 350. # width of bump from Noll+(2009) lam0 = 2175. # wavelength of bump k_V_calzetti = 4.87789 # bump D_bump = E_b * (lam * dlam)**2 / ((lam**2 - lam0**2)**2 + (lam * dlam)**2) # calzetti is already normalized to k_V A_lambda = A_V * (calzetti_absorption(lam) + D_bump / k_V_calzetti) * \ (lam / 5500.)**delta if not nebular: factor = 1. else: factor = theta[8] T_lam = 10.0**(-0.4 * A_lambda * factor) return flux_i * T_lam def calzetti_absorption(lam): ''' calzetti dust absorption attenuation curve normalized to 1 at V :param lam: wavelength in Angstroms notes ----- * different versions from different papers... - k_lam = np.where(lam <= 0.63, 4.88+2.656*(-2.156+1.509/lam-0.198/(lam*lam)+0.011/(lam*lam*lam)), 1.73 + ((1.86 - 0.48/lam)/lam - 0.1)/lam) ''' lam = np.atleast_1d(lam) / 1.e4 #R_V = 4.88 # (Calzetti 1997b) R_V = 4.05 # (Calzetti+2000) # Calzetti+(2000) Eq.4 k_lam = np.zeros(lam.shape) wlim = (lam >= 0.12) & (lam < 0.63) k_lam[wlim] = R_V + 2.659 * (-2.156 + 1.509/lam[wlim] - 0.198/(lam[wlim]**2) + 0.011/(lam[wlim]**3)) wlim = (lam >= 0.63) & (lam <= 2.2) k_lam[wlim] = R_V + 2.659 * (-1.857 + 1.040/lam[wlim]) k_V_calzetti = 4.87789 return k_lam/k_V_calzetti
34.022697
148
0.589923
3,916
25,483
3.682329
0.07763
0.004993
0.013731
0.007767
0.814771
0.78835
0.765465
0.762067
0.75
0.743897
0
0.062983
0.284111
25,483
748
149
34.068182
0.727457
0.454735
0
0.653137
0
0
0.017341
0.010936
0
0
0
0
0.081181
1
0.04059
false
0
0.00738
0
0.095941
0.055351
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
12da6e6c01f311d6c770cb9696a00b32b7b3da9c
47,400
py
Python
tests/unit/test_fs_local.py
neuro-inc/platform-storage-api
7564d6f353f7839962cc5dc2793ba44359eaf390
[ "Apache-2.0" ]
null
null
null
tests/unit/test_fs_local.py
neuro-inc/platform-storage-api
7564d6f353f7839962cc5dc2793ba44359eaf390
[ "Apache-2.0" ]
2
2021-12-29T21:43:29.000Z
2022-01-27T10:45:49.000Z
tests/unit/test_fs_local.py
neuro-inc/platform-storage-api
7564d6f353f7839962cc5dc2793ba44359eaf390
[ "Apache-2.0" ]
null
null
null
import os import shutil import tempfile import uuid from collections.abc import AsyncIterator, Iterable, Iterator from pathlib import Path, PurePath from typing import Any, Callable, Coroutine from unittest import mock import pytest import pytest_asyncio from platform_storage_api.fs.local import ( FileStatus, FileStatusType, FileSystem, LocalFileSystem, StorageType, copy_streams, ) class TestFileSystem: async def test_create_local(self) -> None: fs = FileSystem.create(StorageType.LOCAL) try: assert isinstance(fs, LocalFileSystem) finally: await fs.close() def test_create_s3(self) -> None: with pytest.raises(ValueError, match="Unsupported storage type: s3"): FileSystem.create(StorageType.S3) async def remove_normal(fs: FileSystem, path: PurePath, recursive: bool) -> None: await fs.remove(path, recursive=recursive) async def remove_iter(fs: FileSystem, path: PurePath, recursive: bool) -> None: async for _ in fs.iterremove(path, recursive=recursive): pass RemoveMethod = Callable[[FileSystem, PurePath, bool], Coroutine[Any, Any, None]] class TestLocalFileSystem: @pytest.fixture def tmp_dir_path(self) -> Iterator[Path]: # although blocking, this is fine for tests with tempfile.TemporaryDirectory() as d: yield Path(os.path.realpath(d)) @pytest.fixture def tmp_file_path(self, tmp_dir_path: Path) -> Iterator[Path]: # although blocking, this is fine for tests with tempfile.NamedTemporaryFile(dir=tmp_dir_path) as f: f.flush() yield Path(f.name) @pytest.fixture def path_with_symlink(self, tmp_dir_path: Path) -> Iterator[Path]: (tmp_dir_path / "dir").mkdir() (tmp_dir_path / "dir/subdir").mkdir() os.symlink("dir", tmp_dir_path / "link") yield tmp_dir_path / "link/subdir" @pytest.fixture def symlink_to_dir(self, tmp_dir_path: Path) -> Iterator[Path]: (tmp_dir_path / "dir").mkdir() path = tmp_dir_path / "dirlink" os.symlink("dir", path, target_is_directory=True) assert path.is_dir() yield path @pytest.fixture def symlink_to_file(self, tmp_dir_path: Path) -> Iterator[Path]: (tmp_dir_path / "file").write_bytes(b"test") path = tmp_dir_path / "filelink" os.symlink("file", path) assert path.is_file() yield path @pytest.fixture def free_symlink(self, tmp_dir_path: Path) -> Iterator[Path]: path = tmp_dir_path / "nonexistentlink" os.symlink("nonexistent", path) yield path @pytest_asyncio.fixture async def fs(self) -> AsyncIterator[FileSystem]: async with FileSystem.create(StorageType.LOCAL) as fs: yield fs async def test_open_empty_file_for_reading( self, fs: FileSystem, tmp_file_path: Path ) -> None: async with fs.open(tmp_file_path) as f: payload = await f.read() assert not payload async def test_open_for_writing(self, fs: FileSystem, tmp_file_path: Path) -> None: expected_payload = b"test" async with fs.open(tmp_file_path, "wb") as f: await f.write(expected_payload) await f.flush() async with fs.open(tmp_file_path, "rb") as f: payload = await f.read() assert payload == expected_payload async def test_copy_streams(self, fs: FileSystem, tmp_dir_path: Path) -> None: expected_payload = b"test" chunk_size = 1 out_filename = tmp_dir_path / str(uuid.uuid4()) in_filename = tmp_dir_path / str(uuid.uuid4()) async with fs.open(out_filename, mode="wb") as f: await f.write(b"test") await f.flush() async with fs.open(out_filename, mode="rb") as out_f: async with fs.open(in_filename, mode="wb") as in_f: await copy_streams(out_f, in_f, chunk_size=chunk_size) async with fs.open(in_filename, mode="rb") as f: payload = await f.read() assert payload == expected_payload async def test_open_symlink(self, fs: FileSystem, symlink_to_file: Path) -> None: for mode in "rb", "rb+", "wb", "xb": with pytest.raises(FileNotFoundError): async with fs.open(symlink_to_file, mode): pass async def test_open_free_symlink(self, fs: FileSystem, free_symlink: Path) -> None: for mode in "rb", "rb+", "wb", "xb": with pytest.raises(FileNotFoundError): async with fs.open(free_symlink, mode): pass assert not free_symlink.exists() async def test_open_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path ) -> None: path = path_with_symlink / "file" path.write_bytes(b"") for mode in "rb", "rb+", "wb", "xb": with pytest.raises(FileNotFoundError): async with fs.open(path, mode): pass async def test_listdir( self, fs: FileSystem, tmp_dir_path: Path, tmp_file_path: Path ) -> None: files = await fs.listdir(tmp_dir_path) assert files == [tmp_file_path] async def test_listdir_empty_dir(self, fs: FileSystem, tmp_dir_path: Path) -> None: files = await fs.listdir(tmp_dir_path) assert not files async def test_listdir_symlink(self, fs: FileSystem, symlink_to_dir: Path) -> None: with pytest.raises(FileNotFoundError): await fs.listdir(symlink_to_dir) async def test_listdir_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.listdir(path_with_symlink) async def test_mkdir(self, fs: FileSystem, tmp_dir_path: Path) -> None: dir_name = "new" path = tmp_dir_path / dir_name await fs.mkdir(path) files = await fs.listdir(tmp_dir_path) assert files == [path] async def test_mkdir_existing_dir(self, fs: FileSystem, tmp_dir_path: Path) -> None: dir_name = "new" path = tmp_dir_path / dir_name await fs.mkdir(path) files = await fs.listdir(tmp_dir_path) assert files == [path] # should not fail await fs.mkdir(path) async def test_mkdir_existing_file( self, fs: FileSystem, tmp_dir_path: Path ) -> None: dir_name = "new" path = tmp_dir_path / dir_name async with fs.open(path, "wb"): pass files = await fs.listdir(tmp_dir_path) assert files == [path] with pytest.raises(FileExistsError): await fs.mkdir(path) async def test_mkdir_symlink(self, fs: FileSystem, symlink_to_dir: Path) -> None: with pytest.raises(FileExistsError): await fs.mkdir(symlink_to_dir) async def test_mkdir_free_symlink(self, fs: FileSystem, free_symlink: Path) -> None: with pytest.raises(FileExistsError): await fs.mkdir(free_symlink) async def test_mkdir_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.mkdir(path_with_symlink / "new") async def test_liststatus_with_single_empty_file( self, fs: FileSystem, tmp_dir_path: Path, tmp_file_path: Path ) -> None: expected_path = Path(tmp_file_path.name) stat = os.stat(tmp_file_path) expected_mtime = int(stat.st_mtime) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [ FileStatus( expected_path, size=0, type=FileStatusType.FILE, modification_time=expected_mtime, ) ] async def test_liststatus_with_single_file( self, fs: FileSystem, tmp_dir_path: Path, tmp_file_path: Path ) -> None: expected_path = Path(tmp_file_path.name) expected_payload = b"test" expected_size = len(expected_payload) async with fs.open(tmp_file_path, "wb") as f: await f.write(expected_payload) await f.flush() stat = os.stat(tmp_file_path) expected_mtime = int(stat.st_mtime) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [ FileStatus( expected_path, size=expected_size, type=FileStatusType.FILE, modification_time=expected_mtime, ) ] async def test_liststatus_with_single_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: expected_path = Path("nested") path = tmp_dir_path / expected_path await fs.mkdir(path) stat = os.stat(path) expected_mtime = int(stat.st_mtime) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [ FileStatus( expected_path, size=0, type=FileStatusType.DIRECTORY, modification_time=expected_mtime, ) ] async def test_liststatus_with_many_files( self, fs: FileSystem, tmp_dir_path: Path ) -> None: expected = [] for i in range(5000): name = f"file-{i}" expected.append(PurePath(name)) async with fs.open(tmp_dir_path / name, "wb"): pass statuses = await fs.liststatus(tmp_dir_path) actual = [status.path for status in statuses] assert sorted(actual) == sorted(expected) async def test_iterstatus_with_many_files( self, fs: FileSystem, tmp_dir_path: Path ) -> None: expected = [] for i in range(5000): name = f"file-{i}" expected.append(PurePath(name)) async with fs.open(tmp_dir_path / name, "wb"): pass async with fs.iterstatus(tmp_dir_path) as it: statuses = [status async for status in it] actual = [status.path for status in statuses] assert sorted(actual) == sorted(expected) async def test_liststatus_non_existent_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: path = tmp_dir_path / "nested" with pytest.raises(FileNotFoundError): await fs.liststatus(path) async def test_liststatus_empty_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: statuses = await fs.liststatus(tmp_dir_path) assert statuses == [] async def test_liststatus_symlink( self, fs: FileSystem, symlink_to_dir: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.liststatus(symlink_to_dir) async def test_liststatus_free_symlink( self, fs: FileSystem, free_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.liststatus(free_symlink) async def test_liststatus_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.liststatus(path_with_symlink) async def test_iterstatus_non_existent_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: path = tmp_dir_path / "nested" async with fs.iterstatus(path) as it: with pytest.raises(FileNotFoundError): await it.__anext__() async def test_iterstatus_symlink( self, fs: FileSystem, symlink_to_dir: Path ) -> None: async with fs.iterstatus(symlink_to_dir) as it: with pytest.raises(FileNotFoundError): await it.__anext__() async def test_iterstatus_free_symlink( self, fs: FileSystem, free_symlink: Path ) -> None: async with fs.iterstatus(free_symlink) as it: with pytest.raises(FileNotFoundError): await it.__anext__() async def test_iterstatus_broken_directory_link( self, fs: FileSystem, tmp_dir_path: Path ) -> None: path = tmp_dir_path / "nested" os.symlink("nonexisting", path, target_is_directory=True) async with fs.iterstatus(path) as it: with pytest.raises(FileNotFoundError): await it.__anext__() async def test_iterstatus_with_broken_entry_link( self, fs: FileSystem, tmp_dir_path: Path ) -> None: path = tmp_dir_path / "nested" os.symlink("nonexisting", path) async with fs.iterstatus(tmp_dir_path) as it: statuses = [status async for status in it] actual = [status.path for status in statuses] assert actual == [PurePath("nested")] assert statuses[0] == FileStatus( PurePath("nested"), type=FileStatusType.SYMLINK, size=1, modification_time=mock.ANY, target="nonexisting", ) @pytest.mark.parametrize("recursive", [True, False]) @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) async def test_rm_non_existent( self, fs: FileSystem, tmp_dir_path: Path, remove_method: RemoveMethod, recursive: bool, ) -> None: path = tmp_dir_path / "nested" with pytest.raises(FileNotFoundError): await remove_method(fs, path, recursive) @pytest.mark.parametrize("recursive", [True, False]) @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) async def test_rm_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path, remove_method: RemoveMethod, recursive: bool, ) -> None: path = path_with_symlink / "file" path.write_bytes(b"") with pytest.raises(FileNotFoundError): await remove_method(fs, path, recursive) @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) async def test_rm_empty_dir( self, fs: FileSystem, tmp_dir_path: Path, remove_method: RemoveMethod ) -> None: expected_path = Path("nested") path = tmp_dir_path / expected_path await fs.mkdir(path) stat = os.stat(path) expected_mtime = int(stat.st_mtime) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [ FileStatus( expected_path, size=0, type=FileStatusType.DIRECTORY, modification_time=expected_mtime, ) ] await remove_method(fs, path, True) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [] @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) async def test_rm_dir( self, fs: FileSystem, tmp_dir_path: Path, remove_method: RemoveMethod ) -> None: expected_path = Path("nested") dir_path = tmp_dir_path / expected_path await fs.mkdir(dir_path) subdir_path = dir_path / "subdir" subdir_path.mkdir() file_path = dir_path / "file" async with fs.open(file_path, mode="wb") as f: await f.write(b"test") await f.flush() statuses = await fs.liststatus(dir_path) assert len(statuses) == 2 await remove_method(fs, dir_path, True) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [] @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) async def test_rm_dir_non_recursive_fails( self, fs: FileSystem, tmp_dir_path: Path, remove_method: RemoveMethod ) -> None: dir_path = tmp_dir_path / "nested" await fs.mkdir(dir_path) with pytest.raises(IsADirectoryError): await remove_method(fs, dir_path, False) @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) @pytest.mark.parametrize("recursive", [True, False]) async def test_rm_file( self, fs: FileSystem, tmp_dir_path: Path, recursive: bool, remove_method: RemoveMethod, ) -> None: expected_path = Path("nested") path = tmp_dir_path / expected_path async with fs.open(path, mode="wb") as f: await f.write(b"test") await f.flush() stat = os.stat(path) expected_mtime = int(stat.st_mtime) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [ FileStatus( expected_path, size=4, type=FileStatusType.FILE, modification_time=expected_mtime, ) ] await remove_method(fs, path, recursive) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [] @pytest.mark.parametrize("recursive", [True, False]) @pytest.mark.parametrize("remove_method", [remove_normal, remove_iter]) async def test_rm_symlink_to_dir( self, fs: FileSystem, tmp_dir_path: Path, remove_method: RemoveMethod, recursive: bool, ) -> None: dir_path = tmp_dir_path / "dir" await fs.mkdir(dir_path) link_path = tmp_dir_path / "link" link_path.symlink_to("dir", target_is_directory=True) stat = os.stat(dir_path) expected_mtime = int(stat.st_mtime) lstat = os.lstat(link_path) expected_link_mtime = int(lstat.st_mtime) statuses = await fs.liststatus(tmp_dir_path) assert sorted(statuses, key=lambda s: s.path) == [ FileStatus( Path("dir"), size=0, type=FileStatusType.DIRECTORY, modification_time=expected_mtime, ), FileStatus( Path("link"), size=1, type=FileStatusType.SYMLINK, modification_time=expected_link_mtime, target="dir", ), ] await remove_method(fs, link_path, recursive) statuses = await fs.liststatus(tmp_dir_path) assert statuses == [ FileStatus( Path("dir"), size=0, type=FileStatusType.DIRECTORY, modification_time=expected_mtime, ) ] async def test_iterremove_with_many_files( self, fs: FileSystem, tmp_dir_path: Path ) -> None: expected = [] async def make_files(path: PurePath, count: int) -> None: for i in range(count): name = f"file-{i}" filepath = path / name expected.append((filepath, False)) async with fs.open(filepath, "wb"): pass to_remove_dir = tmp_dir_path / "to_remove" to_remove_dir.mkdir() expected.append((to_remove_dir, True)) for subdir_segments in (("foo",), ("bar",), ("foo", "baz")): subdir = to_remove_dir.joinpath(*subdir_segments) subdir.mkdir() expected.append((subdir, True)) await make_files(subdir, 100) actual = [ (remove_listing.path, remove_listing.is_dir) async for remove_listing in fs.iterremove(to_remove_dir, recursive=True) ] assert sorted(actual) == sorted(expected) async def test_get_filestatus_file( self, fs: FileSystem, tmp_dir_path: Path ) -> None: file_relative = Path("nested") expected_file_path = tmp_dir_path / file_relative payload = b"test" async with fs.open(expected_file_path, mode="wb") as f: await f.write(payload) await f.flush() stat = os.stat(expected_file_path) expected_mtime = int(stat.st_mtime) status = await fs.get_filestatus(expected_file_path) assert status == FileStatus( path=expected_file_path, size=len(payload), type=FileStatusType.FILE, modification_time=expected_mtime, ) await fs.remove(expected_file_path) async def test_get_filestatus_dir(self, fs: FileSystem, tmp_dir_path: Path) -> None: file_relative = Path("nested") expected_file_path = tmp_dir_path / file_relative payload = b"test" async with fs.open(expected_file_path, mode="wb") as f: await f.write(payload) await f.flush() stat = os.stat(expected_file_path) expected_mtime = int(stat.st_mtime) status = await fs.get_filestatus(tmp_dir_path) assert status == FileStatus( path=tmp_dir_path, size=0, type=FileStatusType.DIRECTORY, modification_time=expected_mtime, ) await fs.remove(expected_file_path) async def test_get_filestatus_symlink_to_file( self, fs: FileSystem, symlink_to_file: Path ) -> None: stat = os.lstat(symlink_to_file) expected_mtime = int(stat.st_mtime) status = await fs.get_filestatus(symlink_to_file) assert status == FileStatus( path=symlink_to_file, size=1, type=FileStatusType.SYMLINK, modification_time=expected_mtime, target="file", ) async def test_get_filestatus_symlink_to_dir( self, fs: FileSystem, symlink_to_dir: Path ) -> None: stat = os.lstat(symlink_to_dir) expected_mtime = int(stat.st_mtime) status = await fs.get_filestatus(symlink_to_dir) assert status == FileStatus( path=symlink_to_dir, size=1, type=FileStatusType.SYMLINK, modification_time=expected_mtime, target="dir", ) async def test_get_filestatus_free_symlink( self, fs: FileSystem, free_symlink: Path ) -> None: stat = os.lstat(free_symlink) expected_mtime = int(stat.st_mtime) status = await fs.get_filestatus(free_symlink) assert status == FileStatus( path=free_symlink, size=1, type=FileStatusType.SYMLINK, modification_time=expected_mtime, target="nonexistent", ) async def test_get_filestatus_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.get_filestatus(path_with_symlink) async def test_exists_file(self, fs: FileSystem, tmp_dir_path: Path) -> None: file_relative = Path("nested") expected_file_path = tmp_dir_path / file_relative payload = b"test" async with fs.open(expected_file_path, mode="wb") as f: await f.write(payload) await f.flush() assert await fs.exists(expected_file_path) await fs.remove(expected_file_path) async def test_exists_dir(self, fs: FileSystem, tmp_dir_path: Path) -> None: file_relative = Path("nested") expected_file_path = tmp_dir_path / file_relative payload = b"test" async with fs.open(expected_file_path, mode="wb") as f: await f.write(payload) await f.flush() assert await fs.exists(tmp_dir_path) await fs.remove(expected_file_path) async def test_exists_unknown(self, fs: FileSystem, tmp_dir_path: Path) -> None: assert not await fs.exists(Path("unknown-name")) # helper methods for working with sets of statuses @classmethod def statuses_get(cls, statuses: Iterable[FileStatus], path: PurePath) -> FileStatus: return next(st for st in statuses if st.path == path) @classmethod def statuses_add( cls, statuses: set[FileStatus], status: FileStatus ) -> set[FileStatus]: return statuses | {status} @classmethod def statuses_drop( cls, statuses: Iterable[FileStatus], path: PurePath ) -> set[FileStatus]: return set(filter(lambda st: st.path != path, statuses)) @classmethod def statuses_rename( cls, statuses: Iterable[FileStatus], old_path: PurePath, new_path: PurePath ) -> set[FileStatus]: def rename(status: FileStatus) -> FileStatus: if status.path == old_path: return FileStatus( path=new_path, type=status.type, size=status.size, modification_time=status.modification_time, permission=status.permission, ) else: return status return set(map(rename, statuses)) async def test_rename_file_same_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_name = PurePath("old") new_name = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_name new_path = tmp_dir_path / new_name async with fs.open(old_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) expected_statuses = self.statuses_rename(old_statuses, old_name, new_name) assert statuses == expected_statuses async with fs.open(new_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload await fs.remove(new_path) async def test_rename_file_different_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_name = PurePath("old") subdir = PurePath("nested") new_name = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_name subdir_path = tmp_dir_path / subdir new_path = subdir_path / new_name async with fs.open(old_path, mode="wb") as f: await f.write(payload) await f.flush() await fs.mkdir(subdir_path) old_statuses = set(await fs.liststatus(tmp_dir_path)) renaming_status = self.statuses_get(old_statuses, old_name) old_subdir_status = self.statuses_get(old_statuses, subdir) await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) new_subdir_status = self.statuses_get(statuses, subdir) assert new_subdir_status.modification_time is not None assert old_subdir_status.modification_time is not None assert ( new_subdir_status.modification_time >= old_subdir_status.modification_time ) assert statuses | {renaming_status} | {old_subdir_status} == old_statuses | { new_subdir_status } statuses = set(await fs.liststatus(subdir_path)) assert statuses == self.statuses_rename({renaming_status}, old_name, new_name) async with fs.open(new_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_file_nonexistent_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_name = PurePath("old") subdir = PurePath("nested") new_name = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_name subdir_path = tmp_dir_path / subdir new_path = subdir_path / new_name async with fs.open(old_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) with pytest.raises(FileNotFoundError): await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses async with fs.open(old_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_file_to_dir(self, fs: FileSystem, tmp_dir_path: Path) -> None: old_name = PurePath("old") subdir = PurePath("nested") payload = b"test" old_path = tmp_dir_path / old_name subdir_path = tmp_dir_path / subdir async with fs.open(old_path, mode="wb") as f: await f.write(payload) await f.flush() await fs.mkdir(subdir_path) old_statuses = set(await fs.liststatus(tmp_dir_path)) with pytest.raises(IsADirectoryError): await fs.rename(old_path, subdir_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses_list = await fs.liststatus(subdir_path) assert statuses_list == [] async with fs.open(old_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_file_no_file( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_name = PurePath("old") new_name = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_name new_path = tmp_dir_path / new_name async with fs.open(new_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) with pytest.raises(FileNotFoundError): await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses async with fs.open(new_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_file_self(self, fs: FileSystem, tmp_dir_path: Path) -> None: name = PurePath("file") payload = b"test" path = tmp_dir_path / name async with fs.open(path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) await fs.rename(path, path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses async with fs.open(path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_file_to_existing_file( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_name = PurePath("old") new_name = PurePath("new") old_payload = b"test" new_payload = b"mississippi" old_path = tmp_dir_path / old_name new_path = tmp_dir_path / new_name async with fs.open(old_path, mode="wb") as f: await f.write(old_payload) await f.flush() async with fs.open(new_path, mode="wb") as f: await f.write(new_payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) expected_statuses = self.statuses_drop(old_statuses, new_name) expected_statuses = self.statuses_rename(expected_statuses, old_name, new_name) assert statuses == expected_statuses async with fs.open(new_path, mode="rb") as f: real_payload = await f.read() assert real_payload == old_payload async def test_rename_symlink_to_file( self, fs: FileSystem, tmp_dir_path: Path, symlink_to_file: Path ) -> None: old_path = symlink_to_file new_path = tmp_dir_path / "new" await fs.rename(old_path, new_path) assert not old_path.exists() assert new_path.is_symlink() assert new_path.read_bytes() == b"test" assert set(tmp_dir_path.iterdir()) == {new_path, new_path.resolve()} async def test_rename_file_to_symlink_to_file( self, fs: FileSystem, tmp_dir_path: Path, symlink_to_file: Path ) -> None: old_path = tmp_dir_path / "old" old_path.write_bytes(b"test") new_path = symlink_to_file orig_path = symlink_to_file.resolve() await fs.rename(old_path, new_path) assert not old_path.exists() assert not new_path.is_symlink() assert new_path.read_bytes() == b"test" assert set(tmp_dir_path.iterdir()) == {new_path, orig_path} async def test_rename_file_to_symlink_to_dir( self, fs: FileSystem, tmp_dir_path: Path, symlink_to_dir: Path ) -> None: old_path = tmp_dir_path / "old" old_path.write_bytes(b"test") new_path = symlink_to_dir orig_path = symlink_to_dir.resolve() await fs.rename(old_path, new_path) assert not old_path.exists() assert not new_path.is_symlink() assert new_path.read_bytes() == b"test" assert set(tmp_dir_path.iterdir()) == {new_path, orig_path} async def test_rename_file_to_free_symlink( self, fs: FileSystem, tmp_dir_path: Path, free_symlink: Path ) -> None: old_path = tmp_dir_path / "old" old_path.write_bytes(b"test") new_path = free_symlink await fs.rename(old_path, new_path) assert not old_path.exists() assert not new_path.is_symlink() assert new_path.read_bytes() == b"test" assert list(tmp_dir_path.iterdir()) == [new_path] async def test_rename_file_src_path_with_symlink( self, fs: FileSystem, tmp_dir_path: Path, path_with_symlink: Path ) -> None: old_path = path_with_symlink / "old" new_path = tmp_dir_path / "new" old_path.write_bytes(b"test") with pytest.raises(FileNotFoundError): await fs.rename(old_path, new_path) async def test_rename_file_dst_path_with_symlink( self, fs: FileSystem, tmp_dir_path: Path, path_with_symlink: Path ) -> None: old_path = tmp_dir_path / "old" new_path = path_with_symlink / "new" old_path.write_bytes(b"test") with pytest.raises(FileNotFoundError): await fs.rename(old_path, new_path) async def test_rename_dir_same_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: file_name = PurePath("file") old_dir = PurePath("old") new_dir = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_dir new_path = tmp_dir_path / new_dir old_file_path = old_path / file_name new_file_path = new_path / file_name await fs.mkdir(old_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == self.statuses_rename(old_statuses, old_dir, new_dir) statuses = set(await fs.liststatus(new_path)) assert statuses == old_statuses_old_dir async with fs.open(new_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_dir_different_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: file_name = PurePath("file") old_dir = PurePath("old") new_dir = PurePath("new") nested_dir = PurePath("nested") payload = b"test" old_path = tmp_dir_path / old_dir nested_path = tmp_dir_path / nested_dir new_path = nested_path / new_dir old_file_path = old_path / file_name new_file_path = new_path / file_name await fs.mkdir(old_path) await fs.mkdir(nested_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) renaming_status = self.statuses_get(old_statuses, old_dir) old_subdir_status = self.statuses_get(old_statuses, nested_dir) await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) new_subdir_status = self.statuses_get(statuses, nested_dir) assert new_subdir_status.modification_time is not None assert old_subdir_status.modification_time is not None assert ( new_subdir_status.modification_time >= old_subdir_status.modification_time ) assert statuses | {renaming_status} | {old_subdir_status} == old_statuses | { new_subdir_status } statuses = set(await fs.liststatus(nested_path)) expected_statuses = self.statuses_drop(old_statuses, nested_dir) expected_statuses = self.statuses_rename(expected_statuses, old_dir, new_dir) assert statuses == expected_statuses statuses = set(await fs.liststatus(new_path)) assert statuses == old_statuses_old_dir async with fs.open(new_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_dir_nonexistent_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: file_name = PurePath("file") old_dir = PurePath("old") new_dir = PurePath("new") nested_dir = PurePath("nested") payload = b"test" old_path = tmp_dir_path / old_dir nested_path = tmp_dir_path / nested_dir new_path = nested_path / new_dir old_file_path = old_path / file_name await fs.mkdir(old_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) with pytest.raises(FileNotFoundError): await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses = set(await fs.liststatus(old_path)) assert statuses == old_statuses_old_dir async with fs.open(old_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_dir_to_file(self, fs: FileSystem, tmp_dir_path: Path) -> None: old_dir = PurePath("old") new_file = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_dir new_path = tmp_dir_path / new_file await fs.mkdir(old_path) async with fs.open(new_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) with pytest.raises(NotADirectoryError): await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses = set(await fs.liststatus(old_path)) assert statuses == old_statuses_old_dir async with fs.open(new_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_dir_to_empty_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: file_name = PurePath("file") old_dir = PurePath("old") new_dir = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_dir new_path = tmp_dir_path / new_dir old_file_path = old_path / file_name new_file_path = new_path / file_name await fs.mkdir(old_path) await fs.mkdir(new_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) expected_statuses = self.statuses_drop(old_statuses, new_dir) expected_statuses = self.statuses_rename(expected_statuses, old_dir, new_dir) assert statuses == expected_statuses statuses = set(await fs.liststatus(new_path)) statuses = old_statuses_old_dir async with fs.open(new_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_dir_to_nonempty_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_file_name = PurePath("old_file") new_file_name = PurePath("new_file") old_dir = PurePath("old") new_dir = PurePath("new") old_payload = b"test" new_payload = b"mississippi" old_path = tmp_dir_path / old_dir new_path = tmp_dir_path / new_dir old_file_path = old_path / old_file_name new_file_path = new_path / new_file_name await fs.mkdir(old_path) await fs.mkdir(new_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(old_payload) await f.flush() async with fs.open(new_file_path, mode="wb") as f: await f.write(new_payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) old_statuses_new_dir = set(await fs.liststatus(new_path)) with pytest.raises(OSError): await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses = set(await fs.liststatus(old_path)) assert statuses == old_statuses_old_dir async with fs.open(old_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == old_payload statuses = set(await fs.liststatus(new_path)) assert statuses == old_statuses_new_dir async with fs.open(new_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == new_payload async def test_rename_dir_to_ancestor_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: old_file_name = PurePath("old_file") new_file_name = PurePath("new_file") old_dir = PurePath("old") old_payload = b"test" new_payload = b"mississippi" old_path = tmp_dir_path / old_dir old_file_path = old_path / old_file_name new_file_path = tmp_dir_path / new_file_name await fs.mkdir(old_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(old_payload) await f.flush() async with fs.open(new_file_path, mode="wb") as f: await f.write(new_payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) with pytest.raises(OSError): await fs.rename(old_path, tmp_dir_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses = set(await fs.liststatus(old_path)) assert statuses == old_statuses_old_dir async with fs.open(old_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == old_payload async with fs.open(new_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == new_payload async def test_rename_dir_to_descended_dir( self, fs: FileSystem, tmp_dir_path: Path ) -> None: file_name = PurePath("file") old_dir = PurePath("old") new_dir = PurePath("new") payload = b"test" old_path = tmp_dir_path / old_dir new_path = old_path / new_dir old_file_path = old_path / file_name await fs.mkdir(old_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) with pytest.raises(OSError): await fs.rename(old_path, new_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses = set(await fs.liststatus(old_path)) assert statuses == old_statuses_old_dir async with fs.open(old_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_rename_dir_to_dot(self, fs: FileSystem, tmp_dir_path: Path) -> None: file_name = PurePath("file") old_dir = PurePath("old") payload = b"test" old_path = tmp_dir_path / old_dir old_file_path = old_path / file_name await fs.mkdir(old_path) async with fs.open(old_file_path, mode="wb") as f: await f.write(payload) await f.flush() old_statuses = set(await fs.liststatus(tmp_dir_path)) old_statuses_old_dir = set(await fs.liststatus(old_path)) with pytest.raises(OSError): await fs.rename(old_path, tmp_dir_path / ".") with pytest.raises(OSError): await fs.rename(old_path, tmp_dir_path / "..") with pytest.raises(OSError): await fs.rename(tmp_dir_path / ".", old_path) with pytest.raises(OSError): await fs.rename(tmp_dir_path / "..", old_path) statuses = set(await fs.liststatus(tmp_dir_path)) assert statuses == old_statuses statuses = set(await fs.liststatus(old_path)) assert statuses == old_statuses_old_dir async with fs.open(old_file_path, mode="rb") as f: real_payload = await f.read() assert real_payload == payload async def test_disk_usage(self, fs: FileSystem, tmp_dir_path: Path) -> None: res = await fs.disk_usage(tmp_dir_path) total, used, free = shutil.disk_usage(tmp_dir_path) assert res.total == total assert res.used == used assert res.free == free async def test_disk_usage_symlink_to_file( self, fs: FileSystem, symlink_to_file: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.disk_usage(symlink_to_file) async def test_disk_usage_free_symlink( self, fs: FileSystem, free_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.disk_usage(free_symlink) async def test_disk_usage_path_with_symlink( self, fs: FileSystem, path_with_symlink: Path ) -> None: with pytest.raises(FileNotFoundError): await fs.disk_usage(path_with_symlink)
34.223827
88
0.621814
6,018
47,400
4.61881
0.037388
0.052885
0.068715
0.032235
0.855303
0.828608
0.803425
0.775435
0.745683
0.72183
0
0.000916
0.286076
47,400
1,384
89
34.248555
0.820479
0.003122
0
0.696043
0
0
0.021398
0
0
0
0
0
0.097122
1
0.010791
false
0.007194
0.009892
0.002698
0.027878
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
12ebdd219cd7aa1019874cb7b6ab717acb701dc2
95
py
Python
moses/dataset/__init__.py
jiahuei/moses
7546d45b8d4160f4f40747525dc81b50431c8749
[ "MIT" ]
585
2018-11-28T12:16:12.000Z
2022-03-28T03:50:20.000Z
moses/dataset/__init__.py
jiahuei/moses
7546d45b8d4160f4f40747525dc81b50431c8749
[ "MIT" ]
52
2018-12-04T21:15:15.000Z
2022-03-03T22:14:19.000Z
moses/dataset/__init__.py
jiahuei/moses
7546d45b8d4160f4f40747525dc81b50431c8749
[ "MIT" ]
200
2018-11-28T13:49:16.000Z
2022-03-29T16:53:50.000Z
from .dataset import get_dataset, get_statistics __all__ = ['get_dataset', 'get_statistics']
19
48
0.778947
12
95
5.5
0.5
0.30303
0.393939
0.69697
0
0
0
0
0
0
0
0
0.115789
95
4
49
23.75
0.785714
0
0
0
0
0
0.263158
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
6
42161fd3b1c595564235b67c1806744df1982626
389
py
Python
astropy/run_test.py
Cadair/conda-recipes
0227a81ed80e24eefffe091836dead93f8312ffe
[ "BSD-3-Clause" ]
302
2015-01-04T18:21:56.000Z
2021-11-16T12:14:37.000Z
astropy/run_test.py
Cadair/conda-recipes
0227a81ed80e24eefffe091836dead93f8312ffe
[ "BSD-3-Clause" ]
393
2015-01-03T14:35:48.000Z
2019-12-09T15:09:07.000Z
astropy/run_test.py
Cadair/conda-recipes
0227a81ed80e24eefffe091836dead93f8312ffe
[ "BSD-3-Clause" ]
325
2015-01-04T17:26:39.000Z
2021-11-04T16:25:54.000Z
import astropy.io.fits.compression import astropy.io.votable.tablewriter import astropy.nddata.convolution.boundary_extend import astropy.nddata.convolution.boundary_fill import astropy.nddata.convolution.boundary_none import astropy.nddata.convolution.boundary_wrap import astropy.time.sofa_time import astropy.utils._compiler import astropy.utils.xml._iterparser import astropy.wcs._wcs
35.363636
49
0.879177
52
389
6.423077
0.403846
0.389222
0.227545
0.359281
0.45509
0
0
0
0
0
0
0
0.051414
389
10
50
38.9
0.905149
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
423daac11f1bc1dc6389875584a1867800935230
33
py
Python
apex_utils/apex/utils/__init__.py
ViugiNick/sentiment-discovery
c781b1236a52a981af40733de13ea1598d4255d9
[ "BSD-3-Clause" ]
1
2018-10-16T10:56:47.000Z
2018-10-16T10:56:47.000Z
apex_utils/apex/utils/__init__.py
atsnova/sentiment-discovery
7f5ab28918a6fc29318a30f557b9454f0f5cc26a
[ "BSD-3-Clause" ]
null
null
null
apex_utils/apex/utils/__init__.py
atsnova/sentiment-discovery
7f5ab28918a6fc29318a30f557b9454f0f5cc26a
[ "BSD-3-Clause" ]
1
2019-03-13T11:43:13.000Z
2019-03-13T11:43:13.000Z
from .FusedNorm import FusedNorm
16.5
32
0.848485
4
33
7
0.75
0
0
0
0
0
0
0
0
0
0
0
0.121212
33
1
33
33
0.965517
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
42811b608c768524384ab14a009aed1e430fe507
8,942
py
Python
tests/open_alchemy/column_factory/test_integration.py
codingjoe/OpenAlchemy
a899c05b11209d9d23f81c2638f501e5147c90b8
[ "Apache-2.0" ]
null
null
null
tests/open_alchemy/column_factory/test_integration.py
codingjoe/OpenAlchemy
a899c05b11209d9d23f81c2638f501e5147c90b8
[ "Apache-2.0" ]
null
null
null
tests/open_alchemy/column_factory/test_integration.py
codingjoe/OpenAlchemy
a899c05b11209d9d23f81c2638f501e5147c90b8
[ "Apache-2.0" ]
null
null
null
"""Tests for the column factory.""" # pylint: disable=protected-access import pytest import sqlalchemy from open_alchemy import column_factory @pytest.mark.column def test_integration(): """ GIVEN schema WHEN column_factory is called with the schema THEN SQLAlchemy boolean column is returned in a dictionary with logical name and spec. """ spec = {"type": "boolean"} schemas = {} ([(logical_name, column)], spec) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name="column_1", model_schema={} ) assert logical_name == "column_1" assert isinstance(column.type, sqlalchemy.Boolean) assert spec == {"type": "boolean"} @pytest.mark.column def test_integration_all_of(): """ GIVEN schema with allOf statement WHEN column_factory is called with the schema THEN SQLAlchemy boolean column is returned in a dictionary with logical name and spec. """ spec = {"allOf": [{"type": "boolean"}]} schemas = {} ([(logical_name, column)], spec) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name="column_1", model_schema={} ) assert logical_name == "column_1" assert isinstance(column.type, sqlalchemy.Boolean) assert spec == {"type": "boolean"} @pytest.mark.column def test_integration_ref(): """ GIVEN schema that references another schema and schemas WHEN column_factory is called with the schema and schemas THEN SQLAlchemy boolean column is returned in a dictionary with logical name and the spec. """ spec = {"$ref": "#/components/schemas/RefSchema"} schemas = {"RefSchema": {"type": "boolean"}} ([(logical_name, column)], spec) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name="column_1", model_schema={} ) assert logical_name == "column_1" assert isinstance(column.type, sqlalchemy.Boolean) assert spec == {"type": "boolean"} @pytest.mark.column def test_integration_object_ref(): """ GIVEN schema that references another object schema and schemas WHEN column_factory is called with the schema and schemas THEN foreign key reference and relationship is returned with the spec. """ spec = {"$ref": "#/components/schemas/RefSchema"} schemas = { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "properties": {"id": {"type": "integer"}}, } } logical_name = "ref_schema" ( [(fk_logical_name, fk_column), (tbl_logical_name, relationship)], spec, ) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name=logical_name, model_schema={"properties": {}}, ) assert fk_logical_name == "ref_schema_id" assert isinstance(fk_column.type, sqlalchemy.Integer) assert len(fk_column.foreign_keys) == 1 assert tbl_logical_name == logical_name assert relationship.argument == "RefSchema" assert relationship.backref is None assert relationship.uselist is None assert spec == {"type": "object", "x-de-$ref": "RefSchema"} @pytest.mark.column def test_integration_object_ref_fk_def(): """ GIVEN schema that references another object schema which already has the foreign key defined and schemas WHEN column_factory is called with the schema and schemas THEN no foreign key column is returned. """ model_schema = { "properties": { "ref_schema_id": {"type": "integer", "x-foreign-key": "ref_schema.id"} } } spec = {"$ref": "#/components/schemas/RefSchema"} schemas = { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "properties": {"id": {"type": "integer"}}, } } logical_name = "ref_schema" ([(tbl_logical_name, relationship)], _) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name=logical_name, model_schema=model_schema ) assert tbl_logical_name == logical_name assert relationship.argument == "RefSchema" @pytest.mark.column def test_integration_object_ref_backref(): """ GIVEN schema that references another object schema with a backref and schemas WHEN column_factory is called with the schema and schemas THEN relationship with backref is returned with the spec. """ spec = {"$ref": "#/components/schemas/RefSchema"} schemas = { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "properties": {"id": {"type": "integer"}}, "x-backref": "ref_schemas", } } ([_, (_, relationship)], spec) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name="ref_schema", model_schema={"properties": {}}, ) assert relationship.backref == ("ref_schemas", {"uselist": None}) @pytest.mark.column def test_integration_object_ref_uselist(): """ GIVEN schema that references another object schema with a uselist and schemas WHEN column_factory is called with the schema and schemas THEN relationship with uselist is returned with the spec. """ spec = {"$ref": "#/components/schemas/RefSchema"} schemas = { "RefSchema": { "type": "object", "x-tablename": "ref_schema", "properties": {"id": {"type": "integer"}}, "x-backref": "ref_schemas", "x-uselist": False, } } ([_, (_, relationship)], spec) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name="ref_schema", model_schema={"properties": {}}, ) assert relationship.backref == ("ref_schemas", {"uselist": False}) @pytest.mark.column def test_integration_array_ref(): """ GIVEN schema that references another object schema from an array and schemas WHEN column_factory is called with the schema and schemas THEN foreign key reference is added to the referenced schema and relationship is returned with the spec. """ spec = {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}} schemas = { "RefSchema": { "type": "object", "x-tablename": "table 1", "properties": {"id": {"type": "integer"}}, } } model_schema = { "type": "object", "x-tablename": "schema", "properties": {"id": {"type": "integer"}}, } logical_name = "ref_schema" ([(tbl_logical_name, relationship)], spec) = column_factory.column_factory( spec=spec, schemas=schemas, logical_name=logical_name, model_schema=model_schema ) assert tbl_logical_name == logical_name assert relationship.argument == "RefSchema" assert spec == { "type": "array", "items": {"type": "object", "x-de-$ref": "RefSchema"}, } assert schemas == { "RefSchema": { "allOf": [ { "type": "object", "x-tablename": "table 1", "properties": {"id": {"type": "integer"}}, }, { "type": "object", "properties": { "schema_id": { "type": "integer", "x-foreign-key": "schema.id", "x-dict-ignore": True, } }, }, ] } } @pytest.mark.column def test_integration_array_ref_fk_def(): """ GIVEN schema that references another object schema with a foreign key already defined from an array and schemas WHEN column_factory is called with the schema and schemas THEN schemas is not modified and relationship is returned with the spec. """ spec = {"type": "array", "items": {"$ref": "#/components/schemas/RefSchema"}} schemas = { "RefSchema": { "type": "object", "x-tablename": "table 1", "properties": { "id": {"type": "integer"}, "schema_id": {"type": "integer", "x-foreign-key": "schema.id"}, }, } } model_schema = { "type": "object", "x-tablename": "schema", "properties": {"id": {"type": "integer"}}, } logical_name = "ref_schema" column_factory.column_factory( spec=spec, schemas=schemas, logical_name=logical_name, model_schema=model_schema ) assert schemas == { "RefSchema": { "type": "object", "x-tablename": "table 1", "properties": { "id": {"type": "integer"}, "schema_id": {"type": "integer", "x-foreign-key": "schema.id"}, }, } }
31.485915
88
0.589801
941
8,942
5.442083
0.093518
0.079477
0.03554
0.039055
0.866042
0.866042
0.844562
0.838703
0.79379
0.748291
0
0.001708
0.27958
8,942
283
89
31.597173
0.793232
0.209349
0
0.593909
0
0
0.218791
0.030733
0
0
0
0
0.13198
1
0.045685
false
0
0.015228
0
0.060914
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
429df70a038f138dcb03587f550961a7d2b408f9
154
py
Python
00 - basics/test.py
MIT-BECL/python-plotting-notes
ecf62a6126ac51097ed973b1fc7856dc78a48172
[ "CC-BY-4.0" ]
1
2021-06-09T17:40:05.000Z
2021-06-09T17:40:05.000Z
00 - basics/test.py
MIT-BECL/python-plotting-notes
ecf62a6126ac51097ed973b1fc7856dc78a48172
[ "CC-BY-4.0" ]
null
null
null
00 - basics/test.py
MIT-BECL/python-plotting-notes
ecf62a6126ac51097ed973b1fc7856dc78a48172
[ "CC-BY-4.0" ]
1
2021-06-09T17:43:48.000Z
2021-06-09T17:43:48.000Z
#%% Basic imports import matplotlib.pylab as plt import matplotlib.gridspec as gridspec from palettable.colorbrewer.qualitative import Dark2_7 #%% Basic
25.666667
54
0.818182
20
154
6.25
0.7
0.256
0
0
0
0
0
0
0
0
0
0.014706
0.116883
154
6
55
25.666667
0.904412
0.155844
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
c4214a843cce1da03a3dba2b39d55dc7611293cd
56
py
Python
botik/config.py
Darktimka007/botik
263c63c568cc5510b8f4ce69d43105301a91db67
[ "Apache-2.0" ]
null
null
null
botik/config.py
Darktimka007/botik
263c63c568cc5510b8f4ce69d43105301a91db67
[ "Apache-2.0" ]
null
null
null
botik/config.py
Darktimka007/botik
263c63c568cc5510b8f4ce69d43105301a91db67
[ "Apache-2.0" ]
null
null
null
TOKEN='1211663629:AAGEAv3CizRGsRdzw1a0_VxjZB5RMGBB9P8'
18.666667
54
0.892857
4
56
12.25
1
0
0
0
0
0
0
0
0
0
0
0.296296
0.035714
56
2
55
28
0.611111
0
0
0
0
0
0.836364
0.836364
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
c452eefba367b72b47f3fe0e8001fc95b8740e91
107
py
Python
morpfw/sql.py
morpframework/morpfw
b867e5809d6c52e8839586670a29fcd179ce64c7
[ "Apache-2.0" ]
8
2018-12-08T01:41:58.000Z
2020-12-21T15:30:12.000Z
morpfw/sql.py
morpframework/morpfw
b867e5809d6c52e8839586670a29fcd179ce64c7
[ "Apache-2.0" ]
17
2019-02-05T15:01:32.000Z
2020-04-28T16:17:42.000Z
morpfw/sql.py
morpframework/morpfw
b867e5809d6c52e8839586670a29fcd179ce64c7
[ "Apache-2.0" ]
2
2018-12-08T05:03:37.000Z
2019-03-20T07:15:21.000Z
from .crud.storage.pgsqlstorage import construct_orm_model from .crud.storage.sqlstorage import GUID, Base
35.666667
58
0.850467
15
107
5.933333
0.733333
0.179775
0.337079
0
0
0
0
0
0
0
0
0
0.084112
107
2
59
53.5
0.908163
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
67045bcb9814ac4aeb47a3ce8b29708f14d8d695
43,363
py
Python
PROGRAMS/IGCSEPhysicsSorting.py
KKaps-code/IGCSEPhysicsPastPaper-Sorter
e50048c5b617c80af9944d49963b18238ae7f05a
[ "MIT" ]
null
null
null
PROGRAMS/IGCSEPhysicsSorting.py
KKaps-code/IGCSEPhysicsPastPaper-Sorter
e50048c5b617c80af9944d49963b18238ae7f05a
[ "MIT" ]
null
null
null
PROGRAMS/IGCSEPhysicsSorting.py
KKaps-code/IGCSEPhysicsPastPaper-Sorter
e50048c5b617c80af9944d49963b18238ae7f05a
[ "MIT" ]
null
null
null
#IMPORTING NECESSARY LIBRARIES import tkinter as tk from tkinter import * from tkinter import filedialog from tkinter import Tk from array import * import os import time import PyPDF2 from tkinter import ttk from ttkthemes import themed_tk as theme #DEFINING IMPORTANT FUNCTIONS WHICH THE BUTTONS WOULD PERFORM def browsefn(): global file_name window1.destroy() file_name = filedialog.askopenfilename(initialdir = "/", title = "SELECT A FILE", filetypes = (("PDF","*.pdf*"), ("ALL FILES", "*.*"))) print(file_name) global window2 window2 = theme.ThemedTk() window2.get_themes() window2.set_theme("plastik") window2.title("USER INPUTS NEEDED") window2.geometry("500x200") ttk.Label(window2, text='Enter the Type of Paper (1 for Core and 2 for Extended)').grid(row=0) ttk.Label(window2, text = 'Year of this Paper').grid(row = 1) ttk.Label(window2, text = "NUMBER OF QUESTIONS").grid(row = 2) ttk.Label(window2, text = "ENTER Session - 1 for June, 2 for Novermber and 3 for March").grid(row = 3) global entry1 global entry2 global entry3 global entry4 entry1 = ttk.Entry(window2) entry2 = ttk.Entry(window2) entry3 = ttk.Entry(window2) entry4 = ttk.Entry(window2) entry1.grid(row = 0, column = 1) entry2.grid(row = 1, column = 1) entry3.grid(row = 2, column = 1) entry4.grid(row = 3, column = 1) done = ttk.Button(window2, text = "SAVE", width = 20, command = savefn) done.grid(row = 4, column = 1) exitbutton = ttk.Button(window2, text = "EXIT", width = 20, command = window2.destroy) exitbutton.grid(row = 5, column = 1) window2.mainloop() #CHECKED ABOVE - BROWSEFN HAS NO ISSUES. def savefn(): global s1 global s2 global s3 global s4 s1 = entry1.get() s2 = entry2.get() s3 = entry3.get() s4 = entry4.get() global window3 window3 = theme.ThemedTk() window3.get_themes() window3.set_theme("plastik") window3.title("QUESTION DETAILS") window3.geometry("800x600") print(s1) print(s2) if s3 == '13': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn13() elif s3 == '9': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn9() elif s3== '14': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn14() elif s3 == '10': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn10() elif s3 == '11': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn11() elif s3 == '12': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn12() elif s3 == '15': if s4 == '2': s2 = int(s2) + 50 s2 = str(s2) if s4 == '3': s2 = int(s2) + 100 s2 = str(s2) fn15() else: print("ERROR IN PAPER TYPE") #CHECKED ABOVE - SAVEFN HAS NO ISSUES. def fn15(): j = 15 i = 1 while i<=j: ttk.Label(window3, text = "ENTER TOPIC OF Q" + str(i) + " ----->").grid(row = +i, column = 0) ttk.Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global e10 global e11 global e12 global e13 global e14 global e15 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 global p10 global p11 global p12 global p13 global p14 global p15 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) e10 = ttk.Entry(window3) e10.grid(row = 10, column = 1) e11 = ttk.Entry(window3) e11.grid(row = 11, column = 1) e12 = ttk.Entry(window3) e12.grid(row = 12, column = 1) e13 = ttk.Entry(window3) e13.grid(row = 13, column = 1) e14 = ttk.Entry(window3) e14.grid(row = 14, column = 1) e15 = ttk.Entry(window3) e15.grid(row = 15, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) p10 = ttk.Entry(window3) p10.grid(row = 10, column = 3) p11 = ttk.Entry(window3) p11.grid(row = 11, column = 3) p12 = ttk.Entry(window3) p12.grid(row = 12, column = 3) p13 = ttk.Entry(window3) p13.grid(row = 13, column = 3) p14 = ttk.Entry(window3) p14.grid(row = 14, column = 3) p15 = ttk.Entry(window3) p15.grid(row = 15, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata15) save.grid(row = 16, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 17, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 18, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 19, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 20, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 21, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 22, column = 0) #FN15 HAS NO ISSUES def fn14(): global window3 j = 14 i = 1 while i<=j: ttk.Label(window3, text = "ENTER TOPIC OF Q" + str(i) + " ----->").grid(row = +i, column = 0) ttk.Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global e10 global e11 global e12 global e13 global e14 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 global p10 global p11 global p12 global p13 global p14 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) e10 = ttk.Entry(window3) e10.grid(row = 10, column = 1) e11 = ttk.Entry(window3) e11.grid(row = 11, column = 1) e12 = ttk.Entry(window3) e12.grid(row = 12, column = 1) e13 = ttk.Entry(window3) e13.grid(row = 13, column = 1) e14 = ttk.Entry(window3) e14.grid(row = 14, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) p10 = ttk.Entry(window3) p10.grid(row = 10, column = 3) p11 = ttk.Entry(window3) p11.grid(row = 11, column = 3) p12 = ttk.Entry(window3) p12.grid(row = 12, column = 3) p13 = ttk.Entry(window3) p13.grid(row = 13, column = 3) p14 = ttk.Entry(window3) p14.grid(row = 14, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata14) save.grid(row = 15, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 16, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 17, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 18, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 19, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 20, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 21, column = 0) #FN14 HAS NO ISSUES def fn13(): global window3 j = 13 i = 1 while i<=j: Label(window3, text = "ENTER TOPIC OF Q" + str(i) + " ----->").grid(row = +i, column = 0) Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global e10 global e11 global e12 global e13 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 global p10 global p11 global p12 global p13 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) e10 = ttk.Entry(window3) e10.grid(row = 10, column = 1) e11 = ttk.Entry(window3) e11.grid(row = 11, column = 1) e12 = ttk.Entry(window3) e12.grid(row = 12, column = 1) e13 = ttk.Entry(window3) e13.grid(row = 13, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) p10 = ttk.Entry(window3) p10.grid(row = 10, column = 3) p11 = ttk.Entry(window3) p11.grid(row = 11, column = 3) p12 = ttk.Entry(window3) p12.grid(row = 12, column = 3) p13 = ttk.Entry(window3) p13.grid(row = 13, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata13) save.grid(row = 14, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 15, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 16, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 17, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 18, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 19, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 20, column = 0) #FN13 HAS NO ISSUES def fn12(): j = 12 i = 1 while i<=j: ttk.Label(window3, text = "ENTER TOPIC OF Q" + str(i) + " ----->").grid(row = +i, column = 0) ttk.Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global e10 global e11 global e12 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 global p10 global p11 global p12 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) e10 = ttk.Entry(window3) e10.grid(row = 10, column = 1) e11 = ttk.Entry(window3) e11.grid(row = 11, column = 1) e12 = ttk.Entry(window3) e12.grid(row = 12, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) p10 = ttk.Entry(window3) p10.grid(row = 10, column = 3) p11 = ttk.Entry(window3) p11.grid(row = 11, column = 3) p12 = ttk.Entry(window3) p12.grid(row = 12, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata12) save.grid(row = 13, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 14, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 15, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 16, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 17, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 18, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 19, column = 0) #FN12 HAS NO ISSUES def fn11(): j = 11 i = 1 while i<=j: ttk.Label(window3, text = "ENTER TOPIC OF Q" + str(i) + " ----->").grid(row = +i, column = 0) ttk.Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global e10 global e11 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 global p10 global p11 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) e10 = ttk.Entry(window3) e10.grid(row = 10, column = 1) e11 = ttk.Entry(window3) e11.grid(row = 11, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) p10 = ttk.Entry(window3) p10.grid(row = 10, column = 3) p11 = ttk.Entry(window3) p11.grid(row = 11, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata11) save.grid(row = 12, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 13, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 14, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 15, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 16, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 17, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 18, column = 0) #FN11 HAS NO ISSUES def fn10(): j=10 i=1 while i<=j: ttk.Label(window3, text = "ENTER TOPIC OF Q" + str(i) + " ----->").grid(row = +i, column = 0) ttk.Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global e10 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 global p10 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) e10 = ttk.Entry(window3) e10.grid(row = 10, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) p10 = ttk.Entry(window3) p10.grid(row = 10, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata10) save.grid(row = 11, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 12, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 13, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 14, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 15, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 16, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 17, column = 0) #FN10 HAS NO ISSUES def fn9(): i = 1 j = 9 while i<=j: ttk.Label(window3, text = "ENTER TOPIC OF QUESTION" + str(i) + " ----->").grid(row = +i, column = 0) ttk.Label(window3, text = "ENTER PAGE OF THE BEGINNING OF THE QUESTION ----->").grid(row = +i, column = 2) i+=1 global e1 global e2 global e3 global e4 global e5 global e6 global e7 global e8 global e9 global p1 global p2 global p3 global p4 global p5 global p6 global p7 global p8 global p9 e1 = ttk.Entry(window3) e1.grid(row = 1, column = 1) e2 = ttk.Entry(window3) e2.grid(row = 2, column = 1) e3 = ttk.Entry(window3) e3.grid(row = 3, column = 1) e4 = ttk.Entry(window3) e4.grid(row = 4, column = 1) e5 = ttk.Entry(window3) e5.grid(row = 5, column = 1) e6 = ttk.Entry(window3) e6.grid(row = 6, column = 1) e7 = ttk.Entry(window3) e7.grid(row = 7, column = 1) e8 = ttk.Entry(window3) e8.grid(row = 8, column = 1) e9 = ttk.Entry(window3) e9.grid(row = 9, column = 1) p1 = ttk.Entry(window3) p1.grid(row = 1, column = 3) p2 = ttk.Entry(window3) p2.grid(row = 2, column = 3) p3 = ttk.Entry(window3) p3.grid(row = 3, column = 3) p4 = ttk.Entry(window3) p4.grid(row = 4, column = 3) p5 = ttk.Entry(window3) p5.grid(row = 5, column = 3) p6 = ttk.Entry(window3) p6.grid(row = 6, column = 3) p7 = ttk.Entry(window3) p7.grid(row = 7, column = 3) p8 = ttk.Entry(window3) p8.grid(row = 8, column = 3) p9 = ttk.Entry(window3) p9.grid(row = 9, column = 3) save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata9) save.grid(row = 10, column = 1) ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 11, column = 0) ttk.Label(window3, text = "seperate both with a space").grid(row = 12, column = 0) ttk.Label(window3, text = "2. When entering the PDF baginning page").grid(row = 13, column = 0) ttk.Label(window3, text = "Enter the page at the top, but subtract 1 from it").grid(row = 14, column = 0) ttk.Label(window3, text = "So, if the page number at top is 2").grid(row = 15, column = 0) ttk.Label(window3, text = "enter the beginning page as 1").grid(row = 16, column = 0) #FN9 HAS NO ISSUES def savedata11(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() string10 = e10.get() string11 = e11.get() page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() page10 = p10.get() page11 = p11.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("10. " + string10 + "\n") f.write(" 10P. " + page10 + "\n") f.write("11. " + string11 + "\n") f.write(" 11P. " + page11 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) window3.destroy() #CHECKED - SAVEDATA11 HAS NO ISSUES def savedata15(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() string10 = e10.get() string11 = e11.get() string12 = e12.get() string13 = e13.get() string14 = e14.get() string15 = e15.get() page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() page10 = p10.get() page11 = p11.get() page12 = p12.get() page13 = p13.get() page14 = p14.get() page15 = p15.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("10. " + string10 + "\n") f.write(" 10P. " + page10 + "\n") f.write("11. " + string11 + "\n") f.write(" 11P. " + page11 + "\n") f.write("12. " + string12 + "\n") f.write(" 12P. " + page12 + "\n") f.write("13. " + string13 + "\n") f.write(" 13P. " + page13 + "\n") f.write("14. " + string14 + "\n") f.write(" 14P. " + page14 + "\n") f.write("15. " + string15 + "\n") f.write(" 15P. " + page15 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) def savedata14(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() string10 = e10.get() string11 = e11.get() string12 = e12.get() string13 = e13.get() string14 = e14.get() page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() page10 = p10.get() page11 = p11.get() page12 = p12.get() page13 = p13.get() page14 = p14.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("10. " + string10 + "\n") f.write(" 10P. " + page10 + "\n") f.write("11. " + string11 + "\n") f.write(" 11P. " + page11 + "\n") f.write("12. " + string12 + "\n") f.write(" 12P. " + page12 + "\n") f.write("13. " + string13 + "\n") f.write(" 13P. " + page13 + "\n") f.write("14. " + string14 + "\n") f.write(" 14P. " + page14 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) #CHECKED - SAVEDATA14 HAS NO ISSUES def savedata13(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() string10 = e10.get() string11 = e11.get() string12 = e12.get() string13 = e13.get() page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() page10 = p10.get() page11 = p11.get() page12 = p12.get() page13 = p13.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("10. " + string10 + "\n") f.write(" 10P. " + page10 + "\n") f.write("11. " + string11 + "\n") f.write(" 11P. " + page11 + "\n") f.write("12. " + string12 + "\n") f.write(" 12P. " + page12 + "\n") f.write("13. " + string13 + "\n") f.write(" 13P. " + page13 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) #CHECKED - SAVEDATA13 HAS NO ISSUES def savedata12(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() string10 = e10.get() string11 = e11.get() string12 = e12.get page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() page10 = p10.get() page11 = p11.get() page12 = p12.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("10. " + string10 + "\n") f.write(" 10P. " + page10 + "\n") f.write("11. " + string11 + "\n") f.write(" 11P. " + page11 + "\n") f.write("12. " + string12 + "\n") f.write(" 12P. " + page12 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) def savedata10(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() string10 = e10.get() page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() page10 = p10.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("10. " + string10 + "\n") f.write(" 10P. " + page10 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) window3.destroy() #CHECKED SAVEDATA10 HAS NO ISSUES def savedata9(): string1 = e1.get() string2 = e2.get() string3 = e3.get() string4 = e4.get() string5 = e5.get() string6 = e6.get() string7 = e7.get() string8 = e8.get() string9 = e9.get() page1 = p1.get() page2 = p2.get() page3 = p3.get() page4 = p4.get() page5 = p5.get() page6 = p6.get() page7 = p7.get() page8 = p8.get() page9 = p9.get() path = "" + str(s1) name = os.path.join(path, s2 + ".txt") f = open(name, "w+") f.write("1. " + string1 + "\n") f.write(" 1P. " + page1 + "\n") f.write("2. " + string2 + "\n") f.write(" 2P. " + page2 + "\n") f.write("3. " + string3 + "\n") f.write(" 3P. " + page3 + "\n") f.write("4. " + string4 + "\n") f.write(" 4P. " + page4 + "\n") f.write("5. " + string5 + "\n") f.write(" 5P. " + page5 + "\n") f.write("6. " + string6 + "\n") f.write(" 6P. " + page6 + "\n") f.write("7. " + string7 + "\n") f.write(" 7P. " + page7 + "\n") f.write("8. " + string8 + "\n") f.write(" 8P. " + page8 + "\n") f.write("9. " + string9 + "\n") f.write(" 9P. " + page9 + "\n") f.write("path:" + file_name + "\n") f.write("total:" + str(s3)) window3.destroy() #CHECKED SAVEDATA9 HAS NO ISSUES def choice(): global window5 window5 = theme.ThemedTk() window5.get_themes() window5.set_theme("plastik") window5.title("USER CHOICE") window5.geometry("500x300") #window5.config(bg = "#434340") ttk.Label(window5, text = "ENTER THE TOPIC YOU WANT QUESTIONS FROM").grid(row = 0) ttk.Label(window5, text = "ENTER 1 for Core and 2 for Extended").grid(row = 1) ttk.Label(window5, text = "IF ENTERING 2 TOPICS FOR SEARCH, DOUBLE SPACE BETWEEN THEM").grid(row = 3) global input1 global input2 input1 = ttk.Entry(window5) input2 = ttk.Entry(window5) input1.grid(row = 0, column = 1) input2.grid(row = 1, column = 1) next1 = ttk.Button(window5, text = "SEARCH", width = 20, command = choiceprocess1) next1.grid(row = 2, column = 1) window5.mainloop() def choiceprocess1(): global choice1 global choice2 choice1 = input1.get() choice2 = input2.get() print(choice1) print(choice2) choiceprocess2() window5.destroy() def choiceprocess2(): if choice2 == 3: global path_file1 path_file1 = "" + str(choice2) presortfunction1() elif choice2 == 4: global path_file2 path_file2 = "" + str(choice2) presortfunction1() def presortfunction1(): path_file2 = "" + str(choice2) global arr global z1 global reqcon global recqon global retcon global k global name_full global a global b global d global l global finalarr global totalquestions d = [] b = [] a = [] arr = [] finalarr =[] l = -1 k = 10 choice = " " + choice1 while k<=30: name_file = "20" + str(k) name_full = os.path.join(path_file2, name_file + ".txt") x = os.path.isfile(name_full) k+=1 if x == True: arr.append(name_file) y = open(name_full, 'r') content = y.readlines() for con in content: sel = con.find(" ") sel2 = sel-3 if con[sel2] != "P": if choice in con: sel3 = con.find('.') reqcon = con[0:sel3] arr.append(reqcon) recqon = int(reqcon) + 1 retcon = recqon + 1 totaldetection() l+=1 presortfunction2() presortfunction4() presortfunction3() elif x == False: print("FILE NOT FOUND " + name_file) print(arr) print("THIS IS" + str(a)) print("THIS IS " + str(b)) searchfn() print("THIS IS: " + str(c)) print(len(arr)) print(d) fileremover() def totaldetection(): global totalquestions searterm = "total:" k2 = open(name_full, 'r') linecon = k2.readlines() for line in linecon: findit = line.find(str(searterm)) if findit != -1: ind = line.index(":") k3 = len(line) totalquestions = line[(ind+1):(k3)] totalquestions = int(totalquestions) print(totalquestions) def presortfunction2(): term_search = " " + str(reqcon) + "P" y2 = open(name_full, 'r') linecon = y2.readlines() for line in linecon: findit = line.find(str(term_search)) if findit != -1: sel4 = line.index('.') y3 = len(line) printcon = line[(sel4+2):(y3-1)] a.append(printcon) def presortfunction3(): t = totalquestions + 1 searchterm = " " + str(recqon) + "P" notsearch = " " + str(t) + "P" y4 = open(name_full, 'r') linecon = y4.readlines() for line in linecon: findit = line.find(str(searchterm)) if findit != -1: sel4 = line.index('.') y5 = len(line) printcon = line[(sel4+2):(y5-1)] b.append(printcon) elif searchterm == notsearch: print(l) path = d[l] pdfFileObject = open(path, 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObject) totalpages = pdfReader.getNumPages() b.append(totalpages) break def searchfn(): global c global o c = [] o = 0 sl = 2010 while (sl<=2030): hl = str(sl) for terms in arr: if terms == hl: jl = arr.index(hl) print("SUCCESS") c.append(jl) o+=1 sl+=1 c.append(len(arr)) finalsortfunction() def presortfunction4(): global pathcon term_of_search = "path:" y6 = open(name_full, 'r') linecon = y6.readlines() for line in linecon: findterm = line.find(str(term_of_search)) if findterm != -1: sel4 = line.index(":") y7 = len(line) printcon = line[(sel4+1):(y7-1)] pathcon = str(printcon) print(pathcon) d.append(pathcon) def finalsortfunction(): global r1 global r2 global newval global oldval global m m = 0 p = 0 q = 1 z = 0 f = 0 oldval = 0 while q<=o: x1 = c[p] x2 = c[q] x = x2-x1 x = x - 1 f = f + x newval = d while z<f: r1 = a[z] r2 = b[z] z+=1 print(r1) print(r2) print(f) print( ) pdfextraction() m+=1 p+=1 q+=1 oldval = f def pdfextraction(): print(m) path = d[m] pdfFileObject = open(path, 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObject) start = int(r1) end = int(r2) pdfWriter = PyPDF2.PdfFileWriter() if m<len(b): file_output = "OUTPUT" + str(m) + ".pdf" path_input = d[m] pdfFileObject = open(path, 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObject) for page in range (start, end): pdfWriter.addPage(pdfReader.getPage(page)) with open(file_output, "wb") as f: pdfWriter.write(f) finalarr.append(file_output) pdfmerger2() def pdfmerger2(): path_final = "" + "/IGCSE" output_file = 'TOPIC' + str(choice1) + " QUESTIONS LOADED.pdf" output_final = os.path.join(path_final, output_file) print(finalarr) pdfMerger = PyPDF2.PdfFileMerger() for pdf in finalarr: pdfMerger.append(pdf) with open(output_final, 'wb') as f: pdfMerger.write(f) pdfMerger.close() def fileremover(): for s in finalarr: os.remove(s) window1 = theme.ThemedTk() window1.get_themes() window1.set_theme("plastik") window1.title("TASK") window1.geometry("400x200") window1.configure(bg = 'white') browse = ttk.Button(window1, text = "LOAD", width = 40, command = browsefn) browse.pack() access = ttk.Button(window1, text = "ACCESS", width = 40, command = choice) access.pack() escape = ttk.Button(window1, text = "EXIT", width = 40, command = window1.destroy) escape.pack() window1.mainloop()
31.513808
140
0.517377
5,999
43,363
3.730955
0.065344
0.07725
0.054731
0.04584
0.775981
0.752346
0.748235
0.748235
0.745376
0.73501
0
0.096667
0.321288
43,363
1,375
141
31.536727
0.663824
0.011162
0
0.711127
0
0
0.096539
0
0
0
0
0
0
1
0.021371
false
0
0.007369
0
0.02874
0.021371
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
6714de5c193cac13897eb0a805817eeef907edf9
46
py
Python
autogoal/experimental/augly_tony/semantic/__init__.py
70nybl4nc0/autogoal
4fc95a451ee3c0a2893de315fdb27e32e3288b41
[ "MIT" ]
null
null
null
autogoal/experimental/augly_tony/semantic/__init__.py
70nybl4nc0/autogoal
4fc95a451ee3c0a2893de315fdb27e32e3288b41
[ "MIT" ]
null
null
null
autogoal/experimental/augly_tony/semantic/__init__.py
70nybl4nc0/autogoal
4fc95a451ee3c0a2893de315fdb27e32e3288b41
[ "MIT" ]
null
null
null
from _image import Image from _audio import *
15.333333
24
0.804348
7
46
5
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.173913
46
2
25
23
0.921053
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
672543a33a00f0382306f35be79fe7be4229a870
4,882
py
Python
z2/part2/batch/jm/parser_errors_2/140921606.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
1
2020-04-16T12:13:47.000Z
2020-04-16T12:13:47.000Z
z2/part2/batch/jm/parser_errors_2/140921606.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
18
2020-03-06T17:50:15.000Z
2020-05-19T14:58:30.000Z
z2/part2/batch/jm/parser_errors_2/140921606.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
18
2020-03-06T17:45:13.000Z
2020-06-09T19:18:31.000Z
from part1 import ( gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new, ) """ scenario: test_random_actions uuid: 140921606 """ """ random actions, total chaos """ board = gamma_new(5, 5, 2, 15) assert board is not None assert gamma_move(board, 1, 4, 3) == 1 assert gamma_free_fields(board, 1) == 24 assert gamma_move(board, 2, 0, 3) == 1 assert gamma_move(board, 2, 0, 0) == 1 assert gamma_free_fields(board, 2) == 22 assert gamma_move(board, 1, 3, 1) == 1 assert gamma_busy_fields(board, 1) == 2 assert gamma_move(board, 2, 4, 2) == 1 assert gamma_move(board, 2, 4, 2) == 0 assert gamma_move(board, 1, 2, 4) == 1 board664977355 = gamma_board(board) assert board664977355 is not None assert board664977355 == ("..1..\n" "2...1\n" "....2\n" "...1.\n" "2....\n") del board664977355 board664977355 = None assert gamma_golden_possible(board, 1) == 1 assert gamma_move(board, 2, 2, 2) == 1 assert gamma_move(board, 1, 0, 1) == 1 assert gamma_busy_fields(board, 2) == 4 assert gamma_move(board, 1, 2, 3) == 1 board921107473 = gamma_board(board) assert board921107473 is not None assert board921107473 == ("..1..\n" "2.1.1\n" "..2.2\n" "1..1.\n" "2....\n") del board921107473 board921107473 = None assert gamma_move(board, 2, 0, 0) == 0 assert gamma_move(board, 1, 3, 3) == 1 assert gamma_busy_fields(board, 1) == 6 assert gamma_move(board, 2, 0, 3) == 0 assert gamma_move(board, 2, 4, 4) == 1 assert gamma_free_fields(board, 2) == 14 assert gamma_golden_possible(board, 2) == 1 assert gamma_move(board, 1, 0, 1) == 0 assert gamma_move(board, 1, 2, 4) == 0 assert gamma_golden_possible(board, 1) == 1 assert gamma_move(board, 2, 2, 0) == 1 assert gamma_free_fields(board, 2) == 13 assert gamma_move(board, 1, 2, 0) == 0 assert gamma_move(board, 1, 4, 3) == 0 assert gamma_move(board, 2, 2, 2) == 0 assert gamma_busy_fields(board, 2) == 6 assert gamma_move(board, 1, 0, 1) == 0 assert gamma_move(board, 1, 4, 2) == 0 assert gamma_move(board, 2, 4, 3) == 0 assert gamma_move(board, 2, 0, 4) == 1 assert gamma_move(board, 2, 0, 4) == 0 assert gamma_free_fields(board, 2) == 12 assert gamma_golden_possible(board, 2) == 1 assert gamma_move(board, 1, 2, 1) == 1 assert gamma_move(board, 1, 4, 4) == 0 assert gamma_free_fields(board, 1) == 11 assert gamma_move(board, 2, 2, 0) == 0 assert gamma_golden_possible(board, 2) == 1 assert gamma_move(board, 2, 0, 3) == 0 assert gamma_move(board, 2, 0, 1) == 0 assert gamma_move(board, 1, 2, 0) == 0 assert gamma_move(board, 1, 2, 2) == 0 assert gamma_golden_move(board, 1, 0, 0) == 1 assert gamma_move(board, 2, 4, 1) == 1 assert gamma_move(board, 2, 0, 0) == 0 board711496724 = gamma_board(board) assert board711496724 is not None assert board711496724 == ("2.1.2\n" "2.111\n" "..2.2\n" "1.112\n" "1.2..\n") del board711496724 board711496724 = None assert gamma_move(board, 1, 4, 1) == 0 assert gamma_move(board, 1, 2, 2) == 0 assert gamma_busy_fields(board, 1) == 8 assert gamma_move(board, 2, 1, 1) == 1 assert gamma_golden_move(board, 2, 3, 4) == 0 assert gamma_free_fields(board, 1) == 9 assert gamma_move(board, 2, 4, 3) == 0 assert gamma_move(board, 1, 0, 4) == 0 assert gamma_move(board, 1, 4, 1) == 0 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_golden_move(board, 2, 3, 2) == 0 assert gamma_move(board, 1, 2, 0) == 0 assert gamma_golden_possible(board, 1) == 0 assert gamma_golden_move(board, 1, 0, 2) == 0 assert gamma_move(board, 2, 4, 3) == 0 assert gamma_move(board, 2, 4, 2) == 0 assert gamma_busy_fields(board, 2) == 8 assert gamma_move(board, 1, 0, 3) == 0 assert gamma_move(board, 1, 1, 0) == 1 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 2, 4, 1) == 0 assert gamma_move(board, 1, 3, 2) == 1 assert gamma_move(board, 1, 3, 0) == 1 assert gamma_move(board, 2, 2, 0) == 0 assert gamma_move(board, 2, 0, 2) == 1 assert gamma_golden_possible(board, 2) == 1 assert gamma_move(board, 1, 4, 1) == 0 assert gamma_move(board, 2, 1, 3) == 1 assert gamma_golden_possible(board, 1) == 0 assert gamma_move(board, 2, 2, 0) == 0 board301295344 = gamma_board(board) assert board301295344 is not None assert board301295344 == ("2.1.2\n" "22111\n" "2.212\n" "12112\n" "1121.\n") del board301295344 board301295344 = None assert gamma_move(board, 1, 2, 3) == 0 assert gamma_move(board, 1, 3, 1) == 0 assert gamma_move(board, 2, 4, 3) == 0 assert gamma_move(board, 2, 0, 4) == 0 assert gamma_golden_possible(board, 2) == 1 board105840524 = gamma_board(board) assert board105840524 is not None assert board105840524 == ("2.1.2\n" "22111\n" "2.212\n" "12112\n" "1121.\n") del board105840524 board105840524 = None assert gamma_golden_possible(board, 1) == 0 assert gamma_move(board, 2, 0, 4) == 0 gamma_delete(board)
29.059524
46
0.671651
867
4,882
3.626298
0.062284
0.304389
0.28626
0.381679
0.74173
0.731234
0.704198
0.550573
0.428117
0.408079
0
0.153351
0.171856
4,882
167
47
29.233533
0.624289
0
0
0.344828
0
0
0.036504
0
0
0
0
0
0.675862
1
0
false
0
0.006897
0
0.006897
0
0
0
0
null
1
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
6
6742738da0b50bd2501e57d98c566967d338a704
13,470
py
Python
tests/test_setpoints.py
PeteRager/lennoxs30api
e210b4fd9098c195d02b30c19733b5ead46aaf2c
[ "MIT" ]
6
2021-06-05T02:50:21.000Z
2021-11-28T23:08:41.000Z
tests/test_setpoints.py
PeteRager/lennoxs30api
e210b4fd9098c195d02b30c19733b5ead46aaf2c
[ "MIT" ]
12
2021-07-16T00:28:59.000Z
2021-11-20T22:52:51.000Z
tests/test_setpoints.py
PeteRager/lennoxs30api
e210b4fd9098c195d02b30c19733b5ead46aaf2c
[ "MIT" ]
2
2021-10-30T04:44:48.000Z
2021-10-30T14:43:04.000Z
from unittest import mock from lennoxs30api.s30api_async import lennox_zone, s30api_async, lennox_system from lennoxs30api.lennox_home import lennox_home import json import os import unittest import asyncio from unittest.mock import patch def loadfile(name) -> json: script_dir = os.path.dirname(__file__) + "/messages/" file_path = os.path.join(script_dir, name) with open(file_path) as f: data = json.load(f) return data def setup_load_configuration(single_setpoint: bool = False) -> s30api_async: asyncio.set_event_loop(asyncio.new_event_loop()) api = s30api_async("myemail@email.com", "mypassword", None) data = loadfile("login_response.json") api.process_login_response(data) data = loadfile("config_response_system_01.json") api.processMessage(data) data = loadfile("config_response_system_02.json") api.processMessage(data) if single_setpoint == True: data = loadfile("equipments_lcc_singlesetpoint.json") data["SenderID"] = "0000000-0000-0000-0000-000000000001" else: data = loadfile("equipments_lcc_splitsetpoint.json") data["SenderID"] = "0000000-0000-0000-0000-000000000001" api.processMessage(data) return api def test_hsp_f(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == False zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_hsp=71)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["hsp"] == 71 assert tPeriod["hspC"] == 21.5 schedule = lsystem.getSchedule(zone.getManualModeScheduleId()) zperiod = schedule.getPeriod(0) assert tPeriod["csp"] == zperiod.csp assert tPeriod["cspC"] == zperiod.cspC def test_hsp_c(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == False zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_hspC=21.5)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["hsp"] == 71 assert tPeriod["hspC"] == 21.5 schedule = lsystem.getSchedule(zone.getManualModeScheduleId()) zperiod = schedule.getPeriod(0) assert tPeriod["csp"] == zperiod.csp assert tPeriod["cspC"] == zperiod.cspC def test_csp_f(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == False zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_csp=73)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["csp"] == 73 assert tPeriod["cspC"] == 23 schedule = lsystem.getSchedule(zone.getManualModeScheduleId()) zperiod = schedule.getPeriod(0) assert tPeriod["hsp"] == zperiod.hsp assert tPeriod["hspC"] == zperiod.hspC def test_csp_c(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.single_setpoint_mode == False assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_cspC=23)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["csp"] == 73 assert tPeriod["cspC"] == 23 schedule = lsystem.getSchedule(zone.getManualModeScheduleId()) zperiod = schedule.getPeriod(0) assert tPeriod["hsp"] == zperiod.hsp assert tPeriod["hspC"] == zperiod.hspC def test_hcsp_f(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == False zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_hsp=64, r_csp=78)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["csp"] == 78 assert tPeriod["cspC"] == 25.5 assert tPeriod["hsp"] == 64 assert tPeriod["hspC"] == 18 assert len(tPeriod) == 4 def test_hcsp_c(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == False zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_hspC=18, r_cspC=25.5)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["csp"] == 78 assert tPeriod["cspC"] == 25.5 assert tPeriod["hsp"] == 64 assert tPeriod["hspC"] == 18 assert len(tPeriod) == 4 def test_sp_f(): api = setup_load_configuration(single_setpoint=True) lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == True zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_sp=78)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["sp"] == 78 assert tPeriod["spC"] == 25.5 assert len(tPeriod) == 2 def test_sp_c(): api = setup_load_configuration(True) lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == True zone: lennox_zone = lsystem.getZone(0) with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_spC=25.5)) loop.close() mock_message_helper.assert_called_once() arg0 = mock_message_helper.await_args[0][0] assert arg0 == lsystem.sysId arg1 = mock_message_helper.await_args[0][1] jsbody = json.loads("{" + arg1 + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getManualModeScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["sp"] == 78 assert tPeriod["spC"] == 25.5 assert len(tPeriod) == 2 def test_override(): api = setup_load_configuration() lsystem: lennox_system = api.getSystems()[0] assert lsystem.sysId == "0000000-0000-0000-0000-000000000001" assert lsystem.single_setpoint_mode == False zone: lennox_zone = lsystem.getZone(0) # In the default config all zones are in manual mode, here we fake it to follow the "summer" scheduled # such that an override schedule will need to be created. zone.scheduleId = 1 with patch.object(api, "publishMessageHelper") as mock_message_helper: loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_hsp=71)) assert mock_message_helper.call_count == 2 # First message should be the configuration of the schedule override m1 = mock_message_helper.call_args_list[0] sysId = m1.args[0] message = m1.args[1] assert sysId == lsystem.sysId jsbody = json.loads("{" + message + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getOverrideScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["hsp"] == 71 assert tPeriod["hspC"] == 21.5 assert tPeriod["desp"] == zone.desp assert tPeriod["cspC"] == zone.cspC assert tPeriod["csp"] == zone.csp assert tPeriod["sp"] == zone.sp assert tPeriod["husp"] == zone.husp assert tPeriod["humidityMode"] == zone.humidityMode assert tPeriod["systemMode"] == zone.systemMode assert tPeriod["spC"] == zone.spC assert tPeriod["startTime"] == zone.startTime assert tPeriod["fanMode"] == zone.fanMode # Second message should set the zone to follow this schedule m2 = mock_message_helper.call_args_list[1] sysId = m2.args[0] message = m2.args[1] assert sysId == lsystem.sysId jsbody = json.loads("{" + message + "}") tZone = jsbody["Data"]["zones"][0] assert tZone["id"] == zone.id hold = tZone["config"]["scheduleHold"] assert hold["scheduleId"] == zone.getOverrideScheduleId() assert hold["exceptionType"] == "hold" assert hold["enabled"] == True assert hold["expiresOn"] == "0" assert hold["expirationMode"] == "nextPeriod" assert len(hold) == 5 # Test a setpoint when the zone is already override with patch.object(api, "publishMessageHelper") as mock_message_helper: # Fake the zone to think it is in override mode. zone.scheduleId = zone.getOverrideScheduleId() loop = asyncio.get_event_loop() result = loop.run_until_complete(zone.perform_setpoint(r_csp=75)) loop.close() assert mock_message_helper.call_count == 1 m1 = mock_message_helper.call_args_list[0] sysId = m1.args[0] message = m1.args[1] assert sysId == lsystem.sysId jsbody = json.loads("{" + message + "}") tSchedule = jsbody["Data"]["schedules"][0] assert tSchedule["id"] == zone.getOverrideScheduleId() tPeriod = tSchedule["schedule"]["periods"][0]["period"] assert tPeriod["csp"] == 75 assert tPeriod["cspC"] == 24 assert tPeriod["hsp"] == zone.hsp assert tPeriod["hspC"] == zone.hspC assert len(tPeriod) == 4
40.208955
106
0.653601
1,603
13,470
5.311915
0.113537
0.067176
0.077863
0.041339
0.796829
0.78485
0.762772
0.762772
0.745978
0.738931
0
0.054439
0.217223
13,470
334
107
40.329341
0.75313
0.028137
0
0.731183
0
0
0.109752
0.039132
0
0
0
0
0.376344
1
0.039427
false
0.003584
0.028674
0
0.075269
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
676ca2551c129ec69a32d872cc428ee5cdc043db
248
py
Python
discord_exchange/__init__.py
MiltFra/discord-exchange
66764a22b74a09ab2f8704884164a5deadddb17a
[ "Apache-2.0" ]
null
null
null
discord_exchange/__init__.py
MiltFra/discord-exchange
66764a22b74a09ab2f8704884164a5deadddb17a
[ "Apache-2.0" ]
null
null
null
discord_exchange/__init__.py
MiltFra/discord-exchange
66764a22b74a09ab2f8704884164a5deadddb17a
[ "Apache-2.0" ]
null
null
null
from discord_exchange.orderbook import Orderbook from discord_exchange.orderbook import Trade from discord_exchange.orderbook import Order from discord_exchange.binary_exchange import BinaryExchange __version__ = "0.0.1" __author__ = "Franz Miltz"
35.428571
59
0.858871
32
248
6.25
0.46875
0.22
0.38
0.42
0.51
0
0
0
0
0
0
0.013333
0.092742
248
7
60
35.428571
0.875556
0
0
0
0
0
0.064257
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
6
679124d19e07b756c3d2aa1802e01d3d10935075
28
py
Python
p.py
codio-packs/tkinter-widgets
c35886b7b3a9ca49f0af8a47c8c21e84c117e512
[ "MIT" ]
1
2019-09-17T07:35:43.000Z
2019-09-17T07:35:43.000Z
p.py
codio-packs/tkinter-widgets
c35886b7b3a9ca49f0af8a47c8c21e84c117e512
[ "MIT" ]
null
null
null
p.py
codio-packs/tkinter-widgets
c35886b7b3a9ca49f0af8a47c8c21e84c117e512
[ "MIT" ]
null
null
null
import sys print (sys.argv)
9.333333
16
0.75
5
28
4.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.142857
28
2
17
14
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
6
67a18f5a1d42e66a1e02e7dff739af2e1a6a9a2e
200
py
Python
py_tests/test_template_filters.py
tiesjan/url-shortener
395ffc7b88dfe97c88914e8c4047690185b54ea7
[ "BSD-3-Clause" ]
null
null
null
py_tests/test_template_filters.py
tiesjan/url-shortener
395ffc7b88dfe97c88914e8c4047690185b54ea7
[ "BSD-3-Clause" ]
null
null
null
py_tests/test_template_filters.py
tiesjan/url-shortener
395ffc7b88dfe97c88914e8c4047690185b54ea7
[ "BSD-3-Clause" ]
null
null
null
from url_shortener.template_filters import pluralize def test_pluralize(): assert pluralize(0) == 's' assert pluralize(1) == '' assert pluralize(2) == 's' assert pluralize(3) == 's'
22.222222
52
0.66
25
200
5.16
0.6
0.465116
0.248062
0
0
0
0
0
0
0
0
0.025
0.2
200
8
53
25
0.78125
0
0
0
0
0
0.015
0
0
0
0
0
0.666667
1
0.166667
true
0
0.166667
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
0
0
0
0
0
6
67d78b6a0e7d301305644683f2638977cdf4c155
5,756
py
Python
animations/factorizations.py
bnels/cse21
daad575743bfa7c025c507b3a18a3dff445ca385
[ "MIT" ]
1
2021-04-08T17:00:32.000Z
2021-04-08T17:00:32.000Z
animations/factorizations.py
bnels/cse21
daad575743bfa7c025c507b3a18a3dff445ca385
[ "MIT" ]
null
null
null
animations/factorizations.py
bnels/cse21
daad575743bfa7c025c507b3a18a3dff445ca385
[ "MIT" ]
null
null
null
from manim import * from manim_reveal import SlideScene from manimtda.linalg.shapes import * from manimtda.utils import * def EUmat(color=WHITE): return VGroup( Square(color=color), Line(np.array([-1,1,0]), np.array([-0.3,0.3,0]),color=color), Line(np.array([0,0.3,0]), np.array([0.3,0,0]),color=color) ) def EUhat(color=WHITE): EU = ELmat(color) EU.rotate(180*DEGREES,about_point=np.array([0,0,0])) return EU def ELhat(color=WHITE): EL = EUmat(color) EL.rotate(180*DEGREES,about_point=np.array([0,0,0])) return EL class EFact(VMobject): """ Generic class for LEUP/PUEL etc. factorizations child classes should implement list order """ def __init__(self,A,Arr,Emat,**kwargs): self.angle = kwargs.get("angle", 0.0) self.A = A self.L = Lmat(corner_radius=0.01) self.U = Umat(corner_radius=0.01) self.E = Emat(color=BLACK) self.P = Pmat(color=BLACK) lst = self._create_list() mats=Grp(*lst) scale = kwargs.get("scale", 0.2) self.scale=scale mats.scale(scale) mats.rotate(self.angle) mats.next_to(self.A,0,buff=SMALL_BUFF) P_loc = kwargs.get("P_loc", RIGHT) self.P.next_to(A,0) self.P.shift(self._rotate_loc(3*scale*P_loc)) VMobject.__init__(self, **kwargs) self.add(*lst) self.lst = lst self.Arr = Arr def _rotate_loc(self, loc): ca = np.cos(self.angle) sa = np.sin(self.angle) return np.array([ ca*loc[0] - sa*loc[1], sa*loc[0] + ca*loc[1], loc[2] ]) def __call__(self): return self.lst def _create_list(self): """ return list of matrices in order """ pass def make_target(self): mats = copy_objs(self.lst) Seq(*mats).anchor_position(1,buff=self.scale*SMALL_BUFF) Grp(*mats).next_to(self.A,0,buff=SMALL_BUFF) Seq(*mats).rotate(self.angle) self.target=mats self.target_pos=[m.get_center() for m in mats] def animations1(self): return ShowCreation(self.L), ShowCreation(self.U), ShowCreation(self.P) def animations2(self): self.make_target() return (*MoveTo(self.lst, self.target), FadeOut(self.A)) def play_factorize(self,scene, **kw): scene.play( *self.animations1(), **kw ) scene.play( *self.animations2(), **kw ) class LEUPFact(EFact): def __init__(self,A,Arr,**kwargs): super().__init__(A, Arr, ELmat, P_loc=RIGHT, **kwargs) def _create_list(self): """ return list of matrices in order """ return [self.L, self.E, self.U, self.P] class PLEUFact(EFact): def __init__(self, A, Arr, **kwargs): super().__init__(A, Arr, EUmat, P_loc=LEFT, **kwargs) def _create_list(self): """ return list of matrices in order """ return [self.P, self.L, self.E, self.U] class PUELFact(EFact): def __init__(self, A, Arr, **kwargs): super().__init__(A, Arr, ELhat, P_loc=LEFT, **kwargs) def _create_list(self): """ return list of matrices in order """ return [self.P, self.U, self.E, self.L] class UELPFact(EFact): def __init__(self, A, Arr, **kwargs): super().__init__(A, Arr, EUhat, P_loc=RIGHT, **kwargs) def _create_list(self): """ return list of matrices in order """ return [self.U, self.E, self.L, self.P] class LUTypeFact(VMobject): """ LQU factorization child classes should implement list order """ def __init__(self,A,Arr,**kwargs): self.angle = kwargs.get("angle", 0.0) self.A = A self.L = Lmat(corner_radius=0.01) self.U = Umat(corner_radius=0.01) self.Q = Pmat(color=BLACK) lst = self._create_list() mats=Grp(*lst) scale = kwargs.get("scale", 0.2) self.scale=scale mats.scale(scale) mats.rotate(self.angle) mats.next_to(self.A,0,buff=SMALL_BUFF) VMobject.__init__(self, **kwargs) self.add(*lst) self.lst = lst self.Arr = Arr def _rotate_loc(self, loc): ca = np.cos(self.angle) sa = np.sin(self.angle) return np.array([ ca*loc[0] - sa*loc[1], sa*loc[0] + ca*loc[1], loc[2] ]) def __call__(self): return self.lst def _create_list(self): """ return list of matrices in order """ pass def make_target(self): mats = copy_objs(self.lst) Seq(*mats).anchor_position(1,buff=self.scale*SMALL_BUFF) Grp(*mats).next_to(self.A,0,buff=SMALL_BUFF) Seq(*mats).rotate(self.angle) self.target=mats self.target_pos=[m.get_center() for m in mats] def animations1(self): return ShowCreation(self.L), ShowCreation(self.Q), ShowCreation(self.U) def animations2(self): self.make_target() return (*MoveTo(self.lst, self.target), FadeOut(self.A)) def play_factorize(self,scene, **kw): scene.play( *self.animations1(), **kw ) scene.play( *self.animations2(), **kw ) class LQUFact(LUTypeFact): def _create_list(self): """ return list of matrices in order """ return [self.L, self.Q, self.U] class UQLFact(LUTypeFact): def _create_list(self): """ return list of matrices in order """ return [self.U, self.Q, self.L]
24.493617
79
0.560111
780
5,756
3.978205
0.153846
0.022559
0.033516
0.043829
0.821141
0.807606
0.789558
0.789558
0.789558
0.789558
0
0.018308
0.297776
5,756
234
80
24.598291
0.749381
0.072099
0
0.673333
0
0
0.004885
0
0
0
0
0
0
1
0.193333
false
0.013333
0.026667
0.033333
0.386667
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
67f3c76e02510a436d030f33b0f16c6eb4e18cc0
1,215
py
Python
DataStream/DataInputStream.py
mauriballes/proyecto_compiladores_c3
e1627910c640869ddee6417613789f4e0684bce6
[ "MIT" ]
null
null
null
DataStream/DataInputStream.py
mauriballes/proyecto_compiladores_c3
e1627910c640869ddee6417613789f4e0684bce6
[ "MIT" ]
null
null
null
DataStream/DataInputStream.py
mauriballes/proyecto_compiladores_c3
e1627910c640869ddee6417613789f4e0684bce6
[ "MIT" ]
null
null
null
""" Reading from Java DataInputStream format. """ import struct class DataInputStream: def __init__(self, stream): self.stream = stream def read_boolean(self): return struct.unpack('?', self.stream.read(1))[0] def read_byte(self): return struct.unpack('b', self.stream.read(1))[0] def read_unsigned_byte(self): return struct.unpack('B', self.stream.read(1))[0] def read_char(self): return chr(struct.unpack('>H', self.stream.read(2))[0]) def read_double(self): return struct.unpack('>d', self.stream.read(8))[0] def read_float(self): return struct.unpack('>f', self.stream.read(4))[0] def read_short(self): return struct.unpack('>h', self.stream.read(2))[0] def read_unsigned_short(self): return struct.unpack('>H', self.stream.read(2))[0] def read_long(self): return struct.unpack('>q', self.stream.read(8))[0] def read_utf(self): utf_length = struct.unpack('>H', self.stream.read(2))[0] return self.stream.read(utf_length) def read_int(self): return struct.unpack('>i', self.stream.read(4))[0] def close(self): self.stream.close()
25.851064
64
0.619753
174
1,215
4.218391
0.224138
0.20436
0.228883
0.269755
0.509537
0.509537
0.457766
0.36376
0.324251
0.324251
0
0.023037
0.213992
1,215
47
65
25.851064
0.74555
0.033745
0
0
0
0
0.016295
0
0
0
0
0
0
1
0.448276
false
0
0.034483
0.344828
0.896552
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
db02d43d228dafde50db8e706b9e24576baabf8f
53,968
py
Python
gr37/hf/X310/wwv_monitor_x310_2.py
zleffke/flowgraph_sandbox
6bcad45fd4585e917678b843be323278ebf06323
[ "MIT" ]
null
null
null
gr37/hf/X310/wwv_monitor_x310_2.py
zleffke/flowgraph_sandbox
6bcad45fd4585e917678b843be323278ebf06323
[ "MIT" ]
null
null
null
gr37/hf/X310/wwv_monitor_x310_2.py
zleffke/flowgraph_sandbox
6bcad45fd4585e917678b843be323278ebf06323
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: WWV Monitor X310, Start Time [UTC]: 2020-07-15T03:24:49.649869Z # GNU Radio version: 3.7.13.4 ################################################## if __name__ == '__main__': import ctypes import sys if sys.platform.startswith('linux'): try: x11 = ctypes.cdll.LoadLibrary('libX11.so') x11.XInitThreads() except: print "Warning: failed to XInitThreads()" from PyQt4 import Qt from PyQt4.QtCore import QObject, pyqtSlot from datetime import datetime as dt; import string; import math from gnuradio import analog from gnuradio import blocks from gnuradio import eng_notation from gnuradio import fft from gnuradio import filter from gnuradio import gr from gnuradio import qtgui from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.fft import window from gnuradio.filter import firdes from optparse import OptionParser import sip import sys import time from gnuradio import qtgui class wwv_monitor_x310_2(gr.top_block, Qt.QWidget): def __init__(self, avg_len=128, nfft=2048): gr.top_block.__init__(self, "WWV Monitor X310, Start Time [UTC]: 2020-07-15T03:24:49.649869Z") Qt.QWidget.__init__(self) self.setWindowTitle("WWV Monitor X310, Start Time [UTC]: 2020-07-15T03:24:49.649869Z") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "wwv_monitor_x310_2") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.avg_len = avg_len self.nfft = nfft ################################################## # Variables ################################################## self.ts_str = ts_str = dt.strftime(dt.utcnow(), "%Y-%m-%dT%H:%M:%S.%fZ") self.variable_qtgui_label_0_0 = variable_qtgui_label_0_0 = ts_str self.variable_qtgui_label_0 = variable_qtgui_label_0 = ts_str self.title_str = title_str = "WWV Monitor X310, Start Time [UTC]: {:s}".format(ts_str) self.samp_rate = samp_rate = 250e3 self.rx_freq = rx_freq = 15e6 self.pll_lbw = pll_lbw = 200 self.pll_freq = pll_freq = 100 self.pll_avg = pll_avg = 100000 self.decim_2 = decim_2 = 10 self.decim = decim = 10 self.decay_rate = decay_rate = 100e-6 self.arg_avg = arg_avg = 100000 ################################################## # Blocks ################################################## self.main_tab = Qt.QTabWidget() self.main_tab_widget_0 = Qt.QWidget() self.main_tab_layout_0 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_0) self.main_tab_grid_layout_0 = Qt.QGridLayout() self.main_tab_layout_0.addLayout(self.main_tab_grid_layout_0) self.main_tab.addTab(self.main_tab_widget_0, 'Controls') self.main_tab_widget_1 = Qt.QWidget() self.main_tab_layout_1 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_1) self.main_tab_grid_layout_1 = Qt.QGridLayout() self.main_tab_layout_1.addLayout(self.main_tab_grid_layout_1) self.main_tab.addTab(self.main_tab_widget_1, 'NS_EW') self.main_tab_widget_2 = Qt.QWidget() self.main_tab_layout_2 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_2) self.main_tab_grid_layout_2 = Qt.QGridLayout() self.main_tab_layout_2.addLayout(self.main_tab_grid_layout_2) self.main_tab.addTab(self.main_tab_widget_2, 'Freq') self.main_tab_widget_3 = Qt.QWidget() self.main_tab_layout_3 = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.main_tab_widget_3) self.main_tab_grid_layout_3 = Qt.QGridLayout() self.main_tab_layout_3.addLayout(self.main_tab_grid_layout_3) self.main_tab.addTab(self.main_tab_widget_3, 'Phase') self.top_grid_layout.addWidget(self.main_tab, 1, 0, 1, 1) for r in range(1, 2): self.top_grid_layout.setRowStretch(r, 1) for c in range(0, 1): self.top_grid_layout.setColumnStretch(c, 1) self._samp_rate_tool_bar = Qt.QToolBar(self) self._samp_rate_tool_bar.addWidget(Qt.QLabel('SAMP_RATE'+": ")) self._samp_rate_line_edit = Qt.QLineEdit(str(self.samp_rate)) self._samp_rate_tool_bar.addWidget(self._samp_rate_line_edit) self._samp_rate_line_edit.returnPressed.connect( lambda: self.set_samp_rate(eng_notation.str_to_num(str(self._samp_rate_line_edit.text().toAscii())))) self.main_tab_grid_layout_0.addWidget(self._samp_rate_tool_bar, 2, 0, 1, 1) for r in range(2, 3): self.main_tab_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.main_tab_grid_layout_0.setColumnStretch(c, 1) self._rx_freq_tool_bar = Qt.QToolBar(self) self._rx_freq_tool_bar.addWidget(Qt.QLabel('FREQ'+": ")) self._rx_freq_line_edit = Qt.QLineEdit(str(self.rx_freq)) self._rx_freq_tool_bar.addWidget(self._rx_freq_line_edit) self._rx_freq_line_edit.returnPressed.connect( lambda: self.set_rx_freq(eng_notation.str_to_num(str(self._rx_freq_line_edit.text().toAscii())))) self.main_tab_grid_layout_0.addWidget(self._rx_freq_tool_bar, 1, 0, 1, 1) for r in range(1, 2): self.main_tab_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.main_tab_grid_layout_0.setColumnStretch(c, 1) self._pll_lbw_tool_bar = Qt.QToolBar(self) self._pll_lbw_tool_bar.addWidget(Qt.QLabel("pll_lbw"+": ")) self._pll_lbw_line_edit = Qt.QLineEdit(str(self.pll_lbw)) self._pll_lbw_tool_bar.addWidget(self._pll_lbw_line_edit) self._pll_lbw_line_edit.returnPressed.connect( lambda: self.set_pll_lbw(eng_notation.str_to_num(str(self._pll_lbw_line_edit.text().toAscii())))) self.main_tab_grid_layout_2.addWidget(self._pll_lbw_tool_bar, 5, 7, 1, 1) for r in range(5, 6): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(7, 8): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self._pll_freq_tool_bar = Qt.QToolBar(self) self._pll_freq_tool_bar.addWidget(Qt.QLabel("pll_freq"+": ")) self._pll_freq_line_edit = Qt.QLineEdit(str(self.pll_freq)) self._pll_freq_tool_bar.addWidget(self._pll_freq_line_edit) self._pll_freq_line_edit.returnPressed.connect( lambda: self.set_pll_freq(eng_notation.str_to_num(str(self._pll_freq_line_edit.text().toAscii())))) self.main_tab_grid_layout_2.addWidget(self._pll_freq_tool_bar, 5, 6, 1, 1) for r in range(5, 6): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(6, 7): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self._pll_avg_tool_bar = Qt.QToolBar(self) self._pll_avg_tool_bar.addWidget(Qt.QLabel("pll_avg"+": ")) self._pll_avg_line_edit = Qt.QLineEdit(str(self.pll_avg)) self._pll_avg_tool_bar.addWidget(self._pll_avg_line_edit) self._pll_avg_line_edit.returnPressed.connect( lambda: self.set_pll_avg(eng_notation.str_to_num(str(self._pll_avg_line_edit.text().toAscii())))) self.main_tab_grid_layout_2.addWidget(self._pll_avg_tool_bar, 6, 6, 1, 1) for r in range(6, 7): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(6, 7): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self._decay_rate_options = (100e-6, 65e-3, 20e-3, ) self._decay_rate_labels = ('Fast', 'Medium', 'Slow', ) self._decay_rate_group_box = Qt.QGroupBox("decay_rate") self._decay_rate_box = Qt.QHBoxLayout() class variable_chooser_button_group(Qt.QButtonGroup): def __init__(self, parent=None): Qt.QButtonGroup.__init__(self, parent) @pyqtSlot(int) def updateButtonChecked(self, button_id): self.button(button_id).setChecked(True) self._decay_rate_button_group = variable_chooser_button_group() self._decay_rate_group_box.setLayout(self._decay_rate_box) for i, label in enumerate(self._decay_rate_labels): radio_button = Qt.QRadioButton(label) self._decay_rate_box.addWidget(radio_button) self._decay_rate_button_group.addButton(radio_button, i) self._decay_rate_callback = lambda i: Qt.QMetaObject.invokeMethod(self._decay_rate_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._decay_rate_options.index(i))) self._decay_rate_callback(self.decay_rate) self._decay_rate_button_group.buttonClicked[int].connect( lambda i: self.set_decay_rate(self._decay_rate_options[i])) self.main_tab_grid_layout_0.addWidget(self._decay_rate_group_box, 3, 0, 1, 1) for r in range(3, 4): self.main_tab_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.main_tab_grid_layout_0.setColumnStretch(c, 1) self._arg_avg_tool_bar = Qt.QToolBar(self) self._arg_avg_tool_bar.addWidget(Qt.QLabel("arg_avg"+": ")) self._arg_avg_line_edit = Qt.QLineEdit(str(self.arg_avg)) self._arg_avg_tool_bar.addWidget(self._arg_avg_line_edit) self._arg_avg_line_edit.returnPressed.connect( lambda: self.set_arg_avg(eng_notation.str_to_num(str(self._arg_avg_line_edit.text().toAscii())))) self.main_tab_grid_layout_3.addWidget(self._arg_avg_tool_bar, 6, 6, 1, 1) for r in range(6, 7): self.main_tab_grid_layout_3.setRowStretch(r, 1) for c in range(6, 7): self.main_tab_grid_layout_3.setColumnStretch(c, 1) self._variable_qtgui_label_0_0_tool_bar = Qt.QToolBar(self) if None: self._variable_qtgui_label_0_0_formatter = None else: self._variable_qtgui_label_0_0_formatter = lambda x: str(x) self._variable_qtgui_label_0_0_tool_bar.addWidget(Qt.QLabel('Start Time [UTC]'+": ")) self._variable_qtgui_label_0_0_label = Qt.QLabel(str(self._variable_qtgui_label_0_0_formatter(self.variable_qtgui_label_0_0))) self._variable_qtgui_label_0_0_tool_bar.addWidget(self._variable_qtgui_label_0_0_label) self.main_tab_grid_layout_0.addWidget(self._variable_qtgui_label_0_0_tool_bar, 4, 0, 10, 1) for r in range(4, 14): self.main_tab_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.main_tab_grid_layout_0.setColumnStretch(c, 1) self._variable_qtgui_label_0_tool_bar = Qt.QToolBar(self) if None: self._variable_qtgui_label_0_formatter = None else: self._variable_qtgui_label_0_formatter = lambda x: str(x) self._variable_qtgui_label_0_tool_bar.addWidget(Qt.QLabel('Start Time [UTC]'+": ")) self._variable_qtgui_label_0_label = Qt.QLabel(str(self._variable_qtgui_label_0_formatter(self.variable_qtgui_label_0))) self._variable_qtgui_label_0_tool_bar.addWidget(self._variable_qtgui_label_0_label) self.main_tab_grid_layout_0.addWidget(self._variable_qtgui_label_0_tool_bar, 0, 0, 1, 1) for r in range(0, 1): self.main_tab_grid_layout_0.setRowStretch(r, 1) for c in range(0, 1): self.main_tab_grid_layout_0.setColumnStretch(c, 1) self.uhd_usrp_source_1 = uhd.usrp_source( ",".join(("addr=192.168.10.2", "")), uhd.stream_args( cpu_format="fc32", channels=range(2), ), ) self.uhd_usrp_source_1.set_clock_rate(200e6, uhd.ALL_MBOARDS) self.uhd_usrp_source_1.set_clock_source('gpsdo', 0) self.uhd_usrp_source_1.set_time_source('gpsdo', 0) self.uhd_usrp_source_1.set_subdev_spec('A:AB B:AB', 0) self.uhd_usrp_source_1.set_samp_rate(samp_rate) self.uhd_usrp_source_1.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) self.uhd_usrp_source_1.set_center_freq(uhd.tune_request(rx_freq), 0) self.uhd_usrp_source_1.set_gain(0, 0) self.uhd_usrp_source_1.set_antenna('A', 0) self.uhd_usrp_source_1.set_auto_dc_offset(True, 0) self.uhd_usrp_source_1.set_auto_iq_balance(True, 0) self.uhd_usrp_source_1.set_center_freq(uhd.tune_request(rx_freq), 1) self.uhd_usrp_source_1.set_gain(0, 1) self.uhd_usrp_source_1.set_antenna('A', 1) self.uhd_usrp_source_1.set_auto_dc_offset(True, 1) self.uhd_usrp_source_1.set_auto_iq_balance(True, 1) self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc( interpolation=1, decimation=decim, taps=None, fractional_bw=None, ) self.rational_resampler_xxx_0 = filter.rational_resampler_ccc( interpolation=1, decimation=decim, taps=None, fractional_bw=None, ) self.qtgui_waterfall_sink_x_0_0 = qtgui.waterfall_sink_c( 8192, #size firdes.WIN_BLACKMAN_hARRIS, #wintype rx_freq, #fc samp_rate / decim, #bw "", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_0_0.set_update_time(0.010) self.qtgui_waterfall_sink_x_0_0.enable_grid(False) self.qtgui_waterfall_sink_x_0_0.enable_axis_labels(True) if not True: self.qtgui_waterfall_sink_x_0_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_waterfall_sink_x_0_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_0_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_0_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_0_0.set_intensity_range(-120, 0) self._qtgui_waterfall_sink_x_0_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_1.addWidget(self._qtgui_waterfall_sink_x_0_0_win, 4, 4, 4, 4) for r in range(4, 8): self.main_tab_grid_layout_1.setRowStretch(r, 1) for c in range(4, 8): self.main_tab_grid_layout_1.setColumnStretch(c, 1) self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( 8192, #size firdes.WIN_BLACKMAN_hARRIS, #wintype rx_freq, #fc samp_rate / decim, #bw "", #name 1 #number of inputs ) self.qtgui_waterfall_sink_x_0.set_update_time(0.010) self.qtgui_waterfall_sink_x_0.enable_grid(False) self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) if not True: self.qtgui_waterfall_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] colors = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) self.qtgui_waterfall_sink_x_0.set_intensity_range(-120, 0) self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_1.addWidget(self._qtgui_waterfall_sink_x_0_win, 4, 0, 4, 4) for r in range(4, 8): self.main_tab_grid_layout_1.setRowStretch(r, 1) for c in range(0, 4): self.main_tab_grid_layout_1.setColumnStretch(c, 1) self.qtgui_time_sink_x_0_0 = qtgui.time_sink_f( 1024, #size samp_rate / decim, #samp_rate "", #name 2 #number of inputs ) self.qtgui_time_sink_x_0_0.set_update_time(0.010) self.qtgui_time_sink_x_0_0.set_y_axis(-.2, .2) self.qtgui_time_sink_x_0_0.set_y_label('PLL Freq Offset [Hz]', "") self.qtgui_time_sink_x_0_0.enable_tags(-1, True) self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0_0.enable_autoscale(True) self.qtgui_time_sink_x_0_0.enable_grid(True) self.qtgui_time_sink_x_0_0.enable_axis_labels(True) self.qtgui_time_sink_x_0_0.enable_control_panel(False) self.qtgui_time_sink_x_0_0.enable_stem_plot(False) if not True: self.qtgui_time_sink_x_0_0.disable_legend() labels = ['N/S', 'E/W', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2): if len(labels[i]) == 0: self.qtgui_time_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_3.addWidget(self._qtgui_time_sink_x_0_0_win, 0, 0, 1, 6) for r in range(0, 1): self.main_tab_grid_layout_3.setRowStretch(r, 1) for c in range(0, 6): self.main_tab_grid_layout_3.setColumnStretch(c, 1) self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size samp_rate / decim, #samp_rate "", #name 2 #number of inputs ) self.qtgui_time_sink_x_0.set_update_time(0.010) self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self.qtgui_time_sink_x_0.set_y_label('PLL Freq Offset [Hz]', "") self.qtgui_time_sink_x_0.enable_tags(-1, True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") self.qtgui_time_sink_x_0.enable_autoscale(True) self.qtgui_time_sink_x_0.enable_grid(True) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) self.qtgui_time_sink_x_0.enable_stem_plot(False) if not True: self.qtgui_time_sink_x_0.disable_legend() labels = ['N/S', 'E/W', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "blue"] styles = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] markers = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2): if len(labels[i]) == 0: self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_2.addWidget(self._qtgui_time_sink_x_0_win, 4, 0, 3, 6) for r in range(4, 7): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(0, 6): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self.qtgui_number_sink_0_0 = qtgui.number_sink( gr.sizeof_float, 0, qtgui.NUM_GRAPH_NONE, 2 ) self.qtgui_number_sink_0_0.set_update_time(0.010) self.qtgui_number_sink_0_0.set_title("PLL Freq Offset [Hz]") labels = ['North/South', 'East/West', '', '', '', '', '', '', '', ''] units = ['', '', '', '', '', '', '', '', '', ''] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in xrange(2): self.qtgui_number_sink_0_0.set_min(i, -1000) self.qtgui_number_sink_0_0.set_max(i, 1000) self.qtgui_number_sink_0_0.set_color(i, colors[i][0], colors[i][1]) if len(labels[i]) == 0: self.qtgui_number_sink_0_0.set_label(i, "Data {0}".format(i)) else: self.qtgui_number_sink_0_0.set_label(i, labels[i]) self.qtgui_number_sink_0_0.set_unit(i, units[i]) self.qtgui_number_sink_0_0.set_factor(i, factor[i]) self.qtgui_number_sink_0_0.enable_autoscale(False) self._qtgui_number_sink_0_0_win = sip.wrapinstance(self.qtgui_number_sink_0_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_2.addWidget(self._qtgui_number_sink_0_0_win, 4, 6, 1, 2) for r in range(4, 5): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(6, 8): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self.qtgui_number_sink_0 = qtgui.number_sink( gr.sizeof_float, 0, qtgui.NUM_GRAPH_NONE, 1 ) self.qtgui_number_sink_0.set_update_time(0.10) self.qtgui_number_sink_0.set_title("") labels = ['', '', '', '', '', '', '', '', '', ''] units = ['', '', '', '', '', '', '', '', '', ''] colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")] factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] for i in xrange(1): self.qtgui_number_sink_0.set_min(i, -1) self.qtgui_number_sink_0.set_max(i, 1) self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1]) if len(labels[i]) == 0: self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i)) else: self.qtgui_number_sink_0.set_label(i, labels[i]) self.qtgui_number_sink_0.set_unit(i, units[i]) self.qtgui_number_sink_0.set_factor(i, factor[i]) self.qtgui_number_sink_0.enable_autoscale(False) self._qtgui_number_sink_0_win = sip.wrapinstance(self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_2.addWidget(self._qtgui_number_sink_0_win, 8, 4, 1, 2) for r in range(8, 9): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(4, 6): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0_1 = qtgui.freq_sink_c( 2048, #size firdes.WIN_BLACKMAN_hARRIS, #wintype rx_freq*0, #fc samp_rate / decim / decim_2, #bw "North/South", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0_1.set_update_time(0.010) self.qtgui_freq_sink_x_0_1.set_y_axis(-100, -20) self.qtgui_freq_sink_x_0_1.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0_1.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0_1.enable_autoscale(False) self.qtgui_freq_sink_x_0_1.enable_grid(True) self.qtgui_freq_sink_x_0_1.set_fft_average(0.2) self.qtgui_freq_sink_x_0_1.enable_axis_labels(True) self.qtgui_freq_sink_x_0_1.enable_control_panel(False) if not False: self.qtgui_freq_sink_x_0_1.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0_1.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0_1.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0_1.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0_1.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0_1.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0_1.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_1_win = sip.wrapinstance(self.qtgui_freq_sink_x_0_1.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_2.addWidget(self._qtgui_freq_sink_x_0_1_win, 0, 0, 4, 4) for r in range(0, 4): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(0, 4): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0_0_0 = qtgui.freq_sink_c( 2048, #size firdes.WIN_BLACKMAN_hARRIS, #wintype rx_freq*0, #fc samp_rate /decim / decim_2, #bw "East/West", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0_0_0.set_update_time(0.010) self.qtgui_freq_sink_x_0_0_0.set_y_axis(-100, -20) self.qtgui_freq_sink_x_0_0_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0_0_0.enable_autoscale(False) self.qtgui_freq_sink_x_0_0_0.enable_grid(True) self.qtgui_freq_sink_x_0_0_0.set_fft_average(0.2) self.qtgui_freq_sink_x_0_0_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0_0_0.enable_control_panel(False) if not False: self.qtgui_freq_sink_x_0_0_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0_0_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0_0_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0_0_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0_0_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0_0_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_0_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0_0_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_2.addWidget(self._qtgui_freq_sink_x_0_0_0_win, 0, 4, 4, 4) for r in range(0, 4): self.main_tab_grid_layout_2.setRowStretch(r, 1) for c in range(4, 8): self.main_tab_grid_layout_2.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0_0 = qtgui.freq_sink_c( 2048, #size firdes.WIN_BLACKMAN_hARRIS, #wintype rx_freq*0, #fc samp_rate /decim, #bw "East/West", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0_0.set_update_time(0.010) self.qtgui_freq_sink_x_0_0.set_y_axis(-100, -20) self.qtgui_freq_sink_x_0_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0_0.enable_autoscale(False) self.qtgui_freq_sink_x_0_0.enable_grid(True) self.qtgui_freq_sink_x_0_0.set_fft_average(0.2) self.qtgui_freq_sink_x_0_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0_0.enable_control_panel(False) if not False: self.qtgui_freq_sink_x_0_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_1.addWidget(self._qtgui_freq_sink_x_0_0_win, 0, 4, 4, 4) for r in range(0, 4): self.main_tab_grid_layout_1.setRowStretch(r, 1) for c in range(4, 8): self.main_tab_grid_layout_1.setColumnStretch(c, 1) self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( 2048, #size firdes.WIN_BLACKMAN_hARRIS, #wintype rx_freq*0, #fc samp_rate / decim, #bw "North/South", #name 1 #number of inputs ) self.qtgui_freq_sink_x_0.set_update_time(0.010) self.qtgui_freq_sink_x_0.set_y_axis(-100, -20) self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") self.qtgui_freq_sink_x_0.enable_autoscale(False) self.qtgui_freq_sink_x_0.enable_grid(True) self.qtgui_freq_sink_x_0.set_fft_average(0.2) self.qtgui_freq_sink_x_0.enable_axis_labels(True) self.qtgui_freq_sink_x_0.enable_control_panel(False) if not False: self.qtgui_freq_sink_x_0.disable_legend() if "complex" == "float" or "complex" == "msg_float": self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "green", "black", "cyan", "magenta", "yellow", "dark red", "dark green", "dark blue"] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(1): if len(labels[i]) == 0: self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_1.addWidget(self._qtgui_freq_sink_x_0_win, 0, 0, 4, 4) for r in range(0, 4): self.main_tab_grid_layout_1.setRowStretch(r, 1) for c in range(0, 4): self.main_tab_grid_layout_1.setColumnStretch(c, 1) self.qtgui_const_sink_x_0 = qtgui.const_sink_c( 8192, #size "", #name 2 #number of inputs ) self.qtgui_const_sink_x_0.set_update_time(0.010) self.qtgui_const_sink_x_0.set_y_axis(-.2, .2) self.qtgui_const_sink_x_0.set_x_axis(-.2, .2) self.qtgui_const_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, "") self.qtgui_const_sink_x_0.enable_autoscale(False) self.qtgui_const_sink_x_0.enable_grid(False) self.qtgui_const_sink_x_0.enable_axis_labels(True) if not True: self.qtgui_const_sink_x_0.disable_legend() labels = ['', '', '', '', '', '', '', '', '', ''] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] colors = ["blue", "red", "red", "red", "red", "red", "red", "red", "red", "red"] styles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] markers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] alphas = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] for i in xrange(2): if len(labels[i]) == 0: self.qtgui_const_sink_x_0.set_line_label(i, "Data {0}".format(i)) else: self.qtgui_const_sink_x_0.set_line_label(i, labels[i]) self.qtgui_const_sink_x_0.set_line_width(i, widths[i]) self.qtgui_const_sink_x_0.set_line_color(i, colors[i]) self.qtgui_const_sink_x_0.set_line_style(i, styles[i]) self.qtgui_const_sink_x_0.set_line_marker(i, markers[i]) self.qtgui_const_sink_x_0.set_line_alpha(i, alphas[i]) self._qtgui_const_sink_x_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget) self.main_tab_grid_layout_3.addWidget(self._qtgui_const_sink_x_0_win, 1, 0, 3, 3) for r in range(1, 4): self.main_tab_grid_layout_3.setRowStretch(r, 1) for c in range(0, 3): self.main_tab_grid_layout_3.setColumnStretch(c, 1) self.low_pass_filter_1_0 = filter.fir_filter_ccf(decim_2, firdes.low_pass( 1, samp_rate / decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_1 = filter.fir_filter_ccf(1, firdes.low_pass( 1, samp_rate / decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0_0 = filter.fir_filter_ccf(decim_2, firdes.low_pass( 1, samp_rate / decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( 1, samp_rate / decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.fft_vxx_0 = fft.fft_vcc(nfft, True, (window.blackmanharris(nfft)), False, 4) self.blocks_stream_to_vector_0 = blocks.stream_to_vector(gr.sizeof_gr_complex*1, nfft) self.blocks_short_to_float_0 = blocks.short_to_float(1, 1) self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_short*1) self.blocks_nlog10_ff_0 = blocks.nlog10_ff(10, nfft, -10*math.log10(nfft)) self.blocks_multiply_const_vxx_1_0 = blocks.multiply_const_vff((samp_rate/decim/(2*math.pi), )) self.blocks_multiply_const_vxx_1 = blocks.multiply_const_vff((samp_rate/decim/(2*math.pi), )) self.blocks_multiply_const_vxx_0_0_0 = blocks.multiply_const_vff(((samp_rate / decim / decim_2) / nfft, )) self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vff(((samp_rate / decim / decim_2) / nfft, )) self.blocks_moving_average_xx_1_0_0 = blocks.moving_average_ff(int(arg_avg), 1.0/arg_avg, 4000, 1) self.blocks_moving_average_xx_1_0 = blocks.moving_average_ff(int(arg_avg), 1.0/arg_avg, 4000, 1) self.blocks_moving_average_xx_1 = blocks.moving_average_ff(100000, 0.00001, 4000, 1) self.blocks_moving_average_xx_0_0 = blocks.moving_average_ff(int(pll_avg), 1.0/pll_avg, 4000, 1) self.blocks_moving_average_xx_0 = blocks.moving_average_ff(int(avg_len), 1.0/(avg_len)/nfft, 4000, nfft) self.blocks_complex_to_mag_squared_0 = blocks.complex_to_mag_squared(nfft) self.blocks_complex_to_arg_0_0 = blocks.complex_to_arg(1) self.blocks_complex_to_arg_0 = blocks.complex_to_arg(1) self.blocks_argmax_xx_0 = blocks.argmax_fs(nfft) self.analog_pll_freqdet_cf_0_0 = analog.pll_freqdet_cf(math.pi/pll_lbw, math.pi/pll_freq, -math.pi/pll_freq) self.analog_pll_freqdet_cf_0 = analog.pll_freqdet_cf(math.pi/pll_lbw, math.pi/pll_freq, -math.pi/pll_freq) self.analog_agc2_xx_0_0 = analog.agc2_cc(0.1, decay_rate, .3, 1000) self.analog_agc2_xx_0_0.set_max_gain(65000) self.analog_agc2_xx_0 = analog.agc2_cc(0.1, decay_rate, .3, 1000) self.analog_agc2_xx_0.set_max_gain(65000) ################################################## # Connections ################################################## self.connect((self.analog_agc2_xx_0, 0), (self.rational_resampler_xxx_0_0, 0)) self.connect((self.analog_agc2_xx_0_0, 0), (self.rational_resampler_xxx_0, 0)) self.connect((self.analog_pll_freqdet_cf_0, 0), (self.blocks_moving_average_xx_0_0, 0)) self.connect((self.analog_pll_freqdet_cf_0_0, 0), (self.blocks_moving_average_xx_1, 0)) self.connect((self.blocks_argmax_xx_0, 1), (self.blocks_null_sink_0, 0)) self.connect((self.blocks_argmax_xx_0, 0), (self.blocks_short_to_float_0, 0)) self.connect((self.blocks_complex_to_arg_0, 0), (self.blocks_moving_average_xx_1_0_0, 0)) self.connect((self.blocks_complex_to_arg_0_0, 0), (self.blocks_moving_average_xx_1_0, 0)) self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.blocks_moving_average_xx_0, 0)) self.connect((self.blocks_moving_average_xx_0, 0), (self.blocks_nlog10_ff_0, 0)) self.connect((self.blocks_moving_average_xx_0_0, 0), (self.blocks_multiply_const_vxx_1, 0)) self.connect((self.blocks_moving_average_xx_1, 0), (self.blocks_multiply_const_vxx_1_0, 0)) self.connect((self.blocks_moving_average_xx_1_0, 0), (self.qtgui_time_sink_x_0_0, 0)) self.connect((self.blocks_moving_average_xx_1_0_0, 0), (self.qtgui_time_sink_x_0_0, 1)) self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.blocks_multiply_const_vxx_0_0_0, 0)) self.connect((self.blocks_multiply_const_vxx_0_0_0, 0), (self.qtgui_number_sink_0, 0)) self.connect((self.blocks_multiply_const_vxx_1, 0), (self.qtgui_number_sink_0_0, 0)) self.connect((self.blocks_multiply_const_vxx_1, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.blocks_multiply_const_vxx_1_0, 0), (self.qtgui_number_sink_0_0, 1)) self.connect((self.blocks_multiply_const_vxx_1_0, 0), (self.qtgui_time_sink_x_0, 1)) self.connect((self.blocks_nlog10_ff_0, 0), (self.blocks_argmax_xx_0, 0)) self.connect((self.blocks_short_to_float_0, 0), (self.blocks_multiply_const_vxx_0_0, 0)) self.connect((self.blocks_stream_to_vector_0, 0), (self.fft_vxx_0, 0)) self.connect((self.fft_vxx_0, 0), (self.blocks_complex_to_mag_squared_0, 0)) self.connect((self.low_pass_filter_0, 0), (self.analog_pll_freqdet_cf_0_0, 0)) self.connect((self.low_pass_filter_0_0, 0), (self.qtgui_freq_sink_x_0_0_0, 0)) self.connect((self.low_pass_filter_1, 0), (self.analog_pll_freqdet_cf_0, 0)) self.connect((self.low_pass_filter_1_0, 0), (self.qtgui_freq_sink_x_0_1, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_complex_to_arg_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.low_pass_filter_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.low_pass_filter_0_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_const_sink_x_0, 1)) self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_freq_sink_x_0_0, 0)) self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_waterfall_sink_x_0_0, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.blocks_complex_to_arg_0_0, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.blocks_stream_to_vector_0, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.low_pass_filter_1, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.low_pass_filter_1_0, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.qtgui_const_sink_x_0, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.qtgui_freq_sink_x_0, 0)) self.connect((self.rational_resampler_xxx_0_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) self.connect((self.uhd_usrp_source_1, 0), (self.analog_agc2_xx_0, 0)) self.connect((self.uhd_usrp_source_1, 1), (self.analog_agc2_xx_0_0, 0)) def closeEvent(self, event): self.settings = Qt.QSettings("GNU Radio", "wwv_monitor_x310_2") self.settings.setValue("geometry", self.saveGeometry()) event.accept() def get_avg_len(self): return self.avg_len def set_avg_len(self, avg_len): self.avg_len = avg_len self.blocks_moving_average_xx_0.set_length_and_scale(int(self.avg_len), 1.0/(self.avg_len)/self.nfft) def get_nfft(self): return self.nfft def set_nfft(self, nfft): self.nfft = nfft self.blocks_multiply_const_vxx_0_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) self.blocks_multiply_const_vxx_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) self.blocks_moving_average_xx_0.set_length_and_scale(int(self.avg_len), 1.0/(self.avg_len)/self.nfft) def get_ts_str(self): return self.ts_str def set_ts_str(self, ts_str): self.ts_str = ts_str self.set_variable_qtgui_label_0_0(self._variable_qtgui_label_0_0_formatter(self.ts_str)) self.set_variable_qtgui_label_0(self._variable_qtgui_label_0_formatter(self.ts_str)) self.set_title_str("WWV Monitor X310, Start Time [UTC]: {:s}".format(self.ts_str)) def get_variable_qtgui_label_0_0(self): return self.variable_qtgui_label_0_0 def set_variable_qtgui_label_0_0(self, variable_qtgui_label_0_0): self.variable_qtgui_label_0_0 = variable_qtgui_label_0_0 Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_0_label, "setText", Qt.Q_ARG("QString", self.variable_qtgui_label_0_0)) def get_variable_qtgui_label_0(self): return self.variable_qtgui_label_0 def set_variable_qtgui_label_0(self, variable_qtgui_label_0): self.variable_qtgui_label_0 = variable_qtgui_label_0 Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label, "setText", Qt.Q_ARG("QString", self.variable_qtgui_label_0)) def get_title_str(self): return self.title_str def set_title_str(self, title_str): self.title_str = title_str def get_samp_rate(self): return self.samp_rate def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate Qt.QMetaObject.invokeMethod(self._samp_rate_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.samp_rate))) self.uhd_usrp_source_1.set_samp_rate(self.samp_rate) self.qtgui_waterfall_sink_x_0_0.set_frequency_range(self.rx_freq, self.samp_rate / self.decim) self.qtgui_waterfall_sink_x_0.set_frequency_range(self.rx_freq, self.samp_rate / self.decim) self.qtgui_time_sink_x_0_0.set_samp_rate(self.samp_rate / self.decim) self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate / self.decim) self.qtgui_freq_sink_x_0_1.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim) self.qtgui_freq_sink_x_0.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim) self.low_pass_filter_1_0.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_1.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.blocks_multiply_const_vxx_1_0.set_k((self.samp_rate/self.decim/(2*math.pi), )) self.blocks_multiply_const_vxx_1.set_k((self.samp_rate/self.decim/(2*math.pi), )) self.blocks_multiply_const_vxx_0_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) self.blocks_multiply_const_vxx_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) def get_rx_freq(self): return self.rx_freq def set_rx_freq(self, rx_freq): self.rx_freq = rx_freq Qt.QMetaObject.invokeMethod(self._rx_freq_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.rx_freq))) self.uhd_usrp_source_1.set_center_freq(uhd.tune_request(self.rx_freq), 0) self.uhd_usrp_source_1.set_center_freq(uhd.tune_request(self.rx_freq), 1) self.qtgui_waterfall_sink_x_0_0.set_frequency_range(self.rx_freq, self.samp_rate / self.decim) self.qtgui_waterfall_sink_x_0.set_frequency_range(self.rx_freq, self.samp_rate / self.decim) self.qtgui_freq_sink_x_0_1.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim) self.qtgui_freq_sink_x_0.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim) def get_pll_lbw(self): return self.pll_lbw def set_pll_lbw(self, pll_lbw): self.pll_lbw = pll_lbw Qt.QMetaObject.invokeMethod(self._pll_lbw_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.pll_lbw))) self.analog_pll_freqdet_cf_0_0.set_loop_bandwidth(math.pi/self.pll_lbw) self.analog_pll_freqdet_cf_0.set_loop_bandwidth(math.pi/self.pll_lbw) def get_pll_freq(self): return self.pll_freq def set_pll_freq(self, pll_freq): self.pll_freq = pll_freq Qt.QMetaObject.invokeMethod(self._pll_freq_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.pll_freq))) self.analog_pll_freqdet_cf_0_0.set_max_freq(math.pi/self.pll_freq) self.analog_pll_freqdet_cf_0_0.set_min_freq(-math.pi/self.pll_freq) self.analog_pll_freqdet_cf_0.set_max_freq(math.pi/self.pll_freq) self.analog_pll_freqdet_cf_0.set_min_freq(-math.pi/self.pll_freq) def get_pll_avg(self): return self.pll_avg def set_pll_avg(self, pll_avg): self.pll_avg = pll_avg Qt.QMetaObject.invokeMethod(self._pll_avg_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.pll_avg))) self.blocks_moving_average_xx_0_0.set_length_and_scale(int(self.pll_avg), 1.0/self.pll_avg) def get_decim_2(self): return self.decim_2 def set_decim_2(self, decim_2): self.decim_2 = decim_2 self.qtgui_freq_sink_x_0_1.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim / self.decim_2) self.blocks_multiply_const_vxx_0_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) self.blocks_multiply_const_vxx_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) def get_decim(self): return self.decim def set_decim(self, decim): self.decim = decim self.qtgui_waterfall_sink_x_0_0.set_frequency_range(self.rx_freq, self.samp_rate / self.decim) self.qtgui_waterfall_sink_x_0.set_frequency_range(self.rx_freq, self.samp_rate / self.decim) self.qtgui_time_sink_x_0_0.set_samp_rate(self.samp_rate / self.decim) self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate / self.decim) self.qtgui_freq_sink_x_0_1.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim / self.decim_2) self.qtgui_freq_sink_x_0_0.set_frequency_range(self.rx_freq*0, self.samp_rate /self.decim) self.qtgui_freq_sink_x_0.set_frequency_range(self.rx_freq*0, self.samp_rate / self.decim) self.low_pass_filter_1_0.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_1.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate / self.decim, 50, 100, firdes.WIN_HAMMING, 6.76)) self.blocks_multiply_const_vxx_1_0.set_k((self.samp_rate/self.decim/(2*math.pi), )) self.blocks_multiply_const_vxx_1.set_k((self.samp_rate/self.decim/(2*math.pi), )) self.blocks_multiply_const_vxx_0_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) self.blocks_multiply_const_vxx_0_0.set_k(((self.samp_rate / self.decim / self.decim_2) / self.nfft, )) def get_decay_rate(self): return self.decay_rate def set_decay_rate(self, decay_rate): self.decay_rate = decay_rate self._decay_rate_callback(self.decay_rate) self.analog_agc2_xx_0_0.set_decay_rate(self.decay_rate) self.analog_agc2_xx_0.set_decay_rate(self.decay_rate) def get_arg_avg(self): return self.arg_avg def set_arg_avg(self, arg_avg): self.arg_avg = arg_avg Qt.QMetaObject.invokeMethod(self._arg_avg_line_edit, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.arg_avg))) self.blocks_moving_average_xx_1_0_0.set_length_and_scale(int(self.arg_avg), 1.0/self.arg_avg) self.blocks_moving_average_xx_1_0.set_length_and_scale(int(self.arg_avg), 1.0/self.arg_avg) def argument_parser(): parser = OptionParser(usage="%prog: [options]", option_class=eng_option) parser.add_option( "", "--avg-len", dest="avg_len", type="eng_float", default=eng_notation.num_to_str(128), help="Set avg_len [default=%default]") parser.add_option( "", "--nfft", dest="nfft", type="intx", default=2048, help="Set nfft [default=%default]") return parser def main(top_block_cls=wwv_monitor_x310_2, options=None): if options is None: options, _ = argument_parser().parse_args() from distutils.version import StrictVersion if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): style = gr.prefs().get_string('qtgui', 'style', 'raster') Qt.QApplication.setGraphicsSystem(style) qapp = Qt.QApplication(sys.argv) tb = top_block_cls(avg_len=options.avg_len, nfft=options.nfft) tb.start() tb.show() def quitting(): tb.stop() tb.wait() qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) qapp.exec_() if __name__ == '__main__': main()
51.594646
179
0.653665
8,636
53,968
3.668597
0.049097
0.021526
0.039202
0.052585
0.876965
0.834764
0.789754
0.754782
0.695695
0.645445
0
0.049968
0.216443
53,968
1,045
180
51.644019
0.699246
0.00945
0
0.363636
0
0
0.035273
0.001418
0
0
0
0
0
0
null
null
0.022727
0.02381
null
null
0.001082
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
6
db168de10b25b558135c4875205413b3c1ec15d8
186
py
Python
.history/List of Capstone Projects/pi_program_20200516141346.py
EvanthiosPapadopoulos/Python3
ab773fd458e365c1510f98ecac65965234c881e8
[ "MIT" ]
1
2020-05-18T17:50:00.000Z
2020-05-18T17:50:00.000Z
.history/List of Capstone Projects/pi_program_20200516141346.py
EvanthiosPapadopoulos/Python3
ab773fd458e365c1510f98ecac65965234c881e8
[ "MIT" ]
null
null
null
.history/List of Capstone Projects/pi_program_20200516141346.py
EvanthiosPapadopoulos/Python3
ab773fd458e365c1510f98ecac65965234c881e8
[ "MIT" ]
null
null
null
''' Find PI to the Nth Digit - Enter a number and have the program generate π (pi) up to that many decimal places. Keep a limit to how far the program will go. ''' import HeaderOfFiles
31
155
0.736559
34
186
4.029412
0.794118
0.145985
0
0
0
0
0
0
0
0
0
0
0.204301
186
5
156
37.2
0.925676
0.833333
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
db1f19cb084dbc508bfd36c26611109d743a868b
1,950
py
Python
util/data/gen/CoreUIComponents.dll.py
56kyle/bloons_auto
419d55b51d1cddc49099593970adf1c67985b389
[ "MIT" ]
null
null
null
util/data/gen/CoreUIComponents.dll.py
56kyle/bloons_auto
419d55b51d1cddc49099593970adf1c67985b389
[ "MIT" ]
null
null
null
util/data/gen/CoreUIComponents.dll.py
56kyle/bloons_auto
419d55b51d1cddc49099593970adf1c67985b389
[ "MIT" ]
null
null
null
symbols = [] exports = [{'type': 'function', 'name': 'CoreUIClientCreate', 'address': '0x7ffb38d8cb90'}, {'type': 'function', 'name': 'CoreUIClientTestCreate', 'address': '0x7ffb38e9a810'}, {'type': 'function', 'name': 'CoreUIConfigureTestHost', 'address': '0x7ffb38df9ba0'}, {'type': 'function', 'name': 'CoreUICreateDuplicateWindowFactory', 'address': '0x7ffb38d5fce0'}, {'type': 'function', 'name': 'CoreUICreateICoreWindowFactory', 'address': '0x7ffb38d9c400'}, {'type': 'function', 'name': 'CoreUIFactoryCreate', 'address': '0x7ffb38d89780'}, {'type': 'function', 'name': 'CoreUIServerCreate', 'address': '0x7ffb38dcbbb0'}, {'type': 'function', 'name': 'CoreUIServerTestCreate', 'address': '0x7ffb38e9a920'}, {'type': 'function', 'name': 'CreateNavigationClientWindowAdapter', 'address': '0x7ffb38ee7b80'}, {'type': 'function', 'name': 'DllCanUnloadNow', 'address': '0x7ffb38d5c170'}, {'type': 'function', 'name': 'DllGetActivationFactory', 'address': '0x7ffb38dcd1d0'}, {'type': 'function', 'name': 'DllGetClassObject', 'address': '0x7ffb38d67e50'}, {'type': 'function', 'name': 'MinUserGetInputHost', 'address': '0x7ffb38ee8320'}, {'type': 'function', 'name': 'MinUserGetInputRoutingInfo', 'address': '0x7ffb38ee8370'}, {'type': 'function', 'name': 'MinUserInputInitialize', 'address': '0x7ffb38ee83f0'}, {'type': 'function', 'name': 'MinUserNotifyOneCoreTransformMode', 'address': '0x7ffb38dd1680'}, {'type': 'function', 'name': 'MinUserRegisterPointerInputTarget', 'address': '0x7ffb38ee6a30'}, {'type': 'function', 'name': 'MinUserRequestViewHitTest', 'address': '0x7ffb38ee8510'}, {'type': 'function', 'name': 'MinUserReregisterPointerInputTargets', 'address': '0x7ffb38ee6b50'}, {'type': 'function', 'name': 'MinUserUnregisterPointerInputTarget', 'address': '0x7ffb38ee6bf0'}, {'type': 'function', 'name': 'ServiceMain', 'address': '0x7ffb38ee6cd0'}, {'type': 'function', 'name': 'SvchostPushServiceGlobals', 'address': '0x7ffb38ee6dd0'}]
975
1,937
0.702051
134
1,950
10.216418
0.373134
0.192841
0.257122
0
0
0
0
0
0
0
0
0.086549
0.069744
1,950
2
1,937
975
0.668137
0
0
0
0
0
0.694516
0.217324
0
0
0.157868
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
e1ed9bdeb1a9005af3c3f3abc469d19faf974131
88
py
Python
st3/libconda/tests/__init__.py
DamnWidget/libconda
17ab8cd61a4df83047608dcdbc08f408b80d4e76
[ "Apache-2.0" ]
null
null
null
st3/libconda/tests/__init__.py
DamnWidget/libconda
17ab8cd61a4df83047608dcdbc08f408b80d4e76
[ "Apache-2.0" ]
null
null
null
st3/libconda/tests/__init__.py
DamnWidget/libconda
17ab8cd61a4df83047608dcdbc08f408b80d4e76
[ "Apache-2.0" ]
null
null
null
import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
17.6
65
0.704545
15
88
3.866667
0.6
0.206897
0
0
0
0
0
0
0
0
0
0.0125
0.090909
88
4
66
22
0.7125
0
0
0
0
0
0.022727
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
c06432d28bb085d1ad3e65af6e90b5fb9f0124c9
260,273
py
Python
instances/passenger_demand/pas-20210422-1717-int18e/72.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210422-1717-int18e/72.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
instances/passenger_demand/pas-20210422-1717-int18e/72.py
LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure
bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11
[ "BSD-3-Clause" ]
null
null
null
""" PASSENGERS """ numPassengers = 34399 passenger_arriving = ( (9, 4, 8, 11, 5, 1, 5, 5, 2, 3, 3, 0, 0, 7, 4, 8, 4, 6, 2, 8, 4, 2, 2, 1, 1, 0), # 0 (6, 9, 9, 6, 5, 1, 3, 5, 3, 1, 3, 0, 0, 9, 7, 4, 4, 7, 4, 3, 5, 5, 2, 2, 0, 0), # 1 (11, 13, 5, 10, 9, 2, 5, 2, 3, 1, 4, 1, 0, 14, 7, 7, 6, 15, 4, 3, 6, 3, 1, 2, 1, 0), # 2 (14, 17, 9, 10, 8, 2, 4, 9, 2, 1, 2, 1, 0, 3, 8, 6, 6, 12, 3, 3, 2, 4, 2, 2, 2, 0), # 3 (18, 8, 9, 9, 9, 4, 9, 6, 5, 6, 0, 0, 0, 6, 13, 8, 3, 7, 9, 3, 4, 3, 0, 3, 2, 0), # 4 (20, 9, 11, 10, 11, 5, 4, 9, 2, 3, 1, 1, 0, 16, 7, 11, 5, 9, 10, 4, 4, 5, 4, 1, 2, 0), # 5 (11, 14, 13, 9, 8, 4, 3, 3, 2, 0, 1, 1, 0, 13, 10, 15, 6, 10, 9, 6, 5, 6, 3, 1, 0, 0), # 6 (21, 16, 18, 13, 11, 4, 2, 4, 8, 1, 2, 1, 0, 11, 10, 3, 10, 11, 13, 5, 4, 5, 1, 2, 2, 0), # 7 (13, 17, 15, 12, 5, 4, 11, 4, 6, 2, 4, 1, 0, 11, 12, 11, 7, 12, 11, 8, 2, 3, 5, 1, 1, 0), # 8 (13, 14, 15, 12, 13, 7, 9, 9, 9, 2, 2, 1, 0, 13, 14, 4, 8, 10, 10, 8, 3, 5, 7, 2, 0, 0), # 9 (15, 14, 14, 10, 7, 7, 7, 7, 5, 0, 1, 1, 0, 8, 10, 12, 12, 10, 7, 3, 2, 3, 2, 6, 1, 0), # 10 (18, 9, 13, 12, 10, 2, 10, 3, 10, 4, 3, 3, 0, 14, 16, 10, 10, 13, 17, 7, 4, 8, 5, 10, 1, 0), # 11 (16, 22, 13, 16, 11, 5, 8, 7, 4, 4, 2, 3, 0, 8, 17, 10, 8, 12, 5, 4, 1, 8, 3, 1, 2, 0), # 12 (17, 23, 9, 19, 15, 3, 12, 7, 7, 1, 3, 2, 0, 15, 10, 5, 13, 15, 7, 6, 5, 4, 9, 7, 3, 0), # 13 (15, 29, 14, 10, 8, 5, 4, 9, 7, 3, 1, 1, 0, 16, 14, 11, 12, 11, 7, 7, 3, 7, 4, 2, 1, 0), # 14 (24, 18, 7, 17, 15, 3, 10, 9, 8, 1, 3, 3, 0, 24, 15, 10, 13, 9, 9, 8, 2, 7, 2, 4, 2, 0), # 15 (26, 18, 12, 17, 11, 8, 4, 6, 11, 0, 3, 0, 0, 23, 12, 13, 5, 9, 9, 11, 1, 10, 2, 0, 0, 0), # 16 (10, 16, 14, 23, 12, 3, 11, 13, 9, 5, 2, 1, 0, 21, 18, 16, 10, 8, 9, 10, 5, 5, 2, 4, 1, 0), # 17 (20, 14, 14, 13, 14, 3, 5, 14, 9, 1, 1, 0, 0, 17, 11, 20, 6, 12, 13, 7, 2, 8, 4, 3, 0, 0), # 18 (21, 24, 16, 15, 8, 4, 7, 9, 10, 5, 0, 0, 0, 13, 18, 12, 8, 22, 8, 4, 7, 5, 6, 3, 2, 0), # 19 (22, 21, 16, 7, 10, 10, 9, 11, 7, 3, 2, 2, 0, 12, 17, 20, 12, 11, 8, 8, 5, 8, 9, 4, 0, 0), # 20 (14, 17, 19, 17, 16, 6, 7, 5, 5, 4, 3, 2, 0, 13, 21, 9, 16, 17, 5, 4, 4, 6, 4, 4, 2, 0), # 21 (20, 12, 15, 16, 14, 8, 4, 11, 5, 0, 3, 0, 0, 21, 13, 12, 11, 17, 10, 8, 3, 7, 4, 6, 2, 0), # 22 (18, 17, 13, 19, 11, 9, 8, 8, 8, 2, 3, 1, 0, 14, 26, 11, 9, 19, 13, 12, 8, 7, 7, 4, 2, 0), # 23 (8, 19, 17, 11, 16, 6, 5, 9, 8, 4, 0, 0, 0, 21, 17, 14, 11, 10, 14, 10, 5, 5, 5, 4, 0, 0), # 24 (17, 25, 14, 11, 9, 3, 11, 6, 3, 1, 3, 0, 0, 18, 20, 12, 8, 16, 10, 4, 12, 8, 1, 3, 1, 0), # 25 (17, 16, 17, 12, 16, 7, 9, 8, 10, 4, 1, 2, 0, 21, 21, 6, 16, 7, 13, 7, 5, 7, 7, 2, 2, 0), # 26 (19, 13, 11, 16, 12, 6, 10, 7, 7, 3, 1, 2, 0, 15, 20, 9, 13, 11, 5, 8, 2, 5, 10, 1, 5, 0), # 27 (18, 19, 9, 16, 16, 6, 4, 3, 5, 3, 1, 3, 0, 18, 17, 16, 7, 15, 9, 9, 5, 8, 3, 3, 2, 0), # 28 (20, 15, 14, 12, 17, 6, 8, 4, 4, 4, 3, 1, 0, 13, 23, 14, 9, 23, 5, 11, 8, 6, 4, 5, 2, 0), # 29 (16, 17, 22, 14, 20, 6, 3, 8, 4, 3, 3, 2, 0, 14, 21, 21, 10, 7, 10, 7, 4, 7, 9, 3, 0, 0), # 30 (21, 15, 19, 9, 9, 12, 11, 8, 7, 3, 4, 0, 0, 15, 22, 17, 5, 14, 6, 10, 5, 3, 7, 4, 0, 0), # 31 (15, 16, 11, 17, 8, 9, 5, 9, 6, 1, 2, 1, 0, 21, 14, 12, 8, 20, 6, 12, 7, 5, 5, 2, 2, 0), # 32 (15, 16, 9, 12, 11, 10, 6, 2, 6, 5, 2, 3, 0, 20, 13, 13, 9, 15, 6, 8, 3, 5, 3, 7, 1, 0), # 33 (17, 17, 9, 20, 18, 5, 5, 6, 7, 1, 3, 3, 0, 17, 14, 10, 16, 19, 7, 5, 6, 7, 6, 5, 0, 0), # 34 (23, 14, 18, 17, 14, 4, 9, 8, 10, 6, 3, 1, 0, 17, 23, 6, 13, 17, 11, 13, 5, 8, 5, 3, 1, 0), # 35 (22, 16, 18, 16, 9, 9, 8, 9, 8, 3, 4, 1, 0, 13, 15, 17, 12, 16, 12, 6, 2, 7, 9, 5, 1, 0), # 36 (19, 17, 15, 16, 9, 4, 5, 7, 10, 3, 5, 1, 0, 27, 14, 12, 7, 13, 5, 6, 4, 8, 5, 2, 1, 0), # 37 (22, 24, 16, 17, 12, 11, 1, 5, 8, 6, 3, 3, 0, 25, 10, 8, 14, 17, 8, 3, 2, 10, 6, 5, 6, 0), # 38 (25, 14, 13, 24, 17, 12, 8, 7, 11, 3, 3, 1, 0, 19, 17, 19, 6, 18, 6, 8, 1, 7, 6, 3, 0, 0), # 39 (17, 23, 14, 16, 10, 6, 4, 9, 6, 1, 3, 2, 0, 22, 11, 14, 12, 10, 9, 7, 3, 11, 10, 0, 1, 0), # 40 (18, 22, 16, 11, 13, 4, 5, 7, 7, 8, 2, 1, 0, 12, 19, 13, 10, 12, 7, 10, 9, 10, 5, 2, 1, 0), # 41 (19, 18, 16, 18, 12, 8, 10, 8, 7, 1, 4, 1, 0, 13, 25, 14, 7, 16, 15, 5, 3, 5, 6, 5, 3, 0), # 42 (19, 13, 18, 12, 15, 4, 6, 8, 10, 3, 5, 1, 0, 17, 15, 8, 13, 19, 8, 4, 3, 7, 1, 3, 1, 0), # 43 (21, 13, 10, 22, 15, 7, 8, 4, 11, 2, 0, 1, 0, 15, 18, 11, 12, 13, 4, 8, 5, 4, 5, 2, 2, 0), # 44 (24, 20, 19, 15, 18, 6, 6, 6, 12, 3, 3, 3, 0, 16, 13, 18, 15, 19, 10, 7, 1, 9, 8, 3, 2, 0), # 45 (22, 10, 18, 19, 20, 0, 8, 11, 6, 0, 4, 2, 0, 20, 17, 7, 12, 11, 10, 5, 4, 3, 4, 2, 3, 0), # 46 (19, 13, 22, 16, 17, 3, 5, 5, 5, 2, 3, 2, 0, 15, 16, 16, 5, 13, 14, 12, 3, 11, 6, 7, 1, 0), # 47 (20, 21, 12, 13, 15, 8, 8, 6, 6, 4, 3, 0, 0, 22, 15, 15, 8, 13, 8, 14, 2, 11, 7, 5, 0, 0), # 48 (27, 16, 18, 13, 14, 6, 3, 10, 8, 1, 1, 3, 0, 17, 11, 13, 8, 9, 9, 10, 7, 4, 6, 3, 1, 0), # 49 (18, 24, 14, 17, 18, 4, 6, 7, 4, 3, 1, 0, 0, 16, 15, 15, 6, 25, 9, 8, 6, 3, 6, 4, 1, 0), # 50 (11, 20, 17, 26, 14, 6, 5, 3, 12, 4, 0, 2, 0, 14, 18, 9, 11, 16, 11, 3, 5, 12, 2, 1, 2, 0), # 51 (19, 17, 14, 18, 12, 7, 4, 8, 8, 2, 4, 2, 0, 23, 16, 13, 11, 12, 5, 8, 6, 5, 6, 1, 2, 0), # 52 (14, 13, 20, 15, 14, 12, 11, 3, 8, 3, 3, 5, 0, 9, 9, 15, 16, 8, 13, 8, 4, 5, 6, 2, 1, 0), # 53 (27, 20, 17, 17, 14, 6, 8, 7, 8, 2, 1, 0, 0, 19, 19, 13, 9, 10, 4, 9, 3, 4, 4, 3, 2, 0), # 54 (23, 25, 14, 11, 21, 7, 4, 6, 11, 4, 0, 0, 0, 22, 16, 7, 6, 16, 10, 9, 3, 8, 10, 3, 2, 0), # 55 (16, 17, 17, 15, 13, 6, 7, 5, 6, 1, 3, 1, 0, 16, 16, 15, 2, 12, 12, 9, 6, 6, 5, 0, 3, 0), # 56 (17, 16, 16, 18, 18, 6, 4, 2, 5, 1, 3, 1, 0, 17, 16, 12, 9, 14, 16, 7, 4, 8, 12, 2, 1, 0), # 57 (19, 16, 13, 12, 8, 6, 9, 7, 4, 2, 4, 4, 0, 18, 7, 10, 14, 24, 11, 5, 6, 6, 4, 2, 2, 0), # 58 (20, 18, 17, 16, 13, 8, 7, 9, 3, 2, 2, 0, 0, 13, 9, 14, 11, 18, 9, 9, 4, 9, 3, 2, 0, 0), # 59 (19, 21, 24, 16, 17, 10, 6, 2, 10, 2, 2, 4, 0, 18, 13, 14, 7, 12, 7, 1, 4, 4, 5, 2, 3, 0), # 60 (28, 23, 15, 16, 15, 9, 7, 6, 10, 1, 0, 1, 0, 18, 17, 16, 11, 16, 10, 8, 6, 4, 8, 1, 1, 0), # 61 (20, 15, 9, 19, 9, 16, 9, 5, 10, 4, 0, 0, 0, 20, 16, 12, 10, 20, 7, 4, 4, 4, 6, 6, 2, 0), # 62 (10, 13, 13, 23, 10, 8, 6, 5, 8, 1, 3, 0, 0, 16, 12, 18, 10, 13, 5, 5, 5, 5, 5, 1, 1, 0), # 63 (9, 15, 18, 21, 16, 3, 12, 6, 5, 6, 2, 0, 0, 24, 13, 15, 16, 16, 5, 6, 6, 8, 3, 4, 2, 0), # 64 (19, 15, 12, 12, 14, 8, 11, 6, 7, 6, 1, 1, 0, 15, 15, 9, 8, 10, 7, 6, 2, 11, 2, 7, 0, 0), # 65 (21, 16, 18, 14, 13, 4, 12, 3, 4, 6, 1, 1, 0, 15, 20, 12, 6, 15, 8, 4, 3, 3, 5, 6, 0, 0), # 66 (15, 15, 16, 14, 12, 2, 10, 5, 4, 3, 6, 4, 0, 20, 20, 17, 8, 14, 6, 9, 7, 9, 5, 3, 1, 0), # 67 (28, 24, 14, 17, 17, 9, 2, 5, 3, 3, 5, 1, 0, 11, 18, 18, 6, 11, 11, 6, 7, 6, 3, 2, 0, 0), # 68 (7, 18, 11, 12, 10, 1, 4, 5, 8, 2, 3, 2, 0, 14, 15, 9, 14, 20, 5, 9, 5, 5, 4, 3, 6, 0), # 69 (16, 13, 14, 31, 15, 5, 4, 7, 5, 0, 5, 0, 0, 18, 17, 9, 14, 10, 3, 3, 4, 4, 11, 5, 0, 0), # 70 (16, 12, 13, 11, 9, 3, 3, 8, 6, 3, 3, 3, 0, 24, 24, 16, 4, 17, 7, 8, 0, 7, 6, 4, 0, 0), # 71 (31, 14, 16, 11, 17, 6, 7, 3, 4, 1, 1, 3, 0, 17, 15, 15, 14, 17, 3, 6, 6, 7, 6, 4, 3, 0), # 72 (13, 16, 11, 14, 14, 4, 9, 4, 7, 5, 1, 1, 0, 14, 7, 17, 12, 14, 4, 5, 11, 6, 4, 5, 2, 0), # 73 (23, 16, 13, 12, 22, 8, 10, 4, 6, 2, 2, 0, 0, 21, 13, 21, 7, 13, 10, 4, 4, 9, 9, 4, 2, 0), # 74 (21, 20, 12, 25, 17, 4, 7, 6, 6, 1, 1, 0, 0, 15, 26, 17, 10, 19, 8, 5, 5, 2, 4, 2, 0, 0), # 75 (16, 13, 23, 15, 10, 4, 5, 9, 8, 1, 3, 1, 0, 12, 17, 11, 5, 6, 6, 3, 6, 10, 4, 2, 1, 0), # 76 (12, 10, 17, 16, 9, 5, 7, 8, 8, 3, 2, 1, 0, 10, 13, 16, 7, 16, 3, 5, 3, 4, 4, 4, 1, 0), # 77 (20, 14, 17, 19, 18, 9, 6, 3, 9, 2, 3, 2, 0, 19, 18, 14, 11, 24, 8, 7, 6, 7, 5, 4, 1, 0), # 78 (24, 13, 12, 14, 9, 6, 8, 4, 5, 4, 3, 1, 0, 20, 12, 8, 7, 20, 4, 7, 7, 4, 2, 3, 3, 0), # 79 (27, 14, 14, 13, 11, 4, 7, 4, 7, 4, 2, 0, 0, 12, 13, 11, 5, 16, 6, 10, 6, 8, 6, 3, 2, 0), # 80 (19, 14, 16, 17, 17, 8, 3, 8, 8, 1, 4, 2, 0, 29, 16, 17, 15, 16, 12, 3, 5, 10, 1, 9, 0, 0), # 81 (20, 15, 12, 21, 15, 4, 10, 7, 11, 4, 1, 2, 0, 16, 16, 7, 4, 13, 7, 5, 5, 6, 3, 5, 3, 0), # 82 (12, 12, 10, 10, 6, 11, 4, 7, 10, 3, 2, 0, 0, 11, 14, 10, 9, 18, 7, 6, 1, 5, 4, 2, 0, 0), # 83 (21, 15, 14, 14, 7, 7, 4, 5, 7, 1, 3, 1, 0, 20, 12, 9, 10, 17, 7, 7, 5, 8, 8, 4, 1, 0), # 84 (16, 10, 18, 18, 9, 2, 5, 7, 6, 2, 1, 2, 0, 14, 10, 10, 9, 16, 4, 5, 2, 7, 5, 1, 1, 0), # 85 (17, 17, 24, 18, 17, 6, 5, 6, 6, 2, 2, 0, 0, 15, 20, 10, 4, 14, 7, 5, 6, 8, 5, 4, 2, 0), # 86 (20, 13, 19, 18, 13, 5, 5, 3, 8, 3, 2, 0, 0, 17, 19, 10, 6, 10, 7, 6, 7, 5, 2, 2, 2, 0), # 87 (12, 14, 19, 13, 16, 7, 8, 1, 9, 4, 0, 1, 0, 19, 11, 11, 4, 13, 9, 3, 4, 2, 4, 1, 1, 0), # 88 (22, 10, 19, 25, 16, 3, 7, 6, 10, 3, 0, 0, 0, 21, 18, 10, 11, 17, 5, 4, 2, 11, 5, 3, 2, 0), # 89 (26, 12, 14, 15, 14, 3, 6, 7, 12, 4, 1, 0, 0, 18, 19, 11, 7, 14, 7, 3, 3, 9, 4, 4, 3, 0), # 90 (17, 15, 14, 22, 15, 5, 3, 5, 12, 1, 2, 0, 0, 17, 11, 9, 8, 18, 5, 6, 4, 5, 4, 3, 1, 0), # 91 (20, 16, 6, 18, 6, 11, 5, 5, 7, 5, 4, 0, 0, 21, 16, 9, 4, 11, 7, 5, 2, 9, 9, 1, 3, 0), # 92 (16, 15, 25, 20, 9, 6, 12, 0, 7, 4, 0, 1, 0, 19, 11, 8, 15, 6, 6, 9, 6, 7, 5, 3, 2, 0), # 93 (25, 12, 16, 15, 26, 5, 5, 3, 11, 3, 4, 1, 0, 23, 10, 11, 8, 8, 14, 6, 3, 6, 5, 3, 4, 0), # 94 (19, 15, 12, 18, 15, 4, 5, 6, 8, 2, 1, 2, 0, 20, 9, 5, 9, 9, 9, 5, 3, 5, 3, 7, 0, 0), # 95 (13, 10, 10, 12, 15, 7, 2, 8, 4, 1, 6, 2, 0, 11, 10, 10, 8, 12, 8, 3, 2, 8, 5, 3, 3, 0), # 96 (24, 12, 13, 17, 11, 4, 11, 6, 8, 5, 0, 2, 0, 14, 12, 7, 8, 16, 4, 8, 2, 11, 8, 1, 1, 0), # 97 (17, 13, 15, 20, 20, 8, 4, 1, 8, 2, 2, 4, 0, 18, 18, 12, 5, 19, 7, 5, 5, 7, 5, 5, 0, 0), # 98 (14, 13, 12, 15, 13, 14, 4, 3, 5, 2, 2, 1, 0, 18, 13, 11, 6, 13, 1, 9, 6, 7, 2, 6, 3, 0), # 99 (20, 7, 14, 13, 14, 13, 6, 3, 7, 4, 4, 0, 0, 15, 18, 10, 4, 14, 7, 7, 11, 4, 4, 0, 2, 0), # 100 (17, 15, 17, 14, 7, 3, 6, 5, 10, 0, 3, 1, 0, 13, 12, 13, 11, 18, 6, 7, 3, 5, 4, 1, 1, 0), # 101 (20, 18, 10, 15, 14, 7, 6, 3, 1, 1, 1, 1, 0, 19, 16, 11, 14, 16, 12, 6, 7, 6, 5, 2, 2, 0), # 102 (13, 11, 20, 12, 14, 5, 3, 8, 4, 4, 2, 0, 0, 13, 18, 11, 13, 12, 7, 4, 5, 10, 3, 4, 2, 0), # 103 (13, 13, 11, 17, 9, 7, 5, 3, 5, 4, 0, 1, 0, 16, 13, 11, 8, 12, 9, 4, 5, 6, 4, 3, 0, 0), # 104 (13, 14, 9, 18, 11, 1, 6, 8, 7, 1, 1, 2, 0, 17, 13, 4, 6, 14, 4, 8, 4, 11, 9, 2, 0, 0), # 105 (11, 18, 8, 16, 10, 6, 4, 5, 2, 3, 0, 2, 0, 18, 11, 7, 6, 14, 7, 7, 4, 11, 8, 2, 2, 0), # 106 (9, 11, 16, 12, 11, 9, 5, 3, 3, 4, 1, 0, 0, 19, 12, 14, 6, 8, 7, 8, 7, 5, 2, 3, 1, 0), # 107 (12, 14, 18, 17, 18, 5, 8, 3, 9, 1, 2, 3, 0, 27, 15, 11, 7, 10, 7, 1, 5, 8, 8, 7, 1, 0), # 108 (20, 20, 21, 19, 16, 5, 5, 8, 13, 5, 3, 2, 0, 20, 15, 13, 6, 21, 5, 6, 1, 5, 3, 2, 0, 0), # 109 (21, 19, 16, 7, 12, 6, 4, 5, 13, 3, 3, 0, 0, 14, 9, 8, 10, 13, 3, 6, 3, 5, 5, 5, 2, 0), # 110 (14, 14, 15, 19, 14, 3, 5, 4, 7, 5, 4, 2, 0, 17, 16, 13, 6, 12, 6, 6, 5, 2, 5, 3, 1, 0), # 111 (15, 13, 10, 11, 9, 6, 3, 6, 8, 2, 1, 2, 0, 13, 19, 14, 4, 9, 2, 5, 1, 5, 11, 2, 2, 0), # 112 (21, 15, 17, 18, 6, 6, 2, 6, 8, 4, 3, 2, 0, 12, 13, 12, 11, 12, 13, 7, 4, 10, 3, 4, 1, 0), # 113 (15, 12, 10, 11, 16, 5, 8, 1, 6, 1, 3, 1, 0, 15, 15, 11, 13, 16, 10, 7, 9, 3, 4, 4, 1, 0), # 114 (17, 19, 11, 11, 16, 8, 5, 8, 4, 2, 3, 2, 0, 16, 18, 16, 4, 12, 1, 4, 7, 7, 5, 2, 0, 0), # 115 (19, 12, 8, 12, 14, 6, 6, 3, 5, 5, 3, 1, 0, 19, 11, 10, 7, 14, 6, 9, 3, 10, 2, 2, 0, 0), # 116 (20, 13, 12, 18, 15, 6, 9, 5, 7, 0, 2, 3, 0, 26, 21, 12, 5, 10, 8, 3, 7, 8, 7, 4, 0, 0), # 117 (15, 10, 10, 17, 13, 5, 7, 4, 3, 2, 0, 1, 0, 9, 14, 10, 4, 12, 7, 6, 2, 7, 4, 2, 0, 0), # 118 (17, 14, 11, 16, 10, 4, 3, 5, 11, 3, 0, 2, 0, 14, 15, 4, 10, 9, 6, 6, 1, 6, 9, 1, 2, 0), # 119 (17, 4, 17, 19, 10, 9, 5, 3, 10, 3, 1, 0, 0, 25, 13, 9, 9, 12, 8, 3, 4, 4, 9, 4, 1, 0), # 120 (19, 13, 12, 12, 20, 7, 3, 1, 6, 5, 2, 1, 0, 10, 15, 13, 7, 13, 5, 6, 4, 3, 4, 0, 2, 0), # 121 (16, 13, 12, 16, 12, 4, 3, 4, 8, 6, 2, 1, 0, 10, 10, 7, 4, 15, 9, 3, 2, 5, 6, 2, 2, 0), # 122 (19, 9, 10, 13, 12, 5, 2, 3, 6, 2, 4, 1, 0, 10, 13, 7, 8, 22, 1, 3, 6, 3, 3, 2, 0, 0), # 123 (21, 18, 15, 14, 15, 4, 4, 6, 6, 1, 2, 0, 0, 12, 11, 10, 9, 20, 3, 2, 6, 11, 7, 2, 0, 0), # 124 (10, 18, 13, 17, 16, 3, 6, 2, 11, 1, 1, 1, 0, 14, 15, 10, 10, 21, 8, 8, 6, 7, 8, 4, 4, 0), # 125 (13, 8, 11, 10, 9, 7, 3, 5, 9, 3, 4, 2, 0, 12, 10, 8, 12, 9, 7, 6, 6, 6, 5, 2, 0, 0), # 126 (16, 7, 9, 17, 12, 3, 10, 9, 5, 1, 1, 6, 0, 10, 17, 9, 8, 13, 5, 9, 4, 4, 5, 5, 1, 0), # 127 (20, 9, 12, 13, 12, 7, 5, 3, 5, 4, 4, 1, 0, 19, 17, 13, 5, 11, 10, 2, 3, 11, 10, 1, 2, 0), # 128 (11, 18, 15, 14, 13, 5, 8, 7, 5, 3, 1, 1, 0, 17, 20, 9, 9, 15, 11, 7, 5, 3, 3, 5, 1, 0), # 129 (19, 18, 13, 12, 11, 6, 5, 5, 8, 3, 2, 1, 0, 16, 13, 7, 9, 11, 11, 6, 7, 7, 1, 2, 2, 0), # 130 (13, 13, 18, 11, 11, 6, 7, 4, 8, 3, 0, 0, 0, 21, 15, 4, 9, 19, 3, 3, 5, 3, 6, 1, 2, 0), # 131 (13, 7, 8, 16, 15, 4, 5, 10, 10, 4, 2, 1, 0, 7, 13, 14, 5, 6, 4, 3, 3, 4, 5, 4, 2, 0), # 132 (21, 12, 17, 15, 10, 5, 5, 6, 6, 2, 0, 3, 0, 17, 9, 13, 10, 9, 3, 5, 3, 4, 2, 0, 1, 0), # 133 (17, 16, 11, 19, 11, 8, 3, 2, 9, 3, 3, 2, 0, 10, 12, 8, 3, 11, 6, 6, 2, 10, 6, 0, 0, 0), # 134 (17, 6, 17, 10, 9, 6, 3, 7, 7, 2, 2, 0, 0, 9, 12, 8, 7, 10, 10, 2, 4, 5, 4, 1, 2, 0), # 135 (22, 6, 7, 22, 14, 10, 3, 6, 1, 2, 3, 0, 0, 16, 5, 8, 5, 8, 10, 3, 5, 3, 11, 1, 0, 0), # 136 (10, 9, 13, 10, 13, 5, 10, 7, 5, 2, 6, 2, 0, 20, 17, 11, 2, 18, 6, 7, 5, 4, 2, 2, 1, 0), # 137 (12, 9, 14, 23, 14, 8, 7, 3, 7, 5, 1, 0, 0, 15, 13, 10, 7, 7, 3, 9, 4, 4, 0, 3, 2, 0), # 138 (22, 12, 10, 8, 11, 7, 2, 0, 6, 1, 1, 0, 0, 17, 9, 5, 8, 12, 4, 3, 3, 7, 4, 4, 1, 0), # 139 (19, 11, 10, 10, 8, 8, 4, 6, 5, 4, 1, 0, 0, 18, 15, 6, 6, 8, 2, 3, 2, 11, 4, 4, 1, 0), # 140 (20, 12, 14, 12, 10, 5, 6, 2, 6, 1, 1, 2, 0, 15, 19, 10, 9, 17, 5, 5, 7, 4, 3, 1, 1, 0), # 141 (11, 13, 13, 9, 10, 5, 6, 5, 7, 2, 2, 0, 0, 18, 14, 7, 9, 16, 9, 7, 3, 7, 2, 3, 1, 0), # 142 (12, 10, 12, 10, 16, 4, 5, 3, 9, 2, 3, 3, 0, 17, 13, 12, 10, 15, 3, 6, 9, 6, 8, 1, 0, 0), # 143 (15, 11, 12, 10, 11, 4, 7, 7, 5, 1, 1, 0, 0, 18, 13, 8, 3, 21, 3, 6, 8, 1, 5, 4, 2, 0), # 144 (15, 14, 12, 8, 7, 2, 1, 8, 5, 1, 4, 1, 0, 14, 15, 8, 4, 13, 9, 6, 8, 9, 3, 2, 0, 0), # 145 (16, 7, 14, 9, 12, 10, 7, 0, 3, 3, 1, 0, 0, 22, 7, 4, 8, 14, 5, 4, 5, 8, 7, 6, 2, 0), # 146 (14, 8, 16, 18, 8, 4, 4, 2, 8, 1, 2, 2, 0, 15, 12, 8, 10, 9, 4, 6, 5, 9, 7, 3, 0, 0), # 147 (14, 8, 19, 13, 10, 8, 7, 6, 7, 2, 4, 0, 0, 17, 7, 9, 8, 14, 8, 3, 5, 5, 3, 2, 2, 0), # 148 (13, 10, 5, 19, 15, 8, 3, 5, 10, 3, 3, 0, 0, 10, 13, 7, 8, 13, 5, 0, 4, 2, 2, 5, 1, 0), # 149 (17, 10, 7, 10, 14, 6, 5, 7, 5, 3, 4, 1, 0, 13, 12, 5, 9, 12, 7, 4, 5, 4, 2, 3, 0, 0), # 150 (17, 9, 17, 17, 17, 12, 2, 4, 5, 3, 2, 2, 0, 16, 17, 7, 7, 18, 1, 2, 4, 4, 4, 3, 1, 0), # 151 (14, 7, 6, 11, 12, 4, 4, 7, 7, 1, 0, 1, 0, 13, 13, 8, 6, 16, 8, 3, 2, 5, 6, 3, 1, 0), # 152 (15, 9, 15, 8, 12, 2, 2, 3, 6, 0, 3, 3, 0, 17, 17, 6, 5, 11, 10, 6, 5, 8, 3, 2, 0, 0), # 153 (9, 12, 8, 17, 6, 4, 3, 4, 2, 3, 0, 1, 0, 13, 15, 6, 9, 13, 4, 5, 2, 3, 5, 2, 0, 0), # 154 (19, 11, 17, 10, 6, 7, 7, 5, 6, 1, 3, 2, 0, 10, 16, 8, 10, 15, 2, 3, 1, 6, 2, 1, 1, 0), # 155 (8, 7, 11, 13, 12, 4, 6, 2, 9, 2, 0, 1, 0, 12, 17, 5, 6, 8, 5, 2, 5, 6, 4, 1, 2, 0), # 156 (17, 14, 14, 12, 11, 4, 5, 0, 8, 4, 4, 2, 0, 15, 13, 8, 10, 15, 3, 6, 1, 11, 6, 3, 0, 0), # 157 (12, 9, 17, 10, 7, 3, 5, 3, 7, 0, 3, 2, 0, 16, 9, 7, 9, 8, 4, 1, 7, 3, 3, 2, 0, 0), # 158 (10, 9, 15, 21, 14, 7, 2, 6, 4, 2, 1, 1, 0, 11, 19, 10, 9, 19, 3, 3, 1, 8, 1, 3, 0, 0), # 159 (10, 12, 11, 11, 13, 4, 5, 5, 9, 3, 0, 0, 0, 13, 10, 9, 3, 12, 5, 3, 6, 2, 6, 1, 1, 0), # 160 (13, 17, 16, 17, 4, 5, 4, 6, 6, 2, 1, 0, 0, 11, 11, 5, 10, 15, 7, 10, 2, 3, 6, 6, 2, 0), # 161 (10, 7, 11, 6, 8, 9, 4, 8, 3, 1, 3, 5, 0, 15, 10, 8, 5, 12, 5, 4, 2, 0, 1, 1, 0, 0), # 162 (20, 12, 6, 11, 11, 6, 6, 10, 12, 5, 4, 2, 0, 21, 7, 10, 10, 8, 4, 7, 4, 4, 3, 3, 1, 0), # 163 (13, 6, 9, 7, 15, 6, 2, 6, 5, 3, 0, 1, 0, 11, 8, 11, 11, 13, 8, 2, 5, 5, 1, 2, 0, 0), # 164 (16, 11, 14, 11, 13, 2, 4, 2, 5, 2, 1, 0, 0, 9, 11, 4, 10, 13, 3, 4, 4, 4, 2, 3, 1, 0), # 165 (18, 9, 12, 7, 15, 4, 5, 4, 8, 0, 1, 1, 0, 9, 8, 9, 4, 10, 4, 1, 3, 14, 6, 1, 0, 0), # 166 (14, 3, 8, 10, 7, 6, 2, 3, 4, 1, 0, 1, 0, 15, 3, 8, 13, 7, 3, 7, 6, 8, 2, 1, 1, 0), # 167 (14, 8, 7, 12, 7, 8, 1, 1, 2, 0, 3, 3, 0, 17, 8, 1, 6, 11, 4, 2, 0, 3, 0, 2, 0, 0), # 168 (12, 11, 7, 10, 13, 2, 2, 3, 6, 3, 1, 0, 0, 11, 11, 14, 4, 8, 4, 1, 4, 5, 5, 0, 1, 0), # 169 (6, 11, 8, 11, 12, 6, 2, 1, 6, 0, 1, 0, 0, 12, 9, 5, 6, 11, 6, 2, 4, 3, 2, 3, 0, 0), # 170 (6, 6, 12, 10, 10, 5, 1, 1, 3, 1, 1, 1, 0, 12, 11, 2, 3, 4, 1, 2, 3, 3, 3, 1, 0, 0), # 171 (10, 6, 12, 15, 9, 4, 5, 3, 1, 3, 2, 0, 0, 13, 6, 4, 5, 11, 6, 1, 3, 2, 4, 1, 0, 0), # 172 (9, 6, 9, 5, 10, 2, 3, 3, 9, 1, 2, 0, 0, 13, 8, 4, 2, 8, 7, 1, 2, 2, 7, 0, 2, 0), # 173 (9, 5, 7, 11, 10, 4, 2, 2, 3, 2, 0, 1, 0, 11, 5, 6, 1, 6, 8, 3, 0, 6, 4, 0, 0, 0), # 174 (11, 4, 5, 12, 11, 0, 4, 2, 5, 0, 0, 0, 0, 9, 4, 5, 4, 6, 4, 2, 3, 2, 2, 0, 0, 0), # 175 (6, 7, 8, 11, 3, 5, 2, 4, 2, 2, 2, 0, 0, 15, 4, 5, 2, 7, 1, 4, 4, 2, 2, 4, 0, 0), # 176 (6, 3, 7, 6, 3, 3, 1, 0, 3, 2, 0, 1, 0, 4, 5, 4, 8, 10, 4, 0, 3, 4, 2, 1, 0, 0), # 177 (9, 2, 6, 5, 2, 2, 2, 2, 2, 0, 0, 2, 0, 7, 6, 8, 0, 5, 1, 1, 4, 3, 3, 1, 1, 0), # 178 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 179 ) station_arriving_intensity = ( (9.037558041069182, 9.9455194074477, 9.380309813302512, 11.18640199295418, 9.998434093697302, 5.64957887766721, 7.462864107673047, 8.375717111362961, 10.962178311902413, 7.124427027940266, 7.569477294994085, 8.816247140951113, 9.150984382641052), # 0 (9.637788873635953, 10.602109249460566, 9.999623864394273, 11.925259655897909, 10.660482607453627, 6.0227704512766005, 7.955044094274649, 8.927124701230275, 11.686041587399236, 7.59416524609887, 8.069573044721038, 9.398189989465838, 9.755624965391739), # 1 (10.236101416163518, 11.256093307603763, 10.616476113985344, 12.66117786839663, 11.320133352749538, 6.3944732061224006, 8.445273314329269, 9.476325446227955, 12.407016252379588, 8.062044795036982, 8.567681667797364, 9.9778187736955, 10.357856690777442), # 2 (10.830164027663812, 11.904876903485604, 11.228419564775738, 13.391237533557733, 11.974791016803424, 6.763213120653203, 8.93160655496632, 10.021142083490112, 13.122243289657968, 8.526208857167125, 9.061827141289289, 10.55283423287483, 10.955291051257605), # 3 (11.417645067148767, 12.545865358714394, 11.833007219465467, 14.112519554488625, 12.621860286833686, 7.127516173317602, 9.412098603315226, 10.559397350150848, 13.828863682048873, 8.984800614901822, 9.550033442263036, 11.120937106238575, 11.54553953929167), # 4 (11.996212893630318, 13.176463994898459, 12.427792080754532, 14.822104834296708, 13.258745850058704, 7.485908342564186, 9.884804246505404, 11.088913983344266, 14.524018412366805, 9.435963250653593, 10.030324547784838, 11.679828133021466, 12.126213647339089), # 5 (12.5635358661204, 13.794078133646101, 13.010327151342958, 15.517074276089375, 13.882852393696878, 7.836915606841555, 10.347778271666273, 11.60751472020448, 15.204848463426268, 9.877839946834966, 10.500724434920908, 12.227208052458254, 12.694924867859292), # 6 (13.117282343630944, 14.396113096565637, 13.578165433930742, 16.194508782974033, 14.491584604966597, 8.179063944598298, 10.799075465927253, 12.113022297865593, 15.868494818041759, 10.308573885858456, 10.959257080737483, 12.760777603783673, 13.249284693311735), # 7 (13.655120685173882, 14.979974205265378, 14.128859931217914, 16.85148925805807, 15.082347171086255, 8.510879334283002, 11.236750616417757, 12.603259453461705, 16.512098459027772, 10.726308250136594, 11.403946462300778, 13.278237526232465, 13.786904616155851), # 8 (14.174719249761154, 15.543066781353641, 14.659963645904467, 17.485096604448906, 15.652544779274237, 8.830887754344271, 11.658858510267216, 13.076048924126933, 17.132800369198815, 11.129186222081895, 11.83281655667702, 13.777288559039365, 14.305396128851092), # 9 (14.673746396404677, 16.082796146438728, 15.169029580690424, 18.092411725253918, 16.199582116748942, 9.137615183230693, 12.063453934605038, 13.52921344699538, 17.727741531369386, 11.515350984106886, 12.243891340932432, 14.255631441439114, 14.802370723856898), # 10 (15.149870484116411, 16.596567622128973, 15.653610738275788, 18.670515523580516, 16.72086387072876, 9.429587599390864, 12.44859167656065, 13.960575759201147, 18.294062928353988, 11.882945718624095, 12.635194792133248, 14.710966912666459, 15.2754398936327), # 11 (15.600759871908263, 17.081786530032655, 16.111260121360573, 19.216488902536103, 17.21379472843208, 9.705330981273365, 12.812326523263462, 14.367958597878339, 18.82890554296712, 12.23011360804603, 13.004750887345683, 15.140995711956123, 15.722215130637963), # 12 (16.02408291879218, 17.535858191758116, 16.539530732644792, 19.727412765228078, 17.675779377077284, 9.963371307326803, 13.152713261842901, 14.749184700161067, 19.329410358023278, 12.554997834785228, 13.350583603635965, 15.543418578542857, 16.140307927332124), # 13 (16.41750798378009, 17.95618792891366, 16.935975574828465, 20.20036801476383, 18.10422250388278, 10.202234555999762, 13.46780667942839, 15.102076803183444, 19.79271835633696, 12.855741581254202, 13.670716918070312, 15.915936251661408, 16.527329776174614), # 14 (16.77870342588394, 18.34018106310759, 17.298147650611575, 20.632435554250776, 18.496528796066954, 10.420446705740842, 13.755661563149326, 15.424457644079562, 20.215970520722674, 13.130488029865482, 13.963174807714955, 16.256249470546507, 16.880892169624886), # 15 (17.10533760411564, 18.685242915948237, 17.623599962694165, 21.02069628679629, 18.8501029408482, 10.616533734998628, 14.014332700135158, 15.71414995998353, 20.596307833994917, 13.377380363031593, 14.225981249636122, 16.56205897443289, 17.198606600142384), # 16 (17.395078877487137, 18.988778809043904, 17.909885513776235, 21.362231115507804, 19.162349625444907, 10.789021622221714, 14.24187487751528, 15.968976488029472, 20.930871278968173, 13.594561763165041, 14.457160220900038, 16.8310655025553, 17.47808456018655), # 17 (17.645595605010367, 19.248194064002895, 18.154557306557784, 21.654120943492703, 19.43067353707546, 10.936436345858706, 14.436342882419133, 16.18675996535147, 21.216801838456973, 13.780175412678366, 14.654735698572916, 17.060969794148487, 17.716937542216822), # 18 (17.85455614569726, 19.46089400243354, 18.355168343738843, 21.893446673858367, 19.65247936295826, 11.057303884358175, 14.59579150197611, 16.36532312908364, 21.4512404952758, 13.93236449398409, 14.81673165972098, 17.249472588447173, 17.912777038692653), # 19 (18.01962885855975, 19.624283945944132, 18.509271628019405, 22.077289209712237, 19.8251717903117, 11.150150216168733, 14.718275523315652, 16.50248871636009, 21.631328232239156, 14.049272189494726, 14.94117208141047, 17.394274624686105, 18.063214542073485), # 20 (18.13848210260976, 19.735769216143005, 18.614420162099496, 22.202729454161673, 19.94615550635416, 11.213501319738963, 14.801849733567167, 16.596079464314922, 21.754206032161537, 14.1290416816228, 15.026080940707608, 17.49307664210003, 18.165861544818743), # 21 (18.20878423685924, 19.792755134638462, 18.668166948679115, 22.266848310314106, 20.012835198304035, 11.245883173517461, 14.844568919860079, 16.643918110082247, 21.81701487785745, 14.169816152780836, 15.069482214678613, 17.54357937992368, 18.218329539387888), # 22 (18.23470805401675, 19.799502469135803, 18.674861728395065, 22.274875462962967, 20.029917700858675, 11.25, 14.84964720406681, 16.64908888888889, 21.824867222222224, 14.17462609053498, 15.074924466891131, 17.549815637860082, 18.225), # 23 (18.253822343461476, 19.79556666666667, 18.673766666666666, 22.273887500000004, 20.039593704506736, 11.25, 14.8468568627451, 16.6419, 21.823815, 14.17167111111111, 15.074324242424245, 17.548355555555556, 18.225), # 24 (18.272533014380844, 19.78780864197531, 18.671604938271606, 22.27193287037037, 20.049056902070106, 11.25, 14.841358024691358, 16.62777777777778, 21.82173611111111, 14.16585390946502, 15.073134118967452, 17.545473251028806, 18.225), # 25 (18.290838634286462, 19.776346913580248, 18.668406172839507, 22.269033796296295, 20.05830696315799, 11.25, 14.833236092955698, 16.60698888888889, 21.81865722222222, 14.157271275720165, 15.07136487093154, 17.54120823045268, 18.225), # 26 (18.308737770689945, 19.7613, 18.6642, 22.265212499999997, 20.067343557379587, 11.25, 14.822576470588237, 16.579800000000002, 21.814605, 14.146019999999998, 15.069027272727272, 17.535600000000002, 18.225), # 27 (18.3262289911029, 19.742786419753084, 18.659016049382718, 22.260491203703705, 20.076166354344124, 11.25, 14.809464560639071, 16.54647777777778, 21.809606111111112, 14.132196872427985, 15.066132098765433, 17.528688065843625, 18.225), # 28 (18.34331086303695, 19.720924691358025, 18.652883950617287, 22.25489212962963, 20.084775023660796, 11.25, 14.793985766158318, 16.507288888888887, 21.803687222222223, 14.115898683127574, 15.06269012345679, 17.520511934156378, 18.225), # 29 (18.359981954003697, 19.695833333333333, 18.645833333333332, 22.2484375, 20.093169234938827, 11.25, 14.776225490196078, 16.4625, 21.796875, 14.097222222222223, 15.058712121212121, 17.51111111111111, 18.225), # 30 (18.376240831514746, 19.667630864197534, 18.637893827160497, 22.241149537037035, 20.101348657787415, 11.25, 14.756269135802471, 16.412377777777778, 21.78919611111111, 14.07626427983539, 15.054208866442199, 17.500525102880662, 18.225), # 31 (18.392086063081717, 19.636435802469137, 18.629095061728393, 22.233050462962964, 20.10931296181577, 11.25, 14.734202106027599, 16.357188888888892, 21.780677222222224, 14.053121646090535, 15.0491911335578, 17.48879341563786, 18.225), # 32 (18.407516216216216, 19.602366666666665, 18.619466666666668, 22.2241625, 20.117061816633115, 11.25, 14.710109803921569, 16.2972, 21.771345, 14.027891111111112, 15.043669696969696, 17.475955555555554, 18.225), # 33 (18.422529858429858, 19.56554197530864, 18.609038271604938, 22.21450787037037, 20.12459489184864, 11.25, 14.684077632534496, 16.232677777777777, 21.761226111111114, 14.000669465020577, 15.037655331088663, 17.462051028806584, 18.225), # 34 (18.437125557234253, 19.52608024691358, 18.597839506172843, 22.204108796296293, 20.131911857071568, 11.25, 14.656190994916486, 16.163888888888888, 21.750347222222224, 13.971553497942386, 15.031158810325476, 17.447119341563788, 18.225), # 35 (18.45130188014101, 19.484099999999998, 18.5859, 22.192987499999997, 20.139012381911105, 11.25, 14.626535294117646, 16.0911, 21.738735, 13.94064, 15.024190909090908, 17.431200000000004, 18.225), # 36 (18.46505739466174, 19.43971975308642, 18.57324938271605, 22.181166203703704, 20.145896135976457, 11.25, 14.595195933188089, 16.014577777777777, 21.72641611111111, 13.908025761316873, 15.016762401795738, 17.414332510288066, 18.225), # 37 (18.47839066830806, 19.39305802469136, 18.559917283950615, 22.168667129629632, 20.152562788876843, 11.25, 14.562258315177923, 15.934588888888891, 21.713417222222223, 13.873807572016462, 15.00888406285073, 17.396556378600824, 18.225), # 38 (18.491300268591576, 19.34423333333333, 18.545933333333334, 22.1555125, 20.159012010221467, 11.25, 14.527807843137257, 15.8514, 21.699765000000003, 13.838082222222223, 15.000566666666668, 17.37791111111111, 18.225), # 39 (18.503784763023894, 19.293364197530863, 18.531327160493827, 22.14172453703704, 20.165243469619533, 11.25, 14.491929920116196, 15.765277777777781, 21.685486111111114, 13.800946502057615, 14.99182098765432, 17.358436213991773, 18.225), # 40 (18.51584271911663, 19.24056913580247, 18.51612839506173, 22.127325462962965, 20.171256836680264, 11.25, 14.454709949164851, 15.67648888888889, 21.67060722222222, 13.76249720164609, 14.982657800224468, 17.338171193415636, 18.225), # 41 (18.527472704381402, 19.18596666666667, 18.500366666666668, 22.112337500000002, 20.177051781012857, 11.25, 14.416233333333333, 15.5853, 21.655155000000004, 13.72283111111111, 14.97308787878788, 17.317155555555555, 18.225), # 42 (18.538673286329807, 19.12967530864198, 18.484071604938272, 22.096782870370372, 20.182627972226527, 11.25, 14.37658547567175, 15.491977777777779, 21.63915611111111, 13.682045020576133, 14.96312199775533, 17.295428806584365, 18.225), # 43 (18.54944303247347, 19.071813580246914, 18.467272839506176, 22.0806837962963, 20.18798507993048, 11.25, 14.335851779230211, 15.396788888888892, 21.62263722222222, 13.64023572016461, 14.952770931537597, 17.2730304526749, 18.225), # 44 (18.55978051032399, 19.0125, 18.45, 22.064062500000002, 20.193122773733933, 11.25, 14.294117647058824, 15.3, 21.605625, 13.597500000000002, 14.942045454545454, 17.25, 18.225), # 45 (18.569684287392985, 18.951853086419753, 18.432282716049382, 22.046941203703703, 20.198040723246088, 11.25, 14.251468482207699, 15.20187777777778, 21.588146111111108, 13.553934650205761, 14.930956341189674, 17.226376954732512, 18.225), # 46 (18.579152931192063, 18.88999135802469, 18.41415061728395, 22.02934212962963, 20.202738598076163, 11.25, 14.207989687726945, 15.102688888888888, 21.570227222222226, 13.50963646090535, 14.919514365881032, 17.20220082304527, 18.225), # 47 (18.588185009232834, 18.827033333333333, 18.395633333333333, 22.0112875, 20.20721606783336, 11.25, 14.163766666666668, 15.0027, 21.551895000000002, 13.464702222222222, 14.907730303030302, 17.177511111111112, 18.225), # 48 (18.596779089026917, 18.763097530864197, 18.376760493827163, 21.99279953703704, 20.211472802126895, 11.25, 14.118884822076978, 14.902177777777778, 21.53317611111111, 13.419228724279836, 14.895614927048262, 17.152347325102884, 18.225), # 49 (18.604933738085908, 18.698302469135808, 18.357561728395066, 21.973900462962963, 20.21550847056597, 11.25, 14.073429557007989, 14.801388888888889, 21.514097222222222, 13.373312757201646, 14.883179012345678, 17.126748971193418, 18.225), # 50 (18.61264752392144, 18.63276666666667, 18.338066666666666, 21.9546125, 20.219322742759797, 11.25, 14.027486274509805, 14.7006, 21.494685000000004, 13.32705111111111, 14.870433333333335, 17.10075555555556, 18.225), # 51 (18.619919014045102, 18.56660864197531, 18.318304938271606, 21.934957870370372, 20.222915288317584, 11.25, 13.981140377632535, 14.600077777777777, 21.47496611111111, 13.280540576131688, 14.857388664421999, 17.074406584362144, 18.225), # 52 (18.626746775968517, 18.49994691358025, 18.29830617283951, 21.914958796296297, 20.226285776848552, 11.25, 13.93447726942629, 14.50008888888889, 21.454967222222226, 13.233877942386831, 14.844055780022448, 17.04774156378601, 18.225), # 53 (18.63312937720329, 18.432900000000004, 18.2781, 21.8946375, 20.229433877961906, 11.25, 13.887582352941177, 14.400899999999998, 21.434715, 13.18716, 14.830445454545453, 17.0208, 18.225), # 54 (18.63906538526104, 18.365586419753086, 18.25771604938272, 21.874016203703704, 20.232359261266843, 11.25, 13.840541031227307, 14.302777777777777, 21.414236111111112, 13.140483539094651, 14.816568462401795, 16.993621399176956, 18.225), # 55 (18.64455336765337, 18.298124691358026, 18.237183950617286, 21.85311712962963, 20.235061596372585, 11.25, 13.793438707334786, 14.20598888888889, 21.393557222222224, 13.09394534979424, 14.802435578002246, 16.96624526748971, 18.225), # 56 (18.649591891891887, 18.230633333333333, 18.216533333333334, 21.8319625, 20.23754055288834, 11.25, 13.746360784313726, 14.110800000000001, 21.372705, 13.047642222222223, 14.788057575757577, 16.93871111111111, 18.225), # 57 (18.654179525488225, 18.163230864197534, 18.195793827160493, 21.810574537037034, 20.239795800423316, 11.25, 13.699392665214235, 14.017477777777778, 21.35170611111111, 13.001670946502058, 14.773445230078567, 16.91105843621399, 18.225), # 58 (18.658314835953966, 18.096035802469135, 18.174995061728396, 21.788975462962963, 20.24182700858672, 11.25, 13.65261975308642, 13.92628888888889, 21.330587222222224, 12.956128312757203, 14.758609315375981, 16.883326748971193, 18.225), # 59 (18.661996390800738, 18.02916666666667, 18.154166666666665, 21.767187500000002, 20.243633846987766, 11.25, 13.606127450980392, 13.8375, 21.309375000000003, 12.911111111111111, 14.743560606060607, 16.855555555555558, 18.225), # 60 (18.665222757540146, 17.962741975308646, 18.13333827160494, 21.74523287037037, 20.24521598523566, 11.25, 13.560001161946259, 13.751377777777778, 21.288096111111113, 12.866716131687244, 14.728309876543209, 16.82778436213992, 18.225), # 61 (18.66799250368381, 17.89688024691358, 18.112539506172844, 21.7231337962963, 20.246573092939624, 11.25, 13.514326289034132, 13.66818888888889, 21.266777222222224, 12.823040164609054, 14.712867901234567, 16.80005267489712, 18.225), # 62 (18.670304196743327, 17.831699999999998, 18.0918, 21.7009125, 20.24770483970884, 11.25, 13.469188235294117, 13.5882, 21.245445, 12.78018, 14.697245454545456, 16.7724, 18.225), # 63 (18.672156404230314, 17.767319753086422, 18.071149382716047, 21.678591203703704, 20.24861089515255, 11.25, 13.424672403776325, 13.511677777777779, 21.22412611111111, 12.738232427983538, 14.681453310886642, 16.7448658436214, 18.225), # 64 (18.67354769365639, 17.703858024691357, 18.05061728395062, 21.65619212962963, 20.24929092887994, 11.25, 13.380864197530865, 13.438888888888888, 21.202847222222225, 12.697294238683126, 14.665502244668913, 16.717489711934153, 18.225), # 65 (18.674476632533153, 17.641433333333335, 18.030233333333335, 21.6337375, 20.249744610500233, 11.25, 13.337849019607843, 13.3701, 21.181635000000004, 12.657462222222222, 14.649403030303029, 16.690311111111114, 18.225), # 66 (18.674941788372227, 17.580164197530863, 18.010027160493827, 21.611249537037036, 20.249971609622634, 11.25, 13.29571227305737, 13.30557777777778, 21.16051611111111, 12.618833168724281, 14.633166442199778, 16.6633695473251, 18.225), # 67 (18.674624906065485, 17.519847550776582, 17.989930709876543, 21.588555132850242, 20.249780319535223, 11.24979122085048, 13.254327350693364, 13.245018930041153, 21.13935812757202, 12.5813167949649, 14.616514779372677, 16.636554039419536, 18.22477527006173), # 68 (18.671655072463768, 17.458641935483872, 17.969379166666666, 21.564510326086953, 20.248039215686273, 11.248140740740741, 13.212482726423904, 13.185177777777778, 21.11723611111111, 12.543851503267971, 14.597753110047847, 16.608994152046783, 18.222994791666668), # 69 (18.665794417606012, 17.39626642771804, 17.948283179012343, 21.538956823671498, 20.244598765432098, 11.244890260631001, 13.169988242210465, 13.125514403292183, 21.09402520576132, 12.506255144032922, 14.576667995746943, 16.580560970327056, 18.219478202160495), # 70 (18.657125389157272, 17.332758303464754, 17.92665015432099, 21.51193230676329, 20.239502541757446, 11.240092455418381, 13.12686298717018, 13.066048559670783, 21.06975997942387, 12.46852864681675, 14.553337267410951, 16.551275286982886, 18.21427179783951), # 71 (18.64573043478261, 17.268154838709677, 17.9044875, 21.48347445652174, 20.23279411764706, 11.2338, 13.083126050420168, 13.0068, 21.044475000000002, 12.43067294117647, 14.527838755980863, 16.52115789473684, 18.207421875), # 72 (18.631692002147076, 17.20249330943847, 17.88180262345679, 21.45362095410628, 20.224517066085692, 11.226065569272976, 13.038796521077565, 12.947788477366256, 21.01820483539095, 12.392688956669087, 14.50025029239766, 16.490229586311454, 18.198974729938275), # 73 (18.61509253891573, 17.1358109916368, 17.858602932098762, 21.42240948067633, 20.214714960058096, 11.216941838134431, 12.9938934882595, 12.889033744855967, 20.990984053497943, 12.354577622851611, 14.470649707602341, 16.45851115442928, 18.18897665895062), # 74 (18.59601449275362, 17.06814516129032, 17.83489583333333, 21.389877717391304, 20.203431372549023, 11.206481481481482, 12.9484360410831, 12.830555555555556, 20.96284722222222, 12.316339869281046, 14.439114832535884, 16.426023391812866, 18.177473958333334), # 75 (18.57454031132582, 16.99953309438471, 17.8106887345679, 21.35606334541063, 20.19070987654321, 11.19473717421125, 12.902443268665492, 12.772373662551441, 20.93382890946502, 12.277976625514404, 14.405723498139285, 16.392787091184747, 18.164512924382716), # 76 (18.55075244229737, 16.93001206690562, 17.785989043209874, 21.32100404589372, 20.176594045025414, 11.18176159122085, 12.855934260123803, 12.714507818930043, 20.90396368312757, 12.239488821108692, 14.370553535353537, 16.358823045267492, 18.150139853395064), # 77 (18.524733333333334, 16.859619354838713, 17.760804166666667, 21.2847375, 20.16112745098039, 11.167607407407406, 12.808928104575164, 12.65697777777778, 20.87328611111111, 12.200877385620915, 14.333682775119618, 16.324152046783627, 18.134401041666667), # 78 (18.496565432098766, 16.788392234169656, 17.735141512345677, 21.24730138888889, 20.144353667392885, 11.152327297668037, 12.761443891136702, 12.59980329218107, 20.84183076131687, 12.162143248608086, 14.29518904837852, 16.28879488845571, 18.117342785493825), # 79 (18.466331186258724, 16.71636798088411, 17.70900848765432, 21.208733393719807, 20.126316267247642, 11.135973936899862, 12.713500708925546, 12.543004115226339, 20.809632201646092, 12.123287339627208, 14.255150186071239, 16.252772363006283, 18.09901138117284), # 80 (18.434113043478263, 16.643583870967742, 17.682412499999998, 21.169071195652176, 20.10705882352941, 11.118599999999999, 12.665117647058823, 12.486600000000001, 20.776725, 12.084310588235295, 14.213644019138757, 16.216105263157896, 18.079453124999997), # 81 (18.399993451422436, 16.570077180406216, 17.655360956790126, 21.12835247584541, 20.086624909222948, 11.10025816186557, 12.616313794653665, 12.430610699588478, 20.743143724279836, 12.045213923989348, 14.170748378522063, 16.178814381633096, 18.058714313271608), # 82 (18.364054857756308, 16.495885185185184, 17.6278612654321, 21.086614915458934, 20.065058097313, 11.08100109739369, 12.567108240827196, 12.37505596707819, 20.70892294238683, 12.00599827644638, 14.12654109516215, 16.14092051115443, 18.036841242283952), # 83 (18.326379710144927, 16.421045161290323, 17.599920833333332, 21.043896195652174, 20.042401960784314, 11.060881481481482, 12.517520074696545, 12.319955555555556, 20.674097222222223, 11.9666645751634, 14.0811, 16.102444444444444, 18.013880208333333), # 84 (18.287050456253354, 16.345594384707287, 17.571547067901232, 21.000233997584544, 20.01870007262164, 11.039951989026063, 12.467568385378843, 12.265329218106997, 20.63870113168724, 11.92721374969741, 14.034502923976609, 16.06340697422569, 17.989877507716052), # 85 (18.246149543746643, 16.269570131421744, 17.54274737654321, 20.955666002415462, 19.99399600580973, 11.018265294924555, 12.417272261991217, 12.21119670781893, 20.60276923868313, 11.887646729605423, 13.986827698032961, 16.02382889322071, 17.964879436728395), # 86 (18.203759420289852, 16.193009677419354, 17.513529166666665, 20.910229891304347, 19.968333333333337, 10.995874074074074, 12.366650793650793, 12.157577777777778, 20.566336111111116, 11.847964444444443, 13.938152153110048, 15.983730994152046, 17.938932291666667), # 87 (18.159962533548043, 16.11595029868578, 17.483899845679012, 20.86396334541063, 19.941755628177198, 10.972831001371743, 12.315723069474704, 12.104492181069958, 20.52943631687243, 11.808167823771482, 13.888554120148857, 15.943134069742257, 17.912082368827164), # 88 (18.11484133118626, 16.03842927120669, 17.453866820987656, 20.81690404589372, 19.91430646332607, 10.94918875171468, 12.264508178580074, 12.051959670781894, 20.492104423868312, 11.76825779714355, 13.838111430090379, 15.902058912713883, 17.884375964506173), # 89 (18.068478260869565, 15.960483870967742, 17.423437500000002, 20.769089673913047, 19.886029411764707, 10.925, 12.213025210084034, 12.0, 20.454375000000002, 11.728235294117647, 13.786901913875598, 15.860526315789475, 17.855859375), # 90 (18.020955770263015, 15.8821513739546, 17.392619290123456, 20.720557910628024, 19.85696804647785, 10.900317421124829, 12.161293253103711, 11.9486329218107, 20.41628261316873, 11.688101244250786, 13.735003402445509, 15.818557071691574, 17.826578896604936), # 91 (17.97235630703167, 15.80346905615293, 17.361419598765433, 20.671346437198068, 19.827165940450254, 10.875193689986283, 12.109331396756236, 11.897878189300412, 20.377861831275723, 11.647856577099976, 13.682493726741095, 15.776171973142736, 17.796580825617283), # 92 (17.92276231884058, 15.724474193548389, 17.329845833333334, 20.621492934782612, 19.796666666666667, 10.84968148148148, 12.057158730158731, 11.847755555555556, 20.339147222222223, 11.607502222222221, 13.62945071770335, 15.733391812865497, 17.76591145833333), # 93 (17.872256253354806, 15.645204062126643, 17.29790540123457, 20.571035084541062, 19.765513798111837, 10.823833470507545, 12.00479434242833, 11.798284773662553, 20.300173353909464, 11.567039109174534, 13.575952206273259, 15.690237383582414, 17.734617091049383), # 94 (17.820920558239397, 15.56569593787336, 17.265605709876546, 20.52001056763285, 19.733750907770517, 10.797702331961592, 11.95225732268216, 11.749485596707821, 20.260974794238685, 11.526468167513919, 13.522076023391813, 15.646729478016026, 17.70274402006173), # 95 (17.76883768115942, 15.485987096774197, 17.23295416666667, 20.468457065217393, 19.701421568627453, 10.77134074074074, 11.899566760037347, 11.701377777777779, 20.221586111111108, 11.485790326797385, 13.4679, 15.602888888888891, 17.67033854166667), # 96 (17.716090069779927, 15.406114814814819, 17.199958179012345, 20.416412258454105, 19.668569353667394, 10.744801371742112, 11.846741743611025, 11.65398106995885, 20.182041872427984, 11.445006516581941, 13.413501967038808, 15.558736408923545, 17.637446952160495), # 97 (17.66276017176597, 15.326116367980884, 17.166625154320986, 20.363913828502415, 19.635237835875095, 10.718136899862827, 11.793801362520316, 11.607315226337448, 20.142376646090533, 11.404117666424595, 13.35895975544923, 15.514292830842535, 17.604115547839505), # 98 (17.608930434782607, 15.246029032258065, 17.1329625, 20.31099945652174, 19.601470588235298, 10.6914, 11.740764705882354, 11.5614, 20.102625, 11.363124705882353, 13.304351196172249, 15.469578947368422, 17.570390625), # 99 (17.5546833064949, 15.165890083632016, 17.09897762345679, 20.257706823671498, 19.567311183732752, 10.664643347050754, 11.687650862814262, 11.516255144032922, 20.062821502057616, 11.322028564512225, 13.249754120148857, 15.42461555122374, 17.536318479938274), # 100 (17.500101234567904, 15.085736798088412, 17.064677932098768, 20.204073611111113, 19.532803195352216, 10.637919615912208, 11.634478922433171, 11.471900411522633, 20.02300072016461, 11.280830171871218, 13.195246358320043, 15.379423435131034, 17.501945408950615), # 101 (17.44526666666667, 15.005606451612904, 17.030070833333333, 20.1501375, 19.497990196078433, 10.611281481481482, 11.58126797385621, 11.428355555555555, 19.98319722222222, 11.239530457516341, 13.140905741626794, 15.334023391812867, 17.467317708333336), # 102 (17.390262050456254, 14.92553632019116, 16.9951637345679, 20.095936171497584, 19.462915758896152, 10.584781618655693, 11.528037106200506, 11.385640329218107, 19.943445576131687, 11.1981303510046, 13.086810101010101, 15.28843621399177, 17.432481674382714), # 103 (17.335169833601718, 14.845563679808842, 16.959964043209876, 20.041507306763286, 19.427623456790123, 10.558472702331962, 11.474805408583187, 11.343774485596708, 19.90378034979424, 11.156630781893005, 13.03303726741095, 15.242682694390297, 17.397483603395063), # 104 (17.280072463768114, 14.765725806451613, 16.924479166666668, 19.98688858695652, 19.392156862745097, 10.532407407407408, 11.421591970121383, 11.302777777777779, 19.86423611111111, 11.115032679738563, 12.979665071770334, 15.196783625730996, 17.362369791666666), # 105 (17.225052388620504, 14.686059976105138, 16.888716512345678, 19.932117693236716, 19.356559549745825, 10.50663840877915, 11.36841587993222, 11.262669958847736, 19.82484742798354, 11.07333697409828, 12.92677134502924, 15.15075980073641, 17.327186535493826), # 106 (17.17019205582394, 14.606603464755079, 16.852683487654325, 19.877232306763286, 19.32087509077705, 10.48121838134431, 11.31529622713283, 11.223470781893006, 19.78564886831276, 11.03154459452917, 12.874433918128654, 15.104632012129088, 17.29198013117284), # 107 (17.11557391304348, 14.5273935483871, 16.8163875, 19.822270108695655, 19.28514705882353, 10.4562, 11.262252100840335, 11.185200000000002, 19.746675000000003, 10.989656470588237, 12.82273062200957, 15.05842105263158, 17.256796875000003), # 108 (17.061280407944178, 14.448467502986858, 16.779835956790127, 19.767268780193234, 19.249419026870008, 10.431635939643346, 11.209302590171871, 11.147877366255145, 19.707960390946504, 10.947673531832486, 12.771739287612972, 15.012147714966428, 17.221683063271605), # 109 (17.007393988191087, 14.369862604540026, 16.743036265432103, 19.71226600241546, 19.213734567901238, 10.407578875171467, 11.15646678424456, 11.111522633744855, 19.669539609053498, 10.90559670781893, 12.72153774587985, 14.965832791856185, 17.18668499228395), # 110 (16.953997101449275, 14.29161612903226, 16.705995833333336, 19.65729945652174, 19.178137254901962, 10.384081481481482, 11.103763772175537, 11.076155555555555, 19.631447222222224, 10.863426928104575, 12.672203827751195, 14.919497076023394, 17.151848958333336), # 111 (16.90117219538379, 14.213765352449222, 16.66872206790124, 19.602406823671497, 19.142670660856936, 10.361196433470509, 11.051212643081925, 11.041795884773663, 19.593717798353907, 10.821165122246429, 12.623815364167996, 14.873161360190599, 17.11722125771605), # 112 (16.84890760266548, 14.136477513814715, 16.631312090853726, 19.547700988485673, 19.10731622431267, 10.338965584586125, 10.998946734582185, 11.00853462380509, 19.556483060265517, 10.778948525902914, 12.57646303107516, 14.826947285707972, 17.0827990215178), # 113 (16.796665616220118, 14.060514930345965, 16.594282215038913, 19.493620958299207, 19.071708038219388, 10.317338295353823, 10.947632775139043, 10.976780267109216, 19.52031426428351, 10.73756730224301, 12.530239806803754, 14.781441909803354, 17.048295745488062), # 114 (16.744292825407193, 13.985904957629483, 16.55765447887317, 19.440152109327204, 19.035733820199482, 10.296258322497776, 10.89730737034481, 10.946524777701677, 19.485224961603823, 10.697085590378538, 12.485078120568769, 14.736667648605932, 17.013611936988678), # 115 (16.691723771827743, 13.912538906325063, 16.521357941970972, 19.38719907047953, 18.999339347490803, 10.275675979116777, 10.847888671550209, 10.917684563218188, 19.451126410610094, 10.657428045209185, 12.440890676288666, 14.692541755477222, 16.978693067560602), # 116 (16.63889299708279, 13.840308087092497, 16.485321663946774, 19.33466647066604, 18.9624703973312, 10.255541578309604, 10.799294830105955, 10.890176031294454, 19.417929869685967, 10.618519321634633, 12.39759017788191, 14.64898148377875, 16.943484608744804), # 117 (16.58573504277338, 13.769103810591583, 16.44947470441506, 19.2824589387966, 18.925072746958516, 10.235805433175049, 10.751443997362767, 10.863915589566174, 19.385546597215082, 10.580284074554568, 12.355089329266963, 14.60590408687203, 16.907932032082243), # 118 (16.532184450500534, 13.698817387482112, 16.413746122990304, 19.23048110378107, 18.887092173610597, 10.2164178568119, 10.70425432467136, 10.838819645669062, 19.353887851581078, 10.54264695886867, 12.31330083436229, 14.563226818118581, 16.87198080911388), # 119 (16.47817576186529, 13.629340128423884, 16.37806497928697, 19.17863759452931, 18.848474454525295, 10.197329162318939, 10.657643963382455, 10.814804607238818, 19.322864891167605, 10.50553262947663, 12.272137397086349, 14.520866930879935, 16.835576411380675), # 120 (16.423643518468683, 13.560563344076693, 16.342360332919537, 19.12683303995118, 18.809165366940455, 10.178489662794956, 10.611531064846766, 10.791786881911152, 19.2923889743583, 10.468865741278133, 12.23151172135761, 14.4787416785176, 16.79866431042359), # 121 (16.36852226191174, 13.49237834510033, 16.30656124350248, 19.07497206895654, 18.76911068809392, 10.159849671338735, 10.565833780415012, 10.769682877321769, 19.2623713595368, 10.43257094917286, 12.191336511094532, 14.436768314393102, 16.761189977783587), # 122 (16.312746533795494, 13.424676442154594, 16.270596770650265, 19.02295931045525, 18.728256195223544, 10.141359501049065, 10.52047026143791, 10.74840900110637, 19.232723305086758, 10.396572908060497, 12.151524470215579, 14.394864091867959, 16.72309888500163), # 123 (16.256250875720976, 13.357348945899277, 16.234395973977367, 18.970699393357176, 18.68654766556717, 10.12296946502473, 10.475358659266176, 10.727881660900668, 19.20335606939181, 10.36079627284073, 12.111988302639215, 14.352946264303695, 16.68433650361868), # 124 (16.198969829289226, 13.290287166994178, 16.197887913098263, 18.91809694657217, 18.643930876362642, 10.104629876364521, 10.43041712525053, 10.708017264340365, 19.174180910835588, 10.32516569841324, 12.072640712283903, 14.310932085061827, 16.644848305175692), # 125 (16.14083793610127, 13.22338241609909, 16.16100164762742, 18.8650565990101, 18.60035160484781, 10.086291048167222, 10.385563810741687, 10.688732219061166, 19.145109087801753, 10.289605839677717, 12.033394403068103, 14.268738807503881, 16.604579761213643), # 126 (16.08178973775815, 13.156526003873804, 16.123666237179307, 18.81148297958082, 18.555755628260517, 10.067903293531618, 10.34071686709037, 10.669942932698781, 19.116051858673934, 10.254041351533843, 11.994162078910282, 14.226283684991369, 16.56347634327348), # 127 (16.021759775860883, 13.089609240978122, 16.08581074136841, 18.7572807171942, 18.51008872383862, 10.0494169255565, 10.295794445647289, 10.651565812888913, 19.086920481835772, 10.218396888881303, 11.954856443728904, 14.183483970885819, 16.521483522896165), # 128 (15.960682592010507, 13.022523438071834, 16.047364219809193, 18.702354440760086, 18.46329666881996, 10.03078225734065, 10.250714697763163, 10.633517267267269, 19.057626215670915, 10.182597106619781, 11.915390201442428, 14.140256918548745, 16.478546771622668), # 129 (15.89849272780806, 12.955159905814739, 16.008255732116123, 18.646608779188355, 18.415325240442385, 10.011949601982854, 10.205395774788713, 10.61571370346955, 19.028080318563003, 10.146566659648963, 11.87567605596932, 14.096519781341675, 16.434611560993947), # 130 (15.83512472485457, 12.887409954866628, 15.968414337903685, 18.589948361388856, 18.36612021594374, 9.992869272581904, 10.159755828074656, 10.59807152913147, 18.998194048895677, 10.110230202868534, 11.835626711228041, 14.052189812626125, 16.38962336255096), # 131 (15.770513124751067, 12.8191648958873, 15.927769096786342, 18.532277816271456, 18.315627372561877, 9.973491582236585, 10.113713008971706, 10.580507151888732, 18.967878665052577, 10.073512391178177, 11.795154871137056, 14.007184265763614, 16.343527647834676), # 132 (15.704592469098595, 12.750316039536544, 15.88624906837857, 18.473501772746012, 18.263792487534637, 9.95376684404568, 10.06718546883058, 10.562936979377039, 18.93704542541735, 10.036337879477578, 11.754173239614829, 13.961420394115667, 16.296269888386057), # 133 (15.63729729949817, 12.68075469647416, 15.843783312294848, 18.413524859722386, 18.210561338099865, 9.933645371107978, 10.020091359002002, 10.545277419232098, 18.905605588373632, 9.998631322666423, 11.712594520579822, 13.914815451043799, 16.24779555574605), # 134 (15.568562157550836, 12.610372177359944, 15.800300888149636, 18.352251706110444, 18.15587970149542, 9.913077476522266, 9.972348830836681, 10.527444879089616, 18.873470412305064, 9.960317375644397, 11.670331417950496, 13.867286689909534, 16.198050121455637), # 135 (15.498321584857623, 12.539059792853687, 15.755730855557415, 18.28958694082003, 18.09969335495913, 9.892013473387332, 9.923876035685343, 10.509355766585298, 18.840551155595293, 9.92132069331118, 11.627296635645319, 13.818751364074394, 16.146979057055766), # 136 (15.426510123019561, 12.466708853615184, 15.710002274132659, 18.225435192761026, 18.04194807572886, 9.870403674801956, 9.8745911248987, 10.490926489354854, 18.80675907662796, 9.881565930566463, 11.583402877582751, 13.769126726899895, 16.094527834087398), # 137 (15.353062313637686, 12.393210670304235, 15.66304420348983, 18.159701090843274, 17.982589641042455, 9.848198393864935, 9.824412249827468, 10.472073455033982, 18.772005433786706, 9.840977742309924, 11.538562847681254, 13.718330031747561, 16.040641924091503), # 138 (15.277912698313022, 12.31845655358063, 15.614785703243411, 18.092289263976646, 17.921563828137746, 9.825347943675048, 9.773257561822367, 10.452713071258394, 18.73620148545517, 9.799480783441254, 11.492689249859293, 13.66627853197891, 15.985266798609034), # 139 (15.200995818646616, 12.242337814104165, 15.565155833007877, 18.023104341071, 17.858816414252605, 9.801802637331082, 9.721045212234115, 10.432761745663793, 18.699258490016998, 9.756999708860134, 11.445694788035329, 13.612889480955465, 15.928347929180966), # 140 (15.122246216239494, 12.164745762534638, 15.514083652397689, 17.952050951036195, 17.794293176624855, 9.777512787931828, 9.667693352413432, 10.412135885885887, 18.661087705855824, 9.713459173466253, 11.39749216612783, 13.558080132038745, 15.869830787348244), # 141 (15.041598432692682, 12.08557170953184, 15.461498221027327, 17.879033722782097, 17.727939892492355, 9.752428708576069, 9.613120133711027, 10.39075189956038, 18.621600391355297, 9.66878383215929, 11.347994088055255, 13.50176773859027, 15.80966084465184), # 142 (14.958987009607215, 12.004706965755565, 15.407328598511267, 17.803957285218555, 17.659702339092952, 9.726500712362592, 9.557243707477623, 10.368526194322978, 18.580707804899063, 9.622898339838935, 11.297113257736068, 13.443869553971561, 15.747783572632711), # 143 (14.874346488584132, 11.922042841865615, 15.35150384446397, 17.72672626725544, 17.58952629366449, 9.699679112390184, 9.499982225063938, 10.34537517780939, 18.53832120487076, 9.575727351404868, 11.244762379088732, 13.384302831544138, 15.684144442831826), # 144 (14.787611411224459, 11.837470648521778, 15.29395301849992, 17.64724529780261, 17.51735753344482, 9.671914221757634, 9.441253837820689, 10.321215257655316, 18.494351849654016, 9.527195521756779, 11.190854156031712, 13.322984824669524, 15.618688926790139), # 145 (14.69871631912923, 11.750881696383855, 15.23460518023359, 17.565419005769925, 17.443141835671785, 9.643156353563725, 9.380976697098594, 10.295962841496468, 18.448710997632492, 9.477227505794348, 11.135301292483467, 13.259832786709236, 15.551362496048613), # 146 (14.607595753899481, 11.662167296111635, 15.173389389279437, 17.481152020067245, 17.36682497758323, 9.613355820907245, 9.319068954248365, 10.269534336968547, 18.401309907189823, 9.425747958417263, 11.078016492362465, 13.194763971024798, 15.482110622148213), # 147 (14.51418425713624, 11.571218758364918, 15.11023470525195, 17.394348969604433, 17.28835273641701, 9.582462936886982, 9.255448760620729, 10.241846151707264, 18.352059836709653, 9.372681534525205, 11.018912459587169, 13.127695630977726, 15.410878776629895), # 148 (14.418416370440541, 11.477927393803494, 15.045070187765598, 17.304914483291345, 17.207670889410966, 9.550428014601719, 9.190034267566393, 10.21281469334832, 18.30087204457561, 9.317952889017864, 10.957901898076038, 13.058545019929545, 15.337612431034628), # 149 (14.320226635413416, 11.382184513087163, 14.97782489643485, 17.212753190037848, 17.124725213802947, 9.517201367150248, 9.122743626436081, 10.182356369527422, 18.247657789171353, 9.261486676794918, 10.894897511747537, 12.987229391241772, 15.262257056903364), # 150 (14.219549593655895, 11.283881426875716, 14.908427890874176, 17.117769718753795, 17.0394614868308, 9.48273330763135, 9.05349498858051, 10.150387587880278, 18.19232832888052, 9.20320755275606, 10.829812004520129, 12.91366599827593, 15.184758125777073), # 151 (14.116319786769019, 11.182909445828951, 14.836808230698063, 17.019868698349054, 16.951825485732364, 9.446974149143815, 8.982206505350396, 10.116824756042595, 18.134794922086748, 9.143040171800969, 10.762558080312278, 12.837772094393538, 15.105061109196717), # 152 (14.010471756353809, 11.079159880606662, 14.762894975520963, 16.91895475773348, 16.8617629877455, 9.409874204786428, 8.908796328096455, 10.081584281650072, 18.07496882717368, 9.080909188829333, 10.693048443042448, 12.759464932956115, 15.02311147870325), # 153 (13.901940044011312, 10.972524041868644, 14.686617184957365, 16.81493252581694, 16.769219770108045, 9.371383787657978, 8.83318260816941, 10.044582572338422, 18.01276130252496, 9.016739258740834, 10.6211957966291, 12.678661767325185, 14.938854705837642), # 154 (13.790659191342543, 10.86289324027469, 14.607903918621735, 16.707706631509282, 16.674141610057855, 9.331453210857248, 8.75528349691997, 10.005736035743345, 17.948083606524232, 8.950455036435159, 10.5469128449907, 12.595279850862267, 14.852236262140847), # 155 (13.676563739948545, 10.750158786484597, 14.526684236128547, 16.597181703720377, 16.576474284832766, 9.29003278748303, 8.67501714569886, 9.964961079500554, 17.88084699755513, 8.88198117681199, 10.470112292045709, 12.50923643692888, 14.763201619153833), # 156 (13.559588231430352, 10.634211991158162, 14.442887197092272, 16.483262371360087, 16.476163571670632, 9.247072830634105, 8.592301705856794, 9.922174111245749, 17.8109627340013, 8.811242334771014, 10.39070684171259, 12.420448778886547, 14.671696248417557), # 157 (13.43642570352943, 10.512815617390064, 14.352465517024239, 16.36158524697224, 16.368625990567796, 9.199844057370798, 8.505192097670143, 9.87443451422887, 17.732991764878374, 8.73605864932406, 10.306072354570096, 12.32567921554981, 14.573674546947622), # 158 (13.288116180561124, 10.37351757527906, 14.232128073125379, 16.207158885819215, 16.22734435760693, 9.132641366412786, 8.40278297409429, 9.804984358975888, 17.61556907019986, 8.644105789377742, 10.20135048411419, 12.206452542629595, 14.445769764456351), # 159 (13.112769770827757, 10.215174111373285, 14.0794577243206, 16.017439518735948, 16.04955623642423, 9.043814332885832, 8.284038747090811, 9.712078541149223, 17.455365409011574, 8.534170173353209, 10.075067115497172, 12.060903507998123, 14.285557096008445), # 160 (12.911799698254727, 10.038817562544844, 13.896084549438555, 15.79423050676211, 15.837107623707803, 8.934439034826566, 8.149826602812377, 9.596880959597605, 17.254493580598233, 8.407184747707687, 9.928334978279473, 11.890381444033627, 14.094673280674375), # 161 (12.686619186767443, 9.84548026566583, 13.683638627307893, 15.539335210937388, 15.591844516145768, 8.80559155027162, 8.001013727411657, 9.460555513169764, 17.015066384244545, 8.264082458898416, 9.762266802021516, 11.696235683114327, 13.874755057524599), # 162 (12.438641460291295, 9.636194557608343, 13.443750036757264, 15.254556992301481, 15.315612910426239, 8.65834795725763, 7.838467307041322, 9.304266100714425, 16.73919661923523, 8.105796253382625, 9.577975316283736, 11.479815557618458, 13.627439165629584), # 163 (12.16927974275169, 9.411992775244478, 13.178048856615318, 14.941699211894072, 15.01025880323734, 8.493784333821234, 7.663054527854039, 9.129176621080324, 16.428997084855002, 7.933259077617543, 9.376573250626553, 11.242470399924246, 13.35436234405979), # 164 (11.879947258074031, 9.173907255446338, 12.888165165710705, 14.602565230754854, 14.677628191267182, 8.312976757999055, 7.475642576002479, 8.936450973116184, 16.086580580388564, 7.747403878060404, 9.1591733346104, 10.985549542409915, 13.057161331885686), # 165 (11.572057230183715, 8.922970335086019, 12.57572904287207, 14.238958409923503, 14.319567071203886, 8.117001307827735, 7.277098637639315, 8.727253055670738, 15.714059905120632, 7.549163601168441, 8.926888297795703, 10.710402317453703, 12.737472868177733), # 166 (11.24702288300614, 8.660214351035616, 12.242370566928068, 13.852682110439718, 13.937921439735565, 7.906934061343905, 7.0682898989172145, 8.502746767592717, 15.31354785833592, 7.339471193398886, 8.680830869742888, 10.418378057433825, 12.396933692006392), # 167 (10.906257440466712, 8.386671640167231, 11.889719816707347, 13.445539693343184, 13.534537293550335, 7.683851096584198, 6.850083545988848, 8.264096007730847, 14.887157239319139, 7.11925960120897, 8.422113780012385, 10.11082609472852, 12.037180542442131), # 168 (10.551174126490828, 8.103374539352963, 11.519406871038555, 13.019334519673588, 13.111260629336316, 7.4488284915852505, 6.623346765006885, 8.012464674933861, 14.437000847355009, 6.889461771055926, 8.151849758164623, 9.78909576171601, 11.659850158555415), # 169 (10.18318616500389, 7.811355385464907, 11.133061808750343, 12.575869950470615, 12.66993744378162, 7.2029423243836925, 6.388946742123995, 7.749016668050485, 13.96519148172823, 6.6510106493969845, 7.871151533760029, 9.454536390774527, 11.2665792794167), # 170 (9.8037067799313, 7.511646515375161, 10.73231470867136, 12.116949346773964, 12.21241373357437, 6.947268673016157, 6.147750663492849, 7.47491588592945, 13.47384194172352, 6.404839182689379, 7.581131836359027, 9.108497314282296, 10.859004644096458), # 171 (9.414149195198457, 7.205280265955825, 10.318795649630257, 11.644376069623315, 11.740535495402677, 6.682883615519281, 5.900625715266118, 7.191326227419487, 12.965065026625595, 6.151880317390344, 7.282903395522049, 8.752327864617548, 10.438762991665145), # 172 (9.015926634730764, 6.893288974078996, 9.894134710455681, 11.159953480058356, 11.256148725954663, 6.410863229929695, 5.64843908359647, 6.899411591369322, 12.440973535719161, 5.893066999957107, 6.97757894080952, 8.387377374158506, 10.007491061193234), # 173 (8.610452322453618, 6.576704976616772, 9.459961969976282, 10.665484939118773, 10.76109942191844, 6.132283594284034, 5.3920579546365754, 6.600335876627689, 11.903680268288936, 5.629332176846904, 6.66627120178187, 8.014995175283403, 9.566825591751181), # 174 (8.19913948229242, 6.256560610441251, 9.017907507020714, 10.162773807844262, 10.257233579982124, 5.848220786618931, 5.132349514539104, 6.295262982043313, 11.35529802361963, 5.361608794516964, 6.3500929079995245, 7.636530600370466, 9.118403322409455), # 175 (7.783401338172574, 5.933888212424531, 8.569601400417621, 9.653623447274505, 9.746397196833835, 5.55975088497102, 4.870180949456727, 5.985356806464928, 10.797939600995955, 5.090829799424521, 6.0301567890229135, 7.253332981797922, 8.663860992238513), # 176 (7.364651114019479, 5.6097201194387125, 8.116673728995655, 9.13983721844919, 9.230436269161691, 5.267949967376934, 4.606419445542112, 5.671781248741259, 10.233717799702626, 4.817928138026804, 5.7075755744124645, 6.866751651944002, 8.204835340308824), # 177 (6.944302033758534, 5.285088668355891, 7.660754571583465, 8.623218482408008, 8.711196793653805, 4.973894111873309, 4.341932188947932, 5.355700207721038, 9.664745419024355, 4.54383675678105, 5.383461993728603, 6.478135943186929, 7.742963105690853), # 178 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179 ) passenger_arriving_acc = ( (9, 4, 8, 11, 5, 1, 5, 5, 2, 3, 3, 0, 0, 7, 4, 8, 4, 6, 2, 8, 4, 2, 2, 1, 1, 0), # 0 (15, 13, 17, 17, 10, 2, 8, 10, 5, 4, 6, 0, 0, 16, 11, 12, 8, 13, 6, 11, 9, 7, 4, 3, 1, 0), # 1 (26, 26, 22, 27, 19, 4, 13, 12, 8, 5, 10, 1, 0, 30, 18, 19, 14, 28, 10, 14, 15, 10, 5, 5, 2, 0), # 2 (40, 43, 31, 37, 27, 6, 17, 21, 10, 6, 12, 2, 0, 33, 26, 25, 20, 40, 13, 17, 17, 14, 7, 7, 4, 0), # 3 (58, 51, 40, 46, 36, 10, 26, 27, 15, 12, 12, 2, 0, 39, 39, 33, 23, 47, 22, 20, 21, 17, 7, 10, 6, 0), # 4 (78, 60, 51, 56, 47, 15, 30, 36, 17, 15, 13, 3, 0, 55, 46, 44, 28, 56, 32, 24, 25, 22, 11, 11, 8, 0), # 5 (89, 74, 64, 65, 55, 19, 33, 39, 19, 15, 14, 4, 0, 68, 56, 59, 34, 66, 41, 30, 30, 28, 14, 12, 8, 0), # 6 (110, 90, 82, 78, 66, 23, 35, 43, 27, 16, 16, 5, 0, 79, 66, 62, 44, 77, 54, 35, 34, 33, 15, 14, 10, 0), # 7 (123, 107, 97, 90, 71, 27, 46, 47, 33, 18, 20, 6, 0, 90, 78, 73, 51, 89, 65, 43, 36, 36, 20, 15, 11, 0), # 8 (136, 121, 112, 102, 84, 34, 55, 56, 42, 20, 22, 7, 0, 103, 92, 77, 59, 99, 75, 51, 39, 41, 27, 17, 11, 0), # 9 (151, 135, 126, 112, 91, 41, 62, 63, 47, 20, 23, 8, 0, 111, 102, 89, 71, 109, 82, 54, 41, 44, 29, 23, 12, 0), # 10 (169, 144, 139, 124, 101, 43, 72, 66, 57, 24, 26, 11, 0, 125, 118, 99, 81, 122, 99, 61, 45, 52, 34, 33, 13, 0), # 11 (185, 166, 152, 140, 112, 48, 80, 73, 61, 28, 28, 14, 0, 133, 135, 109, 89, 134, 104, 65, 46, 60, 37, 34, 15, 0), # 12 (202, 189, 161, 159, 127, 51, 92, 80, 68, 29, 31, 16, 0, 148, 145, 114, 102, 149, 111, 71, 51, 64, 46, 41, 18, 0), # 13 (217, 218, 175, 169, 135, 56, 96, 89, 75, 32, 32, 17, 0, 164, 159, 125, 114, 160, 118, 78, 54, 71, 50, 43, 19, 0), # 14 (241, 236, 182, 186, 150, 59, 106, 98, 83, 33, 35, 20, 0, 188, 174, 135, 127, 169, 127, 86, 56, 78, 52, 47, 21, 0), # 15 (267, 254, 194, 203, 161, 67, 110, 104, 94, 33, 38, 20, 0, 211, 186, 148, 132, 178, 136, 97, 57, 88, 54, 47, 21, 0), # 16 (277, 270, 208, 226, 173, 70, 121, 117, 103, 38, 40, 21, 0, 232, 204, 164, 142, 186, 145, 107, 62, 93, 56, 51, 22, 0), # 17 (297, 284, 222, 239, 187, 73, 126, 131, 112, 39, 41, 21, 0, 249, 215, 184, 148, 198, 158, 114, 64, 101, 60, 54, 22, 0), # 18 (318, 308, 238, 254, 195, 77, 133, 140, 122, 44, 41, 21, 0, 262, 233, 196, 156, 220, 166, 118, 71, 106, 66, 57, 24, 0), # 19 (340, 329, 254, 261, 205, 87, 142, 151, 129, 47, 43, 23, 0, 274, 250, 216, 168, 231, 174, 126, 76, 114, 75, 61, 24, 0), # 20 (354, 346, 273, 278, 221, 93, 149, 156, 134, 51, 46, 25, 0, 287, 271, 225, 184, 248, 179, 130, 80, 120, 79, 65, 26, 0), # 21 (374, 358, 288, 294, 235, 101, 153, 167, 139, 51, 49, 25, 0, 308, 284, 237, 195, 265, 189, 138, 83, 127, 83, 71, 28, 0), # 22 (392, 375, 301, 313, 246, 110, 161, 175, 147, 53, 52, 26, 0, 322, 310, 248, 204, 284, 202, 150, 91, 134, 90, 75, 30, 0), # 23 (400, 394, 318, 324, 262, 116, 166, 184, 155, 57, 52, 26, 0, 343, 327, 262, 215, 294, 216, 160, 96, 139, 95, 79, 30, 0), # 24 (417, 419, 332, 335, 271, 119, 177, 190, 158, 58, 55, 26, 0, 361, 347, 274, 223, 310, 226, 164, 108, 147, 96, 82, 31, 0), # 25 (434, 435, 349, 347, 287, 126, 186, 198, 168, 62, 56, 28, 0, 382, 368, 280, 239, 317, 239, 171, 113, 154, 103, 84, 33, 0), # 26 (453, 448, 360, 363, 299, 132, 196, 205, 175, 65, 57, 30, 0, 397, 388, 289, 252, 328, 244, 179, 115, 159, 113, 85, 38, 0), # 27 (471, 467, 369, 379, 315, 138, 200, 208, 180, 68, 58, 33, 0, 415, 405, 305, 259, 343, 253, 188, 120, 167, 116, 88, 40, 0), # 28 (491, 482, 383, 391, 332, 144, 208, 212, 184, 72, 61, 34, 0, 428, 428, 319, 268, 366, 258, 199, 128, 173, 120, 93, 42, 0), # 29 (507, 499, 405, 405, 352, 150, 211, 220, 188, 75, 64, 36, 0, 442, 449, 340, 278, 373, 268, 206, 132, 180, 129, 96, 42, 0), # 30 (528, 514, 424, 414, 361, 162, 222, 228, 195, 78, 68, 36, 0, 457, 471, 357, 283, 387, 274, 216, 137, 183, 136, 100, 42, 0), # 31 (543, 530, 435, 431, 369, 171, 227, 237, 201, 79, 70, 37, 0, 478, 485, 369, 291, 407, 280, 228, 144, 188, 141, 102, 44, 0), # 32 (558, 546, 444, 443, 380, 181, 233, 239, 207, 84, 72, 40, 0, 498, 498, 382, 300, 422, 286, 236, 147, 193, 144, 109, 45, 0), # 33 (575, 563, 453, 463, 398, 186, 238, 245, 214, 85, 75, 43, 0, 515, 512, 392, 316, 441, 293, 241, 153, 200, 150, 114, 45, 0), # 34 (598, 577, 471, 480, 412, 190, 247, 253, 224, 91, 78, 44, 0, 532, 535, 398, 329, 458, 304, 254, 158, 208, 155, 117, 46, 0), # 35 (620, 593, 489, 496, 421, 199, 255, 262, 232, 94, 82, 45, 0, 545, 550, 415, 341, 474, 316, 260, 160, 215, 164, 122, 47, 0), # 36 (639, 610, 504, 512, 430, 203, 260, 269, 242, 97, 87, 46, 0, 572, 564, 427, 348, 487, 321, 266, 164, 223, 169, 124, 48, 0), # 37 (661, 634, 520, 529, 442, 214, 261, 274, 250, 103, 90, 49, 0, 597, 574, 435, 362, 504, 329, 269, 166, 233, 175, 129, 54, 0), # 38 (686, 648, 533, 553, 459, 226, 269, 281, 261, 106, 93, 50, 0, 616, 591, 454, 368, 522, 335, 277, 167, 240, 181, 132, 54, 0), # 39 (703, 671, 547, 569, 469, 232, 273, 290, 267, 107, 96, 52, 0, 638, 602, 468, 380, 532, 344, 284, 170, 251, 191, 132, 55, 0), # 40 (721, 693, 563, 580, 482, 236, 278, 297, 274, 115, 98, 53, 0, 650, 621, 481, 390, 544, 351, 294, 179, 261, 196, 134, 56, 0), # 41 (740, 711, 579, 598, 494, 244, 288, 305, 281, 116, 102, 54, 0, 663, 646, 495, 397, 560, 366, 299, 182, 266, 202, 139, 59, 0), # 42 (759, 724, 597, 610, 509, 248, 294, 313, 291, 119, 107, 55, 0, 680, 661, 503, 410, 579, 374, 303, 185, 273, 203, 142, 60, 0), # 43 (780, 737, 607, 632, 524, 255, 302, 317, 302, 121, 107, 56, 0, 695, 679, 514, 422, 592, 378, 311, 190, 277, 208, 144, 62, 0), # 44 (804, 757, 626, 647, 542, 261, 308, 323, 314, 124, 110, 59, 0, 711, 692, 532, 437, 611, 388, 318, 191, 286, 216, 147, 64, 0), # 45 (826, 767, 644, 666, 562, 261, 316, 334, 320, 124, 114, 61, 0, 731, 709, 539, 449, 622, 398, 323, 195, 289, 220, 149, 67, 0), # 46 (845, 780, 666, 682, 579, 264, 321, 339, 325, 126, 117, 63, 0, 746, 725, 555, 454, 635, 412, 335, 198, 300, 226, 156, 68, 0), # 47 (865, 801, 678, 695, 594, 272, 329, 345, 331, 130, 120, 63, 0, 768, 740, 570, 462, 648, 420, 349, 200, 311, 233, 161, 68, 0), # 48 (892, 817, 696, 708, 608, 278, 332, 355, 339, 131, 121, 66, 0, 785, 751, 583, 470, 657, 429, 359, 207, 315, 239, 164, 69, 0), # 49 (910, 841, 710, 725, 626, 282, 338, 362, 343, 134, 122, 66, 0, 801, 766, 598, 476, 682, 438, 367, 213, 318, 245, 168, 70, 0), # 50 (921, 861, 727, 751, 640, 288, 343, 365, 355, 138, 122, 68, 0, 815, 784, 607, 487, 698, 449, 370, 218, 330, 247, 169, 72, 0), # 51 (940, 878, 741, 769, 652, 295, 347, 373, 363, 140, 126, 70, 0, 838, 800, 620, 498, 710, 454, 378, 224, 335, 253, 170, 74, 0), # 52 (954, 891, 761, 784, 666, 307, 358, 376, 371, 143, 129, 75, 0, 847, 809, 635, 514, 718, 467, 386, 228, 340, 259, 172, 75, 0), # 53 (981, 911, 778, 801, 680, 313, 366, 383, 379, 145, 130, 75, 0, 866, 828, 648, 523, 728, 471, 395, 231, 344, 263, 175, 77, 0), # 54 (1004, 936, 792, 812, 701, 320, 370, 389, 390, 149, 130, 75, 0, 888, 844, 655, 529, 744, 481, 404, 234, 352, 273, 178, 79, 0), # 55 (1020, 953, 809, 827, 714, 326, 377, 394, 396, 150, 133, 76, 0, 904, 860, 670, 531, 756, 493, 413, 240, 358, 278, 178, 82, 0), # 56 (1037, 969, 825, 845, 732, 332, 381, 396, 401, 151, 136, 77, 0, 921, 876, 682, 540, 770, 509, 420, 244, 366, 290, 180, 83, 0), # 57 (1056, 985, 838, 857, 740, 338, 390, 403, 405, 153, 140, 81, 0, 939, 883, 692, 554, 794, 520, 425, 250, 372, 294, 182, 85, 0), # 58 (1076, 1003, 855, 873, 753, 346, 397, 412, 408, 155, 142, 81, 0, 952, 892, 706, 565, 812, 529, 434, 254, 381, 297, 184, 85, 0), # 59 (1095, 1024, 879, 889, 770, 356, 403, 414, 418, 157, 144, 85, 0, 970, 905, 720, 572, 824, 536, 435, 258, 385, 302, 186, 88, 0), # 60 (1123, 1047, 894, 905, 785, 365, 410, 420, 428, 158, 144, 86, 0, 988, 922, 736, 583, 840, 546, 443, 264, 389, 310, 187, 89, 0), # 61 (1143, 1062, 903, 924, 794, 381, 419, 425, 438, 162, 144, 86, 0, 1008, 938, 748, 593, 860, 553, 447, 268, 393, 316, 193, 91, 0), # 62 (1153, 1075, 916, 947, 804, 389, 425, 430, 446, 163, 147, 86, 0, 1024, 950, 766, 603, 873, 558, 452, 273, 398, 321, 194, 92, 0), # 63 (1162, 1090, 934, 968, 820, 392, 437, 436, 451, 169, 149, 86, 0, 1048, 963, 781, 619, 889, 563, 458, 279, 406, 324, 198, 94, 0), # 64 (1181, 1105, 946, 980, 834, 400, 448, 442, 458, 175, 150, 87, 0, 1063, 978, 790, 627, 899, 570, 464, 281, 417, 326, 205, 94, 0), # 65 (1202, 1121, 964, 994, 847, 404, 460, 445, 462, 181, 151, 88, 0, 1078, 998, 802, 633, 914, 578, 468, 284, 420, 331, 211, 94, 0), # 66 (1217, 1136, 980, 1008, 859, 406, 470, 450, 466, 184, 157, 92, 0, 1098, 1018, 819, 641, 928, 584, 477, 291, 429, 336, 214, 95, 0), # 67 (1245, 1160, 994, 1025, 876, 415, 472, 455, 469, 187, 162, 93, 0, 1109, 1036, 837, 647, 939, 595, 483, 298, 435, 339, 216, 95, 0), # 68 (1252, 1178, 1005, 1037, 886, 416, 476, 460, 477, 189, 165, 95, 0, 1123, 1051, 846, 661, 959, 600, 492, 303, 440, 343, 219, 101, 0), # 69 (1268, 1191, 1019, 1068, 901, 421, 480, 467, 482, 189, 170, 95, 0, 1141, 1068, 855, 675, 969, 603, 495, 307, 444, 354, 224, 101, 0), # 70 (1284, 1203, 1032, 1079, 910, 424, 483, 475, 488, 192, 173, 98, 0, 1165, 1092, 871, 679, 986, 610, 503, 307, 451, 360, 228, 101, 0), # 71 (1315, 1217, 1048, 1090, 927, 430, 490, 478, 492, 193, 174, 101, 0, 1182, 1107, 886, 693, 1003, 613, 509, 313, 458, 366, 232, 104, 0), # 72 (1328, 1233, 1059, 1104, 941, 434, 499, 482, 499, 198, 175, 102, 0, 1196, 1114, 903, 705, 1017, 617, 514, 324, 464, 370, 237, 106, 0), # 73 (1351, 1249, 1072, 1116, 963, 442, 509, 486, 505, 200, 177, 102, 0, 1217, 1127, 924, 712, 1030, 627, 518, 328, 473, 379, 241, 108, 0), # 74 (1372, 1269, 1084, 1141, 980, 446, 516, 492, 511, 201, 178, 102, 0, 1232, 1153, 941, 722, 1049, 635, 523, 333, 475, 383, 243, 108, 0), # 75 (1388, 1282, 1107, 1156, 990, 450, 521, 501, 519, 202, 181, 103, 0, 1244, 1170, 952, 727, 1055, 641, 526, 339, 485, 387, 245, 109, 0), # 76 (1400, 1292, 1124, 1172, 999, 455, 528, 509, 527, 205, 183, 104, 0, 1254, 1183, 968, 734, 1071, 644, 531, 342, 489, 391, 249, 110, 0), # 77 (1420, 1306, 1141, 1191, 1017, 464, 534, 512, 536, 207, 186, 106, 0, 1273, 1201, 982, 745, 1095, 652, 538, 348, 496, 396, 253, 111, 0), # 78 (1444, 1319, 1153, 1205, 1026, 470, 542, 516, 541, 211, 189, 107, 0, 1293, 1213, 990, 752, 1115, 656, 545, 355, 500, 398, 256, 114, 0), # 79 (1471, 1333, 1167, 1218, 1037, 474, 549, 520, 548, 215, 191, 107, 0, 1305, 1226, 1001, 757, 1131, 662, 555, 361, 508, 404, 259, 116, 0), # 80 (1490, 1347, 1183, 1235, 1054, 482, 552, 528, 556, 216, 195, 109, 0, 1334, 1242, 1018, 772, 1147, 674, 558, 366, 518, 405, 268, 116, 0), # 81 (1510, 1362, 1195, 1256, 1069, 486, 562, 535, 567, 220, 196, 111, 0, 1350, 1258, 1025, 776, 1160, 681, 563, 371, 524, 408, 273, 119, 0), # 82 (1522, 1374, 1205, 1266, 1075, 497, 566, 542, 577, 223, 198, 111, 0, 1361, 1272, 1035, 785, 1178, 688, 569, 372, 529, 412, 275, 119, 0), # 83 (1543, 1389, 1219, 1280, 1082, 504, 570, 547, 584, 224, 201, 112, 0, 1381, 1284, 1044, 795, 1195, 695, 576, 377, 537, 420, 279, 120, 0), # 84 (1559, 1399, 1237, 1298, 1091, 506, 575, 554, 590, 226, 202, 114, 0, 1395, 1294, 1054, 804, 1211, 699, 581, 379, 544, 425, 280, 121, 0), # 85 (1576, 1416, 1261, 1316, 1108, 512, 580, 560, 596, 228, 204, 114, 0, 1410, 1314, 1064, 808, 1225, 706, 586, 385, 552, 430, 284, 123, 0), # 86 (1596, 1429, 1280, 1334, 1121, 517, 585, 563, 604, 231, 206, 114, 0, 1427, 1333, 1074, 814, 1235, 713, 592, 392, 557, 432, 286, 125, 0), # 87 (1608, 1443, 1299, 1347, 1137, 524, 593, 564, 613, 235, 206, 115, 0, 1446, 1344, 1085, 818, 1248, 722, 595, 396, 559, 436, 287, 126, 0), # 88 (1630, 1453, 1318, 1372, 1153, 527, 600, 570, 623, 238, 206, 115, 0, 1467, 1362, 1095, 829, 1265, 727, 599, 398, 570, 441, 290, 128, 0), # 89 (1656, 1465, 1332, 1387, 1167, 530, 606, 577, 635, 242, 207, 115, 0, 1485, 1381, 1106, 836, 1279, 734, 602, 401, 579, 445, 294, 131, 0), # 90 (1673, 1480, 1346, 1409, 1182, 535, 609, 582, 647, 243, 209, 115, 0, 1502, 1392, 1115, 844, 1297, 739, 608, 405, 584, 449, 297, 132, 0), # 91 (1693, 1496, 1352, 1427, 1188, 546, 614, 587, 654, 248, 213, 115, 0, 1523, 1408, 1124, 848, 1308, 746, 613, 407, 593, 458, 298, 135, 0), # 92 (1709, 1511, 1377, 1447, 1197, 552, 626, 587, 661, 252, 213, 116, 0, 1542, 1419, 1132, 863, 1314, 752, 622, 413, 600, 463, 301, 137, 0), # 93 (1734, 1523, 1393, 1462, 1223, 557, 631, 590, 672, 255, 217, 117, 0, 1565, 1429, 1143, 871, 1322, 766, 628, 416, 606, 468, 304, 141, 0), # 94 (1753, 1538, 1405, 1480, 1238, 561, 636, 596, 680, 257, 218, 119, 0, 1585, 1438, 1148, 880, 1331, 775, 633, 419, 611, 471, 311, 141, 0), # 95 (1766, 1548, 1415, 1492, 1253, 568, 638, 604, 684, 258, 224, 121, 0, 1596, 1448, 1158, 888, 1343, 783, 636, 421, 619, 476, 314, 144, 0), # 96 (1790, 1560, 1428, 1509, 1264, 572, 649, 610, 692, 263, 224, 123, 0, 1610, 1460, 1165, 896, 1359, 787, 644, 423, 630, 484, 315, 145, 0), # 97 (1807, 1573, 1443, 1529, 1284, 580, 653, 611, 700, 265, 226, 127, 0, 1628, 1478, 1177, 901, 1378, 794, 649, 428, 637, 489, 320, 145, 0), # 98 (1821, 1586, 1455, 1544, 1297, 594, 657, 614, 705, 267, 228, 128, 0, 1646, 1491, 1188, 907, 1391, 795, 658, 434, 644, 491, 326, 148, 0), # 99 (1841, 1593, 1469, 1557, 1311, 607, 663, 617, 712, 271, 232, 128, 0, 1661, 1509, 1198, 911, 1405, 802, 665, 445, 648, 495, 326, 150, 0), # 100 (1858, 1608, 1486, 1571, 1318, 610, 669, 622, 722, 271, 235, 129, 0, 1674, 1521, 1211, 922, 1423, 808, 672, 448, 653, 499, 327, 151, 0), # 101 (1878, 1626, 1496, 1586, 1332, 617, 675, 625, 723, 272, 236, 130, 0, 1693, 1537, 1222, 936, 1439, 820, 678, 455, 659, 504, 329, 153, 0), # 102 (1891, 1637, 1516, 1598, 1346, 622, 678, 633, 727, 276, 238, 130, 0, 1706, 1555, 1233, 949, 1451, 827, 682, 460, 669, 507, 333, 155, 0), # 103 (1904, 1650, 1527, 1615, 1355, 629, 683, 636, 732, 280, 238, 131, 0, 1722, 1568, 1244, 957, 1463, 836, 686, 465, 675, 511, 336, 155, 0), # 104 (1917, 1664, 1536, 1633, 1366, 630, 689, 644, 739, 281, 239, 133, 0, 1739, 1581, 1248, 963, 1477, 840, 694, 469, 686, 520, 338, 155, 0), # 105 (1928, 1682, 1544, 1649, 1376, 636, 693, 649, 741, 284, 239, 135, 0, 1757, 1592, 1255, 969, 1491, 847, 701, 473, 697, 528, 340, 157, 0), # 106 (1937, 1693, 1560, 1661, 1387, 645, 698, 652, 744, 288, 240, 135, 0, 1776, 1604, 1269, 975, 1499, 854, 709, 480, 702, 530, 343, 158, 0), # 107 (1949, 1707, 1578, 1678, 1405, 650, 706, 655, 753, 289, 242, 138, 0, 1803, 1619, 1280, 982, 1509, 861, 710, 485, 710, 538, 350, 159, 0), # 108 (1969, 1727, 1599, 1697, 1421, 655, 711, 663, 766, 294, 245, 140, 0, 1823, 1634, 1293, 988, 1530, 866, 716, 486, 715, 541, 352, 159, 0), # 109 (1990, 1746, 1615, 1704, 1433, 661, 715, 668, 779, 297, 248, 140, 0, 1837, 1643, 1301, 998, 1543, 869, 722, 489, 720, 546, 357, 161, 0), # 110 (2004, 1760, 1630, 1723, 1447, 664, 720, 672, 786, 302, 252, 142, 0, 1854, 1659, 1314, 1004, 1555, 875, 728, 494, 722, 551, 360, 162, 0), # 111 (2019, 1773, 1640, 1734, 1456, 670, 723, 678, 794, 304, 253, 144, 0, 1867, 1678, 1328, 1008, 1564, 877, 733, 495, 727, 562, 362, 164, 0), # 112 (2040, 1788, 1657, 1752, 1462, 676, 725, 684, 802, 308, 256, 146, 0, 1879, 1691, 1340, 1019, 1576, 890, 740, 499, 737, 565, 366, 165, 0), # 113 (2055, 1800, 1667, 1763, 1478, 681, 733, 685, 808, 309, 259, 147, 0, 1894, 1706, 1351, 1032, 1592, 900, 747, 508, 740, 569, 370, 166, 0), # 114 (2072, 1819, 1678, 1774, 1494, 689, 738, 693, 812, 311, 262, 149, 0, 1910, 1724, 1367, 1036, 1604, 901, 751, 515, 747, 574, 372, 166, 0), # 115 (2091, 1831, 1686, 1786, 1508, 695, 744, 696, 817, 316, 265, 150, 0, 1929, 1735, 1377, 1043, 1618, 907, 760, 518, 757, 576, 374, 166, 0), # 116 (2111, 1844, 1698, 1804, 1523, 701, 753, 701, 824, 316, 267, 153, 0, 1955, 1756, 1389, 1048, 1628, 915, 763, 525, 765, 583, 378, 166, 0), # 117 (2126, 1854, 1708, 1821, 1536, 706, 760, 705, 827, 318, 267, 154, 0, 1964, 1770, 1399, 1052, 1640, 922, 769, 527, 772, 587, 380, 166, 0), # 118 (2143, 1868, 1719, 1837, 1546, 710, 763, 710, 838, 321, 267, 156, 0, 1978, 1785, 1403, 1062, 1649, 928, 775, 528, 778, 596, 381, 168, 0), # 119 (2160, 1872, 1736, 1856, 1556, 719, 768, 713, 848, 324, 268, 156, 0, 2003, 1798, 1412, 1071, 1661, 936, 778, 532, 782, 605, 385, 169, 0), # 120 (2179, 1885, 1748, 1868, 1576, 726, 771, 714, 854, 329, 270, 157, 0, 2013, 1813, 1425, 1078, 1674, 941, 784, 536, 785, 609, 385, 171, 0), # 121 (2195, 1898, 1760, 1884, 1588, 730, 774, 718, 862, 335, 272, 158, 0, 2023, 1823, 1432, 1082, 1689, 950, 787, 538, 790, 615, 387, 173, 0), # 122 (2214, 1907, 1770, 1897, 1600, 735, 776, 721, 868, 337, 276, 159, 0, 2033, 1836, 1439, 1090, 1711, 951, 790, 544, 793, 618, 389, 173, 0), # 123 (2235, 1925, 1785, 1911, 1615, 739, 780, 727, 874, 338, 278, 159, 0, 2045, 1847, 1449, 1099, 1731, 954, 792, 550, 804, 625, 391, 173, 0), # 124 (2245, 1943, 1798, 1928, 1631, 742, 786, 729, 885, 339, 279, 160, 0, 2059, 1862, 1459, 1109, 1752, 962, 800, 556, 811, 633, 395, 177, 0), # 125 (2258, 1951, 1809, 1938, 1640, 749, 789, 734, 894, 342, 283, 162, 0, 2071, 1872, 1467, 1121, 1761, 969, 806, 562, 817, 638, 397, 177, 0), # 126 (2274, 1958, 1818, 1955, 1652, 752, 799, 743, 899, 343, 284, 168, 0, 2081, 1889, 1476, 1129, 1774, 974, 815, 566, 821, 643, 402, 178, 0), # 127 (2294, 1967, 1830, 1968, 1664, 759, 804, 746, 904, 347, 288, 169, 0, 2100, 1906, 1489, 1134, 1785, 984, 817, 569, 832, 653, 403, 180, 0), # 128 (2305, 1985, 1845, 1982, 1677, 764, 812, 753, 909, 350, 289, 170, 0, 2117, 1926, 1498, 1143, 1800, 995, 824, 574, 835, 656, 408, 181, 0), # 129 (2324, 2003, 1858, 1994, 1688, 770, 817, 758, 917, 353, 291, 171, 0, 2133, 1939, 1505, 1152, 1811, 1006, 830, 581, 842, 657, 410, 183, 0), # 130 (2337, 2016, 1876, 2005, 1699, 776, 824, 762, 925, 356, 291, 171, 0, 2154, 1954, 1509, 1161, 1830, 1009, 833, 586, 845, 663, 411, 185, 0), # 131 (2350, 2023, 1884, 2021, 1714, 780, 829, 772, 935, 360, 293, 172, 0, 2161, 1967, 1523, 1166, 1836, 1013, 836, 589, 849, 668, 415, 187, 0), # 132 (2371, 2035, 1901, 2036, 1724, 785, 834, 778, 941, 362, 293, 175, 0, 2178, 1976, 1536, 1176, 1845, 1016, 841, 592, 853, 670, 415, 188, 0), # 133 (2388, 2051, 1912, 2055, 1735, 793, 837, 780, 950, 365, 296, 177, 0, 2188, 1988, 1544, 1179, 1856, 1022, 847, 594, 863, 676, 415, 188, 0), # 134 (2405, 2057, 1929, 2065, 1744, 799, 840, 787, 957, 367, 298, 177, 0, 2197, 2000, 1552, 1186, 1866, 1032, 849, 598, 868, 680, 416, 190, 0), # 135 (2427, 2063, 1936, 2087, 1758, 809, 843, 793, 958, 369, 301, 177, 0, 2213, 2005, 1560, 1191, 1874, 1042, 852, 603, 871, 691, 417, 190, 0), # 136 (2437, 2072, 1949, 2097, 1771, 814, 853, 800, 963, 371, 307, 179, 0, 2233, 2022, 1571, 1193, 1892, 1048, 859, 608, 875, 693, 419, 191, 0), # 137 (2449, 2081, 1963, 2120, 1785, 822, 860, 803, 970, 376, 308, 179, 0, 2248, 2035, 1581, 1200, 1899, 1051, 868, 612, 879, 693, 422, 193, 0), # 138 (2471, 2093, 1973, 2128, 1796, 829, 862, 803, 976, 377, 309, 179, 0, 2265, 2044, 1586, 1208, 1911, 1055, 871, 615, 886, 697, 426, 194, 0), # 139 (2490, 2104, 1983, 2138, 1804, 837, 866, 809, 981, 381, 310, 179, 0, 2283, 2059, 1592, 1214, 1919, 1057, 874, 617, 897, 701, 430, 195, 0), # 140 (2510, 2116, 1997, 2150, 1814, 842, 872, 811, 987, 382, 311, 181, 0, 2298, 2078, 1602, 1223, 1936, 1062, 879, 624, 901, 704, 431, 196, 0), # 141 (2521, 2129, 2010, 2159, 1824, 847, 878, 816, 994, 384, 313, 181, 0, 2316, 2092, 1609, 1232, 1952, 1071, 886, 627, 908, 706, 434, 197, 0), # 142 (2533, 2139, 2022, 2169, 1840, 851, 883, 819, 1003, 386, 316, 184, 0, 2333, 2105, 1621, 1242, 1967, 1074, 892, 636, 914, 714, 435, 197, 0), # 143 (2548, 2150, 2034, 2179, 1851, 855, 890, 826, 1008, 387, 317, 184, 0, 2351, 2118, 1629, 1245, 1988, 1077, 898, 644, 915, 719, 439, 199, 0), # 144 (2563, 2164, 2046, 2187, 1858, 857, 891, 834, 1013, 388, 321, 185, 0, 2365, 2133, 1637, 1249, 2001, 1086, 904, 652, 924, 722, 441, 199, 0), # 145 (2579, 2171, 2060, 2196, 1870, 867, 898, 834, 1016, 391, 322, 185, 0, 2387, 2140, 1641, 1257, 2015, 1091, 908, 657, 932, 729, 447, 201, 0), # 146 (2593, 2179, 2076, 2214, 1878, 871, 902, 836, 1024, 392, 324, 187, 0, 2402, 2152, 1649, 1267, 2024, 1095, 914, 662, 941, 736, 450, 201, 0), # 147 (2607, 2187, 2095, 2227, 1888, 879, 909, 842, 1031, 394, 328, 187, 0, 2419, 2159, 1658, 1275, 2038, 1103, 917, 667, 946, 739, 452, 203, 0), # 148 (2620, 2197, 2100, 2246, 1903, 887, 912, 847, 1041, 397, 331, 187, 0, 2429, 2172, 1665, 1283, 2051, 1108, 917, 671, 948, 741, 457, 204, 0), # 149 (2637, 2207, 2107, 2256, 1917, 893, 917, 854, 1046, 400, 335, 188, 0, 2442, 2184, 1670, 1292, 2063, 1115, 921, 676, 952, 743, 460, 204, 0), # 150 (2654, 2216, 2124, 2273, 1934, 905, 919, 858, 1051, 403, 337, 190, 0, 2458, 2201, 1677, 1299, 2081, 1116, 923, 680, 956, 747, 463, 205, 0), # 151 (2668, 2223, 2130, 2284, 1946, 909, 923, 865, 1058, 404, 337, 191, 0, 2471, 2214, 1685, 1305, 2097, 1124, 926, 682, 961, 753, 466, 206, 0), # 152 (2683, 2232, 2145, 2292, 1958, 911, 925, 868, 1064, 404, 340, 194, 0, 2488, 2231, 1691, 1310, 2108, 1134, 932, 687, 969, 756, 468, 206, 0), # 153 (2692, 2244, 2153, 2309, 1964, 915, 928, 872, 1066, 407, 340, 195, 0, 2501, 2246, 1697, 1319, 2121, 1138, 937, 689, 972, 761, 470, 206, 0), # 154 (2711, 2255, 2170, 2319, 1970, 922, 935, 877, 1072, 408, 343, 197, 0, 2511, 2262, 1705, 1329, 2136, 1140, 940, 690, 978, 763, 471, 207, 0), # 155 (2719, 2262, 2181, 2332, 1982, 926, 941, 879, 1081, 410, 343, 198, 0, 2523, 2279, 1710, 1335, 2144, 1145, 942, 695, 984, 767, 472, 209, 0), # 156 (2736, 2276, 2195, 2344, 1993, 930, 946, 879, 1089, 414, 347, 200, 0, 2538, 2292, 1718, 1345, 2159, 1148, 948, 696, 995, 773, 475, 209, 0), # 157 (2748, 2285, 2212, 2354, 2000, 933, 951, 882, 1096, 414, 350, 202, 0, 2554, 2301, 1725, 1354, 2167, 1152, 949, 703, 998, 776, 477, 209, 0), # 158 (2758, 2294, 2227, 2375, 2014, 940, 953, 888, 1100, 416, 351, 203, 0, 2565, 2320, 1735, 1363, 2186, 1155, 952, 704, 1006, 777, 480, 209, 0), # 159 (2768, 2306, 2238, 2386, 2027, 944, 958, 893, 1109, 419, 351, 203, 0, 2578, 2330, 1744, 1366, 2198, 1160, 955, 710, 1008, 783, 481, 210, 0), # 160 (2781, 2323, 2254, 2403, 2031, 949, 962, 899, 1115, 421, 352, 203, 0, 2589, 2341, 1749, 1376, 2213, 1167, 965, 712, 1011, 789, 487, 212, 0), # 161 (2791, 2330, 2265, 2409, 2039, 958, 966, 907, 1118, 422, 355, 208, 0, 2604, 2351, 1757, 1381, 2225, 1172, 969, 714, 1011, 790, 488, 212, 0), # 162 (2811, 2342, 2271, 2420, 2050, 964, 972, 917, 1130, 427, 359, 210, 0, 2625, 2358, 1767, 1391, 2233, 1176, 976, 718, 1015, 793, 491, 213, 0), # 163 (2824, 2348, 2280, 2427, 2065, 970, 974, 923, 1135, 430, 359, 211, 0, 2636, 2366, 1778, 1402, 2246, 1184, 978, 723, 1020, 794, 493, 213, 0), # 164 (2840, 2359, 2294, 2438, 2078, 972, 978, 925, 1140, 432, 360, 211, 0, 2645, 2377, 1782, 1412, 2259, 1187, 982, 727, 1024, 796, 496, 214, 0), # 165 (2858, 2368, 2306, 2445, 2093, 976, 983, 929, 1148, 432, 361, 212, 0, 2654, 2385, 1791, 1416, 2269, 1191, 983, 730, 1038, 802, 497, 214, 0), # 166 (2872, 2371, 2314, 2455, 2100, 982, 985, 932, 1152, 433, 361, 213, 0, 2669, 2388, 1799, 1429, 2276, 1194, 990, 736, 1046, 804, 498, 215, 0), # 167 (2886, 2379, 2321, 2467, 2107, 990, 986, 933, 1154, 433, 364, 216, 0, 2686, 2396, 1800, 1435, 2287, 1198, 992, 736, 1049, 804, 500, 215, 0), # 168 (2898, 2390, 2328, 2477, 2120, 992, 988, 936, 1160, 436, 365, 216, 0, 2697, 2407, 1814, 1439, 2295, 1202, 993, 740, 1054, 809, 500, 216, 0), # 169 (2904, 2401, 2336, 2488, 2132, 998, 990, 937, 1166, 436, 366, 216, 0, 2709, 2416, 1819, 1445, 2306, 1208, 995, 744, 1057, 811, 503, 216, 0), # 170 (2910, 2407, 2348, 2498, 2142, 1003, 991, 938, 1169, 437, 367, 217, 0, 2721, 2427, 1821, 1448, 2310, 1209, 997, 747, 1060, 814, 504, 216, 0), # 171 (2920, 2413, 2360, 2513, 2151, 1007, 996, 941, 1170, 440, 369, 217, 0, 2734, 2433, 1825, 1453, 2321, 1215, 998, 750, 1062, 818, 505, 216, 0), # 172 (2929, 2419, 2369, 2518, 2161, 1009, 999, 944, 1179, 441, 371, 217, 0, 2747, 2441, 1829, 1455, 2329, 1222, 999, 752, 1064, 825, 505, 218, 0), # 173 (2938, 2424, 2376, 2529, 2171, 1013, 1001, 946, 1182, 443, 371, 218, 0, 2758, 2446, 1835, 1456, 2335, 1230, 1002, 752, 1070, 829, 505, 218, 0), # 174 (2949, 2428, 2381, 2541, 2182, 1013, 1005, 948, 1187, 443, 371, 218, 0, 2767, 2450, 1840, 1460, 2341, 1234, 1004, 755, 1072, 831, 505, 218, 0), # 175 (2955, 2435, 2389, 2552, 2185, 1018, 1007, 952, 1189, 445, 373, 218, 0, 2782, 2454, 1845, 1462, 2348, 1235, 1008, 759, 1074, 833, 509, 218, 0), # 176 (2961, 2438, 2396, 2558, 2188, 1021, 1008, 952, 1192, 447, 373, 219, 0, 2786, 2459, 1849, 1470, 2358, 1239, 1008, 762, 1078, 835, 510, 218, 0), # 177 (2970, 2440, 2402, 2563, 2190, 1023, 1010, 954, 1194, 447, 373, 221, 0, 2793, 2465, 1857, 1470, 2363, 1240, 1009, 766, 1081, 838, 511, 219, 0), # 178 (2970, 2440, 2402, 2563, 2190, 1023, 1010, 954, 1194, 447, 373, 221, 0, 2793, 2465, 1857, 1470, 2363, 1240, 1009, 766, 1081, 838, 511, 219, 0), # 179 ) passenger_arriving_rate = ( (9.037558041069182, 9.116726123493724, 7.81692484441876, 8.389801494715634, 6.665622729131535, 3.295587678639206, 3.7314320538365235, 3.4898821297345672, 3.654059437300804, 1.781106756985067, 1.261579549165681, 0.7346872617459261, 0.0, 9.150984382641052, 8.081559879205185, 6.307897745828405, 5.3433202709552, 7.308118874601608, 4.885834981628395, 3.7314320538365235, 2.3539911990280045, 3.3328113645657673, 2.7966004982385453, 1.5633849688837522, 0.828793283953975, 0.0), # 0 (9.637788873635953, 9.718600145338852, 8.333019886995228, 8.943944741923431, 7.106988404969084, 3.5132827632446837, 3.9775220471373247, 3.7196352921792815, 3.8953471957997454, 1.8985413115247178, 1.3449288407868398, 0.7831824991221532, 0.0, 9.755624965391739, 8.615007490343684, 6.724644203934198, 5.695623934574153, 7.790694391599491, 5.207489409050994, 3.9775220471373247, 2.509487688031917, 3.553494202484542, 2.9813149139744777, 1.6666039773990458, 0.883509104121714, 0.0), # 1 (10.236101416163518, 10.318085531970116, 8.847063428321121, 9.495883401297473, 7.546755568499692, 3.7301093702380674, 4.222636657164634, 3.948468935928315, 4.135672084126529, 2.015511198759246, 1.4279469446328943, 0.8314848978079584, 0.0, 10.357856690777442, 9.14633387588754, 7.13973472316447, 6.046533596277737, 8.271344168253059, 5.527856510299641, 4.222636657164634, 2.6643638358843336, 3.773377784249846, 3.1652944670991583, 1.7694126856642243, 0.938007775633647, 0.0), # 2 (10.830164027663812, 10.912803828195138, 9.357016303979782, 10.0434281501683, 7.983194011202283, 3.9452076537143688, 4.46580327748316, 4.175475868120881, 4.374081096552656, 2.1315522142917818, 1.5103045235482149, 0.8794028527395692, 0.0, 10.955291051257605, 9.67343138013526, 7.551522617741075, 6.3946566428753435, 8.748162193105312, 5.845666215369232, 4.46580327748316, 2.818005466938835, 3.9915970056011414, 3.3478093833894342, 1.8714032607959565, 0.9920730752904672, 0.0), # 3 (11.417645067148767, 11.500376578821527, 9.860839349554556, 10.584389665866468, 8.41457352455579, 4.1577177677686015, 4.706049301657613, 4.399748895896186, 4.609621227349624, 2.246200153725456, 1.5916722403771728, 0.9267447588532147, 0.0, 11.54553953929167, 10.19419234738536, 7.958361201885864, 6.738600461176366, 9.219242454699248, 6.159648454254661, 4.706049301657613, 2.969798405549001, 4.207286762277895, 3.528129888622157, 1.9721678699109113, 1.0454887798928663, 0.0), # 4 (11.996212893630318, 12.07842532865692, 10.356493400628777, 11.11657862572253, 8.839163900039136, 4.366779866495776, 4.942402123252702, 4.620380826393444, 4.841339470788935, 2.3589908126633987, 1.67172075796414, 0.9733190110851223, 0.0, 12.126213647339089, 10.706509121936344, 8.358603789820698, 7.076972437990195, 9.68267894157787, 6.468533156950822, 4.942402123252702, 3.119128476068411, 4.419581950019568, 3.705526208574178, 2.071298680125756, 1.0980386662415385, 0.0), # 5 (12.5635358661204, 12.644571622508925, 10.8419392927858, 11.63780570706703, 9.255234929131252, 4.571534103990907, 5.173889135833137, 4.836464466751867, 5.068282821142089, 2.469459986708742, 1.750120739153485, 1.0189340043715214, 0.0, 12.694924867859292, 11.208274048086732, 8.750603695767424, 7.408379960126224, 10.136565642284179, 6.771050253452613, 5.173889135833137, 3.265381502850648, 4.627617464565626, 3.8792685690223445, 2.16838785855716, 1.1495065111371752, 0.0), # 6 (13.117282343630944, 13.196437005185167, 11.315137861608953, 12.145881587230525, 9.661056403311065, 4.771120634349007, 5.399537732963626, 5.047092624110664, 5.289498272680586, 2.5771434714646144, 1.8265428467895808, 1.0633981336486396, 0.0, 13.249284693311735, 11.697379470135033, 9.132714233947903, 7.7314304143938415, 10.578996545361171, 7.06592967375493, 5.399537732963626, 3.4079433102492906, 4.830528201655532, 4.048627195743509, 2.2630275723217905, 1.1996760913804698, 0.0), # 7 (13.655120685173882, 13.731643021493262, 11.774049942681595, 12.638616943543553, 10.054898114057503, 4.964679611665085, 5.618375308208878, 5.251358105609044, 5.504032819675924, 2.681577062534149, 1.9006577437167966, 1.1065197938527056, 0.0, 13.786904616155851, 12.171717732379758, 9.503288718583983, 8.044731187602444, 11.008065639351848, 7.351901347852662, 5.618375308208878, 3.5461997226179176, 5.027449057028751, 4.212872314514518, 2.3548099885363194, 1.248331183772115, 0.0), # 8 (14.174719249761154, 14.247811216240837, 12.216636371587056, 13.11382245333668, 10.43502985284949, 5.151351190034158, 5.829429255133608, 5.4483537183862225, 5.710933456399605, 2.782296555520474, 1.9721360927795035, 1.1481073799199473, 0.0, 14.305396128851092, 12.629181179119417, 9.860680463897518, 8.34688966656142, 11.42186691279921, 7.627695205740712, 5.829429255133608, 3.679536564310113, 5.217514926424745, 4.371274151112227, 2.4433272743174115, 1.2952555651128035, 0.0), # 9 (14.673746396404677, 14.7425631342355, 12.640857983908687, 13.569308793940438, 10.799721411165962, 5.330275523551238, 6.031726967302519, 5.637172269581408, 5.909247177123128, 2.878837746026722, 2.0406485568220725, 1.187969286786593, 0.0, 14.802370723856898, 13.06766215465252, 10.20324278411036, 8.636513238080164, 11.818494354246257, 7.892041177413972, 6.031726967302519, 3.8073396596794558, 5.399860705582981, 4.52310293131348, 2.5281715967817378, 1.3402330122032275, 0.0), # 10 (15.149870484116411, 15.213520320284891, 13.044675615229824, 14.002886642685386, 11.14724258048584, 5.500592766311337, 6.224295838280325, 5.816906566333811, 6.098020976117995, 2.970736429656024, 2.105865798688875, 1.2259139093888718, 0.0, 15.2754398936327, 13.485053003277587, 10.529328993444373, 8.912209288968072, 12.19604195223599, 8.143669192867335, 6.224295838280325, 3.9289948330795266, 5.57362129024292, 4.66762888089513, 2.6089351230459648, 1.3830473018440812, 0.0), # 11 (15.600759871908263, 15.6583043191966, 13.42605010113381, 14.412366676902078, 11.475863152288053, 5.6614430724094635, 6.406163261631731, 5.986649415782641, 6.276301847655707, 3.0575284020115086, 2.1674584812242808, 1.2617496426630104, 0.0, 15.722215130637963, 13.879246069293112, 10.837292406121403, 9.172585206034523, 12.552603695311413, 8.381309182095698, 6.406163261631731, 4.043887908863902, 5.737931576144026, 4.804122225634027, 2.6852100202267626, 1.4234822108360548, 0.0), # 12 (16.02408291879218, 16.074536675778273, 13.782942277203993, 14.795559573921057, 11.783852918051522, 5.8119665959406355, 6.576356630921451, 6.145493625067111, 6.443136786007759, 3.138749458696308, 2.225097267272661, 1.2952848815452382, 0.0, 16.140307927332124, 14.248133696997618, 11.125486336363304, 9.416248376088921, 12.886273572015519, 8.603691075093955, 6.576356630921451, 4.151404711386168, 5.891926459025761, 4.93185319130702, 2.756588455440799, 1.4613215159798432, 0.0), # 13 (16.41750798378009, 16.45983893483752, 14.113312979023721, 15.150276011072872, 12.069481669255186, 5.9513034909998614, 6.733903339714195, 6.292532001326435, 6.597572785445653, 3.2139353953135514, 2.2784528196783858, 1.3263280209717843, 0.0, 16.527329776174614, 14.589608230689624, 11.392264098391927, 9.641806185940652, 13.195145570891306, 8.80954480185701, 6.733903339714195, 4.250931064999901, 6.034740834627593, 5.050092003690958, 2.8226625958047444, 1.4963489940761385, 0.0), # 14 (16.77870342588394, 16.811832641181958, 14.415123042176313, 15.474326665688082, 12.33101919737797, 6.078593911682158, 6.877830781574663, 6.426857351699818, 6.738656840240891, 3.2826220074663714, 2.3271958012858263, 1.3546874558788757, 0.0, 16.880892169624886, 14.90156201466763, 11.63597900642913, 9.847866022399112, 13.477313680481782, 8.997600292379746, 6.877830781574663, 4.341852794058684, 6.165509598688985, 5.158108888562695, 2.883024608435263, 1.5283484219256327, 0.0), # 15 (17.10533760411564, 17.128139339619217, 14.686333302245139, 15.765522215097217, 12.566735293898798, 6.192978012082533, 7.007166350067579, 6.547562483326471, 6.865435944664972, 3.344345090757899, 2.370996874939354, 1.380171581202741, 0.0, 17.198606600142384, 15.181887393230149, 11.85498437469677, 10.033035272273695, 13.730871889329944, 9.16658747665706, 7.007166350067579, 4.423555722916095, 6.283367646949399, 5.255174071699074, 2.9372666604490276, 1.55710357632902, 0.0), # 16 (17.395078877487137, 17.406380574956913, 14.92490459481353, 16.021673336630855, 12.774899750296605, 6.2935959462960005, 7.12093743875764, 6.653740203345614, 6.976957092989391, 3.398640440791261, 2.40952670348334, 1.4025887918796085, 0.0, 17.47808456018655, 15.428476710675692, 12.047633517416699, 10.195921322373781, 13.953914185978782, 9.31523628468386, 7.12093743875764, 4.4954256759257145, 6.387449875148302, 5.340557778876952, 2.984980918962706, 1.5823982340869922, 0.0), # 17 (17.645595605010367, 17.644177892002652, 15.12879775546482, 16.24059070761953, 12.953782358050306, 6.379587868417579, 7.2181714412095666, 6.744483318896446, 7.072267279485658, 3.4450438531695924, 2.4424559497621527, 1.4217474828457075, 0.0, 17.716937542216822, 15.63922231130278, 12.212279748810763, 10.335131559508774, 14.144534558971316, 9.442276646455024, 7.2181714412095666, 4.556848477441128, 6.476891179025153, 5.413530235873177, 3.0257595510929645, 1.6040161720002415, 0.0), # 18 (17.85455614569726, 17.83915283556408, 15.29597361978237, 16.420085005393776, 13.10165290863884, 6.450093932542269, 7.297895750988055, 6.818884637118185, 7.150413498425267, 3.4830911234960236, 2.4694552766201636, 1.4374560490372645, 0.0, 17.912777038692653, 15.812016539409907, 12.347276383100818, 10.449273370488068, 14.300826996850533, 9.546438491965459, 7.297895750988055, 4.607209951815906, 6.55082645431942, 5.473361668464593, 3.059194723956474, 1.621741166869462, 0.0), # 19 (18.01962885855975, 17.988926950448786, 15.424393023349506, 16.55796690728418, 13.216781193541133, 6.504254292765094, 7.359137761657826, 6.876036965150038, 7.210442744079718, 3.5123180473736824, 2.490195346901745, 1.4495228853905089, 0.0, 18.063214542073485, 15.944751739295596, 12.450976734508725, 10.536954142121044, 14.420885488159437, 9.626451751210054, 7.359137761657826, 4.645895923403639, 6.608390596770566, 5.51932230242806, 3.084878604669901, 1.6353569954953444, 0.0), # 20 (18.13848210260976, 18.09112178146442, 15.51201680174958, 16.652047090621256, 13.297437004236105, 6.541209103181062, 7.400924866783583, 6.915033110131218, 7.251402010720512, 3.532260420405701, 2.5043468234512685, 1.4577563868416692, 0.0, 18.165861544818743, 16.03532025525836, 12.52173411725634, 10.5967812612171, 14.502804021441024, 9.681046354183705, 7.400924866783583, 4.672292216557902, 6.648718502118053, 5.550682363540419, 3.1024033603499164, 1.644647434678584, 0.0), # 21 (18.20878423685924, 18.143358873418588, 15.55680579056593, 16.70013623273558, 13.341890132202689, 6.560098517885186, 7.422284459930039, 6.934965879200936, 7.27233829261915, 3.54245403819521, 2.5115803691131027, 1.4619649483269737, 0.0, 18.218329539387888, 16.08161443159671, 12.557901845565512, 10.627362114585626, 14.5446765852383, 9.70895223088131, 7.422284459930039, 4.6857846556322755, 6.6709450661013445, 5.5667120775785275, 3.111361158113186, 1.649396261219872, 0.0), # 22 (18.23470805401675, 18.14954393004115, 15.562384773662554, 16.706156597222225, 13.353278467239116, 6.5625, 7.424823602033405, 6.937120370370371, 7.274955740740741, 3.543656522633746, 2.512487411148522, 1.4624846364883404, 0.0, 18.225, 16.08733100137174, 12.56243705574261, 10.630969567901236, 14.549911481481482, 9.71196851851852, 7.424823602033405, 4.6875, 6.676639233619558, 5.568718865740743, 3.1124769547325113, 1.6499585390946503, 0.0), # 23 (18.253822343461476, 18.145936111111112, 15.561472222222221, 16.705415625000004, 13.359729136337823, 6.5625, 7.42342843137255, 6.934125, 7.274604999999999, 3.5429177777777783, 2.5123873737373743, 1.462362962962963, 0.0, 18.225, 16.085992592592593, 12.561936868686871, 10.628753333333332, 14.549209999999999, 9.707775, 7.42342843137255, 4.6875, 6.679864568168911, 5.568471875000002, 3.1122944444444447, 1.649630555555556, 0.0), # 24 (18.272533014380844, 18.138824588477366, 15.559670781893006, 16.70394965277778, 13.366037934713404, 6.5625, 7.420679012345679, 6.928240740740742, 7.273912037037037, 3.541463477366256, 2.512189019827909, 1.4621227709190674, 0.0, 18.225, 16.08335048010974, 12.560945099139545, 10.624390432098766, 14.547824074074073, 9.69953703703704, 7.420679012345679, 4.6875, 6.683018967356702, 5.567983217592594, 3.1119341563786014, 1.6489840534979427, 0.0), # 25 (18.290838634286462, 18.128318004115226, 15.557005144032923, 16.70177534722222, 13.372204642105325, 6.5625, 7.416618046477849, 6.919578703703704, 7.27288574074074, 3.539317818930042, 2.511894145155257, 1.4617673525377233, 0.0, 18.225, 16.079440877914955, 12.559470725776283, 10.617953456790124, 14.54577148148148, 9.687410185185186, 7.416618046477849, 4.6875, 6.686102321052663, 5.567258449074075, 3.111401028806585, 1.648028909465021, 0.0), # 26 (18.308737770689945, 18.114524999999997, 15.553500000000001, 16.698909375, 13.378229038253057, 6.5625, 7.411288235294118, 6.908250000000002, 7.271535, 3.5365050000000005, 2.5115045454545455, 1.4613000000000003, 0.0, 18.225, 16.0743, 12.557522727272728, 10.609514999999998, 14.54307, 9.671550000000002, 7.411288235294118, 4.6875, 6.689114519126528, 5.566303125, 3.1107000000000005, 1.646775, 0.0), # 27 (18.3262289911029, 18.097554218106993, 15.549180041152265, 16.695368402777778, 13.384110902896083, 6.5625, 7.404732280319536, 6.894365740740742, 7.269868703703704, 3.533049218106997, 2.5110220164609056, 1.4607240054869688, 0.0, 18.225, 16.067964060356655, 12.555110082304529, 10.599147654320989, 14.539737407407408, 9.652112037037039, 7.404732280319536, 4.6875, 6.6920554514480415, 5.565122800925927, 3.1098360082304533, 1.6452322016460905, 0.0), # 28 (18.34331086303695, 18.077514300411522, 15.54406995884774, 16.69116909722222, 13.389850015773863, 6.5625, 7.396992883079159, 6.8780370370370365, 7.267895740740741, 3.5289746707818943, 2.510448353909465, 1.4600426611796984, 0.0, 18.225, 16.06046927297668, 12.552241769547326, 10.58692401234568, 14.535791481481482, 9.629251851851851, 7.396992883079159, 4.6875, 6.694925007886932, 5.563723032407409, 3.1088139917695483, 1.6434103909465023, 0.0), # 29 (18.359981954003697, 18.054513888888888, 15.538194444444445, 16.686328125000003, 13.395446156625884, 6.5625, 7.388112745098039, 6.859375, 7.265625, 3.5243055555555567, 2.509785353535354, 1.4592592592592593, 0.0, 18.225, 16.05185185185185, 12.548926767676768, 10.572916666666668, 14.53125, 9.603125, 7.388112745098039, 4.6875, 6.697723078312942, 5.562109375000001, 3.107638888888889, 1.6413194444444446, 0.0), # 30 (18.376240831514746, 18.028661625514406, 15.531578189300415, 16.680862152777777, 13.400899105191609, 6.5625, 7.378134567901236, 6.838490740740741, 7.26306537037037, 3.5190660699588485, 2.5090348110737, 1.458377091906722, 0.0, 18.225, 16.04214801097394, 12.5451740553685, 10.557198209876542, 14.52613074074074, 9.573887037037037, 7.378134567901236, 4.6875, 6.7004495525958045, 5.56028738425926, 3.106315637860083, 1.638969238683128, 0.0), # 31 (18.392086063081717, 18.000066152263376, 15.524245884773661, 16.674787847222223, 13.406208641210513, 6.5625, 7.3671010530137995, 6.815495370370372, 7.260225740740741, 3.5132804115226346, 2.5081985222596335, 1.4573994513031552, 0.0, 18.225, 16.031393964334704, 12.540992611298167, 10.539841234567902, 14.520451481481482, 9.541693518518521, 7.3671010530137995, 4.6875, 6.703104320605257, 5.558262615740742, 3.1048491769547324, 1.6363696502057616, 0.0), # 32 (18.407516216216216, 17.96883611111111, 15.516222222222224, 16.668121874999997, 13.411374544422076, 6.5625, 7.355054901960784, 6.790500000000001, 7.257115, 3.506972777777779, 2.507278282828283, 1.4563296296296298, 0.0, 18.225, 16.019625925925926, 12.536391414141413, 10.520918333333334, 14.51423, 9.5067, 7.355054901960784, 4.6875, 6.705687272211038, 5.5560406250000005, 3.103244444444445, 1.6335305555555555, 0.0), # 33 (18.422529858429858, 17.93508014403292, 15.507531893004115, 16.660880902777777, 13.41639659456576, 6.5625, 7.342038816267248, 6.7636157407407405, 7.253742037037037, 3.500167366255145, 2.5062758885147773, 1.4551709190672155, 0.0, 18.225, 16.006880109739367, 12.531379442573886, 10.500502098765432, 14.507484074074075, 9.469062037037038, 7.342038816267248, 4.6875, 6.70819829728288, 5.553626967592593, 3.1015063786008232, 1.6304618312757202, 0.0), # 34 (18.437125557234253, 17.898906893004114, 15.49819958847737, 16.65308159722222, 13.421274571381044, 6.5625, 7.328095497458243, 6.734953703703703, 7.250115740740741, 3.4928883744855974, 2.5051931350542462, 1.4539266117969825, 0.0, 18.225, 15.993192729766804, 12.52596567527123, 10.47866512345679, 14.500231481481482, 9.428935185185185, 7.328095497458243, 4.6875, 6.710637285690522, 5.551027199074074, 3.099639917695474, 1.627173353909465, 0.0), # 35 (18.45130188014101, 17.860424999999996, 15.488249999999999, 16.644740624999997, 13.426008254607403, 6.5625, 7.313267647058823, 6.704625000000001, 7.246244999999999, 3.485160000000001, 2.504031818181818, 1.4526000000000006, 0.0, 18.225, 15.978600000000004, 12.520159090909091, 10.45548, 14.492489999999998, 9.386475, 7.313267647058823, 4.6875, 6.7130041273037016, 5.548246875, 3.0976500000000002, 1.623675, 0.0), # 36 (18.46505739466174, 17.819743106995883, 15.477707818930043, 16.63587465277778, 13.430597423984304, 6.5625, 7.2975979665940445, 6.672740740740741, 7.242138703703703, 3.477006440329219, 2.502793733632623, 1.451194375857339, 0.0, 18.225, 15.963138134430727, 12.513968668163116, 10.431019320987655, 14.484277407407406, 9.341837037037038, 7.2975979665940445, 4.6875, 6.715298711992152, 5.545291550925927, 3.0955415637860084, 1.619976646090535, 0.0), # 37 (18.47839066830806, 17.776969855967078, 15.466597736625513, 16.626500347222226, 13.435041859251228, 6.5625, 7.281129157588961, 6.639412037037038, 7.237805740740741, 3.4684518930041164, 2.5014806771417883, 1.4497130315500688, 0.0, 18.225, 15.946843347050754, 12.507403385708942, 10.405355679012347, 14.475611481481481, 9.295176851851854, 7.281129157588961, 4.6875, 6.717520929625614, 5.542166782407409, 3.0933195473251027, 1.61608816872428, 0.0), # 38 (18.491300268591576, 17.732213888888886, 15.454944444444445, 16.616634375, 13.439341340147644, 6.5625, 7.2639039215686285, 6.60475, 7.233255000000001, 3.4595205555555566, 2.500094444444445, 1.4481592592592594, 0.0, 18.225, 15.92975185185185, 12.500472222222223, 10.378561666666666, 14.466510000000001, 9.24665, 7.2639039215686285, 4.6875, 6.719670670073822, 5.538878125000001, 3.0909888888888895, 1.6120194444444444, 0.0), # 39 (18.503784763023894, 17.685583847736623, 15.442772633744857, 16.60629340277778, 13.443495646413021, 6.5625, 7.245964960058098, 6.568865740740742, 7.228495370370371, 3.4502366255144046, 2.49863683127572, 1.4465363511659812, 0.0, 18.225, 15.911899862825791, 12.4931841563786, 10.350709876543212, 14.456990740740743, 9.196412037037039, 7.245964960058098, 4.6875, 6.721747823206511, 5.535431134259261, 3.0885545267489714, 1.6077803497942387, 0.0), # 40 (18.51584271911663, 17.637188374485596, 15.430106995884776, 16.595494097222222, 13.447504557786843, 6.5625, 7.2273549745824255, 6.531870370370371, 7.22353574074074, 3.4406243004115233, 2.4971096333707448, 1.4448475994513033, 0.0, 18.225, 15.893323593964332, 12.485548166853723, 10.321872901234567, 14.44707148148148, 9.14461851851852, 7.2273549745824255, 4.6875, 6.723752278893421, 5.531831365740742, 3.0860213991769556, 1.6033807613168727, 0.0), # 41 (18.527472704381402, 17.587136111111114, 15.416972222222224, 16.584253125000004, 13.45136785400857, 6.5625, 7.208116666666666, 6.493875, 7.218385000000001, 3.4307077777777786, 2.4955146464646467, 1.4430962962962963, 0.0, 18.225, 15.874059259259258, 12.477573232323234, 10.292123333333333, 14.436770000000003, 9.091425000000001, 7.208116666666666, 4.6875, 6.725683927004285, 5.5280843750000015, 3.083394444444445, 1.598830555555556, 0.0), # 42 (18.538673286329807, 17.53553569958848, 15.403393004115227, 16.57258715277778, 13.455085314817683, 6.5625, 7.188292737835875, 6.454990740740741, 7.213052037037036, 3.420511255144034, 2.4938536662925554, 1.4412857338820306, 0.0, 18.225, 15.854143072702334, 12.469268331462775, 10.2615337654321, 14.426104074074072, 9.036987037037038, 7.188292737835875, 4.6875, 6.727542657408842, 5.524195717592594, 3.080678600823046, 1.5941396090534983, 0.0), # 43 (18.54944303247347, 17.482495781893004, 15.389394032921814, 16.560512847222224, 13.458656719953654, 6.5625, 7.1679258896151055, 6.415328703703706, 7.2075457407407395, 3.4100589300411532, 2.4921284885895996, 1.439419204389575, 0.0, 18.225, 15.833611248285322, 12.460642442947998, 10.230176790123457, 14.415091481481479, 8.981460185185188, 7.1679258896151055, 4.6875, 6.729328359976827, 5.520170949074076, 3.077878806584363, 1.5893177983539097, 0.0), # 44 (18.55978051032399, 17.428124999999998, 15.375, 16.548046875, 13.462081849155954, 6.5625, 7.147058823529412, 6.375000000000001, 7.201874999999999, 3.3993750000000014, 2.4903409090909094, 1.4375000000000002, 0.0, 18.225, 15.8125, 12.451704545454545, 10.198125000000001, 14.403749999999999, 8.925, 7.147058823529412, 4.6875, 6.731040924577977, 5.516015625000001, 3.075, 1.584375, 0.0), # 45 (18.569684287392985, 17.372531995884774, 15.360235596707819, 16.535205902777776, 13.465360482164058, 6.5625, 7.125734241103849, 6.334115740740741, 7.196048703703703, 3.388483662551441, 2.4884927235316128, 1.4355314128943761, 0.0, 18.225, 15.790845541838134, 12.442463617658062, 10.16545098765432, 14.392097407407405, 8.86776203703704, 7.125734241103849, 4.6875, 6.732680241082029, 5.511735300925927, 3.072047119341564, 1.5793210905349795, 0.0), # 46 (18.579152931192063, 17.31582541152263, 15.345125514403293, 16.522006597222223, 13.46849239871744, 6.5625, 7.103994843863473, 6.292787037037037, 7.190075740740742, 3.3774091152263384, 2.486585727646839, 1.4335167352537728, 0.0, 18.225, 15.768684087791497, 12.432928638234193, 10.132227345679013, 14.380151481481484, 8.809901851851851, 7.103994843863473, 4.6875, 6.73424619935872, 5.507335532407408, 3.069025102880659, 1.5741659465020577, 0.0), # 47 (18.588185009232834, 17.258113888888886, 15.329694444444444, 16.508465625, 13.471477378555573, 6.5625, 7.081883333333334, 6.251125000000001, 7.183965000000001, 3.3661755555555564, 2.4846217171717173, 1.4314592592592594, 0.0, 18.225, 15.746051851851853, 12.423108585858586, 10.098526666666666, 14.367930000000001, 8.751575, 7.081883333333334, 4.6875, 6.735738689277786, 5.502821875000001, 3.065938888888889, 1.5689194444444445, 0.0), # 48 (18.596779089026917, 17.199506069958847, 15.313967078189304, 16.49459965277778, 13.47431520141793, 6.5625, 7.059442411038489, 6.209240740740741, 7.17772537037037, 3.35480718106996, 2.4826024878413775, 1.4293622770919072, 0.0, 18.225, 15.722985048010976, 12.413012439206886, 10.064421543209878, 14.35545074074074, 8.692937037037037, 7.059442411038489, 4.6875, 6.737157600708965, 5.498199884259261, 3.0627934156378607, 1.5635914609053498, 0.0), # 49 (18.604933738085908, 17.140110596707824, 15.297968106995889, 16.480425347222223, 13.477005647043978, 6.5625, 7.0367147785039945, 6.16724537037037, 7.1713657407407405, 3.3433281893004123, 2.480529835390947, 1.427229080932785, 0.0, 18.225, 15.699519890260632, 12.402649176954732, 10.029984567901234, 14.342731481481481, 8.634143518518519, 7.0367147785039945, 4.6875, 6.738502823521989, 5.4934751157407415, 3.059593621399178, 1.5581918724279842, 0.0), # 50 (18.61264752392144, 17.080036111111113, 15.281722222222223, 16.465959375, 13.479548495173198, 6.5625, 7.013743137254902, 6.12525, 7.164895000000001, 3.3317627777777785, 2.478405555555556, 1.4250629629629634, 0.0, 18.225, 15.675692592592595, 12.392027777777779, 9.995288333333333, 14.329790000000003, 8.57535, 7.013743137254902, 4.6875, 6.739774247586599, 5.488653125000001, 3.0563444444444445, 1.552730555555556, 0.0), # 51 (18.619919014045102, 17.019391255144033, 15.26525411522634, 16.45121840277778, 13.481943525545056, 6.5625, 6.9905701888162675, 6.08336574074074, 7.158322037037037, 3.320135144032923, 2.4762314440703332, 1.4228672153635122, 0.0, 18.225, 15.651539368998632, 12.381157220351666, 9.960405432098767, 14.316644074074073, 8.516712037037037, 6.9905701888162675, 4.6875, 6.740971762772528, 5.483739467592594, 3.0530508230452678, 1.547217386831276, 0.0), # 52 (18.626746775968517, 16.958284670781893, 15.248588477366258, 16.43621909722222, 13.484190517899034, 6.5625, 6.967238634713145, 6.041703703703704, 7.1516557407407415, 3.3084694855967087, 2.4740092966704084, 1.4206451303155008, 0.0, 18.225, 15.627096433470507, 12.37004648335204, 9.925408456790123, 14.303311481481483, 8.458385185185186, 6.967238634713145, 4.6875, 6.742095258949517, 5.478739699074075, 3.049717695473252, 1.5416622427983542, 0.0), # 53 (18.63312937720329, 16.896825000000003, 15.23175, 16.420978125, 13.486289251974604, 6.5625, 6.943791176470588, 6.000374999999999, 7.144905, 3.296790000000001, 2.4717409090909093, 1.4184000000000003, 0.0, 18.225, 15.602400000000001, 12.358704545454545, 9.89037, 14.28981, 8.400525, 6.943791176470588, 4.6875, 6.743144625987302, 5.473659375000001, 3.04635, 1.5360750000000005, 0.0), # 54 (18.63906538526104, 16.835120884773662, 15.2147633744856, 16.405512152777778, 13.488239507511228, 6.5625, 6.9202705156136535, 5.9594907407407405, 7.1380787037037035, 3.2851208847736637, 2.4694280770669663, 1.4161351165980798, 0.0, 18.225, 15.577486282578874, 12.34714038533483, 9.855362654320988, 14.276157407407407, 8.343287037037037, 6.9202705156136535, 4.6875, 6.744119753755614, 5.468504050925927, 3.04295267489712, 1.530465534979424, 0.0), # 55 (18.64455336765337, 16.77328096707819, 15.197653292181073, 16.389837847222225, 13.49004106424839, 6.5625, 6.896719353667393, 5.9191620370370375, 7.131185740740741, 3.2734863374485608, 2.467072596333708, 1.4138537722908093, 0.0, 18.225, 15.5523914951989, 12.335362981668538, 9.82045901234568, 14.262371481481482, 8.286826851851853, 6.896719353667393, 4.6875, 6.745020532124195, 5.463279282407409, 3.0395306584362145, 1.5248437242798356, 0.0), # 56 (18.649591891891887, 16.711413888888888, 15.180444444444445, 16.373971875, 13.49169370192556, 6.5625, 6.873180392156863, 5.879500000000001, 7.124235, 3.2619105555555565, 2.4646762626262633, 1.4115592592592594, 0.0, 18.225, 15.527151851851851, 12.323381313131314, 9.785731666666667, 14.24847, 8.231300000000001, 6.873180392156863, 4.6875, 6.74584685096278, 5.457990625000001, 3.0360888888888895, 1.5192194444444447, 0.0), # 57 (18.654179525488225, 16.64962829218107, 15.163161522633745, 16.357930902777774, 13.49319720028221, 6.5625, 6.849696332607118, 5.840615740740741, 7.11723537037037, 3.2504177366255154, 2.4622408716797612, 1.4092548696844995, 0.0, 18.225, 15.501803566529492, 12.311204358398806, 9.751253209876543, 14.23447074074074, 8.176862037037038, 6.849696332607118, 4.6875, 6.746598600141105, 5.4526436342592595, 3.032632304526749, 1.5136025720164612, 0.0), # 58 (18.658314835953966, 16.58803281893004, 15.145829218106996, 16.34173159722222, 13.494551339057814, 6.5625, 6.82630987654321, 5.802620370370371, 7.110195740740741, 3.2390320781893016, 2.4597682192293306, 1.4069438957475995, 0.0, 18.225, 15.476382853223592, 12.298841096146651, 9.717096234567903, 14.220391481481482, 8.12366851851852, 6.82630987654321, 4.6875, 6.747275669528907, 5.447243865740742, 3.0291658436213997, 1.5080029835390947, 0.0), # 59 (18.661996390800738, 16.526736111111113, 15.128472222222221, 16.325390625, 13.495755897991843, 6.5625, 6.803063725490196, 5.765625, 7.103125, 3.2277777777777787, 2.4572601010101014, 1.40462962962963, 0.0, 18.225, 15.450925925925928, 12.286300505050505, 9.683333333333334, 14.20625, 8.071875, 6.803063725490196, 4.6875, 6.747877948995922, 5.441796875000001, 3.0256944444444445, 1.502430555555556, 0.0), # 60 (18.665222757540146, 16.465846810699592, 15.111115226337452, 16.308924652777776, 13.496810656823772, 6.5625, 6.780000580973129, 5.729740740740741, 7.0960320370370376, 3.216679032921812, 2.4547183127572016, 1.40231536351166, 0.0, 18.225, 15.425468998628258, 12.273591563786008, 9.650037098765434, 14.192064074074075, 8.021637037037038, 6.780000580973129, 4.6875, 6.748405328411886, 5.436308217592593, 3.0222230452674905, 1.496895164609054, 0.0), # 61 (18.66799250368381, 16.40547355967078, 15.093782921810703, 16.292350347222225, 13.497715395293081, 6.5625, 6.757163144517066, 5.695078703703705, 7.088925740740741, 3.2057600411522644, 2.4521446502057613, 1.4000043895747603, 0.0, 18.225, 15.40004828532236, 12.260723251028807, 9.61728012345679, 14.177851481481483, 7.973110185185186, 6.757163144517066, 4.6875, 6.748857697646541, 5.430783449074076, 3.018756584362141, 1.4914066872427985, 0.0), # 62 (18.670304196743327, 16.345724999999998, 15.0765, 16.275684375, 13.498469893139227, 6.5625, 6.734594117647059, 5.6617500000000005, 7.081815, 3.195045000000001, 2.4495409090909095, 1.3977000000000002, 0.0, 18.225, 15.3747, 12.247704545454548, 9.585135, 14.16363, 7.926450000000001, 6.734594117647059, 4.6875, 6.749234946569613, 5.425228125000001, 3.0153000000000003, 1.485975, 0.0), # 63 (18.672156404230314, 16.286709773662555, 15.059291152263373, 16.258943402777778, 13.499073930101698, 6.5625, 6.712336201888163, 5.629865740740741, 7.0747087037037035, 3.1845581069958855, 2.446908885147774, 1.3954054869684502, 0.0, 18.225, 15.34946035665295, 12.23454442573887, 9.553674320987653, 14.149417407407407, 7.881812037037038, 6.712336201888163, 4.6875, 6.749536965050849, 5.419647800925927, 3.011858230452675, 1.4806099794238687, 0.0), # 64 (18.67354769365639, 16.228536522633743, 15.042181069958849, 16.242144097222223, 13.49952728591996, 6.5625, 6.690432098765433, 5.599537037037037, 7.067615740740742, 3.1743235596707824, 2.4442503741114856, 1.3931241426611796, 0.0, 18.225, 15.324365569272972, 12.221251870557428, 9.522970679012344, 14.135231481481483, 7.839351851851852, 6.690432098765433, 4.6875, 6.74976364295998, 5.4140480324074085, 3.00843621399177, 1.4753215020576131, 0.0), # 65 (18.674476632533153, 16.17131388888889, 15.025194444444447, 16.225303125, 13.499829740333489, 6.5625, 6.668924509803921, 5.570875000000001, 7.060545000000001, 3.1643655555555563, 2.4415671717171716, 1.3908592592592597, 0.0, 18.225, 15.299451851851854, 12.207835858585858, 9.493096666666666, 14.121090000000002, 7.799225000000001, 6.668924509803921, 4.6875, 6.749914870166744, 5.408434375000001, 3.0050388888888895, 1.4701194444444448, 0.0), # 66 (18.674941788372227, 16.11515051440329, 15.00835596707819, 16.208437152777776, 13.499981073081756, 6.5625, 6.647856136528685, 5.543990740740742, 7.05350537037037, 3.154708292181071, 2.438861073699963, 1.3886141289437586, 0.0, 18.225, 15.274755418381341, 12.194305368499816, 9.464124876543211, 14.10701074074074, 7.761587037037039, 6.647856136528685, 4.6875, 6.749990536540878, 5.40281238425926, 3.001671193415638, 1.465013683127572, 0.0), # 67 (18.674624906065485, 16.059860254878533, 14.99160892489712, 16.19141634963768, 13.499853546356814, 6.56237821216278, 6.627163675346682, 5.518757887517148, 7.046452709190673, 3.145329198741226, 2.436085796562113, 1.3863795032849615, 0.0, 18.22477527006173, 15.250174536134574, 12.180428982810565, 9.435987596223676, 14.092905418381346, 7.726261042524007, 6.627163675346682, 4.6874130086877, 6.749926773178407, 5.3971387832125615, 2.998321784979424, 1.4599872958980487, 0.0), # 68 (18.671655072463768, 16.00375510752688, 14.974482638888889, 16.173382744565217, 13.498692810457515, 6.561415432098766, 6.606241363211952, 5.493824074074074, 7.039078703703703, 3.1359628758169937, 2.4329588516746417, 1.3840828460038987, 0.0, 18.222994791666668, 15.224911306042884, 12.164794258373206, 9.407888627450978, 14.078157407407407, 7.6913537037037045, 6.606241363211952, 4.686725308641976, 6.749346405228757, 5.391127581521739, 2.994896527777778, 1.4548868279569895, 0.0), # 69 (18.665794417606012, 15.946577558741536, 14.956902649176953, 16.154217617753623, 13.496399176954732, 6.559519318701418, 6.5849941211052325, 5.468964334705077, 7.031341735253773, 3.1265637860082314, 2.429444665957824, 1.3817134141939216, 0.0, 18.219478202160495, 15.198847556133135, 12.147223329789119, 9.379691358024692, 14.062683470507546, 7.656550068587107, 6.5849941211052325, 4.685370941929584, 6.748199588477366, 5.384739205917875, 2.9913805298353906, 1.4496888689765035, 0.0), # 70 (18.657125389157272, 15.888361778176023, 14.938875128600824, 16.133949230072467, 13.493001694504963, 6.556720598994056, 6.56343149358509, 5.444186899862826, 7.023253326474624, 3.1171321617041885, 2.425556211235159, 1.3792729405819073, 0.0, 18.21427179783951, 15.172002346400978, 12.127781056175793, 9.351396485112563, 14.046506652949247, 7.621861659807958, 6.56343149358509, 4.683371856424325, 6.746500847252482, 5.377983076690823, 2.987775025720165, 1.4443965252887296, 0.0), # 71 (18.64573043478261, 15.82914193548387, 14.92040625, 16.112605842391304, 13.488529411764706, 6.553050000000001, 6.541563025210084, 5.4195, 7.014825, 3.1076682352941183, 2.421306459330144, 1.376763157894737, 0.0, 18.207421875, 15.144394736842104, 12.10653229665072, 9.323004705882353, 14.02965, 7.587300000000001, 6.541563025210084, 4.680750000000001, 6.744264705882353, 5.370868614130436, 2.98408125, 1.4390129032258066, 0.0), # 72 (18.631692002147076, 15.768952200318596, 14.90150218621399, 16.09021571557971, 13.483011377390461, 6.548538248742569, 6.519398260538782, 5.394911865569274, 7.006068278463649, 3.0981722391672726, 2.4167083820662767, 1.374185798859288, 0.0, 18.198974729938275, 15.116043787452165, 12.083541910331384, 9.294516717501814, 14.012136556927299, 7.552876611796983, 6.519398260538782, 4.677527320530407, 6.741505688695231, 5.363405238526571, 2.9803004372427986, 1.4335411091198726, 0.0), # 73 (18.61509253891573, 15.707826742333731, 14.882169110082302, 16.06680711050725, 13.47647664003873, 6.543216072245086, 6.49694674412975, 5.37043072702332, 6.996994684499314, 3.0886444057129037, 2.411774951267057, 1.3715425962024403, 0.0, 18.18897665895062, 15.086968558226841, 12.058874756335285, 9.26593321713871, 13.993989368998628, 7.518603017832648, 6.49694674412975, 4.673725765889347, 6.738238320019365, 5.355602370169083, 2.976433822016461, 1.4279842493030668, 0.0), # 74 (18.59601449275362, 15.645799731182793, 14.862413194444443, 16.04240828804348, 13.468954248366014, 6.537114197530865, 6.47421802054155, 5.346064814814815, 6.98761574074074, 3.0790849673202625, 2.406519138755981, 1.3688352826510723, 0.0, 18.177473958333334, 15.057188109161793, 12.032595693779903, 9.237254901960785, 13.97523148148148, 7.484490740740742, 6.47421802054155, 4.669367283950618, 6.734477124183007, 5.347469429347827, 2.9724826388888888, 1.422345430107527, 0.0), # 75 (18.57454031132582, 15.582905336519316, 14.842240612139918, 16.01704750905797, 13.460473251028805, 6.53026335162323, 6.451221634332746, 5.321822359396434, 6.977942969821673, 3.069494156378602, 2.400953916356548, 1.3660655909320625, 0.0, 18.164512924382716, 15.026721500252684, 12.004769581782737, 9.208482469135802, 13.955885939643347, 7.450551303155008, 6.451221634332746, 4.664473822588021, 6.730236625514403, 5.339015836352658, 2.9684481224279837, 1.4166277578653925, 0.0), # 76 (18.55075244229737, 15.519177727996816, 14.821657536008228, 15.99075303442029, 13.451062696683609, 6.522694261545496, 6.4279671300619015, 5.2977115912208514, 6.967987894375857, 3.059872205277174, 2.3950922558922563, 1.3632352537722912, 0.0, 18.150139853395064, 14.9955877914952, 11.975461279461282, 9.179616615831518, 13.935975788751714, 7.416796227709193, 6.4279671300619015, 4.659067329675354, 6.725531348341804, 5.330251011473431, 2.964331507201646, 1.4108343389088016, 0.0), # 77 (18.524733333333334, 15.45465107526882, 14.80067013888889, 15.963553124999999, 13.440751633986928, 6.514437654320987, 6.404464052287582, 5.273740740740742, 6.957762037037036, 3.0502193464052296, 2.388947129186603, 1.3603460038986357, 0.0, 18.134401041666667, 14.963806042884991, 11.944735645933015, 9.150658039215687, 13.915524074074073, 7.383237037037039, 6.404464052287582, 4.653169753086419, 6.720375816993464, 5.3211843750000005, 2.960134027777778, 1.404968279569893, 0.0), # 78 (18.496565432098766, 15.389359547988851, 14.779284593621398, 15.935476041666668, 13.429569111595256, 6.505524256973022, 6.380721945568351, 5.249918038408779, 6.947276920438957, 3.0405358121520223, 2.382531508063087, 1.3573995740379758, 0.0, 18.117342785493825, 14.931395314417731, 11.912657540315433, 9.121607436456063, 13.894553840877913, 7.349885253772292, 6.380721945568351, 4.646803040695016, 6.714784555797628, 5.311825347222223, 2.95585691872428, 1.399032686180805, 0.0), # 79 (18.466331186258724, 15.323337315810434, 14.757507073045266, 15.906550045289855, 13.417544178165095, 6.49598479652492, 6.356750354462773, 5.226251714677641, 6.9365440672153635, 3.030821834906803, 2.375858364345207, 1.3543976969171905, 0.0, 18.09901138117284, 14.898374666089092, 11.879291821726033, 9.092465504720405, 13.873088134430727, 7.316752400548698, 6.356750354462773, 4.639989140374943, 6.708772089082547, 5.302183348429953, 2.9515014146090537, 1.3930306650736761, 0.0), # 80 (18.434113043478263, 15.256618548387095, 14.735343749999998, 15.876803396739131, 13.404705882352939, 6.48585, 6.3325588235294115, 5.202750000000001, 6.925574999999999, 3.0210776470588248, 2.36894066985646, 1.3513421052631582, 0.0, 18.079453124999997, 14.864763157894737, 11.844703349282298, 9.063232941176471, 13.851149999999999, 7.283850000000001, 6.3325588235294115, 4.63275, 6.7023529411764695, 5.292267798913045, 2.94706875, 1.3869653225806453, 0.0), # 81 (18.399993451422436, 15.189237415372364, 14.712800797325105, 15.846264356884058, 13.391083272815298, 6.475150594421583, 6.308156897326833, 5.179421124828533, 6.914381241426612, 3.011303480997338, 2.3617913964203443, 1.3482345318027582, 0.0, 18.058714313271608, 14.830579849830338, 11.80895698210172, 9.03391044299201, 13.828762482853223, 7.2511895747599455, 6.308156897326833, 4.625107567443988, 6.695541636407649, 5.2820881189613536, 2.9425601594650215, 1.3808397650338515, 0.0), # 82 (18.364054857756308, 15.121228086419752, 14.689884387860083, 15.8149611865942, 13.376705398208665, 6.463917306812986, 6.283554120413598, 5.156273319615913, 6.902974314128944, 3.001499569111596, 2.3544235158603586, 1.3450767092628693, 0.0, 18.036841242283952, 14.79584380189156, 11.772117579301792, 9.004498707334786, 13.805948628257887, 7.218782647462278, 6.283554120413598, 4.617083790580704, 6.688352699104333, 5.2716537288647345, 2.9379768775720168, 1.374657098765432, 0.0), # 83 (18.326379710144927, 15.052624731182796, 14.666600694444444, 15.78292214673913, 13.361601307189542, 6.452180864197532, 6.258760037348273, 5.133314814814815, 6.89136574074074, 2.9916661437908503, 2.3468500000000003, 1.3418703703703705, 0.0, 18.013880208333333, 14.760574074074073, 11.73425, 8.97499843137255, 13.78273148148148, 7.186640740740741, 6.258760037348273, 4.608700617283951, 6.680800653594771, 5.260974048913044, 2.933320138888889, 1.3684204301075271, 0.0), # 84 (18.287050456253354, 14.983461519315012, 14.642955889917694, 15.750175498188408, 13.345800048414427, 6.439971993598538, 6.233784192689422, 5.110553840877915, 6.879567043895747, 2.981803437424353, 2.3390838206627684, 1.338617247852141, 0.0, 17.989877507716052, 14.724789726373547, 11.69541910331384, 8.945410312273058, 13.759134087791494, 7.154775377229082, 6.233784192689422, 4.5999799954275264, 6.672900024207213, 5.250058499396137, 2.928591177983539, 1.362132865392274, 0.0), # 85 (18.246149543746643, 14.913772620469931, 14.618956147119343, 15.716749501811597, 13.32933067053982, 6.427321422039324, 6.208636130995608, 5.087998628257887, 6.86758974622771, 2.9719116824013563, 2.3311379496721605, 1.3353190744350594, 0.0, 17.964879436728395, 14.68850981878565, 11.655689748360802, 8.915735047204068, 13.73517949245542, 7.123198079561043, 6.208636130995608, 4.590943872885232, 6.66466533526991, 5.2389165006038665, 2.923791229423869, 1.3557975109518121, 0.0), # 86 (18.203759420289852, 14.843592204301075, 14.594607638888888, 15.68267241847826, 13.312222222222225, 6.41425987654321, 6.1833253968253965, 5.065657407407408, 6.855445370370372, 2.9619911111111112, 2.323025358851675, 1.3319775828460039, 0.0, 17.938932291666667, 14.651753411306041, 11.615126794258373, 8.885973333333332, 13.710890740740744, 7.091920370370371, 6.1833253968253965, 4.581614197530865, 6.656111111111112, 5.227557472826088, 2.9189215277777776, 1.3494174731182798, 0.0), # 87 (18.159962533548043, 14.772954440461966, 14.569916538065844, 15.647972509057974, 13.294503752118132, 6.400818084133517, 6.157861534737352, 5.043538408779149, 6.843145438957476, 2.952041955942871, 2.31475902002481, 1.328594505811855, 0.0, 17.912082368827164, 14.614539563930402, 11.573795100124048, 8.856125867828611, 13.686290877914953, 7.06095377229081, 6.157861534737352, 4.572012917238227, 6.647251876059066, 5.215990836352659, 2.913983307613169, 1.3429958582238153, 0.0), # 88 (18.11484133118626, 14.701893498606132, 14.544889017489714, 15.612678034420288, 13.276204308884047, 6.387026771833563, 6.132254089290037, 5.0216498628257895, 6.830701474622771, 2.942064449285888, 2.3063519050150636, 1.3251715760594904, 0.0, 17.884375964506173, 14.576887336654393, 11.531759525075316, 8.826193347857663, 13.661402949245542, 7.0303098079561055, 6.132254089290037, 4.562161979881116, 6.638102154442024, 5.2042260114734304, 2.908977803497943, 1.3365357726005578, 0.0), # 89 (18.068478260869565, 14.630443548387097, 14.519531250000002, 15.576817255434786, 13.257352941176471, 6.372916666666668, 6.106512605042017, 5.0, 6.818125, 2.9320588235294123, 2.2978169856459334, 1.3217105263157898, 0.0, 17.855859375, 14.538815789473684, 11.489084928229666, 8.796176470588236, 13.63625, 7.0, 6.106512605042017, 4.552083333333334, 6.6286764705882355, 5.192272418478263, 2.903906250000001, 1.3300403225806454, 0.0), # 90 (18.020955770263015, 14.558638759458383, 14.493849408436214, 15.540418432971018, 13.237978697651899, 6.35851849565615, 6.0806466265518555, 4.978597050754459, 6.80542753772291, 2.922025311062697, 2.2891672337409186, 1.3182130893076314, 0.0, 17.826578896604936, 14.500343982383942, 11.445836168704592, 8.76607593318809, 13.61085507544582, 6.9700358710562424, 6.0806466265518555, 4.541798925468679, 6.6189893488259495, 5.180139477657007, 2.898769881687243, 1.3235126144962168, 0.0), # 91 (17.97235630703167, 14.486513301473519, 14.467849665637862, 15.50350982789855, 13.218110626966835, 6.343862985825332, 6.054665698378118, 4.957449245541839, 6.7926206104252405, 2.9119641442749944, 2.2804156211235163, 1.3146809977618947, 0.0, 17.796580825617283, 14.46149097538084, 11.40207810561758, 8.735892432824983, 13.585241220850481, 6.940428943758574, 6.054665698378118, 4.531330704160951, 6.609055313483418, 5.167836609299518, 2.8935699331275724, 1.3169557546794108, 0.0), # 92 (17.92276231884058, 14.414101344086022, 14.441538194444446, 15.46611970108696, 13.197777777777777, 6.328980864197531, 6.0285793650793655, 4.936564814814815, 6.779715740740741, 2.9018755555555558, 2.2715751196172254, 1.3111159844054583, 0.0, 17.76591145833333, 14.422275828460037, 11.357875598086125, 8.705626666666666, 13.559431481481482, 6.911190740740742, 6.0285793650793655, 4.520700617283951, 6.598888888888888, 5.155373233695654, 2.888307638888889, 1.3103728494623659, 0.0), # 93 (17.872256253354806, 14.341437056949422, 14.414921167695475, 15.428276313405796, 13.177009198741224, 6.313902857796068, 6.002397171214165, 4.915951989026064, 6.766724451303155, 2.891759777293634, 2.2626587010455435, 1.3075197819652014, 0.0, 17.734617091049383, 14.382717601617212, 11.313293505227715, 8.675279331880901, 13.53344890260631, 6.88233278463649, 6.002397171214165, 4.509930612711477, 6.588504599370612, 5.1427587711352665, 2.882984233539095, 1.3037670051772203, 0.0), # 94 (17.820920558239397, 14.268554609717246, 14.388004758230455, 15.390007925724635, 13.155833938513677, 6.298659693644262, 5.97612866134108, 4.895618998628259, 6.753658264746228, 2.88161704187848, 2.253679337231969, 1.3038941231680024, 0.0, 17.70274402006173, 14.342835354848022, 11.268396686159845, 8.644851125635439, 13.507316529492456, 6.853866598079563, 5.97612866134108, 4.49904263831733, 6.577916969256838, 5.130002641908213, 2.8776009516460914, 1.2971413281561135, 0.0), # 95 (17.76883768115942, 14.195488172043014, 14.360795138888891, 15.351342798913045, 13.134281045751635, 6.283282098765432, 5.9497833800186735, 4.875574074074075, 6.740528703703703, 2.8714475816993468, 2.2446500000000005, 1.300240740740741, 0.0, 17.67033854166667, 14.30264814814815, 11.22325, 8.614342745098039, 13.481057407407405, 6.825803703703705, 5.9497833800186735, 4.488058641975309, 6.5671405228758175, 5.117114266304349, 2.8721590277777787, 1.2904989247311833, 0.0), # 96 (17.716090069779927, 14.12227191358025, 14.333298482510289, 15.31230919384058, 13.112379569111596, 6.267800800182899, 5.9233708718055125, 4.855825445816188, 6.727347290809328, 2.8612516291454857, 2.235583661173135, 1.2965613674102956, 0.0, 17.637446952160495, 14.262175041513249, 11.177918305865674, 8.583754887436456, 13.454694581618655, 6.798155624142662, 5.9233708718055125, 4.477000571559214, 6.556189784555798, 5.104103064613527, 2.8666596965020577, 1.2838429012345685, 0.0), # 97 (17.66276017176597, 14.048940003982477, 14.305520961934155, 15.27293537137681, 13.090158557250064, 6.252246524919983, 5.896900681260158, 4.83638134430727, 6.714125548696844, 2.851029416606149, 2.226493292574872, 1.2928577359035447, 0.0, 17.604115547839505, 14.22143509493899, 11.13246646287436, 8.553088249818446, 13.428251097393687, 6.770933882030178, 5.896900681260158, 4.465890374942845, 6.545079278625032, 5.090978457125605, 2.8611041923868314, 1.277176363998407, 0.0), # 98 (17.608930434782607, 13.975526612903225, 14.277468750000002, 15.233249592391303, 13.067647058823532, 6.23665, 5.870382352941177, 4.8172500000000005, 6.700875, 2.8407811764705886, 2.2173918660287084, 1.2891315789473687, 0.0, 17.570390625, 14.180447368421053, 11.086959330143541, 8.522343529411764, 13.40175, 6.744150000000001, 5.870382352941177, 4.45475, 6.533823529411766, 5.0777498641304355, 2.8554937500000004, 1.2705024193548389, 0.0), # 99 (17.5546833064949, 13.902065909996015, 14.249148019547325, 15.193280117753623, 13.044874122488501, 6.2210419524462734, 5.843825431407131, 4.798439643347051, 6.687607167352539, 2.8305071411280567, 2.2082923533581433, 1.285384629268645, 0.0, 17.536318479938274, 14.139230921955095, 11.041461766790714, 8.49152142338417, 13.375214334705078, 6.717815500685871, 5.843825431407131, 4.443601394604481, 6.522437061244251, 5.064426705917875, 2.8498296039094653, 1.2638241736360014, 0.0), # 100 (17.500101234567904, 13.828592064914377, 14.22056494341564, 15.153055208333335, 13.021868796901476, 6.205453109282122, 5.817239461216586, 4.7799585048010975, 6.674333573388203, 2.820207542967805, 2.1992077263866743, 1.281618619594253, 0.0, 17.501945408950615, 14.097804815536781, 10.99603863193337, 8.460622628903414, 13.348667146776407, 6.691941906721536, 5.817239461216586, 4.432466506630087, 6.510934398450738, 5.051018402777779, 2.8441129886831282, 1.2571447331740344, 0.0), # 101 (17.44526666666667, 13.755139247311828, 14.191725694444445, 15.112603125, 12.998660130718955, 6.189914197530865, 5.790633986928105, 4.761814814814815, 6.66106574074074, 2.809882614379086, 2.1901509569377993, 1.2778352826510724, 0.0, 17.467317708333336, 14.056188109161795, 10.950754784688995, 8.429647843137257, 13.32213148148148, 6.666540740740741, 5.790633986928105, 4.421367283950618, 6.499330065359477, 5.037534375000001, 2.838345138888889, 1.2504672043010754, 0.0), # 102 (17.390262050456254, 13.681741626841896, 14.16263644547325, 15.071952128623188, 12.975277172597433, 6.174455944215821, 5.764018553100253, 4.7440168038408785, 6.647815192043895, 2.7995325877511505, 2.181135016835017, 1.2740363511659811, 0.0, 17.432481674382714, 14.014399862825789, 10.905675084175085, 8.39859776325345, 13.29563038408779, 6.64162352537723, 5.764018553100253, 4.410325674439872, 6.487638586298717, 5.023984042874397, 2.8325272890946502, 1.2437946933492634, 0.0), # 103 (17.335169833601718, 13.608433373158105, 14.133303369341563, 15.031130480072465, 12.951748971193414, 6.159109076360311, 5.737402704291593, 4.7265727023319615, 6.634593449931413, 2.7891576954732518, 2.1721728779018252, 1.2702235578658583, 0.0, 17.397483603395063, 13.972459136524439, 10.860864389509127, 8.367473086419754, 13.269186899862826, 6.617201783264746, 5.737402704291593, 4.399363625971651, 6.475874485596707, 5.010376826690822, 2.826660673868313, 1.237130306650737, 0.0), # 104 (17.280072463768114, 13.535248655913978, 14.103732638888891, 14.99016644021739, 12.928104575163397, 6.143904320987655, 5.710795985060692, 4.709490740740741, 6.621412037037037, 2.7787581699346413, 2.1632775119617227, 1.2663986354775831, 0.0, 17.362369791666666, 13.930384990253412, 10.816387559808613, 8.336274509803923, 13.242824074074074, 6.5932870370370384, 5.710795985060692, 4.388503086419754, 6.464052287581699, 4.996722146739131, 2.820746527777778, 1.2304771505376346, 0.0), # 105 (17.225052388620504, 13.462221644763043, 14.073930426954732, 14.949088269927536, 12.904373033163882, 6.128872405121171, 5.68420793996611, 4.6927791495198905, 6.608282475994512, 2.7683342435245706, 2.1544618908382067, 1.2625633167280343, 0.0, 17.327186535493826, 13.888196484008375, 10.772309454191033, 8.30500273057371, 13.216564951989024, 6.5698908093278465, 5.68420793996611, 4.377766003657979, 6.452186516581941, 4.98302942330918, 2.8147860853909465, 1.223838331342095, 0.0), # 106 (17.17019205582394, 13.389386509358822, 14.043902906378605, 14.907924230072464, 12.880583393851367, 6.114044055784181, 5.657648113566415, 4.6764461591220865, 6.595216289437586, 2.7578861486322928, 2.145738986354776, 1.2587193343440908, 0.0, 17.29198013117284, 13.845912677784996, 10.728694931773878, 8.273658445896878, 13.190432578875171, 6.547024622770921, 5.657648113566415, 4.367174325560129, 6.440291696925684, 4.969308076690822, 2.808780581275721, 1.2172169553962566, 0.0), # 107 (17.11557391304348, 13.31677741935484, 14.013656250000002, 14.866702581521741, 12.856764705882352, 6.099450000000001, 5.631126050420168, 4.660500000000001, 6.582225000000001, 2.7474141176470597, 2.1371217703349283, 1.2548684210526317, 0.0, 17.256796875000003, 13.803552631578947, 10.685608851674642, 8.242242352941178, 13.164450000000002, 6.524700000000001, 5.631126050420168, 4.356750000000001, 6.428382352941176, 4.955567527173915, 2.8027312500000003, 1.2106161290322583, 0.0), # 108 (17.061280407944178, 13.24442854440462, 13.983196630658439, 14.825451585144926, 12.832946017913338, 6.085120964791952, 5.604651295085936, 4.644948902606311, 6.569320130315501, 2.736918382958122, 2.1286232146021624, 1.2510123095805359, 0.0, 17.221683063271605, 13.761135405385891, 10.64311607301081, 8.210755148874364, 13.138640260631002, 6.502928463648835, 5.604651295085936, 4.346514974851394, 6.416473008956669, 4.941817195048309, 2.796639326131688, 1.2040389585822384, 0.0), # 109 (17.007393988191087, 13.17237405416169, 13.95253022119342, 14.784199501811596, 12.809156378600825, 6.071087677183356, 5.57823339212228, 4.62980109739369, 6.556513203017833, 2.726399176954733, 2.120256290979975, 1.2471527326546823, 0.0, 17.18668499228395, 13.718680059201501, 10.601281454899876, 8.179197530864197, 13.113026406035665, 6.4817215363511655, 5.57823339212228, 4.336491197988112, 6.404578189300413, 4.928066500603866, 2.790506044238684, 1.1974885503783357, 0.0), # 110 (16.953997101449275, 13.10064811827957, 13.921663194444447, 14.742974592391306, 12.785424836601308, 6.0573808641975315, 5.551881886087768, 4.615064814814815, 6.543815740740741, 2.715856732026144, 2.1120339712918663, 1.2432914230019496, 0.0, 17.151848958333336, 13.676205653021444, 10.56016985645933, 8.147570196078432, 13.087631481481482, 6.461090740740741, 5.551881886087768, 4.326700617283951, 6.392712418300654, 4.914324864130436, 2.78433263888889, 1.1909680107526885, 0.0), # 111 (16.90117219538379, 13.029284906411787, 13.890601723251033, 14.701805117753622, 12.76178044057129, 6.044031252857797, 5.5256063215409625, 4.60074828532236, 6.531239266117969, 2.7052912805616076, 2.103969227361333, 1.2394301133492167, 0.0, 17.11722125771605, 13.633731246841382, 10.519846136806663, 8.115873841684822, 13.062478532235938, 6.441047599451304, 5.5256063215409625, 4.3171651806127125, 6.380890220285645, 4.900601705917875, 2.778120344650207, 1.1844804460374354, 0.0), # 112 (16.84890760266548, 12.958437720996821, 13.859426742378105, 14.660775741364255, 12.738210816208445, 6.03106325767524, 5.499473367291093, 4.586889426585454, 6.518827686755172, 2.694737131475729, 2.0960771718458604, 1.2355789404756645, 0.0, 17.0827990215178, 13.591368345232306, 10.480385859229301, 8.084211394427186, 13.037655373510344, 6.421645197219636, 5.499473367291093, 4.307902326910885, 6.369105408104223, 4.886925247121419, 2.7718853484756214, 1.178039792817893, 0.0), # 113 (16.796665616220118, 12.888805352817133, 13.828568512532428, 14.620215718724406, 12.71447202547959, 6.018447338956397, 5.473816387569522, 4.57365844462884, 6.506771421427836, 2.684391825560753, 2.0883733011339594, 1.2317868258169462, 0.0, 17.048295745488062, 13.549655083986407, 10.441866505669795, 8.053175476682258, 13.013542842855673, 6.403121822480377, 5.473816387569522, 4.298890956397426, 6.357236012739795, 4.873405239574803, 2.7657137025064857, 1.1717095775288306, 0.0), # 114 (16.744292825407193, 12.820412877827026, 13.798045399060976, 14.580114081995404, 12.690489213466321, 6.006150688123703, 5.448653685172405, 4.561051990709032, 6.495074987201274, 2.674271397594635, 2.0808463534281283, 1.2280556373838278, 0.0, 17.013611936988678, 13.508612011222104, 10.404231767140642, 8.022814192783905, 12.990149974402549, 6.385472786992645, 5.448653685172405, 4.290107634374073, 6.345244606733161, 4.860038027331802, 2.7596090798121957, 1.165492079802457, 0.0), # 115 (16.691723771827743, 12.753160664131308, 13.767798284975811, 14.540399302859647, 12.666226231660534, 5.994144321151453, 5.423944335775104, 4.549035234674245, 6.483708803536698, 2.6643570113022967, 2.0734817793814444, 1.224378479623102, 0.0, 16.978693067560602, 13.46816327585412, 10.367408896907222, 7.9930710339068884, 12.967417607073395, 6.368649328543944, 5.423944335775104, 4.281531657965324, 6.333113115830267, 4.846799767619883, 2.7535596569951624, 1.1593782421937553, 0.0), # 116 (16.63889299708279, 12.686949079834788, 13.73776805328898, 14.50099985299953, 12.641646931554131, 5.982399254013936, 5.399647415052978, 4.537573346372689, 6.472643289895322, 2.6546298304086586, 2.0662650296469853, 1.2207484569815625, 0.0, 16.943484608744804, 13.428233026797187, 10.331325148234924, 7.963889491225975, 12.945286579790643, 6.352602684921765, 5.399647415052978, 4.2731423242956685, 6.320823465777066, 4.833666617666511, 2.747553610657796, 1.1533590072577082, 0.0), # 117 (16.58573504277338, 12.621678493042284, 13.707895587012551, 14.461844204097451, 12.616715164639011, 5.970886502685445, 5.375721998681383, 4.526631495652572, 6.461848865738361, 2.6450710186386424, 2.0591815548778274, 1.2171586739060027, 0.0, 16.907932032082243, 13.388745412966028, 10.295907774389137, 7.935213055915925, 12.923697731476722, 6.337284093913602, 5.375721998681383, 4.264918930489604, 6.3083575823195055, 4.820614734699151, 2.74157911740251, 1.1474253175492988, 0.0), # 118 (16.532184450500534, 12.557249271858602, 13.678121769158587, 14.422860827835802, 12.591394782407065, 5.9595770831402755, 5.35212716233568, 4.516174852362109, 6.451295950527026, 2.6356617397171678, 2.0522168057270487, 1.2136022348432152, 0.0, 16.87198080911388, 13.349624583275366, 10.261084028635242, 7.906985219151502, 12.902591901054052, 6.322644793306953, 5.35212716233568, 4.256840773671625, 6.295697391203532, 4.807620275945268, 2.7356243538317178, 1.1415681156235096, 0.0), # 119 (16.47817576186529, 12.49356178438856, 13.648387482739144, 14.383978195896983, 12.565649636350196, 5.948442011352714, 5.3288219816912274, 4.506168586349507, 6.440954963722534, 2.626383157369158, 2.045356232847725, 1.2100722442399947, 0.0, 16.835576411380675, 13.31079468663994, 10.226781164238623, 7.879149472107472, 12.881909927445069, 6.308636020889311, 5.3288219816912274, 4.248887150966224, 6.282824818175098, 4.794659398632328, 2.7296774965478288, 1.1357783440353237, 0.0), # 120 (16.423643518468683, 12.430516398736968, 13.618633610766281, 14.345124779963385, 12.539443577960302, 5.937452303297058, 5.305765532423383, 4.49657786746298, 6.430796324786099, 2.6172164353195337, 2.038585286892935, 1.2065618065431336, 0.0, 16.79866431042359, 13.272179871974467, 10.192926434464676, 7.8516493059586, 12.861592649572199, 6.295209014448172, 5.305765532423383, 4.2410373594978985, 6.269721788980151, 4.781708259987796, 2.7237267221532564, 1.1300469453397246, 0.0), # 121 (16.36852226191174, 12.368013483008635, 13.588801036252066, 14.306229051717406, 12.51274045872928, 5.926578974947596, 5.282916890207506, 4.487367865550737, 6.420790453178933, 2.6081427372932153, 2.0318894185157554, 1.2030640261994254, 0.0, 16.761189977783587, 13.233704288193676, 10.159447092578777, 7.824428211879645, 12.841580906357866, 6.282315011771032, 5.282916890207506, 4.2332706963911395, 6.25637022936464, 4.768743017239136, 2.7177602072504135, 1.1243648620916942, 0.0), # 122 (16.312746533795494, 12.305953405308378, 13.558830642208555, 14.267219482841437, 12.485504130149028, 5.915793042278621, 5.260235130718955, 4.478503750460988, 6.410907768362252, 2.5991432270151247, 2.0252540783692634, 1.1995720076556633, 0.0, 16.72309888500163, 13.195292084212294, 10.126270391846315, 7.797429681045372, 12.821815536724504, 6.269905250645383, 5.260235130718955, 4.225566458770444, 6.242752065074514, 4.755739827613813, 2.711766128441711, 1.1187230368462162, 0.0), # 123 (16.256250875720976, 12.244236533741004, 13.528663311647806, 14.228024545017881, 12.457698443711445, 5.905065521264426, 5.237679329633088, 4.469950692041945, 6.401118689797269, 2.590199068210183, 2.018664717106536, 1.1960788553586414, 0.0, 16.68433650361868, 13.156867408945052, 10.09332358553268, 7.770597204630548, 12.802237379594539, 6.257930968858723, 5.237679329633088, 4.217903943760304, 6.2288492218557225, 4.742674848339295, 2.7057326623295617, 1.1131124121582732, 0.0), # 124 (16.198969829289226, 12.18276323641133, 13.498239927581887, 14.188572709929128, 12.429287250908427, 5.894367427879304, 5.215208562625265, 4.461673860141818, 6.391393636945196, 2.5812914246033105, 2.012106785380651, 1.1925776737551523, 0.0, 16.644848305175692, 13.118354411306674, 10.060533926903252, 7.74387427380993, 12.782787273890392, 6.246343404198546, 5.215208562625265, 4.210262448485217, 6.2146436254542134, 4.7295242366430434, 2.6996479855163775, 1.1075239305828484, 0.0), # 125 (16.14083793610127, 12.121433881424165, 13.46750137302285, 14.148792449257574, 12.400234403231872, 5.883669778097547, 5.192781905370843, 4.453638424608819, 6.381703029267251, 2.57240145991943, 2.005565733844684, 1.1890615672919902, 0.0, 16.604579761213643, 13.079677240211891, 10.02782866922342, 7.717204379758288, 12.763406058534501, 6.235093794452347, 5.192781905370843, 4.202621270069677, 6.200117201615936, 4.716264149752526, 2.69350027460457, 1.1019485346749243, 0.0), # 126 (16.08178973775815, 12.06014883688432, 13.436388530982757, 14.108612234685616, 12.370503752173677, 5.872943587893444, 5.170358433545185, 4.445809555291159, 6.3720172862246445, 2.563510337883461, 1.9990270131517138, 1.1855236404159475, 0.0, 16.56347634327348, 13.040760044575421, 9.99513506575857, 7.690531013650382, 12.744034572449289, 6.224133377407623, 5.170358433545185, 4.194959705638174, 6.185251876086839, 4.702870744895206, 2.6872777061965514, 1.0963771669894837, 0.0), # 127 (16.021759775860883, 11.998808470896611, 13.404842284473675, 14.06796053789565, 12.340059149225747, 5.862159873241292, 5.147897222823644, 4.438152422037048, 6.362306827278591, 2.554599222220326, 1.9924760739548175, 1.1819569975738184, 0.0, 16.521483522896165, 13.001526973312, 9.962380369774086, 7.663797666660978, 12.724613654557182, 6.2134133908518665, 5.147897222823644, 4.187257052315209, 6.170029574612873, 4.689320179298551, 2.680968456894735, 1.0908007700815103, 0.0), # 128 (15.960682592010507, 11.937313151565847, 13.37280351650766, 14.026765830570064, 12.308864445879973, 5.85128965011538, 5.125357348881582, 4.430632194694696, 6.352542071890305, 2.5456492766549457, 1.9858983669070716, 1.1783547432123955, 0.0, 16.478546771622668, 12.96190217533635, 9.929491834535357, 7.636947829964836, 12.70508414378061, 6.202885072572574, 5.125357348881582, 4.179492607225272, 6.154432222939986, 4.675588610190022, 2.6745607033015326, 1.0852102865059863, 0.0), # 129 (15.89849272780806, 11.875563246996844, 13.34021311009677, 13.984956584391266, 12.276883493628256, 5.840303934489999, 5.102697887394356, 4.423214043112313, 6.342693439521001, 2.536641664912241, 1.9792793426615536, 1.174709981778473, 0.0, 16.434611560993947, 12.921809799563201, 9.896396713307768, 7.609924994736723, 12.685386879042001, 6.192499660357238, 5.102697887394356, 4.171645667492856, 6.138441746814128, 4.66165219479709, 2.668042622019354, 1.0795966588178951, 0.0), # 130 (15.83512472485457, 11.81345912529441, 13.307011948253072, 13.942461271041642, 12.244080143962494, 5.829173742339445, 5.079877914037328, 4.415863137138113, 6.332731349631892, 2.527557550717134, 1.9726044518713404, 1.1710158177188439, 0.0, 16.38962336255096, 12.88117399490728, 9.863022259356702, 7.5826726521514, 12.665462699263784, 6.182208391993358, 5.079877914037328, 4.16369553024246, 6.122040071981247, 4.647487090347215, 2.6614023896506143, 1.073950829572219, 0.0), # 131 (15.770513124751067, 11.750901154563357, 13.27314091398862, 13.899208362203591, 12.210418248374584, 5.817870089638008, 5.056856504485853, 4.408544646620305, 6.322626221684192, 2.5183780977945447, 1.9658591451895095, 1.1672653554803014, 0.0, 16.343527647834676, 12.839918910283313, 9.829295725947548, 7.555134293383633, 12.645252443368385, 6.171962505268427, 5.056856504485853, 4.155621492598577, 6.105209124187292, 4.633069454067865, 2.654628182797724, 1.0682637413239418, 0.0), # 132 (15.704592469098595, 11.687789702908498, 13.238540890315475, 13.855126329559509, 12.175861658356425, 5.80636399235998, 5.03359273441529, 4.4012237414071, 6.312348475139116, 2.509084469869395, 1.9590288732691383, 1.1634516995096391, 0.0, 16.296269888386057, 12.797968694606027, 9.795144366345692, 7.527253409608184, 12.624696950278231, 6.1617132379699395, 5.03359273441529, 4.1474028516857, 6.087930829178212, 4.618375443186504, 2.647708178063095, 1.0625263366280455, 0.0), # 133 (15.63729729949817, 11.624025138434646, 13.203152760245707, 13.81014364479179, 12.14037422539991, 5.794626466479654, 5.010045679501001, 4.3938655913467075, 6.301868529457877, 2.499657830666606, 1.952099086763304, 1.1595679542536501, 0.0, 16.24779555574605, 12.755247496790147, 9.76049543381652, 7.498973491999817, 12.603737058915755, 6.151411827885391, 5.010045679501001, 4.139018904628324, 6.070187112699955, 4.6033812149305975, 2.6406305520491418, 1.0567295580395135, 0.0), # 134 (15.568562157550836, 11.559507829246614, 13.166917406791363, 13.764188779582833, 12.103919800996945, 5.7826285279713225, 4.986174415418341, 4.3864353662873405, 6.291156804101687, 2.4900793439110998, 1.945055236325083, 1.155607224159128, 0.0, 16.198050121455637, 12.711679465750406, 9.725276181625414, 7.470238031733298, 12.582313608203375, 6.141009512802277, 4.986174415418341, 4.130448948550945, 6.051959900498472, 4.588062926527612, 2.633383481358273, 1.0508643481133288, 0.0), # 135 (15.498321584857623, 11.494138143449213, 13.129775712964513, 13.717190205615022, 12.066462236639419, 5.770341192809277, 4.961938017842671, 4.378898236077208, 6.280183718531764, 2.4803301733277956, 1.9378827726075534, 1.1515626136728663, 0.0, 16.146979057055766, 12.667188750401527, 9.689413863037766, 7.4409905199833855, 12.560367437063528, 6.130457530508091, 4.961938017842671, 4.121672280578055, 6.033231118319709, 4.572396735205008, 2.6259551425929026, 1.044921649404474, 0.0), # 136 (15.426510123019561, 11.427816449147253, 13.091668561777217, 13.66907639457077, 12.02796538381924, 5.757735476967808, 4.93729556244935, 4.371219370564522, 6.2689196922093195, 2.4703914826416162, 1.930567146263792, 1.1474272272416581, 0.0, 16.094527834087398, 12.621699499658236, 9.652835731318959, 7.411174447924847, 12.537839384418639, 6.119707118790331, 4.93729556244935, 4.112668197834148, 6.01398269190962, 4.556358798190257, 2.6183337123554433, 1.0388924044679322, 0.0), # 137 (15.353062313637686, 11.360443114445548, 13.052536836241526, 13.619775818132457, 11.988393094028304, 5.744782396421213, 4.912206124913734, 4.363363939597493, 6.257335144595569, 2.4602444355774815, 1.9230938079468758, 1.143194169312297, 0.0, 16.040641924091503, 12.575135862435264, 9.615469039734378, 7.380733306732443, 12.514670289191137, 6.10870951543649, 4.912206124913734, 4.103415997443723, 5.994196547014152, 4.5399252727108195, 2.6105073672483052, 1.0327675558586864, 0.0), # 138 (15.277912698313022, 11.29191850744891, 13.01232141936951, 13.569216947982484, 11.947709218758497, 5.731452967143778, 4.886628780911184, 4.355297113024331, 6.245400495151722, 2.449870195860314, 1.9154482083098823, 1.1388565443315761, 0.0, 15.985266798609034, 12.527421987647335, 9.577241041549412, 7.3496105875809405, 12.490800990303445, 6.0974159582340635, 4.886628780911184, 4.093894976531271, 5.973854609379249, 4.523072315994162, 2.602464283873902, 1.0265380461317193, 0.0), # 139 (15.200995818646616, 11.22214299626215, 12.970963194173232, 13.51732825580325, 11.905877609501736, 5.717718205109798, 4.860522606117057, 4.346984060693248, 6.233086163338999, 2.439249927215034, 1.9076157980058883, 1.134407456746289, 0.0, 15.928347929180966, 12.478482024209175, 9.538078990029442, 7.3177497816451, 12.466172326677999, 6.085777684970546, 4.860522606117057, 4.084084432221284, 5.952938804750868, 4.505776085267751, 2.5941926388346466, 1.020194817842014, 0.0), # 140 (15.122246216239494, 11.151016948990085, 12.92840304366474, 13.464038213277146, 11.862862117749902, 5.7035491262935665, 4.833846676206716, 4.338389952452453, 6.220362568618608, 2.4283647933665637, 1.8995820276879718, 1.129840011003229, 0.0, 15.869830787348244, 12.428240121035515, 9.497910138439858, 7.2850943800996895, 12.440725137237216, 6.073745933433434, 4.833846676206716, 4.0739636616382615, 5.931431058874951, 4.48801273775905, 2.5856806087329485, 1.0137288135445532, 0.0), # 141 (15.041598432692682, 11.07844073373752, 12.884581850856106, 13.409275292086573, 11.818626594994903, 5.688916746669374, 4.806560066855513, 4.329479958150158, 6.207200130451765, 2.417195958039823, 1.8913323480092095, 1.1251473115491895, 0.0, 15.80966084465184, 12.37662042704108, 9.456661740046046, 7.251587874119467, 12.41440026090353, 6.061271941410222, 4.806560066855513, 4.063511961906696, 5.909313297497452, 4.469758430695525, 2.5769163701712214, 1.00713097579432, 0.0), # 142 (14.958987009607215, 11.004314718609267, 12.839440498759389, 13.352967963913915, 11.773134892728635, 5.673792082211512, 4.778621853738811, 4.320219247634575, 6.1935692682996875, 2.405724584959734, 1.8828522096226783, 1.1203224628309636, 0.0, 15.747783572632711, 12.323547091140597, 9.41426104811339, 7.217173754879202, 12.387138536599375, 6.048306946688404, 4.778621853738811, 4.05270863015108, 5.886567446364317, 4.45098932130464, 2.5678880997518783, 1.0003922471462972, 0.0), # 143 (14.874346488584132, 10.928539271710147, 12.792919870386642, 13.29504470044158, 11.726350862442994, 5.658146148894274, 4.749991112531969, 4.310572990753912, 6.1794404016235855, 2.3939318378512175, 1.8741270631814555, 1.115358569295345, 0.0, 15.684144442831826, 12.268944262248793, 9.370635315907277, 7.181795513553651, 12.358880803247171, 6.034802187055478, 4.749991112531969, 4.04153296349591, 5.863175431221497, 4.431681566813861, 2.5585839740773286, 0.993503570155468, 0.0), # 144 (14.787611411224459, 10.851014761144963, 12.744960848749933, 13.235433973351956, 11.67823835562988, 5.641949962691953, 4.7206269189103445, 4.300506357356382, 6.164783949884672, 2.381798880439195, 1.865142359338619, 1.110248735389127, 0.0, 15.618688926790139, 12.212736089280396, 9.325711796693094, 7.145396641317584, 12.329567899769344, 6.020708900298935, 4.7206269189103445, 4.029964259065681, 5.83911917781494, 4.411811324450653, 2.548992169749987, 0.986455887376815, 0.0), # 145 (14.69871631912923, 10.771641555018533, 12.695504316861326, 13.174064254327444, 11.62876122378119, 5.62517453957884, 4.690488348549297, 4.289984517290195, 6.1495703325441635, 2.3693068764485874, 1.8558835487472447, 1.104986065559103, 0.0, 15.551362496048613, 12.154846721150133, 9.279417743736223, 7.107920629345761, 12.299140665088327, 6.005978324206273, 4.690488348549297, 4.0179818139848855, 5.814380611890595, 4.391354751442482, 2.539100863372265, 0.9792401413653213, 0.0), # 146 (14.607595753899481, 10.690320021435666, 12.644491157732865, 13.110864015050435, 11.577883318388821, 5.607790895529226, 4.659534477124183, 4.278972640403562, 6.133769969063274, 2.3564369896043162, 1.846336082060411, 1.0995636642520668, 0.0, 15.482110622148213, 12.095200306772732, 9.231680410302054, 7.069310968812948, 12.267539938126548, 5.990561696564987, 4.659534477124183, 4.005564925378019, 5.7889416591944105, 4.370288005016812, 2.5288982315465733, 0.9718472746759697, 0.0), # 147 (14.51418425713624, 10.606950528501175, 12.591862254376625, 13.045761727203324, 11.525568490944673, 5.5897700465174065, 4.627724380310364, 4.2674358965446935, 6.1173532789032175, 2.3431703836313016, 1.836485409931195, 1.0939746359148106, 0.0, 15.410878776629895, 12.033720995062914, 9.182427049655974, 7.029511150893903, 12.234706557806435, 5.974410255162571, 4.627724380310364, 3.9926928903695758, 5.762784245472337, 4.348587242401109, 2.5183724508753254, 0.9642682298637433, 0.0), # 148 (14.418416370440541, 10.52143344431987, 12.537558489804665, 12.97868586246851, 11.471780592940643, 5.57108300851767, 4.595017133783196, 4.255339455561801, 6.100290681525203, 2.3294882222544664, 1.8263169830126733, 1.0882120849941288, 0.0, 15.337612431034628, 11.970332934935415, 9.131584915063366, 6.988464666763398, 12.200581363050405, 5.957475237786521, 4.595017133783196, 3.9793450060840496, 5.735890296470322, 4.326228620822837, 2.507511697960933, 0.9564939494836247, 0.0), # 149 (14.320226635413416, 10.433669136996565, 12.481520747029043, 12.909564892528387, 11.416483475868631, 5.551700797504312, 4.561371813218041, 4.242648487303093, 6.0825525963904505, 2.31537166919873, 1.815816251957923, 1.0822691159368145, 0.0, 15.262257056903364, 11.904960275304958, 9.079081259789614, 6.946115007596189, 12.165105192780901, 5.93970788222433, 4.561371813218041, 3.9655005696459367, 5.7082417379343156, 4.303188297509463, 2.4963041494058085, 0.948515376090597, 0.0), # 150 (14.219549593655895, 10.343557974636072, 12.423689909061814, 12.838327289065347, 11.359640991220532, 5.531594429451621, 4.526747494290255, 4.229328161616783, 6.064109442960174, 2.3008018881890155, 1.8049686674200216, 1.0761388331896609, 0.0, 15.184758125777073, 11.837527165086268, 9.024843337100108, 6.902405664567045, 12.128218885920347, 5.921059426263496, 4.526747494290255, 3.951138878179729, 5.679820495610266, 4.27944242968845, 2.484737981812363, 0.9403234522396431, 0.0), # 151 (14.116319786769019, 10.251000325343204, 12.364006858915053, 12.76490152376179, 11.301216990488243, 5.510734920333892, 4.491103252675198, 4.215343648351081, 6.044931640695582, 2.2857600429502427, 1.7937596800520466, 1.0698143411994616, 0.0, 15.105061109196717, 11.767957753194075, 8.968798400260232, 6.857280128850727, 12.089863281391164, 5.901481107691514, 4.491103252675198, 3.936239228809923, 5.650608495244121, 4.254967174587264, 2.4728013717830106, 0.931909120485746, 0.0), # 152 (14.010471756353809, 10.155896557222773, 12.302412479600802, 12.68921606830011, 11.241175325163667, 5.489093286125417, 4.454398164048228, 4.200660117354197, 6.024989609057894, 2.2702272972073336, 1.782174740507075, 1.0632887444130097, 0.0, 15.02311147870325, 11.696176188543106, 8.910873702535374, 6.810681891622, 12.049979218115787, 5.880924164295876, 4.454398164048228, 3.920780918661012, 5.620587662581833, 4.229738689433371, 2.4604824959201608, 0.9232633233838886, 0.0), # 153 (13.901940044011312, 10.05814703837959, 12.238847654131138, 12.611199394362703, 11.179479846738696, 5.466640542800487, 4.416591304084705, 4.185242738474343, 6.00425376750832, 2.254184814685209, 1.7701992994381837, 1.0565551472770989, 0.0, 14.938854705837642, 11.622106620048086, 8.850996497190918, 6.762554444055626, 12.00850753501664, 5.85933983386408, 4.416591304084705, 3.904743244857491, 5.589739923369348, 4.203733131454236, 2.447769530826228, 0.9143770034890537, 0.0), # 154 (13.790659191342543, 9.957652136918465, 12.173253265518113, 12.530779973631962, 11.116094406705237, 5.443347706333395, 4.377641748459985, 4.169056681559727, 5.982694535508077, 2.23761375910879, 1.7578188074984502, 1.0496066542385225, 0.0, 14.852236262140847, 11.545673196623744, 8.789094037492251, 6.712841277326369, 11.965389071016155, 5.836679354183619, 4.377641748459985, 3.8881055045238533, 5.5580472033526185, 4.176926657877321, 2.4346506531036227, 0.9052411033562243, 0.0), # 155 (13.676563739948545, 9.854312220944214, 12.10557019677379, 12.447886277790282, 11.050982856555176, 5.419185792698435, 4.33750857284943, 4.152067116458564, 5.960282332518376, 2.220495294202998, 1.7450187153409518, 1.0424363697440735, 0.0, 14.763201619153833, 11.466800067184806, 8.725093576704758, 6.661485882608993, 11.920564665036752, 5.81289396304199, 4.33750857284943, 3.870846994784596, 5.525491428277588, 4.149295425930095, 2.4211140393547583, 0.8958465655403832, 0.0), # 156 (13.559588231430352, 9.748027658561648, 12.035739330910227, 12.362446778520066, 10.984109047780422, 5.394125817869895, 4.296150852928397, 4.134239213019062, 5.9369875780004335, 2.202810583692754, 1.731784473618765, 1.0350373982405456, 0.0, 14.671696248417557, 11.385411380646001, 8.658922368093824, 6.60843175107826, 11.873975156000867, 5.787934898226687, 4.296150852928397, 3.8529470127642105, 5.492054523890211, 4.120815592840023, 2.407147866182046, 0.8861843325965136, 0.0), # 157 (13.43642570352943, 9.636747649274225, 11.960387930853534, 12.27118893522918, 10.912417327045198, 5.366575700132966, 4.252596048835072, 4.1143477142620295, 5.910997254959458, 2.1840146623310153, 1.717678725761683, 1.027139934629151, 0.0, 14.573674546947622, 11.298539280920659, 8.588393628808413, 6.552043986993045, 11.821994509918916, 5.7600867999668415, 4.252596048835072, 3.833268357237833, 5.456208663522599, 4.090396311743061, 2.3920775861707066, 0.8760679681158388, 0.0), # 158 (13.288116180561124, 9.509057777339137, 11.860106727604483, 12.155369164364412, 10.818229571737954, 5.327374130407459, 4.201391487047145, 4.085410149573287, 5.871856356733287, 2.161026447344436, 1.7002250806856987, 1.0172043785524665, 0.0, 14.445769764456351, 11.189248164077128, 8.501125403428492, 6.483079342033307, 11.743712713466573, 5.719574209402602, 4.201391487047145, 3.8052672360053275, 5.409114785868977, 4.051789721454805, 2.372021345520897, 0.8644597979399218, 0.0), # 159 (13.112769770827757, 9.363909602092178, 11.732881436933834, 12.013079639051961, 10.699704157616154, 5.275558360850069, 4.142019373545406, 4.04669939214551, 5.818455136337191, 2.1335425433383026, 1.6791778525828622, 1.0050752923331772, 0.0, 14.285557096008445, 11.055828215664945, 8.39588926291431, 6.400627630014906, 11.636910272674381, 5.665379149003714, 4.142019373545406, 3.7682559720357633, 5.349852078808077, 4.004359879683988, 2.346576287386767, 0.8512645092811072, 0.0), # 160 (12.911799698254727, 9.202249432332774, 11.580070457865464, 11.845672880071582, 10.558071749138534, 5.21175610364883, 4.0749133014061885, 3.9987003998323356, 5.751497860199411, 2.101796186926922, 1.6547224963799123, 0.9908651203361357, 0.0, 14.094673280674375, 10.899516323697492, 8.273612481899562, 6.305388560780765, 11.502995720398822, 5.59818055976527, 4.0749133014061885, 3.722682931177736, 5.279035874569267, 3.9485576266905285, 2.3160140915730927, 0.8365681302120704, 0.0), # 161 (12.686619186767443, 9.025023576860344, 11.403032189423245, 11.654501408203041, 10.394563010763845, 5.1365950709917785, 4.000506863705828, 3.941898130487402, 5.6716887947481816, 2.0660206147246045, 1.6270444670035862, 0.9746863069261941, 0.0, 13.874755057524599, 10.721549376188133, 8.13522233501793, 6.198061844173813, 11.343377589496363, 5.518657382682362, 4.000506863705828, 3.668996479279842, 5.197281505381922, 3.884833802734348, 2.280606437884649, 0.8204566888054858, 0.0), # 162 (12.438641460291295, 8.833178344474314, 11.203125030631053, 11.44091774422611, 10.210408606950825, 5.050702975066952, 3.919233653520661, 3.876777541964344, 5.579732206411743, 2.0264490633456567, 1.5963292193806227, 0.956651296468205, 0.0, 13.627439165629584, 10.523164261150253, 7.9816460969031136, 6.079347190036969, 11.159464412823485, 5.427488558750082, 3.919233653520661, 3.6076449821906795, 5.105204303475412, 3.813639248075371, 2.2406250061262107, 0.8030162131340287, 0.0), # 163 (12.16927974275169, 8.627660043974105, 10.981707380512765, 11.206274408920553, 10.006839202158226, 4.954707528062387, 3.8315272639270197, 3.8038235921168018, 5.476332361618334, 1.9833147694043862, 1.562762208437759, 0.9368725333270206, 0.0, 13.35436234405979, 10.305597866597225, 7.813811042188794, 5.949944308213158, 10.952664723236667, 5.325353028963523, 3.8315272639270197, 3.5390768057588473, 5.003419601079113, 3.735424802973519, 2.1963414761025533, 0.7843327312703733, 0.0), # 164 (11.879947258074031, 8.409414984159142, 10.740137638092254, 10.95192392306614, 9.785085460844787, 4.849236442166116, 3.7378212880012396, 3.7235212387984102, 5.3621935267961875, 1.9368509695151015, 1.5265288891017337, 0.915462461867493, 0.0, 13.057161331885686, 10.070087080542422, 7.632644445508667, 5.810552908545303, 10.724387053592375, 5.2129297343177745, 3.7378212880012396, 3.4637403158329394, 4.892542730422393, 3.6506413076887143, 2.148027527618451, 0.7644922712871949, 0.0), # 165 (11.572057230183715, 8.17938947382885, 10.479774202393392, 10.679218807442627, 9.546378047469258, 4.734917429566179, 3.6385493188196576, 3.636355439862808, 5.2380199683735436, 1.8872909002921108, 1.4878147162992839, 0.8925335264544754, 0.0, 12.737472868177733, 9.817868790999228, 7.4390735814964195, 5.661872700876331, 10.476039936747087, 5.090897615807931, 3.6385493188196576, 3.3820838782615565, 4.773189023734629, 3.5597396024808767, 2.0959548404786785, 0.7435808612571683, 0.0), # 166 (11.24702288300614, 7.938529821782648, 10.201975472440058, 10.389511582829789, 9.291947626490376, 4.6123782024506115, 3.5341449494586072, 3.542811153163632, 5.104515952778639, 1.834867798349722, 1.4468051449571482, 0.8681981714528189, 0.0, 12.396933692006392, 9.550179885981006, 7.23402572478574, 5.504603395049164, 10.209031905557278, 4.959935614429085, 3.5341449494586072, 3.2945558588932937, 4.645973813245188, 3.4631705276099303, 2.040395094488012, 0.7216845292529681, 0.0), # 167 (10.906257440466712, 7.687782336819962, 9.908099847256123, 10.084154770007387, 9.023024862366888, 4.482246473007449, 3.425041772994424, 3.44337333655452, 4.962385746439713, 1.779814900302243, 1.4036856300020644, 0.8425688412273767, 0.0, 12.037180542442131, 9.268257253501142, 7.018428150010321, 5.339444700906728, 9.924771492879426, 4.820722671176328, 3.425041772994424, 3.2016046235767495, 4.511512431183444, 3.361384923335797, 1.9816199694512246, 0.6988893033472693, 0.0), # 168 (10.551174126490828, 7.428093327740216, 9.599505725865463, 9.76450088975519, 8.740840419557543, 4.3451499534247295, 3.3116733825034426, 3.338526947889109, 4.812333615785002, 1.7223654427639818, 1.3586416263607706, 0.8157579801430009, 0.0, 11.659850158555415, 8.97333778157301, 6.793208131803853, 5.167096328291944, 9.624667231570005, 4.673937727044753, 3.3116733825034426, 3.103678538160521, 4.370420209778771, 3.254833629918398, 1.9199011451730927, 0.675281211612747, 0.0), # 169 (10.18318616500389, 7.160409103342831, 9.277551507291953, 9.43190246285296, 8.44662496252108, 4.201716355890488, 3.1944733710619975, 3.228756945021036, 4.655063827242743, 1.6627526623492466, 1.311858588960005, 0.7878780325645439, 0.0, 11.2665792794167, 8.666658358209983, 6.559292944800025, 4.988257987047739, 9.310127654485486, 4.52025972302945, 3.1944733710619975, 3.0012259684932054, 4.22331248126054, 3.1439674876176547, 1.8555103014583907, 0.6509462821220756, 0.0), # 170 (9.8037067799313, 6.88567597242723, 8.943595590559468, 9.087712010080473, 8.141609155716246, 4.052573392592758, 3.0738753317464247, 3.1145482858039375, 4.491280647241173, 1.6012097956723452, 1.2635219727265048, 0.759041442856858, 0.0, 10.859004644096458, 8.349455871425437, 6.317609863632523, 4.803629387017034, 8.982561294482347, 4.360367600125513, 3.0738753317464247, 2.8946952804233987, 4.070804577858123, 3.029237336693492, 1.7887191181118935, 0.6259705429479302, 0.0), # 171 (9.414149195198457, 6.604840243792839, 8.59899637469188, 8.733282052217486, 7.827023663601784, 3.898348775719581, 2.950312857633059, 2.996385928091453, 4.321688342208532, 1.5379700793475863, 1.2138172325870082, 0.7293606553847958, 0.0, 10.438762991665145, 8.022967209232752, 6.069086162935041, 4.613910238042758, 8.643376684417063, 4.194940299328034, 2.950312857633059, 2.7845348397997007, 3.913511831800892, 2.911094017405829, 1.7197992749383764, 0.6004400221629854, 0.0), # 172 (9.015926634730764, 6.31884822623908, 8.245112258713068, 8.369965110043767, 7.504099150636442, 3.739670217458989, 2.824219541798235, 2.874754829737218, 4.146991178573053, 1.4732667499892769, 1.1629298234682535, 0.6989481145132089, 0.0, 10.007491061193234, 7.6884292596452966, 5.8146491173412675, 4.41980024996783, 8.293982357146106, 4.024656761632105, 2.824219541798235, 2.6711930124707064, 3.752049575318221, 2.7899883700145893, 1.6490224517426137, 0.5744407478399164, 0.0), # 173 (8.610452322453618, 6.028646228565374, 7.883301641646902, 7.99911370433908, 7.174066281278959, 3.57716542999902, 2.6960289773182877, 2.7501399485948705, 3.9678934227629785, 1.4073330442117262, 1.1110452002969786, 0.6679162646069503, 0.0, 9.566825591751181, 7.347078910676452, 5.555226001484892, 4.221999132635178, 7.935786845525957, 3.850195928032819, 2.6960289773182877, 2.5551181642850143, 3.5870331406394795, 2.6663712347796937, 1.5766603283293805, 0.5480587480513978, 0.0), # 174 (8.19913948229242, 5.7351805595711465, 7.514922922517262, 7.622080355883197, 6.838155719988082, 3.41146212552771, 2.566174757269552, 2.623026242518047, 3.7850993412065432, 1.3404021986292411, 1.058348817999921, 0.6363775500308723, 0.0, 9.118403322409455, 7.000153050339593, 5.291744089999604, 4.021206595887723, 7.5701986824130865, 3.6722367395252657, 2.566174757269552, 2.4367586610912215, 3.419077859994041, 2.540693451961066, 1.5029845845034526, 0.5213800508701043, 0.0), # 175 (7.783401338172574, 5.43939752805582, 7.141334500348018, 7.240217585455879, 6.497598131222556, 3.2431880162330953, 2.4350904747283635, 2.493898669360387, 3.5993132003319848, 1.2727074498561304, 1.0050261315038191, 0.6044444151498269, 0.0, 8.663860992238513, 6.648888566648095, 5.025130657519095, 3.8181223495683905, 7.1986264006639695, 3.4914581371045417, 2.4350904747283635, 2.3165628687379254, 3.248799065611278, 2.4134058618186267, 1.4282669000696038, 0.49449068436871096, 0.0), # 176 (7.364651114019479, 5.1422434428188195, 6.763894774163046, 6.8548779138368925, 6.1536241794411275, 3.0729708143032117, 2.303209722771056, 2.3632421869755245, 3.411239266567542, 1.2044820345067013, 0.9512625957354108, 0.5722293043286669, 0.0, 8.204835340308824, 6.2945223476153345, 4.756312978677054, 3.6134461035201033, 6.822478533135084, 3.3085390617657344, 2.303209722771056, 2.1949791530737226, 3.0768120897205637, 2.284959304612298, 1.3527789548326095, 0.4674766766198928, 0.0), # 177 (6.944302033758534, 4.8446646126595665, 6.383962142986221, 6.467413861806007, 5.807464529102536, 2.901438231926097, 2.170966094473966, 2.2315417532170994, 3.2215818063414514, 1.1359591891952627, 0.897243665621434, 0.5398446619322442, 0.0, 7.742963105690853, 5.938291281254685, 4.486218328107169, 3.4078775675857873, 6.443163612682903, 3.1241584545039394, 2.170966094473966, 2.072455879947212, 2.903732264551268, 2.1558046206020025, 1.2767924285972443, 0.44042405569632426, 0.0), # 178 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 179 ) passenger_allighting_rate = ( (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 0 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 1 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 2 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 3 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 4 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 5 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 6 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 7 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 8 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 9 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 10 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 11 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 12 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 13 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 14 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 15 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 16 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 17 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 18 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 19 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 20 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 21 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 22 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 23 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 24 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 25 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 26 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 27 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 28 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 29 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 30 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 31 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 32 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 33 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 34 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 35 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 36 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 37 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 38 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 39 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 40 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 41 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 42 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 43 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 44 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 45 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 46 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 47 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 48 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 49 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 50 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 51 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 52 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 53 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 54 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 55 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 56 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 57 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 58 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 59 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 60 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 61 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 62 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 63 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 64 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 65 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 66 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 67 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 68 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 69 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 70 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 71 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 72 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 73 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 74 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 75 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 76 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 77 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 78 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 79 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 80 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 81 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 82 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 83 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 84 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 85 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 86 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 87 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 88 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 89 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 90 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 91 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 92 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 93 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 94 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 95 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 96 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 97 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 98 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 99 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 100 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 101 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 102 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 103 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 104 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 105 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 106 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 107 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 108 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 109 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 110 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 111 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 112 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 113 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 114 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 115 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 116 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 117 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 118 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 119 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 120 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 121 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 122 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 123 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 124 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 125 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 126 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 127 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 128 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 129 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 130 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 131 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 132 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 133 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 134 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 135 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 136 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 137 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 138 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 139 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 140 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 141 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 142 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 143 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 144 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 145 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 146 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 147 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 148 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 149 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 150 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 151 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 152 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 153 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 154 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 155 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 156 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 157 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 158 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 159 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 160 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 161 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 162 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 163 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 164 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 165 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 166 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 167 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 168 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 169 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 170 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 171 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 172 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 173 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 174 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 175 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 176 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 177 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 178 (0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1, 0, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 0.07692307692307693, 1), # 179 ) """ parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html """ #initial entropy entropy = 8991598675325360468762009371570610170 #index for seed sequence child child_seed_index = ( 1, # 0 71, # 1 )
278.366845
490
0.771302
32,987
260,273
6.085367
0.233728
0.35509
0.340743
0.645618
0.366423
0.361187
0.36057
0.36057
0.36057
0.36057
0
0.851065
0.095031
260,273
934
491
278.664882
0.001185
0.015411
0
0.200873
0
0
0
0
0
0
0
0
0
1
0
false
0.005459
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
c068c131e57b1f303cc1518eac8b5ab5859b9cf4
588
py
Python
codewars/8kyu/dinamuh/TotalAmount/test.py
dinamuh/Training_one
d18e8fb12608ce1753162c20252ca928c4df97ab
[ "MIT" ]
null
null
null
codewars/8kyu/dinamuh/TotalAmount/test.py
dinamuh/Training_one
d18e8fb12608ce1753162c20252ca928c4df97ab
[ "MIT" ]
2
2019-01-22T10:53:42.000Z
2019-01-31T08:02:48.000Z
codewars/8kyu/dinamuh/TotalAmount/test.py
dinamuh/Training_one
d18e8fb12608ce1753162c20252ca928c4df97ab
[ "MIT" ]
13
2019-01-22T10:37:42.000Z
2019-01-25T13:30:43.000Z
from main import points def test_points(benchmark): assert benchmark(points, ['1:0', '2:0', '3:0', '4:0', '2:1', '3:1', '4:1', '3:2', '4:2', '4:3']) == 30 assert benchmark(points, ['1:1', '2:2', '3:3', '4:4', '2:2', '3:3', '4:4', '3:3', '4:4', '4:4']) == 10 assert benchmark(points, ['0:1', '0:2', '0:3', '0:4', '1:2', '1:3', '1:4', '2:3', '2:4', '3:4']) == 0 assert benchmark(points, ['1:0', '2:0', '3:0', '4:0', '2:1', '1:3', '1:4', '2:3', '2:4', '3:4']) == 15 assert benchmark(points, ['1:0', '2:0', '3:0', '4:4', '2:2', '3:3', '1:4', '2:3', '2:4', '3:4']) == 12
58.8
106
0.437075
128
588
2
0.132813
0.046875
0.410156
0.34375
0.570313
0.554688
0.492188
0.464844
0.464844
0.429688
0
0.222449
0.166667
588
9
107
65.333333
0.3
0
0
0
0
0
0.255102
0
0
0
0
0
0.714286
1
0.142857
false
0
0.142857
0
0.285714
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
6
fbfb44abccba6a3786c86bef1d5acf3bc706af7c
46
py
Python
{{cookiecutter.repo_name}}/test/{{cookiecutter.package_name}}/main_test.py
genericmoniker/python-project-cookiecutter
cb73950bc21c4cfa056231d852fa1886531d4626
[ "MIT" ]
null
null
null
{{cookiecutter.repo_name}}/test/{{cookiecutter.package_name}}/main_test.py
genericmoniker/python-project-cookiecutter
cb73950bc21c4cfa056231d852fa1886531d4626
[ "MIT" ]
2
2020-03-16T21:09:37.000Z
2020-03-16T21:29:58.000Z
test/gitsplit/main_test.py
genericmoniker/git-split
a46a496e44f3a365579d26359ec446e09fa8cbe5
[ "MIT" ]
null
null
null
def test_something() -> None: assert True
15.333333
29
0.673913
6
46
5
1
0
0
0
0
0
0
0
0
0
0
0
0.217391
46
2
30
23
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.5
1
0.5
true
0
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
1
0
0
0
0
0
0
6
225a423861ecc8252fa8982fc822102a3c9bfa26
7,290
py
Python
DQMOffline/RecoB/python/cTagCombinedSVVariables_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
6
2017-09-08T14:12:56.000Z
2022-03-09T23:57:01.000Z
DQMOffline/RecoB/python/cTagCombinedSVVariables_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
545
2017-09-19T17:10:19.000Z
2022-03-07T16:55:27.000Z
DQMOffline/RecoB/python/cTagCombinedSVVariables_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
14
2017-10-04T09:47:21.000Z
2019-10-23T18:04:45.000Z
import FWCore.ParameterSet.Config as cms combinedSVRecoVertexAllSoftLeptonCtagLVariables = cms.PSet( flightDistance2dSig = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(50.0), min = cms.double(-1.0) ), flightDistance3dSig = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(50.0), min = cms.double(-1.0) ), flightDistance2dVal = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(1.0), min = cms.double(-0.1) ), flightDistance3dVal = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(3.0), min = cms.double(-0.1) ), jetNSecondaryVertices = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(5), max = cms.double(4.5), min = cms.double(-0.5) ) ) combinedSVRecoPseudoVertexAllSoftLeptonCtagLVariables = cms.PSet( vertexJetDeltaR = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.35), min = cms.double(-0.1) ), massVertexEnergyFraction = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(20.0), min = cms.double(0.0) ), vertexBoostOverSqrtJetPt = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.5), min = cms.double(-0.1) ), vertexNTracks = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(15), max = cms.double(14.5), min = cms.double(-0.5) ) ) combinedSVPseudoVertexAllSoftLeptonCtagLVariables = cms.PSet( vertexMass = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(40.0), min = cms.double(0.0) ), vertexEnergyRatio = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(2.0), min = cms.double(-0.1) ) ) combinedSVAllVertexAllSoftLeptonCtagLVariables = cms.PSet( trackSip2dSig = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(30.0), indices = cms.vuint32(0, 1), min = cms.double(-10.0) ), trackSip3dSig = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(30.0), indices = cms.vuint32(0, 1), min = cms.double(-10.0) ), trackSip2dVal = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.15), indices = cms.vuint32(0, 1), min = cms.double(-0.05) ), trackSip3dVal = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.15), indices = cms.vuint32(0, 1), min = cms.double(-0.05) ), trackPtRel = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(20.0), indices = cms.vuint32(0, 1), min = cms.double(0.0) ), trackPPar = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(200.0), indices = cms.vuint32(0, 1), min = cms.double(0.0) ), trackEtaRel = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(10.0), indices = cms.vuint32(0, 1), min = cms.double(0.0) ), trackDeltaR = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.35), indices = cms.vuint32(0, 1), min = cms.double(0.0) ), trackPtRatio = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.35), indices = cms.vuint32(0, 1), min = cms.double(0.0) ), trackPParRatio = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(1.01), indices = cms.vuint32(0, 1), min = cms.double(0.95) ), trackJetDist = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(100), max = cms.double(0.005), indices = cms.vuint32(0, 1), min = cms.double(-0.08) ), trackDecayLenVal = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(5.0), indices = cms.vuint32(0, 1), min = cms.double(0.0) ), trackSip2dSigAboveCharm = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(20.0), min = cms.double(-5.0) ), trackSip3dSigAboveCharm = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(20.0), min = cms.double(-5.0) ), trackSumJetEtRatio = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(1.0), min = cms.double(0.0) ), trackSumJetDeltaR = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.35), min = cms.double(-0.05) ), jetNTracks = cms.PSet( logScale = cms.bool(False), nBins = cms.uint32(50), max = cms.double(60.0), min = cms.double(0.0) ), trackSip2dValAboveCharm = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.15), min = cms.double(-0.05) ), trackSip3dValAboveCharm = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.15), min = cms.double(-0.05) ), vertexLeptonCategory = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(9), max = cms.double(8.5), min = cms.double(-0.5) ) ) combinedSVAllVertexSoftLeptonCtagLVariables = cms.PSet( leptonPtRel = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(10.0), indices = cms.vuint32(0, 1), min = cms.double(-1.0) ), leptonSip3d = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(30.0), indices = cms.vuint32(0, 1), min = cms.double(-10.0) ), leptonDeltaR = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.4), indices = cms.vuint32(0, 1), min = cms.double(-0.1) ), leptonRatioRel = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.05), indices = cms.vuint32(0, 1), min = cms.double(-0.03) ), leptonEtaRel = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(0.1), indices = cms.vuint32(0, 1), min = cms.double(-0.1) ), leptonRatio = cms.PSet( logScale = cms.bool(True), nBins = cms.uint32(50), max = cms.double(1.0), indices = cms.vuint32(0, 1), min = cms.double(-0.1) ) )
28.255814
65
0.528669
888
7,290
4.34009
0.095721
0.172807
0.108978
0.172807
0.747535
0.736637
0.708355
0.70109
0.70109
0.634665
0
0.084357
0.318656
7,290
257
66
28.365759
0.691564
0
0
0.697211
0
0
0
0
0
0
0
0
0
1
0
false
0
0.003984
0
0.003984
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
225bdadd93238da253e013abaabe84afb3831ad5
139
py
Python
arm_control/src/arm_control/__init__.py
errrr0501/wrs2020
8695eca402081d3d02dc12bb50b3ebd78464e96f
[ "MIT" ]
1
2020-02-17T12:56:02.000Z
2020-02-17T12:56:02.000Z
arm_control/src/arm_control/__init__.py
i-am-neet/wrs2020
3b388eac6832f2559c59fa0c1f7732589c5eff0c
[ "MIT" ]
null
null
null
arm_control/src/arm_control/__init__.py
i-am-neet/wrs2020
3b388eac6832f2559c59fa0c1f7732589c5eff0c
[ "MIT" ]
2
2020-10-12T07:48:51.000Z
2020-10-19T15:28:28.000Z
#!/usr/bin/env python3 from arm_task import ArmTask, Command, Status from suction import SuctionTask from dual_arm_task import DualArmTask
27.8
45
0.834532
21
139
5.380952
0.714286
0.123894
0.230089
0
0
0
0
0
0
0
0
0.00813
0.115108
139
4
46
34.75
0.910569
0.151079
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
97de1fe05c9714832b4b5ab36a81718f641b4cb4
44
py
Python
atmosphere/atmospherex/__init__.py
ambiata/atmosphere-python-sdk
48880a8553000cdea59d63b0fba49e1f0f482784
[ "MIT" ]
null
null
null
atmosphere/atmospherex/__init__.py
ambiata/atmosphere-python-sdk
48880a8553000cdea59d63b0fba49e1f0f482784
[ "MIT" ]
9
2021-02-21T21:53:03.000Z
2021-11-05T06:06:55.000Z
atmosphere/atmospherex/__init__.py
ambiata/atmosphere-python-sdk
48880a8553000cdea59d63b0fba49e1f0f482784
[ "MIT" ]
null
null
null
from .atmospherex_api import AtmospherexAPI
22
43
0.886364
5
44
7.6
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
44
1
44
44
0.95
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
97f10e0c35765a4091c4de904717fdd9e058be8b
109
py
Python
models/__init__.py
XiaohangZhan/dist-framework
c13e431fafea39327e8aebe92aa8311c8f0a2169
[ "MIT" ]
16
2019-08-16T16:23:45.000Z
2020-07-27T03:50:49.000Z
models/__init__.py
XiaohangZhan/dist-framework
c13e431fafea39327e8aebe92aa8311c8f0a2169
[ "MIT" ]
1
2020-06-12T10:09:55.000Z
2020-06-15T04:57:28.000Z
models/__init__.py
XiaohangZhan/dist-framework
c13e431fafea39327e8aebe92aa8311c8f0a2169
[ "MIT" ]
2
2019-08-20T01:41:41.000Z
2020-06-04T02:51:18.000Z
from . import backbone from .losses import * from .single_stage_model import * from .classification import *
21.8
33
0.788991
14
109
6
0.571429
0.238095
0
0
0
0
0
0
0
0
0
0
0.146789
109
4
34
27.25
0.903226
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
3f0638c647bdafff5616fea9fdb403b378c867be
16,691
py
Python
tests/ut/python/dataset/test_datasets_imagefolder.py
dongkcs/mindspore
cd7df6dbf463ff3128e9181e9d0c779cecb81320
[ "Apache-2.0" ]
2
2020-11-23T13:46:37.000Z
2020-12-20T02:02:38.000Z
tests/ut/python/dataset/test_datasets_imagefolder.py
dongkcs/mindspore
cd7df6dbf463ff3128e9181e9d0c779cecb81320
[ "Apache-2.0" ]
1
2020-12-29T06:46:38.000Z
2020-12-29T06:46:38.000Z
tests/ut/python/dataset/test_datasets_imagefolder.py
dongkcs/mindspore
cd7df6dbf463ff3128e9181e9d0c779cecb81320
[ "Apache-2.0" ]
1
2021-05-12T06:30:29.000Z
2021-05-12T06:30:29.000Z
# Copyright 2019 Huawei Technologies Co., Ltd # # 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 mindspore.dataset as ds from mindspore import log as logger DATA_DIR = "../data/dataset/testPK/data" def test_imagefolder_basic(): logger.info("Test Case basic") # define parameters repeat_count = 1 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 44 def test_imagefolder_numsamples(): logger.info("Test Case numSamples") # define parameters repeat_count = 1 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, num_samples=10, num_parallel_workers=2) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 10 random_sampler = ds.RandomSampler(num_samples=3, replacement=True) data1 = ds.ImageFolderDataset(DATA_DIR, num_parallel_workers=2, sampler=random_sampler) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): num_iter += 1 assert num_iter == 3 random_sampler = ds.RandomSampler(num_samples=3, replacement=False) data1 = ds.ImageFolderDataset(DATA_DIR, num_parallel_workers=2, sampler=random_sampler) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): num_iter += 1 assert num_iter == 3 def test_imagefolder_numshards(): logger.info("Test Case numShards") # define parameters repeat_count = 1 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, num_shards=4, shard_id=3) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 11 def test_imagefolder_shardid(): logger.info("Test Case withShardID") # define parameters repeat_count = 1 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, num_shards=4, shard_id=1) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 11 def test_imagefolder_noshuffle(): logger.info("Test Case noShuffle") # define parameters repeat_count = 1 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, shuffle=False) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 44 def test_imagefolder_extrashuffle(): logger.info("Test Case extraShuffle") # define parameters repeat_count = 2 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, shuffle=True) data1 = data1.shuffle(buffer_size=5) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 88 def test_imagefolder_classindex(): logger.info("Test Case classIndex") # define parameters repeat_count = 1 # apply dataset operations class_index = {"class3": 333, "class1": 111} data1 = ds.ImageFolderDataset(DATA_DIR, class_indexing=class_index, shuffle=False) data1 = data1.repeat(repeat_count) golden = [111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333] num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1, output_numpy=True): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) assert item["label"] == golden[num_iter] num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 22 def test_imagefolder_negative_classindex(): logger.info("Test Case negative classIndex") # define parameters repeat_count = 1 # apply dataset operations class_index = {"class3": -333, "class1": 111} data1 = ds.ImageFolderDataset(DATA_DIR, class_indexing=class_index, shuffle=False) data1 = data1.repeat(repeat_count) golden = [111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, -333, -333, -333, -333, -333, -333, -333, -333, -333, -333, -333] num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1, output_numpy=True): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) assert item["label"] == golden[num_iter] num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 22 def test_imagefolder_extensions(): logger.info("Test Case extensions") # define parameters repeat_count = 1 # apply dataset operations ext = [".jpg", ".JPEG"] data1 = ds.ImageFolderDataset(DATA_DIR, extensions=ext) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 44 def test_imagefolder_decode(): logger.info("Test Case decode") # define parameters repeat_count = 1 # apply dataset operations ext = [".jpg", ".JPEG"] data1 = ds.ImageFolderDataset(DATA_DIR, extensions=ext, decode=True) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 44 def test_sequential_sampler(): logger.info("Test Case SequentialSampler") golden = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] # define parameters repeat_count = 1 # apply dataset operations sampler = ds.SequentialSampler() data1 = ds.ImageFolderDataset(DATA_DIR, sampler=sampler) data1 = data1.repeat(repeat_count) result = [] num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1, output_numpy=True): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" result.append(item["label"]) num_iter += 1 logger.info("Result: {}".format(result)) assert result == golden def test_random_sampler(): logger.info("Test Case RandomSampler") # define parameters repeat_count = 1 # apply dataset operations sampler = ds.RandomSampler() data1 = ds.ImageFolderDataset(DATA_DIR, sampler=sampler) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 44 def test_distributed_sampler(): logger.info("Test Case DistributedSampler") # define parameters repeat_count = 1 # apply dataset operations sampler = ds.DistributedSampler(10, 1) data1 = ds.ImageFolderDataset(DATA_DIR, sampler=sampler) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 5 def test_pk_sampler(): logger.info("Test Case PKSampler") # define parameters repeat_count = 1 # apply dataset operations sampler = ds.PKSampler(3) data1 = ds.ImageFolderDataset(DATA_DIR, sampler=sampler) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 12 def test_subset_random_sampler(): logger.info("Test Case SubsetRandomSampler") # define parameters repeat_count = 1 # apply dataset operations indices = [0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 11] sampler = ds.SubsetRandomSampler(indices) data1 = ds.ImageFolderDataset(DATA_DIR, sampler=sampler) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 12 def test_weighted_random_sampler(): logger.info("Test Case WeightedRandomSampler") # define parameters repeat_count = 1 # apply dataset operations weights = [1.0, 0.1, 0.02, 0.3, 0.4, 0.05, 1.2, 0.13, 0.14, 0.015, 0.16, 1.1] sampler = ds.WeightedRandomSampler(weights, 11) data1 = ds.ImageFolderDataset(DATA_DIR, sampler=sampler) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 11 def test_imagefolder_rename(): logger.info("Test Case rename") # define parameters repeat_count = 1 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, num_samples=10) data1 = data1.repeat(repeat_count) num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 10 data1 = data1.rename(input_columns=["image"], output_columns="image2") num_iter = 0 for item in data1.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image2"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 10 def test_imagefolder_zip(): logger.info("Test Case zip") # define parameters repeat_count = 2 # apply dataset operations data1 = ds.ImageFolderDataset(DATA_DIR, num_samples=10) data2 = ds.ImageFolderDataset(DATA_DIR, num_samples=10) data1 = data1.repeat(repeat_count) # rename dataset2 for no conflict data2 = data2.rename(input_columns=["image", "label"], output_columns=["image1", "label1"]) data3 = ds.zip((data1, data2)) num_iter = 0 for item in data3.create_dict_iterator(num_epochs=1): # each data is a dictionary # in this example, each dictionary has keys "image" and "label" logger.info("image is {}".format(item["image"])) logger.info("label is {}".format(item["label"])) num_iter += 1 logger.info("Number of data in data1: {}".format(num_iter)) assert num_iter == 10 if __name__ == '__main__': test_imagefolder_basic() logger.info('test_imagefolder_basic Ended.\n') test_imagefolder_numsamples() logger.info('test_imagefolder_numsamples Ended.\n') test_sequential_sampler() logger.info('test_sequential_sampler Ended.\n') test_random_sampler() logger.info('test_random_sampler Ended.\n') test_distributed_sampler() logger.info('test_distributed_sampler Ended.\n') test_pk_sampler() logger.info('test_pk_sampler Ended.\n') test_subset_random_sampler() logger.info('test_subset_random_sampler Ended.\n') test_weighted_random_sampler() logger.info('test_weighted_random_sampler Ended.\n') test_imagefolder_numshards() logger.info('test_imagefolder_numshards Ended.\n') test_imagefolder_shardid() logger.info('test_imagefolder_shardid Ended.\n') test_imagefolder_noshuffle() logger.info('test_imagefolder_noshuffle Ended.\n') test_imagefolder_extrashuffle() logger.info('test_imagefolder_extrashuffle Ended.\n') test_imagefolder_classindex() logger.info('test_imagefolder_classindex Ended.\n') test_imagefolder_negative_classindex() logger.info('test_imagefolder_negative_classindex Ended.\n') test_imagefolder_extensions() logger.info('test_imagefolder_extensions Ended.\n') test_imagefolder_decode() logger.info('test_imagefolder_decode Ended.\n') test_imagefolder_rename() logger.info('test_imagefolder_rename Ended.\n') test_imagefolder_zip() logger.info('test_imagefolder_zip Ended.\n')
33.583501
105
0.667605
2,271
16,691
4.747248
0.084104
0.084408
0.046749
0.052593
0.848623
0.836472
0.745014
0.721362
0.702811
0.701512
0
0.037929
0.208615
16,691
496
106
33.65121
0.778257
0.186807
0
0.619205
0
0
0.162575
0.03256
0
0
0
0
0.076159
1
0.059603
false
0
0.006623
0
0.066225
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
3f21df67a4940b008fc49b7b17e36bfe256dbebc
33
py
Python
tartiflette/directive/__init__.py
alexchamberlain/tartiflette
6904b0f47770c348553e907be5f5bdb0929fe149
[ "MIT" ]
null
null
null
tartiflette/directive/__init__.py
alexchamberlain/tartiflette
6904b0f47770c348553e907be5f5bdb0929fe149
[ "MIT" ]
null
null
null
tartiflette/directive/__init__.py
alexchamberlain/tartiflette
6904b0f47770c348553e907be5f5bdb0929fe149
[ "MIT" ]
null
null
null
from .directive import Directive
16.5
32
0.848485
4
33
7
0.75
0
0
0
0
0
0
0
0
0
0
0
0.121212
33
1
33
33
0.965517
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
3f39f413f584813e10bc695ce16fb26d66385e13
27
py
Python
snail/__init__.py
Who8MyLunch/Snail
86f4093a884ceb6ba296afad50f238f439e4c2c4
[ "MIT" ]
2
2021-04-09T20:17:41.000Z
2021-04-09T20:18:06.000Z
snail/__init__.py
Who8MyLunch/Snail
86f4093a884ceb6ba296afad50f238f439e4c2c4
[ "MIT" ]
5
2019-11-24T16:24:11.000Z
2021-02-22T16:10:05.000Z
snail/__init__.py
Who8MyLunch/Snail
86f4093a884ceb6ba296afad50f238f439e4c2c4
[ "MIT" ]
3
2020-07-25T23:00:59.000Z
2022-02-15T02:37:27.000Z
from .device import Device
13.5
26
0.814815
4
27
5.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.148148
27
1
27
27
0.956522
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
3f49154e72709827a117b624e9bfe75dbaefe449
129
py
Python
src/potpourri3d/__init__.py
unspun/potpourri3d
4ae5fc3ab58be9734fb7f5a6503808a796b89067
[ "MIT" ]
221
2021-02-17T17:43:27.000Z
2022-03-29T06:54:05.000Z
src/potpourri3d/__init__.py
unspun/potpourri3d
4ae5fc3ab58be9734fb7f5a6503808a796b89067
[ "MIT" ]
6
2021-02-24T19:47:36.000Z
2022-02-07T18:37:41.000Z
src/potpourri3d/__init__.py
unspun/potpourri3d
4ae5fc3ab58be9734fb7f5a6503808a796b89067
[ "MIT" ]
15
2021-02-18T05:10:39.000Z
2022-03-09T09:51:04.000Z
from potpourri3d.core import * from potpourri3d.io import * from potpourri3d.mesh import * from potpourri3d.point_cloud import *
25.8
37
0.813953
17
129
6.117647
0.470588
0.576923
0.605769
0
0
0
0
0
0
0
0
0.035398
0.124031
129
4
38
32.25
0.884956
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
3f5f3f3dc09d7dc1393536e97f7bf03558c36aa7
4,265
py
Python
yt/geometry/coordinates/tests/test_geographic_coordinates.py
kastalpes/yt
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
[ "BSD-3-Clause-Clear" ]
2
2021-03-02T18:59:49.000Z
2021-03-02T18:59:50.000Z
yt/geometry/coordinates/tests/test_geographic_coordinates.py
kastalpes/yt
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
[ "BSD-3-Clause-Clear" ]
4
2018-04-13T23:03:42.000Z
2018-05-08T17:50:43.000Z
yt/geometry/coordinates/tests/test_geographic_coordinates.py
kastalpes/yt
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
[ "BSD-3-Clause-Clear" ]
2
2020-05-16T15:29:37.000Z
2020-06-22T10:17:08.000Z
# Some tests for the geographic coordinates handler import numpy as np from yt.testing import \ fake_amr_ds, \ assert_equal, \ assert_rel_equal # Our canonical tests are that we can access all of our fields and we can # compute our volume correctly. def test_geographic_coordinates(): # We're going to load up a simple AMR grid and check its volume # calculations and path length calculations. # Note that we are setting it up to have an altitude of 1000 maximum, which # means our volume will be that of a shell 1000 wide, starting at r of # whatever our surface_height is set to. ds = fake_amr_ds(geometry="geographic") ds.surface_height = ds.quan(5000, "code_length") axes = ["latitude", "longitude", "altitude"] for i, axis in enumerate(axes): dd = ds.all_data() fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) inner_r = ds.surface_height outer_r = ds.surface_height + ds.domain_width[2] assert_equal(dd["index","dtheta"], dd["index","dlatitude"]*np.pi/180.0) assert_equal(dd["index","dphi"], dd["index","dlongitude"]*np.pi/180.0) # Note our terrible agreement here. assert_rel_equal(dd["cell_volume"].sum(dtype="float64"), (4.0/3.0) * np.pi * (outer_r**3 - inner_r**3), 3) assert_equal(dd["index", "path_element_altitude"], dd["index", "daltitude"]) assert_equal(dd["index", "path_element_altitude"], dd["index", "dr"]) # Note that latitude corresponds to theta, longitude to phi assert_equal(dd["index", "path_element_latitude"], dd["index", "r"] * dd["index", "dlatitude"] * np.pi/180.0) assert_equal(dd["index", "path_element_longitude"], (dd["index", "r"] * dd["index", "dlongitude"] * np.pi/180.0 * np.sin((dd["index", "latitude"] + 90.0) * np.pi/180.0))) # We also want to check that our radius is correct assert_equal(dd["index","r"], dd["index","altitude"] + ds.surface_height) def test_internal_geographic_coordinates(): # We're going to load up a simple AMR grid and check its volume # calculations and path length calculations. # Note that we are setting it up to have depth of 1000 maximum, which # means our volume will be that of a shell 1000 wide, starting at r of # outer_radius - 1000. ds = fake_amr_ds(geometry="internal_geographic") ds.outer_radius = ds.quan(5000, "code_length") axes = ["latitude", "longitude", "depth"] for i, axis in enumerate(axes): dd = ds.all_data() fi = ("index", axis) fd = ("index", "d%s" % axis) ma = np.argmax(dd[fi]) assert_equal(dd[fi][ma] + dd[fd][ma] / 2.0, ds.domain_right_edge[i].d) mi = np.argmin(dd[fi]) assert_equal(dd[fi][mi] - dd[fd][mi] / 2.0, ds.domain_left_edge[i].d) assert_equal(dd[fd].max(), (ds.domain_width/ds.domain_dimensions)[i].d) inner_r = ds.outer_radius - ds.domain_right_edge[2] outer_r = ds.outer_radius assert_equal(dd["index","dtheta"], dd["index","dlatitude"]*np.pi/180.0) assert_equal(dd["index","dphi"], dd["index","dlongitude"]*np.pi/180.0) assert_rel_equal(dd["cell_volume"].sum(dtype="float64"), (4.0/3.0) * np.pi * (outer_r**3 - inner_r**3), 10) assert_equal(dd["index", "path_element_depth"], dd["index", "ddepth"]) assert_equal(dd["index", "path_element_depth"], dd["index", "dr"]) # Note that latitude corresponds to theta, longitude to phi assert_equal(dd["index", "path_element_latitude"], dd["index", "r"] * dd["index", "dlatitude"] * np.pi/180.0) assert_equal(dd["index", "path_element_longitude"], (dd["index", "r"] * dd["index", "dlongitude"] * np.pi/180.0 * np.sin((dd["index", "latitude"] + 90.0) * np.pi/180.0))) # We also want to check that our radius is correct assert_equal(dd["index","r"], -1.0*dd["index","depth"] + ds.outer_radius)
50.176471
80
0.62837
659
4,265
3.924127
0.206373
0.092034
0.100541
0.097448
0.792343
0.774942
0.774942
0.774942
0.743233
0.682908
0
0.031102
0.208441
4,265
84
81
50.77381
0.734893
0.222509
0
0.576271
0
0
0.195329
0.038823
0
0
0
0
0.40678
1
0.033898
false
0
0.033898
0
0.067797
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
6
58d28e55daa32cafb24066b3d26ef87d6317b523
162
py
Python
a/aa/web_form/mark_attendence/mark_attendence.py
aswinthaikkat/a
8da4a780e82cfb498017e1d15711001e5679b9a4
[ "MIT" ]
null
null
null
a/aa/web_form/mark_attendence/mark_attendence.py
aswinthaikkat/a
8da4a780e82cfb498017e1d15711001e5679b9a4
[ "MIT" ]
null
null
null
a/aa/web_form/mark_attendence/mark_attendence.py
aswinthaikkat/a
8da4a780e82cfb498017e1d15711001e5679b9a4
[ "MIT" ]
null
null
null
from __future__ import unicode_literals import frappe def get_context(context): pass def has_website_permission(doc,ptype,user,verbose=False): return True
14.727273
57
0.814815
23
162
5.391304
0.869565
0
0
0
0
0
0
0
0
0
0
0
0.123457
162
11
58
14.727273
0.873239
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.166667
0.333333
0.166667
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
1
1
1
0
0
6
58d7874e2071ed69f4f866554b981b6b71c80653
15,976
py
Python
xlsxwriter/test/styles/test_write_xf_methods.py
DeltaEpsilon7787/XlsxWriter
550b9c5bd678c861dcc9f6f4072b33a69566e065
[ "BSD-2-Clause-FreeBSD" ]
2,766
2015-01-02T17:36:42.000Z
2022-03-31T09:23:30.000Z
xlsxwriter/test/styles/test_write_xf_methods.py
DeltaEpsilon7787/XlsxWriter
550b9c5bd678c861dcc9f6f4072b33a69566e065
[ "BSD-2-Clause-FreeBSD" ]
683
2015-01-03T09:55:02.000Z
2022-03-31T07:18:15.000Z
xlsxwriter/test/styles/test_write_xf_methods.py
jmcnamara/test_py_github_actions
d445d5d98b038b63453dd70c9c1a9ca1b325cb47
[ "BSD-2-Clause-FreeBSD" ]
636
2015-01-05T01:57:08.000Z
2022-03-25T18:42:41.000Z
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org # import unittest from io import StringIO from ...styles import Styles from ...format import Format class TestWriteXf(unittest.TestCase): """ Test the Styles _write_xf() method. This test case is similar to test_write_xf.py but with methods calls instead of properties. """ def setUp(self): self.fh = StringIO() self.styles = Styles() self.styles._set_filehandle(self.fh) def test_write_xf_1(self): """Test the _write_xf() method. Default properties.""" xf_format = Format() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_2(self): """Test the _write_xf() method. Has font but is first XF.""" xf_format = Format() xf_format.set_has_font() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_3(self): """Test the _write_xf() method. Has font but isn't first XF.""" xf_format = Format() xf_format.set_has_font() xf_format.set_font_index(1) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_4(self): """Test the _write_xf() method. Uses built-in number format.""" xf_format = Format() xf_format.set_num_format_index(2) self.styles._write_xf(xf_format) exp = """<xf numFmtId="2" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_5(self): """Test the _write_xf() method. Uses built-in number format + font.""" xf_format = Format() xf_format.set_num_format_index(2) xf_format.set_has_font() xf_format.set_font_index(1) self.styles._write_xf(xf_format) exp = """<xf numFmtId="2" fontId="1" fillId="0" borderId="0" xfId="0" applyNumberFormat="1" applyFont="1"/>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_6(self): """Test the _write_xf() method. Vertical alignment = top.""" xf_format = Format() xf_format.set_align('top') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment vertical="top"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_7(self): """Test the _write_xf() method. Vertical alignment = centre.""" xf_format = Format() xf_format.set_align('vcenter') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment vertical="center"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_8(self): """Test the _write_xf() method. Vertical alignment = bottom.""" xf_format = Format() xf_format.set_align('bottom') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"/>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_9(self): """Test the _write_xf() method. Vertical alignment = justify.""" xf_format = Format() xf_format.set_align('vjustify') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment vertical="justify"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_10(self): """Test the _write_xf() method. Vertical alignment = distributed.""" xf_format = Format() xf_format.set_align('vdistributed') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment vertical="distributed"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_11(self): """Test the _write_xf() method. Horizontal alignment = left.""" xf_format = Format() xf_format.set_align('left') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="left"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_12(self): """Test the _write_xf() method. Horizontal alignment = center.""" xf_format = Format() xf_format.set_align('center') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="center"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_13(self): """Test the _write_xf() method. Horizontal alignment = right.""" xf_format = Format() xf_format.set_align('right') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="right"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_14(self): """Test the _write_xf() method. Horizontal alignment = left + indent.""" xf_format = Format() xf_format.set_align('left') xf_format.set_indent() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="left" indent="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_15(self): """Test the _write_xf() method. Horizontal alignment = right + indent.""" xf_format = Format() xf_format.set_align('right') xf_format.set_indent() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="right" indent="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_16(self): """Test the _write_xf() method. Horizontal alignment = fill.""" xf_format = Format() xf_format.set_align('fill') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="fill"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_17(self): """Test the _write_xf() method. Horizontal alignment = justify.""" xf_format = Format() xf_format.set_align('justify') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="justify"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_18(self): """Test the _write_xf() method. Horizontal alignment = center across.""" xf_format = Format() xf_format.set_align('center_across') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="centerContinuous"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_19(self): """Test the _write_xf() method. Horizontal alignment = distributed.""" xf_format = Format() xf_format.set_align('distributed') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="distributed"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_20(self): """Test the _write_xf() method. Horizontal alignment = distributed + indent.""" xf_format = Format() xf_format.set_align('distributed') xf_format.set_indent() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="distributed" indent="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_21(self): """Test the _write_xf() method. Horizontal alignment = justify distributed.""" xf_format = Format() xf_format.set_align('justify_distributed') self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="distributed" justifyLastLine="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_22(self): """Test the _write_xf() method. Horizontal alignment = indent only.""" xf_format = Format() xf_format.set_indent() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="left" indent="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_23(self): """Test the _write_xf() method. Horizontal alignment = distributed + indent.""" xf_format = Format() xf_format.set_align('justify_distributed') xf_format.set_indent() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment horizontal="distributed" indent="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_24(self): """Test the _write_xf() method. Alignment = text wrap""" xf_format = Format() xf_format.set_text_wrap() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment wrapText="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_25(self): """Test the _write_xf() method. Alignment = shrink to fit""" xf_format = Format() xf_format.set_shrink() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment shrinkToFit="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_26(self): """Test the _write_xf() method. Alignment = reading order""" xf_format = Format() xf_format.set_reading_order(1) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment readingOrder="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_27(self): """Test the _write_xf() method. Alignment = reading order""" xf_format = Format() xf_format.set_reading_order(2) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment readingOrder="2"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_28(self): """Test the _write_xf() method. Alignment = rotation""" xf_format = Format() xf_format.set_rotation(45) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="45"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_29(self): """Test the _write_xf() method. Alignment = rotation""" xf_format = Format() xf_format.set_rotation(-45) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="135"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_30(self): """Test the _write_xf() method. Alignment = rotation""" xf_format = Format() xf_format.set_rotation(270) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="255"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_31(self): """Test the _write_xf() method. Alignment = rotation""" xf_format = Format() xf_format.set_rotation(90) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="90"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_32(self): """Test the _write_xf() method. Alignment = rotation""" xf_format = Format() xf_format.set_rotation(-90) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment textRotation="180"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_33(self): """Test the _write_xf() method. With cell protection.""" xf_format = Format() xf_format.set_locked(0) self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyProtection="1"><protection locked="0"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_34(self): """Test the _write_xf() method. With cell protection.""" xf_format = Format() xf_format.set_hidden() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyProtection="1"><protection hidden="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_35(self): """Test the _write_xf() method. With cell protection.""" xf_format = Format() xf_format.set_locked(0) xf_format.set_hidden() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyProtection="1"><protection locked="0" hidden="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp) def test_write_xf_36(self): """Test the _write_xf() method. With cell protection + align.""" xf_format = Format() xf_format.set_align('right') xf_format.set_locked(0) xf_format.set_hidden() self.styles._write_xf(xf_format) exp = """<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1" applyProtection="1"><alignment horizontal="right"/><protection locked="0" hidden="1"/></xf>""" got = self.fh.getvalue() self.assertEqual(got, exp)
31.824701
191
0.607223
2,069
15,976
4.478492
0.072499
0.101014
0.053421
0.054392
0.924887
0.924887
0.91539
0.895316
0.83283
0.751673
0
0.0272
0.226778
15,976
501
192
31.888224
0.722901
0.144905
0
0.655556
0
0.133333
0.316439
0.1146
0
0
0
0
0.133333
1
0.137037
false
0
0.014815
0
0.155556
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
58df2ff230098d344c2e06143d21c584c05e3461
399
py
Python
sdcdup/visualization/__init__.py
WillieMaddox/Airbus_SDC_dup
09be904cf3c8050086f07538f5e2954282de5d62
[ "MIT" ]
null
null
null
sdcdup/visualization/__init__.py
WillieMaddox/Airbus_SDC_dup
09be904cf3c8050086f07538f5e2954282de5d62
[ "MIT" ]
null
null
null
sdcdup/visualization/__init__.py
WillieMaddox/Airbus_SDC_dup
09be904cf3c8050086f07538f5e2954282de5d62
[ "MIT" ]
null
null
null
from .visualize import ChannelShift from .visualize import reversed_recombined_holt_winters from .visualize import get_ticks from .visualize import subtract_channel_average from .visualize import draw_tile_number from .visualize import draw_bbox from .visualize import draw_tile_bbox from .visualize import draw_overlap_bbox from .visualize import show_image from .visualize import show_image_pair
33.25
55
0.87218
56
399
5.928571
0.375
0.391566
0.572289
0.277108
0.424699
0
0
0
0
0
0
0
0.102757
399
11
56
36.272727
0.927374
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
58f437f606e78fa9a8280b5b3337f1b69749090f
4,076
py
Python
rxn4chemistry/callbacks.py
ltalirz/rxn4chemistry
b8601cecdfdeeb45cefacca9bf8945e478d290fa
[ "MIT" ]
null
null
null
rxn4chemistry/callbacks.py
ltalirz/rxn4chemistry
b8601cecdfdeeb45cefacca9bf8945e478d290fa
[ "MIT" ]
null
null
null
rxn4chemistry/callbacks.py
ltalirz/rxn4chemistry
b8601cecdfdeeb45cefacca9bf8945e478d290fa
[ "MIT" ]
null
null
null
"""Callbacks for IBM RXN for Chemistry API.""" import logging import requests from bs4 import BeautifulSoup LOGGER = logging.getLogger('rxn4chemistry:callbacks') def prediction_id_on_success(response: requests.models.Response) -> dict: """ Process the successful response of requests returning a prediction identifier. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ response_dict = response.json() return { 'prediction_id': response_dict['payload']['id'], 'response': response_dict } def synthesis_id_on_success(response: requests.models.Response) -> dict: """ Process the successful response of requests returning a synthesis identifier. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ response_dict = response.json() return { 'synthesis_id': response_dict['payload']['id'], 'response': response_dict } def default_on_success(response: requests.models.Response) -> dict: """ Process the successful response. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ response_dict = response.json() return {'response': response_dict} def automatic_retrosynthesis_results_on_success( response: requests.models.Response ) -> dict: """ Process the successful response of an automatic retrosyntesis result request. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ response_dict = response.json() return { 'retrosynthetic_paths': [ sequence['tree'] for sequence in response_dict['payload']['sequences'] ], 'status': response_dict['payload']['status'], 'response': response_dict } def retrosynthesis_sequence_pdf(response: requests.models.Response) -> dict: """ Process the successful response of .pdf retrosynthesis sequence report retrieval. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ return {'content': response.text} def synthesis_analysis_report_pdf(response: requests.models.Response) -> dict: """ Process the successful response of .pdf spectrometer report retrieval. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ return {'content': response.text} def paragraph_to_actions_on_success( response: requests.models.Response ) -> dict: """ Process the successful response of a paragraph to actions request. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ response_dict = response.json() return { 'actions': [ action.strip(' .') for element in BeautifulSoup( response_dict['payload']['actionSequence'], 'html.parser' ).find_all('li') for action in element.text.split(';') ], 'response': response_dict } def synthesis_status_on_success(response: requests.models.Response) -> dict: """ Process the successful response of requests returning a synthesis identifier. Args: response (requests.models.Response): response from an API request. Returns: dict: dictionary representing the response. """ response_dict = response.json() response_dict['payload'].pop('user') return { 'status': response_dict['payload']['status'], 'response': response_dict }
26.128205
78
0.654318
417
4,076
6.282974
0.179856
0.123664
0.134351
0.183206
0.766031
0.750382
0.750382
0.750382
0.71145
0.676336
0
0.000653
0.248773
4,076
155
79
26.296774
0.854997
0.415604
0
0.448276
0
0
0.124049
0.010932
0
0
0
0
0
1
0.137931
false
0
0.051724
0
0.327586
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
450eb50a6f36ae70158810b21dbc86335e6a26ea
21,618
py
Python
nufftbindings/pykeops.py
albangossard/Bindings-NUFFT-pytorch
86446555505e0daef07dfdd4620d7cd5d57f9832
[ "MIT" ]
null
null
null
nufftbindings/pykeops.py
albangossard/Bindings-NUFFT-pytorch
86446555505e0daef07dfdd4620d7cd5d57f9832
[ "MIT" ]
null
null
null
nufftbindings/pykeops.py
albangossard/Bindings-NUFFT-pytorch
86446555505e0daef07dfdd4620d7cd5d57f9832
[ "MIT" ]
null
null
null
# Author: Alban Gossard # Last modification: 2021/22/09 import torch from pykeops.torch import LazyTensor, ComplexLazyTensor # from pykeops import IntCst, Imag2Complex from nufftbindings.basenufft import * class Nufft(baseNUFFT): def _set_dims(self): self.cos_coupling = None self.sin_coupling = None if self.ndim==2: self.zx = self.xx.view(-1,1).repeat(1, self.nx).view(-1,1) self.zy = self.xy.view(1,-1).repeat(self.ny, 1).view(-1,1) elif self.ndim==3: self.zx = self.xx.view(-1,1,1).repeat(1, self.nx, self.nx).view(-1,1) self.zy = self.xy.view(1,-1,1).repeat(self.ny, 1, self.ny).view(-1,1) self.zz = self.xz.view(1,1,-1).repeat(self.nz, self.nz, 1).view(-1,1) self.zx = LazyTensor( self.zx[None,:,:] ) self.zy = LazyTensor( self.zy[None,:,:] ) if self.ndim==3: self.zz = LazyTensor( self.zz[None,:,:] ) def precompute(self, xi): xix = xi[:,0].type(self.torch_dtype).view(-1,1).contiguous() xiy = xi[:,1].type(self.torch_dtype).view(-1,1).contiguous() if self.ndim==3: xiz = xi[:,2].type(self.torch_dtype).view(-1,1).contiguous() xix = LazyTensor( xix[:,None,:] ) xiy = LazyTensor( xiy[:,None,:] ) if self.ndim==3: xiz = LazyTensor( xiz[:,None,:] ) if self.ndim==2: coupling = xix*self.zx+xiy*self.zy elif self.ndim==3: coupling = xix*self.zx+xiy*self.zy+xiz*self.zz self.cos_coupling = coupling.cos() self.sin_coupling = coupling.sin() self.xiprecomputed = xi.clone() self.precomputedTrig = True def _forward2D(self, f, xi): self.test_xi(xi) ndim = len(f.shape) iscpx = f.is_complex() if ndim==4 and not iscpx or ndim==3 and iscpx: Nbatch = f.shape[0] if iscpx: f = f.permute(1,2,0) # nx,ny,batch fr = f.real.type(self.torch_dtype).view(-1,Nbatch).contiguous() fi = f.imag.type(self.torch_dtype).view(-1,Nbatch).contiguous() else: f = f.permute(1,2,3,0) # nx,ny,r/i,batch fr = f[:,:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fi = f[:,:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fr = LazyTensor( fr[None,:,:] ) fi = LazyTensor( fi[None,:,:] ) f_cos = fr.concat(fi) f_sin = fi.concat(-fr) y_concat = (f_cos*self.cos_coupling+f_sin*self.sin_coupling).sum(dim=1) if iscpx: y = torch.zeros(self.K, Nbatch, dtype=self.torch_cpxdtype, device=self.device) y.real = y_concat[:,:Nbatch] y.imag = y_concat[:,Nbatch:] y = y.permute(1,0) # batch,K else: y = torch.zeros(self.K, 2, Nbatch, dtype=self.torch_dtype, device=self.device) y[:,0,:] = y_concat[:,:Nbatch] y[:,1,:] = y_concat[:,Nbatch:] y = y.permute(2,0,1) # batch,K,r/i return y elif ndim==3 and not iscpx or ndim==2 and iscpx: if iscpx: fr = f.real.type(self.torch_dtype).view(-1,1).contiguous() fi = f.imag.type(self.torch_dtype).view(-1,1).contiguous() else: fr = f[:,:,0].type(self.torch_dtype).view(-1,1).contiguous() fi = f[:,:,1].type(self.torch_dtype).view(-1,1).contiguous() fr = LazyTensor( fr[None,:,:] ) fi = LazyTensor( fi[None,:,:] ) f_cos = fr.concat(fi) f_sin = fi.concat(-fr) y_concat = (f_cos*self.cos_coupling+f_sin*self.sin_coupling).sum(dim=1) if iscpx: y = torch.zeros(self.K, dtype=self.torch_cpxdtype, device=self.device) y.real = y_concat[:,0].view(-1) y.imag = y_concat[:,1].view(-1) else: y = torch.zeros(self.K, 2, dtype=self.torch_dtype, device=self.device) y[:,0] = y_concat[:,0].view(-1) y[:,1] = y_concat[:,1].view(-1) return y else: raise Exception("Error: f should have 2, 3 or 4 dimensions (batch mode)") def _adjoint2D(self, y, xi): self.test_xi(xi) ndim = len(y.shape) iscpx = y.is_complex() if ndim==3 and not iscpx or ndim==2 and iscpx: Nbatch = y.shape[0] if iscpx: y = y.permute(1,0) # K,batch yr = y.real.type(self.torch_dtype).view(-1,Nbatch).contiguous() yi = y.imag.type(self.torch_dtype).view(-1,Nbatch).contiguous() else: y = y.permute(1,2,0) # K,r/i,batch yr = y[:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() yi = y[:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() yr = LazyTensor( yr[:,None,:] ) yi = LazyTensor( yi[:,None,:] ) y_cos=yr.concat(yi) y_sin=(-yi).concat(yr) f_concat = (y_cos*self.cos_coupling+y_sin*self.sin_coupling).sum(dim=0) if iscpx: f = torch.zeros(self.nx,self.ny, Nbatch, dtype=self.torch_cpxdtype, device=self.device) f.real = f_concat[:,:Nbatch].view(self.nx,self.ny,Nbatch) f.imag = f_concat[:,Nbatch:].view(self.nx,self.ny,Nbatch) f = f.permute(2,0,1) # batch,nx,ny else: f = torch.zeros(self.nx,self.ny, 2, Nbatch, dtype=self.torch_dtype, device=self.device) f[:,:,0,:] = f_concat[:,:Nbatch].view(self.nx,self.ny,Nbatch) f[:,:,1,:] = f_concat[:,Nbatch:].view(self.nx,self.ny,Nbatch) f = f.permute(3,0,1,2) # batch,nx,ny,r/i return f elif ndim==2 and not iscpx or ndim==1 and iscpx: if iscpx: yr = y.real.type(self.torch_dtype).view(-1,1).contiguous() yi = y.imag.type(self.torch_dtype).view(-1,1).contiguous() else: yr = y[:,0].type(self.torch_dtype).view(-1,1).contiguous() yi = y[:,1].type(self.torch_dtype).view(-1,1).contiguous() yr = LazyTensor( yr[:,None,:] ) yi = LazyTensor( yi[:,None,:] ) y_cos=yr.concat(yi) y_sin=(-yi).concat(yr) f_concat = (y_cos*self.cos_coupling+y_sin*self.sin_coupling).sum(dim=0) if iscpx: f = torch.zeros(self.nx,self.ny, dtype=self.torch_cpxdtype, device=self.device) f.real = f_concat[:,0].view(self.nx,self.ny) f.imag = f_concat[:,1].view(self.nx,self.ny) else: f = torch.zeros(self.nx,self.ny, 2, dtype=self.torch_dtype, device=self.device) f[:,:,0] = f_concat[:,0].view(self.nx,self.ny) f[:,:,1] = f_concat[:,1].view(self.nx,self.ny) return f else: raise Exception("Error: y should have 2 or 3 dimensions (batch mode)") def _backward_forward2D(self, f, g, xi): self.test_xi(xi) ndim = len(f.shape) iscpx = f.is_complex() if ndim==4 and not iscpx or ndim==3 and iscpx: Nbatch = f.shape[0] if iscpx: f = f.permute(1,2,0) # nx,ny,batch g = g.permute(1,0) # K,batch fr = f.real.type(self.torch_dtype).view(-1,Nbatch).contiguous() fi = f.imag.type(self.torch_dtype).view(-1,Nbatch).contiguous() else: f = f.permute(1,2,3,0) # nx,ny,r/i,batch g = g.permute(1,2,0) # K,r/i,batch fr = f[:,:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fi = f[:,:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fr = LazyTensor( fr[None,:,:] ) fi = LazyTensor( fi[None,:,:] ) vec_frx = self.zx*fr vec_fix = self.zx*fi vec_fry = self.zy*fr vec_fiy = self.zy*fi grad = torch.zeros(xi.shape, dtype=self.torch_dtype, device=self.device) vec_cos = vec_frx.concat(vec_fix).concat(vec_fry).concat(vec_fiy) vec_sin = vec_fix.concat(-vec_frx).concat(vec_fiy).concat(-vec_fry) tmp_concat = (vec_cos*self.cos_coupling+vec_sin*self.sin_coupling).sum(dim=1).view(-1,4*Nbatch) tmp1r = tmp_concat[:,:Nbatch] tmp1i = tmp_concat[:,Nbatch:2*Nbatch] if iscpx: grad[:,0] = (torch.mul(tmp1i, g.real) - torch.mul(tmp1r, g.imag)).sum(dim=1) else: grad[:,0] = (torch.mul(tmp1i, g[:,0,:]) - torch.mul(tmp1r, g[:,1,:])).sum(dim=1) tmp2r = tmp_concat[:,2*Nbatch:3*Nbatch] tmp2i = tmp_concat[:,3*Nbatch:] if iscpx: grad[:,1] = (torch.mul(tmp2i, g.real) - torch.mul(tmp2r, g.imag)).sum(dim=1) else: grad[:,1] = (torch.mul(tmp2i, g[:,0,:]) - torch.mul(tmp2r, g[:,1,:])).sum(dim=1) return grad elif ndim==3 and not iscpx or ndim==2 and iscpx: if iscpx: fr = f.real.type(self.torch_dtype).view(-1,1).contiguous() fi = f.imag.type(self.torch_dtype).view(-1,1).contiguous() else: fr = f[:,:,0].type(self.torch_dtype).view(-1,1).contiguous() fi = f[:,:,1].type(self.torch_dtype).view(-1,1).contiguous() fr = LazyTensor( fr[None,:,:] ) fi = LazyTensor( fi[None,:,:] ) vec_frx = self.zx*fr vec_fix = self.zx*fi vec_fry = self.zy*fr vec_fiy = self.zy*fi grad = torch.zeros(xi.shape, dtype=self.torch_dtype, device=self.device) vec_cos = vec_frx.concat(vec_fix).concat(vec_fry).concat(vec_fiy) vec_sin = vec_fix.concat(-vec_frx).concat(vec_fiy).concat(-vec_fry) tmp_concat = (vec_cos*self.cos_coupling+vec_sin*self.sin_coupling).sum(dim=1).view(-1,4) tmp1r = tmp_concat[:,0] tmp1i = tmp_concat[:,1] if iscpx: grad[:,0] = torch.mul(tmp1i, g.real) - torch.mul(tmp1r, g.imag) else: grad[:,0] = torch.mul(tmp1i, g[:,0]) - torch.mul(tmp1r, g[:,1]) tmp2r = tmp_concat[:,2] tmp2i = tmp_concat[:,3] if iscpx: grad[:,1] = torch.mul(tmp2i, g.real) - torch.mul(tmp2r, g.imag) else: grad[:,1] = torch.mul(tmp2i, g[:,0]) - torch.mul(tmp2r, g[:,1]) return grad else: raise Exception("Error: f should have 3 or 4 dimensions (batch mode)") def _backward_adjoint2D(self, y, g, xi): self.test_xi(xi) ndim = len(y.shape) iscpx = y.is_complex() if ndim==3 and not iscpx or ndim==2 and iscpx: Nbatch = y.shape[0] if iscpx: y = y.permute(1,0) # K,batch g = g.permute(1,2,0) # nx,ny,batch gr = g.real.type(self.torch_dtype).view(-1,Nbatch).contiguous() gi = g.imag.type(self.torch_dtype).view(-1,Nbatch).contiguous() else: y = y.permute(1,2,0) # K,r/i,batch g = g.permute(1,2,3,0) # nx,ny,r/i,batch gr = g[:,:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() gi = g[:,:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() gr = LazyTensor( gr[None,:,:] ) gi = LazyTensor( gi[None,:,:] ) vecx_grad_outputr = self.zx*gr vecx_grad_outputi = self.zx*gi vecy_grad_outputr = self.zy*gr vecy_grad_outputi = self.zy*gi grad = torch.zeros(xi.shape, dtype=self.torch_dtype, device=self.device) vec_grad_output_cos = vecx_grad_outputr.concat(vecx_grad_outputi).concat(vecy_grad_outputr).concat(vecy_grad_outputi) vec_grad_output_sin = vecx_grad_outputi.concat(-vecx_grad_outputr).concat(vecy_grad_outputi).concat(-vecy_grad_outputr) tmp_concat = (vec_grad_output_cos*self.cos_coupling+vec_grad_output_sin*self.sin_coupling).sum(dim=1).view(-1,4*Nbatch) tmp1r = tmp_concat[:,:Nbatch] tmp1i = tmp_concat[:,Nbatch:2*Nbatch] if iscpx: grad[:,0] = (torch.mul(tmp1i, y.real) - torch.mul(tmp1r, y.imag)).sum(dim=1) else: grad[:,0] = (torch.mul(tmp1i, y[:,0,:]) - torch.mul(tmp1r, y[:,1,:])).sum(dim=1) tmp2r = tmp_concat[:,2*Nbatch:3*Nbatch] tmp2i = tmp_concat[:,3*Nbatch:] if iscpx: grad[:,1] = (torch.mul(tmp2i, y.real) - torch.mul(tmp2r, y.imag)).sum(dim=1) else: grad[:,1] = (torch.mul(tmp2i, y[:,0,:]) - torch.mul(tmp2r, y[:,1,:])).sum(dim=1) return grad elif ndim==2 and not iscpx or ndim==1 and iscpx: if iscpx: gr = g.real.type(self.torch_dtype).view(-1,1).contiguous() gi = g.imag.type(self.torch_dtype).view(-1,1).contiguous() else: gr = g[:,:,0].type(self.torch_dtype).view(-1,1).contiguous() gi = g[:,:,1].type(self.torch_dtype).view(-1,1).contiguous() gr = LazyTensor( gr[None,:,:] ) gi = LazyTensor( gi[None,:,:] ) vecx_grad_outputr = self.zx*gr vecx_grad_outputi = self.zx*gi vecy_grad_outputr = self.zy*gr vecy_grad_outputi = self.zy*gi grad = torch.zeros(xi.shape, dtype=self.torch_dtype, device=self.device) vec_grad_output_cos = vecx_grad_outputr.concat(vecx_grad_outputi).concat(vecy_grad_outputr).concat(vecy_grad_outputi) vec_grad_output_sin = vecx_grad_outputi.concat(-vecx_grad_outputr).concat(vecy_grad_outputi).concat(-vecy_grad_outputr) tmp_concat = (vec_grad_output_cos*self.cos_coupling+vec_grad_output_sin*self.sin_coupling).sum(dim=1).view(-1,4) tmp1r = tmp_concat[:,0] tmp1i = tmp_concat[:,1] if iscpx: grad[:,0] = torch.mul(tmp1i, y.real) - torch.mul(tmp1r, y.imag) else: grad[:,0] = torch.mul(tmp1i, y[:,0]) - torch.mul(tmp1r, y[:,1]) tmp2r = tmp_concat[:,2] tmp2i = tmp_concat[:,3] if iscpx: grad[:,1] = torch.mul(tmp2i, y.real) - torch.mul(tmp2r, y.imag) else: grad[:,1] = torch.mul(tmp2i, y[:,0]) - torch.mul(tmp2r, y[:,1]) return grad else: raise Exception("Error: y should have 2 or 3 dimensions (batch mode)") def _forward3D(self, f, xi): self.test_xi(xi) ndim = len(f.shape) if ndim==5: Nbatch = f.shape[0] f = f.permute(1,2,3,4,0) # nx,ny,nz,r/i,batch fr = f[:,:,:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fi = f[:,:,:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fr = LazyTensor( fr[None,:,:] ) fi = LazyTensor( fi[None,:,:] ) f_cos = fr.concat(fi) f_sin = fi.concat(-fr) y_concat = (f_cos*self.cos_coupling+f_sin*self.sin_coupling).sum(dim=1) y = torch.zeros(self.K, 2, Nbatch, dtype=self.torch_dtype, device=self.device) y[:,0,:] = y_concat[:,:Nbatch] y[:,1,:] = y_concat[:,Nbatch:] y = y.permute(2,0,1) # batch,K,r/i return y else: raise Exception("Error: f should have 5 dimensions (batch size, nx, ny, nz, 2)") def _adjoint3D(self, y, xi): self.test_xi(xi) ndim = len(y.shape) if ndim==3: Nbatch = y.shape[0] y = y.permute(1,2,0) # K,r/i,batch yr = y[:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() yi = y[:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() yr = LazyTensor( yr[:,None,:] ) yi = LazyTensor( yi[:,None,:] ) y_cos=yr.concat(yi) y_sin=(-yi).concat(yr) f_concat = (y_cos*self.cos_coupling+y_sin*self.sin_coupling).sum(dim=0) f = torch.zeros(self.nx,self.ny,self.nz, 2, Nbatch, dtype=self.torch_dtype, device=self.device) f[:,:,:,0,:] = f_concat[:,:Nbatch].view(self.nx,self.ny,self.nz,Nbatch) f[:,:,:,1,:] = f_concat[:,Nbatch:].view(self.nx,self.ny,self.nz,Nbatch) f = f.permute(4,0,1,2,3) # batch,nx,ny,nz,r/i return f else: raise Exception("Error: y should have 3 dimensions (batch size, K, 2)") def _backward_forward3D(self, f, g, xi): self.test_xi(xi) ndim = len(f.shape) if ndim==5: Nbatch = f.shape[0] f = f.permute(1,2,3,4,0) # nx,ny,nz,r/i,batch g = g.permute(1,2,0) # K,r/i,batch fr = f[:,:,:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fi = f[:,:,:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() fr = LazyTensor( fr[None,:,:] ) fi = LazyTensor( fi[None,:,:] ) vec_frx = self.zx*fr vec_fix = self.zx*fi vec_fry = self.zy*fr vec_fiy = self.zy*fi vec_frz = self.zz*fr vec_fiz = self.zz*fi grad = torch.zeros(xi.shape, dtype=self.torch_dtype, device=self.device) vec_cos = vec_frx.concat(vec_fix).concat(vec_fry).concat(vec_fiy).concat(vec_frz).concat(vec_fiz) vec_sin = vec_fix.concat(-vec_frx).concat(vec_fiy).concat(-vec_fry).concat(vec_fiz).concat(-vec_frz) tmp_concat = (vec_cos*self.cos_coupling+vec_sin*self.sin_coupling).sum(dim=1).view(-1,6*Nbatch) tmp1r = tmp_concat[:,:Nbatch] tmp1i = tmp_concat[:,Nbatch:2*Nbatch] grad[:,0] = (torch.mul(tmp1i, g[:,0,:]) - torch.mul(tmp1r, g[:,1,:])).sum(dim=1) tmp2r = tmp_concat[:,2*Nbatch:3*Nbatch] tmp2i = tmp_concat[:,3*Nbatch:4*Nbatch] grad[:,1] = (torch.mul(tmp2i, g[:,0,:]) - torch.mul(tmp2r, g[:,1,:])).sum(dim=1) tmp3r = tmp_concat[:,4*Nbatch:5*Nbatch] tmp3i = tmp_concat[:,5*Nbatch:] grad[:,2] = (torch.mul(tmp3i, g[:,0,:]) - torch.mul(tmp3r, g[:,1,:])).sum(dim=1) return grad else: raise Exception("Error: f should have 5 dimensions (batch size, nx, ny, nz, 2)") def _backward_adjoint3D(self, y, g, xi): self.test_xi(xi) ndim = len(y.shape) if ndim==3: Nbatch = y.shape[0] y = y.permute(1,2,0) # K,r/i,batch g = g.permute(1,2,3,4,0) # nx,ny,r/i,batch gr = g[:,:,:,0,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() gi = g[:,:,:,1,:].type(self.torch_dtype).view(-1,Nbatch).contiguous() gr = LazyTensor( gr[None,:,:] ) gi = LazyTensor( gi[None,:,:] ) vecx_grad_outputr = self.zx*gr vecx_grad_outputi = self.zx*gi vecy_grad_outputr = self.zy*gr vecy_grad_outputi = self.zy*gi vecz_grad_outputr = self.zz*gr vecz_grad_outputi = self.zz*gi grad = torch.zeros(xi.shape, dtype=self.torch_dtype, device=self.device) vec_grad_output_cos = vecx_grad_outputr.concat(vecx_grad_outputi).concat(vecy_grad_outputr).concat(vecy_grad_outputi).concat(vecz_grad_outputr).concat(vecz_grad_outputi) vec_grad_output_sin = vecx_grad_outputi.concat(-vecx_grad_outputr).concat(vecy_grad_outputi).concat(-vecy_grad_outputr).concat(vecz_grad_outputi).concat(-vecz_grad_outputr) tmp_concat = (vec_grad_output_cos*self.cos_coupling+vec_grad_output_sin*self.sin_coupling).sum(dim=1).view(-1,6*Nbatch) tmp1r = tmp_concat[:,:Nbatch] tmp1i = tmp_concat[:,Nbatch:2*Nbatch] grad[:,0] = (torch.mul(tmp1i, y[:,0,:]) - torch.mul(tmp1r, y[:,1,:])).sum(dim=1) tmp2r = tmp_concat[:,2*Nbatch:3*Nbatch] tmp2i = tmp_concat[:,3*Nbatch:4*Nbatch] grad[:,1] = (torch.mul(tmp2i, y[:,0,:]) - torch.mul(tmp2r, y[:,1,:])).sum(dim=1) tmp3r = tmp_concat[:,4*Nbatch:5*Nbatch] tmp3i = tmp_concat[:,5*Nbatch:] grad[:,2] = (torch.mul(tmp3i, y[:,0,:]) - torch.mul(tmp3r, y[:,1,:])).sum(dim=1) return grad else: raise Exception("Error: y should have 3 dimensions (batch size, K, 2)") nufft=Nufft() class FClass(torch.autograd.Function): @staticmethod def forward(ctx, xi, f): ctx.save_for_backward(xi, f) output = nufft.forward(f, xi) return output @staticmethod def backward(ctx, grad_output): xi, f = ctx.saved_tensors grad_input = nufft.backward_forward(f, grad_output, xi) grad_input_f = nufft.adjoint(grad_output, xi) return grad_input, grad_input_f class FtClass(torch.autograd.Function): @staticmethod def forward(ctx, xi, y): ctx.save_for_backward(xi, y) output = nufft.adjoint(y, xi) return output @staticmethod def backward(ctx, grad_output): xi, y = ctx.saved_tensors grad_input = nufft.backward_adjoint(y, grad_output, xi) grad_input_y = nufft.forward(grad_output, xi) return grad_input, grad_input_y forward = FClass.apply adjoint = FtClass.apply
43.939024
184
0.539042
3,094
21,618
3.638009
0.046542
0.027985
0.068408
0.068763
0.908849
0.886727
0.872779
0.846482
0.821429
0.803749
0
0.032025
0.295124
21,618
491
185
44.028513
0.706654
0.018734
0
0.685096
0
0
0.020439
0
0
0
0
0
0
1
0.033654
false
0
0.007212
0
0.086538
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
18af57b6ce40c620300712d55b95264ee514e588
54
py
Python
cal/__init__.py
sim6998/Python-Tutorials
07bead55b6b9a6bbdc2479907de06f28761aca59
[ "MIT" ]
null
null
null
cal/__init__.py
sim6998/Python-Tutorials
07bead55b6b9a6bbdc2479907de06f28761aca59
[ "MIT" ]
null
null
null
cal/__init__.py
sim6998/Python-Tutorials
07bead55b6b9a6bbdc2479907de06f28761aca59
[ "MIT" ]
null
null
null
from cal.sum import getSum from cal.sub import getSub
27
27
0.814815
10
54
4.4
0.7
0.318182
0
0
0
0
0
0
0
0
0
0
0.148148
54
2
28
27
0.956522
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
18c88e003632abd2e6f42a110e639d276342dadd
23
py
Python
hello.py
dvhankerson/BroadbandSubs
5dad024d85c57fa4cdc69ee5c159dd7f69460a26
[ "MIT" ]
null
null
null
hello.py
dvhankerson/BroadbandSubs
5dad024d85c57fa4cdc69ee5c159dd7f69460a26
[ "MIT" ]
null
null
null
hello.py
dvhankerson/BroadbandSubs
5dad024d85c57fa4cdc69ee5c159dd7f69460a26
[ "MIT" ]
null
null
null
print "hello, github!"
11.5
22
0.695652
3
23
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
23
1
23
23
0.8
0
0
0
0
0
0.608696
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
6
18d81e022916b5684a27f9a4260ab414698a7615
59
py
Python
catkin_ws/devel/lib/python2.7/dist-packages/localize/msg/__init__.py
preethamam/ROS-TurtleBot-2DAreaScanning
bcd6c976347839d5f2d2bca15c331cf4de8af342
[ "MIT" ]
null
null
null
catkin_ws/devel/lib/python2.7/dist-packages/localize/msg/__init__.py
preethamam/ROS-TurtleBot-2DAreaScanning
bcd6c976347839d5f2d2bca15c331cf4de8af342
[ "MIT" ]
null
null
null
catkin_ws/devel/lib/python2.7/dist-packages/localize/msg/__init__.py
preethamam/ROS-TurtleBot-2DAreaScanning
bcd6c976347839d5f2d2bca15c331cf4de8af342
[ "MIT" ]
null
null
null
from ._slam_stamped import * from ._theta_stamped import *
19.666667
29
0.79661
8
59
5.375
0.625
0.604651
0
0
0
0
0
0
0
0
0
0
0.135593
59
2
30
29.5
0.843137
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
e13e87485c3eb3a77597e73bd1135a6140a42a51
2,542
py
Python
example/example.py
Andoryuuta/PyRSAref
bcb1502334d8041e7dd756f8e69eb07e77d207fd
[ "MIT" ]
null
null
null
example/example.py
Andoryuuta/PyRSAref
bcb1502334d8041e7dd756f8e69eb07e77d207fd
[ "MIT" ]
null
null
null
example/example.py
Andoryuuta/PyRSAref
bcb1502334d8041e7dd756f8e69eb07e77d207fd
[ "MIT" ]
null
null
null
import pyrsaref from hexdump import hexdump """" # Known-value test rsa = pyrsaref.CryptRSA() pub_key = bytes([0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC5, 0xF0, 0x0F, 0x14, 0x34, 0xA4, 0x98, 0x97, 0x82, 0x87, 0x11, 0x84, 0xEC, 0x0F, 0x59, 0xB2, 0xFA, 0x9C, 0x02, 0xD7, 0x1F, 0x91, 0x46, 0x73, 0x51, 0xFE, 0x24, 0x82, 0xF1, 0x1B, 0xB8, 0xA4, 0x75, 0x0B, 0x78, 0x51, 0x97, 0x0A, 0x80, 0x50, 0xA9, 0xCE, 0xF4, 0x97, 0x9A, 0x86, 0x0A, 0xEA, 0x58, 0xDB, 0x4B, 0x65, 0xFA, 0xA0, 0x2E, 0xF0, 0xBD, 0x99, 0xC4, 0xE4, 0x3C, 0xE4, 0x9E, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]) rsa.set_key(pub_key, pyrsaref.MODE_PUBLIC) rsa.set_randstate(bytes([0x00, 0x00, 0x00, 0x00, 0x1a, 0xf3, 0xc6, 0xf5, 0xab, 0x90, 0x68, 0xe0, 0x11, 0x14, 0xc5, 0x8b, 0xf6, 0x54, 0x91, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0xd6, 0x00, 0x00, 0x00, 0x01, 0x01, 0x53, 0x00, 0x00, 0x00, 0x01])) aes_key = bytes([0xAA] * 256) rsa.encrypt(aes_key, pyrsaref.MODE_PUBLIC) hexdump(rsa.get_data()) """ s = pyrsaref.CryptRSA() sr = pyrsaref.CryptRSA() s.make_keys() # Make a encrypted message on the server: s.encrypt(b'TEST' * 64, pyrsaref.MODE_PRIVATE) secret_message = s.get_data() #hexdump(secret_message) # "Send" server public key to client pub_key = s.get_key(pyrsaref.MODE_PUBLIC) sr.set_key(pub_key, pyrsaref.MODE_PUBLIC) # Decrypt secret message from client receiver sr.decrypt(secret_message, pyrsaref.MODE_PUBLIC) hexdump(sr.get_data())
65.179487
1,577
0.693155
414
2,542
4.200483
0.268116
0.92927
1.352501
1.748131
0.508338
0.494537
0.494537
0.460035
0.439333
0.439333
0
0.393883
0.151062
2,542
38
1,578
66.894737
0.411956
0.055468
0
0
0
0
0.011364
0
0
0
0
0
0
1
0
false
0
0.181818
0
0.181818
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
beeaf72f82ba26ea47f96f8f0bb0ce6bdaca2432
53
py
Python
src/CBP/__init__.py
b29308188/cs598vqa
fc45af29c08288d97cbe6145489e754b1dca267e
[ "MIT" ]
null
null
null
src/CBP/__init__.py
b29308188/cs598vqa
fc45af29c08288d97cbe6145489e754b1dca267e
[ "MIT" ]
null
null
null
src/CBP/__init__.py
b29308188/cs598vqa
fc45af29c08288d97cbe6145489e754b1dca267e
[ "MIT" ]
null
null
null
from count_sketch import count_sketch, bilinear_pool
26.5
52
0.886792
8
53
5.5
0.75
0.5
0
0
0
0
0
0
0
0
0
0
0.09434
53
1
53
53
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
bef840d96ef3b9a20b3d3befcc66f6ef40285ca3
43
py
Python
aave-server/app/tasks/worker.py
zoek1/Birdwatching
c447d7c7e59577ff9bc647093a6799fc96a7cb10
[ "MIT" ]
null
null
null
aave-server/app/tasks/worker.py
zoek1/Birdwatching
c447d7c7e59577ff9bc647093a6799fc96a7cb10
[ "MIT" ]
null
null
null
aave-server/app/tasks/worker.py
zoek1/Birdwatching
c447d7c7e59577ff9bc647093a6799fc96a7cb10
[ "MIT" ]
null
null
null
from common.tasks import app as scheduler
14.333333
41
0.813953
7
43
5
1
0
0
0
0
0
0
0
0
0
0
0
0.162791
43
2
42
21.5
0.972222
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
55dcff63fc32a81a50382c933ea0c01f025d10de
44
py
Python
nes/darts/re/__init__.py
automl/nes
1c54786c30acd6e19eb9708204bffc86b58ea272
[ "Apache-2.0" ]
26
2020-06-22T16:07:54.000Z
2022-03-23T08:12:05.000Z
nes/darts/re/__init__.py
automl/nes
1c54786c30acd6e19eb9708204bffc86b58ea272
[ "Apache-2.0" ]
2
2020-07-13T06:23:18.000Z
2022-03-31T07:30:18.000Z
nes/darts/re/__init__.py
automl/nes
1c54786c30acd6e19eb9708204bffc86b58ea272
[ "Apache-2.0" ]
4
2020-07-06T01:55:16.000Z
2021-08-02T00:00:14.000Z
from .re_master import RegularizedEvolution
22
43
0.886364
5
44
7.6
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
44
1
44
44
0.95
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
55e1267affa8b0dabf00c5e173aed442817862ea
156
py
Python
file/admin.py
CaptainMorch/TJU_Cats
c0f692ffce9132936538b991b825744d89933ea7
[ "MIT" ]
null
null
null
file/admin.py
CaptainMorch/TJU_Cats
c0f692ffce9132936538b991b825744d89933ea7
[ "MIT" ]
null
null
null
file/admin.py
CaptainMorch/TJU_Cats
c0f692ffce9132936538b991b825744d89933ea7
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Photo # Register your models here. @admin.register(Photo) class PhotoAdmin(admin.ModelAdmin): pass
22.285714
35
0.788462
21
156
5.857143
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.134615
156
7
36
22.285714
0.911111
0.166667
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0.4
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6
55e6bfecacb5f0461c12c81f6f75878efdec8c17
57
py
Python
willard/__init__.py
cfr2ak/willard
c45e51f2a27f0727b5e55269b266dfbaa752a6f9
[ "MIT" ]
1
2022-01-13T22:30:16.000Z
2022-01-13T22:30:16.000Z
willard/__init__.py
cfr2ak/willard
c45e51f2a27f0727b5e55269b266dfbaa752a6f9
[ "MIT" ]
7
2019-10-14T04:31:51.000Z
2019-11-19T11:27:43.000Z
willard/__init__.py
cfr2ak/willard
c45e51f2a27f0727b5e55269b266dfbaa752a6f9
[ "MIT" ]
null
null
null
from . import type from . import const from . import alg
14.25
19
0.736842
9
57
4.666667
0.555556
0.714286
0
0
0
0
0
0
0
0
0
0
0.210526
57
3
20
19
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
55f6f107d12828727e0231597afe8d40f7b11079
31
py
Python
src/elicznik/__init__.py
mlesniew/elicznik
fdec5f26a3aadde94e15f1783eef74b18426099d
[ "MIT" ]
null
null
null
src/elicznik/__init__.py
mlesniew/elicznik
fdec5f26a3aadde94e15f1783eef74b18426099d
[ "MIT" ]
1
2022-01-29T09:52:19.000Z
2022-01-29T09:52:19.000Z
src/elicznik/__init__.py
mlesniew/elicznik
fdec5f26a3aadde94e15f1783eef74b18426099d
[ "MIT" ]
2
2022-01-29T05:50:52.000Z
2022-03-30T14:04:18.000Z
from .elicznik import ELicznik
15.5
30
0.83871
4
31
6.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.129032
31
1
31
31
0.962963
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
36098ed6338b697562b6b8ae7b8559c0481aebcf
53
py
Python
yass/__init__.py
mardix/yass
32f804c1a916f5b0a13d13fa750e52be3b6d666d
[ "MIT" ]
2
2017-02-26T23:31:24.000Z
2017-02-27T12:26:59.000Z
yass/__init__.py
mardix/yass
32f804c1a916f5b0a13d13fa750e52be3b6d666d
[ "MIT" ]
1
2021-03-25T21:27:39.000Z
2021-03-25T21:27:39.000Z
yass/__init__.py
mardix/yass
32f804c1a916f5b0a13d13fa750e52be3b6d666d
[ "MIT" ]
1
2020-02-25T14:00:15.000Z
2020-02-25T14:00:15.000Z
from .yass import Yass import publisher import re
7.571429
22
0.773585
8
53
5.125
0.625
0.487805
0
0
0
0
0
0
0
0
0
0
0.207547
53
6
23
8.833333
0.97619
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
360fa132389d618ea3f8081d2f37aaaa4cfc33f0
6,519
py
Python
tatum/ledger/account.py
Narasimha-sai/Tatum
a4ff464806e03fb0490abe21f5378cffd5f87be1
[ "MIT" ]
null
null
null
tatum/ledger/account.py
Narasimha-sai/Tatum
a4ff464806e03fb0490abe21f5378cffd5f87be1
[ "MIT" ]
null
null
null
tatum/ledger/account.py
Narasimha-sai/Tatum
a4ff464806e03fb0490abe21f5378cffd5f87be1
[ "MIT" ]
1
2022-02-03T06:46:11.000Z
2022-02-03T06:46:11.000Z
import http.client import json import validator.ledger as ledger_validator import requests import os from dotenv import load_dotenv load_dotenv() conn = http.client.HTTPSConnection(os.environ['API_URL']) API_KEY = os.environ['API_KEY'] def headers(for_post = False): if for_post: return { 'content-type': "application/json", 'x-api-key': API_KEY } else: return { 'x-api-key': API_KEY } def create_new_account(body_params): if ledger_validator.create_new_account(body_params): body_params = json.dumps(body_params) conn.request("POST", "/v3/ledger/account", body_params, headers=headers(for_post=True)) res = conn.getresponse() data = res.read() return data.decode("utf-8") def create_multiple_accounts_in_batch_call(body_params): if ledger_validator.create_multiple_accounts_in_batch_call(body_params): body_params=json.dumps(body_params) conn.request("POST", "/v3/ledger/account/batch", body_params, headers=headers(for_post=True)) res = conn.getresponse() data = res.read() return data.decode("utf-8") def list_all_accounts(query_params): if ledger_validator.page_size_query_params(query_params): if len(query_params) != 1: conn.request("GET", "/v3/ledger/account?pageSize={}&offset={}".format(query_params['pageSize'], query_params['offset']), headers=headers()) else: conn.request("GET", "/v3/ledger/account?pageSize={}".format(query_params['pageSize']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def list_all_customer_accounts(path_params, query_params): if ledger_validator.list_all_customer_accounts(path_params, query_params): if len(query_params) != 1: conn.request("GET", "/v3/ledger/account/customer/{}?pageSize={}&offset={}".format(path_params['id'], query_params['pageSize'], query_params['offset']), headers=headers()) else: conn.request("GET", "/v3/ledger/account/customer/{}?pageSize={}".format(path_params['id'], query_params['pageSize']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def get_account_by_ID(path_params): if ledger_validator.id_path_param(path_params): conn.request("GET", "/v3/ledger/account/{}".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def update_account(path_params,body_params): if ledger_validator.update_account(path_params,body_params): body_params = json.dumps(body_params) conn.request("PUT", "/v3/ledger/account/{}".format(path_params['id']) ,body_params, headers=headers(for_post=True)) res = conn.getresponse() data = res.read() return data.decode("utf-8") def get_account_balance(path_params): if ledger_validator.id_path_param(path_params): conn.request("GET", "/v3/ledger/account/{}/balance".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def block_amount_on_account(path_params, body_params): if ledger_validator.block_amount_on_account(path_params, body_params): body_params = json.dumps(body_params) conn.request("POST", "/v3/ledger/account/block/{}".format(path_params['id']), body_params, headers=headers(for_post=True)) res = conn.getresponse() data = res.read() return data.decode("utf-8") def unlock_amount_on_account_and_perform_transaction(path_params, body_params): if ledger_validator.unlock_amount_on_account_and_perform_transaction(path_params, body_params): body_params = json.dumps(body_params) conn.request("PUT", "/v3/ledger/account/block/{}".format(path_params['id']), body_params, headers=headers(for_post=True)) res = conn.getresponse() data = res.read() return data.decode("utf-8") def unblock_blocked_amount_on_account(path_params): if ledger_validator.id_path_param(path_params): conn.request("DELETE", "/v3/ledger/account/block/{}".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def get_blocked_amounts_on_account(path_params, query_params): if ledger_validator.get_blocked_amounts_on_account(path_params, query_params): if len(query_params) != 1: conn.request("GET", "/v3/ledger/account/block/{}?pageSize={}&offset={}".format(path_params['id'], query_params['pageSize'], query_params['offset']), headers=headers()) else: conn.request("GET", "/v3/ledger/account/block/{}?pageSize={}".format(path_params['id'], query_params['pageSize']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def unblock_all_blocked_amounts_on_account(path_params): if ledger_validator.id_path_param(path_params): conn.request("DELETE", "/v3/ledger/account/block/{}".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def activate_account(path_params): if ledger_validator.id_path_param(path_params): conn.request("PUT", "/v3/ledger/account/{}/activate".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def deactivate_account(path_params): if ledger_validator.id_path_param(path_params): conn.request("PUT", "/v3/ledger/account/{}/deactivate".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def freeze_account(path_params): if ledger_validator.id_path_param(path_params): conn.request("PUT", "/v3/ledger/account/{}/freeze".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8") def unfreeze_account(path_params): if ledger_validator.id_path_param(path_params): conn.request("PUT", "/v3/ledger/account/{}/unfreeze".format(path_params['id']), headers=headers()) res = conn.getresponse() data = res.read() return data.decode("utf-8")
43.751678
182
0.672036
841
6,519
4.969084
0.10107
0.09811
0.068198
0.088059
0.904523
0.883944
0.865757
0.850682
0.798995
0.784159
0
0.007094
0.178248
6,519
149
183
43.751678
0.773007
0
0
0.573643
0
0
0.13727
0.08819
0
0
0
0
0
1
0.131783
false
0
0.046512
0
0.317829
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
3617f66a5d43786f620f93b054621220a45072b5
10,078
py
Python
tests/unit/utils/test_timestamps.py
ahertz/pyowm
e7ccb5ec3f86bee0cbb9981070a62988a83a5b3c
[ "MIT" ]
799
2015-01-03T12:07:57.000Z
2022-03-31T03:59:53.000Z
tests/unit/utils/test_timestamps.py
ahertz/pyowm
e7ccb5ec3f86bee0cbb9981070a62988a83a5b3c
[ "MIT" ]
279
2015-02-12T16:11:43.000Z
2022-02-14T21:49:03.000Z
tests/unit/utils/test_timestamps.py
ahertz/pyowm
e7ccb5ec3f86bee0cbb9981070a62988a83a5b3c
[ "MIT" ]
215
2015-01-06T19:07:11.000Z
2022-02-14T21:39:33.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from datetime import datetime, date, timedelta, timezone from pyowm.utils import timestamps, formatting class TestTimeUtils(unittest.TestCase): def is_timezone_aware(self, dt): self.assertIsNotNone(dt.tzinfo) self.assertIsNotNone(dt.tzinfo.utcoffset(dt)) def test_tomorrow(self): now = datetime.now(timezone.utc) tomorrow = date.today() + timedelta(days=1) result = timestamps.tomorrow() expected = datetime(tomorrow.year, tomorrow.month, tomorrow.day, now.hour, now.minute, 0, 0, timezone.utc) self.assertEqual(expected, result) self.is_timezone_aware(result) def test_tomorrow_with_hour_and_minute(self): tomorrow = date.today() + timedelta(days=1) result = timestamps.tomorrow(18, 56) expected = datetime(tomorrow.year, tomorrow.month, tomorrow.day, 18, 56, 0, 0, timezone.utc) self.assertEqual(expected, result) self.is_timezone_aware(result) def test_tomorrow_with_hour_only(self): now = datetime.now(timezone.utc) tomorrow = date.today() + timedelta(days=1) result = timestamps.tomorrow(6) expected = datetime(tomorrow.year, tomorrow.month, tomorrow.day, 6, now.minute, 0, 0, timezone.utc) self.assertEqual(expected, result) self.is_timezone_aware(result) def test_yesterday(self): now = datetime.now(timezone.utc) yesterday = date.today() + timedelta(days=-1) result = timestamps.yesterday() expected = datetime(yesterday.year, yesterday.month, yesterday.day, now.hour, now.minute, 0, 0, timezone.utc) self.assertEqual(expected, result) self.is_timezone_aware(result) def test_yesterday_with_hour_and_minute(self): yesterday = date.today() + timedelta(days=-1) result = timestamps.yesterday(18, 56) expected = datetime(yesterday.year, yesterday.month, yesterday.day, 18, 56, 0, 0, timezone.utc) self.assertEqual(expected, result) self.is_timezone_aware(result) def test_yesterday_with_hour_only(self): now = datetime.now(timezone.utc) yesterday = date.today() + timedelta(days=-1) result = timestamps.yesterday(6) expected = datetime(yesterday.year, yesterday.month, yesterday.day, 6, now.minute, 0, 0, timezone.utc) self.assertEqual(expected, result) self.is_timezone_aware(result) def test_next_three_hours(self): result = timestamps.next_three_hours() expected = datetime.now(timezone.utc) + timedelta(hours=3) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_next_three_hours_after_specified_time(self): d = datetime(2013, 12, 7, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(hours=3) result = timestamps.next_three_hours(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_last_three_hours(self): result = timestamps.last_three_hours() expected = datetime.now(timezone.utc) + timedelta(hours=-3) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_last_three_hours_before_specified_time(self): d = datetime(2013, 12, 7, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(hours=-3) result = timestamps.last_three_hours(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_next_hour(self): result = timestamps.next_hour() expected = datetime.now(timezone.utc) + timedelta(hours=1) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_next_hour_after_specified_time(self): d = datetime(2013, 12, 7, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(hours=1) result = timestamps.next_hour(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_next_week(self): result = timestamps.next_week() expected = datetime.now(timezone.utc) + timedelta(days=7) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_next_week_after_specified_time(self): d = datetime(2013, 12, 7, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(days=7) result = timestamps.next_week(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_last_week(self): result = timestamps.last_week() expected = datetime.now(timezone.utc) + timedelta(days=-7) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_last_week_after_specified_time(self): d = datetime(2013, 12, 7, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(days=-7) result = timestamps.last_week(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_last_hour(self): result = timestamps.last_hour() expected = datetime.now(timezone.utc) + timedelta(hours=-1) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_last_hour_after_specified_time(self): d = datetime(2013, 12, 7, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(hours=-1) result = timestamps.last_hour(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_now(self): expected = datetime.now(timezone.utc) result = timestamps.now() self.assertEqual(result.year, expected.year) self.assertEqual(result.month, expected.month) self.assertEqual(result.day, expected.day) self.assertEqual(result.hour, expected.hour) self.assertEqual(result.minute, expected.minute) self.assertEqual(result.second, expected.second) self.is_timezone_aware(result) def test_last_month(self): result = timestamps.last_month() expected = datetime.now(timezone.utc) + timedelta(days=-30) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_last_month_after_specified_time(self): d = datetime(2015, 10, 1, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(days=-30) result = timestamps.last_month(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_next_month(self): result = timestamps.next_month() expected = datetime.now(timezone.utc) + timedelta(days=30) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_next_month_after_specified_time(self): d = datetime(2015, 10, 1, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(days=30) result = timestamps.next_month(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_last_year(self): result = timestamps.last_year() expected = datetime.now(timezone.utc) + timedelta(days=-365) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_last_year_after_specified_time(self): d = datetime(2015, 10, 1, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(days=-365) result = timestamps.last_year(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_next_year(self): result = timestamps.next_year() expected = datetime.now(timezone.utc) + timedelta(days=365) self.assertAlmostEqual( float(formatting.to_UNIXtime(expected)), float(formatting.to_UNIXtime(result))) self.is_timezone_aware(result) def test_next_year_after_specified_time(self): d = datetime(2015, 10, 1, 15, 46, 12, 0, timezone.utc) expected = d + timedelta(days=365) result = timestamps.next_year(d) self.assertAlmostEqual(expected, result) self.is_timezone_aware(result) def test_millis_offset_between_epochs(self): # test failures with self.assertRaises(AssertionError): timestamps.millis_offset_between_epochs('test', 123456) with self.assertRaises(AssertionError): timestamps.millis_offset_between_epochs(123456, 'test') # test normal behaviour reference_epoch = 1525176000 target_epoch_1 = 1525176060 target_epoch_2 = 1522584000 expected_1 = (target_epoch_1 - reference_epoch) * 1000 expected_2 = (target_epoch_2 - reference_epoch) * 1000 self.assertEqual(expected_1, timestamps.millis_offset_between_epochs(reference_epoch, target_epoch_1)) self.assertEqual(expected_2, timestamps.millis_offset_between_epochs(reference_epoch, target_epoch_2)) self.assertEqual(0, timestamps.millis_offset_between_epochs(reference_epoch, reference_epoch))
40.96748
110
0.661342
1,186
10,078
5.419899
0.080101
0.053049
0.065339
0.079807
0.834163
0.816739
0.816739
0.809116
0.761979
0.696795
0
0.035311
0.235662
10,078
245
111
41.134694
0.799169
0.00774
0
0.490291
0
0
0.0008
0
0
0
0
0
0.18932
1
0.140777
false
0
0.014563
0
0.160194
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
367e37dfaf97fce86ea7ebbb4d8f613070e7b7f1
42
py
Python
abmarl/sim/corridor/__init__.py
Leonardo767/Abmarl
9fada5447b09174c6a70b6032b4a8d08b66c4589
[ "Apache-2.0" ]
7
2020-11-13T01:33:44.000Z
2021-03-05T14:30:34.000Z
abmarl/sim/corridor/__init__.py
Leonardo767/Abmarl
9fada5447b09174c6a70b6032b4a8d08b66c4589
[ "Apache-2.0" ]
91
2020-11-04T23:34:30.000Z
2021-06-08T17:18:00.000Z
abmarl/sim/corridor/__init__.py
Leonardo767/Abmarl
9fada5447b09174c6a70b6032b4a8d08b66c4589
[ "Apache-2.0" ]
6
2021-07-12T19:28:51.000Z
2022-03-01T00:50:02.000Z
from .multi_corridor import MultiCorridor
21
41
0.880952
5
42
7.2
1
0
0
0
0
0
0
0
0
0
0
0
0.095238
42
1
42
42
0.947368
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
36ef5b50827b431e88c585b422c5723b820627c2
140
py
Python
aws_dynamodb_policies/aws_dynamodb_table_encryption.py
designing-penguin/panther-analysis
26034cea4504f43227f8d3789225f6ca7b35dfe0
[ "Apache-2.0" ]
1
2020-10-21T08:14:49.000Z
2020-10-21T08:14:49.000Z
aws_dynamodb_policies/aws_dynamodb_table_encryption.py
designing-penguin/panther-analysis
26034cea4504f43227f8d3789225f6ca7b35dfe0
[ "Apache-2.0" ]
null
null
null
aws_dynamodb_policies/aws_dynamodb_table_encryption.py
designing-penguin/panther-analysis
26034cea4504f43227f8d3789225f6ca7b35dfe0
[ "Apache-2.0" ]
null
null
null
def policy(resource): return (resource['SSEDescription'] is not None and resource['SSEDescription']['Status'] == 'ENABLED')
35
62
0.657143
14
140
6.571429
0.785714
0.478261
0
0
0
0
0
0
0
0
0
0
0.192857
140
3
63
46.666667
0.814159
0
0
0
0
0
0.292857
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
6
36ef91833e6ae3a593ca5a64f1ee869589e9be29
194
py
Python
API_testes/tests/test_get.py
tavares-douglas/S206_testes
49bce4e12d58296250a5af68efe87d9a25e86bad
[ "MIT" ]
null
null
null
API_testes/tests/test_get.py
tavares-douglas/S206_testes
49bce4e12d58296250a5af68efe87d9a25e86bad
[ "MIT" ]
null
null
null
API_testes/tests/test_get.py
tavares-douglas/S206_testes
49bce4e12d58296250a5af68efe87d9a25e86bad
[ "MIT" ]
null
null
null
import requests from scripts.getting_data import generate_response as gr def test_status_and_data(): _, response = gr() assert response.get('status') and len(response.get('data')) > 0
24.25
67
0.737113
28
194
4.892857
0.642857
0.131387
0
0
0
0
0
0
0
0
0
0.006098
0.154639
194
7
68
27.714286
0.829268
0
0
0
1
0
0.051813
0
0
0
0
0
0.2
1
0.2
true
0
0.4
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
7fe52537b558422059498a7b0fa2ebb6da9692a2
16,254
py
Python
templates/aws-cloudfront-waf/source/log_parser/build_athena_queries.py
zxkane/aws-cloudfront-extensions
cca8334f3777d3c5170113990b28b00bac34ddf6
[ "Apache-2.0" ]
678
2016-10-10T14:32:01.000Z
2022-03-26T19:44:59.000Z
templates/aws-cloudfront-waf/source/log_parser/build_athena_queries.py
zxkane/aws-cloudfront-extensions
cca8334f3777d3c5170113990b28b00bac34ddf6
[ "Apache-2.0" ]
203
2016-10-14T03:06:47.000Z
2022-03-31T07:04:40.000Z
templates/aws-cloudfront-waf/source/log_parser/build_athena_queries.py
zxkane/aws-cloudfront-extensions
cca8334f3777d3c5170113990b28b00bac34ddf6
[ "Apache-2.0" ]
346
2016-10-10T22:24:50.000Z
2022-03-12T23:31:59.000Z
############################################################################## # Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # or in the "license" file accompanying this file. This file is # # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # # KIND, express or implied. See the License for the specific language # # governing permissions and limitations under the License. # ############################################################################## import datetime def build_athena_query_for_app_access_logs( log, log_type, database_name, table_name, end_timestamp, waf_block_period, error_threshold): """ This function dynamically builds athena query for cloudfront logs by adding partition values: year, month, day, hour. It splits query into three parts, builds them one by one and then concatenate them together into one final query. Args: log: logging object database_name: string. The Athena/Glue database name table_name: string. The Athena/Glue table name end_timestamp: datetime. The end time stamp of the logs being scanned waf_block_period: int. The period (in minutes) to block applicable IP addresses error_threshold: int. The maximum acceptable bad requests per minute per IP address Returns: Athena query string """ log.info( '[build_athena_query_for_app_access_logs] Start') # ------------------------------------------------ log.debug( "[build_athena_query_for_app_access_logs] \ Get start and end time stamps") # ------------------------------------------------ query_string = "" start_timestamp = end_timestamp - \ datetime.timedelta(seconds=60*waf_block_period) log.info( "[build_athena_query_for_app_access_logs] \ start time: %s; end time: %s" %(start_timestamp, end_timestamp)) # ------------------------------------------------- log.debug( "[build_athena_query_for_app_access_logs] \ Build query") # -------------------------------------------------- if log_type == 'CLOUDFRONT': query_string = build_athena_query_part_one_for_cloudfront_logs( log, database_name, table_name) else: # ALB logs query_string = build_athena_query_part_one_for_alb_logs( log, database_name, table_name) query_string = query_string + \ build_athena_query_part_two_for_partition( log, start_timestamp, end_timestamp) query_string = query_string + \ build_athena_query_part_three_for_app_access_logs( log, error_threshold, start_timestamp, end_timestamp) log.info( "[build_athena_query_for_app_access_logs] \ Query string:\n %s"%query_string) log.info( '[build_athena_query_for_app_access_logs] End') return query_string def build_athena_query_for_waf_logs( log, database_name, table_name, end_timestamp, waf_block_period, request_threshold): """ This function dynamically builds athena query for cloudfront logs by adding partition values: year, month, day, hour. It splits query into three parts, builds them one by one and then concatenate them together into one final query. Args: log: logging object database_name: string. The Athena/Glue database name table_name: string. The Athena/Glue table name end_timestamp: datetime. The end time stamp of the logs being scanned waf_block_period: int. The period (in minutes) to block applicable IP addresses request_threshold: int. The maximum acceptable bad requests per minute per IP address Returns: Athena query string """ log.info( '[build_athena_query_for_waf_logs] Start') # ------------------------------------------------ log.debug( "[build_athena_query_for_waf_logs] \ Get start and end time stamps") # ------------------------------------------------ query_string = "" start_timestamp = end_timestamp - \ datetime.timedelta(seconds=60*waf_block_period) log.info( "[build_athena_query_for_waf_logs] \ start time: %s; end time: %s" %(start_timestamp, end_timestamp)) # ------------------------------------------------- log.debug( "[build_athena_query_for_waf_logs] \ Build query") # -------------------------------------------------- query_string = build_athena_query_part_one_for_waf_logs( log, database_name, table_name) query_string = query_string + \ build_athena_query_part_two_for_partition( log, start_timestamp, end_timestamp) query_string = query_string + \ build_athena_query_part_three_for_waf_logs( log, request_threshold, start_timestamp, end_timestamp) log.info( "[build_athena_query_for_waf_logs] \ Query string:\n %s"%query_string) log.info( '[build_athena_query_for_waf_logs] End') return query_string def build_athena_query_part_one_for_cloudfront_logs( log, database_name, table_name): """ This function dynamically builds the first part of the athena query. Args: log: logging object database_name: string. The Athena/Glue database name table_name: string. The Athena/Glue table name Returns: Athena query string """ query_string = "SELECT\n" \ "\tclient_ip,\n" \ "\tMAX_BY(counter, counter) as max_counter_per_min\n" \ " FROM (\n" \ "\tWITH logs_with_concat_data AS (\n" \ "\t\tSELECT\n" \ "\t\t\trequestip as client_ip,\n" \ "\t\t\tcast(status as varchar) as status,\n" \ "\t\t\tparse_datetime( concat( concat( format_datetime(date, 'yyyy-MM-dd'), '-' ), time ), 'yyyy-MM-dd-HH:mm:ss') AS datetime\n" \ "\t\tFROM\n" \ + "\t\t\t" \ + database_name + "." + table_name log.debug( "[build_athena_query_part_one_for_cloudfront_logs] \ Query string part One:\n %s"%query_string) return query_string def build_athena_query_part_one_for_alb_logs( log, database_name, table_name): """ This function dynamically builds the first part of the athena query. Args: log: logging object database_name: string. The Athena/Glue database name table_name: string. The Athena/Glue table name Returns: Athena query string """ query_string = "SELECT\n" \ "\tclient_ip,\n" \ "\tMAX_BY(counter, counter) as max_counter_per_min\n" \ " FROM (\n" \ "\tWITH logs_with_concat_data AS (\n" \ "\t\tSELECT\n" \ "\t\t\tclient_ip,\n" \ "\t\t\ttarget_status_code AS status,\n" \ "\t\t\tparse_datetime(time, 'yyyy-MM-dd''T''HH:mm:ss.SSSSSS''Z') AS datetime\n" \ "\t\tFROM\n" \ + "\t\t\t" \ + database_name + "." + table_name log.debug( "[build_athena_query_part_one_for_alb_logs] \ Query string part One:\n %s"%query_string) return query_string def build_athena_query_part_one_for_waf_logs( log, database_name, table_name): """ This function dynamically builds the first part of the athena query. Args: log: logging object database_name: string. The Athena/Glue database name table_name: string. The Athena/Glue table name Returns: Athena query string """ query_string = "SELECT\n" \ "\tclient_ip,\n" \ "\tMAX_BY(counter, counter) as max_counter_per_min\n" \ " FROM (\n" \ "\tWITH logs_with_concat_data AS (\n" \ "\t\tSELECT\n" \ "\t\t\thttprequest.clientip as client_ip,\n" \ "\t\t\tfrom_unixtime(timestamp/1000) as datetime\n" \ "\t\tFROM\n" \ + "\t\t\t" \ + database_name + "." + table_name log.debug( "[build_athena_query_part_one_for_waf_logs] \ Query string part One:\n %s"%query_string) return query_string def build_athena_query_part_two_for_partition( log, start_timestamp, end_timestamp): """ This function dynamically builds the second part of the athena query, where partition values are added. The query will only scan the logs in the partitions that are between start_timestamp and end_timestamp. Args: log: logging object start_timestamp: datetime. The start time stamp of the logs being scanned end_timestamp: datetime. The end time stamp of the logs being scanned Returns: Athena query string """ start_year = start_timestamp.year start_month = start_timestamp.month start_day = start_timestamp.day start_hour = start_timestamp.hour end_year = end_timestamp.year end_month = end_timestamp.month end_day = end_timestamp.day end_hour = end_timestamp.hour # same day query filter! if (start_timestamp.date() == end_timestamp.date()): log.debug( "[build_athena_query_part_two_for_partition] \ Same day query filter") query_string = "\n\t\tWHERE year = " + str(start_year) + "\n" \ "\t\tAND month = " + str(start_month).zfill(2) + "\n" \ "\t\tAND day = " + str(start_day).zfill(2) + "\n" \ "\t\tAND hour between " \ + str(start_hour).zfill(2) + " and " + str(end_hour).zfill(2) # different days - cross days query filter! elif (start_year == end_year): log.debug( "[build_athena_query_part_two_for_partition] \ Different days - cross days query filter") if (start_month == end_month): # year and month are the same, but days are different query_string = "\n\t\tWHERE year = " + str(start_year) + "\n" \ "\t\tAND month = " + str(start_month).zfill(2) + "\n" \ "\t\tAND (\n" \ "\t\t\t(day = " + str(start_day).zfill(2) + " AND hour >= " + str(start_hour).zfill(2) + ")\n" \ "\t\t\tOR (day = " + str(end_day).zfill(2) + " AND hour <= " + str(end_hour).zfill(2) + ")\n" \ "\t\t)\n" else: # years are the same, but months and days are different query_string = "\n\t\tWHERE year = " + str(start_year) + "\n" \ "\t\tAND (\n" \ "\t\t\t(month = " + str(start_month).zfill(2) + " AND day = " + str(start_day).zfill(2) + " AND hour >= " + str(start_hour).zfill(2) + ")\n" \ "\t\t\tOR (month = " + str(end_month).zfill(2) + " AND day = " + str(end_day).zfill(2) + " AND hour <= " + str(end_hour).zfill(2) + ")\n" \ "\t\t)\n" else: # years are different log.debug( "[build_athena_query_part_two_for_partition] \ Different years - cross years query filter") query_string = "\n\t\tWHERE (year = " + str(start_year) + "\n" \ "\t\t\tAND month = " + str(start_month).zfill(2) + "\n" \ "\t\t\tAND day = " + str(start_day).zfill(2) + "\n" \ "\t\t\tAND hour >= " + str(start_hour).zfill(2) + ")\n" \ "\t\tOR (year = " + str(end_year) + "\n" \ "\t\t\tAND month = " + str(end_month).zfill(2) + "\n" \ "\t\t\tAND day = " + str(end_day).zfill(2) + "\n" \ "\t\t\tAND hour <= " + str(end_hour).zfill(2) + ")\n" \ log.debug( "[build_athena_query_part_two_for_partition] \ Query string part Two:\n %s"%query_string) return query_string def build_athena_query_part_three_for_app_access_logs( log, error_threshold, start_timestamp, end_timestamp): """ This function dynamically builds the third part of the athena query. Args: log: logging object error_threshold: int. The maximum acceptable bad requests per minute per IP address start_timestamp: datetime. The start time stamp of the logs being scanned end_timestamp: datetime. The end time stamp of the logs being scanned Returns: Athena query string """ query_string = "\n\t)\n" \ "\tSELECT\n" \ "\t\tclient_ip,\n" \ "\t\tCOUNT(*) as counter\n" \ "\tFROM\n" \ "\t\tlogs_with_concat_data\n" \ "\tWHERE\n" \ "\t\tdatetime > TIMESTAMP " \ + "'" + str(start_timestamp)[0:19] + "'"\ "\n\t\tAND status = ANY (VALUES '400', '401', '403', '404', '405')\n" \ "\tGROUP BY\n" \ "\t\tclient_ip,\n" \ "\t\tdate_trunc('minute', datetime)\n" \ "\tHAVING\n" \ "\t\tCOUNT(*) >= " \ + str(error_threshold) + \ "\n) GROUP BY\n" \ "\tclient_ip\n" \ "ORDER BY\n" \ "\tmax_counter_per_min DESC\n" \ "LIMIT 10000;" log.debug( "[build_athena_query_part_three_for_app_access_logs] \ Query string part Three:\n %s"%query_string) return query_string def build_athena_query_part_three_for_waf_logs( log, request_threshold, start_timestamp, end_timestamp): """ This function dynamically builds the third part of the athena query. Args: log: logging object error_threshold: int. The maximum acceptable bad requests per minute per IP address start_timestamp: datetime. The start time stamp of the logs being scanned end_timestamp: datetime. The end time stamp of the logs being scanned Returns: Athena query string """ request_threshold_calculated = request_threshold / 5 query_string = "\n\t)\n" \ "\tSELECT\n" \ "\t\tclient_ip,\n" \ "\t\tCOUNT(*) as counter\n" \ "\tFROM\n" \ "\t\tlogs_with_concat_data\n" \ "\tWHERE\n" \ "\t\tdatetime > TIMESTAMP " \ + "'" + str(start_timestamp)[0:19] + "'"\ "\n\tGROUP BY\n" \ "\t\tclient_ip,\n" \ "\t\tdate_trunc('minute', datetime)\n" \ "\tHAVING\n" \ "\t\tCOUNT(*) >= " \ + str(request_threshold_calculated) + \ "\n) GROUP BY\n" \ "\tclient_ip\n" \ "ORDER BY\n" \ "\tmax_counter_per_min DESC\n" \ "LIMIT 10000;" log.debug( "[build_athena_query_part_three_for_waf_logs] \ Query string part Three:\n %s"%query_string) return query_string
41.253807
167
0.536053
1,881
16,254
4.385433
0.119086
0.01382
0.069827
0.05334
0.834525
0.825433
0.80834
0.79343
0.77864
0.731604
0
0.006362
0.332718
16,254
393
168
41.358779
0.754195
0.289959
0
0.662281
0
0.013158
0.199196
0.057318
0
0
0
0
0
1
0.035088
false
0
0.004386
0
0.074561
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1821594288a8cc12a60b8a5fd5cf3958afb5028b
20,153
py
Python
win/devkit/other/pymel/extras/completion/py/PySide/QtDeclarative.py
leegoonz/Maya-devkit
b81fe799b58e854e4ef16435426d60446e975871
[ "ADSL" ]
10
2018-03-30T16:09:02.000Z
2021-12-07T07:29:19.000Z
win/devkit/other/pymel/extras/completion/py/PySide/QtDeclarative.py
leegoonz/Maya-devkit
b81fe799b58e854e4ef16435426d60446e975871
[ "ADSL" ]
null
null
null
win/devkit/other/pymel/extras/completion/py/PySide/QtDeclarative.py
leegoonz/Maya-devkit
b81fe799b58e854e4ef16435426d60446e975871
[ "ADSL" ]
9
2018-06-02T09:18:49.000Z
2021-12-20T09:24:35.000Z
from PySide.QtGui import QGraphicsView as _QGraphicsView from PySide.QtCore import QObject as _QObject from PySide.QtGui import QGraphicsObject as _QGraphicsObject class _Property(object): def __call__(*args, **kwargs): """ x.__call__(...) <==> x(...) """ pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def getter(*args, **kwargs): pass def read(*args, **kwargs): pass def setter(*args, **kwargs): pass def write(*args, **kwargs): pass __new__ = None class _Object(object): __dict__ = None class QDeclarativeParserStatus(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def classBegin(*args, **kwargs): pass def componentComplete(*args, **kwargs): pass __new__ = None class QDeclarativeNetworkAccessManagerFactory(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def create(*args, **kwargs): pass __new__ = None class QDeclarativeComponent(_QObject): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __nonzero__(*args, **kwargs): """ x.__nonzero__() <==> x != 0 """ pass def beginCreate(*args, **kwargs): pass def completeCreate(*args, **kwargs): pass def create(*args, **kwargs): pass def creationContext(*args, **kwargs): pass def errorString(*args, **kwargs): pass def errors(*args, **kwargs): pass def isError(*args, **kwargs): pass def isLoading(*args, **kwargs): pass def isNull(*args, **kwargs): pass def isReady(*args, **kwargs): pass def loadUrl(*args, **kwargs): pass def progress(*args, **kwargs): pass def setData(*args, **kwargs): pass def status(*args, **kwargs): pass def url(*args, **kwargs): pass Error = None Loading = None Null = None Ready = None Status = None __new__ = None progressChanged = None staticMetaObject = None statusChanged = None class QDeclarativeExtensionInterface(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def initializeEngine(*args, **kwargs): pass def registerTypes(*args, **kwargs): pass __new__ = None class QDeclarativeExpression(_QObject): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def clearError(*args, **kwargs): pass def context(*args, **kwargs): pass def engine(*args, **kwargs): pass def error(*args, **kwargs): pass def evaluate(*args, **kwargs): pass def expression(*args, **kwargs): pass def hasError(*args, **kwargs): pass def lineNumber(*args, **kwargs): pass def notifyOnValueChanged(*args, **kwargs): pass def scopeObject(*args, **kwargs): pass def setExpression(*args, **kwargs): pass def setNotifyOnValueChanged(*args, **kwargs): pass def setSourceLocation(*args, **kwargs): pass def sourceFile(*args, **kwargs): pass __new__ = None staticMetaObject = None valueChanged = None class QDeclarativeListReference(_Object): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def append(*args, **kwargs): pass def at(*args, **kwargs): pass def canAppend(*args, **kwargs): pass def canAt(*args, **kwargs): pass def canClear(*args, **kwargs): pass def canCount(*args, **kwargs): pass def clear(*args, **kwargs): pass def count(*args, **kwargs): pass def isValid(*args, **kwargs): pass def listElementType(*args, **kwargs): pass def object(*args, **kwargs): pass __new__ = None class QDeclarativePropertyMap(_QObject): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def clear(*args, **kwargs): pass def contains(*args, **kwargs): pass def count(*args, **kwargs): pass def insert(*args, **kwargs): pass def isEmpty(*args, **kwargs): pass def keys(*args, **kwargs): pass def size(*args, **kwargs): pass def value(*args, **kwargs): pass __new__ = None staticMetaObject = None valueChanged = None class QDeclarativeError(_Object): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __repr__(*args, **kwargs): """ x.__repr__() <==> repr(x) """ pass def column(*args, **kwargs): pass def description(*args, **kwargs): pass def isValid(*args, **kwargs): pass def line(*args, **kwargs): pass def setColumn(*args, **kwargs): pass def setDescription(*args, **kwargs): pass def setLine(*args, **kwargs): pass def setUrl(*args, **kwargs): pass def toString(*args, **kwargs): pass def url(*args, **kwargs): pass __new__ = None class QDeclarativeEngine(_QObject): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def addImageProvider(*args, **kwargs): pass def addImportPath(*args, **kwargs): pass def addPluginPath(*args, **kwargs): pass def baseUrl(*args, **kwargs): pass def clearComponentCache(*args, **kwargs): pass def imageProvider(*args, **kwargs): pass def importPathList(*args, **kwargs): pass def importPlugin(*args, **kwargs): pass def networkAccessManager(*args, **kwargs): pass def networkAccessManagerFactory(*args, **kwargs): pass def offlineStoragePath(*args, **kwargs): pass def outputWarningsToStandardError(*args, **kwargs): pass def pluginPathList(*args, **kwargs): pass def removeImageProvider(*args, **kwargs): pass def rootContext(*args, **kwargs): pass def setBaseUrl(*args, **kwargs): pass def setImportPathList(*args, **kwargs): pass def setNetworkAccessManagerFactory(*args, **kwargs): pass def setOfflineStoragePath(*args, **kwargs): pass def setOutputWarningsToStandardError(*args, **kwargs): pass def setPluginPathList(*args, **kwargs): pass def contextForObject(*args, **kwargs): pass def objectOwnership(*args, **kwargs): pass def setContextForObject(*args, **kwargs): pass def setObjectOwnership(*args, **kwargs): pass CppOwnership = None JavaScriptOwnership = None ObjectOwnership = None __new__ = None quit = None staticMetaObject = None warnings = None class QDeclarativeContext(_QObject): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def baseUrl(*args, **kwargs): pass def contextObject(*args, **kwargs): pass def contextProperty(*args, **kwargs): pass def engine(*args, **kwargs): pass def isValid(*args, **kwargs): pass def parentContext(*args, **kwargs): pass def resolvedUrl(*args, **kwargs): pass def setBaseUrl(*args, **kwargs): pass def setContextObject(*args, **kwargs): pass def setContextProperty(*args, **kwargs): pass __new__ = None staticMetaObject = None class QDeclarativeView(_QGraphicsView): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def engine(*args, **kwargs): pass def errors(*args, **kwargs): pass def eventFilter(*args, **kwargs): pass def initialSize(*args, **kwargs): pass def paintEvent(*args, **kwargs): pass def resizeEvent(*args, **kwargs): pass def resizeMode(*args, **kwargs): pass def rootContext(*args, **kwargs): pass def rootObject(*args, **kwargs): pass def setResizeMode(*args, **kwargs): pass def setRootObject(*args, **kwargs): pass def setSource(*args, **kwargs): pass def sizeHint(*args, **kwargs): pass def source(*args, **kwargs): pass def status(*args, **kwargs): pass def timerEvent(*args, **kwargs): pass Error = None Loading = None Null = None Ready = None ResizeMode = None SizeRootObjectToView = None SizeViewToRootObject = None Status = None __new__ = None sceneResized = None staticMetaObject = None statusChanged = None class ListProperty(_Property): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass class QDeclarativeScriptString(_Object): def __copy__(*args, **kwargs): pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def context(*args, **kwargs): pass def scopeObject(*args, **kwargs): pass def script(*args, **kwargs): pass def setContext(*args, **kwargs): pass def setScopeObject(*args, **kwargs): pass def setScript(*args, **kwargs): pass __new__ = None class QDeclarativeProperty(_Object): def __copy__(*args, **kwargs): pass def __eq__(*args, **kwargs): """ x.__eq__(y) <==> x==y """ pass def __ge__(*args, **kwargs): """ x.__ge__(y) <==> x>=y """ pass def __getattribute__(*args, **kwargs): """ x.__getattribute__('name') <==> x.name """ pass def __gt__(*args, **kwargs): """ x.__gt__(y) <==> x>y """ pass def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def __le__(*args, **kwargs): """ x.__le__(y) <==> x<=y """ pass def __lt__(*args, **kwargs): """ x.__lt__(y) <==> x<y """ pass def __ne__(*args, **kwargs): """ x.__ne__(y) <==> x!=y """ pass def connectNotifySignal(*args, **kwargs): pass def hasNotifySignal(*args, **kwargs): pass def index(*args, **kwargs): pass def isDesignable(*args, **kwargs): pass def isProperty(*args, **kwargs): pass def isResettable(*args, **kwargs): pass def isSignalProperty(*args, **kwargs): pass def isValid(*args, **kwargs): pass def isWritable(*args, **kwargs): pass def method(*args, **kwargs): pass def name(*args, **kwargs): pass def needsNotifySignal(*args, **kwargs): pass def object(*args, **kwargs): pass def property(*args, **kwargs): pass def propertyType(*args, **kwargs): pass def propertyTypeCategory(*args, **kwargs): pass def propertyTypeName(*args, **kwargs): pass def reset(*args, **kwargs): pass def type(*args, **kwargs): pass def read(*args, **kwargs): pass def write(*args, **kwargs): pass Invalid = None InvalidCategory = None List = None Normal = None Object = None Property = None PropertyTypeCategory = None SignalProperty = None Type = None __new__ = None class QDeclarativeImageProvider(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def imageType(*args, **kwargs): pass def requestImage(*args, **kwargs): pass def requestPixmap(*args, **kwargs): pass Image = None ImageType = None Pixmap = None __new__ = None class QDeclarativePropertyValueSource(_Object): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def setTarget(*args, **kwargs): pass __new__ = None class QDeclarativeItem(_QGraphicsObject, QDeclarativeParserStatus): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def baselineOffset(*args, **kwargs): pass def boundingRect(*args, **kwargs): pass def childAt(*args, **kwargs): pass def childrenRect(*args, **kwargs): pass def classBegin(*args, **kwargs): pass def clip(*args, **kwargs): pass def componentComplete(*args, **kwargs): pass def event(*args, **kwargs): pass def forceActiveFocus(*args, **kwargs): pass def geometryChanged(*args, **kwargs): pass def hasActiveFocus(*args, **kwargs): pass def hasFocus(*args, **kwargs): pass def height(*args, **kwargs): pass def heightValid(*args, **kwargs): pass def implicitHeight(*args, **kwargs): pass def implicitWidth(*args, **kwargs): pass def inputMethodEvent(*args, **kwargs): pass def inputMethodPreHandler(*args, **kwargs): pass def inputMethodQuery(*args, **kwargs): pass def isComponentComplete(*args, **kwargs): pass def itemChange(*args, **kwargs): pass def keepMouseGrab(*args, **kwargs): pass def keyPressEvent(*args, **kwargs): pass def keyPressPreHandler(*args, **kwargs): pass def keyReleaseEvent(*args, **kwargs): pass def keyReleasePreHandler(*args, **kwargs): pass def paint(*args, **kwargs): pass def parentItem(*args, **kwargs): pass def resetHeight(*args, **kwargs): pass def resetWidth(*args, **kwargs): pass def sceneEvent(*args, **kwargs): pass def setBaselineOffset(*args, **kwargs): pass def setClip(*args, **kwargs): pass def setFocus(*args, **kwargs): pass def setHeight(*args, **kwargs): pass def setImplicitHeight(*args, **kwargs): pass def setImplicitWidth(*args, **kwargs): pass def setKeepMouseGrab(*args, **kwargs): pass def setParentItem(*args, **kwargs): pass def setSize(*args, **kwargs): pass def setSmooth(*args, **kwargs): pass def setTransformOrigin(*args, **kwargs): pass def setWidth(*args, **kwargs): pass def smooth(*args, **kwargs): pass def transformOrigin(*args, **kwargs): pass def width(*args, **kwargs): pass def widthValid(*args, **kwargs): pass Bottom = None BottomLeft = None BottomRight = None Center = None Left = None Right = None Top = None TopLeft = None TopRight = None TransformOrigin = None __new__ = None activeFocusChanged = None baselineOffsetChanged = None childrenRectChanged = None clipChanged = None focusChanged = None implicitHeightChanged = None implicitWidthChanged = None parentChanged = None smoothChanged = None stateChanged = None staticMetaObject = None transformOriginChanged = None class QDeclarativeExtensionPlugin(_QObject, QDeclarativeExtensionInterface): def __init__(*args, **kwargs): """ x.__init__(...) initializes x; see help(type(x)) for signature """ pass def initializeEngine(*args, **kwargs): pass def registerTypes(*args, **kwargs): pass __new__ = None staticMetaObject = None def qmlRegisterType(*args, **kwargs): pass QML_HAS_ATTACHED_PROPERTIES = 1
15.198341
76
0.47065
1,652
20,153
5.529661
0.167676
0.253968
0.311111
0.342419
0.370115
0.360153
0.332129
0.304652
0.275972
0.191133
0
0.00017
0.417605
20,153
1,325
77
15.209811
0.778138
0.071801
0
0.590909
0
0
0
0
0
0
0
0
0
1
0.405594
false
0.405594
0.012238
0
0.59965
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
6
184f1c0d63d001f0c2bc3fe7339d2570cd4fb1ef
3,209
py
Python
Proyectos_Django/TrainningApp/Market/migrations/0001_initial.py
iAmMe340/Frameworks-7a-2020b
eddc9e5e564e761209fb13938c9ec0228b339a7a
[ "MIT" ]
1
2020-09-21T20:37:33.000Z
2020-09-21T20:37:33.000Z
Proyectos_Django/TrainningApp/Market/migrations/0001_initial.py
iAmMe340/Frameworks-7a-2020b
eddc9e5e564e761209fb13938c9ec0228b339a7a
[ "MIT" ]
null
null
null
Proyectos_Django/TrainningApp/Market/migrations/0001_initial.py
iAmMe340/Frameworks-7a-2020b
eddc9e5e564e761209fb13938c9ec0228b339a7a
[ "MIT" ]
null
null
null
# Generated by Django 3.1.4 on 2020-12-17 19:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('code', models.CharField(max_length=1000)), ('name', models.CharField(max_length=100)), ('status', models.BooleanField(default=True)), ('description', models.TextField(default='Description here', max_length=20)), ('create_date', models.DateTimeField(verbose_name='Date creation')), ('update_date', models.DateTimeField(verbose_name='Date update')), ], ), migrations.CreateModel( name='Products', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('code', models.CharField(max_length=1000)), ('name', models.CharField(max_length=100)), ('unity_price', models.IntegerField()), ('quantity', models.IntegerField()), ('status', models.BooleanField(default=True)), ('description', models.TextField(default='Description here', max_length=20)), ('create_date', models.DateTimeField(verbose_name='Date creation')), ('update_date', models.DateTimeField(verbose_name='Date update')), ('id_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Market.category')), ], ), migrations.CreateModel( name='Vendor', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('code', models.CharField(max_length=1000)), ('name', models.CharField(max_length=100)), ('status', models.BooleanField(default=True)), ('description', models.TextField(default='Description here')), ], ), migrations.CreateModel( name='Stock', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('code', models.CharField(max_length=1000)), ('quantity', models.IntegerField()), ('description', models.TextField(default='Description here', max_length=20)), ('create_date', models.DateTimeField(verbose_name='Date creation')), ('update_date', models.DateTimeField(verbose_name='Date update')), ('id_product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Market.products')), ], ), migrations.AddField( model_name='products', name='id_vendor', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Market.vendor'), ), ]
45.842857
118
0.57962
304
3,209
5.980263
0.233553
0.060506
0.069307
0.092409
0.748075
0.748075
0.748075
0.748075
0.748075
0.748075
0
0.019828
0.277033
3,209
69
119
46.507246
0.763793
0.014023
0
0.677419
1
0
0.140101
0
0
0
0
0
0
1
0
false
0
0.032258
0
0.096774
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
43ec57d0be61b9ec587623c6ef5efde1bc34f0e2
44
py
Python
page_objects/elements/__init__.py
konflic/python_qa_jenkins
1a4293945d94242b5f31a373769f74ee8b1193bd
[ "MIT" ]
3
2020-11-22T16:20:27.000Z
2021-06-16T18:46:56.000Z
page_objects/elements/__init__.py
konflic/python_qa_jenkins
1a4293945d94242b5f31a373769f74ee8b1193bd
[ "MIT" ]
null
null
null
page_objects/elements/__init__.py
konflic/python_qa_jenkins
1a4293945d94242b5f31a373769f74ee8b1193bd
[ "MIT" ]
null
null
null
from .FeaturedProduct import FeaturedProduct
44
44
0.909091
4
44
10
0.75
0
0
0
0
0
0
0
0
0
0
0
0.068182
44
1
44
44
0.97561
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a1843e82ec6a7da5ba1cc7f28de044def322fc97
378
py
Python
src/api/domain/connection/CheckDatabaseConnectionTableRowCount/CheckDatabaseConnectionTableRowCountCommand.py
PythonDataIntegrator/pythondataintegrator
6167778c36c2295e36199ac0d4d256a4a0c28d7a
[ "MIT" ]
14
2020-12-19T15:06:13.000Z
2022-01-12T19:52:17.000Z
src/api/domain/connection/CheckDatabaseConnectionTableRowCount/CheckDatabaseConnectionTableRowCountCommand.py
PythonDataIntegrator/pythondataintegrator
6167778c36c2295e36199ac0d4d256a4a0c28d7a
[ "MIT" ]
43
2021-01-06T22:05:22.000Z
2022-03-10T10:30:30.000Z
src/api/domain/connection/CheckDatabaseConnectionTableRowCount/CheckDatabaseConnectionTableRowCountCommand.py
PythonDataIntegrator/pythondataintegrator
6167778c36c2295e36199ac0d4d256a4a0c28d7a
[ "MIT" ]
4
2020-12-18T23:10:09.000Z
2021-04-02T13:03:12.000Z
from dataclasses import dataclass from domain.connection.CheckDatabaseConnectionTableRowCount.CheckDatabaseConnectionTableRowCountRequest import CheckDatabaseConnectionTableRowCountRequest from infrastructure.cqrs.ICommand import ICommand @dataclass class CheckDatabaseConnectionTableRowCountCommand(ICommand): request: CheckDatabaseConnectionTableRowCountRequest = None
37.8
154
0.902116
24
378
14.208333
0.625
0
0
0
0
0
0
0
0
0
0
0
0.068783
378
9
155
42
0.96875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.833333
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
6
a18e717d57af7cde0f79bf4df13ca4b505abc514
2,792
py
Python
tests/netflix/test_crdb.py
Netflix-Skunkworks/service-capacity-modeling
563ed66e62c84f387a4c710e008a0d82479a6718
[ "Apache-2.0" ]
6
2021-06-24T21:32:35.000Z
2021-12-20T21:03:46.000Z
tests/netflix/test_crdb.py
Netflix-Skunkworks/service-capacity-modeling
563ed66e62c84f387a4c710e008a0d82479a6718
[ "Apache-2.0" ]
6
2021-06-30T23:05:04.000Z
2022-03-09T16:29:29.000Z
tests/netflix/test_crdb.py
Netflix-Skunkworks/service-capacity-modeling
563ed66e62c84f387a4c710e008a0d82479a6718
[ "Apache-2.0" ]
4
2021-06-26T19:27:16.000Z
2021-09-23T09:39:40.000Z
from service_capacity_modeling.capacity_planner import planner from service_capacity_modeling.interface import CapacityDesires from service_capacity_modeling.interface import DataShape from service_capacity_modeling.interface import Interval from service_capacity_modeling.interface import QueryPattern def test_crdb_basic(): basic = CapacityDesires( service_tier=1, query_pattern=QueryPattern( estimated_read_per_second=Interval( low=100, mid=1000, high=10000, confidence=0.98 ), estimated_write_per_second=Interval( low=100, mid=1000, high=10000, confidence=0.98 ), ), data_shape=DataShape( estimated_state_size_gib=Interval( low=10, mid=100, high=1000, confidence=0.98 ), ), ) plan = planner.plan( model_name="org.netflix.cockroachdb", region="us-east-1", desires=basic, ) lr = plan.least_regret[0] lr_cluster = lr.candidate_clusters.zonal[0] # Resulting cluster should not be too expensive assert 2000 < lr.candidate_clusters.total_annual_cost < 10_000 # Should have enough disk space for around 80GiB of data in a single # replica (compression). Also that drive should be ephemeral assert lr_cluster.instance.drive is not None assert lr_cluster.count * lr_cluster.instance.drive.size_gib > 80 # Should have enough CPU to handle 1000 QPS assert lr_cluster.count * lr_cluster.instance.cpu > 4 def test_crdb_footprint(): space = CapacityDesires( service_tier=1, query_pattern=QueryPattern( estimated_read_per_second=Interval( low=100, mid=1000, high=10000, confidence=0.98 ), estimated_write_per_second=Interval( low=100, mid=1000, high=10000, confidence=0.98 ), ), data_shape=DataShape( estimated_state_size_gib=Interval( low=100, mid=1000, high=10000, confidence=0.98 ), ), ) plan = planner.plan( model_name="org.netflix.cockroachdb", region="us-east-1", desires=space, ) lr = plan.least_regret[0] lr_cluster = lr.candidate_clusters.zonal[0] # Resulting cluster should not be too expensive assert 4000 < lr.candidate_clusters.total_annual_cost < 12_000 # Should have enough disk space for around 80GiB of data in a single # replica (compression). Also that drive should be ephemeral assert lr_cluster.instance.drive is not None assert lr_cluster.count * lr_cluster.instance.drive.size_gib > 800 # Should have enough CPU to handle 1000 QPS assert lr_cluster.count * lr_cluster.instance.cpu >= 8
33.238095
72
0.664756
350
2,792
5.111429
0.285714
0.060369
0.0436
0.075461
0.893795
0.893795
0.761878
0.761878
0.761878
0.761878
0
0.06383
0.259312
2,792
83
73
33.638554
0.801257
0.152937
0
0.639344
0
0
0.027165
0.019525
0
0
0
0
0.131148
1
0.032787
false
0
0.081967
0
0.114754
0.016393
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
a19dd21aa066af2ffc6a3477c82d1e14db2e6289
196
py
Python
raphael/app/modules/openldap/__init__.py
major1201/raphael
18d7060834be7645b66144ba2a1638f3e1db2dd2
[ "MIT" ]
null
null
null
raphael/app/modules/openldap/__init__.py
major1201/raphael
18d7060834be7645b66144ba2a1638f3e1db2dd2
[ "MIT" ]
null
null
null
raphael/app/modules/openldap/__init__.py
major1201/raphael
18d7060834be7645b66144ba2a1638f3e1db2dd2
[ "MIT" ]
null
null
null
# encoding: utf-8 from __future__ import division, absolute_import, with_statement, print_function from flask import Blueprint openldap_bp = Blueprint('openldap', __name__) from . import views
21.777778
80
0.806122
25
196
5.84
0.72
0.232877
0
0
0
0
0
0
0
0
0
0.005848
0.127551
196
8
81
24.5
0.847953
0.076531
0
0
0
0
0.044693
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0.75
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
1
0
6