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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d8681bd0cf3b8a72eaf239299014e64f3fe891d5 | 307 | py | Python | autokey/data/MacOS/newtab.py | ankur-gupta/keyboard | 5fb6d1e45a3c1956c18d4f2464eacb79397b8aab | [
"MIT"
] | 1 | 2018-03-12T20:52:31.000Z | 2018-03-12T20:52:31.000Z | autokey/data/MacOS/newtab.py | ankur-gupta/keyboard | 5fb6d1e45a3c1956c18d4f2464eacb79397b8aab | [
"MIT"
] | null | null | null | autokey/data/MacOS/newtab.py | ankur-gupta/keyboard | 5fb6d1e45a3c1956c18d4f2464eacb79397b8aab | [
"MIT"
] | null | null | null | # Enter script code
import re
winClass = window.get_active_class()
isTerminalWin1 = re.search("konsole\\.konsole", winClass)
isTerminalWin2 = re.search("x+terminal.*", winClass)
if isTerminalWin1 or isTerminalWin2:
keyboard.send_keys("<ctrl>+<shift>+t")
else:
keyboard.send_keys("<ctrl>+t")
| 30.7 | 57 | 0.71987 | 38 | 307 | 5.710526 | 0.657895 | 0.073733 | 0.147465 | 0.184332 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014981 | 0.130293 | 307 | 9 | 58 | 34.111111 | 0.797753 | 0.055375 | 0 | 0 | 0 | 0 | 0.184028 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
d8965945ad6985da1a9a4430d54d6216025cbd48 | 110 | py | Python | exercices/003.py | haxuyennt38/python-learning | c5fcfc0abfd4aebf4ce58e2f23d378703bd48430 | [
"MIT"
] | null | null | null | exercices/003.py | haxuyennt38/python-learning | c5fcfc0abfd4aebf4ce58e2f23d378703bd48430 | [
"MIT"
] | null | null | null | exercices/003.py | haxuyennt38/python-learning | c5fcfc0abfd4aebf4ce58e2f23d378703bd48430 | [
"MIT"
] | null | null | null | yearOfbirthday = int(input())
year = 2017
age = year - yearOfbirthday
print (f'In 2017, i am {age} years old') | 27.5 | 40 | 0.7 | 17 | 110 | 4.529412 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 0.163636 | 110 | 4 | 40 | 27.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.261261 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
d8a7230534db073c5ffa3f79a291a7bc904c8d11 | 361 | py | Python | yelp/obj/region.py | ruchir594/messenger-bot-yelp-aws | 757d9e3e599432954a1acbf477b2f40e5c2d247c | [
"MIT"
] | 8 | 2016-05-13T20:59:39.000Z | 2017-02-01T03:26:57.000Z | yelp/obj/region.py | ruchir594/messenger-bot-yelp-aws | 757d9e3e599432954a1acbf477b2f40e5c2d247c | [
"MIT"
] | 1 | 2016-08-08T03:53:21.000Z | 2016-08-08T04:09:07.000Z | yelp/obj/region.py | ruchir594/messenger-bot-yelp-aws | 757d9e3e599432954a1acbf477b2f40e5c2d247c | [
"MIT"
] | 4 | 2016-06-21T00:26:55.000Z | 2019-12-23T15:55:42.000Z | # -*- coding: UTF-8 -*-
from yelp.obj.coordinate import Coordinate
from yelp.obj.response_object import ResponseObject
from yelp.obj.span import Span
class Region(ResponseObject):
def __init__(self, response):
super(Region, self).__init__(response)
self._parse('center', Coordinate, response)
self._parse('span', Span, response)
| 25.785714 | 51 | 0.711911 | 44 | 361 | 5.590909 | 0.454545 | 0.097561 | 0.134146 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003344 | 0.171745 | 361 | 13 | 52 | 27.769231 | 0.819398 | 0.058172 | 0 | 0 | 0 | 0 | 0.029586 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
d8a93321e34f3f2ddc18f49907a9271df644f115 | 124 | py | Python | SensorMonitor/__init__.py | Nzbuu/SensorMonitor | 4523e9accc3e57718d752d4f2a22fdb77f80fd82 | [
"MIT"
] | null | null | null | SensorMonitor/__init__.py | Nzbuu/SensorMonitor | 4523e9accc3e57718d752d4f2a22fdb77f80fd82 | [
"MIT"
] | null | null | null | SensorMonitor/__init__.py | Nzbuu/SensorMonitor | 4523e9accc3e57718d752d4f2a22fdb77f80fd82 | [
"MIT"
] | null | null | null | __author__ = 'James Myatt'
__version__ = '0.0.2'
__all__ = [
'monitor', 'sensor', 'utils',
'time', 'w1therm'
]
| 15.5 | 33 | 0.564516 | 13 | 124 | 4.461538 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042105 | 0.233871 | 124 | 7 | 34 | 17.714286 | 0.568421 | 0 | 0 | 0 | 0 | 0 | 0.362903 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
d8b4ef88996d2847dce287ee8237d1d76d1f9da8 | 586 | py | Python | abb_deeplearning_keras/Source_code/models/quiver_server.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | 7 | 2018-01-23T05:17:50.000Z | 2020-10-30T02:29:59.000Z | abb_deeplearning_keras/Source_code/models/quiver_server.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | null | null | null | abb_deeplearning_keras/Source_code/models/quiver_server.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | 2 | 2018-01-23T05:17:58.000Z | 2018-07-02T00:13:34.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 14 12:31:13 2017
@author: maverick
"""
import keras
from keras.applications import vgg16
#model = vgg16.VGG16()
#
#from quiver_engine.server import launch
#launch(model, input_folder='./img', port=7000)
import resnet
model = resnet.ResnetBuilder.build_resnet_18((3, 224, 224), 4)
model.load_weights("/home/maverick/knet/weights/exp_21_singleimage_CAV_RS18_weights.best.hdf5")
from quiver_engine.server import launch
launch(model, input_folder='./img',temp_folder='./tmp', port=7000)
| 22.538462 | 96 | 0.715017 | 84 | 586 | 4.833333 | 0.630952 | 0.049261 | 0.078818 | 0.108374 | 0.29064 | 0.29064 | 0.29064 | 0.29064 | 0.29064 | 0.29064 | 0 | 0.085657 | 0.143345 | 586 | 25 | 97 | 23.44 | 0.723108 | 0.348123 | 0 | 0 | 0 | 0 | 0.241279 | 0.212209 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.571429 | 0 | 0.571429 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
d8b9aa2f627ed0a618578ec601b0b22134b69e0f | 1,638 | py | Python | test/test_beacon_api.py | NCATS-Tangerine/tkbeacon-python-client | a5a88405b6eb5c998b66f6741b589ba72839fd51 | [
"MIT"
] | null | null | null | test/test_beacon_api.py | NCATS-Tangerine/tkbeacon-python-client | a5a88405b6eb5c998b66f6741b589ba72839fd51 | [
"MIT"
] | null | null | null | test/test_beacon_api.py | NCATS-Tangerine/tkbeacon-python-client | a5a88405b6eb5c998b66f6741b589ba72839fd51 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Translator Knowledge Beacon API
This is the Translator Knowledge Beacon web service application programming interface (API). # noqa: E501
The version of the OpenAPI document: 1.3.0
Contact: richard@starinformatics.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import tkbeacon
from tkbeacon.api.beacon_api import BeaconApi # noqa: E501
from tkbeacon.rest import ApiException
class TestBeaconApi(unittest.TestCase):
"""BeaconApi unit test stubs"""
def setUp(self):
self.api = tkbeacon.api.beacon_api.BeaconApi() # noqa: E501
def tearDown(self):
pass
def test_get_concept_categories(self):
"""Test case for get_concept_categories
"""
pass
def test_get_concept_details(self):
"""Test case for get_concept_details
"""
pass
def test_get_concepts(self):
"""Test case for get_concepts
"""
pass
def test_get_exact_matches_to_concept_list(self):
"""Test case for get_exact_matches_to_concept_list
"""
pass
def test_get_knowledge_map(self):
"""Test case for get_knowledge_map
"""
pass
def test_get_predicates(self):
"""Test case for get_predicates
"""
pass
def test_get_statement_details(self):
"""Test case for get_statement_details
"""
pass
def test_get_statements(self):
"""Test case for get_statements
"""
pass
if __name__ == '__main__':
unittest.main()
| 19.73494 | 111 | 0.642247 | 196 | 1,638 | 5.086735 | 0.362245 | 0.056169 | 0.088265 | 0.112337 | 0.30993 | 0.138415 | 0 | 0 | 0 | 0 | 0 | 0.010943 | 0.274725 | 1,638 | 82 | 112 | 19.97561 | 0.828283 | 0.415751 | 0 | 0.321429 | 0 | 0 | 0.00907 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.357143 | false | 0.321429 | 0.178571 | 0 | 0.571429 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
d8c48b7d57359870b490a90227e4ef21b9bcd088 | 1,384 | py | Python | exchange_plugin/consumer.py | FastyBird/application-exchange | 66fedb46b684e5a2fa29e6d654cf7fb9df2b5ee5 | [
"Apache-2.0"
] | null | null | null | exchange_plugin/consumer.py | FastyBird/application-exchange | 66fedb46b684e5a2fa29e6d654cf7fb9df2b5ee5 | [
"Apache-2.0"
] | null | null | null | exchange_plugin/consumer.py | FastyBird/application-exchange | 66fedb46b684e5a2fa29e6d654cf7fb9df2b5ee5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# Copyright 2021. FastyBird s.r.o.
#
# 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.
"""
Exchange plugin messages consumer
"""
# Python base dependencies
from abc import ABC
from typing import Dict, Optional, Union
# Library dependencies
from modules_metadata.routing import RoutingKey
from modules_metadata.types import ModuleOrigin
class IConsumer(ABC): # pylint: disable=too-few-public-methods
"""
Data exchange consumer interface
@package FastyBird:ExchangePlugin!
@module consumer
@author Adam Kadlec <adam.kadlec@fastybird.com>
"""
def consume(
self,
origin: ModuleOrigin,
routing_key: RoutingKey,
data: Optional[Dict[str, Union[str, int, float, bool, None]]],
) -> None:
"""Consume data received from exchange bus"""
| 29.446809 | 78 | 0.689306 | 176 | 1,384 | 5.403409 | 0.670455 | 0.063091 | 0.02734 | 0.033649 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008443 | 0.229769 | 1,384 | 46 | 79 | 30.086957 | 0.883677 | 0.671243 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.363636 | 0 | 0.545455 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
d8ca50d05d227a6bd61f471eef16a683056e344e | 380 | py | Python | test/test_sshtype.py | stribika/sshlabs | 421e62433aab0e21456254a0b2c5feb830d0c77c | [
"Unlicense"
] | 76 | 2015-01-24T19:18:31.000Z | 2021-03-11T11:17:14.000Z | test/test_sshtype.py | stribika/sshlabs | 421e62433aab0e21456254a0b2c5feb830d0c77c | [
"Unlicense"
] | 8 | 2015-01-24T18:59:57.000Z | 2017-06-07T13:07:34.000Z | test/test_sshtype.py | stribika/sshlabs | 421e62433aab0e21456254a0b2c5feb830d0c77c | [
"Unlicense"
] | 21 | 2015-01-24T18:56:52.000Z | 2021-03-10T14:33:14.000Z | import sys
import unittest
sys.path.append("../main")
from sshtype import *
class TestUInt32(unittest.TestCase):
def test_from_bytes(self):
uint32 = UInt32()
self.assertEqual(uint32.from_bytes(b"\x00\x00\x01\x02"), (b"", 0x102))
def test_to_bytes(self):
uint32 = UInt32()
self.assertEqual(uint32.to_bytes(0x10203), b"\x00\x01\x02\x03")
| 23.75 | 78 | 0.665789 | 52 | 380 | 4.75 | 0.480769 | 0.05668 | 0.121457 | 0.17004 | 0.340081 | 0.340081 | 0.340081 | 0 | 0 | 0 | 0 | 0.129032 | 0.184211 | 380 | 15 | 79 | 25.333333 | 0.667742 | 0 | 0 | 0.181818 | 0 | 0 | 0.102632 | 0 | 0 | 0 | 0.031579 | 0 | 0.181818 | 1 | 0.181818 | false | 0 | 0.272727 | 0 | 0.545455 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
d8cba97cb8816c7aeda1bf733a60793f225c76f2 | 392 | py | Python | eventlet_raft/tests/test_client.py | jason-ni/eventlet-raft | 12d97d7b90f4ecd4849ecf5ca3e36dc3879e1d2b | [
"Apache-2.0"
] | 3 | 2015-05-22T05:30:29.000Z | 2016-01-06T10:14:31.000Z | eventlet_raft/tests/test_client.py | jason-ni/eventlet-raft | 12d97d7b90f4ecd4849ecf5ca3e36dc3879e1d2b | [
"Apache-2.0"
] | null | null | null | eventlet_raft/tests/test_client.py | jason-ni/eventlet-raft | 12d97d7b90f4ecd4849ecf5ca3e36dc3879e1d2b | [
"Apache-2.0"
] | null | null | null | from glob import glob
import os
from unittest import TestCase
from nose.plugins.attrib import attr
from ..client import RaftClient
class RaftClientTest(TestCase):
@classmethod
def tearDownClass(cls):
map(os.remove, glob('./~test_file*'))
@attr("integration")
def test_client_init(self):
client = RaftClient(('127.0.0.1', 4000))
client.register()
| 19.6 | 48 | 0.683673 | 49 | 392 | 5.408163 | 0.612245 | 0.075472 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031949 | 0.201531 | 392 | 19 | 49 | 20.631579 | 0.814696 | 0 | 0 | 0 | 0 | 0 | 0.084184 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.384615 | 0 | 0.615385 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
d8ccfdce9caee10035d22fbe4da0b0cf737f602c | 1,852 | py | Python | roc-prepare3.py | catherinekerr/ip-ensemble | a1ddcf0260d5a210dd55ae5faf015f3a8792c812 | [
"Apache-2.0"
] | 1 | 2020-07-25T10:55:21.000Z | 2020-07-25T10:55:21.000Z | roc-prepare3.py | jmarecek/ip-ensemble | 9a867373ea1c99c746debdc9d7aa3a76e00b2005 | [
"Apache-2.0"
] | 1 | 2019-10-16T20:18:26.000Z | 2019-10-16T20:18:26.000Z | roc-prepare3.py | catherinekerr/ip-ensemble | a1ddcf0260d5a210dd55ae5faf015f3a8792c812 | [
"Apache-2.0"
] | null | null | null | """
Construct the ROC plot.
This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE file in the root
directory of this source tree or at
http://www.apache.org/licenses/LICENSE-2.0.
Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice
indicating that they have been altered from the originals.
If you use this code, please cite our paper:
@article{Kerr2020,
author = {Catherine Kerr and Terri Hoare and Paula Carroll and Jakub Marecek},
title = {Integer-Programming Ensemble of Temporal-Relations Classifiers},
journal = {Data Mining and Knowledge Discovery},
volume = {to appear},
year = {2020},
url = {http://arxiv.org/abs/1412.1866},
archivePrefix = {arXiv},
eprint = {1412.1866},
}
"""
import glob
import os.path
import sys
from itertools import combinations
import traceback
import numpy as np
import pickle
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.font_manager as fm
import ensemble
import tempeval
import newmetric
resultsFile = open("./anaforatools/ensemble-results.csv","r")
results = {}
try:
for row in resultsFile.readlines()[1:]:
# reffile,sysfile,num,set,pthr,opt,type,ref,pred,corr1,corr2,P,R,F1,arcs,P2,target,delta,threshold
# Training-test-folders/Tempeval16_Platinum_clinic_00_A,1-3-7-8-12,0,A,0.6,NO,TLINK:Type:CONTAINS,2991,4261,2250,1892,0.5280450598,0.632564359
f = row.split(",")
if len(f) < 14: continue
(pr, re, f1) = map(float, f[11:14])
results[f[0]] = (pr, re)
except (KeyboardInterrupt, SystemExit):
raise
except:
print traceback.format_exc()
with open("ROC3.pkl", 'wb') as resultsPickle: pickle.dump(results, resultsPickle)
resultsFile.close()
| 30.360656 | 146 | 0.736501 | 278 | 1,852 | 4.881295 | 0.690647 | 0.017686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058937 | 0.157127 | 1,852 | 60 | 147 | 30.866667 | 0.810378 | 0.12797 | 0 | 0 | 0 | 0 | 0.063172 | 0.047043 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.481481 | null | null | 0.037037 | 0 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
d8cfe5c85d4c780f5fe5a04c1b84c01f4f74a9e3 | 1,818 | py | Python | go/contacts/import_handlers.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/contacts/import_handlers.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/contacts/import_handlers.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | from go.contacts import tasks, utils
from go.contacts.parsers import ContactFileParser
class ContactImportException(Exception):
"""
Exception raised when an import handler determines that an import cannot
succeed.
"""
def dispatch_import_task(import_task, request, group, check_fields=None):
file_name, file_path = utils.get_file_hints_from_session(request)
file_type, parser = ContactFileParser.get_parser(file_name)
has_header, _, sample_row = parser.guess_headers_and_row(file_path)
# Grab the selected field names from the submitted form
# by looping over the expect n number of `column-n` keys being
# posted
field_names = [request.POST.get('column-%s' % i) for i in
range(len(sample_row))]
normalizers = [request.POST.get('normalize-%s' % i, '')
for i in range(len(sample_row))]
fields = zip(field_names, normalizers)
if check_fields is not None:
check_fields(dict(fields))
import_task.delay(
request.user_api.user_account_key, group.key, file_name,
file_path, fields, has_header)
utils.clear_file_hints_from_session(request)
def check_import_new_contacts_fields(fields):
if u'msisdn' not in fields:
raise ContactImportException("Please specify a Contact Number field.")
def handle_import_new_contacts(request, group):
return dispatch_import_task(
tasks.import_new_contacts_file, request, group,
check_import_new_contacts_fields)
def handle_import_upload_is_truth(request, group):
return dispatch_import_task(
tasks.import_upload_is_truth_contacts_file, request, group)
def handle_import_existing_is_truth(request, group):
return dispatch_import_task(
tasks.import_existing_is_truth_contacts_file, request, group)
| 33.054545 | 78 | 0.735424 | 245 | 1,818 | 5.15102 | 0.379592 | 0.066561 | 0.057052 | 0.061807 | 0.298732 | 0.211569 | 0.162441 | 0.162441 | 0.125198 | 0.085578 | 0 | 0 | 0.187569 | 1,818 | 54 | 79 | 33.666667 | 0.854435 | 0.112211 | 0 | 0.096774 | 0 | 0 | 0.040829 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.16129 | false | 0 | 0.548387 | 0.096774 | 0.83871 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
d8d623e88b523d074fcb064df7ff09e465d2847b | 1,823 | py | Python | BrainML/optimizer.py | bogdan124/DeepML | ad5e904cc9fcd3c499bbca3538525d83fde003f5 | [
"Apache-2.0"
] | null | null | null | BrainML/optimizer.py | bogdan124/DeepML | ad5e904cc9fcd3c499bbca3538525d83fde003f5 | [
"Apache-2.0"
] | null | null | null | BrainML/optimizer.py | bogdan124/DeepML | ad5e904cc9fcd3c499bbca3538525d83fde003f5 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
class Optimizer:
def __init__(self,optimizerName=None):
"""
Here you have the Optimizer class, optimizerName is the optimizer that you want to chose:
ex: Optimizer("Adam")
optimizerName can be one of the following Adam, Adadelta, Adagrad, Adamax, Nadam, Sgd, Rmsprop
"""
self.optimzerChosen=None
self.value=None
self.optimizers={"adam":[1,Adam()],"adadelta":[2,Adadelta()],"adagrad":[3,Adagrad()],"adamax":[4,Adamax],
"nadam":[5,Nadam()],"sgd":[6,Sgd()],"rmsprop":[7,Rmsprop()]}
if optimizerName is not None:
optimizerName=str(optimizerName)
optimizerName=optimizerName.lower()
print(optimizerName)
self.optimzerChosen=self.optimizers[str(optimizerName)][1]
self.value=self.optimzerChosen
def Adam(learning_rate=0.001,beta_1=0.9,beta_2=0.999,epsilon=1e-07,amsgrad=False,name='Adam'):
"""
Here you have the Adam Optimizer
"""
adam=tf.compat.v1.train.AdamOptimizer(learning_rate, beta_1, beta_2, epsilon, amsgrad,name )
return adam
def Adadelta(learning_rate=0.001, rho=0.95, epsilon=1e-07, name='Adadelta'):
"""
Here you have the Adadelta Optimizer
"""
adadelta=tf.compat.v1.train.AdadeltaOptimizer(learning_rate, rho, epsilon, name)
return adadelta
def Adamax():
"""
Here you have the Adamax Optimizer
"""
pass
def Adagrad():
"""
Here you have the Adagrad Optimizer
"""
pass
def Nadam():
"""
Here you have the Nadam Optimizer
"""
pass
def Sgd(learning_rate=0.001):
"""
Here you have the Stochastic Gradient Descent Optimizer
"""
sgd=tf.compat.v1.train.GradientDescentOptimizer(learning_rate)
return sgd
def Rmsprop():
"""
Here you have the Rmsprop Optimizer
"""
pass
| 26.808824 | 109 | 0.659353 | 233 | 1,823 | 5.098712 | 0.317597 | 0.047138 | 0.074074 | 0.094276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029167 | 0.210093 | 1,823 | 67 | 110 | 27.208955 | 0.795833 | 0.259462 | 0 | 0.133333 | 0 | 0 | 0.042588 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0.133333 | 0.033333 | 0 | 0.433333 | 0.033333 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
d8e061713db2c288586dc6014b12b5d47b5cd800 | 66 | py | Python | drones/version.py | bugout-dev/drones | 9af74215a93e364463b1373e7055735f0eef45b0 | [
"Apache-2.0"
] | null | null | null | drones/version.py | bugout-dev/drones | 9af74215a93e364463b1373e7055735f0eef45b0 | [
"Apache-2.0"
] | 5 | 2021-07-13T19:18:54.000Z | 2021-08-25T11:11:17.000Z | drones/version.py | bugout-dev/drones | 9af74215a93e364463b1373e7055735f0eef45b0 | [
"Apache-2.0"
] | null | null | null | """
Drones library and API version.
"""
DRONES_VERSION = "0.1.2"
| 11 | 31 | 0.651515 | 10 | 66 | 4.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054545 | 0.166667 | 66 | 5 | 32 | 13.2 | 0.709091 | 0.469697 | 0 | 0 | 0 | 0 | 0.185185 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
d8e9bd22610fd3818aa67bc056c53e3bfa6d9b36 | 755 | py | Python | python.py | Xsmael/blockhain-implementation | 984e769c8dadb5c90216ebcf8cd98114a64b8a44 | [
"MIT"
] | 2 | 2020-10-23T09:05:39.000Z | 2021-12-24T09:46:51.000Z | python.py | Xsmael/blockchain-implementation | 984e769c8dadb5c90216ebcf8cd98114a64b8a44 | [
"MIT"
] | null | null | null | python.py | Xsmael/blockchain-implementation | 984e769c8dadb5c90216ebcf8cd98114a64b8a44 | [
"MIT"
] | null | null | null | import json
a= [1,2,3,4,5,6,7,8,9,10]
print(a)
b=[el*2 for el in a] # double everything
print(b)
print([el*10 for el in a]) # 10X everything
print([el for el in a if el%2 ==0]) # filter even nums
print([el for el in a if el%2 !=0]) # filter odd nums
print([el for el in a if el%5 ==0]) # filter multiples of 5
c= [['a','b','c'],[1,2,3]]
d= [[el for el in lst if isinstance(el, str)] for lst in c] # filter strings
print(d)
e= [[el for el in lst if isinstance(el, int)] for lst in c] # filter ints
print(e)
def multiplesOf(n,a):
return [el for el in a if el%n==0]
print(multiplesOf(3,a))
import json
print (json.dumps({'a':2, 'b':{'x':3, 'y':{'t1': 4, 't2':5}}}, indent=4))
x = [0] * 10
print x
y = [i+1 for i in xrange(10)]
print y | 19.358974 | 76 | 0.598675 | 168 | 755 | 2.690476 | 0.297619 | 0.088496 | 0.123894 | 0.106195 | 0.391593 | 0.325221 | 0.325221 | 0.294248 | 0.179204 | 0.119469 | 0 | 0.06822 | 0.203974 | 755 | 39 | 77 | 19.358974 | 0.68386 | 0.150993 | 0 | 0.086957 | 0 | 0 | 0.01735 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.086957 | null | null | 0.521739 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
d8ebc194794e59dcd8ef162cae6d6b84fa4669ac | 763 | py | Python | dynamo/api/views.py | rendrom/django-dynamit | 4280da60212ffd9ad6a8cb96a7eba0890a98fee5 | [
"MIT"
] | 3 | 2015-01-20T18:43:16.000Z | 2015-12-09T06:46:55.000Z | dynamo/api/views.py | rendrom/django-dynamit | 4280da60212ffd9ad6a8cb96a7eba0890a98fee5 | [
"MIT"
] | null | null | null | dynamo/api/views.py | rendrom/django-dynamit | 4280da60212ffd9ad6a8cb96a7eba0890a98fee5 | [
"MIT"
] | null | null | null | # coding=utf-8
from dynamo.api.serializers import DynamicModelSerializer, DynamicModelFieldSerializer
from dynamo.models import DynamicModel, DynamicModelField
from rest_framework import viewsets
from rest_framework import generics
from rest_framework.renderers import TemplateHTMLRenderer, JSONRenderer, HTMLFormRenderer
from rest_framework.response import Response
class DynamicModelViewSet(viewsets.ModelViewSet):
model = DynamicModel
serializer_class = DynamicModelSerializer
class DynamicModelFieldViewSet(viewsets.ModelViewSet):
queryset = DynamicModelField.objects.all()
serializer_class = DynamicModelFieldSerializer
# permission_classes = (permissions.IsAuthenticatedOrReadOnly,
# IsOwnerOrReadOnly,)
| 33.173913 | 89 | 0.815203 | 65 | 763 | 9.461538 | 0.553846 | 0.052033 | 0.110569 | 0.074797 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00152 | 0.137615 | 763 | 22 | 90 | 34.681818 | 0.933131 | 0.150721 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
2b08787effb6f7bbb1ae2706ee9a8d4b32070149 | 1,057 | py | Python | pfproject_py/pfgrid.py | assassin945/PixelFight | eca26825dcba17748a5f5c1e9f778aecd3824a4c | [
"Apache-2.0"
] | 2 | 2018-06-27T09:14:18.000Z | 2018-08-30T06:51:33.000Z | pfproject_py/pfgrid.py | assassin945/PixelFight | eca26825dcba17748a5f5c1e9f778aecd3824a4c | [
"Apache-2.0"
] | 5 | 2018-07-23T14:41:14.000Z | 2018-09-07T15:48:18.000Z | pfproject_py/pfgrid.py | assassin945/PixelFight | eca26825dcba17748a5f5c1e9f778aecd3824a4c | [
"Apache-2.0"
] | 3 | 2018-07-17T08:11:52.000Z | 2018-07-23T14:56:50.000Z | # !/usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = 'Zhiquan Wang'
__date__ = '2018/7/20 22:01'
import taginfo
class GridTag(object):
type_land = 'land'
attribution_empty = 'empty'
class PixelGrid(object):
def __init__(self, *, ptype=GridTag.type_land, attribution='empty', value=1):
self.__type = ptype
self.__attribution = attribution
self.__value = value
@property
def type(self):
return self.__type
@type.setter
def type(self, _t):
self.__type = _t
@property
def attribution(self):
return self.__attribution
@attribution.setter
def attribution(self, _a):
self.__attribution = _a
@property
def value(self):
return self.__value
@value.setter
def value(self, _v):
self.__value = _v
def __dict__(self):
return {taginfo.JsonAttribute.pfg_type: self.__type,
taginfo.JsonAttribute.pfg_attribution: self.__attribution,
taginfo.JsonAttribute.pfg_value: self.value}
| 21.571429 | 81 | 0.631977 | 120 | 1,057 | 5.15 | 0.341667 | 0.05178 | 0.067961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017926 | 0.261116 | 1,057 | 48 | 82 | 22.020833 | 0.773367 | 0.039735 | 0 | 0.090909 | 0 | 0 | 0.040514 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.242424 | false | 0 | 0.030303 | 0.121212 | 0.515152 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
2b1cbced49e2339c08d41be09ebb4df53e711aa3 | 8,638 | py | Python | hvm/exceptions.py | hyperevo/py-helios-node | ff417fe3fe90f85c9f95b3d8a5f0dd4c80532ee8 | [
"MIT"
] | null | null | null | hvm/exceptions.py | hyperevo/py-helios-node | ff417fe3fe90f85c9f95b3d8a5f0dd4c80532ee8 | [
"MIT"
] | null | null | null | hvm/exceptions.py | hyperevo/py-helios-node | ff417fe3fe90f85c9f95b3d8a5f0dd4c80532ee8 | [
"MIT"
] | null | null | null | class PyEVMError(Exception):
"""
Base class for all py-hvm errors.
"""
pass
class VMNotFound(PyEVMError):
"""
Raised when no VM is available for the provided block number.
"""
pass
class NoGenesisBlockPresent(PyEVMError):
"""
Raised when a block is imported but there is no genesis block.
"""
pass
class StateRootNotFound(PyEVMError):
"""
Raised when the requested state root is not present in our DB.
"""
pass
class HeaderNotFound(PyEVMError):
"""
Raised when a header with the given number/hash does not exist.
"""
class BlockNotFound(PyEVMError):
"""
Raised when the block with the given number/hash does not exist.
"""
pass
class BlockOnWrongChain(PyEVMError):
"""
Raised when a block interacts with a chain it doesnt belong to
"""
pass
class RewardProofSenderBlockMissing(PyEVMError):
"""
Raised when a reward block is imported with provided proof from peers, but we don't have an up to date peer chain yet
so we cannot verify the proof. Need to safe the block as unprocessed until we download the peer chain.
"""
pass
class NoLocalRootHashTimestamps(PyEVMError):
"""
Raised when there are no local root hash timestamps
"""
pass
class LocalRootHashNotInConsensus(PyEVMError):
"""
Raised when there are no local root hash timestamps
"""
pass
class LocalRootHashNotAsExpected(PyEVMError):
"""
Raised after importing blocks and our root hash doesnt match what it should be
"""
pass
class IncorrectBlockType(PyEVMError):
"""
Raised when the block is queueblock when it should be block or vice-versa
"""
pass
class IncorrectBlockHeaderType(PyEVMError):
"""
Raised when the block is queueblock when it should be block or vice-versa
"""
pass
class NotEnoughTimeBetweenBlocks(PyEVMError):
"""
Raised when there is not enough time between blocks. WHO WOULD HAVE GUESSED?
"""
pass
class CannotCalculateStake(PyEVMError):
"""
Raised when a function tries to calculate the stake for an address where we are missing information. for example, if we dont have their chain.
"""
pass
class ReceivableTransactionNotFound(PyEVMError):
"""
Raised when a A receive transaction tries to receive a transaction that wasnt sent
"""
pass
class HistoricalNetworkTPCMissing(PyEVMError):
"""
Raised when a historical network tpc is missing for a certain timestamp
"""
pass
class NotEnoughProofsOrStakeForRewardType2Proof(PyEVMError):
"""
Raised when all of the proof we have for a reward type 2 does not meet the minimum requirement
"""
pass
class RewardAmountRoundsToZero(PyEVMError):
"""
Raised when a node attempts to create a reward block that has amount = 0 for all kinds of rewards. This will occur if not enough time has passed since the last reward.
"""
pass
class NotEnoughDataForHistoricalMinGasPriceCalculation(PyEVMError):
"""
Raised when there is not enough historical TPC to perform a calculation. Can occur when the genesis node just starts
"""
pass
class HistoricalMinGasPriceError(PyEVMError):
"""
Raised when a historical network tpc is missing for a certain timestamp
"""
pass
class TransactionNotFound(PyEVMError):
"""
Raised when the transaction with the given hash or block index does not exist.
"""
pass
class InvalidHeadRootTimestamp(PyEVMError):
"""
Raised when a timestamp based head hash is loaded or saved with invalid timestamp
"""
pass
class NoChronologicalBlocks(PyEVMError):
"""
Raised When there are no new blocks within the chronological block windows
"""
pass
class ParentNotFound(HeaderNotFound):
"""
Raised when the parent of a given block does not exist.
"""
pass
class UnprocessedBlockNotAllowed(PyEVMError):
"""
Raised when an unprocessed block is imported when it is not allowed
"""
pass
class UnprocessedBlockChildIsProcessed(PyEVMError):
"""
Raised when a child of an unprocessed block has been processed for some reason
"""
pass
class ReplacingBlocksNotAllowed(PyEVMError):
"""
Raised when a block tries to replace another block when it is not allowed
"""
pass
class CanonicalHeadNotFound(PyEVMError):
"""
Raised when the chain has no canonical head.
"""
pass
class TriedImportingGenesisBlock(PyEVMError):
"""
Raised when the genesis block on the genesis chain is attempted to be overwritten
"""
pass
class TriedDeletingGenesisBlock(PyEVMError):
"""
Raised when the genesis block on the genesis chain is attempted to be deleted
"""
pass
class CollationHeaderNotFound(PyEVMError):
"""
Raised when the collation header for the given shard and period does not exist in the database.
"""
pass
class SyncerOutOfOrder(PyEVMError):
"""
Syncer process has hit a snag and is out of order. For example, regular chain syncer went before it should.
"""
pass
class CollationBodyNotFound(PyEVMError):
"""
Raised when the collation body for the given shard and period does not exist in the database.
"""
pass
class CanonicalCollationNotFound(PyEVMError):
"""
Raised when no collation for the given shard and period has been marked as canonical.
"""
pass
class AppendHistoricalRootHashTooOld(PyEVMError):
"""
Raised when you try to append a historical root hash that is older than the oldest one in our database. can only append newer historical root hashes
"""
pass
class ValidationError(PyEVMError):
"""
Raised when something does not pass a validation check.
"""
pass
class JournalDbNotActivated(PyEVMError):
"""
Raised when someone tries to discard, save, persist a db, when it is not actually a journaldb
"""
pass
class Halt(PyEVMError):
"""
Raised when an opcode function halts vm execution.
"""
pass
class VMError(PyEVMError):
"""
Base class for errors raised during VM execution.
"""
burns_gas = True
erases_return_data = True
class OutOfGas(VMError):
"""
Raised when a VM execution has run out of gas.
"""
pass
class InsufficientStack(VMError):
"""
Raised when the stack is empty.
"""
pass
class FullStack(VMError):
"""
Raised when the stack is full.
"""
pass
class InvalidJumpDestination(VMError):
"""
Raised when the jump destination for a JUMPDEST operation is invalid.
"""
pass
class InvalidInstruction(VMError):
"""
Raised when an opcode is invalid.
"""
pass
class InsufficientFunds(VMError):
"""
Raised when an account has insufficient funds to transfer the
requested value.
"""
pass
class ReceiveTransactionIncorrectSenderBlockHash(VMError):
"""
Raised when a receive transaction is found that has a sender block hash
that doesnt match the one in our database.
"""
pass
class ReceivingTransactionForWrongWallet(VMError):
"""
Raised when a someone tries to receive a transaction sent to someone else.
"""
pass
class StackDepthLimit(VMError):
"""
Raised when the call stack has exceeded it's maximum allowed depth.
"""
pass
class ContractCreationCollision(VMError):
"""
Raised when there was an address collision during contract creation.
"""
pass
class IncorrectContractCreationAddress(VMError):
"""
Raised when the address provided by transaction does not
match the calculated contract creation address.
"""
pass
class Revert(VMError):
"""
Raised when the REVERT opcode occured
"""
burns_gas = False
erases_return_data = False
class WriteProtection(VMError):
"""
Raised when an attempt to modify the state database is made while
operating inside of a STATICCALL context.
"""
pass
class OutOfBoundsRead(VMError):
"""
Raised when an attempt was made to read data beyond the
boundaries of the buffer (such as with RETURNDATACOPY)
"""
pass
class AttemptedToAccessExternalStorage(VMError):
"""
Raised when a contract calls another contract and attempts
to use the storage in the other contract. This is not allowed
on Helios. Use DelegateCall instead of Call.
"""
pass
class DepreciatedVMFunctionality(VMError):
"""
Raised when a contract calls another a depreciated global variable or function
"""
pass | 23.158177 | 171 | 0.691364 | 1,033 | 8,638 | 5.775411 | 0.301065 | 0.078445 | 0.117332 | 0.042239 | 0.233993 | 0.179517 | 0.161247 | 0.127389 | 0.115991 | 0.115991 | 0 | 0.000459 | 0.243112 | 8,638 | 373 | 172 | 23.158177 | 0.912053 | 0.523385 | 0 | 0.469027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.469027 | 0.00885 | 0 | 0.539823 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
2b21c264b8b104047fd393b8623d64402d9f7dcd | 822 | py | Python | src/cfcs/__init__.py | KamasamaK/sublimetext-cfml | 3730fca4679a5294234dfb3207eb41a4b313b87e | [
"MIT"
] | null | null | null | src/cfcs/__init__.py | KamasamaK/sublimetext-cfml | 3730fca4679a5294234dfb3207eb41a4b313b87e | [
"MIT"
] | null | null | null | src/cfcs/__init__.py | KamasamaK/sublimetext-cfml | 3730fca4679a5294234dfb3207eb41a4b313b87e | [
"MIT"
] | 1 | 2022-02-28T17:09:43.000Z | 2022-02-28T17:09:43.000Z | from .cfcs import build_project_cfcs
from .completions import get_dot_completions
from .documentation import get_inline_documentation, get_goto_cfml_file, get_completions_doc, get_method_preview
from .di import CfmlDiPropertyCommand
from .. import completions, inline_documentation, goto_cfml_file, method_preview
from ..component_index import component_index
def get_completions(cfml_view):
if cfml_view.type == 'dot':
return get_dot_completions(cfml_view)
return None
completions.add_completion_source(get_completions)
completions.add_completion_doc_source(get_completions_doc)
inline_documentation.add_documentation_source(get_inline_documentation)
method_preview.add_preview_source(get_method_preview)
goto_cfml_file.add_goto_source(get_goto_cfml_file)
component_index.subscribe(build_project_cfcs)
| 41.1 | 112 | 0.868613 | 112 | 822 | 5.901786 | 0.267857 | 0.068079 | 0.072617 | 0.045386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.079075 | 822 | 19 | 113 | 43.263158 | 0.873184 | 0 | 0 | 0 | 0 | 0 | 0.00365 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0 | 0.375 | 0 | 0.5625 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
2b3105bc401831618b83dd86dab377681bcffe9d | 2,062 | py | Python | doobi/recc/serializers.py | bryanopew/doobi | 45e98c7a0a8aceea7b13665da4d57f161fe78725 | [
"MIT"
] | null | null | null | doobi/recc/serializers.py | bryanopew/doobi | 45e98c7a0a8aceea7b13665da4d57f161fe78725 | [
"MIT"
] | null | null | null | doobi/recc/serializers.py | bryanopew/doobi | 45e98c7a0a8aceea7b13665da4d57f161fe78725 | [
"MIT"
] | null | null | null | from . models import Cal_result, Foods, Profile, Recc_result
from rest_framework import serializers
class ProfileForReccSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = "__all__"
class CalResultSerializer(serializers.ModelSerializer):
class Meta:
model = Cal_result
fields = "__all__"
# 위 아니면 리스트, 튜플 형식으로도 가능
# fields = (
# "user",
# "bmr",
# "amr_total",
# "tmr",
# "cal_target",
# "carb_target_mass",
# "prot_target_mass",
# "fat_target_mass",
# )
class CalTargetSerializer(serializers.ModelSerializer):
class Meta:
model = Cal_result
fields = (
"user",
"created_at",
"cal_target",
"carb_target",
"prot_target",
"fat_target",
"sugar_target",
"sodium_target",
)
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = (
"user",
"created_at",
"budget",
"user_preference1",
"user_preference2",
"user_not_like",
)
class FoodLikedSerializer(serializers.ModelSerializer):
class Meta:
model = Foods
fields = (
'product_id',
'product_name',
'likes',
)
class FoodsSerializer(serializers.ModelSerializer):
class Meta:
model = Foods
fields = '__all__'
class ReccResultSerializer(serializers.ModelSerializer):
recommended_food = FoodLikedSerializer()
class Meta:
model = Recc_result
fields = "__all__"
class RecentWeightSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = (
"created_at",
"weight"
)
class PreviousFormSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = '__all__'
| 23.976744 | 60 | 0.555771 | 163 | 2,062 | 6.723926 | 0.355828 | 0.213504 | 0.114964 | 0.255474 | 0.392336 | 0.392336 | 0.392336 | 0.202555 | 0 | 0 | 0 | 0.001505 | 0.35548 | 2,062 | 85 | 61 | 24.258824 | 0.823175 | 0.084869 | 0 | 0.5 | 0 | 0 | 0.11953 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.032258 | 0 | 0.33871 | 0 | 0 | 0 | 0 | null | 1 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2b489d07d9e82fe1aadc06b20d66dc9fd7145ce7 | 430 | py | Python | app/models/shop/footprint.py | Hugking/lin-cms-flask | 5f79e744e60d0f1b81c6e8bd045ab4ffa00043ce | [
"MIT"
] | null | null | null | app/models/shop/footprint.py | Hugking/lin-cms-flask | 5f79e744e60d0f1b81c6e8bd045ab4ffa00043ce | [
"MIT"
] | null | null | null | app/models/shop/footprint.py | Hugking/lin-cms-flask | 5f79e744e60d0f1b81c6e8bd045ab4ffa00043ce | [
"MIT"
] | null | null | null | from lin.exception import NotFound, ParameterException
from lin.interface import InfoCrud as Base
from sqlalchemy import Column, String, Integer, Text,ForeignKey, DateTime
class Footprint(Base):
id = Column(Integer, primary_key=True, autoincrement=True)
member_id = Column(Integer,index=True,nullable=False,default='0')
goods_id = Column(Integer,index=True,nullable=False,default='0')
add_time = Column(DateTime)
| 43 | 73 | 0.77907 | 57 | 430 | 5.807018 | 0.578947 | 0.072508 | 0.135952 | 0.120846 | 0.271903 | 0.271903 | 0.271903 | 0.271903 | 0.271903 | 0 | 0 | 0.005291 | 0.12093 | 430 | 9 | 74 | 47.777778 | 0.87037 | 0 | 0 | 0 | 0 | 0 | 0.004651 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 1 | 0.125 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
2b4d03d59954090b025b2fdb39cc1802e82f536f | 751 | py | Python | wharf_management/wharf_management/doctype/security_check/security_check.py | staumoepeau/pms | 67aa43fb27f75482275b50dff17f5919e6c394b1 | [
"MIT"
] | 1 | 2021-02-19T11:45:24.000Z | 2021-02-19T11:45:24.000Z | wharf_management/wharf_management/doctype/security_check/security_check.py | staumoepeau/pms | 67aa43fb27f75482275b50dff17f5919e6c394b1 | [
"MIT"
] | 1 | 2021-08-12T08:29:50.000Z | 2021-08-17T06:12:02.000Z | wharf_management/wharf_management/doctype/security_check/security_check.py | staumoepeau/pms | 67aa43fb27f75482275b50dff17f5919e6c394b1 | [
"MIT"
] | 4 | 2020-07-22T20:30:00.000Z | 2021-08-07T12:36:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Sione Taumoepeau and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import msgprint, _, scrub
class SecurityCheck(Document):
def on_submit(self):
self.check_status()
def validate(self):
self.update_booking_request()
def update_booking_request(self):
frappe.db.sql("""Update `tabBooking Request` set security_status=%s, security_comment=%s where name=%s""", (self.security_status, self.comments, self.booking_ref))
def check_status(self):
if not self.security_status:
msgprint(_("Security Status is Manadory").format(self.security_status), raise_exception=1) | 30.04 | 165 | 0.772304 | 102 | 751 | 5.480392 | 0.558824 | 0.125224 | 0.096601 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009063 | 0.118509 | 751 | 25 | 166 | 30.04 | 0.835347 | 0.163782 | 0 | 0 | 0 | 0 | 0.1792 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.285714 | 0 | 0.642857 | 0.142857 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
2b58110490a5ec506b288ccfafb0c78b031eefd9 | 10,645 | py | Python | botstory/chat_test.py | botstory/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 5 | 2017-01-14T13:42:13.000Z | 2021-07-27T21:52:04.000Z | botstory/chat_test.py | botstory/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 235 | 2016-11-07T23:33:28.000Z | 2018-03-13T11:27:33.000Z | botstory/chat_test.py | hyzhak/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 5 | 2017-01-14T13:42:14.000Z | 2020-11-06T08:33:20.000Z | import aiohttp
import logging
import pytest
from botstory import Story
import botstory.integrations.fb.messenger
from botstory.middlewares import location
from botstory.utils import answer, SimpleTrigger
logger = logging.getLogger(__name__)
@pytest.fixture()
def mock_interface(mocker):
mocker.patch.object(
botstory.integrations.fb.messenger.FBInterface,
'send_audio',
aiohttp.test_utils.make_mocked_coro('something'),
)
mocker.patch.object(
botstory.integrations.fb.messenger.FBInterface,
'send_list',
aiohttp.test_utils.make_mocked_coro('something'),
)
mocker.patch.object(
botstory.integrations.fb.messenger.FBInterface,
'send_image',
aiohttp.test_utils.make_mocked_coro('something'),
)
mocker.patch.object(
botstory.integrations.fb.messenger.FBInterface,
'send_template',
aiohttp.test_utils.make_mocked_coro('something'),
)
mocker.patch.object(
botstory.integrations.fb.messenger.FBInterface,
'send_text_message',
aiohttp.test_utils.make_mocked_coro('something'),
)
return botstory.integrations.fb.messenger.FBInterface()
@pytest.mark.asyncio
async def test_should_say(mock_interface):
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
@story.on('hi there!')
def one_story():
@story.part()
async def then(message):
await story.say('Nice to see you!', message['user'])
await talk.pure_text('hi there!')
mock_interface.send_text_message.assert_called_once_with(
recipient=talk.user,
text='Nice to see you!',
options=None,
)
# TODO: move to middlewares/location/test_location.py
@pytest.mark.asyncio
@pytest.mark.skip
async def test_ask_location(mock_interface):
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
@story.on('SOS!')
def one_story():
@story.part()
async def then(message):
await story.ask_location('Hey, bro! Where is your rocket?', message['user'])
await talk.pure_text('SOS!')
mock_interface.send_text_message.assert_called_once_with(talk.user, text='Hey, bro! Where is your rocket?')
@pytest.mark.asyncio
@pytest.mark.skip
async def test_get_location_as_result_of_asking_of_location(mock_interface):
trigger = SimpleTrigger()
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
@story.on('SOS!')
def one_story():
@story.part()
def then(ctx):
return story.ask_location('Hey, bro! Where is your rocket?', ctx['user'])
@story.part()
def then(ctx):
trigger.receive(location.get_location(ctx))
await talk.pure_text('SOS!')
await talk.location('somewhere')
assert trigger.result() == 'somewhere'
@pytest.mark.asyncio
async def test_should_list_elements(mock_interface):
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
@story.on('hi there!')
def one_story():
@story.part()
async def then(ctx):
await story.list_elements(elements=[{
'title': 'Classic T-Shirt Collection', # (*) required
'image_url': 'https://peterssendreceiveapp.ngrok.io/img/collection.png',
'subtitle': 'See all our colors',
'default_action': {
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/shop_collection',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
},
'buttons': [{
'title': 'View',
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/collection',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
}]
}, {
'title': 'Classic White T-Shirt',
'image_url': 'https://peterssendreceiveapp.ngrok.io/img/white-t-shirt.png',
'subtitle': '100% Cotton, 200% Comfortable',
'default_action': {
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/view?item=100',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
},
'buttons': [{
'title': 'Shop Now',
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/shop?item=100',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
}]
}], buttons=[{
'title': 'View More',
'payload': 'payload',
}], user=ctx['user'])
await talk.ask('hi there!')
mock_interface.send_list.assert_called_once_with(
recipient=talk.user,
elements=[{
'title': 'Classic T-Shirt Collection', # (*) required
'image_url': 'https://peterssendreceiveapp.ngrok.io/img/collection.png',
'subtitle': 'See all our colors',
'default_action': {
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/shop_collection',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
},
'buttons': [{
'title': 'View',
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/collection',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
}]
}, {
'title': 'Classic White T-Shirt',
'image_url': 'https://peterssendreceiveapp.ngrok.io/img/white-t-shirt.png',
'subtitle': '100% Cotton, 200% Comfortable',
'default_action': {
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/view?item=100',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
},
'buttons': [{
'title': 'Shop Now',
'type': 'web_url',
'url': 'https://peterssendreceiveapp.ngrok.io/shop?item=100',
'messenger_extensions': True,
'webview_height_ratio': 'tall',
'fallback_url': 'https://peterssendreceiveapp.ngrok.io/'
}]
}], buttons=[{
'title': 'View More',
'payload': 'payload',
}],
options=None,
)
@pytest.mark.asyncio
async def test_should_send_template_based_message(mock_interface):
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
payload = {
'template_type': 'receipt',
'recipient_name': 'Stephane Crozatier',
'order_number': '12345678902',
'currency': 'USD',
'payment_method': 'Visa 2345',
'order_url': 'http://petersapparel.parseapp.com/order?order_id=123456',
'timestamp': '1428444852',
'elements': [{
'title': 'Classic White T-Shirt',
'subtitle': '100% Soft and Luxurious Cotton',
'quantity': 2,
'price': 50,
'currency': 'USD',
'image_url': 'http://petersapparel.parseapp.com/img/whiteshirt.png'
}, {
'title': 'Classic Gray T-Shirt',
'subtitle': '100% Soft and Luxurious Cotton',
'quantity': 1,
'price': 25,
'currency': 'USD',
'image_url': 'http://petersapparel.parseapp.com/img/grayshirt.png'
}],
'address': {
'street_1': '1 Hacker Way',
'street_2': '',
'city': 'Menlo Park',
'postal_code': '94025',
'state': 'CA',
'country': 'US'
},
'summary': {
'subtotal': 75.00,
'shipping_cost': 4.95,
'total_tax': 6.19,
'total_cost': 56.14
},
'adjustments': [{
'name': 'New Customer Discount',
'amount': 20
}, {
'name': '$10 Off Coupon',
'amount': 10
}]
}
await story.send_template(payload,
user=talk.user)
mock_interface.send_template.assert_called_once_with(recipient=talk.user,
payload=payload)
@pytest.mark.asyncio
async def test_send_audio(mock_interface):
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
await story.send_audio('http://some.ua/image.gif',
user=talk.user)
mock_interface.send_audio.assert_called_once_with(talk.user, 'http://some.ua/image.gif', None)
@pytest.mark.asyncio
async def test_send_image(mock_interface):
with answer.Talk() as talk:
story = talk.story
story.use(mock_interface)
await story.send_image('http://some.ua/image.gif',
user=talk.user)
mock_interface.send_image.assert_called_once_with(talk.user, 'http://some.ua/image.gif', None)
| 36.455479 | 115 | 0.519493 | 997 | 10,645 | 5.371113 | 0.201605 | 0.05098 | 0.104575 | 0.123249 | 0.786368 | 0.754062 | 0.7324 | 0.675444 | 0.675444 | 0.579832 | 0 | 0.013863 | 0.356224 | 10,645 | 291 | 116 | 36.580756 | 0.767547 | 0.007233 | 0 | 0.629482 | 0 | 0 | 0.289758 | 0 | 0 | 0 | 0 | 0.003436 | 0.027888 | 1 | 0.027888 | false | 0 | 0.027888 | 0.003984 | 0.063745 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2b623892d5b3f6ccac316343b3491435d7f31554 | 14,568 | py | Python | ooobuild/lo/inspection/x_property_handler.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/inspection/x_property_handler.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/inspection/x_property_handler.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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.
#
# Interface Class
# this is a auto generated file generated by Cheetah
# Libre Office Version: 7.3
# Namespace: com.sun.star.inspection
import typing
from abc import abstractmethod
from ..lang.x_component import XComponent as XComponent_98dc0ab5
if typing.TYPE_CHECKING:
from ..beans.property import Property as Property_8f4e0a76
from ..beans.property_state import PropertyState as PropertyState_c97b0c77
from ..beans.x_property_change_listener import XPropertyChangeListener as XPropertyChangeListener_58e4105a
from .interactive_selection_result import InteractiveSelectionResult as InteractiveSelectionResult_f27a13e7
from .line_descriptor import LineDescriptor as LineDescriptor_1e460eeb
from .x_object_inspector_ui import XObjectInspectorUI as XObjectInspectorUI_5ccd1048
from .x_property_control_factory import XPropertyControlFactory as XPropertyControlFactory_b8ed12ba
from ..uno.x_interface import XInterface as XInterface_8f010a43
class XPropertyHandler(XComponent_98dc0ab5):
"""
is the basic interface for object inspection.
The ObjectInspector itself does not know anything about the object it is inspecting, all information is obtained via XPropertyHandlers. Also, property handlers are responsible for describing the user interface which should be used to interact with the user, with respect to a given aspect of the inspected component.
**since**
OOo 2.0.3
See Also:
`API XPropertyHandler <https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1inspection_1_1XPropertyHandler.html>`_
"""
__ooo_ns__: str = 'com.sun.star.inspection'
__ooo_full_ns__: str = 'com.sun.star.inspection.XPropertyHandler'
__ooo_type_name__: str = 'interface'
__pyunointerface__: str = 'com.sun.star.inspection.XPropertyHandler'
@abstractmethod
def actuatingPropertyChanged(self, ActuatingPropertyName: str, NewValue: object, OldValue: object, InspectorUI: 'XObjectInspectorUI_5ccd1048', FirstTimeInit: bool) -> None:
"""
updates the UI of dependent properties when the value of a certain actuating property changed
This method is called whenever a property value changes, limited to those properties whose changes the handler expressed interest in (see getActuatingProperties()).
Raises:
com.sun.star.lang.NullPointerException: ``NullPointerException``
"""
@abstractmethod
def addPropertyChangeListener(self, Listener: 'XPropertyChangeListener_58e4105a') -> None:
"""
registers a listener for notification about property value changes
An XPropertyHandler implementation might decide to ignore this call. However, in this case property value changes made by third party components are not reflected in the object inspector.
If a handler implementation supports property change listeners, it must be able to cope with a call to addPropertyChangeListener() even if currently no component is being inspected. In this case, the listener must become active as soon as a new introspection is set in the next inspect() call.
Raises:
com.sun.star.lang.NullPointerException: ``NullPointerException``
"""
@abstractmethod
def convertToControlValue(self, PropertyName: str, PropertyValue: object, ControlValueType: object) -> object:
"""
converts a given property value to a control-compatible value
In describePropertyLine(), a property handler declared which type of control should be used to display the value of a certain property. To allow to use the same control type for different properties, and in particular, for properties of different type, conversions between controls values and property values are needed.
This method converts a property value, which has previously been obtained using getPropertyValue(), into a control-compatible value, which can be used with XPropertyControl's XPropertyControl.Value attribute.
A usual application of this method are list boxes: There is a generic list box implementation, which is able to display a simple list of strings. Usually, every string represents one possible property value. To translate between those property values and the displayed strings, convertToControlValue() and convertToPropertyValue() are used.
The method is not invoked if the control's value type (XPropertyControl.ValueType equals the property's value type.
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
"""
@abstractmethod
def convertToPropertyValue(self, PropertyName: str, ControlValue: object) -> object:
"""
converts a given control-compatible value to a property value
In describePropertyLine(), a property handler declared which type of control should be used to display the value of a certain property. To allow to use the same control type for different properties, and in particular, for properties of different type, conversions between controls values and property values are needed.
This method converts a control value into a property value, which subsequently can be used in conjunction with setPropertyValue().
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
"""
@abstractmethod
def describePropertyLine(self, PropertyName: str, ControlFactory: 'XPropertyControlFactory_b8ed12ba') -> 'LineDescriptor_1e460eeb':
"""
describes the UI to be used to represent the property
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
com.sun.star.lang.NullPointerException: ``NullPointerException``
"""
@abstractmethod
def getActuatingProperties(self) -> 'typing.Tuple[str, ...]':
"""
retrieve the actuating properties which this handler is interested in
In general, properties can be declared as \"actuating\", that is, when their value changes, the UI for other properties needs to be updated (e.g. enabled or disabled).
With this method, a handler can declare that it feels responsible for some/all of the depending properties of certain actuating properties.
Whenever the value of an actuating property changes, all handlers which expressed their interest in this particular actuating properties are called with their actuatingPropertyChanged() method.
If getSupportedProperties() returned an empty sequence, this method will not be called
"""
@abstractmethod
def getPropertyState(self, PropertyName: str) -> 'PropertyState_c97b0c77':
"""
returns the state of a property
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
"""
@abstractmethod
def getPropertyValue(self, PropertyName: str) -> object:
"""
retrieves the current value of a property
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
"""
@abstractmethod
def getSupersededProperties(self) -> 'typing.Tuple[str, ...]':
"""
returns the properties which are to be superseded by this handler
Besides defining an own set of properties (see getSupportedProperties()), a property handler can also declare that foreign properties (which it is not responsible for) are superseded by its own properties.
This is usually used if your handler is used with another, more generic one, which should continue to be responsible for all properties, except a few which your handler handles more elegantly.
In such a case, simply return those properties here.
There is a precedence in the property handlers used by an ObjectInspector, which also is important for the superseded properties. This precedence is implied by the precedence of factories to create the property handlers, as denoted in the XObjectInspectorModel.HandlerFactories attribute.
With this in mind, property handlers can only supersede properties which are supported by a handler preceding them, but not properties of handlers succeeding them.
For instance, imaging an XObjectInspectorModel which provides three factories, for handler A, B, and C - in this order. Now if A supports the property Foo, C supports Bar, and B supersedes both Foo and Bar, them the result is Bar is still present. This is because B precedes C, so it cannot, by definition, supersede properties which are supported by C.
If getSupportedProperties() returned an empty sequence, this method will not be called.
"""
@abstractmethod
def getSupportedProperties(self) -> 'typing.Tuple[Property_8f4e0a76, ...]':
"""
returns the properties which the handler can handle
A handler is allowed to return an empty sequence here, indicating that for the given introspection, no properties handling can be provided. This might happen when a fixed set of property handlers is used for a variety of components to inspect, where not all handlers can really cope with all components.
In the case of returning an empty sequence here, the property handler is ignored by all further processing in the object inspector.
"""
@abstractmethod
def inspect(self, Component: 'XInterface_8f010a43') -> None:
"""
binds the property handler to a new component
Raises:
com.sun.star.lang.NullPointerException: ``NullPointerException``
"""
@abstractmethod
def isComposable(self, PropertyName: str) -> bool:
"""
determines whether a given property, which the handler is responsible for, is composable.
An object inspector can inspect multiple components at once, displaying the intersection of their properties. For this, all components are examined for their properties, and all properties which exist for all components, and are declared to be composable by their respective handler, are displayed in the inspector UI.
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
"""
@abstractmethod
def onInteractivePropertySelection(self, PropertyName: str, Primary: bool, outData: object, InspectorUI: 'XObjectInspectorUI_5ccd1048') -> 'InteractiveSelectionResult_f27a13e7':
"""
called when a browse button belonging to a property UI representation has been clicked
Property handlers can raise a dedicated UI for entering or somehow changing a property value. Usually, this will be a modal dialog, but it can also be a non-modal user interface component.
Availability of this feature is indicated by the LineDescriptor.HasPrimaryButton and LineDescriptor.HasSecondaryButton members of a LineDescriptor, which the XPropertyHandler fills in its describePropertyLine() method.
When this method is called, the property handler should raise the UI needed to enter the property value, and return the result of this (see InteractiveSelectionResult).
It is recommended that property handlers do not directly set the property value which has been obtained from the user, but store it in the output-parameter Data, and return InteractiveSelectionResult.ObtainedValue.
If a handler sets the new property value directly, and returns InteractiveSelectionResult.ObtainedValue, this implies that the property cannot properly be handled in case the object inspector is inspecting an intersection of multiple components, since in this case onInteractivePropertySelection() will be called at one handler only, however the new property would have to be forwarded to all handlers.
If a property is not composable, directly setting the new property value does not yield any problem, as long as property listeners are properly notified of the change.
* ``outData`` is an out direction argument.
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
com.sun.star.lang.NullPointerException: ``NullPointerException``
"""
@abstractmethod
def removePropertyChangeListener(self, Listener: 'XPropertyChangeListener_58e4105a') -> None:
"""
revokes a listener for notification about property value changes
"""
@abstractmethod
def setPropertyValue(self, PropertyName: str, Value: object) -> None:
"""
sets the value of a property
Raises:
com.sun.star.beans.UnknownPropertyException: ``UnknownPropertyException``
com.sun.star.beans.PropertyVetoException: ``PropertyVetoException``
"""
@abstractmethod
def suspend(self, Suspend: bool) -> bool:
"""
suspends the handler
A XPropertyHandler is used by a XObjectInspector instance, which implements the XController interface. By definition, a XObjectInspector always forwards all suspend requests (com.sun.star.frame.XController.suspend()) to all its handlers.
The usual use case for this method are non-modal user interface components used for property value input. Such a component might have been opened during onInteractivePropertySelection(). If a property handler receives a suspend() call, it should forward the suspension request to the UI component, and veto suspension of the XObjectInspector as appropriate.
If suspension is not to be vetoed, then all non-modal UI components opened by the handler should have been closed when it returns from the suspend() call.
"""
__all__ = ['XPropertyHandler']
| 61.468354 | 410 | 0.734075 | 1,764 | 14,568 | 6.022676 | 0.267007 | 0.01073 | 0.017884 | 0.016566 | 0.213479 | 0.198042 | 0.181005 | 0.181005 | 0.171781 | 0.125753 | 0 | 0.010373 | 0.212521 | 14,568 | 236 | 411 | 61.728814 | 0.915708 | 0.706274 | 0 | 0.32 | 0 | 0 | 0.146427 | 0.116629 | 0 | 0 | 0 | 0 | 0 | 1 | 0.32 | false | 0 | 0.22 | 0 | 0.64 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
2b6e8e31e13f5f8be39e53404e2a14e1327af75b | 4,982 | py | Python | magma/t.py | leonardt/magma | d3e8c9500ec3b167df8ed067e0c0305781c94ab6 | [
"MIT"
] | 167 | 2017-10-08T00:59:22.000Z | 2022-02-08T00:14:39.000Z | magma/t.py | leonardt/magma | d3e8c9500ec3b167df8ed067e0c0305781c94ab6 | [
"MIT"
] | 719 | 2017-08-29T17:58:28.000Z | 2022-03-31T23:39:18.000Z | magma/t.py | leonardt/magma | d3e8c9500ec3b167df8ed067e0c0305781c94ab6 | [
"MIT"
] | 14 | 2017-09-01T03:25:16.000Z | 2021-11-05T13:30:24.000Z | import abc
import enum
from magma.common import deprecated
from magma.compatibility import IntegerTypes, StringTypes
from magma.ref import AnonRef, NamedRef, TempNamedRef, DefnRef, InstRef
from magma.protocol_type import magma_value
from magma.wire import wire
class Direction(enum.Enum):
In = 0
Out = 1
InOut = 2
Undirected = 3
class Type(object):
def __init__(self, name=None):
if name is None:
name = AnonRef()
elif isinstance(name, str):
name = TempNamedRef(name=name, value=self)
self.name = name
__hash__ = object.__hash__
def __repr__(self):
if self.name.anon():
return f"{type(self)}()"
has_name = (isinstance(self.name, NamedRef) and
not isinstance(self.name, (InstRef, DefnRef)))
if has_name:
return f"{type(self)}(name=\"{repr(self.name)}\")"
return repr(self.name)
def __str__(self):
if self.name.anon():
# Anon names aren't very useful, so just return a repr instead so
# it's easier to find the value
return repr(self)
return str(self.name)
# An instance has an anon name.
def anon(self):
return self.name.anon()
# Abstract method to be implemented by subclasses.
@classmethod
def is_oriented(cls, direction):
raise NotImplementedError()
@classmethod
def is_clock(cls):
raise NotImplementedError()
@classmethod
def is_input(cls):
return cls.is_oriented(Direction.In)
@classmethod
def is_output(cls):
return cls.is_oriented(Direction.Out)
@classmethod
def is_inout(cls):
return cls.is_oriented(Direction.InOut)
@classmethod
@deprecated
def isoriented(cls, direction):
return cls.is_oriented(direction)
@classmethod
@deprecated
def isinput(cls):
return cls.is_input()
@classmethod
@deprecated
def isoutput(cls):
return cls.is_output()
@classmethod
@deprecated
def isinout(cls):
return cls.is_inout()
@property
def debug_name(self):
defn_str = ""
inst_str = ""
if isinstance(self.name, DefnRef):
defn_str = str(self.name.defn.name) + "."
elif isinstance(self.name, InstRef):
inst_str = str(self.name.inst.name) + "."
defn_str = str(self.name.inst.defn.name) + "."
return f"{defn_str}{inst_str}{str(self)}"
def __le__(self, other):
if self.is_output():
raise TypeError(f"Cannot use <= to assign to output: "
f"{self.debug_name} (trying to assign "
f"{other.debug_name})")
wire(other, self)
def __imatmul__(self, other):
other = magma_value(other)
if self.is_output():
raise TypeError(f"Cannot use @= to assign to output: {self} "
f"(trying to assign {other})")
wire(other, self)
return self
@abc.abstractmethod
def unused(self):
# Mark value is unused by calling unused on the underlying magma
# elements. For example, m.Bit is wired up to a coreir term primitive A
# general m.Array and m.Tuple will recursively call `unused` on its
# members.
raise NotImplementedError()
@abc.abstractmethod
def undriven(self):
# Mark value is undriven by calling undriven on the underlying magma
# elements. For example, m.Bit is wired up to a coreir undriven
# primitive A general m.Array and m.Tuple will recursively call
# `undriven` on its members.
raise NotImplementedError()
def is_driven_anon_temporary(self):
"""
Returns true if this is an anonymous temporary value (not an output)
that is driven
"""
return self.name.anon() and not self.is_output() and self.driven()
class Kind(type):
# Subclasses only need to implement one of these methods.
def __eq__(cls, rhs):
return cls is rhs
__hash__ = type.__hash__
def __repr__(cls):
return cls.__name__
def __str__(cls):
return cls.__name__
@abc.abstractmethod
def qualify(cls, direction):
raise NotImplementedError()
def flip(cls):
if cls.direction == Direction.In:
return cls[Direction.Out]
if cls.direction == Direction.Out:
return cls[Direction.In]
# Flip of inout is inout, and flip of undirected is undirected.
return cls
@property
def undirected_t(cls):
return cls.qualify(Direction.Undirected)
@property
def is_directed(cls):
return cls is not cls.qualify(Direction.Undirected)
def In(T):
return T.qualify(Direction.In)
def Out(T):
return T.qualify(Direction.Out)
def InOut(T):
return T.qualify(Direction.InOut)
def Flip(T):
return T.flip()
| 26.784946 | 79 | 0.61381 | 622 | 4,982 | 4.770096 | 0.226688 | 0.045838 | 0.040445 | 0.03303 | 0.262555 | 0.145939 | 0.114594 | 0.114594 | 0.114594 | 0.114594 | 0 | 0.001135 | 0.292654 | 4,982 | 185 | 80 | 26.92973 | 0.840806 | 0.160779 | 0 | 0.251969 | 0 | 0 | 0.054642 | 0.007495 | 0 | 0 | 0 | 0 | 0 | 1 | 0.23622 | false | 0 | 0.055118 | 0.133858 | 0.582677 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
2b6f5015f37c257a07fcf7c93dc55530a55149b2 | 284 | py | Python | src/python/baekjoon/10996.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/10996.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/10996.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | N = int(input())
R = []
for i in range(0, N*2) :
if i%2 == 0 : R.append("*")
else : R.append(" ")
for l in range(0, N) :
P1 = P2 = ""
for i in range(0, N) :
P1 += R[i]
print(P1)
for i in range(N*2-1, N-1, -1) :
P2 += R[i]
print(P2) | 18.933333 | 36 | 0.408451 | 54 | 284 | 2.148148 | 0.333333 | 0.241379 | 0.155172 | 0.284483 | 0.336207 | 0.224138 | 0 | 0 | 0 | 0 | 0 | 0.089888 | 0.373239 | 284 | 15 | 37 | 18.933333 | 0.561798 | 0 | 0 | 0 | 0 | 0 | 0.007018 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | null | 1 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2b7232f90a535ad8f5b268e20e520ac98a6345eb | 2,089 | py | Python | evaluator/base_evaluator.py | marsggbo/CovidNet3D | 0aeca91a775f938a0e568dd88d8162473dacf3ce | [
"MIT"
] | 5 | 2021-02-23T06:43:31.000Z | 2021-07-05T15:24:05.000Z | evaluator/base_evaluator.py | etherx-dev/CovidNet3D | b107d7d965cad07f1890ee492857273f3468cc01 | [
"MIT"
] | 1 | 2021-06-08T21:06:10.000Z | 2021-06-08T21:06:10.000Z | evaluator/base_evaluator.py | etherx-dev/CovidNet3D | b107d7d965cad07f1890ee492857273f3468cc01 | [
"MIT"
] | 4 | 2021-02-01T03:29:16.000Z | 2021-08-05T09:13:37.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import argparse
import json
import logging
import os
import time
from argparse import ArgumentParser
import numpy as np
import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
import nni
from datasets import build_dataset
from kd_model import load_kd_model, loss_fn_kd
from losses import build_loss_fn
from networks import build_model
from nni.nas.pytorch.fixed import apply_fixed_architecture
from nni.nas.pytorch.utils import AverageMeter
from utils import (MyLogger, flops_size_counter, generate_optimizer,
generate_scheduler, metrics, mixup_loss_fn, mixup_data,
parse_cfg_for_scheduler)
from abc import ABC, abstractmethod
global logger
global writter
__all__ = [
'BaseEvaluator'
]
class BaseEvaluator(ABC):
def init(self):
'''init train_epochs, device, loss_fn, dataset, and dataloaders, ...
'''
raise NotImplementedError
def reset(self):
'''mutable can be only initialized for once, hence it needs to
reset model, optimizer, scheduler when a new trial starts.
'''
raise NotImplementedError
def compare(self):
'''evaluate all arcs and find the best one
'''
raise NotImplementedError
def run(self, arc, validate=True):
'''retrain the best arc from scratch
self.reset()
# init model and mutator
mutator = apply_fixed_architecture(self.model, arc)
for epoch in range(start_epoch, end_epoch):
for callback in self.callbacks:
callback.on_epoch_begin(epoch)
self.train_one_epoch(epoch)
if validate:
self.validate_one_epoch(epoch)
for callback in self.callbacks:
callback.on_epoch_end(epoch)
'''
raise NotImplementedError
@abstractmethod
def train_one_epoch(self, epoch):
pass
@abstractmethod
def valid_one_epoch(self, epoch):
pass | 26.443038 | 76 | 0.675443 | 254 | 2,089 | 5.385827 | 0.448819 | 0.017544 | 0.059211 | 0.024854 | 0.097953 | 0.067251 | 0.067251 | 0.067251 | 0.067251 | 0 | 0 | 0 | 0.26472 | 2,089 | 79 | 77 | 26.443038 | 0.890625 | 0.346577 | 0 | 0.195122 | 0 | 0 | 0.010708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.146341 | false | 0.04878 | 0.463415 | 0 | 0.634146 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
2b75551cd2d7ea8e68ffa526133f1c22b78f2a55 | 494 | py | Python | example/models.py | acdh-oeaw/django-gnd | 48e4d11bad0fb9ee11cc386d5f401480551e871c | [
"MIT"
] | null | null | null | example/models.py | acdh-oeaw/django-gnd | 48e4d11bad0fb9ee11cc386d5f401480551e871c | [
"MIT"
] | null | null | null | example/models.py | acdh-oeaw/django-gnd | 48e4d11bad0fb9ee11cc386d5f401480551e871c | [
"MIT"
] | null | null | null | from django.db import models
from django.urls import reverse
from gnd.models import GndPersonBase
class MyText(models.Model):
title = models.CharField(max_length=250, blank=True, null=True)
text = models.TextField(blank=True, null=True)
def __str__(self):
return self.title
class Person(GndPersonBase):
title = models.CharField(max_length=250, blank=True, null=True)
def get_absolute_url(self):
return reverse('person_detail', kwargs={'pk': self.id})
| 24.7 | 67 | 0.722672 | 68 | 494 | 5.117647 | 0.5 | 0.077586 | 0.112069 | 0.146552 | 0.347701 | 0.281609 | 0.281609 | 0.281609 | 0.281609 | 0.281609 | 0 | 0.014599 | 0.168016 | 494 | 19 | 68 | 26 | 0.832117 | 0 | 0 | 0.166667 | 0 | 0 | 0.030364 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.25 | 0.166667 | 1 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
2b75db05dad24a6a1243b29f46ad745c9c2181c9 | 535 | py | Python | programs/migrations/0004_auto_20200708_1510.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | 2 | 2020-09-04T17:06:41.000Z | 2020-10-05T01:46:20.000Z | programs/migrations/0004_auto_20200708_1510.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | null | null | null | programs/migrations/0004_auto_20200708_1510.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-07-08 20:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programs', '0003_program_total_lines'),
]
operations = [
migrations.AlterField(
model_name='program',
name='finish_date',
field=models.DateField(null=True),
),
migrations.AlterField(
model_name='program',
name='start_date',
field=models.DateField(),
),
]
| 22.291667 | 49 | 0.571963 | 53 | 535 | 5.641509 | 0.679245 | 0.133779 | 0.167224 | 0.19398 | 0.267559 | 0.267559 | 0 | 0 | 0 | 0 | 0 | 0.051771 | 0.314019 | 535 | 23 | 50 | 23.26087 | 0.762943 | 0.084112 | 0 | 0.352941 | 1 | 0 | 0.137295 | 0.04918 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.058824 | 0 | 0.235294 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 2 |
2b76074f6c6e9f21f01241dacdb81730768d55e8 | 3,643 | py | Python | example.py | Resident234/dejavu | 607811a60388f024d8dd52b47030b4271e4660f3 | [
"MIT"
] | null | null | null | example.py | Resident234/dejavu | 607811a60388f024d8dd52b47030b4271e4660f3 | [
"MIT"
] | null | null | null | example.py | Resident234/dejavu | 607811a60388f024d8dd52b47030b4271e4660f3 | [
"MIT"
] | null | null | null | import warnings
import json
import logging
import datetime
import threading, time
import vlc
import os
import sys
#import multiprocessing
from multiprocessing import Process
warnings.filterwarnings("ignore")
from dejavu import Dejavu
from dejavu.recognize import FileRecognizer, MicrophoneRecognizer
from dejavu.record_stream import RecordStream
import dejavu.logger as logger
# load config from a JSON file (or anything outputting a python dictionary)
with open("dejavu.cnf") as f:
config = json.load(f)
dejavu_process_logger = logger.get_logger('dejavu_process_logger')
record_stream_logger = logger.get_logger('record_stream_logger')
def dejavu_process():
ticker = threading.Event()
while not ticker.wait(60 * 2):#60 * 120
dejavu_process_logger.info('TIME LABEL')
djv.fingerprint_translation_record_directory("records", [".mp3"])
def record_stream_process():
ticker = threading.Event()
while not ticker.wait(1):
record_stream_logger.info('TIME LABEL')
record_stream.record()
def recognize_process():
ticker = threading.Event()
# while not ticker.wait(60 * 1): #
print "recognize_process"
dejavu_process_logger.info('recognize_process')
song = djv.recognize(FileRecognizer, "records/1103_2019-09-14-18-40-43.mp3")
print "#1 From file we recognized: %s\n" % song
if __name__ == '__main__':
# create a Dejavu instance
djv = Dejavu(config)
#record_stream = RecordStream()
#dejavu_process = Process(target=dejavu_process)
#dejavu_process.start()
#record_stream_process = Process(target=record_stream_process)
#record_stream_process.start()
recognize_process = Process(target=recognize_process)
recognize_process.start()
#dejavu_process.join()
#record_stream_process.join()
recognize_process.join()
#song = djv.recognize(FileRecognizer, "records/01 Chasing shadows_fragment.mp3")
#print "#2 From file we recognized: %s\n" % song
#djv.fingerprint_file("records/2019-02-24_20-41-01.mp3")
#djv.fingerprint_translation_record_file("records/2019-02-24_20-41-01.mp3")
# 0 2 21 0 43 50 1 03 05 -> 1 03 32
# Recognize audio from a file
#song = djv.recognize(FileRecognizer, "mp3/Sean-Fournier--Falling-For-You.mp3")
#print "From file we recognized: %s\n" % song
#song = djv.recognize(FileRecognizer, "records/2019-02-24_20-41-01.mp3")
#print "#3 From file we recognized: %s\n" % song
#'offset_seconds': 3784.99193
#song = djv.recognize(FileRecognizer, "records/2019-02-24_20-41-01_ad.mp3")
#print "#4 From file we recognized: %s\n" % song
#recognizer = FileRecognizer(djv)
#recognizer.recognize_directory("records/splitted", [".mp3"])
#recognizer.recognize_directory("records/splitted_10", [".mp3"])
#recognizer.recognize_directory("records/splitted_3", [".mp3"])
#recognizer.recognize_directory("records/splitted_1", [".mp3"])
#song = djv.recognize(FileRecognizer, "records/2019-02-24_00-59-46.mp3")
#print "From file we recognized: %s\n" % song
# Or recognize audio from your microphone for `secs` seconds
#secs = 5
#song = djv.recognize(MicrophoneRecognizer, seconds=secs)
#if song is None:
# print "Nothing recognized -- did you play the song out loud so your mic could hear it? :)"
#else:
# print "From mic with %d seconds we recognized: %s\n" % (secs, song)
# Or use a recognizer without the shortcut, in anyway you would like
#song = recognizer.recognize_file("mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3")
#print "No shortcut, we recognized: %s\n" % song
| 35.715686 | 101 | 0.715619 | 491 | 3,643 | 5.160896 | 0.295316 | 0.052092 | 0.041042 | 0.044199 | 0.31176 | 0.258485 | 0.204025 | 0.162983 | 0.126283 | 0.040253 | 0 | 0.051004 | 0.165797 | 3,643 | 101 | 102 | 36.069307 | 0.782823 | 0.553939 | 0 | 0.076923 | 0 | 0 | 0.125396 | 0.036099 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | null | null | 0.076923 | 0 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
2b7b79f498f068eefb83d8e90c391e5196855fa6 | 26,109 | py | Python | pysnmp/SYMMCOMMONPTP.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/SYMMCOMMONPTP.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/SYMMCOMMONPTP.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SYMMCOMMONPTP (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMMCOMMONPTP
# Produced by pysmi-0.3.4 at Tue Jul 30 11:34:16 2019
# On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt
# Using Python version 3.7.4 (default, Jul 9 2019, 18:13:23)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint")
entPhysicalIndex, = mibBuilder.importSymbols("ENTITY-MIB", "entPhysicalIndex")
ifIndex, ifNumber = mibBuilder.importSymbols("IF-MIB", "ifIndex", "ifNumber")
NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup")
NotificationType, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, TimeTicks, Unsigned32, ObjectIdentity, ModuleIdentity, iso, Bits, MibIdentifier, Counter32, Gauge32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "TimeTicks", "Unsigned32", "ObjectIdentity", "ModuleIdentity", "iso", "Bits", "MibIdentifier", "Counter32", "Gauge32", "IpAddress")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
EnableValue, symmPacketService = mibBuilder.importSymbols("SYMM-COMMON-SMI", "EnableValue", "symmPacketService")
symmPTPv2 = ModuleIdentity((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1))
symmPTPv2.setRevisions(('2018-07-31 06:20',))
if mibBuilder.loadTexts: symmPTPv2.setLastUpdated('201807310620Z')
if mibBuilder.loadTexts: symmPTPv2.setOrganization('Symmetricom')
class PTPPROFILEVALUE(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))
namedValues = NamedValues(("profileTelecom2008", 1), ("profileDefault", 2), ("profileHybrid", 3), ("profileITU8265one", 4), ("profileEthernetDefault", 5), ("profileITU8275one", 6), ("profileITU8275two", 7))
class PTPTIMESCALETYPE(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3))
namedValues = NamedValues(("auto", 1), ("arb", 2), ("ptp", 3))
class PTPMGMTADDRTYPE(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1))
namedValues = NamedValues(("unicast", 0), ("multicast", 1))
class PTPTRANSPORTTYPE(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("ethernet", 1), ("ipv4", 2))
class PTPADDRMODETYPE(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2))
namedValues = NamedValues(("unicast", 0), ("multicast", 1), ("multicasthybrid", 2))
class PORTSTATEVALUE(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("enable", 1), ("disable", 2))
class G82751McAddrValue(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))
namedValues = NamedValues(("mac011b19000000", 1), ("mac0180c200000e", 2))
class VLANID(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1))
namedValues = NamedValues(("none", 1))
class DateAndTime(TextualConvention, OctetString):
status = 'current'
displayHint = '2d-1d-1d,1d:1d:1d.1d,1a1d:1d'
subtypeSpec = OctetString.subtypeSpec + ConstraintsUnion(ValueSizeConstraint(8, 8), ValueSizeConstraint(11, 11), )
class TLatAndLon(TextualConvention, OctetString):
status = 'current'
displayHint = '1a1d:1d:1d.1d'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(5, 5)
fixedLength = 5
class TAntHeight(TextualConvention, OctetString):
status = 'current'
displayHint = '1a2d.1d'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4)
fixedLength = 4
class TLocalTimeOffset(TextualConvention, OctetString):
status = 'current'
displayHint = '1a1d:1d'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(3, 3)
fixedLength = 3
class TSsm(TextualConvention, Integer32):
status = 'current'
displayHint = 'x'
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 255)
ptpv2Status = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1))
ptpv2StatusTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1), )
if mibBuilder.loadTexts: ptpv2StatusTable.setStatus('current')
ptpv2StatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONPTP", "ptpv2StatusIndex"))
if mibBuilder.loadTexts: ptpv2StatusEntry.setStatus('current')
ptpv2StatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: ptpv2StatusIndex.setStatus('current')
ptpv2StatusPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 2), EnableValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusPortEnable.setStatus('current')
ptpv2StatusClockID = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusClockID.setStatus('current')
ptpv2StatusProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 4), PTPPROFILEVALUE()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusProfile.setStatus('current')
ptpv2StatusClockClass = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusClockClass.setStatus('current')
ptpv2StatusClockAccuracy = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusClockAccuracy.setStatus('current')
ptpv2StatusTimescale = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 7), PTPTIMESCALETYPE()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusTimescale.setStatus('current')
ptpv2StatusNumClient = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusNumClient.setStatus('current')
ptpv2StatusClientLoad = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 1, 1, 9), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2StatusClientLoad.setStatus('current')
ptpv2ClientDataTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 2), )
if mibBuilder.loadTexts: ptpv2ClientDataTable.setStatus('current')
ptpv2ClientDataEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 2, 1), ).setIndexNames((0, "SYMMCOMMONPTP", "ptpv2ClientDataIndex"))
if mibBuilder.loadTexts: ptpv2ClientDataEntry.setStatus('current')
ptpv2ClientDataIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5000))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2ClientDataIndex.setStatus('current')
ptpv2ClientData = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ptpv2ClientData.setStatus('current')
ptpv2Config = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2))
ptpv2CommonTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1), )
if mibBuilder.loadTexts: ptpv2CommonTable.setStatus('current')
ptpv2CommonEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONPTP", "ptpv2CommonIndex"))
if mibBuilder.loadTexts: ptpv2CommonEntry.setStatus('current')
ptpv2CommonIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: ptpv2CommonIndex.setStatus('current')
ptpv2Profile = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 2), PTPPROFILEVALUE()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2Profile.setStatus('current')
ptpv2ClockID = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2ClockID.setStatus('current')
ptpv2Priority1 = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2Priority1.setStatus('current')
ptpv2Priority2 = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2Priority2.setStatus('current')
ptpv2Domain = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2Domain.setStatus('current')
ptpv2DSCPState = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 7), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2DSCPState.setStatus('current')
ptpv2DSCPValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2DSCPValue.setStatus('current')
ptpv2State = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 9), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2State.setStatus('current')
ptpv2MaxClient = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1500)).clone(500)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MaxClient.setStatus('current')
ptpv2AnnounceLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-4, 4)).clone(-3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2AnnounceLimit.setStatus('current')
ptpv2SyncLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-7, 7)).clone(-7)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2SyncLimit.setStatus('current')
ptpv2DelayLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-7, 7)).clone(-7)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2DelayLimit.setStatus('current')
ptpv2TwoStep = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 14), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2TwoStep.setStatus('current')
ptpv2MgmtAddrMode = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 15), PTPMGMTADDRTYPE()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MgmtAddrMode.setStatus('current')
ptpv2TTL = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2TTL.setStatus('current')
ptpv2AlternateGM = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 17), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2AlternateGM.setStatus('current')
ptpv2TimeScale = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 18), PTPTIMESCALETYPE()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2TimeScale.setStatus('current')
ptpv2Dither = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 19), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2Dither.setStatus('current')
ptpv2ServiceLoadAlarmThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2ServiceLoadAlarmThreshold.setStatus('current')
ptpv2UnicastTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2), )
if mibBuilder.loadTexts: ptpv2UnicastTable.setStatus('current')
ptpv2UnicastEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONPTP", "ptpv2UnicastIndex"))
if mibBuilder.loadTexts: ptpv2UnicastEntry.setStatus('current')
ptpv2UnicastIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: ptpv2UnicastIndex.setStatus('current')
ptpv2UnicastNeg = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2, 1, 2), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2UnicastNeg.setStatus('current')
ptpv2UnicastLeaseDurLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2UnicastLeaseDurLimit.setStatus('current')
ptpv2UnicastInterfaceRateTLV = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2, 1, 4), EnableValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2UnicastInterfaceRateTLV.setStatus('current')
ptpv2UnicastLeaseExtension = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2UnicastLeaseExtension.setStatus('current')
ptpv2MulticastTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3), )
if mibBuilder.loadTexts: ptpv2MulticastTable.setStatus('current')
ptpv2MulticastEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONPTP", "ptpv2MulticastIndex"))
if mibBuilder.loadTexts: ptpv2MulticastEntry.setStatus('current')
ptpv2MulticastIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: ptpv2MulticastIndex.setStatus('current')
ptpv2MulticastAnnounceInt = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-4, 4))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MulticastAnnounceInt.setStatus('current')
ptpv2MulticastSyncInt = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-7, 7))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MulticastSyncInt.setStatus('current')
ptpv2MulticastDelayInt = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-7, 7))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MulticastDelayInt.setStatus('current')
ptpv2MulticastAnnoTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 10)).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MulticastAnnoTimeout.setStatus('current')
ptpv2MulticastVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MulticastVlanId.setStatus('current')
ptpv2MulticastClientTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 3, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 3600)).clone(360)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2MulticastClientTimeout.setStatus('current')
ptpv2G82751Table = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 4), )
if mibBuilder.loadTexts: ptpv2G82751Table.setStatus('current')
ptpv2G82751Entry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONPTP", "ptpv2G82751Index"))
if mibBuilder.loadTexts: ptpv2G82751Entry.setStatus('current')
ptpv2G82751Index = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: ptpv2G82751Index.setStatus('current')
ptpv2G82751MulticastAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 4, 1, 2), G82751McAddrValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2G82751MulticastAddr.setStatus('current')
ptpv2G82751LocalPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2G82751LocalPriority.setStatus('current')
ptpv2ReflectorTable = MibTable((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5), )
if mibBuilder.loadTexts: ptpv2ReflectorTable.setStatus('current')
ptpv2ReflectorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "SYMMCOMMONPTP", "ptpv2ReflectorIndex"))
if mibBuilder.loadTexts: ptpv2ReflectorEntry.setStatus('current')
ptpv2ReflectorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)))
if mibBuilder.loadTexts: ptpv2ReflectorIndex.setStatus('current')
ptpv2ReflectorAnnounceIntv = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-3, 0))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2ReflectorAnnounceIntv.setStatus('current')
ptpv2ReflectorSyncDelayIntv = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-7, -4))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2ReflectorSyncDelayIntv.setStatus('current')
ptpv2ReflectorClientTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2ReflectorClientTimeout.setStatus('current')
ptpv2ReflectorVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 2, 5, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ptpv2ReflectorVlanID.setStatus('current')
ptpv2Conformance = ObjectIdentity((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3))
if mibBuilder.loadTexts: ptpv2Conformance.setStatus('current')
ptpv2Compliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 1))
ptpv2BasicCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 1, 1)).setObjects(("SYMMCOMMONPTP", "ptpv2StatusGroup"), ("SYMMCOMMONPTP", "ptpv2ClientDataGroup"), ("SYMMCOMMONPTP", "ptpv2CommonGroup"), ("SYMMCOMMONPTP", "ptpv2UnicastGroup"), ("SYMMCOMMONPTP", "ptpv2MulticastGroup"), ("SYMMCOMMONPTP", "ptpv2G82751Group"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2BasicCompliance = ptpv2BasicCompliance.setStatus('current')
ptpv2UocGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2))
ptpv2StatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2, 1)).setObjects(("SYMMCOMMONPTP", "ptpv2StatusPortEnable"), ("SYMMCOMMONPTP", "ptpv2StatusClockID"), ("SYMMCOMMONPTP", "ptpv2StatusProfile"), ("SYMMCOMMONPTP", "ptpv2StatusClockClass"), ("SYMMCOMMONPTP", "ptpv2StatusClockAccuracy"), ("SYMMCOMMONPTP", "ptpv2StatusTimescale"), ("SYMMCOMMONPTP", "ptpv2StatusNumClient"), ("SYMMCOMMONPTP", "ptpv2StatusClientLoad"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2StatusGroup = ptpv2StatusGroup.setStatus('current')
ptpv2ClientDataGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2, 2)).setObjects(("SYMMCOMMONPTP", "ptpv2ClientDataIndex"), ("SYMMCOMMONPTP", "ptpv2ClientData"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2ClientDataGroup = ptpv2ClientDataGroup.setStatus('current')
ptpv2CommonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2, 3)).setObjects(("SYMMCOMMONPTP", "ptpv2Profile"), ("SYMMCOMMONPTP", "ptpv2ClockID"), ("SYMMCOMMONPTP", "ptpv2Priority1"), ("SYMMCOMMONPTP", "ptpv2Priority2"), ("SYMMCOMMONPTP", "ptpv2Domain"), ("SYMMCOMMONPTP", "ptpv2DSCPState"), ("SYMMCOMMONPTP", "ptpv2DSCPValue"), ("SYMMCOMMONPTP", "ptpv2State"), ("SYMMCOMMONPTP", "ptpv2MaxClient"), ("SYMMCOMMONPTP", "ptpv2AnnounceLimit"), ("SYMMCOMMONPTP", "ptpv2SyncLimit"), ("SYMMCOMMONPTP", "ptpv2DelayLimit"), ("SYMMCOMMONPTP", "ptpv2TwoStep"), ("SYMMCOMMONPTP", "ptpv2MgmtAddrMode"), ("SYMMCOMMONPTP", "ptpv2TTL"), ("SYMMCOMMONPTP", "ptpv2AlternateGM"), ("SYMMCOMMONPTP", "ptpv2TimeScale"), ("SYMMCOMMONPTP", "ptpv2Dither"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2CommonGroup = ptpv2CommonGroup.setStatus('current')
ptpv2UnicastGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2, 4)).setObjects(("SYMMCOMMONPTP", "ptpv2UnicastNeg"), ("SYMMCOMMONPTP", "ptpv2UnicastLeaseDurLimit"), ("SYMMCOMMONPTP", "ptpv2UnicastInterfaceRateTLV"), ("SYMMCOMMONPTP", "ptpv2UnicastLeaseExtension"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2UnicastGroup = ptpv2UnicastGroup.setStatus('current')
ptpv2MulticastGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2, 5)).setObjects(("SYMMCOMMONPTP", "ptpv2MulticastAnnounceInt"), ("SYMMCOMMONPTP", "ptpv2MulticastSyncInt"), ("SYMMCOMMONPTP", "ptpv2MulticastDelayInt"), ("SYMMCOMMONPTP", "ptpv2MulticastAnnoTimeout"), ("SYMMCOMMONPTP", "ptpv2MulticastVlanId"), ("SYMMCOMMONPTP", "ptpv2MulticastClientTimeout"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2MulticastGroup = ptpv2MulticastGroup.setStatus('current')
ptpv2G82751Group = ObjectGroup((1, 3, 6, 1, 4, 1, 9070, 1, 2, 5, 1, 1, 3, 2, 6)).setObjects(("SYMMCOMMONPTP", "ptpv2G82751MulticastAddr"), ("SYMMCOMMONPTP", "ptpv2G82751LocalPriority"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ptpv2G82751Group = ptpv2G82751Group.setStatus('current')
mibBuilder.exportSymbols("SYMMCOMMONPTP", ptpv2ReflectorAnnounceIntv=ptpv2ReflectorAnnounceIntv, PYSNMP_MODULE_ID=symmPTPv2, ptpv2Domain=ptpv2Domain, ptpv2StatusClockClass=ptpv2StatusClockClass, ptpv2StatusNumClient=ptpv2StatusNumClient, ptpv2ClientDataTable=ptpv2ClientDataTable, PTPADDRMODETYPE=PTPADDRMODETYPE, ptpv2ClientData=ptpv2ClientData, ptpv2UnicastTable=ptpv2UnicastTable, ptpv2ReflectorSyncDelayIntv=ptpv2ReflectorSyncDelayIntv, ptpv2TTL=ptpv2TTL, ptpv2Compliances=ptpv2Compliances, ptpv2G82751Index=ptpv2G82751Index, ptpv2MulticastClientTimeout=ptpv2MulticastClientTimeout, PTPMGMTADDRTYPE=PTPMGMTADDRTYPE, DateAndTime=DateAndTime, ptpv2StatusTimescale=ptpv2StatusTimescale, ptpv2Profile=ptpv2Profile, ptpv2G82751Entry=ptpv2G82751Entry, ptpv2StatusProfile=ptpv2StatusProfile, ptpv2MulticastSyncInt=ptpv2MulticastSyncInt, ptpv2State=ptpv2State, ptpv2CommonIndex=ptpv2CommonIndex, ptpv2MulticastGroup=ptpv2MulticastGroup, ptpv2StatusClockAccuracy=ptpv2StatusClockAccuracy, ptpv2TimeScale=ptpv2TimeScale, ptpv2UocGroups=ptpv2UocGroups, ptpv2ClockID=ptpv2ClockID, ptpv2UnicastInterfaceRateTLV=ptpv2UnicastInterfaceRateTLV, ptpv2G82751Group=ptpv2G82751Group, ptpv2StatusGroup=ptpv2StatusGroup, VLANID=VLANID, ptpv2MulticastIndex=ptpv2MulticastIndex, ptpv2MulticastTable=ptpv2MulticastTable, PTPTIMESCALETYPE=PTPTIMESCALETYPE, PTPTRANSPORTTYPE=PTPTRANSPORTTYPE, ptpv2StatusEntry=ptpv2StatusEntry, ptpv2ReflectorEntry=ptpv2ReflectorEntry, ptpv2MulticastVlanId=ptpv2MulticastVlanId, ptpv2UnicastEntry=ptpv2UnicastEntry, ptpv2Config=ptpv2Config, ptpv2TwoStep=ptpv2TwoStep, ptpv2CommonTable=ptpv2CommonTable, PTPPROFILEVALUE=PTPPROFILEVALUE, ptpv2DSCPState=ptpv2DSCPState, TLatAndLon=TLatAndLon, ptpv2CommonGroup=ptpv2CommonGroup, ptpv2UnicastIndex=ptpv2UnicastIndex, ptpv2G82751LocalPriority=ptpv2G82751LocalPriority, ptpv2MaxClient=ptpv2MaxClient, ptpv2G82751Table=ptpv2G82751Table, ptpv2ClientDataGroup=ptpv2ClientDataGroup, ptpv2MulticastAnnounceInt=ptpv2MulticastAnnounceInt, G82751McAddrValue=G82751McAddrValue, ptpv2AlternateGM=ptpv2AlternateGM, ptpv2Status=ptpv2Status, TSsm=TSsm, ptpv2UnicastNeg=ptpv2UnicastNeg, ptpv2StatusIndex=ptpv2StatusIndex, ptpv2ClientDataEntry=ptpv2ClientDataEntry, ptpv2BasicCompliance=ptpv2BasicCompliance, TLocalTimeOffset=TLocalTimeOffset, ptpv2ServiceLoadAlarmThreshold=ptpv2ServiceLoadAlarmThreshold, ptpv2StatusTable=ptpv2StatusTable, ptpv2MgmtAddrMode=ptpv2MgmtAddrMode, ptpv2AnnounceLimit=ptpv2AnnounceLimit, ptpv2DSCPValue=ptpv2DSCPValue, PORTSTATEVALUE=PORTSTATEVALUE, ptpv2ReflectorTable=ptpv2ReflectorTable, symmPTPv2=symmPTPv2, ptpv2ClientDataIndex=ptpv2ClientDataIndex, ptpv2UnicastGroup=ptpv2UnicastGroup, ptpv2StatusClockID=ptpv2StatusClockID, ptpv2MulticastEntry=ptpv2MulticastEntry, ptpv2ReflectorClientTimeout=ptpv2ReflectorClientTimeout, ptpv2StatusClientLoad=ptpv2StatusClientLoad, ptpv2SyncLimit=ptpv2SyncLimit, ptpv2Priority1=ptpv2Priority1, ptpv2ReflectorIndex=ptpv2ReflectorIndex, ptpv2G82751MulticastAddr=ptpv2G82751MulticastAddr, TAntHeight=TAntHeight, ptpv2DelayLimit=ptpv2DelayLimit, ptpv2ReflectorVlanID=ptpv2ReflectorVlanID, ptpv2StatusPortEnable=ptpv2StatusPortEnable, ptpv2UnicastLeaseDurLimit=ptpv2UnicastLeaseDurLimit, ptpv2MulticastDelayInt=ptpv2MulticastDelayInt, ptpv2Conformance=ptpv2Conformance, ptpv2Dither=ptpv2Dither, ptpv2Priority2=ptpv2Priority2, ptpv2UnicastLeaseExtension=ptpv2UnicastLeaseExtension, ptpv2MulticastAnnoTimeout=ptpv2MulticastAnnoTimeout, ptpv2CommonEntry=ptpv2CommonEntry)
| 109.242678 | 3,472 | 0.747865 | 2,929 | 26,109 | 6.665756 | 0.089109 | 0.014956 | 0.013061 | 0.01721 | 0.425015 | 0.352182 | 0.289183 | 0.270027 | 0.251229 | 0.238937 | 0 | 0.105428 | 0.095408 | 26,109 | 238 | 3,473 | 109.701681 | 0.72123 | 0.012601 | 0 | 0.068807 | 0 | 0 | 0.139226 | 0.016608 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.041284 | 0 | 0.256881 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9913d53c298de5a6193b0026cb227fb8ff808714 | 514 | py | Python | AER_experimentalist/experiment_environment/IV.py | musslick/DARTS-Cognitive-Modeling | f38e7e34f6f20c1626458de62503e8670e06be7c | [
"MIT"
] | null | null | null | AER_experimentalist/experiment_environment/IV.py | musslick/DARTS-Cognitive-Modeling | f38e7e34f6f20c1626458de62503e8670e06be7c | [
"MIT"
] | null | null | null | AER_experimentalist/experiment_environment/IV.py | musslick/DARTS-Cognitive-Modeling | f38e7e34f6f20c1626458de62503e8670e06be7c | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from tinkerforge_variable import Tinkerforge_Variable
class IV(Tinkerforge_Variable):
def __init__(self, *args, **kwargs):
self._name = "IV"
self._variable_label = "Independent Variable"
super(IV, self).__init__(*args, **kwargs)
# Method for measuring dependent variable.
@abstractmethod
def manipulate(self):
pass
# Method for cleaning up measurement device.
@abstractmethod
def __clean_up__(self):
pass
| 24.47619 | 53 | 0.68677 | 56 | 514 | 5.964286 | 0.5 | 0.170659 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.231518 | 514 | 20 | 54 | 25.7 | 0.84557 | 0.161479 | 0 | 0.307692 | 0 | 0 | 0.051402 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0.153846 | 0.153846 | 0 | 0.461538 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
991a14e9940b831c177bd7fef5e9c7239bb18cfa | 298 | py | Python | mayan/apps/ocr/literals.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 2 | 2021-09-12T19:41:19.000Z | 2021-09-12T19:41:20.000Z | mayan/apps/ocr/literals.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 37 | 2021-09-13T01:00:12.000Z | 2021-10-02T03:54:30.000Z | mayan/apps/ocr/literals.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 1 | 2021-09-22T13:17:30.000Z | 2021-09-22T13:17:30.000Z | DEFAULT_OCR_AUTO_OCR = True
DEFAULT_OCR_BACKEND = 'mayan.apps.ocr.backends.tesseract.Tesseract'
DEFAULT_OCR_BACKEND_ARGUMENTS = {'environment': {'OMP_THREAD_LIMIT': '1'}}
TASK_DOCUMENT_VERSION_PAGE_OCR_RETRY_DELAY = 10
TASK_DOCUMENT_VERSION_PAGE_OCR_TIMEOUT = 10 * 60 # 10 Minutes per page
| 42.571429 | 75 | 0.805369 | 43 | 298 | 5.093023 | 0.604651 | 0.136986 | 0.155251 | 0.210046 | 0.237443 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033835 | 0.107383 | 298 | 6 | 76 | 49.666667 | 0.789474 | 0.063758 | 0 | 0 | 0 | 0 | 0.261993 | 0.158672 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
991fb0f0b1676c7704c886f5d502235f7e62b383 | 770 | py | Python | article/templatetags/article_tags.py | brahici/WBO | 8781512b2ae3e308e2fe9310935a0f5ce4e30a29 | [
"BSD-3-Clause"
] | null | null | null | article/templatetags/article_tags.py | brahici/WBO | 8781512b2ae3e308e2fe9310935a0f5ce4e30a29 | [
"BSD-3-Clause"
] | null | null | null | article/templatetags/article_tags.py | brahici/WBO | 8781512b2ae3e308e2fe9310935a0f5ce4e30a29 | [
"BSD-3-Clause"
] | null | null | null | from django.template import Library
from taggit.models import Tag
from ..models import Article, Category
register = Library()
@register.inclusion_tag('article/tags/recent_articles.html')
def get_recent_articles(number=5):
articles = Article.published.all()[:number]
return {'articles': articles,}
@register.inclusion_tag('article/tags/archive_articles.html')
def get_archive_articles():
archives = Article.published.all()
return {'archives': archives,}
@register.inclusion_tag('article/tags/category.html')
def get_categories():
categories = Category.objects.all()
return {'categories': categories,}
@register.inclusion_tag('article/tags/tag.html')
def get_tags():
tags = Tag.objects.all().order_by('name')
return {'tags': tags,}
| 26.551724 | 61 | 0.738961 | 95 | 770 | 5.852632 | 0.315789 | 0.122302 | 0.143885 | 0.194245 | 0.223022 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001475 | 0.119481 | 770 | 28 | 62 | 27.5 | 0.818584 | 0 | 0 | 0 | 0 | 0 | 0.192458 | 0.148244 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.15 | 0 | 0.55 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
99201765d5f972ad4a6a952e2022f6b35f419092 | 4,539 | py | Python | app/status/models.py | LCOGT/serol | 1b1a0c8343fc7233b9935b8da64c90b8696134cc | [
"MIT"
] | null | null | null | app/status/models.py | LCOGT/serol | 1b1a0c8343fc7233b9935b8da64c90b8696134cc | [
"MIT"
] | 19 | 2017-12-13T14:33:46.000Z | 2022-03-11T23:47:08.000Z | app/status/models.py | LCOGT/serol | 1b1a0c8343fc7233b9935b8da64c90b8696134cc | [
"MIT"
] | null | null | null | from datetime import datetime
from django.db import models
from django.contrib import admin
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django_fsm import FSMField, transition
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from explorer.models import Challenge, Mission
IMAGE_STATUS_OPTIONS = ((0,'No Image'), (1, 'Quicklook'), (2, 'Final'), (3,'Poor Quality'))
COLOUR_STATE = {'New': '000',
'Submitted': 'F1C40F',
'Observed':'5DADE2',
'Identify':'E67E22',
'Analyse':'A569BD',
'Investigate':'aaa',
'Summary':'2ECC71',
'Failed':'E74C3C'
}
class Proposal(models.Model):
code = models.CharField(max_length=20, unique=True)
active = models.BooleanField(default=True)
def __str__(self):
if self.active:
state = ""
else:
state = "NOT "
return "{} is {}active".format(self.code, state)
class User(AbstractUser):
token = models.CharField(help_text=_('Authentication for Valhalla'), max_length=50, blank=True, null=True)
archive_token = models.CharField(help_text=_('Authentication for LCO archive'), max_length=50, blank=True, null=True)
default_proposal = models.ForeignKey(Proposal, null=True, blank=True, on_delete=models.CASCADE)
mission_1 = models.BooleanField(help_text=_('Has user competed Mission 1?'), default=False)
mission_2 = models.BooleanField(help_text=_('Has user competed Mission 2?'), default=False)
mission_3 = models.BooleanField(help_text=_('Has user competed Mission 3?'), default=False)
class Progress(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
challenge = models.ForeignKey(Challenge, on_delete=models.CASCADE)
requestid = models.CharField(max_length=20, null=True, blank=True)
frameids = models.CharField(max_length=20, null=True, blank=True)
status = FSMField(default='New', choices=settings.PROGRESS_OPTIONS)
last_update = models.DateTimeField(default=datetime.utcnow)
target = models.CharField(max_length=100)
image_file = models.FileField(null=True, blank=True, upload_to='images')
image_status = models.SmallIntegerField(default=0, choices=IMAGE_STATUS_OPTIONS)
def has_image(self):
if self.image_file is not None:
return True
else:
return False
has_image.boolean = True
def coloured_state(self):
return format_html(
'<span style="color: #{};">{}</span>',
COLOUR_STATE[self.status],
self.status,
)
def image_tag(self):
return mark_safe('<img src="{}" width="150" height="150" />'.format(self.image_file.url))
image_tag.short_description = 'Image'
def __str__(self):
return "{} is {} in {}".format(self.user.username, self.challenge, self.status)
class Meta:
unique_together = (("user","challenge"),)
verbose_name_plural = 'Challenge Progress'
@transition(field=status, source=['New'], target='Submitted')
def submit(self):
pass
@transition(field=status, source=['Submitted'], target='Failed')
def failed(self):
pass
@transition(field=status, source=['Failed'], target='New')
def retry(self):
self.requestid = ''
self.frameids = ''
pass
@transition(field=status, source=['Submitted'], target='Observed')
def observed(self):
pass
@transition(field=status, source=['Observed'], target='Identify')
def identify(self):
pass
@transition(field=status, source=['Identify'], target='Analyse')
def analyse(self):
pass
@transition(field=status, source=['Analyse'], target='Investigate')
def investigate(self):
pass
@transition(field=status, source=['Analyse','Investigate'], target='Summary')
def completed(self):
pass
class Question(models.Model):
text = models.TextField()
challenge = models.ForeignKey(Challenge, on_delete=models.CASCADE)
class Meta:
verbose_name_plural = 'questions'
class Answer(models.Model):
text = models.TextField()
question = models.ForeignKey(Question, on_delete=models.CASCADE)
class UserAnswer(models.Model):
answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
| 35.186047 | 121 | 0.666667 | 527 | 4,539 | 5.616698 | 0.27704 | 0.027027 | 0.056757 | 0.072973 | 0.330405 | 0.290878 | 0.254054 | 0.14527 | 0.029054 | 0 | 0 | 0.014124 | 0.20445 | 4,539 | 128 | 122 | 35.460938 | 0.805594 | 0 | 0 | 0.194175 | 0 | 0 | 0.124477 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.126214 | false | 0.07767 | 0.097087 | 0.029126 | 0.582524 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
992f8922bdee0ba5a83a10cf55efdc2c81a78c4a | 436 | py | Python | iota/commands/extended/helpers.py | joWeiss/iota.lib.py | e168aaf7101d4eea2fa98340ef793cc870270597 | [
"MIT"
] | null | null | null | iota/commands/extended/helpers.py | joWeiss/iota.lib.py | e168aaf7101d4eea2fa98340ef793cc870270597 | [
"MIT"
] | null | null | null | iota/commands/extended/helpers.py | joWeiss/iota.lib.py | e168aaf7101d4eea2fa98340ef793cc870270597 | [
"MIT"
] | null | null | null | class Helpers(object):
"""
Adds additional helper functions that aren't part of the core or extended
API.
"""
def __init__(self, api):
self.api = api
def is_promotable(self, tail):
# type: (TransactionHash) -> bool
"""
Determines if a tail transaction is promotable.
:param tail:
Transaction hash. Must be a tail transaction.
"""
return self.api.check_consistency(tails=[tail])['state']
| 22.947368 | 75 | 0.658257 | 56 | 436 | 5.017857 | 0.696429 | 0.074733 | 0.113879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.229358 | 436 | 18 | 76 | 24.222222 | 0.83631 | 0.506881 | 0 | 0 | 0 | 0 | 0.02809 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0 | 0.8 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
993679cf18fb575717d3ec43572613b88cdb5275 | 310 | py | Python | src/features/build_features.py | victormmp/ibm_advanced_ds_capstone | fe5f785c6118acaaa698a07d6e1f8a82b816d042 | [
"MIT"
] | null | null | null | src/features/build_features.py | victormmp/ibm_advanced_ds_capstone | fe5f785c6118acaaa698a07d6e1f8a82b816d042 | [
"MIT"
] | null | null | null | src/features/build_features.py | victormmp/ibm_advanced_ds_capstone | fe5f785c6118acaaa698a07d6e1f8a82b816d042 | [
"MIT"
] | null | null | null | import csv
import pandas as pd
import numpy as np
import os
import sys
root_dir = os.path.dirname(__file__)
sys.path.insert(0, root_dir + '/../..')
class ETL:
def __init__(self):
self.data = None
def load_data(self, path):
self.data = pd.read_csv(path)
return self
| 16.315789 | 39 | 0.629032 | 47 | 310 | 3.893617 | 0.553191 | 0.076503 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004367 | 0.26129 | 310 | 19 | 40 | 16.315789 | 0.79476 | 0 | 0 | 0 | 0 | 0 | 0.019293 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.384615 | 0 | 0.692308 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
9947f9b9c078d6c553858729a5952d4735a8d687 | 755 | py | Python | src/unittest/python/raq_matchers/TimeMatchers.py | Continuous-Delivery-Machines/raqcrawl | f00fd7cd29143c99b7b17151d65c22ba87959b64 | [
"Apache-2.0"
] | null | null | null | src/unittest/python/raq_matchers/TimeMatchers.py | Continuous-Delivery-Machines/raqcrawl | f00fd7cd29143c99b7b17151d65c22ba87959b64 | [
"Apache-2.0"
] | null | null | null | src/unittest/python/raq_matchers/TimeMatchers.py | Continuous-Delivery-Machines/raqcrawl | f00fd7cd29143c99b7b17151d65c22ba87959b64 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from hamcrest.core.base_matcher import BaseMatcher
class WithinDatetimeMatcher(BaseMatcher):
def __init__(self, lower_limit_datetime: datetime, upper_limit_datetime: datetime):
self.__lowerLimit = lower_limit_datetime
self.__upperLimit = upper_limit_datetime
def _matches(self, item: datetime):
return self.__lowerLimit <= item <= self.__upperLimit
def describe_to(self, description):
description.append_text('datetime between {0} and {1}'.format(self.__lowerLimit, self.__upperLimit))
def within_an_hour():
low = datetime.utcnow() - timedelta(seconds=10)
up = datetime.utcnow() + timedelta(hours=1, seconds=10)
return WithinDatetimeMatcher(low, up)
| 32.826087 | 108 | 0.744371 | 87 | 755 | 6.114943 | 0.471264 | 0.097744 | 0.067669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011058 | 0.161589 | 755 | 22 | 109 | 34.318182 | 0.829384 | 0 | 0 | 0 | 0 | 0 | 0.037086 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.071429 | 0.642857 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
994f2a9b067dc43d042097eea7bcc12994acae5d | 873 | py | Python | pypro/aperitivos/tests/test_video.py | ravellys/curso-django | 98c0fad20d7c9e5dcd3482eb37c43f9d65695184 | [
"MIT"
] | null | null | null | pypro/aperitivos/tests/test_video.py | ravellys/curso-django | 98c0fad20d7c9e5dcd3482eb37c43f9d65695184 | [
"MIT"
] | 789 | 2020-09-02T01:46:12.000Z | 2022-03-31T23:55:42.000Z | pypro/aperitivos/tests/test_video.py | ravellys/curso-django | 98c0fad20d7c9e5dcd3482eb37c43f9d65695184 | [
"MIT"
] | null | null | null | import pytest
from django.urls import reverse
from model_mommy import mommy
from pypro.aperitivos.models import Video
from pypro.django_assertions import assert_contains
@pytest.fixture
def video(db):
return mommy.make(Video)
@pytest.fixture
def resp(client, video):
return client.get(reverse('aperitivos:video', args=(video.slug, )))
@pytest.fixture
def resp_video_notfound(client, video):
return client.get(reverse('aperitivos:video', args=(video.slug+'_video_notfound', )))
def test_status_code(resp):
return resp.status_code == 200
def test_status_code_video_notfound(resp_video_notfound):
return resp_video_notfound.status_code == 404
def test_title_video(resp, video):
assert_contains(resp, video.title)
def test_content_video(resp, video):
assert_contains(resp, f'<iframe src="https://www.youtube.com/embed/{video.v_id}"')
| 22.973684 | 89 | 0.767468 | 125 | 873 | 5.152 | 0.344 | 0.083851 | 0.074534 | 0.062112 | 0.28882 | 0.28882 | 0.189441 | 0.189441 | 0.189441 | 0.189441 | 0 | 0.007813 | 0.120275 | 873 | 37 | 90 | 23.594595 | 0.830729 | 0 | 0 | 0.136364 | 0 | 0 | 0.117984 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 1 | 0.318182 | false | 0 | 0.227273 | 0.227273 | 0.772727 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
995680b25f293385b1b3c0e4810d1bd28b5693a8 | 9,308 | py | Python | prototree/train.py | TristanGomez44/ProtoTree | d9e77a90b47cb1efe19f1736c6701872a3c4a62e | [
"MIT"
] | 35 | 2020-12-03T14:38:52.000Z | 2022-03-30T02:41:26.000Z | prototree/train.py | TristanGomez44/ProtoTree | d9e77a90b47cb1efe19f1736c6701872a3c4a62e | [
"MIT"
] | 3 | 2021-06-01T10:55:12.000Z | 2021-11-27T10:40:14.000Z | prototree/train.py | TristanGomez44/ProtoTree | d9e77a90b47cb1efe19f1736c6701872a3c4a62e | [
"MIT"
] | 7 | 2021-03-13T12:17:01.000Z | 2022-02-17T15:12:13.000Z | from tqdm import tqdm
import argparse
from copy import deepcopy
import torch
import torch.nn.functional as F
import torch.optim
import torch.utils.data
from torch.utils.data import DataLoader
from prototree.prototree import ProtoTree
from util.log import Log
def train_epoch(tree: ProtoTree,
train_loader: DataLoader,
optimizer: torch.optim.Optimizer,
epoch: int,
disable_derivative_free_leaf_optim: bool,
device,
log: Log = None,
log_prefix: str = 'log_train_epochs',
progress_prefix: str = 'Train Epoch'
) -> dict:
tree = tree.to(device)
# Make sure the model is in eval mode
tree.eval()
# Store info about the procedure
train_info = dict()
total_loss = 0.
total_acc = 0.
# Create a log if required
log_loss = f'{log_prefix}_losses'
nr_batches = float(len(train_loader))
with torch.no_grad():
_old_dist_params = dict()
for leaf in tree.leaves:
_old_dist_params[leaf] = leaf._dist_params.detach().clone()
# Optimize class distributions in leafs
eye = torch.eye(tree._num_classes).to(device)
# Show progress on progress bar
train_iter = tqdm(enumerate(train_loader),
total=len(train_loader),
desc=progress_prefix+' %s'%epoch,
ncols=0)
# Iterate through the data set to update leaves, prototypes and network
for i, (xs, ys) in train_iter:
# Make sure the model is in train mode
tree.train()
# Reset the gradients
optimizer.zero_grad()
xs, ys = xs.to(device), ys.to(device)
# Perform a forward pass through the network
ys_pred, info = tree.forward(xs)
# Learn prototypes and network with gradient descent.
# If disable_derivative_free_leaf_optim, leaves are optimized with gradient descent as well.
# Compute the loss
if tree._log_probabilities:
loss = F.nll_loss(ys_pred, ys)
else:
loss = F.nll_loss(torch.log(ys_pred), ys)
# Compute the gradient
loss.backward()
# Update model parameters
optimizer.step()
if not disable_derivative_free_leaf_optim:
#Update leaves with derivate-free algorithm
#Make sure the tree is in eval mode
tree.eval()
with torch.no_grad():
target = eye[ys] #shape (batchsize, num_classes)
for leaf in tree.leaves:
if tree._log_probabilities:
# log version
update = torch.exp(torch.logsumexp(info['pa_tensor'][leaf.index] + leaf.distribution() + torch.log(target) - ys_pred, dim=0))
else:
update = torch.sum((info['pa_tensor'][leaf.index] * leaf.distribution() * target)/ys_pred, dim=0)
leaf._dist_params -= (_old_dist_params[leaf]/nr_batches)
F.relu_(leaf._dist_params) #dist_params values can get slightly negative because of floating point issues. therefore, set to zero.
leaf._dist_params += update
# Count the number of correct classifications
ys_pred_max = torch.argmax(ys_pred, dim=1)
correct = torch.sum(torch.eq(ys_pred_max, ys))
acc = correct.item() / float(len(xs))
train_iter.set_postfix_str(
f'Batch [{i + 1}/{len(train_loader)}], Loss: {loss.item():.3f}, Acc: {acc:.3f}'
)
# Compute metrics over this batch
total_loss+=loss.item()
total_acc+=acc
if log is not None:
log.log_values(log_loss, epoch, i + 1, loss.item(), acc)
train_info['loss'] = total_loss/float(i+1)
train_info['train_accuracy'] = total_acc/float(i+1)
return train_info
def train_epoch_kontschieder(tree: ProtoTree,
train_loader: DataLoader,
optimizer: torch.optim.Optimizer,
epoch: int,
disable_derivative_free_leaf_optim: bool,
device,
log: Log = None,
log_prefix: str = 'log_train_epochs',
progress_prefix: str = 'Train Epoch'
) -> dict:
tree = tree.to(device)
# Store info about the procedure
train_info = dict()
total_loss = 0.
total_acc = 0.
# Create a log if required
log_loss = f'{log_prefix}_losses'
if log is not None and epoch==1:
log.create_log(log_loss, 'epoch', 'batch', 'loss', 'batch_train_acc')
# Reset the gradients
optimizer.zero_grad()
if disable_derivative_free_leaf_optim:
print("WARNING: kontschieder arguments will be ignored when training leaves with gradient descent")
else:
if tree._kontschieder_normalization:
# Iterate over the dataset multiple times to learn leaves following Kontschieder's approach
for _ in range(10):
# Train leaves with derivative-free algorithm using normalization factor
train_leaves_epoch(tree, train_loader, epoch, device)
else:
# Train leaves with Kontschieder's derivative-free algorithm, but using softmax
train_leaves_epoch(tree, train_loader, epoch, device)
# Train prototypes and network.
# If disable_derivative_free_leaf_optim, leafs are optimized with gradient descent as well.
# Show progress on progress bar
train_iter = tqdm(enumerate(train_loader),
total=len(train_loader),
desc=progress_prefix+' %s'%epoch,
ncols=0)
# Make sure the model is in train mode
tree.train()
for i, (xs, ys) in train_iter:
xs, ys = xs.to(device), ys.to(device)
# Reset the gradients
optimizer.zero_grad()
# Perform a forward pass through the network
ys_pred, _ = tree.forward(xs)
# Compute the loss
if tree._log_probabilities:
loss = F.nll_loss(ys_pred, ys)
else:
loss = F.nll_loss(torch.log(ys_pred), ys)
# Compute the gradient
loss.backward()
# Update model parameters
optimizer.step()
# Count the number of correct classifications
ys_pred = torch.argmax(ys_pred, dim=1)
correct = torch.sum(torch.eq(ys_pred, ys))
acc = correct.item() / float(len(xs))
train_iter.set_postfix_str(
f'Batch [{i + 1}/{len(train_loader)}], Loss: {loss.item():.3f}, Acc: {acc:.3f}'
)
# Compute metrics over this batch
total_loss+=loss.item()
total_acc+=acc
if log is not None:
log.log_values(log_loss, epoch, i + 1, loss.item(), acc)
train_info['loss'] = total_loss/float(i+1)
train_info['train_accuracy'] = total_acc/float(i+1)
return train_info
# Updates leaves with derivative-free algorithm
def train_leaves_epoch(tree: ProtoTree,
train_loader: DataLoader,
epoch: int,
device,
progress_prefix: str = 'Train Leafs Epoch'
) -> dict:
#Make sure the tree is in eval mode for updating leafs
tree.eval()
with torch.no_grad():
_old_dist_params = dict()
for leaf in tree.leaves:
_old_dist_params[leaf] = leaf._dist_params.detach().clone()
# Optimize class distributions in leafs
eye = torch.eye(tree._num_classes).to(device)
# Show progress on progress bar
train_iter = tqdm(enumerate(train_loader),
total=len(train_loader),
desc=progress_prefix+' %s'%epoch,
ncols=0)
# Iterate through the data set
update_sum = dict()
# Create empty tensor for each leaf that will be filled with new values
for leaf in tree.leaves:
update_sum[leaf] = torch.zeros_like(leaf._dist_params)
for i, (xs, ys) in train_iter:
xs, ys = xs.to(device), ys.to(device)
#Train leafs without gradient descent
out, info = tree.forward(xs)
target = eye[ys] #shape (batchsize, num_classes)
for leaf in tree.leaves:
if tree._log_probabilities:
# log version
update = torch.exp(torch.logsumexp(info['pa_tensor'][leaf.index] + leaf.distribution() + torch.log(target) - out, dim=0))
else:
update = torch.sum((info['pa_tensor'][leaf.index] * leaf.distribution() * target)/out, dim=0)
update_sum[leaf] += update
for leaf in tree.leaves:
leaf._dist_params -= leaf._dist_params #set current dist params to zero
leaf._dist_params += update_sum[leaf] #give dist params new value | 38.783333 | 151 | 0.572733 | 1,119 | 9,308 | 4.588025 | 0.17605 | 0.033113 | 0.024542 | 0.029217 | 0.741917 | 0.709973 | 0.639657 | 0.621543 | 0.572848 | 0.556486 | 0 | 0.004565 | 0.340997 | 9,308 | 240 | 152 | 38.783333 | 0.83241 | 0.208208 | 0 | 0.727848 | 0 | 0.012658 | 0.065095 | 0.006778 | 0 | 0 | 0 | 0 | 0 | 1 | 0.018987 | false | 0 | 0.063291 | 0 | 0.094937 | 0.006329 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
995d69939d2d763e9d9c13dfa53c33127ce868ab | 2,887 | py | Python | src/workflow/tests/test_workflows.py | opnfv/laas | 35b9f39178cc502a5283a1b37a65f7dd0838ae05 | [
"Apache-2.0"
] | 2 | 2020-10-31T15:03:20.000Z | 2021-03-22T16:29:15.000Z | src/workflow/tests/test_workflows.py | opnfv/laas | 35b9f39178cc502a5283a1b37a65f7dd0838ae05 | [
"Apache-2.0"
] | 13 | 2019-12-04T23:29:42.000Z | 2022-03-02T04:53:53.000Z | src/workflow/tests/test_workflows.py | opnfv/laas | 35b9f39178cc502a5283a1b37a65f7dd0838ae05 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2018 Parker Berberian, Sawyer Bergeron, and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
from unittest import SkipTest
from django.test import TestCase
from workflow.workflow_factory import WorkflowFactory
"""
To start a workflow:
POST to /wf/workflow {"add": <wf_type_int>
types:
0 - Booking
1 - Resource
2 - Config
To remove a workflow:
POST to /wf/workflow {"cancel": ""}
"""
class WorkflowTestCase(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
raise SkipTest("These tests are no good")
def setUp(self):
self.clear_workflow()
self.create_workflow(self.wf_type)
def create_workflow(self, wf_type):
self.clear_workflow()
# creates workflow on backend
self.client.post("/", {"create": int(wf_type)}) # TODO: verify content type, etc
def clear_workflow(self):
session = self.client.session
for k in session.keys():
del session[k]
session.save()
def render_steps(self):
"""Retrieve each step individually at /wf/workflow/step=<index>."""
for i in range(self.step_count):
# renders the step itself, not in an iframe
exception = None
try:
response = self.client.get("/wf/workflow/", {"step": str(i)})
self.assertLess(response.status_code, 300)
except Exception as e:
exception = e
self.assertIsNone(exception)
class BookingWorkflowTestCase(WorkflowTestCase):
@classmethod
def setUpClass(cls):
super(BookingWorkflowTestCase, cls).setUpClass()
cls.step_count = len(WorkflowFactory.booking_steps)
cls.wf_type = 0
def test_steps_render(self):
super(BookingWorkflowTestCase, self).render_steps()
class ResourceWorkflowTestCase(WorkflowTestCase):
@classmethod
def setUpClass(cls):
super(ResourceWorkflowTestCase, cls).setUpClass()
cls.step_count = len(WorkflowFactory.resource_steps)
cls.wf_type = 1
def test_steps_render(self):
super(ResourceWorkflowTestCase, self).render_steps()
class ConfigWorkflowTestCase(WorkflowTestCase):
@classmethod
def setUpClass(cls):
super(ConfigWorkflowTestCase, cls).setUpClass()
cls.step_count = len(WorkflowFactory.config_steps)
cls.wf_type = 2
def test_steps_render(self):
super(ConfigWorkflowTestCase, self).render_steps()
| 28.87 | 89 | 0.626256 | 312 | 2,887 | 5.692308 | 0.403846 | 0.023649 | 0.054054 | 0.060811 | 0.272523 | 0.227477 | 0.072635 | 0 | 0 | 0 | 0 | 0.00764 | 0.229304 | 2,887 | 99 | 90 | 29.161616 | 0.790562 | 0.161067 | 0 | 0.25 | 0 | 0 | 0.023017 | 0 | 0 | 0 | 0 | 0.010101 | 0.038462 | 1 | 0.211538 | false | 0 | 0.057692 | 0 | 0.346154 | 0 | 0 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
997657151e6c735ccab22a613d02ebc8b14a375d | 548 | py | Python | tests/test_utils.py | Supplyframe/inlinestyler | 3f4ea2642183476d3e26d9733f992422532af893 | [
"BSD-3-Clause"
] | null | null | null | tests/test_utils.py | Supplyframe/inlinestyler | 3f4ea2642183476d3e26d9733f992422532af893 | [
"BSD-3-Clause"
] | 2 | 2021-03-31T19:18:35.000Z | 2021-12-13T20:03:06.000Z | tests/test_utils.py | Supplyframe/inlinestyler | 3f4ea2642183476d3e26d9733f992422532af893 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
from inlinestyler.utils import inline_css
class TestUtils(TestCase):
def setUp(self):
self.the_document = '<html><head><style>.turn_red{ color: red; }</style></head><body><p class="turn_red">This text should be red.</p></body></html>'
def test_inline_css(self):
the_inlined_document = '<html>\n <head/>\n <body>\n <p class="turn_red" style="color: red">This text should be red.</p>\n </body>\n</html>\n'
self.assertEqual(inline_css(self.the_document), the_inlined_document)
| 36.533333 | 156 | 0.680657 | 83 | 548 | 4.337349 | 0.373494 | 0.075 | 0.083333 | 0.072222 | 0.127778 | 0.127778 | 0.127778 | 0 | 0 | 0 | 0 | 0 | 0.155109 | 548 | 14 | 157 | 39.142857 | 0.777538 | 0 | 0 | 0 | 0 | 0.25 | 0.452555 | 0.175182 | 0 | 0 | 0 | 0 | 0.125 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
997ebd1b92696efee94ae16c2be8e1ec43d7d71a | 4,147 | py | Python | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/viewmodels/project_left_nav_bar.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/viewmodels/project_left_nav_bar.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/project/viewmodels/project_left_nav_bar.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | #coding=utf-8
'''
Created on 2015-9-24
@author: Devuser
'''
from doraemon.project.models import Project
class ProjectLeftNavBar(object):
'''
classdocs
'''
def __init__(self,request,projectid):
self.request=request
# self.dashboard_href='/project/'+str(projectid)+'/dashboard'
self.task_href='/project/'+str(projectid)+'/task/'
self.settings_href='/project/'+str(projectid)+'/settings/basic'
self.fortesting_href='/project/'+str(projectid)+'/fortesting'
self.version_href='/project/'+str(projectid)+'/version'
self.archive_href='/project/'+str(projectid)+'/archive/all'
self.issue_href='/project/'+str(projectid)+'/issue/all'
self.statistics_href='/project/'+str(projectid)+'/statistics/all'
self.project=Project.objects.get(projectid)
class menuitem(object):
def __init__(self,namevalue,keyvalue):
self.key=keyvalue
self.name=namevalue
def get_name(self):
return self.name
def get_key(self):
return self.key
def get_id(self):
return "123456"
class ProjectTaskLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.task_href='/project/'+str(projectid)+'/task/'+args['sub_nav_action']
self.task_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectDashboardLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.dashboard_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectSettingsLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.settings_href='/project/'+str(projectid)+'/settings/'+args['sub_nav_action']
self.settings_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectForTestingLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.fortesting_href='/project/'+str(projectid)+'/fortesting/'+args['sub_nav_action']
self.fortesting_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectArchiveLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.archive_href='/project/'+str(projectid)+'/archive/'+args['sub_nav_action']
self.archive_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectIssueLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.issue_href='/project/'+str(projectid)+'/issue/'+args['sub_nav_action']
self.issue_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectStatisticsLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.statistics_href='/project/'+str(projectid)+'/statistics/'+args['sub_nav_action']
self.statistics_active="leftmeunactive"
self.custom_menu_list=list()
class ProjectVersionLeftNavBar(ProjectLeftNavBar):
'''
classdocs
'''
def __init__(self,request,projectid,**args):
ProjectLeftNavBar.__init__(self,request,projectid)
self.request=request
self.version_href='/project/'+str(projectid)+'/version'
self.version_active="leftmeunactive"
self.custom_menu_list=list()
| 31.416667 | 93 | 0.677116 | 417 | 4,147 | 6.431655 | 0.151079 | 0.106637 | 0.095078 | 0.152125 | 0.777405 | 0.732662 | 0.728188 | 0.53654 | 0.381805 | 0.357942 | 0 | 0.004163 | 0.189052 | 4,147 | 132 | 94 | 31.416667 | 0.793339 | 0.050398 | 0 | 0.454545 | 0 | 0 | 0.123584 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.168831 | false | 0 | 0.012987 | 0.038961 | 0.350649 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
99973a7bbffe4bb4c1ff3021b87bc939e4ebaefd | 434 | py | Python | plugins/auth/crypto/algo_pbkdf2.py | UltrosBot/Ultros | 639efc11f73ebf7e8f47f0554aced00a559d9e2d | [
"Artistic-2.0"
] | 16 | 2015-01-02T00:16:11.000Z | 2019-06-03T06:23:11.000Z | plugins/auth/crypto/algo_pbkdf2.py | UltrosBot/Ultros | 639efc11f73ebf7e8f47f0554aced00a559d9e2d | [
"Artistic-2.0"
] | 31 | 2015-01-18T12:14:53.000Z | 2018-01-07T13:32:29.000Z | plugins/auth/crypto/algo_pbkdf2.py | UltrosBot/Ultros | 639efc11f73ebf7e8f47f0554aced00a559d9e2d | [
"Artistic-2.0"
] | 9 | 2015-02-13T09:38:53.000Z | 2020-11-29T19:59:32.000Z | # coding=utf-8
from plugins.auth.crypto.algo_base import BaseAlgorithm
from pbkdf2 import crypt
__author__ = 'Gareth Coles'
class PBKDF2Algo(BaseAlgorithm):
def check(self, hash, value, salt=None):
return hash == self.hash(value, hash)
def hash(self, value, salt=None):
return crypt(
value, salt=salt, iterations=400
)
def gen_salt(self):
return None # It's in the hash
| 20.666667 | 55 | 0.652074 | 58 | 434 | 4.775862 | 0.568966 | 0.097473 | 0.093863 | 0.137184 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018462 | 0.251152 | 434 | 20 | 56 | 21.7 | 0.833846 | 0.06682 | 0 | 0 | 0 | 0 | 0.029851 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.166667 | 0.25 | 0.75 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
99a62a1c3b2e90d6a24f5b5d1e8c742b15d66e2e | 120 | py | Python | Chatbot_KG/chatbot_scrapy/wikidataSpider/wikientities/wikientities/loadjson.py | guci314/Chatbot_CN | 02044eed4a141aa8c61d6064c166f95dbdae894c | [
"Apache-2.0"
] | 1 | 2020-06-21T12:50:34.000Z | 2020-06-21T12:50:34.000Z | Chatbot_KG/chatbot_scrapy/wikidataSpider/wikientities/wikientities/loadjson.py | guci314/Chatbot_CN | 02044eed4a141aa8c61d6064c166f95dbdae894c | [
"Apache-2.0"
] | null | null | null | Chatbot_KG/chatbot_scrapy/wikidataSpider/wikientities/wikientities/loadjson.py | guci314/Chatbot_CN | 02044eed4a141aa8c61d6064c166f95dbdae894c | [
"Apache-2.0"
] | 2 | 2019-11-21T02:51:53.000Z | 2020-04-28T09:09:52.000Z | import json
with open('entities2.json', 'r') as f:
for line in f:
entityjson = json.loads(line)
print(entityjson)
| 17.142857 | 38 | 0.691667 | 19 | 120 | 4.368421 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010101 | 0.175 | 120 | 6 | 39 | 20 | 0.828283 | 0 | 0 | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0.2 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
41e1a762f0d1be508b8aea67bb97266e256a8294 | 1,399 | py | Python | bestiary/management/commands/parse_game_data.py | Itori/swarfarm | 7192e2d8bca093b4254023bbec42b6a2b1887547 | [
"Apache-2.0"
] | 66 | 2017-09-11T04:46:00.000Z | 2021-03-13T00:02:42.000Z | bestiary/management/commands/parse_game_data.py | Itori/swarfarm | 7192e2d8bca093b4254023bbec42b6a2b1887547 | [
"Apache-2.0"
] | 133 | 2017-09-24T21:28:59.000Z | 2021-04-02T10:35:31.000Z | bestiary/management/commands/parse_game_data.py | Itori/swarfarm | 7192e2d8bca093b4254023bbec42b6a2b1887547 | [
"Apache-2.0"
] | 28 | 2017-08-30T19:04:32.000Z | 2020-11-16T04:09:00.000Z | from django.core.management.base import BaseCommand
from bestiary import parse
class Command(BaseCommand):
help = 'Parse all bestiary data from game files'
def handle(self, *args, **kwargs):
self.stdout.write('Processing static files...')
parse.static.decrypt_images()
parse.static.crop_images()
self.stdout.write('Parsing skill data...')
parse.skills()
self.stdout.write('Parsing homunculus skill data...')
parse.homonculus_skills()
self.stdout.write('Parsing monster data...')
parse.monsters()
self.stdout.write('Setting monster awaken/transformation relationships...')
parse.monster_relationships()
self.stdout.write('Parsing monster crafting data...')
parse.monster_crafting()
self.stdout.write('Parsing scenario data...')
parse.scenarios()
self.stdout.write('Parsing rift raid data...')
parse.rift_raids()
self.stdout.write('Parsing elemental rift beast data...')
parse.elemental_rifts()
self.stdout.write('Parsing secret dungeon data...')
parse.secret_dungeons()
self.stdout.write('Parsing dimensional hole data...')
parse.dimensional_hole()
self.stdout.write('Parsing craft materials...')
parse.craft_materials()
self.stdout.write(self.style.SUCCESS('Done!'))
| 29.145833 | 83 | 0.649035 | 153 | 1,399 | 5.869281 | 0.379085 | 0.144766 | 0.217149 | 0.244989 | 0.10245 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.223731 | 1,399 | 47 | 84 | 29.765957 | 0.826888 | 0 | 0 | 0 | 0 | 0 | 0.289492 | 0.015011 | 0 | 0 | 0 | 0 | 0 | 1 | 0.032258 | false | 0 | 0.064516 | 0 | 0.16129 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
41fabf8105aa6882a6a0f47a122cddef117b9740 | 850 | py | Python | src/runner-base/runnertools/runnertools/runner_io.py | ads-ad-itcenter/qunomon.forked | 48d532692d353fe2d3946f62b227f834f9349034 | [
"Apache-2.0"
] | 16 | 2020-11-18T05:43:55.000Z | 2021-11-27T14:43:26.000Z | src/runner-base/runnertools/runnertools/runner_io.py | aistairc/qunomon | d4e9c5cb569b16addfbe6c33c73812065065a1df | [
"Apache-2.0"
] | 1 | 2022-03-23T07:55:54.000Z | 2022-03-23T13:24:11.000Z | src/runner-base/runnertools/runnertools/runner_io.py | ads-ad-itcenter/qunomon.forked | 48d532692d353fe2d3946f62b227f834f9349034 | [
"Apache-2.0"
] | 3 | 2021-02-12T01:56:31.000Z | 2022-03-23T02:45:02.000Z | import os
import sys
import shutil
import glob
from pathlib import Path
import json
import yaml
# init
QAI_USER_HOME = os.environ['QAI_USER_HOME']
inventory_dir = os.path.join(QAI_USER_HOME, 'inventory/')
# check args
args_file = os.path.join(QAI_USER_HOME, 'args', 'args.json')
if os.path.exists(args_file):
print('args_file:{}'.format(str(args_file)))
with open(str(args_file), encoding='utf-8') as f:
args = json.load(f)
def inventory(inventory_name):
match = inventory_dir + inventory_name + '/**/*'
file_paths = [p.replace('\\', '/') for p in glob.glob(match, recursive=True) if os.path.isfile(p)]
return file_paths
def arg(arg_name):
return args[arg_name]
def output(path):
copy_path = os.path.join(os.environ['QAI_USER_HOME'], 'result/') + os.path.basename(path)
shutil.copyfile(path, copy_path)
| 25.757576 | 102 | 0.701176 | 134 | 850 | 4.261194 | 0.38806 | 0.063047 | 0.096322 | 0.056042 | 0.143608 | 0.073555 | 0 | 0 | 0 | 0 | 0 | 0.001383 | 0.149412 | 850 | 32 | 103 | 26.5625 | 0.788382 | 0.017647 | 0 | 0 | 0 | 0 | 0.097473 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.130435 | false | 0 | 0.304348 | 0.043478 | 0.521739 | 0.043478 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
51107035f4e15f54ac07d9fc6430729a7c1928eb | 432 | py | Python | python/high-scores/high_scores_old.py | christine-court/exercism | 0e8fbac1c75ee09003d470352e82b076e2816c44 | [
"MIT"
] | null | null | null | python/high-scores/high_scores_old.py | christine-court/exercism | 0e8fbac1c75ee09003d470352e82b076e2816c44 | [
"MIT"
] | null | null | null | python/high-scores/high_scores_old.py | christine-court/exercism | 0e8fbac1c75ee09003d470352e82b076e2816c44 | [
"MIT"
] | null | null | null | from unittest.main import main
def latest(scores):
return scores[-1]
def personal_best(scores):
return max(scores)
def personal_top_three(scores):
top_three_scores = []
for i in range(3):
top_three_scores.append(max(scores))
scores.remove(max(scores))
if len(scores) == 0:
break
return top_three_scores
if __name__ == "__main__":
personal_top_three([10, 20, 30])
| 17.28 | 44 | 0.645833 | 59 | 432 | 4.40678 | 0.491525 | 0.153846 | 0.215385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027607 | 0.24537 | 432 | 24 | 45 | 18 | 0.769939 | 0 | 0 | 0 | 0 | 0 | 0.018519 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.066667 | 0.133333 | 0.466667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
5123590c3fd365bf56e8d06d0192a1521867fd54 | 2,018 | py | Python | blog/models.py | IreneG5/spss_online | 760abcdd3304a141396ab982ca17cb992afbcecd | [
"CNRI-Python",
"blessing"
] | 14 | 2017-09-28T12:15:42.000Z | 2022-01-27T20:27:01.000Z | blog/models.py | IreneG5/spss_online | 760abcdd3304a141396ab982ca17cb992afbcecd | [
"CNRI-Python",
"blessing"
] | null | null | null | blog/models.py | IreneG5/spss_online | 760abcdd3304a141396ab982ca17cb992afbcecd | [
"CNRI-Python",
"blessing"
] | 9 | 2017-10-25T16:49:02.000Z | 2022-01-22T10:48:18.000Z | # -*- coding: utf-8 -*-
from django.db import models
from django.utils import timezone
from django.conf import settings
class Category(models.Model):
""" Each blog post belongs to a pre-defined category.
Categories are set up on the admin panel """
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
class Post(models.Model):
"""
Each blog post contains its own fields and is liked to a user
(author) and to a category.
Blog posts are created on the admin panel
Score is calculated on the post_voteup and post_votedown views
when the user vote on the post_detail page
Views are incremented on the post_detail view every time the
post_detail template is rendered
"""
author = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='blog')
title = models.CharField(max_length=255)
content = models.TextField()
created_date = models.DateTimeField(auto_now_add=True)
published_date = models.DateTimeField(blank=True, null=True)
category = models.ForeignKey(Category, related_name='blog')
image = models.ImageField(upload_to="blogimage/", blank=True, null=True)
views = models.IntegerField(default=0)
score = models.IntegerField(default=0)
def publish(self):
self.published_date = timezone.now()
self.save()
def __unicode__(self):
return self.title
class Vote(models.Model):
"""
Votes for blog posts are stored in a different model to
avoid a user voting multiple times.
Votes are linked to users and posts, allowing only one
vote per user per post.
The vote value is saved on the post_voteup and post_votedown
views when the user vote on the post_detail page
"""
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='votes')
post = models.ForeignKey(Post, related_name='votes')
vote = models.IntegerField(default=0)
def __unicode__(self):
return '%d-%s' % (self.pk, self.post.title)
| 32.548387 | 77 | 0.708622 | 286 | 2,018 | 4.874126 | 0.388112 | 0.025108 | 0.032281 | 0.043042 | 0.276901 | 0.167862 | 0.167862 | 0.167862 | 0.098996 | 0.098996 | 0 | 0.006246 | 0.20664 | 2,018 | 61 | 78 | 33.081967 | 0.86446 | 0.360258 | 0 | 0.107143 | 0 | 0 | 0.027363 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.107143 | 0.107143 | 0.928571 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
51246251518c088b066874ea4f40b82f548660f5 | 2,045 | py | Python | tests/lib/durak/test_draw_pile.py | maximpertsov/durak-sockets | 53e47980a5456f44df4c2f140d74504ae8ad43a6 | [
"MIT"
] | null | null | null | tests/lib/durak/test_draw_pile.py | maximpertsov/durak-sockets | 53e47980a5456f44df4c2f140d74504ae8ad43a6 | [
"MIT"
] | 1 | 2020-10-23T14:12:47.000Z | 2020-11-03T17:33:11.000Z | tests/lib/durak/test_draw_pile.py | maximpertsov/durak-sockets | 53e47980a5456f44df4c2f140d74504ae8ad43a6 | [
"MIT"
] | null | null | null | import pytest
from lib.durak.draw_pile import DrawPile
@pytest.fixture
def cards():
return ["10D", "10C", "2S", "5C", "8D", "2C"]
@pytest.fixture
def mocked_draw_cards(cards, get_draw_pile_cards):
return get_draw_pile_cards(cards)
@pytest.fixture
def default_parameters():
return {
"drawn_cards": [],
"seed": 0.4,
"lowest_rank": "2",
}
def test_draw_pile_size(default_parameters, mocked_draw_cards):
subject = DrawPile(**default_parameters)
assert subject.serialize() == {
**default_parameters,
"drawn_cards": set(),
"cards_left": 6,
"last_card": "2C",
"trump_suit": "clubs",
}
mocked_draw_cards.assert_called_with(default_parameters["seed"])
def test_drawn_cards(default_parameters, mocked_draw_cards):
args = {**default_parameters, "drawn_cards": ["10D", "10C"]}
subject = DrawPile(**args)
assert subject.serialize() == {
**default_parameters,
"drawn_cards": set(["10D", "10C"]),
"cards_left": 4,
"last_card": "2C",
"trump_suit": "clubs",
}
mocked_draw_cards.assert_called_with(default_parameters["seed"])
def test_lowest_rank_is_six(default_parameters, mocked_draw_cards):
args = {**default_parameters, "lowest_rank": "6"}
subject = DrawPile(**args)
assert subject.serialize() == {
**default_parameters,
"drawn_cards": set(),
"cards_left": 3,
"last_card": "8D",
"lowest_rank": "6",
"trump_suit": "diamonds",
}
mocked_draw_cards.assert_called_with(default_parameters["seed"])
def test_draw_from_pile(default_parameters, mocked_draw_cards):
subject = DrawPile(**default_parameters)
assert subject.draw(count=2) == ["10D", "10C"]
assert subject.serialize() == {
**default_parameters,
"drawn_cards": set(["10D", "10C"]),
"cards_left": 4,
"last_card": "2C",
"trump_suit": "clubs",
}
mocked_draw_cards.assert_called_with(default_parameters["seed"])
| 27.266667 | 68 | 0.634719 | 236 | 2,045 | 5.148305 | 0.211864 | 0.23786 | 0.111111 | 0.111111 | 0.69465 | 0.69465 | 0.69465 | 0.69465 | 0.607407 | 0.607407 | 0 | 0.023632 | 0.213692 | 2,045 | 74 | 69 | 27.635135 | 0.731965 | 0 | 0 | 0.525424 | 0 | 0 | 0.150122 | 0 | 0 | 0 | 0 | 0 | 0.152542 | 1 | 0.118644 | false | 0 | 0.033898 | 0.050847 | 0.20339 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 2 |
5142fe4ce72945b27f6b98b88093c27e12051fda | 9,843 | py | Python | tools/download_secuityhub_event_files.py | xen0l/python-asff | 6b043dd4200084b9999aea2995ea1222309ac42c | [
"BSD-3-Clause"
] | 2 | 2020-12-15T20:49:46.000Z | 2021-10-05T15:59:04.000Z | tools/download_secuityhub_event_files.py | xen0l/python-asff | 6b043dd4200084b9999aea2995ea1222309ac42c | [
"BSD-3-Clause"
] | 68 | 2020-12-13T20:29:58.000Z | 2021-12-20T05:11:08.000Z | tools/download_secuityhub_event_files.py | xen0l/python-asff | 6b043dd4200084b9999aea2995ea1222309ac42c | [
"BSD-3-Clause"
] | 1 | 2022-01-04T23:34:26.000Z | 2022-01-04T23:34:26.000Z | #!/usr/bin/env python
#
# This script is meant to be run when new security hub events are added or we need
# to regenerate sample securityhub event files
#
import json
import os
import boto3
# To get all supported TTPs, it's easiest to fetch it from the AWS console:
# https://eu-west-1.console.aws.amazon.com/securityhub/home?region=eu-west-1#/findings?search=ProductName%3D%255Coperator%255C%253AEQUALS%255C%253ASecurity%2520Hub&groupbyfield=Type
SUPPORTED_TTPS = {
"Security Hub": [
"Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark",
"Software and Configuration Checks/Industry and Regulatory Standards/AWS-Foundational-Security-Best-Practices",
"Effects/Data Exposure/AWS-Foundational-Security-Best-Practices",
],
"Macie": [
"Policy:IAMUser/S3BucketPublic",
"Policy:IAMUser/S3BlockPublicAccessDisabled",
"Policy:IAMUser/S3BucketSharedExternally",
"Policy:IAMUser/S3BucketEncryptionDisabled",
],
"IAM Access Analyzer": [
"Software and Configuration Checks/AWS Security Best Practices/External Access Granted",
"Effects/Data Exposure/External Access Granted",
],
"Inspector": [
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Recognized port reachable from a Peered VPC",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Network exposure from the internet",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Recognized port with no listener reachable from internet",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Network exposure from a Peered VPC",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Recognized port reachable from internet",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Recognized port with listener reachable from a Peered VPC",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Recognized port with listener reachable from internet",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Recognized port with no listener reachable from a Peered VPC",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Unrecognized port with listener reachable from a Peered VPC",
"Software and Configuration Checks/AWS Security Best Practices/Network Reachability - Unrecognized port with listener reachable from internet",
],
"GuardDuty": [
"TTPs/Command and Control/Backdoor:EC2-C&CActivity.B!DNS",
"Software and Configuration Checks/Network Reachability/Recon:EC2-PortProbeUnprotectedPort",
"TTPs/Initial Access/Recon:EC2-PortProbeUnprotectedPort",
"TTPs/Defense Evasion/Stealth:IAMUser-CloudTrailLoggingDisabled",
"Software and Configuration Checks/Policy:S3.BucketBlockPublicAccessDisabled",
"Unusual Behaviors/User/UnauthorizedAccess:IAMUser-ConsoleLogin",
"TTPs/Command and Control/Trojan:EC2-DGADomainRequest.B",
"TTPs/Initial Access/UnauthorizedAccess:EC2-SSHBruteForce",
"TTPs/Initial Access/Trojan:EC2-DriveBySourceTraffic!DNS",
"Unusual Behaviors/User/Recon:IAMUser-UserPermissions",
"TTPs/Command and Control/Trojan:EC2-BlackholeTraffic!DNS",
"TTPs/Discovery/Recon:IAMUser-ResourcePermissions",
"TTPs/Discovery/Recon:IAMUser-UserPermissions",
"Unusual Behaviors/User/Recon:IAMUser-ResourcePermissions",
"Effects/Data Exfiltration/Trojan:EC2-DropPoint!DNS",
"Effects/Resource Consumption/CryptoCurrency:EC2-BitcoinTool.B!DNS",
"TTPs/Command and Control/CryptoCurrency:EC2-BitcoinTool.B!DNS",
"TTPs/Discovery/Recon:IAMUser-NetworkPermissions",
"Unusual Behaviors/User/Recon:IAMUser-NetworkPermissions",
"Effects/Data Exposure/Policy:S3-BucketBlockPublicAccessDisabled",
"TTPs/Initial Access/Recon:EC2-Portscan",
"Unusual Behaviors/VM/Behavior:EC2-NetworkPortUnusual",
"TTPs/Command and Control/Trojan:EC2-DNSDataExfiltration!DNS",
"TTPs/Discovery/Recon:EC2-Portscan",
"TTPs/Command and Control/UnauthorizedAccess:EC2-TorIPCaller",
"TTPs/Discovery/Recon:EC2-PortProbeUnprotectedPort",
"TTPs/Persistence/Persistence:IAMUser-UserPermissions",
"Software and Configuration Checks/Policy:S3.BucketAnonymousAccessGranted",
"TTPs/Persistence/Persistence:IAMUser-NetworkPermissions",
"Unusual Behaviors/User/Persistence:IAMUser-NetworkPermissions",
"Unusual Behaviors/User/Persistence:IAMUser-UserPermissions",
"Effects/Denial of Service/Backdoor:EC2-DenialOfService.UdpOnTcpPorts",
"Effects/Resource Consumption/ResourceConsumption:IAMUser-ComputeResources",
"Software and Configuration Checks/AWS Security Best Practices/Policy:IAMUser-RootCredentialUsage",
"Unusual Behaviors/User/ResourceConsumption:IAMUser-ComputeResources",
"Effects/Data Exfiltration/Trojan:EC2-DropPoint",
"Effects/Data Exfiltration/UnauthorizedAccess:EC2-TorClient",
"Effects/Data Exfiltration/UnauthorizedAccess:IAMUser-InstanceCredentialExfiltration",
"Effects/Denial of Service/Backdoor:EC2-DenialOfService.Dns",
"Effects/Denial of Service/Backdoor:EC2-DenialOfService.Tcp",
"Effects/Denial of Service/Backdoor:EC2-DenialOfService.Udp",
"Effects/Denial of Service/Backdoor:EC2-DenialOfService.UnusualProtocol",
"Effects/Resource Consumption/CryptoCurrency:EC2-BitcoinTool.B",
"Software and Configuration Checks/Network Reachability/Recon:EC2-PortProbeEMRUnprotectedPort",
"Software and Configuration Checks/PrivilegeEscalation:IAMUser.AdministrativePermissions",
"Software and Configuration Checks/Stealth:S3.ServerAccessLoggingDisabled",
"Software and Configuration Checks/UnauthorizedAccess:EC2.MetadataDNSRebind",
"TTPs/Command and Control/Backdoor:EC2-Spambot",
"TTPs/Command and Control/CryptoCurrency:EC2-BitcoinTool.B",
"TTPs/Command and Control/Trojan:EC2-BlackholeTraffic",
"TTPs/Command and Control/Trojan:EC2-DGADomainRequest.C!DNS",
"TTPs/Command and Control/Trojan:EC2-PhishingDomainRequest!DNS",
"TTPs/Command and Control/UnauthorizedAccess:EC2-MaliciousIPCaller.Custom",
"TTPs/Command and Control/UnauthorizedAccess:EC2-TorClient",
"TTPs/Command and Control/UnauthorizedAccess:EC2-TorRelay",
"TTPs/Command and Control/UnauthorizedAccess:IAMUser-TorIPCaller",
"TTPs/Defense Evasion/Stealth:IAMUser-LoggingConfigurationModified",
"TTPs/Defense Evasion/Stealth:IAMUser-PasswordPolicyChange",
"TTPs/Discovery/PenTest:IAMUser-KaliLinux",
"TTPs/Discovery/PenTest:IAMUser-ParrotLinux",
"TTPs/Discovery/PenTest:IAMUser-PenTooLinux",
"TTPs/Initial Access/Recon:EC2-PortProbeEMRUnprotectedPort",
"TTPs/Initial Access/Recon:IAMUser-MaliciousIPCaller",
"TTPs/Initial Access/Recon:IAMUser-MaliciousIPCaller.Custom",
"TTPs/Initial Access/Recon:IAMUser-TorIPCaller",
"TTPs/Initial Access/UnauthorizedAccess:EC2-RDPBruteForce",
"TTPs/Persistence/Persistence:IAMUser-ResourcePermissions",
"TTPs/UnauthorizedAccess:IAMUser-ConsoleLoginSuccess.B",
"TTPs/UnauthorizedAccess:IAMUser-MaliciousIPCaller",
"TTPs/UnauthorizedAccess:IAMUser-MaliciousIPCaller.Custom",
"Unusual Behaviors/User/Persistence:IAMUser-ResourcePermissions",
"Unusual Behaviors/User/Stealth:IAMUser-LoggingConfigurationModified",
"Unusual Behaviors/VM/Backdoor:EC2-Spambot",
"Unusual Behaviors/VM/Behavior:EC2-TrafficVolumeUnusual",
],
"Systems Manager Patch Manager": [
"Software & Configuration Checks/Patch Management/Compliance"
],
}
def download_seurityhub_findings(product_name, type, client=None, max_results=1):
filters = {
"ProductName": [{"Value": product_name, "Comparison": "EQUALS"}],
"Type": [{"Value": type, "Comparison": "EQUALS"}],
}
kwargs = {
"Filters": filters,
"MaxResults": max_results,
}
findings = []
paginator = client.get_paginator("get_findings")
for page in paginator.paginate(**kwargs):
findings.extend(page["Findings"])
if len(findings) > 0:
break
if len(findings) > 0:
return findings[0]
else:
return None
security_hub = boto3.client("securityhub", region_name="eu-west-1")
for product_name in SUPPORTED_TTPS:
for ttp in SUPPORTED_TTPS[product_name]:
print(f"Fetching {ttp} for {product_name}")
normalized_product_name = product_name.replace(" ", "").lower()
normalized_ttp = ttp.replace("/", "-")
file = (
"tests/data/events/{normalized_product_name}/{normalized_ttp}.json".format(
normalized_product_name=normalized_product_name,
normalized_ttp=normalized_ttp,
)
)
finding = download_seurityhub_findings(
product_name=product_name, type=ttp, client=security_hub
)
if finding:
if not os.path.exists(os.path.dirname(file)):
os.makedirs(os.path.dirname(file))
print(f"Writing {file}")
with open(file, "w") as f:
data = json.dumps(finding, sort_keys=True, indent=4)
f.write(data)
else:
print(f"No finding available for {ttp} for {product_name}")
if os.path.exists(file):
os.remove(file)
| 54.683333 | 181 | 0.722239 | 1,013 | 9,843 | 6.982231 | 0.238894 | 0.059098 | 0.071257 | 0.089071 | 0.515906 | 0.397568 | 0.318394 | 0.242896 | 0.162025 | 0.162025 | 0 | 0.009422 | 0.180534 | 9,843 | 179 | 182 | 54.988827 | 0.867468 | 0.040536 | 0 | 0.064103 | 1 | 0.025641 | 0.704642 | 0.391267 | 0 | 0 | 0 | 0 | 0 | 1 | 0.00641 | false | 0.00641 | 0.019231 | 0 | 0.038462 | 0.019231 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
51622d8d280219828a67dff8026ea26e97683b57 | 4,578 | py | Python | tests/test_properties.py | Kapiche/gcloud-python-orm | c2f452f18c9bd549a77b5f3312c1329b1bb6413c | [
"Apache-2.0"
] | 1 | 2017-07-11T14:00:24.000Z | 2017-07-11T14:00:24.000Z | tests/test_properties.py | Kapiche/gcloud-python-orm | c2f452f18c9bd549a77b5f3312c1329b1bb6413c | [
"Apache-2.0"
] | null | null | null | tests/test_properties.py | Kapiche/gcloud-python-orm | c2f452f18c9bd549a77b5f3312c1329b1bb6413c | [
"Apache-2.0"
] | 1 | 2019-02-01T08:56:41.000Z | 2019-02-01T08:56:41.000Z | import six
import unittest2
from gcloud.datastore import helpers, key, set_default_dataset_id
from gcloudorm import model, properties
class TestProperties(unittest2.TestCase):
_DATASET_ID = 'DATASET'
def setUp(self):
set_default_dataset_id(self._DATASET_ID)
def testBooleanProperty(self):
class TestModel(model.Model):
test_bool = properties.BooleanProperty()
m = TestModel()
self.assertEqual(m.test_bool, None)
self.assertEqual(m['test_bool'], None)
m = TestModel(test_bool=False)
self.assertEqual(m.test_bool, False)
self.assertEqual(m['test_bool'], False)
m.test_bool = True
self.assertEqual(m.test_bool, True)
self.assertEqual(m['test_bool'], True)
class TestModel(model.Model):
test_bool = properties.BooleanProperty(default=True)
m = TestModel()
self.assertEqual(m.test_bool, True)
self.assertEqual(m['test_bool'], True)
def testIdProperty(self):
class TestModel(model.Model):
test_id = properties.IdProperty()
m = TestModel()
self.assertIsInstance(m.test_id, six.string_types)
self.assertIs(m.test_id, m.key.id_or_name)
def testIntegerProperty(self):
class TestModel(model.Model):
test_int = properties.IntegerProperty()
m = TestModel()
self.assertEqual(m.test_int, None)
self.assertEqual(m['test_int'], None)
class TestModel(model.Model):
test_int = properties.IntegerProperty(default=3)
m = TestModel()
self.assertEqual(m['test_int'], 3)
m.test_int = 4
self.assertEqual(m.test_int, 4)
self.assertEqual(m['test_int'], 4)
def testFloatproperty(self):
class TestModel(model.Model):
test_float = properties.FloatProperty()
m = TestModel()
self.assertEqual(m.test_float, None)
self.assertEqual(m['test_float'], None)
class TestModel(model.Model):
test_float = properties.FloatProperty(default=0.1)
m = TestModel()
self.assertEqual(m['test_float'], 0.1)
m.test_float = 0.2
self.assertEqual(m['test_float'], 0.2)
def testTextProperty(self):
class TestModel(model.Model):
test_text = properties.TextProperty()
m = TestModel()
self.assertEqual(m.test_text, None)
class TestModel(model.Model):
test_text = properties.TextProperty(default="")
m = TestModel()
self.assertEqual(m['test_text'], "")
class TestModel(model.Model):
test_text = properties.TextProperty(default=lambda: "")
m = TestModel()
self.assertEqual(m['test_text'], "")
def testPickleProperty(self):
class TestModel(model.Model):
test_pickle = properties.PickleProperty()
m = TestModel()
self.assertEqual(m.test_pickle, None)
m = TestModel(test_pickle={"123": "456"})
self.assertEqual(m.test_pickle, {"123": "456"})
m.test_pickle = {'456': '789'}
self.assertEqual(m.test_pickle, {'456': '789'})
def testJsonProperty(self):
class TestModel(model.Model):
test_pickle = properties.JsonProperty()
m = TestModel()
self.assertEqual(m.test_pickle, None)
m = TestModel(test_pickle={"123": "456"})
self.assertEqual(m.test_pickle, {"123": "456"})
m.test_pickle = {'456': '789'}
self.assertEqual(m.test_pickle, {'456': '789'})
def testDataTimeProperty(self):
import datetime
class TestModel(model.Model):
test_datetime = properties.DateTimeProperty()
m = TestModel()
self.assertEqual(m.test_datetime, None)
utcnow = datetime.datetime.utcnow()
m.test_datetime = utcnow
self.assertEqual(m.test_datetime, utcnow)
def testDateProperty(self):
import datetime
class TestModel(model.Model):
test_date = properties.DateProperty()
m = TestModel()
self.assertEqual(m.test_date, None)
today = datetime.date.today()
m.test_date = today
self.assertEqual(m.test_date, today)
def testTimeProperty(self):
import datetime
class TestModel(model.Model):
test_time = properties.TimeProperty()
m = TestModel()
self.assertEqual(m.test_time, None)
t = datetime.time()
m.test_time = t
self.assertEqual(m.test_time, t)
| 28.08589 | 67 | 0.616208 | 509 | 4,578 | 5.398821 | 0.145383 | 0.076419 | 0.186317 | 0.232897 | 0.710699 | 0.672489 | 0.576055 | 0.473435 | 0.245633 | 0.1754 | 0 | 0.018761 | 0.266492 | 4,578 | 162 | 68 | 28.259259 | 0.799583 | 0 | 0 | 0.429825 | 0 | 0 | 0.035605 | 0 | 0 | 0 | 0 | 0 | 0.298246 | 1 | 0.096491 | false | 0 | 0.061404 | 0 | 0.307018 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5166eb8771a6e99003d7a3deae5a69bf5c9516a0 | 1,061 | py | Python | app/services/user.py | StakeBeat/api-server | c23c235a1813c422d0369cb71a448f15340651cc | [
"MIT"
] | null | null | null | app/services/user.py | StakeBeat/api-server | c23c235a1813c422d0369cb71a448f15340651cc | [
"MIT"
] | null | null | null | app/services/user.py | StakeBeat/api-server | c23c235a1813c422d0369cb71a448f15340651cc | [
"MIT"
] | null | null | null | from typing import Dict, List
import bcrypt
from app.session import SessionManager
from app.models.user import User
from app.models.validator import Validator
class UserService:
def __init__(self) -> None:
pass
def create(self, payload: Dict[str, str]) -> User:
hashed_pw = bcrypt.hashpw(payload['password'].encode(), bcrypt.gensalt())
user = User(username=payload['username'], password=hashed_pw.decode())
with SessionManager.session() as session:
session.add(user)
return user
def get_all_validators(self, user_id: int) -> List[Validator]:
with SessionManager.session() as session:
validators = session.query(Validator).filter_by(user_id=user_id)
return validators
def update(self, user_id: int, payload: Dict[str, str]) -> None:
with SessionManager.session() as session:
user = session.query(User).get(user_id)
user.expo_token = payload['expoToken']
user.notification_enabled = payload['notificationEnabled']
| 32.151515 | 81 | 0.67295 | 127 | 1,061 | 5.496063 | 0.385827 | 0.04298 | 0.10745 | 0.116046 | 0.146132 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.220547 | 1,061 | 32 | 82 | 33.15625 | 0.844015 | 0 | 0 | 0.130435 | 0 | 0 | 0.04147 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.173913 | false | 0.130435 | 0.217391 | 0 | 0.521739 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
5a99982380d5effeca0f6dd6c5b36321143294e3 | 243 | py | Python | lists/fruits.py | renataeva/python-basics | 0d8a2c6eda3aa31cca61fb2c727956f82642ebc8 | [
"Apache-2.0"
] | 1 | 2021-02-14T10:43:43.000Z | 2021-02-14T10:43:43.000Z | lists/fruits.py | renataeva/python-basics | 0d8a2c6eda3aa31cca61fb2c727956f82642ebc8 | [
"Apache-2.0"
] | null | null | null | lists/fruits.py | renataeva/python-basics | 0d8a2c6eda3aa31cca61fb2c727956f82642ebc8 | [
"Apache-2.0"
] | null | null | null | fruits = ['pineapple', 'lemon', 'pear', 'watermelon', 'tomato', 'apple']
first, second, *middle, firstlast, last = fruits
print(f'''Первый элемент: {first}
Второй: {second}
Посередине: {middle}
Предпоследний: {firstlast}
Последний: {last}''')
| 30.375 | 72 | 0.691358 | 26 | 243 | 6.461538 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106996 | 243 | 7 | 73 | 34.714286 | 0.774194 | 0 | 0 | 0 | 0 | 0 | 0.596708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5a9eed27c33e629bc1e08035dd959f61cb18df2d | 527 | py | Python | py_projects_boilerplates/sphinx_loguru_pytest_boiler/app/modules/hello_world/tools/tools.py | rypaik/PYTHON | 283ffb90321153c66036ab0282b44918d422f645 | [
"MIT"
] | null | null | null | py_projects_boilerplates/sphinx_loguru_pytest_boiler/app/modules/hello_world/tools/tools.py | rypaik/PYTHON | 283ffb90321153c66036ab0282b44918d422f645 | [
"MIT"
] | null | null | null | py_projects_boilerplates/sphinx_loguru_pytest_boiler/app/modules/hello_world/tools/tools.py | rypaik/PYTHON | 283ffb90321153c66036ab0282b44918d422f645 | [
"MIT"
] | null | null | null | #from config import console, log
from config import console
from loguru import logger
import sys
#TODO: factory function to create logger
# setting up Logger
logger.add(sys.stderr, format="{time} {level} {message}", level="INFO")
logger.add("./common/loguru_log/Tools_{time}.log", rotation="500 MB")
# @logger.catch
# @logger.catch
def say_hello(message):
# print(message)
console.print(message, style="bold blue")
return message
logger.bind(special=True).info("This message, though, is logged to the file!") | 31 | 82 | 0.73055 | 76 | 527 | 5.026316 | 0.592105 | 0.052356 | 0.08377 | 0.120419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006593 | 0.136622 | 527 | 17 | 82 | 31 | 0.832967 | 0.250474 | 0 | 0 | 0 | 0 | 0.315385 | 0.092308 | 0 | 0 | 0 | 0.058824 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.555556 | 0.111111 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
5aad16869e98dc66ff1b17b701a95290d46df4a6 | 1,930 | py | Python | demo/caya/dataobj.py | sugarflower/caya | 40acc237a1e367c757356e8754d11928b01b3f82 | [
"MIT"
] | null | null | null | demo/caya/dataobj.py | sugarflower/caya | 40acc237a1e367c757356e8754d11928b01b3f82 | [
"MIT"
] | 1 | 2021-11-15T11:38:15.000Z | 2021-11-15T16:16:01.000Z | demo/caya/dataobj.py | sugarflower/caya | 40acc237a1e367c757356e8754d11928b01b3f82 | [
"MIT"
] | null | null | null | import json
import os
import zipfile
class DataObj:
def __init__(self, workspace="dataobj", name="default"):
self.workspace = workspace
self.name = name
self.home = self.homepath()
self.iter_pos = 0
self.read()
def keys(self):
return list(self.data.keys())
def new(self):
self.data = {}
def homepath(self):
return os.path.expanduser("~").replace(os.sep, "/")
def workpath(self):
return f"{self.home}/{self.workspace}"
def filepath(self):
return "%s/%s" % (self.workpath(), self.name)
def read(self):
if os.path.exists(self.filepath()):
try:
with zipfile.ZipFile(self.filepath(), "r") as fr:
self.data = json.loads(fr.read(self.name))
except:
self.new()
else:
self.new()
def save(self):
os.makedirs(self.workpath(), exist_ok=True)
with zipfile.ZipFile(self.filepath(), "w") as fw:
fw.writestr(self.name, json.dumps(self.data))
def __enter__(self):
return self
def __exit__(self, exctype, excvalue, traceback):
self.save()
def __setitem__(self, key, value):
self.data[key] = value
def __getitem__(self, key):
return self.data.get(key)
def __delitem__(self, key):
if key in self.data.keys():
del(self.data[key])
def __del__(self):
self.save()
def __iter__(self):
return self
def __next__(self):
keys = self.keys()
if self.iter_pos == len(keys):
self.iter_pos = 0
raise StopIteration()
buf = self.data[keys[self.iter_pos]]
self.iter_pos += 1
return buf
if __name__ == "__main__":
d = DataObj("test","wow")
d["hello"] = "hello world"
del d
d = DataObj("test","wow")
print(d["hello"])
| 23.536585 | 65 | 0.546632 | 237 | 1,930 | 4.240506 | 0.320675 | 0.071642 | 0.054726 | 0.023881 | 0.059701 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002264 | 0.313472 | 1,930 | 81 | 66 | 23.82716 | 0.756226 | 0 | 0 | 0.16129 | 0 | 0 | 0.04873 | 0.014515 | 0 | 0 | 0 | 0 | 0 | 1 | 0.258065 | false | 0 | 0.048387 | 0.112903 | 0.451613 | 0.016129 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
5ac1a515b4945a1114f763c54484e24f450a8d2d | 2,166 | py | Python | light_control/colors.py | XenonMolecule/led-lightstrip | 3e2fe0f1e45646dacf03000a0634cfa29db20e33 | [
"MIT"
] | null | null | null | light_control/colors.py | XenonMolecule/led-lightstrip | 3e2fe0f1e45646dacf03000a0634cfa29db20e33 | [
"MIT"
] | 6 | 2021-03-10T19:20:03.000Z | 2022-02-27T05:15:39.000Z | light_control/colors.py | XenonMolecule/led-lightstrip | 3e2fe0f1e45646dacf03000a0634cfa29db20e33 | [
"MIT"
] | null | null | null | # Converts RGB to GRB which is needed by the lightstrip
def Color(red, green, blue, white = 0):
"""Convert the provided red, green, blue color to a 24-bit color value.
Each color component should be a value 0-255 where 0 is the lowest intensity
and 255 is the highest intensity.
"""
return (white << 24) | (green << 16)| (red << 8) | blue
def getRGB(color):
r = 0b11111111 & (color >> 8)
g = 0b11111111 & (color >> 16)
b = 0b11111111 & color
return r, g, b
def calcGradient(color1, color2, progress = 0.5):
r1, g1, b1 = getRGB(color1)
r2, g2, b2 = getRGB(color2)
dr = (r2 - r1)
dg = (g2 - g1)
db = (b2 - b1)
return Color(r1 + int(round(dr * progress)), g1 + int(round(dg * progress)), b1 + int(round(db * progress)))
def red(n):
return Color(255, 0, 0)
def green(n):
return Color(0, 255, 0)
def blue(n):
return Color(0, 0, 255)
def clear(n):
return Color(0, 0, 0)
def color(r, g, b):
def colorFunc(n):
return Color(r, g, b)
return colorFunc
def gradient(r1, g1, b1, r2, g2, b2):
dr = (r2 - r1) / 128.0
dg = (g2 - g1) / 128.0
db = (b2 - b1) / 128.0
def gradientFunc(n):
n += 128
n = n & 255
n = abs(128 - n)
return Color(r1 + int(round(dr * n)), g1 + int(round(dg * n)), b1 + int(round(db * n)))
return gradientFunc
def gradient_cycle(r1, g1, b1, r2, g2, b2, length):
default_gradient = gradient(r1, g1, b1, r2, g2, b2)
def gradCycleFunc(n):
return default_gradient(n * 256 // length)
return gradCycleFunc
def rainbow(n):
n = n & 255
n = 255 - n
if n < 85:
return Color(255 - n * 3, 0, n * 3)
elif n < 170:
n -= 85
return Color(0, n * 3, 255 - n * 3)
else:
n -= 170
return Color(n * 3, 255 - n * 3, 0)
def rainbow_cycle(length):
def rainbowCycleFunc(n):
return rainbow(n * 256 // length)
return rainbowCycleFunc
def online_background(connection):
def onlineSetColor(n):
color = connection.getBackgroundColor()
return Color(color['red'], color['green'], color['blue'])
return onlineSetColor
def online_foreground(connection):
def onlineSetColor(n):
color = connection.getForegroundColor()
return Color(color['red'], color['green'], color['blue'])
return onlineSetColor | 25.186047 | 109 | 0.638966 | 349 | 2,166 | 3.948424 | 0.240688 | 0.095791 | 0.05225 | 0.028302 | 0.248186 | 0.217707 | 0.113208 | 0.08418 | 0.08418 | 0.08418 | 0 | 0.100992 | 0.209141 | 2,166 | 86 | 110 | 25.186047 | 0.703444 | 0.108033 | 0 | 0.121212 | 0 | 0 | 0.012481 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.30303 | false | 0 | 0 | 0.106061 | 0.636364 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
5ac1fd4ad75709753b765bad70ec5641a7265458 | 402 | py | Python | tests/test_grid/test_continent_cells.py | wpreimes/io_utils | 9ef4161a5bc65ab2fabee0e2c7cf873f19cf7a17 | [
"MIT"
] | null | null | null | tests/test_grid/test_continent_cells.py | wpreimes/io_utils | 9ef4161a5bc65ab2fabee0e2c7cf873f19cf7a17 | [
"MIT"
] | 4 | 2021-07-09T09:03:12.000Z | 2021-12-20T17:24:32.000Z | tests/test_grid/test_continent_cells.py | wpreimes/io_utils | 9ef4161a5bc65ab2fabee0e2c7cf873f19cf7a17 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from io_utils.grid.grid_functions import read_cells_for_continent
def test_read_cells_for_continent():
try:
read_cells_for_continent('notexistingname')
except ValueError:
assert True
else:
assert False
cells = read_cells_for_continent('Oceania')
assert 2244 in cells
if __name__ == '__main__':
test_read_cells_for_continent()
| 22.333333 | 65 | 0.708955 | 51 | 402 | 5.058824 | 0.568627 | 0.174419 | 0.232558 | 0.406977 | 0.193798 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015723 | 0.208955 | 402 | 17 | 66 | 23.647059 | 0.795597 | 0.052239 | 0 | 0 | 0 | 0 | 0.079365 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.083333 | false | 0 | 0.083333 | 0 | 0.166667 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5ae65f8d4acee2e0b7d88fb146f0907a54517320 | 1,088 | py | Python | filebarn/views.py | popas90/filebarn | 031f4baef20b3eb004483597777990fefe03aef8 | [
"MIT"
] | null | null | null | filebarn/views.py | popas90/filebarn | 031f4baef20b3eb004483597777990fefe03aef8 | [
"MIT"
] | null | null | null | filebarn/views.py | popas90/filebarn | 031f4baef20b3eb004483597777990fefe03aef8 | [
"MIT"
] | null | null | null | from flask import render_template, flash, redirect
from flask import session, url_for, request, g
from flask.ext.login import login_user, logout_user
from flask.ext.login import current_user, login_required
from filebarn import app, db, lm
from .forms import LoginForm
from .models import User
@app.route('/secret/<username>')
@login_required
def secret(username):
return render_template('index.html', username=username)
@app.route('/', methods=['GET', 'POST'])
@app.route('/login', methods=['GET', 'POST'])
def login():
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(username=form.username.data).first()
if user is not None and user.verify_password(form.password.data):
login_user(user, form.remember_me.data)
return redirect(request.args.get('next') or
url_for('secret', username=form.username.data))
flash('Invalid username or password.')
return render_template('login.html', form=form)
@lm.user_loader
def load_user(id):
return User.query.get(int(id))
| 32.969697 | 75 | 0.699449 | 151 | 1,088 | 4.92053 | 0.403974 | 0.048452 | 0.040377 | 0.04576 | 0.061911 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172794 | 1,088 | 32 | 76 | 34 | 0.825556 | 0 | 0 | 0 | 0 | 0 | 0.090074 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.115385 | false | 0.076923 | 0.269231 | 0.076923 | 0.538462 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
5ae86cfdf4fb6e5066a584407a52efdaac38c700 | 7,824 | py | Python | main_ssid.py | thomasjanssenR8/Localization | 0c4976c5e16a4d1870fa529591701010fa22d49c | [
"Apache-2.0"
] | null | null | null | main_ssid.py | thomasjanssenR8/Localization | 0c4976c5e16a4d1870fa529591701010fa22d49c | [
"Apache-2.0"
] | null | null | null | main_ssid.py | thomasjanssenR8/Localization | 0c4976c5e16a4d1870fa529591701010fa22d49c | [
"Apache-2.0"
] | null | null | null | """
6-Bachelor thesis: Wi-Fi localization - Thomas Janssen
Localization v1: Use SSID of a network to find coordinates via www.wigle.net and calculate the error.
"""
import requests
import matplotlib.pyplot as plt
import haversine
class Localization:
userID = ""
password = ""
url = ""
ssid = ""
resultsPerPage = 10 # default=10 (daily limited amount of requests!)
def __init__(self, userID, password):
self.userID = userID
self.password = password
def setuserID(self, newUserID):
userID = newUserID
print("User ID set to " + userID)
def setPassword(self, newPassword):
password = newPassword
print("Password set to " + password)
def setSSID(self, newSSID):
ssid = newSSID
return ssid
def setResultsPerPage(self, newResultsPerPage):
self.resultsPerPage = newResultsPerPage
return self.resultsPerPage
def createURL(self, ssid, resultsPerPage):
url = "https://api.wigle.net/api/v2/network/search?freenet=false&paynet=false&ssid=%s&resultsPerPage=%s" \
% (ssid, resultsPerPage)
return url
def request(self, url):
r = requests.get(url, auth=('AID6e6e0f71da38f4b56d8c5990b0a540f1', # Authentication:
'848f760ac689e986a7f14120c014124d')) # API name + API token from Wigle.net account ThomasJanssen
print(r.text) # print string
return r
def decodeObject(self, r):
data = r.json()
resultCount = data['resultCount']
print("ResultCount = " + str(resultCount))
results = data['results']
count = 0
positions = []
for result in range(0, len(results)):
trilat = results[count]['trilat']
trilong = results[count]['trilong']
print("N " + str(trilat) + ", E " + str(trilong))
position = [trilat, trilong]
positions.append(position)
count += 1
return positions
def calcMean(self, mean_coordinates):
sum_latitudes = 0
sum_longitudes = 0
for coordinate in mean_coordinates:
sum_latitudes += coordinate[0]
sum_longitudes += coordinate[1]
mean_latitude = sum_latitudes / len(mean_coordinates) # evt. afronden: round(floatgetal, 8)
mean_longitude = sum_longitudes / len(mean_coordinates)
print("Mean coordinate: N" + str(mean_latitude) + " E" + str(mean_longitude))
calcedMean = [mean_latitude, mean_longitude]
return calcedMean
def calcError(self, mean):
measuredLatitude = float(input("Give the latitude of the coordinate you measured: "))
measuredLongitude = float(input("Give the longitude of the coordinate you measured: "))
# latitudeError = abs(measuredLatitude - mean[0])
# longitudeError = abs(measuredLongitude - mean[1])
# print("The coordinate error is " + str(latitudeError) + ", " + str(longitudeError))
measurementCoordinate = (measuredLatitude, measuredLongitude)
meanCoordinate = (mean[0], mean[1])
distance = haversine.haversine(measurementCoordinate, meanCoordinate)
print("The distance between the coordinates is " + str(distance) + " km") # print difference in kilometers
def plotCoordinates(self, scatter_coordinates):
for coordinate in scatter_coordinates:
scatter_latitude = coordinate[0]
scatter_longitude = coordinate[1]
plt.scatter(scatter_latitude, scatter_longitude)
plt.suptitle('Scatter plot of ' + str(l.resultsPerPage) + ' coordinates with SSID = ' + str(l.ssid))
plt.show()
# Authenticate, perform HTTP-request to Wigle-server, find coordinates in JSON-string, plot them and calculate mean
# -----------------------------------------------------------------------------------------------------------------
l = Localization("user", "pw") # Create Localization object
l.resultsPerPage = input("Give amount of results per page: ") # with SSID and resultsPerPage
l.ssid = input("Give the SSID you are looking for: ")
url = l.createURL(l.ssid, l.resultsPerPage) # Create URL for the request
print("Created URL: " + url)
request = l.request(url) # perform the request
coordinates = l.decodeObject(request) # response unmarshalling (this function also prints the data to the output)
mean = l.calcMean(coordinates) # calculate the mean position of the coordinates
l.calcError(mean) # calculate error between measured and real coordinate
l.plotCoordinates(coordinates) # plot coordinates in scatter plot
# Use this in case daily limit of requests is reached:
# -----------------------------------------------------------------------------------------------------------------
# param1 = data["success"] # Use this in case daily limit of requests is reached
# param2 = data["error"]
# print(param1)
# print(param2)
# positions = [param1, param2]
# data = '{"resultCount":5,"last":5,"success":true,"results":[{"trilat":51.22378540,"trilong":4.40892172,"ssid":"UAntwerpen","qos":7,"transid":"20120419-00187","firsttime":"2012-04-19T23:05:18.000Z","lasttime":"2015-02-22T11:26:18.000Z","lastupdt":"2015-02-22T09:28:02.000Z","netid":"00:0B:86:26:79:C5","name":null,"type":"infra","comment":null,"wep":"2","channel":6,"bcninterval":0,"freenet":"?","dhcp":"?","paynet":"?","userfound":false},{"trilat":51.22327042,"trilong":4.40893793,"ssid":"UAntwerpen","qos":4,"transid":"20120419-00187","firsttime":"2012-04-19T23:05:32.000Z","lasttime":"2014-03-09T07:15:11.000Z","lastupdt":"2014-03-09T05:15:16.000Z","netid":"00:0B:86:26:7A:75","name":null,"type":"infra","comment":null,"wep":"2","channel":6,"bcninterval":0,"freenet":"?","dhcp":"?","paynet":"?","userfound":false},{"trilat":51.22335815,"trilong":4.40887070,"ssid":"UAntwerpen","qos":7,"transid":"20120419-00187","firsttime":"2012-04-19T23:05:20.000Z","lasttime":"2016-04-24T13:59:46.000Z","lastupdt":"2016-04-24T14:00:33.000Z","netid":"00:0B:86:26:7E:75","name":null,"type":"infra","comment":null,"wep":"2","channel":11,"bcninterval":0,"freenet":"?","dhcp":"?","paynet":"?","userfound":false},{"trilat":51.22303772,"trilong":4.40889168,"ssid":"UAntwerpen","qos":0,"transid":"20140304-00114","firsttime":"2014-03-04T21:48:51.000Z","lasttime":"2014-03-05T19:18:58.000Z","lastupdt":"2014-03-05T17:19:23.000Z","netid":"00:0B:86:26:7E:D5","name":null,"type":"infra","comment":null,"wep":"2","channel":1,"bcninterval":0,"freenet":"?","dhcp":"?","paynet":"?","userfound":false},{"trilat":51.17709351,"trilong":4.41607475,"ssid":"UAntwerpen","qos":1,"transid":"20110605-00081","firsttime":"2011-05-31T17:11:13.000Z","lasttime":"2013-10-28T11:32:52.000Z","lastupdt":"2013-10-28T09:33:29.000Z","netid":"00:0b:86:26:86:16","name":null,"type":"infra","comment":null,"wep":"2","channel":6,"bcninterval":0,"freenet":"?","dhcp":"?","paynet":"?","userfound":false}],"first":1}'
# latitude_index = data.find("trilat") + 8
# latitude = data[latitude_index: (latitude_index+11)]
# print("N"+latitude)
#
# longitude_index = data.find("trilong") + 9
# longitude = data[longitude_index: (longitude_index+10)]
# print("E"+longitude)
# s.addCoordinate(51.22378540, 4.40892172) # Coordinates from wigle request with ssid=Uantwerpen (stadscampus)
# s.addCoordinate(51.22327042, 4.40893793)
# s.addCoordinate(51.22335815, 4.40887070)
# s.addCoordinate(51.22303772, 4.40889168)
# s.addCoordinate(51.17709351, 4.41607475) # Campus Groenenborger
# s.plotScatter()
# Show BSSID's in Windows cmd: netsh wlan show networks mode=bssid
| 50.805195 | 1,965 | 0.629729 | 914 | 7,824 | 5.35558 | 0.299781 | 0.01716 | 0.017365 | 0.013279 | 0.170787 | 0.160163 | 0.149745 | 0.141982 | 0.133401 | 0.104597 | 0 | 0.103849 | 0.186478 | 7,824 | 153 | 1,966 | 51.137255 | 0.6652 | 0.508563 | 0 | 0 | 0 | 0.012048 | 0.142517 | 0.017715 | 0 | 0 | 0 | 0 | 0 | 1 | 0.13253 | false | 0.072289 | 0.036145 | 0 | 0.313253 | 0.096386 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
5aed6d615fa91fad4e07d37eee2af76cc5e8ed65 | 463 | py | Python | hackathon/column1/test_12_5.py | abdurahmanadilovic/elements-of-programming-interviews | 14d05935aa901f453ea2086e449b670e993a4c83 | [
"MIT"
] | null | null | null | hackathon/column1/test_12_5.py | abdurahmanadilovic/elements-of-programming-interviews | 14d05935aa901f453ea2086e449b670e993a4c83 | [
"MIT"
] | null | null | null | hackathon/column1/test_12_5.py | abdurahmanadilovic/elements-of-programming-interviews | 14d05935aa901f453ea2086e449b670e993a4c83 | [
"MIT"
] | null | null | null | from unittest import TestCase
from .problem_12_5_closes_squared_number import solution
class TestSolution(TestCase):
def testGivenCases(self):
self.assertEqual(4, solution(16))
def testGivenCases2(self):
self.assertEqual(17, solution(300))
def testZero(self):
self.assertEqual(0, solution(0))
def testOne(self):
self.assertEqual(1, solution(1))
def testTwo(self):
self.assertEqual(1, solution(2))
| 23.15 | 56 | 0.686825 | 56 | 463 | 5.589286 | 0.5 | 0.127796 | 0.303514 | 0.127796 | 0.178914 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049046 | 0.207343 | 463 | 19 | 57 | 24.368421 | 0.803815 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.384615 | 1 | 0.384615 | false | 0 | 0.153846 | 0 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
8526ea9531ae4232ab59f4752d913053e7551235 | 828 | py | Python | src/command_manager.py | thomaspenin/orchid-font-tool | c064a5ddd582393e462fd7411eae250944a6f7e5 | [
"MIT"
] | null | null | null | src/command_manager.py | thomaspenin/orchid-font-tool | c064a5ddd582393e462fd7411eae250944a6f7e5 | [
"MIT"
] | null | null | null | src/command_manager.py | thomaspenin/orchid-font-tool | c064a5ddd582393e462fd7411eae250944a6f7e5 | [
"MIT"
] | null | null | null |
from src.commands.help import HelpCommand
from src.commands.version import VersionCommand
class CommandManager(object):
"""docstring for CommandManager."""
def __init__(self):
super(CommandManager, self).__init__()
self.command_list = self._build_command_list()
def _build_command_list(self):
"""Build the list of available commands
Returns:
A dictionnary, which key is the string naming the command and the value
the command itself
"""
return {
"help": HelpCommand(self),
"version": VersionCommand()
}
def get_command_list(self):
return self.command_list
def get_command(self, name):
try:
return self.command_list[name]
except KeyError:
return None
| 26.709677 | 83 | 0.625604 | 90 | 828 | 5.533333 | 0.455556 | 0.13253 | 0.090361 | 0.080321 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.295894 | 828 | 30 | 84 | 27.6 | 0.854202 | 0.211353 | 0 | 0 | 0 | 0 | 0.018092 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0.055556 | 0.611111 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
516d50479cd839e1f2fb6ba1f23bf879b0b72ee4 | 178 | py | Python | lcopt/bin/lcopt_bw2_setup.py | pjamesjoyce/lcopt_geo | a167ecfa258e62e91af7dac6cbf70be5d63fff93 | [
"BSD-3-Clause"
] | 17 | 2017-08-04T11:38:13.000Z | 2022-03-29T16:22:39.000Z | lcopt/bin/lcopt_bw2_setup.py | pjamesjoyce/lcopt_geo | a167ecfa258e62e91af7dac6cbf70be5d63fff93 | [
"BSD-3-Clause"
] | 65 | 2017-04-27T16:01:04.000Z | 2022-01-19T07:36:15.000Z | lcopt/bin/lcopt_bw2_setup.py | pjamesjoyce/lcopt_geo | a167ecfa258e62e91af7dac6cbf70be5d63fff93 | [
"BSD-3-Clause"
] | 6 | 2017-06-19T09:37:21.000Z | 2022-02-22T18:44:01.000Z | from sys import argv
from lcopt.utils import lcopt_bw2_setup
def main():
ecospold_path = argv[1]
lcopt_bw2_setup(ecospold_path)
if __name__ == "__main__":
main()
| 14.833333 | 39 | 0.713483 | 26 | 178 | 4.346154 | 0.576923 | 0.141593 | 0.230089 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020979 | 0.196629 | 178 | 11 | 40 | 16.181818 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0.044944 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5174351e99ecce6cc76d978668a7a39b17c6cccd | 7,043 | py | Python | road-and-rail-stats/calculate_rail_emissions_and_energy.py | Rebeccacachia/projects | 4f8bebce1c0b4ba2d032aba658b38c3de9effb32 | [
"MIT"
] | null | null | null | road-and-rail-stats/calculate_rail_emissions_and_energy.py | Rebeccacachia/projects | 4f8bebce1c0b4ba2d032aba658b38c3de9effb32 | [
"MIT"
] | null | null | null | road-and-rail-stats/calculate_rail_emissions_and_energy.py | Rebeccacachia/projects | 4f8bebce1c0b4ba2d032aba658b38c3de9effb32 | [
"MIT"
] | null | null | null | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# +
from pathlib import Path
import geopandas as gpd
import pandas as pd
from shapely.geometry import box
# +
data_dir = Path("data")
FILEPATHS = {
"rail_links": data_dir / "external" / "Dublin_Rail_Links" / "Dublin_Rail_Links.shp",
"small_area_boundaries": data_dir
/ "external"
/ "dublin_small_area_boundaries_in_routing_keys.gpkg",
"rail_schedules": data_dir
/ "external"
/ "Transport Emissions - Combined Rail Schedules.xlsx",
}
# + [markdown]
# # Read input data
#
# - NTA Rail Line Statistics
# - 2016 Small Area Boundaries
# - Dublin Boundary
#
# Notes:
# - Convert spatial data to ITM or epsg=2157 so both in same Coordinate Reference System
# - **Don't forget to Mount Google Drive as otherwise this Notebook won't be able to access the data**
# +
rail_lines = gpd.read_file(FILEPATHS["rail_links"]).to_crs(epsg=2157)
# + id="BMPv0-FLWtVu"
small_area_boundaries = gpd.read_file(FILEPATHS["small_area_boundaries"])[
["small_area", "geometry"]
].to_crs(epsg=2157)
# +
dublin_bounding_box = (
gpd.GeoSeries(box(695000, 712500, 740000, 771000), crs=2157)
.rename("geometry")
.to_frame()
)
# +
total_journeys_linkid = pd.read_excel(FILEPATHS["rail_schedules"])
# +
def sjoin_center_inside(dfA, dfB):
"""Join where center of A intersects B"""
dfA_center = dfA.copy()
dfA_center.geometry = dfA.geometry.representative_point()
dfA_sjoined = gpd.sjoin(dfA_center, dfB, op="intersects")
return dfA_sjoined.assign(geometry=dfA.geometry)
dublin_small_area_boundaries = sjoin_center_inside(
small_area_boundaries, dublin_bounding_box
)
# + [markdown]
# # Get Total Journeys
# +
total_journeys = rail_lines.merge(total_journeys_linkid, on="linkID")
# +
total_journeys
# + [markdown]
# # Distribute Rail lines among Small Areas
# + [markdown]
# ## Measure line lengths in each Small Area
# +
total_journeys_per_small_area = gpd.overlay(
total_journeys, small_area_boundaries, "union"
)
# +
total_journeys_per_small_area["line_length_km"] = (
total_journeys_per_small_area.geometry.length * 10 ** -3
)
# +
# ## Link Small Areas to Number of Journeys for linkID
# +
total_journeys_per_small_area["DART_total"] = (
total_journeys_per_small_area["DART_northbound"]
+ total_journeys_per_small_area["DART_southbound"]
)
total_journeys_per_small_area["LUAS_total"] = (
total_journeys_per_small_area["LUAS_northbound"]
+ total_journeys_per_small_area["LUAS_southbound"]
)
total_journeys_per_small_area["Commuter_total"] = (
total_journeys_per_small_area["Commuter_northbound"]
+ total_journeys_per_small_area["Commuter_southbound"]
)
total_journeys_per_small_area["Intercity_total"] = (
total_journeys_per_small_area["Intercity_northbound"]
+ total_journeys_per_small_area["Intercity_southbound"]
)
# +
diesel_train_kgCO2_per_km = 8.057183256
dart_kgCO2_per_km = 3.793376027
luas_kgCO2_per_km = 1.825367372
diesel_train_kWh_per_km = 30.53119839
dart_kWh_per_km = 11.68991071
luas_kWh_per_km = 5.625169096
# +
total_journeys_per_small_area["DART_MWh"] = (
total_journeys_per_small_area["DART_total"]
* total_journeys_per_small_area["line_length_km"]
* dart_kWh_per_km
* 10 ** -3
)
total_journeys_per_small_area["DART_tCO2"] = (
total_journeys_per_small_area["DART_total"]
* total_journeys_per_small_area["line_length_km"]
* dart_kgCO2_per_km
* 10 ** -3
)
total_journeys_per_small_area["LUAS_MWh"] = (
total_journeys_per_small_area["LUAS_total"]
* total_journeys_per_small_area["line_length_km"]
* luas_kWh_per_km
* 10 ** -3
)
total_journeys_per_small_area["LUAS_tCO2"] = (
total_journeys_per_small_area["LUAS_total"]
* total_journeys_per_small_area["line_length_km"]
* luas_kgCO2_per_km
* 10 ** -3
)
total_journeys_per_small_area["Commuter_MWh"] = (
total_journeys_per_small_area["Commuter_total"]
* total_journeys_per_small_area["line_length_km"]
* diesel_train_kWh_per_km
* 10 ** -3
)
total_journeys_per_small_area["Commuter_tCO2"] = (
total_journeys_per_small_area["Commuter_total"]
* total_journeys_per_small_area["line_length_km"]
* diesel_train_kgCO2_per_km
* 10 ** -3
)
total_journeys_per_small_area["Intercity_MWh"] = (
total_journeys_per_small_area["Intercity_total"]
* total_journeys_per_small_area["line_length_km"]
* diesel_train_kWh_per_km
* 10 ** -3
)
total_journeys_per_small_area["Intercity_tCO2"] = (
total_journeys_per_small_area["Intercity_total"]
* total_journeys_per_small_area["line_length_km"]
* diesel_train_kgCO2_per_km
* 10 ** -3
)
# +
total_energy = total_journeys_per_small_area["DART_MWh"].sum()
total_energy
# +
total_journeys_per_small_area
# +
total_journeys_per_small_area.to_file(
data_dir / "rail_small_area_statistics.geojson", driver="GeoJSON"
)
# + [markdown]
# # Estimate All-of-Dublin Rail Energy
# +
total_journeys["line_length_km"] = total_journeys.geometry.length * 10 ** -3
# +
total_journeys["DART_total"] = (
total_journeys["DART_northbound"] + total_journeys["DART_southbound"]
)
total_journeys["LUAS_total"] = (
total_journeys["LUAS_northbound"] + total_journeys["LUAS_southbound"]
)
total_journeys["Commuter_total"] = (
total_journeys["Commuter_northbound"] + total_journeys["Commuter_southbound"]
)
total_journeys["Intercity_total"] = (
total_journeys["Intercity_northbound"] + total_journeys["Intercity_southbound"]
)
# +
total_journeys["DART_MWh"] = (
total_journeys["DART_total"]
* total_journeys["line_length_km"]
* dart_kWh_per_km
* 10 ** -3
)
total_journeys["DART_tCO2"] = (
total_journeys["DART_total"]
* total_journeys["line_length_km"]
* dart_kgCO2_per_km
* 10 ** -3
)
total_journeys["LUAS_MWh"] = (
total_journeys["LUAS_total"]
* total_journeys["line_length_km"]
* luas_kWh_per_km
* 10 ** -3
)
total_journeys["LUAS_tCO2"] = (
total_journeys["LUAS_total"]
* total_journeys["line_length_km"]
* luas_kgCO2_per_km
* 10 ** -3
)
total_journeys["Commuter_MWh"] = (
total_journeys["Commuter_total"]
* total_journeys["line_length_km"]
* diesel_train_kWh_per_km
* 10 ** -3
)
total_journeys["Commuter_tCO2"] = (
total_journeys["Commuter_total"]
* total_journeys["line_length_km"]
* diesel_train_kgCO2_per_km
* 10 ** -3
)
total_journeys["Intercity_MWh"] = (
total_journeys["Intercity_total"]
* total_journeys["line_length_km"]
* diesel_train_kWh_per_km
* 10 ** -3
)
total_journeys["Intercity_tCO2"] = (
total_journeys["Intercity_total"]
* total_journeys["line_length_km"]
* diesel_train_kgCO2_per_km
* 10 ** -3
)
# +
total_journeys
# +
for rail_mwh in ["DART_MWh", "LUAS_MWh", "Commuter_MWh", "Intercity_MWh"]:
print(total_journeys[rail_mwh].sum())
| 26.378277 | 102 | 0.726821 | 938 | 7,043 | 4.971215 | 0.180171 | 0.245336 | 0.144113 | 0.189149 | 0.560798 | 0.537208 | 0.451855 | 0.407463 | 0.399528 | 0.399528 | 0 | 0.031198 | 0.153486 | 7,043 | 266 | 103 | 26.477444 | 0.750923 | 0.121823 | 0 | 0.377778 | 0 | 0 | 0.226545 | 0.023864 | 0 | 0 | 0 | 0 | 0 | 1 | 0.005556 | false | 0 | 0.022222 | 0 | 0.033333 | 0.005556 | 0 | 0 | 0 | null | 1 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
517d85ea470a29dfc6956fb01a2a0f088f31fb7e | 3,217 | py | Python | features/steps/day5.py | erikedin/aoc2016 | 7f248f252b0a846e39c60d66485f796576b2179e | [
"MIT"
] | null | null | null | features/steps/day5.py | erikedin/aoc2016 | 7f248f252b0a846e39c60d66485f796576b2179e | [
"MIT"
] | null | null | null | features/steps/day5.py | erikedin/aoc2016 | 7f248f252b0a846e39c60d66485f796576b2179e | [
"MIT"
] | null | null | null | from behave import *
import aoc2016.securitydoor as securitydoor
import aoc2016.day5 as day5
@given(u'a door with door id "{door_id}"')
def step_impl(context, door_id):
context.door_breaker = securitydoor.DoorBreaker(door_id)
@given(u'a second door with door id "{door_id}"')
def step_impl(context, door_id):
context.door_breaker = securitydoor.SecondDoorBreaker(door_id)
@given(u'that a hash must start with five zeroes')
def step_impl(context):
context.door_breaker.hash_condition = securitydoor.five_zeroes_condition
@given(u'I want to find the {password_char_index:d}th character in the hash')
def step_impl(context, password_char_index):
context.door_breaker.password_char = securitydoor.PasswordCharIndex(password_char_index)
@given(u'I want the position and char from the {pos_th:d}th and {char_th:d}th positions with a password length of eight')
def step_impl(context, pos_th, char_th):
context.door_breaker.password_char = securitydoor.SecondPasswordCharIndex(pos_th, char_th, 8)
@given(u'I want a eight-character password')
def step_impl(context):
context.door_breaker.set_length(8)
context.password_length = 8
@given(u'I use MD5 as the hash function')
def step_impl(context):
context.door_breaker.hash_function = securitydoor.MD5()
@then(u'the current index should be {current_index:d}')
def step_impl(context, current_index):
assert context.door_breaker.current_index == current_index
@when(u'I hash door id and the index')
def step_impl(context):
context.hash = context.door_breaker.hash()
@then(u'I should get the password character {password_char}')
def step_impl(context, password_char):
c = context.door_breaker.password_char.get_char(context.hash)
assert c == password_char, "Expected {}, but got {}".format(password_char, c)
@given(u'that the current hash index is {current_index:d}')
def step_impl(context, current_index):
context.door_breaker.current_index = current_index
@when(u'I want to find the next valid index')
def step_impl(context):
context.door_breaker.find_next_valid_index()
@when(u'I find the password for the door')
def step_impl(context):
context.password = context.door_breaker.find_password()
@then(u'the password should be {password}')
def step_impl(context, password):
assert context.password == password, "Expected {}, but got {}".format(password, context.password)
@then(u'the password position should be {pos:d}')
def step_impl(context, pos):
p = context.door_breaker.password_char.get_pos(context.hash)
assert p == pos, "Expected {}, but got {}".format(pos, p)
@then(u'I should ignore the password character, because it is an invalid position')
def step_impl(context):
assert context.door_breaker.password_char.get_pos(context.hash) == None
@given(u'a position in the password has been filled')
def step_impl(context):
context.door_breaker.fill_password(0, 'a')
@when(u'I try to fill the same position')
def step_impl(context):
context.door_breaker.fill_password(0, 'b')
@then(u'I should keep the existing password character')
def step_impl(context):
assert context.door_breaker.password[0] == 'a', "Expected a, but got {}".format(context.door_breaker.password[0])
| 38.759036 | 121 | 0.761579 | 503 | 3,217 | 4.695825 | 0.172962 | 0.097798 | 0.088484 | 0.144793 | 0.527519 | 0.41829 | 0.316681 | 0.286198 | 0.252329 | 0.144793 | 0 | 0.006759 | 0.126205 | 3,217 | 82 | 122 | 39.231707 | 0.833511 | 0 | 0 | 0.222222 | 0 | 0.015873 | 0.29313 | 0.007771 | 0 | 0 | 0 | 0 | 0.095238 | 1 | 0.301587 | false | 0.396825 | 0.047619 | 0 | 0.349206 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
517e27047d5d641e18eeb7fefe552eda3043f7c9 | 11,125 | py | Python | adapters-stk/example/MixedPoissonExample/analyze_performance.py | hillyuan/Panzer | 13ece3ea4c145c4d7b6339e3ad6332a501932ea8 | [
"BSD-3-Clause"
] | 1 | 2022-03-22T03:49:50.000Z | 2022-03-22T03:49:50.000Z | adapters-stk/example/MixedPoissonExample/analyze_performance.py | hillyuan/Panzer | 13ece3ea4c145c4d7b6339e3ad6332a501932ea8 | [
"BSD-3-Clause"
] | null | null | null | adapters-stk/example/MixedPoissonExample/analyze_performance.py | hillyuan/Panzer | 13ece3ea4c145c4d7b6339e3ad6332a501932ea8 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
"""
Script for analyzing Panzer kernel performance on next-generation
architectures. Runs hierarchic parallelism and generates plots from
data.
"""
__version__ = "1.0"
__author__ = "Roger Pawlowski"
__date__ = "Dec 2018"
# Import python modules for command-line options, the operating system, regular
# expressions, and system functions
import commands
import argparse
import os
import re
import sys
import datetime
#############################################################################
def main():
"""Script for analyzing Phalanx performance on next-generation architectures."""
# Initialization
print '****************************************'
print '* Starting Panzer Analysis'
print '****************************************'
parser = argparse.ArgumentParser(description='Panzer hierarchic parallelism analysis script')
parser.add_argument('-r', '--run', action='store_true', help='Run the executable to generate data and output to files.')
parser.add_argument('-a', '--analyze', action='store_true', help='Analyze the data from files generated with --run.')
parser.add_argument('-p', '--prefix', help='Add a prefix string to all output filenames.')
parser.add_argument('-v', '--verbose', action='store_true', help='Print more data to screen.')
parser.add_argument('-o', '--basis-order', type=int, required=True, help='FE basis order.')
parser.add_argument('-ts', '--team-size', type=int, required=True, help='Team size for hierarchic parallelism.')
parser.add_argument('-vs', '--vector-size', type=int, required=True, help='Vector size for hierarchic parallelism.')
group = parser.add_mutually_exclusive_group()
group.add_argument('-b', '--base-exe', action='store_true', default=False, help="Use the Base executable")
group.add_argument('-m', '--mixed-exe', action='store_true', default=False, help="Use the Mixed Field Type executable")
group.add_argument('-d', '--device-dag-exe', action='store_true', default=True, help="Use the Device DAG executable")
args = parser.parse_args()
nx = 20
ny = 20
nz = 20
order = args.basis_order
ts = args.team_size
vs = args.vector_size
print "basis order = %d, team size = %d, vector size = %d\n" % (order, ts, vs)
executable = "./PanzerAdaptersSTK_MixedPoissonExample.exe"
print "Starting Workset Analysis"
ws_step_size = 100
workset_range = range(100,2000+ws_step_size,ws_step_size)
print "workset range = "+str(workset_range)
timings = {}
if args.analyze:
import numpy as np
timings["panzer::AssemblyEngine::evaluate_volume(panzer::Traits::Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] GatherSolution (Tpetra): GRADPHI_FIELD (panzer::Traits::Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] DOFDiv: DIV_GRADPHI_FIELD (panzer::Traits::Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] Integrator_DivBasisTimesScalar (EVALUATES): RESIDUAL_GRADPHI_FIELD"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] Sine Source"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] Integrator_DivBasisTimesScalar (CONTRIBUTES): RESIDUAL_GRADPHI_FIELD"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] SCATTER_GRADPHI_FIELD Scatter Residual (Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] DOF: GRADPHI_FIELD accel_jac (panzer::Traits::Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] Integrator_GradBasisDotVector (EVALUATES): RESIDUAL_PHI_MASS_OP"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] GatherSolution (Tpetra): PHI (panzer::Traits::Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] DOFGradient: GRAD_PHI (panzer::Traits::Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] Integrator_GradBasisDotVector (EVALUATES): RESIDUAL_PHI_DIFFUSION_OP"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] SumStatic Rank 2 Evaluator"] = np.zeros(len(workset_range),dtype=np.float64)
timings["[panzer::Traits::Jacobian] SCATTER_PHI Scatter Residual (Jacobian)"] = np.zeros(len(workset_range),dtype=np.float64)
#print dir(np)
for i in range(len(workset_range)):
ws = workset_range[i]
filename = "fea_nx_%i_ny_%i_nz_%i_order_%i_ws_%i_ts_%i_vs_%i.dat" % (nx, ny, nz , order, ws, ts, vs)
if args.prefix:
filename = args.prefix+filename
command = executable+" --x-elements=%i --y-elements=%i --z-elements=%i --hgrad-basis-order=%i --hdiv-basis-order=%i --workset-size=%i --use-shared-mem-for-ad --no-check-order" % (nx, ny, nz, order, order, ws) +" >& "+filename
if args.run:
#print 'generating data...'
if args.verbose:
print " Running \""+command+"\" ...",
sys.stdout.flush()
os.system(command);
if args.verbose:
print "completed!"
sys.stdout.flush()
if args.analyze:
f = open(filename, mode='r')
lines = f.readlines()
for line in lines:
if args.verbose:
print line,
for key,value in timings.iteritems():
if key in line:
split_line = line.split()
timings[key][i] += float(split_line[-4])
if args.verbose:
print " found key: "+key+" = "+str(split_line[-4])
break
f.close()
do_jac = True
if args.analyze:
import matplotlib.pyplot as plt
fig = plt.figure()
plt.semilogy()
# maroon = #990033, light blue = #00ffff
#plt.plot(workset_range,timings["Jacobian Evaluation Time <<Host DAG>>"],label="Jac Total Time (Host DAG)",marker="o",color="#990033",markersize=8)
#plt.plot(workset_range,timings["Jacobian Evaluation Time <<Device DAG>>"],label="Jac Total Time (Device DAG)",marker="s",color="r",markersize=8)
#plt.plot(workset_range,timings["Residual Evaluation Time <<Host DAG>>"],label="Res Total Time (Host DAG)",marker="o",color="b",markersize=8)
plt.plot(workset_range,timings["panzer::AssemblyEngine::evaluate_volume(panzer::Traits::Jacobian)"],label="Jacobian Volume Assembly Total Time",marker="s",color="#00ffff",markersize=8)
plt.xlabel("Workset Size",fontsize=16)
plt.ylabel("Time (s)",fontsize=16)
plt.tick_params(labelsize=16)
title = "nel=%i,order=%i" % (nx*ny*nz,order)
plt.title(title)
#plt.legend(bbox_to_anchor=(1,1))
plt.legend(loc='upper center', bbox_to_anchor=(0.5,1.0),ncol=2,fancybox=True,shadow=True, prop={'size': 12})
plt.grid()
dag_timings_filename = "total_time_nx_%i_ny_%i_nz_%i_order_%i_ts_%i_vs_%i.png" % (nx, ny, nz ,order, ts, vs)
fig.savefig(dag_timings_filename)
#plt.show()
fig = plt.figure(2)
#plt.clf()
plt.semilogy()
plt.plot(workset_range,timings["[panzer::Traits::Jacobian] Integrator_DivBasisTimesScalar (EVALUATES): RESIDUAL_GRADPHI_FIELD"],label="Integrator DivBasisTimesScalar (eval)",marker='s')
plt.plot(workset_range,timings["[panzer::Traits::Jacobian] Integrator_DivBasisTimesScalar (CONTRIBUTES): RESIDUAL_GRADPHI_FIELD"],label="Integrator DivBasisTimesScalar (contrib)",marker='^')
plt.plot(workset_range,timings["[panzer::Traits::Jacobian] Integrator_GradBasisDotVector (EVALUATES): RESIDUAL_PHI_MASS_OP"],label="Integrator GradBasisDotVector (mass op)",marker='*')
plt.plot(workset_range,timings["[panzer::Traits::Jacobian] Integrator_GradBasisDotVector (EVALUATES): RESIDUAL_PHI_DIFFUSION_OP"],label="Integrator GradBasisDotVector (diff op)",marker='D')
plt.plot(workset_range,timings["[panzer::Traits::Jacobian] DOF: GRADPHI_FIELD accel_jac (panzer::Traits::Jacobian)"],label="DOF (GradPHI)",marker='+')
plt.plot(workset_range,timings["[panzer::Traits::Jacobian] DOFGradient: GRAD_PHI (panzer::Traits::Jacobian)"],label="DOFGradient (GradPhi)",marker='x')
#plt.plot(workset_range,timings["[panzer::Traits::Jacobian] DOFDiv: DIV_GRADPHI_FIELD (panzer::Traits::Jacobian)"],label="DOF Div (GradPhi)",marker='o')
#plt.plot(workset_range,timings[""],label="Res Scatter",marker='.',color="#ff6600")
plt.xlabel("Workset Size",fontsize=16)
plt.ylabel("Time (s)",fontsize=16)
plt.tick_params(labelsize=16)
plt.ylim(1.0e-4,1.0e1)
title = "nel=%i,order=%i" % (nx*ny*nz,order)
plt.title(title)
#plt.legend(bbox_to_anchor=(1,1))
plt.legend(loc='upper center', bbox_to_anchor=(0.5,0.25),ncol=2,fancybox=True,shadow=True, prop={'size': 10})
#plt.axis([0,2000,1.0e-4,0.1])
plt.grid()
res_evaluator_timings_filename = "kernel_timings_nx_%i_ny_%i_nz_%i_order_%i_ts_%i_vs_%i.png" % (nx, ny, nz, order, ts, vs)
fig.savefig(res_evaluator_timings_filename)
#print dir(plt)
# Plot to assess savings
count = 0;
for key,value in timings.iteritems():
filename_f = "raw_data_output_timer_%i_nx_%i_ny_%i_nz_%i_order_%i_ws_%i_ts_%i_vs_%i.csv" % (count, nx, ny, nz, order, ws, ts, vs)
write_file = open(filename_f,'w')
count += 1;
write_file.write(str(key)+"\n")
for i in range(len(workset_range)):
write_file.write(str(workset_range[i])+", "+str(timings[key][i])+"\n")
print "Finished Workset Analysis"
if args.verbose:
print timings
# f = open(filename, mode='r')
# lines = f.readlines()
# for line in lines:
# print line,
# split_line = line.split(" ")
# print split_line[1]
# f.close()
#os.chdir('/Users')
# Write timestamp for backup
#os.chdir('/Users/rppawlo')
#timestamp_file = open('BACKUP_DATE', 'w')
#today = datetime.datetime.today()
#date = today.strftime("YYYY.MM.DD: %Y.%m.%d at HH.MM.SS: %H.%M.%S")
#timestamp_file.write(date)
#timestamp_file.close()
print '****************************************'
print '* Finished Panzer Analysis!'
print '****************************************'
#############################################################################
# If called from the command line, call main()
#############################################################################
if __name__ == "__main__":
main()
| 51.985981 | 234 | 0.626427 | 1,379 | 11,125 | 4.894851 | 0.211748 | 0.058667 | 0.088889 | 0.08 | 0.547111 | 0.50637 | 0.479704 | 0.447111 | 0.401778 | 0.386222 | 0 | 0.014244 | 0.19227 | 11,125 | 213 | 235 | 52.230047 | 0.736924 | 0.134112 | 0 | 0.242424 | 1 | 0.007576 | 0.379639 | 0.186645 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.060606 | null | null | 0.113636 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
51924a6869dfd9437cc45177c80fbceb98f4485d | 243 | py | Python | sedastrela_is/urls.py | ondrejsika/sedastrela-is | be9c449c81fd1d7711a09acceb2321fd4828e8b1 | [
"MIT"
] | null | null | null | sedastrela_is/urls.py | ondrejsika/sedastrela-is | be9c449c81fd1d7711a09acceb2321fd4828e8b1 | [
"MIT"
] | null | null | null | sedastrela_is/urls.py | ondrejsika/sedastrela-is | be9c449c81fd1d7711a09acceb2321fd4828e8b1 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.views.generic.base import RedirectView
urlpatterns = [
url(r'^event/', include('sedastrela_is.event.urls', namespace='event')),
url(r'^$', RedirectView.as_view(url='/admin/')),
]
| 27 | 76 | 0.707819 | 32 | 243 | 5.3125 | 0.625 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115226 | 243 | 8 | 77 | 30.375 | 0.790698 | 0 | 0 | 0 | 0 | 0 | 0.185185 | 0.098765 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
51a8a5ea4b3bcb9b33a3e62002c249025c90e13f | 13,905 | py | Python | tests/test_images.py | Muhammad-R/flaskr | 16f33963653fa758c9402b91f2f4723ba3d7a6db | [
"MIT"
] | 2 | 2021-03-04T08:23:20.000Z | 2021-12-19T16:41:54.000Z | tests/test_images.py | Muhammad-R/flaskr | 16f33963653fa758c9402b91f2f4723ba3d7a6db | [
"MIT"
] | null | null | null | tests/test_images.py | Muhammad-R/flaskr | 16f33963653fa758c9402b91f2f4723ba3d7a6db | [
"MIT"
] | 2 | 2021-09-14T20:57:35.000Z | 2021-12-19T15:26:58.000Z | import os
import shutil
import pytest
from flask import url_for
from werkzeug.datastructures import FileStorage
from flaskr import images
from flaskr.db import get_db
class ExampleImage(object):
def __init__(self):
self.filename = "example.png"
self.path = os.path.join(
os.path.dirname(__file__), self.filename)
self.fileobject = open(self.path, mode="rb")
with open(self.path, mode="rb") as f:
self.content = f.read()
@pytest.fixture
def example_image_to_upload_dir(app):
example_image = ExampleImage()
shutil.copyfile(example_image.path,
os.path.join(app.config["UPLOAD_DIR"],
example_image.filename))
def test_get_example_image_from_url(app, client, example_image_to_upload_dir):
example_image = ExampleImage()
with app.app_context():
assert example_image.filename in os.listdir(app.config["UPLOAD_DIR"])
with app.test_request_context():
response = client.get(
url_for("images.get", filename=example_image.filename))
assert response.status_code == 200
assert response.mimetype == "image/png"
assert response.data == example_image.content
def test_get_random_string():
first_string = images.get_random_string()
second_string = images.get_random_string()
assert first_string != second_string
assert "-" not in second_string
assert "." not in second_string
def test_save_image_to_upload_dir_with_given_filename(app):
example_image = ExampleImage()
# The werkzeug filestorage type is how that uploaded image will be attached
# to the request by Flask. The FileStorage object already comes with a save
# method. It makes sense to utilize that.
filestorage = FileStorage(
stream=example_image.fileobject,
filename=example_image.filename)
with app.app_context():
# File does not exist
assert (example_image.filename
not in os.listdir(app.config["UPLOAD_DIR"]))
# Saving file
saved_filename = images.save_image_to_upload_dir(
filestrorage_obj=filestorage,
_filename=example_image.filename
)
# File exists
assert saved_filename == example_image.filename
assert (example_image.filename
in os.listdir(app.config["UPLOAD_DIR"]))
saved_image_path = os.path.join(app.config["UPLOAD_DIR"],
example_image.filename)
# File has correct content
with open(saved_image_path, mode="rb") as f:
saved_image_content = f.read()
assert saved_image_content == example_image.content
def test_save_image_to_upload_dir_without_given_filename(app):
example_image = ExampleImage()
filestorage = FileStorage(
stream=example_image.fileobject,
filename=example_image.filename)
with app.app_context():
# File does not exist
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert (example_image.filename
not in uploaded_files)
assert len(uploaded_files) == 0
# Saving file
saved_filename = images.save_image_to_upload_dir(
filestrorage_obj=filestorage)
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 1
# The saved file does not have the example filename!
assert (example_image.filename
not in uploaded_files)
assert uploaded_files[0] == saved_filename
_, saved_fileextension = os.path.splitext(saved_filename)
assert saved_fileextension == ".png"
# But the content is correct
saved_image_path = os.path.join(app.config["UPLOAD_DIR"],
saved_filename)
with open(saved_image_path, mode="rb") as f:
saved_image_content = f.read()
assert saved_image_content == example_image.content
def test_post_image_association_none_exising_file(app):
with app.app_context():
# To create an association, the file has to exist in the upload
# directory or an Exception is raised
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 0
filenotfound_raised = False
try:
images.create_post_image_association(
post_id=1, filename="example.png")
except FileNotFoundError:
filenotfound_raised = True
assert filenotfound_raised
def test_new_post_image_association(app, example_image_to_upload_dir):
with app.app_context():
images.create_post_image_association(
post_id=1, filename="example.png")
db = get_db()
result = db.execute(
"SELECT post_id, filename FROM post_image WHERE post_id = 1"
).fetchone()
assert result["post_id"] == 1
assert result["filename"] == "example.png"
def test_get_image_of_post(app, example_image_to_upload_dir):
example_image = ExampleImage()
with app.app_context():
response_before_association = images.get_image_of_post(post_id=1)
assert response_before_association is None
images.create_post_image_association(
post_id=1, filename=example_image.filename)
image_filename = images.get_image_of_post(post_id=1)
assert image_filename == example_image.filename
def test_delete_post_image_associations_of_post(
app, example_image_to_upload_dir):
example_image = ExampleImage()
with app.app_context():
images.create_post_image_association(
post_id=1, filename=example_image.filename)
image_filename = images.get_image_of_post(post_id=1)
assert image_filename == example_image.filename
assert image_filename in os.listdir(app.config["UPLOAD_DIR"])
images.delete_post_image_associations_of_post(post_id=1)
assert images.get_image_of_post(post_id=1) is None
assert image_filename not in os.listdir(app.config["UPLOAD_DIR"])
def test_save_image_and_create_image_association(app):
example_image = ExampleImage()
filestorage = FileStorage(
stream=example_image.fileobject,
filename=example_image.filename)
with app.app_context():
# File does not exist
assert len(os.listdir(app.config["UPLOAD_DIR"])) == 0
# Saving file
images.save_image_and_create_or_update_post_association(
image=filestorage, post_id=1)
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 1
associated_image_filename = images.get_image_of_post(post_id=1)
assert associated_image_filename is not None
assert associated_image_filename in uploaded_files
def test_save_image_and_update_image_association(app):
example_image = ExampleImage()
filestorage = FileStorage(
stream=example_image.fileobject,
filename=example_image.filename)
with app.app_context():
# File does not exist
assert len(os.listdir(app.config["UPLOAD_DIR"])) == 0
# Saving file for the first time
images.save_image_and_create_or_update_post_association(
image=filestorage, post_id=1)
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 1
associated_image_filename_1 = images.get_image_of_post(post_id=1)
assert associated_image_filename_1 is not None
assert associated_image_filename_1 in uploaded_files
# Saving the image again
images.save_image_and_create_or_update_post_association(
image=filestorage, post_id=1)
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
# There should still be only one file in the upload folder, because
# the first one should be deleted.
assert len(uploaded_files) == 1
associated_image_filename_2 = images.get_image_of_post(post_id=1)
# The name of the associated file should have changed and that should
# the uploaded file.
assert associated_image_filename_2 is not associated_image_filename_1
assert associated_image_filename_2 in uploaded_files
@pytest.mark.parametrize(("path", "post_id"), (
("/create", 2),
("/1/update", 1)
))
def test_post_view_saves_files_and_creates_association(
app, client, auth, path, post_id):
auth.login()
example_image = ExampleImage()
with app.test_request_context():
# No uploads yet
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 0
form_data = {
"title": "post with image",
"body": "some body",
"image": [(example_image.fileobject, example_image.filename)]
}
response = client.post(
path, data=form_data, follow_redirects=True)
assert response.status_code == 200
# The associated files should be in the uploads
associated_image_filename = images.get_image_of_post(post_id=post_id)
assert associated_image_filename is not None
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 1
assert associated_image_filename in uploaded_files
# The associated file should have the example files content
saved_image_path = os.path.join(app.config["UPLOAD_DIR"],
associated_image_filename)
with open(saved_image_path, mode="rb") as f:
saved_image_content = f.read()
assert saved_image_content == example_image.content
def test_sending_empty_value_for_image_to_create_post_view(
app, client, auth):
auth.login()
with app.test_request_context():
# No uploads yet
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 0
form_data = {
"title": "post with image",
"body": "some body",
"image": []
}
response = client.post(
url_for("blog.create"), data=form_data, follow_redirects=True)
assert response.status_code == 200
uploaded_files = os.listdir(app.config["UPLOAD_DIR"])
assert len(uploaded_files) == 0
associated_image_filename = images.get_image_of_post(post_id=2)
assert associated_image_filename is None
def test_file_input_for_image_on_post_create_view(app, client, auth):
auth.login()
with app.test_request_context():
response = client.get(url_for("blog.create"))
assert b'<input type="file" name="image">' in response.data
# The enctype is required by flask to have data actually being attached
# to the request object.
assert b'enctype="multipart/form-data"' in response.data
def test_file_input_for_image_on_post_update_view(app, client, auth):
auth.login()
with app.test_request_context():
response = client.get(url_for("blog.update", id=1))
assert b'<input type="file" name="image">' in response.data
# The enctype is required by flask to have data actually being attached
# to the request object.
assert b'enctype="multipart/form-data"' in response.data
def test_image_url_on_post_detail_page(app, client, auth):
auth.login()
example_image = ExampleImage()
with app.test_request_context():
# Adding image to post 1
form_data = {
"title": "post with image",
"body": "some body",
"image": [(example_image.fileobject, example_image.filename)]
}
response = client.post(
"/1/update", data=form_data, follow_redirects=True)
assert response.status_code == 200
# The associated files should be in the uploads
associated_image_filename = images.get_image_of_post(post_id=1)
assert associated_image_filename is not None
response = client.get("/1/detail")
assert bytes(
associated_image_filename, encoding="utf8") in response.data
def test_post_with_image_shows_image_on_update_page_(
app, client, auth):
auth.login()
example_image = ExampleImage()
with app.test_request_context():
# Adding image to post 1
form_data = {
"title": "post with image",
"body": "some body",
"image": [(example_image.fileobject, example_image.filename)]
}
response = client.post(
"/1/update", data=form_data, follow_redirects=True)
assert response.status_code == 200
# The associated files should be in the uploads
associated_image_filename = images.get_image_of_post(post_id=1)
assert associated_image_filename is not None
response = client.get("/1/update")
assert bytes(
associated_image_filename, encoding="utf8") in response.data
def test_delete_image_association_via_update_form(app, client, auth):
auth.login()
example_image = ExampleImage()
with app.test_request_context():
# Adding image to post 1
form_data = {
"title": "post with image",
"body": "some body",
"image": [(example_image.fileobject, example_image.filename)]
}
client.post("/1/update", data=form_data)
# The check association exists
assert images.get_image_of_post(post_id=1) is not None
# Remove image association via update form
form_data = {
"title": "post with image",
"body": "some body",
"delete-image": True
}
client.post("/1/update", data=form_data)
# Check association is removed
assert images.get_image_of_post(post_id=1) is None
| 37.379032 | 79 | 0.665085 | 1,754 | 13,905 | 4.982896 | 0.104903 | 0.072769 | 0.050343 | 0.043249 | 0.777117 | 0.715446 | 0.697941 | 0.660526 | 0.64611 | 0.617162 | 0 | 0.006901 | 0.249622 | 13,905 | 371 | 80 | 37.479784 | 0.830746 | 0.096081 | 0 | 0.607407 | 0 | 0 | 0.067119 | 0.004629 | 0 | 0 | 0 | 0 | 0.225926 | 1 | 0.07037 | false | 0 | 0.025926 | 0 | 0.1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 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 | 2 |
51c816d336e3c0a3ca2ec653b14ab90eeb171ba8 | 51 | py | Python | python_work/Chapter2_Exercises/exe7_name_cases.py | Elektra-2/python_crash_course_2nd | 1c8beaddfe037faa3a36e7c384a6ea2f9d560060 | [
"MIT"
] | 1 | 2020-08-25T18:42:30.000Z | 2020-08-25T18:42:30.000Z | python_work/Chapter2_Exercises/exe7_name_cases.py | Elektra-2/python_crash_course_2nd | 1c8beaddfe037faa3a36e7c384a6ea2f9d560060 | [
"MIT"
] | null | null | null | python_work/Chapter2_Exercises/exe7_name_cases.py | Elektra-2/python_crash_course_2nd | 1c8beaddfe037faa3a36e7c384a6ea2f9d560060 | [
"MIT"
] | null | null | null | nome = "\tCarolina"
nome = nome.strip()
print(nome) | 17 | 19 | 0.686275 | 7 | 51 | 5 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 51 | 3 | 20 | 17 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0.192308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
51dd8afe5967102df99425c0fa965295c60ca0cb | 460 | py | Python | pyrhessys/read_shellscript.py | DavidChoi76/pyRHESSys | 7dd75041bdafa8dd99851960bec4e27c834f9cc8 | [
"MIT"
] | null | null | null | pyrhessys/read_shellscript.py | DavidChoi76/pyRHESSys | 7dd75041bdafa8dd99851960bec4e27c834f9cc8 | [
"MIT"
] | 6 | 2020-05-28T17:46:11.000Z | 2020-12-02T06:43:49.000Z | pyrhessys/read_shellscript.py | DavidChoi76/pyRHESSys | 7dd75041bdafa8dd99851960bec4e27c834f9cc8 | [
"MIT"
] | 1 | 2022-01-15T12:45:12.000Z | 2022-01-15T12:45:12.000Z | import os
import shutil
import pkg_resources
delineation_d8 = pkg_resources.resource_filename(
__name__, 'sh_code/grass_delineation_d8.sh')
delineation_dinf = pkg_resources.resource_filename(
__name__, 'sh_code/grass_delineation_dinf.sh')
spatial_hierarchy = pkg_resources.resource_filename(
__name__, 'sh_code/grass_spatial_hierarchy.sh')
lulc_fraction = pkg_resources.resource_filename(
__name__, 'sh_code/lulc_fraction.sh')
| 35.384615 | 55 | 0.793478 | 58 | 460 | 5.603448 | 0.310345 | 0.184615 | 0.246154 | 0.344615 | 0.581538 | 0.581538 | 0.581538 | 0.464615 | 0.332308 | 0 | 0 | 0.004988 | 0.128261 | 460 | 12 | 56 | 38.333333 | 0.805486 | 0 | 0 | 0 | 0 | 0 | 0.265217 | 0.265217 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.272727 | 0 | 0.272727 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
51e477d0f9beac58a4c8c8d7b0f51e45e12352e0 | 362 | py | Python | Recipes/Recipes/web_app/models.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | 2 | 2022-03-05T13:17:12.000Z | 2022-03-05T13:17:16.000Z | Recipes/Recipes/web_app/models.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | Recipes/Recipes/web_app/models.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | from django.db import models
class Recipe(models.Model):
TITLE_MAX_LEN=30
INGREDIENTS_MAX_LEN=250
title=models.CharField(
max_length=TITLE_MAX_LEN,
)
image_url=models.URLField()
description=models.TextField()
ingredients=models.CharField(
max_length=INGREDIENTS_MAX_LEN,
)
time=models.IntegerField()
| 18.1 | 39 | 0.696133 | 43 | 362 | 5.604651 | 0.534884 | 0.099585 | 0.091286 | 0.19917 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017668 | 0.218232 | 362 | 19 | 40 | 19.052632 | 0.833922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.076923 | 0 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
51f4ea1e8dffd32df205aff2ca163a1723388b58 | 10,566 | py | Python | pucadmin/secondments/migrations/0001_initial.py | JobDoesburg/PUC-admin | ab61478cbf1cb0ddb57661a7508e70b23642810b | [
"MIT"
] | null | null | null | pucadmin/secondments/migrations/0001_initial.py | JobDoesburg/PUC-admin | ab61478cbf1cb0ddb57661a7508e70b23642810b | [
"MIT"
] | null | null | null | pucadmin/secondments/migrations/0001_initial.py | JobDoesburg/PUC-admin | ab61478cbf1cb0ddb57661a7508e70b23642810b | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-11-26 20:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
("organisations", "0004_auto_20210718_1147"),
("schools", "0004_auto_20211126_2107"),
]
operations = [
migrations.CreateModel(
name="Daypart",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=20, verbose_name="name")),
],
options={
"verbose_name": "daypart",
"verbose_name_plural": "dayparts",
},
),
migrations.CreateModel(
name="Employee",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"first_name",
models.CharField(max_length=20, verbose_name="first name"),
),
(
"last_name",
models.CharField(max_length=20, verbose_name="last name"),
),
(
"phone",
models.CharField(
blank=True, max_length=20, null=True, verbose_name="phone"
),
),
(
"email",
models.EmailField(
blank=True, max_length=254, null=True, verbose_name="email"
),
),
(
"study_year",
models.PositiveSmallIntegerField(
blank=True, null=True, verbose_name="study year"
),
),
(
"hours_available",
models.PositiveSmallIntegerField(
blank=True, null=True, verbose_name="hours available"
),
),
(
"drivers_license",
models.BooleanField(verbose_name="drivers license"),
),
("contract", models.BooleanField(verbose_name="contract")),
(
"courses",
models.ManyToManyField(
to="organisations.Course", verbose_name="courses"
),
),
(
"dayparts",
models.ManyToManyField(
related_name="dayparts",
related_query_name="dayparts",
to="secondments.Daypart",
),
),
],
options={
"verbose_name": "employee",
"verbose_name_plural": "employees",
},
),
migrations.CreateModel(
name="StudyProgram",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=20, verbose_name="name")),
],
options={
"verbose_name": "study program",
"verbose_name_plural": "study program",
},
),
migrations.CreateModel(
name="TimePeriod",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"name",
models.CharField(
help_text="For example, 2019-2020",
max_length=20,
verbose_name="name",
),
),
("start", models.DateField()),
("end", models.DateField()),
],
options={
"verbose_name": "time period",
"verbose_name_plural": "time periods",
},
),
migrations.CreateModel(
name="SecondmentSchool",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"contact_person",
models.CharField(
blank=True,
max_length=100,
null=True,
verbose_name="contact person",
),
),
(
"phone",
models.CharField(
blank=True, max_length=20, null=True, verbose_name="phone"
),
),
(
"email",
models.EmailField(
blank=True, max_length=254, null=True, verbose_name="email"
),
),
(
"drivers_license_required",
models.BooleanField(verbose_name="drivers license required"),
),
("remarks", models.TextField(blank=True, null=True)),
(
"school",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="secondment_schools",
related_query_name="secondment_schools",
to="schools.school",
verbose_name="school",
),
),
(
"time_period",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="secondment_schools",
related_query_name="secondment_schools",
to="secondments.timeperiod",
verbose_name="time period",
),
),
],
options={
"verbose_name": "school",
"verbose_name_plural": "schools",
},
),
migrations.CreateModel(
name="Request",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"num_hours",
models.PositiveSmallIntegerField(verbose_name="num. hours"),
),
(
"remarks",
models.TextField(blank=True, null=True, verbose_name="remarks"),
),
(
"course",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="secondment_requests",
related_query_name="secondment_requests",
to="organisations.course",
verbose_name="course",
),
),
(
"dayparts",
models.ManyToManyField(
related_name="requests",
related_query_name="requests",
to="secondments.Daypart",
verbose_name="dayparts",
),
),
(
"employee",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="secondments",
related_query_name="secondments",
to="secondments.employee",
verbose_name="employee",
),
),
(
"school",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="requests",
related_query_name="requests",
to="secondments.secondmentschool",
verbose_name="school",
),
),
],
options={
"verbose_name": "request",
"verbose_name_plural": "requests",
},
),
migrations.AddField(
model_name="employee",
name="study_program",
field=models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="employees",
related_query_name="employees",
to="secondments.studyprogram",
verbose_name="study program",
),
),
migrations.AddField(
model_name="employee",
name="time_period",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="employees",
related_query_name="employees",
to="secondments.timeperiod",
verbose_name="time period",
),
),
]
| 34.529412 | 84 | 0.376301 | 637 | 10,566 | 6.032967 | 0.172684 | 0.125943 | 0.037471 | 0.045798 | 0.618787 | 0.584179 | 0.523289 | 0.483997 | 0.431954 | 0.36612 | 0 | 0.015828 | 0.533598 | 10,566 | 305 | 85 | 34.642623 | 0.764002 | 0.004259 | 0 | 0.627517 | 1 | 0 | 0.132047 | 0.015781 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.006711 | 0 | 0.020134 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
51f7fd3b964d6ecb8c5ec2f8d89edff3d73d845e | 1,229 | py | Python | lib/utils/stat.py | shikorab/DSG | f2e5eeb1e9695da47b964f3da91b197ab3ecc7ba | [
"MIT"
] | 9 | 2020-05-29T18:36:56.000Z | 2021-09-22T12:23:21.000Z | lib/utils/stat.py | shikorab/DSG | f2e5eeb1e9695da47b964f3da91b197ab3ecc7ba | [
"MIT"
] | 1 | 2021-03-21T14:21:27.000Z | 2021-03-21T14:21:27.000Z | lib/utils/stat.py | shikorab/DSG | f2e5eeb1e9695da47b964f3da91b197ab3ecc7ba | [
"MIT"
] | 3 | 2020-05-31T03:15:59.000Z | 2020-12-30T05:48:20.000Z | class Stat:
def __init__(self):
self.sum = {}
self.sum_square = {}
self.count = {}
def add(self, key, value):
self.count[key] = self.count.get(key, 0) + 1
self.sum[key] = self.sum.get(key, 0.0) + value
self.sum_square[key] = self.sum_square.get(key, 0.0) + value ** 2
def add_dict(self, dict):
for key in dict:
self.add(key, dict[key])
def print_stat(self):
for key in self.count:
name = key
count = self.count[key]
sum = self.sum[key]
square = self.sum_square[key]
avg = sum / count
std = (square / count - (avg) ** 2) ** 0.5
print("%s - count %d avg %.2g std %.2g" % (name, count, avg, std))
def get_count(self, keys):
return {key: self.count.get(key, 0) for key in keys}
def get_avg(self, keys):
return {key: self.sum.get(key, 0) / self.count.get(key, 0) for key in keys if self.count.get(key, 0) != 0}
def get_std(self, keys):
return {key: (self.square.get(key, 0) / self.sum.get(key, 0) - (
self.sum.get(key, 0) / self.count.get(key, 0)) ** 2) ** 0.5 for key in keys if key in self.count}
| 34.138889 | 114 | 0.528885 | 192 | 1,229 | 3.317708 | 0.151042 | 0.120879 | 0.120879 | 0.117739 | 0.412873 | 0.255887 | 0.189953 | 0.189953 | 0.189953 | 0.094192 | 0 | 0.028504 | 0.31489 | 1,229 | 35 | 115 | 35.114286 | 0.728029 | 0 | 0 | 0 | 0 | 0 | 0.025224 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.107143 | 0.392857 | 0.071429 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
a409519b575802d5e295668a5c504b47abedd1a4 | 70 | py | Python | trade_system/offers/choises.py | Artsiom-Shlapakou/trade-system | 41c7bd6779b159d1c867968f5230d4ccbc37995a | [
"MIT"
] | null | null | null | trade_system/offers/choises.py | Artsiom-Shlapakou/trade-system | 41c7bd6779b159d1c867968f5230d4ccbc37995a | [
"MIT"
] | null | null | null | trade_system/offers/choises.py | Artsiom-Shlapakou/trade-system | 41c7bd6779b159d1c867968f5230d4ccbc37995a | [
"MIT"
] | null | null | null | BUY = 1
SALE = 2
OrderType = [
(BUY, 'BUY'),
(SALE, 'SALE')
] | 10 | 18 | 0.457143 | 9 | 70 | 3.555556 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.314286 | 70 | 7 | 19 | 10 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0.098592 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cf91304e2204d86edfae47bac4c942d96ebb31ad | 1,807 | py | Python | meiduo_mall/meiduo_mall/apps/verifications/views.py | zhiliangsu/MeiduoMall | a3968c52f6815ccda6513371d331580dc5aa58f3 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/verifications/views.py | zhiliangsu/MeiduoMall | a3968c52f6815ccda6513371d331580dc5aa58f3 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/verifications/views.py | zhiliangsu/MeiduoMall | a3968c52f6815ccda6513371d331580dc5aa58f3 | [
"MIT"
] | null | null | null | import logging
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from random import randint
from django_redis import get_redis_connection
from rest_framework import status
from meiduo_mall.libs.yuntongxun.sms import CCP
from . import constants
from celery_tasks.sms.tasks import send_sms_code
logger = logging.getLogger('django') # 创建日志输出器
# Create your views here.
# GET /sms_codes/(?P<mobile>1[3-9]\d{9})/
class SMSCodeView(APIView):
"""发送短信验证码"""
def get(self, request, mobile):
# 1.接受手机号码,并校验(通过路由正则组已校验过了)
# 3.创建redis连接对象,并保存短信验证码到Redis中
redis_conn = get_redis_connection('verify_codes')
# 获取此手机号是否有发送过的标记
flag = redis_conn.get('send_flag_%s' % mobile)
# 如果已发送就提前响应,不执行后续代码
if flag: # 如果if成立说明此手机号60秒内发过短信
return Response({'message': '频繁发送短信'}, status=status.HTTP_400_BAD_REQUEST)
# 2.生成短信验证码
sms_code = '%06d' % randint(0, 999999)
logger.info(sms_code)
# 创建redis管道对象
pl = redis_conn.pipeline()
# redis_conn.setex(key, 过期时间, value)
# redis_conn.setex('sms_%s' % mobile, constants.SMS_CODE_REDIS_EXPIRES, sms_code)
pl.setex('sms_%s' % mobile, constants.SMS_CODE_REDIS_EXPIRES, sms_code)
# 存储此手机已发送短信标记
# redis_conn.setex('send_flag_%s' % mobile, constants.SEND_SMS_CODE_INTERVAL, 1)
pl.setex('send_flag_%s' % mobile, constants.SEND_SMS_CODE_INTERVAL, 1)
# 执行管道
pl.execute()
# 4.集成容联云通讯发送短信验证码
# CCP().send_template_sms(mobile, [sms_code, constants.SMS_CODE_REDIS_EXPIRES // 60], 1)
# 触发异步任务(让发短信不用阻塞主线程)
send_sms_code.delay(mobile, sms_code)
# 5.响应结果
return Response({'message': 'ok'})
| 30.627119 | 96 | 0.679026 | 229 | 1,807 | 5.113537 | 0.414847 | 0.077711 | 0.037575 | 0.038429 | 0.192997 | 0.169086 | 0.169086 | 0.169086 | 0.169086 | 0.169086 | 0 | 0.01976 | 0.215827 | 1,807 | 58 | 97 | 31.155172 | 0.806634 | 0.308799 | 0 | 0 | 0 | 0 | 0.060408 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.04 | false | 0 | 0.4 | 0 | 0.56 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
cf9c78ede48195cf2c3a61fc9f5787fc0aa9ab8b | 1,114 | py | Python | core/views.py | DjangoBoston/django-mulsite | 1a4c0e710fa89cbdeda1f0d9070588cdde0878db | [
"MIT"
] | null | null | null | core/views.py | DjangoBoston/django-mulsite | 1a4c0e710fa89cbdeda1f0d9070588cdde0878db | [
"MIT"
] | 4 | 2021-03-19T01:05:57.000Z | 2022-02-10T08:23:38.000Z | core/views.py | DjangoBoston/django-mulsite | 1a4c0e710fa89cbdeda1f0d9070588cdde0878db | [
"MIT"
] | null | null | null |
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from django.contrib.sites.shortcuts import get_current_site
from rest_framework import viewsets
from core.models import SiteUser
from core import sites
from core.serializers import SiteUserSerializer, SiteSerializer, UserSerializer
class UserViewSet(viewsets.ModelViewSet):
model = get_user_model()
serializer_class = UserSerializer
def get_queryset(self):
site = get_current_site(self.request)
queryset = sites.get_users_for_site(site)
return queryset
class SiteUserViewSet(viewsets.ModelViewSet):
model = SiteUser
serializer_class = SiteUserSerializer
def get_queryset(self):
site = get_current_site(self.request)
queryset = sites.get_siteusers_for_site(site)
return queryset
class SiteViewSet(viewsets.ReadOnlyModelViewSet):
"""
TODO: Restrict this viewset to global admins
Example: Users who have `is_superuser` set to `True`
"""
model = Site
queryset = Site.objects.all()
serializer_class = SiteSerializer
| 27.170732 | 79 | 0.752244 | 132 | 1,114 | 6.174242 | 0.401515 | 0.03681 | 0.062577 | 0.053988 | 0.228221 | 0.228221 | 0.154601 | 0.154601 | 0.154601 | 0.154601 | 0 | 0 | 0.184022 | 1,114 | 40 | 80 | 27.85 | 0.89659 | 0.087074 | 0 | 0.24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0 | 1 | 0.08 | false | 0 | 0.28 | 0 | 0.84 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cf9d331b8df5bee8697093247c209e1dc1500366 | 1,445 | py | Python | Mutable Function.py | samli6479/PythonLearn | 2ad78f62d58612132d3a3759aecec4a52381566f | [
"Apache-2.0"
] | null | null | null | Mutable Function.py | samli6479/PythonLearn | 2ad78f62d58612132d3a3759aecec4a52381566f | [
"Apache-2.0"
] | null | null | null | Mutable Function.py | samli6479/PythonLearn | 2ad78f62d58612132d3a3759aecec4a52381566f | [
"Apache-2.0"
] | null | null | null | # A function with Behavior That varies Over Time
# A function compound value have a body and a parent frame
# The parent frame contains the balance, the local state of the withdraw function
# Non-Local Assignment & Persistent Local State
# Work for python 3
def make_withdraw(balance):
""" Return a withdraw function with a starting balance."""
def withdraw(amount):
nonlocal balance # Declare the name "balance" nonlocal at the top of the body
# of the function which it is re-assigned
if amount > balance:
return 'Insufficient funds'
balance = balance - amount #Re-bind balance in the first non-local frame in which
#it was bound previously
return balance
def deposit(amount):
nonlocal balance
balance = balance + amount
return balance
return withdraw, deposit
# nonlocal <name>
# Effect: future assignments to that name change its pre-existing binding in the first non-local frame of the current environment
# Alternative 2.7
def make_withdraw(balance):
""" Return a withdraw function with a starting balance."""
balance = [balance]
def withdraw(amount):
if amount > balance[0]:
return 'Insufficient funds'
balance[0] = balance[0] - amount
return balance[0]
def deposit(amount):
balance[0] = balance[0] + amount
return balance[0]
return withdraw, deposit
| 32.111111 | 130 | 0.674048 | 189 | 1,445 | 5.142857 | 0.365079 | 0.057613 | 0.058642 | 0.045267 | 0.255144 | 0.255144 | 0.207819 | 0.207819 | 0.133745 | 0.133745 | 0 | 0.009372 | 0.261592 | 1,445 | 44 | 131 | 32.840909 | 0.901593 | 0.476125 | 0 | 0.695652 | 0 | 0 | 0.049113 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0 | 0 | 0.608696 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cfae276e00c535030e057c9ddc74b0073c1f988e | 1,470 | py | Python | brain/src/model/firmware_error.py | siddharthkundu/raspberry-pi-os-image-builder | ffbb008668340e602722f98227048ed3e5243386 | [
"Apache-2.0"
] | null | null | null | brain/src/model/firmware_error.py | siddharthkundu/raspberry-pi-os-image-builder | ffbb008668340e602722f98227048ed3e5243386 | [
"Apache-2.0"
] | null | null | null | brain/src/model/firmware_error.py | siddharthkundu/raspberry-pi-os-image-builder | ffbb008668340e602722f98227048ed3e5243386 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from enum import unique, IntEnum
import json
@unique
class ErrorType(IntEnum):
WARNING = 5
ERROR = 6
OK = 4
class FirmwareError:
def __init__(self, number: int, task: str, description: str) -> None:
self.number = number
self.task = task
self.description = description
self.error_type = ErrorType(int(str(self.number)[0]))
def __eq__(self, other) -> bool:
"""Overrides the default implementation"""
if isinstance(other, FirmwareError):
return self.number == other.number and self.task == other.task and self.description == other.description
return NotImplemented
def __ne__(self, other) -> bool:
"""Overrides the default implementation (unnecessary in Python 3)"""
x = self.__eq__(other)
if x is not NotImplemented:
return not x
return NotImplemented
def __hash__(self) -> str:
"""Overrides the default implementation"""
return hash(tuple(sorted(self.__dict__.items())))
def __str__(self) -> str:
return f'(number: {self.number}, task: {self.task}, description: {self.description}'
def toJson(self) -> str:
return json.dumps(self, default=lambda o: o.__dict__)
@staticmethod
def fromJson(json_str: str) -> FirmwareError:
return json.loads(json_str, object_hook=lambda d: FirmwareError(d['number'], d['task'], d['description']))
| 30.625 | 116 | 0.647619 | 174 | 1,470 | 5.241379 | 0.367816 | 0.054825 | 0.0625 | 0.108553 | 0.100877 | 0.100877 | 0.100877 | 0 | 0 | 0 | 0 | 0.004464 | 0.238095 | 1,470 | 47 | 117 | 31.276596 | 0.809821 | 0.092517 | 0 | 0.0625 | 0 | 0.03125 | 0.072079 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.21875 | false | 0 | 0.09375 | 0.09375 | 0.71875 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cfb3732057211f535d8019c8ff6d43bb2848aa9e | 325 | py | Python | Gold_Badges/Ayuba_Badge/backend/frontend/tests.py | MoonX-Hub/Voting | e7d3672405a8752a7d8ea15bfde8201c943d7685 | [
"Apache-2.0"
] | 5 | 2021-09-15T08:03:05.000Z | 2022-03-31T22:12:35.000Z | Gold_Badges/Ayuba_Badge/backend/frontend/tests.py | MoonX-Hub/Voting | e7d3672405a8752a7d8ea15bfde8201c943d7685 | [
"Apache-2.0"
] | null | null | null | Gold_Badges/Ayuba_Badge/backend/frontend/tests.py | MoonX-Hub/Voting | e7d3672405a8752a7d8ea15bfde8201c943d7685 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:30:38.000Z | 2021-12-26T17:45:13.000Z | #from django.test import TestCase
# Create your tests here.
from algosdk import account,mnemonic
def generateAccount():
private_key, public_key = account.generate_account()
print('addr:',public_key)
print('mnemonic:',mnemonic.from_private_key(private_key))
return private_key,public_key
generateAccount() | 23.214286 | 61 | 0.769231 | 41 | 325 | 5.878049 | 0.512195 | 0.165975 | 0.13278 | 0.157676 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135385 | 325 | 14 | 62 | 23.214286 | 0.857651 | 0.172308 | 0 | 0 | 1 | 0 | 0.052239 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | true | 0 | 0.142857 | 0 | 0.428571 | 0.285714 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
cfbba94515cd85c42f66f489666d043f63087f36 | 404 | py | Python | parens/plistd.py | NoraCodes/pyparens | 3f0579bfd947d9f689ee51b706109b4a3d4b21a9 | [
"MIT"
] | 2 | 2021-01-08T17:13:30.000Z | 2021-11-17T11:39:24.000Z | parens/plistd.py | NoraCodes/pyparens | 3f0579bfd947d9f689ee51b706109b4a3d4b21a9 | [
"MIT"
] | null | null | null | parens/plistd.py | NoraCodes/pyparens | 3f0579bfd947d9f689ee51b706109b4a3d4b21a9 | [
"MIT"
] | null | null | null | # plistd.py
# Python LIsp STanDard library
def makelist(*args):
" Create a list from arguments. "
return list(args)
def quote(*args):
return ['"{}"'.format(a) if isinstance(a, str) else a for a in args]
def cond(test, then, else_=False, *, env):
from .eval import eval
return eval(then if test else else_, env)
def assign(name, val, *, env):
env[name] = val
return val
| 19.238095 | 72 | 0.638614 | 62 | 404 | 4.129032 | 0.532258 | 0.054688 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.230198 | 404 | 20 | 73 | 20.2 | 0.823151 | 0.173267 | 0 | 0 | 0 | 0 | 0.096419 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0 | 0.090909 | 0.090909 | 0.818182 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
cfcc0c173cc04cd06fb9541afc5a52fc6abd7401 | 636 | py | Python | generate_password/random_sample.py | XinyueZ/some-python-codes | 2d7296a4deebb0cd086be34ad7d66f5042cdf6e6 | [
"Unlicense"
] | null | null | null | generate_password/random_sample.py | XinyueZ/some-python-codes | 2d7296a4deebb0cd086be34ad7d66f5042cdf6e6 | [
"Unlicense"
] | null | null | null | generate_password/random_sample.py | XinyueZ/some-python-codes | 2d7296a4deebb0cd086be34ad7d66f5042cdf6e6 | [
"Unlicense"
] | null | null | null | """
This is another sample to generate password.
"""
import random
# Use an import statement at the top
word_file = "words.txt"
word_list = []
#fill up the word_list
with open(word_file,'r') as words:
for line in words:
# remove white space and make everything lowercase
word = line.strip().lower()
# don't include words that are too long or too short
if 3 < len(word) < 8:
word_list.append(word)
def generate_password(): return "".join(random.sample(word_list, 3))
# test your function
print(generate_password())
| 25.44 | 68 | 0.597484 | 85 | 636 | 4.376471 | 0.694118 | 0.086022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006849 | 0.311321 | 636 | 24 | 69 | 26.5 | 0.842466 | 0.345912 | 0 | 0 | 1 | 0 | 0.024752 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0.2 | 0.1 | 0.1 | 0.2 | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
cfcef9df4894b134addf72c709648c18ea2aa5c9 | 628 | py | Python | ramda/ap.py | zydmayday/pamda | 6740d0294f3bedbeeef3bbc3042a43dceb3239b2 | [
"MIT"
] | 1 | 2022-03-14T07:35:13.000Z | 2022-03-14T07:35:13.000Z | ramda/ap.py | zydmayday/pamda | 6740d0294f3bedbeeef3bbc3042a43dceb3239b2 | [
"MIT"
] | 3 | 2022-03-24T02:30:18.000Z | 2022-03-31T07:46:04.000Z | ramda/ap.py | zydmayday/pamda | 6740d0294f3bedbeeef3bbc3042a43dceb3239b2 | [
"MIT"
] | null | null | null | from .map import map
from .private._concat import _concat
from .private._curry2 import _curry2
from .private._helper import getAttribute
from .private._isFunction import _isFunction
from .private._reduce import _reduce
def inner_ap(applyF, applyX):
if _isFunction(getAttribute(applyX, 'fantasy-land/ap')):
return getAttribute(applyX, 'fantasy-land/ap')(applyF)
if _isFunction(getAttribute(applyF, 'ap')):
return getAttribute(applyF, 'ap')(applyX)
if _isFunction(applyF):
return lambda x: applyF(x)(applyX(x))
return _reduce(lambda acc, f: _concat(acc, map(f, applyX)), [], applyF)
ap = _curry2(inner_ap)
| 31.4 | 73 | 0.75 | 83 | 628 | 5.46988 | 0.277108 | 0.121145 | 0.079295 | 0.127753 | 0.136564 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005484 | 0.128981 | 628 | 19 | 74 | 33.052632 | 0.824497 | 0 | 0 | 0 | 0 | 0 | 0.05414 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.4 | 0 | 0.733333 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
cfd103c655e14bd5cf358f126c6fa0c152f8b798 | 1,894 | py | Python | toxaway/views/contract/__init__.py | cmickeyb/toxaway | dbc3391bfafac8464b191e6e5228ab56258f02fb | [
"Apache-2.0"
] | null | null | null | toxaway/views/contract/__init__.py | cmickeyb/toxaway | dbc3391bfafac8464b191e6e5228ab56258f02fb | [
"Apache-2.0"
] | null | null | null | toxaway/views/contract/__init__.py | cmickeyb/toxaway | dbc3391bfafac8464b191e6e5228ab56258f02fb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from toxaway.views.contract.create_app import contract_create_app
from toxaway.views.contract.import_app import contract_import_app
from toxaway.views.contract.invoke_app import contract_invoke_app
from toxaway.views.contract.pick_app import contract_pick_app
from toxaway.views.contract.set_preferences_app import set_preferences_app
from toxaway.views.contract.view_app import contract_view_app
import logging
logger = logging.getLogger(__name__)
__all__ = [ 'register' ]
## ----------------------------------------------------------------
## ----------------------------------------------------------------
def register(app, config) :
logging.info('register contract creation')
app.add_url_rule('/contract/create', None, contract_create_app(config), methods=['GET', 'POST'])
app.add_url_rule('/contract/pick', None, contract_pick_app(config), methods=['GET', 'POST'])
app.add_url_rule('/contract/import', None, contract_import_app(config), methods=['GET', 'POST'])
app.add_url_rule('/contract/view/<contract_id>', None, contract_view_app(config), methods=['GET'])
app.add_url_rule('/contract/invoke/<contract_id>', None, contract_invoke_app(config), methods=['GET', 'POST'])
app.add_url_rule('/contract/preferences/<contract_id>', None, set_preferences_app(config), methods=['GET', 'POST'])
| 51.189189 | 119 | 0.716473 | 257 | 1,894 | 5.070039 | 0.361868 | 0.04835 | 0.073676 | 0.110514 | 0.288565 | 0.135073 | 0.135073 | 0.135073 | 0.135073 | 0.135073 | 0 | 0.002364 | 0.106653 | 1,894 | 36 | 120 | 52.611111 | 0.767731 | 0.354805 | 0 | 0 | 0 | 0 | 0.175104 | 0.077178 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0.470588 | 0 | 0.529412 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
cfd18c0693619d0fdb0cb134fdd955a738fdd3c2 | 346 | py | Python | Exercicios-Python/CursoEmVideo/ex035.py | bruno1906/ExerciciosPython | af657fb8083bc60b80d35d0d9f66495a2f1e3b43 | [
"MIT"
] | null | null | null | Exercicios-Python/CursoEmVideo/ex035.py | bruno1906/ExerciciosPython | af657fb8083bc60b80d35d0d9f66495a2f1e3b43 | [
"MIT"
] | null | null | null | Exercicios-Python/CursoEmVideo/ex035.py | bruno1906/ExerciciosPython | af657fb8083bc60b80d35d0d9f66495a2f1e3b43 | [
"MIT"
] | null | null | null | print('-*-'*20)
print('Analisador de triângulos ')
print('-*-'*20)
r1=float(input('Primeiro segmento:'))
r2=float(input('Segundo segmento:'))
r3=float(input('Terceiro segmento:'))
if r1<r2+r3 and r2<r1+r3 and r3<r1+r2:
print('Os segmentos acima podem formar um triangulo')
else:
print('Os segmentos acima não podem formar um triangulo')
| 28.833333 | 61 | 0.702312 | 53 | 346 | 4.584906 | 0.471698 | 0.123457 | 0.131687 | 0.17284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052805 | 0.124277 | 346 | 11 | 62 | 31.454545 | 0.749175 | 0 | 0 | 0.2 | 0 | 0 | 0.510145 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
cfe5d3050fdcafb0b2e8679258684898732aba8c | 528 | py | Python | code_reviews/palabras_largas/palabras_largas_refactored.py | proto-tools-docs/Soluciones | 7a619e00572a3496cb08a90702f152f52c6d5e56 | [
"MIT"
] | null | null | null | code_reviews/palabras_largas/palabras_largas_refactored.py | proto-tools-docs/Soluciones | 7a619e00572a3496cb08a90702f152f52c6d5e56 | [
"MIT"
] | null | null | null | code_reviews/palabras_largas/palabras_largas_refactored.py | proto-tools-docs/Soluciones | 7a619e00572a3496cb08a90702f152f52c6d5e56 | [
"MIT"
] | null | null | null | """AyudaEnPython: https://www.facebook.com/groups/ayudapython
Solución completa en:
https://github.com/AyudaEnPython/Soluciones/blob/main/ejercicios/palabras_largas.py
"""
from prototools.entradas import entrada_int
def solver(s: str, n: int) -> bool:
return any(len(e) >= n for e in s.split())
def main():
s = input("Ingresar cadena: ")
n = entrada_int("k: ", min=1) # pip install prototools
print("Hay palabras largas" if solver(s, n) else "No hay palabras largas")
if __name__ == "__main__":
main() | 26.4 | 83 | 0.693182 | 76 | 528 | 4.671053 | 0.671053 | 0.11831 | 0.095775 | 0.107042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002252 | 0.159091 | 528 | 20 | 84 | 26.4 | 0.797297 | 0.357955 | 0 | 0 | 0 | 0 | 0.207207 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0.111111 | 0.444444 | 0.111111 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
32192f629351c3c68beb0f689c9a0a85ec1e8711 | 337 | py | Python | jrdb/models/managers.py | hankehly/JRDB | ad470e867d204ea975f7b98b57881d72fcfb41c7 | [
"MIT"
] | 1 | 2022-02-19T14:44:34.000Z | 2022-02-19T14:44:34.000Z | jrdb/models/managers.py | hankehly/JRDB | ad470e867d204ea975f7b98b57881d72fcfb41c7 | [
"MIT"
] | null | null | null | jrdb/models/managers.py | hankehly/JRDB | ad470e867d204ea975f7b98b57881d72fcfb41c7 | [
"MIT"
] | 1 | 2022-02-19T14:46:40.000Z | 2022-02-19T14:46:40.000Z | import pandas as pd
from django.db import models
from django.db.models.query import ModelIterable
class DataFrameQuerySet(models.QuerySet):
def to_dataframe(self):
records = (
self.values() if issubclass(self._iterable_class, ModelIterable) else self
)
return pd.DataFrame.from_records(records)
| 28.083333 | 86 | 0.718101 | 41 | 337 | 5.804878 | 0.585366 | 0.084034 | 0.10084 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207715 | 337 | 11 | 87 | 30.636364 | 0.891386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
5c5b855dafbecfa12d8f6ff9bfebe6eb2b90cd1b | 710 | py | Python | PublisherAzureTestsResults/variables.py | ismailktami/robotframework-azuretestplans-results | 261f936a24121a90cf0a778a61b31bb01f490d41 | [
"MIT"
] | 1 | 2022-03-18T13:30:34.000Z | 2022-03-18T13:30:34.000Z | PublisherAzureTestsResults/variables.py | ismailktami/robotframework-azuretestplans-results | 261f936a24121a90cf0a778a61b31bb01f490d41 | [
"MIT"
] | null | null | null | PublisherAzureTestsResults/variables.py | ismailktami/robotframework-azuretestplans-results | 261f936a24121a90cf0a778a61b31bb01f490d41 | [
"MIT"
] | null | null | null | from robot.libraries.BuiltIn import BuiltIn
import json
class VariablesBuiltIn:
@staticmethod
def getVariables():
USERNAME = BuiltIn().get_variable_value("${USERNAME}") or "USERNAME"
ENVIRONNEMENT = BuiltIn().get_variable_value("${ENVIRONNEMENT}") or "ENVIRONNEMENT"
JOB_ID = BuiltIn().get_variable_value("${JOB_ID}") or ""
JOB_URL = BuiltIn().get_variable_value("${JOB_URL}") or ""
JOB_NAME = BuiltIn().get_variable_value("${JOB_NAME}") or ""
OUTPUT_DIR = BuiltIn().get_variable_value("${OUTPUT_DIR}")
return {"output_dir":OUTPUT_DIR,"username":USERNAME,"job_id":JOB_ID,"job_url":JOB_URL,"job_name":JOB_NAME,"environnement":ENVIRONNEMENT}
| 47.333333 | 144 | 0.691549 | 85 | 710 | 5.447059 | 0.282353 | 0.12959 | 0.233261 | 0.298056 | 0.168467 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156338 | 710 | 14 | 145 | 50.714286 | 0.772955 | 0 | 0 | 0 | 0 | 0 | 0.201408 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | false | 0 | 0.166667 | 0 | 0.416667 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5c6c0888dbb7c41a10165e561af163c693fbb054 | 1,014 | py | Python | Utility/Torch/Models/Supertransformer/StorageTools.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | Utility/Torch/Models/Supertransformer/StorageTools.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | Utility/Torch/Models/Supertransformer/StorageTools.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | """
Storing tensors such that torchscript can work with them can be
quite a pain. This set of tools makes it a lot easier. Tensors
are stored by placing them in the initialization region, and become
something that can then be accessed by looking at
.stored
"""
from __future__ import annotations
from typing import List, Optional, Union, Tuple, Dict
import torch
from torch import nn
from Utility.Torch.Models.Supertransformer import StreamTools
from Utility.Torch.Models.Supertransformer.StreamTools import StreamTensor
class TensorStorageItem(nn.Module):
def __init__(self, tensor: torch.Tensor, requires_grad=False):
super().__init__()
self.item = nn.Parameter(tensor, requires_grad=requires_grad)
def forward(self):
return self.item
def DictTensorStorage(tensors: Dict[str, torch.Tensor], requires_grad=False):
#Store
storage = nn.ModuleDict()
for name in tensors:
storage[name] = TensorStorageItem(tensors[name], requires_grad)
return storage
| 28.166667 | 77 | 0.75641 | 135 | 1,014 | 5.555556 | 0.555556 | 0.08 | 0.072 | 0.058667 | 0.176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171598 | 1,014 | 35 | 78 | 28.971429 | 0.892857 | 0.254438 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.176471 | false | 0 | 0.352941 | 0.058824 | 0.705882 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
5c7d69cf4bcf2289ab3c3b5c106e109c577910a8 | 1,364 | py | Python | treap/treap_test.py | Monras/Treap | 867465fca019e0ca3745c07235900706e74e1173 | [
"CC-BY-3.0"
] | null | null | null | treap/treap_test.py | Monras/Treap | 867465fca019e0ca3745c07235900706e74e1173 | [
"CC-BY-3.0"
] | null | null | null | treap/treap_test.py | Monras/Treap | 867465fca019e0ca3745c07235900706e74e1173 | [
"CC-BY-3.0"
] | null | null | null | #Test code to treap.py
from treap import *
def test():
"""test code to treap.py"""
treap = Treap()
treap.add("A", 2)
treap.add("B", 123)
treap.add("C", 23)
treap.add("D", "T")
all = treap.get_all()
assert treap.size() == 4
assert treap.search("A") == all[0]
assert treap.get_min() == all[0]
assert treap.get_max() == all[3]
assert treap.size() == 4
assert treap.remove("A") is True
assert treap.size() == 3
assert treap.remove("C") is True
assert treap.size() == 2
assert treap.get_min() == all[1]
assert treap.get_max() == all[3]
assert treap.search("B") == all[1]
assert all[0].key == "A"
assert all[1].key == "B"
assert all[2].key == "C"
assert all[3].key == "D"
assert all[0].value == 2
assert all[1].value == 123
assert all[2].value == 23
assert all[3].value == "T"
assert treap.add("F", 0) is True
all_plus = treap.get_all()
assert treap.get_max() == all_plus[4]
assert treap.size() == 5
assert treap.clear() is True
assert treap.size() == 0
assert treap.get_root() is None
assert treap.add("A", 5) is True
assert treap.get_root() == all[0]
assert treap.size() == 1
assert treap.remove("A") is True
assert treap.size() == 0
assert treap.get_root() is None
if __name__ == '__main__':
test()
| 27.28 | 41 | 0.576979 | 216 | 1,364 | 3.550926 | 0.194444 | 0.344198 | 0.156454 | 0.110821 | 0.504563 | 0.319426 | 0.277705 | 0.277705 | 0.194263 | 0.119948 | 0 | 0.036893 | 0.244868 | 1,364 | 49 | 42 | 27.836735 | 0.707767 | 0.031525 | 0 | 0.232558 | 0 | 0 | 0.019011 | 0 | 0 | 0 | 0 | 0 | 0.744186 | 1 | 0.023256 | false | 0 | 0.023256 | 0 | 0.046512 | 0 | 0 | 0 | 0 | null | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
5c81f37a8aca6a5f42cddb3483e43667ae7ea664 | 289 | py | Python | alembic/versions/e43177bfe90b_nbgrader_schema.py | EvgenyTsydenov/python_course | d3d228b4bf051ad5fb0dff14c2a1fc9656d5ae63 | [
"MIT"
] | 4 | 2022-03-22T14:26:19.000Z | 2022-03-24T05:05:12.000Z | alembic/versions/e43177bfe90b_nbgrader_schema.py | EvgenyTsydenov/python_course | d3d228b4bf051ad5fb0dff14c2a1fc9656d5ae63 | [
"MIT"
] | null | null | null | alembic/versions/e43177bfe90b_nbgrader_schema.py | EvgenyTsydenov/python_course | d3d228b4bf051ad5fb0dff14c2a1fc9656d5ae63 | [
"MIT"
] | null | null | null | """nbgrader_schema
Revision ID: e43177bfe90b
Revises:
Create Date: 2021-09-11 04:07:31.804665+00:00
"""
# revision identifiers, used by Alembic.
revision = 'e43177bfe90b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass
| 13.136364 | 45 | 0.719723 | 39 | 289 | 5.230769 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158996 | 0.17301 | 289 | 21 | 46 | 13.761905 | 0.694561 | 0.477509 | 0 | 0.25 | 0 | 0 | 0.083916 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0 | 0 | 0.25 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 2 |
5cb480c198ba718ab8b76bbb622684e256d89ea8 | 4,582 | py | Python | ooobuild/lo/xml/sax/x_fast_attribute_list.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/xml/sax/x_fast_attribute_list.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/xml/sax/x_fast_attribute_list.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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.
#
# Interface Class
# this is a auto generated file generated by Cheetah
# Libre Office Version: 7.3
# Namespace: com.sun.star.xml.sax
import typing
from abc import abstractmethod
from ...uno.x_interface import XInterface as XInterface_8f010a43
if typing.TYPE_CHECKING:
from ..attribute import Attribute as Attribute_85880a0d
from ..fast_attribute import FastAttribute as FastAttribute_b07f0b9b
class XFastAttributeList(XInterface_8f010a43):
"""
a container for the attributes of an XML element.
Attributes are separated into known attributes and unknown attributes.
Known attributes have a local name that is known to the XFastTokenHandler registered at the XFastParser which created the sax event containing this attributes. If an attribute also has a namespace, that must be registered at the XFastParser, else this attribute is also unknown even if the local name is known.
See Also:
`API XFastAttributeList <https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1xml_1_1sax_1_1XFastAttributeList.html>`_
"""
__ooo_ns__: str = 'com.sun.star.xml.sax'
__ooo_full_ns__: str = 'com.sun.star.xml.sax.XFastAttributeList'
__ooo_type_name__: str = 'interface'
__pyunointerface__: str = 'com.sun.star.xml.sax.XFastAttributeList'
@abstractmethod
def getFastAttributes(self) -> 'typing.Tuple[FastAttribute_b07f0b9b, ...]':
"""
returns a sequence of attributes which names and or namespaces URLS are translated to tokens.
"""
@abstractmethod
def getOptionalValue(self, Token: int) -> str:
"""
retrieves the value of an attribute.
If the attribute name has a namespace that was registered with the XFastParser, Token contains the integer token of the attributes local name from the XFastTokenHandler and the integer token of the namespace combined with an arithmetic or operation.
"""
@abstractmethod
def getOptionalValueToken(self, Token: int, Default: int) -> int:
"""
retrieves the token of an attribute value.
If the attribute name has a namespace that was registered with the XFastParser, Token contains the integer token of the attributes local name from the XFastTokenHandler and the integer token of the namespace combined with an arithmetic or operation.
"""
@abstractmethod
def getUnknownAttributes(self) -> 'typing.Tuple[Attribute_85880a0d, ...]':
"""
returns a sequence of attributes which names and or namespaces URLS can not be translated to tokens.
"""
@abstractmethod
def getValue(self, Token: int) -> str:
"""
retrieves the value of an attribute.
If the attribute name has a namespace that was registered with the XFastParser, Token contains the integer token of the attributes local name from the XFastTokenHandler and the integer token of the namespace combined with an arithmetic or operation.
Raises:
SAXException: ``SAXException``
"""
@abstractmethod
def getValueToken(self, Token: int) -> int:
"""
retrieves the token of an attribute value.
If the attribute name has a namespace that was registered with the XFastParser, Token contains the integer token of the attributes local name from the XFastTokenHandler and the integer token of the namespace combined with an arithmetic or operation.
Raises:
SAXException: ``SAXException``
"""
@abstractmethod
def hasAttribute(self, Token: int) -> bool:
"""
checks if an attribute is available.
If the attribute name has a namespace that was registered with the XFastParser, Token contains the integer token of the attributes local name from the XFastTokenHandler and the integer token of the namespace combined with an arithmetic or operation.
"""
__all__ = ['XFastAttributeList']
| 46.755102 | 314 | 0.721955 | 598 | 4,582 | 5.456522 | 0.301003 | 0.025743 | 0.04597 | 0.052099 | 0.503218 | 0.476862 | 0.476862 | 0.447135 | 0.447135 | 0.447135 | 0 | 0.014796 | 0.218245 | 4,582 | 97 | 315 | 47.237113 | 0.896147 | 0.659974 | 0 | 0.269231 | 0 | 0 | 0.165714 | 0.119184 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0 | 0.192308 | 0 | 0.653846 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
5cd51578386d122ba218a5538c2d40af15721e00 | 1,612 | py | Python | tests/integration/test_termination.py | jobvs/cf-mendix-buildpack | 7df5585b5ac8550fd36d21c9d354d74489ff78c0 | [
"Apache-2.0"
] | 1 | 2022-01-31T09:56:06.000Z | 2022-01-31T09:56:06.000Z | tests/integration/test_termination.py | jobvs/cf-mendix-buildpack | 7df5585b5ac8550fd36d21c9d354d74489ff78c0 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_termination.py | jobvs/cf-mendix-buildpack | 7df5585b5ac8550fd36d21c9d354d74489ff78c0 | [
"Apache-2.0"
] | 5 | 2018-12-17T09:45:17.000Z | 2020-11-17T22:08:10.000Z | from tests.integration import basetest
class TestCaseTermination(basetest.BaseTest):
# Tests that the process terminates with a stack trace when Python code
# errors. The env variable S3_ENCRYPTION_KEYS is used here, it doesn't
# have a try-except on it.
# TODO determine if we can unit test this / should test this
def test_termination_stacktrace(self):
self.stage_container(
"Mendix8.1.1.58432_StarterApp.mda",
env_vars={"S3_ENCRYPTION_KEYS": "{invalid-json}"},
)
with self.assertRaises(RuntimeError):
self.start_container()
self.assert_string_in_recent_logs(
'json.loads(os.getenv("S3_ENCRYPTION_KEYS"))'
)
def test_termination_broken_application(self):
self.stage_container(
"Sample-StartError-7.23.2.mda",
env_vars={
"DEPLOY_PASSWORD": self._mx_password,
"METRICS_INTERVAL": "10",
},
)
self.start_container(status="unhealthy")
self.assert_string_in_recent_logs("start failed, stopping")
self.assert_string_not_in_recent_logs("health check never passed")
def test_java_crash_triggers_unhealthy(self):
self.stage_container(
"sample-6.2.0.mda",
env_vars={
"DEPLOY_PASSWORD": self._mx_password,
"METRICS_INTERVAL": "10",
},
)
self.start_container()
self.assert_app_running()
self.run_on_container("killall java")
assert self.await_container_status("unhealthy", 60)
| 35.043478 | 75 | 0.630273 | 187 | 1,612 | 5.15508 | 0.540107 | 0.041494 | 0.049793 | 0.068465 | 0.296681 | 0.209544 | 0.151452 | 0.151452 | 0.151452 | 0.151452 | 0 | 0.020566 | 0.276055 | 1,612 | 45 | 76 | 35.822222 | 0.805484 | 0.137717 | 0 | 0.314286 | 0 | 0 | 0.212274 | 0.074368 | 0 | 0 | 0 | 0.022222 | 0.171429 | 1 | 0.085714 | false | 0.085714 | 0.028571 | 0 | 0.142857 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
5cd8dfb05582b57c170a1f603910f7bd19608dbe | 419 | py | Python | tests/models/r-net_dynamic_test.py | matthew-z/pytorch_rnet | 670f3796cd01595903ef781ec7eb0e55c020e77b | [
"MIT"
] | 227 | 2017-09-20T08:17:07.000Z | 2022-02-16T23:48:04.000Z | tests/models/r-net_dynamic_test.py | matthew-z/R-Net | 670f3796cd01595903ef781ec7eb0e55c020e77b | [
"MIT"
] | 18 | 2017-10-25T14:42:56.000Z | 2020-04-14T18:50:48.000Z | tests/models/r-net_dynamic_test.py | matthew-z/R-Net | 670f3796cd01595903ef781ec7eb0e55c020e77b | [
"MIT"
] | 59 | 2017-10-02T15:25:27.000Z | 2021-05-28T07:57:39.000Z | from allennlp.common.testing import ModelTestCase
from qa.squad.rnet import RNet
class RNetDynamicTest(ModelTestCase):
def setUp(self):
super().setUp()
self.set_up_model('tests/fixtures/rnet/experiment_dynamic.jsonnet',
'tests/fixtures/data/squad.json')
def test_model_can_train_save_and_load(self):
self.ensure_model_can_train_save_and_load(self.param_file)
| 34.916667 | 75 | 0.72315 | 55 | 419 | 5.218182 | 0.618182 | 0.062718 | 0.090592 | 0.118467 | 0.195122 | 0.195122 | 0.195122 | 0 | 0 | 0 | 0 | 0 | 0.186158 | 419 | 11 | 76 | 38.090909 | 0.841642 | 0 | 0 | 0 | 0 | 0 | 0.181384 | 0.181384 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
7a3bf82ffb41a87ec9399ff8dca826537eac4c4f | 1,039 | py | Python | ecdsa_keygen.py | seandsanders/ecdsa_keygen | 5c7f71a8f403e4f69beeeca3d0df576a89045ee7 | [
"MIT"
] | 1 | 2015-12-17T10:46:37.000Z | 2015-12-17T10:46:37.000Z | ecdsa_keygen.py | seandsanders/ecdsa_keygen | 5c7f71a8f403e4f69beeeca3d0df576a89045ee7 | [
"MIT"
] | null | null | null | ecdsa_keygen.py | seandsanders/ecdsa_keygen | 5c7f71a8f403e4f69beeeca3d0df576a89045ee7 | [
"MIT"
] | null | null | null | import argparse
from binascii import hexlify
from ecdsa import SigningKey, NIST256p
from ecdsa.curves import curves
def generate_ecdsa_keypair(curve):
signing_key = SigningKey.generate(curve=curve)
signing_key.to_string()
verifying_key = signing_key.get_verifying_key()
return signing_key, verifying_key
class ParseCurveAction(argparse.Action):
CURVES_DICT = {curve.name.lower(): curve for curve in curves}
def __call__(self, parser, namespace, values, option_string=None):
value = self.CURVES_DICT[values]
setattr(namespace, self.dest, value)
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'--curve',
choices=ParseCurveAction.CURVES_DICT.keys(),
action=ParseCurveAction,
default=NIST256p,
)
args = parser.parse_args()
private, public = generate_ecdsa_keypair(args.curve)
print "private: %s" % hexlify(private.to_string())
print "public: %s" % hexlify(public.to_string())
if __name__ == '__main__':
main() | 28.081081 | 70 | 0.709336 | 123 | 1,039 | 5.723577 | 0.422764 | 0.056818 | 0.056818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007101 | 0.186718 | 1,039 | 37 | 71 | 28.081081 | 0.826036 | 0 | 0 | 0 | 1 | 0 | 0.034615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.142857 | null | null | 0.071429 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7a5f45847ce76f45725bec3e256fc722d6260c66 | 556 | py | Python | setup.py | Don-Felice/photoraspi | 04b64f65cacde6c7d31acd1b5f337444d1ee7489 | [
"MIT"
] | null | null | null | setup.py | Don-Felice/photoraspi | 04b64f65cacde6c7d31acd1b5f337444d1ee7489 | [
"MIT"
] | null | null | null | setup.py | Don-Felice/photoraspi | 04b64f65cacde6c7d31acd1b5f337444d1ee7489 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='photoraspi',
version='0.1.0',
author='Felix Segerer',
packages=['photoraspi'],
license='LICENSE',
description='Photography tools using the raspberry pi',
entry_points={
'console_scripts': [
'photoraspi = photoraspi.__main__:main',
],
'photoraspi_plugins': [
'shot = photoraspi.plugins.shot:Shot',
'mshot = photoraspi.plugins.multishot:MultiShot',
'lt = photoraspi.plugins.livetime:LiveTime',
],
}
)
| 25.272727 | 61 | 0.595324 | 50 | 556 | 6.48 | 0.64 | 0.209877 | 0.12963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007444 | 0.27518 | 556 | 21 | 62 | 26.47619 | 0.796526 | 0 | 0 | 0.105263 | 0 | 0 | 0.498201 | 0.226619 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.052632 | 0 | 0.052632 | 0 | 0 | 0 | 0 | null | 1 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7a5f59b8105d8c01b6a6b66cefa57d4ad90dde3c | 92,239 | py | Python | psx/_dump_/17/_dump_ida_/set_vars.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 15 | 2018-06-28T01:11:25.000Z | 2021-09-27T15:57:18.000Z | psx/_dump_/17/_dump_ida_/set_vars.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-29T04:08:23.000Z | 2019-10-17T13:57:22.000Z | psx/_dump_/17/_dump_ida_/set_vars.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-28T01:11:34.000Z | 2020-05-23T09:21:48.000Z | del_items(0x80114B24)
SetType(0x80114B24, "int NumOfMonsterListLevels")
del_items(0x800A49E4)
SetType(0x800A49E4, "struct MonstLevel AllLevels[16]")
del_items(0x80114820)
SetType(0x80114820, "unsigned char NumsLEV1M1A[4]")
del_items(0x80114824)
SetType(0x80114824, "unsigned char NumsLEV1M1B[4]")
del_items(0x80114828)
SetType(0x80114828, "unsigned char NumsLEV1M1C[5]")
del_items(0x80114830)
SetType(0x80114830, "unsigned char NumsLEV2M2A[4]")
del_items(0x80114834)
SetType(0x80114834, "unsigned char NumsLEV2M2B[4]")
del_items(0x80114838)
SetType(0x80114838, "unsigned char NumsLEV2M2C[3]")
del_items(0x8011483C)
SetType(0x8011483C, "unsigned char NumsLEV2M2D[4]")
del_items(0x80114840)
SetType(0x80114840, "unsigned char NumsLEV2M2QA[4]")
del_items(0x80114844)
SetType(0x80114844, "unsigned char NumsLEV2M2QB[4]")
del_items(0x80114848)
SetType(0x80114848, "unsigned char NumsLEV3M3A[4]")
del_items(0x8011484C)
SetType(0x8011484C, "unsigned char NumsLEV3M3QA[3]")
del_items(0x80114850)
SetType(0x80114850, "unsigned char NumsLEV3M3B[4]")
del_items(0x80114854)
SetType(0x80114854, "unsigned char NumsLEV3M3C[4]")
del_items(0x80114858)
SetType(0x80114858, "unsigned char NumsLEV4M4A[4]")
del_items(0x8011485C)
SetType(0x8011485C, "unsigned char NumsLEV4M4QA[4]")
del_items(0x80114860)
SetType(0x80114860, "unsigned char NumsLEV4M4B[4]")
del_items(0x80114864)
SetType(0x80114864, "unsigned char NumsLEV4M4QB[5]")
del_items(0x8011486C)
SetType(0x8011486C, "unsigned char NumsLEV4M4C[4]")
del_items(0x80114870)
SetType(0x80114870, "unsigned char NumsLEV4M4QC[5]")
del_items(0x80114878)
SetType(0x80114878, "unsigned char NumsLEV4M4D[4]")
del_items(0x8011487C)
SetType(0x8011487C, "unsigned char NumsLEV5M5A[4]")
del_items(0x80114880)
SetType(0x80114880, "unsigned char NumsLEV5M5B[4]")
del_items(0x80114884)
SetType(0x80114884, "unsigned char NumsLEV5M5C[4]")
del_items(0x80114888)
SetType(0x80114888, "unsigned char NumsLEV5M5D[4]")
del_items(0x8011488C)
SetType(0x8011488C, "unsigned char NumsLEV5M5E[4]")
del_items(0x80114890)
SetType(0x80114890, "unsigned char NumsLEV5M5F[3]")
del_items(0x80114894)
SetType(0x80114894, "unsigned char NumsLEV5M5QA[4]")
del_items(0x80114898)
SetType(0x80114898, "unsigned char NumsLEV6M6A[5]")
del_items(0x801148A0)
SetType(0x801148A0, "unsigned char NumsLEV6M6B[3]")
del_items(0x801148A4)
SetType(0x801148A4, "unsigned char NumsLEV6M6C[4]")
del_items(0x801148A8)
SetType(0x801148A8, "unsigned char NumsLEV6M6D[3]")
del_items(0x801148AC)
SetType(0x801148AC, "unsigned char NumsLEV6M6E[3]")
del_items(0x801148B0)
SetType(0x801148B0, "unsigned char NumsLEV7M7A[4]")
del_items(0x801148B4)
SetType(0x801148B4, "unsigned char NumsLEV7M7B[4]")
del_items(0x801148B8)
SetType(0x801148B8, "unsigned char NumsLEV7M7C[3]")
del_items(0x801148BC)
SetType(0x801148BC, "unsigned char NumsLEV7M7D[2]")
del_items(0x801148C0)
SetType(0x801148C0, "unsigned char NumsLEV7M7E[2]")
del_items(0x801148C4)
SetType(0x801148C4, "unsigned char NumsLEV8M8QA[2]")
del_items(0x801148C8)
SetType(0x801148C8, "unsigned char NumsLEV8M8A[3]")
del_items(0x801148CC)
SetType(0x801148CC, "unsigned char NumsLEV8M8B[4]")
del_items(0x801148D0)
SetType(0x801148D0, "unsigned char NumsLEV8M8C[3]")
del_items(0x801148D4)
SetType(0x801148D4, "unsigned char NumsLEV8M8D[2]")
del_items(0x801148D8)
SetType(0x801148D8, "unsigned char NumsLEV8M8E[2]")
del_items(0x801148DC)
SetType(0x801148DC, "unsigned char NumsLEV9M9A[4]")
del_items(0x801148E0)
SetType(0x801148E0, "unsigned char NumsLEV9M9B[3]")
del_items(0x801148E4)
SetType(0x801148E4, "unsigned char NumsLEV9M9C[2]")
del_items(0x801148E8)
SetType(0x801148E8, "unsigned char NumsLEV9M9D[2]")
del_items(0x801148EC)
SetType(0x801148EC, "unsigned char NumsLEV10M10A[3]")
del_items(0x801148F0)
SetType(0x801148F0, "unsigned char NumsLEV10M10B[2]")
del_items(0x801148F4)
SetType(0x801148F4, "unsigned char NumsLEV10M10C[2]")
del_items(0x801148F8)
SetType(0x801148F8, "unsigned char NumsLEV10M10D[2]")
del_items(0x801148FC)
SetType(0x801148FC, "unsigned char NumsLEV10M10QA[3]")
del_items(0x80114900)
SetType(0x80114900, "unsigned char NumsLEV11M11A[3]")
del_items(0x80114904)
SetType(0x80114904, "unsigned char NumsLEV11M11B[3]")
del_items(0x80114908)
SetType(0x80114908, "unsigned char NumsLEV11M11C[3]")
del_items(0x8011490C)
SetType(0x8011490C, "unsigned char NumsLEV11M11D[3]")
del_items(0x80114910)
SetType(0x80114910, "unsigned char NumsLEV11M11E[2]")
del_items(0x80114914)
SetType(0x80114914, "unsigned char NumsLEV12M12A[3]")
del_items(0x80114918)
SetType(0x80114918, "unsigned char NumsLEV12M12B[3]")
del_items(0x8011491C)
SetType(0x8011491C, "unsigned char NumsLEV12M12C[3]")
del_items(0x80114920)
SetType(0x80114920, "unsigned char NumsLEV12M12D[3]")
del_items(0x80114924)
SetType(0x80114924, "unsigned char NumsLEV13M13A[3]")
del_items(0x80114928)
SetType(0x80114928, "unsigned char NumsLEV13M13B[2]")
del_items(0x8011492C)
SetType(0x8011492C, "unsigned char NumsLEV13M13QB[3]")
del_items(0x80114930)
SetType(0x80114930, "unsigned char NumsLEV13M13C[3]")
del_items(0x80114934)
SetType(0x80114934, "unsigned char NumsLEV13M13D[2]")
del_items(0x80114938)
SetType(0x80114938, "unsigned char NumsLEV14M14A[3]")
del_items(0x8011493C)
SetType(0x8011493C, "unsigned char NumsLEV14M14B[3]")
del_items(0x80114940)
SetType(0x80114940, "unsigned char NumsLEV14M14QB[3]")
del_items(0x80114944)
SetType(0x80114944, "unsigned char NumsLEV14M14C[3]")
del_items(0x80114948)
SetType(0x80114948, "unsigned char NumsLEV14M14D[3]")
del_items(0x8011494C)
SetType(0x8011494C, "unsigned char NumsLEV14M14E[2]")
del_items(0x80114950)
SetType(0x80114950, "unsigned char NumsLEV15M15A[3]")
del_items(0x80114954)
SetType(0x80114954, "unsigned char NumsLEV15M15B[3]")
del_items(0x80114958)
SetType(0x80114958, "unsigned char NumsLEV15M15C[2]")
del_items(0x8011495C)
SetType(0x8011495C, "unsigned char NumsLEV16M16D[2]")
del_items(0x800A4524)
SetType(0x800A4524, "struct MonstList ChoiceListLEV1[3]")
del_items(0x800A4554)
SetType(0x800A4554, "struct MonstList ChoiceListLEV2[6]")
del_items(0x800A45B4)
SetType(0x800A45B4, "struct MonstList ChoiceListLEV3[4]")
del_items(0x800A45F4)
SetType(0x800A45F4, "struct MonstList ChoiceListLEV4[7]")
del_items(0x800A4664)
SetType(0x800A4664, "struct MonstList ChoiceListLEV5[7]")
del_items(0x800A46D4)
SetType(0x800A46D4, "struct MonstList ChoiceListLEV6[5]")
del_items(0x800A4724)
SetType(0x800A4724, "struct MonstList ChoiceListLEV7[5]")
del_items(0x800A4774)
SetType(0x800A4774, "struct MonstList ChoiceListLEV8[6]")
del_items(0x800A47D4)
SetType(0x800A47D4, "struct MonstList ChoiceListLEV9[4]")
del_items(0x800A4814)
SetType(0x800A4814, "struct MonstList ChoiceListLEV10[5]")
del_items(0x800A4864)
SetType(0x800A4864, "struct MonstList ChoiceListLEV11[5]")
del_items(0x800A48B4)
SetType(0x800A48B4, "struct MonstList ChoiceListLEV12[4]")
del_items(0x800A48F4)
SetType(0x800A48F4, "struct MonstList ChoiceListLEV13[5]")
del_items(0x800A4944)
SetType(0x800A4944, "struct MonstList ChoiceListLEV14[6]")
del_items(0x800A49A4)
SetType(0x800A49A4, "struct MonstList ChoiceListLEV15[3]")
del_items(0x800A49D4)
SetType(0x800A49D4, "struct MonstList ChoiceListLEV16[1]")
del_items(0x80116354)
SetType(0x80116354, "struct TASK *GameTaskPtr")
del_items(0x800A4A64)
SetType(0x800A4A64, "struct LOAD_IMAGE_ARGS AllArgs[30]")
del_items(0x80114B34)
SetType(0x80114B34, "int ArgsSoFar")
del_items(0x80114B38)
SetType(0x80114B38, "unsigned long *ThisOt")
del_items(0x80114B3C)
SetType(0x80114B3C, "struct POLY_FT4 *ThisPrimAddr")
del_items(0x80116358)
SetType(0x80116358, "long hndPrimBuffers")
del_items(0x8011635C)
SetType(0x8011635C, "struct PRIM_BUFFER *PrimBuffers")
del_items(0x80116360)
SetType(0x80116360, "unsigned char BufferDepth")
del_items(0x80116361)
SetType(0x80116361, "unsigned char WorkRamId")
del_items(0x80116362)
SetType(0x80116362, "unsigned char ScrNum")
del_items(0x80116364)
SetType(0x80116364, "struct SCREEN_ENV *Screens")
del_items(0x80116368)
SetType(0x80116368, "struct PRIM_BUFFER *PbToClear")
del_items(0x8011636C)
SetType(0x8011636C, "unsigned char BufferNum")
del_items(0x80114B40)
SetType(0x80114B40, "struct POLY_FT4 *AddrToAvoid")
del_items(0x8011636D)
SetType(0x8011636D, "unsigned char LastBuffer")
del_items(0x80116370)
SetType(0x80116370, "struct DISPENV *DispEnvToPut")
del_items(0x80116374)
SetType(0x80116374, "int ThisOtSize")
del_items(0x80114B44)
SetType(0x80114B44, "struct RECT ScrRect")
del_items(0x80116378)
SetType(0x80116378, "int VidWait")
del_items(0x801167C8)
SetType(0x801167C8, "struct SCREEN_ENV screen[2]")
del_items(0x8011637C)
SetType(0x8011637C, "void (*VbFunc)()")
del_items(0x80116380)
SetType(0x80116380, "unsigned long VidTick")
del_items(0x80116384)
SetType(0x80116384, "int VXOff")
del_items(0x80116388)
SetType(0x80116388, "int VYOff")
del_items(0x80114B58)
SetType(0x80114B58, "struct LNK_OPTS *Gaz")
del_items(0x80114B5C)
SetType(0x80114B5C, "int LastFmem")
del_items(0x80114B4C)
SetType(0x80114B4C, "unsigned int GSYS_MemStart")
del_items(0x80114B50)
SetType(0x80114B50, "unsigned int GSYS_MemEnd")
del_items(0x800A4DAC)
SetType(0x800A4DAC, "struct MEM_INIT_INFO PsxMem")
del_items(0x800A4DD4)
SetType(0x800A4DD4, "struct MEM_INIT_INFO PsxFastMem")
del_items(0x80114B54)
SetType(0x80114B54, "int LowestFmem")
del_items(0x80114B6C)
SetType(0x80114B6C, "int FileSYS")
del_items(0x8011638C)
SetType(0x8011638C, "struct FileIO *FileSystem")
del_items(0x80116390)
SetType(0x80116390, "struct FileIO *OverlayFileSystem")
del_items(0x80114B86)
SetType(0x80114B86, "short DavesPad")
del_items(0x80114B88)
SetType(0x80114B88, "short DavesPadDeb")
del_items(0x800A4DFC)
SetType(0x800A4DFC, "char _6FileIO_FileToLoad[50]")
del_items(0x801168A8)
SetType(0x801168A8, "struct POLY_FT4 MyFT4")
del_items(0x800A56A0)
SetType(0x800A56A0, "struct TextDat *AllDats[285]")
del_items(0x80114BD8)
SetType(0x80114BD8, "int TpW")
del_items(0x80114BDC)
SetType(0x80114BDC, "int TpH")
del_items(0x80114BE0)
SetType(0x80114BE0, "int TpXDest")
del_items(0x80114BE4)
SetType(0x80114BE4, "int TpYDest")
del_items(0x80114BE8)
SetType(0x80114BE8, "struct RECT R")
del_items(0x800A5B14)
SetType(0x800A5B14, "struct POLY_GT4 MyGT4")
del_items(0x800A5B48)
SetType(0x800A5B48, "struct POLY_GT3 MyGT3")
del_items(0x800A4E30)
SetType(0x800A4E30, "struct TextDat DatPool[20]")
del_items(0x80114BFC)
SetType(0x80114BFC, "bool ChunkGot")
del_items(0x800A5B70)
SetType(0x800A5B70, "char STREAM_DIR[16]")
del_items(0x800A5B80)
SetType(0x800A5B80, "char STREAM_BIN[16]")
del_items(0x800A5B90)
SetType(0x800A5B90, "unsigned char EAC_DirectoryCache[300]")
del_items(0x80114C10)
SetType(0x80114C10, "unsigned long BL_NoLumpFiles")
del_items(0x80114C14)
SetType(0x80114C14, "unsigned long BL_NoStreamFiles")
del_items(0x80114C18)
SetType(0x80114C18, "struct STRHDR *LFileTab")
del_items(0x80114C1C)
SetType(0x80114C1C, "struct STRHDR *SFileTab")
del_items(0x80114C20)
SetType(0x80114C20, "unsigned char FileLoaded")
del_items(0x80114C50)
SetType(0x80114C50, "int NoTAllocs")
del_items(0x800A5CBC)
SetType(0x800A5CBC, "struct MEMSTRUCT MemBlock[50]")
del_items(0x8011639C)
SetType(0x8011639C, "bool CanPause")
del_items(0x801163A0)
SetType(0x801163A0, "bool Paused")
del_items(0x801163A4)
SetType(0x801163A4, "struct RECT PRect")
del_items(0x801168D0)
SetType(0x801168D0, "struct Dialog PBack")
del_items(0x800A5F24)
SetType(0x800A5F24, "unsigned char RawPadData0[34]")
del_items(0x800A5F48)
SetType(0x800A5F48, "unsigned char RawPadData1[34]")
del_items(0x800A5F6C)
SetType(0x800A5F6C, "unsigned char demo_buffer[1800]")
del_items(0x80114C7C)
SetType(0x80114C7C, "int demo_pad_time")
del_items(0x80114C80)
SetType(0x80114C80, "int demo_pad_count")
del_items(0x800A5E4C)
SetType(0x800A5E4C, "struct CPad Pad0")
del_items(0x800A5EB8)
SetType(0x800A5EB8, "struct CPad Pad1")
del_items(0x80114C84)
SetType(0x80114C84, "unsigned long demo_finish")
del_items(0x80114C88)
SetType(0x80114C88, "int cac_pad")
del_items(0x80114CA4)
SetType(0x80114CA4, "struct POLY_FT4 *CharFt4")
del_items(0x80114CA8)
SetType(0x80114CA8, "int CharFrm")
del_items(0x80114C95)
SetType(0x80114C95, "unsigned char WHITER")
del_items(0x80114C96)
SetType(0x80114C96, "unsigned char WHITEG")
del_items(0x80114C97)
SetType(0x80114C97, "unsigned char WHITEB")
del_items(0x80114C98)
SetType(0x80114C98, "unsigned char BLUER")
del_items(0x80114C99)
SetType(0x80114C99, "unsigned char BLUEG")
del_items(0x80114C9A)
SetType(0x80114C9A, "unsigned char BLUEB")
del_items(0x80114C9B)
SetType(0x80114C9B, "unsigned char REDR")
del_items(0x80114C9C)
SetType(0x80114C9C, "unsigned char REDG")
del_items(0x80114C9D)
SetType(0x80114C9D, "unsigned char REDB")
del_items(0x80114C9E)
SetType(0x80114C9E, "unsigned char GOLDR")
del_items(0x80114C9F)
SetType(0x80114C9F, "unsigned char GOLDG")
del_items(0x80114CA0)
SetType(0x80114CA0, "unsigned char GOLDB")
del_items(0x800A6674)
SetType(0x800A6674, "struct CFont MediumFont")
del_items(0x800A688C)
SetType(0x800A688C, "struct CFont LargeFont")
del_items(0x800A6AA4)
SetType(0x800A6AA4, "struct FontItem LFontTab[90]")
del_items(0x800A6B58)
SetType(0x800A6B58, "struct FontTab LFont")
del_items(0x800A6B68)
SetType(0x800A6B68, "struct FontItem MFontTab[155]")
del_items(0x800A6CA0)
SetType(0x800A6CA0, "struct FontTab MFont")
del_items(0x80114CBD)
SetType(0x80114CBD, "unsigned char DialogRed")
del_items(0x80114CBE)
SetType(0x80114CBE, "unsigned char DialogGreen")
del_items(0x80114CBF)
SetType(0x80114CBF, "unsigned char DialogBlue")
del_items(0x80114CC0)
SetType(0x80114CC0, "unsigned char DialogTRed")
del_items(0x80114CC1)
SetType(0x80114CC1, "unsigned char DialogTGreen")
del_items(0x80114CC2)
SetType(0x80114CC2, "unsigned char DialogTBlue")
del_items(0x80114CC4)
SetType(0x80114CC4, "struct TextDat *DialogTData")
del_items(0x80114CC8)
SetType(0x80114CC8, "int DialogBackGfx")
del_items(0x80114CCC)
SetType(0x80114CCC, "int DialogBackW")
del_items(0x80114CD0)
SetType(0x80114CD0, "int DialogBackH")
del_items(0x80114CD4)
SetType(0x80114CD4, "int DialogBorderGfx")
del_items(0x80114CD8)
SetType(0x80114CD8, "int DialogBorderTLW")
del_items(0x80114CDC)
SetType(0x80114CDC, "int DialogBorderTLH")
del_items(0x80114CE0)
SetType(0x80114CE0, "int DialogBorderTRW")
del_items(0x80114CE4)
SetType(0x80114CE4, "int DialogBorderTRH")
del_items(0x80114CE8)
SetType(0x80114CE8, "int DialogBorderBLW")
del_items(0x80114CEC)
SetType(0x80114CEC, "int DialogBorderBLH")
del_items(0x80114CF0)
SetType(0x80114CF0, "int DialogBorderBRW")
del_items(0x80114CF4)
SetType(0x80114CF4, "int DialogBorderBRH")
del_items(0x80114CF8)
SetType(0x80114CF8, "int DialogBorderTW")
del_items(0x80114CFC)
SetType(0x80114CFC, "int DialogBorderTH")
del_items(0x80114D00)
SetType(0x80114D00, "int DialogBorderBW")
del_items(0x80114D04)
SetType(0x80114D04, "int DialogBorderBH")
del_items(0x80114D08)
SetType(0x80114D08, "int DialogBorderLW")
del_items(0x80114D0C)
SetType(0x80114D0C, "int DialogBorderLH")
del_items(0x80114D10)
SetType(0x80114D10, "int DialogBorderRW")
del_items(0x80114D14)
SetType(0x80114D14, "int DialogBorderRH")
del_items(0x80114D18)
SetType(0x80114D18, "int DialogBevelGfx")
del_items(0x80114D1C)
SetType(0x80114D1C, "int DialogBevelCW")
del_items(0x80114D20)
SetType(0x80114D20, "int DialogBevelCH")
del_items(0x80114D24)
SetType(0x80114D24, "int DialogBevelLRW")
del_items(0x80114D28)
SetType(0x80114D28, "int DialogBevelLRH")
del_items(0x80114D2C)
SetType(0x80114D2C, "int DialogBevelUDW")
del_items(0x80114D30)
SetType(0x80114D30, "int DialogBevelUDH")
del_items(0x80114D34)
SetType(0x80114D34, "int MY_DialogOTpos")
del_items(0x801163AC)
SetType(0x801163AC, "unsigned char DialogGBack")
del_items(0x801163AD)
SetType(0x801163AD, "char GShadeX")
del_items(0x801163AE)
SetType(0x801163AE, "char GShadeY")
del_items(0x801163B4)
SetType(0x801163B4, "unsigned char RandBTab[8]")
del_items(0x800A6CF0)
SetType(0x800A6CF0, "int Cxy[28]")
del_items(0x80114CB7)
SetType(0x80114CB7, "unsigned char BORDERR")
del_items(0x80114CB8)
SetType(0x80114CB8, "unsigned char BORDERG")
del_items(0x80114CB9)
SetType(0x80114CB9, "unsigned char BORDERB")
del_items(0x80114CBA)
SetType(0x80114CBA, "unsigned char BACKR")
del_items(0x80114CBB)
SetType(0x80114CBB, "unsigned char BACKG")
del_items(0x80114CBC)
SetType(0x80114CBC, "unsigned char BACKB")
del_items(0x800A6CB0)
SetType(0x800A6CB0, "char GShadeTab[64]")
del_items(0x80114CB5)
SetType(0x80114CB5, "char GShadePX")
del_items(0x80114CB6)
SetType(0x80114CB6, "char GShadePY")
del_items(0x80114D41)
SetType(0x80114D41, "unsigned char PlayDemoFlag")
del_items(0x801168E0)
SetType(0x801168E0, "struct RGBPOLY rgbb")
del_items(0x80116910)
SetType(0x80116910, "struct RGBPOLY rgbt")
del_items(0x801163BC)
SetType(0x801163BC, "int blockr")
del_items(0x801163C0)
SetType(0x801163C0, "int blockg")
del_items(0x801163C4)
SetType(0x801163C4, "int blockb")
del_items(0x801163C8)
SetType(0x801163C8, "int InfraFlag")
del_items(0x80114D55)
SetType(0x80114D55, "unsigned char P1ObjSelCount")
del_items(0x80114D56)
SetType(0x80114D56, "unsigned char P2ObjSelCount")
del_items(0x80114D57)
SetType(0x80114D57, "unsigned char P12ObjSelCount")
del_items(0x80114D58)
SetType(0x80114D58, "unsigned char P1ItemSelCount")
del_items(0x80114D59)
SetType(0x80114D59, "unsigned char P2ItemSelCount")
del_items(0x80114D5A)
SetType(0x80114D5A, "unsigned char P12ItemSelCount")
del_items(0x80114D5B)
SetType(0x80114D5B, "unsigned char P1MonstSelCount")
del_items(0x80114D5C)
SetType(0x80114D5C, "unsigned char P2MonstSelCount")
del_items(0x80114D5D)
SetType(0x80114D5D, "unsigned char P12MonstSelCount")
del_items(0x80114D5E)
SetType(0x80114D5E, "unsigned short P1ObjSelCol")
del_items(0x80114D60)
SetType(0x80114D60, "unsigned short P2ObjSelCol")
del_items(0x80114D62)
SetType(0x80114D62, "unsigned short P12ObjSelCol")
del_items(0x80114D64)
SetType(0x80114D64, "unsigned short P1ItemSelCol")
del_items(0x80114D66)
SetType(0x80114D66, "unsigned short P2ItemSelCol")
del_items(0x80114D68)
SetType(0x80114D68, "unsigned short P12ItemSelCol")
del_items(0x80114D6A)
SetType(0x80114D6A, "unsigned short P1MonstSelCol")
del_items(0x80114D6C)
SetType(0x80114D6C, "unsigned short P2MonstSelCol")
del_items(0x80114D6E)
SetType(0x80114D6E, "unsigned short P12MonstSelCol")
del_items(0x80114D70)
SetType(0x80114D70, "struct CBlocks *CurrentBlocks")
del_items(0x8010A718)
SetType(0x8010A718, "short SinTab[32]")
del_items(0x800A6D60)
SetType(0x800A6D60, "struct TownToCreature TownConv[10]")
del_items(0x80114D8C)
SetType(0x80114D8C, "enum OVER_TYPE CurrentOverlay")
del_items(0x8010A7A4)
SetType(0x8010A7A4, "unsigned long HaltTab[3]")
del_items(0x80116940)
SetType(0x80116940, "struct Overlay FrontEndOver")
del_items(0x80116950)
SetType(0x80116950, "struct Overlay PregameOver")
del_items(0x80116960)
SetType(0x80116960, "struct Overlay GameOver")
del_items(0x80116970)
SetType(0x80116970, "struct Overlay FmvOver")
del_items(0x801163CC)
SetType(0x801163CC, "int OWorldX")
del_items(0x801163D0)
SetType(0x801163D0, "int OWorldY")
del_items(0x801163D4)
SetType(0x801163D4, "int WWorldX")
del_items(0x801163D8)
SetType(0x801163D8, "int WWorldY")
del_items(0x8010A820)
SetType(0x8010A820, "short TxyAdd[16]")
del_items(0x80114DB0)
SetType(0x80114DB0, "int GXAdj2")
del_items(0x801163DC)
SetType(0x801163DC, "int TimePerFrame")
del_items(0x801163E0)
SetType(0x801163E0, "int CpuStart")
del_items(0x801163E4)
SetType(0x801163E4, "int CpuTime")
del_items(0x801163E8)
SetType(0x801163E8, "int DrawTime")
del_items(0x801163EC)
SetType(0x801163EC, "int DrawStart")
del_items(0x801163F0)
SetType(0x801163F0, "int LastCpuTime")
del_items(0x801163F4)
SetType(0x801163F4, "int LastDrawTime")
del_items(0x801163F8)
SetType(0x801163F8, "int DrawArea")
del_items(0x80114DB8)
SetType(0x80114DB8, "bool ProfOn")
del_items(0x800A6D74)
SetType(0x800A6D74, "unsigned char LevPals[17]")
del_items(0x8010A97C)
SetType(0x8010A97C, "unsigned short Level2Bgdata[25]")
del_items(0x800A6D88)
SetType(0x800A6D88, "struct PanelXY DefP1PanelXY")
del_items(0x800A6DDC)
SetType(0x800A6DDC, "struct PanelXY DefP1PanelXY2")
del_items(0x800A6E30)
SetType(0x800A6E30, "struct PanelXY DefP2PanelXY")
del_items(0x800A6E84)
SetType(0x800A6E84, "struct PanelXY DefP2PanelXY2")
del_items(0x800A6ED8)
SetType(0x800A6ED8, "unsigned int SpeedBarGfxTable[50]")
del_items(0x80114DE0)
SetType(0x80114DE0, "int hof")
del_items(0x80114DE4)
SetType(0x80114DE4, "int mof")
del_items(0x800A6FA0)
SetType(0x800A6FA0, "struct SFXHDR SFXTab[2]")
del_items(0x80114E18)
SetType(0x80114E18, "unsigned long Time")
del_items(0x800A70A0)
SetType(0x800A70A0, "struct SpuVoiceAttr voice_attr")
del_items(0x80114DF4)
SetType(0x80114DF4, "unsigned long *STR_Buffer")
del_items(0x80114DF8)
SetType(0x80114DF8, "char NoActiveStreams")
del_items(0x80114DFC)
SetType(0x80114DFC, "bool STRInit")
del_items(0x80114E3C)
SetType(0x80114E3C, "char SFXNotPlayed")
del_items(0x80114E3D)
SetType(0x80114E3D, "char SFXNotInBank")
del_items(0x80116980)
SetType(0x80116980, "char spu_management[264]")
del_items(0x80116A90)
SetType(0x80116A90, "struct SpuReverbAttr rev_attr")
del_items(0x80116400)
SetType(0x80116400, "unsigned short NoSfx")
del_items(0x80114E28)
SetType(0x80114E28, "struct bank_entry *BankOffsets")
del_items(0x80114E2C)
SetType(0x80114E2C, "long OffsetHandle")
del_items(0x80114E30)
SetType(0x80114E30, "int BankBase")
del_items(0x80114E34)
SetType(0x80114E34, "unsigned char SPU_Done")
del_items(0x8010AD44)
SetType(0x8010AD44, "unsigned short SFXRemapTab[56]")
del_items(0x80114E38)
SetType(0x80114E38, "int NoSNDRemaps")
del_items(0x800A70E0)
SetType(0x800A70E0, "struct PalCollection ThePals")
del_items(0x8010ADE8)
SetType(0x8010ADE8, "struct InitPos InitialPositions[20]")
del_items(0x80114E90)
SetType(0x80114E90, "int demo_level")
del_items(0x80114E94)
SetType(0x80114E94, "struct TASK *DemoTask")
del_items(0x80114E98)
SetType(0x80114E98, "struct TASK *DemoGameTask")
del_items(0x80114E9C)
SetType(0x80114E9C, "struct TASK *tonys")
del_items(0x80114E68)
SetType(0x80114E68, "int demo_load")
del_items(0x80114E6C)
SetType(0x80114E6C, "int demo_record_load")
del_items(0x80114E70)
SetType(0x80114E70, "int level_record")
del_items(0x80114E64)
SetType(0x80114E64, "int moo_moo")
del_items(0x80114E74)
SetType(0x80114E74, "char demolevel[5]")
del_items(0x80114E7C)
SetType(0x80114E7C, "int demo_which")
del_items(0x80114E80)
SetType(0x80114E80, "unsigned char demo_flash")
del_items(0x80114E84)
SetType(0x80114E84, "int tonys_Task")
del_items(0x80114FF8)
SetType(0x80114FF8, "bool DoShowPanel")
del_items(0x80114FFC)
SetType(0x80114FFC, "bool DoDrawBg")
del_items(0x80116404)
SetType(0x80116404, "bool GlueFinished")
del_items(0x80116408)
SetType(0x80116408, "bool DoHomingScroll")
del_items(0x8011640C)
SetType(0x8011640C, "struct TextDat *TownerGfx")
del_items(0x80116410)
SetType(0x80116410, "int CurrentMonsterList")
del_items(0x80114EA9)
SetType(0x80114EA9, "char started_grtask")
del_items(0x800A72CC)
SetType(0x800A72CC, "struct PInf PlayerInfo[81]")
del_items(0x80115000)
SetType(0x80115000, "char ArmourChar[4]")
del_items(0x8010AEDC)
SetType(0x8010AEDC, "char WepChar[10]")
del_items(0x80115004)
SetType(0x80115004, "char CharChar[4]")
del_items(0x80116414)
SetType(0x80116414, "char ctrl_select_line")
del_items(0x80116415)
SetType(0x80116415, "char ctrl_select_side")
del_items(0x80116416)
SetType(0x80116416, "char ckeyheld")
del_items(0x80116418)
SetType(0x80116418, "int old_options_pad")
del_items(0x8011641C)
SetType(0x8011641C, "struct RECT CtrlRect")
del_items(0x80115018)
SetType(0x80115018, "unsigned char ctrlflag")
del_items(0x800A75FC)
SetType(0x800A75FC, "struct KEY_ASSIGNS txt_actions[19]")
del_items(0x800A7554)
SetType(0x800A7554, "struct pad_assigns pad_txt[14]")
del_items(0x80115014)
SetType(0x80115014, "int toppos")
del_items(0x80116AA8)
SetType(0x80116AA8, "struct Dialog CtrlBack")
del_items(0x800A772C)
SetType(0x800A772C, "int controller_defaults[2][19]")
del_items(0x80115084)
SetType(0x80115084, "int gr_scrxoff")
del_items(0x80115088)
SetType(0x80115088, "int gr_scryoff")
del_items(0x80115090)
SetType(0x80115090, "unsigned short water_clut")
del_items(0x80115094)
SetType(0x80115094, "char visible_level")
del_items(0x80115081)
SetType(0x80115081, "char last_type")
del_items(0x80115096)
SetType(0x80115096, "char daylight")
del_items(0x80115092)
SetType(0x80115092, "char cow_in_sight")
del_items(0x80115093)
SetType(0x80115093, "char inn_in_sight")
del_items(0x8011508C)
SetType(0x8011508C, "unsigned int water_count")
del_items(0x80115095)
SetType(0x80115095, "unsigned char lastrnd")
del_items(0x80115098)
SetType(0x80115098, "int call_clock")
del_items(0x801150A8)
SetType(0x801150A8, "int TitleAnimCount")
del_items(0x801150AC)
SetType(0x801150AC, "int flametick")
del_items(0x8010AF9C)
SetType(0x8010AF9C, "unsigned char light_tile[55]")
del_items(0x800A77E4)
SetType(0x800A77E4, "struct SPELLFX_DAT SpellFXDat[2]")
del_items(0x80116AB8)
SetType(0x80116AB8, "struct Particle PartArray[16]")
del_items(0x80116424)
SetType(0x80116424, "int partOtPos")
del_items(0x801150C8)
SetType(0x801150C8, "int SetParticle")
del_items(0x801150CC)
SetType(0x801150CC, "int p1partexecnum")
del_items(0x801150D0)
SetType(0x801150D0, "int p2partexecnum")
del_items(0x800A77C4)
SetType(0x800A77C4, "int JumpArray[8]")
del_items(0x801150D4)
SetType(0x801150D4, "int partjumpflag")
del_items(0x801150D8)
SetType(0x801150D8, "int partglowflag")
del_items(0x801150DC)
SetType(0x801150DC, "int partcolour")
del_items(0x800A7884)
SetType(0x800A7884, "struct Spell_Target SplTarget[2]")
del_items(0x801150FD)
SetType(0x801150FD, "unsigned char select_flag")
del_items(0x80116428)
SetType(0x80116428, "struct RECT SelectRect")
del_items(0x80116430)
SetType(0x80116430, "char item_select")
del_items(0x80115100)
SetType(0x80115100, "char QSpell[2]")
del_items(0x80115104)
SetType(0x80115104, "char _spltotype[2]")
del_items(0x801150F0)
SetType(0x801150F0, "struct CPlayer *gplayer")
del_items(0x80116CF8)
SetType(0x80116CF8, "struct Dialog SelectBack")
del_items(0x801150F4)
SetType(0x801150F4, "char mana_order[4]")
del_items(0x801150F8)
SetType(0x801150F8, "char health_order[4]")
del_items(0x801150FC)
SetType(0x801150FC, "unsigned char birdcheck")
del_items(0x80116D08)
SetType(0x80116D08, "struct TextDat *DecRequestors[10]")
del_items(0x80116434)
SetType(0x80116434, "unsigned short progress")
del_items(0x8010B098)
SetType(0x8010B098, "unsigned short Level2CutScreen[20]")
del_items(0x80115120)
SetType(0x80115120, "char *CutString")
del_items(0x80116D30)
SetType(0x80116D30, "struct CScreen Scr")
del_items(0x80115124)
SetType(0x80115124, "struct TASK *CutScreenTSK")
del_items(0x80115128)
SetType(0x80115128, "bool GameLoading")
del_items(0x80116DB0)
SetType(0x80116DB0, "struct Dialog LBack")
del_items(0x80115138)
SetType(0x80115138, "unsigned int card_ev0")
del_items(0x8011513C)
SetType(0x8011513C, "unsigned int card_ev1")
del_items(0x80115140)
SetType(0x80115140, "unsigned int card_ev2")
del_items(0x80115144)
SetType(0x80115144, "unsigned int card_ev3")
del_items(0x80115148)
SetType(0x80115148, "unsigned int card_ev10")
del_items(0x8011514C)
SetType(0x8011514C, "unsigned int card_ev11")
del_items(0x80115150)
SetType(0x80115150, "unsigned int card_ev12")
del_items(0x80115154)
SetType(0x80115154, "unsigned int card_ev13")
del_items(0x80115158)
SetType(0x80115158, "int card_dirty[2]")
del_items(0x80115160)
SetType(0x80115160, "struct TASK *MemcardTask")
del_items(0x80116438)
SetType(0x80116438, "int card_event")
del_items(0x80115134)
SetType(0x80115134, "void (*mem_card_event_handler)()")
del_items(0x8011512C)
SetType(0x8011512C, "bool MemCardActive")
del_items(0x80115130)
SetType(0x80115130, "int never_hooked_events")
del_items(0x801151A4)
SetType(0x801151A4, "unsigned long MasterVol")
del_items(0x801151A8)
SetType(0x801151A8, "unsigned long MusicVol")
del_items(0x801151AC)
SetType(0x801151AC, "unsigned long SoundVol")
del_items(0x801151B0)
SetType(0x801151B0, "unsigned long VideoVol")
del_items(0x801151B4)
SetType(0x801151B4, "unsigned long SpeechVol")
del_items(0x8011643C)
SetType(0x8011643C, "struct TextDat *Slider")
del_items(0x80116440)
SetType(0x80116440, "int sw")
del_items(0x80116444)
SetType(0x80116444, "int sx")
del_items(0x80116448)
SetType(0x80116448, "int sy")
del_items(0x8011644C)
SetType(0x8011644C, "unsigned char Adjust")
del_items(0x8011644D)
SetType(0x8011644D, "unsigned char qspin")
del_items(0x8011644E)
SetType(0x8011644E, "unsigned char lqspin")
del_items(0x80116450)
SetType(0x80116450, "enum LANG_TYPE OrigLang")
del_items(0x80116454)
SetType(0x80116454, "enum LANG_TYPE OldLang")
del_items(0x80116458)
SetType(0x80116458, "enum LANG_TYPE NewLang")
del_items(0x801151B8)
SetType(0x801151B8, "int ReturnMenu")
del_items(0x8011645C)
SetType(0x8011645C, "struct RECT ORect")
del_items(0x80116464)
SetType(0x80116464, "char *McState[2]")
del_items(0x80115188)
SetType(0x80115188, "bool optionsflag")
del_items(0x8011517C)
SetType(0x8011517C, "int cmenu")
del_items(0x80115190)
SetType(0x80115190, "int options_pad")
del_items(0x8011519C)
SetType(0x8011519C, "char *PrevTxt")
del_items(0x80115184)
SetType(0x80115184, "bool allspellsflag")
del_items(0x800A80EC)
SetType(0x800A80EC, "short Circle[64]")
del_items(0x80115170)
SetType(0x80115170, "int Spacing")
del_items(0x80115174)
SetType(0x80115174, "int cs")
del_items(0x80115178)
SetType(0x80115178, "int lastcs")
del_items(0x80115180)
SetType(0x80115180, "bool MemcardOverlay")
del_items(0x8011518C)
SetType(0x8011518C, "int saveflag")
del_items(0x800A78CC)
SetType(0x800A78CC, "struct OMENUITEM MainMenu[7]")
del_items(0x800A7974)
SetType(0x800A7974, "struct OMENUITEM GameMenu[9]")
del_items(0x800A7A4C)
SetType(0x800A7A4C, "struct OMENUITEM SoundMenu[6]")
del_items(0x800A7ADC)
SetType(0x800A7ADC, "struct OMENUITEM CentreMenu[7]")
del_items(0x800A7B84)
SetType(0x800A7B84, "struct OMENUITEM LangMenu[7]")
del_items(0x800A7C2C)
SetType(0x800A7C2C, "struct OMENUITEM MemcardMenu[4]")
del_items(0x800A7C8C)
SetType(0x800A7C8C, "struct OMENUITEM MemcardGameMenu[6]")
del_items(0x800A7D1C)
SetType(0x800A7D1C, "struct OMENUITEM MemcardCharacterMenu[4]")
del_items(0x800A7D7C)
SetType(0x800A7D7C, "struct OMENUITEM MemcardSelectCard1[7]")
del_items(0x800A7E24)
SetType(0x800A7E24, "struct OMENUITEM MemcardSelectCard2[7]")
del_items(0x800A7ECC)
SetType(0x800A7ECC, "struct OMENUITEM MemcardFormatMenu[4]")
del_items(0x800A7F2C)
SetType(0x800A7F2C, "struct OMENUITEM CheatMenu[9]")
del_items(0x800A8004)
SetType(0x800A8004, "struct OMENUITEM InfoMenu[2]")
del_items(0x800A8034)
SetType(0x800A8034, "struct OMENUITEM MonstViewMenu[3]")
del_items(0x800A807C)
SetType(0x800A807C, "struct OMENULIST MenuList[14]")
del_items(0x801151A0)
SetType(0x801151A0, "bool debounce")
del_items(0x800A816C)
SetType(0x800A816C, "struct BIRDSTRUCT BirdList[16]")
del_items(0x801151C5)
SetType(0x801151C5, "char hop_height")
del_items(0x801151C8)
SetType(0x801151C8, "struct Perch perches[4]")
del_items(0x800A82EC)
SetType(0x800A82EC, "char *FmvTab[4]")
del_items(0x801151DC)
SetType(0x801151DC, "int CurMons")
del_items(0x801151E0)
SetType(0x801151E0, "int Frame")
del_items(0x801151E4)
SetType(0x801151E4, "int Action")
del_items(0x801151E8)
SetType(0x801151E8, "int Dir")
del_items(0x8011525C)
SetType(0x8011525C, "int FeBackX")
del_items(0x80115260)
SetType(0x80115260, "int FeBackY")
del_items(0x80115264)
SetType(0x80115264, "int FeBackW")
del_items(0x80115268)
SetType(0x80115268, "int FeBackH")
del_items(0x8011526C)
SetType(0x8011526C, "unsigned char FeFlag")
del_items(0x800A8A9C)
SetType(0x800A8A9C, "struct FeStruct FeBuffer[40]")
del_items(0x80115270)
SetType(0x80115270, "int FePlayerNo")
del_items(0x8011646C)
SetType(0x8011646C, "struct FE_CREATE *CStruct")
del_items(0x80115274)
SetType(0x80115274, "int FeBufferCount")
del_items(0x80115278)
SetType(0x80115278, "int FeNoOfPlayers")
del_items(0x8011527C)
SetType(0x8011527C, "int FeChrClass[2]")
del_items(0x800A8E5C)
SetType(0x800A8E5C, "char FePlayerName[11][2]")
del_items(0x80115284)
SetType(0x80115284, "struct FeTable *FeCurMenu")
del_items(0x80115288)
SetType(0x80115288, "unsigned char FePlayerNameFlag[2]")
del_items(0x8011528C)
SetType(0x8011528C, "unsigned long FeCount")
del_items(0x80115290)
SetType(0x80115290, "int fileselect")
del_items(0x80115294)
SetType(0x80115294, "int BookMenu")
del_items(0x80115298)
SetType(0x80115298, "int FeAttractMode")
del_items(0x8011529C)
SetType(0x8011529C, "int FMVPress")
del_items(0x8011522C)
SetType(0x8011522C, "struct TextDat *FeTData")
del_items(0x80115234)
SetType(0x80115234, "bool LoadedChar[2]")
del_items(0x80115230)
SetType(0x80115230, "struct TextDat *FlameTData")
del_items(0x8011523C)
SetType(0x8011523C, "unsigned char FeIsAVirgin")
del_items(0x80115240)
SetType(0x80115240, "int FeMenuDelay")
del_items(0x800A82FC)
SetType(0x800A82FC, "struct FeTable DummyMenu")
del_items(0x800A8318)
SetType(0x800A8318, "struct FeTable FeMainMenu")
del_items(0x800A8334)
SetType(0x800A8334, "struct FeTable FeNewGameMenu")
del_items(0x800A8350)
SetType(0x800A8350, "struct FeTable FeNewP1ClassMenu")
del_items(0x800A836C)
SetType(0x800A836C, "struct FeTable FeNewP1NameMenu")
del_items(0x800A8388)
SetType(0x800A8388, "struct FeTable FeNewP2ClassMenu")
del_items(0x800A83A4)
SetType(0x800A83A4, "struct FeTable FeNewP2NameMenu")
del_items(0x800A83C0)
SetType(0x800A83C0, "struct FeTable FeDifficultyMenu")
del_items(0x800A83DC)
SetType(0x800A83DC, "struct FeTable FeBackgroundMenu")
del_items(0x800A83F8)
SetType(0x800A83F8, "struct FeTable FeBook1Menu")
del_items(0x800A8414)
SetType(0x800A8414, "struct FeTable FeBook2Menu")
del_items(0x800A8430)
SetType(0x800A8430, "struct FeTable FeLoadCharMenu")
del_items(0x800A844C)
SetType(0x800A844C, "struct FeTable FeLoadChar1Menu")
del_items(0x800A8468)
SetType(0x800A8468, "struct FeTable FeLoadChar2Menu")
del_items(0x80115244)
SetType(0x80115244, "int fadeval")
del_items(0x800A8484)
SetType(0x800A8484, "struct FeMenuTable FeMainMenuTable[5]")
del_items(0x800A84FC)
SetType(0x800A84FC, "struct FeMenuTable FeNewGameMenuTable[3]")
del_items(0x800A8544)
SetType(0x800A8544, "struct FeMenuTable FePlayerClassMenuTable[5]")
del_items(0x800A85BC)
SetType(0x800A85BC, "struct FeMenuTable FeNameEngMenuTable[31]")
del_items(0x800A88A4)
SetType(0x800A88A4, "struct FeMenuTable FeMemcardMenuTable[3]")
del_items(0x800A88EC)
SetType(0x800A88EC, "struct FeMenuTable FeDifficultyMenuTable[4]")
del_items(0x800A894C)
SetType(0x800A894C, "struct FeMenuTable FeBackgroundMenuTable[4]")
del_items(0x800A89AC)
SetType(0x800A89AC, "struct FeMenuTable FeBook1MenuTable[5]")
del_items(0x800A8A24)
SetType(0x800A8A24, "struct FeMenuTable FeBook2MenuTable[5]")
del_items(0x80115250)
SetType(0x80115250, "unsigned long AttractTitleDelay")
del_items(0x80115254)
SetType(0x80115254, "unsigned long AttractMainDelay")
del_items(0x80115258)
SetType(0x80115258, "int FMVEndPad")
del_items(0x801152D0)
SetType(0x801152D0, "int InCredits")
del_items(0x801152D4)
SetType(0x801152D4, "int CreditTitleNo")
del_items(0x801152D8)
SetType(0x801152D8, "int CreditSubTitleNo")
del_items(0x801152EC)
SetType(0x801152EC, "int card_status[2]")
del_items(0x801152F4)
SetType(0x801152F4, "int card_usable[2]")
del_items(0x801152FC)
SetType(0x801152FC, "int card_files[2]")
del_items(0x80115304)
SetType(0x80115304, "int card_changed[2]")
del_items(0x80115344)
SetType(0x80115344, "int AlertTxt")
del_items(0x80115348)
SetType(0x80115348, "int current_card")
del_items(0x8011534C)
SetType(0x8011534C, "int LoadType")
del_items(0x80115350)
SetType(0x80115350, "int McMenuPos")
del_items(0x80115354)
SetType(0x80115354, "struct FeTable *McCurMenu")
del_items(0x80115340)
SetType(0x80115340, "bool fileinfoflag")
del_items(0x80115318)
SetType(0x80115318, "char *DiabloGameFile")
del_items(0x80115338)
SetType(0x80115338, "char *McState_addr_80115338[2]")
del_items(0x80115424)
SetType(0x80115424, "int mdec_audio_buffer[2]")
del_items(0x8011542C)
SetType(0x8011542C, "int mdec_audio_sec")
del_items(0x80115430)
SetType(0x80115430, "int mdec_audio_offs")
del_items(0x80115434)
SetType(0x80115434, "int mdec_audio_playing")
del_items(0x80115438)
SetType(0x80115438, "int mdec_audio_rate_shift")
del_items(0x8011543C)
SetType(0x8011543C, "char *vlcbuf[2]")
del_items(0x80115444)
SetType(0x80115444, "int slice_size")
del_items(0x80115448)
SetType(0x80115448, "struct RECT slice")
del_items(0x80115450)
SetType(0x80115450, "int slice_inc")
del_items(0x80115454)
SetType(0x80115454, "int area_pw")
del_items(0x80115458)
SetType(0x80115458, "int area_ph")
del_items(0x8011545C)
SetType(0x8011545C, "int tmdc_pol_dirty[2]")
del_items(0x80115464)
SetType(0x80115464, "int num_pol[2]")
del_items(0x8011546C)
SetType(0x8011546C, "int mdec_cx")
del_items(0x80115470)
SetType(0x80115470, "int mdec_cy")
del_items(0x80115474)
SetType(0x80115474, "int mdec_w")
del_items(0x80115478)
SetType(0x80115478, "int mdec_h")
del_items(0x8011547C)
SetType(0x8011547C, "int mdec_pw[2]")
del_items(0x80115484)
SetType(0x80115484, "int mdec_ph[2]")
del_items(0x8011548C)
SetType(0x8011548C, "int move_x")
del_items(0x80115490)
SetType(0x80115490, "int move_y")
del_items(0x80115494)
SetType(0x80115494, "int move_scale")
del_items(0x80115498)
SetType(0x80115498, "int stream_frames")
del_items(0x8011549C)
SetType(0x8011549C, "int last_stream_frame")
del_items(0x801154A0)
SetType(0x801154A0, "int mdec_framecount")
del_items(0x801154A4)
SetType(0x801154A4, "int mdec_speed")
del_items(0x801154A8)
SetType(0x801154A8, "int mdec_stream_starting")
del_items(0x801154AC)
SetType(0x801154AC, "int mdec_last_frame")
del_items(0x801154B0)
SetType(0x801154B0, "int mdec_sectors_per_frame")
del_items(0x801154B4)
SetType(0x801154B4, "unsigned short *vlctab")
del_items(0x801154B8)
SetType(0x801154B8, "unsigned char *mdc_buftop")
del_items(0x801154BC)
SetType(0x801154BC, "unsigned char *mdc_bufstart")
del_items(0x801154C0)
SetType(0x801154C0, "int mdc_bufleft")
del_items(0x801154C4)
SetType(0x801154C4, "int mdc_buftotal")
del_items(0x801154C8)
SetType(0x801154C8, "int time_in_frames")
del_items(0x801154CC)
SetType(0x801154CC, "int stream_chunksize")
del_items(0x801154D0)
SetType(0x801154D0, "int stream_bufsize")
del_items(0x801154D4)
SetType(0x801154D4, "int stream_subsec")
del_items(0x801154D8)
SetType(0x801154D8, "int stream_secnum")
del_items(0x801154DC)
SetType(0x801154DC, "int stream_last_sector")
del_items(0x801154E0)
SetType(0x801154E0, "int stream_startsec")
del_items(0x801154E4)
SetType(0x801154E4, "int stream_opened")
del_items(0x801154E8)
SetType(0x801154E8, "int stream_last_chunk")
del_items(0x801154EC)
SetType(0x801154EC, "int stream_got_chunks")
del_items(0x801154F0)
SetType(0x801154F0, "int last_sector")
del_items(0x801154F4)
SetType(0x801154F4, "int cdstream_resetsec")
del_items(0x801154F8)
SetType(0x801154F8, "int last_handler_event")
del_items(0x80115364)
SetType(0x80115364, "unsigned char *map_buf")
del_items(0x80115368)
SetType(0x80115368, "unsigned char *vlc_tab")
del_items(0x8011536C)
SetType(0x8011536C, "unsigned char *vlc_buf")
del_items(0x80115370)
SetType(0x80115370, "int vbuf")
del_items(0x80115374)
SetType(0x80115374, "int last_fn")
del_items(0x80115378)
SetType(0x80115378, "int last_mdc")
del_items(0x8011537C)
SetType(0x8011537C, "int slnum")
del_items(0x80115380)
SetType(0x80115380, "int slices_to_do")
del_items(0x80115384)
SetType(0x80115384, "int mbuf")
del_items(0x80115388)
SetType(0x80115388, "int mfn")
del_items(0x8011538C)
SetType(0x8011538C, "int last_move_mbuf")
del_items(0x80115390)
SetType(0x80115390, "int move_request")
del_items(0x80115394)
SetType(0x80115394, "int mdec_scale")
del_items(0x80115398)
SetType(0x80115398, "int do_brightness")
del_items(0x8011539C)
SetType(0x8011539C, "int frame_decoded")
del_items(0x801153A0)
SetType(0x801153A0, "int mdec_streaming")
del_items(0x801153A4)
SetType(0x801153A4, "int mdec_stream_size")
del_items(0x801153A8)
SetType(0x801153A8, "int first_stream_frame")
del_items(0x801153AC)
SetType(0x801153AC, "int stream_frames_played")
del_items(0x801153B0)
SetType(0x801153B0, "int num_mdcs")
del_items(0x801153B4)
SetType(0x801153B4, "int mdec_head")
del_items(0x801153B8)
SetType(0x801153B8, "int mdec_tail")
del_items(0x801153BC)
SetType(0x801153BC, "int mdec_waiting_tail")
del_items(0x801153C0)
SetType(0x801153C0, "int mdecs_queued")
del_items(0x801153C4)
SetType(0x801153C4, "int mdecs_waiting")
del_items(0x801153C8)
SetType(0x801153C8, "int sfx_volume")
del_items(0x801153CC)
SetType(0x801153CC, "int stream_chunks_in")
del_items(0x801153D0)
SetType(0x801153D0, "int stream_chunks_total")
del_items(0x801153D4)
SetType(0x801153D4, "int stream_in")
del_items(0x801153D8)
SetType(0x801153D8, "int stream_out")
del_items(0x801153DC)
SetType(0x801153DC, "int stream_stalled")
del_items(0x801153E0)
SetType(0x801153E0, "int stream_ending")
del_items(0x801153E4)
SetType(0x801153E4, "int stream_open")
del_items(0x801153E8)
SetType(0x801153E8, "int stream_handler_installed")
del_items(0x801153EC)
SetType(0x801153EC, "int stream_chunks_borrowed")
del_items(0x801153F0)
SetType(0x801153F0, "int _get_count")
del_items(0x801153F4)
SetType(0x801153F4, "int _discard_count")
del_items(0x801153F8)
SetType(0x801153F8, "struct TASK *CDTask")
del_items(0x801153FC)
SetType(0x801153FC, "struct cdstreamstruct *CDStream")
del_items(0x80115400)
SetType(0x80115400, "int cdready_calls")
del_items(0x80115404)
SetType(0x80115404, "int cdready_errors")
del_items(0x80115408)
SetType(0x80115408, "int cdready_out_of_sync")
del_items(0x8011540C)
SetType(0x8011540C, "int cdstream_resetting")
del_items(0x80115410)
SetType(0x80115410, "int sector_dma")
del_items(0x80115414)
SetType(0x80115414, "int sector_dma_in")
del_items(0x80115418)
SetType(0x80115418, "unsigned long *chkaddr")
del_items(0x8011541C)
SetType(0x8011541C, "struct chunkhdrstruct *chunk")
del_items(0x80115420)
SetType(0x80115420, "int first_handler_event")
del_items(0x80115598)
SetType(0x80115598, "unsigned char *pStatusPanel")
del_items(0x8011559C)
SetType(0x8011559C, "unsigned char *pGBoxBuff")
del_items(0x801155A0)
SetType(0x801155A0, "unsigned char dropGoldFlag")
del_items(0x801155A4)
SetType(0x801155A4, "unsigned char _pinfoflag[2]")
del_items(0x800A9454)
SetType(0x800A9454, "char _infostr[256][2]")
del_items(0x801155A8)
SetType(0x801155A8, "char _infoclr[2]")
del_items(0x800A9654)
SetType(0x800A9654, "char tempstr[256]")
del_items(0x801155AA)
SetType(0x801155AA, "unsigned char drawhpflag")
del_items(0x801155AB)
SetType(0x801155AB, "unsigned char drawmanaflag")
del_items(0x801155AC)
SetType(0x801155AC, "unsigned char chrflag")
del_items(0x801155AD)
SetType(0x801155AD, "unsigned char drawbtnflag")
del_items(0x801155AE)
SetType(0x801155AE, "unsigned char panbtndown")
del_items(0x801155AF)
SetType(0x801155AF, "unsigned char panelflag")
del_items(0x801155B0)
SetType(0x801155B0, "unsigned char chrbtndown")
del_items(0x801155B1)
SetType(0x801155B1, "unsigned char lvlbtndown")
del_items(0x801155B2)
SetType(0x801155B2, "unsigned char sbookflag")
del_items(0x801155B3)
SetType(0x801155B3, "unsigned char talkflag")
del_items(0x801155B4)
SetType(0x801155B4, "int dropGoldValue")
del_items(0x801155B8)
SetType(0x801155B8, "int initialDropGoldValue")
del_items(0x801155BC)
SetType(0x801155BC, "int initialDropGoldIndex")
del_items(0x801155C0)
SetType(0x801155C0, "unsigned char *pPanelButtons")
del_items(0x801155C4)
SetType(0x801155C4, "unsigned char *pPanelText")
del_items(0x801155C8)
SetType(0x801155C8, "unsigned char *pManaBuff")
del_items(0x801155CC)
SetType(0x801155CC, "unsigned char *pLifeBuff")
del_items(0x801155D0)
SetType(0x801155D0, "unsigned char *pChrPanel")
del_items(0x801155D4)
SetType(0x801155D4, "unsigned char *pChrButtons")
del_items(0x801155D8)
SetType(0x801155D8, "unsigned char *pSpellCels")
del_items(0x80116E00)
SetType(0x80116E00, "char _panelstr[64][8][2]")
del_items(0x80117200)
SetType(0x80117200, "int _pstrjust[8][2]")
del_items(0x8011647C)
SetType(0x8011647C, "int _pnumlines[2]")
del_items(0x801155DC)
SetType(0x801155DC, "struct RECT *InfoBoxRect")
del_items(0x801155E0)
SetType(0x801155E0, "struct RECT CSRect")
del_items(0x8011648C)
SetType(0x8011648C, "int _pSpell[2]")
del_items(0x80116494)
SetType(0x80116494, "int _pSplType[2]")
del_items(0x8011649C)
SetType(0x8011649C, "unsigned char panbtn[8]")
del_items(0x801155E8)
SetType(0x801155E8, "int numpanbtns")
del_items(0x801155EC)
SetType(0x801155EC, "unsigned char *pDurIcons")
del_items(0x801155F0)
SetType(0x801155F0, "unsigned char drawdurflag")
del_items(0x801164A4)
SetType(0x801164A4, "unsigned char chrbtn[4]")
del_items(0x801155F1)
SetType(0x801155F1, "unsigned char chrbtnactive")
del_items(0x801155F4)
SetType(0x801155F4, "unsigned char *pSpellBkCel")
del_items(0x801155F8)
SetType(0x801155F8, "unsigned char *pSBkBtnCel")
del_items(0x801155FC)
SetType(0x801155FC, "unsigned char *pSBkIconCels")
del_items(0x80115600)
SetType(0x80115600, "int sbooktab")
del_items(0x80115604)
SetType(0x80115604, "int cur_spel")
del_items(0x801164A8)
SetType(0x801164A8, "long talkofs")
del_items(0x80117250)
SetType(0x80117250, "char sgszTalkMsg[80]")
del_items(0x801164AC)
SetType(0x801164AC, "unsigned char sgbTalkSavePos")
del_items(0x801164AD)
SetType(0x801164AD, "unsigned char sgbNextTalkSave")
del_items(0x801164AE)
SetType(0x801164AE, "unsigned char sgbPlrTalkTbl[2]")
del_items(0x801164B0)
SetType(0x801164B0, "unsigned char *pTalkPanel")
del_items(0x801164B4)
SetType(0x801164B4, "unsigned char *pMultiBtns")
del_items(0x801164B8)
SetType(0x801164B8, "unsigned char *pTalkBtns")
del_items(0x801164BC)
SetType(0x801164BC, "unsigned char talkbtndown[3]")
del_items(0x8010B408)
SetType(0x8010B408, "unsigned char gbFontTransTbl[256]")
del_items(0x8010B348)
SetType(0x8010B348, "unsigned char fontkern[68]")
del_items(0x800A8E88)
SetType(0x800A8E88, "char SpellITbl[37]")
del_items(0x80115505)
SetType(0x80115505, "unsigned char DrawLevelUpFlag")
del_items(0x8011552C)
SetType(0x8011552C, "struct TASK *_spselflag[2]")
del_items(0x80115528)
SetType(0x80115528, "unsigned char spspelstate")
del_items(0x80115568)
SetType(0x80115568, "bool initchr")
del_items(0x80115508)
SetType(0x80115508, "int SPLICONNO")
del_items(0x8011550C)
SetType(0x8011550C, "int SPLICONY")
del_items(0x80116484)
SetType(0x80116484, "int SPLICONRIGHT")
del_items(0x80115510)
SetType(0x80115510, "int scx")
del_items(0x80115514)
SetType(0x80115514, "int scy")
del_items(0x80115518)
SetType(0x80115518, "int scx1")
del_items(0x8011551C)
SetType(0x8011551C, "int scy1")
del_items(0x80115520)
SetType(0x80115520, "int scx2")
del_items(0x80115524)
SetType(0x80115524, "int scy2")
del_items(0x80115534)
SetType(0x80115534, "char SpellCol")
del_items(0x800A8E74)
SetType(0x800A8E74, "unsigned char SpellColors[18]")
del_items(0x800A8EB0)
SetType(0x800A8EB0, "int PanBtnPos[5][8]")
del_items(0x800A8F50)
SetType(0x800A8F50, "char *PanBtnHotKey[8]")
del_items(0x800A8F70)
SetType(0x800A8F70, "unsigned long PanBtnStr[8]")
del_items(0x800A8F90)
SetType(0x800A8F90, "int SpellPages[5][5]")
del_items(0x80115558)
SetType(0x80115558, "int lus")
del_items(0x8011555C)
SetType(0x8011555C, "int CsNo")
del_items(0x80115560)
SetType(0x80115560, "char plusanim")
del_items(0x80117240)
SetType(0x80117240, "struct Dialog CSBack")
del_items(0x80115564)
SetType(0x80115564, "int CS_XOFF")
del_items(0x800A8FF4)
SetType(0x800A8FF4, "struct CSDATA CS_Tab[28]")
del_items(0x8011556C)
SetType(0x8011556C, "int NoCSEntries")
del_items(0x80115570)
SetType(0x80115570, "int SPALOFF")
del_items(0x80115574)
SetType(0x80115574, "int paloffset1")
del_items(0x80115578)
SetType(0x80115578, "int paloffset2")
del_items(0x8011557C)
SetType(0x8011557C, "int paloffset3")
del_items(0x80115580)
SetType(0x80115580, "int paloffset4")
del_items(0x80115584)
SetType(0x80115584, "int pinc1")
del_items(0x80115588)
SetType(0x80115588, "int pinc2")
del_items(0x8011558C)
SetType(0x8011558C, "int pinc3")
del_items(0x80115590)
SetType(0x80115590, "int pinc4")
del_items(0x80115618)
SetType(0x80115618, "int _pcurs[2]")
del_items(0x80115620)
SetType(0x80115620, "int cursW")
del_items(0x80115624)
SetType(0x80115624, "int cursH")
del_items(0x80115628)
SetType(0x80115628, "int icursW")
del_items(0x8011562C)
SetType(0x8011562C, "int icursH")
del_items(0x80115630)
SetType(0x80115630, "int icursW28")
del_items(0x80115634)
SetType(0x80115634, "int icursH28")
del_items(0x80115638)
SetType(0x80115638, "int cursmx")
del_items(0x8011563C)
SetType(0x8011563C, "int cursmy")
del_items(0x80115640)
SetType(0x80115640, "int _pcursmonst[2]")
del_items(0x80115648)
SetType(0x80115648, "char _pcursobj[2]")
del_items(0x8011564C)
SetType(0x8011564C, "char _pcursitem[2]")
del_items(0x80115650)
SetType(0x80115650, "char _pcursinvitem[2]")
del_items(0x80115654)
SetType(0x80115654, "char _pcursplr[2]")
del_items(0x80115614)
SetType(0x80115614, "int sel_data")
del_items(0x800A9754)
SetType(0x800A9754, "struct DeadStruct dead[31]")
del_items(0x80115658)
SetType(0x80115658, "int spurtndx")
del_items(0x8011565C)
SetType(0x8011565C, "int stonendx")
del_items(0x80115660)
SetType(0x80115660, "unsigned char *pSquareCel")
del_items(0x801156A0)
SetType(0x801156A0, "unsigned long ghInst")
del_items(0x801156A4)
SetType(0x801156A4, "unsigned char svgamode")
del_items(0x801156A8)
SetType(0x801156A8, "int MouseX")
del_items(0x801156AC)
SetType(0x801156AC, "int MouseY")
del_items(0x801156B0)
SetType(0x801156B0, "long gv1")
del_items(0x801156B4)
SetType(0x801156B4, "long gv2")
del_items(0x801156B8)
SetType(0x801156B8, "long gv3")
del_items(0x801156BC)
SetType(0x801156BC, "long gv4")
del_items(0x801156C0)
SetType(0x801156C0, "long gv5")
del_items(0x801156C4)
SetType(0x801156C4, "unsigned char gbProcessPlayers")
del_items(0x800A98C8)
SetType(0x800A98C8, "int DebugMonsters[10]")
del_items(0x800A98F0)
SetType(0x800A98F0, "unsigned long glSeedTbl[17]")
del_items(0x800A9934)
SetType(0x800A9934, "int gnLevelTypeTbl[17]")
del_items(0x801156C5)
SetType(0x801156C5, "unsigned char gbDoEnding")
del_items(0x801156C6)
SetType(0x801156C6, "unsigned char gbRunGame")
del_items(0x801156C7)
SetType(0x801156C7, "unsigned char gbRunGameResult")
del_items(0x801156C8)
SetType(0x801156C8, "unsigned char gbGameLoopStartup")
del_items(0x801172A0)
SetType(0x801172A0, "int glEndSeed[17]")
del_items(0x801172F0)
SetType(0x801172F0, "int glMid1Seed[17]")
del_items(0x80117340)
SetType(0x80117340, "int glMid2Seed[17]")
del_items(0x80117390)
SetType(0x80117390, "int glMid3Seed[17]")
del_items(0x801164C0)
SetType(0x801164C0, "long *sg_previousFilter")
del_items(0x800A9978)
SetType(0x800A9978, "int CreateEnv[12]")
del_items(0x801156CC)
SetType(0x801156CC, "int Passedlvldir")
del_items(0x801156D0)
SetType(0x801156D0, "unsigned char *TempStack")
del_items(0x80115670)
SetType(0x80115670, "unsigned long ghMainWnd")
del_items(0x80115674)
SetType(0x80115674, "unsigned char fullscreen")
del_items(0x80115678)
SetType(0x80115678, "int force_redraw")
del_items(0x8011568C)
SetType(0x8011568C, "unsigned char PauseMode")
del_items(0x8011568D)
SetType(0x8011568D, "unsigned char FriendlyMode")
del_items(0x8011567D)
SetType(0x8011567D, "unsigned char visiondebug")
del_items(0x8011567F)
SetType(0x8011567F, "unsigned char light4flag")
del_items(0x80115680)
SetType(0x80115680, "unsigned char leveldebug")
del_items(0x80115681)
SetType(0x80115681, "unsigned char monstdebug")
del_items(0x80115688)
SetType(0x80115688, "int debugmonsttypes")
del_items(0x8011567C)
SetType(0x8011567C, "unsigned char cineflag")
del_items(0x8011567E)
SetType(0x8011567E, "unsigned char scrollflag")
del_items(0x80115682)
SetType(0x80115682, "unsigned char trigdebug")
del_items(0x80115684)
SetType(0x80115684, "int setseed")
del_items(0x80115690)
SetType(0x80115690, "int sgnTimeoutCurs")
del_items(0x80115694)
SetType(0x80115694, "unsigned char sgbMouseDown")
del_items(0x800AA044)
SetType(0x800AA044, "struct TownerStruct towner[16]")
del_items(0x801156E8)
SetType(0x801156E8, "int numtowners")
del_items(0x801156EC)
SetType(0x801156EC, "unsigned char storeflag")
del_items(0x801156ED)
SetType(0x801156ED, "unsigned char boyloadflag")
del_items(0x801156EE)
SetType(0x801156EE, "unsigned char bannerflag")
del_items(0x801156F0)
SetType(0x801156F0, "unsigned char *pCowCels")
del_items(0x801164C4)
SetType(0x801164C4, "unsigned long sgdwCowClicks")
del_items(0x801164C8)
SetType(0x801164C8, "int sgnCowMsg")
del_items(0x800A9D84)
SetType(0x800A9D84, "int Qtalklist[16][11]")
del_items(0x801156E0)
SetType(0x801156E0, "unsigned long CowPlaying")
del_items(0x800A99A8)
SetType(0x800A99A8, "char AnimOrder[148][6]")
del_items(0x800A9D20)
SetType(0x800A9D20, "int TownCowX[3]")
del_items(0x800A9D2C)
SetType(0x800A9D2C, "int TownCowY[3]")
del_items(0x800A9D38)
SetType(0x800A9D38, "int TownCowDir[3]")
del_items(0x800A9D44)
SetType(0x800A9D44, "int cowoffx[8]")
del_items(0x800A9D64)
SetType(0x800A9D64, "int cowoffy[8]")
del_items(0x80115708)
SetType(0x80115708, "int sfxdelay")
del_items(0x8011570C)
SetType(0x8011570C, "int sfxdnum")
del_items(0x80115700)
SetType(0x80115700, "struct SFXHDR *sghStream")
del_items(0x800AAE44)
SetType(0x800AAE44, "struct TSFX sgSFX[979]")
del_items(0x80115704)
SetType(0x80115704, "struct TSFX *sgpStreamSFX")
del_items(0x80115710)
SetType(0x80115710, "long orgseed")
del_items(0x801164CC)
SetType(0x801164CC, "long sglGameSeed")
del_items(0x80115714)
SetType(0x80115714, "int SeedCount")
del_items(0x801164D0)
SetType(0x801164D0, "struct CCritSect sgMemCrit")
del_items(0x801164D4)
SetType(0x801164D4, "int sgnWidth")
del_items(0x80115722)
SetType(0x80115722, "char msgflag")
del_items(0x80115723)
SetType(0x80115723, "char msgdelay")
del_items(0x800ABE40)
SetType(0x800ABE40, "char msgtable[80]")
del_items(0x800ABD90)
SetType(0x800ABD90, "int MsgStrings[44]")
del_items(0x80115721)
SetType(0x80115721, "char msgcnt")
del_items(0x801164D8)
SetType(0x801164D8, "unsigned long sgdwProgress")
del_items(0x801164DC)
SetType(0x801164DC, "unsigned long sgdwXY")
del_items(0x800ABE90)
SetType(0x800ABE90, "unsigned char AllItemsUseable[157]")
del_items(0x8010B840)
SetType(0x8010B840, "struct ItemDataStruct AllItemsList[157]")
del_items(0x8010CBE0)
SetType(0x8010CBE0, "struct PLStruct PL_Prefix[84]")
del_items(0x8010D900)
SetType(0x8010D900, "struct PLStruct PL_Suffix[96]")
del_items(0x8010E800)
SetType(0x8010E800, "struct UItemStruct UniqueItemList[91]")
del_items(0x800AC0A4)
SetType(0x800AC0A4, "struct ItemStruct item[128]")
del_items(0x800B0AA4)
SetType(0x800B0AA4, "char itemactive[127]")
del_items(0x800B0B24)
SetType(0x800B0B24, "char itemavail[127]")
del_items(0x800B0BA4)
SetType(0x800B0BA4, "unsigned char UniqueItemFlag[128]")
del_items(0x8011575C)
SetType(0x8011575C, "unsigned char uitemflag")
del_items(0x801164E0)
SetType(0x801164E0, "int tem")
del_items(0x801173D8)
SetType(0x801173D8, "struct ItemStruct curruitem")
del_items(0x80117478)
SetType(0x80117478, "unsigned char itemhold[3][3]")
del_items(0x80115760)
SetType(0x80115760, "int ScrollType")
del_items(0x800B0C24)
SetType(0x800B0C24, "char ItemStr[64]")
del_items(0x800B0C64)
SetType(0x800B0C64, "char SufStr[64]")
del_items(0x8011573C)
SetType(0x8011573C, "long numitems")
del_items(0x80115740)
SetType(0x80115740, "int gnNumGetRecords")
del_items(0x800AC000)
SetType(0x800AC000, "int ItemInvSnds[35]")
del_items(0x800ABF30)
SetType(0x800ABF30, "unsigned char ItemCAnimTbl[169]")
del_items(0x80110644)
SetType(0x80110644, "short Item2Frm[35]")
del_items(0x800ABFDC)
SetType(0x800ABFDC, "unsigned char ItemAnimLs[35]")
del_items(0x80115744)
SetType(0x80115744, "int *ItemAnimSnds")
del_items(0x80115748)
SetType(0x80115748, "int idoppely")
del_items(0x8011574C)
SetType(0x8011574C, "int ScrollFlag")
del_items(0x800AC08C)
SetType(0x800AC08C, "int premiumlvladd[6]")
del_items(0x800B1A50)
SetType(0x800B1A50, "struct LightListStruct2 LightList[40]")
del_items(0x800B1B90)
SetType(0x800B1B90, "unsigned char lightactive[40]")
del_items(0x80115774)
SetType(0x80115774, "int numlights")
del_items(0x80115778)
SetType(0x80115778, "char lightmax")
del_items(0x800B1BB8)
SetType(0x800B1BB8, "struct LightListStruct VisionList[32]")
del_items(0x8011577C)
SetType(0x8011577C, "int numvision")
del_items(0x80115780)
SetType(0x80115780, "unsigned char dovision")
del_items(0x80115784)
SetType(0x80115784, "int visionid")
del_items(0x801164E4)
SetType(0x801164E4, "int disp_mask")
del_items(0x801164E8)
SetType(0x801164E8, "int weird")
del_items(0x801164EC)
SetType(0x801164EC, "int disp_tab_r")
del_items(0x801164F0)
SetType(0x801164F0, "int dispy_r")
del_items(0x801164F4)
SetType(0x801164F4, "int disp_tab_g")
del_items(0x801164F8)
SetType(0x801164F8, "int dispy_g")
del_items(0x801164FC)
SetType(0x801164FC, "int disp_tab_b")
del_items(0x80116500)
SetType(0x80116500, "int dispy_b")
del_items(0x80116504)
SetType(0x80116504, "int radius")
del_items(0x80116508)
SetType(0x80116508, "int bright")
del_items(0x80117488)
SetType(0x80117488, "unsigned char mult_tab[128]")
del_items(0x80115764)
SetType(0x80115764, "int lightflag")
del_items(0x800B1764)
SetType(0x800B1764, "unsigned char vCrawlTable[30][23]")
del_items(0x800B1A18)
SetType(0x800B1A18, "unsigned char RadiusAdj[23]")
del_items(0x800B0CA4)
SetType(0x800B0CA4, "char CrawlTable[2749]")
del_items(0x80115768)
SetType(0x80115768, "int restore_r")
del_items(0x8011576C)
SetType(0x8011576C, "int restore_g")
del_items(0x80115770)
SetType(0x80115770, "int restore_b")
del_items(0x800B1A30)
SetType(0x800B1A30, "char radius_tab[16]")
del_items(0x800B1A40)
SetType(0x800B1A40, "char bright_tab[16]")
del_items(0x801157A6)
SetType(0x801157A6, "unsigned char qtextflag")
del_items(0x801157A8)
SetType(0x801157A8, "int qtextSpd")
del_items(0x8011650C)
SetType(0x8011650C, "unsigned char *pMedTextCels")
del_items(0x80116510)
SetType(0x80116510, "unsigned char *pTextBoxCels")
del_items(0x80116514)
SetType(0x80116514, "char *qtextptr")
del_items(0x80116518)
SetType(0x80116518, "int qtexty")
del_items(0x8011651C)
SetType(0x8011651C, "unsigned long qtextDelay")
del_items(0x80116520)
SetType(0x80116520, "unsigned long sgLastScroll")
del_items(0x80116524)
SetType(0x80116524, "unsigned long scrolltexty")
del_items(0x80116528)
SetType(0x80116528, "long sglMusicVolumeSave")
del_items(0x80115794)
SetType(0x80115794, "bool qtbodge")
del_items(0x800B1D78)
SetType(0x800B1D78, "struct Dialog QBack")
del_items(0x801157A5)
SetType(0x801157A5, "unsigned char CDFlip")
del_items(0x800B1D88)
SetType(0x800B1D88, "struct MissileData missiledata[68]")
del_items(0x800B24F8)
SetType(0x800B24F8, "struct MisFileData misfiledata[47]")
del_items(0x800B23E8)
SetType(0x800B23E8, "void (*MissPrintRoutines[68])()")
del_items(0x800B25E4)
SetType(0x800B25E4, "struct DLevel sgLevels[21]")
del_items(0x800C6330)
SetType(0x800C6330, "struct LocalLevel sgLocals[21]")
del_items(0x80117508)
SetType(0x80117508, "struct DJunk sgJunk")
del_items(0x8011652D)
SetType(0x8011652D, "unsigned char sgbRecvCmd")
del_items(0x80116530)
SetType(0x80116530, "unsigned long sgdwRecvOffset")
del_items(0x80116534)
SetType(0x80116534, "unsigned char sgbDeltaChunks")
del_items(0x80116535)
SetType(0x80116535, "unsigned char sgbDeltaChanged")
del_items(0x80116538)
SetType(0x80116538, "unsigned long sgdwOwnerWait")
del_items(0x8011653C)
SetType(0x8011653C, "struct TMegaPkt *sgpMegaPkt")
del_items(0x80116540)
SetType(0x80116540, "struct TMegaPkt *sgpCurrPkt")
del_items(0x80116544)
SetType(0x80116544, "int sgnCurrMegaPlayer")
del_items(0x801157C1)
SetType(0x801157C1, "unsigned char deltaload")
del_items(0x801157C2)
SetType(0x801157C2, "unsigned char gbBufferMsgs")
del_items(0x801157C4)
SetType(0x801157C4, "unsigned long dwRecCount")
del_items(0x801157C8)
SetType(0x801157C8, "bool LevelOut")
del_items(0x801157DE)
SetType(0x801157DE, "unsigned char gbMaxPlayers")
del_items(0x801157DF)
SetType(0x801157DF, "unsigned char gbActivePlayers")
del_items(0x801157E0)
SetType(0x801157E0, "unsigned char gbGameDestroyed")
del_items(0x801157E1)
SetType(0x801157E1, "unsigned char gbDeltaSender")
del_items(0x801157E2)
SetType(0x801157E2, "unsigned char gbSelectProvider")
del_items(0x801157E3)
SetType(0x801157E3, "unsigned char gbSomebodyWonGameKludge")
del_items(0x80116548)
SetType(0x80116548, "unsigned char sgbSentThisCycle")
del_items(0x8011654C)
SetType(0x8011654C, "unsigned long sgdwGameLoops")
del_items(0x80116550)
SetType(0x80116550, "unsigned short sgwPackPlrOffsetTbl[2]")
del_items(0x80116554)
SetType(0x80116554, "unsigned char sgbPlayerLeftGameTbl[2]")
del_items(0x80116558)
SetType(0x80116558, "unsigned long sgdwPlayerLeftReasonTbl[2]")
del_items(0x80116560)
SetType(0x80116560, "unsigned char sgbSendDeltaTbl[2]")
del_items(0x80116568)
SetType(0x80116568, "struct _gamedata sgGameInitInfo")
del_items(0x80116570)
SetType(0x80116570, "unsigned char sgbTimeout")
del_items(0x80116574)
SetType(0x80116574, "long sglTimeoutStart")
del_items(0x801157D8)
SetType(0x801157D8, "char gszVersionNumber[5]")
del_items(0x801157DD)
SetType(0x801157DD, "unsigned char sgbNetInited")
del_items(0x800C7398)
SetType(0x800C7398, "int ObjTypeConv[113]")
del_items(0x800C755C)
SetType(0x800C755C, "struct ObjDataStruct AllObjects[99]")
del_items(0x80110D0C)
SetType(0x80110D0C, "struct OBJ_LOAD_INFO ObjMasterLoadList[56]")
del_items(0x800C7D3C)
SetType(0x800C7D3C, "struct ObjectStruct object[127]")
del_items(0x80115804)
SetType(0x80115804, "long numobjects")
del_items(0x800C9310)
SetType(0x800C9310, "char objectactive[127]")
del_items(0x800C9390)
SetType(0x800C9390, "char objectavail[127]")
del_items(0x80115808)
SetType(0x80115808, "unsigned char InitObjFlag")
del_items(0x8011580C)
SetType(0x8011580C, "int trapid")
del_items(0x800C9410)
SetType(0x800C9410, "char ObjFileList[40]")
del_items(0x80115810)
SetType(0x80115810, "int trapdir")
del_items(0x80115814)
SetType(0x80115814, "int leverid")
del_items(0x801157FC)
SetType(0x801157FC, "int numobjfiles")
del_items(0x800C7C54)
SetType(0x800C7C54, "int bxadd[8]")
del_items(0x800C7C74)
SetType(0x800C7C74, "int byadd[8]")
del_items(0x800C7CFC)
SetType(0x800C7CFC, "char shrineavail[26]")
del_items(0x800C7C94)
SetType(0x800C7C94, "int shrinestrs[26]")
del_items(0x800C7D18)
SetType(0x800C7D18, "int StoryBookName[9]")
del_items(0x80115800)
SetType(0x80115800, "int myscale")
del_items(0x80115828)
SetType(0x80115828, "unsigned char gbValidSaveFile")
del_items(0x80115824)
SetType(0x80115824, "bool DoLoadedChar")
del_items(0x800C9630)
SetType(0x800C9630, "struct PlayerStruct plr[2]")
del_items(0x80115848)
SetType(0x80115848, "int myplr")
del_items(0x8011584C)
SetType(0x8011584C, "int deathdelay")
del_items(0x80115850)
SetType(0x80115850, "unsigned char deathflag")
del_items(0x80115851)
SetType(0x80115851, "char light_rad")
del_items(0x80115840)
SetType(0x80115840, "char light_level[5]")
del_items(0x800C9528)
SetType(0x800C9528, "int MaxStats[4][3]")
del_items(0x80115838)
SetType(0x80115838, "int PlrStructSize")
del_items(0x8011583C)
SetType(0x8011583C, "int ItemStructSize")
del_items(0x800C9438)
SetType(0x800C9438, "int plrxoff[9]")
del_items(0x800C945C)
SetType(0x800C945C, "int plryoff[9]")
del_items(0x800C9480)
SetType(0x800C9480, "int plrxoff2[9]")
del_items(0x800C94A4)
SetType(0x800C94A4, "int plryoff2[9]")
del_items(0x800C94C8)
SetType(0x800C94C8, "char PlrGFXAnimLens[11][3]")
del_items(0x800C94EC)
SetType(0x800C94EC, "int StrengthTbl[3]")
del_items(0x800C94F8)
SetType(0x800C94F8, "int MagicTbl[3]")
del_items(0x800C9504)
SetType(0x800C9504, "int DexterityTbl[3]")
del_items(0x800C9510)
SetType(0x800C9510, "int VitalityTbl[3]")
del_items(0x800C951C)
SetType(0x800C951C, "int ToBlkTbl[3]")
del_items(0x800C9558)
SetType(0x800C9558, "long ExpLvlsTbl[51]")
del_items(0x800CDCF8)
SetType(0x800CDCF8, "struct QuestStruct quests[16]")
del_items(0x80115890)
SetType(0x80115890, "unsigned char *pQLogCel")
del_items(0x80115894)
SetType(0x80115894, "int ReturnLvlX")
del_items(0x80115898)
SetType(0x80115898, "int ReturnLvlY")
del_items(0x8011589C)
SetType(0x8011589C, "int ReturnLvl")
del_items(0x801158A0)
SetType(0x801158A0, "int ReturnLvlT")
del_items(0x801158A4)
SetType(0x801158A4, "unsigned char rporttest")
del_items(0x801158A8)
SetType(0x801158A8, "int qline")
del_items(0x801158AC)
SetType(0x801158AC, "int numqlines")
del_items(0x801158B0)
SetType(0x801158B0, "int qtopline")
del_items(0x80117528)
SetType(0x80117528, "int qlist[16]")
del_items(0x80116578)
SetType(0x80116578, "struct RECT QSRect")
del_items(0x8011585D)
SetType(0x8011585D, "unsigned char questlog")
del_items(0x800CDBC0)
SetType(0x800CDBC0, "struct QuestData questlist[16]")
del_items(0x80115860)
SetType(0x80115860, "int ALLQUESTS")
del_items(0x800CDCD4)
SetType(0x800CDCD4, "int QuestGroup1[3]")
del_items(0x800CDCE0)
SetType(0x800CDCE0, "int QuestGroup2[3]")
del_items(0x800CDCEC)
SetType(0x800CDCEC, "int QuestGroup3[3]")
del_items(0x80115874)
SetType(0x80115874, "int QuestGroup4[2]")
del_items(0x8011588C)
SetType(0x8011588C, "bool WaterDone")
del_items(0x80115864)
SetType(0x80115864, "char questxoff[7]")
del_items(0x8011586C)
SetType(0x8011586C, "char questyoff[7]")
del_items(0x800CDCC0)
SetType(0x800CDCC0, "int questtrigstr[5]")
del_items(0x8011587C)
SetType(0x8011587C, "int QS_PX")
del_items(0x80115880)
SetType(0x80115880, "int QS_PY")
del_items(0x80115884)
SetType(0x80115884, "int QS_PW")
del_items(0x80115888)
SetType(0x80115888, "int QS_PH")
del_items(0x80117568)
SetType(0x80117568, "struct Dialog QSBack")
del_items(0x800CDE38)
SetType(0x800CDE38, "struct SpellData spelldata[37]")
del_items(0x801158EF)
SetType(0x801158EF, "char stextflag")
del_items(0x800CE690)
SetType(0x800CE690, "struct ItemStruct smithitem[20]")
del_items(0x800CF220)
SetType(0x800CF220, "struct ItemStruct premiumitem[6]")
del_items(0x801158F0)
SetType(0x801158F0, "int numpremium")
del_items(0x801158F4)
SetType(0x801158F4, "int premiumlevel")
del_items(0x800CF598)
SetType(0x800CF598, "struct ItemStruct witchitem[20]")
del_items(0x800D0128)
SetType(0x800D0128, "struct ItemStruct boyitem")
del_items(0x801158F8)
SetType(0x801158F8, "int boylevel")
del_items(0x800D01BC)
SetType(0x800D01BC, "struct ItemStruct golditem")
del_items(0x800D0250)
SetType(0x800D0250, "struct ItemStruct healitem[20]")
del_items(0x801158FC)
SetType(0x801158FC, "char stextsize")
del_items(0x801158FD)
SetType(0x801158FD, "unsigned char stextscrl")
del_items(0x80116580)
SetType(0x80116580, "int stextsel")
del_items(0x80116584)
SetType(0x80116584, "int stextlhold")
del_items(0x80116588)
SetType(0x80116588, "int stextshold")
del_items(0x8011658C)
SetType(0x8011658C, "int stextvhold")
del_items(0x80116590)
SetType(0x80116590, "int stextsval")
del_items(0x80116594)
SetType(0x80116594, "int stextsmax")
del_items(0x80116598)
SetType(0x80116598, "int stextup")
del_items(0x8011659C)
SetType(0x8011659C, "int stextdown")
del_items(0x801165A0)
SetType(0x801165A0, "char stextscrlubtn")
del_items(0x801165A1)
SetType(0x801165A1, "char stextscrldbtn")
del_items(0x801165A2)
SetType(0x801165A2, "char SItemListFlag")
del_items(0x80117578)
SetType(0x80117578, "struct STextStruct stext[24]")
del_items(0x800D0DE0)
SetType(0x800D0DE0, "struct ItemStruct storehold[48]")
del_items(0x800D29A0)
SetType(0x800D29A0, "char storehidx[48]")
del_items(0x801165A4)
SetType(0x801165A4, "int storenumh")
del_items(0x801165A8)
SetType(0x801165A8, "int gossipstart")
del_items(0x801165AC)
SetType(0x801165AC, "int gossipend")
del_items(0x801165B0)
SetType(0x801165B0, "struct RECT StoreBackRect")
del_items(0x801165B8)
SetType(0x801165B8, "int talker")
del_items(0x801158D8)
SetType(0x801158D8, "unsigned char *pSTextBoxCels")
del_items(0x801158DC)
SetType(0x801158DC, "unsigned char *pSTextSlidCels")
del_items(0x801158E0)
SetType(0x801158E0, "int *SStringY")
del_items(0x800CE5BC)
SetType(0x800CE5BC, "struct Dialog SBack")
del_items(0x800CE5CC)
SetType(0x800CE5CC, "int SStringYNorm[20]")
del_items(0x800CE61C)
SetType(0x800CE61C, "int SStringYBuy[20]")
del_items(0x800CE66C)
SetType(0x800CE66C, "int talkname[9]")
del_items(0x801158EE)
SetType(0x801158EE, "unsigned char InStoreFlag")
del_items(0x80111F20)
SetType(0x80111F20, "struct TextDataStruct alltext[269]")
del_items(0x8011590C)
SetType(0x8011590C, "unsigned long gdwAllTextEntries")
del_items(0x801165BC)
SetType(0x801165BC, "unsigned char *P3Tiles")
del_items(0x8011591C)
SetType(0x8011591C, "int tile")
del_items(0x8011592C)
SetType(0x8011592C, "unsigned char _trigflag[2]")
del_items(0x800D2C08)
SetType(0x800D2C08, "struct TriggerStruct trigs[5]")
del_items(0x80115930)
SetType(0x80115930, "int numtrigs")
del_items(0x80115934)
SetType(0x80115934, "unsigned char townwarps[3]")
del_items(0x80115938)
SetType(0x80115938, "int TWarpFrom")
del_items(0x800D29D0)
SetType(0x800D29D0, "int TownDownList[11]")
del_items(0x800D29FC)
SetType(0x800D29FC, "int TownWarp1List[13]")
del_items(0x800D2A30)
SetType(0x800D2A30, "int L1UpList[12]")
del_items(0x800D2A60)
SetType(0x800D2A60, "int L1DownList[10]")
del_items(0x800D2A88)
SetType(0x800D2A88, "int L2UpList[3]")
del_items(0x800D2A94)
SetType(0x800D2A94, "int L2DownList[5]")
del_items(0x800D2AA8)
SetType(0x800D2AA8, "int L2TWarpUpList[3]")
del_items(0x800D2AB4)
SetType(0x800D2AB4, "int L3UpList[15]")
del_items(0x800D2AF0)
SetType(0x800D2AF0, "int L3DownList[9]")
del_items(0x800D2B14)
SetType(0x800D2B14, "int L3TWarpUpList[14]")
del_items(0x800D2B4C)
SetType(0x800D2B4C, "int L4UpList[4]")
del_items(0x800D2B5C)
SetType(0x800D2B5C, "int L4DownList[6]")
del_items(0x800D2B74)
SetType(0x800D2B74, "int L4TWarpUpList[4]")
del_items(0x800D2B84)
SetType(0x800D2B84, "int L4PentaList[33]")
del_items(0x80112CB0)
SetType(0x80112CB0, "char cursoff[10]")
del_items(0x80115952)
SetType(0x80115952, "unsigned char gbMusicOn")
del_items(0x80115953)
SetType(0x80115953, "unsigned char gbSoundOn")
del_items(0x80115951)
SetType(0x80115951, "unsigned char gbSndInited")
del_items(0x80115958)
SetType(0x80115958, "long sglMasterVolume")
del_items(0x8011595C)
SetType(0x8011595C, "long sglMusicVolume")
del_items(0x80115960)
SetType(0x80115960, "long sglSoundVolume")
del_items(0x80115964)
SetType(0x80115964, "long sglSpeechVolume")
del_items(0x80115954)
SetType(0x80115954, "unsigned char gbDupSounds")
del_items(0x80115968)
SetType(0x80115968, "int sgnMusicTrack")
del_items(0x8011596C)
SetType(0x8011596C, "struct SFXHDR *sghMusic")
del_items(0x80112D5C)
SetType(0x80112D5C, "unsigned short sgszMusicTracks[6]")
del_items(0x80115990)
SetType(0x80115990, "int _pcurr_inv[2]")
del_items(0x800D2C58)
SetType(0x800D2C58, "struct found_objects _pfind_list[10][2]")
del_items(0x80115998)
SetType(0x80115998, "char _pfind_index[2]")
del_items(0x8011599C)
SetType(0x8011599C, "char _pfindx[2]")
del_items(0x801159A0)
SetType(0x801159A0, "char _pfindy[2]")
del_items(0x801159A2)
SetType(0x801159A2, "unsigned char automapmoved")
del_items(0x80115984)
SetType(0x80115984, "unsigned char flyflag")
del_items(0x8011597C)
SetType(0x8011597C, "char (*pad_styles[2])()")
del_items(0x80115985)
SetType(0x80115985, "char speed_type")
del_items(0x80115986)
SetType(0x80115986, "char sel_speed")
del_items(0x801165C0)
SetType(0x801165C0, "unsigned long (*CurrentProc)()")
del_items(0x80112EF8)
SetType(0x80112EF8, "struct MESSAGE_STR AllMsgs[12]")
del_items(0x801159DC)
SetType(0x801159DC, "int NumOfStrings")
del_items(0x801159B0)
SetType(0x801159B0, "enum LANG_TYPE LanguageType")
del_items(0x801159B4)
SetType(0x801159B4, "long hndText")
del_items(0x801159B8)
SetType(0x801159B8, "char **TextPtr")
del_items(0x801159BC)
SetType(0x801159BC, "enum LANG_DB_NO LangDbNo")
del_items(0x801159EC)
SetType(0x801159EC, "struct TextDat *MissDat")
del_items(0x801159F0)
SetType(0x801159F0, "int CharFade")
del_items(0x801159F4)
SetType(0x801159F4, "int rotateness")
del_items(0x801159F8)
SetType(0x801159F8, "int spiralling_shape")
del_items(0x801159FC)
SetType(0x801159FC, "int down")
del_items(0x800D2CA8)
SetType(0x800D2CA8, "char MlTab[16]")
del_items(0x800D2CB8)
SetType(0x800D2CB8, "char QlTab[16]")
del_items(0x800D2CC8)
SetType(0x800D2CC8, "struct POLY_FT4 *(*ObjPrintFuncs[98])()")
del_items(0x80115A18)
SetType(0x80115A18, "int MyXoff1")
del_items(0x80115A1C)
SetType(0x80115A1C, "int MyYoff1")
del_items(0x80115A20)
SetType(0x80115A20, "int MyXoff2")
del_items(0x80115A24)
SetType(0x80115A24, "int MyYoff2")
del_items(0x80115A34)
SetType(0x80115A34, "bool iscflag")
del_items(0x80115A41)
SetType(0x80115A41, "unsigned char sgbFadedIn")
del_items(0x80115A42)
SetType(0x80115A42, "unsigned char screenbright")
del_items(0x80115A44)
SetType(0x80115A44, "int faderate")
del_items(0x80115A48)
SetType(0x80115A48, "bool fading")
del_items(0x80115A54)
SetType(0x80115A54, "unsigned char FadeCoords[8]")
del_items(0x80115A4C)
SetType(0x80115A4C, "int st")
del_items(0x80115A50)
SetType(0x80115A50, "int mode")
del_items(0x800D2E70)
SetType(0x800D2E70, "struct PortalStruct portal[4]")
del_items(0x80115A80)
SetType(0x80115A80, "int portalindex")
del_items(0x800D2E50)
SetType(0x800D2E50, "int WarpDropX[4]")
del_items(0x800D2E60)
SetType(0x800D2E60, "int WarpDropY[4]")
del_items(0x800D2ED0)
SetType(0x800D2ED0, "char MyVerString[120]")
del_items(0x80115BE8)
SetType(0x80115BE8, "int Year")
del_items(0x80115BEC)
SetType(0x80115BEC, "int Day")
del_items(0x801165C4)
SetType(0x801165C4, "unsigned char *tbuff")
del_items(0x801165C8)
SetType(0x801165C8, "unsigned char HR1")
del_items(0x801165C9)
SetType(0x801165C9, "unsigned char HR2")
del_items(0x801165CA)
SetType(0x801165CA, "unsigned char HR3")
del_items(0x801165CB)
SetType(0x801165CB, "unsigned char VR1")
del_items(0x801165CC)
SetType(0x801165CC, "unsigned char VR2")
del_items(0x801165CD)
SetType(0x801165CD, "unsigned char VR3")
del_items(0x80115C5C)
SetType(0x80115C5C, "struct NODE *pHallList")
del_items(0x80115C60)
SetType(0x80115C60, "int nRoomCnt")
del_items(0x80115C64)
SetType(0x80115C64, "int nSx1")
del_items(0x80115C68)
SetType(0x80115C68, "int nSy1")
del_items(0x80115C6C)
SetType(0x80115C6C, "int nSx2")
del_items(0x80115C70)
SetType(0x80115C70, "int nSy2")
del_items(0x80115C14)
SetType(0x80115C14, "int Area_Min")
del_items(0x80115C18)
SetType(0x80115C18, "int Room_Max")
del_items(0x80115C1C)
SetType(0x80115C1C, "int Room_Min")
del_items(0x80115C20)
SetType(0x80115C20, "unsigned char BIG3[6]")
del_items(0x80115C28)
SetType(0x80115C28, "unsigned char BIG4[6]")
del_items(0x80115C30)
SetType(0x80115C30, "unsigned char BIG6[6]")
del_items(0x80115C38)
SetType(0x80115C38, "unsigned char BIG7[6]")
del_items(0x80115C40)
SetType(0x80115C40, "unsigned char RUINS1[4]")
del_items(0x80115C44)
SetType(0x80115C44, "unsigned char RUINS2[4]")
del_items(0x80115C48)
SetType(0x80115C48, "unsigned char RUINS3[4]")
del_items(0x80115C4C)
SetType(0x80115C4C, "unsigned char RUINS4[4]")
del_items(0x80115C50)
SetType(0x80115C50, "unsigned char RUINS5[4]")
del_items(0x80115C54)
SetType(0x80115C54, "unsigned char RUINS6[4]")
del_items(0x80115C58)
SetType(0x80115C58, "unsigned char RUINS7[4]")
del_items(0x801165D0)
SetType(0x801165D0, "int abyssx")
del_items(0x801165D4)
SetType(0x801165D4, "unsigned char lavapool")
del_items(0x80115CFC)
SetType(0x80115CFC, "int lockoutcnt")
del_items(0x80115C80)
SetType(0x80115C80, "unsigned char L3TITE12[6]")
del_items(0x80115C88)
SetType(0x80115C88, "unsigned char L3TITE13[6]")
del_items(0x80115C90)
SetType(0x80115C90, "unsigned char L3CREV1[6]")
del_items(0x80115C98)
SetType(0x80115C98, "unsigned char L3CREV2[6]")
del_items(0x80115CA0)
SetType(0x80115CA0, "unsigned char L3CREV3[6]")
del_items(0x80115CA8)
SetType(0x80115CA8, "unsigned char L3CREV4[6]")
del_items(0x80115CB0)
SetType(0x80115CB0, "unsigned char L3CREV5[6]")
del_items(0x80115CB8)
SetType(0x80115CB8, "unsigned char L3CREV6[6]")
del_items(0x80115CC0)
SetType(0x80115CC0, "unsigned char L3CREV7[6]")
del_items(0x80115CC8)
SetType(0x80115CC8, "unsigned char L3CREV8[6]")
del_items(0x80115CD0)
SetType(0x80115CD0, "unsigned char L3CREV9[6]")
del_items(0x80115CD8)
SetType(0x80115CD8, "unsigned char L3CREV10[6]")
del_items(0x80115CE0)
SetType(0x80115CE0, "unsigned char L3CREV11[6]")
del_items(0x80115CE8)
SetType(0x80115CE8, "unsigned char L3XTRA1[4]")
del_items(0x80115CEC)
SetType(0x80115CEC, "unsigned char L3XTRA2[4]")
del_items(0x80115CF0)
SetType(0x80115CF0, "unsigned char L3XTRA3[4]")
del_items(0x80115CF4)
SetType(0x80115CF4, "unsigned char L3XTRA4[4]")
del_items(0x80115CF8)
SetType(0x80115CF8, "unsigned char L3XTRA5[4]")
del_items(0x80115D00)
SetType(0x80115D00, "int diabquad1x")
del_items(0x80115D04)
SetType(0x80115D04, "int diabquad2x")
del_items(0x80115D08)
SetType(0x80115D08, "int diabquad3x")
del_items(0x80115D0C)
SetType(0x80115D0C, "int diabquad4x")
del_items(0x80115D10)
SetType(0x80115D10, "int diabquad1y")
del_items(0x80115D14)
SetType(0x80115D14, "int diabquad2y")
del_items(0x80115D18)
SetType(0x80115D18, "int diabquad3y")
del_items(0x80115D1C)
SetType(0x80115D1C, "int diabquad4y")
del_items(0x80115D20)
SetType(0x80115D20, "int SP4x1")
del_items(0x80115D24)
SetType(0x80115D24, "int SP4y1")
del_items(0x80115D28)
SetType(0x80115D28, "int SP4x2")
del_items(0x80115D2C)
SetType(0x80115D2C, "int SP4y2")
del_items(0x80115D30)
SetType(0x80115D30, "int l4holdx")
del_items(0x80115D34)
SetType(0x80115D34, "int l4holdy")
del_items(0x801165D8)
SetType(0x801165D8, "unsigned char *lpSetPiece1")
del_items(0x801165DC)
SetType(0x801165DC, "unsigned char *lpSetPiece2")
del_items(0x801165E0)
SetType(0x801165E0, "unsigned char *lpSetPiece3")
del_items(0x801165E4)
SetType(0x801165E4, "unsigned char *lpSetPiece4")
del_items(0x80115D44)
SetType(0x80115D44, "unsigned char SkelKingTrans1[8]")
del_items(0x80115D4C)
SetType(0x80115D4C, "unsigned char SkelKingTrans2[8]")
del_items(0x800D2F48)
SetType(0x800D2F48, "unsigned char SkelKingTrans3[20]")
del_items(0x800D2F5C)
SetType(0x800D2F5C, "unsigned char SkelKingTrans4[28]")
del_items(0x800D2F78)
SetType(0x800D2F78, "unsigned char SkelChamTrans1[20]")
del_items(0x80115D54)
SetType(0x80115D54, "unsigned char SkelChamTrans2[8]")
del_items(0x800D2F8C)
SetType(0x800D2F8C, "unsigned char SkelChamTrans3[36]")
del_items(0x80115E40)
SetType(0x80115E40, "bool DoUiForChooseMonster")
del_items(0x800D2FB0)
SetType(0x800D2FB0, "char *MgToText[34]")
del_items(0x800D3038)
SetType(0x800D3038, "int StoryText[3][3]")
del_items(0x800D305C)
SetType(0x800D305C, "unsigned short dungeon[48][48]")
del_items(0x800D425C)
SetType(0x800D425C, "unsigned char pdungeon[40][40]")
del_items(0x800D489C)
SetType(0x800D489C, "unsigned char dflags[40][40]")
del_items(0x80115E64)
SetType(0x80115E64, "int setpc_x")
del_items(0x80115E68)
SetType(0x80115E68, "int setpc_y")
del_items(0x80115E6C)
SetType(0x80115E6C, "int setpc_w")
del_items(0x80115E70)
SetType(0x80115E70, "int setpc_h")
del_items(0x80115E74)
SetType(0x80115E74, "unsigned char setloadflag")
del_items(0x80115E78)
SetType(0x80115E78, "unsigned char *pMegaTiles")
del_items(0x800D4EDC)
SetType(0x800D4EDC, "unsigned char nBlockTable[2049]")
del_items(0x800D56E0)
SetType(0x800D56E0, "unsigned char nSolidTable[2049]")
del_items(0x800D5EE4)
SetType(0x800D5EE4, "unsigned char nTransTable[2049]")
del_items(0x800D66E8)
SetType(0x800D66E8, "unsigned char nMissileTable[2049]")
del_items(0x800D6EEC)
SetType(0x800D6EEC, "unsigned char nTrapTable[2049]")
del_items(0x80115E7C)
SetType(0x80115E7C, "int dminx")
del_items(0x80115E80)
SetType(0x80115E80, "int dminy")
del_items(0x80115E84)
SetType(0x80115E84, "int dmaxx")
del_items(0x80115E88)
SetType(0x80115E88, "int dmaxy")
del_items(0x80115E8C)
SetType(0x80115E8C, "int gnDifficulty")
del_items(0x80115E90)
SetType(0x80115E90, "unsigned char currlevel")
del_items(0x80115E91)
SetType(0x80115E91, "unsigned char leveltype")
del_items(0x80115E92)
SetType(0x80115E92, "unsigned char setlevel")
del_items(0x80115E93)
SetType(0x80115E93, "unsigned char setlvlnum")
del_items(0x80115E94)
SetType(0x80115E94, "unsigned char setlvltype")
del_items(0x80115E98)
SetType(0x80115E98, "int ViewX")
del_items(0x80115E9C)
SetType(0x80115E9C, "int ViewY")
del_items(0x80115EA0)
SetType(0x80115EA0, "int ViewDX")
del_items(0x80115EA4)
SetType(0x80115EA4, "int ViewDY")
del_items(0x80115EA8)
SetType(0x80115EA8, "int ViewBX")
del_items(0x80115EAC)
SetType(0x80115EAC, "int ViewBY")
del_items(0x800D76F0)
SetType(0x800D76F0, "struct ScrollStruct ScrollInfo")
del_items(0x80115EB0)
SetType(0x80115EB0, "int LvlViewX")
del_items(0x80115EB4)
SetType(0x80115EB4, "int LvlViewY")
del_items(0x80115EB8)
SetType(0x80115EB8, "int btmbx")
del_items(0x80115EBC)
SetType(0x80115EBC, "int btmby")
del_items(0x80115EC0)
SetType(0x80115EC0, "int btmdx")
del_items(0x80115EC4)
SetType(0x80115EC4, "int btmdy")
del_items(0x80115EC8)
SetType(0x80115EC8, "int MicroTileLen")
del_items(0x80115ECC)
SetType(0x80115ECC, "char TransVal")
del_items(0x800D7704)
SetType(0x800D7704, "bool TransList[8]")
del_items(0x80115ED0)
SetType(0x80115ED0, "int themeCount")
del_items(0x800D7724)
SetType(0x800D7724, "struct map_info dung_map[108][108]")
del_items(0x800F99E4)
SetType(0x800F99E4, "unsigned char dung_map_r[54][54]")
del_items(0x800FA548)
SetType(0x800FA548, "unsigned char dung_map_g[54][54]")
del_items(0x800FB0AC)
SetType(0x800FB0AC, "unsigned char dung_map_b[54][54]")
del_items(0x800FBC10)
SetType(0x800FBC10, "struct MINIXY MinisetXY[17]")
del_items(0x80115E5C)
SetType(0x80115E5C, "unsigned char *pSetPiece")
del_items(0x80115E60)
SetType(0x80115E60, "int DungSize")
del_items(0x800FBDDC)
SetType(0x800FBDDC, "struct ThemeStruct theme[50]")
del_items(0x80115F10)
SetType(0x80115F10, "int numthemes")
del_items(0x80115F14)
SetType(0x80115F14, "int zharlib")
del_items(0x80115F18)
SetType(0x80115F18, "unsigned char armorFlag")
del_items(0x80115F19)
SetType(0x80115F19, "unsigned char bCrossFlag")
del_items(0x80115F1A)
SetType(0x80115F1A, "unsigned char weaponFlag")
del_items(0x80115F1C)
SetType(0x80115F1C, "int themex")
del_items(0x80115F20)
SetType(0x80115F20, "int themey")
del_items(0x80115F24)
SetType(0x80115F24, "int themeVar1")
del_items(0x80115F28)
SetType(0x80115F28, "unsigned char bFountainFlag")
del_items(0x80115F29)
SetType(0x80115F29, "unsigned char cauldronFlag")
del_items(0x80115F2A)
SetType(0x80115F2A, "unsigned char mFountainFlag")
del_items(0x80115F2B)
SetType(0x80115F2B, "unsigned char pFountainFlag")
del_items(0x80115F2C)
SetType(0x80115F2C, "unsigned char tFountainFlag")
del_items(0x80115F2D)
SetType(0x80115F2D, "unsigned char treasureFlag")
del_items(0x80115F30)
SetType(0x80115F30, "unsigned char ThemeGoodIn[4]")
del_items(0x800FBCBC)
SetType(0x800FBCBC, "int ThemeGood[4]")
del_items(0x800FBCCC)
SetType(0x800FBCCC, "int trm5x[25]")
del_items(0x800FBD30)
SetType(0x800FBD30, "int trm5y[25]")
del_items(0x800FBD94)
SetType(0x800FBD94, "int trm3x[9]")
del_items(0x800FBDB8)
SetType(0x800FBDB8, "int trm3y[9]")
del_items(0x80115FE8)
SetType(0x80115FE8, "int nummissiles")
del_items(0x800FBFF4)
SetType(0x800FBFF4, "int missileactive[125]")
del_items(0x800FC1E8)
SetType(0x800FC1E8, "int missileavail[125]")
del_items(0x80115FEC)
SetType(0x80115FEC, "unsigned char MissilePreFlag")
del_items(0x800FC3DC)
SetType(0x800FC3DC, "struct MissileStruct missile[125]")
del_items(0x80115FED)
SetType(0x80115FED, "unsigned char ManashieldFlag")
del_items(0x80115FEE)
SetType(0x80115FEE, "unsigned char ManashieldFlag2")
del_items(0x800FBF6C)
SetType(0x800FBF6C, "int XDirAdd[8]")
del_items(0x800FBF8C)
SetType(0x800FBF8C, "int YDirAdd[8]")
del_items(0x80115FD5)
SetType(0x80115FD5, "unsigned char fadetor")
del_items(0x80115FD6)
SetType(0x80115FD6, "unsigned char fadetog")
del_items(0x80115FD7)
SetType(0x80115FD7, "unsigned char fadetob")
del_items(0x800FBFAC)
SetType(0x800FBFAC, "unsigned char ValueTable[16]")
del_items(0x800FBFBC)
SetType(0x800FBFBC, "unsigned char StringTable[9][6]")
del_items(0x800FEC8C)
SetType(0x800FEC8C, "struct MonsterStruct monster[200]")
del_items(0x8011604C)
SetType(0x8011604C, "long nummonsters")
del_items(0x8010440C)
SetType(0x8010440C, "short monstactive[200]")
del_items(0x8010459C)
SetType(0x8010459C, "short monstkills[200]")
del_items(0x8010472C)
SetType(0x8010472C, "struct CMonster Monsters[16]")
del_items(0x80116050)
SetType(0x80116050, "long monstimgtot")
del_items(0x80116054)
SetType(0x80116054, "char totalmonsters")
del_items(0x80116058)
SetType(0x80116058, "int uniquetrans")
del_items(0x801165E8)
SetType(0x801165E8, "unsigned char sgbSaveSoundOn")
del_items(0x80116020)
SetType(0x80116020, "char offset_x[8]")
del_items(0x80116028)
SetType(0x80116028, "char offset_y[8]")
del_items(0x80116008)
SetType(0x80116008, "char left[8]")
del_items(0x80116010)
SetType(0x80116010, "char right[8]")
del_items(0x80116018)
SetType(0x80116018, "char opposite[8]")
del_items(0x80115FFC)
SetType(0x80115FFC, "int nummtypes")
del_items(0x80116000)
SetType(0x80116000, "char animletter[7]")
del_items(0x800FEAEC)
SetType(0x800FEAEC, "int MWVel[3][24]")
del_items(0x80116030)
SetType(0x80116030, "char rnd5[4]")
del_items(0x80116034)
SetType(0x80116034, "char rnd10[4]")
del_items(0x80116038)
SetType(0x80116038, "char rnd20[4]")
del_items(0x8011603C)
SetType(0x8011603C, "char rnd60[4]")
del_items(0x800FEC0C)
SetType(0x800FEC0C, "void (*AiProc[32])()")
del_items(0x80104C04)
SetType(0x80104C04, "struct MonsterData monsterdata[112]")
del_items(0x80106644)
SetType(0x80106644, "char MonstConvTbl[128]")
del_items(0x801066C4)
SetType(0x801066C4, "char MonstAvailTbl[112]")
del_items(0x80106734)
SetType(0x80106734, "struct UniqMonstStruct UniqMonst[98]")
del_items(0x801049EC)
SetType(0x801049EC, "int TransPals[134]")
del_items(0x801048EC)
SetType(0x801048EC, "struct STONEPAL StonePals[32]")
del_items(0x80116084)
SetType(0x80116084, "unsigned char invflag")
del_items(0x80116085)
SetType(0x80116085, "unsigned char drawsbarflag")
del_items(0x80116088)
SetType(0x80116088, "int InvBackY")
del_items(0x8011608C)
SetType(0x8011608C, "int InvCursPos")
del_items(0x801076DC)
SetType(0x801076DC, "unsigned char InvSlotTable[73]")
del_items(0x80116090)
SetType(0x80116090, "int InvBackAY")
del_items(0x80116094)
SetType(0x80116094, "int InvSel")
del_items(0x80116098)
SetType(0x80116098, "int ItemW")
del_items(0x8011609C)
SetType(0x8011609C, "int ItemH")
del_items(0x801160A0)
SetType(0x801160A0, "int ItemNo")
del_items(0x801160A4)
SetType(0x801160A4, "struct RECT BRect")
del_items(0x80116078)
SetType(0x80116078, "struct TextDat *InvPanelTData")
del_items(0x8011607C)
SetType(0x8011607C, "struct TextDat *InvGfxTData")
del_items(0x80116074)
SetType(0x80116074, "int InvPageNo")
del_items(0x80107064)
SetType(0x80107064, "int AP2x2Tbl[10]")
del_items(0x8010708C)
SetType(0x8010708C, "struct InvXY InvRect[73]")
del_items(0x801072D4)
SetType(0x801072D4, "int InvGfxTable[168]")
del_items(0x80107574)
SetType(0x80107574, "unsigned char InvItemWidth[180]")
del_items(0x80107628)
SetType(0x80107628, "unsigned char InvItemHeight[180]")
del_items(0x80116080)
SetType(0x80116080, "unsigned long sgdwLastTime")
del_items(0x801160CE)
SetType(0x801160CE, "unsigned char automapflag")
del_items(0x80107728)
SetType(0x80107728, "unsigned char automapview[40][5]")
del_items(0x801077F0)
SetType(0x801077F0, "unsigned short automaptype[512]")
del_items(0x801160CF)
SetType(0x801160CF, "unsigned char AMLWallFlag")
del_items(0x801160D0)
SetType(0x801160D0, "unsigned char AMRWallFlag")
del_items(0x801160D1)
SetType(0x801160D1, "unsigned char AMLLWallFlag")
del_items(0x801160D2)
SetType(0x801160D2, "unsigned char AMLRWallFlag")
del_items(0x801160D3)
SetType(0x801160D3, "unsigned char AMDirtFlag")
del_items(0x801160D4)
SetType(0x801160D4, "unsigned char AMColumnFlag")
del_items(0x801160D5)
SetType(0x801160D5, "unsigned char AMStairFlag")
del_items(0x801160D6)
SetType(0x801160D6, "unsigned char AMLDoorFlag")
del_items(0x801160D7)
SetType(0x801160D7, "unsigned char AMLGrateFlag")
del_items(0x801160D8)
SetType(0x801160D8, "unsigned char AMLArchFlag")
del_items(0x801160D9)
SetType(0x801160D9, "unsigned char AMRDoorFlag")
del_items(0x801160DA)
SetType(0x801160DA, "unsigned char AMRGrateFlag")
del_items(0x801160DB)
SetType(0x801160DB, "unsigned char AMRArchFlag")
del_items(0x801160DC)
SetType(0x801160DC, "int AutoMapX")
del_items(0x801160E0)
SetType(0x801160E0, "int AutoMapY")
del_items(0x801160E4)
SetType(0x801160E4, "int AutoMapXOfs")
del_items(0x801160E8)
SetType(0x801160E8, "int AutoMapYOfs")
del_items(0x801160EC)
SetType(0x801160EC, "int AMPlayerX")
del_items(0x801160F0)
SetType(0x801160F0, "int AMPlayerY")
del_items(0x801160B8)
SetType(0x801160B8, "int AutoMapScale")
del_items(0x801160BC)
SetType(0x801160BC, "unsigned char AutoMapPlayerR")
del_items(0x801160BD)
SetType(0x801160BD, "unsigned char AutoMapPlayerG")
del_items(0x801160BE)
SetType(0x801160BE, "unsigned char AutoMapPlayerB")
del_items(0x801160BF)
SetType(0x801160BF, "unsigned char AutoMapWallR")
del_items(0x801160C0)
SetType(0x801160C0, "unsigned char AutoMapWallG")
del_items(0x801160C1)
SetType(0x801160C1, "unsigned char AutoMapWallB")
del_items(0x801160C2)
SetType(0x801160C2, "unsigned char AutoMapDoorR")
del_items(0x801160C3)
SetType(0x801160C3, "unsigned char AutoMapDoorG")
del_items(0x801160C4)
SetType(0x801160C4, "unsigned char AutoMapDoorB")
del_items(0x801160C5)
SetType(0x801160C5, "unsigned char AutoMapColumnR")
del_items(0x801160C6)
SetType(0x801160C6, "unsigned char AutoMapColumnG")
del_items(0x801160C7)
SetType(0x801160C7, "unsigned char AutoMapColumnB")
del_items(0x801160C8)
SetType(0x801160C8, "unsigned char AutoMapArchR")
del_items(0x801160C9)
SetType(0x801160C9, "unsigned char AutoMapArchG")
del_items(0x801160CA)
SetType(0x801160CA, "unsigned char AutoMapArchB")
del_items(0x801160CB)
SetType(0x801160CB, "unsigned char AutoMapStairR")
del_items(0x801160CC)
SetType(0x801160CC, "unsigned char AutoMapStairG")
del_items(0x801160CD)
SetType(0x801160CD, "unsigned char AutoMapStairB")
del_items(0x80116744)
SetType(0x80116744, "unsigned long GazTick")
del_items(0x8011D068)
SetType(0x8011D068, "unsigned long RndTabs[6]")
del_items(0x800A37F8)
SetType(0x800A37F8, "unsigned long DefaultRnd[6]")
del_items(0x8011676C)
SetType(0x8011676C, "void (*PollFunc)()")
del_items(0x80116750)
SetType(0x80116750, "void (*MsgFunc)()")
del_items(0x8011679C)
SetType(0x8011679C, "void (*ErrorFunc)()")
del_items(0x80116670)
SetType(0x80116670, "struct TASK *ActiveTasks")
del_items(0x80116674)
SetType(0x80116674, "struct TASK *CurrentTask")
del_items(0x80116678)
SetType(0x80116678, "struct TASK *T")
del_items(0x8011667C)
SetType(0x8011667C, "unsigned long MemTypeForTasker")
del_items(0x8011A898)
SetType(0x8011A898, "int SchEnv[12]")
del_items(0x80116680)
SetType(0x80116680, "unsigned long ExecId")
del_items(0x80116684)
SetType(0x80116684, "unsigned long ExecMask")
del_items(0x80116688)
SetType(0x80116688, "int TasksActive")
del_items(0x8011668C)
SetType(0x8011668C, "void (*EpiFunc)()")
del_items(0x80116690)
SetType(0x80116690, "void (*ProFunc)()")
del_items(0x80116694)
SetType(0x80116694, "unsigned long EpiProId")
del_items(0x80116698)
SetType(0x80116698, "unsigned long EpiProMask")
del_items(0x8011669C)
SetType(0x8011669C, "void (*DoTasksPrologue)()")
del_items(0x801166A0)
SetType(0x801166A0, "void (*DoTasksEpilogue)()")
del_items(0x801166A4)
SetType(0x801166A4, "void (*StackFloodCallback)()")
del_items(0x801166A8)
SetType(0x801166A8, "unsigned char ExtraStackProtection")
del_items(0x801166AC)
SetType(0x801166AC, "int ExtraStackSizeLongs")
del_items(0x80116758)
SetType(0x80116758, "void *LastPtr")
del_items(0x800A3830)
SetType(0x800A3830, "struct MEM_INFO WorkMemInfo")
del_items(0x801166B0)
SetType(0x801166B0, "struct MEM_INIT_INFO *MemInitBlocks")
del_items(0x8011A8C8)
SetType(0x8011A8C8, "struct MEM_HDR MemHdrBlocks[140]")
del_items(0x801166B4)
SetType(0x801166B4, "struct MEM_HDR *FreeBlocks")
del_items(0x801166B8)
SetType(0x801166B8, "enum GAL_ERROR_CODE LastError")
del_items(0x801166BC)
SetType(0x801166BC, "int TimeStamp")
del_items(0x801166C0)
SetType(0x801166C0, "unsigned char FullErrorChecking")
del_items(0x801166C4)
SetType(0x801166C4, "unsigned long LastAttemptedAlloc")
del_items(0x801166C8)
SetType(0x801166C8, "unsigned long LastDeallocedBlock")
del_items(0x801166CC)
SetType(0x801166CC, "enum GAL_VERB_LEV VerbLev")
del_items(0x801166D0)
SetType(0x801166D0, "int NumOfFreeHdrs")
del_items(0x801166D4)
SetType(0x801166D4, "unsigned long LastTypeAlloced")
del_items(0x801166D8)
SetType(0x801166D8, "void (*AllocFilter)()")
del_items(0x800A3838)
SetType(0x800A3838, "char *GalErrors[10]")
del_items(0x800A3860)
SetType(0x800A3860, "struct MEM_INIT_INFO PhantomMem")
del_items(0x8011BA48)
SetType(0x8011BA48, "char buf[4992]")
del_items(0x800A3888)
SetType(0x800A3888, "char NULL_REP[7]")
| 33.407823 | 67 | 0.815414 | 11,130 | 92,239 | 6.604762 | 0.266757 | 0.150182 | 0.008448 | 0.000925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.264379 | 0.067336 | 92,239 | 2,760 | 68 | 33.419928 | 0.590122 | 0 | 0 | 0 | 0 | 0 | 0.311788 | 0.006993 | 0 | 0 | 0.299223 | 0 | 0 | 1 | 0 | true | 0.000362 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7a66397e7772830697bee3478cb657c01b06a8bc | 655 | py | Python | src/aspire/utils/em.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | src/aspire/utils/em.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | 5 | 2019-06-07T13:25:29.000Z | 2019-06-18T20:34:37.000Z | src/aspire/utils/em.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | 1 | 2019-06-18T17:41:52.000Z | 2019-06-18T17:41:52.000Z | """
Utility functions for Electron-Microscopy
"""
import math
def voltage_to_wavelength(voltage):
"""
Convert from electron voltage to wavelength.
:param voltage: float, The electron voltage in kV.
:return: float, The electron wavelength in nm.
"""
return 12.2643247 / math.sqrt(voltage*1e3 + 0.978466*voltage**2)
def wavelength_to_voltage(wavelength):
"""
Convert from electron voltage to wavelength.
:param wavelength: float, The electron wavelength in nm.
:return: float, The electron voltage in kV.
"""
return (-1e3 + math.sqrt(1e6 + 4 * 12.2643247**2 * 0.978466 / wavelength**2)) / (2 * 0.978466)
| 27.291667 | 98 | 0.680916 | 86 | 655 | 5.139535 | 0.337209 | 0.135747 | 0.144796 | 0.117647 | 0.506787 | 0.506787 | 0.506787 | 0 | 0 | 0 | 0 | 0.095785 | 0.203053 | 655 | 23 | 99 | 28.478261 | 0.750958 | 0.503817 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0 | 1 | 0 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
7a679d1a00efd7ff99cef00976d5ad2c0db00094 | 268 | py | Python | 1 MyPractice/A_Tutorials/Socratica/2InteractiveHelp.py | Davidjbennett/DavidBennett.github.io | 09a2652b7ace8741bf23c6432abd58ee790b9f0c | [
"MIT"
] | 3 | 2021-05-18T16:17:29.000Z | 2022-01-20T15:46:59.000Z | 1 MyPractice/A_Tutorials/Socratica/2InteractiveHelp.py | Davidjbennett/DavidBennett | 09a2652b7ace8741bf23c6432abd58ee790b9f0c | [
"MIT"
] | null | null | null | 1 MyPractice/A_Tutorials/Socratica/2InteractiveHelp.py | Davidjbennett/DavidBennett | 09a2652b7ace8741bf23c6432abd58ee790b9f0c | [
"MIT"
] | null | null | null | import math
print(dir()) #short for directory
#print(dir(__builtins__)) #containes many functions and types
help(pow) #shows documentation for specific function
print(pow(2,10),"\n")
help(hex)
print("\n", hex(10))
print(0xa,"\n")
#help('modules')
print(dir(math))
| 17.866667 | 61 | 0.712687 | 41 | 268 | 4.560976 | 0.609756 | 0.128342 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025105 | 0.108209 | 268 | 14 | 62 | 19.142857 | 0.757322 | 0.5 | 0 | 0 | 0 | 0 | 0.046512 | 0 | 0 | 0 | 0.023256 | 0 | 0 | 1 | 0 | true | 0 | 0.125 | 0 | 0.125 | 0.625 | 0 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
7a67bebe0580d55980e54fbc6f55a144c53ec12f | 7,953 | py | Python | voicefixer/vocoder/config.py | ishine/voicefixer | 0966a2f39096575cf8ae3fed8b53daf2f4512f35 | [
"MIT"
] | 159 | 2021-09-26T08:09:45.000Z | 2022-03-30T07:51:02.000Z | voicefixer/vocoder/config.py | ishine/voicefixer | 0966a2f39096575cf8ae3fed8b53daf2f4512f35 | [
"MIT"
] | 15 | 2021-09-30T04:28:09.000Z | 2022-03-27T05:06:32.000Z | voicefixer/vocoder/config.py | ishine/voicefixer | 0966a2f39096575cf8ae3fed8b53daf2f4512f35 | [
"MIT"
] | 32 | 2021-09-27T03:24:01.000Z | 2022-03-30T07:52:15.000Z | import torch
import numpy as np
import os
from voicefixer.tools.path import root_path
class Config:
@classmethod
def refresh(cls, sr):
if sr == 44100:
Config.ckpt = os.path.join(
os.path.expanduser("~"),
".cache/voicefixer/synthesis_module/44100/model.ckpt-1490000_trimed.pt",
)
Config.cond_channels = 512
Config.m_channels = 768
Config.resstack_depth = [8, 8, 8, 8]
Config.channels = 1024
Config.cin_channels = 128
Config.upsample_scales = [7, 7, 3, 3]
Config.num_mels = 128
Config.n_fft = 2048
Config.hop_length = 441
Config.sample_rate = 44100
Config.fmax = 22000
Config.mel_win = 128
Config.local_condition_dim = 128
else:
raise RuntimeError(
"Error: Vocoder currently only support 44100 samplerate."
)
ckpt = os.path.join(
os.path.expanduser("~"),
".cache/voicefixer/synthesis_module/44100/model.ckpt-1490000_trimed.pt",
)
m_channels = 384
bits = 10
opt = "Ralamb"
cond_channels = 256
clip = 0.5
num_bands = 1
cin_channels = 128
upsample_scales = [7, 7, 3, 3]
filterbands = "test/filterbanks_4bands.dat"
##For inference
tag = ""
min_db = -115
num_mels = 128
n_fft = 2048
hop_length = 441
win_size = None
sample_rate = 44100
frame_shift_ms = None
trim_fft_size = 512
trim_hop_size = 128
trim_top_db = 23
signal_normalization = True
allow_clipping_in_normalization = True
symmetric_mels = True
max_abs_value = 4.0
preemphasis = 0.85
min_level_db = -100
ref_level_db = 20
fmin = 50
fmax = 22000
power = 1.5
griffin_lim_iters = 60
rescale = False
rescaling_max = 0.95
trim_silence = False
clip_mels_length = True
max_mel_frames = 2000
mel_win = 128
batch_size = 24
g_learning_rate = 0.001
d_learning_rate = 0.001
warmup_steps = 100000
decay_learning_rate = 0.5
exponential_moving_average = True
ema_decay = 0.99
reset_opt = False
reset_g_opt = False
reset_d_opt = False
local_condition_dim = 128
lambda_update_G = 1
multiscale_D = 3
lambda_adv = 4.0
lambda_fm_loss = 0.0
lambda_sc_loss = 5.0
lambda_mag_loss = 5.0
lambda_mel_loss = 50.0
use_mle_loss = False
lambda_mle_loss = 5.0
lambda_freq_loss = 2.0
lambda_energy_loss = 100.0
lambda_t_loss = 200.0
lambda_phase_loss = 100.0
lambda_f0_loss = 1.0
use_elu = False
de_preem = False # train
up_org = False
use_one = True
use_small_D = False
use_condnet = True
use_depreem = False # inference
use_msd = False
model_type = "tfgan" # or bytewave, frame level vocoder using istft
use_hjcud = False
no_skip = False
out_channels = 1
use_postnet = False # wn in postnet
use_wn = False # wn in resstack
up_type = "transpose"
use_smooth = False
use_drop = False
use_shift_scale = False
use_gcnn = False
resstack_depth = [6, 6, 6, 6]
kernel_size = [3, 3, 3, 3]
channels = 512
use_f0_loss = False
use_sine = False
use_cond_rnn = False
use_rnn = False
f0_step = 120
use_lowfreq_loss = False
lambda_lowfreq_loss = 1.0
use_film = False
use_mb_mr_gan = False
use_mssl = False
use_ml_gan = False
use_mb_gan = True
use_mpd = False
use_spec_gan = True
use_rwd = False
use_mr_gan = True
use_pqmf_rwd = False
no_sine = False
use_frame_mask = False
lambda_var_loss = 0.0
discriminator_train_start_steps = 40000 # 80k
aux_d_train_start_steps = 40000 # 100k
rescale_out = 0.40
use_dist = True
dist_backend = "nccl"
dist_url = "tcp://localhost:12345"
world_size = 1
mel_weight_torch = torch.tensor(
[
19.40951426,
19.94047336,
20.4859038,
21.04629067,
21.62194148,
22.21335214,
22.8210215,
23.44529231,
24.08660962,
24.74541882,
25.42234287,
26.11770576,
26.83212784,
27.56615283,
28.32007747,
29.0947679,
29.89060111,
30.70832636,
31.54828121,
32.41121487,
33.29780773,
34.20865341,
35.14437675,
36.1056621,
37.09332763,
38.10795802,
39.15039691,
40.22119881,
41.32154931,
42.45172373,
43.61293329,
44.80609379,
46.031602,
47.29070223,
48.58427549,
49.91327905,
51.27863232,
52.68119708,
54.1222372,
55.60274206,
57.12364703,
58.68617876,
60.29148652,
61.94081306,
63.63501986,
65.37562658,
67.16408954,
69.00109084,
70.88850318,
72.82736101,
74.81985537,
76.86654792,
78.96885475,
81.12900906,
83.34840929,
85.62810662,
87.97005418,
90.37689804,
92.84887686,
95.38872881,
97.99777002,
100.67862715,
103.43232942,
106.26140638,
109.16827015,
112.15470471,
115.22184756,
118.37439245,
121.6122689,
124.93877158,
128.35661454,
131.86761321,
135.47417938,
139.18059494,
142.98713744,
146.89771854,
150.91684347,
155.0446638,
159.28614648,
163.64270198,
168.12035831,
172.71749158,
177.44220154,
182.29556933,
187.28286676,
192.40502126,
197.6682721,
203.07516896,
208.63088733,
214.33770931,
220.19910108,
226.22363072,
232.41087124,
238.76803591,
245.30079083,
252.01064464,
258.90261676,
265.98474,
273.26010248,
280.73496362,
288.41440094,
296.30489752,
304.41180337,
312.7377183,
321.28877878,
330.07870237,
339.10812951,
348.38276173,
357.91393924,
367.70513992,
377.76413924,
388.09467408,
398.70920178,
409.61813793,
420.81980127,
432.33215467,
444.16083117,
456.30919947,
468.78589276,
481.61325588,
494.78824596,
508.31969844,
522.2238331,
536.51163441,
551.18859414,
566.26142988,
581.75006061,
597.66210737,
]
)
x_orig = np.linspace(1, mel_weight_torch.shape[0], num=mel_weight_torch.shape[0])
x_orig_torch = torch.linspace(
1, mel_weight_torch.shape[0], steps=mel_weight_torch.shape[0]
)
@classmethod
def get_mel_weight(cls, percent=1, a=18.8927416350036, b=0.0269863588184314):
b = percent * b
def func(a, b, x):
return a * np.exp(b * x)
return func(a, b, Config.x_orig)
@classmethod
def get_mel_weight_torch(cls, percent=1, a=18.8927416350036, b=0.0269863588184314):
b = percent * b
def func(a, b, x):
return a * torch.exp(b * x)
return func(a, b, Config.x_orig_torch)
| 25.088328 | 88 | 0.530995 | 921 | 7,953 | 4.378936 | 0.52443 | 0.029755 | 0.020828 | 0.018845 | 0.13935 | 0.116539 | 0.107612 | 0.093231 | 0.093231 | 0.093231 | 0 | 0.342469 | 0.38979 | 7,953 | 316 | 89 | 25.167722 | 0.488564 | 0.014083 | 0 | 0.037671 | 0 | 0 | 0.034091 | 0.023749 | 0 | 0 | 0 | 0 | 0 | 1 | 0.017123 | false | 0 | 0.013699 | 0.006849 | 0.441781 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7a92082d3d523c6edc93f0763c489fce6fec5488 | 3,612 | py | Python | src/TypeChecker.py | leveryd/PlayWithCompiler | 0701fbb7d94512e3af05a95266e0fdc562b3d40c | [
"MIT"
] | 8 | 2021-01-16T09:29:54.000Z | 2022-03-25T11:22:09.000Z | src/TypeChecker.py | leveryd/PlayWithCompiler | 0701fbb7d94512e3af05a95266e0fdc562b3d40c | [
"MIT"
] | null | null | null | src/TypeChecker.py | leveryd/PlayWithCompiler | 0701fbb7d94512e3af05a95266e0fdc562b3d40c | [
"MIT"
] | null | null | null | # coding:utf-8
"""
类型检查:
1. 检查赋值是否正确
2. 变量初始化;
3. 表达式里的一些运算,比如加减乘除,是否类型匹配;
4. 返回值的类型; [这个还没有做]
"""
from dist.PlayScriptListener import PlayScriptListener
from dist.PlayScriptParser import PlayScriptParser
from src.DataStructures import *
class TypeChecker(PlayScriptListener):
def __init__(self, ast_tree):
self.ast = ast_tree
self.compile_error_list = []
def exitExpression(self, ctx):
"""
:param ctx:
:return:
"""
if ctx.bop is not None and ctx.bop.text == "+":
pass
elif ctx.bop is not None and ctx.bop.text == "=":
ll = NodeAndType.get_type_of_node(ctx.expression(0))
# 检查左边expression是否是变量
if not isinstance(ll, VariableSymbol):
err_msg = "assign left must be a variable,can't be %s = %s" % (ctx.expression(0).getText(),
ctx.expression(1).getText())
err_line = ctx.expression(0).start.line
self.compile_error_list.append(CompileError(err_msg, err_line))
return
# 检查左边变量类型和右边表达式类型是否相等
rr = NodeAndType.get_type_of_node(ctx.expression(1))
rr.update_self()
if isinstance(rr, VariableSymbol):
flag = type(rr.type) == type(ll.type)
else:
flag = type(rr) == type(ll.type)
if flag is False:
err_msg = "left's type is not equal right's type,%s = %s" % (ctx.expression(0).getText(),
ctx.expression(1).getText())
err_line = ctx.expression(0).start.line
self.compile_error_list.append(CompileError(err_msg, err_line))
def exitFunctionCall(self, ctx):
"""
:param ctx:
:return:
"""
# symbol = NodeAndSymbol.get_symbol_of_node(ctx.)
# 内置函数没有symbol,暂时先给snoopy_print加白
if ctx.IDENTIFIER().getText() in ["snoopy_print"]:
pass
else:
symbol = NodeScopeMap.get_symbol(ctx, ctx.IDENTIFIER().getText())
if isinstance(ctx.parentCtx, PlayScriptParser.ExpressionContext): # 类调用
return # TODO:更详细地检查类方法
if isinstance(symbol, ClassSymbol): # 类初始化
pass
elif isinstance(symbol, FunctionSymbol):
pass
elif isinstance(symbol, VariableSymbol) and isinstance(symbol.type, FunctionSymbol): # 检查是否闭包函数
pass
else:
err_msg = "'%s' '%s' is not function" % (ctx.getText(), ctx.IDENTIFIER().getText())
err_line = ctx.start.line
self.compile_error_list.append(CompileError(err_msg, err_line))
def exitVariableDeclarator(self, ctx):
"""
:param ctx:
:return:
"""
if ctx.variableInitializer() is not None:
variable_name = ctx.variableDeclaratorId().IDENTIFIER().getText()
ll = NodeScopeMap.get_symbol(ctx, variable_name)
rr = NodeAndType.get_type_of_node(ctx.variableInitializer().expression()) # TODO:支持数组
if isinstance(rr, type(ll.type)) is False:
err_msg = "declare variable type does not match right,%s = %s" % (variable_name,
ctx.variableInitializer().getText())
err_line = ctx.start.line
self.compile_error_list.append(CompileError(err_msg, err_line))
| 38.83871 | 113 | 0.550941 | 370 | 3,612 | 5.237838 | 0.294595 | 0.053664 | 0.04128 | 0.0516 | 0.330753 | 0.319917 | 0.319917 | 0.240454 | 0.240454 | 0.211558 | 0 | 0.005497 | 0.345238 | 3,612 | 92 | 114 | 39.26087 | 0.813953 | 0.08804 | 0 | 0.357143 | 0 | 0 | 0.056847 | 0 | 0 | 0 | 0 | 0.021739 | 0 | 1 | 0.071429 | false | 0.089286 | 0.053571 | 0 | 0.178571 | 0.017857 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
7ab674f9cee64f6395f521ac99930ad93c5cdb4a | 2,006 | py | Python | Lesson_3/List.py | mirdinemris/Python_lesson_2 | bf2fce1dbd6ae635d6aa631703b9930b164972b0 | [
"MIT"
] | null | null | null | Lesson_3/List.py | mirdinemris/Python_lesson_2 | bf2fce1dbd6ae635d6aa631703b9930b164972b0 | [
"MIT"
] | 1 | 2020-04-14T14:13:57.000Z | 2020-04-14T14:13:57.000Z | Lesson_3/List.py | mirdinemris/Python_lesson_2 | bf2fce1dbd6ae635d6aa631703b9930b164972b0 | [
"MIT"
] | null | null | null | # Тип данных - список (List)
# Инициализация (генераторы)
list_temp = [] # Пустой список
print(type(list_temp))
list_temp = [1.2, 123, 'Volvo', [1,2,3,]]
for el in list_temp:
print(el, type(el))
# инициализация с помощью команды - list
list_str = list('Volvo')
print(list_str)
# Обращение к элементам списка, подсписки
for i in range(len(list_temp)):
print(i, ':', list_temp[i])
for i in range(len(list_temp)):
print(i, ':', list_temp[i:])
for i in range(len(list_temp)):
print(i, ':', list_temp[:i])
# Функции со списками
print(len(list_temp))
# Опреции со списками
print(list_temp + list_str)
print(list_temp*2)
# Методы
# append - для добавления в конец
integer_list = []
for i in range(5):
integer_list.append(i)
print(integer_list)
integer_list.append(100)
print(integer_list)
# remove - метод удаления элемента из списка
integer_list.remove(3) # удаляет первый встретившийся элемент
print(integer_list)
del integer_list[1] # удаляет по индексу
print(integer_list)
# reverse
integer_list.reverse()
print(integer_list)
# sort
integer_list = [1, 4,2, 8, 6, 98, 2]
integer_list.sort()
print(integer_list)
# insert
integer_list.insert(2, 100) # (индекс, значение)
print(integer_list)
# Обработка списков (map, filter, reduce)
# map - функция применяемая к каждому элементу списка
integer_list = [9,2,4,5,8,7]
# map(function, list) -----> map ------> list(map)
new_integer_list = list(map(lambda x: x**2, integer_list))
print(new_integer_list)
new_integer_list = list(map(str, new_integer_list))
print(new_integer_list)
# filter - фильтрация списка согласно некоторому условию
integer_list = [9,2,4,5,8,7]
new_integer_list = list(filter(lambda x: x<5, integer_list))
print(new_integer_list)
# reduce - применяется ко всем элементам списка возвращая им один определенный элемент
from functools import reduce
integer_list = [1,2,3,4]
sum = reduce(lambda x,y: x+y, integer_list)
product = reduce(lambda x,y: x*y, integer_list)
print(sum, product)
| 25.075 | 86 | 0.720837 | 317 | 2,006 | 4.394322 | 0.302839 | 0.236899 | 0.080402 | 0.031587 | 0.237617 | 0.207466 | 0.142857 | 0.142857 | 0.079684 | 0.079684 | 0 | 0.026316 | 0.147557 | 2,006 | 79 | 87 | 25.392405 | 0.788304 | 0.321037 | 0 | 0.326087 | 0 | 0 | 0.009701 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.021739 | 0 | 0.021739 | 0.434783 | 0 | 0 | 0 | null | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.