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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9ea4c6c4578a83085f65776e18b173f05c84e8b2 | 16,305 | py | Python | measure_mate/tests/api/test_measurement.py | niche-tester/measure-mate | c3acba57747bcb89fe0c6b9509ec90f04a581506 | [
"MIT"
] | 15 | 2015-12-14T02:20:31.000Z | 2022-01-30T04:36:39.000Z | measure_mate/tests/api/test_measurement.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 1,403 | 2017-02-16T01:00:04.000Z | 2022-03-15T21:12:13.000Z | measure_mate/tests/api/test_measurement.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 10 | 2015-12-18T01:30:46.000Z | 2022-01-30T04:36:41.000Z | from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from measure_mate.models import Measurement
from measure_mate.tests.factories import TemplateFactory, AttributeFactory, RatingFactory, AssessmentFactory, \
MeasurementFactory
class MeasurementAPITestCases(APITestCase):
def test_search_measurement(self):
"""
Should return one measurement that matches the rating, assessment combo.
One measurement relates to a rating that is not in the scope of the search.
"""
template = TemplateFactory()
attribute1 = AttributeFactory(template=template)
attribute2 = AttributeFactory(template=template)
rating_in_scope = RatingFactory(attribute=attribute1)
rating_out_of_scope = RatingFactory(attribute=attribute2)
assessment = AssessmentFactory(template=template)
measurement1 = MeasurementFactory(assessment=assessment, attribute=attribute1, rating=rating_in_scope)
measurement2 = MeasurementFactory(assessment=assessment, attribute=attribute2, rating=rating_out_of_scope)
url = "%s?assessment__id=%d&attribute__id=%d" % (reverse('measurement-list'), assessment.id, attribute1.id)
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data[0]['id'], measurement1.id)
self.assertEqual(response.data[0]['rating'], rating_in_scope.id)
self.assertEqual(len(response.data), 1)
def test_search_measurement2(self):
"""
Should return zero measurements as the api search is for a different assessment
"""
template = TemplateFactory()
attribute = AttributeFactory(template=template)
rating_in_scope1 = RatingFactory(attribute=attribute)
rating_in_scope2 = RatingFactory(attribute=attribute)
assessment1 = AssessmentFactory(template=template)
assessment2 = AssessmentFactory(template=template)
assessment3 = AssessmentFactory()
measurement1 = MeasurementFactory(assessment=assessment1, attribute=attribute, rating=rating_in_scope1)
measurement2 = MeasurementFactory(assessment=assessment2, attribute=attribute, rating=rating_in_scope2)
url = "%s?assessment__id=%s&rating__attribute=%s" % (reverse('measurement-list'), assessment3.id, attribute.id)
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(len(response.data), 0)
def test_search_measurement3(self):
"""
Should return one measurement that matches the rating, assessment combo.
One measurement relates to an assessment that is not in the scope of the search.
"""
template1 = TemplateFactory()
template2 = TemplateFactory()
attribute1 = AttributeFactory(template=template1)
attribute2 = AttributeFactory(template=template2)
rating = RatingFactory(attribute=attribute1)
assessment1 = AssessmentFactory(template=template1)
assessment2 = AssessmentFactory(template=template2)
measurement1 = MeasurementFactory(assessment=assessment1, attribute=attribute1, rating=rating)
measurement2 = MeasurementFactory(assessment=assessment2, attribute=attribute2, rating=rating)
url = "%s?assessment__id=%s&rating__attribute=%s" % (reverse('measurement-list'), assessment1.id, attribute1.id)
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data[0]['id'], measurement1.id)
self.assertEqual(response.data[0]['rating'], rating.id)
self.assertEqual(len(response.data), 1)
def test_create_measurement(self):
"""
Ensure we can create a new measurement object.
"""
assessment = AssessmentFactory()
rating = RatingFactory()
target_rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"target_rating": target_rating.id, "observations": "123",
"action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_create_measurement_no_rating(self):
"""
Ensure we can't create a new measurement object without a rating.
"""
assessment = AssessmentFactory()
target_rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": target_rating.attribute.id,
"rating": None,
"target_rating": target_rating.id, "observations": "123",
"action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(Measurement.objects.count(), 0)
def test_create_measurement_blank_observation(self):
"""
Ensure we can create a new measurement object with a "" observation.
"""
assessment = AssessmentFactory()
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": "", "action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_create_measurement_no_observation(self):
"""
Ensure we can create a new measurement object without an observation.
"""
assessment = AssessmentFactory()
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": None, "action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_create_measurement_no_target(self):
"""
Ensure we can create a new measurement object without a target
"""
assessment = AssessmentFactory()
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": None, "action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_create_measurement_fail_assessment_read_only(self):
"""
Ensure we cannot create a new measurement when the assessment is read only
"""
assessment = AssessmentFactory(status="DONE")
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": None, "action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(Measurement.objects.count(), 0)
def test_create_measurement_success_assessment_read_only_super_user(self):
"""
Ensure we can create a new measurement when the assessment is read only and superuser
"""
password = 'mypassword'
my_admin = User.objects.create_superuser('myuser', 'myemail@test.com', password)
self.client.login(username=my_admin.username, password=password)
assessment = AssessmentFactory(status="DONE")
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": None, "action": "456"}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_update_measurement(self):
"""
Ensure we can update an existing measurement object.
"""
assessment = AssessmentFactory()
rating = RatingFactory()
rating2 = RatingFactory(attribute=rating.attribute)
measurement = MeasurementFactory(assessment=assessment, attribute=rating.attribute, rating=rating)
url = reverse('measurement-detail', args=(measurement.id,))
data = {"id": measurement.id, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating2.id, "observations": "123", "action": "456"}
response = self.client.put(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(Measurement.objects.count(), 1)
self.assertEqual(response.data['id'], measurement.id)
self.assertEqual(response.data['rating'], rating2.id)
def test_update_target_rating_to_measurement(self):
"""
Ensure we can update an existing measurement object with a target rating
"""
assessment = AssessmentFactory()
rating = RatingFactory()
target_rating = RatingFactory(attribute=rating.attribute)
measurement = MeasurementFactory(assessment=assessment, attribute=rating.attribute, rating=rating)
url = reverse('measurement-detail', args=(measurement.id,))
data = {"id": measurement.id, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id, "target_rating": target_rating.id,
"observations": "123", "action": "456"}
response = self.client.put(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(Measurement.objects.count(), 1)
self.assertEqual(response.data['id'], measurement.id)
self.assertEqual(response.data['target_rating'], target_rating.id)
def test_cannot_update_measurement_when_assessment_is_read_only(self):
"""
Ensure we cannot update an existing measurement object when assessment is read only
"""
assessment = AssessmentFactory(status="DONE")
rating = RatingFactory()
target_rating = RatingFactory(attribute=rating.attribute)
measurement = MeasurementFactory(assessment=assessment, attribute=rating.attribute, rating=rating)
url = reverse('measurement-detail', args=(measurement.id,))
data = {"id": measurement.id, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id, "target_rating": target_rating.id,
"observations": "123", "action": "456"}
response = self.client.put(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_can_update_measurement_when_assessment_is_read_only_and_super_user(self):
"""
Ensure we can update an existing measurement object when assessment is read only and you are superuser
"""
assessment = AssessmentFactory(status="DONE")
rating = RatingFactory()
target_rating = RatingFactory(attribute=rating.attribute)
measurement = MeasurementFactory(assessment=assessment, attribute=rating.attribute, rating=rating)
password = 'mypassword'
my_admin = User.objects.create_superuser('myuser', 'myemail@test.com', password)
self.client.login(username=my_admin.username, password=password)
url = reverse('measurement-detail', args=(measurement.id,))
data = {"id": measurement.id, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id, "target_rating": target_rating.id,
"observations": "123", "action": "456"}
response = self.client.put(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
def test_create_measurement_blank_action(self):
"""
Ensure we can create a new measurement object with a "" action.
"""
assessment = AssessmentFactory()
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": "123", "action": ""}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_create_measurement_no_action(self):
"""
Ensure we can create a new measurement object without an action.
"""
assessment = AssessmentFactory()
rating = RatingFactory()
url = reverse('measurement-list')
data = {"id": None, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id,
"observations": "123", "action": None}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(Measurement.objects.count(), 1)
def test_cannot_delete_measurement_when_assessment_is_read_only(self):
"""
Ensure we cannot delete an existing measurement object when assessment is read only
"""
assessment = AssessmentFactory(status="DONE")
rating = RatingFactory()
target_rating = RatingFactory(attribute=rating.attribute)
measurement = MeasurementFactory(assessment=assessment, attribute=rating.attribute, rating=rating)
url = reverse('measurement-detail', args=(measurement.id,))
data = {"id": measurement.id, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id, "target_rating": target_rating.id,
"observations": "123", "action": "456"}
response = self.client.delete(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(Measurement.objects.count(), 1)
def test_can_delete_measurement_when_assessment_is_read_only_and_super_user(self):
"""
Ensure we can delete an existing measurement object when assessment is read only and you are superuser
"""
assessment = AssessmentFactory(status="DONE")
rating = RatingFactory()
target_rating = RatingFactory(attribute=rating.attribute)
measurement = MeasurementFactory(assessment=assessment, attribute=rating.attribute, rating=rating)
password = 'mypassword'
my_admin = User.objects.create_superuser('myuser', 'myemail@test.com', password)
self.client.login(username=my_admin.username, password=password)
url = reverse('measurement-detail', args=(measurement.id,))
data = {"id": measurement.id, "assessment": assessment.id,
"attribute": rating.attribute.id,
"rating": rating.id, "target_rating": target_rating.id,
"observations": "123", "action": "456"}
response = self.client.delete(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
self.assertEqual(Measurement.objects.count(), 0)
| 48.963964 | 120 | 0.660227 | 1,677 | 16,305 | 6.2904 | 0.086464 | 0.059721 | 0.056688 | 0.049483 | 0.829463 | 0.785762 | 0.774386 | 0.761778 | 0.759598 | 0.742345 | 0 | 0.015117 | 0.229132 | 16,305 | 332 | 121 | 49.111446 | 0.824171 | 0.091199 | 0 | 0.72428 | 0 | 0 | 0.102384 | 0.008271 | 0 | 0 | 0 | 0 | 0.17284 | 1 | 0.074074 | false | 0.037037 | 0.024691 | 0 | 0.102881 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
9ebb800a5ef8330c6d0e90edb4a30fbb21496873 | 20,542 | py | Python | tests/test_base.py | roverdotcom/dogstatsd-collector | d42ab28fa22e50ea419b2d1874498270687db84e | [
"BSD-3-Clause"
] | 1 | 2019-06-01T20:04:14.000Z | 2019-06-01T20:04:14.000Z | tests/test_base.py | roverdotcom/dogstatsd-collector | d42ab28fa22e50ea419b2d1874498270687db84e | [
"BSD-3-Clause"
] | 2 | 2019-06-06T17:41:19.000Z | 2019-08-14T16:48:21.000Z | tests/test_base.py | roverdotcom/dogstatsd-collector | d42ab28fa22e50ea419b2d1874498270687db84e | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
from mock import MagicMock
from mock import call
from dogstatsd_collector import DogstatsdCollector
class DogstatsdCollectorTests(TestCase):
def setUp(self):
super(DogstatsdCollectorTests, self).setUp()
self.dogstatsd = MagicMock()
self.collector = DogstatsdCollector(self.dogstatsd)
def test_ctor_initializes_histograms(self):
self.assertTrue(hasattr(self.collector, '_histograms'))
self.assertEqual(self.collector._histograms, {})
def test_ctor_initializes_increments(self):
self.assertTrue(hasattr(self.collector, '_increments'))
self.assertEqual(self.collector._increments, {})
def test_ctor_initializes_base_tags_when_not_specified(self):
self.assertTrue(hasattr(self.collector, 'base_tags'))
self.assertEqual(self.collector.base_tags, [])
def test_ctor_initializes_base_tags_when_specified(self):
expected_tags = ['tag:value']
collector = DogstatsdCollector(self.dogstatsd, base_tags=expected_tags)
self.assertTrue(hasattr(collector, 'base_tags'))
self.assertEqual(collector.base_tags, expected_tags)
def test_single_increment_without_tags(self):
metric_name = 'my.metric'
self.collector.increment(metric_name)
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=[])
], any_order=True)
def test_single_increment_with_tags(self):
metric_name = 'my.metric'
tags = ['tag1:value1']
self.collector.increment(metric_name, tags=tags)
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=tags)
], any_order=True)
def test_increment_with_base_tags(self):
base_tags = ['basetag:basevalue']
collector = DogstatsdCollector(self.dogstatsd, base_tags=base_tags)
metric_name = 'my.metric'
tags = ['tag1:value1']
collector.increment(metric_name, tags=tags)
collector.flush()
expected_tags = sorted(tags + base_tags)
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=expected_tags)
], any_order=True)
def test_increment_supports_specified_value(self):
metric_name = 'my.metric'
tags = ['tag1:value1']
self.collector.increment(metric_name, 5, tags=tags)
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 5, tags=tags)
], any_order=True)
def test_multiple_increment_with_tags(self):
metric_name = 'my.metric'
tags = ['tag1:value1']
self.collector.increment(metric_name, tags=tags)
self.collector.increment(metric_name, tags=tags)
self.collector.increment(metric_name, tags=tags)
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 3, tags=['tag1:value1'])
], any_order=True)
def test_increment_with_multiple_values_for_one_tag(self):
metric_name = 'my.metric'
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value2'])
self.collector.increment(metric_name, tags=['tag1:value3'])
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 1, tags=['tag1:value2']),
call(metric_name, 1, tags=['tag1:value3'])
], any_order=True)
def test_multiple_increment_with_multiple_values_for_one_tag(self):
metric_name = 'my.metric'
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value2'])
self.collector.increment(metric_name, tags=['tag1:value2'])
self.collector.increment(metric_name, tags=['tag1:value3'])
self.collector.increment(metric_name, tags=['tag1:value3'])
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 2, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value2']),
call(metric_name, 2, tags=['tag1:value3'])
], any_order=True)
def test_single_increment_with_multiple_tags(self):
metric_name = 'my.metric'
tags1 = ['tag1:value1']
tags2 = ['tag2:value1']
tags3 = ['tag3:value1']
self.collector.increment(metric_name, tags=tags1)
self.collector.increment(metric_name, tags=tags2)
self.collector.increment(metric_name, tags=tags3)
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=tags1),
call(metric_name, 1, tags=tags2),
call(metric_name, 1, tags=tags3),
], any_order=True)
def test_multiple_increment_with_multiple_tags(self):
metric_name = 'my.metric'
tags1 = ['tag1:value1']
tags2 = ['tag2:value1']
tags3 = ['tag3:value1']
self.collector.increment(metric_name, tags=tags1)
self.collector.increment(metric_name, tags=tags1)
self.collector.increment(metric_name, tags=tags2)
self.collector.increment(metric_name, tags=tags2)
self.collector.increment(metric_name, tags=tags3)
self.collector.increment(metric_name, tags=tags3)
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 2, tags=tags1),
call(metric_name, 2, tags=tags2),
call(metric_name, 2, tags=tags3),
], any_order=True)
def test_single_increment_with_multiple_values_for_multiple_tags(self):
metric_name = 'my.metric'
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value2'])
self.collector.increment(metric_name, tags=['tag1:value3'])
self.collector.increment(metric_name, tags=['tag2:value1'])
self.collector.increment(metric_name, tags=['tag2:value2'])
self.collector.increment(metric_name, tags=['tag2:value3'])
self.collector.increment(metric_name, tags=['tag3:value1'])
self.collector.increment(metric_name, tags=['tag3:value2'])
self.collector.increment(metric_name, tags=['tag3:value3'])
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 1, tags=['tag1:value2']),
call(metric_name, 1, tags=['tag1:value3']),
call(metric_name, 1, tags=['tag2:value1']),
call(metric_name, 1, tags=['tag2:value2']),
call(metric_name, 1, tags=['tag2:value3']),
call(metric_name, 1, tags=['tag3:value1']),
call(metric_name, 1, tags=['tag3:value2']),
call(metric_name, 1, tags=['tag3:value3']),
], any_order=True)
def test_multiple_increment_with_multiple_values_for_multiple_tags(self):
metric_name = 'my.metric'
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value2'])
self.collector.increment(metric_name, tags=['tag1:value2'])
self.collector.increment(metric_name, tags=['tag1:value3'])
self.collector.increment(metric_name, tags=['tag1:value3'])
self.collector.increment(metric_name, tags=['tag2:value1'])
self.collector.increment(metric_name, tags=['tag2:value1'])
self.collector.increment(metric_name, tags=['tag2:value2'])
self.collector.increment(metric_name, tags=['tag2:value2'])
self.collector.increment(metric_name, tags=['tag2:value3'])
self.collector.increment(metric_name, tags=['tag2:value3'])
self.collector.increment(metric_name, tags=['tag3:value1'])
self.collector.increment(metric_name, tags=['tag3:value1'])
self.collector.increment(metric_name, tags=['tag3:value2'])
self.collector.increment(metric_name, tags=['tag3:value2'])
self.collector.increment(metric_name, tags=['tag3:value3'])
self.collector.increment(metric_name, tags=['tag3:value3'])
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 2, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value2']),
call(metric_name, 2, tags=['tag1:value3']),
call(metric_name, 2, tags=['tag2:value1']),
call(metric_name, 2, tags=['tag2:value2']),
call(metric_name, 2, tags=['tag2:value3']),
call(metric_name, 2, tags=['tag3:value1']),
call(metric_name, 2, tags=['tag3:value2']),
call(metric_name, 2, tags=['tag3:value3']),
], any_order=True)
def test_increment_differentiates_among_series(self):
metric_name = 'my.metric'
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value1', 'tag2:value2']),
call(metric_name, 3, tags=['tag1:value1', 'tag2:value2', 'tag3:value3']),
], any_order=True)
def test_single_histogram_without_tags(self):
metric_name = 'my.metric'
self.collector.histogram(metric_name, 1)
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=[])
], any_order=True)
def test_single_histogram_with_tags(self):
metric_name = 'my.metric'
tags = ['tag1:value1']
self.collector.histogram(metric_name, 1, tags=tags)
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=tags)
], any_order=True)
def test_multiple_histogram_with_tags(self):
metric_name = 'my.metric'
tags = ['tag1:value1']
self.collector.histogram(metric_name, 1, tags=tags)
self.collector.histogram(metric_name, 1, tags=tags)
self.collector.histogram(metric_name, 1, tags=tags)
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 3, tags=['tag1:value1'])
], any_order=True)
def test_histogram_with_base_tags(self):
base_tags = ['basetag:basevalue']
collector = DogstatsdCollector(self.dogstatsd, base_tags=base_tags)
metric_name = 'my.metric'
tags = ['tag1:value1']
collector.histogram(metric_name, 1, tags=tags)
collector.flush()
expected_tags = sorted(tags + base_tags)
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=expected_tags)
], any_order=True)
def test_histogram_with_multiple_values_for_one_tag(self):
metric_name = 'my.metric'
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value3'])
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 1, tags=['tag1:value2']),
call(metric_name, 1, tags=['tag1:value3'])
], any_order=True)
def test_multiple_histogram_with_multiple_values_for_one_tag(self):
metric_name = 'my.metric'
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value3'])
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 2, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value2']),
call(metric_name, 2, tags=['tag1:value3'])
], any_order=True)
def test_single_histogram_with_multiple_tags(self):
metric_name = 'my.metric'
tags1 = ['tag1:value1']
tags2 = ['tag2:value1']
tags3 = ['tag3:value1']
self.collector.histogram(metric_name, 1, tags=tags1)
self.collector.histogram(metric_name, 1, tags=tags2)
self.collector.histogram(metric_name, 1, tags=tags3)
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=tags1),
call(metric_name, 1, tags=tags2),
call(metric_name, 1, tags=tags3),
], any_order=True)
def test_multiple_histogram_with_multiple_tags(self):
metric_name = 'my.metric'
tags1 = ['tag1:value1']
tags2 = ['tag2:value1']
tags3 = ['tag3:value1']
self.collector.histogram(metric_name, 1, tags=tags1)
self.collector.histogram(metric_name, 1, tags=tags1)
self.collector.histogram(metric_name, 1, tags=tags2)
self.collector.histogram(metric_name, 1, tags=tags2)
self.collector.histogram(metric_name, 1, tags=tags3)
self.collector.histogram(metric_name, 1, tags=tags3)
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 2, tags=tags1),
call(metric_name, 2, tags=tags2),
call(metric_name, 2, tags=tags3),
], any_order=True)
def test_single_histogram_with_multiple_values_for_multiple_tags(self):
metric_name = 'my.metric'
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value3'])
self.collector.histogram(metric_name, 1, tags=['tag2:value1'])
self.collector.histogram(metric_name, 1, tags=['tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag2:value3'])
self.collector.histogram(metric_name, 1, tags=['tag3:value1'])
self.collector.histogram(metric_name, 1, tags=['tag3:value2'])
self.collector.histogram(metric_name, 1, tags=['tag3:value3'])
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 1, tags=['tag1:value2']),
call(metric_name, 1, tags=['tag1:value3']),
call(metric_name, 1, tags=['tag2:value1']),
call(metric_name, 1, tags=['tag2:value2']),
call(metric_name, 1, tags=['tag2:value3']),
call(metric_name, 1, tags=['tag3:value1']),
call(metric_name, 1, tags=['tag3:value2']),
call(metric_name, 1, tags=['tag3:value3']),
], any_order=True)
def test_multiple_histogram_with_multiple_values_for_multiple_tags(self):
metric_name = 'my.metric'
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value3'])
self.collector.histogram(metric_name, 1, tags=['tag2:value1'])
self.collector.histogram(metric_name, 1, tags=['tag2:value1'])
self.collector.histogram(metric_name, 1, tags=['tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag2:value3'])
self.collector.histogram(metric_name, 1, tags=['tag2:value3'])
self.collector.histogram(metric_name, 1, tags=['tag3:value1'])
self.collector.histogram(metric_name, 1, tags=['tag3:value1'])
self.collector.histogram(metric_name, 1, tags=['tag3:value2'])
self.collector.histogram(metric_name, 1, tags=['tag3:value2'])
self.collector.histogram(metric_name, 1, tags=['tag3:value3'])
self.collector.histogram(metric_name, 1, tags=['tag3:value3'])
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 2, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value2']),
call(metric_name, 2, tags=['tag1:value3']),
call(metric_name, 2, tags=['tag2:value1']),
call(metric_name, 2, tags=['tag2:value2']),
call(metric_name, 2, tags=['tag2:value3']),
call(metric_name, 2, tags=['tag3:value1']),
call(metric_name, 2, tags=['tag3:value2']),
call(metric_name, 2, tags=['tag3:value3']),
], any_order=True)
def test_histogram_differentiates_among_series(self):
metric_name = 'my.metric'
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.flush()
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value1', 'tag2:value2']),
call(metric_name, 3, tags=['tag1:value1', 'tag2:value2', 'tag3:value3']),
], any_order=True)
def test_mix_of_increments_and_histograms(self):
metric_name = 'my.metric'
self.collector.increment(metric_name, tags=['tag1:value1'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.increment(metric_name, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.histogram(metric_name, 1, tags=['tag1:value1', 'tag2:value2', 'tag3:value3'])
self.collector.flush()
self.dogstatsd.increment.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value1', 'tag2:value2']),
call(metric_name, 3, tags=['tag1:value1', 'tag2:value2', 'tag3:value3']),
], any_order=True)
self.dogstatsd.histogram.assert_has_calls([
call(metric_name, 1, tags=['tag1:value1']),
call(metric_name, 2, tags=['tag1:value1', 'tag2:value2']),
call(metric_name, 3, tags=['tag1:value1', 'tag2:value2', 'tag3:value3']),
], any_order=True)
| 49.498795 | 100 | 0.649742 | 2,492 | 20,542 | 5.16252 | 0.029695 | 0.180334 | 0.088068 | 0.118927 | 0.951496 | 0.947066 | 0.931597 | 0.922658 | 0.91815 | 0.917062 | 0 | 0.038466 | 0.203972 | 20,542 | 414 | 101 | 49.618357 | 0.748288 | 0 | 0 | 0.859788 | 0 | 0 | 0.132898 | 0 | 0 | 0 | 0 | 0 | 0.087302 | 1 | 0.07672 | false | 0 | 0.010582 | 0 | 0.089947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
7b39ba2000e24077995ec1dadd33cc19139f70f5 | 33,737 | py | Python | ippgtoolbox/utils/video/msrReader.py | BeCuriousS/ippg-toolbox | 74b58459d038e2a77f0b51b33de372f3f9afd2a6 | [
"MIT"
] | null | null | null | ippgtoolbox/utils/video/msrReader.py | BeCuriousS/ippg-toolbox | 74b58459d038e2a77f0b51b33de372f3f9afd2a6 | [
"MIT"
] | null | null | null | ippgtoolbox/utils/video/msrReader.py | BeCuriousS/ippg-toolbox | 74b58459d038e2a77f0b51b33de372f3f9afd2a6 | [
"MIT"
] | null | null | null | """
-------------------------------------------------------------------------------
Created: 21.02.2021, 18:41
-------------------------------------------------------------------------------
Author: Matthieu Scherpf
Email: Matthieu.Scherpf@tu-dresden.de
Website: https://becuriouss.github.io/matthieu-scherpf/
Project page: tba
-------------------------------------------------------------------------------
Purpose: Video reader class for a custom video format that is used at the IBMT.
-------------------------------------------------------------------------------
"""
from ..logger import Logger
import os
import numpy as np
import struct
from datetime import date, time, datetime
Logger.setGlobalLoglvl('error')
def _convertBinToInt(byteArray, bitsPerChannel, colorModel, byteorder):
"""Convert binary values to integers. Used for the custom MSR video format.
"""
if byteorder == 'big':
dataType = np.dtype(np.uint8)
elif byteorder == 'little':
dataType = np.dtype(np.uint8).newbyteorder('>')
if colorModel == 'M':
if bitsPerChannel[0] == 8:
# no conversion necessary
Logger.logWarning(
'This conversion type (model: {0}, bitdepth: {1:d}) has not been tested yet...'.format(colorModel, bitsPerChannel[0]))
return np.frombuffer(byteArray, dtype=dataType)
elif bitsPerChannel[0] == 10:
Logger.logWarning(
'This conversion type (model: {0}, bitdepth: {1:d}) has not been tested yet...'.format(colorModel, bitsPerChannel[0]))
return _binToInt_mono10(np.frombuffer(byteArray, dtype=dataType))
elif bitsPerChannel[0] == 12:
Logger.logWarning(
'This conversion type (model: {0}, bitdepth: {1:d}) has not been tested yet...'.format(colorModel, bitsPerChannel[0]))
return _binToInt_mono12(np.frombuffer(byteArray, dtype=dataType))
else:
Logger.logError(
'The specified bitsPerChannel have not yet been defined for this colorModel...')
raise ValueError('bitsPerChannel not defined')
elif colorModel == 'RGB':
if bitsPerChannel[0] == 8:
# no conversion necessary
Logger.logWarning(
'This conversion type (model: {0}, bitdepth: {1:d}) has not been tested yet...'.format(colorModel, bitsPerChannel[0]))
return np.frombuffer(byteArray, dtype=dataType)
elif bitsPerChannel[0] == 10:
return _binToInt_rgb10(np.frombuffer(byteArray, dtype=dataType))
elif bitsPerChannel[0] == 12:
return _binToInt_rgb12(np.frombuffer(byteArray, dtype=dataType))
else:
Logger.logError(
'The specified bitsPerChannel have not yet been defined for this colorModel {}...'.format(colorModel))
raise ValueError('bitsPerChannel not defined')
else:
Logger.logError(
'The specified colorModel {} has not yet been defined...'.format(colorModel))
raise ValueError('ColorModel not defined')
MONO10_SHIFTS = [
2**2, 1/2**6,
2**4, 1/2**4,
2**6, 1/2**2,
2**8, 1/2**0
]
def _binToInt_mono10(uint8Array):
bytesPerChunk = 5
assert np.mod(
uint8Array.shape[0], bytesPerChunk) == 0, 'modulo operation for uint8Array.shape[0] and bytesPerChunk not zero'
tmp = uint8Array.copy().reshape((-1, bytesPerChunk))
bytes_1 = np.sum(tmp[:, 0:2] * MONO10_SHIFTS[0:2],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 1] = tmp[:, 1] % 2**6
bytes_2 = np.sum(tmp[:, 1:3] * MONO10_SHIFTS[2:4],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 2] = tmp[:, 2] % 2**4
bytes_3 = np.sum(tmp[:, 2:4] * MONO10_SHIFTS[4:6],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 3] = tmp[:, 3] % 2**2
bytes_4 = np.sum(tmp[:, 3:] * MONO10_SHIFTS[6:],
dtype=np.uint64, axis=1, keepdims=True)
out = np.concatenate([bytes_1, bytes_2, bytes_3, bytes_4], axis=1)
# flatten the array back to the input shape
out = out.reshape((-1,))
return out
MONO12_SHIFTS = [
2**4, 1/2**4,
2**8, 2**0
]
def _binToInt_mono12(uint8Array):
bytesPerChunk = 3
# ensure that the uint8Array has the right length
assert np.mod(
uint8Array.shape[0], bytesPerChunk) == 0, 'modulo operation for uint8Array.shape[0] and bytesPerChunk not zero'
tmp = uint8Array.copy().reshape((-1, bytesPerChunk))
bytes_1 = np.sum(tmp[:, 0:2] * MONO12_SHIFTS[0:2],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 1] = tmp[:, 1] % 2**4
bytes_2 = np.sum(tmp[:, 1:] * MONO12_SHIFTS[2:],
dtype=np.uint64, axis=1, keepdims=True)
out = np.concatenate([bytes_1, bytes_2], axis=1)
# flatten the array back to the input shape
out = out.reshape((-1,))
return out
RGB10_SHIFTS = [
2**22, 2**14, 2**6, 1/2**2,
2**28, 2**20, 2**12, 2**4, 1/2**4,
2**26, 2**18, 2**10, 2**2, 1/2**6,
2**24, 2**16, 2**8, 2**0
]
def _binToInt_rgb10(uint8Array):
bytesPerChunk = 15
# ensure that the uint8Array has the right length
assert np.mod(
uint8Array.shape[0], bytesPerChunk) == 0, 'modulo operation for uint8Array.shape[0] and bytesPerChunk not zero'
tmp = uint8Array.copy().reshape((-1, bytesPerChunk))
bytes_1 = np.sum(tmp[:, 0:4] * RGB10_SHIFTS[0:4],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 3] = tmp[:, 3] % 2**2
bytes_2 = np.sum(tmp[:, 3:8] * RGB10_SHIFTS[4:9],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 7] = tmp[:, 7] % 2**4
bytes_3 = np.sum(tmp[:, 7:12] * RGB10_SHIFTS[9:14],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 11] = tmp[:, 11] % 2**6
bytes_4 = np.sum(tmp[:, 11:] * RGB10_SHIFTS[14:],
dtype=np.uint64, axis=1, keepdims=True)
out = np.concatenate([bytes_1, bytes_2, bytes_3, bytes_4], axis=1)
# flatten the array back to the input shape
out = out.reshape((-1,))
return out
RGB12_SHIFTS = [
2**28, 2**20, 2**12, 2**4, 1/2**4, # shifts for bytes_1
2**32, 2**24, 2**16, 2**8, 2**0 # shifts for bytes_2
]
def _binToInt_rgb12(uint8Array):
bytesPerChunk = 9
# ensure that the uint8Array has the right length
assert np.mod(
uint8Array.shape[0], bytesPerChunk) == 0, 'modulo operation for uint8Array.shape[0] and bytesPerChunk not zero'
tmp = uint8Array.copy().reshape((-1, bytesPerChunk))
bytes_1 = np.sum(tmp[:, 0:5] * RGB12_SHIFTS[0:5],
dtype=np.uint64, axis=1, keepdims=True)
tmp[:, 4] = tmp[:, 4] % 2**4
bytes_2 = np.sum(tmp[:, 4:] * RGB12_SHIFTS[5:],
dtype=np.uint64, axis=1, keepdims=True)
out = np.concatenate([bytes_1, bytes_2], axis=1)
# flatten the array back to the input shape
out = out.reshape((-1,))
return out
class MSRReader():
"""Reads a msr version 1 (*.msr) video file so that it can be used in python. This class is developed based on the MSRReader.m from the matfiles. MSR is a custom video format developed and used internally at the IBMT.
"""
def __init__(self, absFileName, byteorder='little', img_coord_sys='indices'):
"""Instanciate a reader for msr foramtted videos.
Arguments:
absFileName {str} -- absolute path to the video file
Keyword Arguments:
byteorder {str} -- little endian or big endian architecture (default: {'little'})
img_coord_sys {str} -- defines the orientation of the images ('indices' or 'spatial') (default: {'indices'})
"""
self.absFileName = absFileName
self.byteorder = byteorder
# set the byteorder sign for struct.unpack func
if self.byteorder == 'big':
self.bos = '>'
elif self.byteorder == 'little':
self.bos = '<'
self.img_coord_sys = img_coord_sys
self.numberOfFrames = None
self.resolution = None
self.bytesPerFrame = None
self.colorMode = None
self.fileSize = None
self.framesPerSecond = None
self.duration = None
self.headerSize = 16 # in byte
self.timestampSize = 8 # in byte
self.width = None
self.height = None
self.colorModel = None
self.bitsPerChannel = None
self._frameCounter = None # only used for reading frame by frame
self._readMetaData = False # check if meta data of the video has been read
def reader_next(self, startFrameIndex=0, return_ts=False):
"""Generator that yields frames and timestamps frame by frame until the video is completly read.
Args:
startFrameIndex (int, optional): frame index from which to start reading
return_ts (bool, optional): Set if the timestamps from the camera should also be returned. Defaults to False.
Yields:
tuple or array: tuple for return_ts=True and numpy array otherwise.
"""
with open(self.absFileName, 'rb') as f:
self._getMetaData(f)
if startFrameIndex != 0:
offset = self.headerSize + startFrameIndex * \
(self.timestampSize + self.bytesPerFrame)
f.seek(offset, os.SEEK_SET)
self._frameCounter = startFrameIndex
while self._frameCounter < self.numberOfFrames:
next_timestamp = self._getNextTimestamp(f)
next_frame = self._getNextFrame(f)
self._frameCounter += 1
if return_ts:
yield (next_frame, next_timestamp)
else:
yield next_frame
def reader_nextAtIndex(self, frameIndexes, return_ts=False):
"""
Generator that yields frames and timestamps at given frame indexes.
Args:
frameIndexes (iterable): Listlike object containing the indexes of the frames of interest in the video
return_ts (bool, optional): Set if the timestamps from the camera should also be returned. Defaults to False.
Yields:
tuple or array: tuple for return_ts=True and numpy array otherwise.
"""
with open(self.absFileName, 'rb') as f:
self._getMetaData(f)
if return_ts:
for idx in frameIndexes:
next_timestamp = self.getTimestampAtIndex(f, idx)
next_frame = self.getFrameAtIndex(f, idx)
yield (next_frame, next_timestamp)
else:
for idx in frameIndexes:
next_frame = self.getFrameAtIndex(f, idx)
yield next_frame
def readMetaData(self):
with open(self.absFileName, 'rb') as f:
self._getMetaData(f)
def getFrameAtIndex(self, f: 'filehandler', frameIndex):
"""Reading the frame of a specific position defined by frameIndex. The indexing is 0-based.
"""
if not self._readMetaData:
self._getMetaData(f)
self._checkFrameIndex(frameIndex)
offset = self.headerSize + self.timestampSize + \
frameIndex * (self.timestampSize + self.bytesPerFrame)
f.seek(offset, os.SEEK_SET)
# For 12bit mono (10bit used)
if self.colorMode == 26:
Logger.logWarning('This colorMode has not been tested yet...')
binFrame = f.read(self.bytesPerFrame)
binFrame = np.frombuffer(binFrame, dtype=np.dtype(
np.uint16).newbyteorder(self.bos))
frame = np.reshape((binFrame & 4092)/4,
self.resolution, order=self.order)
return frame
frame = np.zeros((self.resolution[0], self.resolution[1], 3))
binFrame = f.read(self.bytesPerFrame)
binFrame = np.frombuffer(binFrame, dtype=np.dtype(
np.uint32).newbyteorder(self.bos))
frame[:, :, 2] = np.reshape(
(binFrame & 1023), self.resolution, order=self.order)
frame[:, :, 1] = np.reshape(
(binFrame & 1047552)/1024, self.resolution, order=self.order)
frame[:, :, 0] = np.reshape(
(binFrame & 1072693248)/1048576, self.resolution, order=self.order)
return frame
def getTimestampAtIndex(self, f: 'filehandler', frameIndex):
"""Reading the timestamp of a specific position defined by frameIndex. The indexing is 0-based.
"""
if not self._readMetaData:
self._getMetaData(f)
self._checkFrameIndex(frameIndex)
offset = self.headerSize + (frameIndex) * \
(self.timestampSize + self.bytesPerFrame)
f.seek(offset, os.SEEK_SET)
timestamp = int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)
if timestamp == int(16*'f', 16):
if frameIndex == 0 or frameIndex == self.numberOfFrames:
Logger.logError(
'Can\'t interpolate corrupted timestamp at frameIndex '+str(frameIndex))
# NOTE not sure if this recursion won't brake at some point
t1 = self.getTimestampAtIndex(f, frameIndex-1)
t2 = self.getTimestampAtIndex(f, frameIndex+1)
timestamp = t1+(t2-t1)/2
return timestamp
def getAllTimestamps(self, f: 'filehandler'):
if not self._readMetaData:
self._getMetaData(f)
f.seek(self.headerSize, os.SEEK_SET)
timestamps = []
for i in range(0, self.numberOfFrames):
timestamps.append(int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False))
f.seek(self.bytesPerFrame, os.SEEK_CUR)
timestamps = np.array(timestamps)
# correct corrupted timestamps (ct) with corrected values (cv)
ct = np.nonzero(timestamps == int(16*'f', 16))[0]
# rounding differences comparing matlab and python can occure at the next step (due to round rules)
cv = np.asarray(
np.round(np.mean(np.array((timestamps[ct-1], timestamps[ct+1])), axis=0)), 'int')
timestamps[ct] = cv
return timestamps
def _getMetaData(self, f: 'filehandler'):
Logger.logDebug('Opened file '+self.absFileName)
self.colorMode = int.from_bytes(
f.read(4), byteorder=self.byteorder, signed=False)
self.bytesPerFrame = int.from_bytes(
f.read(4), byteorder=self.byteorder, signed=False)
resX = int.from_bytes(
f.read(4), byteorder=self.byteorder, signed=False)
resY = int.from_bytes(
f.read(4), byteorder=self.byteorder, signed=False)
self._readMetaData = True
if self.img_coord_sys == 'indices':
self.resolution = (resY, resX) # pixel indices
self.order = 'F' # fill columns first
if self.img_coord_sys == 'spatial':
self.resolution = (resX, resY) # spatial coordinates
self.order = 'C' # fill rows first
self.fileSize = os.path.getsize(self.absFileName)
self.numberOfFrames = int(
(self.fileSize - self.headerSize) / (self.bytesPerFrame + self.timestampSize))
self.duration = (self.getTimestampAtIndex(
f, self.numberOfFrames-1) - self.getTimestampAtIndex(f, 0))/10**7 # accuracy equals 100ns
self.framesPerSecond = self.numberOfFrames / self.duration
self.width = resX
self.height = resY
self.colorModel = 'RGB'
# type tuple for forward compatibility with msr2 format
self.bitsPerChannel = (10,)
self._frameCounter = 0
self._resetPointer(f)
[Logger.logDebug('var: ' + key + ', val: ' + str(val))
for key, val in vars(self).items()]
def _getNextFrame(self, f: 'filehandler'):
"""Assumes the pointer is directly(!) before the next frame. It is intended
to be used together with _getNextTimestamp after applying getMetaData.
"""
if self._frameCounter < self.numberOfFrames:
# For 12bit mono (10bit used)
if self.colorMode == 26:
Logger.logWarning('This colorMode has not been tested yet...')
binFrame = f.read(self.bytesPerFrame)
binFrame = np.frombuffer(binFrame, dtype=np.dtype(
np.uint16).newbyteorder(self.bos))
frame = np.reshape((binFrame & 4092)/4,
self.resolution, order=self.order)
return frame
frame = np.zeros((self.resolution[0], self.resolution[1], 3))
binFrame = f.read(self.bytesPerFrame)
binFrame = np.frombuffer(binFrame, dtype=np.dtype(
np.uint32).newbyteorder(self.bos))
frame[:, :, 2] = np.reshape(
(binFrame & 1023), self.resolution, order=self.order)
frame[:, :, 1] = np.reshape(
(binFrame & 1047552)/1024, self.resolution, order=self.order)
frame[:, :, 0] = np.reshape(
(binFrame & 1072693248)/1048576, self.resolution, order=self.order)
return frame
return None
def _getNextTimestamp(self, f: 'filehandler'):
"""Assumes the pointer is directly(!) before the next timestamp. It is intended
to be used together with _getNextFrame.
"""
if self._frameCounter < self.numberOfFrames:
timestamp = int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)
if timestamp == int(16*'f', 16):
# save current position in file
lastPos = os.SEEK_CUR
# NOTE not sure if this recursion won't brake at some point
t1 = self.getTimestampAtIndex(f, self._frameCounter-1)
t2 = self.getTimestampAtIndex(f, self._frameCounter+1)
timestamp = t1+(t2-t1)/2
# reset pointer to last position
f.seek(lastPos, os.SEEK_SET)
return timestamp
return None
def _checkFrameIndex(self, frameIndex):
valid = False
if (frameIndex < 0) or (frameIndex % 1) != 0:
Logger.logError('frame index must be a positive integer.')
raise ValueError('frameindex value out of range')
elif frameIndex >= self.numberOfFrames:
Logger.logError('frame index larger than number of frames.')
raise ValueError('frameindex value out of range')
else:
valid = True
return valid
def _resetPointer(self, f: 'filehandler'):
"""
Set the pointer of the filehandler to the position after the metadata.
"""
f.seek(self.headerSize, os.SEEK_SET)
self._frameCounter = 0
class MSR2Reader():
"""Reads a msr version 2 (*.msr2) video file so that it can be used in python. This class is developed based on the MSR2ReaderV2.m from the matfiles. MSR2 is a custom video format developed and used internally at the IBMT.
"""
def __init__(self, absFileName, byteorder='big', img_coord_sys='indices'):
"""Instanciate a reader for msr foramtted videos.
Arguments:
absFileName {str} -- absolute path to the video file
Keyword Arguments:
byteorder {str} -- little endian or big endian architecture (default: {'little'})
img_coord_sys {str} -- defines the orientation of the images ('indices' or 'spatial') (default: {'indices'})
"""
self.absFileName = absFileName
self.byteorder = byteorder
# set the byteorder sign for struct.unpack func
if self.byteorder == 'big':
self.bos = '>'
elif self.byteorder == 'little':
self.bos = '<'
self.img_coord_sys = img_coord_sys
self.numberOfFrames = None
self.resolution = None
self.bytesPerFrame = None
self.fileSize = None
self.framesPerSecond = None
self.duration = None
self.headerSize = None
self.timestampSize = 8 # in byte
self.width = None
self.height = None
self.colorModel = None
self.bitsPerChannel = None
self.cameraModel = None
self.firstCompStamp = None
self.timerFreq = 10**7
self._rgb12 = False
self._mono12 = False
self._rgb10 = False
self._rgb8 = False
self._mono8 = False
self._deadBitsPerFrame = 0
self._accE = 3 # Accepted error in frame rate (in percent)
self._frameCounter = None # only used for reading frame by frame
self._readMetaData = False # check if meta data of the video has been read
def reader_next(self, startFrameIndex=0, return_ts=False):
"""Generator that yields frames and timestamps frame by frame until the video is completly read.
Args:
startFrameIndex (int, optional): frame index from which to start reading
return_ts (bool, optional): Set if the timestamps from the camera should also be returned. Defaults to False.
Yields:
tuple or array: tuple for return_ts=True and numpy array otherwise.
"""
with open(self.absFileName, 'rb') as f:
self._getMetaData(f)
if startFrameIndex != 0:
offset = self.headerSize + startFrameIndex * \
(self.timestampSize + self.bytesPerFrame)
f.seek(offset, os.SEEK_SET)
self._frameCounter = startFrameIndex
while self._frameCounter < self.numberOfFrames:
next_timestamp = self._getNextTimestamp(f)
next_frame = self._getNextFrame(f)
self._frameCounter += 1
if return_ts:
yield (next_frame, next_timestamp)
else:
yield next_frame
def reader_nextAtIndex(self, frameIndexes, return_ts=False):
"""
Generator that yields frames and timestamps at given frame indexes.
Args:
frameIndexes (iterable): Listlike object containing the indexes of the frames of interest in the video
return_ts (bool, optional): Set if the timestamps from the camera should also be returned. Defaults to False.
Yields:
tuple or array: tuple for return_ts=True and numpy array otherwise.
"""
with open(self.absFileName, 'rb') as f:
self._getMetaData(f)
if return_ts:
for idx in frameIndexes:
next_timestamp = self.getTimestampAtIndex(f, idx)
next_frame = self.getFrameAtIndex(f, idx)
yield (next_frame, next_timestamp)
else:
for idx in frameIndexes:
next_frame = self.getFrameAtIndex(f, idx)
yield next_frame
def readMetaData(self):
with open(self.absFileName, 'rb') as f:
self._getMetaData(f)
def getFrameAtIndex(self, f: 'filehandler', frameIndex):
"""Reading the frame of a specific position defined by frameIndex. The indexing is 0-based.
"""
if not self._readMetaData:
self._getMetaData(f)
self._checkFrameIndex(frameIndex)
offset = self.headerSize + self.timestampSize + \
frameIndex * (self.timestampSize + self.bytesPerFrame)
f.seek(offset, os.SEEK_SET)
binFrame = f.read(self.bytesPerFrame)
binFrame = _convertBinToInt(
binFrame, self.bitsPerChannel, self.colorModel, self.byteorder)
# For Mono colorMode
if 'M' in self.colorModel:
Logger.logWarning('This colorMode has not been tested yet...')
frame = np.reshape(binFrame, self.resolution, order=self.order)
return frame
if 'RGB' in self.colorModel:
bpc = self.bitsPerChannel[0]
frame = np.zeros((self.resolution[0], self.resolution[1], 3))
frame[:, :, 2] = np.reshape(
(binFrame & (2**bpc-1)), self.resolution, order=self.order)
frame[:, :, 1] = np.reshape(
(binFrame & (2**(bpc*2)-2**bpc))/(2**bpc), self.resolution, order=self.order)
frame[:, :, 0] = np.reshape(
(binFrame & (2**(bpc*3)-2**(bpc*2)))/(2**(bpc*2)), self.resolution, order=self.order)
return frame
def getTimestampAtIndex(self, f: 'filehandler', frameIndex):
"""Reading the timestamp of a specific position defined by frameIndex. The indexing is 0-based.
"""
if not self._readMetaData:
self._getMetaData(f)
self._checkFrameIndex(frameIndex)
offset = self.headerSize + (frameIndex) * \
(self.timestampSize + self.bytesPerFrame)
f.seek(offset, os.SEEK_SET)
timestamp = int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)
if timestamp == int(16*'f', 16):
if frameIndex == 0 or frameIndex == self.numberOfFrames:
Logger.logError(
'Can\'t interpolate corrupted timestamp at frameIndex '+str(frameIndex))
# NOTE not sure if this recursion won't brake at some point
t1 = self.getTimestampAtIndex(f, frameIndex-1)
t2 = self.getTimestampAtIndex(f, frameIndex+1)
timestamp = t1+(t2-t1)/2
return timestamp
def getAllTimestamps(self, f: 'filehandler'):
if not self._readMetaData:
self._getMetaData(f)
f.seek(self.headerSize, os.SEEK_SET)
timestamps = []
for i in range(0, self.numberOfFrames):
timestamps.append(int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False))
f.seek(self.bytesPerFrame, os.SEEK_CUR)
timestamps = np.array(timestamps)
# correct corrupted timestamps (ct) with corrected values (cv)
ct = np.nonzero(timestamps == int(16*'f', 16))[0]
# rounding differences comparing matlab and python can occure at the next step (due to round rules)
cv = np.asarray(
np.round(np.mean(np.array((timestamps[ct-1], timestamps[ct+1])), axis=0)), 'int')
timestamps[ct] = cv
return timestamps
def _getMetaData(self, f: 'filehandler'):
Logger.logDebug('Opened file '+self.absFileName)
self.headerSize = int(int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)/8) # /8 because header size is in bit
self.colorModel = ((f.read(8)).decode('windows-1252')).split('\x00')[0]
if ('M' not in self.colorModel) and ('RGB' not in self.colorModel):
Logger.logError(
'The color mode is not supported: colorModel' + self.colorModel)
raise ValueError('The color model - ' +
self.colorModel + ' - is not supported')
self.bitsPerChannel = np.array(struct.unpack(
8*'B', f.read(8))[0:len(self.colorModel)])
self.bytesPerFrame = None
self.width = int.from_bytes(
f.read(4), byteorder=self.byteorder, signed=False)
self.height = int.from_bytes(
f.read(4), byteorder=self.byteorder, signed=False)
self.framesPerSecond = struct.unpack(self.bos+'d', f.read(8))[0]
self.numberOfFrames = int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)
f.seek(8, os.SEEK_CUR) # skip timer freq for now (??)
self.cameraModel = (f.read(32)).split(b'\x00')[0].decode('utf-8')
if self.headerSize > 88:
tmp_time = int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)
if tmp_time > 10**10:
tmp_time = tmp_time/86400000 + date.toordinal(date(1970, 1, 1))
else:
tmp_time = tmp_time/86400 + date.toordinal(date(1970, 1, 1))
d = date.fromordinal(int(tmp_time))
hrs = (tmp_time % 1)*24
mins = (hrs % 1)*60
secs = (mins % 1)*60
msecs = (secs % 1)*1000
t = time(hour=int(hrs), minute=int(mins),
second=int(secs), microsecond=int(msecs))
self.firstCompStamp = datetime.combine(d, t)
if self.colorModel == 'RGB' and sum(self.bitsPerChannel-12) == 0:
s = 3
self._rgb12 = True
elif self.colorModel == 'RGB' and sum(self.bitsPerChannel-10) == 0:
s = 3
self._rgb10 = True
elif self.colorModel == 'RGB' and sum(self.bitsPerChannel-8) == 0:
s = 3
self._rgb8 = True
elif self.colorModel == 'M' and self.bitsPerChannel[0] == 12:
s = 1
self._mono12 = True
elif self.colorModel == 'M' and self.bitsPerChannel[0] == 8:
s = 1
self._mono8 = True
# for RGB, Mono with symmetric BitDepths
bitCount = self.width * self.height * self.bitsPerChannel[0] * s
self._deadBitsPerFrame = -bitCount % 8
if self._deadBitsPerFrame != 0:
Logger.logError(
'This version does not support videos with dead bits at the end of the frames yet')
raise NotImplementedError('Dead bits per frame not supported')
self.bytesPerFrame = int((bitCount + self._deadBitsPerFrame)/8)
self._readMetaData = True
if self.img_coord_sys == 'indices':
self.resolution = (self.width, self.height) # pixel indices
self.order = 'F' # fill columns first
if self.img_coord_sys == 'spatial':
self.resolution = (self.height, self.width) # spatial coordinates
self.order = 'C' # fill rows first
self.fileSize = os.path.getsize(self.absFileName)
self.duration = (self.getTimestampAtIndex(
f, self.numberOfFrames-1) - self.getTimestampAtIndex(f, 0))/self.timerFreq
self._frameCounter = 0
self._resetPointer(f)
[Logger.logDebug('var: ' + key + ', val: ' + str(val))
for key, val in vars(self).items()]
def _getNextFrame(self, f: 'filehandler'):
"""Assumes the pointer is directly(!) before the next frame. It is intended
to be used together with _getNextTimestamp after applying getMetaData.
"""
if self._frameCounter < self.numberOfFrames:
binFrame = f.read(self.bytesPerFrame)
binFrame = _convertBinToInt(
binFrame, self.bitsPerChannel, self.colorModel, self.byteorder)
# For Mono colorMode
if 'M' in self.colorModel:
Logger.logWarning('This colorMode has not been tested yet...')
frame = np.reshape(binFrame, self.resolution, order=self.order)
return frame
if 'RGB' in self.colorModel:
bpc = self.bitsPerChannel[0]
frame = np.zeros((self.resolution[0], self.resolution[1], 3))
frame[:, :, 2] = np.reshape(
(binFrame & (2**bpc-1)), self.resolution, order=self.order)
frame[:, :, 1] = np.reshape(
(binFrame & (2**(bpc*2)-2**bpc))/(2**bpc), self.resolution, order=self.order)
frame[:, :, 0] = np.reshape(
(binFrame & (2**(bpc*3)-2**(bpc*2)))/(2**(bpc*2)), self.resolution, order=self.order)
return frame
return None
def _getNextTimestamp(self, f: 'filehandler'):
"""Assumes the pointer is directly(!) before the next timestamp. It is intended
to be used together with _getNextFrame.
"""
if self._frameCounter < self.numberOfFrames:
timestamp = int.from_bytes(
f.read(8), byteorder=self.byteorder, signed=False)
if timestamp == int(16*'f', 16):
# save current position in file
lastPos = os.SEEK_CUR
# NOTE not sure if this recursion won't brake at some point
t1 = self.getTimestampAtIndex(f, self._frameCounter-1)
t2 = self.getTimestampAtIndex(f, self._frameCounter+1)
timestamp = t1+(t2-t1)/2
# reset pointer to last position
f.seek(lastPos, os.SEEK_SET)
return timestamp
return None
def _checkFrameIndex(self, frameIndex):
valid = False
if (frameIndex < 0) or (frameIndex % 1) != 0:
Logger.logError('frame index must be a positive integer.')
raise ValueError('frameindex value out of range')
elif frameIndex >= self.numberOfFrames:
Logger.logError('frame index larger than number of frames.')
raise ValueError('frameindex value out of range')
else:
valid = True
if not valid:
raise ValueError('Invalid frameindex')
return valid
def _resetPointer(self, f: 'filehandler'):
"""
Set the pointer of the filehandler to the position after the metadata.
"""
f.seek(self.headerSize, os.SEEK_SET)
self._frameCounter = 0
def _getFrameRateErrors(self):
ds_des = self.timerFreq/self.framesPerSecond
stamps = self.getAllTimestamps()
ds = stamps[1:] - stamps[0:-1]
mask = np.logical_or((ds > (1+self._accE/100) * ds_des),
(ds < (1-self._accE/100)*ds_des))
mask = np.concatenate([mask, np.array([False])])
ind = np.nonzero(mask)
return ind, mask, stamps
| 41.961443 | 226 | 0.586745 | 3,960 | 33,737 | 4.932323 | 0.109091 | 0.021503 | 0.013926 | 0.018841 | 0.84144 | 0.836013 | 0.825364 | 0.818093 | 0.81154 | 0.794491 | 0 | 0.032564 | 0.294573 | 33,737 | 803 | 227 | 42.013699 | 0.788142 | 0.181522 | 0 | 0.7338 | 0 | 0.012259 | 0.070105 | 0 | 0 | 0 | 0 | 0 | 0.007005 | 1 | 0.052539 | false | 0 | 0.008757 | 0 | 0.119089 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
c89d9d97a01a1827019c7dd871c8f38dd4fdcbbd | 20,421 | py | Python | suites/test_assembly_content.py | redhataccess/cheesecake-api-tests | 9f2d255942bd23f93d0edb9d98be3acc360b7863 | [
"MIT"
] | 1 | 2019-12-03T21:22:37.000Z | 2019-12-03T21:22:37.000Z | suites/test_assembly_content.py | redhataccess/cheesecake-api-tests | 9f2d255942bd23f93d0edb9d98be3acc360b7863 | [
"MIT"
] | 8 | 2020-08-28T19:21:16.000Z | 2021-06-08T12:22:18.000Z | suites/test_assembly_content.py | redhataccess/cheesecake-api-tests | 9f2d255942bd23f93d0edb9d98be3acc360b7863 | [
"MIT"
] | null | null | null | import sys
from helpers import base
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import *
from helpers import constants
import requests
from fixtures import fixture
from polling2 import poll
from helpers import utilities
import urllib.parse
import os
proxy_server = base.config_reader('proxy', 'proxy_server')
proxies = {
"http": proxy_server,
"https": proxy_server,
}
sys.path.append("..")
assembly_title_prefix = base.config_reader('test_repo', 'assembly_prefix')
assembly_prefix = base.config_reader('test_repo', 'assembly_content_prefix')
repo_name = base.config_reader('test_repo', 'repo_name')
module_title_prefix = base.config_reader('test_repo', 'module_prefix')
env = os.getenv('PANTHEON_ENV')
@lcc.suite(description="Suite: Verify contents of published assembly", rank=4)
class test_assembly_content:
api_auth = lcc.inject_fixture("api_auth")
path_for_assembly = ""
request_url = ""
@lcc.test("Verify response of assembly variant api for pantheon endpoints")
def verify_assembly_content(self, api_auth, setup_test_products):
# Publishing module included in assembly
self.variant = utilities.read_variant_name_from_pantheon2config()
lcc.log_info(str(self.variant))
self.variant = str(self.variant)
self.path_for_module = utilities.select_nth_item_from_search_results(0, fixture.url,
module_title_prefix + " Include", api_auth)
if "/assemblies" in self.path_for_module:
self.path_for_module = utilities.select_nth_item_from_search_results(2, fixture.url, module_title_prefix,
api_auth)
res, product_name_uri = utilities.add_metadata(fixture.url, self.path_for_module, self.variant, api_auth,
setup_test_products, content_type="module")
utilities.publish_content(fixture.url, self.path_for_module, self.variant, api_auth)
module_uuid = utilities.fetch_uuid(fixture.url, self.path_for_module, self.variant, api_auth)
published_module_url = fixture.url + "api/module/variant.json/" + module_uuid
published_module_relative_url = "api/module/variant.json/" + module_uuid
print("published module url: \n" + published_module_url)
lcc.log_info("Published Module api endpoint: %s" % published_module_url)
data_from_published_module = api_auth.get(published_module_url)
print(data_from_published_module.json())
self.path_for_assembly = utilities.select_nth_item_from_search_results(0, fixture.url, assembly_prefix,
api_auth)
if "/modules" in self.path_for_assembly:
self.path_for_assembly = utilities.select_nth_item_from_search_results(1, fixture.url, assembly_prefix,
api_auth)
res, product_name_uri = utilities.add_metadata(fixture.url, self.path_for_assembly, self.variant, api_auth,
setup_test_products, content_type="assembly")
# print(res.content)
utilities.publish_content(fixture.url, self.path_for_assembly, self.variant, api_auth)
assembly_uuid = utilities.fetch_uuid(fixture.url, self.path_for_assembly, self.variant, api_auth)
published_assembly_url = fixture.url + "api/assembly/variant.json/" + assembly_uuid
print("published assembly url: \n" + published_assembly_url)
lcc.log_info("Published Assembly api endpoint: %s" % published_assembly_url)
data_from_published_assembly = api_auth.get(published_assembly_url)
print(data_from_published_assembly.content)
check_that("The /api/assembly/variant.json/<assembly_uuid> endpoint for a published assembly",
data_from_published_assembly.status_code, equal_to(200))
# print("Response from published assembly API endpoint: \n" + str(data_from_published_assembly.content))
check_that("The response is ", data_from_published_assembly.json()["message"], equal_to("Assembly Found"))
check_that("The title of the assembly ", data_from_published_assembly.json()["assembly"]["title"],
contains_string(assembly_prefix))
check_that("The status of the assembly ", data_from_published_assembly.json()["assembly"]["status"],
equal_to("published"))
# check_that("The uuid of the assembly", data_from_published_assembly.json()["assembly"]["uuid"],
# equal_to(assembly_uuid))
check_that("The uuid of the assembly", data_from_published_assembly.json()["assembly"]["uuid"],
equal_to(assembly_uuid))
check_that("The abstract of the assembly", data_from_published_assembly.json()["assembly"]["description"],
equal_to(constants.assembly_abstract))
keywords = constants.assembly_searchkeywords.split(',')
print(keywords)
all_of(check_that("Search keywords", data_from_published_assembly.json()["assembly"]["search_keywords"],
has_items(keywords)))
check_that("The assembly type", data_from_published_assembly.json()["assembly"]["content_type"],
equal_to("assembly"))
# date_published and #date_modified test pending
path = self.path_for_assembly.split("repositories/")[1]
path = path + "/en_US/variants/" + self.variant
check_that("The assembly url fragment",
data_from_published_assembly.json()["assembly"]["assembly_url_fragment"],
equal_to(path))
check_that("The view_uri", data_from_published_assembly.json()["assembly"]["view_uri"], equal_to(
fixture.cp_url + "documentation/en-us/" + product_name_uri + "/" + constants.product_version_uri + "/guide/" + assembly_uuid))
check_that("The revision_id", data_from_published_assembly.json()["assembly"]["revision_id"],
equal_to("released"))
# print(data_from_published_assembly.json()["assembly"]["products"][0]["product_name"])
check_that("The product name url",
data_from_published_assembly.json()["assembly"]["products"][0]["product_url_fragment"],
equal_to(product_name_uri))
check_that("The product version",
data_from_published_assembly.json()["assembly"]["products"][0]["product_version"],
equal_to(constants.product_version))
lcc.log_info("Modules included from the API response: %s" % str(
data_from_published_assembly.json()["assembly"]["modules_included"]))
number_of_modules_included = len(data_from_published_assembly.json()["assembly"]["modules_included"])
check_that("Number of Modules included", number_of_modules_included, greater_than_or_equal_to(1))
relative_url = []
for i in range(number_of_modules_included):
print(data_from_published_assembly.json()["assembly"]["modules_included"][i]["relative_url"])
relative_url.append(data_from_published_assembly.json()["assembly"]["modules_included"][i]["relative_url"])
check_that("Modules included",
data_from_published_assembly.json()["assembly"]["modules_included"][i],
all_of(has_entry("canonical_uuid"), has_entry("level_offset"), has_entry("module_uuid"),
has_entry("title"), has_entry("url"), has_entry("pantheon_env"),
has_entry("relative_url")))
check_that("Modules included-> pantheon_env",
data_from_published_assembly.json()["assembly"]["modules_included"][i]["pantheon_env"],
equal_to(env))
print(*relative_url)
check_that("Relative url to", relative_url, has_item("/" + published_module_relative_url))
lcc.log_info("hasPart from the API response: %s" % str(
data_from_published_assembly.json()["assembly"]["hasPart"]))
number_of_modules_hasPart = len(data_from_published_assembly.json()["assembly"]["hasPart"])
check_that("Number of Modules in hasPart", number_of_modules_hasPart, greater_than_or_equal_to(1))
relative_url1 = []
for i in range(number_of_modules_hasPart):
print(data_from_published_assembly.json()["assembly"]["hasPart"][i]["relative_url"])
relative_url1.append(data_from_published_assembly.json()["assembly"]["hasPart"][i]["relative_url"])
check_that("hasPart section ",
data_from_published_assembly.json()["assembly"]["hasPart"][i],
all_of(has_entry("canonical_uuid"), has_entry("level_offset"), has_entry("module_uuid"),
has_entry("title"), has_entry("url"), has_entry("pantheon_env"),
has_entry("relative_url")))
any_of(check_that("hasPart-> pantheon_env",
data_from_published_assembly.json()["assembly"]["hasPart"][i]["pantheon_env"],
equal_to(env)))
print(*relative_url1)
check_that("Relative url to", relative_url1, has_item("/" + published_module_relative_url))
@lcc.test("Verify response of assembly variant api behind akamai")
def verify_assembly_content_behind_akamai(self, api_auth):
assembly_uuid = utilities.fetch_uuid(fixture.url, self.path_for_assembly, self.variant, api_auth)
published_assembly_url = fixture.behind_akamai_url + "api/assembly/variant.json/" + assembly_uuid
print("published assembly url: \n" + published_assembly_url)
lcc.log_info("Published Assembly api endpoint: %s" % published_assembly_url)
data_from_published_assembly = api_auth.get(published_assembly_url, proxies = proxies)
print(data_from_published_assembly.content)
check_that("The /api/assembly/variant.json/<assembly_uuid> endpoint for a published assembly",
data_from_published_assembly.status_code, equal_to(200))
# print("Response from published assembly API endpoint: \n" + str(data_from_published_assembly.content))
check_that("The response is ", data_from_published_assembly.json()["message"], equal_to("Assembly Found"))
check_that("The title of the assembly ", data_from_published_assembly.json()["assembly"]["title"],
contains_string(assembly_prefix))
check_that("The status of the assembly ", data_from_published_assembly.json()["assembly"]["status"],
equal_to("published"))
# check_that("The uuid of the assembly", data_from_published_assembly.json()["assembly"]["uuid"],
# equal_to(assembly_uuid))
check_that("The uuid of the assembly", data_from_published_assembly.json()["assembly"]["uuid"],
equal_to(assembly_uuid))
check_that("The abstract of the assembly", data_from_published_assembly.json()["assembly"]["description"],
equal_to(constants.assembly_abstract))
keywords = constants.assembly_searchkeywords.split(',')
print(keywords)
all_of(check_that("Search keywords", data_from_published_assembly.json()["assembly"]["search_keywords"],
has_items(keywords)))
check_that("The assembly type", data_from_published_assembly.json()["assembly"]["content_type"],
equal_to("assembly"))
# date_published and #date_modified test pending
path = self.path_for_assembly.split("repositories/")[1]
path = path + "/en_US/variants/" + self.variant
check_that("The assembly url fragment",
data_from_published_assembly.json()["assembly"]["assembly_url_fragment"],
equal_to(path))
check_that("The revision_id", data_from_published_assembly.json()["assembly"]["revision_id"],
equal_to("released"))
check_that("The product version",
data_from_published_assembly.json()["assembly"]["products"][0]["product_version"],
equal_to(constants.product_version))
lcc.log_info("Modules included from the API response: %s" % str(
data_from_published_assembly.json()["assembly"]["modules_included"]))
number_of_modules_included = len(data_from_published_assembly.json()["assembly"]["modules_included"])
check_that("Number of Modules included", number_of_modules_included, greater_than_or_equal_to(1))
relative_url = []
for i in range(number_of_modules_included):
print(data_from_published_assembly.json()["assembly"]["modules_included"][i]["relative_url"])
relative_url.append(data_from_published_assembly.json()["assembly"]["modules_included"][i]["relative_url"])
check_that("Modules included",
data_from_published_assembly.json()["assembly"]["modules_included"][i],
all_of(has_entry("canonical_uuid"), has_entry("level_offset"), has_entry("module_uuid"),
has_entry("title"), has_entry("url"), has_entry("pantheon_env"),
has_entry("relative_url")))
check_that("Modules included-> pantheon_env",
data_from_published_assembly.json()["assembly"]["modules_included"][i]["pantheon_env"],
equal_to(env))
lcc.log_info("hasPart from the API response: %s" % str(
data_from_published_assembly.json()["assembly"]["hasPart"]))
number_of_modules_hasPart = len(data_from_published_assembly.json()["assembly"]["hasPart"])
check_that("Number of Modules in hasPart", number_of_modules_hasPart, greater_than_or_equal_to(1))
relative_url1 = []
for i in range(number_of_modules_hasPart):
print(data_from_published_assembly.json()["assembly"]["hasPart"][i]["relative_url"])
relative_url1.append(data_from_published_assembly.json()["assembly"]["hasPart"][i]["relative_url"])
check_that("hasPart section ",
data_from_published_assembly.json()["assembly"]["hasPart"][i],
all_of(has_entry("canonical_uuid"), has_entry("level_offset"), has_entry("module_uuid"),
has_entry("title"), has_entry("url"), has_entry("pantheon_env"),
has_entry("relative_url")))
any_of(check_that("hasPart-> pantheon_env",
data_from_published_assembly.json()["assembly"]["hasPart"][i]["pantheon_env"],
equal_to(env)))
@lcc.test("Verify response of assembly variant api for external proxy API")
def verify_assembly_content_ext_proxy(self, api_auth):
assembly_uuid = utilities.fetch_uuid(fixture.url, self.path_for_assembly, self.variant, api_auth)
published_assembly_url = fixture.external_proxy_url+ "assembly/variant.json/" + assembly_uuid
print("published assembly url: \n" + published_assembly_url)
lcc.log_info("Published Assembly api endpoint: %s" % published_assembly_url)
data_from_published_assembly = api_auth.get(published_assembly_url, proxies =proxies)
print(data_from_published_assembly.content)
check_that("The /api/assembly/variant.json/<assembly_uuid> endpoint for a published assembly",
data_from_published_assembly.status_code, equal_to(200))
# print("Response from published assembly API endpoint: \n" + str(data_from_published_assembly.content))
check_that("The response is ", data_from_published_assembly.json()["message"], equal_to("Assembly Found"))
check_that("The title of the assembly ", data_from_published_assembly.json()["assembly"]["title"],
contains_string(assembly_prefix))
check_that("The status of the assembly ", data_from_published_assembly.json()["assembly"]["status"],
equal_to("published"))
# check_that("The uuid of the assembly", data_from_published_assembly.json()["assembly"]["uuid"],
# equal_to(assembly_uuid))
check_that("The uuid of the assembly", data_from_published_assembly.json()["assembly"]["uuid"],
equal_to(assembly_uuid))
check_that("The abstract of the assembly", data_from_published_assembly.json()["assembly"]["description"],
equal_to(constants.assembly_abstract))
keywords = constants.assembly_searchkeywords.split(',')
print(keywords)
all_of(check_that("Search keywords", data_from_published_assembly.json()["assembly"]["search_keywords"],
has_items(keywords)))
check_that("The assembly type", data_from_published_assembly.json()["assembly"]["content_type"],
equal_to("assembly"))
# date_published and #date_modified test pending
path = self.path_for_assembly.split("repositories/")[1]
path = path + "/en_US/variants/" + self.variant
check_that("The assembly url fragment",
data_from_published_assembly.json()["assembly"]["assembly_url_fragment"],
equal_to(path))
check_that("The revision_id", data_from_published_assembly.json()["assembly"]["revision_id"],
equal_to("released"))
check_that("The product version",
data_from_published_assembly.json()["assembly"]["products"][0]["product_version"],
equal_to(constants.product_version))
lcc.log_info("Modules included from the API response: %s" % str(
data_from_published_assembly.json()["assembly"]["modules_included"]))
number_of_modules_included = len(data_from_published_assembly.json()["assembly"]["modules_included"])
check_that("Number of Modules included", number_of_modules_included, greater_than_or_equal_to(1))
relative_url = []
for i in range(number_of_modules_included):
print(data_from_published_assembly.json()["assembly"]["modules_included"][i]["relative_url"])
relative_url.append(data_from_published_assembly.json()["assembly"]["modules_included"][i]["relative_url"])
check_that("Modules included",
data_from_published_assembly.json()["assembly"]["modules_included"][i],
all_of(has_entry("canonical_uuid"), has_entry("level_offset"), has_entry("module_uuid"),
has_entry("title"), has_entry("url"), has_entry("pantheon_env"),
has_entry("relative_url")))
check_that("Modules included-> pantheon_env",
data_from_published_assembly.json()["assembly"]["modules_included"][i]["pantheon_env"],
equal_to(env))
lcc.log_info("hasPart from the API response: %s" % str(
data_from_published_assembly.json()["assembly"]["hasPart"]))
number_of_modules_hasPart = len(data_from_published_assembly.json()["assembly"]["hasPart"])
check_that("Number of Modules in hasPart", number_of_modules_hasPart, greater_than_or_equal_to(1))
relative_url1 = []
for i in range(number_of_modules_hasPart):
print(data_from_published_assembly.json()["assembly"]["hasPart"][i]["relative_url"])
relative_url1.append(data_from_published_assembly.json()["assembly"]["hasPart"][i]["relative_url"])
check_that("hasPart section ",
data_from_published_assembly.json()["assembly"]["hasPart"][i],
all_of(has_entry("canonical_uuid"), has_entry("level_offset"), has_entry("module_uuid"),
has_entry("title"), has_entry("url"), has_entry("pantheon_env"),
has_entry("relative_url")))
any_of(check_that("hasPart-> pantheon_env",
data_from_published_assembly.json()["assembly"]["hasPart"][i]["pantheon_env"],
equal_to(env)))
| 68.989865 | 138 | 0.653837 | 2,362 | 20,421 | 5.288738 | 0.065622 | 0.148335 | 0.146254 | 0.168108 | 0.897935 | 0.882485 | 0.871598 | 0.851585 | 0.845821 | 0.820285 | 0 | 0.00241 | 0.227756 | 20,421 | 295 | 139 | 69.223729 | 0.789727 | 0.048284 | 0 | 0.737643 | 0 | 0 | 0.233313 | 0.017202 | 0 | 0 | 0 | 0 | 0 | 1 | 0.011407 | false | 0 | 0.041825 | 0 | 0.068441 | 0.072243 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
c8cd480865fcd013d9b416febff1ab138b4b861c | 11,912 | py | Python | tests/test_job.py | hotkit/mod-ngarn | e068c4ec5377e5c70cf0afba598afaee4ba380a3 | [
"MIT"
] | 3 | 2019-10-10T08:02:46.000Z | 2022-01-04T16:21:33.000Z | tests/test_job.py | hotkit/mod-ngarn | e068c4ec5377e5c70cf0afba598afaee4ba380a3 | [
"MIT"
] | 5 | 2018-10-01T13:05:46.000Z | 2019-03-17T19:09:09.000Z | tests/test_job.py | Proteus-tech/mod-ngarn | e068c4ec5377e5c70cf0afba598afaee4ba380a3 | [
"MIT"
] | 1 | 2019-02-27T07:18:07.000Z | 2019-02-27T07:18:07.000Z | import os
from datetime import datetime
from unittest import TestCase
import asyncio
import freezegun
import pytest
from mod_ngarn.connection import get_connection
from mod_ngarn.utils import create_table
from mod_ngarn.worker import Job, JobRunner
from decimal import Decimal
def sync_dummy_job(text):
return text
async def async_dummy_job(text):
return text
def raise_dummy_job():
raise KeyError()
@pytest.mark.asyncio
async def test_job_execute_builtin_success():
await create_table("public", "modngarn_job")
cnx = await get_connection()
job = Job(cnx, "public", "modngarn_job", "job-1", "sum", 1, [[1, 2]], {})
result = await job.execute()
assert result == 3
await cnx.close()
@pytest.mark.asyncio
async def test_job_execute_sync_fn_success():
await create_table("public", "modngarn_job")
cnx = await get_connection()
job = Job(
cnx,
"public",
"modngarn_job",
"job-1",
"tests.test_job.sync_dummy_job",
1,
["hello"],
{},
)
result = await job.execute()
assert result == "hello"
await cnx.close()
@pytest.mark.asyncio
async def test_job_execute_async_fn_success():
await create_table("public", "modngarn_job")
cnx = await get_connection()
job = Job(
cnx,
"public",
"modngarn_job",
"job-1",
"tests.test_job.async_dummy_job",
1,
["hello"],
{},
)
result = await job.execute()
assert result == "hello"
await cnx.close()
@pytest.mark.asyncio
async def test_job_success_record_to_db():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args) VALUES ('job-1', 'tests.test_job.async_dummy_job', '["hello"]')
""".format(
queue_table=queue_table
)
)
job = Job(
cnx,
"public",
"modngarn_job",
"job-1",
"tests.test_job.async_dummy_job",
0,
["hello"],
{},
)
result = await job.execute()
assert result == "hello"
job = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-1")
assert job["result"] == "hello"
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
@pytest.mark.asyncio
async def test_job_failed_record_to_db():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args) VALUES ('job-2', 'tests.test_job.raise_dummy_job', '["hello"]')
""".format(
queue_table=queue_table
)
)
job = Job(
cnx, "public", "modngarn_job", "job-2", "tests.test_job.raise_dummy_job", 0
)
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["result"] == None
assert job_db["priority"] == 1
assert "KeyError" in job_db["reason"]
assert "Traceback" in job_db["reason"]
log_db = await cnx.fetchval(
f"SELECT COUNT(*) FROM {queue_table}_error WHERE id=$1", "job-2"
)
assert log_db == 1
job = Job(
cnx, "public", "modngarn_job", "job-2", "tests.test_job.raise_dummy_job", 1
)
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["result"] == None
assert job_db["priority"] == 2
assert "KeyError" in job_db["reason"]
assert "Traceback" in job_db["reason"]
log_db = await cnx.fetchval(
f"SELECT COUNT(*) FROM {queue_table}_error WHERE id=$1", "job-2"
)
assert log_db == 2
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
@freezegun.freeze_time("2018-01-01T12:00:00+00:00")
@pytest.mark.asyncio
async def test_job_failed_exponential_delay_job_based_on_priority():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args) VALUES ('job-2', 'tests.test_job.raise_dummy_job', '["hello"]')
""".format(
queue_table=queue_table
)
)
job = Job(
cnx, "public", "modngarn_job", "job-2", "tests.test_job.raise_dummy_job", 0
)
# First failed, should delay 1 sec
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["priority"] == 1
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:01+00:00"
# Second failed, should delay e^2 sec
job.priority = job_db["priority"]
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["priority"] == 2
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:02.718282+00:00"
# Third failed, should delay e^3 sec
job.priority = job_db["priority"]
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["priority"] == 3
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:07.389056+00:00"
# 10th failed, should delay e^10 sec
job.priority = 10
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["scheduled"].isoformat() == "2018-01-01T18:07:06.465795+00:00"
# 21th failed, should be priority 21
job.priority = 21
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["scheduled"].isoformat() == "2059-10-17T13:42:14.483215+00:00"
# 22th failed, should be priority 21
job.priority = 22
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["scheduled"].isoformat() == "2059-10-17T13:42:14.483215+00:00"
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
@freezegun.freeze_time("2018-01-01T12:00:00+00:00")
@pytest.mark.asyncio
async def test_job_failed_can_set_max_delay():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args) VALUES ('job-2', 'tests.test_job.raise_dummy_job', '["hello"]')
""".format(
queue_table=queue_table
)
)
job = Job(
cnx,
"public",
"modngarn_job",
"job-2",
"tests.test_job.raise_dummy_job",
0,
max_delay=1.5,
)
# First failed, should delay 1 sec
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["priority"] == 1
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:01+00:00"
# Second failed, should delay 1.5 sec
job.priority = job_db["priority"]
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["priority"] == 2
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:01.500000+00:00"
# Third failed, should delay 1.5 sec
job.priority = job_db["priority"]
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["priority"] == 3
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:01.500000+00:00"
# 10th failed, should delay 1.5 sec
job.priority = 10
await job.execute()
job_db = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-2")
assert job_db["scheduled"].isoformat() == "2018-01-01T12:00:01.500000+00:00"
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
@pytest.mark.asyncio
async def test_job_runner_success_process():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args) VALUES ('job-1', 'tests.test_job.async_dummy_job', '["hello"]')
""".format(
queue_table=queue_table
)
)
job_runner = JobRunner()
await job_runner.run("public", "modngarn_job", 1, None)
job = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-1")
assert job["result"] == "hello"
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
@pytest.mark.asyncio
async def test_job_runner_can_define_limit():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f'TRUNCATE TABLE "modngarn_job";')
await cnx.execute(
"""INSERT INTO "modngarn_job" (id, fn_name, args)
SELECT 'job-' || s, 'tests.test_job.async_dummy_job', '["hello"]'
FROM generate_series(0, 100) s;"""
)
job_runner = JobRunner()
await job_runner.run("public", "modngarn_job", 10, None)
total_processed = await cnx.fetchval(
f'SELECT COUNT(*) FROM "modngarn_job" WHERE executed IS NOT NULL'
)
assert total_processed == 10
await job_runner.run("public", "modngarn_job", 10, None)
total_processed = await cnx.fetchval(
f'SELECT COUNT(*) FROM "modngarn_job" WHERE executed IS NOT NULL'
)
assert total_processed == 20
await cnx.execute(f'TRUNCATE TABLE "modngarn_job";')
await cnx.close()
@pytest.mark.asyncio
async def test_job_notify_when_job_is_inserted():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
q = asyncio.Queue()
def listener(cnx, pid: int, channel: str, payload: str):
q.put_nowait(channel)
await cnx.add_listener("public_modngarn_job", listener)
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args, reason) VALUES ('job-1', 'tests.test_job.async_dummy_job', '["hello"]', 'some error message')
""".format(
queue_table=queue_table
)
)
assert q.get_nowait() == "public_modngarn_job"
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
@pytest.mark.asyncio
async def test_job_runner_success_should_clear_error_msg():
queue_table = "public.modngarn_job"
await create_table("public", "modngarn_job")
cnx = await get_connection()
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.execute(
"""
INSERT INTO {queue_table} (id, fn_name, args, reason) VALUES ('job-1', 'tests.test_job.async_dummy_job', '["hello"]', 'some error message')
""".format(
queue_table=queue_table
)
)
job_runner = JobRunner()
await job_runner.run("public", "modngarn_job", 1, None)
job = await cnx.fetchrow(f"SELECT * FROM {queue_table} WHERE id=$1", "job-1")
assert job["result"] == "hello"
assert job["reason"] is None
await cnx.execute(f"TRUNCATE TABLE {queue_table};")
await cnx.close()
class TestExitFromJobRunner(TestCase):
def async_test(f):
def wrapper(*args, **kwargs):
coro = asyncio.coroutine(f)
future = coro(*args, **kwargs)
loop = asyncio.get_event_loop()
loop.run_until_complete(future)
return wrapper
| 32.546448 | 143 | 0.642461 | 1,652 | 11,912 | 4.441889 | 0.096852 | 0.081766 | 0.076451 | 0.056964 | 0.879531 | 0.869719 | 0.856773 | 0.843145 | 0.828564 | 0.828564 | 0 | 0.040816 | 0.214322 | 11,912 | 365 | 144 | 32.635616 | 0.743242 | 0.029046 | 0 | 0.72069 | 0 | 0 | 0.277714 | 0.054088 | 0 | 0 | 0 | 0 | 0.127586 | 1 | 0.017241 | false | 0 | 0.034483 | 0.003448 | 0.065517 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
cd9d4a108d07191e55c13e4966c84ce2b98b3b83 | 15,566 | py | Python | chunair/kicad-footprint-generator-master/scripts/TerminalBlock_WAGO/make_TerminalBlock_WAGO.py | speedypotato/chuni-lite | c8dda8428723f8c4f99075e7cbaa22a44cbc187d | [
"CC-BY-4.0"
] | 2 | 2022-03-18T23:42:51.000Z | 2022-03-19T15:31:34.000Z | chunair/kicad-footprint-generator-master/scripts/TerminalBlock_WAGO/make_TerminalBlock_WAGO.py | speedypotato/chuni-lite | c8dda8428723f8c4f99075e7cbaa22a44cbc187d | [
"CC-BY-4.0"
] | null | null | null | chunair/kicad-footprint-generator-master/scripts/TerminalBlock_WAGO/make_TerminalBlock_WAGO.py | speedypotato/chuni-lite | c8dda8428723f8c4f99075e7cbaa22a44cbc187d | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import math
# ensure that the kicad-footprint-generator directory is available
#sys.path.append(os.environ.get('KIFOOTPRINTGENERATOR')) # enable package import from parent directory
#sys.path.append("D:\hardware\KiCAD\kicad-footprint-generator") # enable package import from parent directory
sys.path.append(os.path.join(sys.path[0],"..","..","kicad_mod")) # load kicad_mod path
sys.path.append(os.path.join(sys.path[0],"..","..")) # load kicad_mod path
sys.path.append(os.path.join(sys.path[0],"..","tools")) # load kicad_mod path
from KicadModTree import * # NOQA
from footprint_scripts_terminal_blocks import *
if __name__ == '__main__':
script_generated_note="script-generated using https://github.com/pointhi/kicad-footprint-generator/scripts/TerminalBlock_WAGO";
classname="TerminalBlock_WAGO"
pins=[1,2,3,4,5,6,7,8,9,10,11,12,16,24]
rm=7.5
package_height=15
leftbottom_offset=[2.75, 6.7, 3.75]
ddrill=1.2
pad=[2,3]
screw_diameter=2.2
bevel_height=[2.9]
vsegment_lines_offset=[-1.25]
opening=[2.9,2.3]
opening_xoffset=1.25
opening_yoffset=1.45
opening_elliptic=True
secondDrillDiameter=ddrill
secondDrillOffset=[2.5,-5]
secondDrillPad=pad
secondHoleDiameter=[4,4.4]
secondHoleOffset=[1.25,0]
thirdHoleDiameter=[4,1]
thirdHoleOffset=[1.25,0]
fourthHoleDiameter=3#4
fourthHoleOffset=[1.25,-5.75]
fifthHoleDiameter=0
fifthHoleOffset=[2.5,-0.75]
secondEllipseSize=[0,0]
secondEllipseOffset=[1.25,2.5]
fabref_offset=[0,-1]
nibbleSize=[]
nibblePos=[]
for p in pins:
name="804-{0}".format(300+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad, vsegment_lines_offset=vsegment_lines_offset,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset, opening_elliptic=opening_elliptic,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, fifthHoleDiameter=fifthHoleDiameter,fifthHoleOffset=fifthHoleOffset,
secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad,
secondEllipseSize=secondEllipseSize,secondEllipseOffset=secondEllipseOffset,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
pins=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,24]
rm=5
package_height=15
leftbottom_offset=[2.75, 6.7, 3.75]
ddrill=1.2
pad=[2,3]
screw_diameter=2.2
bevel_height=[2.9]
vsegment_lines_offset=[-1.25]
opening=[2.9,2.3]
opening_xoffset=1.25
opening_yoffset=1.45
opening_elliptic=True
secondDrillDiameter=ddrill
secondDrillOffset=[2.5,-5]
secondDrillPad=pad
secondHoleDiameter=[4,4.4]
secondHoleOffset=[1.25,0]
thirdHoleDiameter=[4,1]
thirdHoleOffset=[1.25,0]
fourthHoleDiameter=3#4
fourthHoleOffset=[1.25,-5.75]
fifthHoleDiameter=0
fifthHoleOffset=[1.25,-0.75]
secondEllipseSize=[0,0]
secondEllipseOffset=[1.25,2.5]
fabref_offset=[0,-1]
nibbleSize=[]
nibblePos=[]
for p in pins:
name="804-{0}".format(100+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad, vsegment_lines_offset=vsegment_lines_offset,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset, opening_elliptic=opening_elliptic,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, fifthHoleDiameter=fifthHoleDiameter,fifthHoleOffset=fifthHoleOffset,
secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad,
secondEllipseSize=secondEllipseSize,secondEllipseOffset=secondEllipseOffset,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
pins=[1,2,3,4,5,6,7,8,9,12,14,16,24,36,48]
rm=5
package_height=14
leftbottom_offset=[3.5, 9, 3.8]
ddrill=1.15
pad=[1.5,3]
screw_diameter=2.2
bevel_height=[1,6.7,9.5]
opening=[4,3.3]
opening_xoffset=0.5
opening_yoffset=1.3#package_height-leftbottom_offset[1]-opening[1]/2
secondDrillDiameter=ddrill
secondDrillOffset=[0,5]
secondDrillPad=pad
secondHoleDiameter=[5,14]
secondHoleOffset=[0.5,2]
thirdHoleDiameter=[4,1]
thirdHoleOffset=[0.5,3.2]
fourthHoleDiameter=[1,2.5]
fourthHoleOffset=[0.5,-3.4]
fabref_offset=[0,-1]
nibbleSize=[]
nibblePos=[]
for p in pins:
name="236-{0}".format(100+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
name="236-{0}".format(400+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset,
secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
pins=[1,2,3,4,5,6,7,8,9,12,16,24]
rm=7.5
package_height=14
leftbottom_offset=[3.5, 9, 6.3]
ddrill=1.15
pad=[1.5,3]
screw_diameter=2.2
bevel_height=[1,6.7,9.5]
opening=[4,3.3]
opening_xoffset=0.5
opening_yoffset=1.3#package_height-leftbottom_offset[1]-opening[1]/2
secondDrillDiameter=ddrill
secondDrillOffset=[0,5]
secondDrillPad=pad
secondHoleDiameter=[rm,package_height]
secondHoleOffset=[1.75,2]
thirdHoleDiameter=[4,1]
thirdHoleOffset=[0.5,3.2]
fourthHoleDiameter=1,2.5
fourthHoleOffset=[0.5,-3.4]
fabref_offset=[0,-1]
nibbleSize=[]
nibblePos=[]
for p in pins:
name="236-{0}".format(200+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
name="236-{0}".format(500+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset,
secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
pins=[1,2,3,4,5,6,8,9,12,16,24]
rm=10
package_height=14
leftbottom_offset=[3.5, 9, 8.8]
ddrill=1.15
pad=[1.5,3]
screw_diameter=2.2
bevel_height=[1,6.7,9.5]
opening=[4,3.3]
opening_xoffset=0.5
opening_yoffset=1.3#package_height-leftbottom_offset[1]-opening[1]/2
secondDrillDiameter=ddrill
secondDrillOffset=[0,5]
secondDrillPad=pad
secondHoleDiameter=[rm,package_height]
secondHoleOffset=[3,2]
thirdHoleDiameter=[4,1]
thirdHoleOffset=[0.5,3.2]
fourthHoleDiameter=1,2.5
fourthHoleOffset=[0.5,-3.4]
fabref_offset=[0,-1]
nibbleSize=[]
nibblePos=[]
for p in pins:
name="236-{0}".format(300+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
name="236-{0}".format(600+p);
webpage="";
classname_description="Terminal Block WAGO {0}".format(name);
footprint_name="TerminalBlock_WAGO_{0}_1x{2:02}_P{1:3.2f}mm_45Degree".format(name, rm, p)
makeTerminalBlock45Degree(footprint_name=footprint_name,
pins=p, rm=rm,
package_height=package_height, leftbottom_offset=leftbottom_offset,
ddrill=ddrill, pad=pad,
opening=opening, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset,
bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset,
secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad,
nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset,
tags_additional=[], lib_name="${KICAD6_3DMODEL_DIR}/"+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
| 56.810219 | 347 | 0.667673 | 1,625 | 15,566 | 6.193846 | 0.082462 | 0.033582 | 0.032091 | 0.031694 | 0.954694 | 0.951316 | 0.950323 | 0.950323 | 0.945554 | 0.926677 | 0 | 0.048097 | 0.23198 | 15,566 | 273 | 348 | 57.018315 | 0.79381 | 0.032443 | 0 | 0.857724 | 0 | 0.004065 | 0.065399 | 0.039346 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.020325 | 0 | 0.020325 | 0.073171 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
cdcca8d098bd7962b96802f2c2b22bbb519e3c6f | 184 | py | Python | dev_blog/settings/__init__.py | kylejuliandev/dev_blog_assignment | 272466cb591f9b45fb81c2a42e86b25bff3cd9ad | [
"MIT"
] | null | null | null | dev_blog/settings/__init__.py | kylejuliandev/dev_blog_assignment | 272466cb591f9b45fb81c2a42e86b25bff3cd9ad | [
"MIT"
] | null | null | null | dev_blog/settings/__init__.py | kylejuliandev/dev_blog_assignment | 272466cb591f9b45fb81c2a42e86b25bff3cd9ad | [
"MIT"
] | null | null | null | from .base import *
if os.environ.get('ENVIRONMENT') == 'prod':
from .prod import *
elif os.environ.get('ENVIRONMENT') == 'test':
from .test import *
else:
from .dev import * | 23 | 45 | 0.646739 | 25 | 184 | 4.76 | 0.52 | 0.151261 | 0.201681 | 0.386555 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184783 | 184 | 8 | 46 | 23 | 0.793333 | 0 | 0 | 0 | 0 | 0 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
b5211ac43f6b42a738f4c82f6feaae39f370d4ce | 79 | py | Python | code/dk-iris-pipeline/airflow_home/src/deploy/__init__.py | dushyantkhosla/airflow4ds | b5ae213f7169c54d31f4eca58d235ec6b09fd56f | [
"MIT"
] | 13 | 2019-01-15T14:42:58.000Z | 2021-11-10T07:29:36.000Z | code/dk-iris-pipeline/airflow_home/src/deploy/__init__.py | dushyantkhosla/airflow4ds | b5ae213f7169c54d31f4eca58d235ec6b09fd56f | [
"MIT"
] | 1 | 2018-10-03T12:52:56.000Z | 2018-10-03T12:52:56.000Z | code/dk-iris-pipeline/airflow_home/src/deploy/__init__.py | dushyantkhosla/airflow4ds | b5ae213f7169c54d31f4eca58d235ec6b09fd56f | [
"MIT"
] | 3 | 2020-04-21T14:55:39.000Z | 2021-04-29T15:42:00.000Z | from .from_api import get_prediction
from .for_api import generate_random_iris
| 26.333333 | 41 | 0.873418 | 13 | 79 | 4.923077 | 0.692308 | 0.28125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101266 | 79 | 2 | 42 | 39.5 | 0.901408 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
b5387bb9d8d682c16b9514e44cee44c5b6e9a050 | 7,850 | py | Python | tests/test_commandline.py | zhouyangnk/Montreal-Forced-Aligner | 4f8733409e79a50744616921a04fccf115e8af6f | [
"MIT"
] | null | null | null | tests/test_commandline.py | zhouyangnk/Montreal-Forced-Aligner | 4f8733409e79a50744616921a04fccf115e8af6f | [
"MIT"
] | null | null | null | tests/test_commandline.py | zhouyangnk/Montreal-Forced-Aligner | 4f8733409e79a50744616921a04fccf115e8af6f | [
"MIT"
] | null | null | null | import os
import pytest
from aligner.command_line.align import run_align_corpus, DummyArgs
from aligner.command_line.train_and_align import align_corpus as train_and_align_corpus
from aligner.command_line.validate import validate_corpus
from aligner.exceptions import PronunciationAcousticMismatchError
def assert_export_exist(old_directory, new_directory):
for root, dirs, files in os.walk(old_directory):
new_root = root.replace(old_directory, new_directory)
for d in dirs:
assert (os.path.exists(os.path.join(new_root, d)))
for f in files:
if not f.endswith('.wav'):
continue
new_f = f.replace('.wav', '.TextGrid')
assert (os.path.exists(os.path.join(new_root, new_f)))
def test_train_large_prosodylab(large_prosodylab_format_directory,
large_dataset_dictionary, prosodylab_output_directory,
prosodylab_output_model_path, temp_dir, basic_train_config, skip_large):
if skip_large:
pytest.skip('Large testsets disabled')
args = DummyArgs()
args.num_jobs = 2
args.clean = True
args.corpus_directory = large_prosodylab_format_directory
args.dictionary_path = large_dataset_dictionary
args.output_directory = prosodylab_output_directory
args.output_model_path = prosodylab_output_model_path
args.temp_directory = temp_dir
args.config_path = basic_train_config
train_and_align_corpus(args)
# assert_export_exist(large_prosodylab_format_directory, prosodylab_output_directory)
assert (os.path.exists(args.output_model_path))
train_and_align_corpus(args)
def test_align_basic(basic_corpus_dir, sick_dict_path, generated_dir, large_dataset_dictionary, temp_dir,
basic_align_config, english_acoustic_model):
args = DummyArgs()
args.acoustic_model_path = 'english'
args.corpus_directory = basic_corpus_dir
args.dictionary_path = sick_dict_path
args.output_directory = os.path.join(generated_dir, 'basic_output')
args.quiet = True
args.clean = True
args.temp_directory = temp_dir
args.config_path = basic_align_config
with pytest.raises(PronunciationAcousticMismatchError):
run_align_corpus(args)
args.acoustic_model_path = 'english'
args.corpus_directory = basic_corpus_dir
args.dictionary_path = large_dataset_dictionary
args.output_directory = os.path.join(generated_dir, 'basic_output')
run_align_corpus(args)
def test_nnet_export_model(large_prosodylab_format_directory, config_directory, generated_dir, large_dataset_dictionary,
temp_dir):
args = DummyArgs()
args.debug = True
args.clean = True
args.config_path = os.path.join(config_directory, 'long_nnet_train.yaml')
args.output_model_path = os.path.join(generated_dir, 'nnet_test_model.zip')
args.corpus_directory = large_prosodylab_format_directory
args.dictionary_path = large_dataset_dictionary
args.output_directory = os.path.join(generated_dir, 'nnet_basic_output_selftrained_outputting_model3')
args.temp_directory = temp_dir
train_and_align_corpus(args)
def test_nnet_use_model(basic_corpus_dir, generated_dir, large_dataset_dictionary, temp_dir):
args = DummyArgs()
args.debug = True
args.clean = True
args.acoustic_model_path = os.path.join(generated_dir, 'nnet_test_model.zip')
args.corpus_directory = basic_corpus_dir
args.dictionary_path = large_dataset_dictionary
args.output_directory = os.path.join(generated_dir, 'nnet_basic_output')
args.temp_directory = temp_dir
run_align_corpus(args)
def test_align_basic_errors(basic_corpus_dir, large_dataset_dictionary, generated_dir, temp_dir):
args = DummyArgs()
args.quiet = True
args.clean = True
args.acoustic_model_path = 'english'
args.corpus_directory = basic_corpus_dir
args.dictionary_path = large_dataset_dictionary
args.output_directory = os.path.join(generated_dir, 'basic_output')
args.temp_directory = temp_dir
run_align_corpus(args)
def test_align_basic_debug(basic_corpus_dir, large_dataset_dictionary, generated_dir, temp_dir):
args = DummyArgs()
args.debug = True
args.quiet = True
args.clean = True
args.acoustic_model_path = 'english'
args.corpus_directory = basic_corpus_dir
args.dictionary_path = large_dataset_dictionary
args.output_directory = os.path.join(generated_dir, 'basic_output')
args.temp_directory = temp_dir
run_align_corpus(args)
def test_align_large_prosodylab(large_prosodylab_format_directory, prosodylab_output_directory,
large_dataset_dictionary, temp_dir, basic_align_config, skip_large):
if skip_large:
pytest.skip('Large testsets disabled')
args = DummyArgs()
args.quiet = True
args.clean = True
args.acoustic_model_path = 'english'
args.corpus_directory = large_prosodylab_format_directory
args.dictionary_path = large_dataset_dictionary
args.output_directory = prosodylab_output_directory
args.temp_directory = temp_dir
args.config_path = basic_align_config
run_align_corpus(args)
# assert_export_exist(large_prosodylab_format_directory, prosodylab_output_directory)
def test_train_single_speaker_prosodylab(single_speaker_prosodylab_format_directory,
large_dataset_dictionary,
prosodylab_output_directory,
prosodylab_output_model_path, temp_dir, basic_train_config, skip_large):
if skip_large:
pytest.skip('Large testsets disabled')
args = DummyArgs()
args.num_jobs = 2
args.clean = True
args.temp_directory = temp_dir
args.corpus_directory = single_speaker_prosodylab_format_directory
args.dictionary_path = large_dataset_dictionary
args.output_directory = prosodylab_output_directory
args.output_model_path = prosodylab_output_model_path
args.config_path = basic_train_config
train_and_align_corpus(args)
# assert_export_exist(single_speaker_prosodylab_format_directory, prosodylab_output_directory)
assert (os.path.exists(args.output_model_path))
## TEXTGRID
def test_align_large_textgrid(large_textgrid_format_directory, textgrid_output_directory, large_dataset_dictionary,
temp_dir, basic_align_config, skip_large):
if skip_large:
pytest.skip('Large testsets disabled')
args = DummyArgs()
args.clean = True
args.acoustic_model_path = 'english'
args.corpus_directory = large_textgrid_format_directory
args.output_directory = textgrid_output_directory
args.dictionary_path = large_dataset_dictionary
args.temp_directory = temp_dir
args.config_path = basic_align_config
run_align_corpus(args)
# assert_export_exist(large_textgrid_format_directory, textgrid_output_directory)
def test_train_large_textgrid(large_textgrid_format_directory,
large_dataset_dictionary, textgrid_output_directory,
textgrid_output_model_path, temp_dir, basic_train_config, skip_large):
if skip_large:
pytest.skip('Large testsets disabled')
args = DummyArgs()
args.num_jobs = 2
args.clean = True
args.corpus_directory = large_textgrid_format_directory
args.dictionary_path = large_dataset_dictionary
args.output_directory = textgrid_output_directory
args.output_model_path = textgrid_output_model_path
args.temp_directory = temp_dir
args.config_path = basic_train_config
train_and_align_corpus(args)
# assert_export_exist(large_textgrid_format_directory, textgrid_output_directory)
assert (os.path.exists(args.output_model_path))
| 41.534392 | 120 | 0.748917 | 986 | 7,850 | 5.530426 | 0.084179 | 0.07152 | 0.08069 | 0.031176 | 0.851091 | 0.818265 | 0.793141 | 0.752246 | 0.725472 | 0.70585 | 0 | 0.000626 | 0.185732 | 7,850 | 188 | 121 | 41.755319 | 0.852472 | 0.05465 | 0 | 0.714286 | 0 | 0 | 0.046405 | 0.00634 | 0 | 0 | 0 | 0 | 0.038961 | 1 | 0.071429 | false | 0 | 0.038961 | 0 | 0.11039 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
b538c60523c61080e42bd1aca1be040e5a7166aa | 167 | py | Python | succolib/__init__.py | mattiasoldani/succolib | 95581fb9e4fabcc6d4232a63f5e92df49aab939a | [
"MIT"
] | null | null | null | succolib/__init__.py | mattiasoldani/succolib | 95581fb9e4fabcc6d4232a63f5e92df49aab939a | [
"MIT"
] | 13 | 2020-06-23T08:57:58.000Z | 2022-03-25T16:11:39.000Z | succolib/__init__.py | mattiasoldani/succolib | 95581fb9e4fabcc6d4232a63f5e92df49aab939a | [
"MIT"
] | null | null | null | from .io.__init__ import *
from .math_tools.__init__ import *
from .tracking.__init__ import *
from .statistics.__init__ import *
from .visualisation.__init__ import * | 33.4 | 37 | 0.796407 | 21 | 167 | 5.333333 | 0.428571 | 0.446429 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113772 | 167 | 5 | 37 | 33.4 | 0.756757 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
b54a86825f5f33024256d1b0c2b5b9a33b3458e9 | 229 | py | Python | referencing/search.py | rsbyrne/thesis | 44689b1d06c5b08fd44054313d7a6148b0e44a24 | [
"MIT"
] | null | null | null | referencing/search.py | rsbyrne/thesis | 44689b1d06c5b08fd44054313d7a6148b0e44a24 | [
"MIT"
] | null | null | null | referencing/search.py | rsbyrne/thesis | 44689b1d06c5b08fd44054313d7a6148b0e44a24 | [
"MIT"
] | 1 | 2021-06-10T14:35:54.000Z | 2021-06-10T14:35:54.000Z | if __name__ == '__main__':
import sys
from searchengine import get_searchengine
search = get_searchengine()
search(sys.argv[1])
else:
from .searchengine import get_searchengine
search = get_searchengine() | 25.444444 | 46 | 0.720524 | 26 | 229 | 5.884615 | 0.461538 | 0.392157 | 0.411765 | 0.326797 | 0.75817 | 0.75817 | 0.75817 | 0.75817 | 0 | 0 | 0 | 0.005464 | 0.200873 | 229 | 9 | 47 | 25.444444 | 0.830601 | 0 | 0 | 0.25 | 0 | 0 | 0.034783 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 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 | 9 |
b57b137006caeb2b445212463c3b52537f53d93c | 142 | py | Python | thermo_int/__init__.py | JunboLu/CP2K_kit | 0950f37f253c3f90d6a0539c57f1be1045e7317d | [
"Apache-2.0"
] | 16 | 2021-04-19T03:40:32.000Z | 2022-02-21T12:53:33.000Z | thermo_int/__init__.py | JunboLu/CP2K_kit | 0950f37f253c3f90d6a0539c57f1be1045e7317d | [
"Apache-2.0"
] | null | null | null | thermo_int/__init__.py | JunboLu/CP2K_kit | 0950f37f253c3f90d6a0539c57f1be1045e7317d | [
"Apache-2.0"
] | 2 | 2021-11-28T02:55:31.000Z | 2022-02-21T12:54:52.000Z | from CP2K_kit.thermo_int import check_thermo_int
from CP2K_kit.thermo_int import constraint_md
from CP2K_kit.thermo_int import mix_force_eval
| 35.5 | 48 | 0.894366 | 26 | 142 | 4.461538 | 0.461538 | 0.310345 | 0.284483 | 0.439655 | 0.672414 | 0.672414 | 0 | 0 | 0 | 0 | 0 | 0.023077 | 0.084507 | 142 | 3 | 49 | 47.333333 | 0.869231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 8 |
b5860500a13437b409cd201c99fd5d9f856d3b7e | 304 | py | Python | resources/__init__.py | fellipeh/imoveis | c7260621d2982631cfc003d6922ae7c6e0454aab | [
"MIT"
] | null | null | null | resources/__init__.py | fellipeh/imoveis | c7260621d2982631cfc003d6922ae7c6e0454aab | [
"MIT"
] | null | null | null | resources/__init__.py | fellipeh/imoveis | c7260621d2982631cfc003d6922ae7c6e0454aab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .users import UserLogin, UserLogoutAccess, UserLogoutRefresh, UserRegistration, AllUsers, TokenRefresh
from .items import Items
__all__ = ['UserLogin', 'UserLogoutAccess', 'UserLogoutRefresh', 'UserRegistration', 'AllUsers', 'TokenRefresh',
'Items'
]
| 33.777778 | 112 | 0.700658 | 24 | 304 | 8.708333 | 0.583333 | 0.239234 | 0.401914 | 0.555024 | 0.746411 | 0.746411 | 0 | 0 | 0 | 0 | 0 | 0.003968 | 0.171053 | 304 | 8 | 113 | 38 | 0.825397 | 0.069079 | 0 | 0 | 0 | 0 | 0.295374 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
a9a18c1aa3b94044a5c4900609ce1db9cfd6edb9 | 2,011 | py | Python | wcoa/migrations/0009_auto_20190725_2314.py | Ecotrust/wcoa | 21501677f161b2a3a718dab547b7c1c567efe729 | [
"MIT"
] | 1 | 2019-11-30T22:29:23.000Z | 2019-11-30T22:29:23.000Z | wcoa/migrations/0009_auto_20190725_2314.py | Ecotrust/wcoa | 21501677f161b2a3a718dab547b7c1c567efe729 | [
"MIT"
] | 13 | 2019-08-23T03:22:09.000Z | 2021-12-09T00:46:44.000Z | wcoa/migrations/0009_auto_20190725_2314.py | Ecotrust/wcoa | 21501677f161b2a3a718dab547b7c1c567efe729 | [
"MIT"
] | 1 | 2019-11-30T22:29:28.000Z | 2019-11-30T22:29:28.000Z | # Generated by Django 2.2.3 on 2019-07-25 23:14
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('wcoa', '0008_auto_20190725_2313'),
]
operations = [
migrations.AlterField(
model_name='connectpage',
name='cta_list',
field=wagtail.core.fields.StreamField([('connection', wagtail.core.blocks.StructBlock([('cta_title', wagtail.core.blocks.CharBlock()), ('cta_content', wagtail.core.blocks.RichTextBlock()), ('cta_link', wagtail.core.blocks.URLBlock(label='URL', required=False)), ('width', wagtail.core.blocks.IntegerBlock(help_text='Number of columns to span out of 12 (e.g., input of 3 would mean give this a width of 3 out of the 12 (25%))', max_value=12, min_value=0, required=False)), ('background_color', wagtail.core.blocks.ChoiceBlock(choices=[('blue', 'Blue'), ('green', 'Green')], icon='color', required=False)), ('background_image', wagtail.images.blocks.ImageChooserBlock(required=False))])), ('details', wagtail.core.blocks.RichTextBlock())]),
),
migrations.AlterField(
model_name='ctapage',
name='body',
field=wagtail.core.fields.StreamField([('item', wagtail.core.blocks.StructBlock([('cta_title', wagtail.core.blocks.CharBlock()), ('cta_content', wagtail.core.blocks.RichTextBlock()), ('cta_link', wagtail.core.blocks.URLBlock(label='URL', required=False)), ('width', wagtail.core.blocks.IntegerBlock(help_text='Number of columns to span out of 12 (e.g., input of 3 would mean give this a width of 3 out of the 12 (25%))', max_value=12, min_value=0, required=False)), ('background_color', wagtail.core.blocks.ChoiceBlock(choices=[('blue', 'Blue'), ('green', 'Green')], icon='color', required=False)), ('background_image', wagtail.images.blocks.ImageChooserBlock(required=False))])), ('details', wagtail.core.blocks.RichTextBlock())]),
),
]
| 74.481481 | 750 | 0.696668 | 257 | 2,011 | 5.365759 | 0.33463 | 0.143582 | 0.184917 | 0.08702 | 0.767223 | 0.719362 | 0.719362 | 0.719362 | 0.719362 | 0.719362 | 0 | 0.03039 | 0.13277 | 2,011 | 26 | 751 | 77.346154 | 0.760321 | 0.022377 | 0 | 0.2 | 1 | 0.1 | 0.245927 | 0.011711 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.35 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
8d7abc78638351a573291a295313c787a2488c28 | 132 | py | Python | 02/01/capitalize.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | null | null | null | 02/01/capitalize.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | 39 | 2017-07-31T22:54:01.000Z | 2017-08-31T00:19:03.000Z | 02/01/capitalize.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | null | null | null | #最初の文字を大文字にし、残りを小文字に
print('abcdefg'.capitalize())
print('ABCDEFG'.capitalize())
print('abcdefg'.upper())
print('ABCDEFG'.lower())
| 18.857143 | 29 | 0.727273 | 14 | 132 | 6.857143 | 0.5 | 0.5 | 0.458333 | 0.5625 | 0.583333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045455 | 132 | 6 | 30 | 22 | 0.761905 | 0.143939 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 7 |
a5ce64e9c997d941cd9bbb6842b337d6714054bd | 122 | py | Python | test.py | benokan/Malware_Detection_ML | 5ddd60f12a65ae554b07dbc34c00149f9f81b58b | [
"MIT"
] | null | null | null | test.py | benokan/Malware_Detection_ML | 5ddd60f12a65ae554b07dbc34c00149f9f81b58b | [
"MIT"
] | null | null | null | test.py | benokan/Malware_Detection_ML | 5ddd60f12a65ae554b07dbc34c00149f9f81b58b | [
"MIT"
] | null | null | null | from os.path import isfile, join
import numpy as np
import sys
from os import listdir
from os.path import isfile, join
| 13.555556 | 32 | 0.778689 | 22 | 122 | 4.318182 | 0.5 | 0.189474 | 0.210526 | 0.336842 | 0.547368 | 0.547368 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188525 | 122 | 8 | 33 | 15.25 | 0.959596 | 0 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
57064b848c6f165e8fb2c833511efef2fbaefb84 | 18,639 | py | Python | tests/test_pcposit.py | xman/sgposit | d538b54cb109a4a6f58a4a53188599a17faec701 | [
"MIT"
] | 14 | 2018-02-18T10:04:34.000Z | 2021-11-14T17:15:22.000Z | tests/test_pcposit.py | xman/sgposit | d538b54cb109a4a6f58a4a53188599a17faec701 | [
"MIT"
] | 6 | 2018-03-11T02:56:17.000Z | 2019-11-23T10:29:19.000Z | tests/test_pcposit.py | xman/sgposit | d538b54cb109a4a6f58a4a53188599a17faec701 | [
"MIT"
] | 5 | 2018-01-11T13:18:02.000Z | 2019-11-20T10:07:09.000Z | # MIT License
#
# Copyright (c) 2018 SpeedGo Computing
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import unittest
from sgposit import coder
from sgposit.pcposit import PCPosit
class TestPCPosit(unittest.TestCase):
def setUp(self):
self.posit_n6e2_m1o16_bits = 0x38
self.posit_n6e2_m1o2_bits = 0x32
self.posit_n6e2_m1o64_bits = 0x3A
self.posit_n6e2_m3o2_bits = 0x2F
self.posit_n6e2_m3o4_bits = 0x31
self.posit_n6e2_m3o8_bits = 0x33
self.posit_n6e2_m3o16_bits = 0x35
self.posit_n6e2_1_bits = 0x10
self.posit_n6e2_1o2_bits = 0x0E
self.posit_n6e2_1o4_bits = 0x0C
self.posit_n6e2_1o8_bits = 0x0A
self.posit_n6e2_2_bits = 0x12
self.posit_n6e2_3_bits = 0x13
self.posit_n6e2_3o2_bits = 0x11
self.posit_n6e2_3o4_bits = 0x0F
self.posit_n6e2_3o16_bits = 0x0B
self.posit_n6e2_3o8_bits = 0x0D
self.posit_n6e2_cinf_bits = 0x20
def tearDown(self):
pass
def run_posit_op(self, abits=None, op_str=None, bbits=None, ref_cbits=None, nbits=None, es=None):
a = PCPosit(abits, nbits=nbits, es=es, mode='bits')
b = PCPosit(bbits, nbits=nbits, es=es, mode='bits')
c = None
if op_str == '+':
c = a + b
elif op_str == '-':
c = a - b
elif op_str == '*':
c = a * b
elif op_str == '/':
c = a / b
elif op_str == 'u-':
c = -a
else:
raise NotImplementedError("op={}".format(op_str))
cbits = coder.encode_posit_binary(c.rep)
self.assertEqual(cbits, ref_cbits)
def test_add_simple(self):
self.run_posit_op(self.posit_n6e2_3o2_bits, '+', self.posit_n6e2_3o2_bits, self.posit_n6e2_3_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o4_bits, '+', self.posit_n6e2_3o4_bits, self.posit_n6e2_1_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o8_bits, '+', self.posit_n6e2_m3o16_bits, self.posit_n6e2_m1o16_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o8_bits, '+', self.posit_n6e2_3o4_bits, self.posit_n6e2_1_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o2_bits, '+', self.posit_n6e2_1_bits, self.posit_n6e2_2_bits, 6, 2)
def test_sub_simple(self):
self.run_posit_op(self.posit_n6e2_3o2_bits, '-', self.posit_n6e2_3o2_bits, 0, 6, 2)
self.run_posit_op(self.posit_n6e2_1o4_bits, '-', self.posit_n6e2_3o4_bits, self.posit_n6e2_m1o2_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o8_bits, '-', self.posit_n6e2_m3o16_bits, self.posit_n6e2_1o4_bits, 6, 2) # result: 5/16 ~> 1/4
self.run_posit_op(self.posit_n6e2_3o8_bits, '-', self.posit_n6e2_3o4_bits, self.posit_n6e2_m3o8_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o2_bits, '-', self.posit_n6e2_1_bits, self.posit_n6e2_1o2_bits, 6, 2)
def test_neg_simple(self):
self.run_posit_op(self.posit_n6e2_3o2_bits, 'u-', None, self.posit_n6e2_m3o2_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_m3o16_bits, 'u-', None, self.posit_n6e2_3o16_bits, 6, 2)
def test_mul_simple(self):
self.run_posit_op(self.posit_n6e2_3o2_bits, '*', self.posit_n6e2_3o2_bits, self.posit_n6e2_2_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o4_bits, '*', self.posit_n6e2_3o4_bits, self.posit_n6e2_3o16_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o8_bits, '*', self.posit_n6e2_m3o16_bits, self.posit_n6e2_m1o64_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o8_bits, '*', self.posit_n6e2_3o4_bits, self.posit_n6e2_1o4_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o2_bits, '*', self.posit_n6e2_1_bits, self.posit_n6e2_3o2_bits, 6, 2)
def test_truediv_simple(self):
self.run_posit_op(self.posit_n6e2_3o2_bits, '/', self.posit_n6e2_3o2_bits, self.posit_n6e2_1_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o4_bits, '/', self.posit_n6e2_3o4_bits, self.posit_n6e2_3o8_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_1o8_bits, '/', self.posit_n6e2_m3o16_bits, self.posit_n6e2_m3o4_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o8_bits, '/', self.posit_n6e2_3o4_bits, self.posit_n6e2_1o2_bits, 6, 2)
self.run_posit_op(self.posit_n6e2_3o2_bits, '/', self.posit_n6e2_1_bits, self.posit_n6e2_3o2_bits, 6, 2)
def test_create_pcposit_from_large_int_bits(self):
p0 = PCPosit(3**80, mode='bits', nbits=256, es=2)
p1 = PCPosit(5**90, mode='bits', nbits=256, es=2)
p2 = p0 + p1
p3 = p0 - p1
p4 = p0 * p1
p5 = p0 / p1
@unittest.skip("Not implemented.")
def test_floordiv(self):
raise NotImplementedError
def run_posit_cmp_op(self, abits=None, op_str=None, bbits=None, ref_output=None, nbits=None, es=None):
a = PCPosit(abits, nbits=nbits, es=es, mode='bits')
b = PCPosit(bbits, nbits=nbits, es=es, mode='bits')
out = None
if op_str == '==':
out = (a == b)
elif op_str == '!=':
out = (a != b)
elif op_str == '<':
out = (a < b)
elif op_str == '<=':
out = (a <= b)
elif op_str == '>':
out = (a > b)
elif op_str == '>=':
out = (a >= b)
else:
raise NotImplementedError("op={}".format(op_str))
self.assertEqual(out, ref_output)
def test_eq(self):
self.run_posit_cmp_op(0, '==', 0, True, 6, 2)
self.run_posit_cmp_op(0, '==', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(0, '==', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(0, '==', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '==', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '==', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '==', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '==', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '==', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '==', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '==', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '==', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '==', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '==', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '==', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '==', self.posit_n6e2_m3o16_bits, True, 6, 2)
def test_ne(self):
self.run_posit_cmp_op(0, '!=', 0, False, 6, 2)
self.run_posit_cmp_op(0, '!=', self.posit_n6e2_cinf_bits, True, 6, 2)
self.run_posit_cmp_op(0, '!=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(0, '!=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '!=', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '!=', self.posit_n6e2_cinf_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '!=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '!=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '!=', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '!=', self.posit_n6e2_cinf_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '!=', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '!=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '!=', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '!=', self.posit_n6e2_cinf_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '!=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '!=', self.posit_n6e2_m3o16_bits, False, 6, 2)
def test_lt(self):
self.run_posit_cmp_op(0, '<', 0, False, 6, 2)
self.run_posit_cmp_op(0, '<', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(0, '<', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(0, '<', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_m1o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_3_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_1o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<', self.posit_n6e2_m3o4_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_m1o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_3_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_1o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<', self.posit_n6e2_m3o4_bits, False, 6, 2)
def test_le(self):
self.run_posit_cmp_op(0, '<=', 0, True, 6, 2)
self.run_posit_cmp_op(0, '<=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(0, '<=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(0, '<=', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<=', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<=', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '<=', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_m1o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_3_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_1o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '<=', self.posit_n6e2_m3o4_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_m1o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_3_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_1o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '<=', self.posit_n6e2_m3o4_bits, False, 6, 2)
def test_gt(self):
self.run_posit_cmp_op(0, '>', 0, False, 6, 2)
self.run_posit_cmp_op(0, '>', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(0, '>', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(0, '>', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_m1o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_3_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_1o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>', self.posit_n6e2_m3o4_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_m1o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_3_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_1o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>', self.posit_n6e2_m3o4_bits, True, 6, 2)
def test_ge(self):
self.run_posit_cmp_op(0, '>=', 0, True, 6, 2)
self.run_posit_cmp_op(0, '>=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(0, '>=', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(0, '>=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>=', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>=', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_cinf_bits, '>=', self.posit_n6e2_m3o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', 0, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_3o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', 0, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_cinf_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_3o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_m3o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_m1o16_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_3_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_1o2_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_3o2_bits, '>=', self.posit_n6e2_m3o4_bits, True, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_m1o16_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_3_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_1o2_bits, False, 6, 2)
self.run_posit_cmp_op(self.posit_n6e2_m3o16_bits, '>=', self.posit_n6e2_m3o4_bits, True, 6, 2)
@unittest.skip("Not implemented.")
def test_str(self):
raise NotImplementedError
if __name__ == '__main__':
unittest.main()
| 55.972973 | 138 | 0.692312 | 3,160 | 18,639 | 3.65538 | 0.067089 | 0.225175 | 0.325253 | 0.107523 | 0.876721 | 0.840533 | 0.826855 | 0.817418 | 0.814648 | 0.814648 | 0 | 0.101363 | 0.177477 | 18,639 | 332 | 139 | 56.141566 | 0.652077 | 0.058426 | 0 | 0.05042 | 0 | 0 | 0.018372 | 0 | 0 | 0 | 0.004108 | 0 | 0.008403 | 1 | 0.07563 | false | 0.004202 | 0.012605 | 0 | 0.092437 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
570ca1c1fc41d2b04d157c2fede017bc8d0b01c9 | 1,833 | py | Python | tests/test_nlp_model.py | JayLinC2C/Google-Speech-to-Text-API-Word-Error-Rate-Analysis-Tool | e0079e542e56f36abc3ae05575ea05b8d7331f7a | [
"BSD-2-Clause"
] | 7 | 2020-01-15T07:11:41.000Z | 2021-07-14T15:04:58.000Z | tests/test_nlp_model.py | JayLinC2C/Google-Speech-to-Text-API-Word-Error-Rate-Analysis-Tool | e0079e542e56f36abc3ae05575ea05b8d7331f7a | [
"BSD-2-Clause"
] | 14 | 2019-12-17T16:56:40.000Z | 2021-08-06T16:22:11.000Z | tests/test_nlp_model.py | JayLinC2C/Google-Speech-to-Text-API-Word-Error-Rate-Analysis-Tool | e0079e542e56f36abc3ae05575ea05b8d7331f7a | [
"BSD-2-Clause"
] | 3 | 2020-06-04T08:57:45.000Z | 2021-08-03T01:10:26.000Z | import pytest
def test_set_remove_stop_words():
from model.nlp import NLPModel
nlp_model = NLPModel()
nlp_model.set_remove_stop_words(True)
def test_get_remove_stop_words():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = False
result = nlp_model.get_remove_stop_words()
assert result == expected
def test_set_get_remove_stop_words():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = True
nlp_model.set_remove_stop_words(expected)
result = nlp_model.get_remove_stop_words()
assert result == expected
def test_get_apply_stemming():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = False
result = nlp_model.get_apply_stemming()
assert result == expected
def test_set_get_apply_stemming():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = True
nlp_model.set_apply_stemming(expected)
result = nlp_model.get_apply_stemming()
assert expected == result
def test_get_expand_contractions():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = False
result = nlp_model.get_expand_contractions()
assert result == expected
def test_set_get_expand_contractions():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = True
nlp_model.set_expand_contractions(expected)
result = nlp_model.get_expand_contractions()
assert result == expected
def test_get_n2w():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = False
result = nlp_model.get_n2w()
assert result == expected
def test_set_get_n2w():
from model.nlp import NLPModel
nlp_model = NLPModel()
expected = True
nlp_model.set_n2w(expected)
result = nlp_model.get_n2w()
assert result == expected | 27.772727 | 48 | 0.728314 | 243 | 1,833 | 5.160494 | 0.09465 | 0.140351 | 0.127592 | 0.129187 | 0.929825 | 0.904306 | 0.871611 | 0.795853 | 0.745614 | 0.745614 | 0 | 0.003404 | 0.198582 | 1,833 | 66 | 49 | 27.772727 | 0.850238 | 0 | 0 | 0.719298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140351 | 1 | 0.157895 | false | 0 | 0.175439 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
57282dc60bfc07af60781668a48054ca800806ef | 6,545 | py | Python | loldib/getratings/models/NA/na_soraka/na_soraka_mid.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_soraka/na_soraka_mid.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_soraka/na_soraka_mid.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | from getratings.models.ratings import Ratings
class NA_Soraka_Mid_Aatrox(Ratings):
pass
class NA_Soraka_Mid_Ahri(Ratings):
pass
class NA_Soraka_Mid_Akali(Ratings):
pass
class NA_Soraka_Mid_Alistar(Ratings):
pass
class NA_Soraka_Mid_Amumu(Ratings):
pass
class NA_Soraka_Mid_Anivia(Ratings):
pass
class NA_Soraka_Mid_Annie(Ratings):
pass
class NA_Soraka_Mid_Ashe(Ratings):
pass
class NA_Soraka_Mid_AurelionSol(Ratings):
pass
class NA_Soraka_Mid_Azir(Ratings):
pass
class NA_Soraka_Mid_Bard(Ratings):
pass
class NA_Soraka_Mid_Blitzcrank(Ratings):
pass
class NA_Soraka_Mid_Brand(Ratings):
pass
class NA_Soraka_Mid_Braum(Ratings):
pass
class NA_Soraka_Mid_Caitlyn(Ratings):
pass
class NA_Soraka_Mid_Camille(Ratings):
pass
class NA_Soraka_Mid_Cassiopeia(Ratings):
pass
class NA_Soraka_Mid_Chogath(Ratings):
pass
class NA_Soraka_Mid_Corki(Ratings):
pass
class NA_Soraka_Mid_Darius(Ratings):
pass
class NA_Soraka_Mid_Diana(Ratings):
pass
class NA_Soraka_Mid_Draven(Ratings):
pass
class NA_Soraka_Mid_DrMundo(Ratings):
pass
class NA_Soraka_Mid_Ekko(Ratings):
pass
class NA_Soraka_Mid_Elise(Ratings):
pass
class NA_Soraka_Mid_Evelynn(Ratings):
pass
class NA_Soraka_Mid_Ezreal(Ratings):
pass
class NA_Soraka_Mid_Fiddlesticks(Ratings):
pass
class NA_Soraka_Mid_Fiora(Ratings):
pass
class NA_Soraka_Mid_Fizz(Ratings):
pass
class NA_Soraka_Mid_Galio(Ratings):
pass
class NA_Soraka_Mid_Gangplank(Ratings):
pass
class NA_Soraka_Mid_Garen(Ratings):
pass
class NA_Soraka_Mid_Gnar(Ratings):
pass
class NA_Soraka_Mid_Gragas(Ratings):
pass
class NA_Soraka_Mid_Graves(Ratings):
pass
class NA_Soraka_Mid_Hecarim(Ratings):
pass
class NA_Soraka_Mid_Heimerdinger(Ratings):
pass
class NA_Soraka_Mid_Illaoi(Ratings):
pass
class NA_Soraka_Mid_Irelia(Ratings):
pass
class NA_Soraka_Mid_Ivern(Ratings):
pass
class NA_Soraka_Mid_Janna(Ratings):
pass
class NA_Soraka_Mid_JarvanIV(Ratings):
pass
class NA_Soraka_Mid_Jax(Ratings):
pass
class NA_Soraka_Mid_Jayce(Ratings):
pass
class NA_Soraka_Mid_Jhin(Ratings):
pass
class NA_Soraka_Mid_Jinx(Ratings):
pass
class NA_Soraka_Mid_Kalista(Ratings):
pass
class NA_Soraka_Mid_Karma(Ratings):
pass
class NA_Soraka_Mid_Karthus(Ratings):
pass
class NA_Soraka_Mid_Kassadin(Ratings):
pass
class NA_Soraka_Mid_Katarina(Ratings):
pass
class NA_Soraka_Mid_Kayle(Ratings):
pass
class NA_Soraka_Mid_Kayn(Ratings):
pass
class NA_Soraka_Mid_Kennen(Ratings):
pass
class NA_Soraka_Mid_Khazix(Ratings):
pass
class NA_Soraka_Mid_Kindred(Ratings):
pass
class NA_Soraka_Mid_Kled(Ratings):
pass
class NA_Soraka_Mid_KogMaw(Ratings):
pass
class NA_Soraka_Mid_Leblanc(Ratings):
pass
class NA_Soraka_Mid_LeeSin(Ratings):
pass
class NA_Soraka_Mid_Leona(Ratings):
pass
class NA_Soraka_Mid_Lissandra(Ratings):
pass
class NA_Soraka_Mid_Lucian(Ratings):
pass
class NA_Soraka_Mid_Lulu(Ratings):
pass
class NA_Soraka_Mid_Lux(Ratings):
pass
class NA_Soraka_Mid_Malphite(Ratings):
pass
class NA_Soraka_Mid_Malzahar(Ratings):
pass
class NA_Soraka_Mid_Maokai(Ratings):
pass
class NA_Soraka_Mid_MasterYi(Ratings):
pass
class NA_Soraka_Mid_MissFortune(Ratings):
pass
class NA_Soraka_Mid_MonkeyKing(Ratings):
pass
class NA_Soraka_Mid_Mordekaiser(Ratings):
pass
class NA_Soraka_Mid_Morgana(Ratings):
pass
class NA_Soraka_Mid_Nami(Ratings):
pass
class NA_Soraka_Mid_Nasus(Ratings):
pass
class NA_Soraka_Mid_Nautilus(Ratings):
pass
class NA_Soraka_Mid_Nidalee(Ratings):
pass
class NA_Soraka_Mid_Nocturne(Ratings):
pass
class NA_Soraka_Mid_Nunu(Ratings):
pass
class NA_Soraka_Mid_Olaf(Ratings):
pass
class NA_Soraka_Mid_Orianna(Ratings):
pass
class NA_Soraka_Mid_Ornn(Ratings):
pass
class NA_Soraka_Mid_Pantheon(Ratings):
pass
class NA_Soraka_Mid_Poppy(Ratings):
pass
class NA_Soraka_Mid_Quinn(Ratings):
pass
class NA_Soraka_Mid_Rakan(Ratings):
pass
class NA_Soraka_Mid_Rammus(Ratings):
pass
class NA_Soraka_Mid_RekSai(Ratings):
pass
class NA_Soraka_Mid_Renekton(Ratings):
pass
class NA_Soraka_Mid_Rengar(Ratings):
pass
class NA_Soraka_Mid_Riven(Ratings):
pass
class NA_Soraka_Mid_Rumble(Ratings):
pass
class NA_Soraka_Mid_Ryze(Ratings):
pass
class NA_Soraka_Mid_Sejuani(Ratings):
pass
class NA_Soraka_Mid_Shaco(Ratings):
pass
class NA_Soraka_Mid_Shen(Ratings):
pass
class NA_Soraka_Mid_Shyvana(Ratings):
pass
class NA_Soraka_Mid_Singed(Ratings):
pass
class NA_Soraka_Mid_Sion(Ratings):
pass
class NA_Soraka_Mid_Sivir(Ratings):
pass
class NA_Soraka_Mid_Skarner(Ratings):
pass
class NA_Soraka_Mid_Sona(Ratings):
pass
class NA_Soraka_Mid_Soraka(Ratings):
pass
class NA_Soraka_Mid_Swain(Ratings):
pass
class NA_Soraka_Mid_Syndra(Ratings):
pass
class NA_Soraka_Mid_TahmKench(Ratings):
pass
class NA_Soraka_Mid_Taliyah(Ratings):
pass
class NA_Soraka_Mid_Talon(Ratings):
pass
class NA_Soraka_Mid_Taric(Ratings):
pass
class NA_Soraka_Mid_Teemo(Ratings):
pass
class NA_Soraka_Mid_Thresh(Ratings):
pass
class NA_Soraka_Mid_Tristana(Ratings):
pass
class NA_Soraka_Mid_Trundle(Ratings):
pass
class NA_Soraka_Mid_Tryndamere(Ratings):
pass
class NA_Soraka_Mid_TwistedFate(Ratings):
pass
class NA_Soraka_Mid_Twitch(Ratings):
pass
class NA_Soraka_Mid_Udyr(Ratings):
pass
class NA_Soraka_Mid_Urgot(Ratings):
pass
class NA_Soraka_Mid_Varus(Ratings):
pass
class NA_Soraka_Mid_Vayne(Ratings):
pass
class NA_Soraka_Mid_Veigar(Ratings):
pass
class NA_Soraka_Mid_Velkoz(Ratings):
pass
class NA_Soraka_Mid_Vi(Ratings):
pass
class NA_Soraka_Mid_Viktor(Ratings):
pass
class NA_Soraka_Mid_Vladimir(Ratings):
pass
class NA_Soraka_Mid_Volibear(Ratings):
pass
class NA_Soraka_Mid_Warwick(Ratings):
pass
class NA_Soraka_Mid_Xayah(Ratings):
pass
class NA_Soraka_Mid_Xerath(Ratings):
pass
class NA_Soraka_Mid_XinZhao(Ratings):
pass
class NA_Soraka_Mid_Yasuo(Ratings):
pass
class NA_Soraka_Mid_Yorick(Ratings):
pass
class NA_Soraka_Mid_Zac(Ratings):
pass
class NA_Soraka_Mid_Zed(Ratings):
pass
class NA_Soraka_Mid_Ziggs(Ratings):
pass
class NA_Soraka_Mid_Zilean(Ratings):
pass
class NA_Soraka_Mid_Zyra(Ratings):
pass
| 15.695444 | 46 | 0.766692 | 972 | 6,545 | 4.736626 | 0.151235 | 0.209818 | 0.389661 | 0.479583 | 0.803432 | 0.803432 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169748 | 6,545 | 416 | 47 | 15.733173 | 0.847258 | 0 | 0 | 0.498195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.498195 | 0.00361 | 0 | 0.501805 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 7 |
5744b203873878161033067caa0e8bb3189fbd01 | 191 | py | Python | hrdc/stream/optimizer/__init__.py | fossabot/hrdc | 740794c946e8d9f967318b1dfc18085448ca0f0c | [
"MIT"
] | 13 | 2018-04-07T06:10:00.000Z | 2022-02-18T04:24:32.000Z | hrdc/stream/optimizer/__init__.py | fossabot/hrdc | 740794c946e8d9f967318b1dfc18085448ca0f0c | [
"MIT"
] | 3 | 2019-07-29T03:06:07.000Z | 2021-10-10T12:20:19.000Z | hrdc/stream/optimizer/__init__.py | fossabot/hrdc | 740794c946e8d9f967318b1dfc18085448ca0f0c | [
"MIT"
] | 4 | 2019-07-29T03:03:24.000Z | 2021-10-10T12:15:25.000Z | from .base import Optimizer
from . import designator_uniq
from . import global_merge
from . import main_merge
from . import physical_merge
from . import range_merge
from . import usage_page
| 21.222222 | 29 | 0.811518 | 28 | 191 | 5.321429 | 0.464286 | 0.402685 | 0.402685 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151832 | 191 | 8 | 30 | 23.875 | 0.919753 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
938c7d9ad64303bf35888d9fed6992def403500b | 10,015 | py | Python | code/backend/twitter/api/views/graphics.py | detiuaveiro/social-network-mining | 283ca46b9bdbcc2dffb71e5d4e3718040121380c | [
"BSD-3-Clause"
] | 4 | 2020-07-16T16:01:11.000Z | 2020-07-21T15:17:34.000Z | code/backend/twitter/api/views/graphics.py | detiuaveiro/social-network-mining | 283ca46b9bdbcc2dffb71e5d4e3718040121380c | [
"BSD-3-Clause"
] | null | null | null | code/backend/twitter/api/views/graphics.py | detiuaveiro/social-network-mining | 283ca46b9bdbcc2dffb71e5d4e3718040121380c | [
"BSD-3-Clause"
] | 1 | 2020-07-16T15:54:53.000Z | 2020-07-16T15:54:53.000Z | from rest_framework.decorators import api_view
from rest_framework.status import HTTP_200_OK, HTTP_403_FORBIDDEN
from api import queries
from api.views.utils import create_response
@api_view(["GET"])
def entities_counter(_, ):
"""
Args:
_: Http Request (ignored in this function)
Returns: Entities counter (bots,users,tweets) info saved on database wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.entities_counter()
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def latest_tweets(_, counter, entries_per_page=None, page=None):
"""
Args:
_: Http Request (ignored in this function)
counter: Number of tweets to return
entries_per_page: Number of entries per page or None
page: Number of page the user wants to retrieve or None
Returns: Latest tweets wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.latest_tweets(int(counter), entries_per_page, page)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def latest_tweets_daily(_, entries_per_page=None, page=None):
"""
Args:
_: Http Request (ignored in this function)
entries_per_page: Number of entries per page or None
page: Number of page the user wants to retrieve or None
Returns: All bots's daily tweets wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.latest_tweets_daily(entries_per_page, page)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def latest_activities_daily(_, entries_per_page=None, page=None):
"""
Args:
_: Http Request (ignored in this function)
entries_per_page: Number of entries per page or None
page: Number of page the user wants to retrieve or None
Returns: All bots's daily activities wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.latest_activities_daily(entries_per_page, page)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def latest_activities(_, counter, entries_per_page=None, page=None):
"""
Args:
_: Http Request (ignored in this function)
counter: Number of tweets to return
entries_per_page: Number of entries per page or None
page: Number of page the user wants to retrieve or None
Returns: All bots's activities limited by counter wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.latest_activities(int(counter), entries_per_page, page)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def gen_stats_grouped_accum(_, group_type):
"""
Args:
_: Http Request (ignored in this function)
group_type: Keyword defining group label (day,month,year)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
index_per_type = {
'year': 0,
'month': 1,
'day': 2
}
types = ["year", "month", "day"]
success, data, message = queries.gen_stats_grouped(types[:index_per_type[group_type] + 1], accum=True)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def gen_stats_grouped_new(_, group_type):
"""
Args:
_: Http Request (ignored in this function)
group_type: Keyword defining group label (day,month,year)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
index_per_type = {
'year': 0,
'month': 1,
'day': 2
}
types = ["year", "month", "day"]
success, data, message = queries.gen_stats_grouped(types[:index_per_type[group_type] + 1], accum=False)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def user_tweets_stats_grouped_accum(_, group_type):
"""
Args:
_: Http Request (ignored in this function)
group_type: Keyword defining group label (day,month,year)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
index_per_type = {
'year': 0,
'month': 1,
'day': 2
}
types = ["year", "month", "day"]
success, data, message = queries.user_tweets_stats_grouped(types[:index_per_type[group_type] + 1], accum=True)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def user_tweets_stats_grouped_new(_, group_type):
"""
Args:
_: Http Request (ignored in this function)
group_type: Keyword defining group label (day,month,year)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
index_per_type = {
'year': 0,
'month': 1,
'day': 2
}
types = ["year", "month", "day"]
success, data, message = queries.user_tweets_stats_grouped(types[:index_per_type[group_type] + 1], accum=False)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def relations_stats_grouped_accum(_, group_type):
"""
Args:
_: Http Request (ignored in this function)
group_type: Keyword defining group label (day,month,year)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
index_per_type = {
'year': 0,
'month': 1,
'day': 2
}
types = ["year", "month", "day"]
success, data, message = queries.relations_stats_grouped(types[:index_per_type[group_type] + 1], accum=True)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def relations_stats_grouped_new(_, group_type):
"""
Args:
_: Http Request (ignored in this function)
group_type: Keyword defining group label (day,month,year)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
index_per_type = {
'year': 0,
'month': 1,
'day': 2
}
types = ["year", "month", "day"]
success, data, message = queries.relations_stats_grouped(types[:index_per_type[group_type] + 1], accum=False)
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def general_today(_):
"""
Args:
_: Http Request (ignored in this function)
Returns: Number of activities done today
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.general_today()
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def user_tweets_today(_):
"""
Args:
_: Http Request (ignored in this function)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.user_tweets_today()
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
@api_view(["GET"])
def relations_today(_):
"""
Args:
_: Http Request (ignored in this function)
Returns: Activities grouped by (day or month or year) wrapped on response's object
"""
error_messages = []
success_messages = []
status = HTTP_200_OK
success, data, message = queries.relations_today()
if success:
success_messages.append(message)
else:
error_messages.append(message)
status = HTTP_403_FORBIDDEN
return create_response(data=data, error_messages=error_messages, success_messages=success_messages, status=status)
| 25.2267 | 115 | 0.750075 | 1,371 | 10,015 | 5.221007 | 0.066375 | 0.101704 | 0.134954 | 0.109528 | 0.954457 | 0.953199 | 0.951802 | 0.951802 | 0.945795 | 0.939089 | 0 | 0.013327 | 0.145881 | 10,015 | 396 | 116 | 25.290404 | 0.823474 | 0.286171 | 0 | 0.817308 | 0 | 0 | 0.025963 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.067308 | false | 0 | 0.019231 | 0 | 0.153846 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
93ad20edb9a59f3493b913e86a9913ce6b2b9815 | 4,663 | py | Python | tests/test_client.py | WLM1ke/aiomoex | dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f | [
"Unlicense"
] | 55 | 2018-11-25T14:11:50.000Z | 2021-11-14T21:53:10.000Z | tests/test_client.py | WLM1ke/aiomoex | dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f | [
"Unlicense"
] | 5 | 2018-12-01T05:42:41.000Z | 2021-07-13T11:15:23.000Z | tests/test_client.py | WLM1ke/aiomoex | dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f | [
"Unlicense"
] | 21 | 2018-11-20T17:46:43.000Z | 2022-03-30T04:24:56.000Z | import typing
import pytest
from aiomoex import client
def test_iss_client_async_iterable(http_session):
iss = client.ISSClient(http_session, "test_url")
assert isinstance(iss, typing.AsyncIterable)
assert str(iss) == "ISSClient(url=test_url, query={})"
def test_make_query_empty(http_session):
iss = client.ISSClient(http_session, "test_url")
# noinspection PyProtectedMember
query = iss._make_query()
assert isinstance(query, typing.Mapping)
assert len(query) == 2
assert query["iss.json"] == "extended"
assert query["iss.meta"] == "off"
def test_make_query_not_empty(http_session):
iss = client.ISSClient(http_session, "test_url", dict(test_param="test_value"))
# noinspection PyProtectedMember
query = iss._make_query()
assert isinstance(query, typing.Mapping)
assert len(query) == 3
assert query["iss.json"] == "extended"
assert query["iss.meta"] == "off"
assert query["test_param"] == "test_value"
def test_make_query_not_empty_with_start(http_session):
iss = client.ISSClient(http_session, "test_url", dict(test_param="test_value"))
# noinspection PyProtectedMember
query = iss._make_query(100)
assert isinstance(query, typing.Mapping)
assert len(query) == 4
assert query["iss.json"] == "extended"
assert query["iss.meta"] == "off"
assert query["test_param"] == "test_value"
assert query["start"] == 100
@pytest.mark.asyncio
async def test_get(http_session):
url = "https://iss.moex.com/iss/securities.json"
query = dict(q="1-02-65104-D")
iss = client.ISSClient(http_session, url, query)
raw = await iss.get()
data = raw["securities"]
assert isinstance(data, list)
assert len(data) == 4
assert isinstance(data[0], dict)
assert data[1]["regnumber"] == "1-02-65104-D"
assert "Юнипро" in data[2]["emitent_title"]
@pytest.mark.asyncio
async def test_get_with_start(http_session):
url = "https://iss.moex.com/iss/securities.json"
query = dict(q="1-02-65104-D")
iss = client.ISSClient(http_session, url, query)
raw = await iss.get(1)
data = raw["securities"]
assert isinstance(data, list)
assert len(data) == 3
assert isinstance(data[0], dict)
assert data[1]["regnumber"] == "1-02-65104-D"
assert "Юнипро" in data[2]["emitent_title"]
@pytest.mark.asyncio
async def test_get_error(http_session):
url = "https://iss.moex.com/iss/securities1.json"
iss = client.ISSClient(http_session, url)
with pytest.raises(client.ISSMoexError) as error:
await iss.get()
assert "Неверный url" in str(error.value)
assert "url" in str(error.value)
@pytest.mark.asyncio
async def test_get_all_with_cursor(http_session):
url = "https://iss.moex.com/iss/history/engines/stock/markets/shares/securities/SNGSP.json"
query = {"from": "2018-01-01", "till": "2018-03-01"}
iss = client.ISSClient(http_session, url, query)
raw = await iss.get_all()
data = raw["history"]
assert isinstance(data, list)
assert len(data) > 100
assert data[0]["TRADEDATE"] == "2018-01-03"
assert data[-1]["TRADEDATE"] == "2018-03-01"
for row in data:
for column in ["TRADEDATE", "OPEN", "LOW", "HIGH", "CLOSE", "VOLUME"]:
assert column in row
@pytest.mark.asyncio
async def test_get_all_without_cursor(http_session):
url = (
"https://iss.moex.com/iss/history/engines/stock/markets/shares/boards/TQBR/securities/SNGSP.json"
)
query = {"from": "2018-01-03", "till": "2018-06-01"}
iss = client.ISSClient(http_session, url, query)
raw = await iss.get_all()
data = raw["history"]
assert isinstance(data, list)
assert len(data) > 100
assert data[0]["TRADEDATE"] == "2018-01-03"
assert data[-1]["TRADEDATE"] == "2018-06-01"
for row in data:
for column in ["TRADEDATE", "OPEN", "LOW", "HIGH", "CLOSE", "VOLUME"]:
assert column in row
def test_cursor_block_size():
assert client._cursor_block_size(5, [{"INDEX": 5, "PAGESIZE": 8, "TOTAL": 14}]) == 8
def test_cursor_block_size_zero():
assert client._cursor_block_size(5, [{"INDEX": 5, "PAGESIZE": 8, "TOTAL": 13}]) == 0
def test_cursor_block_size_raise_bad_start():
with pytest.raises(client.ISSMoexError) as error:
client._cursor_block_size(5, [{"INDEX": 6, "PAGESIZE": 8, "TOTAL": 14}])
assert "Некорректные данные history.cursor" in str(error.value)
def test_cursor_block_size_raise_bad_structure():
with pytest.raises(client.ISSMoexError) as error:
client._cursor_block_size(5, [{}, {}])
assert "Некорректные данные history.cursor" in str(error.value)
| 34.036496 | 105 | 0.67596 | 647 | 4,663 | 4.712519 | 0.16847 | 0.064939 | 0.045917 | 0.064939 | 0.884224 | 0.857986 | 0.831748 | 0.765825 | 0.716628 | 0.667104 | 0 | 0.037143 | 0.174351 | 4,663 | 136 | 106 | 34.286765 | 0.754805 | 0.01973 | 0 | 0.580952 | 0 | 0.019048 | 0.214364 | 0.005036 | 0 | 0 | 0 | 0 | 0.409524 | 1 | 0.07619 | false | 0 | 0.028571 | 0 | 0.104762 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
93bc661d5b8224340ad93045508ad308dd18521e | 8,735 | py | Python | plot/box/paths_puddle.py | architsakhadeo/Offline-Hyperparameter-Tuning-for-RL | 94b8f205b12f0cc59ae8e19b2e6099f34be929d6 | [
"MIT"
] | null | null | null | plot/box/paths_puddle.py | architsakhadeo/Offline-Hyperparameter-Tuning-for-RL | 94b8f205b12f0cc59ae8e19b2e6099f34be929d6 | [
"MIT"
] | null | null | null | plot/box/paths_puddle.py | architsakhadeo/Offline-Hyperparameter-Tuning-for-RL | 94b8f205b12f0cc59ae8e19b2e6099f34be929d6 | [
"MIT"
] | null | null | null | #pd_true = ["../../data/hyperparam_v4/puddle/online_learning/esarsa-adam/step10k/sweep/"]
#pd_rnd = [2, 0, 29, 10, 28, 30, 0, 29, 14, 24, 9, 8, 29, 11, 28, 9, 7, 5, 6, 8, 9, 7, 9, 3, 21, 2, 8, 21, 6, 20, 2, 16]
#pd_random = ["../../data/hyperparam_v4/puddle/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_random/drop0.3"]
#pd_return320 = ["../../data/hyperparam_v4/puddle/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_return-320/drop0.3"]
#pd_return40 = ["../../data/hyperparam_v4/puddle/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_return-40/drop0.3"]
#pdhard_true = ["../../data/hyperparam_v4/puddlehard/online_learning/esarsa-adam/step50k/sweep/"]
#pdhard_random = ["../../data/hyperparam_v4/puddlehard/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_random/drop0.3"]
#pdhard_return360 = ["../../data/hyperparam_v4/puddlehard/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_return-360/drop0.3"]
#pdhard_return45 = ["../../data/hyperparam_v4/puddlehard/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_return-45/drop0.3"]
'''
pd_true = ["../../../../../../Downloads/transferabledata/new/hyperparam_ap_CEM_gridsearch/data/hyperparam_ap/puddleworld/online_learning/esarsa/step30k/sweep/"]
pd_rnd = [34, 4, 43, 30, 24, 32, 40, 11, 20, 30, 3, 16, 53, 45, 0, 21, 43, 23, 44, 50, 9, 41, 37, 37, 11, 2, 26, 33, 18, 20]
pd_offline = ["../../../../../../Downloads/transferabledata/new/hyperparam_ap_CEM_gridsearch/data/hyperparam_ap/puddleworld/offline_learning/k3_timeout400/esarsa/step30k/optimalfixed_eps0/sweep/"]
pd_cemOffline = ["../../../../../../Downloads/transferabledata/new/hyperparam_ap_CEM_gridsearch/data/hyperparam_ap/puddleworld/list/CEMoffline_onlineEvaluation/esarsa/step30k/sweep/"]
pd_cemOnline = ["../../../../../../Downloads/transferabledata/new/hyperparam_ap_CEM_gridsearch/data/hyperparam_ap/puddleworld/list/CEMonline_onlineEvaluation/esarsa/step30k/sweep/"]
pdhard_random = ["../../data/hyperparam_v4/puddlehard/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_random/drop0.3"]
pdhard_return360 = ["../../data/hyperparam_v4/puddlehard/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_return-360/drop0.3"]
pdhard_return45 = ["../../data/hyperparam_v4/puddlehard/offline_learning/knn-ens/randomInit/closeTrans/k3/timeout1000/esarsa/step10k_env/data_return-45/drop0.3"]
'''
pdrand_rnd = [34, 4, 43, 30, 24, 32, 40, 11, 20, 30, 3, 16, 53, 45, 0, 21, 43, 23, 44, 50, 9, 41, 37, 37, 11, 2, 26, 33, 18, 20]
pdrand_true = ["../../data/hyperparam_v5/puddlerand/online_learning/esarsa/step30k/sweep"]
pdrand_true_dqn = ["../../data/hyperparam_v5/puddlerand/online_learning/dqn/step600k/sweep"]
pdrand_laplace_knn_test1_5k_dqn = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout20k/dqn/step5k_env/data_optimal/drop0/sweep_rep1/"]
pdrand_network_15k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_separated/timeout1000/esarsa/step15k_env/data_optimal/sweep"]
pdrand_laplace_network_15k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_laplace_separated/timeout1000/esarsa/step15k_env/data_optimal/sweep"]
pdrand_knn_15k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3/timeout1000/esarsa/step15k_env/data_optimal/drop0/sweep"]
pdrand_knn_10k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3/timeout1000/esarsa/step10k_env/data_optimal/drop0/sweep"]
pdrand_knn_5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3/timeout1000/esarsa/step5k_env/data_optimal/drop0/sweep"]
pdrand_knn_2p5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3/timeout1000/esarsa/step2.5k_env/data_optimal/drop0/sweep"]
pdrand_knn_1k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3/timeout1000/esarsa/step1k_env/data_optimal/drop0/sweep"]
pdrand_knn_500 = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3/timeout1000/esarsa/step500_env/data_optimal/drop0/sweep"]
pdrand_laplace_knn_test1_15k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout1000/esarsa/step15k_env/data_optimal/drop0/sweep_rep1"]
pdrand_laplace_knn_test1_10k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout1000/esarsa/step10k_env/data_optimal/drop0/sweep_rep1"]
pdrand_laplace_knn_test1_5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout1000/esarsa/step5k_env/data_optimal/drop0/sweep_rep1"]
pdrand_laplace_knn_test1_2p5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout1000/esarsa/step2.5k_env/data_optimal/drop0/sweep_rep1"]
pdrand_laplace_knn_test1_1k = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout1000/esarsa/step1k_env/data_optimal/drop0/sweep_rep1"]
pdrand_laplace_knn_test1_500 = ["../../data/hyperparam_v5/puddlerand/offline_learning/knn/learning/k3_laplace/timeout1000/esarsa/step500_env/data_optimal/drop0/sweep_rep1"]
pdrand_scale_network_15k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_separated/timeout1000/esarsa/step15k_env/data_optimal/sweep"]
pdrand_scale_network_10k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_separated/timeout1000/esarsa/step10k_env/data_optimal/sweep"]
pdrand_scale_network_5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_separated/timeout1000/esarsa/step5k_env/data_optimal/sweep"]
pdrand_scale_network_2p5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_separated/timeout1000/esarsa/step2.5k_env/data_optimal/sweep"]
pdrand_scale_network_1k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_separated/timeout1000/esarsa/step1k_env/data_optimal/sweep"]
pdrand_scale_network_500 = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_separated/timeout1000/esarsa/step500_env/data_optimal/sweep"]
pdrand_scale_laplace_network_15k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout1000/esarsa/step15k_env/data_optimal/sweep"]
pdrand_scale_laplace_network_10k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout1000/esarsa/step10k_env/data_optimal/sweep"]
pdrand_scale_laplace_network_5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout1000/esarsa/step5k_env/data_optimal/sweep"]
pdrand_scale_laplace_network_2p5k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout1000/esarsa/step2.5k_env/data_optimal/sweep"]
pdrand_scale_laplace_network_1k = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout1000/esarsa/step1k_env/data_optimal/sweep"]
pdrand_scale_laplace_network_500 = ["../../data/hyperparam_v5/puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout1000/esarsa/step500_env/data_optimal/sweep"]
pd_rnd = [34, 4, 43, 30, 24, 32, 40, 11, 20, 30, 3, 16, 53, 45, 0, 21, 43, 23, 44, 50, 9, 41, 37, 37, 11, 2, 26, 33, 18, 20]
basepath = "../../../../../../Downloads/transferabledata/new/data_dcp/final/data/hyperparam_v5/"
pd_true = [basepath + "puddlerand/online_learning/esarsa/step30k/sweep/"]
pd_optim_knn = [basepath + "puddlerand/offline_learning/knn/learning/k3_laplace/timeout500/esarsa/step15k_env/data_optimal/drop0/sweep_rep1/"]
pd_suboptim_knn = [basepath + "puddlerand/offline_learning/knn/learning/k3_laplace/timeout500/esarsa/step15k_env/data_suboptimal/drop0/sweep_rep1/"]
pd_subsuboptim_knn = [basepath + "puddlerand/offline_learning/knn/learning/k3_laplace/timeout500/esarsa/step15k_env/data_subsuboptimal/drop0/sweep_rep1/"]
pd_optim_network = [basepath + "puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout500/esarsa/step15k_env/data_optimal/sweep/"]
pd_suboptim_network = [basepath + "puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout500/esarsa/step15k_env/data_suboptimal/sweep/"]
pd_subsuboptim_network = [basepath + "puddlerand/offline_learning/network/learning/clip_scale_laplace_separated/timeout500/esarsa/step15k_env/data_subsuboptimal/sweep/"] | 118.040541 | 196 | 0.810418 | 1,200 | 8,735 | 5.5825 | 0.095833 | 0.094044 | 0.123153 | 0.112554 | 0.904613 | 0.897 | 0.862218 | 0.854008 | 0.799672 | 0.785341 | 0 | 0.079601 | 0.036405 | 8,735 | 74 | 197 | 118.040541 | 0.716288 | 0.294562 | 0 | 0 | 0 | 0.769231 | 0.763787 | 0.763787 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 |
93e398978632020d5083a8125af08209d4de6872 | 254 | py | Python | PyObjCTest/test_nsportcoder.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | PyObjCTest/test_nsportcoder.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | PyObjCTest/test_nsportcoder.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | import Foundation
from PyObjCTools.TestSupport import TestCase
class TestNSPortCoder(TestCase):
def testMethods(self):
self.assertResultIsBOOL(Foundation.NSPortCoder.isBycopy)
self.assertResultIsBOOL(Foundation.NSPortCoder.isByref)
| 28.222222 | 64 | 0.799213 | 23 | 254 | 8.826087 | 0.652174 | 0.216749 | 0.315271 | 0.423645 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133858 | 254 | 8 | 65 | 31.75 | 0.922727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
f5411f3b00ad71cfe6d82973fb9c1d7ad761728b | 128 | py | Python | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_0/_mod1_0_1_1_0_0.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_0/_mod1_0_1_1_0_0.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_0/_mod1_0_1_1_0_0.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | name1_0_1_1_0_0_0 = None
name1_0_1_1_0_0_1 = None
name1_0_1_1_0_0_2 = None
name1_0_1_1_0_0_3 = None
name1_0_1_1_0_0_4 = None | 14.222222 | 24 | 0.820313 | 40 | 128 | 1.875 | 0.175 | 0.16 | 0.466667 | 0.533333 | 0.88 | 0.88 | 0.746667 | 0 | 0 | 0 | 0 | 0.318182 | 0.140625 | 128 | 9 | 25 | 14.222222 | 0.363636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
f5a402fef7cecb30ab9d84bd9bf3411aa93939e6 | 67 | py | Python | TwitterScraperAPI/__init__.py | vaskrneup/TwitterScraperAPI | c4bfc860ec012a8233d5d325c25ba58642a843e2 | [
"MIT"
] | 1 | 2020-09-19T14:39:50.000Z | 2020-09-19T14:39:50.000Z | TwitterScraperAPI/__init__.py | vaskrneup/TwitterScraperAPI | c4bfc860ec012a8233d5d325c25ba58642a843e2 | [
"MIT"
] | null | null | null | TwitterScraperAPI/__init__.py | vaskrneup/TwitterScraperAPI | c4bfc860ec012a8233d5d325c25ba58642a843e2 | [
"MIT"
] | null | null | null | from .packages import default_data
from .packages import extractor
| 22.333333 | 34 | 0.850746 | 9 | 67 | 6.222222 | 0.666667 | 0.428571 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119403 | 67 | 2 | 35 | 33.5 | 0.949153 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
1934bc4ce61ce05ba8223bb93a957f769a1691fa | 93,078 | py | Python | gaugette/fonts/tahoma_24.py | wsiffer/Google-Bartender | 37018d3efe33a84074a6dccbce9e82f20ef3c923 | [
"MIT"
] | 6 | 2020-07-30T00:21:29.000Z | 2022-03-16T23:31:09.000Z | gaugette/fonts/tahoma_24.py | antndeb/Google-Bartender | 37018d3efe33a84074a6dccbce9e82f20ef3c923 | [
"MIT"
] | null | null | null | gaugette/fonts/tahoma_24.py | antndeb/Google-Bartender | 37018d3efe33a84074a6dccbce9e82f20ef3c923 | [
"MIT"
] | 1 | 2022-03-16T23:39:29.000Z | 2022-03-16T23:39:29.000Z | # coding=utf-8
# Module tahoma_24
# generated from Tahoma 18pt
name = "Tahoma 24"
start_char = '!'
end_char = chr(127)
char_height = 24
space_width = 12
gap_width = 3
bitmaps = (
# @0 '!' (2 pixels wide)
0x00, #
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @24 '"' (6 pixels wide)
0xCC, # OO OO
0xCC, # OO OO
0xCC, # OO OO
0xCC, # OO OO
0xCC, # OO OO
0xCC, # OO OO
0xCC, # OO OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @48 '#' (15 pixels wide)
0x00, 0x00, #
0x03, 0x18, # OO OO
0x03, 0x18, # OO OO
0x07, 0x30, # OOO OO
0x06, 0x30, # OO OO
0x06, 0x30, # OO OO
0x3F, 0xFE, # OOOOOOOOOOOOO
0x3F, 0xFE, # OOOOOOOOOOOOO
0x0C, 0x60, # OO OO
0x0C, 0x60, # OO OO
0x0C, 0x60, # OO OO
0x0C, 0x60, # OO OO
0xFF, 0xF8, # OOOOOOOOOOOOO
0xFF, 0xF8, # OOOOOOOOOOOOO
0x18, 0xC0, # OO OO
0x18, 0xC0, # OO OO
0x19, 0xC0, # OO OOO
0x31, 0x80, # OO OO
0x31, 0x80, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @96 '$' (11 pixels wide)
0x00, 0x00, #
0x04, 0x00, # O
0x04, 0x00, # O
0x04, 0x00, # O
0x1F, 0x80, # OOOOOO
0x7F, 0xC0, # OOOOOOOOO
0xE4, 0x40, # OOO O O
0xC4, 0x00, # OO O
0xC4, 0x00, # OO O
0xE4, 0x00, # OOO O
0x7C, 0x00, # OOOOO
0x3F, 0x80, # OOOOOOO
0x07, 0xC0, # OOOOO
0x04, 0x60, # O OO
0x04, 0x60, # O OO
0x04, 0x60, # O OO
0xC4, 0xC0, # OO O OO
0xFF, 0xC0, # OOOOOOOOOO
0x7F, 0x00, # OOOOOOO
0x04, 0x00, # O
0x04, 0x00, # O
0x04, 0x00, # O
0x04, 0x00, # O
0x00, 0x00, #
# @144 '%' (21 pixels wide)
0x00, 0x00, 0x00, #
0x3C, 0x03, 0x00, # OOOO OO
0x7E, 0x06, 0x00, # OOOOOO OO
0xE7, 0x06, 0x00, # OOO OOO OO
0xC3, 0x0C, 0x00, # OO OO OO
0xC3, 0x0C, 0x00, # OO OO OO
0xC3, 0x18, 0x00, # OO OO OO
0xC3, 0x18, 0x00, # OO OO OO
0xE7, 0x30, 0x00, # OOO OOO OO
0x7E, 0x31, 0xE0, # OOOOOO OO OOOO
0x3C, 0x63, 0xF0, # OOOO OO OOOOOO
0x00, 0x67, 0x38, # OO OOO OOO
0x00, 0xC6, 0x18, # OO OO OO
0x00, 0xC6, 0x18, # OO OO OO
0x01, 0x86, 0x18, # OO OO OO
0x01, 0x86, 0x18, # OO OO OO
0x03, 0x07, 0x38, # OO OOO OOO
0x03, 0x03, 0xF0, # OO OOOOOO
0x06, 0x01, 0xE0, # OO OOOO
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
# @216 '&' (16 pixels wide)
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x3F, 0x80, # OOOOOOO
0x71, 0xC0, # OOO OOO
0x60, 0xC0, # OO OO
0x60, 0xC0, # OO OO
0x60, 0xC0, # OO OO
0x31, 0x80, # OO OO
0x1F, 0x18, # OOOOO OO
0x1E, 0x18, # OOOO OO
0x77, 0x18, # OOO OOO OO
0x63, 0x98, # OO OOO OO
0xC1, 0xD8, # OO OOO OO
0xC0, 0xF0, # OO OOOO
0xC0, 0x70, # OO OOO
0xC0, 0x38, # OO OOO
0x70, 0xFC, # OOO OOOOOO
0x7F, 0xCE, # OOOOOOOOO OOO
0x1F, 0x07, # OOOOO OOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @264 ''' (2 pixels wide)
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @288 '(' (7 pixels wide)
0x0E, # OOO
0x1C, # OOO
0x18, # OO
0x30, # OO
0x30, # OO
0x60, # OO
0x60, # OO
0xE0, # OOO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xE0, # OOO
0x60, # OO
0x60, # OO
0x30, # OO
0x30, # OO
0x18, # OO
0x1C, # OOO
0x0E, # OOO
# @312 ')' (7 pixels wide)
0xE0, # OOO
0x70, # OOO
0x30, # OO
0x18, # OO
0x18, # OO
0x0C, # OO
0x0C, # OO
0x0E, # OOO
0x06, # OO
0x06, # OO
0x06, # OO
0x06, # OO
0x06, # OO
0x06, # OO
0x06, # OO
0x06, # OO
0x0E, # OOO
0x0C, # OO
0x0C, # OO
0x18, # OO
0x18, # OO
0x30, # OO
0x70, # OOO
0xE0, # OOO
# @336 '*' (10 pixels wide)
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x8C, 0x40, # O OO O
0xED, 0xC0, # OOO OO OOO
0x3F, 0x00, # OOOOOO
0x0C, 0x00, # OO
0x3F, 0x00, # OOOOOO
0xED, 0xC0, # OOO OO OOO
0x8C, 0x40, # O OO O
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @384 '+' (14 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0xFF, 0xFC, # OOOOOOOOOOOOOO
0xFF, 0xFC, # OOOOOOOOOOOOOO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @432 ',' (5 pixels wide)
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x38, # OOO
0x30, # OO
0x70, # OOO
0x70, # OOO
0x60, # OO
0x60, # OO
0xC0, # OO
0xC0, # OO
# @456 '-' (7 pixels wide)
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0xFE, # OOOOOOO
0xFE, # OOOOOOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @480 '.' (3 pixels wide)
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0xE0, # OOO
0xE0, # OOO
0xE0, # OOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @504 '/' (9 pixels wide)
0x01, 0x80, # OO
0x01, 0x80, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x1C, 0x00, # OOO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x30, 0x00, # OO
0x30, 0x00, # OO
0x30, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0x00, 0x00, #
# @552 '0' (11 pixels wide)
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x3F, 0x80, # OOOOOOO
0x71, 0xC0, # OOO OOO
0x60, 0xC0, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0x60, 0xC0, # OO OO
0x71, 0xC0, # OOO OOO
0x3F, 0x80, # OOOOOOO
0x1F, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @600 '1' (8 pixels wide)
0x00, #
0x18, # OO
0x18, # OO
0xF8, # OOOOO
0xF8, # OOOOO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0x18, # OO
0xFF, # OOOOOOOO
0xFF, # OOOOOOOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @624 '2' (11 pixels wide)
0x00, 0x00, #
0x3E, 0x00, # OOOOO
0xFF, 0x80, # OOOOOOOOO
0xE1, 0x80, # OOO OO
0x80, 0xC0, # O OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x01, 0xC0, # OOO
0x01, 0x80, # OO
0x03, 0x00, # OO
0x07, 0x00, # OOO
0x0E, 0x00, # OOO
0x1C, 0x00, # OOO
0x38, 0x00, # OOO
0x70, 0x00, # OOO
0xE0, 0x00, # OOO
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @672 '3' (11 pixels wide)
0x00, 0x00, #
0x3F, 0x00, # OOOOOO
0xFF, 0xC0, # OOOOOOOOOO
0xE0, 0xE0, # OOO OOO
0x80, 0x60, # O OO
0x00, 0x60, # OO
0x00, 0x60, # OO
0x01, 0xC0, # OOO
0x0F, 0x80, # OOOOO
0x0F, 0x00, # OOOO
0x00, 0xC0, # OO
0x00, 0x60, # OO
0x00, 0x60, # OO
0x00, 0x60, # OO
0x00, 0x60, # OO
0x80, 0xE0, # O OOO
0xE1, 0xC0, # OOO OOO
0xFF, 0x80, # OOOOOOOOO
0x3F, 0x00, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @720 '4' (12 pixels wide)
0x00, 0x00, #
0x00, 0xC0, # OO
0x01, 0xC0, # OOO
0x03, 0xC0, # OOOO
0x06, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x18, 0xC0, # OO OO
0x38, 0xC0, # OOO OO
0x30, 0xC0, # OO OO
0x60, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xFF, 0xF0, # OOOOOOOOOOOO
0xFF, 0xF0, # OOOOOOOOOOOO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @768 '5' (10 pixels wide)
0x00, 0x00, #
0x7F, 0xC0, # OOOOOOOOO
0x7F, 0xC0, # OOOOOOOOO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x7E, 0x00, # OOOOOO
0x7F, 0x80, # OOOOOOOO
0x01, 0x80, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x01, 0xC0, # OOO
0xC3, 0x80, # OO OOO
0xFF, 0x00, # OOOOOOOO
0x7E, 0x00, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @816 '6' (11 pixels wide)
0x00, 0x00, #
0x07, 0xC0, # OOOOO
0x1F, 0xC0, # OOOOOOO
0x38, 0x00, # OOO
0x70, 0x00, # OOO
0x60, 0x00, # OO
0x60, 0x00, # OO
0xC0, 0x00, # OO
0xDF, 0x00, # OO OOOOO
0xFF, 0xC0, # OOOOOOOOOO
0xE0, 0xC0, # OOO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0x60, 0x60, # OO OO
0x70, 0xC0, # OOO OO
0x3F, 0x80, # OOOOOOO
0x1F, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @864 '7' (11 pixels wide)
0x00, 0x00, #
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0x00, 0x60, # OO
0x00, 0xE0, # OOO
0x00, 0xC0, # OO
0x01, 0x80, # OO
0x01, 0x80, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x30, 0x00, # OO
0x30, 0x00, # OO
0x60, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @912 '8' (11 pixels wide)
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x7F, 0xC0, # OOOOOOOOO
0x60, 0xE0, # OO OOO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xE0, 0xC0, # OOO OO
0x79, 0x80, # OOOO OO
0x1F, 0x00, # OOOOO
0x67, 0x80, # OO OOOO
0x60, 0xC0, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xE0, 0x60, # OOO OO
0x70, 0xC0, # OOO OO
0x7F, 0x80, # OOOOOOOO
0x1F, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @960 '9' (11 pixels wide)
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x3F, 0x80, # OOOOOOO
0x61, 0xC0, # OO OOO
0xC0, 0xC0, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0x60, 0xE0, # OO OOO
0x7F, 0xE0, # OOOOOOOOOO
0x1F, 0x60, # OOOOO OO
0x00, 0x60, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x01, 0xC0, # OOO
0x03, 0x80, # OOO
0x3F, 0x00, # OOOOOO
0x3E, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1008 ':' (3 pixels wide)
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0xE0, # OOO
0xE0, # OOO
0xE0, # OOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0xE0, # OOO
0xE0, # OOO
0xE0, # OOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @1032 ';' (5 pixels wide)
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x70, # OOO
0x70, # OOO
0x70, # OOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x38, # OOO
0x30, # OO
0x70, # OOO
0x70, # OOO
0x60, # OO
0x60, # OO
0xC0, # OO
0xC0, # OO
# @1056 '<' (13 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x08, # O
0x00, 0x38, # OOO
0x01, 0xF0, # OOOOO
0x07, 0xC0, # OOOOO
0x1E, 0x00, # OOOO
0x78, 0x00, # OOOO
0xE0, 0x00, # OOO
0x78, 0x00, # OOOO
0x1E, 0x00, # OOOO
0x07, 0xC0, # OOOOO
0x01, 0xF0, # OOOOO
0x00, 0x38, # OOO
0x00, 0x08, # O
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1104 '=' (13 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xFF, 0xF8, # OOOOOOOOOOOOO
0xFF, 0xF8, # OOOOOOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xFF, 0xF8, # OOOOOOOOOOOOO
0xFF, 0xF8, # OOOOOOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1152 '>' (13 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x80, 0x00, # O
0xE0, 0x00, # OOO
0x7C, 0x00, # OOOOO
0x1F, 0x00, # OOOOO
0x03, 0xC0, # OOOO
0x00, 0xF0, # OOOO
0x00, 0x38, # OOO
0x00, 0xF0, # OOOO
0x03, 0xC0, # OOOO
0x1F, 0x00, # OOOOO
0x7C, 0x00, # OOOOO
0xE0, 0x00, # OOO
0x80, 0x00, # O
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1200 '?' (9 pixels wide)
0x00, 0x00, #
0x7E, 0x00, # OOOOOO
0xFF, 0x00, # OOOOOOOO
0x83, 0x80, # O OOO
0x01, 0x80, # OO
0x01, 0x80, # OO
0x01, 0x80, # OO
0x01, 0x80, # OO
0x03, 0x00, # OO
0x07, 0x00, # OOO
0x0E, 0x00, # OOO
0x1C, 0x00, # OOO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x18, 0x00, # OO
0x18, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1248 '@' (19 pixels wide)
0x00, 0x00, 0x00, #
0x01, 0xF8, 0x00, # OOOOOO
0x07, 0xFE, 0x00, # OOOOOOOOOO
0x1E, 0x07, 0x00, # OOOO OOO
0x38, 0x03, 0x80, # OOO OOO
0x30, 0x01, 0xC0, # OO OOO
0x60, 0xFC, 0xC0, # OO OOOOOO OO
0x63, 0xFC, 0xE0, # OO OOOOOOOO OOO
0xC3, 0x0C, 0x60, # OO OO OO OO
0xC6, 0x0C, 0x60, # OO OO OO OO
0xC6, 0x0C, 0x60, # OO OO OO OO
0xC6, 0x0C, 0x60, # OO OO OO OO
0xC6, 0x0C, 0x60, # OO OO OO OO
0xC6, 0x0C, 0x60, # OO OO OO OO
0xC7, 0x1C, 0xC0, # OO OOO OOO OO
0x63, 0xFF, 0xC0, # OO OOOOOOOOOOOO
0x61, 0xEF, 0xC0, # OO OOOO OOOOOO
0x30, 0x00, 0x00, # OO
0x38, 0x00, 0x00, # OOO
0x1E, 0x04, 0x00, # OOOO O
0x07, 0xFC, 0x00, # OOOOOOOOO
0x01, 0xFC, 0x00, # OOOOOOO
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
# @1320 'A' (14 pixels wide)
0x00, 0x00, #
0x07, 0x80, # OOOO
0x07, 0x80, # OOOO
0x07, 0x80, # OOOO
0x04, 0x80, # O O
0x0C, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x18, 0x60, # OO OO
0x18, 0x60, # OO OO
0x18, 0x60, # OO OO
0x30, 0x30, # OO OO
0x3F, 0xF0, # OOOOOOOOOO
0x3F, 0xF0, # OOOOOOOOOO
0x60, 0x18, # OO OO
0x60, 0x18, # OO OO
0x60, 0x18, # OO OO
0xE0, 0x1C, # OOO OOO
0xC0, 0x0C, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1368 'B' (11 pixels wide)
0x00, 0x00, #
0xFF, 0x00, # OOOOOOOO
0xFF, 0x80, # OOOOOOOOO
0xC1, 0xC0, # OO OOO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC1, 0x80, # OO OO
0xFF, 0x00, # OOOOOOOO
0xFF, 0x80, # OOOOOOOOO
0xC0, 0xC0, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0xE0, # OO OOO
0xC1, 0xC0, # OO OOO
0xFF, 0x80, # OOOOOOOOO
0xFF, 0x00, # OOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1416 'C' (12 pixels wide)
0x00, 0x00, #
0x0F, 0xC0, # OOOOOO
0x1F, 0xF0, # OOOOOOOOO
0x38, 0x30, # OOO OO
0x70, 0x10, # OOO O
0x60, 0x00, # OO
0xE0, 0x00, # OOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xE0, 0x00, # OOO
0x60, 0x00, # OO
0x70, 0x10, # OOO O
0x38, 0x30, # OOO OO
0x1F, 0xF0, # OOOOOOOOO
0x0F, 0xC0, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1464 'D' (13 pixels wide)
0x00, 0x00, #
0xFF, 0x00, # OOOOOOOO
0xFF, 0xC0, # OOOOOOOOOO
0xC1, 0xE0, # OO OOOO
0xC0, 0x70, # OO OOO
0xC0, 0x30, # OO OO
0xC0, 0x38, # OO OOO
0xC0, 0x18, # OO OO
0xC0, 0x18, # OO OO
0xC0, 0x18, # OO OO
0xC0, 0x18, # OO OO
0xC0, 0x18, # OO OO
0xC0, 0x18, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x70, # OO OOO
0xC1, 0xE0, # OO OOOO
0xFF, 0xC0, # OOOOOOOOOO
0xFF, 0x00, # OOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1512 'E' (10 pixels wide)
0x00, 0x00, #
0xFF, 0xC0, # OOOOOOOOOO
0xFF, 0xC0, # OOOOOOOOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xFF, 0x80, # OOOOOOOOO
0xFF, 0x80, # OOOOOOOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xFF, 0xC0, # OOOOOOOOOO
0xFF, 0xC0, # OOOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1560 'F' (11 pixels wide)
0x00, 0x00, #
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1608 'G' (14 pixels wide)
0x00, 0x00, #
0x07, 0xF0, # OOOOOOO
0x1F, 0xFC, # OOOOOOOOOOO
0x38, 0x1C, # OOO OOO
0x70, 0x04, # OOO O
0x60, 0x00, # OO
0xE0, 0x00, # OOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0xFC, # OO OOOOOO
0xC0, 0xFC, # OO OOOOOO
0xC0, 0x0C, # OO OO
0xE0, 0x0C, # OOO OO
0x60, 0x0C, # OO OO
0x70, 0x0C, # OOO OO
0x3C, 0x0C, # OOOO OO
0x1F, 0xFC, # OOOOOOOOOOO
0x07, 0xE0, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1656 'H' (12 pixels wide)
0x00, 0x00, #
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xFF, 0xF0, # OOOOOOOOOOOO
0xFF, 0xF0, # OOOOOOOOOOOO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1704 'I' (6 pixels wide)
0x00, #
0xFC, # OOOOOO
0xFC, # OOOOOO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0x30, # OO
0xFC, # OOOOOO
0xFC, # OOOOOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @1728 'J' (8 pixels wide)
0x00, #
0x3F, # OOOOOO
0x3F, # OOOOOO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x03, # OO
0x87, # O OOO
0xFE, # OOOOOOO
0xFC, # OOOOOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @1752 'K' (12 pixels wide)
0x00, 0x00, #
0xC0, 0x70, # OO OOO
0xC0, 0xE0, # OO OOO
0xC1, 0xC0, # OO OOO
0xC3, 0x80, # OO OOO
0xC7, 0x00, # OO OOO
0xC6, 0x00, # OO OO
0xCC, 0x00, # OO OO
0xD8, 0x00, # OO OO
0xF8, 0x00, # OOOOO
0xFC, 0x00, # OOOOOO
0xCE, 0x00, # OO OOO
0xC6, 0x00, # OO OO
0xC3, 0x00, # OO OO
0xC3, 0x80, # OO OOO
0xC1, 0x80, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xE0, # OO OOO
0xC0, 0x70, # OO OOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1800 'L' (10 pixels wide)
0x00, 0x00, #
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xFF, 0xC0, # OOOOOOOOOO
0xFF, 0xC0, # OOOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1848 'M' (15 pixels wide)
0x00, 0x00, #
0xE0, 0x0E, # OOO OOO
0xF0, 0x1E, # OOOO OOOO
0xF0, 0x1E, # OOOO OOOO
0xF8, 0x3E, # OOOOO OOOOO
0xD8, 0x36, # OO OO OO OO
0xDC, 0x36, # OO OOO OO OO
0xCC, 0x66, # OO OO OO OO
0xCC, 0x66, # OO OO OO OO
0xC6, 0xC6, # OO OO OO OO
0xC6, 0xC6, # OO OO OO OO
0xC3, 0x86, # OO OOO OO
0xC3, 0x86, # OO OOO OO
0xC1, 0x06, # OO O OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1896 'N' (12 pixels wide)
0x00, 0x00, #
0xE0, 0x30, # OOO OO
0xF0, 0x30, # OOOO OO
0xF0, 0x30, # OOOO OO
0xF8, 0x30, # OOOOO OO
0xD8, 0x30, # OO OO OO
0xDC, 0x30, # OO OOO OO
0xCC, 0x30, # OO OO OO
0xCE, 0x30, # OO OOO OO
0xC6, 0x30, # OO OO OO
0xC7, 0x30, # OO OOO OO
0xC3, 0x30, # OO OO OO
0xC3, 0xB0, # OO OOO OO
0xC1, 0xB0, # OO OO OO
0xC1, 0xF0, # OO OOOOO
0xC0, 0xF0, # OO OOOO
0xC0, 0xF0, # OO OOOO
0xC0, 0x70, # OO OOO
0xC0, 0x70, # OO OOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1944 'O' (15 pixels wide)
0x00, 0x00, #
0x07, 0xC0, # OOOOO
0x1F, 0xF0, # OOOOOOOOO
0x38, 0x38, # OOO OOO
0x70, 0x1C, # OOO OOO
0x60, 0x0C, # OO OO
0xE0, 0x0E, # OOO OOO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xE0, 0x0E, # OOO OOO
0x60, 0x0C, # OO OO
0x70, 0x1C, # OOO OOO
0x38, 0x38, # OOO OOO
0x1F, 0xF0, # OOOOOOOOO
0x07, 0xC0, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @1992 'P' (11 pixels wide)
0x00, 0x00, #
0xFF, 0x00, # OOOOOOOO
0xFF, 0x80, # OOOOOOOOO
0xC1, 0xC0, # OO OOO
0xC0, 0xE0, # OO OOO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0xE0, # OO OOO
0xC1, 0xC0, # OO OOO
0xFF, 0x80, # OOOOOOOOO
0xFE, 0x00, # OOOOOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2040 'Q' (15 pixels wide)
0x00, 0x00, #
0x07, 0xC0, # OOOOO
0x1F, 0xF0, # OOOOOOOOO
0x38, 0x38, # OOO OOO
0x70, 0x1C, # OOO OOO
0x60, 0x0C, # OO OO
0xE0, 0x0E, # OOO OOO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xC0, 0x06, # OO OO
0xE0, 0x0E, # OOO OOO
0x60, 0x0C, # OO OO
0x70, 0x1C, # OOO OOO
0x38, 0x38, # OOO OOO
0x1F, 0xF0, # OOOOOOOOO
0x07, 0xC0, # OOOOO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0x60, # OO
0x00, 0x7E, # OOOOOO
0x00, 0x3E, # OOOOO
# @2088 'R' (13 pixels wide)
0x00, 0x00, #
0xFF, 0x00, # OOOOOOOO
0xFF, 0xC0, # OOOOOOOOOO
0xC0, 0xC0, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0xC0, # OO OO
0xC1, 0xC0, # OO OOO
0xFF, 0x80, # OOOOOOOOO
0xFE, 0x00, # OOOOOOO
0xC3, 0x00, # OO OO
0xC3, 0x80, # OO OOO
0xC1, 0x80, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x70, # OO OOO
0xC0, 0x38, # OO OOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2136 'S' (11 pixels wide)
0x00, 0x00, #
0x1F, 0x80, # OOOOOO
0x7F, 0xC0, # OOOOOOOOO
0x60, 0xC0, # OO OO
0xC0, 0x40, # OO O
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xE0, 0x00, # OOO
0x78, 0x00, # OOOO
0x7F, 0x00, # OOOOOOO
0x1F, 0xC0, # OOOOOOO
0x01, 0xE0, # OOOO
0x00, 0x60, # OO
0x00, 0x60, # OO
0x00, 0x60, # OO
0x80, 0x60, # O OO
0xE0, 0xC0, # OOO OO
0xFF, 0x80, # OOOOOOOOO
0x3F, 0x00, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2184 'T' (14 pixels wide)
0x00, 0x00, #
0xFF, 0xFC, # OOOOOOOOOOOOOO
0xFF, 0xFC, # OOOOOOOOOOOOOO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2232 'U' (12 pixels wide)
0x00, 0x00, #
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xC0, 0x30, # OO OO
0xE0, 0x70, # OOO OOO
0x70, 0xE0, # OOO OOO
0x3F, 0xC0, # OOOOOOOO
0x1F, 0x80, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2280 'V' (14 pixels wide)
0x00, 0x00, #
0xC0, 0x0C, # OO OO
0xE0, 0x1C, # OOO OOO
0x60, 0x18, # OO OO
0x60, 0x18, # OO OO
0x60, 0x18, # OO OO
0x30, 0x30, # OO OO
0x30, 0x30, # OO OO
0x30, 0x30, # OO OO
0x18, 0x60, # OO OO
0x18, 0x60, # OO OO
0x18, 0x60, # OO OO
0x0C, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x07, 0x80, # OOOO
0x07, 0x80, # OOOO
0x07, 0x80, # OOOO
0x03, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2328 'W' (22 pixels wide)
0x00, 0x00, 0x00, #
0xC0, 0x30, 0x0C, # OO OO OO
0xC0, 0x78, 0x0C, # OO OOOO OO
0x60, 0x78, 0x18, # OO OOOO OO
0x60, 0x78, 0x18, # OO OOOO OO
0x60, 0x78, 0x18, # OO OOOO OO
0x60, 0xCC, 0x18, # OO OO OO OO
0x30, 0xCC, 0x30, # OO OO OO OO
0x30, 0xCC, 0x30, # OO OO OO OO
0x30, 0x8C, 0x30, # OO O OO OO
0x30, 0x86, 0x30, # OO O OO OO
0x19, 0x86, 0x60, # OO OO OO OO
0x19, 0x86, 0x60, # OO OO OO OO
0x19, 0x02, 0x60, # OO O O OO
0x09, 0x02, 0x40, # O O O O
0x0F, 0x03, 0xC0, # OOOO OOOO
0x0F, 0x03, 0xC0, # OOOO OOOO
0x0E, 0x01, 0xC0, # OOO OOO
0x06, 0x01, 0x80, # OO OO
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
# @2400 'X' (14 pixels wide)
0x00, 0x00, #
0xC0, 0x0C, # OO OO
0x60, 0x18, # OO OO
0x30, 0x30, # OO OO
0x30, 0x30, # OO OO
0x18, 0x60, # OO OO
0x0C, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x07, 0x80, # OOOO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x07, 0x80, # OOOO
0x0C, 0xC0, # OO OO
0x0C, 0xC0, # OO OO
0x18, 0x60, # OO OO
0x30, 0x30, # OO OO
0x30, 0x30, # OO OO
0x60, 0x18, # OO OO
0xC0, 0x0C, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2448 'Y' (14 pixels wide)
0x00, 0x00, #
0xE0, 0x1C, # OOO OOO
0x60, 0x18, # OO OO
0x70, 0x38, # OOO OOO
0x30, 0x30, # OO OO
0x18, 0x60, # OO OO
0x18, 0xE0, # OO OOO
0x0C, 0xC0, # OO OO
0x0F, 0xC0, # OOOOOO
0x07, 0x80, # OOOO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2496 'Z' (11 pixels wide)
0x00, 0x00, #
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0x00, 0x60, # OO
0x00, 0xC0, # OO
0x01, 0x80, # OO
0x01, 0x80, # OO
0x03, 0x00, # OO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x0C, 0x00, # OO
0x1C, 0x00, # OOO
0x18, 0x00, # OO
0x30, 0x00, # OO
0x30, 0x00, # OO
0x60, 0x00, # OO
0xC0, 0x00, # OO
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2544 '[' (6 pixels wide)
0xFC, # OOOOOO
0xFC, # OOOOOO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xFC, # OOOOOO
0xFC, # OOOOOO
# @2568 '\' (9 pixels wide)
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0x30, 0x00, # OO
0x30, 0x00, # OO
0x30, 0x00, # OO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x18, 0x00, # OO
0x1C, 0x00, # OOO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x01, 0x80, # OO
0x01, 0x80, # OO
0x00, 0x00, #
# @2616 ']' (6 pixels wide)
0xFC, # OOOOOO
0xFC, # OOOOOO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0xFC, # OOOOOO
0xFC, # OOOOOO
# @2640 '^' (14 pixels wide)
0x00, 0x00, #
0x03, 0x00, # OO
0x07, 0x80, # OOOO
0x07, 0x80, # OOOO
0x0C, 0xC0, # OO OO
0x18, 0x60, # OO OO
0x30, 0x30, # OO OO
0x30, 0x30, # OO OO
0x60, 0x18, # OO OO
0xC0, 0x0C, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2688 '_' (13 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xFF, 0xF8, # OOOOOOOOOOOOO
0xFF, 0xF8, # OOOOOOOOOOOOO
0x00, 0x00, #
# @2736 '`' (5 pixels wide)
0xE0, # OOO
0x70, # OOO
0x30, # OO
0x18, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @2760 'a' (10 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x3F, 0x00, # OOOOOO
0x7F, 0x80, # OOOOOOOO
0x41, 0xC0, # O OOO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x1F, 0xC0, # OOOOOOO
0x7F, 0xC0, # OOOOOOOOO
0xF0, 0xC0, # OOOO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xE3, 0xC0, # OOO OOOO
0x7F, 0xC0, # OOOOOOOOO
0x3C, 0xC0, # OOOO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2808 'b' (10 pixels wide)
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xCF, 0x00, # OO OOOO
0xFF, 0x80, # OOOOOOOOO
0xE1, 0x80, # OOO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC1, 0x80, # OO OO
0xC3, 0x80, # OO OOO
0xFF, 0x00, # OOOOOOOO
0xDE, 0x00, # OO OOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2856 'c' (9 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x3F, 0x80, # OOOOOOO
0x70, 0x80, # OOO O
0xE0, 0x00, # OOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xE0, 0x80, # OOO O
0x71, 0x80, # OOO OO
0x3F, 0x80, # OOOOOOO
0x1F, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2904 'd' (10 pixels wide)
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x1E, 0xC0, # OOOO OO
0x3F, 0xC0, # OOOOOOOO
0x70, 0xC0, # OOO OO
0x60, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0x61, 0xC0, # OO OOO
0x7F, 0xC0, # OOOOOOOOO
0x3C, 0xC0, # OOOO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @2952 'e' (11 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x3F, 0xC0, # OOOOOOOO
0x70, 0xC0, # OOO OO
0x60, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xFF, 0xE0, # OOOOOOOOOOO
0xFF, 0xE0, # OOOOOOOOOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xE0, 0x20, # OOO O
0x70, 0x60, # OOO OO
0x3F, 0xE0, # OOOOOOOOO
0x0F, 0x80, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3000 'f' (8 pixels wide)
0x1F, # OOOOO
0x3F, # OOOOOO
0x30, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0xFE, # OOOOOOO
0xFE, # OOOOOOO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @3024 'g' (10 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x1E, 0xC0, # OOOO OO
0x3F, 0xC0, # OOOOOOOO
0x70, 0xC0, # OOO OO
0x60, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0x61, 0xC0, # OO OOO
0x7F, 0xC0, # OOOOOOOOO
0x3E, 0xC0, # OOOOO OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x41, 0x80, # O OO
0x7F, 0x80, # OOOOOOOO
0x7E, 0x00, # OOOOOO
# @3072 'h' (9 pixels wide)
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xCE, 0x00, # OO OOO
0xFF, 0x00, # OOOOOOOO
0xE3, 0x80, # OOO OOO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3120 'i' (2 pixels wide)
0x00, #
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @3144 'j' (6 pixels wide)
0x00, #
0x0C, # OO
0x0C, # OO
0x00, #
0x00, #
0x00, #
0x7C, # OOOOO
0x7C, # OOOOO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x0C, # OO
0x1C, # OOO
0xF8, # OOOOO
0xF0, # OOOO
# @3168 'k' (11 pixels wide)
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC1, 0xC0, # OO OOO
0xC3, 0x80, # OO OOO
0xC7, 0x00, # OO OOO
0xCE, 0x00, # OO OOO
0xCC, 0x00, # OO OO
0xD8, 0x00, # OO OO
0xF8, 0x00, # OOOOO
0xCC, 0x00, # OO OO
0xC6, 0x00, # OO OO
0xC7, 0x00, # OO OOO
0xC3, 0x80, # OO OOO
0xC1, 0xC0, # OO OOO
0xC0, 0xE0, # OO OOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3216 'l' (2 pixels wide)
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @3240 'm' (16 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xCE, 0x1C, # OO OOO OOO
0xFF, 0x7E, # OOOOOOOO OOOOOO
0xE3, 0xC7, # OOO OOOO OOO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0xC1, 0x83, # OO OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3288 'n' (9 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xCE, 0x00, # OO OOO
0xFF, 0x00, # OOOOOOOO
0xE3, 0x80, # OOO OOO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3336 'o' (11 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x1F, 0x00, # OOOOO
0x3F, 0x80, # OOOOOOO
0x71, 0xC0, # OOO OOO
0xE0, 0xE0, # OOO OOO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xC0, 0x60, # OO OO
0xE0, 0xE0, # OOO OOO
0x71, 0xC0, # OOO OOO
0x3F, 0x80, # OOOOOOO
0x1F, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3384 'p' (10 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xCF, 0x00, # OO OOOO
0xFF, 0x80, # OOOOOOOOO
0xE1, 0x80, # OOO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC1, 0x80, # OO OO
0xC3, 0x80, # OO OOO
0xFF, 0x00, # OOOOOOOO
0xDE, 0x00, # OO OOOO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0xC0, 0x00, # OO
# @3432 'q' (10 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x1E, 0xC0, # OOOO OO
0x3F, 0xC0, # OOOOOOOO
0x70, 0xC0, # OOO OO
0x60, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xC0, 0xC0, # OO OO
0xE0, 0xC0, # OOO OO
0x61, 0xC0, # OO OOO
0x7F, 0xC0, # OOOOOOOOO
0x3E, 0xC0, # OOOOO OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
0x00, 0xC0, # OO
# @3480 'r' (7 pixels wide)
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
0xCE, # OO OOO
0xDE, # OO OOOO
0xF0, # OOOO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @3504 's' (10 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x3F, 0x00, # OOOOOO
0x7F, 0x80, # OOOOOOOO
0xE0, 0x80, # OOO O
0xC0, 0x00, # OO
0xC0, 0x00, # OO
0x78, 0x00, # OOOO
0x3F, 0x80, # OOOOOOO
0x07, 0xC0, # OOOOO
0x00, 0xC0, # OO
0x80, 0xC0, # O OO
0xE1, 0xC0, # OOO OOO
0xFF, 0x80, # OOOOOOOOO
0x3F, 0x00, # OOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3552 't' (7 pixels wide)
0x00, #
0x00, #
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0xFE, # OOOOOOO
0xFE, # OOOOOOO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x60, # OO
0x3E, # OOOOO
0x1E, # OOOO
0x00, #
0x00, #
0x00, #
0x00, #
0x00, #
# @3576 'u' (9 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xE3, 0x80, # OOO OOO
0x7F, 0x80, # OOOOOOOO
0x39, 0x80, # OOO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3624 'v' (12 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xC0, 0x30, # OO OO
0x60, 0x60, # OO OO
0x60, 0x60, # OO OO
0x60, 0x60, # OO OO
0x30, 0xC0, # OO OO
0x30, 0xC0, # OO OO
0x38, 0x80, # OOO O
0x19, 0x80, # OO OO
0x19, 0x80, # OO OO
0x0F, 0x00, # OOOO
0x0F, 0x00, # OOOO
0x0F, 0x00, # OOOO
0x06, 0x00, # OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3672 'w' (18 pixels wide)
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0xC0, 0xC0, 0xC0, # OO OO OO
0xC0, 0xE0, 0xC0, # OO OOO OO
0x61, 0xE1, 0x80, # OO OOOO OO
0x61, 0xE1, 0x80, # OO OOOO OO
0x61, 0x31, 0x80, # OO O OO OO
0x73, 0x31, 0x80, # OOO OO OO OO
0x33, 0x33, 0x00, # OO OO OO OO
0x32, 0x1B, 0x00, # OO O OO OO
0x36, 0x1B, 0x00, # OO OO OO OO
0x1E, 0x1A, 0x00, # OOOO OO O
0x1C, 0x0E, 0x00, # OOO OOO
0x1C, 0x0E, 0x00, # OOO OOO
0x1C, 0x0E, 0x00, # OOO OOO
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
# @3744 'x' (12 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xC0, 0x30, # OO OO
0x60, 0x60, # OO OO
0x30, 0xC0, # OO OO
0x19, 0x80, # OO OO
0x19, 0x80, # OO OO
0x0F, 0x00, # OOOO
0x06, 0x00, # OO
0x0F, 0x00, # OOOO
0x19, 0x80, # OO OO
0x19, 0x80, # OO OO
0x30, 0xC0, # OO OO
0x60, 0x60, # OO OO
0xC0, 0x30, # OO OO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3792 'y' (12 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xC0, 0x30, # OO OO
0x60, 0x60, # OO OO
0x60, 0x60, # OO OO
0x60, 0x60, # OO OO
0x30, 0xC0, # OO OO
0x30, 0xC0, # OO OO
0x19, 0x80, # OO OO
0x19, 0x80, # OO OO
0x19, 0x80, # OO OO
0x0F, 0x00, # OOOO
0x0F, 0x00, # OOOO
0x0E, 0x00, # OOO
0x06, 0x00, # OO
0x06, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x18, 0x00, # OO
0x18, 0x00, # OO
# @3840 'z' (9 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0xFF, 0x80, # OOOOOOOOO
0xFF, 0x80, # OOOOOOOOO
0x03, 0x00, # OO
0x03, 0x00, # OO
0x06, 0x00, # OO
0x0C, 0x00, # OO
0x1C, 0x00, # OOO
0x18, 0x00, # OO
0x30, 0x00, # OO
0x60, 0x00, # OO
0x60, 0x00, # OO
0xFF, 0x80, # OOOOOOOOO
0xFF, 0x80, # OOOOOOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @3888 '{' (10 pixels wide)
0x03, 0xC0, # OOOO
0x07, 0xC0, # OOOOO
0x0E, 0x00, # OOO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x1C, 0x00, # OOO
0x38, 0x00, # OOO
0xF0, 0x00, # OOOO
0xF0, 0x00, # OOOO
0x38, 0x00, # OOO
0x1C, 0x00, # OOO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0E, 0x00, # OOO
0x07, 0xC0, # OOOOO
0x03, 0xC0, # OOOO
# @3936 '|' (2 pixels wide)
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
0xC0, # OO
# @3960 '}' (10 pixels wide)
0xF0, 0x00, # OOOO
0xF8, 0x00, # OOOOO
0x1C, 0x00, # OOO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0E, 0x00, # OOO
0x07, 0x00, # OOO
0x03, 0xC0, # OOOO
0x03, 0xC0, # OOOO
0x07, 0x00, # OOO
0x0E, 0x00, # OOO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x0C, 0x00, # OO
0x1C, 0x00, # OOO
0xF8, 0x00, # OOOOO
0xF0, 0x00, # OOOO
# @4008 '~' (13 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x38, 0x18, # OOO OO
0x7C, 0x18, # OOOOO OO
0x66, 0x18, # OO OO OO
0xC3, 0x30, # OO OO OO
0xC1, 0xF0, # OO OOOOO
0xC0, 0xE0, # OO OOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @4056 '°' (9 pixels wide)
0x00, 0x00, #
0x3E, 0x00, # OOOOO
0x7F, 0x00, # OOOOOOO
0xE3, 0x80, # OOO OOO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xC1, 0x80, # OO OO
0xE3, 0x80, # OOO OOO
0x7F, 0x00, # OOOOOOO
0x3E, 0x00, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
)
descriptors = (
(2,0),# !
(6,24),# "
(15,48),# #
(11,96),# $
(21,144),# %
(16,216),# &
(2,264),# '
(7,288),# (
(7,312),# )
(10,336),# *
(14,384),# +
(5,432),# ,
(7,456),# -
(3,480),# .
(9,504),# /
(11,552),# 0
(8,600),# 1
(11,624),# 2
(11,672),# 3
(12,720),# 4
(10,768),# 5
(11,816),# 6
(11,864),# 7
(11,912),# 8
(11,960),# 9
(3,1008),# :
(5,1032),# ;
(13,1056),# <
(13,1104),# =
(13,1152),# >
(9,1200),# ?
(19,1248),# @
(14,1320),# A
(11,1368),# B
(12,1416),# C
(13,1464),# D
(10,1512),# E
(11,1560),# F
(14,1608),# G
(12,1656),# H
(6,1704),# I
(8,1728),# J
(12,1752),# K
(10,1800),# L
(15,1848),# M
(12,1896),# N
(15,1944),# O
(11,1992),# P
(15,2040),# Q
(13,2088),# R
(11,2136),# S
(14,2184),# T
(12,2232),# U
(14,2280),# V
(22,2328),# W
(14,2400),# X
(14,2448),# Y
(11,2496),# Z
(6,2544),# [
(9,2568),# \
(6,2616),# ]
(14,2640),# ^
(13,2688),# _
(5,2736),# `
(10,2760),# a
(10,2808),# b
(9,2856),# c
(10,2904),# d
(11,2952),# e
(8,3000),# f
(10,3024),# g
(9,3072),# h
(2,3120),# i
(6,3144),# j
(11,3168),# k
(2,3216),# l
(16,3240),# m
(9,3288),# n
(11,3336),# o
(10,3384),# p
(10,3432),# q
(7,3480),# r
(10,3504),# s
(7,3552),# t
(9,3576),# u
(12,3624),# v
(18,3672),# w
(12,3744),# x
(12,3792),# y
(9,3840),# z
(10,3888),# {
(2,3936),# |
(10,3960),# }
(13,4008),# ~
(9,4056),# °
)
kerning = (
(2,2,2,2,2,2,2,2,1,2,2,1,2,2,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,),
(6,6,4,6,6,5,6,5,6,6,0,1,0,3,1,6,6,6,6,3,5,5,6,6,6,6,5,0,0,6,6,5,2,6,6,6,6,6,6,6,6,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,4,0,6,4,6,3,3,3,6,3,6,6,5,6,6,6,6,3,6,3,6,4,6,6,6,6,6,6,6,2,6,6,0,6,),
(15,15,13,15,15,14,15,15,12,15,11,10,11,12,10,15,12,13,13,13,14,15,13,15,15,15,14,12,13,15,13,14,11,15,15,15,15,15,15,15,13,11,15,15,15,15,15,15,15,15,15,13,15,13,14,13,13,13,15,13,13,13,2,12,14,15,13,13,13,15,13,15,15,14,15,15,15,15,13,15,13,15,14,15,15,15,15,15,15,15,13,15,13,13,15,),
(11,10,11,10,10,11,10,11,6,8,9,8,9,10,9,11,10,10,11,10,10,11,8,11,10,10,9,9,11,10,8,11,10,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,6,11,9,9,9,7,10,11,8,7,8,6,6,11,11,11,11,11,10,11,11,11,9,11,11,11,11,11,11,11,11,11,10,11,10,10,10,10,10,10,11,7,11,10,),
(21,16,21,21,18,21,19,21,17,16,21,19,21,21,19,21,20,21,21,21,21,21,19,21,19,21,19,21,21,21,18,21,20,21,21,21,21,21,21,21,20,21,21,21,21,21,21,21,21,21,21,16,21,18,18,19,16,21,21,18,17,19,8,16,21,21,21,21,21,20,21,21,21,17,21,21,21,21,21,21,21,21,21,20,21,19,20,19,19,20,21,21,17,21,17,),
(16,10,14,15,13,14,14,15,12,13,13,15,13,16,15,13,16,16,15,13,15,13,15,14,14,16,15,13,13,15,13,14,16,16,13,16,16,16,13,16,16,16,16,16,16,16,13,16,13,16,15,10,13,11,11,16,10,16,16,10,12,13,3,11,14,16,13,14,13,15,14,16,16,12,16,16,16,16,13,16,14,16,15,13,14,12,13,16,12,16,13,16,12,13,12,),
(2,2,0,2,2,1,2,1,2,2,0,0,0,0,0,2,2,2,2,0,1,1,2,2,2,2,1,0,0,2,2,1,0,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,0,2,0,0,0,2,0,2,2,1,2,2,2,2,0,2,0,2,0,2,2,2,2,2,2,2,0,2,2,0,2,),
(6,7,2,3,4,3,7,3,7,5,2,7,2,4,6,3,4,5,5,2,5,3,6,4,4,4,7,2,2,3,5,2,3,6,3,6,6,6,3,6,6,4,6,6,6,6,3,6,3,6,4,6,6,6,6,6,6,6,7,7,7,2,6,7,3,7,2,2,2,4,6,7,6,7,7,7,3,3,2,7,2,3,3,4,3,3,3,3,4,3,2,7,7,2,4,),
(7,6,7,7,7,7,6,7,3,7,7,5,7,7,5,7,6,7,7,7,7,7,5,7,7,7,6,7,7,7,5,7,6,7,7,7,7,7,7,7,6,7,7,7,7,7,7,7,7,7,7,4,7,5,5,6,4,7,7,5,4,7,4,3,7,7,7,7,7,7,7,7,7,6,7,7,7,7,7,7,7,7,7,7,7,6,7,6,6,7,7,7,4,7,7,),
(10,10,8,10,10,9,10,10,8,10,6,5,6,7,6,10,10,10,10,8,9,10,10,10,10,10,9,5,10,9,10,10,7,10,10,10,10,10,10,10,10,8,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,10,10,9,6,9,0,8,9,10,9,9,9,10,9,10,10,9,10,10,10,10,9,10,9,10,10,10,10,9,10,9,9,10,6,10,7,8,10,),
(14,8,10,13,12,13,12,14,9,10,14,9,14,11,11,14,11,9,8,14,8,14,9,13,13,11,9,14,8,8,11,14,12,14,14,14,14,14,14,14,12,8,14,14,14,14,14,14,14,14,11,8,14,11,12,9,8,11,14,11,10,8,1,9,11,14,14,14,14,13,14,14,14,10,14,14,14,14,14,14,14,14,14,13,14,12,13,11,12,10,14,14,9,14,8,),
(4,0,2,5,0,4,3,5,2,0,0,3,0,5,3,4,4,5,5,0,5,4,3,4,2,5,3,0,0,5,1,4,4,5,3,5,5,5,3,5,4,5,5,5,5,5,3,5,3,5,5,0,4,0,1,4,0,5,5,0,2,0,3,0,5,5,4,4,4,4,4,5,5,2,5,5,5,5,4,5,4,5,5,4,5,1,2,4,1,4,1,5,2,0,0,),
(7,1,3,6,5,6,5,7,2,3,7,2,7,4,4,7,4,2,0,7,0,7,2,6,6,4,2,7,0,0,4,7,5,7,7,7,7,7,7,7,5,1,7,7,7,7,7,7,7,7,4,1,7,4,5,2,1,4,7,4,3,0,0,2,4,7,7,7,7,6,7,7,7,3,7,7,7,7,7,7,7,7,7,6,7,5,6,4,5,3,7,7,2,7,0,),
(3,0,1,3,0,2,1,3,0,0,0,2,0,3,2,2,3,3,3,0,3,2,2,2,1,3,2,0,0,3,0,2,3,3,1,3,3,3,1,3,3,3,3,3,3,3,1,3,1,3,3,0,2,0,0,3,0,3,3,0,0,0,0,0,3,3,2,2,2,2,2,3,3,0,3,3,3,3,2,3,2,3,3,2,3,0,0,3,0,3,0,3,0,0,0,),
(9,9,5,7,8,7,9,7,9,8,6,4,6,6,3,7,8,8,8,6,8,7,9,8,8,7,6,6,6,7,8,6,4,9,7,9,9,9,7,9,9,7,9,9,9,9,7,9,7,9,8,9,9,9,9,9,9,9,9,9,9,6,2,9,6,9,6,6,6,7,6,9,9,6,9,9,7,7,6,7,6,7,6,7,7,7,7,7,7,7,6,9,9,6,8,),
(11,11,11,11,11,11,11,11,7,11,11,8,11,10,8,11,10,10,10,11,10,11,9,11,11,11,10,11,11,11,10,11,10,11,11,11,11,11,11,11,9,10,11,11,11,11,11,11,11,11,11,9,11,10,10,8,9,10,11,9,8,11,0,7,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,11,11,),
(8,5,6,8,5,7,6,7,4,5,5,7,5,8,7,6,8,8,8,5,8,6,7,7,6,8,7,5,5,8,5,6,8,8,5,8,8,8,5,8,8,8,8,8,8,8,5,8,5,8,8,5,6,5,5,8,5,8,8,5,5,5,0,4,7,8,6,7,6,7,7,8,8,4,8,8,8,8,6,8,7,8,8,6,7,5,5,8,5,8,5,8,5,5,5,),
(11,10,9,11,10,10,10,10,7,10,8,10,8,11,10,10,11,11,11,8,11,10,10,10,10,11,10,8,10,11,9,10,11,11,10,11,11,11,10,11,11,11,11,11,11,11,10,11,10,11,11,9,10,9,9,11,8,11,11,9,7,9,0,7,10,11,9,10,9,10,10,11,11,9,11,11,11,11,9,11,10,11,11,10,10,10,10,11,10,11,8,11,7,8,10,),
(11,11,11,11,11,11,11,11,8,11,11,8,11,10,9,11,11,11,11,11,10,11,10,11,11,11,10,11,11,11,11,11,10,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,10,11,10,10,9,10,10,11,10,8,9,0,8,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,11,11,),
(12,10,12,10,10,12,10,12,9,10,12,9,12,10,9,12,10,10,10,12,10,12,10,12,10,10,9,12,10,10,10,12,10,12,12,12,12,12,12,12,10,10,12,12,12,12,12,12,12,12,10,10,12,10,10,10,10,10,12,10,10,10,0,9,11,12,12,12,12,11,12,12,12,9,12,12,12,12,12,12,12,12,11,11,12,10,11,10,10,10,12,12,10,12,10,),
(10,10,10,9,9,10,10,10,9,10,10,7,10,9,8,10,8,10,10,10,9,10,10,10,8,9,7,10,10,9,10,10,9,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,0,9,10,10,10,10,10,9,10,10,10,6,10,10,10,10,10,10,10,10,10,9,10,8,9,7,8,9,10,10,10,10,9,),
(11,10,11,10,9,11,10,11,9,10,11,8,11,10,9,11,9,10,11,11,10,11,10,11,9,10,8,11,11,10,10,11,10,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,10,11,10,10,10,10,10,11,10,10,10,0,9,11,11,11,11,11,10,11,11,11,7,11,11,11,11,11,11,11,11,11,10,11,9,10,8,9,10,11,11,10,11,9,),
(11,11,7,9,11,10,11,9,10,11,7,6,7,8,5,10,11,11,11,7,10,10,11,11,11,9,8,7,8,10,11,9,6,11,10,11,11,11,10,11,11,9,11,11,11,11,10,11,10,11,11,11,11,11,11,11,11,11,11,11,11,8,0,10,8,11,8,7,7,10,7,11,11,8,11,11,9,9,8,9,7,9,8,10,9,9,9,9,9,9,7,11,11,7,11,),
(11,11,11,11,11,11,11,11,8,11,10,8,10,10,9,11,11,11,11,11,10,11,10,11,11,11,10,10,11,11,11,11,10,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,10,11,10,10,9,10,10,11,10,8,9,0,8,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,11,11,),
(11,11,11,11,11,11,11,11,7,11,11,7,11,9,8,11,10,10,10,11,10,11,9,11,11,11,10,11,11,11,10,11,9,11,11,11,11,11,11,11,9,9,11,11,11,11,11,11,11,11,11,9,11,10,10,8,9,9,11,9,8,11,0,7,10,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,11,11,),
(3,3,1,3,3,2,3,3,0,3,0,2,0,3,2,3,3,3,3,1,3,3,2,3,3,3,2,0,3,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,1,2,3,0,3,3,1,0,2,0,0,3,3,2,2,2,3,2,3,3,2,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,0,3,0,1,3,),
(4,4,2,5,4,4,4,5,2,4,0,3,0,5,3,4,4,5,5,2,5,4,3,4,4,5,3,0,4,5,1,4,4,5,4,5,5,5,4,5,4,5,5,5,5,5,4,5,4,5,5,0,4,2,3,4,1,5,5,2,2,3,3,0,5,5,4,4,4,4,4,5,5,3,5,5,5,5,4,5,4,5,5,4,5,4,4,4,4,4,1,5,2,2,4,),
(13,13,11,13,13,12,13,13,9,12,7,11,6,13,11,13,13,13,13,10,13,12,11,13,13,13,12,5,10,13,10,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,7,13,12,12,12,10,13,13,11,9,11,0,8,13,13,12,12,12,13,12,13,13,12,13,13,13,13,12,13,12,13,13,13,13,13,13,13,13,13,9,13,9,8,13,),
(13,7,13,13,13,13,11,13,8,13,7,8,6,10,10,13,10,11,9,12,12,13,10,13,13,13,12,10,13,10,10,13,12,13,13,13,13,13,13,13,11,7,13,13,13,13,13,13,13,13,12,7,13,11,11,10,9,11,13,10,9,13,0,8,13,13,13,13,13,12,13,13,13,9,13,13,13,13,13,13,13,13,13,12,13,12,12,11,12,11,11,13,9,13,12,),
(13,7,12,11,10,12,11,13,8,8,13,8,13,10,10,13,10,8,6,13,9,13,8,12,11,10,8,13,10,5,10,13,11,13,13,13,13,13,13,13,11,7,13,13,13,13,13,13,13,13,9,7,13,10,10,8,7,10,13,10,9,10,0,8,11,13,13,13,13,12,13,13,13,9,13,13,13,13,13,13,13,13,12,12,13,11,12,9,11,9,13,13,7,13,8,),
(9,9,7,9,9,8,9,9,6,9,7,4,7,6,4,9,9,9,9,7,8,9,8,9,9,9,8,6,8,9,9,8,5,9,9,9,9,9,9,9,8,6,9,9,9,9,9,9,9,9,9,8,9,8,8,7,8,8,9,8,7,8,0,6,8,9,8,7,7,9,7,9,9,8,9,9,9,9,8,9,7,9,8,9,9,9,9,9,9,9,6,9,7,7,9,),
(19,18,19,19,19,19,18,19,15,19,19,16,19,18,16,19,17,18,18,19,18,19,16,19,19,19,18,19,19,18,16,19,17,19,19,19,19,19,19,19,17,18,19,19,19,19,19,19,19,19,19,15,19,17,17,16,15,18,19,17,15,19,14,14,19,19,19,19,19,19,19,19,19,18,19,19,19,19,19,19,19,19,19,19,19,18,19,18,18,19,19,19,15,19,19,),
(14,10,12,14,11,13,12,13,10,11,12,13,12,14,13,13,14,14,14,12,14,13,13,13,12,14,13,12,13,14,11,13,14,14,12,14,14,14,12,14,14,14,14,14,14,14,12,14,12,14,14,9,13,9,10,14,9,14,14,9,10,11,1,9,13,14,13,13,13,13,13,14,14,10,14,14,14,14,13,14,13,14,14,12,13,10,11,14,10,14,12,14,10,12,10,),
(11,10,11,10,10,11,10,11,7,10,11,8,11,10,9,11,10,10,11,11,10,11,9,11,10,10,9,11,11,10,10,11,10,11,11,11,11,11,11,11,9,10,11,11,11,11,11,11,11,11,11,9,11,9,9,9,9,10,11,9,8,9,0,7,11,11,11,11,11,10,11,11,11,9,11,11,11,11,11,11,11,11,11,10,11,10,10,10,10,10,11,11,8,11,10,),
(12,12,10,12,12,12,12,12,10,12,6,10,5,12,10,11,12,12,12,7,12,11,12,12,12,12,10,5,3,12,12,11,12,12,11,12,12,12,11,12,12,12,12,12,12,12,11,12,11,12,12,12,12,12,12,11,11,12,12,11,10,8,0,10,12,12,12,12,12,11,12,12,12,8,12,12,12,12,12,12,12,12,12,11,12,8,9,11,8,12,8,12,10,3,12,),
(13,13,13,13,13,13,13,13,9,13,13,9,13,11,10,13,12,12,12,13,12,13,10,13,13,13,12,13,13,13,11,13,11,13,13,13,13,13,13,13,11,11,13,13,13,13,13,13,13,13,13,10,13,11,12,10,10,11,13,11,9,13,0,8,12,13,13,13,13,13,13,13,13,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,9,13,13,),
(10,10,8,10,9,9,10,9,9,10,4,9,3,10,9,9,10,10,10,8,10,9,10,9,9,10,9,6,9,10,10,9,10,10,9,10,10,10,9,10,10,10,10,10,10,10,9,10,9,10,10,10,10,10,10,10,10,10,10,10,10,9,0,9,9,10,9,9,8,9,9,10,10,6,10,10,10,10,9,10,9,10,10,9,9,8,8,10,8,10,6,10,10,8,9,),
(11,11,7,11,11,9,11,11,10,11,5,6,4,8,7,11,8,11,11,10,10,11,11,10,11,11,10,8,11,8,11,11,8,11,11,11,11,11,11,11,11,9,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,0,10,10,11,11,10,10,10,10,11,11,7,11,11,11,11,11,11,10,11,11,10,11,10,10,9,10,5,8,11,11,10,10,),
(14,14,14,14,14,14,14,14,12,14,14,12,14,14,12,14,14,14,14,14,14,14,14,14,14,14,12,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,13,13,14,14,13,12,10,1,12,14,14,14,14,14,13,14,14,14,10,14,14,14,14,14,14,14,14,14,13,14,12,13,13,12,14,14,14,12,14,14,),
(12,12,12,12,12,12,12,12,11,12,12,11,12,12,11,12,12,12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,0,11,12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,),
(6,6,4,6,5,5,6,5,5,6,4,5,4,6,5,4,6,6,6,4,6,4,6,5,4,6,5,4,4,6,6,4,6,6,4,6,6,6,4,6,6,6,6,6,6,6,4,6,4,6,6,6,6,6,6,6,6,6,6,6,6,4,0,5,5,6,4,5,4,5,5,6,6,3,6,6,6,6,4,6,5,6,6,5,5,4,4,6,4,6,4,6,6,4,5,),
(8,8,8,8,8,8,8,8,7,8,8,6,8,8,6,8,8,8,8,8,8,8,8,8,8,8,7,8,8,8,8,8,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,7,8,8,8,8,8,8,8,8,8,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,),
(12,12,10,11,10,10,12,11,11,11,7,11,7,12,11,9,12,12,11,7,11,9,12,10,10,12,11,7,9,11,11,10,12,12,8,12,12,12,8,12,12,12,12,12,12,12,8,12,8,12,11,12,12,12,12,12,12,12,12,12,12,6,0,11,10,12,9,10,9,11,10,12,12,8,12,12,12,12,9,12,10,12,11,10,10,7,9,12,7,12,8,12,12,8,10,),
(10,4,8,10,5,9,8,9,6,2,4,9,3,10,9,8,10,10,10,2,10,8,9,9,8,10,9,2,2,10,7,8,10,10,7,10,10,10,7,10,10,10,10,10,10,10,7,10,7,10,10,4,8,5,6,10,4,10,10,5,6,2,0,5,9,10,8,9,8,9,9,10,10,6,10,10,10,10,8,10,9,10,10,8,9,6,7,10,6,10,6,10,6,2,2,),
(15,15,15,15,15,15,15,15,14,15,15,14,15,15,14,15,15,15,15,15,15,15,15,15,15,15,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,2,14,15,15,15,15,15,15,15,15,15,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,),
(12,12,12,12,12,12,12,12,11,12,12,11,12,12,11,12,12,12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,0,11,12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,),
(15,15,15,15,15,15,15,15,11,15,15,11,15,13,12,15,14,14,14,15,14,15,12,15,15,15,14,15,15,15,13,15,13,15,15,15,15,15,15,15,13,13,15,15,15,15,15,15,15,15,15,12,15,13,14,12,12,13,15,13,11,15,2,10,15,15,15,15,15,15,15,15,15,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,11,15,15,),
(11,11,9,11,11,10,11,11,8,11,9,6,9,8,7,11,11,11,11,9,10,11,9,11,11,11,10,8,11,11,10,11,8,11,11,11,11,11,11,11,9,7,11,11,11,11,11,11,11,11,11,9,11,10,10,9,9,9,11,10,8,10,0,7,10,11,10,10,10,11,10,11,11,10,11,11,11,11,10,11,10,11,11,11,11,11,11,11,11,11,7,11,8,9,11,),
(15,15,15,15,15,15,15,15,15,15,15,15,15,13,15,15,14,14,14,15,14,15,12,15,15,15,15,15,15,15,13,15,13,15,15,15,15,15,15,15,13,13,15,15,15,15,15,15,15,15,15,12,15,13,14,12,12,13,15,13,15,15,15,10,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,),
(13,11,11,12,11,11,11,12,9,11,9,12,9,13,12,11,13,13,12,9,12,11,12,11,11,13,12,8,10,12,10,11,13,13,11,13,13,13,11,13,13,13,13,13,13,13,11,13,11,13,12,10,11,10,10,13,9,13,13,10,9,10,0,8,11,13,10,11,10,12,11,13,13,10,13,13,13,13,10,13,11,13,12,11,11,11,11,13,11,13,9,13,9,9,11,),
(11,10,11,10,10,11,10,11,8,10,11,8,11,10,9,11,10,10,11,11,10,11,10,11,10,10,8,11,11,10,10,11,10,11,11,11,11,11,11,11,10,10,11,11,11,11,11,11,11,11,11,10,11,10,10,9,9,10,11,9,9,8,0,8,11,11,11,11,11,10,11,11,11,7,11,11,11,11,11,11,11,11,11,10,11,9,10,8,9,10,11,11,9,11,10,),
(14,14,8,9,13,12,14,11,13,14,8,9,8,11,8,12,11,14,14,8,13,11,14,13,12,11,9,8,8,8,14,9,9,14,11,14,14,14,11,14,14,12,14,14,14,14,11,14,11,14,13,14,14,14,14,14,14,14,14,14,14,9,1,13,8,14,8,8,8,12,8,14,14,10,14,14,8,8,8,8,8,8,8,13,8,8,8,8,8,8,10,14,14,8,13,),
(12,12,12,12,12,12,12,12,11,12,12,9,12,11,10,12,12,12,12,12,11,12,12,12,12,12,11,12,12,12,12,12,11,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,0,11,12,12,12,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,),
(14,14,10,12,13,12,14,12,13,14,11,9,11,11,8,13,13,14,14,11,13,12,14,13,13,12,11,11,12,13,14,12,9,14,12,14,14,14,12,14,14,12,14,14,14,14,12,14,12,14,13,14,14,14,14,14,14,14,14,14,14,11,1,13,11,14,11,11,11,12,11,14,14,11,14,14,12,12,11,12,11,12,12,13,12,12,12,12,12,12,11,14,14,11,13,),
(22,22,19,21,21,20,22,20,21,22,20,17,20,19,16,21,21,22,22,20,21,20,22,21,21,21,20,19,20,21,22,20,18,22,21,22,22,22,21,22,22,20,22,22,22,22,21,22,21,22,21,22,22,22,22,22,22,22,22,22,22,20,9,21,19,22,20,20,20,21,20,22,22,20,22,22,21,21,20,21,20,21,20,21,21,21,21,21,21,21,19,22,22,19,21,),
(14,14,12,13,12,12,14,13,13,13,9,13,9,14,13,11,14,14,13,10,13,11,14,12,12,14,13,9,11,13,13,12,14,14,11,14,14,14,11,14,14,14,14,14,14,14,11,14,11,14,13,14,14,14,14,14,14,14,14,14,14,8,1,13,12,14,12,12,12,13,12,14,14,10,14,14,14,14,12,14,12,14,13,12,12,10,11,14,10,14,10,14,14,10,12,),
(14,14,9,11,13,12,14,11,13,13,8,9,8,11,7,12,13,13,13,8,13,11,14,12,12,11,10,8,10,11,13,10,9,14,11,14,14,14,11,14,14,12,14,14,14,14,11,14,11,14,12,14,14,14,14,14,14,14,14,14,14,9,1,13,9,14,9,9,9,12,9,14,14,10,14,14,11,11,9,11,9,11,10,12,11,11,11,11,11,11,9,14,14,8,13,),
(11,11,9,11,11,10,11,10,10,11,6,10,6,11,10,10,11,11,11,6,11,9,11,10,10,11,10,6,7,11,11,9,11,11,9,11,11,11,9,11,11,11,11,11,11,11,9,11,9,11,11,11,11,11,11,11,11,11,11,11,11,7,0,10,10,11,9,10,9,10,10,11,11,8,11,11,11,11,9,11,10,11,11,10,10,9,9,11,9,11,7,11,11,6,11,),
(6,6,2,2,4,3,6,3,6,2,2,6,2,3,6,3,3,4,4,2,5,2,6,3,3,3,6,2,2,2,5,2,2,6,2,6,6,6,2,6,6,4,6,6,6,6,2,6,2,6,3,6,6,6,6,6,6,6,6,6,6,2,6,6,2,6,2,2,2,4,5,6,6,6,6,6,2,2,2,6,2,2,2,2,2,2,2,2,3,2,2,6,6,2,4,),
(8,4,6,7,5,7,7,7,8,5,6,9,6,8,9,6,8,8,7,6,7,6,7,7,6,8,9,6,6,7,5,6,8,8,6,8,8,8,6,8,8,8,8,8,8,8,6,8,6,8,7,3,7,3,3,8,2,8,9,3,9,5,9,4,7,8,7,7,7,7,8,8,8,9,8,8,8,8,7,9,7,8,7,6,7,4,5,8,6,8,6,9,9,6,4,),
(6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,),
(14,12,10,14,13,11,12,14,9,13,8,9,7,11,10,14,11,10,10,13,13,14,9,12,13,13,12,11,14,12,9,14,11,14,14,14,14,14,14,14,12,8,14,14,14,14,14,14,14,14,13,9,14,11,12,8,9,9,14,11,10,14,1,9,12,14,14,13,13,13,13,14,14,11,14,14,14,14,14,14,13,14,14,13,14,13,13,12,13,12,11,14,10,13,12,),
(11,7,0,8,0,0,11,10,12,3,0,13,6,10,13,2,5,2,2,1,3,2,2,2,2,10,13,0,0,0,4,6,0,2,1,0,3,2,0,1,7,5,1,3,0,1,0,2,4,0,2,0,1,0,0,0,0,2,13,6,13,0,13,8,3,3,4,3,2,5,12,4,11,13,2,11,0,4,2,13,5,6,3,6,4,1,0,1,10,4,9,13,13,0,4,),
(5,5,0,0,5,4,5,3,3,5,0,0,0,2,0,4,5,5,5,0,4,3,4,4,4,2,0,0,0,0,5,2,0,5,3,5,5,5,3,5,4,2,5,5,5,5,3,5,3,5,4,4,5,4,4,4,4,4,5,4,4,0,0,3,0,5,0,0,0,4,0,5,4,0,5,5,0,0,0,0,0,0,0,4,0,0,0,0,0,0,1,5,4,0,5,),
(10,8,10,10,10,10,8,10,6,10,10,9,10,10,9,10,10,10,10,10,10,10,9,10,10,10,9,10,10,10,7,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,4,10,8,8,10,6,10,10,7,6,10,0,5,10,10,10,10,10,9,10,10,10,8,10,10,10,10,10,10,10,10,10,9,10,9,9,10,9,10,10,10,6,10,9,),
(10,8,10,10,9,10,8,10,5,9,10,7,10,9,7,10,8,9,9,10,9,10,7,10,9,9,8,10,10,9,7,10,9,10,10,10,10,10,10,10,8,9,10,10,10,10,10,10,10,10,9,4,10,7,8,7,5,9,10,7,6,10,0,5,10,10,10,10,10,9,10,10,10,8,10,10,10,10,10,10,10,10,10,9,10,9,9,8,9,9,10,10,6,10,9,),
(9,8,7,9,9,9,8,9,5,9,3,7,2,9,7,9,9,9,9,7,9,9,7,9,9,9,8,4,9,9,6,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,7,7,8,5,9,9,7,5,8,0,4,9,9,9,9,9,9,9,9,9,8,9,9,9,9,9,9,9,9,9,9,9,8,9,8,8,9,5,9,5,7,9,),
(10,10,10,10,10,10,10,10,10,10,10,9,10,10,9,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,0,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,),
(11,8,11,11,10,11,9,11,7,10,11,9,11,11,9,11,11,11,11,11,11,11,9,11,10,11,9,11,11,11,8,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,8,9,10,6,11,11,8,7,11,0,6,11,11,11,11,11,10,11,11,11,9,11,11,11,11,11,11,11,11,11,10,11,10,10,10,10,11,11,11,7,11,10,),
(8,8,5,7,7,6,8,7,8,7,3,3,3,5,2,7,5,6,6,5,7,7,8,7,7,7,6,3,3,7,7,6,3,8,7,8,8,8,7,8,8,6,8,8,8,8,7,8,7,8,7,8,8,8,8,8,8,8,8,8,8,5,0,8,6,8,5,5,5,7,5,8,8,6,8,8,7,7,5,7,5,7,6,7,7,7,7,7,7,7,3,8,8,3,7,),
(10,10,10,10,10,10,10,10,8,10,10,9,10,10,9,10,10,10,10,10,10,10,9,10,10,10,9,10,10,10,7,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,4,10,8,9,10,7,10,10,8,9,10,9,5,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,),
(9,7,9,9,9,9,7,9,5,9,9,8,9,9,8,9,9,9,9,9,9,9,8,9,9,9,8,9,9,9,6,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,7,7,9,5,9,9,6,5,9,0,4,9,9,9,9,9,8,9,9,9,7,9,9,9,9,9,9,9,9,9,8,9,8,8,9,8,9,9,9,5,9,8,),
(2,2,2,2,2,2,2,2,1,2,2,1,2,2,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,),
(6,6,6,6,6,6,6,6,5,6,6,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,6,6,6,6,6,6,6,6,6,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,),
(11,10,9,10,10,9,10,10,7,9,6,10,6,11,10,10,11,11,10,7,10,9,10,10,10,11,10,5,8,10,8,9,11,11,10,11,11,11,10,11,11,11,11,11,11,11,10,11,10,11,10,5,10,8,9,11,7,11,11,8,7,8,0,6,9,11,8,9,8,10,9,11,11,9,11,11,11,11,8,11,9,11,10,10,10,10,10,11,10,11,7,11,7,6,10,),
(2,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,),
(16,14,16,16,16,16,14,16,12,16,16,15,16,16,15,16,16,16,16,16,16,16,15,16,16,16,15,16,16,16,13,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,10,16,14,14,16,12,16,16,13,12,16,3,11,16,16,16,16,16,15,16,16,16,14,16,16,16,16,16,16,16,16,16,15,16,15,15,16,15,16,16,16,12,16,15,),
(9,7,9,9,9,9,7,9,5,9,9,8,9,9,8,9,9,9,9,9,9,9,8,9,9,9,8,9,9,9,6,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,7,7,9,5,9,9,6,5,9,0,4,9,9,9,9,9,8,9,9,9,7,9,9,9,9,9,9,9,9,9,8,9,8,8,9,8,9,9,9,5,9,8,),
(11,8,11,11,10,11,9,11,6,10,11,8,11,10,9,11,9,10,11,11,10,11,8,11,10,10,9,11,11,10,8,11,10,11,11,11,11,11,11,11,9,10,11,11,11,11,11,11,11,11,11,5,11,8,9,9,6,10,11,8,7,11,0,6,11,11,11,11,11,10,11,11,11,8,11,11,11,11,11,11,11,11,11,10,11,10,10,8,10,10,11,11,7,11,9,),
(10,8,10,10,9,10,8,10,5,9,10,7,10,9,7,10,8,9,9,10,9,10,7,10,9,9,8,10,10,9,7,10,9,10,10,10,10,10,10,10,8,9,10,10,10,10,10,10,10,10,9,4,10,7,8,7,5,9,10,7,6,10,2,5,10,10,10,10,10,9,10,10,10,8,10,10,10,10,10,10,10,10,10,9,10,9,9,8,9,9,10,10,6,10,9,),
(10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,7,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,4,10,8,9,10,7,10,10,8,10,10,10,5,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,),
(7,7,5,7,7,6,7,7,3,7,2,2,2,4,2,7,4,2,2,5,6,7,1,7,7,7,6,2,4,7,0,6,3,7,7,7,7,7,7,7,5,2,7,7,7,7,7,7,7,7,7,1,7,5,6,3,4,2,7,5,3,5,0,2,6,7,5,5,5,7,5,7,7,6,7,7,7,7,5,7,5,7,6,7,7,7,7,7,7,7,3,7,3,2,7,),
(10,8,10,10,9,10,8,10,6,9,5,8,5,10,8,10,9,10,10,9,10,10,8,10,9,10,8,8,10,10,7,10,9,10,10,10,10,10,10,10,9,10,10,10,10,10,10,10,10,10,10,4,10,7,7,8,5,10,10,7,6,8,0,5,10,10,10,10,10,9,10,10,10,8,10,10,10,10,10,10,10,10,10,9,10,8,9,8,8,9,9,10,6,10,9,),
(7,7,5,7,7,6,7,7,3,7,3,6,3,7,6,7,7,7,7,5,7,7,6,7,7,7,6,3,3,7,4,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,3,7,5,6,7,4,7,7,5,3,5,0,2,6,7,5,6,5,7,6,7,7,6,7,7,7,7,5,7,6,7,7,7,7,7,7,7,7,7,3,7,3,3,7,),
(9,9,9,9,9,9,9,9,5,9,9,8,9,9,8,9,9,9,9,9,9,9,8,9,9,9,8,9,9,9,6,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,7,8,9,6,9,9,7,5,9,0,4,9,9,9,9,9,9,9,9,9,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,9,9,),
(12,12,10,12,12,11,12,11,8,11,10,7,10,9,7,12,9,8,8,10,11,11,6,12,12,12,11,10,11,12,7,11,8,12,12,12,12,12,12,12,10,8,12,12,12,12,12,12,12,12,12,6,12,10,11,8,9,8,12,10,8,11,0,7,10,12,11,10,10,12,10,12,12,11,12,12,12,12,11,12,10,12,11,12,12,12,12,12,12,12,10,12,8,10,12,),
(18,18,16,18,18,17,18,18,14,18,17,14,17,15,14,18,15,15,15,17,17,18,14,18,18,18,17,17,17,18,14,17,15,18,18,18,18,18,18,18,16,15,18,18,18,18,18,18,18,18,18,12,18,16,17,15,15,15,18,16,14,17,5,13,17,18,17,17,17,18,17,18,18,17,18,18,18,18,17,18,17,18,17,18,18,18,18,18,18,18,17,18,14,17,18,),
(12,12,10,12,12,11,12,11,8,11,9,11,9,12,11,12,12,12,11,9,11,11,11,12,12,12,11,8,10,12,9,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,6,12,10,11,12,9,12,12,10,8,10,0,7,10,12,9,10,9,12,10,12,12,11,12,12,12,12,9,12,10,12,11,12,12,12,12,12,12,12,8,12,8,8,12,),
(12,12,10,12,12,11,12,11,8,11,10,7,10,9,7,12,9,8,8,10,11,11,6,12,12,12,11,10,11,12,7,11,8,12,12,12,12,12,12,12,10,8,12,12,12,12,12,12,12,12,12,6,12,10,11,8,9,8,12,10,8,11,6,7,10,12,11,10,10,12,10,12,12,11,12,12,12,12,11,12,10,12,11,12,12,12,12,12,12,12,10,12,8,10,12,),
(9,9,7,9,9,8,9,9,5,9,7,8,7,9,8,9,9,9,9,7,9,9,8,9,9,9,8,6,8,9,6,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,7,8,9,6,9,9,7,5,8,0,4,8,9,8,8,7,9,8,9,9,8,9,9,9,9,8,9,8,9,9,9,9,9,9,9,9,9,6,9,5,7,9,),
(10,10,5,6,8,7,10,7,10,7,5,10,5,7,10,7,7,8,8,5,9,6,10,7,7,7,10,4,6,6,9,6,6,10,6,10,10,10,6,10,10,8,10,10,10,10,6,10,6,10,7,10,10,10,10,10,10,10,10,10,10,6,10,10,6,10,6,6,6,8,9,10,10,10,10,10,6,6,6,10,6,6,6,6,6,6,6,6,7,6,5,10,10,5,8,),
(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,),
(10,6,10,8,6,10,8,10,5,6,10,5,10,7,7,10,7,6,6,10,6,10,6,10,7,7,5,10,8,6,7,10,8,10,10,10,10,10,10,10,8,6,10,10,10,10,10,10,10,10,6,6,10,7,7,6,5,7,10,7,6,7,6,5,9,10,10,10,10,9,10,10,10,6,10,10,10,10,10,10,10,10,9,9,10,8,9,6,8,7,10,10,5,10,6,),
(13,7,12,13,13,12,11,13,8,13,13,8,13,10,9,13,10,8,9,13,12,13,8,12,13,13,12,12,13,10,9,13,10,13,13,13,13,13,13,13,11,7,13,13,13,13,13,13,13,13,12,7,13,11,11,8,9,9,13,10,9,13,0,8,12,13,13,13,13,12,13,13,13,9,13,13,13,13,13,13,13,13,13,12,13,12,12,11,12,9,12,13,9,12,12,),
(9,9,7,9,9,8,9,9,6,9,3,4,2,6,4,9,9,9,9,7,8,9,8,9,9,9,8,4,8,9,9,8,5,9,9,9,9,9,9,9,8,6,9,9,9,9,9,9,9,9,9,8,9,8,8,7,8,8,9,8,7,7,0,6,8,9,7,7,7,9,7,9,9,8,9,9,9,9,7,9,7,9,8,9,9,9,9,9,9,9,5,9,7,6,9,),
)
# End of font
| 34.704698 | 292 | 0.417424 | 16,092 | 93,078 | 2.414057 | 0.016157 | 0.237444 | 0.307051 | 0.362036 | 0.823255 | 0.765078 | 0.722424 | 0.689577 | 0.658815 | 0.623883 | 0 | 0.462251 | 0.401749 | 93,078 | 2,681 | 293 | 34.717643 | 0.235346 | 0.309407 | 0 | 0.871878 | 1 | 0 | 0.000162 | 0 | 0 | 0 | 0.265627 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
270e798e603f7e84a2849d640d46003db11cbd8d | 120 | py | Python | MultiDet/model/__init__.py | ydlstartx/MultiDet | 82c62222f2bb9daeb1e07dc984b1e6b7b8d89a51 | [
"MIT"
] | null | null | null | MultiDet/model/__init__.py | ydlstartx/MultiDet | 82c62222f2bb9daeb1e07dc984b1e6b7b8d89a51 | [
"MIT"
] | null | null | null | MultiDet/model/__init__.py | ydlstartx/MultiDet | 82c62222f2bb9daeb1e07dc984b1e6b7b8d89a51 | [
"MIT"
] | null | null | null | from . import box
from .box import *
from . import basenet
from .basenet import *
from . import ssd
from .ssd import * | 15 | 22 | 0.716667 | 18 | 120 | 4.777778 | 0.277778 | 0.348837 | 0.372093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 120 | 8 | 23 | 15 | 0.905263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
2719f91d9265305bc0d3c77fa47c75795157b054 | 49 | py | Python | yama_util/temp2.py | yamato-kaeng/yama_util | 2fa31edf7ba501fc2e01f58511c185c8850d58f5 | [
"MIT"
] | null | null | null | yama_util/temp2.py | yamato-kaeng/yama_util | 2fa31edf7ba501fc2e01f58511c185c8850d58f5 | [
"MIT"
] | null | null | null | yama_util/temp2.py | yamato-kaeng/yama_util | 2fa31edf7ba501fc2e01f58511c185c8850d58f5 | [
"MIT"
] | null | null | null | def yama2():
return 'Hello Yama Util ๒๒๒๒๒๒๒' | 24.5 | 36 | 0.693878 | 7 | 49 | 4.857143 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.205128 | 0.204082 | 49 | 2 | 36 | 24.5 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0.46 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0.5 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 7 |
7e0ccd816a2381d18664b45a28a526ea7f53ff91 | 194 | py | Python | src/db_commands/__init__.py | jmaenpaa/db2_helpers | ebcaf2daa563c3bf76c31dffb9ded529c386fdde | [
"MIT"
] | 1 | 2021-04-21T07:29:37.000Z | 2021-04-21T07:29:37.000Z | src/db_commands/__init__.py | jmaenpaa/db2_helpers | ebcaf2daa563c3bf76c31dffb9ded529c386fdde | [
"MIT"
] | null | null | null | src/db_commands/__init__.py | jmaenpaa/db2_helpers | ebcaf2daa563c3bf76c31dffb9ded529c386fdde | [
"MIT"
] | null | null | null | # Copyright (c) 2020. db2solutions LLC
from db_commands.db_import_export import db_export
from db_commands.db_import_export import db_import
from db_commands.db_commands import db_credentials
| 32.333333 | 50 | 0.860825 | 31 | 194 | 5.032258 | 0.354839 | 0.25641 | 0.269231 | 0.307692 | 0.461538 | 0.461538 | 0.461538 | 0.461538 | 0 | 0 | 0 | 0.028736 | 0.103093 | 194 | 5 | 51 | 38.8 | 0.867816 | 0.185567 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
fdfd6b9fac2173f220a49f0b3bbd73c7c29615ac | 231 | py | Python | src/xapitrader/core/data/transaction/__init__.py | SarithT/xapitrader | 0018bc37d9756a10c328def90d042ef39857cfb5 | [
"MIT"
] | null | null | null | src/xapitrader/core/data/transaction/__init__.py | SarithT/xapitrader | 0018bc37d9756a10c328def90d042ef39857cfb5 | [
"MIT"
] | null | null | null | src/xapitrader/core/data/transaction/__init__.py | SarithT/xapitrader | 0018bc37d9756a10c328def90d042ef39857cfb5 | [
"MIT"
] | null | null | null | from xapitrader.core.data.transaction.TradingGuard import TradingGuard
from xapitrader.core.data.transaction.SimulatingTradingGuard import SimulatingTradingGuard
from xapitrader.core.data.transaction.Transaction import Transaction
| 57.75 | 90 | 0.896104 | 24 | 231 | 8.625 | 0.333333 | 0.202899 | 0.26087 | 0.318841 | 0.478261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051948 | 231 | 3 | 91 | 77 | 0.945205 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 8 |
8b5d14871176fbaf7c6f000239995d77458ddf48 | 39,505 | py | Python | msgraph/cli/command_modules/sites/azext_sites/generated/action.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/sites/azext_sites/generated/action.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/sites/azext_sites/generated/action.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=protected-access
# pylint: disable=no-self-use
import argparse
from collections import defaultdict
from knack.util import CLIError
class AddSharepointIds(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.sharepoint_ids = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'list-id':
d['list_id'] = v[0]
elif kl == 'list-item-id':
d['list_item_id'] = v[0]
elif kl == 'list-item-unique-id':
d['list_item_unique_id'] = v[0]
elif kl == 'site-id':
d['site_id'] = v[0]
elif kl == 'site-url':
d['site_url'] = v[0]
elif kl == 'tenant-id':
d['tenant_id'] = v[0]
elif kl == 'web-id':
d['web_id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter sharepoint-ids. All possible keys are: list-id,'
' list-item-id, list-item-unique-id, site-id, site-url, tenant-id, web-id'.format(k)
)
return d
class AddApplication(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.application = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'display-name':
d['display_name'] = v[0]
elif kl == 'id':
d['id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter application. All possible keys are: display-name, id'
.format(k)
)
return d
class AddResources(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddResources, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'content':
d['content'] = v[0]
elif kl == 'content-url':
d['content_url'] = v[0]
elif kl == 'self':
d['self_property'] = v[0]
elif kl == 'id':
d['id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter resources. All possible keys are: content,'
' content-url, self, id'.format(k)
)
return d
class AddDetails(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddDetails, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'code':
d['code'] = v[0]
elif kl == 'message':
d['message'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter details. All possible keys are: code, message, target'
.format(k)
)
return d
class AddInnerError(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.inner_error = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'code':
d['code'] = v[0]
elif kl == 'details':
d['details'] = v
elif kl == 'message':
d['message'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter inner-error. All possible keys are: code, details,'
' message, target'.format(k)
)
return d
class AddCalculated(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.calculated = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'format':
d['format'] = v[0]
elif kl == 'formula':
d['formula'] = v[0]
elif kl == 'output-type':
d['output_type'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter calculated. All possible keys are: format, formula,'
' output-type'.format(k)
)
return d
class AddChoice(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.choice = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'allow-text-entry':
d['allow_text_entry'] = v[0]
elif kl == 'choices':
d['choices'] = v
elif kl == 'display-as':
d['display_as'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter choice. All possible keys are: allow-text-entry,'
' choices, display-as'.format(k)
)
return d
class AddDateTime(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.date_time = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'display-as':
d['display_as'] = v[0]
elif kl == 'format':
d['format'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter date-time. All possible keys are: display-as, format'
.format(k)
)
return d
class AddDefaultValue(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.default_value = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'formula':
d['formula'] = v[0]
elif kl == 'value':
d['value'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter default-value. All possible keys are: formula, value'
.format(k)
)
return d
class AddLookup(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.lookup = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'allow-multiple-values':
d['allow_multiple_values'] = v[0]
elif kl == 'allow-unlimited-length':
d['allow_unlimited_length'] = v[0]
elif kl == 'column-name':
d['column_name'] = v[0]
elif kl == 'list-id':
d['list_id'] = v[0]
elif kl == 'primary-lookup-column-id':
d['primary_lookup_column_id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter lookup. All possible keys are: allow-multiple-values,'
' allow-unlimited-length, column-name, list-id, primary-lookup-column-id'.format(k)
)
return d
class AddNumber(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.number = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'decimal-places':
d['decimal_places'] = v[0]
elif kl == 'display-as':
d['display_as'] = v[0]
elif kl == 'maximum':
d['maximum'] = v[0]
elif kl == 'minimum':
d['minimum'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter number. All possible keys are: decimal-places,'
' display-as, maximum, minimum'.format(k)
)
return d
class AddPersonOrGroup(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.person_or_group = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'allow-multiple-selection':
d['allow_multiple_selection'] = v[0]
elif kl == 'choose-from-type':
d['choose_from_type'] = v[0]
elif kl == 'display-as':
d['display_as'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter person-or-group. All possible keys are:'
' allow-multiple-selection, choose-from-type, display-as'.format(k)
)
return d
class AddText(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.text = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'allow-multiple-lines':
d['allow_multiple_lines'] = v[0]
elif kl == 'append-changes-to-existing-text':
d['append_changes_to_existing_text'] = v[0]
elif kl == 'lines-for-editing':
d['lines_for_editing'] = v[0]
elif kl == 'max-length':
d['max_length'] = v[0]
elif kl == 'text-type':
d['text_type'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter text. All possible keys are: allow-multiple-lines,'
' append-changes-to-existing-text, lines-for-editing, max-length, text-type'.format(k)
)
return d
class AddOrder(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.order = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'default':
d['default'] = v[0]
elif kl == 'position':
d['position'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter order. All possible keys are: default, position'
.format(k)
)
return d
class AddColumnLinks(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddColumnLinks, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'name':
d['name'] = v[0]
elif kl == 'id':
d['id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter column-links. All possible keys are: name, id'.format(
k
)
)
return d
class AddStoragePlanInformation(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.storage_plan_information = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'upgrade-available':
d['upgrade_available'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter storage-plan-information. All possible keys are:'
' upgrade-available'.format(k)
)
return d
class AddList(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.list = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'content-types-enabled':
d['content_types_enabled'] = v[0]
elif kl == 'hidden':
d['hidden'] = v[0]
elif kl == 'template':
d['template'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter list. All possible keys are: content-types-enabled,'
' hidden, template'.format(k)
)
return d
class AddSubscriptions(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSubscriptions, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'application-id':
d['application_id'] = v[0]
elif kl == 'change-type':
d['change_type'] = v[0]
elif kl == 'client-state':
d['client_state'] = v[0]
elif kl == 'creator-id':
d['creator_id'] = v[0]
elif kl == 'encryption-certificate':
d['encryption_certificate'] = v[0]
elif kl == 'encryption-certificate-id':
d['encryption_certificate_id'] = v[0]
elif kl == 'expiration-date-time':
d['expiration_date_time'] = v[0]
elif kl == 'include-resource-data':
d['include_resource_data'] = v[0]
elif kl == 'latest-supported-tls-version':
d['latest_supported_tls_version'] = v[0]
elif kl == 'lifecycle-notification-url':
d['lifecycle_notification_url'] = v[0]
elif kl == 'notification-url':
d['notification_url'] = v[0]
elif kl == 'resource':
d['resource'] = v[0]
elif kl == 'id':
d['id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter subscriptions. All possible keys are: application-id,'
' change-type, client-state, creator-id, encryption-certificate, encryption-certificate-id,'
' expiration-date-time, include-resource-data, latest-supported-tls-version,'
' lifecycle-notification-url, notification-url, resource, id'.format(k)
)
return d
class AddContentType(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.content_type_ = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'id':
d['id'] = v[0]
elif kl == 'name':
d['name'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter content-type-. All possible keys are: id, name'
.format(k)
)
return d
class AddVersions(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddVersions, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'id-fields-id':
sub_d = d
if 'fields' not in sub_d:
sub_d['fields'] = {}
sub_d = sub_d['fields']
sub_d['id'] = v[0]
elif kl == 'last-modified-date-time':
d['last_modified_date_time'] = v[0]
elif kl == 'publication':
d['publication'] = v[0]
elif kl == 'application':
sub_d = d
if 'last_modified_by' not in sub_d:
sub_d['last_modified_by'] = {}
sub_d = sub_d['last_modified_by']
sub_d['application'] = v[0]
elif kl == 'device':
sub_d = d
if 'last_modified_by' not in sub_d:
sub_d['last_modified_by'] = {}
sub_d = sub_d['last_modified_by']
sub_d['device'] = v[0]
elif kl == 'user':
sub_d = d
if 'last_modified_by' not in sub_d:
sub_d['last_modified_by'] = {}
sub_d = sub_d['last_modified_by']
sub_d['user'] = v[0]
elif kl == 'id':
d['id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter versions. All possible keys are: id-fields-id,'
' last-modified-date-time, publication, application, device, user, id'.format(k)
)
return d
class AddPublication(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
namespace.publication = action
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'level':
d['level'] = v[0]
elif kl == 'version-id':
d['version_id'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter publication. All possible keys are: level, version-id'
.format(k)
)
return d
class AddSitesOnenoteNotebooksSectiongroupsSectionsPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenoteNotebooksSectiongroupsSectionsPagesCommands, self).__call__(
parser, namespace, action, option_string
)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenoteNotebooksSectionsPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenoteNotebooksSectionsPagesCommands, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenotePagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenotePagesCommands, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenotePagesParentnotebookSectiongroupsSectionsPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenotePagesParentnotebookSectiongroupsSectionsPagesCommands, self).__call__(
parser, namespace, action, option_string
)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenotePagesParentnotebookSectionsPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenotePagesParentnotebookSectionsPagesCommands, self).__call__(
parser, namespace, action, option_string
)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenotePagesParentsectionPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenotePagesParentsectionPagesCommands, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenoteSectiongroupsParentnotebookSectionsPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenoteSectiongroupsParentnotebookSectionsPagesCommands, self).__call__(
parser, namespace, action, option_string
)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddSitesOnenoteSectiongroupsSectionsPagesCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddSitesOnenoteSectiongroupsSectionsPagesCommands, self).__call__(
parser, namespace, action, option_string
)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
class AddCommands(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(AddCommands, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string):
try:
properties = defaultdict(list)
for (k, v) in (x.split('=', 1) for x in values):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
if kl == 'action':
d['action'] = v[0]
elif kl == 'content':
d['content'] = v[0]
elif kl == 'position':
d['position'] = v[0]
elif kl == 'target':
d['target'] = v[0]
else:
raise CLIError(
'Unsupported Key {} is provided for parameter commands. All possible keys are: action, content,'
' position, target'.format(k)
)
return d
| 32.702815 | 120 | 0.51715 | 4,141 | 39,505 | 4.811881 | 0.052644 | 0.080699 | 0.081301 | 0.033323 | 0.80533 | 0.77843 | 0.753488 | 0.742046 | 0.738834 | 0.737579 | 0 | 0.005698 | 0.364688 | 39,505 | 1,207 | 121 | 32.729909 | 0.78823 | 0.012657 | 0 | 0.722343 | 0 | 0.005423 | 0.179853 | 0.024158 | 0 | 0 | 0 | 0 | 0 | 1 | 0.065076 | false | 0 | 0.003254 | 0 | 0.133406 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
4776beb428ae256f0ee7ec443c65d48d51f63b0e | 4,330 | py | Python | asnets/experiments/det_sokoban.py | xf1590281/ASNets | 5f4b29fb62a5e72004b813228442d06246c9ec33 | [
"MIT"
] | 21 | 2017-12-05T13:27:36.000Z | 2021-11-16T20:32:33.000Z | asnets/experiments/det_sokoban.py | xf1590281/ASNets | 5f4b29fb62a5e72004b813228442d06246c9ec33 | [
"MIT"
] | 2 | 2018-07-16T12:15:46.000Z | 2020-10-31T00:02:49.000Z | asnets/experiments/det_sokoban.py | xf1590281/ASNets | 5f4b29fb62a5e72004b813228442d06246c9ec33 | [
"MIT"
] | 7 | 2018-03-19T13:45:13.000Z | 2022-03-24T07:52:20.000Z | """For experiments on sokoban from IPC'08 learning track."""
PDDL_DIR = '../problems/ipc08-learn/sokoban/'
COMMON_PDDLS = ['learning/sokoban-typed.pddl']
TRAIN_PDDLS = [
# 'learning/bootstrap/typed/bootstrap-typed-01.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-02.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-03.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-04.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-05.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-06.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-07.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-08.pddl',
'learning/bootstrap/typed/bootstrap-typed-09.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-10.pddl',
'learning/bootstrap/typed/bootstrap-typed-11.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-12.pddl',
'learning/bootstrap/typed/bootstrap-typed-13.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-14.pddl',
'learning/bootstrap/typed/bootstrap-typed-15.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-16.pddl',
'learning/bootstrap/typed/bootstrap-typed-17.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-18.pddl',
'learning/bootstrap/typed/bootstrap-typed-19.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-20.pddl',
'learning/bootstrap/typed/bootstrap-typed-21.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-22.pddl',
'learning/bootstrap/typed/bootstrap-typed-23.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-24.pddl',
'learning/bootstrap/typed/bootstrap-typed-25.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-26.pddl',
'learning/bootstrap/typed/bootstrap-typed-27.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-28.pddl',
'learning/bootstrap/typed/bootstrap-typed-29.pddl',
# 'learning/bootstrap/typed/bootstrap-typed-30.pddl',
] # yapf: disable
TRAIN_NAMES = None
TEST_RUNS = [
(['testing/target/typed/sokoban-target-n09-b03-w04-01-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-02-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-03-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-04-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-05-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-06-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-07-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-08-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-09-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b03-w04-10-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-01-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-02-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-03-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-04-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-05-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-06-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-07-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-08-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-09-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-10-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-11-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-12-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-13-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-14-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-15-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-16-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-17-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-18-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-19-typed.pddl'], None),
(['testing/target/typed/sokoban-target-n09-b04-w04-20-typed.pddl'], None),
] # yapf: disable
| 61.857143 | 78 | 0.711547 | 602 | 4,330 | 5.109635 | 0.099668 | 0.273082 | 0.214564 | 0.302341 | 0.914499 | 0.902796 | 0.525683 | 0.525683 | 0.513654 | 0.513654 | 0 | 0.077021 | 0.088453 | 4,330 | 69 | 79 | 62.753623 | 0.702306 | 0.247344 | 0 | 0 | 0 | 0.625 | 0.747603 | 0.747603 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
47a32ff7c1bb5d75c7bf80a3e8ad901cd873d3d5 | 10,932 | py | Python | tests/test_exceptions.py | cloudblue/connect-reports-runner | 8a23752d4067a45ce48a943792a63e4c7cafcb5a | [
"Apache-2.0"
] | null | null | null | tests/test_exceptions.py | cloudblue/connect-reports-runner | 8a23752d4067a45ce48a943792a63e4c7cafcb5a | [
"Apache-2.0"
] | null | null | null | tests/test_exceptions.py | cloudblue/connect-reports-runner | 8a23752d4067a45ce48a943792a63e4c7cafcb5a | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from connect.client import ClientError, ConnectClient
from requests import Request, RequestException
from executor.exception_handler import (
handle_exception,
handle_post_execution_exception,
handle_preparation_exception,
)
def test_post_execution_error(
mocked_env,
mocked_responses,
):
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='POST',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000/fail',
json={},
)
exception = ClientError(
message="weird error uploading",
status_code=500,
error_code=500,
)
with pytest.raises(ClientError) as e:
handle_post_execution_exception(exception, client)
assert 'weird error uploading' in str(e.value)
def test_handle_preparation_exception_getting_report(
mocked_env,
mocked_responses,
):
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='POST',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000/fail',
json={},
)
exception = ClientError(
message="weird error uploading",
status_code=500,
error_code=500,
)
with pytest.raises(ClientError) as e:
handle_preparation_exception(exception, client)
assert 'weird error uploading' in str(e.value)
@pytest.mark.parametrize("ex_type", [ValueError, AttributeError, ImportError, ModuleNotFoundError])
def test_handle_report_execution_value_error(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
ex_type,
):
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ex_type("Some Value Error")
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ex_type) as e:
handle_exception(exception, client)
assert isinstance(e.value, ex_type)
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
'Report execution failed with error: Some Value Error',
True,
)
def test_handle_report_execution_409_outside_connect_block(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
):
mocked_report_response_v1['template']['type'] = 'custom'
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ClientError(
status_code=409,
error_code=409,
message="Test",
errors=[
"error 1",
"error 2",
],
)
request_exception = RequestException(
request=Request(
method='GET',
url='https://www.google.com',
),
)
exception.__cause__ = request_exception
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ClientError):
handle_exception(exception, client)
# Change False to True in case that firewall reenabled as per LITE-16960
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
'409 - Conflict: unexpected error: Test',
False,
)
def test_handle_report_execution_409_connect_no_block(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
):
mocked_report_response_v1['template']['type'] = 'custom'
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ClientError(
status_code=409,
error_code=409,
message="Test",
errors=[
"error 1",
"error 2",
],
)
request_exception = RequestException(
request=Request(
method='GET',
url='https://localhost/public/v1',
),
)
exception.__cause__ = request_exception
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ClientError):
handle_exception(exception, client)
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
'409 - Conflict: unexpected error: Test',
False,
)
@pytest.mark.parametrize("report_type", ["custom", "system"])
def test_handle_report_execution_500_connect_no_block(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
report_type,
):
mocked_report_response_v1['template']['type'] = report_type
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ClientError(
status_code=500,
error_code=500,
message="Internal error",
errors=[
"error 1",
"error 2",
],
)
request_exception = RequestException(
request=Request(
method='GET',
url='https://localhost/public/v1',
),
)
exception.__cause__ = request_exception
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ClientError):
handle_exception(exception, client)
error = "500 - Internal Server Error: unexpected error: Internal error"
if report_type == 'system':
error = error + ". Please contact support."
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
error,
False,
)
@pytest.mark.parametrize("report_type", ["custom", "system"])
def test_handle_report_execution_500(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
report_type,
):
mocked_report_response_v1['template']['type'] = report_type
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ClientError(
status_code=500,
error_code=500,
message="Internal error",
errors=[
"error 1",
"error 2",
],
)
request_exception = RequestException(
request=Request(
method='GET',
url='https://localhost/public/v1',
),
)
exception.__cause__ = request_exception
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ClientError):
handle_exception(exception, client)
error = "500 - Internal Server Error: unexpected error: Internal error"
if report_type == 'system':
error = error + ". Please contact support."
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
error,
False,
)
@pytest.mark.parametrize("report_type", ["custom", "system"])
def test_handle_report_execution_401(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
report_type,
):
mocked_report_response_v1['template']['type'] = report_type
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ClientError(
status_code=401,
error_code=401,
message="Internal error",
errors=[
"error 1",
"error 2",
],
)
request_exception = RequestException(
request=Request(
method='GET',
url='https://localhost/public/v1',
),
)
exception.__cause__ = request_exception
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ClientError):
handle_exception(exception, client)
error = "401 - Unauthorized: report tried to access objects not accessible by your account"
if report_type == 'system':
error = error + ". Please contact support."
block = True if report_type == 'custom' else False
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
error,
block,
)
@pytest.mark.parametrize("report_type", ["custom", "system"])
def test_handle_report_execution_400(
mocker,
mocked_env,
mocked_responses,
mocked_report_response_v1,
report_type,
):
mocked_report_response_v1['template']['type'] = report_type
client = ConnectClient(
use_specs=False,
api_key=os.getenv('CLIENT_TOKEN'),
endpoint=os.getenv('API_ENDPOINT'),
)
mocked_responses.add(
method='GET',
url='https://localhost/public/v1/reporting/reports/REC-000-000-0000-000000',
json=mocked_report_response_v1,
)
exception = ClientError(
status_code=400,
error_code=400,
message="Internal error",
errors=[
"error 1",
"error 2",
],
)
request_exception = RequestException(
request=Request(
method='GET',
url='https://localhost/public/v1',
),
)
exception.__cause__ = request_exception
upload = mocker.patch(
'executor.exception_handler.fail_report',
)
with pytest.raises(ClientError):
handle_exception(exception, client)
error = "400 - Bad Request: 400 - error 1,error 2"
if report_type == 'system':
error = error + ". Please contact support."
upload.assert_called_with(
client,
'REC-000-000-0000-000000',
error,
False,
)
| 26.090692 | 99 | 0.625778 | 1,169 | 10,932 | 5.603935 | 0.106929 | 0.036636 | 0.061059 | 0.067165 | 0.879408 | 0.875134 | 0.865669 | 0.865669 | 0.865669 | 0.850405 | 0 | 0.049186 | 0.263538 | 10,932 | 418 | 100 | 26.15311 | 0.764501 | 0.006403 | 0 | 0.777778 | 0 | 0.02439 | 0.221915 | 0.039319 | 0 | 0 | 0 | 0 | 0.0271 | 1 | 0.02439 | false | 0 | 0.01626 | 0 | 0.04065 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
9a5f947ec50c29c8773507a00ebf8f1a4207060c | 15,299 | py | Python | testcases.py | abelyang999/smtp | fcdbafd506256686a351fa3017bf01fbf59b4e42 | [
"MIT"
] | null | null | null | testcases.py | abelyang999/smtp | fcdbafd506256686a351fa3017bf01fbf59b4e42 | [
"MIT"
] | 3 | 2020-10-27T22:16:51.000Z | 2022-03-21T22:18:14.000Z | testcases.py | abelyang999/smtp | fcdbafd506256686a351fa3017bf01fbf59b4e42 | [
"MIT"
] | null | null | null | from common.common import *
test_cases = {
"case_00": {
"case_name":b"Normail mail, everything should be OK\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_a4": { # An example of DKIM authentication injection attack
"case_name":b"DKIM authentication injection attack\r\n",
"helo": b"attack.com",
"mailfrom": b"<any@attack.com>",
"rcptto": b"<victim@victim.com>",
"dkim_para": {"d":b"legitimate.com'a.attack.com", "s":b"selector", "sign_header": b"From: <security@legitimate.com>"},
"data": {
"from_header": b"From: <security@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_a7": { # A example of SPF authentication results injection attack
"case_name":b"SPF authentication results injection attack\r\n",
"helo": b"attack.com",
"mailfrom": b"<@legitimate.com,@any.com:'any@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <security@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: SPF authentication results injection attack\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_6e": {
"case_name":b"Exploiting normalization behavior with multiple email addresses.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>,\r\n\t<any2@attack.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"Sender: <admin-sender@legitimate.com>\r\n",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_6a": {
"case_name":b"Preference of multiple From headers\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>\r\nFrom: <admin@@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_6b": {
"case_name":b"Inconsistent interpretation in folding-space-succeeded From header.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From\n :<any@attack.com>\r\nFrom: <admin@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_6c": {
"case_name":b"Exploiting normalization behavior with space-succeeded From header.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <admin@attack.com>\r\nFrom :<admin@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_6d": {
"case_name":b"Interpreting Sender header as From alternative header.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From\r\n :<any@attack.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"Sender: <admin@legitimate.com>\r\n",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_6f": {
"case_name":b"Combine multiple techniques to bypass Gmail validation.\r\n",
"helo": b"attack.com",
"mailfrom": b"<>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>\r\nResent-From: <admin@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_1a": {
"case_name":b"From with double address + Sender + Resent-From\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>\r\n\t<any2@attack.com>\r\nResent-From: <admin-resent@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"Sender: <admin-sender@legitimate.com>\r\n",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_1b": {
"case_name":b"From address with comment + Sender \r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any(comment@attack.com>)@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"Sender: <sender@legitimate.com>\r\n",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_1c": {
"case_name":b"From address with comment + Sender \r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any(comment@attack.com>)@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"Sender: <admin-sender@legitimate.com\r\n",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_1d": {
"case_name":b"Display name in From with comment\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: \"display(@abc.com)\" <any@attack.com>\r\n",
"to_header": b"To: <victim@victim.com(comment)>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_1e": {
"case_name": b"Unbalance from address angle bracket\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_8a": {
"case_name": b"Preference of multiple email addresses.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>,<admin@legitimate.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_8b": {
"case_name": b"Differences in parsing Base64-encoded address.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: =?UTF-8?B?dGVzdA=?= ( <admin@legitimate.com> ), <any@attack.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_8d": {
"case_name": b"Differences in supporting quoted-pair feature.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <admin@legitimate.com>\, <any@attack.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_8e": {
"case_name": b"Inconsistencies in recognizing special character precedence.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: admin@legitimate.com, <any@attack.com>\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
"case_8f": {
"case_name": b"Display name and real address parsing ambiguity.\r\n",
"helo": b"attack.com",
"mailfrom": b"<test@attack.com>",
"rcptto": b"<victim@victim.com>",
"data": {
"from_header": b"From: <any@attack.com>admin@legitimate.com\r\n",
"to_header": b"To: <victim@victim.com>\r\n",
"subject_header": b"Subject: fake subject here\r\n",
"body": b"Hi, fake body here.\r\n",
"custom": b"",
"other_headers": b"Date: " + get_date() + b"\r\n" + b'Content-Type: text/plain; charset="UTF-8"\r\nMIME-Version: 1.0\r\nMessage-ID: <1538085644648.096e3d4e-bc38-4027-b57e-' + id_generator() + b'@message-ids.attack.com>\r\nlast:value\r\n\r\n',
}
},
}
| 54.060071 | 254 | 0.562717 | 2,220 | 15,299 | 3.808108 | 0.066667 | 0.037852 | 0.026023 | 0.015732 | 0.919092 | 0.900402 | 0.887864 | 0.870002 | 0.862669 | 0.862669 | 0 | 0.048888 | 0.229884 | 15,299 | 282 | 255 | 54.251773 | 0.668647 | 0.006994 | 0 | 0.625926 | 0 | 0.166667 | 0.639057 | 0.237227 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.003704 | 0.003704 | 0 | 0.003704 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
d0069058ebc98d8a7d1221451b0575cbb0204a62 | 203 | py | Python | davidgoliath/project/modelling/06_pdfnumpy.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | davidgoliath/project/modelling/06_pdfnumpy.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | davidgoliath/project/modelling/06_pdfnumpy.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | # probability density function numpy
# https://www.google.com/search?q=probability+density+function+numpy&oq=Probability+density+function+numpy&aqs=chrome.0.0j0i22i30l7.2167j0j7&sourceid=chrome&ie=UTF-8
| 67.666667 | 165 | 0.827586 | 29 | 203 | 5.793103 | 0.689655 | 0.321429 | 0.464286 | 0.553571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076531 | 0.034483 | 203 | 2 | 166 | 101.5 | 0.780612 | 0.975369 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
d0392c6d0e01723e72aa45faf62d9da7023f4630 | 85,266 | py | Python | silo/benchmarks/results/istc3-9-8-13.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 274 | 2015-01-23T16:24:09.000Z | 2022-02-22T03:16:14.000Z | silo/benchmarks/results/istc3-9-8-13.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 3 | 2015-03-17T11:52:36.000Z | 2019-07-22T23:04:25.000Z | silo/benchmarks/results/istc3-9-8-13.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 94 | 2015-01-07T06:55:36.000Z | 2022-01-22T08:14:15.000Z | RESULTS = [({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 1, 'numa_memory': '42G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(598829.0, 598829.0, 0.00162352, 0.0, 0.0), (576272.0, 576272.0, 0.00168956, 0.0, 0.0), (596995.0, 596995.0, 0.00162922, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 1, 'numa_memory': '42G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(570013.0, 570013.0, 0.00170737, 0.0, 0.0), (576566.0, 576566.0, 0.00168789, 0.0, 0.0), (578566.0, 578566.0, 0.0016818, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 1, 'numa_memory': '42G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(575913.0, 575913.0, 0.00169019, 0.0, 0.0), (578635.0, 578635.0, 0.00168184, 0.0, 0.0), (574126.0, 574126.0, 0.00169477, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 4, 'numa_memory': '48G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(2438130.0, 2438130.0, 0.00159217, 0.0, 0.0), (2431590.0, 2431590.0, 0.00159665, 0.0, 0.0), (2426370.0, 2426370.0, 0.00160015, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 4, 'numa_memory': '48G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(2290490.0, 2290490.0, 0.00169747, 0.0, 0.0), (2291870.0, 2291870.0, 0.00169685, 0.0, 0.0), (2286970.0, 2286970.0, 0.00169992, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 4, 'numa_memory': '48G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(2294240.0, 2294240.0, 0.00169429, 0.0, 0.0), (2291370.0, 2291370.0, 0.00169699, 0.0, 0.0), (2294750.0, 2294750.0, 0.00169438, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 8, 'numa_memory': '56G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(4661400.0, 4661400.0, 0.00166712, 0.0, 0.0), (4687400.0, 4687400.0, 0.00165809, 0.0, 0.0), (4694850.0, 4694850.0, 0.00165542, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 8, 'numa_memory': '56G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(4386430.0, 4386430.0, 0.00177481, 0.0, 0.0), (4379040.0, 4379040.0, 0.00177779, 0.0, 0.0), (4372870.0, 4372870.0, 0.00178038, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 8, 'numa_memory': '56G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(4408000.0, 4408000.0, 0.00176533, 0.0, 0.0), (4391850.0, 4391850.0, 0.00177218, 0.0, 0.0), (4382660.0, 4382660.0, 0.00177663, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 12, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(6466410.0, 6466410.0, 0.00180709, 0.0, 0.0), (6450240.0, 6450240.0, 0.00181201, 0.0, 0.0), (6476090.0, 6476090.0, 0.00180464, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 12, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(5903190.0, 5903190.0, 0.00198429, 0.0, 0.0166665), (5904180.0, 5904180.0, 0.00198394, 0.0, 0.0166664), (5909890.0, 5909890.0, 0.00198205, 0.0, 0.0166666)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 12, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(6177300.0, 6177300.0, 0.00189372, 0.0, 0.0333327), (6174910.0, 6174910.0, 0.00189447, 0.0, 0.0), (6163160.0, 6163160.0, 0.00189852, 0.0, 0.0333331)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 16, 'numa_memory': '72G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(8401480.0, 8401480.0, 0.00185598, 0.0, 0.0), (8445120.0, 8445120.0, 0.00184608, 0.0, 0.0), (8428590.0, 8428590.0, 0.00184987, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 16, 'numa_memory': '72G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(7891700.0, 7891700.0, 0.00197831, 0.0, 0.0333331), (7920470.0, 7920470.0, 0.00197126, 0.0, 0.0), (7924250.0, 7924250.0, 0.00196993, 0.0, 0.0166666)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 16, 'numa_memory': '72G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(8007260.0, 8007260.0, 0.00194911, 0.0, 0.0), (8050990.0, 8050990.0, 0.0019384, 0.0, 0.0), (7996460.0, 7996460.0, 0.00195181, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(10393900.0, 10393900.0, 0.00187588, 0.0, 0.0), (10085100.0, 10085100.0, 0.00193509, 0.0, 0.0), (10440000.0, 10440000.0, 0.00186743, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(9557570.0, 9557570.0, 0.00204384, 0.0, 0.0499995), (9538900.0, 9538900.0, 0.00204754, 0.0, 0.0), (9573950.0, 9573950.0, 0.00204017, 0.0, 0.0499993)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(9952310.0, 9952310.0, 0.00196109, 0.0, 0.0333329), (9972960.0, 9972960.0, 0.00195628, 0.0, 0.0166665), (9985650.0, 9985650.0, 0.001954, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 24, 'numa_memory': '88G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(12298300.0, 12298300.0, 0.00190305, 0.0, 0.0), (12300300.0, 12300300.0, 0.00190267, 0.0, 0.0), (12312900.0, 12312900.0, 0.00190073, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 24, 'numa_memory': '88G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(10579900.0, 10579900.0, 0.0022179, 0.0, 0.0333329), (10544700.0, 10544700.0, 0.0022271, 0.0, 0.0499995), (10558600.0, 10558600.0, 0.00222414, 0.0, 0.033333)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 24, 'numa_memory': '88G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(11803200.0, 11803200.0, 0.00198391, 0.0, 0.0166662), (11789800.0, 11789800.0, 0.00198707, 0.0, 0.0833317), (11782000.0, 11782000.0, 0.00198799, 0.0, 0.0833323)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 28, 'numa_memory': '96G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(14403600.0, 14403600.0, 0.00189556, 0.0, 0.0), (14414900.0, 14414900.0, 0.00189406, 0.0, 0.0), (14447200.0, 14447200.0, 0.00188966, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 28, 'numa_memory': '96G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(9598150.0, 9598150.0, 0.00286876, 0.0, 0.0499992), (9492480.0, 9492480.0, 0.00290082, 0.0, 0.0), (9400670.0, 9400670.0, 0.00292828, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 28, 'numa_memory': '96G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(13783200.0, 13783200.0, 0.00198227, 0.0, 0.0), (13774500.0, 13774500.0, 0.00198424, 0.0, 0.0499994), (13753900.0, 13753900.0, 0.00198701, 0.0, 0.0499987)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'kvdb', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 32, 'numa_memory': '104G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(16055600.0, 16055600.0, 0.00194448, 0.0, 0.0), (16089100.0, 16089100.0, 0.00194021, 0.0, 0.0), (16085200.0, 16085200.0, 0.00194084, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto1', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 32, 'numa_memory': '104G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(8924990.0, 8924990.0, 0.00353644, 0.0, 0.0), (8876150.0, 8876150.0, 0.00355618, 0.0, 0.0), (8950210.0, 8950210.0, 0.00352647, 0.0, 0.066665)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 160000, 'name': 'scale_rmw', 'bench_opts': '--workload-mix 80,0,20,0', 'db': 'ndb-proto2', 'bench': 'ycsb', 'par_load': True, 'disable_gc': False, 'threads': 32, 'numa_memory': '104G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(15272000.0, 15272000.0, 0.00204642, 0.0, 0.0833321), (15297600.0, 15297600.0, 0.002041, 0.0, 0.0999969), (15355300.0, 15355300.0, 0.00203521, 0.0, 0.13333)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 1, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 1, 'numa_memory': '4G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(28617.3, 28617.3, 0.0348511, 84.0693, 0.0), (28797.6, 28797.6, 0.0346053, 85.089, 0.0), (28634.6, 28634.6, 0.0348112, 82.1759, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 1, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 1, 'numa_memory': '4G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(28599.0, 28599.0, 0.034848, 80.7266, 0.0), (29454.5, 29454.5, 0.0338453, 80.0298, 0.0), (29408.1, 29408.1, 0.0338889, 80.1761, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 1, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 1, 'numa_memory': '4G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(31471.4, 31471.4, 0.0316881, 0.0, 0.0), (30873.7, 30873.7, 0.0323058, 0.0, 0.0), (31358.4, 31358.4, 0.0318088, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 4, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 4, 'numa_memory': '16G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(102620.0, 102620.0, 0.0388521, 119.521, 4.29604), (102977.0, 102977.0, 0.0387193, 99.163, 4.03024), (102850.0, 102850.0, 0.0387698, 125.878, 4.11336)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 4, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 4, 'numa_memory': '16G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(103526.0, 103526.0, 0.0385128, 95.7767, 3.97995), (103273.0, 103273.0, 0.0385991, 94.4058, 4.1124), (101679.0, 101679.0, 0.039207, 93.914, 3.92921)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 4, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 4, 'numa_memory': '16G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(109121.0, 109121.0, 0.0365664, 0.0, 4.9333), (109623.0, 109623.0, 0.0363978, 0.0, 4.74996), (109268.0, 109268.0, 0.0365079, 0.0, 4.49996)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 8, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 8, 'numa_memory': '32G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(193124.0, 193124.0, 0.0410664, 138.851, 8.42909), (191079.0, 191079.0, 0.0417271, 125.539, 7.87475), (191261.0, 191261.0, 0.041699, 140.306, 8.30992)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 8, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 8, 'numa_memory': '32G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(196416.0, 196416.0, 0.0406024, 95.78, 7.51033), (194810.0, 194810.0, 0.0409333, 101.529, 7.94223), (195209.0, 195209.0, 0.0408526, 98.6565, 8.49267)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 8, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 8, 'numa_memory': '32G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(210821.0, 210821.0, 0.0378565, 0.0, 10.0332), (207514.0, 207514.0, 0.0384576, 0.0, 8.74985), (208789.0, 208789.0, 0.0382243, 0.0, 8.74991)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 12, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 12, 'numa_memory': '48G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(287716.0, 287716.0, 0.041558, 147.45, 11.1854), (284466.0, 284466.0, 0.0420381, 167.027, 11.4533), (284599.0, 284599.0, 0.0420073, 160.727, 12.0337)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 12, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 12, 'numa_memory': '48G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(294521.0, 294521.0, 0.040619, 104.533, 12.1073), (294360.0, 294360.0, 0.0406423, 95.7708, 12.1238), (293600.0, 293600.0, 0.04075, 96.6426, 11.259)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 12, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 12, 'numa_memory': '48G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(309782.0, 309782.0, 0.0386451, 0.0, 13.6312), (315285.0, 315285.0, 0.0379676, 0.0, 13.8332), (316796.0, 316796.0, 0.037787, 0.0, 13.4964)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 16, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(378445.0, 378445.0, 0.0421168, 197.735, 15.9599), (378523.0, 378523.0, 0.0421152, 243.092, 15.6954), (376749.0, 376749.0, 0.0423176, 146.844, 14.2827)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 16, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(384610.0, 384610.0, 0.0414841, 104.691, 15.2749), (383920.0, 383920.0, 0.0415515, 95.9765, 15.4567), (384704.0, 384704.0, 0.0414555, 105.822, 16.102)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 16, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(411151.0, 411151.0, 0.0388214, 0.0, 18.0664), (407373.0, 407373.0, 0.0391797, 0.0, 17.833), (405772.0, 405772.0, 0.0393358, 0.0, 16.6817)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 20, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(467720.0, 467720.0, 0.0425209, 285.225, 18.7369), (471138.0, 471138.0, 0.0423071, 180.023, 19.645), (470824.0, 470824.0, 0.0423446, 149.565, 18.4838)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 20, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(479899.0, 479899.0, 0.0415457, 108.423, 19.1495), (482061.0, 482061.0, 0.0413528, 107.488, 19.8966), (477598.0, 477598.0, 0.0417324, 106.076, 18.4774)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 20, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(518581.0, 518581.0, 0.0384662, 0.0, 23.7657), (521165.0, 521165.0, 0.0382815, 0.0, 22.2322), (520478.0, 520478.0, 0.0383316, 0.0, 21.9944)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 24, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 24, 'numa_memory': '96G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(560251.0, 560251.0, 0.042649, 347.523, 22.7845), (557037.0, 557037.0, 0.0429351, 226.496, 22.6055), (566398.0, 566398.0, 0.0422298, 259.593, 22.5577)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 24, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 24, 'numa_memory': '96G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(570554.0, 570554.0, 0.0419319, 109.373, 22.4786), (571235.0, 571235.0, 0.0418883, 109.831, 22.8149), (561708.0, 561708.0, 0.0425866, 109.558, 22.1268)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 24, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 24, 'numa_memory': '96G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(614054.0, 614054.0, 0.0389887, 0.0, 26.9214), (612463.0, 612463.0, 0.0390935, 0.0, 25.5662), (611227.0, 611227.0, 0.0391734, 0.0, 26.1997)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(635704.0, 635704.0, 0.0432926, 440.427, 25.892), (641894.0, 641894.0, 0.0434858, 122.07, 25.8114), (636286.0, 636286.0, 0.043859, 129.47, 26.2711)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(645019.0, 645019.0, 0.0432778, 112.454, 25.5628), (644904.0, 644904.0, 0.0432636, 113.517, 26.0968), (648679.0, 648679.0, 0.0430153, 102.459, 25.6019)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(705610.0, 705610.0, 0.0395877, 0.0, 30.1652), (702785.0, 702785.0, 0.0397455, 0.0, 29.3329), (705719.0, 705719.0, 0.0395825, 0.0, 30.1161)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 32, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 32, 'numa_memory': '128G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(699384.0, 699384.0, 0.0452612, 1136.85, 28.7525), (699960.0, 699960.0, 0.0452737, 1210.42, 29.2327), (696170.0, 696170.0, 0.0453715, 1474.05, 27.8344)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 32, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 32, 'numa_memory': '128G', 'persist': 'persist-temp', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(720767.0, 720767.0, 0.0442469, 759.988, 29.0968), (718494.0, 718494.0, 0.0443789, 648.494, 28.9776), (728285.0, 728285.0, 0.0437597, 773.536, 30.0091)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 32, 'name': 'scale_tpcc', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 32, 'numa_memory': '128G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(814635.0, 814635.0, 0.0391764, 0.0, 35.1976), (823571.0, 823571.0, 0.0387536, 0.0, 37.2659), (813039.0, 813039.0, 0.0392549, 0.0, 36.2492)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(806288.0, 806288.0, 0.0346716, 0.0, 0.0), (812797.0, 812797.0, 0.0343964, 0.0, 0.0), (805790.0, 805790.0, 0.0346961, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 1', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(797902.0, 797902.0, 0.0350234, 0.0, 121.078), (788705.0, 788705.0, 0.0354296, 0.0, 116.181), (790483.0, 790483.0, 0.0353565, 0.0, 119.697)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 2', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(777488.0, 777488.0, 0.0359398, 0.0, 234.32), (793928.0, 793928.0, 0.0351839, 0.0, 238.275), (774937.0, 774937.0, 0.0360464, 0.0, 234.145)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 3', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(769009.0, 769009.0, 0.0363146, 0.0, 347.611), (781956.0, 781956.0, 0.0357226, 0.0, 349.994), (784384.0, 784384.0, 0.0356131, 0.0, 351.86)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 4', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(766040.0, 766040.0, 0.0364569, 0.0, 451.138), (774012.0, 774012.0, 0.0360733, 0.0, 467.057), (782923.0, 782923.0, 0.0356682, 0.0, 464.325)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 5', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(761386.0, 761386.0, 0.0366621, 0.0, 560.837), (773768.0, 773768.0, 0.0360849, 0.0, 571.139), (778537.0, 778537.0, 0.0358533, 0.0, 578.473)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 6', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(764569.0, 764569.0, 0.0365113, 0.0, 679.599), (759640.0, 759640.0, 0.0367474, 0.0, 666.214), (776602.0, 776602.0, 0.0359345, 0.0, 687.29)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 7', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(765354.0, 765354.0, 0.036465, 0.0, 773.979), (760492.0, 760492.0, 0.0366901, 0.0, 780.935), (765215.0, 765215.0, 0.0364707, 0.0, 779.952)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 8', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(741889.0, 741889.0, 0.0376049, 0.0, 862.211), (765299.0, 765299.0, 0.0364518, 0.0, 895.632), (767722.0, 767722.0, 0.0363191, 0.0, 902.566)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 9', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(751384.0, 751384.0, 0.0371292, 0.0, 985.814), (763935.0, 763935.0, 0.0365074, 0.0, 1001.3), (756551.0, 756551.0, 0.0368641, 0.0, 999.711)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 10', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(761211.0, 761211.0, 0.0366384, 0.0, 1092.68), (763319.0, 763319.0, 0.0365279, 0.0, 1110.38), (765116.0, 765116.0, 0.0364423, 0.0, 1102.56)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(825461.0, 825461.0, 0.033858, 0.0, 0.0), (815822.0, 815822.0, 0.0342369, 0.0, 0.0), (821089.0, 821089.0, 0.0340414, 0.0, 0.0)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 1', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(811573.0, 811573.0, 0.034428, 0.0, 121.597), (814350.0, 814350.0, 0.034308, 0.0, 124.348), (816024.0, 816024.0, 0.0342422, 0.0, 125.231)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 2', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(808929.0, 808929.0, 0.0345328, 0.0, 245.946), (799773.0, 799773.0, 0.0349224, 0.0, 242.943), (790461.0, 790461.0, 0.0353392, 0.0, 238.913)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 3', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(804244.0, 804244.0, 0.0347248, 0.0, 367.843), (799706.0, 799706.0, 0.0349187, 0.0, 362.959), (796449.0, 796449.0, 0.0350647, 0.0, 361.86)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 4', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(794453.0, 794453.0, 0.0351407, 0.0, 487.235), (788685.0, 788685.0, 0.0353989, 0.0, 476.802), (787245.0, 787245.0, 0.0354657, 0.0, 475.537)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 5', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(798494.0, 798494.0, 0.0349548, 0.0, 602.005), (800584.0, 800584.0, 0.034865, 0.0, 608.673), (788170.0, 788170.0, 0.0354135, 0.0, 596.038)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 6', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(794715.0, 794715.0, 0.0351173, 0.0, 712.204), (782944.0, 782944.0, 0.0355952, 0.0, 699.92), (782979.0, 782979.0, 0.0356386, 0.0, 705.519)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 7', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(765775.0, 765775.0, 0.0364354, 0.0, 804.152), (792340.0, 792340.0, 0.0352126, 0.0, 829.994), (785538.0, 785538.0, 0.0355196, 0.0, 827.851)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 8', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(769798.0, 769798.0, 0.0362347, 0.0, 913.05), (783104.0, 783104.0, 0.0356187, 0.0, 938.75), (790762.0, 790762.0, 0.035276, 0.0, 940.525)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 9', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(774841.0, 774841.0, 0.0359907, 0.0, 1027.7), (776136.0, 776136.0, 0.0359342, 0.0, 1026.0), (781545.0, 781545.0, 0.0356814, 0.0, 1041.08)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-remote-item-pct 10', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(785045.0, 785045.0, 0.0355166, 0.0, 1159.89), (781998.0, 781998.0, 0.0356545, 0.0, 1146.56), (775092.0, 775092.0, 0.0359774, 0.0, 1136.1)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(925456.0, 925456.0, 0.0301944, 0.0, 0.0), (924710.0, 924710.0, 0.0302244, 0.0, 0.0), (912381.0, 912381.0, 0.0306279, 0.0, 0.0)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 1', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(905686.0, 905686.0, 0.030846, 0.0, 139.797), (923047.0, 923047.0, 0.0302669, 0.0, 141.698), (912168.0, 912168.0, 0.0306273, 0.0, 140.031)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 2', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(915460.0, 915460.0, 0.0305097, 0.0, 278.892), (891186.0, 891186.0, 0.0313397, 0.0, 272.795), (910633.0, 910633.0, 0.0306712, 0.0, 281.36)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 3', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(909618.0, 909618.0, 0.0306986, 0.0, 409.575), (900989.0, 900989.0, 0.0309938, 0.0, 405.692), (909806.0, 909806.0, 0.0306935, 0.0, 413.409)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 4', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(892349.0, 892349.0, 0.031283, 0.0, 543.606), (895733.0, 895733.0, 0.0311659, 0.0, 534.007), (905308.0, 905308.0, 0.0308356, 0.0, 546.89)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 5', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(892090.0, 892090.0, 0.0312859, 0.0, 669.004), (883095.0, 883095.0, 0.0316099, 0.0, 663.537), (892337.0, 892337.0, 0.0312792, 0.0, 658.321)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 6', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(881039.0, 881039.0, 0.0316704, 0.0, 793.076), (882058.0, 882058.0, 0.0316328, 0.0, 784.9), (880395.0, 880395.0, 0.0316974, 0.0, 782.47)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 7', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(886761.0, 886761.0, 0.0314644, 0.0, 921.532), (881661.0, 881661.0, 0.0316401, 0.0, 915.601), (882964.0, 882964.0, 0.0315967, 0.0, 917.951)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 8', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(880621.0, 880621.0, 0.0316745, 0.0, 1031.19), (871377.0, 871377.0, 0.0320079, 0.0, 1025.53), (876721.0, 876721.0, 0.0318137, 0.0, 1034.05)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 9', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(881304.0, 881304.0, 0.0316413, 0.0, 1159.76), (869172.0, 869172.0, 0.0320832, 0.0, 1144.78), (886523.0, 886523.0, 0.0314546, 0.0, 1169.68)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--enable-separate-tree-per-partition --workload-mix 100,0,0,0,0 --new-order-remote-item-pct 10', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(863583.0, 863583.0, 0.0322865, 0.0, 1254.06), (878930.0, 878930.0, 0.0317189, 0.0, 1276.02), (877821.0, 877821.0, 0.0317597, 0.0, 1278.09)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 0', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(1242960.0, 1242960.0, 0.0224758, 0.0, 0.0), (1247870.0, 1247870.0, 0.0223908, 0.0, 0.0), (1227620.0, 1227620.0, 0.0227595, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 1', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(1043580.0, 1043580.0, 0.0267812, 0.0, 0.0), (1039090.0, 1039090.0, 0.0268949, 0.0, 0.0), (1032500.0, 1032500.0, 0.0270694, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 2', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(855396.0, 855396.0, 0.0326825, 0.0, 0.0), (860291.0, 860291.0, 0.0324972, 0.0, 0.0), (855942.0, 855942.0, 0.032662, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 3', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(704703.0, 704703.0, 0.0396825, 0.0, 0.0), (695359.0, 695359.0, 0.0402165, 0.0, 0.0), (698044.0, 698044.0, 0.0400605, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 4', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(591127.0, 591127.0, 0.0473125, 0.0, 0.0), (586776.0, 586776.0, 0.0476642, 0.0, 0.0), (580026.0, 580026.0, 0.0482227, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 5', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(478630.0, 478630.0, 0.0584464, 0.0, 0.0), (491725.0, 491725.0, 0.0568888, 0.0, 0.0), (493271.0, 493271.0, 0.0567128, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 6', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(408654.0, 408654.0, 0.0684639, 0.0, 0.0), (419374.0, 419374.0, 0.0667132, 0.0, 0.0), (419056.0, 419056.0, 0.0667628, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 7', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(359188.0, 359188.0, 0.0778998, 0.0, 0.0), (359580.0, 359580.0, 0.0778133, 0.0, 0.0), (349631.0, 349631.0, 0.0800309, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 8', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(319971.0, 319971.0, 0.0874537, 0.0, 0.0), (319187.0, 319187.0, 0.0876687, 0.0, 0.0), (310965.0, 310965.0, 0.0899824, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 9', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(284031.0, 284031.0, 0.098525, 0.0, 0.0), (280539.0, 280539.0, 0.0997519, 0.0, 0.0), (284378.0, 284378.0, 0.0984049, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'multipart:pct', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks --new-order-remote-item-pct 10', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(255585.0, 255585.0, 0.109496, 0.0, 0.0), (256025.0, 256025.0, 0.109306, 0.0, 0.0), (256373.0, 256373.0, 0.109162, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --enable-separate-tree-per-partition --enable-partition-locks', 'db': 'kvdb-st', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 1, 'numa_memory': '16G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(44495.0, 44495.0, 0.0224293, 0.0, 0.0), (44288.4, 44288.4, 0.0225344, 0.0, 0.0), (44321.1, 44321.1, 0.0225171, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 1, 'numa_memory': '4G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(32118.3, 32118.3, 0.031069, 0.0, 0.0), (31969.4, 31969.4, 0.0312214, 0.0, 0.0), (31833.7, 31833.7, 0.0313521, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 1, 'numa_memory': '4G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(32951.1, 32951.1, 0.0302875, 0.0, 0.0), (32419.2, 32419.2, 0.0307953, 0.0, 0.0), (32893.5, 32893.5, 0.0303424, 0.0, 0.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 2, 'numa_memory': '8G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(62796.0, 62796.0, 0.0317857, 0.0, 3.31664), (62559.5, 62559.5, 0.0319149, 0.0, 3.14998), (61874.2, 61874.2, 0.0322658, 0.0, 2.99998)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 2, 'numa_memory': '8G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(64657.0, 64657.0, 0.0308702, 0.0, 3.28332), (64476.1, 64476.1, 0.0309545, 0.0, 3.48331), (64139.1, 64139.1, 0.0311286, 0.0, 3.26665)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 4, 'numa_memory': '16G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(121387.0, 121387.0, 0.032889, 0.0, 18.0999), (121454.0, 121454.0, 0.0328622, 0.0, 18.0498), (122034.0, 122034.0, 0.0327109, 0.0, 19.4165)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 4, 'numa_memory': '16G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(123894.0, 123894.0, 0.0322137, 0.0, 19.0832), (123991.0, 123991.0, 0.0321967, 0.0, 18.9832), (124994.0, 124994.0, 0.0319308, 0.0, 19.2999)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 6, 'numa_memory': '24G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(169515.0, 169515.0, 0.0327435, 0.0, 11079.4), (168722.0, 168722.0, 0.0329019, 0.0, 11018.7), (168456.0, 168456.0, 0.0329514, 0.0, 11011.8)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 6, 'numa_memory': '24G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(183716.0, 183716.0, 0.0323312, 0.0, 956.825), (183498.0, 183498.0, 0.0323662, 0.0, 960.558), (182594.0, 182594.0, 0.0325335, 0.0, 949.625)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 8, 'numa_memory': '32G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(216280.0, 216280.0, 0.0328513, 0.0, 22023.0), (210393.0, 210393.0, 0.0338061, 0.0, 21584.0), (213755.0, 213755.0, 0.0332433, 0.0, 21779.1)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 8, 'numa_memory': '32G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(238839.0, 238839.0, 0.0330196, 0.0, 1873.42), (237640.0, 237640.0, 0.0331984, 0.0, 1869.13), (239380.0, 239380.0, 0.0329553, 0.0, 1877.23)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 10, 'numa_memory': '40G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(250519.0, 250519.0, 0.0330805, 0.0, 40559.1), (241457.0, 241457.0, 0.0343597, 0.0, 39833.8), (250890.0, 250890.0, 0.0330292, 0.0, 40774.7)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 10, 'numa_memory': '40G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(293347.0, 293347.0, 0.0333821, 0.0, 3590.83), (295378.0, 295378.0, 0.0331443, 0.0, 3610.9), (292020.0, 292020.0, 0.0335388, 0.0, 3585.19)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 12, 'numa_memory': '48G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(275702.0, 275702.0, 0.0344281, 0.0, 57568.0), (277685.0, 277685.0, 0.0342305, 0.0, 57495.8), (279760.0, 279760.0, 0.0339387, 0.0, 58130.7)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 12, 'numa_memory': '48G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(343407.0, 343407.0, 0.0340644, 0.0, 5269.62), (340971.0, 340971.0, 0.0343138, 0.0, 5212.04), (341800.0, 341800.0, 0.034232, 0.0, 5232.51)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(327565.0, 327565.0, 0.0345718, 0.0, 103537.0), (325068.0, 325068.0, 0.0347459, 0.0, 103584.0), (327822.0, 327822.0, 0.0344385, 0.0, 104351.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(432829.0, 432829.0, 0.035626, 0.0, 9930.59), (442102.0, 442102.0, 0.0348777, 0.0, 10143.6), (441455.0, 441455.0, 0.0349215, 0.0, 10166.3)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(352584.0, 352584.0, 0.0352099, 0.0, 150022.0), (353061.0, 353061.0, 0.034983, 0.0, 150998.0), (349523.0, 349523.0, 0.0353466, 0.0, 150234.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 20, 'numa_memory': '80G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(531869.0, 531869.0, 0.0358097, 0.0, 16305.2), (531126.0, 531126.0, 0.0358588, 0.0, 16329.8), (531405.0, 531405.0, 0.0358489, 0.0, 16244.1)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 24, 'numa_memory': '96G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(362583.0, 362583.0, 0.0353427, 0.0, 191307.0), (363862.0, 363862.0, 0.0353339, 0.0, 191715.0), (363285.0, 363285.0, 0.0353368, 0.0, 191112.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 24, 'numa_memory': '96G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(618380.0, 618380.0, 0.0365441, 0.0, 23631.0), (621098.0, 621098.0, 0.0363649, 0.0, 23789.4), (619742.0, 619742.0, 0.0364553, 0.0, 23719.6)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(338537.0, 338537.0, 0.0365146, 0.0, 205308.0), (337417.0, 337417.0, 0.0363902, 0.0, 207241.0), (336938.0, 336938.0, 0.03607, 0.0, 207617.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(690271.0, 690271.0, 0.0377613, 0.0, 31631.7), (695852.0, 695852.0, 0.037431, 0.0, 32018.7), (695134.0, 695134.0, 0.0374861, 0.0, 31971.2)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 32, 'numa_memory': '128G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': True, 'log_compress': False, 'disable_madv_willneed': True}, [(300664.0, 300664.0, 0.0364553, 0.0, 195246.0), (309101.0, 309101.0, 0.0362933, 0.0, 201725.0), (307603.0, 307603.0, 0.0365383, 0.0, 200124.0)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 4, 'name': 'multipart:skew', 'bench_opts': '--workload-mix 100,0,0,0,0 --new-order-fast-id-gen', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 32, 'numa_memory': '128G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(762910.0, 762910.0, 0.0379692, 0.0, 40435.0), (766111.0, 766111.0, 0.0378948, 0.0, 40718.0), (753796.0, 753796.0, 0.0385245, 0.0, 39840.5)]), ({'binary': '../out-factor-gc-nowriteinplace/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'factoranalysis', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': None, 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(433200.0, 433200.0, 0.0645148, 0.0, 23.2829), (429709.0, 429709.0, 0.0650403, 0.0, 22.1329), (432455.0, 432455.0, 0.0646299, 0.0, 22.9662)]), ({'binary': '../out-factor-gc-nowriteinplace/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'factoranalysis', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(525665.0, 525665.0, 0.0531658, 0.0, 26.2329), (520951.0, 520951.0, 0.0536426, 0.0, 28.9828), (522117.0, 522117.0, 0.0535238, 0.0, 27.6495)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'factoranalysis', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(698023.0, 698023.0, 0.0400015, 0.0, 30.2117), (702420.0, 702420.0, 0.0397585, 0.0, 31.3994), (699132.0, 699132.0, 0.0399416, 0.0, 30.7157)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'factoranalysis', 'bench_opts': '--disable-read-only-snapshots', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(759458.0, 759458.0, 0.0367641, 0.0, 99.8045), (769139.0, 769139.0, 0.0362966, 0.0, 103.031), (759587.0, 759587.0, 0.0367557, 0.0, 99.7311)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'factoranalysis', 'bench_opts': '--disable-read-only-snapshots', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': True, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(777304.0, 777304.0, 0.035915, 0.0, 102.848), (779015.0, 779015.0, 0.0358351, 0.0, 105.114), (777038.0, 777038.0, 0.0359254, 0.0, 104.731)]), ({'binary': '../out-factor-fake-compression/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'persistfactoranalysis', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(688122.0, 688122.0, 0.0405507, 105.366, 30.9495), (685386.0, 685386.0, 0.0407172, 96.5505, 29.9872), (690778.0, 690778.0, 0.0404074, 105.092, 30.0936)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': False, 'scale_factor': 28, 'name': 'persistfactoranalysis', 'bench_opts': '', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 28, 'numa_memory': '112G', 'persist': 'persist-real', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': True, 'disable_madv_willneed': True}, [(596712.0, 596712.0, 0.046765, 139.349, 23.7017), (600256.0, 600256.0, 0.0464942, 145.855, 22.8553), (603010.0, 603010.0, 0.0462962, 147.18, 23.5958)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--workload-mix 50,0,0,0,50 --new-order-remote-item-pct 0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(199646.0, 199646.0, 0.0794695, 0.0, 2514.41), (205182.0, 205182.0, 0.0773246, 0.0, 2603.53), (200252.0, 200252.0, 0.0792314, 0.0, 2570.28)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--workload-mix 50,0,0,0,50 --new-order-remote-item-pct 20', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(197077.0, 197077.0, 0.0805048, 0.0, 2514.27), (196762.0, 196762.0, 0.0806183, 0.0, 2570.83), (196422.0, 196422.0, 0.0807498, 0.0, 2611.23)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--workload-mix 50,0,0,0,50 --new-order-remote-item-pct 40', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(196410.0, 196410.0, 0.0807394, 0.0, 2658.45), (196638.0, 196638.0, 0.0806373, 0.0, 2659.57), (195049.0, 195049.0, 0.0813108, 0.0, 2631.86)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--workload-mix 50,0,0,0,50 --new-order-remote-item-pct 60', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(194832.0, 194832.0, 0.0813761, 0.0, 2682.3), (192620.0, 192620.0, 0.0823341, 0.0, 2604.41), (193308.0, 193308.0, 0.0820224, 0.0, 2643.47)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--workload-mix 50,0,0,0,50 --new-order-remote-item-pct 80', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(194833.0, 194833.0, 0.0813758, 0.0, 2662.9), (194696.0, 194696.0, 0.081434, 0.0, 2695.99), (194545.0, 194545.0, 0.0814888, 0.0, 2691.61)]), ({'binary': '../out-perf/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--workload-mix 50,0,0,0,50 --new-order-remote-item-pct 100', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': False, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(194546.0, 194546.0, 0.0815033, 0.0, 2684.96), (192913.0, 192913.0, 0.0821921, 0.0, 2649.91), (194385.0, 194385.0, 0.0815586, 0.0, 2688.2)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--disable-read-only-snapshots --workload-mix 50,0,0,0,50 --new-order-remote-item-pct 0', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(168978.0, 168978.0, 0.0837348, 0.0, 15890.0), (161929.0, 161929.0, 0.0872612, 0.0, 15326.3), (168062.0, 168062.0, 0.0842055, 0.0, 15755.6)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--disable-read-only-snapshots --workload-mix 50,0,0,0,50 --new-order-remote-item-pct 20', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(164062.0, 164062.0, 0.0848855, 0.0, 17470.9), (164666.0, 164666.0, 0.0845902, 0.0, 17461.6), (161672.0, 161672.0, 0.0862109, 0.0, 17059.7)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--disable-read-only-snapshots --workload-mix 50,0,0,0,50 --new-order-remote-item-pct 40', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(158790.0, 158790.0, 0.0864914, 0.0, 18601.4), (157279.0, 157279.0, 0.0872426, 0.0, 18473.4), (160467.0, 160467.0, 0.0855206, 0.0, 18853.0)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--disable-read-only-snapshots --workload-mix 50,0,0,0,50 --new-order-remote-item-pct 60', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(157723.0, 157723.0, 0.0858837, 0.0, 20168.6), (157928.0, 157928.0, 0.0857274, 0.0, 20283.9), (157018.0, 157018.0, 0.0862519, 0.0, 20123.3)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--disable-read-only-snapshots --workload-mix 50,0,0,0,50 --new-order-remote-item-pct 80', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(155544.0, 155544.0, 0.0859683, 0.0, 21492.7), (154378.0, 154378.0, 0.0866151, 0.0, 21396.8), (154077.0, 154077.0, 0.0868223, 0.0, 21207.4)]), ({'binary': '../out-factor-gc/benchmarks/dbtest', 'log_fake_writes': False, 'retry': True, 'scale_factor': 8, 'name': 'readonly', 'bench_opts': '--disable-read-only-snapshots --workload-mix 50,0,0,0,50 --new-order-remote-item-pct 100', 'db': 'ndb-proto2', 'bench': 'tpcc', 'par_load': False, 'disable_gc': False, 'threads': 16, 'numa_memory': '64G', 'persist': 'persist-none', 'disable_snapshots': True, 'log_nofsync': False, 'backoff': False, 'log_compress': False, 'disable_madv_willneed': True}, [(150274.0, 150274.0, 0.0879101, 0.0, 22111.7), (153706.0, 153706.0, 0.0859128, 0.0, 22644.0), (151011.0, 151011.0, 0.0874784, 0.0, 22178.2)])]
| 42,633 | 85,265 | 0.668226 | 13,104 | 85,266 | 4.213904 | 0.109966 | 0.045455 | 0.021514 | 0.013039 | 0.771202 | 0.770804 | 0.770804 | 0.770586 | 0.770586 | 0.770586 | 0 | 0.188182 | 0.088159 | 85,266 | 1 | 85,266 | 85,266 | 0.522039 | 0 | 0 | 0 | 0 | 69 | 0.472908 | 0.12305 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
d05655178e399ed272d3d7d2d997fe5b8d197192 | 9,528 | py | Python | cocpit/dash_app/layout/legend.py | vprzybylo/COCPIT | cce6d614e9646bdf6c74c8163ad73126c429b6fa | [
"MIT"
] | 1 | 2020-08-27T14:29:13.000Z | 2020-08-27T14:29:13.000Z | cocpit/dash_app/layout/legend.py | vprzybylo/COCPIT | cce6d614e9646bdf6c74c8163ad73126c429b6fa | [
"MIT"
] | 1 | 2020-08-27T15:37:51.000Z | 2020-08-27T16:56:00.000Z | cocpit/dash_app/layout/legend.py | vprzybylo/COCPIT | cce6d614e9646bdf6c74c8163ad73126c429b6fa | [
"MIT"
] | null | null | null | import dash_bootstrap_components as dbc
from dash import html
import globals
def legend():
return html.Div(
children=[
dbc.CardGroup(
className="justify-content-around",
children=[
dbc.Col(
className="agg legend p-1 d-flex",
children=[
dbc.Row(
html.Img(
className='my-auto img-fluid card-img shadow p-1',
src='assets/agg.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4('Aggregate', className='m-1'),
),
dbc.Row(
html.H4(
'n = %d' % globals.part_type_count['agg'],
id='agg-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
dbc.Col(
className="budding legend p-1 d-flex justify-space-between",
children=[
dbc.Row(
html.Img(
className='my-auto img-fluid card-img shadow p-1',
src='assets/budding.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4('Budding Rosette', className='m-1'),
),
dbc.Row(
html.H4(
'n = %d'
% globals.part_type_count['budding'],
id='budding-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
dbc.Col(
className="bullet legend p-1 d-flex justify-space-between",
children=[
dbc.Row(
html.Img(
className='img-fluid card-img shadow p-1',
src='assets/bullet.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4('Bullet Rosette', className='m-1'),
),
dbc.Row(
html.H4(
'n = %d'
% globals.part_type_count['bullet'],
id='bullet-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
dbc.Col(
className="column legend p-1 d-flex justify-space-between",
children=[
dbc.Row(
html.Img(
className='my-auto img-fluid card-img shadow p-1',
src='assets/column.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4('Column', className='m-1'),
),
dbc.Row(
html.H4(
'n = %d'
% globals.part_type_count['column'],
id='column-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
dbc.Col(
className="compact legend p-1 d-flex justify-space-between",
children=[
dbc.Row(
html.Img(
className='my-auto img-fluid card-img shadow p-1',
src='assets/compact.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4('Compact Irregular', className='m-1'),
),
dbc.Row(
html.H4(
'n = %d'
% globals.part_type_count['compact'],
id='compact-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
dbc.Col(
className="planar legend p-1 d-flex justify-space-between",
children=[
dbc.Row(
html.Img(
className='my-auto img-fluid card-img shadow p-1',
src='assets/planar.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4(
'Planar Polycrystal',
className='m-1',
),
),
dbc.Row(
html.H4(
'n = %d'
% globals.part_type_count['planar'],
id='planar-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
dbc.Col(
className="rimed legend p-1 d-flex justify-space-between",
children=[
dbc.Row(
html.Img(
className='my-auto img-fluid card-img shadow p-1',
src='assets/rimed.png',
),
),
dbc.Col(
className='py-2 h3 text-white',
children=[
dbc.Row(
html.H4('Rimed', className='m-1'),
),
dbc.Row(
html.H4(
'n = %d' % globals.part_type_count['rimed'],
id='rimed-count',
className='m-1 mx-auto fw-normal',
),
),
],
),
],
),
],
),
],
)
| 46.252427 | 88 | 0.218619 | 507 | 9,528 | 4.076923 | 0.122288 | 0.060958 | 0.101597 | 0.121916 | 0.806967 | 0.800677 | 0.800677 | 0.800677 | 0.786164 | 0.770682 | 0 | 0.020064 | 0.707074 | 9,528 | 205 | 89 | 46.478049 | 0.72053 | 0 | 0 | 0.778325 | 0 | 0 | 0.129093 | 0.015533 | 0 | 0 | 0 | 0 | 0 | 1 | 0.004926 | true | 0 | 0.014778 | 0.004926 | 0.024631 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
ef99ad58442813b7e4cbcd9b851f04638429bdb0 | 12,761 | py | Python | state-change-localization-classification/slowFast-perceiver/models/multi_models.py | EGO4D/hands-and-objects | 76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2 | [
"MIT"
] | 24 | 2021-10-15T20:17:38.000Z | 2022-03-30T18:54:55.000Z | state-change-localization-classification/slowFast-perceiver/models/multi_models.py | EGO4D/hands-and-objects | 76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2 | [
"MIT"
] | 1 | 2022-03-09T03:35:42.000Z | 2022-03-10T20:50:24.000Z | state-change-localization-classification/slowFast-perceiver/models/multi_models.py | EGO4D/hands-and-objects | 76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2 | [
"MIT"
] | 4 | 2021-11-18T19:22:16.000Z | 2022-03-21T02:51:35.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Video models."""
import torch
import torch.nn as nn
from .build import MODEL_REGISTRY
from .video_model_builder import ResNet, SlowFast, _POOL1, SlowFastTx, SlowFastPerceiver, Perceiver
"""HEAD"""
class MultiTaskHead(nn.Module):
def __init__(
self,
dim_in,
num_classes,
pool_size,
dropout_rate=0.0,
act_func="softmax",
test_noact=False,
):
super(MultiTaskHead, self).__init__()
assert (
len({len(pool_size), len(dim_in)}) == 1
), "pathway dimensions are not consistent."
self.num_pathways = len(pool_size)
self.test_noact = test_noact
for pathway in range(self.num_pathways):
if pool_size[pathway] is None:
avg_pool = nn.AdaptiveAvgPool3d((1, 1, 1))
else:
avg_pool = nn.AvgPool3d(pool_size[pathway], stride=1)
self.add_module("pathway{}_avgpool".format(pathway), avg_pool)
if dropout_rate > 0.0:
self.dropout = nn.Dropout(dropout_rate)
# Perform FC in a fully convolutional manner. The FC layer will be
# initialized with a different std comparing to convolutional layers.
projs = []
for n in num_classes:
projs.append(nn.Linear(sum(dim_in), n, bias=True))
self.projections = nn.ModuleList(projs)
# Softmax for evaluation and testing.
if act_func == "softmax":
self.act = nn.Softmax(dim=4)
elif act_func == "sigmoid":
self.act = nn.Sigmoid()
else:
raise NotImplementedError(
"{} is not supported as an activation" "function.".format(act_func)
)
def forward(self, inputs):
assert (
len(inputs) == self.num_pathways
), "Input tensor does not contain {} pathway".format(self.num_pathways)
pool_out = []
for pathway in range(self.num_pathways):
m = getattr(self, "pathway{}_avgpool".format(pathway))
pool_out.append(m(inputs[pathway]))
x = torch.cat(pool_out, 1)
# (N, C, T, H, W) -> (N, T, H, W, C).
x = x.permute((0, 2, 3, 4, 1))
# Perform dropout.
feat = x
if hasattr(self, "dropout"):
feat = self.dropout(feat)
x = []
for projection in self.projections:
# print(feat.shape, projection)
x.append(projection(feat))
# Performs fully convlutional inference.
if not self.training:
if not self.test_noact:
x = [self.act(x_i) for x_i in x]
x = [x_i.mean([1, 2, 3]) for x_i in x]
x = [x_i.view(x_i.shape[0], -1) for x_i in x]
return x
class MultiTaskPerceiverHead(nn.Module):
def __init__(
self,
dim_in,
num_classes,
pool_size,
dropout_rate=0.0,
act_func="softmax",
test_noact=False,
):
super(MultiTaskPerceiverHead, self).__init__()
assert len(dim_in) == 3
self.num_pathways = len(pool_size) # slow+fast path
self.test_noact = test_noact
# fuse weight of output from perceiver to slowfast
self.fuse = nn.Parameter(0.01 * torch.ones(1))
for pathway in range(self.num_pathways):
if pool_size[pathway] is None:
avg_pool = nn.AdaptiveAvgPool3d((1, 1, 1))
else:
avg_pool = nn.AvgPool3d(pool_size[pathway], stride=1)
self.add_module("pathway{}_avgpool".format(pathway), avg_pool)
if dropout_rate > 0.0:
self.dropout = nn.Dropout(dropout_rate)
# Perform FC in a fully convolutional manner. The FC layer will be
# initialized with a different std comparing to convolutional layers.
projs = []
for n in num_classes:
projs.append(nn.Linear(sum(dim_in[:self.num_pathways]), n, bias=True))
self.projections = nn.ModuleList(projs)
# initialized projection for perceiver path
projs1 = []
for n in num_classes:
projs1.append(nn.Linear(sum(dim_in[self.num_pathways:]), n, bias=True))
self.projections1 = nn.ModuleList(projs1)
# Softmax for evaluation and testing.
if act_func == "softmax":
self.act = nn.Softmax(dim=4)
elif act_func == "sigmoid":
self.act = nn.Sigmoid()
else:
raise NotImplementedError(
"{} is not supported as an activation" "function.".format(act_func)
)
def forward(self, inputs):
pool_out = []
for pathway in range(self.num_pathways):
m = getattr(self, "pathway{}_avgpool".format(pathway))
pool_out.append(m(inputs[pathway]))
x = torch.cat(pool_out, 1)
# (N, C, T, H, W) -> (N, T, H, W, C).
x = x.permute((0, 2, 3, 4, 1))
# Perform dropout.
feat = x
if hasattr(self, "dropout"):
feat = self.dropout(feat)
# (N, C) -> (N, 1, 1, 1, C).
x1 = inputs[-1]
N, C = x1.shape
x1 = x1.reshape(N, 1, 1, 1, C)
x = []
for projection, projection1 in zip(self.projections, self.projections1):
# print(feat.shape, projection)
fused_projecton = projection(feat) + self.fuse * projection1(x1)
x.append(fused_projecton)
# Performs fully convlutional inference.
if not self.training:
if not self.test_noact:
x = [self.act(x_i) for x_i in x]
x = [x_i.mean([1, 2, 3]) for x_i in x]
x = [x_i.view(x_i.shape[0], -1) for x_i in x]
return x
class PerceiverHead(nn.Module):
def __init__(
self,
dim_in,
num_classes,
dropout_rate=0.0,
act_func="softmax",
test_noact=False,
):
super(PerceiverHead, self).__init__()
self.test_noact = test_noact
# Perform FC in a fully convolutional manner. The FC layer will be
# initialized with a different std comparing to convolutional layers.
projs = []
for n in num_classes:
projs.append(nn.Linear(sum(dim_in), n, bias=True))
self.projections = nn.ModuleList(projs)
# Softmax for evaluation and testing.
if act_func == "softmax":
self.act = nn.Softmax(dim=4)
elif act_func == "sigmoid":
self.act = nn.Sigmoid()
else:
raise NotImplementedError(
"{} is not supported as an activation" "function.".format(act_func)
)
def forward(self, inputs):
# (N, C) -> (N, 1, 1, 1, C).
feat = inputs
N, C = feat.shape
feat = feat.reshape(N, 1, 1, 1, C)
x = []
for projection in self.projections:
# print(feat.shape, projection)
x.append(projection(feat))
# Performs fully convlutional inference.
if not self.training:
if not self.test_noact:
x = [self.act(x_i) for x_i in x]
x = [x_i.mean([1, 2, 3]) for x_i in x]
x = [x_i.view(x_i.shape[0], -1) for x_i in x]
return x
"""MODEL"""
@MODEL_REGISTRY.register()
class MultiTaskResNet(ResNet):
def _construct_network(self, cfg):
super()._construct_network(cfg, with_head=False)
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
pool_size = _POOL1[cfg.MODEL.ARCH]
head = MultiTaskHead(
dim_in=[width_per_group * 32],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[
[
cfg.DATA.NUM_FRAMES // pool_size[0][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][2],
]
], # None for AdaptiveAvgPool3d((1, 1, 1))
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
test_noact=cfg.TEST.NO_ACT,
)
self.head_name = "headepic"
self.add_module(self.head_name, head)
@MODEL_REGISTRY.register()
class MultiTaskSlowFast(SlowFast):
def _construct_network(self, cfg):
super()._construct_network(cfg, with_head=False)
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
pool_size = _POOL1[cfg.MODEL.ARCH]
head = MultiTaskHead(
dim_in=[
width_per_group * 32,
width_per_group * 32 // cfg.SLOWFAST.BETA_INV,
],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[
[
cfg.DATA.NUM_FRAMES // cfg.SLOWFAST.ALPHA // pool_size[0][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][2],
],
[
cfg.DATA.NUM_FRAMES // pool_size[1][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[1][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[1][2],
],
], # None for AdaptiveAvgPool3d((1, 1, 1))
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
test_noact=cfg.TEST.NO_ACT,
)
self.head_name = "headepic"
self.add_module(self.head_name, head)
@MODEL_REGISTRY.register()
class MultiTaskSlowFastPr(SlowFastPerceiver):
# slowfast with Perceiver
def _construct_network(self, cfg):
super()._construct_network(cfg, with_head=False)
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
pool_size = _POOL1[cfg.MODEL.ARCH]
num_frames = cfg.DATA.SAMPLING_FPS * cfg.DATA.CLIP_LEN_SEC
head = MultiTaskPerceiverHead(
dim_in=[
width_per_group * 32,
width_per_group * 32 // cfg.SLOWFAST.BETA_INV,
cfg.PERCEIVER.LATENT_DIM
],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[
[
num_frames // cfg.SLOWFAST.ALPHA // pool_size[0][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][2],
],
[
num_frames // pool_size[1][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[1][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[1][2],
],
], # None for AdaptiveAvgPool3d((1, 1, 1))
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
test_noact=cfg.TEST.NO_ACT,
)
self.head_name = "headepic"
self.add_module(self.head_name, head)
@MODEL_REGISTRY.register()
class MultiTaskPerceiver(Perceiver):
def _construct_network(self, cfg):
super()._construct_network(cfg, with_head=False)
head = PerceiverHead(
dim_in=[cfg.PERCEIVER.LATENT_DIM],
num_classes=cfg.MODEL.NUM_CLASSES,
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
test_noact=cfg.TEST.NO_ACT,
)
self.head_name = "headepic"
self.add_module(self.head_name, head)
@MODEL_REGISTRY.register()
class MultiTaskSlowFastTx(SlowFastTx):
# slowfast with transformer
def _construct_network(self, cfg):
super()._construct_network(cfg, with_head=False)
width_per_group = cfg.RESNET.WIDTH_PER_GROUP
pool_size = _POOL1[cfg.MODEL.ARCH]
head = MultiTaskHead(
dim_in=[
width_per_group * 32,
width_per_group * 32 // cfg.SLOWFAST.BETA_INV,
],
num_classes=cfg.MODEL.NUM_CLASSES,
pool_size=[
[
cfg.DATA.NUM_FRAMES // cfg.SLOWFAST.ALPHA // pool_size[0][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[0][2],
],
[
cfg.DATA.NUM_FRAMES // pool_size[1][0],
cfg.DATA.CROP_SIZE // 32 // pool_size[1][1],
cfg.DATA.CROP_SIZE // 32 // pool_size[1][2],
],
], # None for AdaptiveAvgPool3d((1, 1, 1))
dropout_rate=cfg.MODEL.DROPOUT_RATE,
act_func=cfg.MODEL.HEAD_ACT,
test_noact=cfg.TEST.NO_ACT,
)
self.head_name = "headepic"
self.add_module(self.head_name, head)
| 34.396226 | 99 | 0.549879 | 1,571 | 12,761 | 4.264163 | 0.122215 | 0.04538 | 0.029109 | 0.031348 | 0.828183 | 0.815943 | 0.80818 | 0.80609 | 0.800717 | 0.789969 | 0 | 0.022346 | 0.337199 | 12,761 | 370 | 100 | 34.489189 | 0.769686 | 0.100854 | 0 | 0.794425 | 0 | 0 | 0.034863 | 0 | 0 | 0 | 0 | 0 | 0.010453 | 1 | 0.038328 | false | 0 | 0.013937 | 0 | 0.090592 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
4bd811c9d764a5dc715c82901fa542bc164a6bb1 | 3,815 | py | Python | symplectic_map/gpu_symplectic_map.py | carlidel/c_symplectic_map | 4c5cc8a0c9fa1d5b28588aec1ab005e2747dc231 | [
"MIT"
] | null | null | null | symplectic_map/gpu_symplectic_map.py | carlidel/c_symplectic_map | 4c5cc8a0c9fa1d5b28588aec1ab005e2747dc231 | [
"MIT"
] | null | null | null | symplectic_map/gpu_symplectic_map.py | carlidel/c_symplectic_map | 4c5cc8a0c9fa1d5b28588aec1ab005e2747dc231 | [
"MIT"
] | null | null | null | import numpy as np
from numba import njit, cuda
from numba.cuda import random
import math
from numba import float64, int32
@cuda.jit
def symplectic_map_common(x, px, step_values, noise_array, epsilon, alpha, beta, x_star, delta, omega_0, omega_1, omega_2, action_radius):
i = cuda.threadIdx.x
j = cuda.threadIdx.x + cuda.blockIdx.x * cuda.blockDim.x
action = cuda.shared.array(shape=(512), dtype=float64)
rot_angle = cuda.shared.array(shape=(512), dtype=float64)
temp1 = cuda.shared.array(shape=(512), dtype=float64)
temp2 = cuda.shared.array(shape=(512), dtype=float64)
l_x = cuda.shared.array(shape=(512), dtype=float64)
l_px = cuda.shared.array(shape=(512), dtype=float64)
l_step = cuda.shared.array(shape=(512), dtype=int32)
if j < x.shape[0]:
l_x[i] = x[j]
l_px[i] = px[j]
l_step[i] = step_values[j]
for k in range(noise_array.shape[0]):
action[i] = (l_x[i] * l_x[i] + l_px[i] * l_px[i]) * 0.5
rot_angle[i] = omega_0 + (omega_1 + action[i]) + (0.5 * omega_2 * action[i] * action[i])
if (l_x[i] == 0.0 and px[i] == 0.0) or action[i] >= action_radius:
l_x[i] = 0.0
l_px[i] = 0.0
break
temp1[i] = l_x[i]
temp2[i] = (
l_px[i] + epsilon * noise_array[k] * (l_x[i] ** beta)
* math.exp(-((x_star / (delta + abs(l_x[i]))) ** alpha))
)
l_x[i] = math.cos(rot_angle[i]) * temp1[i] + \
math.sin(rot_angle[i]) * temp2[i]
l_px[i] = -math.sin(rot_angle[i]) * temp1[i] + \
math.cos(rot_angle[i]) * temp2[i]
l_step[i] += 1
x[j] = l_x[i]
px[j] = l_px[i]
step_values[j] = l_step[i]
@cuda.jit
def symplectic_map_personal(x, px, step_values, n_iterations, epsilon, alpha, beta, x_star, delta, omega_0, omega_1, omega_2, action_radius, rng_states, gamma):
i = cuda.threadIdx.x
j = cuda.threadIdx.x + cuda.blockIdx.x * cuda.blockDim.x
action = cuda.shared.array(shape=(512), dtype=float64)
rot_angle = cuda.shared.array(shape=(512), dtype=float64)
temp1 = cuda.shared.array(shape=(512), dtype=float64)
temp2 = cuda.shared.array(shape=(512), dtype=float64)
noise = cuda.shared.array(shape=(512), dtype=float64)
l_x = cuda.shared.array(shape=(512), dtype=float64)
l_px = cuda.shared.array(shape=(512), dtype=float64)
l_step = cuda.shared.array(shape=(512), dtype=int32)
noise[i] = random.xoroshiro128p_normal_float64(rng_states, j)
if j < x.shape[0]:
l_x[i] = x[j]
l_px[i] = px[j]
l_step[i] = step_values[j]
for k in range(n_iterations):
action[i] = (l_x[i] * l_x[i] + l_px[i] * l_px[i]) * 0.5
rot_angle[i] = omega_0 + (omega_1 + action[i]) + \
(0.5 * omega_2 * action[i] * action[i])
if (l_x[i] == 0.0 and l_px[i] == 0.0) or action[i] >= action_radius:
l_x[i] = 0.0
l_px[i] = 0.0
break
temp1[i] = l_x[i]
temp2[i] = (
l_px[i] + epsilon * noise[i] * (l_x[i] ** beta)
* math.exp(-((x_star / (delta + abs(l_x[i]))) ** alpha))
)
l_x[i] = math.cos(rot_angle[i]) * temp1[i] + \
math.sin(rot_angle[i]) * temp2[i]
l_px[i] = -math.sin(rot_angle[i]) * temp1[i] + \
math.cos(rot_angle[i]) * temp2[i]
l_step[i] += 1
noise[i] = random.xoroshiro128p_normal_float64(rng_states, j) + gamma * noise[i]
x[j] = l_x[i]
px[j] = l_px[i]
step_values[j] = l_step[i]
| 40.157895 | 161 | 0.531062 | 593 | 3,815 | 3.246206 | 0.116358 | 0.022857 | 0.031169 | 0.155844 | 0.883117 | 0.858701 | 0.858701 | 0.858701 | 0.858701 | 0.808831 | 0 | 0.055282 | 0.307733 | 3,815 | 94 | 162 | 40.585106 | 0.673608 | 0 | 0 | 0.734177 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.025316 | false | 0 | 0.063291 | 0 | 0.088608 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
4be452afc63264c6f3f7b06737d876f2898927e8 | 93 | py | Python | exercicios/aula11.py | anildoferreira/CursoPython-PyCharm | 56c3962d6cc7d43482a9649a482619adba780d81 | [
"MIT"
] | null | null | null | exercicios/aula11.py | anildoferreira/CursoPython-PyCharm | 56c3962d6cc7d43482a9649a482619adba780d81 | [
"MIT"
] | null | null | null | exercicios/aula11.py | anildoferreira/CursoPython-PyCharm | 56c3962d6cc7d43482a9649a482619adba780d81 | [
"MIT"
] | null | null | null | print('\33[31mOlá mundo!')
print('\33[7;32mOlá mundo!\33[m')
print('\33[7;30mOlá mundo\33[m') | 31 | 33 | 0.666667 | 18 | 93 | 3.444444 | 0.444444 | 0.33871 | 0.258065 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204545 | 0.053763 | 93 | 3 | 34 | 31 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0.680851 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 8 |
ef2e5c2f6f53fbb02b12191e9f12c3d53aa73721 | 3,351 | py | Python | tests/data/preview/remove_newline_after_code_block_open.py | hampuskraft/black | f2d279faed9e545b8d6fbb620fa239dee5e67520 | [
"MIT"
] | null | null | null | tests/data/preview/remove_newline_after_code_block_open.py | hampuskraft/black | f2d279faed9e545b8d6fbb620fa239dee5e67520 | [
"MIT"
] | 2 | 2021-12-15T08:11:30.000Z | 2021-12-15T08:11:45.000Z | tests/data/preview/remove_newline_after_code_block_open.py | hampuskraft/black | f2d279faed9e545b8d6fbb620fa239dee5e67520 | [
"MIT"
] | null | null | null | import random
def foo1():
print("The newline above me should be deleted!")
def foo2():
print("All the newlines above me should be deleted!")
def foo3():
print("No newline above me!")
print("There is a newline above me, and that's OK!")
def foo4():
# There is a comment here
print("The newline above me should not be deleted!")
class Foo:
def bar(self):
print("The newline above me should be deleted!")
for i in range(5):
print(f"{i}) The line above me should be removed!")
for i in range(5):
print(f"{i}) The lines above me should be removed!")
for i in range(5):
for j in range(7):
print(f"{i}) The lines above me should be removed!")
if random.randint(0, 3) == 0:
print("The new line above me is about to be removed!")
if random.randint(0, 3) == 0:
print("The new lines above me is about to be removed!")
if random.randint(0, 3) == 0:
if random.uniform(0, 1) > 0.5:
print("Two lines above me are about to be removed!")
while True:
print("The newline above me should be deleted!")
while True:
print("The newlines above me should be deleted!")
while True:
while False:
print("The newlines above me should be deleted!")
with open("/path/to/file.txt", mode="w") as file:
file.write("The new line above me is about to be removed!")
with open("/path/to/file.txt", mode="w") as file:
file.write("The new lines above me is about to be removed!")
with open("/path/to/file.txt", mode="r") as read_file:
with open("/path/to/output_file.txt", mode="w") as write_file:
write_file.writelines(read_file.readlines())
# output
import random
def foo1():
print("The newline above me should be deleted!")
def foo2():
print("All the newlines above me should be deleted!")
def foo3():
print("No newline above me!")
print("There is a newline above me, and that's OK!")
def foo4():
# There is a comment here
print("The newline above me should not be deleted!")
class Foo:
def bar(self):
print("The newline above me should be deleted!")
for i in range(5):
print(f"{i}) The line above me should be removed!")
for i in range(5):
print(f"{i}) The lines above me should be removed!")
for i in range(5):
for j in range(7):
print(f"{i}) The lines above me should be removed!")
if random.randint(0, 3) == 0:
print("The new line above me is about to be removed!")
if random.randint(0, 3) == 0:
print("The new lines above me is about to be removed!")
if random.randint(0, 3) == 0:
if random.uniform(0, 1) > 0.5:
print("Two lines above me are about to be removed!")
while True:
print("The newline above me should be deleted!")
while True:
print("The newlines above me should be deleted!")
while True:
while False:
print("The newlines above me should be deleted!")
with open("/path/to/file.txt", mode="w") as file:
file.write("The new line above me is about to be removed!")
with open("/path/to/file.txt", mode="w") as file:
file.write("The new lines above me is about to be removed!")
with open("/path/to/file.txt", mode="r") as read_file:
with open("/path/to/output_file.txt", mode="w") as write_file:
write_file.writelines(read_file.readlines())
| 17.636842 | 66 | 0.636825 | 565 | 3,351 | 3.759292 | 0.125664 | 0.112053 | 0.122411 | 0.127119 | 0.997175 | 0.997175 | 0.997175 | 0.997175 | 0.997175 | 0.997175 | 0 | 0.016349 | 0.233363 | 3,351 | 189 | 67 | 17.730159 | 0.810432 | 0.016115 | 0 | 1 | 0 | 0 | 0.471303 | 0.014576 | 0 | 0 | 0 | 0 | 0 | 1 | 0.121951 | false | 0 | 0.02439 | 0 | 0.170732 | 0.365854 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
ef4efb1207989009287f2e5347409f08b9317686 | 4,979 | py | Python | openprocurement/audit/inspection/tests/test_monitoring_inspections.py | ProzorroUKR/openprocurement.audit.api | a17836e29bca28d9151c091e1d2e42de9f70b949 | [
"Apache-2.0"
] | 1 | 2018-05-21T08:14:55.000Z | 2018-05-21T08:14:55.000Z | openprocurement/audit/inspection/tests/test_monitoring_inspections.py | ProzorroUKR/openprocurement.audit.api | a17836e29bca28d9151c091e1d2e42de9f70b949 | [
"Apache-2.0"
] | 59 | 2018-05-18T02:09:47.000Z | 2019-05-29T12:10:06.000Z | openprocurement/audit/inspection/tests/test_monitoring_inspections.py | ProzorroUKR/openprocurement.audit.api | a17836e29bca28d9151c091e1d2e42de9f70b949 | [
"Apache-2.0"
] | 1 | 2020-06-15T11:04:25.000Z | 2020-06-15T11:04:25.000Z | from freezegun import freeze_time
from openprocurement.audit.inspection.tests.base import BaseWebTest
@freeze_time('2018-01-01T11:00:00+02:00')
class MonitoringInspectionsResourceTest(BaseWebTest):
def test_get_empty(self):
response = self.app.get('/monitorings/{}/inspections'.format("f" * 32))
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data'], [])
def test_get(self):
self.create_inspection()
for uid in self.monitoring_ids:
response = self.app.get('/monitorings/{}/inspections'.format(uid))
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(
response.json['data'],
[{
u'dateCreated': u'2018-01-01T11:00:00+02:00',
u'dateModified': u'2018-01-01T11:00:00+02:00',
u'inspection_id': self.inspectionId,
u'id': self.inspection_id
}]
)
def test_get_opt_fields(self):
self.create_inspection()
for uid in self.monitoring_ids:
response = self.app.get('/monitorings/{}/inspections?opt_fields=description'.format(uid))
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(
response.json['data'],
[{
u'description': u'Yo-ho-ho',
u'dateCreated': u'2018-01-01T11:00:00+02:00',
u'dateModified': u'2018-01-01T11:00:00+02:00',
u'inspection_id': self.inspectionId,
u'id': self.inspection_id
}]
)
def test_get_two(self):
self.create_inspection()
expected_one = {
u'dateCreated': u'2018-01-01T11:00:00+02:00',
u'dateModified': u'2018-01-01T11:00:00+02:00',
u'inspection_id': self.inspectionId,
u'id': self.inspection_id
}
with freeze_time('2018-01-01T11:00:50+02:00'):
self.create_inspection()
expected_two = {
u'dateCreated': u'2018-01-01T11:00:50+02:00',
u'dateModified': u'2018-01-01T11:00:50+02:00',
u'inspection_id': self.inspectionId,
u'id': self.inspection_id
}
for uid in self.monitoring_ids:
response = self.app.get('/monitorings/{}/inspections'.format(uid))
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(
response.json['data'],
[expected_one, expected_two]
)
def test_get_with_pagination(self):
for i in range(5):
self.create_inspection()
for uid in self.monitoring_ids:
response = self.app.get(
'/monitorings/{}/inspections?limit=2&page=2'.format(uid)
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['total'], 5)
self.assertEqual(response.json['count'], 2)
self.assertEqual(response.json['limit'], 2)
self.assertEqual(response.json['page'], 2)
self.assertEqual(len(response.json['data']), 2)
def test_get_with_pagination_not_full_page(self):
for i in range(5):
self.create_inspection()
for uid in self.monitoring_ids:
response = self.app.get(
'/monitorings/{}/inspections?limit=2&page=3'.format(uid)
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['total'], 5)
self.assertEqual(response.json['count'], 1)
self.assertEqual(response.json['limit'], 2)
self.assertEqual(response.json['page'], 3)
self.assertEqual(len(response.json['data']), 1)
def test_get_with_pagination_out_of_bounds_page(self):
for i in range(5):
self.create_inspection()
for uid in self.monitoring_ids:
response = self.app.get(
'/monitorings/{}/inspections?limit=2&page=4'.format(uid)
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['total'], 5)
self.assertEqual(response.json['count'], 0)
self.assertEqual(response.json['limit'], 2)
self.assertEqual(response.json['page'], 4)
self.assertEqual(len(response.json['data']), 0)
| 39.832 | 101 | 0.58084 | 562 | 4,979 | 5.033808 | 0.142349 | 0.174973 | 0.243902 | 0.152704 | 0.879463 | 0.853659 | 0.810534 | 0.7766 | 0.7766 | 0.759279 | 0 | 0.064106 | 0.288813 | 4,979 | 124 | 102 | 40.153226 | 0.734821 | 0 | 0 | 0.613208 | 0 | 0 | 0.180759 | 0.101828 | 0 | 0 | 0 | 0 | 0.311321 | 1 | 0.066038 | false | 0 | 0.018868 | 0 | 0.09434 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
326b2844dff32f5c760166bf1fc442f18e606c73 | 17,968 | py | Python | test/test_search_service.py | mmalandra-kb4/service-auto-analyzer | 475e343d918254a33cb8fc953aa75dacab62465b | [
"Apache-2.0"
] | 8 | 2020-06-04T10:32:27.000Z | 2022-02-17T08:11:00.000Z | test/test_search_service.py | mmalandra-kb4/service-auto-analyzer | 475e343d918254a33cb8fc953aa75dacab62465b | [
"Apache-2.0"
] | 9 | 2019-12-12T11:18:37.000Z | 2022-02-19T16:17:28.000Z | test/test_search_service.py | mmalandra-kb4/service-auto-analyzer | 475e343d918254a33cb8fc953aa75dacab62465b | [
"Apache-2.0"
] | 12 | 2020-04-01T15:19:40.000Z | 2022-03-03T14:41:55.000Z | """
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
"""
import unittest
from unittest.mock import MagicMock
import json
from http import HTTPStatus
import sure # noqa
import httpretty
import commons.launch_objects as launch_objects
from service.search_service import SearchService
from test.test_service import TestService
from utils import utils
class TestSearchService(TestService):
@utils.ignore_warnings
def test_search_logs(self):
"""Test search logs"""
tests = [
{
"test_calls": [{"method": httpretty.GET,
"uri": "/1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(self.search_logs_rq),
"rs": utils.get_fixture(
self.no_hits_search_rs),
}, ],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error"],
logLines=-1),
"expected_count": 0
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/rp_1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/rp_1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(self.search_logs_rq),
"rs": utils.get_fixture(
self.no_hits_search_rs),
}, ],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error"],
logLines=-1),
"app_config": {
"esHost": "http://localhost:9200",
"esUser": "",
"esPassword": "",
"esVerifyCerts": False,
"esUseSsl": False,
"esSslShowWarn": False,
"turnOffSslVerification": True,
"esCAcert": "",
"esClientCert": "",
"esClientKey": "",
"appVersion": "",
"minioRegion": "",
"minioBucketPrefix": "",
"filesystemDefaultPath": "",
"esChunkNumber": 1000,
"binaryStoreType": "minio",
"minioHost": "",
"minioAccessKey": "",
"minioSecretKey": "",
"esProjectIndexPrefix": "rp_"
},
"expected_count": 0
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/1",
"status": HTTPStatus.OK,
}, ],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=[""],
logLines=-1),
"expected_count": 0
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(self.search_logs_rq),
"rs": utils.get_fixture(
self.one_hit_search_rs_search_logs),
}, ],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error"],
logLines=-1),
"expected_count": 0
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_logs_rq_not_found),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs),
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_not_merged_logs_by_test_item),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs),
}, ],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error occured once"],
logLines=-1),
"expected_count": 1
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_logs_rq_with_status_codes),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs_with_status_codes),
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_not_merged_logs_by_test_item),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs_with_status_codes),
}],
"rq": launch_objects.SearchLogs(
launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error occured once status code: 500 but got 200"],
logLines=-1),
"expected_count": 1,
"response": [launch_objects.SearchLogInfo(logId=2, testItemId=1, matchScore=100)]
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/rp_1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/rp_1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_logs_rq_not_found),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs),
},
{"method": httpretty.GET,
"uri": "/rp_1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_not_merged_logs_by_test_item),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs),
}],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error occured once"],
logLines=-1),
"app_config": {
"esHost": "http://localhost:9200",
"esUser": "",
"esPassword": "",
"esVerifyCerts": False,
"esUseSsl": False,
"esSslShowWarn": False,
"turnOffSslVerification": True,
"esCAcert": "",
"esClientCert": "",
"esClientKey": "",
"appVersion": "",
"minioRegion": "",
"minioBucketPrefix": "",
"filesystemDefaultPath": "",
"esChunkNumber": 1000,
"binaryStoreType": "minio",
"minioHost": "",
"minioAccessKey": "",
"minioSecretKey": "",
"esProjectIndexPrefix": "rp_"
},
"expected_count": 1,
"response": [launch_objects.SearchLogInfo(logId=1, testItemId=1, matchScore=100)]
},
{
"test_calls": [{"method": httpretty.GET,
"uri": "/1",
"status": HTTPStatus.OK,
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_logs_rq_not_found),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs),
},
{"method": httpretty.GET,
"uri": "/1/_search?scroll=5m&size=1000",
"status": HTTPStatus.OK,
"content_type": "application/json",
"rq": utils.get_fixture(
self.search_not_merged_logs_by_test_item),
"rs": utils.get_fixture(
self.two_hits_search_rs_search_logs),
}],
"rq": launch_objects.SearchLogs(launchId=1,
launchName="Launch 1",
itemId=3,
projectId=1,
filteredLaunchIds=[1],
logMessages=["error occured once"],
logLines=-1,
analyzerConfig=launch_objects.AnalyzerConf(
allMessagesShouldMatch=True)),
"expected_count": 1,
"response": [launch_objects.SearchLogInfo(logId=1, testItemId=1, matchScore=100)]
}
]
for idx, test in enumerate(tests):
with sure.ensure('Error in the test case number: {0}', idx):
self._start_server(test["test_calls"])
app_config = self.app_config
if "app_config" in test:
app_config = test["app_config"]
search_service = SearchService(app_config=app_config,
search_cfg=self.get_default_search_config())
search_service.es_client.es_client.scroll = MagicMock(return_value=json.loads(
utils.get_fixture(self.no_hits_search_rs)))
response = search_service.search_logs(test["rq"])
response.should.have.length_of(test["expected_count"])
if "response" in test:
response.should.equal(test["response"])
TestSearchService.shutdown_server(test["test_calls"])
if __name__ == '__main__':
unittest.main()
| 56.503145 | 103 | 0.324132 | 1,050 | 17,968 | 5.328571 | 0.184762 | 0.032887 | 0.061662 | 0.078105 | 0.752994 | 0.748883 | 0.748883 | 0.748883 | 0.733512 | 0.733512 | 0 | 0.024159 | 0.594557 | 17,968 | 317 | 104 | 56.681388 | 0.743857 | 0.033059 | 0 | 0.751724 | 0 | 0 | 0.121422 | 0.02448 | 0 | 0 | 0 | 0 | 0 | 1 | 0.003448 | false | 0.006897 | 0.034483 | 0 | 0.041379 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
32abd73b62128f694f8b129b7e78f06ec4999b56 | 165 | py | Python | vimscripts/bla.py | edgarklerks/dotfiles | 6f25ee0cb110c7984ac4d88943c74abd4fd6dd44 | [
"BSD-2-Clause"
] | null | null | null | vimscripts/bla.py | edgarklerks/dotfiles | 6f25ee0cb110c7984ac4d88943c74abd4fd6dd44 | [
"BSD-2-Clause"
] | null | null | null | vimscripts/bla.py | edgarklerks/dotfiles | 6f25ee0cb110c7984ac4d88943c74abd4fd6dd44 | [
"BSD-2-Clause"
] | null | null | null | test = "asddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
| 82.5 | 164 | 0.963636 | 2 | 165 | 79.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018182 | 165 | 1 | 165 | 165 | 0.981481 | 0 | 0 | 0 | 0 | 0 | 0.939394 | 0.939394 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
0879551104b679623fd94850389268365ade3c85 | 4,987 | py | Python | config.py | theshanky/Fingerprint-Liveness | 4a303cc5043e8aef1bea59b581cf2943b773b97f | [
"MIT"
] | 1 | 2020-07-10T08:50:23.000Z | 2020-07-10T08:50:23.000Z | config.py | theshanky/Fingerprint-Liveness | 4a303cc5043e8aef1bea59b581cf2943b773b97f | [
"MIT"
] | null | null | null | config.py | theshanky/Fingerprint-Liveness | 4a303cc5043e8aef1bea59b581cf2943b773b97f | [
"MIT"
] | null | null | null | # coding: utf8
import torch
import warnings
class DefaultConfig(object):
model = 'MyMobilenet' # 使用的模型,名字必须与models/__init__.py中的名字一致
env = model #
ATTACK = 1
GENUINE = 0
# train_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset/colored','/home/shashank/Desktop/Fingerprint/dataset/colored/BiometrikaTrain/Livetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset/colored','/home/shashank/Desktop/Fingerprint/dataset/colored/BiometrikaTrain/Spooftest.txt',ATTACK]
# ]
# test_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset/colored','/home/shashank/Desktop/Fingerprint/dataset/colored/BiometrikaTest/Livetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset/colored','/home/shashank/Desktop/Fingerprint/dataset/colored/BiometrikaTest/Spooftest.txt',ATTACK]
# ]
# train_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/BiometrikaTrain/Livetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/BiometrikaTrain/Spooftest.txt',ATTACK]
# ]
# test_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/BiometrikaTest/Livetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/BiometrikaTest/Spooftest.txt',ATTACK]
# ]
#GRAY
# train_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/gray/train/alivetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/gray/train/faketest.txt',ATTACK]
# ]
# test_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/gray/Test/alivetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/gray/Test/faketest.txt',ATTACK]
# ]
#CrossMatch
# train_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/CrossMatch/Training/Livetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/CrossMatch/Training/Faketest.txt',ATTACK]
# ]
# test_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/CrossMatch/Testing/Livetest.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/CrossMatch/Testing/Faketest.txt',ATTACK]
# ]
#resized
#/home/shashank/Desktop/Fingerprint/dataset
# train_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/1test.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/1test.txt',ATTACK]
# ]
# test_filelists=[
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/1test.txt',GENUINE],
# ['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/1test.txt',ATTACK]
# ]
#ultimate
train_filelists=[
['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/ultimate/Train/Livetest.txt',GENUINE],
['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/ultimate/Train/Spooftest.txt',ATTACK]
]
test_filelists=[
['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/ultimate/Test/Livetest.txt',GENUINE],
['/home/shashank/Desktop/Fingerprint/dataset','/home/shashank/Desktop/Fingerprint/dataset/ultimate/Test/Spooftest.txt',ATTACK]
]
#load_model_path = 'checkpoints/model.pth' # 加载预训练的模型的路径,为None代表不加载
load_model_path = None # 加载预训练的模型的路径,为None代表不加载
batch_size = 8# batch size
use_gpu = torch.cuda.is_available() # use GPU or not
#use_gpu = True # use GPU or not
num_workers = 8 # how many workers for loading data
print_freq = 20 # print info every N batch
debug_file = '/tmp/debug' # if os.path.exists(debug_file): enter ipdb
result_name = 'result'
max_epoch = 5
lr = 0.01 # initial learning rate
lr_decay = 0.5 # when val_loss increase, lr = lr*lr_decay
lr_stepsize=3#learning step size
weight_decay = 1e-5 # 损失函数
cropscale = 3.5
image_size = 224
def parse(self, kwargs):
'''
根据字典kwargs 更新 config参数
'''
# 更新配置参数
for k, v in kwargs.items():
if not hasattr(self, k):
# 警告还是报错,取决于你个人的喜好
warnings.warn("Warning: opt has not attribut %s" %k)
setattr(self, k, v)
# 打印配置信息
print('user config:')
for k, v in self.__class__.__dict__.items():
if not k.startswith('__'):
print(k, getattr(self, k))
DefaultConfig.parse = parse
opt = DefaultConfig()
| 46.607477 | 151 | 0.72689 | 572 | 4,987 | 6.256993 | 0.232517 | 0.164292 | 0.260129 | 0.410729 | 0.734563 | 0.724225 | 0.724225 | 0.722828 | 0.722828 | 0.722828 | 0 | 0.005706 | 0.121516 | 4,987 | 106 | 152 | 47.04717 | 0.81123 | 0.660116 | 0 | 0 | 0 | 0 | 0.322202 | 0.277056 | 0 | 0 | 0 | 0 | 0 | 1 | 0.025 | false | 0 | 0.05 | 0 | 0.6 | 0.175 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 8 |
3eaf57c059f9269320a251f0d6ae1777cee35e3f | 24,808 | py | Python | CompNeuroPy/neuron_models.py | Olimaol/CompNeuroPy | 6112dd34bcae9191e496bda85fabdf5ea7be4818 | [
"MIT"
] | null | null | null | CompNeuroPy/neuron_models.py | Olimaol/CompNeuroPy | 6112dd34bcae9191e496bda85fabdf5ea7be4818 | [
"MIT"
] | null | null | null | CompNeuroPy/neuron_models.py | Olimaol/CompNeuroPy | 6112dd34bcae9191e496bda85fabdf5ea7be4818 | [
"MIT"
] | null | null | null | from ANNarchy import Neuron
Izhikevich2007 = Neuron(
parameters="""
C = 0 : population # pF
k = 0 : population # pS * mV**-1
v_r = 0 : population # mV
v_t = 0 : population # mV
a = 0 : population # ms**-1
b = 0 : population # nS
c = 0 : population # mV
d = 0 : population # pA
v_peak = 0 : population # mV
I_app = 0 # pA
""",
equations="""
C * dv/dt = k*(v - v_r)*(v - v_t) - u + I_app
du/dt = a*(b*(v - v_r) - u)
""",
spike = "v >= v_peak",
reset = """
v = c
u = u + d
""",
name = "Izhikevich2007",
description = "Simple neuron model equations from Izhikevich (2007)."
)
Izhikevich2007_voltage_clamp = Neuron(
parameters="""
C = 0 : population # pF
k = 0 : population # pS * mV**-1
v_r = 0 : population # mV
v_t = 0 : population # mV
a = 0 : population # ms**-1
b = 0 : population # nS
c = 0 : population # mV
d = 0 : population # pA
v_peak = 0 : population # mV
I_app = 0 # pA
""",
equations="""
C * dv/dt = 0
du/dt = a*(b*(v - v_r) - u)
I_inf = k*(v - v_r)*(v - v_t) - u + I_app
""",
spike = "v >= v_peak",
reset = """
v = c
u = u + d
""",
name = "Izhikevich2007_vc",
description = "Simple neuron model equations from Izhikevich (2007). With voltage clamp to record I_inf."
)
Izhikevich2007_syn = Neuron(
parameters="""
C = 0 : population # pF
k = 0 : population # pS * mV**-1
v_r = 0 : population # mV
v_t = 0 : population # mV
a = 0 : population # ms**-1
b = 0 : population # nS
c = 0 : population # mV
d = 0 : population # pA
v_peak = 0 : population # mV
I_app = 0 # pA
tau_ampa = 10 : population # ms
tau_gaba = 10 : population # ms
E_ampa = 0 : population # mV
E_gaba = -90 : population # mV
""",
equations="""
dg_ampa/dt = -g_ampa/tau_ampa
dg_gaba/dt = -g_gaba/tau_gaba
C * dv/dt = k*(v - v_r)*(v - v_t) - u + I_app - g_ampa*(v - E_ampa) - g_gaba*(v - E_gaba)
du/dt = a*(b*(v - v_r) - u)
""",
spike = "v >= v_peak",
reset = """
v = c
u = u + d
""",
name = "Izhikevich2007_syn",
description = "Simple neuron model equations from Izhikevich (2007) with conductance-based AMPA and GABA synapses/currents."
)
Izhikevich2007_Corbit = Neuron(
parameters="""
C = 0 : population # pF
k = 0 : population #
p1 = 0 : population #
p2 = 0 : population #
p3 = 0 : population #
v_r = 0 : population # mV
v_t = 0 : population # mV
a = 0 : population # ms**-1
b = 0 : population # nS
c = 0 : population # mV
d = 0 : population # pA
v_peak = 0 : population # mV
I_app = 0 # pA
""",
equations="""
I_inst = k*(v - v_r)*(v - v_t)*(1+p2*pos(v - v_r)) + p1*(v_d - v)
C * dv/dt = k*(v - v_r)*(v - v_t)*(1+p2*pos(v - v_r)) - u + p1*(v_d - v) + I_app
du/dt = a*(b*pos(v - v_r)**4 - u)
dv_d/dt = p3*(v - v_d)
""",
spike = "v >= v_peak",
reset = """
v = c
u = u + d
""",
name = "Izhikevich2007_Corbit",
description = "Simple neuron model equations from Izhikevich (2007) adjusted to fit Corbit et al. (2016) FSI neuron model."
)
Izhikevich2007_Corbit2 = Neuron(
parameters="""
C = 0 : population # pF
k = 0 : population #
p1 = 0 : population #
p2 = 0 : population #
v_r = 0 : population # mV
v_t = 0 : population # mV
a = 0 : population # ms**-1
b = 0 : population # nS
c = 0 : population # mV
d = 0 : population # pA
v_peak = 0 : population # mV
I_app = 0 # pA
""",
equations="""
C * dv/dt = k*(v - v_r)*(v - v_t) - u + p1*(v_d - v) + I_app
du/dt = a*(b*(v - v_r) - u)
dv_d/dt = p2*(v - v_d)
""",
spike = "v >= v_peak",
reset = """
v = c
u = u + d
""",
name = "Izhikevich2007_Corbit",
description = "Simple neuron model equations from Izhikevich (2007) adjusted version should be able to produce late spiking."
)
Izhikevich2007_Corbit3 = Neuron(
parameters="""
C = 0 : population # pF
k = 0 : population #
p1 = 0 : population #
p2 = 0 : population #
p3 = 0 : population #
v_r = 0 : population # mV
v_t = 0 : population # mV
a = 0 : population # ms**-1
b = 0 : population # nS
c = 0 : population # mV
d = 0 : population # pA
v_peak = 0 : population # mV
I_app = 0 # pA
""",
equations="""
C * dv/dt = k*(v - v_r)*(v - v_t) - u + s*p1*(v_d - v) + I_app
du/dt = a*(b*(v - v_r) - u)
dv_d/dt = p2*(v - v_d)
ds/dt = p3*(-s) : init=0
""",
spike = "v >= v_peak",
reset = """
v = c
u = u + d
s = 1
""",
name = "Izhikevich2007_Corbit",
description = "Simple neuron model equations from Izhikevich (2007) adjusted version should be able to produce late spiking."
)
H_and_H_Bischop = Neuron(
parameters="""
C_m = 30 # pF
gg_L = 2.5 # nS
E_L = -68 # mV
gg_Na = 700 # nS
E_Na = 74 # mV
gg_Kv1 = 2 # nS
gg_Kv3 = 300 # nS
gg_SK = 2 # nS
E_K = -90 # mV
K_SK = 0.5 # yM --> strange units for k
F = 96485.332 # (As)/M --> strange units for I_Ca / (2 * F * A * d)
A = 3000 # ym**2
d = 0.2 # ym
gamma = 1 # ms**-1
Ca_rest = 0.07 # yM
k_on_ca = 0.1 # yM**-1 * ms**-1
k_off_ca = 0.001 # ms**-1
k_on_mg = 0.0008 # yM**-1 * ms**-1
k_off_mg = 0.025 # ms**-1
Mg = 500 # yM
PV_T = 63.5 # yM, from Lee et al. (2000), The Journal of physiology, Kinetics
# in Bischop et al. (2012) varied from 50 - 1000 yM
gg_Ca = 30 # nS
E_Ca = 80 # mV
I_app = 0 # pA
vt = 30 # mV
""",
equations="""
prev_v = v
I_L = gg_L * (v - E_L)
alpha_h = 0.0035 * exp(-v / 24.186)
beta_h = 0.017 * (-51.25 - v) / (exp((-51.25 - v) / 5.2) - 1)
h_inf = alpha_h / (alpha_h + beta_h)
tau_h = 1 / (alpha_h + beta_h)
dh/dt = (h_inf - h) / tau_h
alpha_m = 40 * (75.5 - v) / (exp((75.5 - v) / 13.5) - 1)
beta_m = 1.2262 * exp(-v/42.248)
m_inf = alpha_m / (alpha_m + beta_m)
m = m_inf
I_Na = gg_Na * m**3 * h * (v - E_Na)
alpha_n1 = 0.014 * (-44 - v) / (exp((-44 - v) / 2.3) - 1)
beta_n1 = 0.0043 * exp((44 + v) / 34)
n1_inf = alpha_n1 / (alpha_n1 + beta_n1)
tau_n1 = 1 / (alpha_n1 + beta_n1)
dn1/dt = (n1_inf - n1) / tau_n1
I_Kv1 = gg_Kv1 * n1**4 * (v - E_K)
alpha_n3 = (95 - v) / (exp((95 - v) / 11.8) - 1)
beta_n3 = 0.025 * exp(-v / 22.222)
n3_inf = alpha_n3 / (alpha_n3 + beta_n3)
tau_n3 = 1 / (alpha_n3 + beta_n3)
dn3/dt = (n3_inf - n3) / tau_n3
I_Kv3 = gg_Kv3 * n3**2 * (v - E_K)
PV = PV_T - PV_Ca - PV_Mg
dPV_Mg/dt = k_on_mg * Mg * PV - k_off_mg * PV_Mg
dPV_Ca_dt = k_on_ca * Ca * PV - k_off_ca * PV_Ca
dPV_Ca/dt = dPV_Ca_dt
dCa/dt = I_Ca / (2 * F * A * d) - gamma * (Ca - Ca_rest) - dPV_Ca_dt
k_inf = Ca / (K_SK + Ca)
tau_k = 1 / (K_SK + Ca)
dk/dt = (k_inf - k) / tau_k
I_SK = gg_SK * k**2 * (v - E_K)
a_inf = 1 / (1 + exp((-6-v) / 7.775))
a = a_inf
I_Ca = gg_Ca * a**2 * (v - E_Ca)
C_m * dv/dt = -I_L - I_Na - I_Kv1 - I_Kv3 - I_SK - I_Ca + I_app : init=-68
""",
spike = "(v > vt) and (prev_v <= vt)",
reset = "",
name = "H_and_H_Bischop",
description = "H & H model of Bischop et al. (2012)."
)
H_and_H_Bischop_syn = Neuron(
parameters="""
C_m = 30 # pF
gg_L = 2.5 # nS
E_L = -68 # mV
gg_Na = 700 # nS
E_Na = 74 # mV
gg_Kv1 = 2 # nS
gg_Kv3 = 300 # nS
gg_SK = 2 # nS
E_K = -90 # mV
K_SK = 0.5 # yM --> strange units for k
F = 96485.332 # (As)/M --> strange units for I_Ca / (2 * F * A * d)
A = 3000 # ym**2
d = 0.2 # ym
gamma = 1 # ms**-1
Ca_rest = 0.07 # yM
k_on_ca = 0.1 # yM**-1 * ms**-1
k_off_ca = 0.001 # ms**-1
k_on_mg = 0.0008 # yM**-1 * ms**-1
k_off_mg = 0.025 # ms**-1
Mg = 500 # yM
PV_T = 63.5 # yM, from Lee et al. (2000), The Journal of physiology, Kinetics
# in Bischop et al. (2012) varied from 50 - 1000 yM
gg_Ca = 30 # nS
E_Ca = 80 # mV
I_app = 0 # pA
vt = 30 # mV
tau_ampa = 10 : population # ms
tau_gaba = 10 : population # ms
E_ampa = 0 : population # mV
E_gaba = -90 : population # mV
""",
equations="""
dg_ampa/dt = -g_ampa/tau_ampa
dg_gaba/dt = -g_gaba/tau_gaba
prev_v = v
I_L = gg_L * (v - E_L)
alpha_h = 0.0035 * exp(-v / 24.186)
beta_h = 0.017 * (-51.25 - v) / (exp((-51.25 - v) / 5.2) - 1)
h_inf = alpha_h / (alpha_h + beta_h)
tau_h = 1 / (alpha_h + beta_h)
dh/dt = (h_inf - h) / tau_h
alpha_m = 40 * (75.5 - v) / (exp((75.5 - v) / 13.5) - 1)
beta_m = 1.2262 * exp(-v/42.248)
m_inf = alpha_m / (alpha_m + beta_m)
m = m_inf
I_Na = gg_Na * m**3 * h * (v - E_Na)
alpha_n1 = 0.014 * (-44 - v) / (exp((-44 - v) / 2.3) - 1)
beta_n1 = 0.0043 * exp((44 + v) / 34)
n1_inf = alpha_n1 / (alpha_n1 + beta_n1)
tau_n1 = 1 / (alpha_n1 + beta_n1)
dn1/dt = (n1_inf - n1) / tau_n1
I_Kv1 = gg_Kv1 * n1**4 * (v - E_K)
alpha_n3 = (95 - v) / (exp((95 - v) / 11.8) - 1)
beta_n3 = 0.025 * exp(-v / 22.222)
n3_inf = alpha_n3 / (alpha_n3 + beta_n3)
tau_n3 = 1 / (alpha_n3 + beta_n3)
dn3/dt = (n3_inf - n3) / tau_n3
I_Kv3 = gg_Kv3 * n3**2 * (v - E_K)
PV = PV_T - PV_Ca - PV_Mg
dPV_Mg/dt = k_on_mg * Mg * PV - k_off_mg * PV_Mg
dPV_Ca_dt = k_on_ca * Ca * PV - k_off_ca * PV_Ca
dPV_Ca/dt = dPV_Ca_dt
dCa/dt = I_Ca / (2 * F * A * d) - gamma * (Ca - Ca_rest) - dPV_Ca_dt
k_inf = Ca / (K_SK + Ca)
tau_k = 1 / (K_SK + Ca)
dk/dt = (k_inf - k) / tau_k
I_SK = gg_SK * k**2 * (v - E_K)
a_inf = 1 / (1 + exp((-6-v) / 7.775))
a = a_inf
I_Ca = gg_Ca * a**2 * (v - E_Ca)
C_m * dv/dt = -I_L - I_Na - I_Kv1 - I_Kv3 - I_SK - I_Ca + I_app - g_ampa*(v - E_ampa) - g_gaba*(v - E_gaba) : init=-68
""",
spike = "(v > vt) and (prev_v <= vt)",
reset = "",
name = "H_and_H_Bischop",
description = "H & H model of Bischop et al. (2012)."
)
H_and_H_Corbit = Neuron(
parameters="""
v_t = 0 # :population #mV (see Corbit et al.,2016 under "Model analysis")
C_m = 1.0 # :population #myF/cm^2
v_L = -70 # :population # mV
gg_L = 0.25 # :population # mS/cm^2
E_Na = 50 # :population # mV
gg_Na = 112.5 # :population # mS/cm^2
th_m_Na = -24.0 # :population # mV
k_m_Na = 11.5 # :population # mV
tau_0_m_Na = 0 # :population # ms default value (Corbit et al., 2016 description table 1)
tau_1_m_Na = 0 # :population # ms default value (Corbit et al., 2016 description table 1)
sigma_0_m_Na = 1 # :population # mV default value (Corbit et al., 2016 description table 1)
th_h_Na = -58.3 # :population # mV
k_h_Na = -6.7 # :population # mV
phi_h_Na = -60 # :population # mV
sigma_0_h_Na = -12.0# :population # mV
tau_0_h_Na = 0.5 # :population # ms
tau_1_h_Na = 13.5 # :population # ms
E_Kv3 = -90 # :population # mV
gg_Kv3 = 225.0 # :population # mS/cm^2
th_n_Kv3 = -12.4 # :population # mV
k_n_Kv3 = 6.8 # :population # mV
tau_0_n_Kv3 = 0.087 # :population # ms
tau_1_n_Kv3 = 11.313# :population # ms
phi_a_n_Kv3 = -14.6 # :population # mV
phi_b_n_Kv3 = 1.3 # :population # mV
sigma_0_a_n_Kv3 = -8.6 # :population #mV
sigma_0_b_n_Kv3 = 18.7 # :population #mV
E_Kv1 = -90 # :population #mV
gg_Kv1 = 0.39 # :population #mS/cm^2 in Corbit et al. (2016) they use 0.1, but they say they use delayed-tonic firing which is 0.39 in Golomb (2007), 0.39 fits also better to Figure in Corbit et al. (2016)
th_m_Kv1 = -50 # :population #mV
k_m_Kv1 = 20 # :population #mV
tau_m_Kv1 = 2 # :population #ms
th_h_Kv1 = -70 # :population #mV
k_h_Kv1 = -6 # :population #mV
tau_h_Kv1 = 150 # :population #ms
I_app = 0 : population
""",
equations="""
prev_v = v
I_L = gg_L * (v - v_L) #CHECK
# Na current with h particle and instantaneous m:
m_Na = 1.0 / (1.0 + exp((th_m_Na - v) / k_m_Na))
dh_Na/dt = (1.0 / (1.0 + exp((th_h_Na - v) / k_h_Na)) - h_Na) / (tau_0_h_Na + (tau_1_h_Na + tau_0_h_Na) / (1.0 + exp((phi_h_Na - v) / sigma_0_h_Na))) : init=0.8521993432343666 #CHECK, in paper: tau_1-tau_0 in numerator, in code: tau_1+tau_0 (= 14) in numerator, in paper: exp + exp in denominator, in code: exp + 1 in denominator, for MSNs they set the term to 0... maybe for FSIs they set it to 1
I_Na = (v - E_Na) * gg_Na * pow(m_Na,3) * h_Na #CHECK
# Kv3 current with n particle (but in Corbit et al., 2016 paper version h):
n_Kv3_inf = 1.0 / (1.0 + exp((th_n_Kv3 - v) / k_n_Kv3)) #CHECK
tau_n_Kv3_inf = (tau_0_n_Kv3 + (tau_0_n_Kv3 + tau_1_n_Kv3) / (1.0 + exp((phi_a_n_Kv3 - v) / sigma_0_a_n_Kv3)))*(tau_0_n_Kv3 + (tau_0_n_Kv3 + tau_1_n_Kv3) / (1.0 + exp((phi_b_n_Kv3 - v) / sigma_0_b_n_Kv3))) # CHECK
dn_Kv3/dt = (n_Kv3_inf - n_Kv3) / tau_n_Kv3_inf : init=0.00020832726857419512
I_Kv3 = (v - E_Kv3) * gg_Kv3 * pow(n_Kv3,2) #CHECK
# Kv1 current with m, h particle :
dm_Kv1/dt = (1.0 / (1.0 + exp((th_m_Kv1 - v) / k_m_Kv1)) - m_Kv1) / tau_m_Kv1 : init=0.2685669882630486
dh_Kv1/dt = (1.0 / (1.0 + exp((th_h_Kv1 - v) / k_h_Kv1)) - h_Kv1) / tau_h_Kv1 : init=0.5015877164262258
I_Kv1 = (v - E_Kv1) * gg_Kv1 * pow(m_Kv1, 3) * h_Kv1 #CHECK
C_m * dv/dt = -I_L - I_Na - I_Kv3 - I_Kv1 + I_app : init=-70.03810532250634
""",
spike = "(v > v_t) and (prev_v <= v_t)",
reset = "",
name = "H_and_H_Corbit",
description = "H & H model of Corbit et al. (2016)."
)
H_and_H_Corbit_voltage_clamp = Neuron(
parameters="""
v_t = 0 # :population #mV (see Corbit et al.,2016 under "Model analysis")
C_m = 1.0 # :population #myF/cm^2
v_L = -70 # :population # mV
gg_L = 0.25 # :population # mS/cm^2
E_Na = 50 # :population # mV
gg_Na = 112.5 # :population # mS/cm^2
th_m_Na = -24.0 # :population # mV
k_m_Na = 11.5 # :population # mV
tau_0_m_Na = 0 # :population # ms default value (Corbit et al., 2016 description table 1)
tau_1_m_Na = 0 # :population # ms default value (Corbit et al., 2016 description table 1)
sigma_0_m_Na = 1 # :population # mV default value (Corbit et al., 2016 description table 1)
th_h_Na = -58.3 # :population # mV
k_h_Na = -6.7 # :population # mV
phi_h_Na = -60 # :population # mV
sigma_0_h_Na = -12.0# :population # mV
tau_0_h_Na = 0.5 # :population # ms
tau_1_h_Na = 13.5 # :population # ms
E_Kv3 = -90 # :population # mV
gg_Kv3 = 225.0 # :population # mS/cm^2
th_n_Kv3 = -12.4 # :population # mV
k_n_Kv3 = 6.8 # :population # mV
tau_0_n_Kv3 = 0.087 # :population # ms
tau_1_n_Kv3 = 11.313# :population # ms
phi_a_n_Kv3 = -14.6 # :population # mV
phi_b_n_Kv3 = 1.3 # :population # mV
sigma_0_a_n_Kv3 = -8.6 # :population #mV
sigma_0_b_n_Kv3 = 18.7 # :population #mV
E_Kv1 = -90 # :population #mV
gg_Kv1 = 0.39 # :population #mS/cm^2 in Corbit et al. (2016) they use 0.1, but they say they use delayed-tonic firing which is 0.39 in Golomb (2007), 0.39 fits also better to Figure in Corbit et al. (2016)
th_m_Kv1 = -50 # :population #mV
k_m_Kv1 = 20 # :population #mV
tau_m_Kv1 = 2 # :population #ms
th_h_Kv1 = -70 # :population #mV
k_h_Kv1 = -6 # :population #mV
tau_h_Kv1 = 150 # :population #ms
I_app = 0 : population
""",
equations="""
prev_v = v
I_L = gg_L * (v - v_L) #CHECK
# Na current with h particle and instantaneous m:
m_Na = 1.0 / (1.0 + exp((th_m_Na - v) / k_m_Na))
dh_Na/dt = (1.0 / (1.0 + exp((th_h_Na - v) / k_h_Na)) - h_Na) / (tau_0_h_Na + (tau_1_h_Na + tau_0_h_Na) / (1.0 + exp((phi_h_Na - v) / sigma_0_h_Na))) : init=0.8521993432343666 #CHECK, in paper: tau_1-tau_0 in numerator, in code: tau_1+tau_0 (= 14) in numerator, in paper: exp + exp in denominator, in code: exp + 1 in denominator, for MSNs they set the term to 0... maybe for FSIs they set it to 1
I_Na = (v - E_Na) * gg_Na * pow(m_Na,3) * h_Na #CHECK
# Kv3 current with n particle (but in Corbit et al., 2016 paper version h):
n_Kv3_inf = 1.0 / (1.0 + exp((th_n_Kv3 - v) / k_n_Kv3)) #CHECK
tau_n_Kv3_inf = (tau_0_n_Kv3 + (tau_0_n_Kv3 + tau_1_n_Kv3) / (1.0 + exp((phi_a_n_Kv3 - v) / sigma_0_a_n_Kv3)))*(tau_0_n_Kv3 + (tau_0_n_Kv3 + tau_1_n_Kv3) / (1.0 + exp((phi_b_n_Kv3 - v) / sigma_0_b_n_Kv3))) # CHECK
dn_Kv3/dt = (n_Kv3_inf - n_Kv3) / tau_n_Kv3_inf : init=0.00020832726857419512
I_Kv3 = (v - E_Kv3) * gg_Kv3 * pow(n_Kv3,2) #CHECK
# Kv1 current with m, h particle :
dm_Kv1/dt = (1.0 / (1.0 + exp((th_m_Kv1 - v) / k_m_Kv1)) - m_Kv1) / tau_m_Kv1 : init=0.2685669882630486
dh_Kv1/dt = (1.0 / (1.0 + exp((th_h_Kv1 - v) / k_h_Kv1)) - h_Kv1) / tau_h_Kv1 : init=0.5015877164262258
I_Kv1 = (v - E_Kv1) * gg_Kv1 * pow(m_Kv1, 3) * h_Kv1 #CHECK
C_m * dv/dt = 0 : init=-70.03810532250634
I_inf = -I_L - I_Na - I_Kv3 - I_Kv1 + I_app
""",
spike = "(v > v_t) and (prev_v <= v_t)",
reset = "",
name = "H_and_H_Corbit",
description = "H & H model of Corbit et al. (2016)."
)
H_and_H_Corbit_syn = Neuron(
parameters="""
v_t = 0 # :population #mV (see Corbit et al.,2016 under "Model analysis")
C_m = 1.0 # :population #myF/cm^2
v_L = -70 # :population # mV
gg_L = 0.25 # :population # mS/cm^2
E_Na = 50 # :population # mV
gg_Na = 112.5 # :population # mS/cm^2
th_m_Na = -24.0 # :population # mV
k_m_Na = 11.5 # :population # mV
tau_0_m_Na = 0 # :population # ms default value (Corbit et al., 2016 description table 1)
tau_1_m_Na = 0 # :population # ms default value (Corbit et al., 2016 description table 1)
sigma_0_m_Na = 1 # :population # mV default value (Corbit et al., 2016 description table 1)
th_h_Na = -58.3 # :population # mV
k_h_Na = -6.7 # :population # mV
phi_h_Na = -60 # :population # mV
sigma_0_h_Na = -12.0# :population # mV
tau_0_h_Na = 0.5 # :population # ms
tau_1_h_Na = 13.5 # :population # ms
E_Kv3 = -90 # :population # mV
gg_Kv3 = 225.0 # :population # mS/cm^2
th_n_Kv3 = -12.4 # :population # mV
k_n_Kv3 = 6.8 # :population # mV
tau_0_n_Kv3 = 0.087 # :population # ms
tau_1_n_Kv3 = 11.313# :population # ms
phi_a_n_Kv3 = -14.6 # :population # mV
phi_b_n_Kv3 = 1.3 # :population # mV
sigma_0_a_n_Kv3 = -8.6 # :population #mV
sigma_0_b_n_Kv3 = 18.7 # :population #mV
E_Kv1 = -90 # :population #mV
gg_Kv1 = 0.39 # :population #mS/cm^2 in Corbit et al. (2016) they use 0.1, but they say they use delayed-tonic firing which is 0.39 in Golomb (2007), 0.39 fits also better to Figure in Corbit et al. (2016)
th_m_Kv1 = -50 # :population #mV
k_m_Kv1 = 20 # :population #mV
tau_m_Kv1 = 2 # :population #ms
th_h_Kv1 = -70 # :population #mV
k_h_Kv1 = -6 # :population #mV
tau_h_Kv1 = 150 # :population #ms
I_app = 0 : population
tau_ampa = 10 : population # ms
tau_gaba = 10 : population # ms
E_ampa = 0 : population # mV
E_gaba = -90 : population # mV
""",
equations="""
dg_ampa/dt = -g_ampa/tau_ampa
dg_gaba/dt = -g_gaba/tau_gaba
prev_v = v
I_L = gg_L * (v - v_L) #CHECK
# Na current with h particle and instantaneous m:
m_Na = 1.0 / (1.0 + exp((th_m_Na - v) / k_m_Na))
dh_Na/dt = (1.0 / (1.0 + exp((th_h_Na - v) / k_h_Na)) - h_Na) / (tau_0_h_Na + (tau_1_h_Na + tau_0_h_Na) / (1.0 + exp((phi_h_Na - v) / sigma_0_h_Na))) : init=0.8521993432343666 #CHECK, in paper: tau_1-tau_0 in numerator, in code: tau_1+tau_0 (= 14) in numerator, in paper: exp + exp in denominator, in code: exp + 1 in denominator, for MSNs they set the term to 0... maybe for FSIs they set it to 1
I_Na = (v - E_Na) * gg_Na * pow(m_Na,3) * h_Na #CHECK
# Kv3 current with n particle (but in Corbit et al., 2016 paper version h):
n_Kv3_inf = 1.0 / (1.0 + exp((th_n_Kv3 - v) / k_n_Kv3)) #CHECK
tau_n_Kv3_inf = (tau_0_n_Kv3 + (tau_0_n_Kv3 + tau_1_n_Kv3) / (1.0 + exp((phi_a_n_Kv3 - v) / sigma_0_a_n_Kv3)))*(tau_0_n_Kv3 + (tau_0_n_Kv3 + tau_1_n_Kv3) / (1.0 + exp((phi_b_n_Kv3 - v) / sigma_0_b_n_Kv3))) # CHECK
dn_Kv3/dt = (n_Kv3_inf - n_Kv3) / tau_n_Kv3_inf : init=0.00020832726857419512
I_Kv3 = (v - E_Kv3) * gg_Kv3 * pow(n_Kv3,2) #CHECK
# Kv1 current with m, h particle :
dm_Kv1/dt = (1.0 / (1.0 + exp((th_m_Kv1 - v) / k_m_Kv1)) - m_Kv1) / tau_m_Kv1 : init=0.2685669882630486
dh_Kv1/dt = (1.0 / (1.0 + exp((th_h_Kv1 - v) / k_h_Kv1)) - h_Kv1) / tau_h_Kv1 : init=0.5015877164262258
I_Kv1 = (v - E_Kv1) * gg_Kv1 * pow(m_Kv1, 3) * h_Kv1 #CHECK
C_m * dv/dt = -I_L - I_Na - I_Kv3 - I_Kv1 + I_app - g_ampa*(v - E_ampa) - g_gaba*(v - E_gaba) : init=-70.03810532250634
""",
spike = "(v > v_t) and (prev_v <= v_t)",
reset = "",
name = "H_and_H_Corbit",
description = "H & H model of Corbit et al. (2016)."
)
| 40.735632 | 459 | 0.47787 | 3,873 | 24,808 | 2.805319 | 0.060676 | 0.106029 | 0.043074 | 0.032214 | 0.966774 | 0.966774 | 0.966774 | 0.966774 | 0.960792 | 0.949103 | 0 | 0.112772 | 0.393421 | 24,808 | 608 | 460 | 40.802632 | 0.60925 | 0 | 0 | 0.907157 | 0 | 0.081238 | 0.932468 | 0.020683 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.001934 | 0 | 0.001934 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
3ed387c2a599f41a28421a3e6263ee6ba9a37591 | 8,289 | py | Python | couch/tests/test_server.py | madron/django-couch | 21e4c3a0022bdb7cfaff017f72025afbf5220b3b | [
"MIT"
] | null | null | null | couch/tests/test_server.py | madron/django-couch | 21e4c3a0022bdb7cfaff017f72025afbf5220b3b | [
"MIT"
] | null | null | null | couch/tests/test_server.py | madron/django-couch | 21e4c3a0022bdb7cfaff017f72025afbf5220b3b | [
"MIT"
] | null | null | null | from django.test import override_settings
from django.test import SimpleTestCase
from .. import exceptions
from .. import Server
from ..test import CouchTestCase
class ServerTest(CouchTestCase):
def test_database(self):
server = Server()
self.assertNotIn('mydb', server.list_databases())
# Create database
server.create_database('mydb')
# Check database list
self.assertIn('mydb', server.list_databases())
def test_create_database(self):
server = Server()
db = server.create_database('acme')
self.assertEqual(db.name, 'acme')
self.assertEqual(db.server.alias, 'default')
def test_get_database_not_found_check(self):
server = Server()
with self.assertRaises(exceptions.CouchError):
server.get_database('acme', check=True)
def test_get_database_not_found_no_check(self):
server = Server()
db = server.get_database('acme')
self.assertEqual(db.name, 'acme')
self.assertEqual(db.server.alias, 'default')
def test_get_database_ok(self):
server = Server()
server.create_database('acme')
db = server.get_database('acme', check=True)
self.assertEqual(db.name, 'acme')
self.assertEqual(db.server.alias, 'default')
def test_get_or_create_database_existing(self):
server = Server()
server.create_database('acme')
db, created = server.get_or_create_database('acme')
self.assertEqual(db.name, 'acme')
self.assertEqual(db.server.alias, 'default')
self.assertFalse(created)
def test_get_or_create_database_not_existing(self):
server = Server()
db, created = server.get_or_create_database('acme')
self.assertEqual(db.name, 'acme')
self.assertEqual(db.server.alias, 'default')
self.assertTrue(created)
@override_settings(COUCH_SERVERS=dict(default=dict(HOST='nowhere.example.com')))
def test_get_or_create_database_ko(self):
server = Server()
with self.assertRaises(exceptions.CouchError):
server.get_or_create_database('acme')
def test_list_databases(self):
server = Server()
self.assertNotIn('mydb', server.list_databases())
server.create_database('mydb')
self.assertIn('mydb', server.list_databases())
# Databases created without prefix are not listed
server.put('/a_l_r_e_a_d_y___p_r_e_s_e_n_t____d_b')
self.assertNotIn('a_l_r_e_a_d_y___p_r_e_s_e_n_t____d_b', server.list_databases())
server.delete('/a_l_r_e_a_d_y___p_r_e_s_e_n_t____d_b')
def test_delete_database(self):
server = Server()
self.assertNotIn('mydb', server.list_databases())
server.create_database('mydb')
server.delete_database('mydb')
self.assertNotIn('mydb', server.list_databases())
def test_delete_database_not_found(self):
server = Server()
self.assertNotIn('mydb', server.list_databases())
with self.assertRaises(exceptions.CouchError) as context:
server.delete_database('mydb')
self.assertEqual(
context.exception.args[0],
dict(reason='Database does not exist.', error='not_found', status_code=404)
)
def test_delete_database_if_exists_1(self):
server = Server()
server.get_or_create_database('mydb')
server.delete_database_if_exists('mydb')
self.assertNotIn('mydb', server.list_databases())
def test_delete_database_if_exists_2(self):
server = Server()
self.assertNotIn('mydb', server.list_databases())
server.delete_database_if_exists('mydb')
self.assertNotIn('mydb', server.list_databases())
@override_settings(COUCH_SERVERS=dict(default=dict(HOST='nowhere.example.com')))
def test_delete_database_if_exists_ko(self):
server = Server()
with self.assertRaises(exceptions.CouchError) as context:
server.delete_database_if_exists('mydb')
self.assertEqual(context.exception.args[0]['error'], 'requests.exceptions.ConnectionError')
def test_single_node_setup(self):
server = Server()
server.single_node_setup()
@override_settings(COUCH_SERVERS=dict(default=dict(HOST='nowhere.example.com')))
def test_single_node_setup_ko(self):
server = Server()
with self.assertRaises(exceptions.CouchError):
server.single_node_setup()
class DefaultServerTest(SimpleTestCase):
@override_settings(COUCH_SERVERS=dict(default=dict()))
def test_default(self):
server = Server()
self.assertEqual(server.alias, 'default')
self.assertEqual(server.protocol, 'http')
self.assertEqual(server.host, 'localhost')
self.assertEqual(server.port, 5984)
self.assertEqual(server.username, None)
self.assertEqual(server.password, None)
self.assertEqual(server.database_prefix, '')
@override_settings(COUCH_SERVERS=dict(default=dict(PROTOCOL='https', HOST='192.168.1.1', PORT=9999, USERNAME='user', PASSWORD='pass', DATABASE_PREFIX='test_')))
def test_config(self):
server = Server()
self.assertEqual(server.alias, 'default')
self.assertEqual(server.protocol, 'https')
self.assertEqual(server.host, '192.168.1.1')
self.assertEqual(server.port, 9999)
self.assertEqual(server.username, 'user')
self.assertEqual(server.password, 'pass')
self.assertEqual(server.database_prefix, 'test_')
@override_settings(COUCH_SERVERS=dict(default=dict(PROTOCOL='https', HOST='192.168.1.1', PORT=9999, USERNAME='user', PASSWORD='pass', DATABASE_PREFIX='test_')))
def test_override(self):
server = Server(protocol='http', host='couch.example.com', port=8888, username='admin', password='admin', database_prefix='demo_')
self.assertEqual(server.alias, 'default')
self.assertEqual(server.protocol, 'http')
self.assertEqual(server.host, 'couch.example.com')
self.assertEqual(server.port, 8888)
self.assertEqual(server.username, 'admin')
self.assertEqual(server.password, 'admin')
self.assertEqual(server.database_prefix, 'demo_')
class OtherServerTest(SimpleTestCase):
@override_settings(COUCH_SERVERS=dict(another=dict()))
def test_no_default_server(self):
with self.assertRaises(KeyError):
Server()
@override_settings(COUCH_SERVERS=dict(default=dict(), another=dict()))
def test_default(self):
server = Server(alias='another')
self.assertEqual(server.alias, 'another')
self.assertEqual(server.protocol, 'http')
self.assertEqual(server.host, 'localhost')
self.assertEqual(server.port, 5984)
self.assertEqual(server.username, None)
self.assertEqual(server.password, None)
self.assertEqual(server.database_prefix, '')
@override_settings(COUCH_SERVERS=dict(default=dict(), another=dict(PROTOCOL='https', HOST='192.168.1.1', PORT=9999, USERNAME='user', PASSWORD='pass', DATABASE_PREFIX='test_')))
def test_config(self):
server = Server(alias='another')
self.assertEqual(server.alias, 'another')
self.assertEqual(server.protocol, 'https')
self.assertEqual(server.host, '192.168.1.1')
self.assertEqual(server.port, 9999)
self.assertEqual(server.username, 'user')
self.assertEqual(server.password, 'pass')
self.assertEqual(server.database_prefix, 'test_')
@override_settings(COUCH_SERVERS=dict(default=dict(), another=dict(PROTOCOL='https', HOST='192.168.1.1', PORT=9999, USERNAME='user', PASSWORD='pass', DATABASE_PREFIX='test_')))
def test_override(self):
server = Server(alias='another', protocol='http', host='couch.example.com', port=8888, username='admin', password='admin', database_prefix='demo_')
self.assertEqual(server.alias, 'another')
self.assertEqual(server.protocol, 'http')
self.assertEqual(server.host, 'couch.example.com')
self.assertEqual(server.port, 8888)
self.assertEqual(server.username, 'admin')
self.assertEqual(server.password, 'admin')
self.assertEqual(server.database_prefix, 'demo_')
| 43.171875 | 180 | 0.680902 | 984 | 8,289 | 5.50813 | 0.111789 | 0.149446 | 0.162731 | 0.042435 | 0.873432 | 0.843911 | 0.770111 | 0.740775 | 0.725646 | 0.702399 | 0 | 0.015332 | 0.189528 | 8,289 | 191 | 181 | 43.397906 | 0.791456 | 0.010013 | 0 | 0.703704 | 0 | 0 | 0.099244 | 0.017679 | 0 | 0 | 0 | 0 | 0.450617 | 1 | 0.141975 | false | 0.074074 | 0.030864 | 0 | 0.191358 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 9 |
f5c1431f0c61c4097b4745e74e8928f4de7a9cf4 | 47 | py | Python | docs/cours/algorithmie_code/cours_1_code/ressources/projet_test/le_code.py | FrancoisBrucker/cours_informatique | 8e693adefa84770850291fe4562c66d36d77cefa | [
"MIT"
] | 3 | 2021-09-15T12:34:56.000Z | 2021-12-14T09:29:17.000Z | docs/cours/algorithmie_code/cours_1_code/ressources/projet_test/le_code.py | FrancoisBrucker/cours_informatique | 8e693adefa84770850291fe4562c66d36d77cefa | [
"MIT"
] | 1 | 2020-09-29T14:44:09.000Z | 2020-09-29T15:39:01.000Z | docs/cours/algorithmie_code/cours_1_code/ressources/projet_test/le_code.py | FrancoisBrucker/cours_informatique | 8e693adefa84770850291fe4562c66d36d77cefa | [
"MIT"
] | 4 | 2020-10-01T09:12:32.000Z | 2021-12-14T09:29:09.000Z | def bonjour():
return "Bonjour les gens !"
| 15.666667 | 31 | 0.638298 | 6 | 47 | 5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.234043 | 47 | 2 | 32 | 23.5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.382979 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0.5 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 7 |
de70cbec6c565c37ab5ff1f1a92cd76b4f087fed | 179 | py | Python | journal_bot/components/commands/__init__.py | rerobins/rho_journal_bot | 7209171f9eccbbc058237457fb9c446e4eff9b30 | [
"BSD-3-Clause"
] | null | null | null | journal_bot/components/commands/__init__.py | rerobins/rho_journal_bot | 7209171f9eccbbc058237457fb9c446e4eff9b30 | [
"BSD-3-Clause"
] | null | null | null | journal_bot/components/commands/__init__.py | rerobins/rho_journal_bot | 7209171f9eccbbc058237457fb9c446e4eff9b30 | [
"BSD-3-Clause"
] | null | null | null | from journal_bot.components.commands.create_event import create_event
from sleekxmpp.plugins.base import register_plugin
def load_commands():
register_plugin(create_event)
| 22.375 | 69 | 0.843575 | 24 | 179 | 6 | 0.625 | 0.229167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.100559 | 179 | 7 | 70 | 25.571429 | 0.89441 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0.5 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
de974acde69471cacde3e1948abadb6b036e9d32 | 8,097 | py | Python | tests/test_estimate_normals.py | cassfalg/pptk | e08b0184f2e5c5e288f1ff030cf09d11c8864ef1 | [
"MIT"
] | 1 | 2020-11-17T08:08:15.000Z | 2020-11-17T08:08:15.000Z | tests/test_estimate_normals.py | cassfalg/pptk | e08b0184f2e5c5e288f1ff030cf09d11c8864ef1 | [
"MIT"
] | null | null | null | tests/test_estimate_normals.py | cassfalg/pptk | e08b0184f2e5c5e288f1ff030cf09d11c8864ef1 | [
"MIT"
] | null | null | null | import unittest
import pptk
import numpy as np
class TestEstimateNormals(unittest.TestCase):
def test_rand100(self):
np.random.seed(0)
x = pptk.rand(100, 3)
pptk.estimate_normals(x, 5, 0.2,
verbose=False)
pptk.estimate_normals(x, 5, 0.2,
output_eigenvalues=True,
verbose=False)
pptk.estimate_normals(x, 5, 0.2,
output_all_eigenvectors=True,
verbose=False)
pptk.estimate_normals(x, 5, 0.2,
output_eigenvalues=True,
output_all_eigenvectors=True,
verbose=False)
x = np.float32(x)
pptk.estimate_normals(x, 5, 0.2,
verbose=False)
pptk.estimate_normals(x, 5, 0.2,
output_eigenvalues=True,
verbose=False)
pptk.estimate_normals(x, 5, 0.2,
output_all_eigenvectors=True,
verbose=False)
pptk.estimate_normals(x, 5, 0.2,
output_eigenvalues=True,
output_all_eigenvectors=True,
verbose=False)
def test_output_types(self):
# test all 8 combinations of output_* switches
y = np.zeros((10, 3), dtype=np.float64)
y[:, 0] = np.arange(10)
k = 4
r = 3
evals = np.array([2. / 3] + [5. / 4] * 8 + [2. / 3])
evecs = np.array([[1., 0., 0.]] * 10)
nbhd_sizes = np.array([3] + [4] * 8 + [3])
# combo 1: (0, 0, 0)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=False,
output_all_eigenvectors=False,
output_neighborhood_sizes=False,
verbose=False)
self.assertTrue(isinstance(z, np.ndarray) and z.shape == (10, 3))
# combo 2: (0, 0, 1)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=False,
output_all_eigenvectors=False,
output_neighborhood_sizes=True,
verbose=False)
self.assertTrue(
isinstance(z, tuple) and len(z) == 3 and
[type(i) for i in z] == [np.ndarray, type(None), np.ndarray] and
z[0].shape == (10, 3) and z[2].shape == (10, ))
self.assertTrue(np.all(z[2] == nbhd_sizes))
# combo 3: (0, 1, 0)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=False,
output_all_eigenvectors=True,
output_neighborhood_sizes=False,
verbose=False)
self.assertTrue(isinstance(z, np.ndarray) and z.shape == (10, 3, 3))
# combo 4: (0, 1, 1)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=False,
output_all_eigenvectors=True,
output_neighborhood_sizes=True,
verbose=False)
self.assertTrue(
isinstance(z, tuple) and len(z) == 3 and
[type(i) for i in z] == [np.ndarray, type(None), np.ndarray] and
z[0].shape == (10, 3, 3) and z[2].shape == (10, ))
self.assertTrue(np.allclose(z[0][:, -1, :], evecs))
self.assertTrue(np.all(z[2] == nbhd_sizes))
# combo 5: (1, 0, 0)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=True,
output_all_eigenvectors=False,
output_neighborhood_sizes=False,
verbose=False)
self.assertTrue(
isinstance(z, tuple) and len(z) == 3 and
[type(i) for i in z] == [np.ndarray, np.ndarray, type(None)] and
z[0].shape == (10, 3) and z[1].shape == (10, ))
# combo 6: (1, 0, 1)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=True,
output_all_eigenvectors=False,
output_neighborhood_sizes=True,
verbose=False)
self.assertTrue(
isinstance(z, tuple) and len(z) == 3 and
[type(i) for i in z] == [np.ndarray, np.ndarray, np.ndarray] and
[i.shape for i in z] == [(10, 3), (10, ), (10, )])
self.assertTrue(np.all(z[2] == nbhd_sizes))
# combo 7: (1, 1, 0)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=True,
output_all_eigenvectors=True,
output_neighborhood_sizes=False,
verbose=False)
self.assertTrue(
isinstance(z, tuple) and len(z) == 3 and
[type(i) for i in z] == [np.ndarray, np.ndarray, type(None)] and
z[0].shape == (10, 3, 3) and z[1].shape == (10, 3))
self.assertTrue(np.allclose(z[0][:, -1, :], evecs))
self.assertTrue(np.allclose(z[1][:, -1], evals))
# combo 8: (1, 1, 1)
z = pptk.estimate_normals(y, k, r,
output_eigenvalues=True,
output_all_eigenvectors=True,
output_neighborhood_sizes=True,
verbose=False)
self.assertTrue(
isinstance(z, tuple) and len(z) == 3 and
[type(i) for i in z] == [np.ndarray, np.ndarray, np.ndarray] and
[i.shape for i in z] == [(10, 3, 3), (10, 3), (10, )])
self.assertTrue(np.allclose(z[0][:, -1, :], evecs))
self.assertTrue(np.allclose(z[1][:, -1], evals))
self.assertTrue(np.all(z[2] == nbhd_sizes))
def test_neighborhood_types(self):
pass
def test_subsample(self):
y = np.zeros((10, 3), dtype=np.float64)
y[:, 0] = np.arange(10)
k = 4
r = 3
evals = np.array([2. / 3] + [5. / 4] * 8 + [2. / 3])
evecs = np.array([[1., 0., 0.]] * 10)
nbhd_sizes = np.array([3] + [4] * 8 + [3])
s = [0, 3, 4, -1]
mask = np.zeros(10, dtype=np.bool)
mask[s] = True
z = pptk.estimate_normals(y, k, r,
subsample=mask,
output_eigenvalues=True,
output_all_eigenvectors=True,
output_neighborhood_sizes=True,
verbose=False)
self.assertTrue(np.allclose(z[0][:, -1, :], evecs[s]))
self.assertTrue(np.allclose(z[1][:, -1], evals[s]))
self.assertTrue(np.all(z[2] == nbhd_sizes[s]))
mask = np.zeros(2, dtype=np.bool)
with self.assertRaises(ValueError):
pptk.estimate_normals(y, k, r,
subsample=mask,
output_eigenvalues=True,
output_all_eigenvectors=True,
output_neighborhood_sizes=True,
verbose=False)
z = pptk.estimate_normals(y, k, r,
subsample=s,
output_eigenvalues=True,
output_all_eigenvectors=True,
output_neighborhood_sizes=True,
verbose=False)
self.assertTrue(np.allclose(z[0][:, -1, :], evecs[s]))
self.assertTrue(np.allclose(z[1][:, -1], evals[s]))
self.assertTrue(np.all(z[2] == nbhd_sizes[s]))
if __name__ == '__main__':
unittest.main()
| 43.299465 | 76 | 0.447697 | 883 | 8,097 | 3.98188 | 0.091733 | 0.091581 | 0.102673 | 0.078214 | 0.884243 | 0.884243 | 0.879693 | 0.879693 | 0.860637 | 0.847838 | 0 | 0.045742 | 0.433 | 8,097 | 186 | 77 | 43.532258 | 0.720105 | 0.024207 | 0 | 0.814103 | 0 | 0 | 0.001014 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.025641 | false | 0.00641 | 0.019231 | 0 | 0.051282 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
720478f244e0cc97cdd040ec175a7ce4dfedce40 | 83,451 | py | Python | envjoy/tests/test_env.py | grimen/python-envjoy | e4abcc7251a400850c67419a96d29fe97f000fef | [
"MIT"
] | null | null | null | envjoy/tests/test_env.py | grimen/python-envjoy | e4abcc7251a400850c67419a96d29fe97f000fef | [
"MIT"
] | null | null | null | envjoy/tests/test_env.py | grimen/python-envjoy | e4abcc7251a400850c67419a96d29fe97f000fef | [
"MIT"
] | null | null | null |
# =========================================
# IMPORTS
# --------------------------------------
from __future__ import print_function # Python 2
import rootpath
rootpath.append()
from envjoy.tests import helper
import envjoy
import inspecta
import json
from os import environ
from collections import Iterable, Iterator, OrderedDict
from six import PY2, PY3, string_types
environ['COLORS'] = 'true' # lower prio
environ['VERBOSE'] = 'true' # lower prio
environ['ENV_COLORS'] = 'false' # higher prio
environ['ENV_VERBOSE'] = 'false' # higher prio
# =========================================
# HELPERS
# --------------------------------------
def env_get(key, default = None):
return environ.get(key, default)
def env_set(key, value):
environ[key] = str(value)
def env_del(key):
try:
del environ[key]
except:
pass
def env_clear():
for key in environ.keys():
env_del(key)
# =========================================
# TEST
# --------------------------------------
class TestCase(helper.TestCase):
def test__import(self):
self.assertModule(envjoy)
def test_get(self):
self.assertTrue(hasattr(envjoy.env, 'get'))
self.assertTrue(callable(envjoy.env.get))
environ.clear()
self.assertDeepEqual(envjoy.env.get('FOO'), None)
self.assertDeepEqual(envjoy.env.get('BAR'), None)
environ['FOO'] = '0'
self.assertDeepEqual(envjoy.env.get('FOO'), 0)
self.assertDeepEqual(envjoy.env.get('FOO', bool), False)
self.assertDeepEqual(envjoy.env.get('FOO', int), 0)
self.assertDeepEqual(envjoy.env.get('FOO', float), 0.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '0')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (0,))
self.assertDeepEqual(envjoy.env.get('FOO', list), [0])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '1'
self.assertDeepEqual(envjoy.env.get('FOO'), 1)
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 1)
self.assertDeepEqual(envjoy.env.get('FOO', float), 1.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '1')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (1,))
self.assertDeepEqual(envjoy.env.get('FOO', list), [1])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '-1'
self.assertDeepEqual(envjoy.env.get('FOO'), -1)
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), -1)
self.assertDeepEqual(envjoy.env.get('FOO', float), -1.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '-1')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (-1,))
self.assertDeepEqual(envjoy.env.get('FOO', list), [-1])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '12.34'
self.assertDeepEqual(envjoy.env.get('FOO'), 12.34)
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
self.assertDeepEqual(envjoy.env.get('FOO', float), 12.34)
self.assertDeepEqual(envjoy.env.get('FOO', str), '12.34')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (12.34,))
self.assertDeepEqual(envjoy.env.get('FOO', list), [12.34])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '-12.34'
self.assertDeepEqual(envjoy.env.get('FOO'), -12.34)
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), -12)
self.assertDeepEqual(envjoy.env.get('FOO', float), -12.34)
self.assertDeepEqual(envjoy.env.get('FOO', str), '-12.34')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (-12.34,))
self.assertDeepEqual(envjoy.env.get('FOO', list), [-12.34])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = 'foo bar baz 1 2 3'
self.assertDeepEqual(envjoy.env.get('FOO'), 'foo bar baz 1 2 3')
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), 'foo bar baz 1 2 3')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo bar baz 1 2 3',))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo bar baz 1 2 3'])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = 'foo,bar,baz,1,2,3'
self.assertDeepEqual(envjoy.env.get('FOO'), 'foo,bar,baz,1,2,3')
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), 'foo,bar,baz,1,2,3')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo,bar,baz,1,2,3',))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo,bar,baz,1,2,3'])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = 'foo, bar, baz, 1, 2, 3'
self.assertDeepEqual(envjoy.env.get('FOO'), 'foo, bar, baz, 1, 2, 3')
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), 'foo, bar, baz, 1, 2, 3')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo, bar, baz, 1, 2, 3',))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo, bar, baz, 1, 2, 3'])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '(foo,bar,baz,1,2,3)'
# self.assertDeepEqual(envjoy.env.get('FOO'), ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '(foo,bar,baz,1,2,3)')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '("foo","bar","baz",1,2,3)'
self.assertDeepEqual(envjoy.env.get('FOO'), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '("foo","bar","baz",1,2,3)')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '((foo,bar),baz,(1,2,3))'
# self.assertDeepEqual(envjoy.env.get('FOO'), (('foo', 'bar'), 'baz', (1, 2, 3)))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '((foo,bar),baz,(1,2,3))')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, 2, 3)))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, 2, 3]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '(("foo","bar"),"baz",(1,2,3))'
self.assertDeepEqual(envjoy.env.get('FOO'), (('foo', 'bar'), 'baz', (1, 2, 3)))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '(("foo","bar"),"baz",(1,2,3))')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, 2, 3)))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, 2, 3]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '([foo,bar],baz,[1,2,3])'
# self.assertDeepEqual(envjoy.env.get('FOO'), (['foo', 'bar'], 'baz', [1, 2, 3]))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '([foo,bar],baz,[1,2,3])')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, 2, 3)))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, 2, 3]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '(["foo","bar"],"baz",[1,2,3])'
self.assertDeepEqual(envjoy.env.get('FOO'), (['foo', 'bar'], 'baz', [1, 2, 3]))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '(["foo","bar"],"baz",[1,2,3])')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, 2, 3)))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, 2, 3]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '(foo, bar, baz, 1, 2, 3)'
# self.assertDeepEqual(envjoy.env.get('FOO'), ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '(foo, bar, baz, 1, 2, 3)')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '("foo", "bar", "baz", 1, 2, 3)'
self.assertDeepEqual(envjoy.env.get('FOO'), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '("foo", "bar", "baz", 1, 2, 3)')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '((foo, bar), baz, (1, (2, 3)))'
# self.assertDeepEqual(envjoy.env.get('FOO'), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '((foo, bar), baz, (1, (2, 3)))')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '(("foo", "bar"), "baz", (1, (2, 3)))'
self.assertDeepEqual(envjoy.env.get('FOO'), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '(("foo", "bar"), "baz", (1, (2, 3)))')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '([foo, bar], baz, [1, [2, 3]])'
# self.assertDeepEqual(envjoy.env.get('FOO'), (['foo', 'bar'], 'baz', [1, [2, 3]]))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '([foo, bar], baz, [1, [2, 3]])')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '(["foo", "bar"], "baz", [1, [2, 3]])'
self.assertDeepEqual(envjoy.env.get('FOO'), (['foo', 'bar'], 'baz', [1, [2, 3]]))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '(["foo", "bar"], "baz", [1, [2, 3]])')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '[foo,bar,baz,1,2,3]'
# self.assertDeepEqual(envjoy.env.get('FOO'), ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[foo,bar,baz,1,2,3]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '["foo","bar","baz",1,2,3]'
self.assertDeepEqual(envjoy.env.get('FOO'), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '["foo","bar","baz",1,2,3]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '[(foo,bar),baz,(1,(2,3))]'
# self.assertDeepEqual(envjoy.env.get('FOO'), [('foo', 'bar'), 'baz', (1, (2, 3))])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[(foo,bar),baz,(1,(2,3))]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [('foo', 'bar'), 'baz', (1, (2, 3))])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '[("foo","bar"),"baz",(1,(2,3))]'
self.assertDeepEqual(envjoy.env.get('FOO'), [('foo', 'bar'), 'baz', (1, (2, 3))])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '[("foo","bar"),"baz",(1,(2,3))]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '[[foo,bar],baz,[1,[2,3]]'
# self.assertDeepEqual(envjoy.env.get('FOO'), [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[[foo,bar],baz,[1,[2,3]]]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '[["foo","bar"],"baz",[1,[2,3]]]'
self.assertDeepEqual(envjoy.env.get('FOO'), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '[["foo","bar"],"baz",[1,[2,3]]]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '[foo, bar, baz, 1, 2, 3]'
# self.assertDeepEqual(envjoy.env.get('FOO'), ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[foo, bar, baz, 1, 2, 3]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '["foo", "bar", "baz", 1, 2, 3]'
self.assertDeepEqual(envjoy.env.get('FOO'), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '["foo", "bar", "baz", 1, 2, 3]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '[(foo, bar), baz, (1, (2, 3))]'
# self.assertDeepEqual(envjoy.env.get('FOO'), [('foo', 'bar'), 'baz', (1, (2, 3))])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[(foo, bar), baz, (1, (2, 3))]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '[("foo", "bar"), "baz", (1, (2, 3))]'
self.assertDeepEqual(envjoy.env.get('FOO'), [('foo', 'bar'), 'baz', (1, (2, 3))])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '[("foo", "bar"), "baz", (1, (2, 3))]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '[[foo, bar], baz, [1, [2, 3]]]'
# self.assertDeepEqual(envjoy.env.get('FOO'), [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[[foo, bar], baz, [1, [2, 3]]]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = '[["foo", "bar"], "baz", [1, [2, 3]]]'
self.assertDeepEqual(envjoy.env.get('FOO'), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '[["foo", "bar"], "baz", [1, [2, 3]]]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
# environ['FOO'] = '((foo, 1), (bar, 2))'
# self.assertDeepEqual(envjoy.env.get('FOO'), (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 12.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '((foo, 1), (bar, 2))')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 1], ['bar', 2]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2})
environ['FOO'] = '(("foo", 1), ("bar", 2))'
self.assertDeepEqual(envjoy.env.get('FOO'), (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
self.assertDeepEqual(envjoy.env.get('FOO', float), 12.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '(("foo", 1), ("bar", 2))')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 1], ['bar', 2]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2})
# environ['FOO'] = '[(foo, 1), (bar, 2)]'
# self.assertDeepEqual(envjoy.env.get('FOO'), [('foo', 1), ('bar', 2)])
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 12.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '[(foo, 1), (bar, 2)]')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 1], ['bar', 2]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2})
environ['FOO'] = '[("foo", 1), ("bar", 2)]'
self.assertDeepEqual(envjoy.env.get('FOO'), [('foo', 1), ('bar', 2)])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
self.assertDeepEqual(envjoy.env.get('FOO', float), 12.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '[("foo", 1), ("bar", 2)]')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 1], ['bar', 2]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2})
# environ['FOO'] = '([foo, 1], [bar, 2])'
# self.assertDeepEqual(envjoy.env.get('FOO'), (['foo', 1], ['bar', 2]))
# self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
# self.assertDeepEqual(envjoy.env.get('FOO', float), 12.0)
# self.assertDeepEqual(envjoy.env.get('FOO', str), '([foo, 1], [bar, 2])')
# self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 1], ['bar', 2]])
# self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2})
environ['FOO'] = '(["foo", 1], ["bar", 2])'
self.assertDeepEqual(envjoy.env.get('FOO'), (['foo', 1], ['bar', 2]))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 12)
self.assertDeepEqual(envjoy.env.get('FOO', float), 12.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), '(["foo", 1], ["bar", 2])')
self.assertDeepEqual(envjoy.env.get('FOO', tuple), (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env.get('FOO', list), [['foo', 1], ['bar', 2]])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2})
environ['FOO'] = str(('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO'), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), "('foo', 'bar', 'baz', 1, 2, 3)")
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = str(['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO'), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), "['foo', 'bar', 'baz', 1, 2, 3]")
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.get('FOO', list), ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {})
environ['FOO'] = str({'foo': 1, 'bar': 2, 'baz': 3})
self.assertDeepEqual(envjoy.env.get('FOO'), {'foo': 1, 'bar': 2, 'baz': 3})
self.assertDeepEqual(envjoy.env.get('FOO', bool), True)
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(envjoy.env['FOO', int], 213)
self.assertDeepEqual(envjoy.env['FOO', float], 213.0)
self.assertDeepEqual(envjoy.env['FOO', str], "{'baz': 3, 'foo': 1, 'bar': 2}")
except:
self.assertDeepEqual(envjoy.env.get('FOO', int), 123)
self.assertDeepEqual(envjoy.env.get('FOO', float), 123.0)
self.assertDeepEqual(envjoy.env.get('FOO', str), "{'foo': 1, 'bar': 2, 'baz': 3}")
self.assertDeepEqual(envjoy.env.get('FOO', tuple), ({'bar': 2, 'baz': 3, 'foo': 1},))
self.assertDeepEqual(envjoy.env.get('FOO', list), [{'bar': 2, 'baz': 3, 'foo': 1}])
self.assertDeepEqual(envjoy.env.get('FOO', dict), {'foo': 1, 'bar': 2, 'baz': 3})
def test_set(self):
self.assertTrue(hasattr(envjoy.env, 'set'))
self.assertTrue(callable(envjoy.env.set))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2')])
envjoy.env.set('BAZ', 3)
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2'), ('BAZ', '3')])
with self.assertRaises(Exception):
envjoy.env.set('FOO')
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', None)
self.assertDeepEqual(list(environ.items()), [('FOO', ''), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', True)
self.assertDeepEqual(list(environ.items()), [('FOO', 'True'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', 'true')
self.assertDeepEqual(list(environ.items()), [('FOO', 'true'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', 0)
self.assertDeepEqual(list(environ.items()), [('FOO', '0'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', '0')
self.assertDeepEqual(list(environ.items()), [('FOO', '0'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', 0.01)
self.assertDeepEqual(list(environ.items()), [('FOO', '0.01'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', '0.01')
self.assertDeepEqual(list(environ.items()), [('FOO', '0.01'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', 'foo bar baz 1 2 3')
self.assertDeepEqual(list(environ.items()), [('FOO', 'foo bar baz 1 2 3'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', 'foo,bar,baz,1,2,3')
self.assertDeepEqual(list(environ.items()), [('FOO', 'foo,bar,baz,1,2,3'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', '(foo,bar,baz,1,2,3)')
self.assertDeepEqual(list(environ.items()), [('FOO', '(foo,bar,baz,1,2,3)'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', '[foo,bar,baz,1,2,3]')
self.assertDeepEqual(list(environ.items()), [('FOO', '[foo,bar,baz,1,2,3]'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(list(environ.items()), [('FOO', "('foo', 'bar', 'baz', 1, 2, 3)"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(list(environ.items()), [('FOO', "['foo', 'bar', 'baz', 1, 2, 3]"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', {'foo': 1, 'bar': 2, 'baz': 3})
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(list(environ.items()), [('BAZ', '3'), ('FOO', "{'bar': 2, 'foo': 1, 'baz': 3}"), ('bar', '2')])
except:
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': 1, 'bar': 2, 'baz': 3}"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', {'foo': {'bar': {'baz': True}}})
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': {'bar': {'baz': True}}}"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.set('FOO', OrderedDict({'foo': 1, 'bar': 2, 'baz': 3}))
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(list(environ.items()), [('BAZ', '3'), ('FOO', "{'baz': 3, 'foo': 1, 'bar': 2}"), ('bar', '2')])
except:
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': 1, 'bar': 2, 'baz': 3}"), ('bar', '2'), ('BAZ', '3')])
def test_delete(self):
self.assertTrue(hasattr(envjoy.env, 'delete'))
self.assertTrue(callable(envjoy.env.delete))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
envjoy.env.delete('BAZ')
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
envjoy.env.delete('FOO')
self.assertDeepEqual(list(environ.keys()), ['bar'])
envjoy.env.delete('BAR')
self.assertDeepEqual(list(environ.keys()), ['bar'])
envjoy.env.delete('bar')
self.assertDeepEqual(list(environ.keys()), [])
def test_exists(self):
self.assertTrue(hasattr(envjoy.env, 'exists'))
self.assertTrue(callable(envjoy.env.exists))
environ.clear()
self.assertDeepEqual(envjoy.env.exists('XXX'), False)
self.assertDeepEqual(envjoy.env.exists('BOOL'), False)
self.assertDeepEqual(envjoy.env.exists('INT'), False)
self.assertDeepEqual(envjoy.env.exists('FLOAT'), False)
self.assertDeepEqual(envjoy.env.exists('TUPLE'), False)
self.assertDeepEqual(envjoy.env.exists('LIST'), False)
self.assertDeepEqual(envjoy.env.exists('DICT'), False)
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(envjoy.env.exists('XXX'), False)
self.assertDeepEqual(envjoy.env.exists('BOOL'), True)
self.assertDeepEqual(envjoy.env.exists('INT'), True)
self.assertDeepEqual(envjoy.env.exists('FLOAT'), True)
self.assertDeepEqual(envjoy.env.exists('TUPLE'), True)
self.assertDeepEqual(envjoy.env.exists('LIST'), True)
self.assertDeepEqual(envjoy.env.exists('DICT'), True)
def test_clear(self):
self.assertTrue(hasattr(envjoy.env, 'clear'))
self.assertTrue(callable(envjoy.env.clear))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
envjoy.env.clear()
self.assertDeepEqual(list(environ.keys()), [])
def test_size(self):
self.assertTrue(hasattr(envjoy.env, 'size'))
self.assertTrue(callable(envjoy.env.size))
self.assertIsInstance(envjoy.env.size(), int)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(envjoy.env.size(), 6)
def test_inspect(self):
self.assertTrue(hasattr(envjoy.env, 'inspect'))
self.assertTrue(callable(envjoy.env.inspect))
environ.clear()
environ['FOO'] = '1'
self.assertIsInstance(envjoy.env.inspect(), string_types)
self.assertDeepEqual(envjoy.env.inspect(), inspecta.inspect({'FOO': 1}))
def test_print(self):
self.assertTrue(hasattr(envjoy.env, 'print'))
self.assertTrue(callable(envjoy.env.print))
with self.assertNotRaises(Exception):
envjoy.env.print()
def test_keys(self):
self.assertTrue(hasattr(envjoy.env, 'keys'))
self.assertTrue(callable(envjoy.env.keys))
self.assertIsInstance(envjoy.env.keys(), Iterable)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(list(envjoy.env.keys()), [
'BOOL',
'INT',
'FLOAT',
'TUPLE',
'LIST',
'DICT',
])
def test_values(self):
self.assertTrue(hasattr(envjoy.env, 'values'))
self.assertTrue(callable(envjoy.env.values))
self.assertIsInstance(envjoy.env.values(), Iterable)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(list(envjoy.env.values()), [
True,
1,
1.01,
(1, 2, 3),
[1, 2, 3],
{'foo': [1, 2, 3]},
])
def test_items(self):
self.assertTrue(hasattr(envjoy.env, 'items'))
self.assertTrue(callable(envjoy.env.items))
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(list(envjoy.env.items()), [
('BOOL', True),
('INT', 1),
('FLOAT', 1.01),
('TUPLE', (1, 2, 3)),
('LIST', [1, 2, 3]),
('DICT', {'foo': [1, 2, 3]}),
])
def test_tolist(self):
self.assertTrue(hasattr(envjoy.env, 'tolist'))
self.assertTrue(callable(envjoy.env.tolist))
self.assertIsInstance(envjoy.env.tolist(), list)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(envjoy.env.tolist(), [
('BOOL', True),
('INT', 1),
('FLOAT', 1.01),
('TUPLE', (1, 2, 3)),
('LIST', [1, 2, 3]),
('DICT', {'foo': [1, 2, 3]}),
])
def test_todict(self):
self.assertTrue(hasattr(envjoy.env, 'todict'))
self.assertTrue(callable(envjoy.env.todict))
self.assertIsInstance(envjoy.env.todict(), dict)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(envjoy.env.todict(), {
'BOOL': True,
'INT': 1,
'FLOAT': 1.01,
'TUPLE': (1, 2, 3),
'LIST': [1, 2, 3],
'DICT': {'foo': [1, 2, 3]},
})
def test___getitem__(self):
self.assertTrue(hasattr(envjoy.env, '__getitem__'))
self.assertTrue(callable(envjoy.env.__getitem__))
environ.clear()
self.assertDeepEqual(envjoy.env['FOO'], None)
self.assertDeepEqual(envjoy.env['BAR'], None)
environ['FOO'] = '0'
self.assertDeepEqual(envjoy.env['FOO'], 0)
self.assertDeepEqual(envjoy.env['FOO', bool], False)
self.assertDeepEqual(envjoy.env['FOO', int], 0)
self.assertDeepEqual(envjoy.env['FOO', float], 0.0)
self.assertDeepEqual(envjoy.env['FOO', str], '0')
self.assertDeepEqual(envjoy.env['FOO', tuple], (0,))
self.assertDeepEqual(envjoy.env['FOO', list], [0])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '1'
self.assertDeepEqual(envjoy.env['FOO'], 1)
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 1)
self.assertDeepEqual(envjoy.env['FOO', float], 1.0)
self.assertDeepEqual(envjoy.env['FOO', str], '1')
self.assertDeepEqual(envjoy.env['FOO', tuple], (1,))
self.assertDeepEqual(envjoy.env['FOO', list], [1])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '-1'
self.assertDeepEqual(envjoy.env['FOO'], -1)
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], -1)
self.assertDeepEqual(envjoy.env['FOO', float], -1.0)
self.assertDeepEqual(envjoy.env['FOO', str], '-1')
self.assertDeepEqual(envjoy.env['FOO', tuple], (-1,))
self.assertDeepEqual(envjoy.env['FOO', list], [-1])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '12.34'
self.assertDeepEqual(envjoy.env['FOO'], 12.34)
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 12)
self.assertDeepEqual(envjoy.env['FOO', float], 12.34)
self.assertDeepEqual(envjoy.env['FOO', str], '12.34')
self.assertDeepEqual(envjoy.env['FOO', tuple], (12.34,))
self.assertDeepEqual(envjoy.env['FOO', list], [12.34])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '-12.34'
self.assertDeepEqual(envjoy.env['FOO'], -12.34)
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], -12)
self.assertDeepEqual(envjoy.env['FOO', float], -12.34)
self.assertDeepEqual(envjoy.env['FOO', str], '-12.34')
self.assertDeepEqual(envjoy.env['FOO', tuple], (-12.34,))
self.assertDeepEqual(envjoy.env['FOO', list], [-12.34])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = 'foo bar baz 1 2 3'
self.assertDeepEqual(envjoy.env['FOO'], 'foo bar baz 1 2 3')
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], 'foo bar baz 1 2 3')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo bar baz 1 2 3',))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo bar baz 1 2 3'])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = 'foo,bar,baz,1,2,3'
self.assertDeepEqual(envjoy.env['FOO'], 'foo,bar,baz,1,2,3')
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], 'foo,bar,baz,1,2,3')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo,bar,baz,1,2,3',))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo,bar,baz,1,2,3'])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = 'foo, bar, baz, 1, 2, 3'
self.assertDeepEqual(envjoy.env['FOO'], 'foo, bar, baz, 1, 2, 3')
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], 'foo, bar, baz, 1, 2, 3')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo, bar, baz, 1, 2, 3',))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo, bar, baz, 1, 2, 3'])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '(foo,bar,baz,1,2,3)'
# self.assertDeepEqual(envjoy.env['FOO'], ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '(foo,bar,baz,1,2,3)')
# self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '("foo","bar","baz",1,2,3)'
self.assertDeepEqual(envjoy.env['FOO'], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '("foo","bar","baz",1,2,3)')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '((foo,bar),baz,(1,2,3))'
# self.assertDeepEqual(envjoy.env['FOO'], (('foo', 'bar'), 'baz', (1, 2, 3)))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '((foo,bar),baz,(1,2,3))')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, 2, 3)))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, 2, 3]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '(("foo","bar"),"baz",(1,2,3))'
self.assertDeepEqual(envjoy.env['FOO'], (('foo', 'bar'), 'baz', (1, 2, 3)))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '(("foo","bar"),"baz",(1,2,3))')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, 2, 3)))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, 2, 3]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '([foo,bar],baz,[1,2,3])'
# self.assertDeepEqual(envjoy.env['FOO'], (['foo', 'bar'], 'baz', [1, 2, 3]))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '([foo,bar],baz,[1,2,3])')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, 2, 3)))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, 2, 3]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '(["foo","bar"],"baz",[1,2,3])'
self.assertDeepEqual(envjoy.env['FOO'], (['foo', 'bar'], 'baz', [1, 2, 3]))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '(["foo","bar"],"baz",[1,2,3])')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, 2, 3)))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, 2, 3]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '(foo, bar, baz, 1, 2, 3)'
# self.assertDeepEqual(envjoy.env['FOO'], ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '(foo, bar, baz, 1, 2, 3)')
# self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '("foo", "bar", "baz", 1, 2, 3)'
self.assertDeepEqual(envjoy.env['FOO'], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '("foo", "bar", "baz", 1, 2, 3)')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '((foo, bar), baz, (1, (2, 3)))'
# self.assertDeepEqual(envjoy.env['FOO'], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '((foo, bar), baz, (1, (2, 3)))')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '(("foo", "bar"), "baz", (1, (2, 3)))'
self.assertDeepEqual(envjoy.env['FOO'], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '(("foo", "bar"), "baz", (1, (2, 3)))')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '([foo, bar], baz, [1, [2, 3]])'
# self.assertDeepEqual(envjoy.env['FOO'], (['foo', 'bar'], 'baz', [1, [2, 3]]))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '([foo, bar], baz, [1, [2, 3]])')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '(["foo", "bar"], "baz", [1, [2, 3]])'
self.assertDeepEqual(envjoy.env['FOO'], (['foo', 'bar'], 'baz', [1, [2, 3]]))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '(["foo", "bar"], "baz", [1, [2, 3]])')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '[foo,bar,baz,1,2,3]'
# self.assertDeepEqual(envjoy.env['FOO'], ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[foo,bar,baz,1,2,3]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '["foo","bar","baz",1,2,3]'
self.assertDeepEqual(envjoy.env['FOO'], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '["foo","bar","baz",1,2,3]')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '[(foo,bar),baz,(1,(2,3))]'
# self.assertDeepEqual(envjoy.env['FOO'], [('foo', 'bar'), 'baz', (1, (2, 3))])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[(foo,bar),baz,(1,(2,3))]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', list], [('foo', 'bar'), 'baz', (1, (2, 3))])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '[("foo","bar"),"baz",(1,(2,3))]'
self.assertDeepEqual(envjoy.env['FOO'], [('foo', 'bar'), 'baz', (1, (2, 3))])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '[("foo","bar"),"baz",(1,(2,3))]')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '[[foo,bar],baz,[1,[2,3]]'
# self.assertDeepEqual(envjoy.env['FOO'], [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[[foo,bar],baz,[1,[2,3]]]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '[["foo","bar"],"baz",[1,[2,3]]]'
self.assertDeepEqual(envjoy.env['FOO'], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '[["foo","bar"],"baz",[1,[2,3]]]')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '[foo, bar, baz, 1, 2, 3]'
# self.assertDeepEqual(envjoy.env['FOO'], ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[foo, bar, baz, 1, 2, 3]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
# self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '["foo", "bar", "baz", 1, 2, 3]'
self.assertDeepEqual(envjoy.env['FOO'], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '["foo", "bar", "baz", 1, 2, 3]')
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '[(foo, bar), baz, (1, (2, 3))]'
# self.assertDeepEqual(envjoy.env['FOO'], [('foo', 'bar'), 'baz', (1, (2, 3))])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[(foo, bar), baz, (1, (2, 3))]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '[("foo", "bar"), "baz", (1, (2, 3))]'
self.assertDeepEqual(envjoy.env['FOO'], [('foo', 'bar'), 'baz', (1, (2, 3))])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '[("foo", "bar"), "baz", (1, (2, 3))]')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '[[foo, bar], baz, [1, [2, 3]]]'
# self.assertDeepEqual(envjoy.env['FOO'], [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 123)
# self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[[foo, bar], baz, [1, [2, 3]]]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = '[["foo", "bar"], "baz", [1, [2, 3]]]'
self.assertDeepEqual(envjoy.env['FOO'], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], '[["foo", "bar"], "baz", [1, [2, 3]]]')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 'bar'), 'baz', (1, (2, 3))))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 'bar'], 'baz', [1, [2, 3]]])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
# environ['FOO'] = '((foo, 1), (bar, 2))'
# self.assertDeepEqual(envjoy.env['FOO'], (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 12)
# self.assertDeepEqual(envjoy.env['FOO', float], 12.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '((foo, 1), (bar, 2))')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 1], ['bar', 2]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2})
environ['FOO'] = '(("foo", 1), ("bar", 2))'
self.assertDeepEqual(envjoy.env['FOO'], (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 12)
self.assertDeepEqual(envjoy.env['FOO', float], 12.0)
self.assertDeepEqual(envjoy.env['FOO', str], '(("foo", 1), ("bar", 2))')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 1], ['bar', 2]])
self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2})
# environ['FOO'] = '[(foo, 1), (bar, 2)]'
# self.assertDeepEqual(envjoy.env['FOO'], [('foo', 1), ('bar', 2)])
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 12)
# self.assertDeepEqual(envjoy.env['FOO', float], 12.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '[(foo, 1), (bar, 2)]')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 1], ['bar', 2]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2})
environ['FOO'] = '[("foo", 1), ("bar", 2)]'
self.assertDeepEqual(envjoy.env['FOO'], [('foo', 1), ('bar', 2)])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 12)
self.assertDeepEqual(envjoy.env['FOO', float], 12.0)
self.assertDeepEqual(envjoy.env['FOO', str], '[("foo", 1), ("bar", 2)]')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 1], ['bar', 2]])
self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2})
# environ['FOO'] = '([foo, 1], [bar, 2])'
# self.assertDeepEqual(envjoy.env['FOO'], (['foo', 1], ['bar', 2]))
# self.assertDeepEqual(envjoy.env['FOO', bool], True)
# self.assertDeepEqual(envjoy.env['FOO', int], 12)
# self.assertDeepEqual(envjoy.env['FOO', float], 12.0)
# self.assertDeepEqual(envjoy.env['FOO', str], '([foo, 1], [bar, 2])')
# self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 1), ('bar', 2)))
# self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 1], ['bar', 2]])
# self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2})
environ['FOO'] = '(["foo", 1], ["bar", 2])'
self.assertDeepEqual(envjoy.env['FOO'], (['foo', 1], ['bar', 2]))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 12)
self.assertDeepEqual(envjoy.env['FOO', float], 12.0)
self.assertDeepEqual(envjoy.env['FOO', str], '(["foo", 1], ["bar", 2])')
self.assertDeepEqual(envjoy.env['FOO', tuple], (('foo', 1), ('bar', 2)))
self.assertDeepEqual(envjoy.env['FOO', list], [['foo', 1], ['bar', 2]])
self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2})
environ['FOO'] = str(('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO'], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], "('foo', 'bar', 'baz', 1, 2, 3)")
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = str(['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO'], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', bool], True)
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], "['foo', 'bar', 'baz', 1, 2, 3]")
self.assertDeepEqual(envjoy.env['FOO', tuple], ('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env['FOO', list], ['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env['FOO', dict], {})
environ['FOO'] = str({'foo': 1, 'bar': 2, 'baz': 3})
self.assertDeepEqual(envjoy.env['FOO'], {'foo': 1, 'bar': 2, 'baz': 3})
self.assertDeepEqual(envjoy.env['FOO', bool], True)
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(envjoy.env['FOO', int], 213)
self.assertDeepEqual(envjoy.env['FOO', float], 213.0)
self.assertDeepEqual(envjoy.env['FOO', str], "{'baz': 3, 'foo': 1, 'bar': 2}")
except:
self.assertDeepEqual(envjoy.env['FOO', int], 123)
self.assertDeepEqual(envjoy.env['FOO', float], 123.0)
self.assertDeepEqual(envjoy.env['FOO', str], "{'foo': 1, 'bar': 2, 'baz': 3}")
self.assertDeepEqual(envjoy.env['FOO', tuple], ({'bar': 2, 'baz': 3, 'foo': 1},))
self.assertDeepEqual(envjoy.env['FOO', list], [{'bar': 2, 'baz': 3, 'foo': 1}])
self.assertDeepEqual(envjoy.env['FOO', dict], {'foo': 1, 'bar': 2, 'baz': 3})
def test___getattr__(self):
self.assertTrue(hasattr(envjoy.env, '__getattr__'))
self.assertTrue(callable(envjoy.env.__getattr__))
environ.clear()
self.assertDeepEqual(envjoy.env.FOO, None)
self.assertDeepEqual(envjoy.env.BAR, None)
environ['FOO'] = '0'
self.assertDeepEqual(envjoy.env.FOO, 0)
environ['FOO'] = '1'
self.assertDeepEqual(envjoy.env.FOO, 1)
environ['FOO'] = '-1'
self.assertDeepEqual(envjoy.env.FOO, -1)
environ['FOO'] = '12.34'
self.assertDeepEqual(envjoy.env.FOO, 12.34)
environ['FOO'] = '-12.34'
self.assertDeepEqual(envjoy.env.FOO, -12.34)
environ['FOO'] = 'foo bar baz 1 2 3'
self.assertDeepEqual(envjoy.env.FOO, 'foo bar baz 1 2 3')
environ['FOO'] = 'foo,bar,baz,1,2,3'
self.assertDeepEqual(envjoy.env.FOO, 'foo,bar,baz,1,2,3')
environ['FOO'] = 'foo, bar, baz, 1, 2, 3'
self.assertDeepEqual(envjoy.env.FOO, 'foo, bar, baz, 1, 2, 3')
# environ['FOO'] = '(foo,bar,baz,1,2,3)'
# self.assertDeepEqual(envjoy.env.FOO, ('foo', 'bar', 'baz', 1, 2, 3))
environ['FOO'] = '("foo","bar","baz",1,2,3)'
self.assertDeepEqual(envjoy.env.FOO, ('foo', 'bar', 'baz', 1, 2, 3))
# environ['FOO'] = '((foo,bar),baz,(1,2,3))'
# self.assertDeepEqual(envjoy.env.FOO, (('foo', 'bar'), 'baz', (1, 2, 3)))
environ['FOO'] = '(("foo","bar"),"baz",(1,2,3))'
self.assertDeepEqual(envjoy.env.FOO, (('foo', 'bar'), 'baz', (1, 2, 3)))
# environ['FOO'] = '([foo,bar],baz,[1,2,3])'
# self.assertDeepEqual(envjoy.env.FOO, (['foo', 'bar'], 'baz', [1, 2, 3]))
environ['FOO'] = '(["foo","bar"],"baz",[1,2,3])'
self.assertDeepEqual(envjoy.env.FOO, (['foo', 'bar'], 'baz', [1, 2, 3]))
# environ['FOO'] = '(foo, bar, baz, 1, 2, 3)'
# self.assertDeepEqual(envjoy.env.FOO, ('foo', 'bar', 'baz', 1, 2, 3))
environ['FOO'] = '("foo", "bar", "baz", 1, 2, 3)'
self.assertDeepEqual(envjoy.env.FOO, ('foo', 'bar', 'baz', 1, 2, 3))
# environ['FOO'] = '((foo, bar), baz, (1, (2, 3)))'
# self.assertDeepEqual(envjoy.env.FOO, (('foo', 'bar'), 'baz', (1, (2, 3))))
environ['FOO'] = '(("foo", "bar"), "baz", (1, (2, 3)))'
self.assertDeepEqual(envjoy.env.FOO, (('foo', 'bar'), 'baz', (1, (2, 3))))
# environ['FOO'] = '([foo, bar], baz, [1, [2, 3]])'
# self.assertDeepEqual(envjoy.env.FOO, (['foo', 'bar'], 'baz', [1, [2, 3]]))
environ['FOO'] = '(["foo", "bar"], "baz", [1, [2, 3]])'
self.assertDeepEqual(envjoy.env.FOO, (['foo', 'bar'], 'baz', [1, [2, 3]]))
# environ['FOO'] = '[foo,bar,baz,1,2,3]'
# self.assertDeepEqual(envjoy.env.FOO, ['foo', 'bar', 'baz', 1, 2, 3])
environ['FOO'] = '["foo","bar","baz",1,2,3]'
self.assertDeepEqual(envjoy.env.FOO, ['foo', 'bar', 'baz', 1, 2, 3])
# environ['FOO'] = '[(foo,bar),baz,(1,(2,3))]'
# self.assertDeepEqual(envjoy.env.FOO, [('foo', 'bar'), 'baz', (1, (2, 3))])
environ['FOO'] = '[("foo","bar"),"baz",(1,(2,3))]'
self.assertDeepEqual(envjoy.env.FOO, [('foo', 'bar'), 'baz', (1, (2, 3))])
# environ['FOO'] = '[[foo,bar],baz,[1,[2,3]]'
# self.assertDeepEqual(envjoy.env.FOO, [['foo', 'bar'], 'baz', [1, [2, 3]]])
environ['FOO'] = '[["foo","bar"],"baz",[1,[2,3]]]'
self.assertDeepEqual(envjoy.env.FOO, [['foo', 'bar'], 'baz', [1, [2, 3]]])
# environ['FOO'] = '[foo, bar, baz, 1, 2, 3]'
# self.assertDeepEqual(envjoy.env.FOO, ['foo', 'bar', 'baz', 1, 2, 3])
environ['FOO'] = '["foo", "bar", "baz", 1, 2, 3]'
self.assertDeepEqual(envjoy.env.FOO, ['foo', 'bar', 'baz', 1, 2, 3])
# environ['FOO'] = '[(foo, bar), baz, (1, (2, 3))]'
# self.assertDeepEqual(envjoy.env.FOO, [('foo', 'bar'), 'baz', (1, (2, 3))])
environ['FOO'] = '[("foo", "bar"), "baz", (1, (2, 3))]'
self.assertDeepEqual(envjoy.env.FOO, [('foo', 'bar'), 'baz', (1, (2, 3))])
# environ['FOO'] = '[[foo, bar], baz, [1, [2, 3]]]'
# self.assertDeepEqual(envjoy.env.FOO, [['foo', 'bar'], 'baz', [1, [2, 3]]])
environ['FOO'] = '[["foo", "bar"], "baz", [1, [2, 3]]]'
self.assertDeepEqual(envjoy.env.FOO, [['foo', 'bar'], 'baz', [1, [2, 3]]])
# environ['FOO'] = '((foo, 1), (bar, 2))'
# self.assertDeepEqual(envjoy.env.FOO, (('foo', 1), ('bar', 2)))
environ['FOO'] = '(("foo", 1), ("bar", 2))'
self.assertDeepEqual(envjoy.env.FOO, (('foo', 1), ('bar', 2)))
# environ['FOO'] = '[(foo, 1), (bar, 2)]'
# self.assertDeepEqual(envjoy.env.FOO, [('foo', 1), ('bar', 2)])
environ['FOO'] = '[("foo", 1), ("bar", 2)]'
self.assertDeepEqual(envjoy.env.FOO, [('foo', 1), ('bar', 2)])
# environ['FOO'] = '([foo, 1], [bar, 2])'
# self.assertDeepEqual(envjoy.env.FOO, (['foo', 1], ['bar', 2]))
environ['FOO'] = '(["foo", 1], ["bar", 2])'
self.assertDeepEqual(envjoy.env.FOO, (['foo', 1], ['bar', 2]))
environ['FOO'] = str(('foo', 'bar', 'baz', 1, 2, 3))
self.assertDeepEqual(envjoy.env.FOO, ('foo', 'bar', 'baz', 1, 2, 3))
environ['FOO'] = str(['foo', 'bar', 'baz', 1, 2, 3])
self.assertDeepEqual(envjoy.env.FOO, ['foo', 'bar', 'baz', 1, 2, 3])
environ['FOO'] = str({'foo': 1, 'bar': 2, 'baz': 3})
self.assertDeepEqual(envjoy.env.FOO, {'foo': 1, 'bar': 2, 'baz': 3})
def test___setitem__(self):
self.assertTrue(hasattr(envjoy.env, '__setitem__'))
self.assertTrue(callable(envjoy.env.__setitem__))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2')])
envjoy.env['BAZ'] = 3
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = None
self.assertDeepEqual(list(environ.items()), [('FOO', ''), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = True
self.assertDeepEqual(list(environ.items()), [('FOO', 'True'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = 'true'
self.assertDeepEqual(list(environ.items()), [('FOO', 'true'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = 0
self.assertDeepEqual(list(environ.items()), [('FOO', '0'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = '0'
self.assertDeepEqual(list(environ.items()), [('FOO', '0'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = 0.01
self.assertDeepEqual(list(environ.items()), [('FOO', '0.01'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = '0.01'
self.assertDeepEqual(list(environ.items()), [('FOO', '0.01'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = 'foo bar baz 1 2 3'
self.assertDeepEqual(list(environ.items()), [('FOO', 'foo bar baz 1 2 3'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = 'foo,bar,baz,1,2,3'
self.assertDeepEqual(list(environ.items()), [('FOO', 'foo,bar,baz,1,2,3'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = '(foo,bar,baz,1,2,3)'
self.assertDeepEqual(list(environ.items()), [('FOO', '(foo,bar,baz,1,2,3)'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = '[foo,bar,baz,1,2,3]'
self.assertDeepEqual(list(environ.items()), [('FOO', '[foo,bar,baz,1,2,3]'), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = ('foo', 'bar', 'baz', 1, 2, 3)
self.assertDeepEqual(list(environ.items()), [('FOO', "('foo', 'bar', 'baz', 1, 2, 3)"), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = ['foo', 'bar', 'baz', 1, 2, 3]
self.assertDeepEqual(list(environ.items()), [('FOO', "['foo', 'bar', 'baz', 1, 2, 3]"), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = {'foo': 1, 'bar': 2, 'baz': 3}
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(list(environ.items()), [('BAZ', '3'), ('FOO', "{'bar': 2, 'foo': 1, 'baz': 3}"), ('bar', '2')])
except:
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': 1, 'bar': 2, 'baz': 3}"), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = {'foo': {'bar': {'baz': True}}}
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': {'bar': {'baz': True}}}"), ('bar', '2'), ('BAZ', '3')])
envjoy.env['FOO'] = OrderedDict({'foo': 1, 'bar': 2, 'baz': 3})
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(list(environ.items()), [('BAZ', '3'), ('FOO', "{'baz': 3, 'foo': 1, 'bar': 2}"), ('bar', '2')])
except:
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': 1, 'bar': 2, 'baz': 3}"), ('bar', '2'), ('BAZ', '3')])
def test___setattr__(self):
self.assertTrue(hasattr(envjoy.env, '__setattr__'))
self.assertTrue(callable(envjoy.env.__setattr__))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2')])
envjoy.env.BAZ = 3
self.assertDeepEqual(list(environ.items()), [('FOO', '1'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = None
self.assertDeepEqual(list(environ.items()), [('FOO', ''), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = True
self.assertDeepEqual(list(environ.items()), [('FOO', 'True'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = 'true'
self.assertDeepEqual(list(environ.items()), [('FOO', 'true'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = 0
self.assertDeepEqual(list(environ.items()), [('FOO', '0'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = '0'
self.assertDeepEqual(list(environ.items()), [('FOO', '0'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = 0.01
self.assertDeepEqual(list(environ.items()), [('FOO', '0.01'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = '0.01'
self.assertDeepEqual(list(environ.items()), [('FOO', '0.01'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = 'foo bar baz 1 2 3'
self.assertDeepEqual(list(environ.items()), [('FOO', 'foo bar baz 1 2 3'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = 'foo,bar,baz,1,2,3'
self.assertDeepEqual(list(environ.items()), [('FOO', 'foo,bar,baz,1,2,3'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = '(foo,bar,baz,1,2,3)'
self.assertDeepEqual(list(environ.items()), [('FOO', '(foo,bar,baz,1,2,3)'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = '[foo,bar,baz,1,2,3]'
self.assertDeepEqual(list(environ.items()), [('FOO', '[foo,bar,baz,1,2,3]'), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = ('foo', 'bar', 'baz', 1, 2, 3)
self.assertDeepEqual(list(environ.items()), [('FOO', "('foo', 'bar', 'baz', 1, 2, 3)"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = ['foo', 'bar', 'baz', 1, 2, 3]
self.assertDeepEqual(list(environ.items()), [('FOO', "['foo', 'bar', 'baz', 1, 2, 3]"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = {'foo': 1, 'bar': 2, 'baz': 3}
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(list(environ.items()), [('BAZ', '3'), ('FOO', "{'bar': 2, 'foo': 1, 'baz': 3}"), ('bar', '2')])
except:
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': 1, 'bar': 2, 'baz': 3}"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = {'foo': {'bar': {'baz': True}}}
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': {'bar': {'baz': True}}}"), ('bar', '2'), ('BAZ', '3')])
envjoy.env.FOO = OrderedDict({'foo': 1, 'bar': 2, 'baz': 3})
# NOTE: no consistency within Python's major versions even >:'(
try:
self.assertDeepEqual(list(environ.items()), [('BAZ', '3'), ('FOO', "{'baz': 3, 'foo': 1, 'bar': 2}"), ('bar', '2')])
except:
self.assertDeepEqual(list(environ.items()), [('FOO', "{'foo': 1, 'bar': 2, 'baz': 3}"), ('bar', '2'), ('BAZ', '3')])
def test___delitem__(self):
self.assertTrue(hasattr(envjoy.env, '__delitem__'))
self.assertTrue(callable(envjoy.env.__delitem__))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
del envjoy.env['BAZ']
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
del envjoy.env['FOO']
self.assertDeepEqual(list(environ.keys()), ['bar'])
del envjoy.env['BAR']
self.assertDeepEqual(list(environ.keys()), ['bar'])
del envjoy.env['bar']
self.assertDeepEqual(list(environ.keys()), [])
def test___delattr__(self):
self.assertTrue(hasattr(envjoy.env, '__delattr__'))
self.assertTrue(callable(envjoy.env.__delattr__))
environ.clear()
environ['FOO'] = '1'
environ['bar'] = '2'
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
del envjoy.env.BAZ
self.assertDeepEqual(list(environ.keys()), ['FOO', 'bar'])
del envjoy.env.FOO
self.assertDeepEqual(list(environ.keys()), ['bar'])
del envjoy.env.BAR
self.assertDeepEqual(list(environ.keys()), ['bar'])
del envjoy.env.bar
self.assertDeepEqual(list(environ.keys()), [])
def test___contains__(self):
self.assertTrue(hasattr(envjoy.env, '__contains__'))
self.assertTrue(callable(envjoy.env.__contains__))
environ.clear()
self.assertDeepEqual(('XXX' in envjoy.env), False)
self.assertDeepEqual(('BOOL' in envjoy.env), False)
self.assertDeepEqual(('INT' in envjoy.env), False)
self.assertDeepEqual(('FLOAT' in envjoy.env), False)
self.assertDeepEqual(('TUPLE' in envjoy.env), False)
self.assertDeepEqual(('LIST' in envjoy.env), False)
self.assertDeepEqual(('DICT' in envjoy.env), False)
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(('XXX' in envjoy.env), False)
self.assertDeepEqual(('BOOL' in envjoy.env), True)
self.assertDeepEqual(('INT' in envjoy.env), True)
self.assertDeepEqual(('FLOAT' in envjoy.env), True)
self.assertDeepEqual(('TUPLE' in envjoy.env), True)
self.assertDeepEqual(('LIST' in envjoy.env), True)
self.assertDeepEqual(('DICT' in envjoy.env), True)
def test___len__(self):
self.assertTrue(hasattr(envjoy.env, '__len__'))
self.assertTrue(callable(envjoy.env.__len__))
self.assertIsInstance(len(envjoy.env), int)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(len(envjoy.env), 6)
def test___iter__(self):
self.assertTrue(hasattr(envjoy.env, '__iter__'))
self.assertTrue(callable(envjoy.env.__iter__))
self.assertIsInstance(iter(envjoy.env), Iterable)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
self.assertDeepEqual(list(iter(envjoy.env)), [
('BOOL', True),
('INT', 1),
('FLOAT', 1.01),
('TUPLE', (1, 2, 3)),
('LIST', [1, 2, 3]),
('DICT', {'foo': [1, 2, 3]}),
])
def test___repr__(self):
self.assertTrue(hasattr(envjoy.env, '__repr__'))
self.assertTrue(callable(envjoy.env.__repr__))
self.assertIsInstance(repr(envjoy.env), str)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
# NOTE: Python 2 vs Python 3
self.assertDeepEqual(eval(repr(envjoy.env)), eval("{'BOOL': True, 'INT': 1, 'FLOAT': 1.01, 'TUPLE': (1, 2, 3), 'LIST': [1, 2, "
"3], 'DICT': {'foo': [1, 2, 3]}}"))
def test___str__(self):
self.assertTrue(hasattr(envjoy.env, '__str__'))
self.assertTrue(callable(envjoy.env.__str__))
self.assertIsInstance(str(envjoy.env), str)
environ.clear()
environ['BOOL'] = str(True)
environ['INT'] = str(1)
environ['FLOAT'] = str(1.01)
environ['TUPLE'] = str((1, 2, 3))
environ['LIST'] = str([1, 2, 3])
environ['DICT'] = str({'foo': [1, 2, 3]})
# NOTE: Python 2 vs Python 3
self.assertDeepEqual(eval(str(envjoy.env)), eval("{'BOOL': True, 'INT': 1, 'FLOAT': 1.01, 'TUPLE': (1, 2, 3), 'LIST': [1, 2, "
"3], 'DICT': {'foo': [1, 2, 3]}}"))
def test___bool__(self):
self.assertTrue(hasattr(envjoy.env, '__bool__'))
self.assertTrue(callable(envjoy.env.__bool__))
self.assertTrue(envjoy.env)
# =========================================
# MAIN
# --------------------------------------
if __name__ == '__main__':
helper.run(TestCase)
| 45.477384 | 135 | 0.543469 | 10,579 | 83,451 | 4.268834 | 0.01106 | 0.17438 | 0.402458 | 0.450753 | 0.962666 | 0.944376 | 0.905248 | 0.896723 | 0.89349 | 0.892405 | 0 | 0.038315 | 0.205917 | 83,451 | 1,834 | 136 | 45.502181 | 0.643171 | 0.239614 | 0 | 0.634462 | 0 | 0.001992 | 0.14536 | 0.013465 | 0 | 0 | 0 | 0 | 0.63247 | 1 | 0.02988 | false | 0.000996 | 0.00996 | 0.000996 | 0.041833 | 0.00498 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
7218ecc146ac9f0a557ecb4c30b5df88ba46e549 | 119,063 | py | Python | server/output.py | mahmoudalismail/Reporta | 3e1c5e2a1219a4d5b76b62a9968faa2192882c83 | [
"MIT"
] | 5 | 2015-04-26T05:48:13.000Z | 2022-03-21T22:36:08.000Z | server/output.py | mahmoudalismail/Reporta | 3e1c5e2a1219a4d5b76b62a9968faa2192882c83 | [
"MIT"
] | null | null | null | server/output.py | mahmoudalismail/Reporta | 3e1c5e2a1219a4d5b76b62a9968faa2192882c83 | [
"MIT"
] | null | null | null | {'type_of_material': u'News', 'headline': u'In Ferguson, Officer Defused Eruptions as Crowds Grew Tense', 'abstract': u'Jerry Lohr, white lieutenant of St Louis County Police, has done much on the ground to relieve tensions and volatility of Ferguson protesters, in wake of grand jury decision not to indict white police officer Darren Wilson for fatal shooting of unarmed black teenager Michael Brown; to many protesters, Lohr is evidence that police have improved community relations at divisive time.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/us/OFFICER/OFFICER-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/us/OFFICER/OFFICER-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/us/OFFICER/OFFICER-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/us/OFFICER/OFFICER-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/us/OFFICER/OFFICER-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/us/OFFICER/OFFICER-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Few law enforcers have done more on the ground to ease tensions than Jerry Lohr, a white lieutenant of the St. Louis County Police who is not above giving hugs.', 'web_url': u'http://www.nytimes.com/2014/11/28/us/officer-defused-eruptions-as-crowds-grew-volatile.html', 'section_name': u'U.S.', 'keywords': [u'Lohr, Jerry (1973- )', u'Demonstrations, Protests and Riots', u'Police Brutality, Misconduct and Shootings', u'Ferguson (Mo)', u'Brown, Michael (1996-2014)'], 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'AIDS Group Wages Lonely Fight Against Pill to Prevent H.I.V.', 'abstract': u'The Upshot; Michael Weinstein, president of Los Angeles-based nonprofit AIDS Healthcare Foundation, speaks out against use of Truvada to prevent HIV with national ad campaign; warns widespread use of drug erodes condom use and leaves many open to infection; Weinstein also notes that research found many people were not consistently taking Truvada and therefore risking HIV infection.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/17/upshot/17UP-HIV-1/17UP-HIV-1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/17/upshot/17UP-HIV-1/17UP-HIV-1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/17/upshot/17UP-HIV-1/17UP-HIV-1-articleLarge.jpg', u'height': 402, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/17/upshot/17UP-HIV-1/17UP-HIV-1-articleLarge.jpg', u'xlargeheight': u'402'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/17/upshot/17UP-HIV-1/17UP-HIV-1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/17/upshot/17UP-HIV-1/17UP-HIV-1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'A growing consensus in favor of Truvada is opposed by one vocal man, Michael Weinstein, and his nonprofit organization.', 'web_url': u'http://www.nytimes.com/2014/11/17/upshot/aids-group-wages-lonely-fight-against-pill-to-prevent-hiv.html', 'section_name': u'The Upshot', 'keywords': [u'Truvada (Drug)', u'Acquired Immune Deficiency Syndrome', u'AIDS Healthcare Foundation', u'Weinstein, Michael Arthur (1952- )', u'Condoms', u'Advertising and Marketing', u'Drugs (Pharmaceuticals)'], 'pub_date': u'20141117'}
{'type_of_material': u'Blog', 'headline': u'Q. and A.: Ann E. Carlson and Alex Wang on the U.S.-China Climate Accord', 'abstract': u'Alex Wang and Ann E. Carlson, law professors at the University of California, Los Angeles, who study environmental policy and regulations in the United States and China, responded to questions about the United States-China agreement on cutting greenhouse gases.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-articleLarge.jpg', u'height': 422, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-articleLarge.jpg', u'xlargeheight': u'422'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Alex Wang and Ann E. Carlson, law professors at the University of California, Los Angeles, who study environmental policy and regulations in the United States and China, responded to questions about the United States-China agreement on cutting...', 'web_url': u'http://sinosphere.blogs.nytimes.com/2014/11/28/q-and-a-alex-wang-and-ann-e-carlson-on-the-u-s-china-climate-accord/', 'section_name': u'World', 'keywords': [u'Bush, George W', u'Carlson, Ann E', u'McConnell, Mitch', u'Obama, Barack', u'Wang, Alex (Law Professor)', u'Xi Jinping', u'China', u'India', u'United States', u'Environmental Protection Agency', u'Republican Party', u'Senate', u'Air Pollution', u'Carbon Dioxide', u'Global Warming', u'Greenhouse Gas Emissions'], 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'E.U. Parliament Passes Measure to Break Up Google in Symbolic Vote', 'abstract': u'European Parliament passes nonbinding vote to break up Google; symbolic resolution comes one day after a separate European body sought to expand online privacy rights across Continent, and signifies growing antipathy to American technological dominance in the European Union.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/business/28EUGOOGLE2/28EUGOOGLE2-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/business/28EUGOOGLE2/28EUGOOGLE2-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/business/28EUGOOGLE2/28EUGOOGLE2-articleLarge.jpg', u'height': 375, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/business/28EUGOOGLE2/28EUGOOGLE2-articleLarge.jpg', u'xlargeheight': u'375'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/business/28EUGOOGLE2/28EUGOOGLE2-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/business/28EUGOOGLE2/28EUGOOGLE2-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'While the vote poses no immediate threat to the company, it symbolizes the growing resentment in Europe toward the American technology titan.', 'web_url': u'http://www.nytimes.com/2014/11/28/business/international/google-european-union.html', 'section_name': u'Business Day', 'keywords': [u'Antitrust Laws and Competition Issues', u'European Parliament', u'Google Inc', u'Europe', u'Computers and the Internet', u'European Commission', u'Vestager, Margrethe', u'European Union', u'Privacy'], 'pub_date': u'20141128'}
{'type_of_material': u'Op-Ed', 'headline': u'Judaism Must Embrace the Convert', 'abstract': u"Op-Ed article by Orthodox Rabbi Shmuly Yanklowitz argues that Judaism must work to reduce the formidable obstacles faced by those who wish to convert; examines his own difficult experience with conversion; contends process needs to become more transparent and pluralistic, in accordance with Judaism's inclusiveness.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/22/opinion/1124OPEDbeck/1124OPEDbeck-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/22/opinion/1124OPEDbeck/1124OPEDbeck-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/22/opinion/1124OPEDbeck/1124OPEDbeck-articleLarge.jpg', u'height': 728, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/22/opinion/1124OPEDbeck/1124OPEDbeck-articleLarge.jpg', u'xlargeheight': u'728'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/22/opinion/1124OPEDbeck/1124OPEDbeck-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/22/opinion/1124OPEDbeck/1124OPEDbeck-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Our people believe in inclusiveness as well as chosenness.', 'web_url': u'http://www.nytimes.com/2014/11/24/opinion/judaism-must-embrace-the-convert.html', 'section_name': u'Opinion', 'keywords': [u'Jews and Judaism', u'Rabbis', u'Rabbinical Council of America'], 'pub_date': u'20141124'}
{'type_of_material': u'News', 'headline': u'Israeli Cabinet Approves Nationality Bill ', 'abstract': u"Israeli cabinet approves draft nationality bill that emphasizes nation's Jewish character above its democratic nature; critics point out law could hurt fragile relationship with country's Arab minority at time of heightened tensions.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/24/world/24israel/24israel-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/24/world/24israel/24israel-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/24/world/24israel/24israel-articleLarge.jpg', u'height': 668, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/24/world/24israel/24israel-articleLarge.jpg', u'xlargeheight': u'668'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/24/world/24israel/24israel-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/24/world/24israel/24israel-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'The draft legislation emphasizes Israel\u2019s Jewish character above its democratic nature, proposing to define Israel as the nation-state of the Jewish people, a move opposed by Arab citizens.', 'web_url': u'http://www.nytimes.com/2014/11/24/world/middleeast/israeli-cabinet-backs-nationality-bill-that-risks-wider-rift-with-arab-minority.html', 'section_name': u'World', 'keywords': [u'Israel', u'Jews and Judaism', u'Law and Legislation', u'Arabs', u'Palestinians', u'Likud Party (Israel)', u'Netanyahu, Benjamin'], 'pub_date': u'20141124'}
{'type_of_material': u'News', 'headline': u'With a New League, a Sport\u2019s Sleeping Giant Begins to Stir', 'abstract': u"Creation of Indian Super League has, at least temporarily, revived nation's interest soccer, sport long overshadowed by cricket\u2019s $3 billion Indian Premier League.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/sports/28indiasoccer1/28indiasoccer1-thumbWide-v2.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/sports/28indiasoccer1/28indiasoccer1-thumbWide-v2.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/sports/28indiasoccer1/28indiasoccer1-articleLarge.jpg', u'height': 431, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/sports/28indiasoccer1/28indiasoccer1-articleLarge.jpg', u'xlargeheight': u'431'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/sports/28indiasoccer1/28indiasoccer1-thumbStandard-v2.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/sports/28indiasoccer1/28indiasoccer1-thumbStandard-v2.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'The creation of a professional league in India, backed with huge investments and Bollywood glamour, has prompted a level of excitement more common to cricket.', 'web_url': u'http://www.nytimes.com/2014/11/28/sports/soccer/new-indian-soccer-league-tries-glamour-approach.html', 'section_name': u'Sports', 'keywords': [u'Soccer', u'India', u'Cricket (Game)', u'Indian Super League'], 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'For Former Embassy Hostages, a Special Interest in Iran Talks', 'abstract': u'Diplomatic Memo; seven-month extension of nuclear negotiations with Iran has been particularly upsetting to the 39 surviving Americans who endured 444 days of captivity in Tehran from 1979 to 1981; former hostages are particularly outraged that Iran will continue to receive $700 million a month in funds that were frozen under Western sanctions.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/26/world/POST/POST-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/26/world/POST/POST-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/26/world/POST/POST-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/26/world/POST/POST-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/26/world/POST/POST-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/26/world/POST/POST-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'For the 39 Americans still alive who were held captive in Tehran for 444 days from 1979 to 1981, there has been no financial compensation from Iran and financial deals to extend the nuclear talks add to their anguish.', 'web_url': u'http://www.nytimes.com/2014/11/26/world/middleeast/for-former-embassy-hostages-a-special-interest-in-iran-talks.html', 'section_name': u'World', 'keywords': [u'Iran', u'Nuclear Weapons', u'Kidnapping and Hostages', u'United States International Relations'], 'pub_date': u'20141126'}
{'type_of_material': u'News', 'headline': u'For New Tappan Zee, Questions Persist Over How High the Tolls Will Climb', 'abstract': u'Toll for travelers on the Tappan Zee Bridge, which has long been significantly cheaper than other Hudson River crossings like the George Washington Bridge, is likely to increase; it remains unclear how much New York State will be forced to raise toll due to construction of $3.9 billion replacement for bridge (Series: 21st-Century Span).', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/nyregion/TAPPANZEE/TAPPANZEE-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/nyregion/TAPPANZEE/TAPPANZEE-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/nyregion/TAPPANZEE/TAPPANZEE-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/nyregion/TAPPANZEE/TAPPANZEE-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/nyregion/TAPPANZEE/TAPPANZEE-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/nyregion/TAPPANZEE/TAPPANZEE-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'The discount afforded by one of the New York City area\u2019s great travel bargains \u2014 crossing the Hudson River on the Tappan Zee Bridge \u2014 is likely to shrink, but no one can say by how much.', 'web_url': u'http://www.nytimes.com/2014/11/28/nyregion/for-new-tappan-zee-questions-persist-over-how-high-the-tolls-will-climb.html', 'section_name': u'N.Y. / Region', 'keywords': [u'Tappan Zee Bridge', u'Dewey, Thomas E, Thruway', u'Bridges and Tunnels', u'Tolls', u'Series', u'New York Metropolitan Area', u'New York State', u'Infrastructure (Public Works)', u'Cuomo, Andrew M', u'Rockland County (NY)', u'Westchester County (NY)'], 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'OPEC Holds Production Unchanged; Prices Fall ', 'abstract': u"Organization of the Petroleum Exporting Countries decides not to cut petroleum production despite plunge in oil prices that has highlighted group's diminishing clout; price of Brent crude oil falls to four-year low of about $73 on news, as American crude drops below key $70 benchmark; OPEC has been shaken over past months as prices have declined by more than 30 percent.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/business/28OPEC/28OPEC-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/business/28OPEC/28OPEC-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/business/28OPEC/28OPEC-articleLarge.jpg', u'height': 398, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/business/28OPEC/28OPEC-articleLarge.jpg', u'xlargeheight': u'398'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/business/28OPEC/28OPEC-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/business/28OPEC/28OPEC-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'The 30 percent decline in oil prices in recent months has shaken the solidarity of the 12-member Organization of the Petroleum Exporting Countries.', 'web_url': u'http://www.nytimes.com/2014/11/28/business/international/opec-leaves-oil-production-quotas-unchanged-and-prices-fall-further.html', 'section_name': u'Business Day', 'keywords': [u'Organization of the Petroleum Exporting Countries', u'Oil (Petroleum) and Gasoline', u'International Trade and World Market', u'Naimi, Ali Al-', u'Saudi Arabia'], 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'Grateful for What\u2019s Left, Not Mourning What\u2019s Lost', 'abstract': u'Catholic Charities Brooklyn and Queens, one of seven agencies supported by The New York Times Neediest Cases Fund, has helped Anna Maria Walsh of Brooklyn to pay for filing Certificate of Citizenship form and for replacement for her washer and dryer.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/nyregion/NEEDIEST/NEEDIEST-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/nyregion/NEEDIEST/NEEDIEST-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/nyregion/NEEDIEST/NEEDIEST-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/nyregion/NEEDIEST/NEEDIEST-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/nyregion/NEEDIEST/NEEDIEST-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/nyregion/NEEDIEST/NEEDIEST-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Anna Maria Walsh has numerous health problems, but her resiliency has led her to win nomination to a Brooklyn community board and to work to help others with disabilities.', 'web_url': u'http://www.nytimes.com/2014/11/28/nyregion/grateful-for-what-remains.html', 'section_name': u'N.Y. / Region', 'keywords': [u'New York Times Neediest Cases Fund', u'Catholic Charities', u'Philanthropy'], 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'Eagles Come Out Strong Against Cowboys and Take Division Lead', 'abstract': u'Philadelphia Eagles improve to 9-3 and assume control of NFC East with 33-10 win over Dallas Cowboys.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/sports/Y-COWBOYS/Y-COWBOYS-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/sports/Y-COWBOYS/Y-COWBOYS-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/sports/Y-COWBOYS/Y-COWBOYS-articleLarge.jpg', u'height': 425, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/sports/Y-COWBOYS/Y-COWBOYS-articleLarge.jpg', u'xlargeheight': u'425'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/sports/Y-COWBOYS/Y-COWBOYS-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/sports/Y-COWBOYS/Y-COWBOYS-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Mark Sanchez, who was 20 of 29 passing for 217 yards, led Philadelphia in a rout of N.F.C. East rival Dallas.', 'web_url': u'http://www.nytimes.com/2014/11/28/sports/football/philadelphia-eagles-come-out-strong-against-dallas-cowboys-and-walk-off-with-division-lead.html', 'section_name': u'Sports', 'keywords': [u'Football', u'National Football League', u'Sanchez, Mark', u'Romo, Tony', u'Philadelphia Eagles', u'Dallas Cowboys'], 'pub_date': u'20141128'}
{'type_of_material': u'Op-Ed', 'headline': u'Did Dubai Do It? ', 'abstract': u'Thomas L Friedman Op-Ed column considers role Dubai and United Arab Emirates played in Arab awakening; argues that, despite being absolute monarchies, the two served as example of modernity to young Arabs across Middle East; holds best American policy in Middle East is one, based on containment, that simply amplifies any such spark of legitimacy and coherence in a body politic.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/01/opinion/friedman-circular/friedman-circular-thumbWide-v2.png', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/01/opinion/friedman-circular/friedman-circular-thumbWide-v2.png', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/01/opinion/friedman-circular/friedman-circular-thumbStandard-v2.png', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/01/opinion/friedman-circular/friedman-circular-thumbStandard-v2.png', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'On a visit to Dubai, several conversations pondered whether the crown jewel of the United Arab Emirates caused the Arab awakening.', 'web_url': u'http://www.nytimes.com/2014/11/19/opinion/thomas-friedman-did-dubai-do-it.html', 'section_name': u'Opinion', 'keywords': [u'Dubai (United Arab Emirates)', u'United Arab Emirates', u'Middle East and North Africa Unrest (2010- )', u'United States International Relations', u'Middle East'], 'pub_date': u'20141119'}
{'type_of_material': u'Editorial', 'headline': u'Israel Narrows Its Democracy ', 'abstract': u"Editorial decries adoption of contentious bill that will officially define Israel as the nation-state of the Jewish people, reserving 'national rights' only for Jews; calls for defeat of law that would be in clear violation of Israel's founding principles; holds it will also antagonize an already seething Arab minority and erode Israel's standing among democratic nations.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/25/opinion/25tue2/25tue2-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/25/opinion/25tue2/25tue2-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/25/opinion/25tue2/25tue2-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/25/opinion/25tue2/25tue2-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/25/opinion/25tue2/25tue2-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/25/opinion/25tue2/25tue2-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'In any form, the contentious bill that would officially define Israel as the nation-state of the Jewish people, reserving “national rights” only for Jews, should be defeated.', 'web_url': u'http://www.nytimes.com/2014/11/25/opinion/israel-narrows-its-democracy.html', 'section_name': u'Opinion', 'keywords': [u'Israel', u'Editorials', u'Jews and Judaism', u'Palestinians', u'Discrimination', u'Minorities', u'United States'], 'pub_date': u'20141125'}
{'type_of_material': u'News', 'headline': u'On the Trail of an Ancient Mystery', 'abstract': u"Drs Christian C Carman and James Evans study in journal Archive for History of Exact Sciences suggests that Antikythera Mechanism, astronomical calculator raised from ancient shipwreck near Crete in 1901, may date to 205 BC, 50 years earlier than previously suggested; finding also supports idea that mechanism's eclipse prediction strategy was based on Babylonian arithmetical methods, rather than Greek trigonometry.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/25/science/25DEVI1/25DEVI1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/25/science/25DEVI1/25DEVI1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/25/science/25DEVI1/25DEVI1-articleLarge.jpg', u'height': 604, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/25/science/25DEVI1/25DEVI1-articleLarge.jpg', u'xlargeheight': u'604'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/25/science/25DEVI1/25DEVI1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/25/science/25DEVI1/25DEVI1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'More than 100 years after it was found, and more than 2,000 years after it was believed to have been built, the Antikythera Mechanism continues to raise questions and provide answers.', 'web_url': u'http://www.nytimes.com/2014/11/25/science/solving-the-riddles-of-an-early-astronomical-calculator.html', 'section_name': u'Science', 'keywords': [u'Archaeology', u'Space and Astronomy', u'Archive for History of Exact Sciences (Journal)', u'Greek Civilization', u'Crete (Greece)'], 'pub_date': u'20141125'}
{'type_of_material': u'Blog', 'headline': u'Q. and A.: Ann E. Carlson and Alex Wang on the U.S.-China Climate Accord', 'abstract': u'Alex Wang and Ann E. Carlson, law professors at the University of California, Los Angeles, who study environmental policy and regulations in the United States and China, responded to questions about the United States-China agreement on cutting greenhouse gases.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-articleLarge.jpg', u'height': 422, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-articleLarge.jpg', u'xlargeheight': u'422'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/world/28sino-WANG1/28sino-WANG1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Alex Wang and Ann E. Carlson, law professors at the University of California, Los Angeles, who study environmental policy and regulations in the United States and China, responded to questions about the United States-China agreement on cutting...', 'web_url': u'http://sinosphere.blogs.nytimes.com/2014/11/28/q-and-a-alex-wang-and-ann-e-carlson-on-the-u-s-china-climate-accord/', 'section_name': u'World', 'keywords': [u'Bush, George W', u'Carlson, Ann E', u'McConnell, Mitch', u'Obama, Barack', u'Wang, Alex (Law Professor)', u'Xi Jinping', u'China', u'India', u'United States', u'Environmental Protection Agency', u'Republican Party', u'Senate', u'Air Pollution', u'Carbon Dioxide', u'Global Warming', u'Greenhouse Gas Emissions'], 'pub_date': u'20141128'}
(venv)ncl:server nkl223$ python test_nyt_api.py
[{u'type_of_material': u'Video', u'blog': [], u'news_desk': u'Multimedia/Photos', u'lead_paragraph': u'Protesters return to the streets of Ferguson after the police officer who shot black teenager Michael Brown resigns. Rough cut (no reporter narration)', u'headline': {u'main': u'Protesters return to Ferguson streets after police officer resigns', u'sub': u'Protesters return to Ferguson streets after police officer resigns'}, u'abstract': None, u'print_page': None, u'word_count': u'23', u'_id': u'547ad45238f0d803f445c1f2', u'snippet': u'Protesters return to the streets of Ferguson after the police officer who shot black teenager Michael Brown resigns. Rough cut (no reporter narration)', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/video/multimedia/100000003262539/protesters-return-to-ferguson-streets-after-police-officer-resig.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-articleLarge.jpg', u'height': 338, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-articleLarge.jpg', u'xlargeheight': u'338'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [], u'byline': None, u'document_type': u'multimedia', u'pub_date': u'2014-11-30T03:22:56Z', u'section_name': u'Multimedia/Photos'}, {u'type_of_material': u'Video', u'blog': [], u'news_desk': u'Multimedia/Photos', u'lead_paragraph': u'Protesters return to the streets of Ferguson after the police officer who shot black teenager Michael Brown resigns. Rough cut (no reporter narration)', u'headline': {u'main': u'Protesters return to Ferguson streets after police officer resigns', u'sub': u'Protesters return to Ferguson streets after police officer resigns'}, u'abstract': None, u'print_page': None, u'word_count': u'23', u'_id': u'547ad1c238f0d803f445c1c3', u'snippet': u'Protesters return to the streets of Ferguson after the police officer who shot black teenager Michael Brown resigns. Rough cut (no reporter narration)', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/video/multimedia/100000003262536/protesters-return-to-ferguson-streets-after-police-officer-resig.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-articleLarge.jpg', u'height': 338, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-articleLarge.jpg', u'xlargeheight': u'338'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/multimedia/video-missourishooting/video-missourishooting-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [], u'byline': None, u'document_type': u'multimedia', u'pub_date': u'2014-11-30T03:12:56Z', u'section_name': u'Multimedia/Photos'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"The officer who fatally shot 18-year-old Michael Brown resigned Saturday from the police department in Ferguson, Missouri, where protests continued but were far more muted than the violence sparked by a grand jury's decision not to indict the officer earlier in the week.", u'headline': {u'main': u'A Glance at Developments in Ferguson', u'print_headline': u'A Glance at Developments in Ferguson'}, u'abstract': None, u'print_page': None, u'word_count': u'608', u'_id': u'547abb1538f0d803f445bfd6', u'snippet': u"The officer who fatally shot 18-year-old Michael Brown resigned Saturday from the police department in Ferguson, Missouri, where protests continued but were far more muted than the violence sparked by a grand jury's decision not to indict the officer...", u'source': u'AP', u'web_url': u'http://www.nytimes.com/aponline/2014/11/30/us/ap-us-ferguson-news-guide.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By THE ASSOCIATED PRESS', u'organization': u'THE ASSOCIATED PRESS'}, u'document_type': u'article', u'pub_date': u'2014-11-30T01:34:56Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u'Ferguson officials plan to address the resignation of a police officer who fatally shot 18-year-old Michael Brown, as his parents prepared to attend a church service where civil rights activist the Rev. Al Sharpton was scheduled to preach.', u'headline': {u'main': u'Ferguson Officer Who Shot Michael Brown Resigns', u'print_headline': u'Ferguson Officer Who Shot Michael Brown Resigns'}, u'abstract': None, u'print_page': None, u'word_count': u'115', u'_id': u'547aba6138f0d803f445bfc8', u'snippet': u'Ferguson officials plan to address the resignation of a police officer who fatally shot 18-year-old Michael Brown, as his parents prepared to attend a church service where civil rights activist the Rev. Al Sharpton was scheduled to preach.', u'source': u'AP', u'web_url': u'http://www.nytimes.com/aponline/2014/11/30/us/ap-us-ferguson.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By THE ASSOCIATED PRESS', u'organization': u'THE ASSOCIATED PRESS'}, u'document_type': u'article', u'pub_date': u'2014-11-30T01:31:52Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'National', u'lead_paragraph': u'A group called Oath Keepers, regarded by some as an antigovernment militia, is placing sentries atop businesses as tensions continue in Ferguson, Mo.', u'headline': {u'main': u'On Rooftops of Ferguson, Volunteers — With Guns ', u'print_headline': u'On Rooftops of Ferguson, Volunteers \u2014 With Guns'}, u'abstract': None, u'print_page': u'33', u'word_count': u'928', u'_id': u'547a768638f0d803f445ba10', u'snippet': u'A group called Oath Keepers, regarded by some as an antigovernment militia, is placing sentries atop businesses as tensions continue in Ferguson, Mo.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/us/on-rooftops-of-ferguson-volunteers-with-guns.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/us/OATH/OATH-thumbWide-v2.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/us/OATH/OATH-thumbWide-v2.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/us/OATH/OATH-articleLarge-v2.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/us/OATH/OATH-articleLarge-v2.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/us/OATH/OATH-thumbStandard-v4.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/us/OATH/OATH-thumbStandard-v4.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [{u'value': u'Security and Warning Systems', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Looting (Crime)', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'4', u'name': u'glocations'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Manny', u'lastname': u'FERNANDEZ'}, {u'organization': u'', u'role': u'reported', u'rank': 2, u'firstname': u'Alan', u'lastname': u'BLINDER'}], u'original': u'By MANNY FERNANDEZ and ALAN BLINDER'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Sports', u'lead_paragraph': u'Ronaldo\u2019s two assists helped his club to a 2-1 win at M\xe1laga in the Spanish league.', u'headline': {u'main': u'Cristiano Ronaldo Helps Real Madrid Set a Mark by Winning 16th Straight', u'kicker': u'Soccer Roundup', u'print_headline': u'Ronaldo\u2019s Two Assists Help Real Madrid Set a New Mark', u'content_kicker': u'Roundup'}, u'abstract': None, u'print_page': u'4', u'word_count': u'660', u'_id': u'547a4fad38f0d803f445b6c8', u'snippet': u'Ronaldo\u2019s two assists helped his club to a 2-1 win at M\xe1laga in the Spanish league.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/sports/soccer/roundup.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/sports/dogSOCCER/dogSOCCER-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/sports/dogSOCCER/dogSOCCER-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/sports/dogSOCCER/dogSOCCER-articleLarge.jpg', u'height': 401, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/sports/dogSOCCER/dogSOCCER-articleLarge.jpg', u'xlargeheight': u'401'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/sports/dogSOCCER/dogSOCCER-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/sports/dogSOCCER/dogSOCCER-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Soccer', u'keywords': [{u'value': u'Soccer', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Arsenal (Soccer Team)', u'is_major': u'N', u'rank': u'2', u'name': u'organizations'}, {u'value': u'Bayern Munich (Soccer Team)', u'is_major': u'N', u'rank': u'3', u'name': u'organizations'}], u'byline': {u'contributor': u'', u'person': [], u'original': u'By THE ASSOCIATED PRESS', u'organization': u'THE ASSOCIATED PRESS'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Sports'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'National', u'lead_paragraph': u'A grand jury rejected the image of Michael Brown with his hands raised in surrender before he was shot, but the questions surrounding his final moments remain murky and unresolved.', u'headline': {u'main': u'Raised Hands, and the Doubts of a Grand Jury', u'print_headline': u'Raised Hands, and the Doubts of a Grand Jury'}, u'abstract': None, u'print_page': u'1', u'word_count': u'1939', u'_id': u'547a2b0938f0d803f445b399', u'snippet': u'A grand jury rejected the image of Michael Brown with his hands raised in surrender before he was shot, but the questions surrounding his final moments remain murky and unresolved.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/us/raised-hands-and-the-doubts-of-a-grand-jury-.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/us/JP-FERGUSON1/JP-FERGUSON1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/us/JP-FERGUSON1/JP-FERGUSON1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/us/JP-FERGUSON1/JP-FERGUSON1-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/us/JP-FERGUSON1/JP-FERGUSON1-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/us/JP-FERGUSON1/JP-FERGUSON1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/us/JP-FERGUSON1/JP-FERGUSON1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [{u'value': u'Police Brutality, Misconduct and Shootings', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Murders, Attempted Murders and Homicides', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Jury System', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'4', u'name': u'persons'}, {u'value': u'Wilson, Darren (1986- )', u'is_major': u'N', u'rank': u'5', u'name': u'persons'}], u'byline': {u'contributor': u'Monica Davey reported from Ferguson, and Michael Wines, Erik Eckholm and Richard A. Oppel Jr. from New York.', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Monica', u'lastname': u'DAVEY'}, {u'organization': u'', u'role': u'reported', u'rank': 2, u'firstname': u'Michael', u'lastname': u'WINES'}, {u'organization': u'', u'role': u'reported', u'rank': 3, u'firstname': u'Erik', u'lastname': u'ECKHOLM'}, {u'qualifier': u'Jr', u'firstname': u'Richard', u'middlename': u'A.', u'lastname': u'OPPEL', u'rank': 4, u'role': u'reported', u'organization': u''}], u'original': u'By MONICA DAVEY, MICHAEL WINES, ERIK ECKHOLM and RICHARD A. OPPEL Jr'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'U.S.'}, {u'type_of_material': u'An Analysis; News Analysis', u'blog': [], u'news_desk': u'OpEd', u'lead_paragraph': u'What color was the trigger finger? Wrong question.', u'headline': {u'main': u'Pain Is Colorblind', u'kicker': u'News Analysis', u'print_headline': u'Pain Is Colorblind', u'content_kicker': u'News Analysis'}, u'abstract': None, u'print_page': u'1', u'word_count': u'1233', u'_id': u'547a241f38f0d803f445b302', u'snippet': u'What color was the trigger finger? Wrong question.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/sunday-review/pain-is-colorblind.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/sunday-review/30eligon/30eligon-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/sunday-review/30eligon/30eligon-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/sunday-review/30eligon/30eligon-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/sunday-review/30eligon/30eligon-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/sunday-review/30eligon/30eligon-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/sunday-review/30eligon/30eligon-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [{u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'1', u'name': u'persons'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'2', u'name': u'glocations'}, {u'value': u'Police Brutality, Misconduct and Shootings', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Murders, Attempted Murders and Homicides', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'Giuliani, Rudolph W', u'is_major': u'N', u'rank': u'5', u'name': u'persons'}, {u'value': u'French, Antonio D', u'is_major': u'N', u'rank': u'6', u'name': u'persons'}, {u'value': u'Social Conditions and Trends', u'is_major': u'N', u'rank': u'7', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'John', u'lastname': u'ELIGON'}], u'original': u'By JOHN ELIGON'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Sunday Review'}, {u'type_of_material': u'Op-Ed', u'blog': [], u'news_desk': u'Editorial', u'lead_paragraph': u'After Ferguson, it’s harder to make a case for optimism about race and politics in America.', u'headline': {u'main': u'The Retreat to Identity', u'kicker': u'Op-Ed Columnist', u'print_headline': u'The Retreat to Identity', u'content_kicker': u'Op-Ed Columnist'}, u'abstract': None, u'print_page': u'9', u'word_count': u'806', u'_id': u'547a1ec138f0d803f445b27f', u'snippet': u'After Ferguson, it’s harder to make a case for optimism about race and politics in America.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/ross-douthat-the-retreat-to-identity.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbWide-v2.png', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbWide-v2.png', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbStandard-v2.png', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbStandard-v2.png', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Race and Ethnicity', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Blacks', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Demonstrations, Protests and Riots', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Police Brutality, Misconduct and Shootings', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'Demonstrations, Protests and Riots', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'6', u'name': u'glocations'}, {u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'7', u'name': u'persons'}, {u'value': u'Social Conditions and Trends', u'is_major': u'N', u'rank': u'8', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Ross', u'lastname': u'DOUTHAT'}], u'original': u'By ROSS DOUTHAT'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}, {u'type_of_material': u'Op-Ed', u'blog': [], u'news_desk': u'Editorial', u'lead_paragraph': u'How can we address the racial biases embedded in our society?', u'headline': {u'main': u'When Whites Just Don’t Get It, Part 5', u'print_headline': u'When Whites Just Don\u2019t Get It, Part 5', u'content_kicker': u'Op-Ed Columnist'}, u'abstract': None, u'print_page': u'9', u'word_count': u'797', u'_id': u'547a1ec438f0d803f445b283', u'snippet': u'How can we address the racial biases embedded in our society?', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/nicholas-kristof-when-whites-just-dont-get-it-part-5.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Blacks', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Discrimination', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Race and Ethnicity', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Social Conditions and Trends', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'National Basketball Assn', u'is_major': u'N', u'rank': u'5', u'name': u'organizations'}, {u'value': u'Booker, Cory A', u'is_major': u'N', u'rank': u'6', u'name': u'persons'}, {u'value': u'Police', u'is_major': u'N', u'rank': u'7', u'name': u'subject'}, {u'value': u'Wilson, Darren (1986- )', u'is_major': u'N', u'rank': u'8', u'name': u'persons'}, {u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'9', u'name': u'persons'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'10', u'name': u'glocations'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Nicholas', u'lastname': u'KRISTOF'}], u'original': u'By NICHOLAS KRISTOF'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}], u'meta': {u'hits': 44317, u'offset': 0, u'time': 13}}, u'copyright': u'Copyright (c) 2013 The New York Times Company. All Rights Reserved.'}
[{u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u'Leading U.S. CEOs, angered by the Obama administration\'s challenge to certain "workplace wellness" programs, are threatening to side with anti-Obamacare forces unless the government backs off, according to people familiar with the matter. ', u'headline': {u'main': u"Exclusive-U.S. CEOs Threaten to Pull Tacit Obamacare Support Over 'Wellness' Spat", u'print_headline': u"Exclusive-U.S. CEOs Threaten to Pull Tacit Obamacare Support Over 'Wellness' Spat"}, u'abstract': None, u'print_page': None, u'word_count': u'848', u'_id': u'5479b85138f0d86bf592fc14', u'snippet': u'Leading U.S. CEOs, angered by the Obama administration\'s challenge to certain "workplace wellness" programs, are threatening to side with anti-Obamacare forces unless the government backs off, according to people familiar with the matter. ', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/29/us/29reuters-usa-healthcare-wellness.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-29T07:12:01Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u'Leading U.S. CEOs, angered by the Obama administration\'s challenge to certain "workplace wellness" programs, are threatening to side with anti-Obamacare forces unless the government backs off, according to people familiar with the matter. ', u'headline': {u'main': u"Exclusive: U.S. CEOs Threaten to Pull Tacit Obamacare Support Over 'Wellness' Spat", u'print_headline': u"Exclusive: U.S. CEOs Threaten to Pull Tacit Obamacare Support Over 'Wellness' Spat"}, u'abstract': None, u'print_page': None, u'word_count': u'848', u'_id': u'5479b6ea38f0d86bf592fbf6', u'snippet': u'Leading U.S. CEOs, angered by the Obama administration\'s challenge to certain "workplace wellness" programs, are threatening to side with anti-Obamacare forces unless the government backs off, according to people familiar with the matter. ', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/29/us/29reuters-usa-healthcare-wellness-exclusive.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-29T07:05:56Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u'New York state health officials have stopped a nonprofit group from providing free medical care to thousands of patients lacking health insurance during a four-day dental conference that starts Friday. ', u'headline': {u'main': u'New York State Blocks Free Medical Services at Event', u'print_headline': u'New York State Blocks Free Medical Services at Event'}, u'abstract': None, u'print_page': None, u'word_count': u'401', u'_id': u'5478e56338f0d86bf592ea31', u'snippet': u'New York state health officials have stopped a nonprofit group from providing free medical care to thousands of patients lacking health insurance during a four-day dental conference that starts Friday. ', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/28/nyregion/28reuters-usa-newyork-medical.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-28T16:11:28Z', u'section_name': u'N.Y. / Region'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"Fresenius is considering pulling out of the bidding for French food group Danone's medical nutrition unit because of frustration with the slow progress of the process, two sources familiar with the situation said.", u'headline': {u'main': u'Fresenius Set to Walk Away From Danone Unit-Sources', u'print_headline': u'Fresenius Set to Walk Away From Danone Unit-Sources'}, u'abstract': None, u'print_page': None, u'word_count': u'310', u'_id': u'5478c5b838f0d86bf592e76b', u'snippet': u"Fresenius is considering pulling out of the bidding for French food group Danone's medical nutrition unit because of frustration with the slow progress of the process, two sources familiar with the situation said.", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/28/business/28reuters-danone-fresenius-medi.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-28T13:56:56Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u'Merck KGaA aims to keep hold of its consumer healthcare unit, it said on Friday, pledging to develop a business that is expected to generate 2014 sales of $1 billion (0.63 billion pounds) for the German drugs and chemicals company.', u'headline': {u'main': u"Germany's Merck Aims to Grow, Not Sell $1 Billion Consumer Health Arm", u'print_headline': u"Germany's Merck Aims to Grow, Not Sell $1 Billion Consumer Health Arm"}, u'abstract': None, u'print_page': None, u'word_count': u'375', u'_id': u'5478867638f0d854b20b33db', u'snippet': u'Merck KGaA aims to keep hold of its consumer healthcare unit, it said on Friday, pledging to develop a business that is expected to generate 2014 sales of $1 billion (0.63 billion pounds) for the German drugs and chemicals company.', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/28/business/28reuters-merck-consumers.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-28T09:24:55Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"Britain's biggest drugmaker, GlaxoSmithKline Plc, fired an executive from its South African unit for refusing to appear for a performance review, which was called a week after he complained of racial discrimination in the workplace, Bloomberg reported, citing company documents.", u'headline': {u'main': u'GlaxoSmithKline Fires Executive Who Raised Race Complaint in South Africa: Bloomberg', u'print_headline': u'GlaxoSmithKline Fires Executive Who Raised Race Complaint in South Africa: Bloomberg'}, u'abstract': None, u'print_page': None, u'word_count': u'216', u'_id': u'5477bca738f0d854b20b2219', u'snippet': u"Britain's biggest drugmaker, GlaxoSmithKline Plc, fired an executive from its South African unit for refusing to appear for a performance review, which was called a week after he complained of racial discrimination in the workplace, Bloomberg...", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/27/business/27reuters-gsk-employment.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-27T19:06:38Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u'European private equity house Apax [APAX.UL] is nearing the target on its $300 million (190.81 million dollars) Israeli mid-market fund and is expected hold a so-called "first close" next week, allowing it to start investing, a source familiar with the matter said. ', u'headline': {u'main': u"Apax's $300 Million Mid-Market Israeli Fund to Start Investing-Source", u'print_headline': u"Apax's $300 Million Mid-Market Israeli Fund to Start Investing-Source"}, u'abstract': None, u'print_page': None, u'word_count': u'354', u'_id': u'547726e638f0d83924902c25', u'snippet': u'European private equity house Apax [APAX.UL] is nearing the target on its $300 million (190.81 million dollars) Israeli mid-market fund and is expected hold a so-called "first close" next week, allowing it to start investing, a source familiar with...', u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/27/business/27reuters-apax-israel.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-27T08:26:07Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"Criticism of President Barack Obama's signature healthcare law by a top Senate Democrat this week laid bare post-election tensions that could pose challenges for the party in upcoming fights with Republicans over taxes, energy and immigration.", u'headline': {u'main': u'Tensions Flare Between Senate Democrats, White House', u'print_headline': u'Tensions Flare Between Senate Democrats, White House'}, u'abstract': None, u'print_page': None, u'word_count': u'636', u'_id': u'54764fbc38f0d839249018bf', u'snippet': u"Criticism of President Barack Obama's signature healthcare law by a top Senate Democrat this week laid bare post-election tensions that could pose challenges for the party in upcoming fights with Republicans over taxes, energy and immigration.", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/26/us/politics/26reuters-usa-obama-democrats.html', u'multimedia': [], u'subsection_name': u'Politics', u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-26T17:08:49Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"U.S. antitrust regulators on Wednesday approved a pair of major deals in the medical field, including Medtronic's purchase of Covidien, which will allow it to take advantage of tax breaks in Ireland.", u'headline': {u'main': u'Medtronic Gets U.S. Antitrust OK to Buy Covidien With Divestiture', u'print_headline': u'Medtronic Gets U.S. Antitrust OK to Buy Covidien With Divestiture'}, u'abstract': None, u'print_page': None, u'word_count': u'336', u'_id': u'5476344e38f0d8392490174f', u'snippet': u"U.S. antitrust regulators on Wednesday approved a pair of major deals in the medical field, including Medtronic's purchase of Covidien, which will allow it to take advantage of tax breaks in Ireland.", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/26/business/26reuters-covidien-medtronic-inc-antitrust.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-26T15:10:02Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"GlaxoSmithKline won U.S. antitrust approval to buy Novartis AG's vaccine business, with the exception of influenza vaccines, the two companies said on Wednesday.", u'headline': {u'main': u"U.S. Approves GSK's Purchase of Novartis Vaccine Business-Companies", u'print_headline': u"U.S. Approves GSK's Purchase of Novartis Vaccine Business-Companies"}, u'abstract': None, u'print_page': None, u'word_count': u'122', u'_id': u'54762c9b38f0d83924901733', u'snippet': u"GlaxoSmithKline won U.S. antitrust approval to buy Novartis AG's vaccine business, with the exception of influenza vaccines, the two companies said on Wednesday.", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/26/business/26reuters-novartis-glaxosmithkline-vaccine.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-26T14:39:23Z', u'section_name': u'Business Day'}], u'meta': {u'hits': 11577, u'offset': 0, u'time': 8}}, u'copyright': u'Copyright (c) 2013 The New York Times Company. All Rights Reserved.'}
[{u'type_of_material': u'Review', u'blog': [], u'news_desk': u'BookReview', u'lead_paragraph': u'George W. Bush\u2019s \u201c41,\u201d an affectionate biography of his father, takes readers through the touchstones of an extraordinary life.', u'headline': {u'main': u'George W. Bush\u2019s \u201841: A Portrait of My Father\u2019'}, u'abstract': None, u'print_page': u'11', u'word_count': u'1221', u'_id': u'546cc7bf38f0d869ced9a8d3', u'snippet': u'George W. Bush\u2019s \u201c41,\u201d an affectionate biography of his father, takes readers through the touchstones of an extraordinary life.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/12/28/books/review/george-w-bushs-41-a-portrait-of-my-father.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/19/books/review/19baker/19baker-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/19/books/review/19baker/19baker-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/19/books/review/19baker/19baker-articleLarge.jpg', u'height': 887, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/19/books/review/19baker/19baker-articleLarge.jpg', u'xlargeheight': u'887'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/19/books/review/19baker/19baker-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/19/books/review/19baker/19baker-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Book Review', u'keywords': [{u'value': u'41: A Portrait of My Father (Book)', u'is_major': u'N', u'rank': u'1', u'name': u'creative_works'}, {u'value': u'Bush, George W', u'is_major': u'N', u'rank': u'2', u'name': u'persons'}, {u'value': u'Bush, George', u'is_major': u'N', u'rank': u'3', u'name': u'persons'}, {u'value': u'Books and Literature', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'Presidents and Presidency (US)', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}], u'byline': {u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Peter', u'lastname': u'BAKER'}], u'original': u'By PETER BAKER'}, u'document_type': u'article', u'pub_date': u'2014-12-28T00:00:00Z', u'section_name': u'Books'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Culture', u'lead_paragraph': u"At recent sales in London, auction houses struggled to sell top Russian works of art. Some dealers said that the sluggish sales were a reflection of what's going on in Russia.", u'headline': {u'main': u'At Auctions, Russian Oligarchs Start to Hedge Their Bets', u'print_headline': u'At Auctions, Oligarchs Start to Hedge Their Bets'}, u'abstract': None, u'print_page': None, u'word_count': u'1108', u'_id': u'547894c138f0d854b20b352b', u'snippet': u"At recent sales in London, auction houses struggled to sell top Russian works of art. Some dealers said that the sluggish sales were a reflection of what's going on in Russia.", u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/12/01/arts/international/at-auctions-russian-oligarchs-start-to-hedge-their-bets.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/12/01/arts/international/01iht-reyburn01a/01iht-reyburn01a-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/12/01/arts/international/01iht-reyburn01a/01iht-reyburn01a-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/12/01/arts/international/01iht-reyburn01a/01iht-reyburn01a-articleLarge.jpg', u'height': 418, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/12/01/arts/international/01iht-reyburn01a/01iht-reyburn01a-articleLarge.jpg', u'xlargeheight': u'418'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/12/01/arts/international/01iht-reyburn01a/01iht-reyburn01a-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/12/01/arts/international/01iht-reyburn01a/01iht-reyburn01a-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'International Arts', u'keywords': [{u'value': u'Art', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Bonhams 1793 Ltd', u'is_major': u'N', u'rank': u'11', u'name': u'organizations'}, {u'value': u"Sotheby's", u'is_major': u'N', u'rank': u'12', u'name': u'organizations'}, {u'value': u'Lehman Brothers Holdings Inc', u'is_major': u'N', u'rank': u'13', u'name': u'organizations'}, {u'value': u'Faberge', u'is_major': u'N', u'rank': u'14', u'name': u'organizations'}, {u'value': u'Culture (Arts)', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Auctions', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'London (England)', u'is_major': u'N', u'rank': u'4', u'name': u'glocations'}, {u'value': u'Russia', u'is_major': u'N', u'rank': u'5', u'name': u'glocations'}, {u'value': u'Ruble (Currency)', u'is_major': u'N', u'rank': u'6', u'name': u'subject'}, {u'value': u'Economic Conditions and Trends', u'is_major': u'N', u'rank': u'7', u'name': u'subject'}, {u'value': u'Embargoes and Sanctions', u'is_major': u'N', u'rank': u'8', u'name': u'subject'}, {u'value': u'Collectors and Collections', u'is_major': u'N', u'rank': u'9', u'name': u'subject'}, {u'value': u"Christie's", u'is_major': u'N', u'rank': u'10', u'name': u'organizations'}], u'byline': {u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Scott', u'lastname': u'REYBURN'}], u'original': u'By SCOTT REYBURN'}, u'document_type': u'article', u'pub_date': u'2014-12-01T13:00:00Z', u'section_name': u'Arts'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"The ECB's monthly rate meeting will focus minds this week on the debate over quantitative easing in the euro zone, as a series of data releases on both sides of the Atlantic sheds more light on European woes and U.S. strength.", u'headline': {u'main': u'QE or Not QE? Spotlight on the ECB as Inflation Dips', u'print_headline': u'QE or Not QE? Spotlight on the ECB as Inflation Dips'}, u'abstract': None, u'print_page': None, u'word_count': u'621', u'_id': u'547addb238f0d803f445c2a8', u'snippet': u"The ECB's monthly rate meeting will focus minds this week on the debate over quantitative easing in the euro zone, as a series of data releases on both sides of the Atlantic sheds more light on European woes and U.S. strength.", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/30/business/30reuters-global-economy-weekahead.html', u'multimedia': [], u'subsection_name': None, u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-30T04:02:33Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"Pressure was building on Sunday for Taiwan's president to step down as chief of the island's China-friendly ruling party after an unprecedented election battering by the opposition threw into doubt efforts to build closer ties with the giant neighbor.", u'headline': {u'main': u"Taiwan President's Party Post at Risk After Election Trouncing", u'print_headline': u"Taiwan President's Party Post at Risk After Election Trouncing"}, u'abstract': None, u'print_page': None, u'word_count': u'537', u'_id': u'547ac91e38f0d803f445c103', u'snippet': u"Pressure was building on Sunday for Taiwan's president to step down as chief of the island's China-friendly ruling party after an unprecedented election battering by the opposition threw into doubt efforts to build closer ties with the giant...", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/30/world/asia/30reuters-taiwan-election.html', u'multimedia': [], u'subsection_name': u'Asia Pacific', u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-30T02:34:21Z', u'section_name': u'World'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'None', u'lead_paragraph': u"China's President Xi Jinping ratcheted down Beijing's heated rhetoric and called on the government to expand its foreign policy agenda through cooperation and diplomacy.", u'headline': {u'main': u"China's Xi Strikes Conciliatory Note, Broadens Diplomatic Focus", u'print_headline': u"China's Xi Strikes Conciliatory Note, Broadens Diplomatic Focus"}, u'abstract': None, u'print_page': None, u'word_count': u'382', u'_id': u'547ac5a038f0d803f445c0be', u'snippet': u"China's President Xi Jinping ratcheted down Beijing's heated rhetoric and called on the government to expand its foreign policy agenda through cooperation and diplomacy.", u'source': u'Reuters', u'web_url': u'http://www.nytimes.com/reuters/2014/11/30/world/asia/30reuters-china-southchinasea.html', u'multimedia': [], u'subsection_name': u'Asia Pacific', u'keywords': [], u'byline': {u'person': [], u'original': u'By REUTERS', u'organization': u'REUTERS'}, u'document_type': u'article', u'pub_date': u'2014-11-30T02:21:38Z', u'section_name': u'World'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'National', u'lead_paragraph': u'The president and his daughters, Malia and Sasha, visited Prose and Politics, an independent bookstore in Washington, on Saturday.', u'headline': {u'main': u'Honoring Small Business, Obamas Go Book Shopping', u'print_headline': u'Honoring Small Business, Obamas Go Book Shopping'}, u'abstract': None, u'print_page': u'24', u'word_count': u'488', u'_id': u'547a62d938f0d803f445b864', u'snippet': u'The president and his daughters, Malia and Sasha, visited Prose and Politics, an independent bookstore in Washington, on Saturday.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/us/honoring-small-business-obamas-go-book-shopping.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/us/30obama/30obama-thumbWide-v2.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/us/30obama/30obama-thumbWide-v2.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/us/30obama/30obama-articleLarge-v2.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/us/30obama/30obama-articleLarge-v2.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/us/30obama/30obama-thumbStandard-v2.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/us/30obama/30obama-thumbStandard-v2.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [{u'value': u'Black Friday and Cyber Monday (Shopping)', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Small Business', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Obama, Barack', u'is_major': u'N', u'rank': u'3', u'name': u'persons'}, {u'value': u'Politics and Prose', u'is_major': u'N', u'rank': u'4', u'name': u'organizations'}, {u'value': u'Books and Literature', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Elena', u'lastname': u'SCHNEIDER'}], u'original': u'By ELENA SCHNEIDER'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Business', u'lead_paragraph': u'Sony Pictures Entertainment is investigating what provoked the cyberattack, including whether there are any ties to a coming film that has elicited the ire of North Korea.', u'headline': {u'main': u'Intrusion on Sony Unit Prompts a Shutdown of Messaging Systems', u'print_headline': u'Intrusion on Sony Unit Prompts a Shutdown of Messaging Systems'}, u'abstract': None, u'print_page': u'24', u'word_count': u'861', u'_id': u'547a4f3438f0d803f445b6bd', u'snippet': u'Sony Pictures Entertainment is investigating what provoked the cyberattack, including whether there are any ties to a coming film that has elicited the ire of North Korea.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/business/media/intrusion-on-sony-unit-prompts-a-shutdown-of-messaging-systems.html', u'multimedia': [], u'subsection_name': u'Media', u'keywords': [{u'value': u'Sony Pictures Entertainment', u'is_major': u'N', u'rank': u'1', u'name': u'organizations'}, {u'value': u'United States', u'is_major': u'N', u'rank': u'2', u'name': u'glocations'}, {u'value': u'Cyberattacks and Hackers', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'North Korea', u'is_major': u'N', u'rank': u'4', u'name': u'glocations'}, {u'value': u'Rogen, Seth', u'is_major': u'N', u'rank': u'5', u'name': u'persons'}, {u'value': u'The Interview (Movie)', u'is_major': u'N', u'rank': u'6', u'name': u'creative_works'}, {u'value': u'Franco, James', u'is_major': u'N', u'rank': u'7', u'name': u'persons'}], u'byline': {u'contributor': u'Nicole Perlroth contributed reporting from New York.', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Brooks', u'lastname': u'BARNES'}, {u'organization': u'', u'role': u'reported', u'rank': 2, u'firstname': u'Michael', u'lastname': u'CIEPLY'}], u'original': u'By BROOKS BARNES and MICHAEL CIEPLY'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Business Day'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Foreign', u'lead_paragraph': u'Expeditions to the South Pacific island where many thousands died reflect a surge in interest among young Japanese in World War II.', u'headline': {u'main': u'Japanese Unearth Remains, and Their Nation’s Past, on Guadalcanal', u'print_headline': u'Japanese Unearth Remains, and Their Nation\u2019s Past, on Guadalcanal'}, u'abstract': None, u'print_page': u'20', u'word_count': u'1428', u'_id': u'547a4ef138f0d803f445b6b6', u'snippet': u'Expeditions to the South Pacific island where many thousands died reflect a surge in interest among young Japanese in World War II.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/world/japanese-unearth-remains-and-their-nations-past-on-guadalcanal.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/world/GAUDALCANAL/GAUDALCANAL-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/world/GAUDALCANAL/GAUDALCANAL-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/world/GAUDALCANAL/GAUDALCANAL-articleLarge.jpg', u'height': 480, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/world/GAUDALCANAL/GAUDALCANAL-articleLarge.jpg', u'xlargeheight': u'480'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/world/GAUDALCANAL/GAUDALCANAL-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/world/GAUDALCANAL/GAUDALCANAL-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Asia Pacific', u'keywords': [{u'value': u'World War II (1939-45)', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Solomon Islands', u'is_major': u'N', u'rank': u'2', u'name': u'glocations'}, {u'value': u'Japan', u'is_major': u'N', u'rank': u'4', u'name': u'glocations'}, {u'value': u'East China Sea', u'is_major': u'N', u'rank': u'5', u'name': u'glocations'}, {u'value': u'Abe, Shinzo', u'is_major': u'N', u'rank': u'6', u'name': u'persons'}, {u'value': u'Far East, South and Southeast Asia and Pacific Areas', u'is_major': u'N', u'rank': u'7', u'name': u'glocations'}, {u'value': u'Defense and Military Forces', u'is_major': u'N', u'rank': u'8', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Martin', u'lastname': u'FACKLER'}], u'original': u'By MARTIN FACKLER'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'World'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Foreign', u'lead_paragraph': u'The election results signaled that Taiwan’s governing Chinese Nationalist Party, known as the Kuomintang, would be hard-pressed to retain the presidency in the 2016 election.', u'headline': {u'main': u'Independent Is Elected Taipei Mayor as Taiwan\u2019s Governing Party Falters', u'print_headline': u'Independent is Elected Taipei Mayor as Taiwan\u2019s Governing Party Falters'}, u'abstract': None, u'print_page': u'10', u'word_count': u'685', u'_id': u'547a32e938f0d803f445b452', u'snippet': u'The election results signaled that Taiwan’s governing Chinese Nationalist Party, known as the Kuomintang, would be hard-pressed to retain the presidency in the 2016 election.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/world/asia/independent-is-elected-taipei-mayor-as-taiwans-governing-party-falters-.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/world/TAIWAN01/TAIWAN01-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/world/TAIWAN01/TAIWAN01-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/world/TAIWAN01/TAIWAN01-articleLarge.jpg', u'height': 416, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/world/TAIWAN01/TAIWAN01-articleLarge.jpg', u'xlargeheight': u'416'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/world/TAIWAN01/TAIWAN01-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/world/TAIWAN01/TAIWAN01-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Asia Pacific', u'keywords': [{u'value': u'Chinese Nationalist Party (Taiwan)', u'is_major': u'N', u'rank': u'1', u'name': u'organizations'}, {u'value': u'Taiwan', u'is_major': u'N', u'rank': u'2', u'name': u'glocations'}, {u'value': u'Jiang Yi-huah', u'is_major': u'N', u'rank': u'3', u'name': u'persons'}, {u'value': u'Elections', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Austin', u'lastname': u'RAMZY'}], u'original': u'By AUSTIN RAMZY'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'World'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Business', u'lead_paragraph': u'To combat declining attendance, movie theaters are experimenting with more immersive and interactive experiences, including moving seats, scents and precipitation.', u'headline': {u'main': u'To Lure Young, Movie Theaters Shake, Smell and Spritz', u'print_headline': u'To Lure Young, Theaters Shake, Smell and Spritz'}, u'abstract': None, u'print_page': u'1', u'word_count': u'1058', u'_id': u'547a2c4638f0d803f445b3b9', u'snippet': u'To combat declining attendance, movie theaters are experimenting with more immersive and interactive experiences, including moving seats, scents and precipitation.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/business/media/to-lure-young-movie-theaters-shake-smell-and-spritz.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/business/JP-THEATERS1/JP-THEATERS1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/business/JP-THEATERS1/JP-THEATERS1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/business/JP-THEATERS1/JP-THEATERS1-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/business/JP-THEATERS1/JP-THEATERS1-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/business/JP-THEATERS1/JP-THEATERS1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/business/JP-THEATERS1/JP-THEATERS1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Media', u'keywords': [{u'value': u'Movies', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Theaters (Buildings)', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Los Angeles (Calif)', u'is_major': u'N', u'rank': u'3', u'name': u'glocations'}, {u'value': u'Regal Entertainment Group', u'is_major': u'N', u'rank': u'4', u'name': u'organizations'}, {u'value': u'AMC Entertainment', u'is_major': u'N', u'rank': u'5', u'name': u'organizations'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Brooks', u'lastname': u'BARNES'}], u'original': u'By BROOKS BARNES'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Business Day'}], u'meta': {u'hits': 394244, u'offset': 0, u'time': 26}}, u'copyright': u'Copyright (c) 2013 The New York Times Company. All Rights Reserved.'}
[{u'type_of_material': u'News', u'blog': [], u'news_desk': u'National', u'lead_paragraph': u'The president and his daughters, Malia and Sasha, visited Prose and Politics, an independent bookstore in Washington, on Saturday.', u'headline': {u'main': u'Honoring Small Business, Obamas Go Book Shopping', u'print_headline': u'Honoring Small Business, Obamas Go Book Shopping'}, u'abstract': None, u'print_page': u'24', u'word_count': u'488', u'_id': u'547a62d938f0d803f445b864', u'snippet': u'The president and his daughters, Malia and Sasha, visited Prose and Politics, an independent bookstore in Washington, on Saturday.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/us/honoring-small-business-obamas-go-book-shopping.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/us/30obama/30obama-thumbWide-v2.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/us/30obama/30obama-thumbWide-v2.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/us/30obama/30obama-articleLarge-v2.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/us/30obama/30obama-articleLarge-v2.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/us/30obama/30obama-thumbStandard-v2.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/us/30obama/30obama-thumbStandard-v2.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [{u'value': u'Black Friday and Cyber Monday (Shopping)', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Small Business', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Obama, Barack', u'is_major': u'N', u'rank': u'3', u'name': u'persons'}, {u'value': u'Politics and Prose', u'is_major': u'N', u'rank': u'4', u'name': u'organizations'}, {u'value': u'Books and Literature', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Elena', u'lastname': u'SCHNEIDER'}], u'original': u'By ELENA SCHNEIDER'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'National', u'lead_paragraph': u'House Republicans say Congress never appropriated money for a provision of the Affordable Care Act that offers financial assistance to low- and moderate-income people.', u'headline': {u'main': u'Suit on Health Law Puts Focus on Funding Powers ', u'print_headline': u'Suit on Health Law Puts Focus on Funding Powers'}, u'abstract': None, u'print_page': u'25', u'word_count': u'864', u'_id': u'547a4dcd38f0d803f445b69a', u'snippet': u'House Republicans say Congress never appropriated money for a provision of the Affordable Care Act that offers financial assistance to low- and moderate-income people.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/us/politics/suit-on-health-law-puts-focus-on-funding-powers-.html', u'multimedia': [], u'subsection_name': u'Politics', u'keywords': [{u'value': u'Federal Budget (US)', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Health Insurance and Managed Care', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'United States Politics and Government', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'Patient Protection and Affordable Care Act (2010)', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}, {u'value': u'House of Representatives', u'is_major': u'N', u'rank': u'6', u'name': u'organizations'}, {u'value': u'Federal Aid (US)', u'is_major': u'N', u'rank': u'7', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Robert', u'lastname': u'PEAR'}], u'original': u'By ROBERT PEAR'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'U.S.'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'Foreign', u'lead_paragraph': u'Activists who supported the uprising that drove Hosni Mubarak from power in 2011 jeered a court ruling acquitting him on Saturday.', u'headline': {u'main': u'Egyptian Activists Protest Mubarak Verdict Online and Outside in a Sealed Tahrir Square', u'kicker': u'Open Source', u'content_kicker': u'Open Source'}, u'abstract': None, u'print_page': u'', u'word_count': u'1044', u'_id': u'547a46d238f0d803f445b602', u'snippet': u'Activists who supported the uprising that drove Hosni Mubarak from power in 2011 jeered a court ruling acquitting him on Saturday.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/world/africa/egyptian-activists-protest-mubarak-verdict-online-and-outside-sealed-tahrir-square.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/29/world/middleeast/29open_tahrir/29open_tahrir-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/29/world/middleeast/29open_tahrir/29open_tahrir-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/29/world/middleeast/29open_tahrir/29open_tahrir-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/29/world/middleeast/29open_tahrir/29open_tahrir-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/29/world/middleeast/29open_tahrir/29open_tahrir-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/29/world/middleeast/29open_tahrir/29open_tahrir-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Africa', u'keywords': [{u'value': u'Middle East and North Africa Unrest (2010- )', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Egypt', u'is_major': u'N', u'rank': u'2', u'name': u'glocations'}, {u'value': u'Tahrir Square (Cairo)', u'is_major': u'N', u'rank': u'3', u'name': u'glocations'}, {u'value': u'Mubarak, Hosni', u'is_major': u'N', u'rank': u'4', u'name': u'persons'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Robert', u'lastname': u'MACKEY'}], u'original': u'By ROBERT MACKEY'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'World'}, {u'type_of_material': u'News', u'blog': [], u'news_desk': u'NODESK', u'lead_paragraph': u'In taking control of nearly 70 state legislative chambers in the midterm elections, Republicans focused on recruiting women and minorities as candidates.', u'headline': {u'main': u'G.O.P. Gains by Tapping Democrats’ Base for State Candidates ', u'print_headline': u'G.O.P. Gains by Tapping Democrats\u2019 Base for State Candidates'}, u'abstract': None, u'print_page': u'22', u'word_count': u'1114', u'_id': u'547a3e7b38f0d803f445b543', u'snippet': u'In taking control of nearly 70 state legislative chambers in the midterm elections, Republicans focused on recruiting women and minorities as candidates.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/us/gop-gains-by-tapping-democrats-base-for-state-candidates-.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/us/GOPWOMEN/GOPWOMEN-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/us/GOPWOMEN/GOPWOMEN-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/us/GOPWOMEN/GOPWOMEN-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/us/GOPWOMEN/GOPWOMEN-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/us/GOPWOMEN/GOPWOMEN-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/us/GOPWOMEN/GOPWOMEN-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': None, u'keywords': [{u'value': u'United States Politics and Government', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Midterm Elections (2014)', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Republican Party', u'is_major': u'N', u'rank': u'3', u'name': u'organizations'}, {u'value': u'Women and Girls', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'Minorities', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}, {u'value': u'Martinez, Susana', u'is_major': u'N', u'rank': u'6', u'name': u'persons'}, {u'value': u'Obama, Barack', u'is_major': u'N', u'rank': u'7', u'name': u'persons'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Shaila', u'lastname': u'DEWAN'}], u'original': u'By SHAILA DEWAN'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'U.S.'}, {u'type_of_material': u'Op-Ed', u'blog': [], u'news_desk': u'OpEd', u'lead_paragraph': u'A weekly comic strip featured in the Sunday Review.', u'headline': {u'main': u'The Strip', u'print_headline': u'The Strip'}, u'abstract': None, u'print_page': u'2', u'word_count': u'9', u'_id': u'547a2e5a38f0d803f445b3e6', u'snippet': u'A weekly comic strip featured in the Sunday Review.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/the-strip-brian-mcfadden-comics.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/29/opinion/the-strip-11302014/the-strip-11302014-thumbWide.png', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/29/opinion/the-strip-11302014/the-strip-11302014-thumbWide.png', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/29/opinion/the-strip-11302014/the-strip-11302014-articleLarge.png', u'height': 312, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/29/opinion/the-strip-11302014/the-strip-11302014-articleLarge.png', u'xlargeheight': u'312'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/29/opinion/the-strip-11302014/the-strip-11302014-thumbStandard.png', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/29/opinion/the-strip-11302014/the-strip-11302014-thumbStandard.png', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Obama, Barack', u'is_major': u'Y', u'rank': u'1', u'name': u'persons'}, {u'value': u'Comic Books and Strips', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Brian', u'lastname': u'McFADDEN'}], u'original': u'By BRIAN McFADDEN'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}, {u'type_of_material': u'Editorial', u'blog': [], u'news_desk': u'Editorial', u'lead_paragraph': u'Economic forces that make homeownership less possible need to be in the forefront of political debate.', u'headline': {u'main': u'Homeownership and Wealth Creation ', u'kicker': u"Today's Editorials", u'print_headline': u'Homeownership and Wealth Creation', u'content_kicker': u'Editorial'}, u'abstract': None, u'print_page': u'8', u'word_count': u'615', u'_id': u'547a1feb38f0d803f445b2a3', u'snippet': u'Economic forces that make homeownership less possible need to be in the forefront of political debate.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/homeownership-and-wealth-creation.html', u'multimedia': [], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Real Estate and Housing (Residential)', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Renting and Leasing (Real Estate)', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Consumer Financial Protection Bureau', u'is_major': u'N', u'rank': u'3', u'name': u'organizations'}, {u'value': u'Consumer Protection', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'House of Representatives', u'is_major': u'N', u'rank': u'5', u'name': u'organizations'}, {u'value': u'Republican Party', u'is_major': u'N', u'rank': u'6', u'name': u'organizations'}, {u'value': u'Senate', u'is_major': u'N', u'rank': u'7', u'name': u'organizations'}], u'byline': {u'contributor': u'', u'person': [], u'original': u'By THE EDITORIAL BOARD', u'organization': u'THE EDITORIAL BOARD'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}, {u'type_of_material': u'Editorial', u'blog': [], u'news_desk': u'Editorial', u'lead_paragraph': u'They could play an important role in fighting climate change, but a lot more refueling stations will be needed.', u'headline': {u'main': u'Hydrogen Cars, Coming Down the Pike ', u'kicker': u'Editorial', u'print_headline': u'Hydrogen Cars, Coming Down the Pike', u'content_kicker': u'Editorial'}, u'abstract': None, u'print_page': u'8', u'word_count': u'650', u'_id': u'547a1ec138f0d803f445b27e', u'snippet': u'They could play an important role in fighting climate change, but a lot more refueling stations will be needed.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/hydrogen-cars-coming-down-the-pike.html', u'multimedia': [], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Hydrogen', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Electric and Hybrid Vehicles', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Automobiles', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Oil (Petroleum) and Gasoline', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}, {u'value': u'Alternative and Renewable Energy', u'is_major': u'N', u'rank': u'6', u'name': u'subject'}, {u'value': u'Toyota Motor Corporation', u'is_major': u'N', u'rank': u'7', u'name': u'organizations'}, {u'value': u'Honda Motor Co Ltd', u'is_major': u'N', u'rank': u'8', u'name': u'organizations'}], u'byline': {u'contributor': u'', u'person': [], u'original': u'By THE EDITORIAL BOARD', u'organization': u'THE EDITORIAL BOARD'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}, {u'type_of_material': u'Op-Ed', u'blog': [], u'news_desk': u'Editorial', u'lead_paragraph': u'After Ferguson, it’s harder to make a case for optimism about race and politics in America.', u'headline': {u'main': u'The Retreat to Identity', u'kicker': u'Op-Ed Columnist', u'print_headline': u'The Retreat to Identity', u'content_kicker': u'Op-Ed Columnist'}, u'abstract': None, u'print_page': u'9', u'word_count': u'806', u'_id': u'547a1ec138f0d803f445b27f', u'snippet': u'After Ferguson, it’s harder to make a case for optimism about race and politics in America.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/ross-douthat-the-retreat-to-identity.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbWide-v2.png', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbWide-v2.png', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbStandard-v2.png', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/01/opinion/douthat-circular/douthat-circular-thumbStandard-v2.png', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Race and Ethnicity', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Blacks', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Demonstrations, Protests and Riots', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Police Brutality, Misconduct and Shootings', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'Demonstrations, Protests and Riots', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'6', u'name': u'glocations'}, {u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'7', u'name': u'persons'}, {u'value': u'Social Conditions and Trends', u'is_major': u'N', u'rank': u'8', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Ross', u'lastname': u'DOUTHAT'}], u'original': u'By ROSS DOUTHAT'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}, {u'type_of_material': u'Op-Ed', u'blog': [], u'news_desk': u'Editorial', u'lead_paragraph': u'How can we address the racial biases embedded in our society?', u'headline': {u'main': u'When Whites Just Don’t Get It, Part 5', u'print_headline': u'When Whites Just Don\u2019t Get It, Part 5', u'content_kicker': u'Op-Ed Columnist'}, u'abstract': None, u'print_page': u'9', u'word_count': u'797', u'_id': u'547a1ec438f0d803f445b283', u'snippet': u'How can we address the racial biases embedded in our society?', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/nicholas-kristof-when-whites-just-dont-get-it-part-5.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/sunday-review/30KRISTOFsub/30KRISTOFsub-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Blacks', u'is_major': u'N', u'rank': u'1', u'name': u'subject'}, {u'value': u'Discrimination', u'is_major': u'N', u'rank': u'2', u'name': u'subject'}, {u'value': u'Race and Ethnicity', u'is_major': u'N', u'rank': u'3', u'name': u'subject'}, {u'value': u'Social Conditions and Trends', u'is_major': u'N', u'rank': u'4', u'name': u'subject'}, {u'value': u'National Basketball Assn', u'is_major': u'N', u'rank': u'5', u'name': u'organizations'}, {u'value': u'Booker, Cory A', u'is_major': u'N', u'rank': u'6', u'name': u'persons'}, {u'value': u'Police', u'is_major': u'N', u'rank': u'7', u'name': u'subject'}, {u'value': u'Wilson, Darren (1986- )', u'is_major': u'N', u'rank': u'8', u'name': u'persons'}, {u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'9', u'name': u'persons'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'10', u'name': u'glocations'}], u'byline': {u'contributor': u'', u'person': [{u'organization': u'', u'role': u'reported', u'rank': 1, u'firstname': u'Nicholas', u'lastname': u'KRISTOF'}], u'original': u'By NICHOLAS KRISTOF'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}, {u'type_of_material': u'Op-Ed', u'blog': [], u'news_desk': u'OpEd', u'lead_paragraph': u'Ferguson illuminates our country’s racial divide.', u'headline': {u'main': u'Where Do We Go After Ferguson?', u'kicker': u'Opinion', u'print_headline': u'Where Do We Go After Ferguson?', u'content_kicker': u'Opinion'}, u'abstract': None, u'print_page': u'1', u'word_count': u'2139', u'_id': u'547a1ec038f0d803f445b27d', u'snippet': u'Ferguson illuminates our country’s racial divide.', u'source': u'The New York Times', u'web_url': u'http://www.nytimes.com/2014/11/30/opinion/sunday/where-do-we-go-after-ferguson.html', u'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/30/sunday-review/30DYSONCOVER/30DYSONCOVER-thumbWide-v3.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/30/sunday-review/30DYSONCOVER/30DYSONCOVER-thumbWide-v3.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/30/sunday-review/30DYSONCOVER/30DYSONCOVER-articleLarge-v2.jpg', u'height': 888, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/30/sunday-review/30DYSONCOVER/30DYSONCOVER-articleLarge-v2.jpg', u'xlargeheight': u'888'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/30/sunday-review/30DYSONCOVER/30DYSONCOVER-thumbStandard-v2.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/30/sunday-review/30DYSONCOVER/30DYSONCOVER-thumbStandard-v2.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], u'subsection_name': u'Sunday Review', u'keywords': [{u'value': u'Wilson, Darren (1986- )', u'is_major': u'N', u'rank': u'1', u'name': u'persons'}, {u'value': u'Brown, Michael (1996-2014)', u'is_major': u'N', u'rank': u'2', u'name': u'persons'}, {u'value': u'Ferguson (Mo)', u'is_major': u'N', u'rank': u'3', u'name': u'glocations'}, {u'value': u'Kerner Commission', u'is_major': u'N', u'rank': u'4', u'name': u'organizations'}, {u'value': u'Police Brutality, Misconduct and Shootings', u'is_major': u'N', u'rank': u'5', u'name': u'subject'}, {u'value': u'Blacks', u'is_major': u'N', u'rank': u'6', u'name': u'subject'}, {u'value': u'Demonstrations, Protests and Riots', u'is_major': u'N', u'rank': u'7', u'name': u'subject'}, {u'value': u'Vandalism', u'is_major': u'N', u'rank': u'8', u'name': u'subject'}], u'byline': {u'contributor': u'', u'person': [{u'firstname': u'Michael', u'middlename': u'Eric', u'lastname': u'DYSON', u'rank': 1, u'role': u'reported', u'organization': u''}], u'original': u'By MICHAEL ERIC DYSON'}, u'document_type': u'article', u'pub_date': u'2014-11-30T00:00:00Z', u'section_name': u'Opinion'}], u'meta': {u'hits': 124424, u'offset': 0, u'time': 321}}, u'copyright': u'Copyright (c) 2013 The New York Times Company. All Rights Reserved.'}
(venv)ncl:server nkl223$
(venv)ncl:server nkl223$ python NYTimes.py
{'type_of_material': u'News', 'headline': u'Restoring Lost Names, Recapturing Lost Dignity ', 'abstract': u"Dan Barry This Land column on gravedigger Lawrence Mocha, who was buried under an anonymous numbered marker on grounds of New York's Willard State Psychiatric Hospital in 1968; some 55,000 patients have been buried under such markers at psychiatric institutions across state, and advocates want to see numbers linked to names of deceased; state officials have refused efforts, citing laws protecting privacy of psychiatric patients.", 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/us/JP-LAND1/JP-LAND1-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/us/JP-LAND1/JP-LAND1-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/us/JP-LAND1/JP-LAND1-articleLarge.jpg', u'height': 392, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/us/JP-LAND1/JP-LAND1-articleLarge.jpg', u'xlargeheight': u'392'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/us/JP-LAND1/JP-LAND1-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/us/JP-LAND1/JP-LAND1-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'An obscure gravedigger has come to represent the 55,000 other people buried on the grounds of old psychiatric hospitals across New York State — many of them identified only by numbers.', 'web_url': u'http://www.nytimes.com/2014/11/28/us/restoring-lost-names-recapturing-lost-dignity.html', 'section_name': u'U.S.', 'keywords': [u'Cemeteries', u'Mental Health and Disorders', u'New York State', u'Mocha, Lawrence (1878-1968)', u'Willard Psychiatric Hospital', u'Hospitals', u'Monuments and Memorials (Structures)', u'Intellectual Disabilities'], '_id': u'5477ea1f38f0d854b20b2608', 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'Mexican Leader, Facing Protests, Promises to Overhaul Policing', 'abstract': u'Mexican Pres Enrique Pena Nieto, facing protests, proposes broad plan to revamp policing after local officials and police are implicated in disappearance and presumed murder of 43 college students; more than 1,800 municipal police forces would effectively be disbanded and come under control of state governments; federal government would have power to dissolve corrupt municipal governments.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/world/MEXICO/MEXICO-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/world/MEXICO/MEXICO-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/world/MEXICO/MEXICO-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/world/MEXICO/MEXICO-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/world/MEXICO/MEXICO-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/world/MEXICO/MEXICO-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'President Enrique Pe\xf1a Nieto\u2019s plan makes forces answerable to state and federal authorities, though observers questioned the credibility of a president who has had scandals of his own.', 'web_url': u'http://www.nytimes.com/2014/11/28/world/americas/mexican-leader-facing-protests-promises-to-overhaul-policing.html', 'section_name': u'World', 'keywords': [u'Mexico', u'Pena Nieto, Enrique', u'Missing Persons', u'Police Brutality, Misconduct and Shootings', u'Kidnapping and Hostages', u'Escuela Normal Rural Raul Isidro Burgos (Guerrero, Mexico)', u'Organized Crime', u'Corruption (Institutional)'], '_id': u'5477d87638f0d854b20b2478', 'pub_date': u'20141128'}
{'type_of_material': u'News', 'headline': u'As Mexican Border Town Tries to Move On, Some Are Stuck in Limbo', 'abstract': u'Tijuana Journal: Tijuana, Mexico, is promoting itself as a city on the rise, but it has long been and remains a way station for the downtrodden heading to America or kicked out of it; El Bordo is an encampment for hundreds living in hovels, lean-tos or on the pavement, and is a catch basin for the drug addicted and the deported, sometimes both, just shy of the United States-Mexico border.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/world/TIJUANA01/TIJUANA01-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/world/TIJUANA01/TIJUANA01-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/world/TIJUANA01/TIJUANA01-articleLarge.jpg', u'height': 400, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/world/TIJUANA01/TIJUANA01-articleLarge.jpg', u'xlargeheight': u'400'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/world/TIJUANA01/TIJUANA01-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/world/TIJUANA01/TIJUANA01-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'Tijuana is promoting itself as a city on the rise, shaking off years of drug violence and declining tourism. But it remains a way station for the downtrodden heading for America or kicked out of it.', 'web_url': u'http://www.nytimes.com/2014/11/28/world/americas/a-border-limbo-for-the-displaced-at-home-in-mexico-no-more-.html', 'section_name': u'World', 'keywords': [u'Mexico', u'Tijuana (Mexico)', u'Immigration and Emigration', u'Deportation', u'Drug Abuse and Traffic', u'United States', u'Illegal Immigration'], '_id': u'5477d07e38f0d854b20b23d0', 'pub_date': u'20141128'}
{'type_of_material': u'Op-Ed', 'headline': u'Remember the Sand Creek Massacre', 'abstract': u'Op-Ed article by Prof Ned Blackhawk recounts 1864 attack by Union armies on peaceful Cheyenne and Arapaho villagers at Sand Creek in Colorado, in which nearly 200 women, children and older men were murdered; holds Civil War obscures campaigns like Sand Creek Massacre and other acts of ethnic cleansing against American Indians; calls for National Day of Indigenous Remembrance and Survival to commemorate those murdered at Sand Creek.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/11/28/opinion/1128OPEDlarsen/1128OPEDlarsen-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/11/28/opinion/1128OPEDlarsen/1128OPEDlarsen-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/11/28/opinion/1128OPEDlarsen/1128OPEDlarsen-articleLarge.jpg', u'height': 388, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/11/28/opinion/1128OPEDlarsen/1128OPEDlarsen-articleLarge.jpg', u'xlargeheight': u'388'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/11/28/opinion/1128OPEDlarsen/1128OPEDlarsen-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/11/28/opinion/1128OPEDlarsen/1128OPEDlarsen-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'The 1864 murder of 200 innocent Indians is still largely forgotten.', 'web_url': u'http://www.nytimes.com/2014/11/28/opinion/remember-the-sand-creek-massacre.html', 'section_name': u'Opinion', 'keywords': [u'Native Americans', u'Civil War (US) (1861-65)', u'War Crimes, Genocide and Crimes Against Humanity', u'Navajo Indians', u'United States Defense and Military Forces', u'Chivington, John M (1821-94)', u'Connor, Patrick Edward (1820-91)', u'Soule, Silas (1838-65)', u'Evans, John (1814-97)'], '_id': u'5477b65938f0d854b20b218e', 'pub_date': u'20141128'}
{'type_of_material': u'Op-Ed', 'headline': u'The Trick to Being More Virtuous', 'abstract': u'Arthur C Brooks Op-Ed article describes how he changed his behavior, and even felt happier and more courteous, after he started to use briefcase emblazoned with name of Mormon college Brigham Young University; notes it is example of psychological phenomenon known as moral elevation, emotional state that leads one to act virtuously when exposed to virtues of others; contends voters should challenge political leaders and demand climate of moral elevation.', 'multimedia': [{u'subtype': u'wide', u'url': u'images/2014/02/13/opinion/arthur-brooks/arthur-brooks-thumbWide.jpg', u'height': 126, u'width': 190, u'legacy': {u'wide': u'images/2014/02/13/opinion/arthur-brooks/arthur-brooks-thumbWide.jpg', u'wideheight': u'126', u'widewidth': u'190'}, u'type': u'image'}, {u'subtype': u'xlarge', u'url': u'images/2014/02/13/opinion/arthur-brooks/arthur-brooks-articleLarge.jpg', u'height': 600, u'width': 600, u'legacy': {u'xlargewidth': u'600', u'xlarge': u'images/2014/02/13/opinion/arthur-brooks/arthur-brooks-articleLarge.jpg', u'xlargeheight': u'600'}, u'type': u'image'}, {u'subtype': u'thumbnail', u'url': u'images/2014/02/13/opinion/arthur-brooks/arthur-brooks-thumbStandard.jpg', u'height': 75, u'width': 75, u'legacy': {u'thumbnailheight': u'75', u'thumbnail': u'images/2014/02/13/opinion/arthur-brooks/arthur-brooks-thumbStandard.jpg', u'thumbnailwidth': u'75'}, u'type': u'image'}], 'snippet': u'I was more polite when I carried the briefcase the Mormons gave me.', 'web_url': u'http://www.nytimes.com/2014/11/28/opinion/the-trick-to-being-more-virtuous.html', 'section_name': u'Opinion', 'keywords': [u'United States Politics and Government', u'Mormons (Church of Jesus Christ of Latter-Day Saints)', u'Psychology and Psychologists', u'Colleges and Universities', u'Optimism', u'Brigham Young University', u'Ethics (Personal)'], '_id': u'5477b4d338f0d854b20b216d', 'pub_date': u'20141128'}]
(venv)ncl:server nkl223$
fields:
snippet
web_url
abstract
multimedia
keywords
pub_date
type_of_material
section_name
headline
_id
| 2,705.977273 | 23,128 | 0.717099 | 20,343 | 119,063 | 4.15745 | 0.096495 | 0.02334 | 0.031995 | 0.035968 | 0.820668 | 0.801632 | 0.788661 | 0.77582 | 0.765687 | 0.752374 | 0 | 0.065354 | 0.091918 | 119,063 | 44 | 23,129 | 2,705.977273 | 0.716886 | 0 | 0 | 0.1 | 0 | 6.475 | 0.738998 | 0.143536 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.05 | 0.025 | null | null | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
a0fb2844ff0d7e2b209b9aedaeb97271e3a9bbcd | 10,412 | py | Python | google/ads/google_ads/v6/proto/services/offline_user_data_job_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/services/offline_user_data_job_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/services/offline_user_data_job_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.ads.google_ads.v6.proto.resources import offline_user_data_job_pb2 as google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_offline__user__data__job__pb2
from google.ads.google_ads.v6.proto.services import offline_user_data_job_service_pb2 as google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2
from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2
class OfflineUserDataJobServiceStub(object):
"""Proto file describing the OfflineUserDataJobService.
Service to manage offline user data jobs.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.CreateOfflineUserDataJob = channel.unary_unary(
'/google.ads.googleads.v6.services.OfflineUserDataJobService/CreateOfflineUserDataJob',
request_serializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.CreateOfflineUserDataJobRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.CreateOfflineUserDataJobResponse.FromString,
)
self.GetOfflineUserDataJob = channel.unary_unary(
'/google.ads.googleads.v6.services.OfflineUserDataJobService/GetOfflineUserDataJob',
request_serializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.GetOfflineUserDataJobRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_offline__user__data__job__pb2.OfflineUserDataJob.FromString,
)
self.AddOfflineUserDataJobOperations = channel.unary_unary(
'/google.ads.googleads.v6.services.OfflineUserDataJobService/AddOfflineUserDataJobOperations',
request_serializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.AddOfflineUserDataJobOperationsRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.AddOfflineUserDataJobOperationsResponse.FromString,
)
self.RunOfflineUserDataJob = channel.unary_unary(
'/google.ads.googleads.v6.services.OfflineUserDataJobService/RunOfflineUserDataJob',
request_serializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.RunOfflineUserDataJobRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
class OfflineUserDataJobServiceServicer(object):
"""Proto file describing the OfflineUserDataJobService.
Service to manage offline user data jobs.
"""
def CreateOfflineUserDataJob(self, request, context):
"""Creates an offline user data job.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetOfflineUserDataJob(self, request, context):
"""Returns the offline user data job.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def AddOfflineUserDataJobOperations(self, request, context):
"""Adds operations to the offline user data job.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RunOfflineUserDataJob(self, request, context):
"""Runs the offline user data job.
When finished, the long running operation will contain the processing
result or failure information, if any.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_OfflineUserDataJobServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'CreateOfflineUserDataJob': grpc.unary_unary_rpc_method_handler(
servicer.CreateOfflineUserDataJob,
request_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.CreateOfflineUserDataJobRequest.FromString,
response_serializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.CreateOfflineUserDataJobResponse.SerializeToString,
),
'GetOfflineUserDataJob': grpc.unary_unary_rpc_method_handler(
servicer.GetOfflineUserDataJob,
request_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.GetOfflineUserDataJobRequest.FromString,
response_serializer=google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_offline__user__data__job__pb2.OfflineUserDataJob.SerializeToString,
),
'AddOfflineUserDataJobOperations': grpc.unary_unary_rpc_method_handler(
servicer.AddOfflineUserDataJobOperations,
request_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.AddOfflineUserDataJobOperationsRequest.FromString,
response_serializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.AddOfflineUserDataJobOperationsResponse.SerializeToString,
),
'RunOfflineUserDataJob': grpc.unary_unary_rpc_method_handler(
servicer.RunOfflineUserDataJob,
request_deserializer=google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.RunOfflineUserDataJobRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'google.ads.googleads.v6.services.OfflineUserDataJobService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class OfflineUserDataJobService(object):
"""Proto file describing the OfflineUserDataJobService.
Service to manage offline user data jobs.
"""
@staticmethod
def CreateOfflineUserDataJob(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.OfflineUserDataJobService/CreateOfflineUserDataJob',
google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.CreateOfflineUserDataJobRequest.SerializeToString,
google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.CreateOfflineUserDataJobResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetOfflineUserDataJob(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.OfflineUserDataJobService/GetOfflineUserDataJob',
google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.GetOfflineUserDataJobRequest.SerializeToString,
google_dot_ads_dot_googleads_dot_v6_dot_resources_dot_offline__user__data__job__pb2.OfflineUserDataJob.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def AddOfflineUserDataJobOperations(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.OfflineUserDataJobService/AddOfflineUserDataJobOperations',
google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.AddOfflineUserDataJobOperationsRequest.SerializeToString,
google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.AddOfflineUserDataJobOperationsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def RunOfflineUserDataJob(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.OfflineUserDataJobService/RunOfflineUserDataJob',
google_dot_ads_dot_googleads_dot_v6_dot_services_dot_offline__user__data__job__service__pb2.RunOfflineUserDataJobRequest.SerializeToString,
google_dot_longrunning_dot_operations__pb2.Operation.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
| 56.586957 | 190 | 0.752401 | 1,038 | 10,412 | 6.981696 | 0.123314 | 0.048572 | 0.066234 | 0.07203 | 0.816476 | 0.802815 | 0.787084 | 0.725128 | 0.711329 | 0.672692 | 0 | 0.007606 | 0.191894 | 10,412 | 183 | 191 | 56.896175 | 0.853696 | 0.077027 | 0 | 0.477612 | 1 | 0 | 0.106789 | 0.087392 | 0 | 0 | 0 | 0 | 0 | 1 | 0.074627 | false | 0 | 0.029851 | 0.029851 | 0.156716 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
19bd0b37c3c8bef04b29f7f352090bddd3571a83 | 11,482 | py | Python | src/capsNet_arch.py | LeanderLXZ/oracle-recognition | c82976333d4a72218b06fffc94192238d95fcf9e | [
"Apache-2.0"
] | 1 | 2022-02-08T09:33:16.000Z | 2022-02-08T09:33:16.000Z | src/capsNet_arch.py | LeanderLXZ/oracle-recognition | c82976333d4a72218b06fffc94192238d95fcf9e | [
"Apache-2.0"
] | null | null | null | src/capsNet_arch.py | LeanderLXZ/oracle-recognition | c82976333d4a72218b06fffc94192238d95fcf9e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from models.layers import *
from models.capsule_layers import *
def conv_block(model, cfg, conv_size, conv_stride, conv_depth,
conv_padding='VALID', act_fn='relu',
use_max_pool=False, use_avg_pool=False,
pool_size=None, pool_strides=None, pool_padding='VALID',
use_batch_norm=False, is_training=None, idx=0):
model.add(ConvLayer(
cfg,
kernel_size=conv_size,
stride=conv_stride,
n_kernel=conv_depth,
padding=conv_padding,
act_fn=None if use_batch_norm else act_fn,
idx=idx
))
if use_max_pool:
model.add(MaxPool(
cfg,
pool_size=pool_size,
strides=pool_strides,
padding=pool_padding,
idx=idx
))
if use_avg_pool:
model.add(AveragePool(
cfg,
pool_size=pool_size,
strides=pool_strides,
padding=pool_padding,
idx=idx
))
if use_batch_norm:
model.add(BatchNorm(
cfg,
is_training=is_training,
momentum=0.99,
act_fn=act_fn,
idx=idx))
def classifier(inputs, cfg, batch_size=None, is_training=None):
if cfg.DATABASE_NAME == 'radical':
num_classes = cfg.NUM_RADICALS
else:
num_classes = 10
model = Sequential(inputs)
model.add(ConvLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=256,
padding='VALID',
act_fn='relu',
idx=0
))
model.add(Conv2CapsLayer(
cfg,
kernel_size=9,
stride=2,
n_kernel=32,
vec_dim=8,
padding='VALID',
batch_size=batch_size
))
model.add(CapsLayer(
cfg,
num_caps=num_classes,
vec_dim=16,
route_epoch=3,
batch_size=batch_size,
idx=0
))
return model.top_layer, model.info
def decoder(inputs, cfg, batch_size=None, is_training=None):
model = Sequential(inputs)
act_fn_last = None if cfg.REC_LOSS == 'ce' else 'relu'
if cfg.DATABASE_NAME == 'radical':
if cfg.DECODER_TYPE == 'fc':
model.add(DenseLayer(
cfg,
out_dim=512,
act_fn='relu',
idx=0))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=0))
model.add(DenseLayer(
cfg,
out_dim=1024,
act_fn='relu',
idx=1))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=1))
model.add(DenseLayer(
cfg,
out_dim=28*28,
act_fn=act_fn_last,
idx=2))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn=act_fn_last, idx=2))
elif cfg.DECODER_TYPE == 'conv':
model.add(Reshape( # (b, 4, 4, 1)
(batch_size, 4, 4, -1), name='reshape'))
model.add(ConvLayer( # (b, 8, 8, 16)
cfg,
kernel_size=3,
stride=1,
n_kernel=16,
resize=8,
act_fn=None,
idx=0))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=0))
model.add(ConvLayer( # (b, 16, 16, 32)
cfg,
kernel_size=3,
stride=1,
n_kernel=32,
resize=16,
act_fn=None,
idx=1))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=1))
model.add(ConvLayer( # (b, 32, 32, 16)
cfg,
kernel_size=3,
stride=1,
n_kernel=16,
resize=32,
act_fn=None,
idx=2))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=2))
model.add(ConvLayer( # (b, 32, 32, 1)
cfg,
kernel_size=3,
stride=1,
n_kernel=1,
resize=32,
padding='SAME',
act_fn=None,
idx=3))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn=act_fn_last, idx=3))
elif cfg.DECODER_TYPE == 'conv_t':
model.add(Reshape(
(batch_size, 1, 1, -1), name='reshape'))
model.add(ConvTLayer(
cfg,
kernel_size=4,
stride=1,
n_kernel=16,
output_shape=[batch_size, 4, 4, 16],
padding='VALID',
act_fn=None,
idx=0))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=0))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=32,
output_shape=[batch_size, 12, 12, 32],
padding='VALID',
act_fn=None,
idx=1))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=1))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=16,
output_shape=[batch_size, 20, 20, 16],
padding='VALID',
act_fn=None,
idx=2))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=2))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=8,
output_shape=[batch_size, 28, 28, 8],
padding='VALID',
act_fn=None,
idx=3))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=3))
model.add(ConvTLayer(
cfg,
kernel_size=3,
stride=1,
n_kernel=1,
output_shape=[batch_size, 28, 28, 1],
padding='SAME',
act_fn=act_fn_last,
idx=4))
else:
raise ValueError('Wrong decoder type!')
elif cfg.DATABASE_NAME == 'mnist':
if cfg.DECODER_TYPE == 'fc':
model.add(DenseLayer(
cfg,
out_dim=512,
idx=0))
model.add(DenseLayer(
cfg,
out_dim=1024,
idx=1))
model.add(DenseLayer(
cfg,
out_dim=784,
act_fn=act_fn_last,
idx=2))
elif cfg.DECODER_TYPE == 'conv':
model.add(Reshape( # (b, 4, 4, 1)
(batch_size, 4, 4, -1), name='reshape'))
model.add(ConvLayer( # (b, 8, 8, 16)
cfg,
kernel_size=3,
stride=1,
n_kernel=16,
idx=0))
model.add(ConvLayer( # (b, 16, 16, 32)
cfg,
kernel_size=3,
stride=1,
n_kernel=32,
resize=16,
idx=1))
model.add(ConvLayer( # (b, 32, 32, 16)
cfg,
kernel_size=3,
stride=1,
n_kernel=16,
resize=32,
idx=2))
model.add(ConvLayer( # (b, 32, 32, 3)
cfg,
kernel_size=3,
stride=1,
n_kernel=3,
act_fn=act_fn_last,
idx=3))
elif cfg.DECODER_TYPE == 'conv_t':
model.add(Reshape(
(batch_size, 1, 1, -1), name='reshape'))
model.add(ConvTLayer(
cfg,
kernel_size=4,
stride=1,
n_kernel=16,
output_shape=[batch_size, 4, 4, 16],
padding='VALID',
act_fn=None,
idx=0))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=0))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=32,
output_shape=[batch_size, 12, 12, 32],
padding='VALID',
act_fn=None,
idx=1))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=1))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=16,
output_shape=[batch_size, 20, 20, 16],
padding='VALID',
act_fn=None,
idx=2))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=2))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=8,
output_shape=[batch_size, 28, 28, 8],
padding='VALID',
act_fn=None,
idx=3))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=3))
model.add(ConvTLayer(
cfg,
kernel_size=3,
stride=1,
n_kernel=1,
output_shape=[batch_size, 28, 28, 1],
act_fn=act_fn_last,
idx=4))
else:
raise ValueError('Wrong decoder type!')
elif cfg.DATABASE_NAME == 'cifar10':
if cfg.DECODER_TYPE == 'fc':
model.add(DenseLayer(
cfg,
out_dim=2048,
idx=0))
model.add(DenseLayer(
cfg,
out_dim=4096,
idx=1))
model.add(DenseLayer(
cfg,
out_dim=3072,
act_fn=act_fn_last,
idx=2))
elif cfg.DECODER_TYPE == 'conv':
model.add(Reshape( # (b, 4, 4, 1)
(batch_size, 4, 4, -1), name='reshape'))
model.add(ConvLayer( # (b, 8, 8, 16)
cfg,
kernel_size=3,
stride=1,
n_kernel=16,
idx=0))
model.add(ConvLayer( # (b, 16, 16, 32)
cfg,
kernel_size=3,
stride=1,
n_kernel=32,
resize=16,
idx=1))
model.add(ConvLayer( # (b, 32, 32, 16)
cfg,
kernel_size=3,
stride=1,
n_kernel=16,
resize=32,
idx=2))
model.add(ConvLayer( # (b, 32, 32, 3)
cfg,
kernel_size=3,
stride=1,
n_kernel=3,
act_fn=act_fn_last,
idx=3))
elif cfg.DECODER_TYPE == 'conv_t':
model.add(Reshape(
(batch_size, 1, 1, -1), name='reshape'))
model.add(ConvTLayer(
cfg,
kernel_size=4,
stride=1,
n_kernel=16,
output_shape=[batch_size, 4, 4, 16],
padding='VALID',
act_fn=None,
idx=0))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=0))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=32,
output_shape=[batch_size, 12, 12, 32],
padding='VALID',
act_fn=None,
idx=1))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=1))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=16,
output_shape=[batch_size, 20, 20, 16],
padding='VALID',
act_fn=None,
idx=2))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=2))
model.add(ConvTLayer(
cfg,
kernel_size=9,
stride=1,
n_kernel=8,
output_shape=[batch_size, 28, 28, 8],
padding='VALID',
act_fn=None,
idx=3))
model.add(BatchNorm(
cfg, is_training, momentum=0.99, act_fn='relu', idx=3))
model.add(ConvTLayer(
cfg,
kernel_size=5,
stride=1,
n_kernel=3,
output_shape=[batch_size, 32, 32, 3],
padding='VALID',
act_fn=act_fn_last,
idx=4))
else:
raise ValueError('Wrong decoder type!')
else:
raise ValueError('Wrong database name!')
return model.top_layer, model.info
caps_arch = {
'classifier': classifier,
'decoder': decoder
}
| 25.86036 | 71 | 0.514109 | 1,468 | 11,482 | 3.826975 | 0.075613 | 0.096832 | 0.06942 | 0.069776 | 0.838021 | 0.815949 | 0.792275 | 0.782841 | 0.742613 | 0.721609 | 0 | 0.061461 | 0.360913 | 11,482 | 443 | 72 | 25.918736 | 0.704143 | 0.019248 | 0 | 0.86506 | 0 | 0 | 0.033882 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.007229 | false | 0 | 0.012048 | 0 | 0.024096 | 0.00241 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
19e2ac7872bbafbe6df1586ff5ada49f3e1552a3 | 47 | py | Python | src/kinematics_from_description/__init__.py | LSinterbotix/kinematics_from_description | c53893dbc289f959db907814e5cd2069c0ff94d3 | [
"BSD-2-Clause"
] | 2 | 2022-01-13T19:16:32.000Z | 2022-03-05T01:39:54.000Z | src/kinematics_from_description/__init__.py | LSinterbotix/kinematics_from_description | c53893dbc289f959db907814e5cd2069c0ff94d3 | [
"BSD-2-Clause"
] | null | null | null | src/kinematics_from_description/__init__.py | LSinterbotix/kinematics_from_description | c53893dbc289f959db907814e5cd2069c0ff94d3 | [
"BSD-2-Clause"
] | null | null | null | from .kfd import KinematicsFromDescriptionTool
| 23.5 | 46 | 0.893617 | 4 | 47 | 10.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085106 | 47 | 1 | 47 | 47 | 0.976744 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
19e66e673eabf0690e15636e2cecffb2c335056f | 74 | py | Python | snlp/mwes/__init__.py | meghdadFar/snlp | deb37b12bc5112b74d0bf8187f47b5d36bf6b943 | [
"MIT"
] | 4 | 2021-01-12T15:16:16.000Z | 2021-08-06T08:38:35.000Z | snlp/mwes/__init__.py | meghdadFar/snlp | deb37b12bc5112b74d0bf8187f47b5d36bf6b943 | [
"MIT"
] | null | null | null | snlp/mwes/__init__.py | meghdadFar/snlp | deb37b12bc5112b74d0bf8187f47b5d36bf6b943 | [
"MIT"
] | null | null | null | from snlp.mwes.mwe_utils import replace_mwes
from snlp.mwes.mwe import MWE | 37 | 44 | 0.851351 | 14 | 74 | 4.357143 | 0.5 | 0.262295 | 0.393443 | 0.491803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094595 | 74 | 2 | 45 | 37 | 0.910448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
19eac500a092837d55140ebbe1416a3a1fb17b6a | 2,672 | py | Python | test/pyaz/sql/vm/group/ag_listener/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/sql/vm/group/ag_listener/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/sql/vm/group/ag_listener/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from ..... pyaz_utils import get_cli_name, get_params
def update(resource_group, group_name, name, sqlvms=None, set=None, add=None, remove=None, force_string=None):
params = get_params(locals())
command = "az sql vm group ag-listener update " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = output.stdout.decode("utf-8")
stderr = output.stderr.decode("utf-8")
if stdout:
return json.loads(stdout)
print(stdout)
else:
raise Exception(stderr)
print(stderr)
def show(resource_group, group_name, name):
params = get_params(locals())
command = "az sql vm group ag-listener show " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = output.stdout.decode("utf-8")
stderr = output.stderr.decode("utf-8")
if stdout:
return json.loads(stdout)
print(stdout)
else:
raise Exception(stderr)
print(stderr)
def list(resource_group, group_name):
params = get_params(locals())
command = "az sql vm group ag-listener list " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = output.stdout.decode("utf-8")
stderr = output.stderr.decode("utf-8")
if stdout:
return json.loads(stdout)
print(stdout)
else:
raise Exception(stderr)
print(stderr)
def delete(resource_group, group_name, name, yes=None):
params = get_params(locals())
command = "az sql vm group ag-listener delete " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = output.stdout.decode("utf-8")
stderr = output.stderr.decode("utf-8")
if stdout:
return json.loads(stdout)
print(stdout)
else:
raise Exception(stderr)
print(stderr)
def create(name, group_name, resource_group, ag_name, ip_address, subnet, load_balancer, probe_port, sqlvms, port=None, public_ip=None, vnet_name=None):
params = get_params(locals())
command = "az sql vm group ag-listener create " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = output.stdout.decode("utf-8")
stderr = output.stderr.decode("utf-8")
if stdout:
return json.loads(stdout)
print(stdout)
else:
raise Exception(stderr)
print(stderr)
| 36.108108 | 152 | 0.66729 | 342 | 2,672 | 5.137427 | 0.172515 | 0.079681 | 0.056915 | 0.059761 | 0.840068 | 0.797951 | 0.797951 | 0.797951 | 0.797951 | 0.797951 | 0 | 0.004778 | 0.216692 | 2,672 | 73 | 153 | 36.60274 | 0.834687 | 0 | 0 | 0.820896 | 0 | 0 | 0.08271 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.074627 | false | 0 | 0.029851 | 0 | 0.179104 | 0.223881 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
dfaa0ef780ff2fdd8fd4e9b882802bbe79088d2b | 791 | py | Python | tests/s3_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | 1 | 2020-08-31T17:53:01.000Z | 2020-08-31T17:53:01.000Z | tests/s3_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | null | null | null | tests/s3_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | null | null | null | import vaex
import os
import pytest
@pytest.mark.skipif(vaex.utils.devmode, reason='runs too slow when developing')
def test_s3():
df = vaex.open('s3://vaex/testing/xys.hdf5?cache=false&anon=true')
assert df.x.tolist() == [1, 2]
assert df.y.tolist() == [3, 4]
assert df.s.tolist() == ['5', '6']
df = vaex.open('s3://vaex/testing/xys.hdf5?cache=true&anon=true')
assert df.x.tolist() == [1, 2]
assert df.y.tolist() == [3, 4]
assert df.s.tolist() == ['5', '6']
@pytest.mark.skipif(vaex.utils.devmode, reason='runs too slow when developing')
def test_s3_masked():
df = vaex.open('s3://vaex/testing/xys-masked.hdf5?cache=false&anon=true')
assert df.x.tolist() == [1, None]
assert df.y.tolist() == [None, 4]
assert df.s.tolist() == ['5', None]
| 31.64 | 79 | 0.624526 | 128 | 791 | 3.835938 | 0.304688 | 0.14664 | 0.0611 | 0.07332 | 0.851324 | 0.851324 | 0.816701 | 0.763747 | 0.763747 | 0.639511 | 0 | 0.034743 | 0.163085 | 791 | 24 | 80 | 32.958333 | 0.706949 | 0 | 0 | 0.421053 | 0 | 0 | 0.269279 | 0.189633 | 0 | 0 | 0 | 0 | 0.473684 | 1 | 0.105263 | false | 0 | 0.157895 | 0 | 0.263158 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
dfb5a3ad041c33adf074240c919144732a3027a6 | 542 | py | Python | src/algoritmia/problems/spanningtrees/__init__.py | DavidLlorens/algoritmia | 40ca0a89ea6de9b633fa5f697f0a28cae70816a2 | [
"MIT"
] | 6 | 2018-09-15T15:09:10.000Z | 2022-02-27T01:23:11.000Z | src/algoritmia/problems/spanningtrees/__init__.py | JeromeIllgner/algoritmia | 406afe7206f2411557859bf03480c16db7dcce0d | [
"MIT"
] | null | null | null | src/algoritmia/problems/spanningtrees/__init__.py | JeromeIllgner/algoritmia | 406afe7206f2411557859bf03480c16db7dcce0d | [
"MIT"
] | 5 | 2018-07-10T20:19:55.000Z | 2021-03-31T03:32:22.000Z | from algoritmia.problems.spanningtrees.interfaces import ISpanningForestFinder, ISpanningTreeFinder
from algoritmia.problems.spanningtrees.graphtraversal import GraphTraversalSpanningForestFinder, GraphTraversalSpanningTreeFinder
from algoritmia.problems.spanningtrees.baruvka import BaruvkasMinimumSpanningForestFinder
from algoritmia.problems.spanningtrees.prim import PrimsMinimumSpanningFinder, PrimsWithPriorityQueueMinimumSpanningTreeFinder
from algoritmia.problems.spanningtrees.kruskal import KruskalsMinimumSpanningForestFinder
| 90.333333 | 130 | 0.915129 | 38 | 542 | 13.052632 | 0.473684 | 0.141129 | 0.221774 | 0.352823 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051661 | 542 | 5 | 131 | 108.4 | 0.964981 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 8 |
dfb5c1db99873b9d6964de368ee5ad308880173d | 180 | py | Python | gallery/stream/code_tests.py | arvkevi/awesome-streamlit | be454e29c35a9a1a760b1737a5176a47f4f9717b | [
"CC0-1.0"
] | 1,194 | 2019-10-09T06:15:27.000Z | 2022-03-31T14:53:00.000Z | gallery/stream/code_tests.py | arvkevi/awesome-streamlit | be454e29c35a9a1a760b1737a5176a47f4f9717b | [
"CC0-1.0"
] | 55 | 2019-10-09T12:08:39.000Z | 2022-02-10T00:48:53.000Z | gallery/stream/code_tests.py | arvkevi/awesome-streamlit | be454e29c35a9a1a760b1737a5176a47f4f9717b | [
"CC0-1.0"
] | 272 | 2019-10-09T12:04:31.000Z | 2022-03-29T02:43:30.000Z | create_dir_structure(top_dir="C:\\Users\\Fred\\Documents\\_Programming\\Python\\stream\\tmp")
create_pages(top_dir="C:\\Users\\Fred\\Documents\\_Programming\\Python\\stream\\tmp")
| 60 | 93 | 0.766667 | 25 | 180 | 5.24 | 0.52 | 0.091603 | 0.10687 | 0.183206 | 0.778626 | 0.778626 | 0.778626 | 0.778626 | 0.778626 | 0.778626 | 0 | 0 | 0.011111 | 180 | 2 | 94 | 90 | 0.735955 | 0 | 0 | 0 | 0 | 0 | 0.677778 | 0.677778 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
5f2822dc34cb21189ec1ffd2c966d6a614bd6a98 | 48 | py | Python | Florence/LegendreTransform/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 65 | 2017-08-04T10:21:13.000Z | 2022-02-21T21:45:09.000Z | Florence/LegendreTransform/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 6 | 2018-06-03T02:29:20.000Z | 2022-01-18T02:30:22.000Z | Florence/LegendreTransform/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 10 | 2018-05-30T09:44:10.000Z | 2021-05-18T08:06:51.000Z | from .LegendreTransform import LegendreTransform | 48 | 48 | 0.916667 | 4 | 48 | 11 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 48 | 1 | 48 | 48 | 0.977778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
5f32dfb81d2a79de42eb0d457238ca7aec3a5427 | 14,974 | py | Python | test/test_BoundaryTimespanMaker.py | josiah-wolf-oberholtzer/consort | 6c7d511835d5ad883ad1ad52ae9cd48c4a7b5571 | [
"MIT"
] | 9 | 2015-02-11T09:35:40.000Z | 2019-04-29T23:57:49.000Z | test/test_BoundaryTimespanMaker.py | josiah-wolf-oberholtzer/consort | 6c7d511835d5ad883ad1ad52ae9cd48c4a7b5571 | [
"MIT"
] | 2 | 2016-02-07T18:54:47.000Z | 2017-08-10T01:38:01.000Z | test/test_BoundaryTimespanMaker.py | josiah-wolf-oberholtzer/consort | 6c7d511835d5ad883ad1ad52ae9cd48c4a7b5571 | [
"MIT"
] | 1 | 2019-05-13T12:37:15.000Z | 2019-05-13T12:37:15.000Z | import abjad
import consort
import collections
from abjad.tools import systemtools
from abjad.tools import timespantools
def _make_timespan_inventory():
timespan_inventory = abjad.TimespanList([
consort.PerformedTimespan(
start_offset=0,
stop_offset=20,
voice_name='A',
),
consort.PerformedTimespan(
music_specifier=consort.MusicSpecifier(
labels=('labeled',),
),
start_offset=20,
stop_offset=40,
voice_name='A',
),
consort.PerformedTimespan(
music_specifier=consort.MusicSpecifier(
labels=('labeled',),
),
start_offset=25,
stop_offset=50,
voice_name='B',
),
consort.PerformedTimespan(
music_specifier=consort.MusicSpecifier(
labels=('labeled',),
),
start_offset=60,
stop_offset=80,
voice_name='A',
),
consort.PerformedTimespan(
start_offset=65,
stop_offset=100,
voice_name='B',
),
])
timespan_inventory.sort()
return timespan_inventory
def test_BoundarTimespanMaker_01():
timespan_inventory = _make_timespan_inventory()
assert format(timespan_inventory) == abjad.String.normalize(
r'''
abjad.TimespanList(
[
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(20, 1),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(40, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(25, 1),
stop_offset=abjad.Offset(50, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(80, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(65, 1),
stop_offset=abjad.Offset(100, 1),
voice_name='B',
),
]
)
''')
def test_BoundaryTimespanMaker_02():
music_specifiers = collections.OrderedDict([
('C', None),
])
target_timespan = abjad.Timespan(0, 100)
timespan_maker = consort.BoundaryTimespanMaker(
start_talea=5,
stop_talea=5,
voice_names=(
'A',
'B',
),
)
timespan_inventory = timespan_maker(
target_timespan=target_timespan,
music_specifiers=music_specifiers,
timespan_inventory=_make_timespan_inventory(),
)
assert format(timespan_inventory) == abjad.String.normalize(
r'''
abjad.TimespanList(
[
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(5, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(20, 1),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(40, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(25, 1),
stop_offset=abjad.Offset(50, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(50, 1),
stop_offset=abjad.Offset(55, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(65, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(80, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(65, 1),
stop_offset=abjad.Offset(100, 1),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(100, 1),
stop_offset=abjad.Offset(105, 1),
voice_name='C',
),
]
)
''')
def test_BoundaryTimespanMaker_03():
music_specifiers = collections.OrderedDict([
('C', None),
])
target_timespan = abjad.Timespan(0, 100)
timespan_maker = consort.BoundaryTimespanMaker(
labels=['labeled'],
start_talea=5,
stop_talea=5,
voice_names=(
'A',
'B',
),
)
timespan_inventory = timespan_maker(
target_timespan=target_timespan,
music_specifiers=music_specifiers,
timespan_inventory=_make_timespan_inventory(),
)
assert format(timespan_inventory) == abjad.String.normalize(
r'''
abjad.TimespanList(
[
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(20, 1),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(25, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(40, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(25, 1),
stop_offset=abjad.Offset(50, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(50, 1),
stop_offset=abjad.Offset(55, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(65, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(80, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(65, 1),
stop_offset=abjad.Offset(100, 1),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(80, 1),
stop_offset=abjad.Offset(85, 1),
voice_name='C',
),
]
)
''')
def test_BoundaryTimespanMaker_04():
music_specifiers = collections.OrderedDict([
('C', None),
])
target_timespan = abjad.Timespan(0, 100)
timespan_maker = consort.BoundaryTimespanMaker(
start_talea=5,
stop_talea=15,
voice_names=(
'A',
'B',
),
)
timespan_inventory = timespan_maker(
target_timespan=target_timespan,
music_specifiers=music_specifiers,
timespan_inventory=_make_timespan_inventory(),
)
assert format(timespan_inventory) == abjad.String.normalize(
r'''
abjad.TimespanList(
[
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(5, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(20, 1),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(40, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(25, 1),
stop_offset=abjad.Offset(50, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(50, 1),
stop_offset=abjad.Offset(65, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(80, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(65, 1),
stop_offset=abjad.Offset(100, 1),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(100, 1),
stop_offset=abjad.Offset(115, 1),
voice_name='C',
),
]
)
''')
def test_BoundaryTimespanMaker_05():
music_specifiers = collections.OrderedDict([
('C', None),
])
target_timespan = abjad.Timespan(0, 100)
timespan_maker = consort.BoundaryTimespanMaker(
start_talea=5,
stop_talea=5,
labels=['labeled'],
)
timespan_inventory = timespan_maker(
target_timespan=target_timespan,
music_specifiers=music_specifiers,
timespan_inventory=_make_timespan_inventory(),
)
assert format(timespan_inventory) == abjad.String.normalize(
r'''
abjad.TimespanList(
[
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(0, 1),
stop_offset=abjad.Offset(20, 1),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(25, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(20, 1),
stop_offset=abjad.Offset(40, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(25, 1),
stop_offset=abjad.Offset(50, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(50, 1),
stop_offset=abjad.Offset(55, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(65, 1),
voice_name='C',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(60, 1),
stop_offset=abjad.Offset(80, 1),
music_specifier=consort.tools.MusicSpecifier(
labels=('labeled',),
),
voice_name='A',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(65, 1),
stop_offset=abjad.Offset(100, 1),
voice_name='B',
),
consort.tools.PerformedTimespan(
start_offset=abjad.Offset(80, 1),
stop_offset=abjad.Offset(85, 1),
voice_name='C',
),
]
)
''')
| 36.611247 | 65 | 0.456191 | 1,175 | 14,974 | 5.608511 | 0.055319 | 0.133536 | 0.206373 | 0.206373 | 0.932929 | 0.927769 | 0.927769 | 0.911684 | 0.911684 | 0.911684 | 0 | 0.03565 | 0.447375 | 14,974 | 408 | 66 | 36.70098 | 0.760725 | 0 | 0 | 0.730159 | 0 | 0 | 0.012957 | 0 | 0 | 0 | 0 | 0 | 0.039683 | 1 | 0.047619 | false | 0 | 0.039683 | 0 | 0.095238 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
a060298c151fb95c338b81f78619d4691930e688 | 100 | py | Python | kwat/path/get_absolute.py | KwatME/ccal | d96dfa811482eee067f346386a2181ec514625f4 | [
"MIT"
] | 5 | 2017-05-05T17:50:28.000Z | 2019-01-30T19:23:02.000Z | kwat/path/get_absolute.py | KwatME/ccal | d96dfa811482eee067f346386a2181ec514625f4 | [
"MIT"
] | 5 | 2017-05-05T01:52:31.000Z | 2019-04-20T21:06:05.000Z | kwat/path/get_absolute.py | KwatME/ccal | d96dfa811482eee067f346386a2181ec514625f4 | [
"MIT"
] | 5 | 2017-07-17T18:55:54.000Z | 2019-02-02T04:46:19.000Z | from os.path import abspath, expanduser
def get_absolute(pa):
return abspath(expanduser(pa))
| 14.285714 | 39 | 0.75 | 14 | 100 | 5.285714 | 0.785714 | 0.459459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16 | 100 | 6 | 40 | 16.666667 | 0.880952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0.333333 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 7 |
2645ff07099565c1caab530d5fd1a25e164bb1fe | 44,289 | py | Python | qrc.py | LegosAndStuff-Dev/Orgize.code | d84776a74b4d4d0b0d1779fc692e435511839f8c | [
"MIT"
] | null | null | null | qrc.py | LegosAndStuff-Dev/Orgize.code | d84776a74b4d4d0b0d1779fc692e435511839f8c | [
"MIT"
] | null | null | null | qrc.py | LegosAndStuff-Dev/Orgize.code | d84776a74b4d4d0b0d1779fc692e435511839f8c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x02\x6d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x06\x00\x00\x00\x3b\x30\xae\xa2\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x02\x22\x49\x44\x41\x54\x48\x89\xed\x96\xbf\x4e\
\x1b\x41\x10\xc6\x7f\x32\x09\x72\x08\x28\x14\x86\x3e\x12\x0e\x8a\
\x2c\x27\x28\xa1\xa6\x21\x34\x08\xa8\x42\x01\x0f\x10\x1a\xb0\x25\
\xa7\x32\x79\x87\xd4\xc9\x13\xf0\x00\x24\x75\x90\x2d\x4a\x04\x52\
\x48\x49\x41\x19\x37\x80\x8d\xe4\x84\x3f\x31\xc5\xce\xe5\xe6\xee\
\x76\x7d\x6b\xc7\x55\xc4\x27\xad\x74\xbb\x3b\xfb\xcd\xcd\xee\xce\
\xb7\x03\xf7\x70\xe3\x51\xac\xbf\x0f\xd4\x53\x6c\xfe\x19\x25\xe0\
\x06\x58\x92\x7e\x1e\xe8\x48\xcb\xcb\xd8\x8a\xd8\x6c\xfa\x10\x3e\
\xf0\x74\x3c\x0a\x0c\x01\x3b\xc0\x21\x30\xa3\xe6\x0e\x80\x23\xe0\
\x95\xd8\x8c\x79\x72\x5a\x31\x8e\x89\x32\x07\x64\x81\x2f\x84\x11\
\xa6\xb5\x5d\x59\x33\x01\x94\x85\xcb\x1b\x25\x21\x39\x07\x1a\x3d\
\x38\x0d\x5a\x43\xd6\x76\x80\xad\x5e\x1c\xe7\x80\x33\x0b\xe1\x0d\
\x50\x01\x0a\xc0\x63\x69\x05\x21\x3f\xb6\xd8\x9f\x09\x97\x37\xb2\
\xb1\x48\x7f\x03\x3f\xe5\xfb\x9d\x63\x4d\x06\x73\xb1\xda\x44\x23\
\xcf\xfa\x38\x2c\x01\xdb\x44\xcf\xb4\x0d\x2c\x02\x6f\x15\x59\xb7\
\x73\x7b\x03\xfc\x22\x7a\xe6\x1f\x84\xdb\x8a\x11\xcc\x56\xc6\xb7\
\xab\xa2\x6c\xbe\xc9\xd8\x47\x8f\x00\xe2\x3c\xd7\x74\xc9\xf3\x65\
\xa0\xa5\x8c\xbf\x63\x52\x24\xc0\x4b\xf9\xb9\x2b\x60\xba\x8b\xe3\
\x0c\xf0\x43\xf1\xb4\x08\x35\xc0\x89\x1a\xf6\x68\x03\x7c\x92\xb9\
\xaf\x29\x3c\x3a\xea\x5a\x9a\xd3\x67\x40\x53\x2d\x28\x5a\x6c\x26\
\x08\x6f\xfc\x09\xe6\x4c\x6d\x28\x2a\x9e\x26\xa1\xc2\x25\xb0\x4f\
\xf2\x5c\x9e\x38\x6c\x4f\x2c\xb6\x3e\xed\xaf\xb6\x67\x14\xd9\x1f\
\xd7\x1f\x0d\x10\x1d\xd7\xc4\x14\x83\xdb\xea\x17\x44\xb7\x7a\x2a\
\xed\xaf\xf4\xe5\x7a\x6f\x99\xff\x8c\xdf\xe5\x2a\x2b\x9e\xd4\xcb\
\x15\x4f\xa7\x63\xa2\xe9\x34\x43\x7f\xe9\x74\x89\x79\x36\xad\x70\
\x09\x88\x8e\x7a\x0f\x3f\x01\xd1\xd1\x6a\x9d\x1f\x71\x2d\xd8\x02\
\xaa\x18\x99\xd3\x92\xb9\x04\xac\xe2\x27\x99\x0b\x24\x25\xb3\x8a\
\x67\x81\xd0\xef\x23\x51\x8e\x39\x6d\xe0\x90\x49\x57\x05\x32\x0a\
\x3c\x54\xfd\x61\x60\x12\xb8\xc5\x54\x18\x05\xe0\x54\xc8\x9f\x02\
\xf3\xc0\x06\xf0\x3c\xc6\x33\x2c\x5c\x6d\x87\x9f\x04\x06\x51\x08\
\x04\x29\xd7\x53\x21\x30\x8e\x39\x93\x1c\x66\xab\xfa\x29\x7d\x72\
\xc2\xe1\x52\x3f\x2f\x54\x09\x5f\x99\x1a\x51\x91\xb9\x90\xb1\x20\
\x0d\xab\x3e\x84\x99\x74\x13\xc0\xe4\xe1\x2d\xb0\x0e\xcc\x01\xb3\
\x6a\xee\xb5\x8c\xad\x89\x4d\xcb\x93\xd3\x1b\xf1\x1c\xac\x93\x54\
\xa4\x81\x17\xf4\xff\x0f\xee\x00\xba\xaa\x03\x30\xed\x4b\xf8\x39\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\x33\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x06\x00\x00\x00\x3b\x30\xae\xa2\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\xe8\x49\x44\x41\x54\x48\x89\xed\x96\x4b\x0e\
\x82\x30\x10\x86\x3f\x8d\x57\xd0\xc8\x2d\xdc\xb8\xf2\xf4\xbe\x42\
\x04\xdc\xc8\xc2\x05\x1b\xdd\x9b\x78\x04\xd8\x94\x04\xeb\x94\x52\
\x28\x01\x23\x7f\x32\x9b\xce\xe3\xcb\x0c\x43\x5a\x98\xf4\x8f\x3a\
\x03\xb9\x67\x3b\xea\x90\x99\x00\xce\xfd\xf6\x21\xb3\x16\x4d\x03\
\x3b\x48\x6c\x64\xee\xa9\xb8\xb3\x7e\x02\xbc\x02\xae\xc0\x5e\xf0\
\x1d\x80\x44\xc5\xb4\x56\xb9\x89\x3a\x34\x55\xe7\x17\x21\x27\x52\
\xbe\x54\x80\x4b\xf5\x1a\x81\x97\xc0\x4d\x9d\xdd\x81\xb5\x90\xa3\
\xc7\x04\x3e\xc0\x09\xe6\x6e\xaa\xaa\x4e\x25\xb6\x81\x07\x5b\x2e\
\x49\xb6\x51\x07\x42\x4e\xdd\xe7\x68\x3d\x6a\xf8\x1c\x63\x24\xe4\
\xc4\xf4\xb0\x5c\x55\x78\x02\x84\x82\x2f\xc4\xfc\x3b\x75\x06\xb7\
\xd5\xb8\x96\x6b\x30\x70\xdd\xed\xd4\xd7\xf5\x08\xc8\x1d\x9f\x7a\
\xe0\x34\x7a\x08\xd8\x64\x9a\x84\x53\xad\x51\x2e\xd7\x06\xc8\xf8\
\x7e\x3f\x99\xa4\xc7\x65\xaa\x86\x93\xb6\xc0\x4b\x28\xe6\x6a\x6f\
\x60\xe7\x02\x7e\x7a\x80\x96\xf6\x70\xed\x7a\x92\x57\x15\xa8\x87\
\x89\x12\x79\x24\xfa\x60\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\
\x60\x82\
\x00\x00\x23\x3a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x05\xa0\x00\x00\x01\x40\x08\x06\x00\x00\x00\x4a\xab\xdb\x59\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\
\x01\xc7\x6f\xa8\x64\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x20\x00\x49\x44\
\x41\x54\x78\x9c\xed\xdd\x7b\xb4\xe7\x75\x41\xef\xff\xe7\x7b\x0f\
\x03\xa8\xa0\x08\xe6\xfd\x52\x78\x42\x8f\x76\xa1\x28\x4b\xe5\x54\
\x2a\x5a\xe7\x68\x69\x79\x29\xfd\x1d\x2d\x15\x18\x90\x23\xfd\xf2\
\x9c\x8e\xf5\xcb\x9f\x4e\xfd\x7e\x79\x4e\x67\x75\xfb\x71\x04\x9c\
\x41\xba\x78\x2b\x41\xb4\xc2\xb4\x12\xb5\x12\x2b\x2b\xac\xbc\x90\
\x69\xa2\x78\x03\xb9\x88\x88\x20\x97\x99\xfd\xf9\xfd\xb1\x67\xbc\
\x85\x0a\xcc\x7c\xe7\xb3\x2f\x8f\xc7\x5a\xdf\xb5\x37\xcc\x5a\xb3\
\x9f\xb0\x66\xd6\x7c\xd7\x6b\xde\xfb\xfd\x29\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x56\xaf\x31\x77\x00\x00\x00\xc0\x6d\x72\xda\x74\
\xe7\x96\xba\x4b\xa3\x43\x9b\x3a\xac\x3a\xb4\xa5\x0e\x6b\xea\xa0\
\x46\x07\x37\xb5\x7f\x75\x87\x46\x07\x36\x75\xbb\xea\xf6\xd5\x01\
\xbb\x7e\x7c\x73\x75\xc7\x6a\x53\x75\x48\xb5\xb4\xeb\xe3\x9e\xb8\
\xb6\xba\xb1\xfa\x4c\x75\x53\x75\x4d\xa3\xeb\x9b\xfa\x7c\x53\xd7\
\x54\x37\x35\xfa\x4c\x75\x63\xa3\x6b\xab\xeb\x5a\xee\x86\xea\xea\
\xea\x73\x2d\x75\x65\x3b\xbb\xb2\xa5\xae\xac\xae\x68\xcb\xb8\x7a\
\x0f\x7b\x00\x00\x66\x67\x80\x06\x00\x00\x56\x87\x33\xa6\xbb\x55\
\xf7\x6e\xea\x5e\x2d\x77\xcf\x46\x87\x36\x3a\xec\x0b\xe3\x72\x5f\
\xf6\xf1\xb0\x56\x46\xe3\xf5\x6c\x47\x75\x65\x75\x65\x53\x57\x36\
\x76\xbd\xa6\x5d\x03\xf5\xe8\xca\x96\xbb\xb2\x4d\x7d\xaa\xa5\x3e\
\xda\xc1\x7d\xaa\xa7\x8c\x9d\x33\x37\x03\x00\x7c\x19\x03\x34\x00\
\x00\xb0\x78\xbf\x3e\xdd\xae\x03\xbb\x47\xfb\x75\x78\x53\x87\x57\
\xf7\xac\xee\x51\x5f\xf8\xfc\xbe\xd5\x41\x73\x26\xae\x13\x57\x55\
\x17\x35\x75\x49\xa3\x4f\x36\x75\x51\x75\x49\x4b\x7d\xb2\x1d\x5d\
\xd4\x65\x7d\xb4\xad\x63\xc7\xdc\x91\x00\xc0\xc6\x61\x80\x06\x00\
\x00\xf6\xdc\xb6\x69\x73\xa3\x6f\xaa\x1e\xd8\xd4\x03\xaa\x23\x9a\
\x3a\xbc\xd1\xbd\x5a\x19\x97\x6f\x37\x6f\x20\xbb\xdc\x54\x5d\xd2\
\xe8\x63\x4d\x7d\xac\xfa\x48\xa3\x0f\x36\xf5\x81\x96\xfb\x40\x27\
\x8e\xcb\xe6\x0e\x04\x00\xd6\x17\x03\x34\x00\x00\x70\xcb\x9d\x36\
\xdd\xb9\xcd\x1d\xde\xce\x1e\xdc\x52\x0f\xda\x75\x9a\xf9\xf0\xea\
\xc1\xd5\x81\x33\xd7\xb1\xe7\xae\xaf\x2e\xaa\xde\xd7\xe8\xa2\xa6\
\x2e\x6a\x74\x51\x37\xf5\xde\x4e\x1a\x97\xce\x1d\x07\x00\xac\x3d\
\x06\x68\x00\x00\xe0\xdf\x3a\x7d\xfa\xc6\x96\x3a\xb2\x95\x61\xf9\
\x81\xb5\xeb\x54\x73\xdd\x69\xd6\x2e\xe6\x74\x45\xf5\x81\xa6\x3e\
\xd0\xe8\x83\x8d\xfe\xb9\x1d\xfd\x53\x27\xf6\xe1\xc6\x98\xe6\x8e\
\x03\x00\x56\x27\x03\x34\x00\x00\x6c\x64\x67\x4d\x9b\xba\xa2\xfb\
\xb5\xd4\x83\x1b\x1d\xd5\xd4\x51\x8d\x1e\x52\xdd\x75\xee\x34\xd6\
\x8c\x6b\xaa\x0f\x54\x17\x36\xba\xa0\x7a\x5f\x37\xf6\x0f\xfd\x97\
\x71\xe5\xcc\x5d\x00\xc0\x2a\x60\x80\x06\x00\x80\x8d\x62\xe5\x9e\
\xe6\x23\x5a\xee\xa8\xc6\xae\xd7\xd4\x77\x54\xb7\x9f\x3b\x8d\x75\
\xe9\x92\xa6\x2e\x68\xa9\xf7\xb5\xdc\x85\x2d\x75\x41\x9f\xec\x9f\
\xdb\x3a\x96\xe7\x0e\x03\x00\xf6\x1d\x03\x34\x00\x00\xac\x47\x5b\
\xa7\xfd\xba\x57\xdf\xde\x72\x0f\x6f\xea\x21\x8d\x8e\x6c\xe5\x2a\
\x8d\x4d\x73\xa7\xb1\xa1\x5d\x53\xbd\xb7\xba\xa0\xa9\x77\x56\xef\
\xec\x84\xf1\xc1\x99\x9b\x00\x80\x05\x32\x40\x03\x00\xc0\x7a\x70\
\xea\x74\x50\xfb\x75\x64\x53\x0f\xaf\x8e\x6e\x74\x74\x75\xc8\xdc\
\x59\x70\x0b\x7c\xb6\xd1\x7b\xaa\xf3\x5b\xee\x1d\xed\xdf\xdf\xf4\
\xac\x71\xf9\xdc\x51\x00\xc0\xde\x61\x80\x06\x00\x80\xb5\xe8\xcc\
\xe9\x9e\xdd\xd4\x51\x2d\xed\x1a\x9c\xa7\x1e\x52\x6d\x9e\x3b\x0b\
\xf6\x92\x4b\xaa\xf3\x1b\xbd\xa3\xa9\x0b\xda\xbf\xbf\xef\x99\xe3\
\xfa\xb9\xa3\x00\x80\x5b\xcf\x00\x0d\x00\x00\xab\xdd\x59\xd3\xa6\
\xae\xec\xdb\x1a\x1d\xdd\xe8\x61\xd5\xd1\xd5\xbd\xe7\xce\x82\x7d\
\xe8\xfa\xea\x5d\xd5\x3b\x77\x8d\xd2\x7f\xd1\x96\x71\xc5\xdc\x51\
\x00\xc0\xd7\x67\x80\x06\x00\x80\xd5\x68\xdb\x74\x8f\xa6\x1e\xdd\
\xe8\x71\xd5\xa3\xaa\x43\xe7\x4e\x82\x55\xe6\xa2\xea\xbc\x5d\xaf\
\xb7\x19\xa4\x01\x60\x75\x32\x40\x03\x00\xc0\x6a\xf0\xf2\xe9\x0e\
\x5d\xdf\x43\xab\x63\x9a\x3a\xa6\x3a\x6a\xee\x24\x58\x63\x0c\xd2\
\x00\xb0\x0a\x19\xa0\x01\x00\x60\x0e\x67\x4d\x9b\xba\xba\x23\xdb\
\xd9\x31\x8d\x8e\xa9\xbe\xaf\xda\x7f\xee\x2c\x58\x47\x0c\xd2\x00\
\xb0\x0a\x18\xa0\x01\x00\x60\x5f\xd9\x36\xdd\x7f\xd7\xb5\x1a\x8f\
\xae\x1e\x59\x1d\x32\x77\x12\x6c\x10\x53\xf5\xbe\x46\x7f\xd6\x72\
\x7f\xd2\x8d\xfd\x65\x27\x8f\x1b\xe6\x8e\x02\x80\x8d\xc0\x00\x0d\
\x00\x00\x8b\xb2\xfb\x94\xf3\x72\x3f\x5c\x3d\xb9\x7a\xd0\xdc\x49\
\x40\x55\x9f\xaf\xde\xd1\xd4\x79\x8d\xfe\xb0\x2d\xe3\xfd\x73\x07\
\x01\xc0\x7a\x65\x80\x06\x00\x80\xbd\xe9\xe5\xd3\x1d\xba\xae\x47\
\xee\x7a\x78\xe0\xe3\xab\xbb\xcd\x9d\x04\x7c\x5d\x2b\xd7\x75\x4c\
\xbd\xa1\x03\x7a\x73\xcf\x1c\xd7\xcf\x1d\x04\x00\xeb\x85\x01\x1a\
\x00\x00\xf6\xd4\xa9\xd3\xdd\xdb\xd4\x13\x1a\x3d\xb1\xfa\xfe\x6a\
\xf3\xdc\x49\xc0\x6d\x76\x6d\xf5\xd6\xea\x4d\x2d\xf7\xa6\x4e\x1c\
\x1f\x99\xb9\x07\x00\xd6\x34\x03\x34\x00\x00\xdc\x16\xa7\x4e\xf7\
\x69\x73\x3f\xd6\x72\x4f\x6c\xf4\xf0\x6a\x69\xee\x24\x60\x21\xfe\
\xb9\xd1\x9b\x9a\x7a\x43\x97\xf4\xf6\xb6\x8e\x1d\x73\x07\x01\xc0\
\x5a\x62\x80\x06\x00\x80\x5b\xea\x8c\xe9\x9b\x5a\xee\xc9\x8d\x9e\
\xd8\xd4\x77\xe7\xfd\x34\x6c\x34\x57\x36\xfa\xe3\xea\x0f\x9a\xfa\
\xd3\xb6\x8c\xeb\xe6\x0e\x02\x80\xd5\xce\x1b\x66\x00\x00\xf8\x5a\
\x5e\x32\x1d\xd6\xe6\x9e\xd8\xe8\x19\x4d\x3d\x2c\xef\xa1\x81\x15\
\xd7\x57\xe7\x37\x7a\x43\x37\xf5\x9a\x4e\x1a\x97\xce\x1d\x04\x00\
\xab\x91\x37\xcf\x00\x00\xf0\x95\xb6\x4d\x77\x6a\xea\xf1\xd5\x93\
\x1b\xfd\x60\xee\x74\x06\xbe\xb6\xe5\x46\x7f\xdd\x72\xe7\xb6\xdc\
\x1f\xf4\x9c\xf1\x2f\x73\x07\x01\xc0\x6a\x61\x80\x06\x00\x80\xaa\
\xdf\x9e\x0e\xec\x86\x1e\xdd\xe8\xc9\xd5\x13\xab\xdb\xcf\x9d\x04\
\xac\x59\x17\x36\x3a\xb7\xa9\x37\x74\x7c\xef\x68\x8c\x69\xee\x20\
\x00\x98\x8b\x01\x1a\x00\x80\x8d\x6b\xdb\xb4\xb9\xa9\x47\x37\xfa\
\x89\xea\x09\xd5\xc1\x73\x27\x01\xeb\xce\xc5\xd5\xeb\x1b\x9d\xdd\
\x71\xfd\xb5\x31\x1a\x80\x8d\xc6\x00\x0d\x00\xc0\xc6\x32\x4d\xa3\
\x97\x75\x74\xcb\x3d\xb5\x7a\x72\x75\x97\xb9\x93\x80\x0d\xe3\xe3\
\xd5\x6b\x8d\xd1\x00\x6c\x24\xa3\xed\xd3\xf9\x4d\xfd\x5c\x5b\xc6\
\xf9\x73\xc7\x00\x00\xc0\xc2\x9c\x39\xdd\xb3\x9b\x7a\x7a\xa3\xe3\
\xaa\xfb\xcf\x9d\x03\x6c\x78\x1f\xaf\x5e\x57\x9d\xdd\x25\xfd\x55\
\x5b\xc7\xf2\xdc\x41\x00\xb0\xd7\x9c\x39\x1d\xdc\x8e\x9e\x5a\x1d\
\x3f\xda\x36\xed\xfe\x1b\xd7\xf3\xaa\xe7\xb5\x65\xbc\x67\xc6\x34\
\x00\x00\xd8\x7b\xce\x9a\x36\xf5\x99\x1e\xd1\xd4\xf1\xd5\x8f\x56\
\xfb\xcd\x9d\x04\x70\x33\x3e\x51\x9d\x93\x31\x1a\x80\xb5\xee\x8c\
\xe9\xa8\x96\x3b\xbe\x7a\x6a\xbb\xae\xb7\xfb\xd2\x01\xba\x6a\xb9\
\x3a\xa7\xe5\xfe\x7b\x27\x8e\x8f\xcc\x90\x08\x00\x00\x7b\xee\xb4\
\xe9\x01\xed\xd7\x33\x9b\xfa\xa9\xea\x6e\x73\xe7\x00\xdc\x0a\x97\
\x57\x7f\xd2\xd4\xd9\x1d\xda\x1b\x7b\xca\xd8\x39\x77\x10\x00\x7c\
\x4d\x5f\x72\xda\xb9\x3a\xea\x2b\x7f\xf8\x2b\x07\xe8\xdd\x3e\x5f\
\xfd\xef\x36\xf5\x2b\x1d\x3b\x3e\xbd\xe8\x46\x00\x00\xd8\x63\xa7\
\x4e\x07\xb5\xb9\xa7\x34\xf5\xec\xea\x61\x73\xe7\x00\xec\x05\x9f\
\xa8\xce\x6e\xb9\xdf\xeb\xc4\xf1\xb7\x73\xc7\x00\xc0\x97\xb9\x99\
\xd3\xce\x37\xe7\xab\x0d\xd0\xbb\x5d\xd3\xe8\xb4\x36\xf5\xcb\x3d\
\x7b\x5c\xb3\xd7\x23\x01\x00\x60\x4f\xdd\xc2\x37\xbe\x00\x6b\xdc\
\x47\xab\x3f\xa8\x7e\xb7\x2d\xe3\x5d\x73\xc7\x00\xb0\x41\x7d\x9d\
\xd3\xce\x37\xe7\xeb\x0d\xd0\xbb\x5d\xd2\xd4\x2f\x35\x3a\xb3\x2d\
\xe3\xa6\x3d\x8a\x04\x00\x80\x3d\xb5\x6d\xba\x4b\x53\xcf\x68\xf4\
\xec\xea\x41\x73\xe7\x00\xec\x63\xef\xae\x7e\xaf\xe5\x7e\xdf\xf5\
\x99\x00\xec\x13\x7b\x70\xe8\xe3\x96\x0e\xd0\xbb\x5d\x5c\xbd\xb8\
\x4b\x7a\x99\x87\x22\x00\x00\xb0\xcf\x6d\x9b\xbe\xb3\xda\x52\xfd\
\xe7\xea\xf6\x33\xd7\x00\xac\x06\x17\x34\x7a\x45\x37\xf5\x9a\x4e\
\x1a\x97\xce\x1d\x03\xc0\x3a\x72\x1b\x4e\x3b\xdf\x9c\x5b\x3b\x40\
\xef\xf6\xde\xea\x97\xda\x32\xce\xbe\xad\x5f\x18\x00\x00\x6e\x91\
\xb3\xa6\xfd\xbb\xaa\xc7\xb7\xf2\xc6\xf7\x98\xb9\x73\x00\x56\xa9\
\xe5\x46\x7f\x5d\x9d\xdd\xd4\xab\xda\x32\xae\x98\x3b\x08\x80\x35\
\x6a\x2f\x5f\x71\x77\x5b\x07\xe8\xdd\xde\x56\xfd\x7c\x5b\xc6\x3b\
\xf7\x34\x04\x00\x00\xbe\xcc\xb6\xe9\xbe\x4d\x9d\xd0\xe8\xd8\xea\
\x1b\xe6\xce\x01\x58\x43\xae\x6f\xea\x4d\x2d\xf5\xaa\x36\xf7\xc7\
\x3d\x73\x5c\x3f\x77\x10\x00\xab\xdc\x5e\x3a\xed\x7c\x73\xf6\x74\
\x80\xde\xed\xbc\x96\xfa\xaf\x1d\x37\xde\xbd\x17\x7e\x2e\x00\x00\
\x36\xb2\x6d\xd3\xd1\xd5\xc9\xd5\x8f\x56\xfb\xcd\x5c\x03\xb0\xd6\
\x5d\x5d\xfd\x51\x53\x67\x77\x68\x6f\xec\x29\x63\xe7\xdc\x41\x00\
\xac\x22\xfb\xe0\x81\xde\x7b\x6b\x80\xae\x5a\xae\xce\x69\xa9\xe7\
\x77\xdc\xf8\xf0\x5e\xfa\x39\x01\x00\xd8\x08\xbe\x78\xe2\xe2\xb9\
\xd5\xb7\xcc\x9d\x03\xb0\x4e\x7d\xa2\x3a\xa7\xe5\x7e\xa7\x13\xc7\
\x3f\xcc\x1d\x03\xc0\x4c\x16\x78\xda\xf9\xe6\xec\xcd\x01\x7a\xb7\
\x1b\xab\xdf\x69\xa9\x17\x76\xdc\xf8\xd4\x5e\xfe\xb9\x01\x00\x58\
\x4f\xb6\x4f\x47\x54\xcf\x6a\x6a\x4b\x75\xc8\xdc\x39\x00\x1b\xc8\
\x85\xd5\xd9\xbb\xc6\xe8\x8f\xcc\x1d\x03\xc0\x3e\xb0\x0f\x4e\x3b\
\xdf\x9c\x45\x0c\xd0\xbb\x5d\xdd\xd4\xaf\x76\xfb\x7e\xa3\x67\x8c\
\x6b\x17\xf4\x35\x00\x00\x58\x6b\xa6\x69\x74\x46\x3f\xd4\xd4\xf3\
\xf2\x50\x41\x80\xb9\xed\x6c\xf4\xd6\x96\x7b\x65\x9b\x7b\x7d\xcf\
\x1e\xd7\xcc\x1d\x04\xc0\x5e\xb4\x8f\x4f\x3b\xdf\x9c\x45\x0e\xd0\
\xbb\x5d\xd1\xd4\xaf\x76\x63\xbf\xd9\xc9\xe3\x86\x05\x7f\x2d\x00\
\x00\x56\xab\x53\xa6\x03\xda\xbf\x1f\x6f\xf4\xb3\xb9\x66\x03\x60\
\x35\xba\xbe\xa9\xf3\x1a\xbd\xbc\xfa\x83\xb6\x8c\x9b\xe6\x0e\x02\
\xe0\x36\x9a\xe9\xb4\xf3\xcd\xd9\x17\x03\xf4\x6e\x1f\xad\x7e\xb9\
\x3b\x77\xa6\x87\x1e\x00\x00\x6c\x20\xbf\x35\x7d\x43\x37\xf6\xac\
\x46\x27\x57\xf7\x9c\x3b\x07\x80\x5b\xe4\xd3\xd5\x6b\xab\x57\x74\
\x7c\xef\x68\x8c\x7d\xb5\x1d\x00\x70\x5b\xad\x82\xd3\xce\x37\x67\
\x5f\x0e\xd0\xbb\x5d\x58\x6d\x6d\xcb\x38\x7b\x1f\x7f\x5d\x00\x00\
\xf6\xa5\x97\x4d\xff\xae\x9d\x3d\xb7\x3a\xb6\xba\xfd\xdc\x39\x00\
\xdc\x66\x17\x37\xfa\xfd\x96\x3b\xb3\x13\xc6\x07\xe7\x8e\x01\xe0\
\x2b\xac\xa2\xd3\xce\x37\x67\x8e\x01\x7a\xb7\xbf\x6e\xf4\xf3\x1d\
\x3f\xfe\x62\xa6\xaf\x0f\x00\xc0\x22\x6c\x9b\x8e\x6e\xea\xf9\x8d\
\x1e\x5b\x8d\xb9\x73\x00\xd8\xab\x2e\x68\xf4\x8a\x76\xf6\x7b\x9d\
\x38\x2e\x9b\x3b\x06\x60\xc3\x3a\x65\xba\x63\x07\xf4\x13\xad\xb2\
\xd3\xce\x37\x67\xce\x01\x7a\xb7\xf3\x1a\xfd\x6c\xc7\x8f\x7f\x9c\
\xb9\x03\x00\x80\xdb\xea\xac\x69\xff\xae\xea\xf1\x8d\xfe\x5b\x53\
\x0f\x99\x3b\x07\x80\x85\xdb\x59\xbd\xad\xa9\x57\x74\xfb\xce\xe9\
\x19\xe3\xda\xb9\x83\x00\x36\x84\x2f\x9e\x76\x7e\x5a\x75\xd0\xdc\
\x39\xb7\xc4\x6a\x18\xa0\x6b\xe5\x0f\xae\x57\xb6\xa9\x17\x75\xec\
\xb8\x78\xee\x18\x00\x00\x6e\xa1\x97\x4d\x87\xb6\xdc\x96\xa6\x9e\
\x5b\xdd\x63\xee\x1c\x00\x66\x71\x75\x75\x4e\xf5\xca\x2e\xe9\x2f\
\xda\x3a\x96\xe7\x0e\x02\x58\x57\x4e\x9b\xee\xdc\x52\xff\xb9\xd1\
\x71\xd5\xb7\xce\x9d\x73\x6b\xad\x96\x01\x7a\xb7\x1b\xaa\xd3\xdb\
\xdc\x8b\x7b\xd6\xb8\x7c\xee\x18\x00\x00\xbe\x8a\xd3\xa7\x7b\xb5\
\xa9\xe7\x35\x75\x7c\x6b\xe4\xe4\x05\x00\xfb\xc4\xc7\xaa\xdf\xab\
\x5e\xd9\x96\xf1\x9e\xb9\x63\x00\xd6\xb4\x97\x4e\xdf\xd7\xe8\xd8\
\xea\xc9\xd5\x81\x73\xe7\xdc\x56\xab\x6d\x80\xde\xed\xda\x46\x2f\
\x69\xea\x7f\xb4\x65\x5c\x3d\x77\x0c\x00\x00\xbb\x6c\x9b\xee\x5f\
\x9d\xdc\xca\x5d\x73\x6b\xf6\x4d\x30\x00\xfb\xc4\x85\xd5\xd9\xed\
\xec\xe5\x3d\x67\x5c\x34\x77\x0c\xc0\x9a\xf0\xdb\xd3\x21\xdd\xd8\
\x53\xaa\xff\xd2\x1a\x3c\xed\x7c\x73\x56\xeb\x00\xbd\xdb\xe5\xd5\
\xff\xdb\x9d\x7b\x69\x4f\x19\x37\xce\x1d\x03\x00\xb0\x61\x9d\x3e\
\x3d\xa4\xa5\x9e\x5f\x3d\xa1\x5a\x9a\x3b\x07\x80\x35\x65\xb9\x7a\
\x7b\xf5\xca\x76\x76\x4e\xcf\x19\x57\xcd\x1d\x04\xb0\xaa\x4c\xd3\
\x68\x5b\x8f\xdc\x75\xc5\xc6\x13\xaa\x03\xe6\x4e\xda\x9b\x56\xfb\
\x00\xbd\xdb\x87\x9b\x7a\x61\x97\xf6\x6a\x77\x49\x01\x00\xec\x43\
\xdb\xa6\xc7\x34\xf5\xfc\x46\x8f\x9c\x3b\x05\x80\x75\xe1\x86\xa6\
\xde\x58\xbd\xb2\x1b\xfb\xe3\x4e\x1e\x37\xcc\x1d\x04\x30\x9b\x33\
\xa7\x7b\xb6\xb3\x9f\x6c\xea\xd9\xd5\xfd\xe7\xce\x59\x94\xb5\x32\
\x40\xef\x76\x61\xb5\xb5\x2d\xe3\xec\xb9\x43\x00\x00\xd6\xad\xad\
\xd3\x52\x77\xef\xb1\x2d\xf5\x82\xa6\x1e\x32\x77\x0e\x00\xeb\xd6\
\xd5\xd5\x1f\x35\x75\x76\x97\xf6\xa6\xb6\x8e\x1d\x73\x07\x01\x2c\
\xdc\x59\xd3\xa6\x3e\xd3\x23\x76\x3d\x4b\xe5\x09\xd5\xe6\xb9\x93\
\x16\x6d\xad\x0d\xd0\xbb\xfd\x75\x4b\x3d\xbf\xe3\xc6\xdb\xe7\x0e\
\x01\x00\x58\x37\xce\x9a\xf6\xef\xd3\xfd\x44\xa3\x9f\xaf\x1e\x38\
\x77\x0e\x00\x1b\xca\x27\xaa\x73\xaa\xb3\xdb\x32\xce\x9f\x3b\x06\
\x60\xaf\x3b\x63\xfa\xf7\x4d\xfd\x64\x53\xcf\xac\xee\x3a\x77\xce\
\xbe\xb4\x56\x07\xe8\xaa\xa9\x7a\x7d\xf5\x0b\x6d\x19\xef\x9f\x3b\
\x06\x00\x60\xcd\x3a\x65\xba\x63\x07\x74\x42\xf5\x7f\x56\xf7\x98\
\x3b\x07\x80\x0d\xef\x3d\x4d\xbd\xaa\x9d\xbd\xba\x93\xc6\xc7\xe6\
\x8e\x01\xb8\xcd\x4e\x9b\xee\xdc\x7e\x3d\x75\xd7\xe8\xfc\x5d\x73\
\xe7\xcc\x65\x2d\x0f\xd0\xbb\xed\xa8\x7e\xa7\xe5\xb6\x76\xe2\xf8\
\xc4\xdc\x31\x00\x00\x6b\xc6\xcb\xa6\x43\xdb\xd9\xc9\xd5\xc9\xd5\
\x9d\xe7\xce\x01\x80\xaf\xb0\xf2\xf0\xc2\xd1\xab\xda\xd1\x6b\x3d\
\xbc\x10\x58\x13\x56\xae\xd8\x78\x4c\x53\xcf\x68\xe5\x8a\x8d\x03\
\xe7\x4e\x9a\xdb\x7a\x18\xa0\x77\xbb\xb1\xfa\x9d\x36\xf7\x82\x9e\
\x35\x2e\x9f\x3b\x06\x00\x60\xd5\xfa\xad\xe9\x1b\xba\xa9\x93\xaa\
\x9f\xae\x0e\x99\x3b\x07\x00\x6e\x81\x1b\x9a\x7a\x73\x75\x76\xa3\
\xd7\xb6\x65\x5c\x37\x77\x10\xc0\x97\x79\xe9\xf4\xa0\x46\x4f\xa9\
\x7e\xaa\xba\xdf\xcc\x35\xab\xca\x7a\x1a\xa0\x77\xbb\xaa\xa9\x5f\
\xe9\xba\x4e\xe9\x79\xe3\xf3\x73\xc7\x00\x00\xac\x1a\x67\x4c\x77\
\x6b\xea\x67\x9a\x7a\x6e\x75\xfb\xb9\x73\x00\xe0\x36\xf2\xf0\x42\
\x60\x75\x58\xf9\x8e\xc2\x27\x35\x7a\x46\x53\x0f\x9f\x3b\x67\xb5\
\x5a\x8f\x03\xf4\x6e\x9f\xa8\x7e\xa9\x4b\xfa\x2d\x7f\x18\x01\x00\
\x1b\xda\xcb\xa6\xfb\xb5\xb3\xe7\x55\xc7\xe7\x5b\x00\x01\x58\x5f\
\x3c\xbc\x10\xd8\xb7\x4e\x99\x0e\x68\xff\x1e\xd3\xe8\xe9\xad\x5c\
\xb1\xb1\x79\xee\xa4\xd5\x6e\x3d\x0f\xd0\xbb\xfd\x73\x53\x2f\x6c\
\x4b\xe7\x34\xc6\x7a\xff\x6f\x05\x00\xf8\xa2\xed\xd3\x11\x2d\xf7\
\xf3\x8d\xfe\x8f\xbc\x31\x06\x60\xfd\xbb\xb0\xd1\x6b\xda\xd1\x6b\
\x7a\xce\xf8\x97\xb9\x63\x80\x75\x64\xe5\x5e\xe7\x47\x34\xf5\xb4\
\xea\xc7\xaa\x3b\xcd\x9d\xb4\x96\x6c\x84\x01\x7a\xb7\xf7\x56\xbf\
\xd4\x96\x71\xf6\xdc\x21\x00\x00\x0b\xb5\x7d\x7a\x70\x53\xcf\xaf\
\x9e\x5a\xed\x37\x77\x0e\x00\xcc\xe0\xc2\x56\xee\x8b\x7e\x75\xc7\
\x8f\x0f\xcc\x1d\x03\xac\x51\xdb\xa7\x07\x57\x4f\xdf\xf5\x40\xc1\
\x7b\xcc\x9d\xb3\x56\x6d\xa4\x01\x7a\xc5\xd4\xdf\x54\x2f\xe8\x84\
\xf1\x96\xb9\x53\x00\x00\xf6\xaa\x97\x4e\xdf\xde\xe8\xbf\x56\x4f\
\xab\x36\xcd\x9d\x03\x00\xab\xc4\xca\x18\x5d\xaf\x68\xcb\xf8\xd0\
\xdc\x31\xc0\x2a\xf7\xc5\x87\x09\x3e\xad\xfa\xe6\xb9\x73\xd6\x83\
\x8d\x37\x40\xef\x36\x7a\x73\x3b\x7b\x41\x27\x8e\xbf\x9d\x3b\x05\
\x00\x60\x8f\x9c\x3e\x3d\xa4\xa5\x5e\x58\x3d\x76\xee\x14\x00\x58\
\xc5\xa6\x46\x7f\xd5\x72\xaf\x69\xf4\xda\xb6\x8c\x4b\xe6\x0e\x02\
\x56\x89\x95\x67\xa6\x3c\xb5\x95\xef\x20\xfc\xb6\xb9\x73\xd6\x9b\
\x8d\x3b\x40\xaf\x98\x1a\xfd\x51\x53\xff\x77\x5b\xc6\x7b\xe6\x8e\
\x01\x00\xb8\x55\xb6\x4d\xdf\xd3\xe8\x85\x4d\xfd\xa7\xb9\x53\x00\
\x60\x8d\xd9\x59\xfd\x65\x53\x67\xed\x1a\xa3\xaf\x98\x3b\x08\xd8\
\xc7\x56\x46\xe7\x27\x35\xf5\xa4\x46\xdf\x53\x8d\xb9\x93\xd6\xab\
\x8d\x3e\x40\xef\xb6\xdc\xe8\x35\xd5\x56\x77\x43\x01\x00\xab\xde\
\xb6\xe9\x7b\xaa\x17\x55\xff\x71\xee\x14\x00\x58\x07\x76\x54\x7f\
\xde\xd4\x39\xed\xec\x0f\x3a\x69\x5c\x3a\x77\x10\xb0\x20\xa7\x4d\
\x87\xb7\xa9\x27\x55\x4f\xaa\xbe\x2b\xa3\xf3\x3e\x61\x80\xfe\x72\
\xcb\xd5\x39\xed\xec\xe7\x7a\xce\xb8\x68\xee\x18\x00\x80\x2f\x73\
\xc6\xf4\xbd\xed\xec\x17\x1a\x3d\x36\x6f\x96\x01\x60\x11\x96\xab\
\x7f\xa8\xde\xd0\xd4\xab\x3a\x61\x7c\x70\xee\x20\x60\x0f\x9d\x3e\
\x7d\x63\x9b\x7a\x7c\xf5\xe4\xa6\x1e\x96\xf7\xd1\xfb\x9c\x01\xfa\
\xe6\xdd\xd0\x68\x7b\x37\xf5\x62\x7f\xf3\x09\x00\xcc\xee\xa5\xd3\
\x43\x1b\xbd\xb0\xfa\xa1\xb9\x53\x00\x60\x03\x99\xaa\x0b\xaa\x73\
\x1a\xbd\xce\x77\x4c\xc3\x1a\x72\xda\xf4\x80\x2f\x39\xe9\x7c\xe4\
\xdc\x39\x1b\x9d\x01\xfa\x6b\xbb\xae\x7a\x59\xcb\xfd\x72\x27\x8e\
\xcb\xe6\x8e\x01\x00\x36\x98\x97\x4e\x0f\xad\xfe\xaf\x46\x8f\x9b\
\x3b\x05\x00\xe8\xc2\x46\xe7\x36\xf5\x86\xb6\x8c\xf3\xe7\x8e\x01\
\xbe\xc4\xd6\x69\xa9\x7b\xf5\x1d\x2d\xf7\xc3\xd5\xe3\xaa\xa3\xe6\
\x4e\xe2\x8b\x0c\xd0\xb7\xcc\xd5\x8d\x7e\xbd\x4d\xfd\x46\xcf\x1e\
\xd7\xcc\x1d\x03\x00\xac\x73\xdb\xa7\x87\x35\xf5\xa2\xea\x31\x73\
\xa7\x00\x00\x37\xeb\x5f\x1b\x9d\xd3\xce\x5e\xd7\x09\xfd\x5d\x63\
\xd8\x56\x60\x5f\xdb\x36\xdd\xbe\xa9\x47\x37\xfa\x91\x56\x46\xe7\
\xbb\xce\x9d\xc4\xcd\x33\x40\xdf\x3a\x57\x54\xff\xb3\x3a\xbd\x2d\
\xe3\xba\xb9\x63\x00\x80\x75\xe6\xf4\xe9\xe1\x6d\xea\x45\x4d\x3d\
\x7a\xee\x14\x00\xe0\x16\xfb\x64\x2b\x77\x46\xbf\xa1\xd1\x5b\xec\
\x05\xb0\x40\x67\x4c\x77\xdb\x75\xca\xf9\x47\xaa\x63\xaa\xdb\xcd\
\x5c\xc4\x2d\x60\x80\xbe\x6d\x3e\xd5\xd4\xff\x6a\xf4\x52\x7f\xb0\
\x00\x00\x7b\x6c\xdb\x74\x74\xf5\xa2\x56\xde\x44\x03\x00\x6b\xd7\
\xe7\xab\xb7\x56\xe7\xb6\xd4\x1f\x77\xdc\xf8\xf8\xdc\x41\xb0\xe6\
\x6d\x9b\xbe\xb5\x7a\x6c\x53\x8f\x6f\xf4\x90\x6a\x69\xee\x24\x6e\
\x1d\x03\xf4\x9e\xb9\xa2\x3a\xb5\x1b\xfa\xf5\x4e\x1e\x9f\x9d\x3b\
\x06\x00\x58\x63\xb6\x4f\x0f\x6b\xb9\x9f\x77\xc7\x33\x00\xac\x5b\
\x5f\xbc\x37\xfa\x92\xfe\xaa\xad\x63\x79\xee\x20\x58\xf5\x4e\x9d\
\x0e\x6a\x53\x8f\xd8\xf5\x1e\xf9\x87\xaa\xfb\xce\x9d\xc4\x9e\x31\
\x40\xef\x1d\x86\x68\x00\xe0\x96\x3b\x7d\x7a\x78\xa3\x9f\x33\x3c\
\x03\xc0\x86\x72\x79\xf5\x27\xd5\xb9\xdd\xd0\x9f\xda\x0f\x60\x97\
\xdd\x0f\x10\xdc\xd9\x31\x8d\x8e\xa9\xbe\xbf\xda\x3c\x77\x16\x7b\
\x8f\x01\x7a\xef\xba\xbc\xa9\x5f\x6b\x67\xa7\x76\xd2\xf8\xdc\xdc\
\x31\x00\xc0\x2a\xf3\xd2\xe9\xfb\xaa\x17\x35\x7a\xe4\xdc\x29\x00\
\xc0\xac\xae\xaf\xde\xd6\xd4\x9b\x1a\xbd\xb9\x2d\xe3\xfd\x73\x07\
\xc1\x3e\x75\xc6\x74\xb7\xa6\x1e\xd3\xd4\x0f\xb5\xf2\xe0\xed\xbb\
\xcc\x9d\xc4\xe2\x18\xa0\x17\xe3\x8a\xea\xd7\xda\xd1\x4b\x0c\xd1\
\x00\x40\xdb\xa7\xef\x6f\xea\x45\xd5\x23\xe6\x4e\x01\x00\x56\xa5\
\x8f\x55\x6f\x6e\xf4\xe6\xf6\xeb\x2d\x3d\x6b\x5c\x3e\x77\x10\xec\
\x55\x67\x4e\x07\xb7\xb3\xa3\x9b\xfa\x81\x56\x9e\x7b\xf2\x1d\xd5\
\x98\x37\x8a\x7d\xc5\x00\xbd\x58\x57\x56\x2f\xa9\x7e\xa3\x2d\xe3\
\xea\xb9\x63\x00\x80\x7d\x6c\xdb\x74\x74\x53\xcf\x77\xd5\x06\x00\
\x70\x2b\x5d\x54\xbd\xa1\xd1\xb9\x6d\xee\xfc\x9e\x39\xae\x9f\x3b\
\x08\x6e\x95\x6d\xd3\xed\x1b\x3d\xac\xa9\xa3\xab\x87\x57\xdf\x57\
\xed\x3f\x73\x15\x33\x31\x40\xef\x1b\x2b\x43\xf4\xfe\xfd\x66\xcf\
\x1c\x9f\x99\x3b\x06\x00\x58\xb0\x6d\xd3\xd1\xd5\x8b\x5a\x39\xdd\
\x01\x00\xb0\x27\x3e\x5f\xbd\xa3\xa9\xf3\xda\xd4\x79\x1d\xdb\xbb\
\x1a\xc3\x96\xc3\xea\xf2\x6f\x07\xe7\xff\x50\x1d\x30\x73\x15\xab\
\x84\x01\x7a\xdf\xfa\x74\x53\xbf\xd1\x8d\x9d\xe2\x61\x03\x00\xb0\
\x0e\x6d\x9b\x1e\x51\x6d\x6d\xe5\x84\x07\x00\xc0\x22\x5c\x5a\x9d\
\xd7\xe8\x6d\xed\xe8\x1d\x3d\x67\xfc\xcb\xdc\x41\x6c\x40\xdb\xa6\
\x3b\x55\xdf\x53\x7d\x5f\xa3\x1f\x68\xea\x21\x79\x70\x20\x5f\x85\
\x01\x7a\x1e\xd7\x34\x3a\xad\xcd\xfd\x4f\x27\xa2\x01\x60\x1d\x58\
\x39\xf1\xbc\xb5\x7a\xd4\xcc\x25\x00\xc0\xc6\x73\x59\x53\x7f\x5b\
\x9d\xdf\xe8\x1d\xdd\xb9\xbf\xed\x29\xe3\xc6\xb9\xa3\x58\x67\x4e\
\x9b\x0e\x6f\xa9\xa3\x1b\x1d\xd5\xca\x09\xe7\xef\xa8\x96\x66\xae\
\x62\x8d\x30\x40\xcf\x6b\x65\x88\xde\xd1\xaf\xf4\x9c\x71\xd5\xdc\
\x31\x00\xc0\xad\xb4\x72\xc7\xf3\x2f\x36\x7a\xe4\xdc\x29\x00\x00\
\xbb\x5c\xdb\xe8\x1f\xab\xf3\x5b\xee\x1d\x1d\xd0\xdb\x1d\x7e\xe3\
\x56\x39\x65\xba\x63\x07\xf4\x6d\x4d\x3d\xbc\x3a\xba\xd1\x43\xab\
\xc3\xe6\xce\x62\xed\x32\x40\xaf\x0e\x9f\xa9\xfe\x3f\x77\x44\x03\
\xc0\x1a\xb1\x7d\x3a\xa6\xa9\x17\x55\x47\xcf\x9d\x02\x00\xf0\x75\
\xec\xa8\xfe\xa1\x95\x7b\xa4\xdf\xde\xa6\xde\xd1\x71\xe3\x53\x73\
\x47\xb1\x4a\x9c\x32\x1d\xd0\x01\x3d\xb8\xfa\xee\xa6\xbe\xb7\xd1\
\xf7\x56\x0f\xa8\xc6\xcc\x65\xac\x23\x06\xe8\xd5\xe5\xea\xea\xd4\
\x36\xf7\x9b\x3d\x6b\x5c\x3e\x77\x0c\x00\xf0\x15\x5e\x3a\x3d\xba\
\xa5\x5e\xb4\xeb\x34\x08\x00\xc0\x5a\x75\x51\xf5\x77\x8d\xfe\xbe\
\xfa\xbb\x36\xf5\xae\x9e\x3d\xae\x99\x3b\x8a\x05\xdb\x36\xdd\xa5\
\xd1\x91\xd5\x91\x4d\x7d\x7b\xf5\xed\xd5\x03\x73\x77\x33\x0b\x66\
\x80\x5e\x9d\xae\x6b\xea\x8c\x36\xf5\xab\x1d\x37\x3e\x3e\x77\x0c\
\x00\x6c\x78\xdb\xa6\xc7\x54\x2f\xaa\x1e\x36\x77\x0a\x00\xc0\x02\
\x2c\x57\xef\x6f\xf4\xf7\x2d\xf7\xf7\x6d\xea\x1f\x5b\xee\xdd\x6d\
\x19\x57\xcf\x1d\xc6\x6d\xb0\x75\x5a\xea\xee\xdd\xff\x0b\x63\xf3\
\xca\xd0\x7c\x64\x75\xaf\x79\xc3\xd8\xa8\x0c\xd0\xab\xdb\x8d\xd5\
\xcb\xdb\xd4\xaf\x74\xec\xf8\xd7\xb9\x63\x00\x60\xc3\xd9\x3e\xfd\
\xe0\xae\xab\x36\x1e\x3a\x77\x0a\x00\xc0\x0c\x3e\xdc\xd4\x3f\x36\
\xfa\xa7\xea\x9f\x5a\xea\x9f\x3a\x6e\x7c\x78\xee\x28\x76\xd9\x36\
\x6d\x6e\xf4\x4d\x2d\xf7\x80\x46\x47\x54\x47\x54\xdf\xba\xeb\x75\
\xd0\xbc\x71\xf0\x45\x06\xe8\xb5\x61\xb9\xa9\x37\x56\xbf\xd8\x09\
\xe3\xef\xe7\x8e\x01\x80\x75\x6f\xdb\x74\x74\xa3\xff\xa7\xa9\x1f\
\x98\x3b\x05\x00\x60\x95\xb9\xa1\xfa\x50\xf5\xbe\xea\xc2\xea\x7d\
\x2d\x75\x51\x9f\xef\xbd\x9d\x3c\x6e\x98\x37\x6d\x9d\x3a\x6d\xba\
\x73\x9b\x3b\xbc\x9d\x3d\xb8\xa5\x1e\xd4\xd4\xe1\xd5\xe1\xd5\x83\
\xab\x03\x67\xae\x83\xaf\xcb\x00\xbd\xb6\x4c\xd5\x1b\x5a\xea\xc5\
\x1d\x37\xfe\x66\xee\x18\x00\x58\x77\xb6\x4f\xff\x71\xd7\x89\xe7\
\xef\x99\x3b\x05\x00\x60\x8d\xb9\xa1\xfa\x60\xf5\xaf\xad\x0c\xd4\
\x1f\x6a\xea\x5f\x5b\xee\x43\x5d\xd6\x47\xdb\x3a\x76\xcc\x9b\xb7\
\x8a\xfd\xfa\x74\xbb\x0e\xec\xbe\x2d\x75\xdf\xea\xbe\x2d\xf5\x8d\
\x4d\x7d\x73\x7d\xe1\x54\xf3\x1d\xe6\x0d\x84\x3d\x63\x80\x5e\xab\
\xa6\xde\x5a\xbd\xb8\x13\xc6\x5b\xe6\x4e\x01\x80\x35\xef\xa5\xd3\
\x7f\xda\xf5\x70\xc1\x87\xcc\x9d\x02\x00\xb0\x0e\xdd\x54\x5d\x5c\
\x7d\xa4\xa9\x8f\x57\x1f\x6d\xa9\x8f\xd7\xae\xcf\xaf\xef\x63\x9d\
\x3c\x3e\x3b\x6b\xe1\xa2\x9c\x31\xdd\xad\xe5\xee\xda\xd4\xbd\x1a\
\xdd\xad\x95\x7b\x98\xef\x56\xdd\xbb\x76\x0d\xce\x75\xd7\x39\x13\
\x61\xd1\x0c\xd0\x6b\xdf\xdf\x35\xf5\xbf\xba\xb4\xd7\xb5\x75\x2c\
\xcf\x1d\x03\x00\x6b\xca\xb6\xe9\xb1\x8d\x5e\x68\x78\x06\x00\x98\
\xdd\xe7\xaa\x4b\xaa\xcb\x1b\x5d\xde\x72\x97\xb5\xd4\xa7\x9a\xba\
\xbc\xa9\xcb\x5b\xea\xf2\x46\x9f\x6b\xb9\x6b\x5b\xea\x73\xdd\xd4\
\x67\xba\xac\x6b\xf6\xc9\xc9\xea\x53\xa7\x83\xaa\x83\xda\xd4\xc1\
\x6d\xea\x8e\xd5\x9d\xda\xd9\xc1\x2d\x75\xc7\xa6\x0e\x6b\x74\x58\
\x53\x87\x55\x77\xd9\xf5\x3a\x6c\xd7\xeb\xae\xd5\xe6\x85\xf7\xc1\
\x2a\x67\x80\x5e\x3f\x3e\x58\xfd\x5a\xfb\xf7\xbb\x3d\x73\x5c\x3f\
\x77\x0c\x00\xac\x6a\xdb\xa7\xc7\x35\xf5\xc2\xea\xbb\xe7\x4e\x01\
\x00\x60\x8f\x5c\x5f\x7d\xbe\xba\xa6\xda\x3d\x46\x5f\x55\xd5\x68\
\x67\x53\x5f\xfb\x64\xf5\x68\xbf\xa6\x0e\xde\xf5\x4f\x07\x57\xfb\
\xb5\x32\x1a\xef\x7e\x88\xdf\x21\xd5\xd8\xbb\xc9\xb0\xb1\x18\xa0\
\xd7\x9f\xcb\xaa\xd3\xdb\xd4\x29\x1d\x3b\x3e\x3d\x77\x0c\x00\xac\
\x2a\xdb\xa7\x63\xaa\x5f\x76\xe2\x19\x00\x00\x60\xdf\x30\x40\xaf\
\x5f\x9f\xab\x7e\xab\x1d\xfd\x6a\x27\x8d\x8f\xcd\x1d\x03\x00\xb3\
\xda\x3e\x1d\xd3\xd4\x8b\x73\xe2\x19\x00\x00\x60\x9f\x32\x40\xaf\
\x7f\x37\x36\xf5\xea\x96\xfa\xd5\x8e\x1f\xef\x9b\x3b\x06\x00\xf6\
\x99\x69\x1a\x9d\xd1\x0f\x37\xf5\xa2\xea\x3b\xe7\xce\x01\x00\x00\
\xd8\x88\x0c\xd0\x1b\xc7\x54\xbd\xa5\xa9\x53\x3a\x61\x9c\x3b\x77\
\x0c\x00\x2c\xcc\xd6\x69\xa9\xbb\xb7\xf2\x70\xc1\xfa\xae\xb9\x73\
\x00\x00\x00\x36\x32\x03\xf4\xc6\x74\x41\x53\xa7\x74\x69\xaf\xde\
\x27\x4f\x8b\x05\x80\x7d\x61\xeb\xb4\xd4\x3d\x7a\x62\xf5\x8b\xd5\
\xbf\x9f\x3b\x07\x00\x00\x00\x03\xf4\x46\xf7\x91\xa6\x5e\xda\x72\
\xdb\x7b\xce\xb8\x6a\xee\x18\x00\xb8\x4d\xb6\x4d\x9b\x9b\x7a\x6a\
\xa3\x5f\xa8\x8e\x98\x3b\x07\x00\x00\x80\x2f\x32\x40\x53\x75\x4d\
\xf5\xdb\x6d\xea\xd7\x3b\x76\x5c\x3c\x77\x0c\x00\xdc\x22\x67\x4d\
\xfb\x77\x55\x3f\x55\xbd\xa0\xba\xcf\xcc\x35\x00\x00\x00\xdc\x0c\
\x03\x34\x5f\x6a\xb9\xa9\x37\xb6\xd4\xff\xe8\xf8\xf1\x57\x73\xc7\
\x00\xc0\xcd\x7a\xf9\x74\x87\xae\xef\xd8\xa6\xfe\x7b\x75\xcf\xb9\
\x73\x00\x00\x00\xf8\xea\x0c\xd0\x7c\x35\xee\x89\x06\x60\x75\x39\
\x73\x3a\xb8\x9d\x3d\xab\xa9\x9f\xab\xee\x3e\x77\x0e\x00\x00\x00\
\x5f\x9f\x01\x9a\xaf\xe7\x43\xd5\x6f\xb6\xa3\xdf\xe9\xa4\xf1\xb9\
\xb9\x63\x00\xd8\x80\xb6\x4d\x77\x69\xf4\xd3\x4d\x3d\xb7\xba\xd3\
\xdc\x39\x00\x00\x00\xdc\x72\x06\x68\x6e\xa9\xcf\x34\xfa\xad\x76\
\x74\x6a\xcf\x19\x17\xcd\x1d\x03\xc0\x06\x70\xc6\x74\xef\xa6\x7e\
\xa6\xa9\xe3\xab\x83\xe6\xce\x01\x00\x00\xe0\xd6\x33\x40\x73\x6b\
\x2d\x57\x6f\x6d\xea\x94\xb6\xf4\x86\xc6\xf0\xeb\x07\x80\xbd\x6b\
\xdb\x74\xff\xea\xe4\xea\xf8\xea\xc0\x99\x6b\x00\x00\x00\xd8\x03\
\x06\x68\xf6\xc4\x07\x1b\x9d\xda\x4d\x9d\xe9\x7a\x0e\x00\xf6\xd8\
\xe9\xd3\x77\xb4\xd4\xcf\x54\x4f\xab\x36\xcd\x9d\x03\x00\x00\xc0\
\x9e\x33\x40\xb3\x37\x7c\xb6\xfa\xfd\xea\x37\xda\x32\xde\x3f\x77\
\x0c\x00\x6b\xcc\xb6\xe9\xe8\xa6\x9e\xdf\xe8\x71\x73\xa7\x00\x00\
\x00\xb0\x77\x19\xa0\xd9\x9b\x5c\xcf\x01\xc0\x2d\xb3\x75\x5a\xea\
\xee\x3d\xb6\xa5\x5e\xd0\xd4\x43\xe6\xce\x01\x00\x00\x60\x31\x0c\
\xd0\x2c\xca\xfb\xaa\xff\xdd\xed\x7a\x65\xcf\x18\xd7\xce\x1d\x03\
\xc0\x2a\x71\xca\x74\x40\x07\xf4\x93\xd5\xcf\x56\xff\x6e\xee\x1c\
\x00\x00\x00\x16\xcb\x00\xcd\xa2\xad\x5c\xcf\xb1\xd4\xa9\x1d\x37\
\xde\x3d\x77\x0c\x00\x33\x39\x75\x3a\xa8\xcd\x3d\xbb\xa9\xff\x56\
\xdd\x7b\xee\x1c\x00\x00\x00\xf6\x0d\x03\x34\xfb\xd2\x5f\x36\x3a\
\xbd\x43\x7a\x5d\x4f\x19\x37\xce\x1d\x03\xc0\x3e\x70\xfa\x74\xaf\
\x36\xf5\xdc\xa6\xb6\x54\x87\xcc\x9d\x03\x00\x00\xc0\xbe\x65\x80\
\x66\x0e\x97\x35\xfa\xed\x46\xdb\x3a\x6e\x7c\x78\xee\x18\x00\x16\
\x60\xfb\x74\x64\x53\x27\x56\xcf\xa8\x0e\x9c\x3b\x07\x00\x00\x80\
\x79\x18\xa0\x99\xd3\xca\x43\x0b\x6b\x7b\x97\xf4\xfa\xb6\x8e\x1d\
\x73\x07\x01\xb0\x07\xa6\x69\x74\x46\x8f\x6a\xb9\x9f\x6e\xf4\xd8\
\x6a\xcc\x9d\x04\x00\x00\xc0\xbc\x0c\xd0\xac\x16\x9f\x6c\xf4\x8a\
\x46\x2f\xe9\xb8\xf1\xf1\xb9\x63\x00\xb8\x15\x4e\x99\x0e\x68\xff\
\x7e\xbc\xd1\xf3\xab\x07\xcd\x9d\x03\x00\x00\xc0\xea\x61\x80\x66\
\xb5\xb9\xb1\x7a\x7d\xb5\xad\xe3\xfb\xf3\xc6\xf0\xeb\x13\x60\xb5\
\x3a\x75\xba\x7b\x9b\x3b\xa9\xa9\x13\xaa\xbb\xcc\x9d\x03\x00\x00\
\xc0\xea\x63\x80\x66\x35\xfb\x58\xa3\x57\xb7\xd4\xe9\x1d\x3b\x2e\
\x9e\x3b\x06\x80\x5d\xb6\x4f\x47\x34\x75\x52\x75\x5c\x75\xbb\xb9\
\x73\x00\x00\x00\x58\xbd\x0c\xd0\xac\x05\x3b\xaa\x37\x35\x7a\x59\
\x9f\xec\x8d\xee\x8a\x06\x98\xc1\x34\x8d\xb6\xf5\x83\x2d\xf5\xbc\
\xa6\x8e\xc9\xfd\xce\x00\x00\x00\xdc\x02\x06\x68\xd6\x9a\x4b\xab\
\xb3\x5a\xee\x8c\x4e\x1c\xef\x9d\x3b\x06\x60\xdd\x3b\x73\x3a\xb8\
\x1d\x3d\xb5\x7a\x6e\xf5\x2d\x73\xe7\x00\x00\x00\xb0\xb6\x18\xa0\
\x59\xcb\x2e\xa8\xb6\x77\xbb\x5e\xd5\x33\xc6\xb5\x73\xc7\x00\xac\
\x2b\xdb\xa7\x23\xaa\x67\x35\xb5\xa5\x3a\x64\xee\x1c\x00\x00\x00\
\xd6\x26\x03\x34\xeb\xc1\xd5\xd5\x6b\x5a\x6a\x7b\xc7\x8d\x0b\xe6\
\x8e\x01\x58\xb3\xb6\x4e\x4b\xdd\xbd\xc7\x36\x3a\xb9\x7a\x54\xae\
\xd9\x00\x00\x00\x60\x0f\x19\xa0\x59\x6f\xde\x55\xfd\x6e\xcb\xfd\
\x7e\x27\x8e\xcb\xe6\x8e\x01\x58\x13\xce\x98\xee\xd6\xce\x8e\x6b\
\x74\x42\x75\xaf\xb9\x73\x00\x00\x00\x58\x3f\x0c\xd0\xac\x57\x3b\
\xab\xb7\x35\xf5\x8a\x46\xaf\x6d\xcb\xb8\x6e\xee\x20\x80\x55\xe7\
\x8c\xe9\xa8\x96\x3b\xbe\x7a\x7a\x75\xbb\xb9\x73\x00\x00\x00\x58\
\x7f\x0c\xd0\x6c\x04\x57\x57\x7f\xd4\xe8\xe5\x1d\xd7\x5b\x1a\xc3\
\xaf\x79\x60\xe3\x3a\x65\x3a\xa0\x03\xfa\x91\xea\x67\xaa\x87\xce\
\x9d\x03\x00\x00\xc0\xfa\x66\x80\x66\xa3\xf9\x50\xf5\x8a\xea\x95\
\x6d\x19\x1f\x9a\x3b\x06\x60\x9f\xd9\x36\x7d\x6b\x53\xcf\x6e\xf4\
\xf4\xea\xd0\xb9\x73\x00\x00\x00\xd8\x18\x0c\xd0\x6c\x64\x17\x34\
\x7a\x45\x53\xaf\x6a\xcb\xb8\x62\xee\x18\x80\xbd\xee\x94\xe9\x8e\
\xed\xdf\x13\x76\x8d\xce\xc7\xcc\x9d\x03\x00\x00\xc0\xc6\x63\x80\
\x86\xba\xbe\x3a\xb7\xd1\x2b\xbb\xbe\x3f\xed\xe4\x71\xc3\xdc\x41\
\x00\xb7\xd9\x34\x8d\x5e\xd6\xd1\x2d\xf7\xec\xea\x49\xd5\x1d\xe6\
\x4e\x02\x00\x00\x60\xe3\x32\x40\xc3\x97\xfb\x4c\x75\x6e\x53\x67\
\x37\xfa\x93\xb6\x8c\x9b\xe6\x0e\x02\xb8\x45\x4e\x9d\xee\xde\xe6\
\x7e\xbc\xa9\x67\x57\xdf\x3a\x77\x0e\x00\x00\x00\x94\x01\x1a\xbe\
\x96\x4f\x57\x7f\xdc\xd4\xd9\x5d\xda\x9b\xda\x3a\x76\xcc\x1d\x04\
\xf0\x65\xb6\x4e\x4b\xdd\xb3\x47\x36\x75\x7c\xf5\x84\x6a\xf3\xdc\
\x49\x00\x00\x00\xf0\xa5\x0c\xd0\x70\xcb\x5c\x51\xbd\xae\x7a\x45\
\xc7\xf7\x8e\xc6\xf0\xfb\x06\x98\xcf\xa9\xd3\x7d\xda\xd4\xd3\x1a\
\x9d\x58\xdd\x6f\xee\x1c\x00\x00\x00\xf8\x6a\x0c\xd0\x70\xeb\x5d\
\x5c\x9d\xd5\x52\xaf\xe9\xb8\x71\xc1\xdc\x31\xc0\x06\x71\xfa\x74\
\xd7\x96\x7a\x72\xa3\xa7\x36\xf5\xb0\x6a\xcc\x9d\x04\x00\x00\x00\
\x5f\x8f\x01\x1a\xf6\xcc\x07\x1b\xbd\xa6\xe5\x5e\xdb\x09\xe3\x9f\
\xe6\x8e\x01\xd6\x99\x53\xa6\x3b\x76\x40\x3f\xda\xd4\x53\x1b\x3d\
\xaa\xda\x6f\xee\x24\x00\x00\x00\xb8\x35\x0c\xd0\xb0\xf7\x5c\x5c\
\xfd\x61\xa3\x73\xfb\x64\x7f\xee\xce\x68\xe0\x36\x39\x65\x3a\xa0\
\xfd\x7b\x4c\xa3\x27\x57\x3f\x56\xdd\x61\xee\x24\x00\x00\x00\xb8\
\xad\x0c\xd0\xb0\x18\x57\x56\x6f\x6c\xea\xec\x6e\xec\xcf\x3a\x79\
\xdc\x30\x77\x10\xb0\x8a\x6d\x9d\x96\xba\x47\x0f\xab\x9e\x5c\x3d\
\xad\xba\xcb\xcc\x45\x00\x00\x00\xb0\x57\x18\xa0\x61\xf1\xae\x6b\
\xea\xad\xd5\xd9\x8d\xfe\xb0\x2d\xe3\xea\xb9\x83\x80\x55\x62\xfb\
\xf4\xe0\xea\xe9\x4d\xfd\x64\x75\xf7\xb9\x73\x00\x00\x00\x60\x6f\
\x33\x40\xc3\xbe\x75\x43\xf5\xd6\x46\xaf\x6f\xf4\x47\x1d\x37\x3e\
\x35\x77\x10\xb0\x0f\x4d\xd3\x68\x7b\x0f\x69\xe5\x6a\x8d\x27\x57\
\xdf\x34\x73\x11\x00\x00\x00\x2c\x94\x01\x1a\xe6\xb3\x5c\xfd\x55\
\x75\x6e\x4b\xfd\x49\xc7\x8d\x77\xcf\x1d\x04\x2c\xc0\x59\xd3\xa6\
\x3e\xd3\xd1\x4d\xfd\x58\xf5\xa3\xd5\x7d\xe6\x4e\x02\x00\x00\x80\
\x7d\xc5\x00\x0d\xab\xc7\xc7\x9b\x7a\x53\x4b\xbd\xa9\x4d\x9d\xd7\
\xb3\xc7\x35\x73\x07\x01\xb7\xd1\x29\xd3\x01\x1d\xd8\x0f\xec\x1a\
\x9d\x9f\x50\xdd\x75\xee\x24\x00\x00\x00\x98\x83\x01\x1a\x56\xa7\
\x9d\x8d\xfe\xa6\xe5\xce\x6d\x53\xe7\x75\x6c\xef\x6a\x0c\xbf\x57\
\x61\x35\x7b\xc9\x74\x58\x9b\x7b\x64\xf5\xc3\xd5\x8f\x54\x77\x9a\
\xb9\x08\x00\x00\x00\x66\x67\x80\x86\xb5\xe1\x53\xd5\x9f\x55\xe7\
\x76\x43\x7f\xda\xc9\xe3\xb3\x73\x07\x01\xd5\x69\xd3\xe1\xed\xd7\
\x0f\x37\xf5\xb8\xea\xfb\xab\xcd\x73\x27\x01\x00\x00\xc0\x6a\x62\
\x80\x86\xb5\xe7\x86\xea\xed\x4d\xbd\xa9\xa9\x3f\xeb\x84\xde\xe7\
\x74\x34\xec\x23\x2f\x9b\x0e\x6d\x67\x8f\x6a\xea\xd1\x8d\x1e\x5d\
\x7d\xe3\xdc\x49\x00\x00\x00\xb0\x9a\x19\xa0\x61\xed\xfb\x6c\xf5\
\xb7\x4d\x9d\xd7\xa6\xce\xeb\x13\xfd\x43\x5b\xc7\xf2\xdc\x51\xb0\
\x2e\x9c\x35\x6d\xea\xea\x8e\x6c\x67\xc7\x34\x3a\x26\xa7\x9c\x01\
\x00\x00\xe0\x56\x31\x40\xc3\xfa\x73\x4d\xf5\x4e\x83\x34\xdc\x46\
\xa7\x4d\x87\xb7\xa9\x63\xaa\x63\xaa\xc7\xe4\x2e\x67\x00\x00\x00\
\xb8\xcd\x0c\xd0\xb0\xfe\x19\xa4\xe1\x6b\xf9\xe2\xc3\x03\x8f\xa9\
\x7e\xb0\xba\xdf\xcc\x45\x00\x00\x00\xb0\x6e\x18\xa0\x61\xe3\xf9\
\x74\xa3\xb7\x57\xe7\x37\x7a\x67\xcb\x5d\xd0\x96\x71\xdd\xdc\x51\
\xb0\xcf\x9c\x3e\x7d\x63\x9b\x7a\x78\xcb\x3d\xac\xd1\xd1\xd5\xb7\
\x54\x4b\x73\x67\x01\x00\x00\xc0\x7a\x64\x80\x06\x76\x56\xff\x52\
\x5d\xd0\xe8\x82\x46\xe7\x3b\x25\xcd\xba\x71\xd6\xb4\xa9\xcf\xf4\
\xc0\xa6\x1e\x5e\x1d\x5d\xfd\x87\x3c\x38\x10\x00\x00\x00\xf6\x19\
\x03\x34\x70\x73\xae\x69\xf4\xee\xa6\x2e\xa8\xce\x6f\xa9\xbf\xec\
\xb8\xf1\xa9\xb9\xa3\xe0\xeb\x3a\x75\x3a\xa8\xfd\x3a\xf2\x0b\x83\
\xf3\xca\x09\xe7\x43\xe6\xce\x02\x00\x00\x80\x8d\xca\x00\x0d\xdc\
\x52\x17\x35\x7a\x67\xf5\xce\x46\xef\x6a\xb9\x77\xb7\x65\x5c\x3d\
\x77\x14\x1b\xd8\xb6\x69\x73\x53\x0f\x6a\x74\x64\xf5\xdd\xad\x9c\
\x6e\x7e\x70\xb5\x69\xde\x30\x00\x00\x00\x60\x37\x03\x34\xb0\x27\
\x2e\xa9\xde\x57\x5d\xd8\xd4\x05\x2d\x75\x41\x87\xf4\xfe\x9e\x32\
\x76\xce\x1d\xc6\x3a\x73\xd6\xb4\x7f\x9f\xe9\x9b\x5b\xee\xa8\xc6\
\xae\xd7\xd4\x77\x56\xb7\x9b\x3b\x0d\x00\x00\x00\xf8\xea\x0c\xd0\
\xc0\xde\x76\x63\xf5\xaf\xd5\x05\x4d\x5f\x18\xa7\xdf\xd9\x89\xe3\
\xb2\x99\xbb\x58\x2b\x7e\x7b\x3a\xa4\x1b\xfb\x96\x5d\x23\xf3\x51\
\xd5\x51\xd5\x03\x72\xb2\x19\x00\x00\x00\xd6\x1c\x03\x34\xb0\xaf\
\x5c\xdc\xd4\x7b\x1a\x5d\x58\x7d\xb0\xa9\x0f\xb4\xb3\x0f\x74\xd2\
\xb8\x74\xee\x30\x66\xf2\xb2\xe9\xd0\xa6\x8e\x68\xea\x81\x2d\x77\
\x44\xa3\x6f\xa9\x8e\xac\xee\x33\x77\x1a\x00\x00\x00\xb0\x77\x18\
\xa0\x81\xb9\xdd\x50\x7d\xa8\x7a\x5f\xa3\x8b\x9a\xba\x68\xd7\xc7\
\xf7\xb5\x65\x5c\x32\x77\x1c\x7b\x68\xdb\xb4\xb9\x9d\xdd\xa7\xfd\
\x3a\xbc\x7a\x70\x53\x0f\xaa\x0e\xff\x92\x17\x00\x00\x00\xb0\x8e\
\x19\xa0\x81\xd5\xec\xca\xa6\x3e\xd8\xe8\x5f\x5a\x39\x35\x7d\x71\
\x9b\xba\xb8\x9b\xfa\x44\x3b\xfa\x44\x27\x8f\x1b\xe6\x0e\xa4\x3a\
\x73\x3a\xb8\x9d\xdd\xb7\xe5\xee\xd3\xe8\x9b\xaa\x23\xaa\x07\xee\
\xfa\x78\xbf\x5c\x9d\x01\x00\x00\x00\x1b\x96\x01\x1a\x58\xcb\xae\
\x6a\xe5\x41\x88\x9f\xac\x2e\xfa\xc2\xe7\x63\xd7\xe7\x37\x75\x71\
\x27\x8d\xcf\xcd\x19\xb8\xe6\x9d\x32\x1d\xd0\x7e\xdd\xab\x4d\xdd\
\xb3\xba\x47\x53\x87\x37\x76\x7d\xbe\x72\x82\x79\xf7\xe7\x00\x00\
\x00\x00\xff\x86\x01\x1a\x58\xef\x3e\x55\x7d\xa2\x95\x71\xfa\xd3\
\xad\x9c\xaa\xbe\xb2\xd1\x95\x4d\x5d\xde\xe8\xca\x96\xba\xb2\x1d\
\x5d\xd9\x81\x5d\xd9\x33\xc7\xf5\xf3\xe6\x2e\xd8\x59\xd3\xfe\x5d\
\xd5\x61\x8d\x0e\x6d\x79\xd7\xc7\xa9\xc3\x1a\x1d\x56\xdd\x65\xd7\
\xbf\xbf\x5b\xa3\xfb\x56\xf7\xae\x0e\x9d\xb9\x18\x00\x00\x00\x58\
\xc3\x0c\xd0\x00\x5f\xee\xda\xea\xca\xea\xca\x46\x57\x54\x57\x34\
\x75\x4d\xa3\xcf\x55\x37\xb5\xdc\x55\x8d\x76\x54\xd7\x34\xfa\x7c\
\x53\xd7\x60\xa0\xb3\xbe\x00\x00\x02\xbb\x49\x44\x41\x54\x37\xfa\
\x6c\xa3\x9b\xaa\xab\xdb\xd1\x0d\x4d\x5d\xd7\xe6\xae\xed\xa6\x6e\
\x6c\x53\xcb\x6d\x19\x57\xdf\xa6\x92\xb3\xa6\x4d\x5d\xd1\x1d\xdb\
\xdc\xfe\xdd\xd4\x1d\x5a\xea\xc0\x36\x75\xbb\xea\xf6\x4d\x1d\x50\
\x1d\xdc\xd4\x7e\xd5\x9d\xaa\x4d\x4d\x1d\xd2\x68\x53\xa3\x3b\x36\
\x75\xd0\x17\xc6\xe5\x76\x8d\xcb\x2b\x63\xf2\xc1\x7b\xfc\x7f\x08\
\x00\x00\x00\xe0\x16\x32\x40\x03\x00\x00\x00\x00\xb0\x10\x4b\x73\
\x07\x00\x00\x00\x00\x00\xb0\x3e\x19\xa0\x01\x00\x00\x00\x00\x58\
\x08\x03\x34\x00\x00\x00\x00\x00\x0b\x61\x80\x06\x00\x00\x00\x00\
\x60\x21\x0c\xd0\x00\x00\x00\x00\x00\x2c\x84\x01\x1a\x00\x00\x00\
\x00\x80\x85\x30\x40\x03\x00\x00\x00\x00\xb0\x10\x06\x68\x00\x00\
\x00\x00\x00\x16\xc2\x00\x0d\x00\x00\x00\x00\xc0\x42\x18\xa0\x01\
\x00\x00\x00\x00\x58\x08\x03\x34\x00\x00\x00\x00\x00\x0b\x61\x80\
\x06\x00\x00\x00\x00\x60\x21\x0c\xd0\x00\x00\x00\x00\x00\x2c\x84\
\x01\x1a\x00\x00\x00\x00\x80\x85\x30\x40\x03\x00\x00\x00\x00\xb0\
\x10\x06\x68\x00\x00\x00\x00\x00\x16\xc2\x00\x0d\x00\x00\x00\x00\
\xc0\x42\x18\xa0\x01\x00\x00\x00\x00\x58\x08\x03\x34\x00\x00\x00\
\x00\x00\x0b\x61\x80\x06\x00\x00\x00\x00\x60\x21\x0c\xd0\x00\x00\
\x00\x00\x00\x2c\x84\x01\x1a\x00\x00\x00\x00\x80\x85\x30\x40\x03\
\x00\x00\x00\x00\xb0\x10\x06\x68\x00\x00\x00\x00\x00\x16\xc2\x00\
\x0d\x00\x00\x00\x00\xc0\x42\x18\xa0\x01\x00\x00\x00\x00\x58\x08\
\x03\x34\x00\x00\x00\x00\x00\x0b\x61\x80\x06\x00\x00\x00\x00\x60\
\x21\x0c\xd0\x00\x00\x00\x00\x00\x2c\x84\x01\x1a\x00\x00\x00\x00\
\x80\x85\x30\x40\x03\x00\x00\x00\x00\xb0\x10\x06\x68\x00\x00\x00\
\x00\x00\x16\xc2\x00\x0d\x00\x00\x00\x00\xc0\x42\x18\xa0\x01\x00\
\x00\x00\x00\x58\x08\x03\x34\x00\x00\x00\x00\x00\x0b\x61\x80\x06\
\x00\x00\x00\x00\x60\x21\x0c\xd0\x00\x00\x00\x00\x00\x2c\x84\x01\
\x1a\x00\x00\x00\x00\x80\x85\x30\x40\x03\x00\x00\x00\x00\xb0\x10\
\x06\x68\x00\x00\x00\x00\x00\x16\xc2\x00\x0d\x00\x00\x00\x00\xc0\
\x42\x18\xa0\x01\x00\x00\x00\x00\x58\x08\x03\x34\x00\x00\x00\x00\
\x00\x0b\x61\x80\x06\x00\x00\x00\x00\x60\x21\x0c\xd0\x00\x00\x00\
\x00\x00\x2c\x84\x01\x1a\x00\x00\x00\x00\x80\x85\x30\x40\x03\x00\
\x00\x00\x00\xb0\x10\x06\x68\x00\x00\x00\x00\x00\x16\xc2\x00\x0d\
\x00\x00\x00\x00\xc0\x42\x18\xa0\x01\x00\x00\x00\x00\x58\x08\x03\
\x34\x00\x00\x00\x00\x00\x0b\x61\x80\x06\x00\x00\x00\x00\x60\x21\
\x0c\xd0\x00\x00\x00\x00\x00\x2c\x84\x01\x1a\x00\x00\x00\x00\x80\
\x85\x30\x40\x03\x00\x00\x00\x00\xb0\x10\x06\x68\x00\x00\x00\x00\
\x00\x16\xc2\x00\x0d\x00\x00\x00\x00\xc0\x42\x18\xa0\x01\x00\x00\
\x00\x00\x58\x08\x03\x34\x00\x00\x00\x00\x00\x0b\x61\x80\x06\x00\
\x00\x00\x00\x60\x21\x0c\xd0\x00\x00\x00\x00\x00\x2c\x84\x01\x1a\
\x00\x00\x00\x00\x80\x85\x30\x40\x03\x00\x00\x00\x00\xb0\x10\x06\
\x68\x00\x00\x00\x00\x00\x16\xc2\x00\x0d\x00\x00\x00\x00\xc0\x42\
\x18\xa0\x01\x00\x00\x00\x00\x58\x08\x03\x34\x00\x00\x00\x00\x00\
\x0b\x61\x80\x06\x00\x00\x00\x00\x60\x21\x0c\xd0\x00\x00\x00\x00\
\x00\x2c\xc4\xff\x0f\x5a\x06\xa7\xf2\xb2\x2c\x3d\x48\x00\x00\x00\
\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = b"\
\x00\x04\
\x00\x07\xd8\xc5\
\x00\x77\
\x00\x61\x00\x76\x00\x65\
\x00\x04\
\x00\x06\xfa\x5e\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\
\x00\x05\
\x00\x50\x37\xd5\
\x00\x49\
\x00\x6d\x00\x61\x00\x67\x00\x65\
\x00\x05\
\x00\x4f\xa6\x53\
\x00\x49\
\x00\x63\x00\x6f\x00\x6e\x00\x73\
\x00\x16\
\x02\xa9\x3f\x87\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x73\x00\x38\x00\x2d\x00\x73\x00\x65\x00\x74\x00\x74\x00\x69\x00\x6e\x00\x67\x00\x73\x00\x2d\x00\x33\
\x00\x30\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x19\
\x02\xbc\x2e\x47\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x73\x00\x38\x00\x2d\x00\x67\x00\x6f\x00\x6f\x00\x67\x00\x6c\x00\x65\x00\x2d\x00\x63\x00\x6f\x00\x64\
\x00\x65\x00\x2d\x00\x33\x00\x30\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x04\
\x00\x05\xd8\xc5\
\x00\x57\
\x00\x61\x00\x76\x00\x65\
\x00\x0a\
\x0b\x2a\xe6\xc7\
\x00\x77\
\x00\x61\x00\x76\x00\x65\x00\x5f\x00\x32\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\
\x00\x00\x00\x0e\x00\x02\x00\x00\x00\x01\x00\x00\x00\x06\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x1c\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\xa6\x00\x02\x00\x00\x00\x01\x00\x00\x00\x05\
\x00\x00\x00\xb4\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa8\
\x00\x00\x00\x1c\x00\x02\x00\x00\x00\x01\x00\x00\x00\x07\
\x00\x00\x00\x2c\x00\x02\x00\x00\x00\x02\x00\x00\x00\x08\
\x00\x00\x00\x3c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x6e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x71\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x0e\x00\x02\x00\x00\x00\x01\x00\x00\x00\x06\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x1c\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\xa6\x00\x02\x00\x00\x00\x01\x00\x00\x00\x05\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\xb4\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa8\
\x00\x00\x01\x7e\x55\x94\x67\xd7\
\x00\x00\x00\x1c\x00\x02\x00\x00\x00\x01\x00\x00\x00\x07\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x2c\x00\x02\x00\x00\x00\x02\x00\x00\x00\x08\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x3c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x7e\x55\xa1\x15\xcc\
\x00\x00\x00\x6e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x71\
\x00\x00\x01\x7e\x55\x9e\xbf\xb3\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| 60.586867 | 129 | 0.726411 | 10,641 | 44,289 | 3.019829 | 0.028851 | 0.223502 | 0.262432 | 0.280077 | 0.228263 | 0.194374 | 0.179032 | 0.17315 | 0.167175 | 0.163814 | 0 | 0.313818 | 0.01847 | 44,289 | 730 | 130 | 60.669863 | 0.425387 | 0.003432 | 0 | 0.120448 | 0 | 0.904762 | 0.000023 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0.002801 | false | 0 | 0.001401 | 0 | 0.004202 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
264c1cf47fdd592a5387b8761221d7ac31905bfe | 6,407 | py | Python | loldib/getratings/models/NA/na_vayne/na_vayne_bot.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_vayne/na_vayne_bot.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_vayne/na_vayne_bot.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | from getratings.models.ratings import Ratings
class NA_Vayne_Bot_Aatrox(Ratings):
pass
class NA_Vayne_Bot_Ahri(Ratings):
pass
class NA_Vayne_Bot_Akali(Ratings):
pass
class NA_Vayne_Bot_Alistar(Ratings):
pass
class NA_Vayne_Bot_Amumu(Ratings):
pass
class NA_Vayne_Bot_Anivia(Ratings):
pass
class NA_Vayne_Bot_Annie(Ratings):
pass
class NA_Vayne_Bot_Ashe(Ratings):
pass
class NA_Vayne_Bot_AurelionSol(Ratings):
pass
class NA_Vayne_Bot_Azir(Ratings):
pass
class NA_Vayne_Bot_Bard(Ratings):
pass
class NA_Vayne_Bot_Blitzcrank(Ratings):
pass
class NA_Vayne_Bot_Brand(Ratings):
pass
class NA_Vayne_Bot_Braum(Ratings):
pass
class NA_Vayne_Bot_Caitlyn(Ratings):
pass
class NA_Vayne_Bot_Camille(Ratings):
pass
class NA_Vayne_Bot_Cassiopeia(Ratings):
pass
class NA_Vayne_Bot_Chogath(Ratings):
pass
class NA_Vayne_Bot_Corki(Ratings):
pass
class NA_Vayne_Bot_Darius(Ratings):
pass
class NA_Vayne_Bot_Diana(Ratings):
pass
class NA_Vayne_Bot_Draven(Ratings):
pass
class NA_Vayne_Bot_DrMundo(Ratings):
pass
class NA_Vayne_Bot_Ekko(Ratings):
pass
class NA_Vayne_Bot_Elise(Ratings):
pass
class NA_Vayne_Bot_Evelynn(Ratings):
pass
class NA_Vayne_Bot_Ezreal(Ratings):
pass
class NA_Vayne_Bot_Fiddlesticks(Ratings):
pass
class NA_Vayne_Bot_Fiora(Ratings):
pass
class NA_Vayne_Bot_Fizz(Ratings):
pass
class NA_Vayne_Bot_Galio(Ratings):
pass
class NA_Vayne_Bot_Gangplank(Ratings):
pass
class NA_Vayne_Bot_Garen(Ratings):
pass
class NA_Vayne_Bot_Gnar(Ratings):
pass
class NA_Vayne_Bot_Gragas(Ratings):
pass
class NA_Vayne_Bot_Graves(Ratings):
pass
class NA_Vayne_Bot_Hecarim(Ratings):
pass
class NA_Vayne_Bot_Heimerdinger(Ratings):
pass
class NA_Vayne_Bot_Illaoi(Ratings):
pass
class NA_Vayne_Bot_Irelia(Ratings):
pass
class NA_Vayne_Bot_Ivern(Ratings):
pass
class NA_Vayne_Bot_Janna(Ratings):
pass
class NA_Vayne_Bot_JarvanIV(Ratings):
pass
class NA_Vayne_Bot_Jax(Ratings):
pass
class NA_Vayne_Bot_Jayce(Ratings):
pass
class NA_Vayne_Bot_Jhin(Ratings):
pass
class NA_Vayne_Bot_Jinx(Ratings):
pass
class NA_Vayne_Bot_Kalista(Ratings):
pass
class NA_Vayne_Bot_Karma(Ratings):
pass
class NA_Vayne_Bot_Karthus(Ratings):
pass
class NA_Vayne_Bot_Kassadin(Ratings):
pass
class NA_Vayne_Bot_Katarina(Ratings):
pass
class NA_Vayne_Bot_Kayle(Ratings):
pass
class NA_Vayne_Bot_Kayn(Ratings):
pass
class NA_Vayne_Bot_Kennen(Ratings):
pass
class NA_Vayne_Bot_Khazix(Ratings):
pass
class NA_Vayne_Bot_Kindred(Ratings):
pass
class NA_Vayne_Bot_Kled(Ratings):
pass
class NA_Vayne_Bot_KogMaw(Ratings):
pass
class NA_Vayne_Bot_Leblanc(Ratings):
pass
class NA_Vayne_Bot_LeeSin(Ratings):
pass
class NA_Vayne_Bot_Leona(Ratings):
pass
class NA_Vayne_Bot_Lissandra(Ratings):
pass
class NA_Vayne_Bot_Lucian(Ratings):
pass
class NA_Vayne_Bot_Lulu(Ratings):
pass
class NA_Vayne_Bot_Lux(Ratings):
pass
class NA_Vayne_Bot_Malphite(Ratings):
pass
class NA_Vayne_Bot_Malzahar(Ratings):
pass
class NA_Vayne_Bot_Maokai(Ratings):
pass
class NA_Vayne_Bot_MasterYi(Ratings):
pass
class NA_Vayne_Bot_MissFortune(Ratings):
pass
class NA_Vayne_Bot_MonkeyKing(Ratings):
pass
class NA_Vayne_Bot_Mordekaiser(Ratings):
pass
class NA_Vayne_Bot_Morgana(Ratings):
pass
class NA_Vayne_Bot_Nami(Ratings):
pass
class NA_Vayne_Bot_Nasus(Ratings):
pass
class NA_Vayne_Bot_Nautilus(Ratings):
pass
class NA_Vayne_Bot_Nidalee(Ratings):
pass
class NA_Vayne_Bot_Nocturne(Ratings):
pass
class NA_Vayne_Bot_Nunu(Ratings):
pass
class NA_Vayne_Bot_Olaf(Ratings):
pass
class NA_Vayne_Bot_Orianna(Ratings):
pass
class NA_Vayne_Bot_Ornn(Ratings):
pass
class NA_Vayne_Bot_Pantheon(Ratings):
pass
class NA_Vayne_Bot_Poppy(Ratings):
pass
class NA_Vayne_Bot_Quinn(Ratings):
pass
class NA_Vayne_Bot_Rakan(Ratings):
pass
class NA_Vayne_Bot_Rammus(Ratings):
pass
class NA_Vayne_Bot_RekSai(Ratings):
pass
class NA_Vayne_Bot_Renekton(Ratings):
pass
class NA_Vayne_Bot_Rengar(Ratings):
pass
class NA_Vayne_Bot_Riven(Ratings):
pass
class NA_Vayne_Bot_Rumble(Ratings):
pass
class NA_Vayne_Bot_Ryze(Ratings):
pass
class NA_Vayne_Bot_Sejuani(Ratings):
pass
class NA_Vayne_Bot_Shaco(Ratings):
pass
class NA_Vayne_Bot_Shen(Ratings):
pass
class NA_Vayne_Bot_Shyvana(Ratings):
pass
class NA_Vayne_Bot_Singed(Ratings):
pass
class NA_Vayne_Bot_Sion(Ratings):
pass
class NA_Vayne_Bot_Sivir(Ratings):
pass
class NA_Vayne_Bot_Skarner(Ratings):
pass
class NA_Vayne_Bot_Sona(Ratings):
pass
class NA_Vayne_Bot_Soraka(Ratings):
pass
class NA_Vayne_Bot_Swain(Ratings):
pass
class NA_Vayne_Bot_Syndra(Ratings):
pass
class NA_Vayne_Bot_TahmKench(Ratings):
pass
class NA_Vayne_Bot_Taliyah(Ratings):
pass
class NA_Vayne_Bot_Talon(Ratings):
pass
class NA_Vayne_Bot_Taric(Ratings):
pass
class NA_Vayne_Bot_Teemo(Ratings):
pass
class NA_Vayne_Bot_Thresh(Ratings):
pass
class NA_Vayne_Bot_Tristana(Ratings):
pass
class NA_Vayne_Bot_Trundle(Ratings):
pass
class NA_Vayne_Bot_Tryndamere(Ratings):
pass
class NA_Vayne_Bot_TwistedFate(Ratings):
pass
class NA_Vayne_Bot_Twitch(Ratings):
pass
class NA_Vayne_Bot_Udyr(Ratings):
pass
class NA_Vayne_Bot_Urgot(Ratings):
pass
class NA_Vayne_Bot_Varus(Ratings):
pass
class NA_Vayne_Bot_Vayne(Ratings):
pass
class NA_Vayne_Bot_Veigar(Ratings):
pass
class NA_Vayne_Bot_Velkoz(Ratings):
pass
class NA_Vayne_Bot_Vi(Ratings):
pass
class NA_Vayne_Bot_Viktor(Ratings):
pass
class NA_Vayne_Bot_Vladimir(Ratings):
pass
class NA_Vayne_Bot_Volibear(Ratings):
pass
class NA_Vayne_Bot_Warwick(Ratings):
pass
class NA_Vayne_Bot_Xayah(Ratings):
pass
class NA_Vayne_Bot_Xerath(Ratings):
pass
class NA_Vayne_Bot_XinZhao(Ratings):
pass
class NA_Vayne_Bot_Yasuo(Ratings):
pass
class NA_Vayne_Bot_Yorick(Ratings):
pass
class NA_Vayne_Bot_Zac(Ratings):
pass
class NA_Vayne_Bot_Zed(Ratings):
pass
class NA_Vayne_Bot_Ziggs(Ratings):
pass
class NA_Vayne_Bot_Zilean(Ratings):
pass
class NA_Vayne_Bot_Zyra(Ratings):
pass
| 15.364508 | 46 | 0.761667 | 972 | 6,407 | 4.59465 | 0.151235 | 0.216301 | 0.370802 | 0.463502 | 0.797582 | 0.797582 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173404 | 6,407 | 416 | 47 | 15.401442 | 0.843278 | 0 | 0 | 0.498195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.498195 | 0.00361 | 0 | 0.501805 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 7 |
266f96a4a7dc630ad8f2e376053b5f03bab78571 | 8,318 | py | Python | tests/test_blocks.py | guolinxin/bitcoin | f76764a4c22327538c94a442a2de5fadb229a5a6 | [
"MIT"
] | 3 | 2019-11-14T03:45:39.000Z | 2021-08-02T14:24:27.000Z | tests/test_blocks.py | guolinxin/bitcoin | f76764a4c22327538c94a442a2de5fadb229a5a6 | [
"MIT"
] | 1 | 2020-01-04T00:50:52.000Z | 2020-01-13T20:08:59.000Z | tests/test_blocks.py | guolinxin/bitcoin | f76764a4c22327538c94a442a2de5fadb229a5a6 | [
"MIT"
] | 4 | 2020-05-07T17:45:22.000Z | 2021-12-03T05:30:52.000Z | import btc.block
#
# Compare two strings and return the first charqcte where they
# differ or minus 1
#
def diff_strings(s1, s2):
l = min(len(s1), len(s2))
for i in range(l):
if s1[i] != s2[i]:
return i
if len(s1) != len(s2):
return l
return -1
#
# Pretty print blocks
#
def pp_block(raw):
cpl = 50
lines = int(len(raw) / cpl) + 1
s = raw
for i in range(lines):
print(s[0:cpl])
s = s[cpl:]
#
# Deserialize a block header
#
def test_tc1():
raw = '00000020df9e03f6f3b6089704150a0627841c9fb86adbf265fc8f31c95bb6b99e4a604c187d9b8d7dad469812834e9f4f72af649656b4179880d0102499118c7fd488d9bc69b65affff7f20030000000102000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016b0101ffffffff0200f2052a01000000232103bacc76145b9800c24b519cf659e6add26db1ea0b23806ae361f058e67d84bd04ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000'
blockHeader = btc.block.blockHeader()
raw = blockHeader.deserialize(raw)
assert(blockHeader.getVersion() == 0x20000000)
assert(blockHeader.getPrevBlockId() == '4c604a9eb9b65bc9318ffc65f2db6ab89f1c8427060a15049708b6f3f6039edf')
assert(blockHeader.getMerkleRoot() == 'd988d47f8c11992410d0809817b4569664af724f9f4e83129846ad7d8d9b7d18')
assert(blockHeader.getCreationTime() == 1521904060)
assert(blockHeader.getBits() == 545259519)
assert(blockHeader.getNonce() == 3)
assert(raw == '0102000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016b0101ffffffff0200f2052a01000000232103bacc76145b9800c24b519cf659e6add26db1ea0b23806ae361f058e67d84bd04ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000')
#
# Deserialize a block
#
def test_tc2():
raw = '00000020df9e03f6f3b6089704150a0627841c9fb86adbf265fc8f31c95bb6b99e4a604c187d9b8d7dad469812834e9f4f72af649656b4179880d0102499118c7fd488d9bc69b65affff7f20030000000102000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016b0101ffffffff0200f2052a01000000232103bacc76145b9800c24b519cf659e6add26db1ea0b23806ae361f058e67d84bd04ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000'
block = btc.block.block()
raw = block.deserialize(raw)
#
# First check block header fields
#
blockHeader = block.getBlockHeader()
assert(blockHeader.getVersion() == 0x20000000)
assert(blockHeader.getPrevBlockId() == '4c604a9eb9b65bc9318ffc65f2db6ab89f1c8427060a15049708b6f3f6039edf')
assert(blockHeader.getMerkleRoot() == 'd988d47f8c11992410d0809817b4569664af724f9f4e83129846ad7d8d9b7d18')
assert(blockHeader.getCreationTime() == 1521904060)
assert(blockHeader.getBits() == 545259519)
assert(blockHeader.getNonce() == 3)
#
# Now check transactions
#
tx = block.getTx()
assert(1 == len(tx))
#
# Deserialize a block with two transactions
#
def test_tc3():
raw = '000000208b04e3a08be31c35257492f18bfac10c5ead328b5a4012473ef20a903cd49850bd11c56cf26bf256e4cdd00cd21b68c37f3b71d9614e9630226f5fa09b4104c1d7a1bf5affff7f20020000000202000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016c0101ffffffff02a803062a01000000232102a2f9ed878030526366b30093c00e32934f3c04a884f2844af2883ee453f0228dac0000000000000000266a24aa21a9ede8d2abc7618be366fa6688272429dac8512666a1610a72c6a72527c4698ccafc000000000200000001a88649b2ec24cb6fa07011acb68749461d7c438e8b89ddbcea3f5bac89e3ad2b010000006b483045022100ca652e20c2a0ceae370a2c037d8bbce09498c883a7a98a541e8f9fcea294d8c902207a16331540cd8a892186926646f99220489de0a9a9713f870b1c6989cf22948c012103f9fa8e3fba8af74b6c8ba4bd530000df4cc62bf0a50aeff58b6462888f79a5cefeffffff0280d1f008000000001976a914625d8e5d40a1b797b47cb66eee958724a668d8d288acd87adfa9000000001976a914731a59d04408789756ae353eeba6eefc975bfe7688ac1f000000'
block = btc.block.block()
block.deserialize(raw)
#
# First check block header fields
#
blockHeader = block.getBlockHeader()
assert(blockHeader.getVersion() == 0x20000000)
#
# Now check transactions
#
tx = block.getTx()
assert(2 == len(tx))
#
# Re-serialize the block manually and compare. The block header
# has 80 bytes
#
_raw = raw[:2*80] + "02" + tx[0].serialize() + tx[1].serialize()
assert(_raw == raw)
#
# Also check the transaction hashes
#
assert(tx[0].getTxnId(byteorder="big") == '7a2470e0242a5dc141f3d260dd3e4c43a06bf2f827ac26d9d3686ad1949bcd66')
assert(tx[1].getTxnId(byteorder="big") == 'b257a1ff6503d2d93fd5c8fc49c91c3cfc14f38f34788217320b32e4a30e9b40')
#
# Deserialize a block header
#
def test_tc4():
raw = '00000020df9e03f6f3b6089704150a0627841c9fb86adbf265fc8f31c95bb6b99e4a604c187d9b8d7dad469812834e9f4f72af649656b4179880d0102499118c7fd488d9bc69b65affff7f20030000000102000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016b0101ffffffff0200f2052a01000000232103bacc76145b9800c24b519cf659e6add26db1ea0b23806ae361f058e67d84bd04ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000'
blockHeader = btc.block.blockHeader()
blockHeader.deserialize(raw)
assert(blockHeader.serialize() == raw[:160])
#
# Serialize a block with two transactions
#
def test_tc5():
raw = '000000208b04e3a08be31c35257492f18bfac10c5ead328b5a4012473ef20a903cd49850bd11c56cf26bf256e4cdd00cd21b68c37f3b71d9614e9630226f5fa09b4104c1d7a1bf5affff7f20020000000202000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016c0101ffffffff02a803062a01000000232102a2f9ed878030526366b30093c00e32934f3c04a884f2844af2883ee453f0228dac0000000000000000266a24aa21a9ede8d2abc7618be366fa6688272429dac8512666a1610a72c6a72527c4698ccafc000000000200000001a88649b2ec24cb6fa07011acb68749461d7c438e8b89ddbcea3f5bac89e3ad2b010000006b483045022100ca652e20c2a0ceae370a2c037d8bbce09498c883a7a98a541e8f9fcea294d8c902207a16331540cd8a892186926646f99220489de0a9a9713f870b1c6989cf22948c012103f9fa8e3fba8af74b6c8ba4bd530000df4cc62bf0a50aeff58b6462888f79a5cefeffffff0280d1f008000000001976a914625d8e5d40a1b797b47cb66eee958724a668d8d288acd87adfa9000000001976a914731a59d04408789756ae353eeba6eefc975bfe7688ac1f000000'
block = btc.block.block()
block.deserialize(raw)
assert(block.serialize() == raw)
#
# Test conversion of bits to difficulty
#
def test_tc6():
#
# This is the raw block header of block #516463
#
raw = "00000020d0af8b47e9b5cdf1911642224e548bec3d54c2ba1c900300000000000000000079fd24794eccc05a7e198ce2613dfc0e89a65d20dc871440f2c8b6197deb237b0199c35ab72a5017ed3013f1bb"
blockHeader = btc.block.blockHeader()
blockHeader.deserialize(raw)
assert(abs(blockHeader.getDifficulty() - 3511060552899.72) < 0.01)
#
# Test updateMerkleRoot
#
def test_tc7():
raw = '000000208b04e3a08be31c35257492f18bfac10c5ead328b5a4012473ef20a903cd49850bd11c56cf26bf256e4cdd00cd21b68c37f3b71d9614e9630226f5fa09b4104c1d7a1bf5affff7f20020000000202000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04016c0101ffffffff02a803062a01000000232102a2f9ed878030526366b30093c00e32934f3c04a884f2844af2883ee453f0228dac0000000000000000266a24aa21a9ede8d2abc7618be366fa6688272429dac8512666a1610a72c6a72527c4698ccafc000000000200000001a88649b2ec24cb6fa07011acb68749461d7c438e8b89ddbcea3f5bac89e3ad2b010000006b483045022100ca652e20c2a0ceae370a2c037d8bbce09498c883a7a98a541e8f9fcea294d8c902207a16331540cd8a892186926646f99220489de0a9a9713f870b1c6989cf22948c012103f9fa8e3fba8af74b6c8ba4bd530000df4cc62bf0a50aeff58b6462888f79a5cefeffffff0280d1f008000000001976a914625d8e5d40a1b797b47cb66eee958724a668d8d288acd87adfa9000000001976a914731a59d04408789756ae353eeba6eefc975bfe7688ac1f000000'
block = btc.block.block()
block.deserialize(raw)
#
# Get the Merkle root
#
merkleRoot = block.getBlockHeader().getMerkleRoot()
#
# Update - but overwrite first so that we really know
# that we do something
#
block.getBlockHeader().merkleRoot = "ff"
block.updateMerkleRoot()
#
# this should not change anything
#
assert(block.getBlockHeader().getMerkleRoot() == merkleRoot)
| 54.723684 | 918 | 0.842029 | 395 | 8,318 | 17.703797 | 0.321519 | 0.034034 | 0.009724 | 0.010296 | 0.709853 | 0.704705 | 0.561133 | 0.541113 | 0.523667 | 0.120549 | 0 | 0.480504 | 0.102789 | 8,318 | 151 | 919 | 55.086093 | 0.456519 | 0.084996 | 0 | 0.466667 | 0 | 0 | 0.653067 | 0.651742 | 0 | 1 | 0.003974 | 0 | 0.306667 | 1 | 0.12 | false | 0 | 0.013333 | 0 | 0.173333 | 0.013333 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
cd210311f26c781f6e5dd986d7ad9af22631b91b | 37 | py | Python | movie_spider/resource/movie.py | codelegant/python-action | 6da939faa3a235d595825d442f72825b7849c393 | [
"MIT"
] | null | null | null | movie_spider/resource/movie.py | codelegant/python-action | 6da939faa3a235d595825d442f72825b7849c393 | [
"MIT"
] | null | null | null | movie_spider/resource/movie.py | codelegant/python-action | 6da939faa3a235d595825d442f72825b7849c393 | [
"MIT"
] | null | null | null | def get():
return 'This is movie' | 18.5 | 26 | 0.621622 | 6 | 37 | 3.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.243243 | 37 | 2 | 26 | 18.5 | 0.821429 | 0 | 0 | 0 | 0 | 0 | 0.342105 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0.5 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 7 |
cd8c6db9f45222dc102494856a7d69295142fb56 | 1,768 | py | Python | ParallelPyMetaMap/main/output_files.py | biomedicalinformaticsgroup/ParallelPyMetaMap | 7d78cc026d914de81803a794f833223f1dab2df9 | [
"MIT"
] | null | null | null | ParallelPyMetaMap/main/output_files.py | biomedicalinformaticsgroup/ParallelPyMetaMap | 7d78cc026d914de81803a794f833223f1dab2df9 | [
"MIT"
] | null | null | null | ParallelPyMetaMap/main/output_files.py | biomedicalinformaticsgroup/ParallelPyMetaMap | 7d78cc026d914de81803a794f833223f1dab2df9 | [
"MIT"
] | null | null | null | import os
def output_files(column_name, out_form, extension):
#creating the directories we are planning on using the save the result of the system
if out_form == 'mmi':
for path in [f'output_ParallelPyMetaMap_{column_name}_{out_form}',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/annotated_df',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/temporary_df',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/extra_resources',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/{extension}_files'
]:
try:
#try to create the directory, most likely will work for new project
os.mkdir(path)
print(f'Now creating {path}')
except:
#if the directory already exist just pass
pass
if out_form == 'mo':
for path in [f'output_ParallelPyMetaMap_{column_name}_{out_form}',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/annotated_df',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/temporary_df',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/extra_resources',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/{extension}_files_output',
f'output_ParallelPyMetaMap_{column_name}_{out_form}/{extension}_files_input'
]:
try:
#try to create the directory, most likely will work for new project
os.mkdir(path)
print(f'Now creating {path}')
except:
#if the directory already exist just pass
pass | 52 | 98 | 0.605769 | 196 | 1,768 | 5.102041 | 0.27551 | 0.098 | 0.156 | 0.204 | 0.875 | 0.849 | 0.849 | 0.849 | 0.849 | 0.794 | 0 | 0 | 0.315045 | 1,768 | 34 | 99 | 52 | 0.825764 | 0.166855 | 0 | 0.740741 | 0 | 0 | 0.498979 | 0.469707 | 0 | 0 | 0 | 0 | 0 | 1 | 0.037037 | false | 0.074074 | 0.037037 | 0 | 0.074074 | 0.074074 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 10 |
269a8e1fef05ee3e6858bffcf8e3c641bdbe3163 | 10,869 | py | Python | pytorch_toolkit/object_detection/tests/common/test_case.py | maxpark/openvino_training_extensions | 98450ed8aeab8a003e1d19b49b6fb0da60388605 | [
"Apache-2.0"
] | 3 | 2020-12-29T02:47:32.000Z | 2021-11-12T08:12:51.000Z | pytorch_toolkit/object_detection/tests/common/test_case.py | maxpark/openvino_training_extensions | 98450ed8aeab8a003e1d19b49b6fb0da60388605 | [
"Apache-2.0"
] | null | null | null | pytorch_toolkit/object_detection/tests/common/test_case.py | maxpark/openvino_training_extensions | 98450ed8aeab8a003e1d19b49b6fb0da60388605 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions
# and limitations under the License.
import json
import os
import unittest
import torch
import yaml
from common.utils import collect_ap, run_through_shell
def get_dependencies(template_file):
output = {}
with open(template_file) as read_file:
content = yaml.load(read_file, yaml.SafeLoader)
for dependency in content['dependencies']:
output[dependency['destination'].split('.')[0]] = dependency['source']
return output
def get_epochs(template_file):
with open(template_file) as read_file:
content = yaml.load(read_file, yaml.SafeLoader)
return content['hyper_parameters']['basic']['epochs']
def create_test_case(problem_name, model_name, ann_file, img_root):
class TestCaseOteApi(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.templates_folder = os.environ['MODEL_TEMPLATES']
cls.template_folder = os.path.join(cls.templates_folder, 'object_detection', problem_name, model_name)
cls.template_file = os.path.join(cls.template_folder, 'template.yaml')
cls.ann_file = ann_file
cls.img_root = img_root
cls.dependencies = get_dependencies(cls.template_file)
cls.epochs_delta = 2
cls.total_epochs = get_epochs(cls.template_file) + cls.epochs_delta
run_through_shell(
f'cd {cls.template_folder};'
f'pip install -r requirements.txt;'
)
def skip_if_cpu_is_not_supported(self):
with open(self.template_file) as read_file:
training_targets = [x.lower() for x in yaml.load(read_file, yaml.SafeLoader)['training_target']]
if 'cpu' not in training_targets:
self.skipTest('CPU is not supported.')
@unittest.skipUnless(torch.cuda.is_available(), 'No GPU found')
def test_evaluation_on_gpu(self):
run_through_shell(
f'cd {self.template_folder};'
f'python eval.py'
f' --test-ann-files {self.ann_file}'
f' --test-data-roots {self.img_root}'
f' --save-metrics-to metrics.yaml'
f' --load-weights snapshot.pth'
)
with open(os.path.join(self.template_folder, "metrics.yaml")) as read_file:
content = yaml.load(read_file, yaml.SafeLoader)
ap = [metrics['value'] for metrics in content['metrics'] if metrics['key'] == 'ap'][0]
with open(f'{os.path.dirname(__file__)}/../expected_outputs/{problem_name}/{model_name}.json') as read_file:
content = json.load(read_file)
self.assertLess(abs(content['map'] - ap / 100), 1e-6)
def test_evaluation_on_cpu(self):
self.skip_if_cpu_is_not_supported()
run_through_shell(
'export CUDA_VISIBLE_DEVICES=;'
f'cd {self.template_folder};'
f'python eval.py'
f' --test-ann-files {self.ann_file}'
f' --test-data-roots {self.img_root}'
f' --save-metrics-to metrics.yaml'
f' --load-weights snapshot.pth'
)
with open(os.path.join(self.template_folder, "metrics.yaml")) as read_file:
content = yaml.load(read_file, yaml.SafeLoader)
ap = [metrics['value'] for metrics in content['metrics'] if metrics['key'] == 'ap'][0]
with open(f'{os.path.dirname(__file__)}/../expected_outputs/{problem_name}/{model_name}.json') as read_file:
content = json.load(read_file)
self.assertLess(abs(content['map'] - ap / 100), 1e-6)
@unittest.skipUnless(torch.cuda.is_available(), 'No GPU found')
def test_finetuning_on_gpu(self):
log_file = os.path.join(self.template_folder, 'test_finetuning.log')
run_through_shell(
f'cd {self.template_folder};'
f'python train.py'
f' --train-ann-files {self.ann_file}'
f' --train-data-roots {self.img_root}'
f' --val-ann-files {self.ann_file}'
f' --val-data-roots {self.img_root}'
f' --resume-from snapshot.pth'
f' --save-checkpoints-to {self.template_folder}'
f' --gpu-num 1'
f' --batch-size 1'
f' --epochs {self.total_epochs}'
f' | tee {log_file}')
ap = collect_ap(log_file)
self.assertEqual(len((ap)), self.epochs_delta)
self.assertGreater(ap[-1], 0)
def test_finetuning_on_cpu(self):
self.skip_if_cpu_is_not_supported()
log_file = os.path.join(self.template_folder, 'test_finetuning.log')
run_through_shell(
'export CUDA_VISIBLE_DEVICES=;'
f'cd {self.template_folder};'
f'python train.py'
f' --train-ann-files {self.ann_file}'
f' --train-data-roots {self.img_root}'
f' --val-ann-files {self.ann_file}'
f' --val-data-roots {self.img_root}'
f' --resume-from snapshot.pth'
f' --save-checkpoints-to {self.template_folder}'
f' --gpu-num 1'
f' --batch-size 1'
f' --epochs {self.total_epochs}'
f' | tee {log_file}')
ap = collect_ap(log_file)
self.assertEqual(len((ap)), self.epochs_delta)
self.assertGreater(ap[-1], 0)
return TestCaseOteApi
def create_export_test_case(problem_name, model_name, ann_file, img_root, alt_ssd_export=False):
class ExportTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.templates_folder = os.environ['MODEL_TEMPLATES']
cls.template_folder = os.path.join(cls.templates_folder, 'object_detection', problem_name, model_name)
cls.template_file = os.path.join(cls.template_folder, 'template.yaml')
cls.ann_file = ann_file
cls.img_root = img_root
cls.dependencies = get_dependencies(cls.template_file)
cls.test_export_thr = 0.031
def skip_if_cpu_is_not_supported(self):
with open(self.template_file) as read_file:
training_targets = [x.lower() for x in yaml.load(read_file, yaml.SafeLoader)['training_target']]
if 'cpu' not in training_targets:
self.skipTest('CPU is not supported.')
def do_export(self, folder):
run_through_shell(
f'cd {os.path.dirname(self.template_file)};'
f'pip install -r requirements.txt;'
f'python export.py'
f' --load-weights snapshot.pth'
f' --save-model-to {folder}'
)
def export_test_on_gpu(self, alt_ssd_export, thr):
export_folder = 'gpu_export'
if not os.path.exists(export_folder):
self.do_export(export_folder)
if alt_ssd_export:
export_dir = os.path.join(self.template_folder, export_folder, 'alt_ssd_export')
else:
export_dir = os.path.join(self.template_folder, export_folder)
run_through_shell(
f'cd {os.path.dirname(self.template_file)};'
f'python eval.py'
f' --test-ann-files {ann_file}'
f' --test-data-roots {img_root}'
f' --load-weights {os.path.join(export_dir, "model.bin")}'
f' --save-metrics-to {os.path.join(export_dir, "metrics.yaml")}'
)
with open(os.path.join(export_dir, "metrics.yaml")) as read_file:
content = yaml.load(read_file, yaml.SafeLoader)
ap = [metric for metric in content['metrics'] if metric['key'] == 'ap'][0]['value']
with open(f'{os.path.dirname(__file__)}/../expected_outputs/{problem_name}/{model_name}.json') as read_file:
content = json.load(read_file)
self.assertGreater(ap, content['map'] - thr)
def export_test_on_cpu(self, alt_ssd_export, thr):
export_folder = 'cpu_export'
if not os.path.exists(export_folder):
self.do_export(export_folder)
if alt_ssd_export:
export_dir = os.path.join(self.template_folder, export_folder, 'alt_ssd_export')
else:
export_dir = os.path.join(self.template_folder, export_folder)
run_through_shell(
f'export CUDA_VISIBLE_DEVICES=;'
f'cd {os.path.dirname(self.template_file)};'
f'python eval.py'
f' --test-ann-files {ann_file}'
f' --test-data-roots {img_root}'
f' --load-weights {os.path.join(export_dir, "model.bin")}'
f' --save-metrics-to {os.path.join(export_dir, "metrics.yaml")}'
)
with open(os.path.join(export_dir, "metrics.yaml")) as read_file:
content = yaml.load(read_file, yaml.SafeLoader)
ap = [metric for metric in content['metrics'] if metric['key'] == 'ap'][0]['value']
with open(f'{os.path.dirname(__file__)}/../expected_outputs/{problem_name}/{model_name}.json') as read_file:
content = json.load(read_file)
self.assertGreater(ap, content['map'] - thr)
@unittest.skipUnless(torch.cuda.is_available(), 'No GPU found')
def test_export_on_gpu(self):
self.export_test_on_gpu(False, self.test_export_thr)
def test_export_on_cpu(self):
self.skip_if_cpu_is_not_supported()
self.export_test_on_cpu(False, self.test_export_thr)
class ExportWithAltSsdTestCase(ExportTestCase):
@unittest.skipUnless(torch.cuda.is_available(), 'No GPU found')
def test_alt_ssd_export_on_gpu(self):
self.export_test_on_gpu(True, self.test_export_thr)
def test_alt_ssd_export_on_cpu(self):
self.skip_if_cpu_is_not_supported()
self.export_test_on_cpu(True, self.test_export_thr)
if alt_ssd_export:
return ExportWithAltSsdTestCase
return ExportTestCase
| 42.127907 | 120 | 0.597663 | 1,373 | 10,869 | 4.498908 | 0.144938 | 0.026226 | 0.02914 | 0.027521 | 0.811559 | 0.796503 | 0.767848 | 0.757811 | 0.757811 | 0.746803 | 0 | 0.004642 | 0.286503 | 10,869 | 257 | 121 | 42.291829 | 0.791876 | 0.050971 | 0 | 0.739796 | 0 | 0 | 0.244539 | 0.077662 | 0 | 0 | 0 | 0 | 0.040816 | 1 | 0.096939 | false | 0 | 0.030612 | 0 | 0.168367 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
26c4f748dd775544780d6f2f4a2b535002b4da26 | 2,801 | py | Python | eLearningProject/eLearningApp/migrations/0003_auto_20200115_0944.py | MelissaYates/passionProject1 | d8462265fd4c17bbe1e70410e989aff6ca5298fe | [
"MIT"
] | null | null | null | eLearningProject/eLearningApp/migrations/0003_auto_20200115_0944.py | MelissaYates/passionProject1 | d8462265fd4c17bbe1e70410e989aff6ca5298fe | [
"MIT"
] | null | null | null | eLearningProject/eLearningApp/migrations/0003_auto_20200115_0944.py | MelissaYates/passionProject1 | d8462265fd4c17bbe1e70410e989aff6ca5298fe | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-01-15 09:44
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('eLearningApp', '0002_auto_20200115_0917'),
]
operations = [
migrations.AlterField(
model_name='course',
name='created',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 476747, tzinfo=utc)),
),
migrations.AlterField(
model_name='course',
name='thumbnail',
field=models.ImageField(upload_to='gallery'),
),
migrations.AlterField(
model_name='course',
name='updated',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 476773, tzinfo=utc)),
),
migrations.AlterField(
model_name='file',
name='created',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479520, tzinfo=utc)),
),
migrations.AlterField(
model_name='file',
name='updated',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479543, tzinfo=utc)),
),
migrations.AlterField(
model_name='image',
name='created',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479520, tzinfo=utc)),
),
migrations.AlterField(
model_name='image',
name='updated',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479543, tzinfo=utc)),
),
migrations.AlterField(
model_name='relatedcourse',
name='time',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 477669, tzinfo=utc)),
),
migrations.AlterField(
model_name='text',
name='created',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479520, tzinfo=utc)),
),
migrations.AlterField(
model_name='text',
name='updated',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479543, tzinfo=utc)),
),
migrations.AlterField(
model_name='video',
name='created',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479520, tzinfo=utc)),
),
migrations.AlterField(
model_name='video',
name='updated',
field=models.DateTimeField(default=datetime.datetime(2020, 1, 15, 9, 44, 52, 479543, tzinfo=utc)),
),
]
| 36.855263 | 110 | 0.575866 | 292 | 2,801 | 5.469178 | 0.202055 | 0.150282 | 0.187852 | 0.217909 | 0.82154 | 0.82154 | 0.747652 | 0.747652 | 0.67752 | 0.67752 | 0 | 0.115657 | 0.29311 | 2,801 | 75 | 111 | 37.346667 | 0.690909 | 0.016066 | 0 | 0.768116 | 1 | 0 | 0.069717 | 0.008351 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.043478 | 0 | 0.086957 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
f805845b946af2e8dafef0dab1f4a164a626968c | 166 | py | Python | Task1E.py | cued-ia-computing/flood-ojss2-os416 | d8fb81a216b6100de342dc9d134d852257adb713 | [
"MIT"
] | null | null | null | Task1E.py | cued-ia-computing/flood-ojss2-os416 | d8fb81a216b6100de342dc9d134d852257adb713 | [
"MIT"
] | null | null | null | Task1E.py | cued-ia-computing/flood-ojss2-os416 | d8fb81a216b6100de342dc9d134d852257adb713 | [
"MIT"
] | null | null | null | from floodsystem.geo import rivers_by_station_number
from floodsystem.stationdata import build_station_list
print(rivers_by_station_number(build_station_list(), 9))
| 33.2 | 56 | 0.879518 | 24 | 166 | 5.666667 | 0.541667 | 0.220588 | 0.220588 | 0.308824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006452 | 0.066265 | 166 | 4 | 57 | 41.5 | 0.870968 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0.333333 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
f808b4fd018833d54a849466600f7324bba42fb3 | 25,036 | py | Python | Firmware/Py Scripts/unused in GUI/OAP_SampleLogger/Presentation_Part.py | ECE-412-Capstone-Sensor-Suite/Team-20-Sensor-Suite | ac1c1bb5383c0b9fe91caf8646ca2cb8643f607e | [
"MIT"
] | 2 | 2021-03-03T05:03:56.000Z | 2021-03-03T05:03:58.000Z | Firmware/Py Scripts/unused in GUI/OAP_SampleLogger/Presentation_Part.py | ECE-412-Capstone-Sensor-Suite/Team-20-Sensor-Suite | ac1c1bb5383c0b9fe91caf8646ca2cb8643f607e | [
"MIT"
] | null | null | null | Firmware/Py Scripts/unused in GUI/OAP_SampleLogger/Presentation_Part.py | ECE-412-Capstone-Sensor-Suite/Team-20-Sensor-Suite | ac1c1bb5383c0b9fe91caf8646ca2cb8643f607e | [
"MIT"
] | 1 | 2021-02-27T01:15:39.000Z | 2021-02-27T01:15:39.000Z | import tkinter as tk # python 2
import time
class SampleApp(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
container = tk.Frame(self)
container.pack(side="top", fill="both", expand=True)
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)
self.frames = {}
for F in (StartPage, MotesPage, Mote1Page, Mote2Page, Mote3Page):
page_name = F.__name__
frame = F(parent=container, controller=self)
self.frames[page_name] = frame
frame.grid(row=0, column=0, sticky="nsew")
self.show_frame("StartPage")
def show_frame(self, page_name):
'''Show a frame for the given page name'''
frame = self.frames[page_name]
frame.tkraise()
class StartPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg = '#b3d9ff')
self.controller = controller
self.controller.title("Data Visualization")
self.controller.geometry("1080x720")
self.controller.maxsize(1080, 720)
self.controller.minsize(1080, 720)
self.controller.iconbitmap("agriculture_plants_icon.ico")
self.controller.configure(bg= "white")
self.controller.attributes("-topmost", 1)
heading_label1 = tk.Label(self,
text = 'Data Visualization',
font = ("Times_New_Roman 30"),
fg = 'black',
bg = '#b3d9ff')
heading_label1.pack(pady = 50)
def s_button():
controller.show_frame('MotesPage')
start_button = tk.Button(self,
text = 'Get Start',
font=("Times_New_Roman 15"),
relief = 'raised',
borderwidth = 3,
width = 30,
height = 3,
command=s_button)
start_button.pack(pady= 50)
class MotesPage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg='#b3d9ff')
self.controller = controller
self.controller.title("Data Visualization")
self.controller.geometry("1080x720")
self.controller.maxsize(1080, 720)
self.controller.minsize(1080, 720)
self.controller.iconbitmap("agriculture_plants_icon.ico")
self.controller.configure(bg="white")
self.controller.attributes("-topmost", 1)
heading_label1 = tk.Label(self,
text='Data Visualization',
font=("Times_New_Roman 30"),
fg='black',
bg='#b3d9ff')
heading_label1.pack(pady=50)
motes_label = tk.Label(self,
text='Motes Choose',
font=("Times_New_Roman 20"),
fg='black',
bg='#b3d9ff'
)
motes_label.pack()
button_frame = tk.Frame(self, bg = '#b3d9ff')
button_frame.pack(expand = True)
button_frame2 = tk.Frame(self, bg='#b3d9ff')
button_frame2.pack(fill = 'both', expand = True)
def mote1():
controller.show_frame('Mote1Page')
mote1_button = tk.Button(button_frame,
text = 'Mote1',
font=("Times_New_Roman 15"),
command = mote1,
relief = 'raised',
borderwidth = 3,
width = 20,
height = 4,
)
mote1_button.grid(row = 0, column= 0, pady = 20, padx = 10)
def mote2():
controller.show_frame('Mote2Page')
mote2_button = tk.Button(button_frame,
text = 'Mote2',
font=("Times_New_Roman 15"),
command = mote2,
relief = 'raised',
borderwidth = 3,
width = 20,
height = 4)
mote2_button.grid(row = 0, column= 1, pady = 20, padx = 10)
def mote3():
controller.show_frame('Mote3Page')
mote3_button = tk.Button(button_frame,
text = 'Mote3',
font=("Times_New_Roman 15"),
command = mote3,
relief = 'raised',
borderwidth = 3,
width = 20,
height = 4)
mote3_button.grid(row = 0, column= 2, pady = 20, padx = 10)
def back1():
controller.show_frame('StartPage')
back1_button = tk.Button(button_frame2,
text = 'Back',
font=("Times_New_Roman 15"),
command = back1,
relief = 'raised',
borderwidth = 3,
width = 10,
height = 2)
back1_button.grid(row = 0, column= 0, pady = 300, padx = 10)
class Mote1Page(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg='#b3d9ff')
self.controller = controller
self.controller.title("Data Visualization")
self.controller.geometry("1080x720")
self.controller.maxsize(1080, 720)
self.controller.minsize(1080, 720)
self.controller.iconbitmap("agriculture_plants_icon.ico")
self.controller.configure(bg="white")
self.controller.attributes("-topmost", 1)
heading_label2 = tk.Label(self,
text='Data Visualization - Mote1 Data',
font=("Times_New_Roman 20"),
fg='black',
bg='#b3d9ff')
heading_label2.pack(pady=50)
button_frame = tk.Frame(self, bg='#b3d9ff')
button_frame.pack(fill='both', expand=True)
button_frame2 = tk.Frame(self, bg='#b3d9ff')
button_frame2.pack(fill = 'both', expand = True)
def temp():
pass
temp_button = tk.Button(button_frame,
text = 'Tempeture Graph',
font=("Times_New_Roman 12"),
command = temp,
relief = 'raised',
borderwidth = 3,
width = 16,
height = 4)
temp_button.grid(row = 0, column = 0, pady = 10, padx = 30)
def hum():
pass
hum_button = tk.Button(button_frame,
text = 'Humidity Graph',
font=("Times_New_Roman 12"),
command = hum,
relief = 'raised',
borderwidth = 3,
width = 16,
height = 4)
hum_button.grid(row = 0, column = 1, pady = 10, padx = 10)
def lig():
pass
lig_button = tk.Button(button_frame,
text='Light Graph',
font=("Times_New_Roman 12"),
command=hum,
relief='raised',
borderwidth=3,
width=16,
height=4)
lig_button.grid(row=1, column=0, pady=10, padx=10)
def vib():
pass
vib_button = tk.Button(button_frame,
text='Vibration Graph',
font=("Times_New_Roman 12"),
command=hum,
relief='raised',
borderwidth=3,
width=16,
height=4)
vib_button.grid(row=1, column=1, pady=10, padx=10)
def back1():
controller.show_frame('MotesPage')
back1_button = tk.Button(button_frame2,
text = 'Back',
font=("Times_New_Roman 15"),
command = back1,
relief = 'raised',
borderwidth = 3,
width = 10,
height = 2)
back1_button.grid(row = 0, column= 0, pady = 10, padx = 10)
text_window = tk.Frame(button_frame, pady =10, padx = 50)
text_window.configure(bg = '#b3d9ff')
text_window.grid(row=0, column=2, rowspan = 6, columnspan = 2, sticky = "nsew")
text = tk.Text(text_window, width = 50, height = 20, font = ("Times_New_Roman 15"))
text.grid(row=0, column=2, rowspan = 6, columnspan = 2, pady = 5, padx = 5)
scrollbar = tk.Scrollbar(text_window, command = text.yview)
text['yscroll'] = scrollbar.set
scrollbar.grid(row=0, column=4, rowspan = 6, sticky = "ns")
data_log = """Friedrich Wilhelm Nietzsche,
15 October 1844 – 25 August 1900) was a German philosopher,
cultural critic, composer, poet, writer, and philologist
whose work has exerted a profound influence on modern intellectual history.
He began his career as a classical philologist before turning to philosophy.
He became the youngest person ever to hold the Chair of Classical Philology
at the University of Basel in 1869 at the age of 24.[44] Nietzsche resigned in 1879
due to health problems that plagued him most of his life; he completed much of his core writing
in the following decade.[45] In 1889, at age 44, he suffered a collapse
and afterward a complete loss of his mental faculties. He lived his remaining years
in the care of his mother until her death in 1897 and then with his sister Elisabeth Förster-Nietzsche.
Nietzsche died in 1900.
Nietzsche's writing spans philosophical polemics, poetry, cultural criticism,
and fiction while displaying a fondness for aphorism and irony.[47] Prominent elements of his philosophy
include his radical critique of truth in favor of perspectivism; a genealogical critique of religion
and Christian morality and related theory of master–slave morality;[40][48][i] the aesthetic affirmation of life
in response to both the "death of God" and the profound crisis of nihilism;[40] the notion of Apollonian
and Dionysian forces; and a characterization of the human subject as the expression of competing wills,
collectively understood as the will to power.[49] He also developed influential concepts such as the Übermensch
and the doctrine of eternal return.[50][51] In his later work, he became increasingly preoccupied
with the creative powers of the individual to overcome cultural and moral mores in pursuit of new values
and aesthetic health.[43] His body of work touched a wide range of topics, including art, philology, history,
religion, tragedy, culture, and science, and drew inspiration from figures such as Socrates, Zoroaster,
Arthur Schopenhauer,[23] Ralph Waldo Emerson, Richard Wagner[23] and Johann Wolfgang von Goethe."""
text.insert(tk.INSERT,data_log)
class Mote2Page(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg='#b3d9ff')
self.controller = controller
self.controller.title("Data Visualization")
self.controller.geometry("1080x720")
self.controller.maxsize(1080, 720)
self.controller.minsize(1080, 720)
self.controller.iconbitmap("agriculture_plants_icon.ico")
self.controller.configure(bg="white")
self.controller.attributes("-topmost", 1)
heading_label2 = tk.Label(self,
text='Data Visualization - Mote2 Data',
font=("Times_New_Roman 20"),
fg='black',
bg='#b3d9ff')
heading_label2.pack(pady=50)
button_frame = tk.Frame(self, bg='#b3d9ff')
button_frame.pack(fill='both', expand=True)
button_frame2 = tk.Frame(self, bg='#b3d9ff')
button_frame2.pack(fill = 'both', expand = True)
def temp():
pass
temp_button = tk.Button(button_frame,
text = 'Tempeture Graph',
font=("Times_New_Roman 12"),
command = temp,
relief = 'raised',
borderwidth = 3,
width = 16,
height = 4)
temp_button.grid(row = 0, column = 0, pady = 10, padx = 30)
def hum():
pass
hum_button = tk.Button(button_frame,
text = 'Humidity Graph',
font=("Times_New_Roman 12"),
command = hum,
relief = 'raised',
borderwidth = 3,
width = 16,
height = 4)
hum_button.grid(row = 0, column = 1, pady = 10, padx = 10)
def lig():
pass
lig_button = tk.Button(button_frame,
text='Light Graph',
font=("Times_New_Roman 12"),
command=hum,
relief='raised',
borderwidth=3,
width=16,
height=4)
lig_button.grid(row=1, column=0, pady=10, padx=10)
def vib():
pass
vib_button = tk.Button(button_frame,
text='Vibration Graph',
font=("Times_New_Roman 12"),
command=hum,
relief='raised',
borderwidth=3,
width=16,
height=4)
vib_button.grid(row=1, column=1, pady=10, padx=10)
def back1():
controller.show_frame('MotesPage')
back1_button = tk.Button(button_frame2,
text = 'Back',
font=("Times_New_Roman 15"),
command = back1,
relief = 'raised',
borderwidth = 3,
width = 10,
height = 2)
back1_button.grid(row = 0, column= 0, pady = 10, padx = 10)
text_window = tk.Frame(button_frame, pady =10, padx = 50)
text_window.configure(bg = '#b3d9ff')
text_window.grid(row=0, column=2, rowspan = 6, columnspan = 2, sticky = "nsew")
text = tk.Text(text_window, width = 50, height = 20, font = ("Times_New_Roman 15"))
text.grid(row=0, column=2, rowspan = 6, columnspan = 2, pady = 5, padx = 5)
scrollbar = tk.Scrollbar(text_window, command = text.yview)
text['yscroll'] = scrollbar.set
scrollbar.grid(row=0, column=4, rowspan = 6, sticky = "ns")
data_log = """Friedrich Wilhelm Nietzsche,
15 October 1844 – 25 August 1900) was a German philosopher,
cultural critic, composer, poet, writer, and philologist
whose work has exerted a profound influence on modern intellectual history.
He began his career as a classical philologist before turning to philosophy.
He became the youngest person ever to hold the Chair of Classical Philology
at the University of Basel in 1869 at the age of 24.[44] Nietzsche resigned in 1879
due to health problems that plagued him most of his life; he completed much of his core writing
in the following decade.[45] In 1889, at age 44, he suffered a collapse
and afterward a complete loss of his mental faculties. He lived his remaining years
in the care of his mother until her death in 1897 and then with his sister Elisabeth Förster-Nietzsche.
Nietzsche died in 1900.
Nietzsche's writing spans philosophical polemics, poetry, cultural criticism,
and fiction while displaying a fondness for aphorism and irony.[47] Prominent elements of his philosophy
include his radical critique of truth in favor of perspectivism; a genealogical critique of religion
and Christian morality and related theory of master–slave morality;[40][48][i] the aesthetic affirmation of life
in response to both the "death of God" and the profound crisis of nihilism;[40] the notion of Apollonian
and Dionysian forces; and a characterization of the human subject as the expression of competing wills,
collectively understood as the will to power.[49] He also developed influential concepts such as the Übermensch
and the doctrine of eternal return.[50][51] In his later work, he became increasingly preoccupied
with the creative powers of the individual to overcome cultural and moral mores in pursuit of new values
and aesthetic health.[43] His body of work touched a wide range of topics, including art, philology, history,
religion, tragedy, culture, and science, and drew inspiration from figures such as Socrates, Zoroaster,
Arthur Schopenhauer,[23] Ralph Waldo Emerson, Richard Wagner[23] and Johann Wolfgang von Goethe."""
text.insert(tk.INSERT,data_log)
class Mote3Page(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent, bg='#b3d9ff')
self.controller = controller
self.controller.title("Data Visualization")
self.controller.geometry("1080x720")
self.controller.maxsize(1080, 720)
self.controller.minsize(1080, 720)
self.controller.iconbitmap("agriculture_plants_icon.ico")
self.controller.configure(bg="white")
self.controller.attributes("-topmost", 1)
heading_label2 = tk.Label(self,
text='Data Visualization - Mote3 Data',
font=("Times_New_Roman 20"),
fg='black',
bg='#b3d9ff')
heading_label2.pack(pady=50)
button_frame = tk.Frame(self, bg='#b3d9ff')
button_frame.pack(fill='both', expand=True)
button_frame2 = tk.Frame(self, bg='#b3d9ff')
button_frame2.pack(fill = 'both', expand = True)
def temp():
pass
temp_button = tk.Button(button_frame,
text = 'Tempeture Graph',
font=("Times_New_Roman 12"),
command = temp,
relief = 'raised',
borderwidth = 3,
width = 16,
height = 4)
temp_button.grid(row = 0, column = 0, pady = 10, padx = 30)
def hum():
pass
hum_button = tk.Button(button_frame,
text = 'Humidity Graph',
font=("Times_New_Roman 12"),
command = hum,
relief = 'raised',
borderwidth = 3,
width = 16,
height = 4)
hum_button.grid(row = 0, column = 1, pady = 10, padx = 10)
def lig():
pass
lig_button = tk.Button(button_frame,
text='Light Graph',
font=("Times_New_Roman 12"),
command=hum,
relief='raised',
borderwidth=3,
width=16,
height=4)
lig_button.grid(row=1, column=0, pady=10, padx=10)
def vib():
pass
vib_button = tk.Button(button_frame,
text='Vibration Graph',
font=("Times_New_Roman 12"),
command=hum,
relief='raised',
borderwidth=3,
width=16,
height=4)
vib_button.grid(row=1, column=1, pady=10, padx=10)
def back1():
controller.show_frame('MotesPage')
back1_button = tk.Button(button_frame2,
text = 'Back',
font=("Times_New_Roman 15"),
command = back1,
relief = 'raised',
borderwidth = 3,
width = 10,
height = 2)
back1_button.grid(row = 0, column= 0, pady = 10, padx = 10)
text_window = tk.Frame(button_frame, pady =10, padx = 50)
text_window.configure(bg = '#b3d9ff')
text_window.grid(row=0, column=2, rowspan = 6, columnspan = 2, sticky = "nsew")
text = tk.Text(text_window, width = 50, height = 20, font = ("Times_New_Roman 15"))
text.grid(row=0, column=2, rowspan = 6, columnspan = 2, pady = 5, padx = 5)
scrollbar = tk.Scrollbar(text_window, command = text.yview)
text['yscroll'] = scrollbar.set
scrollbar.grid(row=0, column=4, rowspan = 6, sticky = "ns")
data_log = """Friedrich Wilhelm Nietzsche,
15 October 1844 – 25 August 1900) was a German philosopher,
cultural critic, composer, poet, writer, and philologist
whose work has exerted a profound influence on modern intellectual history.
He began his career as a classical philologist before turning to philosophy.
He became the youngest person ever to hold the Chair of Classical Philology
at the University of Basel in 1869 at the age of 24.[44] Nietzsche resigned in 1879
due to health problems that plagued him most of his life; he completed much of his core writing
in the following decade.[45] In 1889, at age 44, he suffered a collapse
and afterward a complete loss of his mental faculties. He lived his remaining years
in the care of his mother until her death in 1897 and then with his sister Elisabeth Förster-Nietzsche.
Nietzsche died in 1900.
Nietzsche's writing spans philosophical polemics, poetry, cultural criticism,
and fiction while displaying a fondness for aphorism and irony.[47] Prominent elements of his philosophy
include his radical critique of truth in favor of perspectivism; a genealogical critique of religion
and Christian morality and related theory of master–slave morality;[40][48][i] the aesthetic affirmation of life
in response to both the "death of God" and the profound crisis of nihilism;[40] the notion of Apollonian
and Dionysian forces; and a characterization of the human subject as the expression of competing wills,
collectively understood as the will to power.[49] He also developed influential concepts such as the Übermensch
and the doctrine of eternal return.[50][51] In his later work, he became increasingly preoccupied
with the creative powers of the individual to overcome cultural and moral mores in pursuit of new values
and aesthetic health.[43] His body of work touched a wide range of topics, including art, philology, history,
religion, tragedy, culture, and science, and drew inspiration from figures such as Socrates, Zoroaster,
Arthur Schopenhauer,[23] Ralph Waldo Emerson, Richard Wagner[23] and Johann Wolfgang von Goethe."""
text.insert(tk.INSERT,data_log)
if __name__ == "__main__":
app = SampleApp()
app.mainloop() | 45.028777 | 121 | 0.52117 | 2,665 | 25,036 | 4.801876 | 0.124953 | 0.04376 | 0.027194 | 0.038525 | 0.930843 | 0.918497 | 0.905603 | 0.899117 | 0.890209 | 0.887552 | 0 | 0.048593 | 0.396669 | 25,036 | 556 | 122 | 45.028777 | 0.798213 | 0.001837 | 0 | 0.855556 | 0 | 0.026667 | 0.339964 | 0.005403 | 0 | 0 | 0 | 0 | 0 | 1 | 0.06 | false | 0.026667 | 0.004444 | 0 | 0.077778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
f809ee7c3f75547a5a8c1b48422176535696e24e | 701 | py | Python | Day3/3b.py | nint8835/AdventOfCode2019 | 7afd21eafba749761433594104f257b424bf7dce | [
"MIT"
] | 2 | 2019-12-07T21:34:55.000Z | 2019-12-07T22:19:07.000Z | Day3/3b.py | nint8835/AdventOfCode2019 | 7afd21eafba749761433594104f257b424bf7dce | [
"MIT"
] | null | null | null | Day3/3b.py | nint8835/AdventOfCode2019 | 7afd21eafba749761433594104f257b424bf7dce | [
"MIT"
] | null | null | null | print((a:=(w:=lambda m,x,y,p,s:w(m[1:],{"U":lambda m:x,"D":lambda m:x,"R":lambda m:x+m,"L":lambda m:x-m}[m[0][0]](int(m[0][1:])),{"U":lambda m:y+m,"D":lambda m:y-m,"R":lambda m:y,"L":lambda m:y}[m[0][0]](int(m[0][1:])),{**p,**({"U":lambda m:{(x,y+i):s+i for i in range(1,m+1) if (x,y+m)!=(0,0)},"D":lambda m:{(x,y-i):s+i for i in range(1,m+1) if (x,y-m)!=(0,0)},"R":lambda m:{(x+i,y):s+i for i in range(1,m+1) if (x+i,y)!=(0,0)},"L":lambda m:{(x-i,y):s+i for i in range(1,m+1) if (x-i,y)!=(0,0)}}[m[0][0]](int(m[0][1:])))},s+int(m[0][1:])) if len(m)!=0 else p)((f:=open("i").read().split("\n"))[0].split(","),0,0,{},0),sorted([s+a[c] for c,s in w(f[1].split(","),0,0,{},0).items() if c in a])[0])[1])
| 350.5 | 700 | 0.492154 | 198 | 701 | 1.742424 | 0.156566 | 0.263768 | 0.208696 | 0.069565 | 0.46087 | 0.46087 | 0.46087 | 0.382609 | 0.382609 | 0.382609 | 0 | 0.064516 | 0.071327 | 701 | 1 | 701 | 701 | 0.465438 | 0 | 0 | 0 | 0 | 0 | 0.024251 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 8 |
f88bf0ada230c866bc2e16c4dc07a441747dfb37 | 2,510 | py | Python | tests/dict/test_dict_generation.py | nikitanovosibirsk/blahblah | 17a1a6c1a4f2f5f8528090ee40d4a6be08ababa3 | [
"Apache-2.0"
] | null | null | null | tests/dict/test_dict_generation.py | nikitanovosibirsk/blahblah | 17a1a6c1a4f2f5f8528090ee40d4a6be08ababa3 | [
"Apache-2.0"
] | 1 | 2021-12-05T11:41:37.000Z | 2021-12-05T11:41:37.000Z | tests/dict/test_dict_generation.py | nikitanovosibirsk/blahblah | 17a1a6c1a4f2f5f8528090ee40d4a6be08ababa3 | [
"Apache-2.0"
] | null | null | null | from unittest.mock import call
from baby_steps import given, then, when
from district42 import optional, schema
from .._fixtures import * # noqa: F401, F403
from .._utils import schema_mock
def test_dict_generation(*, generate, random_):
with given:
sch = schema.dict
with when:
res = generate(sch)
with then:
assert res == {}
def test_dict_empty_keys_generation(*, generate, random_):
with given:
sch = schema.dict({})
with when:
res = generate(sch)
with then:
assert res == {}
def test_dict_keys_generation(*, generate, generator, random_):
with given:
type1_ = schema_mock(return_value=42)
type2_ = schema_mock(return_value="banana")
sch = schema.dict({
"id": type1_,
"name": type2_,
})
with when:
res = generate(sch)
with then:
assert res == {
"id": 42,
"name": "banana",
}
assert random_.mock_calls == []
assert type1_.mock_calls == [call.__accept__(generator)]
assert type2_.mock_calls == [call.__accept__(generator)]
def test_dict_relaxed_empty_keys_generation(*, generate, random_):
with given:
sch = schema.dict({...: ...})
with when:
res = generate(sch)
with then:
assert res == {}
def test_dict_relaxed_keys_generation(*, generate, generator, random_):
with given:
type1_ = schema_mock(return_value=42)
type2_ = schema_mock(return_value="banana")
sch = schema.dict({
"id": type1_,
"name": type2_,
...: ...
})
with when:
res = generate(sch)
with then:
assert res == {
"id": 42,
"name": "banana",
}
assert random_.mock_calls == []
assert type1_.mock_calls == [call.__accept__(generator)]
assert type2_.mock_calls == [call.__accept__(generator)]
def test_dict_with_optional_key_generation(*, generate, generator, random_):
with given:
type1_ = schema_mock(return_value=42)
type2_ = schema_mock(return_value="banana")
sch = schema.dict({
"id": type1_,
optional("name"): type2_,
})
with when:
res = generate(sch)
with then:
assert res == {"id": 42}
assert random_.mock_calls == []
assert type1_.mock_calls == [call.__accept__(generator)]
assert type2_.mock_calls == []
| 23.904762 | 76 | 0.576096 | 272 | 2,510 | 4.966912 | 0.158088 | 0.059956 | 0.048853 | 0.084382 | 0.855662 | 0.855662 | 0.855662 | 0.855662 | 0.855662 | 0.855662 | 0 | 0.021814 | 0.305976 | 2,510 | 104 | 77 | 24.134615 | 0.753731 | 0.006375 | 0 | 0.74359 | 0 | 0 | 0.02488 | 0 | 0 | 0 | 0 | 0 | 0.192308 | 1 | 0.076923 | false | 0 | 0.064103 | 0 | 0.141026 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
f8b8f7054c7d06ea41a5714f828e208da37cd076 | 7,216 | py | Python | Judger/tests/Python_and_core/testcase/seccomp/test.py | YuliNet/OnlineJudge_BasedOnQDU | cbd7be5e56bab56a4c819f37ea9c735e3b366e42 | [
"MIT"
] | 19 | 2020-06-17T13:57:51.000Z | 2022-01-06T10:24:49.000Z | Judger/tests/Python_and_core/testcase/seccomp/test.py | YuliNet/OnlineJudge_BasedOnQDU | cbd7be5e56bab56a4c819f37ea9c735e3b366e42 | [
"MIT"
] | 26 | 2020-06-18T03:11:13.000Z | 2022-03-12T00:36:02.000Z | Judger/tests/Python_and_core/testcase/seccomp/test.py | YuliNet/OnlineJudge_BasedOnQDU | cbd7be5e56bab56a4c819f37ea9c735e3b366e42 | [
"MIT"
] | 11 | 2020-06-17T03:32:17.000Z | 2020-12-18T06:01:15.000Z | # coding=utf-8
from __future__ import print_function
import _judger
import signal
import shutil
import os
from .. import base
class SeccompTest(base.BaseTestCase):
def setUp(self):
print("Running", self._testMethodName)
self.workspace = self.init_workspace("integration")
def _compile_c(self, src_name, extra_flags=None):
return super(SeccompTest, self)._compile_c("../../test_src/seccomp/" + src_name, extra_flags)
def test_fork(self):
config = self.base_config
config["exe_path"] = self._compile_c("fork.c")
config["output_path"] = config["error_path"] = self.output_path()
result = _judger.run(**config)
# without seccomp
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
# with c_cpp seccomp
config["seccomp_rule_name"] = "c_cpp"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
def test_execve(self):
config = self.base_config
config["exe_path"] = self._compile_c("execve.c")
config["output_path"] = config["error_path"] = self.output_path()
result = _judger.run(**config)
# without seccomp
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
self.assertEqual("Helloworld\n", self.output_content(config["output_path"]))
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
# with c_cpp seccomp
config["seccomp_rule_name"] = "c_cpp"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
def test_write_file_using_open(self):
config = self.base_config
config["exe_path"] = self._compile_c("write_file_open.c")
config["output_path"] = config["error_path"] = self.output_path()
path = os.path.join(self.workspace, "file1.txt")
config["args"] = [path, "w"]
result = _judger.run(**config)
# without seccomp
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
self.assertEqual("", self.output_content(path))
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
# with c_cpp seccomp
config["seccomp_rule_name"] = "c_cpp"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
def test_read_write_file_using_open(self):
config = self.base_config
config["exe_path"] = self._compile_c("write_file_open.c")
config["output_path"] = config["error_path"] = self.output_path()
path = os.path.join(self.workspace, "file2.txt")
config["args"] = [path, "w+"]
result = _judger.run(**config)
# without seccomp
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
self.assertEqual("", self.output_content(path))
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
# with c_cpp seccomp
config["seccomp_rule_name"] = "c_cpp"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
def test_write_file_using_openat(self):
config = self.base_config
config["exe_path"] = self._compile_c("write_file_openat.c")
config["output_path"] = config["error_path"] = self.output_path()
path = os.path.join(self.workspace, "file3.txt")
config["args"] = [path, "w"]
result = _judger.run(**config)
# without seccomp
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
self.assertEqual("", self.output_content(path))
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
# with c_cpp seccomp
config["seccomp_rule_name"] = "c_cpp"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
def test_read_write_file_using_openat(self):
config = self.base_config
config["exe_path"] = self._compile_c("write_file_openat.c")
config["output_path"] = config["error_path"] = self.output_path()
path = os.path.join(self.workspace, "file4.txt")
config["args"] = [path, "w+"]
result = _judger.run(**config)
# without seccomp
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
self.assertEqual("", self.output_content(path))
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
# with c_cpp seccomp
config["seccomp_rule_name"] = "c_cpp"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
def test_sysinfo(self):
config = self.base_config
config["exe_path"] = self._compile_c("sysinfo.c")
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
def test_exceveat(self):
config = self.base_config
config["exe_path"] = self._compile_c("execveat.c")
config["output_path"] = config["error_path"] = self.output_path()
result = _judger.run(**config)
if "syscall not found" in self.output_content(config["output_path"]):
print("execveat syscall not found, test ignored")
return
self.assertEqual(result["result"], _judger.RESULT_SUCCESS)
# with general seccomp
config["seccomp_rule_name"] = "general"
result = _judger.run(**config)
self.assertEqual(result["result"], _judger.RESULT_RUNTIME_ERROR)
self.assertEqual(result["signal"], self.BAD_SYSTEM_CALL)
| 41.234286 | 101 | 0.652993 | 848 | 7,216 | 5.264151 | 0.095519 | 0.112903 | 0.159946 | 0.09879 | 0.894041 | 0.894041 | 0.880152 | 0.878584 | 0.878584 | 0.878584 | 0 | 0.000882 | 0.214385 | 7,216 | 174 | 102 | 41.471264 | 0.786558 | 0.051136 | 0 | 0.748032 | 0 | 0 | 0.147985 | 0.00337 | 0 | 0 | 0 | 0 | 0.307087 | 1 | 0.07874 | false | 0 | 0.047244 | 0.007874 | 0.149606 | 0.023622 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
f8bd09ba4d53da46b24c5db1b278e51afaa78974 | 4,836 | py | Python | executor/network_setup.py | samueljero/TCPwn | 8514a9fa53123e4abe45460d008de2f5d91500f8 | [
"BSD-3-Clause"
] | 14 | 2018-02-20T07:11:40.000Z | 2021-09-23T08:31:59.000Z | executor/network_setup.py | samueljero/TCPwn | 8514a9fa53123e4abe45460d008de2f5d91500f8 | [
"BSD-3-Clause"
] | 1 | 2018-08-18T23:06:53.000Z | 2018-08-21T00:01:06.000Z | executor/network_setup.py | samueljero/TCPwn | 8514a9fa53123e4abe45460d008de2f5d91500f8 | [
"BSD-3-Clause"
] | 9 | 2017-12-01T15:45:18.000Z | 2020-04-14T02:42:32.000Z | #!/usr/bin/env python
# Samuel Jero <sjero@purdue.edu>
# Network setup script
import os
import argparse
import sys
user = os.getlogin()
def do_network(cmd, num):
global user
if cmd == "start":
#Host bridge
os.system("sudo brctl addbr brhost")
os.system("sudo ifconfig brhost 10.0.0.1 netmask 255.255.0.0 up")
os.system("touch /tmp/ip-mac")
os.system("echo \"\" >> /tmp/ip-mac")
#Host VM taps and DHCP config
for i in range(0,6):
os.system("sudo tunctl -u {0} -t tap-n{1}-h{2}".format(user, str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-h{1} 0.0.0.0 up".format(str(num),str(i)))
os.system("sudo brctl addif brhost tap-n{0}-h{1}".format(str(num),str(i)))
os.system("echo \"10.0.1.{:d} 00:00:00:01:00:{:02X}\" >> /tmp/ip-mac".format((num-1)*6+i+1,(num-1)*6+i+1))
#Create Bridges
os.system("sudo brctl addbr br-n{0}-1".format(str(num)))
os.system("sudo brctl addbr br-n{0}-2".format(str(num)))
os.system("sudo brctl addbr br-n{0}-3".format(str(num)))
os.system("sudo ifconfig br-n{0}-1 up".format(str(num)))
os.system("sudo ifconfig br-n{0}-2 up".format(str(num)))
os.system("sudo ifconfig br-n{0}-3 up".format(str(num)))
os.system("sudo ifconfig br-n{0}-1 txqueuelen 50".format(str(num)))
os.system("sudo ifconfig br-n{0}-2 txqueuelen 50".format(str(num)))
os.system("sudo ifconfig br-n{0}-3 txqueuelen 50".format(str(num)))
#Create Main Network
for i in range(0,3):
os.system("sudo tunctl -u {0} -t tap-n{1}-b1-h{2}".format(user, str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-b1-h{1} 0.0.0.0 up".format(str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-b1-h{1} txqueuelen 50".format(str(num),str(i)))
os.system("sudo brctl addif br-n{0}-1 tap-n{0}-b1-h{1}".format(str(num),str(i)))
for i in range(0,3):
os.system("sudo tunctl -u {0} -t tap-n{1}-b2-h{2}".format(user, str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-b2-h{1} 0.0.0.0 up".format(str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-b2-h{1} txqueuelen 50".format(str(num),str(i)))
os.system("sudo brctl addif br-n{0}-2 tap-n{0}-b2-h{1}".format(str(num),str(i)))
for i in range(0,2):
os.system("sudo tunctl -u {0} -t tap-n{1}-b3-h{2}".format(user, str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-b3-h{1} 0.0.0.0 up".format(str(num),str(i)))
os.system("sudo ifconfig tap-n{0}-b3-h{1} txqueuelen 50".format(str(num),str(i)))
os.system("sudo brctl addif br-n{0}-3 tap-n{0}-b3-h{1}".format(str(num),str(i)))
#Restart DHCP
os.system("sudo /usr/local/sbin/restart-dhcpd < /tmp/ip-mac")
elif cmd == "stop":
#Remove main network
for i in range(0,3):
os.system("sudo ifconfig tap-n{0}-b1-h{1} down".format(str(num),str(i)))
os.system("sudo brctl delif br-n{0}-1 tap-n{0}-b1-h{1}".format(str(num),str(i)))
os.system("sudo tunctl -d tap-n{1}-b1-h{2}".format(user, str(num),str(i)))
for i in range(0,3):
os.system("sudo ifconfig tap-n{0}-b2-h{1} down".format(str(num),str(i)))
os.system("sudo brctl delif br-n{0}-2 tap-n{0}-b2-h{1}".format(str(num),str(i)))
os.system("sudo tunctl -d tap-n{1}-b2-h{2}".format(user, str(num),str(i)))
for i in range(0,2):
os.system("sudo ifconfig tap-n{0}-b3-h{1} down".format(str(num),str(i)))
os.system("sudo brctl delif br-n{0}-3 tap-n{0}-b3-h{1}".format(str(num),str(i)))
os.system("sudo tunctl -d tap-n{1}-b3-h{2}".format(user, str(num),str(i)))
#Remove Bridges
os.system("sudo ifconfig br-n{0}-1 down".format(str(num)))
os.system("sudo ifconfig br-n{0}-2 down".format(str(num)))
os.system("sudo ifconfig br-n{0}-3 down".format(str(num)))
os.system("sudo brctl delbr br-n{0}-1".format(str(num)))
os.system("sudo brctl delbr br-n{0}-2".format(str(num)))
os.system("sudo brctl delbr br-n{0}-3".format(str(num)))
#Remove VM taps
for i in range(0,6):
os.system("sudo ifconfig tap-n{0}-h{1} down".format(str(num),str(i)))
os.system("sudo brctl delif brhost tap-n{0}-h{1}".format(str(num),str(i)))
os.system("sudo tunctl -d tap-n{1}-h{2}".format(user, str(num),str(i)))
#Remove Host Bridge
os.system("sudo ifconfig brhost down")
os.system("sudo brctl delbr brhost")
#Cleanup DHCP
os.system("rm /tmp/ip-mac")
else:
return False
return True
if __name__ == "__main__":
if len(sys.argv)!= 4:
print "Usage: network_setup.py start|stop start end"
sys.exit()
cmd = sys.argv[1]
start = int(sys.argv[2])
end = int(sys.argv[3]) + 1
for i in range(start, end):
do_network(cmd, i)
| 48.848485 | 109 | 0.592225 | 918 | 4,836 | 3.107843 | 0.11329 | 0.143007 | 0.197687 | 0.094637 | 0.794252 | 0.740273 | 0.740273 | 0.733964 | 0.71749 | 0.695408 | 0 | 0.052551 | 0.193342 | 4,836 | 98 | 110 | 49.346939 | 0.6788 | 0.04818 | 0 | 0.101266 | 0 | 0.151899 | 0.384749 | 0.006318 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.037975 | null | null | 0.012658 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
3e74e7721167d64c2035fc92105afe8adbad0d0c | 7,486 | py | Python | main.py | yasouysal/Subtitle-Recognition | 9b011071ce74a345c7e1fa16e5374a4bf3cc04a0 | [
"Apache-2.0"
] | 1 | 2022-03-19T20:14:16.000Z | 2022-03-19T20:14:16.000Z | main.py | yasouysal/Subtitle-Recognition | 9b011071ce74a345c7e1fa16e5374a4bf3cc04a0 | [
"Apache-2.0"
] | null | null | null | main.py | yasouysal/Subtitle-Recognition | 9b011071ce74a345c7e1fa16e5374a4bf3cc04a0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from ExperimentSuite import ExperimentSuite
import tensorflow as tf
from Preprocessor import Preprocessor
from Vectorizer import Vectorizer
import OneHotEncoder
import numpy as np
DEFAULT_EPOCH = 75
DEFAULT_LAYERS = (512,)
DEFAULT_ACTIVATION = tf.nn.relu
DEFAULT_LOSS = "categorical_hinge"
if __name__ == "__main__":
# TODO: Make your experiments here
es = ExperimentSuite()
# p = Preprocessor()
# p.preprocess()
# print "preprocess is done"
# V1 = Vectorizer(3, 0.97, 0.5)
# V1.fit(es.train_contents)
# V2 = Vectorizer(3, 0.97, 0.25)
# V2.fit(es.train_contents)
V3 = Vectorizer(3, 0.97, 0.1)
V3.fit(es.train_contents)
# print "vectorizer-fit is done"
# existance_vectorized_train_data_V1 = V1.transform(es.train_contents, "existance")
# existance_vectorized_test_data_V1 = V1.transform(es.test_contents, "existance")
# count_vectorized_train_data_V1 = V1.transform(es.train_contents, "count")
# count_vectorized_test_data_V1 = V1.transform(es.test_contents, "count")
# tf_idf_vectorized_train_data_V1 = V1.transform(es.train_contents, "tf-idf")
# tf_idf_vectorized_test_data_V1 = V1.transform(es.test_contents, "tf-idf")
# existance_vectorized_train_data_V2 = V2.transform(es.train_contents, "existance")
# existance_vectorized_test_data_V2 = V2.transform(es.test_contents, "existance")
# count_vectorized_train_data_V2 = V2.transform(es.train_contents, "count")
# count_vectorized_test_data_V2 = V2.transform(es.test_contents, "count")
# tf_idf_vectorized_train_data_V2 = V2.transform(es.train_contents, "tf-idf")
# tf_idf_vectorized_test_data_V2 = V2.transform(es.test_contents, "tf-idf")
# existance_vectorized_train_data_V3 = V3.transform(es.train_contents, "existance")
# existance_vectorized_test_data_V3 = V3.transform(es.test_contents, "existance")
# count_vectorized_train_data_V3 = V3.transform(es.train_contents, "count")
# count_vectorized_test_data_V3 = V3.transform(es.test_contents, "count")
tf_idf_vectorized_train_data_V3 = V3.transform(es.train_contents, "tf-idf")
tf_idf_vectorized_test_data_V3 = V3.transform(es.test_contents, "tf-idf")
tbCallBack = tf.keras.callbacks.TensorBoard(log_dir='./Graph', histogram_freq=0,
write_graph=True, write_images=True)
# print "transform and callback is done"
# result1 = es.train_model(DEFAULT_LAYERS, tbCallBack, existance_vectorized_train_data_V1, es.train_y, existance_vectorized_test_data_V1,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result1
# result2 = es.train_model(DEFAULT_LAYERS, tbCallBack, count_vectorized_train_data_V1, es.train_y, count_vectorized_test_data_V1,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result2
# result3 = es.train_model(DEFAULT_LAYERS, tbCallBack, tf_idf_vectorized_train_data_V1, es.train_y, tf_idf_vectorized_test_data_V1,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result3
# result4 = es.train_model(DEFAULT_LAYERS, tbCallBack, existance_vectorized_train_data_V2, es.train_y, existance_vectorized_test_data_V2,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result4
# result5 = es.train_model(DEFAULT_LAYERS, tbCallBack, count_vectorized_train_data_V2, es.train_y, count_vectorized_test_data_V2,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result5
# result6 = es.train_model(DEFAULT_LAYERS, tbCallBack, tf_idf_vectorized_train_data_V2, es.train_y, tf_idf_vectorized_test_data_V2,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result6
# result7 = es.train_model(DEFAULT_LAYERS, tbCallBack, existance_vectorized_train_data_V3, es.train_y, existance_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result7
# result8 = es.train_model(DEFAULT_LAYERS, tbCallBack, count_vectorized_train_data_V3, es.train_y, count_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result8
# result9 = es.train_model(DEFAULT_LAYERS, tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result9
#
#
# bu 3lü countu farklı layerlarla test etmek icin
# result2 = es.train_model((512,), tbCallBack, count_vectorized_train_data_V3, es.train_y, count_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result2
# result5 = es.train_model((512,256,), tbCallBack, count_vectorized_train_data_V3, es.train_y, count_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result5
# result8 = es.train_model((512,256,128), tbCallBack, count_vectorized_train_data_V3, es.train_y, count_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result8
#
#
#
# result3 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result3
# result6 = es.train_model((512,256,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result6
# result9 = es.train_model((512,256,128), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, DEFAULT_LOSS, DEFAULT_ACTIVATION, DEFAULT_EPOCH)
# print result9
# result1 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, 'categorical_hinge', tf.nn.relu, DEFAULT_EPOCH)
# print result1
# result2 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, 'categorical_crossentropy', tf.nn.relu, DEFAULT_EPOCH)
# print result2
# result3 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, 'categorical_hinge', tf.nn.tanh, DEFAULT_EPOCH)
# print result3
# result4 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, 'categorical_crossentropy', tf.nn.tanh, DEFAULT_EPOCH)
# print result4
# result5 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, 'categorical_hinge', tf.nn.sigmoid, DEFAULT_EPOCH)
# print result5
# result6 = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
# es.test_y, 'categorical_crossentropy', tf.nn.sigmoid, DEFAULT_EPOCH)
# print result6
result = es.train_model((512,), tbCallBack, tf_idf_vectorized_train_data_V3, es.train_y, tf_idf_vectorized_test_data_V3,
es.test_y, 'categorical_crossentropy', tf.nn.sigmoid, 500)
print result
| 45.369697 | 141 | 0.746326 | 1,047 | 7,486 | 4.905444 | 0.092646 | 0.076324 | 0.093458 | 0.077687 | 0.866044 | 0.852804 | 0.832749 | 0.806854 | 0.763435 | 0.643107 | 0 | 0.034143 | 0.15883 | 7,486 | 164 | 142 | 45.646341 | 0.781483 | 0.794016 | 0 | 0 | 0 | 0 | 0.047091 | 0.016621 | 0 | 0 | 0 | 0.006098 | 0 | 0 | null | null | 0 | 0.285714 | null | null | 0.047619 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
3e8064f1b14cd0f02b2908b78554eacc91bcb521 | 33,367 | py | Python | SCTF/2018 Finals/poly_pkc/solver.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | 1 | 2021-08-24T22:16:41.000Z | 2021-08-24T22:16:41.000Z | SCTF/2018 Finals/poly_pkc/solver.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | SCTF/2018 Finals/poly_pkc/solver.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | from Crypto.Util.number import long_to_bytes as l2b
order = 51
pub = [71310390893489944689496023538384590273480479577790659364289683346165713044517659824375418132621317272871004005705874716794106720299606351251857326868794687420678580513921323592626585428109604324817801257245994766462530696504897491647112793017094053700776353394558598875425321551598027446836612401496552702369L, 24141387205628359588751027036536471952710266387706490099467990572318163253735471351854583392464994484437088745521928566631489844630483073950579141140807033279671624978051983600714150455576997894708411771506138712743160749468496347236675843493265683988991881970104822488071226376954287596558379843269258673632L, 22077500239906997464936234955234405655024838193867195162620369185622309814798579048742627287241968477343923463563816692763090520803915604490292617102998892379119992893359730759109318371382623232822368105203185170025000718359551377444154850503968282914138968484715902087713954518913373417432771110357970999831L, 72457056123145550654596267474159384058863312163351774948503351729011706448464216358681723824789324679161471856941975301836693949350751290844960927590076709407691889391388362203121820585282356217170795588644809669765484228173165014249978452470988364692489229811036078513644083069424465944523107252313974864368L, 48577670254977119445125852977814252561688757173518153326532315704504998543288520950331034681415056311372282609883876916648404751724574949644958648236978842214483177332972067072386909733967065638336879380074628622045094886590726326422920464595076275425270599509792009400755045970306505515258443378952586687884L, 44078127712731617518797775823587919527003266781907072937636200613557642895182883399705041127897698761804405015972089854194752256938913877813854685871106269456699479440854843003572658048897174520195257153984496669936184384360099373112905917124953820629407265901225527192398797076341840558574166015652173972027L, 47737341768615611989474767468336881069364646967102494593327821423987110744140135672628733122238522952431057266412637208661104653432652268370428222665975655603928922856009787200783007658806201096628326074404176671384850164485718090712565771849529134651216889984791646498274070900704723736995542791612101365114L, 4002529870390887026639971372751150951272622337668297839051137375574283117399655226439714017500924796563106320419817040033348862498083919794421197191551234967984298526486950274733554844509076212817732136348708616858481015693982014720121127744292278451310326600251375925359631012185488350421207620584509930639L, 75568681305958306288622209291044326842816499791488488094868335376719310936038920526907677123120643093691747415913700898303933696999883681650352949997111769926130528756898004879910001752205825976761182786388978199575046649252073822681738109917566792593624806293328756933519946894575096740938824650418508130324L, 32538863044267365748399930232623314638256327042908819314743382578440151821292017909099781113373745165258584171893143891418977939438603575775028583963285455789275554054186885439075795650958946990021633184810033369142960854154577310049965593398967530929911718774008063022400507028056342174049096476573873091601L, 45794078256399553073763833842231672652583353407495412062445532036451308599363717338470619561387944964442843351679074104383479967978087386158840871805435180772527923098518573293357421807680694471845496463356441743613898165324076396793527652466115825563452470228896727884303421022289353204502967577359860193399L, 16031474714518210241225441434775064923222040124725285370943592899268220168631275856827638689834431405955642143564226554636019959182865419615106784159637801995437287494686842267181405818421765687890679137486261080504971500510619491104525076299192794882252125741170181842951276980583581790939088856451106699305L, 39460742712080822219514399306888316402722197500604458068428812144189872629035018934189445003561671886882459510438917634379943778766621414614031700325211773398344597638032281453270764480473329052706728424538314979169619191263274539969940284585792065432989314406313991620808737176677401996958910380809218948244L, 10304323604438901360992974089410399431036122894857369813825396461743783752473290891342575182176667799590536449574837726328224002728249464155953176362587419364162787534648767328327373953380118656233683199036989982305380281362393410188509370330884478709843651861090950511442255123284208948934286949055567408237L, 77149840322651828237709098903890230384823272930821388295755657060164261950699872531729234617602305243602693248422604111065460549817053858783659213832152143692173366151548930454205109713827225932484797731378041794652689999187750137056695069284294999512158727612155919290755142841552814044435903251063440942589L, 17391714876640004401732207434539329608339200349365270134011976497493507572023295002090379547926335620151708575682128651662938044572791739126685154028047797927974003716123069190477046508408304556391721741432450560073094567650148455647857817784653359153379625372113710110575664970003550731332308941235712175033L, 27713827604642233172543550572725037577921681912985626668730282382270576769149653665422639471074138354609707917813559953523816778142574214304342573868588628365575046964804860993723626104355226918042609526293081903563248846722781510189225660577248761035674716708010594984530113241757649105442917888185244150800L, 35336970319909961780280367849484457965718823581032529539403240522551068747145674887259044933968175510266601827869440881970597534108607122800320283735644141944874511944805556608325546375244896836508297286504018669213501391312415387741756207348865774345214033094121336067405878563109263838371820063426981638585L, 24734606481052435359275566693041095351672345904705308942507092918801459171579107070507546425891710814291454550093710704205188384536081020760524419264185113643281696218363075521141383732290918854478084593612609906452855216663134256560515375193725705029274571735127978841321450286368222932561644701485911449469L, 62067320616318134017488189638639902595577036786069492413059252628760274339275315498367462702207867388494803149470250816106095447419214096641671537584082923572280975208583430102029234613834766389657874106322161490567841630776641436689319288368624034782131897907695433250428510400740818950941848162794403874811L, 51883220639675205132281801645085158412041091335773050196174238534484711920621551045666842513106803074970952612431330748515849380630896578953503062724315594753769190437508431573304209222475176888199304477935075106551603838923907004679697427820044050038026382318948010081114898635221964309022080286270478558776L, 75710517529765825029085198795420894643441830408688136455034238329507115725584034403601624256988627065489769702389786587470886525691484798577035359830148429402218251972266801376648088649385344154092992458520478265316906736566481523337678435876158319846163226622491702133792789018376245704616939403970904411395L, 15464586606645692816229270262921644023921122370195594987292231656381172624362100247950903179880598634546969534347735917598489983915010794426933457754786105940660425568494876035415750250842777703147306971013162603686194710534272469490630022383159902476068117014193083780225606896870061063825620574543752292700L, 78089122434435669955925370605689338753785452758272574683220997714762566025195411313374856999568269598232447792048336133482921631282708362012684409330814385934244846290265720961408826064723705785066567768787839686954554856173854537391795254450861027393222730588109148049206016964667002689539008340323664885359L, 71951818945948617521248773403191569896359606874084303828176754675563649523711699289537370195376455971294814122663298486519041129811873038471101162680485608545911866253158917969666518057207531692598489787455769853261772087020291159277022870255311154312275307950910553047012059852579004786082800238686429512777L, 58938713916871472455566043063853615645740396536692930808657044739525256997295633621559342790900094411194727550397387212155711319882544011956232556089218781398524290822647897434630877965928061515465565098211739630857853676191561926655040641498538488659650500518388833790532713664929052785406039487838877091297L, 44664321377698973638841814763484899274434184257513461030658452050320428053557970549349267878380831105385724005556492976795980802452404194167363625780647190571259070409873819763531262450969915194771511294833115837721352797298876422453305734185016601707293795227525653517143535748428069461084148787524145047438L, 63799367473009844534301898148535677286081712650575820122893429547704646423542417403905792053322882841335517442413418679055240101931121250819333440482425485440634553735778933349938561887239565709282115331824370149872419904552242060697499165204467299841847533768250457472485278005703081209326606249585216411956L, 58361426936203728307914293089893050662860935511977980975993139548910350663724520273966242325899350515580833870505874465310555014182690180579118874322263948892861668844386429625243771831278535689815081217163232656474916436234666437014663491114371136619007314924661231823685964112412805950443365651587064293181L, 38502482019580648802047619460715183833053812791946368337054856304759253207555156975144554915086269706154071148600294098134982313240203089339600372018764584209347289060209536026897153898092680786137799831556652059645498645832748623098175636638216925619218229314963046620794012329966551651242238874863577001065L, 30775583588666463836164415169966670272946352651789361787076273064326608180183659036809029894617736769425133024205406213231925182519405747070260367733702092955058090436664362338369260964633648142328757085211081896726633732946492818276750359391396253116926578718971573009649879691633776943515751894968580978396L, 68465816999969910755471231711623259936791775540307584746265126863816731129399446645205997289176160234544177136234030810739201218613880822542177205034636589823405281172869751065528306994194477800256183022345363040548554033401298866206279598519192393967156378156232292662846437538976434786594031896083065491928L, 61081832900481294116815285199874307475172479742469410762163322553789306896511091910141710304510339024384415930294206053861933863739414662156458118762495518664598531553344335817526055854541434231042366053852377456235419436764466417350359716660535200425387885097758817839856378090354865628935052713042694019440L, 49082636650229277586829153865115886757875566376813395623038639109974596665322270986407229727144012435578094070900680890172298030220423418861061833534079131702580488354075824497339662635661005898100985560943933386025555063777714202720446267591686832512089185268901409105664120595913431433876629827977751465288L, 18444953794823582694488009659293758147416191135845368377615585715640146125273275477977900580764682284276120217331470740857178702213069257790397585731829419281986746356644487824870253045529205122996770273964198038576945667817645166478663884280311318667805211085214597623170599871423497235067814775699526952077L, 65236552810686147389780549578961797376799154878308182733602112638617269998221740463666882463361348792824155237894484170868928051681012016257509479292757847900970692617366816725292260248497262051494536295577073140047750954554163764478488926519911195772410309525681037558128594298788683854873253973443190000058L, 53348707220974123150298981921348346678552212087195179801307878610183238159377696327277848317228935808249647135724622598923135415367730427314604212425170120696293175255936937356062730403131273408652409238783781234701739380917709513794806233495013529862771513011439854516081026555975745429191032053162655262178L, 48209881274937573366852292336224881837373191458562526783628306179349123008236819670938130702197815580512468949113240774200476231365308501866489764298340889860542319283168731151700575583798587808770239174407812396972296005964769856711326589673687255070328982288201450435313232421342040484213298433512080382558L, 68006389703777117477895896018876106216697050217166098755679008288128619031782886697136862886739171885342101720787338149292323223408107799777299795888902008619818827713700137174191466091105689822991623901324679684451894347790213794745078255970637433379950204504553614821505080082559680690963085425668882379962L, 14648442321955369711034065800441148780997295125978983768906939168054816408659130086306304448285929337033435791245793543584136898760089416592781059503710824232186534631927328321537833416776512861612946696734384745278792690715502284052182654953569163435960600778079497573025793841035009911134521179618127163819L, 44416966969909122403163614957247039480001588259960992495145497232377129527240422802732284512093641752619839581513893935978021369685519370533163762504630722394027379640388901571003544428184886656124439909426327383783649871260696805079734199489084076867149219242736578110493351816856764860792952909619344496348L, 13451408963930854949081970794812900198468392898690043890170934009952009827470556346578701971789263503258608788568862887170131215830187820299194962039186660689643107431754613040433292474946062293204686958703325402644208596896774834300969887299851179972514564650311254017858517195883201729000298385035618115093L, 20800365686434261037761971050040057313910719265879962533655654448603118170483051517138824927836291164443218742639800238676988482882052477735820623635285634593617977934018812994826297266122518586074726900173871344103522945270290547607144829464820298365500885220903507741786645154686141006546095675867975301359L, 42753687335598518736671274488463982824427970662218770074085682171705986812793202104712313672000015192809570362110242122505831660499307032521593996842168833340058322281996106427652566694762523711673928174363985235774664353144757387089613006005718963234272620418789709926255893761366063635490577321418833346026L, 73073958871393891393295131075472467427692260141821677794483302822330155584200002261139010601176194938374997653882030164904875028151328529704154199809274975733960205081508650127180523165326617099679895414078249600409547449341515462611711374351234729845894491732835881709993131421804384186368283626295974440973L, 70155878761556807262496424315378843984719416366855399008906632787387302505531419352059761033765212622002237008019381862258069218211525800583075998727448949475639971821011913200887968855737884453144710426585669983669393402792266690019081564240781361353603575838413625426741989360257223803021335108709539863458L, 55807474346103433281945045643033209078490261942694957690618548108755176277766731675194905619973323671091803538376685394950005892731841023444761484289908915272605688675857050105801152861923558342890204802652147980899969939263324525018089151278318784038293937727690934897440991323753665060410975210500014060390L, 23921994357951332890898145649528057546678459611884716341647968811419453752297097583261581880217017016870117904987092954376956861175980889272449402630655646568820375466822365100878620223501398444575374321530710648977132975084320574027080118718582841604028911779406179912056125219443577905695845956096727289486L, 77344549488074377667078227430574905900945042745787929516672662681878404229110627292685948814501614931517321225449716724851573244424119213885966689238700873292499604910322501227314794258010587294780411039987349891567128911277253214587092650466336627569758813433910536077533366196448799851872158181079771963124L, 68059793446089724876861682152904792072377943302119283420393297969271405018676997105703930991157156501926855849587801348357535098046811172203493205203940009327611519088815740995375576540540416153633633919854511126718245620730523090605620155215921135602743987434962651211579984572006763435196140512125768205843L, 57404341477592698173183149505690470518385241949508350998984059381962290471781763965824456498909291880574629881205134831160111132249197036709902155090698915326002006317599860380884352451116615391392313844498073402690529299237438024792491682746432779119799047404428327583137074383940110169693268268945967835540L]
N = 79549130611975274962216946810352793995031716614472758601024408226103952732146159665707263650545202678032278075336739155558714716276046914546683651625430305061198720705416406257769124576572194162961791938851242713989594293270537302363247962611005560085096617122206721658379222684525014387207908766505569360713
enc = [58854881384831016012673965500537325086235422048472577140482275831941202525176628981254094877293736513758238189964610163017736585864933314852895935870114140657716445182469814471354969811224935899411923101598027730428124525640248527580340901787519450987160996735491502122317881083703743230431468080663520428230L, 78353453709725130568907024394064381606234733338077051774777170966451955074530644587153614818613862456038670269573901249447358177244653014484119663509707033461871071587700062610368291858824751599751583931686529231449347921774123944067097223151629752382736953840738003890054896534780680410235357912543497554297L, 39392878974925830148634599637538056340264728060320826322171940287147522025015620067401515530186128023954133569253303268753406162819153281431802052737284947294171219682486639223111310136745090276427175526928551795880903702976530409033630486057082208203038516890211557253449539028053947417301749976770923469592L, 48432460252233896518590701146801699465268148284787060057107516046629706465390996875309983237451651439246289701749841428726394905745596934548654004743163477568754248994377703978705368371628696708908905838291548209861942276030703230359196462558346905625846948218721938124709505105977173341503624601300917523097L, 18835911952635245397983121689518027353873670555350297239877307172573536957491362820331901964231066536876865691174319867193512816679623288056483079397786571363489404925965608535519696331905164710186216120645252646440925835819895263170792950998831330961506637806484283620198320048058017019150494818975211033855L, 52533216100609752837744563594124909165294764771771078792037396727243445302840308173965764773963417358459494569059554524632302368713302220410923330724595377828323601722229997966233899921405903102784893806412255766877033410963483639420931264473292140988943080319905702646946133719378087224444599925462000503889L, 45777797047899489467326840599440234664028439415361279953361225234419693797050268644921822219053706659820103277081024725459357751956951151496560046018606397360690977759503137382534178564661797054507764631128625879821734502651149613960417034150901090486581306832046376965218529758235455947898213029056118643900L, 10922974820898509282698672877657814372070610113890926292666621441991808481100179797645121317061747565420025660652346467298859793916333788440679717908913083109059427404938685731627075041641596099237946552813325131522225110849731046145201797837504788629140717884368797474990752721253612302734529434732788445847L, 33823105504363689381758582104743512765079368841067570103416502009855231227451395538145505676127630448444289217771236894280555321812176019206825431128606063878873763577289105047230169980752556326920297951646729648420307771256432775529886380289816710233120359222453271645359378516489705896554327227418683121547L, 69945273320490194445067385533221719987142325945909526050519023126817845916298831964553165770846417941025390753942474325595338567725024724655366222105769355388228941979041649493796411584233076568801474825938247926869663393203422125438660639552157428473880402424308141644618043786838130296309603527353409729830L, 74475623133597805731977916498503731601375688858551211276537127972813518749467547186743564098950476292323292315615050676378633440972714183222014386214711312789387083031250872450952989439230602942195699801977083527056062997724479497426302443259729487806259432504490616020899710846945071275723231906664531936339L, 73814197194858988044413875425308704067661071222951319136292995351181731393056180271405781404909022804307885183661655640050827508982835677078560746227771939298533770507272149355171877428019578063846578210517436589994165444678646535725027931898869430749888798712691213884450466644874775871232495814456219167632L, 15130340155184507360732381943661472558525964186750245687297296142214873076024054837007626375339631188662297991030058415808946773718505731281425847869772588657601595553921669847007806252130241776715429326797095531692653455287235469156051365135289533997855288940126574338811799964897305913052081886865098918803L, 77856544674664475078880121642570348890105817705314190093693242825836699599600685396948074256254454737253153036625644580090126616271462016976827998314121862669820053162446307254740387951179038308002915514775068255437333422564385416568437169100822134149466101444930364232164040928417605213474322760965527953689L, 37130502041492970123747849209813894876110158377945281065389879916983884146737265755371384224232725199488655070553199162855950954072486057491007559607356632098745412827265608734890696596066459632127917285877375592030369262923273574840899690547746193186882922923838945286746840519768127553532489368586295659306L, 4902835801863618707968029869710404287541213875769737161649973782223299185008980671336806364276958833359300425227072732375037041695085737001209600521578652525307660195008588855513241592745229513115015537074520777697351769022395096189165777683091057724011345242093013831553362920902812450775642990015324217170L, 71519639284223929645337628525114539070599121642586574209606897738531258317549093554186322315123650443590256393845733099201943072931771034062173938723819425589633292174558935738014484146531417235422039685771216778163611050775129315361649144467177766212850357551156908185674273253735911296755401926798440258528L, 49696343535507284771183919816900894811731426764830885480418170788359167279699467233190919006134351942655585427261024852729444209064312152697764127339761875593382583134553783879159948381135313505301765910322139032027673764194328620424918239796541583603977993984662269161158386255574854140874459131663138385869L, 58319768100065028489283224631544506669179534246333883309231004230721792679149290415166142236276086847045165732776143668108416208540641257864760839048828106011211323456565681278268808237939520947094618307206739799150520118040633243167962668065004113631498851629896046962885241489529361898574000009220308221641L, 40090270480157428285231023778008567946209825763678738064054525697711211074173082389785504205390558115057387234324422374297364371364604372238067670797269735997310171944398576564257296057239011599153279736817511985387194358680622805753390777012534595302600221858135044762282112612497515867758111243411578565156L, 45006509700132953295435671374744736260526032576333457013908478738761100775410176476935814694153638540855507246095806330179505830143734034813861462846142029715979428054617481701853895252716253132928498307087181235620648343856366081722888588035217865282872471020563424141726403429552631263193220111308042281902L, 6264556681069286778467361437919737790117873625553279749644837003900297273583814112545547381428096896904147358125315141951126736371682038321341906381389614962785993027888651799165202381516531572186066272504640055097117736051892712427878427346515036166468899791161725270968288837549860157791358006649747496673L, 72935480719256095766387140557369749067638898260537815171477414016327125579144529229095754891746467698488169427092409978908724640121934964851948769708760277028332033782955158307621755171726703690879260713405836464740169664391116803110730534715681535975951847028288209086514093935878579183643946782294018486397L, 45877030606040696827128950294569124409095201325183944798112719428074882612843759377185525033169642057205716327325229864830346761258641546601135024020430878995637821641585821180381776748467424309416824204730196903824831716579060008259682346564057134224902834579390466743472846180015668124398445733845424942856L, 43876179490694041144358625972733258747650539842234844763306632035124367166722634322615063282261946834173184046173917523785442530730760487968913327420598483911052716675704506186352046669659645885790795827790924746521214008736252911465226745922934488552965384610617983995500458988356679885656313075229818069360L, 54879133479774562497136145603909988578660334235112184006784621226913063903977949902614886004473672653007804901796482778683962443316485289632865222392491341405946363351936575627689779432862158681886713590421427896729816358575712367132725724599686908670811010732938275392521528220083603591303032950925151412409L, 7807563161147049837415697813183050427377452478326732401302366737513322922251347538378085767801496427283156148693986600972164892428191583343739430087038844894226625001479108484991740266891305942306338123960784067593148605906959935786204719510987749673109414005482595966197818351821392518810537286934262039944L, 6236483915970064243997556550606791588726152881811482029103887730739977871848806133098617620582831692571470843860641295062252932004268225226741561480266804785496544510586518618213926573959239443048001865759405067424758517074174137065442098338770355909040158632992733167199981585171140049710373663912775912739L, 68167961578232166259272214638335273615231979085116683181939476821335269880650567249210006409793232860484308186983624666089013754882098721752168753076479029491584524163350039261010917119820269394489956428671158786904129501998822874265817284570409820522128903448721446384222855333756680297870717165471739071519L, 64363448829520610499603273201157486861789885515552842121081202880931856403046035651632929966061035554349754551582961002980596815390274675767024710584552423125975474125499646950449810188973867664603057654222517780482299991582815587584411377829226162631699933754941235551853966098426328085588287046395309197223L, 60854193158849297491086685466111937940658016151510927317382687066799849088198218412251816844838645262808537829505424849144203770720397154739409399853148434422524433584776093214154379857417013172405836311665674108399499656982223004196194199550853002308539206886888592631600156923212993210465089959550623131978L, 16135519099809124735113943434479016632213908130183767769412543891220564178681789652627810885175543943020775291529326513218316465836775645505667731787227156598444443876643382347837341224343993716781429517807661021157142275979117206680713064582800456586807407090313456463042713668986794606491415412145765614737L, 55030572194370847969670818872075063625381590055882188634415581852969696812498549687483073398016213249076276191284531942184782695948080237634730986118992210072620249085417694599441613013007673035121530514843017994198633937459498311190346305253431166506841078163197703124995536399691559510662330876479079956518L, 18635286813688275185198443408524897623578017873057842611311593157544413415206388494497351926621312172701370660011037116984733309376318391866863144334428679843421231059153791891818462314049608548830168767012976154259512162499841071910315315869969626304581841288411259219494508259784875941762299397381140790453L, 71641241420336572515378731841065541526932097274913236661086701452333835141110259305834341479431278049140699994164637938223779553225112006797855827833777724071270290796120408508433406532771922639567908959686115145206724508611090189423775549257067165868718528287057536371466551009531218621862148165660508918164L, 21024216759199189023585830568543206828347835550837829000967823709065894480888154923740609295009601738803351879457874306411854675734891063181145949590279386336371235641673064189424742996986533251708062989662625135251613177470323640997323463524646127728793177515608825126801763129509720443897625055544011214984L, 50754932392160557446512789204982860668844916679882535185943242062673715922081203655206161817920399351755671829147230941765647617607025821606522050128811576519383667261756174022225983763754722140926655316578549497786367939242065299515925462685518541207470490996741863002530668871136178353821849402598992515470L, 36359517984845108578667593911201224014491372913918723414664559212868592418864569241776258936022996506022513638805118530060309683000106542933572190341236088174275222204401520330884029369096602741821954076104334422863231251170228600706155250752916641700874683728844682707218980806724548416966543995744253829911L, 28656922468541586310841108806466719348093869365005186821214962657346319432366906787618129406731944999283938582616079262425845073607599957178612574779852838896144429028797366844557778940015250447890755192338609034689645964507955899886823083087497463130267563530088023039338467697289740544622883735148771594055L, 78637171886750376321446493189743194190902124860427767769593492166807581875840945999714507477125088266542027987094800275966628663421849116510709269764327013251687199239903215034788041406271472336070556944117083305877231465113036086928829711544848998170604935936963895763930775465914055551861898765044324595258L, 4719665451507013623047233026060992851479454009672021205322844422826888158790000023245546282706947876751704796565075621325477618452536983590051706292435346517532236974757657879258728981907776455198801857769405198261161563552851358480203079606143020407901608999122481935913286534419088947683147248020032119348L, 56956788798722204914586936231789845640435801691647179346359409602772883845382776983941554952127001673446888195260564115782852445199122381492646836789286957255630020923471867058504285933329246451548316983421367567524836992963192076201628165160099295279291712775422391491260183937967497347411267158063837741338L, 73543708217935865141219526900110618931100752267091808497379814057596540650359426513135487074753513887173167888151030142671963672763504965814629367321628485230555946871192100885101850870812295145215843450092375616078147958968943961040490739476412145719954797778496363369638379725160162223316183958292898808970L, 78077652584819868283986513580241109365344777396999655045621388482349296049840361470587385250041133324511987197442575024090267753923992260962868191878384328271802810905033880411497874583552615985409956346391823768307150008334393154816815163774192435341185714190649581003092045317721383140036951113473656575642L, 79518281174679664223285602340888845737707700147360204488184464564600149882916065336170977726436756181627510128668234679727863261718185569992043350121999770432652279924513580364719914640855570968835723286755584032181915899203419628916159881340855880531723200399488230031524541870177580419179862897606523951819L, 32080378644551834679593030176319891559958821556138306281545034548975679346846553745495224966151274795282068689817481322714609378886404636243601169265963690218867160074088109949321007684957990799786781823573250892775145692145403203131405271451839061662554931013282959236372767285876791975110072575937669170219L, 77547891430256033620301332885897959212179561135835953133579256556135996962345866522498361862621981840354180005062351240569619928780861492484333797492320138174924335241149496369658342822954941018972231519961416361575046380333295094550654436458459646805824183558973387860807125937629417708489448294775898331442L, 72880369047795192346313619668055796865906574270373850077895963180884953697909195615926385580634970396455398374428885885432258052724816320312185922593225606133478843370389709901031306988188539446116628678726210820293057226981405776406034189986904699133711426698899601344016546371428975456545757908587137600911L, 8632047896753265619302791370849335310245865264363721249718027019960197092776527378454878495830502771885235449291133382175821652523609930847724406604466499603622651581386401948903799842995468874169824508698917709496909876959471098210645799576152343788941124486535230965953491688488122998111988666549056638271L, 75797315620976782831077460580470849581693352844594528489304537333675947841051361473975260786478614393362712311054578657322102896265342092471649909588791182743582311978811981947648347868829111279951309370698866977085606679696076527735878429102518802961113035611755931892247494977843916992979262437255747111467L, 52404731938077857255586577288748838253966990991440748107286182097142320439613112336293805375083241257585433071142941823799637948580093242429783657087130366877859399669015341894960656948465486114529753185077231990652658921158462495821318443962867950034199850973809883752981657767711481926052758219200262725617L]
def egcd(a, b):
if a == 0:
return (b, 0, 1)
g, y, x = egcd(b % a, a)
return (g, x - (b//a) * y, y)
def modinv(a, m):
g, x, y = egcd(a, m)
if g != 1:
raise Exception('No modular inverse')
return x % m
A = [[0 for _ in range(order + 2)] for _ in range(order)]
for y in range(order):
for x in range(order):
k = (x + y) % order
A[k][x] = (A[k][x] + pub[y]) % N
A[y][order+1] = enc[y]
A[0][order] = 1
n = order
for i in range(0, n):
# Search for maximum in this column
maxEl = abs(A[i][i])
maxRow = i
for k in range(i+1, n):
if abs(A[k][i]) > maxEl:
maxEl = abs(A[k][i])
maxRow = k
# Swap maximum row with current row (column by column)
for k in range(i, n+2):
A[maxRow][k], A[i][k] = A[i][k], A[maxRow][k]
if i == n-1:
assert A[i][i] == 0
break
# Make all rows below this one 0 in current column
for k in range(i+1, n):
c = (-A[k][i] * modinv(A[i][i], N)) % N
for j in range(i, n+2):
if i == j:
A[k][j] = 0
else:
A[k][j] = (A[k][j] + c * A[i][j]) % N
m = (A[order-1][order+1] * modinv(A[order-1][order], N)) % N
print l2b(m)
| 547 | 15,866 | 0.972368 | 356 | 33,367 | 91.126404 | 0.463483 | 0.001942 | 0.00148 | 0.001017 | 0.002219 | 0.001603 | 0.000863 | 0 | 0 | 0 | 0 | 0.967803 | 0.017053 | 33,367 | 60 | 15,867 | 556.116667 | 0.021312 | 0.004046 | 0 | 0.045455 | 0 | 0 | 0.000542 | 0 | 0 | 1 | 0 | 0 | 0.022727 | 0 | null | null | 0 | 0.022727 | null | null | 0.022727 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
e4735422f6baec2d7074ec0e9a76bb0fbcc9799a | 9,421 | py | Python | django/api/views.py | nah990/StockF | 58f719728f4072186459d0ca5651624eab820c5e | [
"MIT"
] | null | null | null | django/api/views.py | nah990/StockF | 58f719728f4072186459d0ca5651624eab820c5e | [
"MIT"
] | 3 | 2021-12-27T02:05:58.000Z | 2022-03-23T00:06:14.000Z | django/api/views.py | nah990/StockF | 58f719728f4072186459d0ca5651624eab820c5e | [
"MIT"
] | null | null | null | from stock.models import StockByDate, StockInfo, SourceInfo
from users.models import CustomUser
from .serializers import *
from stock.services import *
from rest_framework import generics, serializers
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated, AllowAny
from rest_framework import status
from .role import *
from django.http import JsonResponse
from django.contrib.auth.decorators import login_required, user_passes_test
class StockByDateApiView(APIView):
def get(self, request, *args, **kwargs):
pk = kwargs['pk']
flag = StockByDateService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = StockByDateService.read_by_pk(request.user, pk)
return Response(StockByDateSerializer(stock).data)
def delete(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = StockByDateService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = StockByDateService.delete_by_pk(request.user, pk)
return JsonResponse({'status': 'Ok', 'message': 'You deleted stock by date'},
status=200)
def patch(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = StockByDateService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
flag.update_by_pk(request.user,pk, request.data)
return JsonResponse({'status': 'Ok', 'message': 'You changed stock by date data'},
status=200)
class StockInfoApiView(APIView):
def get(self, request, *args, **kwargs):
pk = kwargs['pk']
flag = StockInfoService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = StockInfoService.read_by_pk(request.user, pk)
return Response(StockInfoSerializer(stock).data)
def delete(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = StockInfoService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = StockInfoService.delete_by_pk(request.user, pk)
return JsonResponse({'status': 'Ok', 'message': 'You deleted stock by date'},
status=200)
def patch(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = StockInfoService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
flag.update_by_pk(request.user,pk, request.data)
return JsonResponse({'status': 'Ok', 'message': 'You changed stock by date data'},
status=200)
class SourceInfoApiView(APIView):
def get(self, request, *args, **kwargs):
pk = kwargs['pk']
flag = SourceInfoService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = SourceInfoService.read_by_pk(request.user, pk)
return Response(SourceInfoSerializer(stock).data)
def delete(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = SourceInfoService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = SourceInfoService.delete_by_pk(request.user, pk)
return JsonResponse({'status': 'Ok', 'message': 'You deleted stock by date'},
status=200)
def patch(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = SourceInfoService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
flag.update_by_pk(request.user,pk, request.data)
return JsonResponse({'status': 'Ok', 'message': 'You changed stock by date data'},
status=200)
class CustomUserApiView(APIView):
def get(self, request, *args, **kwargs):
pk = kwargs['pk']
flag = CustomUserService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = CustomUserService.read_by_pk(request.user, pk)
return Response(CustomUserSerializer(stock).data)
def delete(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = CustomUserService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
stock = CustomUserService.delete_by_pk(request.user, pk)
return JsonResponse({'status': 'Ok', 'message': 'You deleted stock by date'},
status=200)
def patch(self, request, *args, **kwargs):
role = get_role_json(request)
if not role['is_specialist'] and not role['is_superuser']:
return JsonResponse({'status':'false','message':'You do not have rights to get the information'}, status=403)
pk = kwargs['pk']
flag = CustomUserService.read_filtered(request.user, {"pk": pk})
if len(flag) == 0:
return JsonResponse({'status': 'false', 'message': "This record doesn't exist"},
status=400)
flag.update_by_pk(request.user,pk, request.data)
return JsonResponse({'status': 'Ok', 'message': 'You changed stock by date data'},
status=200)
class CreateUserApiView(APIView):
permission_classes = (AllowAny,)
def post(self, request):
user = request.data
serializer = CreateUserSerializer(data=user)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
class StockByDateCreateApiView(APIView):
def post(self, request):
serializer = StockByDateSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
class StockInfoCreateApiView(APIView):
def post(self, request):
serializer = StockInfoSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
class SourceInfoCreateApiView(APIView):
def post(self, request):
serializer = SourceInfoSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED) | 41.685841 | 121 | 0.615009 | 1,065 | 9,421 | 5.353052 | 0.101408 | 0.088406 | 0.117874 | 0.101737 | 0.852657 | 0.852657 | 0.83424 | 0.83424 | 0.809683 | 0.809683 | 0 | 0.015493 | 0.260057 | 9,421 | 226 | 122 | 41.685841 | 0.802324 | 0 | 0 | 0.776471 | 0 | 0 | 0.170664 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.094118 | false | 0.005882 | 0.070588 | 0 | 0.429412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
e4adc655a4ea59400d419ae413dfc56a114a2b1e | 24 | py | Python | Chapter 04/ch41b.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 04/ch41b.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 04/ch41b.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | print(2 + 7 | 8 & 2)
#9 | 12 | 21 | 0.416667 | 6 | 24 | 1.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | 0.333333 | 24 | 2 | 22 | 12 | 0.3125 | 0.041667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 8 |
5f606a04bccaa6ac2e651e6b0d5695fbbab5635c | 5,280 | py | Python | research/glue/score_glue.py | legacyai/tf-transformers | 65a5f9a4bcb3236483daa598a37b91673f56cb97 | [
"Apache-2.0"
] | 116 | 2021-03-15T09:48:41.000Z | 2022-03-24T05:15:51.000Z | research/glue/score_glue.py | legacyai/tf-transformers | 65a5f9a4bcb3236483daa598a37b91673f56cb97 | [
"Apache-2.0"
] | 4 | 2021-03-20T11:20:57.000Z | 2022-01-05T04:59:07.000Z | research/glue/score_glue.py | legacyai/tf-transformers | 65a5f9a4bcb3236483daa598a37b91673f56cb97 | [
"Apache-2.0"
] | 9 | 2021-03-17T04:14:48.000Z | 2021-09-13T07:15:31.000Z | import pandas as pd
import os
def score_glue_joint(eval_folder):
"""Join GLUE evaluation"""
# Infer num_layers from a saved file MNLI
df_sample = pd.read_csv(os.path.join(eval_folder, "mnli_eval.csv"))
num_layers = df_sample.shape[1]
# MRPC
df = pd.read_csv(os.path.join(eval_folder, "mrpc_eval.csv"))
mrpc_scores = []
for i in range(num_layers):
# Best per ;ayer
score = ((df['accuracy_score_layer_{}'.format(i+1)] + + df['f1_score_layer_{}'.format(i+1)])/2.0).max()
mrpc_scores.append(score)
# MNLI
df = pd.read_csv(os.path.join(eval_folder, "mnli_eval.csv"))
df_mismatched = pd.read_csv(os.path.join(eval_folder, "mnli_eval_mismatched.csv"))
mnli_scores = []
for i in range(num_layers):
score = ((df['accuracy_score_layer_{}'.format(i+1)] + + df_mismatched['accuracy_score_layer_{}'.format(i+1)])/2.0).max()
mnli_scores.append(score)
# QQP
df = pd.read_csv(os.path.join(eval_folder, "qqp_eval.csv"))
qqp_scores = []
for i in range(num_layers):
score = ((df['accuracy_score_layer_{}'.format(i+1)] + + df['f1_score_layer_{}'.format(i+1)])/2.0).max()
qqp_scores.append(score)
# STSB
df = pd.read_csv(os.path.join(eval_folder, "stsb_eval.csv"))
stsb_scores = []
for i in range(num_layers):
score = ((df['pearsonr_layer_{}'.format(i+1)] + + df['spearmanr_layer_{}'.format(i+1)])/2.0).max()
stsb_scores.append(score)
# COLA
df = pd.read_csv(os.path.join(eval_folder, "cola_eval.csv"))
cola_scores = []
for i in range(num_layers):
cola_scores.append(df['matthews_corrcoef_layer_{}'.format(i+1)].max())
# QNLI
df = pd.read_csv(os.path.join(eval_folder, "qnli_eval.csv"))
qnli_scores = []
for i in range(num_layers):
qnli_scores.append(df['accuracy_score_layer_{}'.format(i+1)].max())
# RTE
df = pd.read_csv(os.path.join(eval_folder, "rte_eval.csv"))
rte_scores = []
for i in range(num_layers):
rte_scores.append(df['accuracy_score_layer_{}'.format(i+1)].max())
# SST2
df = pd.read_csv(os.path.join(eval_folder, "sst2_eval.csv"))
sst2_scores = []
for i in range(num_layers):
sst2_scores.append(df['accuracy_score_layer_{}'.format(i+1)].max())
# Average
df_results = pd.DataFrame([cola_scores, mnli_scores, mrpc_scores, qnli_scores, qqp_scores, rte_scores, sst2_scores, stsb_scores])
df_results.index = ['cola', 'mnli', 'mrpc', 'qnli', 'qqp', 'rte', 'sst2', 'stsb']
df_results.columns = ['layer_{}'.format(i+1) for i in range(num_layers)]
df_results = df_results.transpose()
df_results['glue_score'] = df_results.mean(axis=1)
df_results.to_csv(os.path.join(eval_folder, "glue_results_joint.csv"), index=False)
print("GLUE SCORE calculated")
print("------------------------")
print(df_results.to_markdown())
def score_glue(eval_folder):
"""Join GLUE evaluation"""
# MRPC
mrpc_scores = []
df = pd.read_csv(os.path.join(eval_folder, "mrpc_eval.csv"))
score = ((df['accuracy_score'] + df['f1_score'])/2.0).max()
mrpc_scores.append(score)
# MNLI
df = pd.read_csv(os.path.join(eval_folder, "mnli_eval.csv"))
df_mismatched = pd.read_csv(os.path.join(eval_folder, "mnli_eval_mismatched.csv"))
mnli_scores = []
score = ((df['accuracy_score'] + df_mismatched['accuracy_score'])/2.0).max()
mnli_scores.append(score)
# QQP
df = pd.read_csv(os.path.join(eval_folder, "qqp_eval.csv"))
qqp_scores = []
score =score = ((df['accuracy_score'] + df['f1_score'])/2.0).max()
qqp_scores.append(score)
# STSB
df = pd.read_csv(os.path.join(eval_folder, "stsb_eval.csv"))
stsb_scores = []
score = ((df['pearsonr'] + df['spearmanr'])/2.0).max()
stsb_scores.append(score)
# COLA
df = pd.read_csv(os.path.join(eval_folder, "cola_eval.csv"))
cola_scores = []
cola_scores.append(df['matthews_corrcoef'].max())
# QNLI
df = pd.read_csv(os.path.join(eval_folder, "qnli_eval.csv"))
qnli_scores = []
qnli_scores.append(df['accuracy_score'].max())
# RTE
df = pd.read_csv(os.path.join(eval_folder, "rte_eval.csv"))
rte_scores = []
rte_scores.append(df['accuracy_score'].max())
# SST2
df = pd.read_csv(os.path.join(eval_folder, "sst2_eval.csv"))
sst2_scores = []
sst2_scores.append(df['accuracy_score'].max())
# Average
df_results = pd.DataFrame([cola_scores, mnli_scores, mrpc_scores, qnli_scores, qqp_scores, rte_scores, sst2_scores, stsb_scores])
df_results.index = ['cola', 'mnli', 'mrpc', 'qnli', 'qqp', 'rte', 'sst2', 'stsb']
df_results = df_results.transpose()
df_results['glue_score'] = df_results.mean(axis=1)
df_results.to_csv(os.path.join(eval_folder, "glue_results.csv"), index=False)
print("GLUE SCORE calculated")
print("------------------------")
print(df_results.to_markdown())
def score(eval_folder, return_all_layer_outputs):
"""Score GLUE based on subtasks"""
if return_all_layer_outputs:
score_glue_joint(eval_folder)
else:
score_glue(eval_folder) | 35.918367 | 133 | 0.632386 | 766 | 5,280 | 4.079634 | 0.100522 | 0.0832 | 0.06048 | 0.08736 | 0.90944 | 0.86624 | 0.78336 | 0.74528 | 0.73952 | 0.73088 | 0 | 0.011291 | 0.194886 | 5,280 | 147 | 134 | 35.918367 | 0.72383 | 0.042045 | 0 | 0.702128 | 0 | 0 | 0.176154 | 0.060709 | 0 | 0 | 0 | 0 | 0 | 1 | 0.031915 | false | 0 | 0.021277 | 0 | 0.053191 | 0.06383 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
397f8509a7e029bbe153ca03cf0b158b93f70a52 | 51,407 | py | Python | src/r2b2/simulation/minerva.py | gwexploratoryaudits/r2b2 | 76fcf1658e3055ee7e262a836fcb0b1af8e04233 | [
"MIT"
] | 4 | 2020-02-05T20:51:42.000Z | 2021-07-06T19:24:35.000Z | src/r2b2/simulation/minerva.py | gwexploratoryaudits/r2b2 | 76fcf1658e3055ee7e262a836fcb0b1af8e04233 | [
"MIT"
] | 36 | 2020-02-13T19:18:30.000Z | 2021-10-07T23:50:47.000Z | src/r2b2/simulation/minerva.py | gwexploratoryaudits/r2b2 | 76fcf1658e3055ee7e262a836fcb0b1af8e04233 | [
"MIT"
] | 1 | 2021-03-19T10:35:38.000Z | 2021-03-19T10:35:38.000Z | import math
import random as r
from typing import List
from typing import Tuple
from r2b2.minerva import Minerva
from r2b2.simulator import Simulation
from r2b2.simulator import histogram
class MinervaOneRoundRisk(Simulation):
"""Simulate a 1-round Minerva audit for a given sample size to compute risk limit."""
sample_size: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
sample_size,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
super().__init__('minerva', alpha, reported, 'tie', True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.sample_size = sample_size
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
self.reported.contest_ballots = self.total_relevant_ballots
self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_size < self.audit.min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit.')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
self.vote_dist = [(sorted_tally[0][0], self.total_relevant_ballots // 2)]
for i in range(1, len(sorted_tally)):
self.vote_dist.append((sorted_tally[i][0], self.total_relevant_ballots))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a 1-round minerva audit (using r2b2.minerva.Minerva)"""
r.seed(seed)
# Draw a sample of a given size
sample = [0 for i in range(len(self.vote_dist))]
for i in range(self.sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
relevant_sample_size = self.sample_size - sample[-1]
# Perform audit computations
self.audit._reset()
self.audit.rounds.append(relevant_sample_size)
self.audit.current_dist_null()
self.audit.current_dist_reported()
p_value = self.audit.compute_risk(sample[0], relevant_sample_size)
if p_value <= self.alpha:
stop = True
else:
stop = False
return {
'stop': stop,
'p_value': p_value,
'sample_size': self.sample_size,
'relevant_sample_size': relevant_sample_size,
'winner_ballots': sample[0]
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyze trials to get experimental risk.
Args:
verbose (bool): If true, analyze will print simulation analysis information.
hist (bool): If true, analyze will generate and display 2 histograms: winner
ballots found in the sample size and computed risk.
"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
total_risk = 0
total_relevant_sampled = 0
winner_ballot_dist = []
risk_dist = []
for trial in trials:
num_trials += 1
if trial['stop']:
stopped += 1
total_relevant_sampled += trial['relevant_sample_size']
winner_ballot_dist.append(trial['winner_ballots'])
total_risk += trial['p_value']
risk_dist.append(trial['p_value'])
if verbose:
print('Analysis\n========')
print('Underlying election is tied\n')
print('Number of trials: {}'.format(num_trials))
print('Number of stopped: {}'.format(stopped))
print('Risk Limit: {:%}'.format(self.alpha))
print('Risk Computed: {:%}'.format(stopped / num_trials))
if hist:
histogram(winner_ballot_dist, 'Winner ballots found in sample of size: {}'.format(self.sample_size))
histogram(risk_dist, 'Risk (p_value) dist.')
# Update simulation entry to include analysis
if self.db_mode:
self.db.update_analysis(self.sim_id, (stopped / num_trials))
return stopped / num_trials
class MinervaOneRoundStoppingProb(Simulation):
"""Simulate a 1-round Minerva audit for a given sample size to compute stopping probability."""
sample_size: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
sample_size,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
super().__init__('minerva', alpha, reported, 'reported', True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.sample_size = sample_size
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
self.reported.contest_ballots = self.total_relevant_ballots
self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_size < self.audit.min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
self.vote_dist = [(sorted_tally[0][0], sorted_tally[0][1])]
current = sorted_tally[0][1]
for i in range(1, len(sorted_tally)):
current += sorted_tally[i][1]
self.vote_dist.append((sorted_tally[i][0], current))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a 1-round minerva audit."""
r.seed(seed)
# Draw a sample
sample = [0 for i in range(len(self.vote_dist))]
for i in range(self.sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
relevant_sample_size = self.sample_size - sample[-1]
# Perform audit computations
self.audit._reset()
self.audit.rounds.append(relevant_sample_size)
self.audit.current_dist_null()
self.audit.current_dist_reported()
p_value = self.audit.compute_risk(sample[0], relevant_sample_size)
if p_value <= self.alpha:
stop = True
else:
stop = False
return {
'stop': stop,
'p_value': p_value,
'sample_size': self.sample_size,
'relevant_sample_size': relevant_sample_size,
'winner_ballots': sample[0]
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyse trials to get experimental stopping probability"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
winner_ballot_dist = []
risk_dist = []
for trial in trials:
num_trials += 1
if trial['stop']:
stopped += 1
winner_ballot_dist.append(trial['winner_ballots'])
risk_dist.append(trial['p_value'])
# TODO: insert verbose and histograms
# Update simulation entry to include analysis
if self.db_mode:
self.db.update_analysis(self.sim_id, (stopped / num_trials))
return stopped / num_trials
class MinervaOneRoundAlteredMargin(Simulation):
"""Simulate a 1-round Minerva audit for a given sample size with a correct outcome but incorrect reported margin"""
underlying_margin: float
sample_size: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
underlying,
underlying_margin,
sample_size,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
super().__init__('minerva', alpha, reported, {
'change': underlying,
'margin': underlying_margin
}, True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.underlying_margin = underlying_margin
self.sample_size = sample_size
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
self.reported.contest_ballots = self.total_relevant_ballots
self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_size < self.audit.min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
underlying_winner_prop = (1.0 + underlying_margin) / 2.0
self.vote_dist = [(sorted_tally[0][0], self.total_relevant_ballots * underlying_winner_prop)]
# current = sorted_tally[0][1]
# for i in range(1, len(sorted_tally)):
# current += sorted_tally[i][1]
# self.vote_dist.append((sorted_tally[i][0], current))
for i in range(1, len(sorted_tally)):
self.vote_dist.append((sorted_tally[i][0], self.total_relevant_ballots))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a 1-round minerva audit."""
r.seed(seed)
# Draw a sample
sample = [0 for i in range(len(self.vote_dist))]
for i in range(self.sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
relevant_sample_size = self.sample_size - sample[-1]
# Perform audit computations
self.audit._reset()
self.audit.rounds.append(relevant_sample_size)
self.audit.current_dist_null()
self.audit.current_dist_reported()
p_value = self.audit.compute_risk(sample[0], relevant_sample_size)
if p_value <= self.alpha:
stop = True
else:
stop = False
return {
'stop': stop,
'p_value': p_value,
'sample_size': self.sample_size,
'relevant_sample_size': relevant_sample_size,
'winner_ballots': sample[0]
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyse trials to get experimental stopping probability"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
winner_ballot_dist = []
total_risk = 0.0
for trial in trials:
num_trials += 1
total_risk += trial['p_value']
if trial['stop']:
stopped += 1
winner_ballot_dist.append(trial['winner_ballots'])
# TODO: insert verbose and histograms
# Update simulation entry to include analysis
if self.db_mode:
analysis = {'avg_p_value': (total_risk / num_trials), 'sprob': (stopped / num_trials)}
self.db.update_analysis(self.sim_id, analysis)
return analysis
class MinervaMultiRoundStoppingProb(Simulation):
"""Simulate a multi-round Minerva audit.
If sample_sprob is provided, sample sizes to achieve a sample_sprob
probability of stopping will be computed and used. Otherwise,
the initial sample size, sample_size, is given as input and further sample
sizes are an additional (sample_mult) * (sample_size) ballots.
The audit executes until it stops or reaches the maximum number of rounds.
"""
sample_sprob: float
sample_size: int
sample_mult: float
max_rounds: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
max_rounds,
sample_size=None,
sample_mult=None,
sample_sprob=None,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
# Add parameters to simulation DB entry
if 'sim_args' in kwargs:
kwargs['sim_args']['max_rounds'] = max_rounds
kwargs['sim_args']['sample_mult'] = sample_mult
kwargs['sim_args']['sample_sprob'] = sample_sprob
else:
kwargs['sim_args'] = {'max_rounds': max_rounds, 'sample_mult': sample_mult, 'sample_sprob': sample_sprob}
super().__init__('minerva', alpha, reported, 'reported', True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.sample_sprob = sample_sprob
self.sample_size = sample_size
self.sample_mult = sample_mult
self.max_rounds = max_rounds
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
# self.reported.contest_ballots = self.total_relevant_ballots
# self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_sprob is None and sample_size is None and sample_mult is None:
raise ValueError('Sample sizes cannot be chosen without sample_sprob or sample_size and sample_mult.')
if sample_sprob is not None:
if not sample_sprob > 0 or not sample_sprob < 1:
raise ValueError('Sample size stopping probability is not between 0 and 1.')
else:
min_sample_size = 0
for pairwise_audit in self.audit.sub_audits.values():
min_sample_size = max(pairwise_audit.min_sample_size, min_sample_size)
if sample_size < min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit.')
if max_rounds < 2:
raise ValueError('Maximum rounds is too small.')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
self.vote_dist = [(sorted_tally[0][0], sorted_tally[0][1])]
current = sorted_tally[0][1]
for i in range(1, len(sorted_tally)):
current += sorted_tally[i][1]
self.vote_dist.append((sorted_tally[i][0], current))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a multiround minerva audit (using r2b2.minerva.Minerva)"""
r.seed(seed)
# Ensure audit is reset
self.audit._reset()
# Initialize first round including initial sample size
round_num = 1
previous_sample_size = 0
if self.sample_sprob is not None:
current_sample_size = self.audit.next_sample_size(self.sample_sprob)
else:
current_sample_size = self.sample_size
next_sample = math.ceil(self.sample_mult * self.sample_size)
stop = False
# For each round
sample = [0 for i in range(len(self.vote_dist))]
while round_num <= self.max_rounds:
# Draw a sample of a given size
if current_sample_size <= previous_sample_size:
# TODO figure out when this happens and prevent it
current_sample_size = previous_sample_size + 1
for i in range(current_sample_size - previous_sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
# Convert this sample to a dict
sample_dict = {}
for i in range(len(self.vote_dist)):
# For now, we will ignore the irrelevant votes for this simulation
if not self.vote_dist[i][0] == 'invalid':
sample_dict[self.vote_dist[i][0]] = sample[i]
# Execute a round of the audit for this sample
stop = self.audit.execute_round(current_sample_size, sample_dict)
# If audit is done, return trial output
# FIXME: Improve output format
if stop:
return {
'stop': stop,
'round': round_num,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_ballots
# 'kmin_sched': self.audit.min_winner_ballots
}
# Else choose a next round size and continue
round_num += 1
previous_sample_size = current_sample_size
if self.sample_sprob is not None:
current_sample_size = self.audit.next_sample_size(self.sample_sprob)
else:
current_sample_size += next_sample
next_sample = math.ceil(self.sample_mult * self.sample_size)
# If audit does not stop, return trial output
# FIXME: Improve output format
return {
'stop': stop,
'round': self.max_rounds,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_ballots
# 'kmin_sched': self.audit.min_winner_ballots
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyze trials to get experimental stopping probability.
Args:
verbose (bool): If true, analyze will print simulation analysis information.
hist (bool): If true, analyze will generate and display 2 histograms: winner
ballots found in the sample size and computed stopping probability.
"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
rounds_stopped = []
# TODO: Create additinal structures to store trial data
for trial in trials:
num_trials += 1
if trial['stop']:
stopped += 1
rounds_stopped.append(trial['round'])
# TODO: Extract more data from trial
if verbose:
print('Analysis\n========\n')
print('Number of trials: {}'.format(num_trials))
print('Experiemtnal Stopping Prob: {:.5f}'.format(stopped / num_trials))
if stopped > 0:
print('Average Rounds in Stopped Trials: {:.2f}'.format(sum(rounds_stopped) / stopped))
if hist:
histogram(rounds_stopped, 'Rounds reached in stopped trials.')
# Find stopping probability for each round
sprob_by_round = [0]*self.max_rounds
stopped_by_round = [0]*self.max_rounds
remaining_by_round = [0]*(self.max_rounds+1)
# first round has all remaining
remaining_by_round[0] = num_trials
for rd in range(1, self.max_rounds+1):
stopped_this_round = rounds_stopped.count(r)
stopped_by_round[rd-1] = stopped_this_round
if remaining_by_round[rd-1] != 0:
sprob_by_round[rd-1] = stopped_this_round/remaining_by_round[rd-1]
else:
sprob_by_round[rd-1] = -1
remaining_by_round[rd] = remaining_by_round[rd-1]-stopped_this_round
analysis = {
'sprob': stopped / num_trials,
'sprob_by_round': sprob_by_round,
'remaining_by_round': remaining_by_round,
'stopped_by_round': stopped_by_round
}
# Update simulation entry to include analysis
if self.db_mode:
self.db.update_analysis(self.sim_id, analysis)
return analysis
class MinervaMultiRoundRisk(Simulation):
"""Simulate a multi-round Minerva audit.
If sample_sprob is provided, sample sizes to achieve a sample_sprob
probability of stopping will be computed and used. Otherwise,
the initial sample size, x, is given as input and further sample sizes are
an additional (sample_mult) * x ballots.
The audit executes until it stops or reaches the maximum number of rounds.
"""
sample_sprob: float
sample_size: int
sample_mult: float
max_rounds: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
max_rounds,
sample_size=None,
sample_mult=None,
sample_sprob=None,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
# Add parameters to simulation DB entry
if 'sim_args' in kwargs:
kwargs['sim_args']['max_rounds'] = max_rounds
kwargs['sim_args']['sample_mult'] = sample_mult
kwargs['sim_args']['sample_sprob'] = sample_sprob
else:
kwargs['sim_args'] = {'max_rounds': max_rounds, 'sample_mult': sample_mult, 'sample_sprob': sample_sprob}
super().__init__('minerva', alpha, reported, 'tie', True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.sample_size = sample_size
self.sample_mult = sample_mult
self.sample_sprob = sample_sprob
self.max_rounds = max_rounds
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
# self.reported.contest_ballots = self.total_relevant_ballots
# self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_sprob is None and sample_size is None and sample_mult is None:
raise ValueError('Sample sizes cannot be chosen without sample_sprob or sample_size and sample_mult.')
if sample_sprob is not None:
if not sample_sprob > 0 or not sample_sprob < 1:
raise ValueError('Sample size stopping probability is not between 0 and 1.')
else:
min_sample_size = 0
for pairwise_audit in self.audit.sub_audits.values():
min_sample_size = max(pairwise_audit.min_sample_size, min_sample_size)
if sample_size < min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit.')
if max_rounds < 2:
raise ValueError('Maximum rounds is too small.')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution for a tied election
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
self.vote_dist = [(sorted_tally[0][0], self.total_relevant_ballots // 2)]
for i in range(1, len(sorted_tally)):
self.vote_dist.append((sorted_tally[i][0], self.total_relevant_ballots))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a multiround minerva audit (using r2b2.minerva.Minerva)"""
r.seed(seed)
# Ensure audit is reset
self.audit._reset()
# Initialize first round including initial sample size
round_num = 1
previous_sample_size = 0
if self.sample_sprob is None:
current_sample_size = self.sample_size
next_sample = math.ceil(self.sample_mult * self.sample_size)
stop = False
# For each round
sample = [0 for i in range(len(self.vote_dist))]
while round_num <= self.max_rounds:
if self.sample_sprob is not None:
current_sample_size = self.audit.next_sample_size(self.sample_sprob)
# Draw a sample of a given size
for i in range(current_sample_size - previous_sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
# Convert this sample to a dict
sample_dict = {}
for i in range(len(self.vote_dist)):
# For now, we will ignore the irrelevant ballots
if not self.vote_dist[i][0] == 'invalid':
sample_dict[self.vote_dist[i][0]] = sample[i]
# Execute a round of the audit for this sample
stop = self.audit.execute_round(current_sample_size, sample_dict)
# If audit is done, return trial output
# FIXME: Improve output format
if stop:
return {
'stop': stop,
'round': round_num,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_ballots,
# 'kmin_sched': self.audit.min_winner_ballots
}
# Else choose a next round size and continue
round_num += 1
previous_sample_size = current_sample_size
if self.sample_sprob is None:
current_sample_size += next_sample
next_sample = math.ceil(self.sample_mult * self.sample_size)
# If audit does not stop, return trial output
# FIXME: Improve output format
return {
'stop': stop,
'round': self.max_rounds,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_ballots,
# 'kmin_sched': self.audit.min_winner_ballots
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyze trials to get experimental risk.
Args:
verbose (bool): If true, analyze will print simulation analysis information.
hist (bool): If true, analyze will generate and display 2 histograms: winner
ballots found in the sample size and computed risk.
"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
rounds_stopped = []
# TODO: Create additinal structures to store trial data
for trial in trials:
num_trials += 1
if trial['stop']:
stopped += 1
rounds_stopped.append(trial['round'])
# TODO: Extract more data from trial
if verbose:
print('Analysis\n========\n')
print('Number of trials: {}'.format(num_trials))
print('Experiemtnal Risk: {:.5f}'.format(stopped / num_trials))
if stopped > 0:
print('Average Rounds in Stopped Trials: {:.2f}'.format(sum(rounds_stopped) / stopped))
if hist:
histogram(rounds_stopped, 'Rounds reached in stopped trials.')
# Find risk for each round
risk_by_round = [0]*self.max_rounds
stopped_by_round = [0]*self.max_rounds
remaining_by_round = [0]*(self.max_rounds+1)
# first round has all remaining
remaining_by_round[0] = num_trials
for rd in range(1, self.max_rounds + 1):
stopped_this_round = rounds_stopped.count(rd)
stopped_by_round[rd-1] = stopped_this_round
if remaining_by_round[rd-1] != 0:
risk_by_round[rd-1] = stopped_this_round/remaining_by_round[rd-1]
else:
risk_by_round[rd-1] = -1
remaining_by_round[rd] = remaining_by_round[rd-1]-stopped_this_round
analysis = {
'risk': stopped / num_trials,
'risk_by_round': risk_by_round,
'remaining_by_round': remaining_by_round,
'stopped_by_round': stopped_by_round
}
# Update simulation entry to include analysis
if self.db_mode:
self.db.update_analysis(self.sim_id, analysis)
return analysis
class MinervaRandomMultiRoundRisk(Simulation):
"""Simulate a multi-round Minerva audit for random subsequent sample sizes.
The initial sample size, x, is given as input and further sample sizes are
chosen randomly as an additioanl 0.5x to 1.5x ballots in the next round.
The audit executes until it stops or reaches the maximum number of rounds.
"""
sample_size: int
max_rounds: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
sample_size,
max_rounds,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
if 'sim_args' in kwargs:
kwargs['sim_args']['max_rounds'] = max_rounds
else:
kwargs['sim_args'] = {'max_rounds': max_rounds}
super().__init__('minerva', alpha, reported, 'tie', True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.sample_size = sample_size
self.max_rounds = max_rounds
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
self.reported.contest_ballots = self.total_relevant_ballots
self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_size < self.audit.min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit.')
if max_rounds < 2:
raise ValueError('Maximum rounds is too small.')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution for a tied election
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
self.vote_dist = [(sorted_tally[0][0], self.total_relevant_ballots // 2)]
for i in range(1, len(sorted_tally)):
self.vote_dist.append((sorted_tally[i][0], self.total_relevant_ballots))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a 1-round minerva audit (using r2b2.minerva.Minerva)"""
r.seed(seed)
# Ensure audit is reset
self.audit._reset()
# Initialize first round with given initial sample size
round_num = 1
previous_sample_size = 0
current_sample_size = self.sample_size
stop = False
# For each round
sample = [0 for i in range(len(self.vote_dist))]
while round_num <= self.max_rounds:
# Draw a sample of a given size
for i in range(current_sample_size - previous_sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
relevant_sample_size = current_sample_size - sample[-1]
# Perform audit computations
self.audit.rounds.append(relevant_sample_size)
self.audit.current_dist_null()
self.audit.current_dist_reported()
# Check is audit has completed
if (self.audit.stopping_condition(sample[0])):
stop = True
# Continue audit computations
kmin = self.audit.next_min_winner_ballots(relevant_sample_size)
self.audit.min_winner_ballots.append(kmin)
self.audit.truncate_dist_null()
self.audit.truncate_dist_reported()
self.audit.sample_winner_ballots.append(sample[0])
# If audit is done, return trial output
# FIXME: Improve output format
if stop:
return {
'stop': stop,
'round': round_num,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_winner_ballots,
# 'kmin_sched': self.audit.min_winner_ballots
}
# Else choose a next round size and continue
round_num += 1
sample_mult = r.uniform(0.5, 1.5)
next_sample = math.ceil(self.sample_size * sample_mult)
previous_sample_size = current_sample_size
current_sample_size += next_sample
# If audit does not stop, return trial output
# FIXME: Improve output format
return {
'stop': stop,
'round': self.max_rounds,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_winner_ballots,
# 'kmin_sched': self.audit.min_winner_ballots
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyze trials to get experimental risk.
Args:
verbose (bool): If true, analyze will print simulation analysis information.
hist (bool): If true, analyze will generate and display 2 histograms: winner
ballots found in the sample size and computed risk.
"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
rounds_stopped = []
# TODO: Create additinal structures to store trial data
for trial in trials:
num_trials += 1
if trial['stop']:
stopped += 1
rounds_stopped.append(trial['round'])
# TODO: Extract more data from trial
if verbose:
print('Analysis\n========\n')
print('Number of trials: {}'.format(num_trials))
print('Experiemtnal Risk: {:.5f}'.format(stopped / num_trials))
if stopped > 0:
print('Average Rounds in Stopped Trials: {:.2f}'.format(sum(rounds_stopped) / stopped))
if hist:
histogram(rounds_stopped, 'Rounds reached in stopped trials.')
# Update simulation entry to include analysis
if self.db_mode:
self.db.update_analysis(self.sim_id, (stopped / num_trials))
return stopped / num_trials
class MinervaRandomMultiRoundStoppingProb(Simulation):
"""Simulate a multi-round Minerva audit for random subsequent sample sizes.
The initial sample size, x, is given as input and further sample sizes are
chosen randomly as an additioanl 0.5x to 1.5x ballots in the next round.
The audit executes until it stops or reaches the maximum number of rounds.
"""
sample_size: int
max_rounds: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
sample_size,
max_rounds,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
if 'sim_args' in kwargs:
kwargs['sim_args']['max_rounds'] = max_rounds
else:
kwargs['sim_args'] = {'max_rounds': max_rounds}
super().__init__('minerva', alpha, reported, 'reported', True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.sample_size = sample_size
self.max_rounds = max_rounds
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
self.reported.contest_ballots = self.total_relevant_ballots
self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_size < self.audit.min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit.')
if max_rounds < 2:
raise ValueError('Maximum rounds is too small.')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution for a tied election
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
self.vote_dist = [(sorted_tally[0][0], sorted_tally[0][1])]
current = sorted_tally[0][1]
for i in range(1, len(sorted_tally)):
current += sorted_tally[i][1]
self.vote_dist.append((sorted_tally[i][0], current))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a 1-round minerva audit (using r2b2.minerva.Minerva)"""
r.seed(seed)
# Ensure audit is reset
self.audit._reset()
# Initialize first round with given initial sample size
round_num = 1
previous_sample_size = 0
current_sample_size = self.sample_size
stop = False
# For each round
sample = [0 for i in range(len(self.vote_dist))]
while round_num <= self.max_rounds:
# Draw a sample of a given size
for i in range(current_sample_size - previous_sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
relevant_sample_size = current_sample_size - sample[-1]
# Perform audit computations
self.audit.rounds.append(relevant_sample_size)
self.audit.current_dist_null()
self.audit.current_dist_reported()
# Check is audit has completed
if (self.audit.stopping_condition(sample[0])):
stop = True
# Continue audit computations
kmin = self.audit.next_min_winner_ballots(relevant_sample_size)
self.audit.min_winner_ballots.append(kmin)
self.audit.truncate_dist_null()
self.audit.truncate_dist_reported()
self.audit.sample_winner_ballots.append(sample[0])
# If audit is done, return trial output
# FIXME: Improve output format
if stop:
return {
'stop': stop,
'round': round_num,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_winner_ballots,
'kmin_sched': self.audit.min_winner_ballots
}
# Else choose a next round size and continue
round_num += 1
sample_mult = r.uniform(0.5, 1.5)
next_sample = math.ceil(self.sample_size * sample_mult)
previous_sample_size = current_sample_size
current_sample_size += next_sample
# If audit does not stop, return trial output
# FIXME: Improve output format
return {
'stop': stop,
'round': self.max_rounds,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_winner_ballots,
'kmin_sched': self.audit.min_winner_ballots
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyze trials to get experimental risk.
Args:
verbose (bool): If true, analyze will print simulation analysis information.
hist (bool): If true, analyze will generate and display 2 histograms: winner
ballots found in the sample size and computed risk.
"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
rounds_stopped = []
# TODO: Create additinal structures to store trial data
for trial in trials:
num_trials += 1
if trial['stop']:
stopped += 1
rounds_stopped.append(trial['round'])
# TODO: Extract more data from trial
if verbose:
print('Analysis\n========\n')
print('Number of trials: {}'.format(num_trials))
print('Stopping Probability: {:%}'.format(stopped / num_trials))
if stopped > 0:
print('Average Rounds in Stopped Trials: {:.2f}'.format(sum(rounds_stopped) / stopped))
if hist:
histogram(rounds_stopped, 'Rounds reached in stopped trials.')
# Update simulation entry to include analysis
if self.db_mode:
self.db.update_analysis(self.sim_id, (stopped / num_trials))
return stopped / num_trials
class MinervaMultiRoundAlteredMargin(Simulation):
"""Simulate a Minerva audit for a given sample size with a correct outcome but incorrect reported margin"""
underlying_margin: float
sample_size: int
max_rounds: int
total_relevant_ballots: int
vote_dist: List[Tuple[str, int]]
audit: Minerva
def __init__(self,
alpha,
reported,
underlying,
underlying_margin,
sample_size,
max_rounds,
db_mode=True,
db_host='localhost',
db_name='r2b2',
db_port=27017,
user='writer',
pwd='icanwrite',
*args,
**kwargs):
if 'sim_args' in kwargs:
kwargs['sim__args']['max_rounds'] = max_rounds
else:
kwargs['sim_args'] = {'max_rounds': max_rounds}
super().__init__('minerva', alpha, reported, {
'change': underlying,
'margin': underlying_margin
}, True, db_mode, db_host, db_port, db_name, user, pwd, *args, **kwargs)
self.underlying_margin = underlying_margin
self.sample_size = sample_size
self.max_rounds = max_rounds
self.total_relevant_ballots = sum(self.reported.tally.values())
# FIXME: temporary until pairwise contest fix is implemented
self.contest_ballots = self.reported.contest_ballots
self.reported.contest_ballots = self.total_relevant_ballots
self.reported.winner_prop = self.reported.tally[self.reported.reported_winners[0]] / self.reported.contest_ballots
self.audit = Minerva(self.alpha, 1.0, self.reported)
if sample_size < self.audit.min_sample_size:
raise ValueError('Sample size is less than minimum sample size for audit')
# FIXME: sorted candidate list will be created by new branch, update once merged
# Generate a sorted underlying vote distribution
sorted_tally = sorted(self.reported.tally.items(), key=lambda x: x[1], reverse=True)
underlying_winner_prop = (1.0 + underlying_margin) / 2.0
self.vote_dist = [(sorted_tally[0][0], self.total_relevant_ballots * underlying_winner_prop)]
for i in range(1, len(sorted_tally)):
self.vote_dist.append((sorted_tally[i][0], self.total_relevant_ballots))
self.vote_dist.append(('invalid', self.contest_ballots))
def trial(self, seed):
"""Execute a multiround minerva audit."""
r.seed(seed)
# Ensure audit is reset
self.audit._reset()
# Initialize first round with given initial sample size
round_num = 1
previous_sample_size = 0
current_sample_size = self.sample_size
stop = False
# Draw a sample
sample = [0 for i in range(len(self.vote_dist))]
while round_num <= self.max_rounds:
# Draw a sample for current size
for i in range(current_sample_size - previous_sample_size):
ballot = r.randint(1, self.contest_ballots)
for j in range(len(sample)):
if ballot <= self.vote_dist[j][1]:
sample[j] += 1
break
relevant_sample_size = current_sample_size - sample[-1]
# Perform audit computations
self.audit.rounds.append(relevant_sample_size)
self.audit.current_dist_null()
self.audit.current_dist_reported()
# Check if audit is completed
if (self.audit.stopping_condition(sample[0])):
stop = True
# Continue audit computations
kmin = self.audit.next_min_winner_ballots(relevant_sample_size)
self.audit.min_winner_ballots.append(kmin)
self.audit.truncate_dist_null()
self.audit.truncate_dist_reported()
self.audit.sample_winner_ballots.append(sample[0])
# If audit is done, return trial output
if stop:
return {
'stop': stop,
'round': round_num,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_winner_ballots,
'kmin_sched': self.audit.min_winner_ballots
}
# Else choose a next round size and continue
round_num += 1
sample_mult = r.uniform(0.5, 1.5)
next_sample = math.ceil(self.sample_size * sample_mult)
previous_sample_size = current_sample_size
current_sample_size += next_sample
# If audit does not stop, return trial output
return {
'stop': stop,
'round': self.max_rounds,
'p_value_sched': self.audit.pvalue_schedule,
'p_value': self.audit.get_risk_level(),
'relevant_sample_size_sched': self.audit.rounds,
'winner_ballots_drawn_sched': self.audit.sample_winner_ballots,
'kmin_sched': self.audit.min_winner_ballots
}
def analyze(self, verbose: bool = False, hist: bool = False):
"""Analyse trials to get experimental stopping probability"""
if self.db_mode:
trials = self.db.trial_lookup(self.sim_id)
else:
trials = self.trials
num_trials = 0
stopped = 0
winner_ballot_dist = []
total_risk = 0.0
for trial in trials:
num_trials += 1
total_risk += trial['p_value']
if trial['stop']:
stopped += 1
winner_ballot_dist.append(trial['winner_ballots'])
# TODO: insert verbose and histograms
# Update simulation entry to include analysis
if self.db_mode:
analysis = {'avg_p_value': (total_risk / num_trials), 'sprob': (stopped / num_trials)}
self.db.update_analysis(self.sim_id, analysis)
return analysis
| 41.027135 | 134 | 0.597642 | 6,194 | 51,407 | 4.746367 | 0.044236 | 0.070751 | 0.019184 | 0.010102 | 0.966359 | 0.963434 | 0.957414 | 0.955271 | 0.955271 | 0.953638 | 0 | 0.010274 | 0.31272 | 51,407 | 1,252 | 135 | 41.059904 | 0.821828 | 0.1784 | 0 | 0.936099 | 0 | 0 | 0.087316 | 0.01247 | 0 | 0 | 0 | 0.007987 | 0 | 1 | 0.026906 | false | 0 | 0.007848 | 0 | 0.115471 | 0.024664 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
39d0b5cbaa15339582c41b3121d9cfc9b5b0a855 | 21,207 | py | Python | explicalib/experiments/setups/comparison_with_gt/plots.py | euranova/estimating_eces | 9bfa81dd7a39ebe069c5b11b8e7a9bf9017e9350 | [
"MIT"
] | 2 | 2021-11-30T18:44:11.000Z | 2021-11-30T18:44:19.000Z | explicalib/experiments/setups/comparison_with_gt/plots.py | euranova/estimating_eces | 9bfa81dd7a39ebe069c5b11b8e7a9bf9017e9350 | [
"MIT"
] | null | null | null | explicalib/experiments/setups/comparison_with_gt/plots.py | euranova/estimating_eces | 9bfa81dd7a39ebe069c5b11b8e7a9bf9017e9350 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: nicolas.posocco
"""
import copy
import numpy as np
from .utils import group_by, load_all
import matplotlib
import matplotlib.pyplot as plt
def add_normalized_trajectories(reports):
res = []
for report in reports:
report2 = copy.deepcopy(report)
gt = report["gt"]
report2["medians_norm"] = report["medians"] / gt
report2["highs_norm"] = report["highs"] / gt
res.append(report2)
return res
def aggregate_by_metric_complete(reports):
def aggregate(group):
result = {}
d = np.stack([report["medians"] for report in group])
distance_medians_gt_norm = np.median(d, axis=0)
result["medians"] = distance_medians_gt_norm
d = np.stack([report["highs"] for report in group])
distance_highs_gt_norm = np.median(d, axis=0)
result["highs"] = distance_highs_gt_norm
result["n_samples_calibration_evaluations"] = group[0]["n_samples_calibration_evaluations"]
# All groupped reports share the same metric settings
result["metric.__name__"] = group[0]["metric.__name__"]
result["metric_kwargs"] = group[0]["metric_kwargs"]
result["metric_complete"] = group[0]["metric_complete"]
return result
reports_groupped = group_by(reports, key="metric_complete")
reports_aggregated = [aggregate(group) for group in reports_groupped]
return reports_aggregated
def plot_all_upper(seed_train_test_split=None, seed_distribution=None, setup_name=None, n_features=None, ylim=None,
filter_in=None, title=None, cut_at=5000, font=None, reports=None):
metric_name_to_colors = {
"classwise_ece": "k",
"direct_classwise_ece": "g",
"classwise_ece_a": "r",
"classwise_ece_ma": "orange",
"classwise_ece_c": "b",
"classwise_ece_ac": "m",
"confidence_ece": "k",
"direct_confidence_ece": "g",
"confidence_ece_a": "r",
"confidence_ece_ma": "orange",
"confidence_ece_c": "b",
"confidence_ece_ac": "m",
"binary_ece": "k",
"direct_binary_ece": "g",
"binary_ece_a": "r",
"binary_ece_ma": "orange",
"binary_ece_c": "b",
"binary_ece_ac": "m",
}
metric_complete_to_linestyle = {
"sqrt": "--",
# "direct": ":", # if silverman, gets replaced by
"silverman": "-.",
}
metric_complete_to_alpha = {
"{'n_bins': 10}": 1.0,
"{'n_bins': 20}": 0.7,
"{'n_bins': 30}": 0.4,
"{'bandwidth': 0.01}": 0.4,
"{'bandwidth': 0.033}": 0.7,
"{'bandwidth': 0.05}": 0.8,
"{'bandwidth': 0.1}": 1.0,
}
metric_name_to_clean_metric_name = {
"binary_ece": "$ECE^1$",
"binary_ece_c": "$ECE^1_c$",
"binary_ece_a": "$ECE^1_a$",
"binary_ece_ma": "$ECE^1_{ma}$",
"binary_ece_ac": "$ECE^1_{ac}$",
"direct_binary_ece": "$ECE^1_{kde}$",
"confidence_ece": "$ECE^{conf}$",
"confidence_ece_c": "$ECE^{conf}_c$",
"confidence_ece_a": "$ECE^{conf}_a$",
"confidence_ece_ma": "$ECE^{conf}_{ma}$",
"confidence_ece_ac": "$ECE^{conf}_{ac}$",
"direct_confidence_ece": "$ECE^{conf}_{kde}$",
"classwise_ece": "$ECE^{cw}$",
"classwise_ece_c": "$ECE^{cw}_c$",
"classwise_ece_a": "$ECE^{cw}_a$",
"classwise_ece_ma": "$ECE^{cw}_{ma}$",
"classwise_ece_ac": "$ECE^{cw}_{ac}$",
"direct_classwise_ece": "$ECE^{cw}_{kde}$",
}
assert reports is not None
# Setting font
if font is None:
font = {'family': 'DejaVu Sans', 'size': 15}
matplotlib.rc('font', **font)
#if reports is None:
# reports_df = load_all(setup_name=setup_name, protocol=4)
# reports = reports_df.to_dict(orient='records')
#if seed_train_test_split is not None:
# reports = filter(lambda report: report["seed_train_test_split"] == seed_train_test_split, reports)
#if seed_distribution is not None:
# reports = filter(lambda report: report["seed_distribution"] == seed_distribution, reports)
#if n_features is not None:
# reports = filter(lambda report: report["n_features"] == n_features, reports)
#if filter_in is not None:
# reports = filter(lambda report: filter_in(report), reports)
print("Aggregating {} trajectories.".format(len(reports)))
# Adding normalized trajectories
print(type(reports))
reports = add_normalized_trajectories(reports)
# Adding the distance between the median estimation and the ground truth (with and without normalization)
# reports = add_distances_to_gt(reports)
# Adding the width of the 95% confidence interval (with and without normalization)
# reports = add_confidence95_width(reports)
# Aggregating reports with the same metric_complete
reports = aggregate_by_metric_complete(reports)
# Sorting reports for consistent colors
reports = sorted(reports, key=lambda report: report["metric_complete"])
# Creating figure
fig = plt.figure(figsize=(14, 18))
gs = fig.add_gridspec(2, 1)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
legends = {}
for report in reports:
metric_complete = report["metric_complete"]
metric_complete = metric_complete.replace("classwise_", "").replace("binary_", "").replace("confidence_", "")
metric_name = report["metric.__name__"]
if metric_name not in legends:
legends[metric_name] = []
legends[metric_name].append((metric_complete, report))
max_entries = 0
for metric_name in legends:
max_entries = max(max_entries, len(legends[metric_name]))
# Populating figure
for metric_name in legends:
clean_metric_name = metric_name_to_clean_metric_name[metric_name]
ax2.plot([0, 1], [-1, -1], marker='o', linestyle="None", label=clean_metric_name,
color=metric_name_to_colors[metric_name])
for metric_complete, report in legends[metric_name]:
# Setting linestyle
linestyle = "solid"
for part in metric_complete_to_linestyle:
if part in report["metric_complete"]:
linestyle = metric_complete_to_linestyle[part]
# Setting color
color = "fuchsia"
for metric_name in metric_name_to_colors:
if metric_name == report["metric.__name__"]:
color = metric_name_to_colors[metric_name]
# Setting alpha
alpha = 1
for part in metric_complete_to_alpha:
if part in report["metric_complete"]:
alpha = metric_complete_to_alpha[part]
metric_complete = report["metric_complete"]
metric_complete = metric_complete.replace("classwise_", "").replace("binary_", "").replace("confidence_",
"")
metric_name = report["metric.__name__"]
metric_kwargs = report["metric_kwargs"]
# if "direct" in report["metric_complete"]:
# linestyle = ":"
# elif "sqrt" in report["metric_complete"]:
# linestyle = "--"
# elif "silverman" in report["metric_complete"]:
# linestyle = "-."
# else:
# linestyle="solid"
if metric_kwargs == "{'n_bins': 'sqrt'}":
metric_kwargs = "sqrt"
elif metric_kwargs == "{'bandwidth': 'silverman'}":
metric_kwargs = "Silverman"
elif "n_bins" in metric_kwargs:
n_bins = metric_kwargs.split(" ")[1][:-1]
metric_kwargs = str(n_bins) + " bins"
elif "bandwidth" in metric_kwargs:
bandwidth = metric_kwargs.split(" ")[1][:-1]
metric_kwargs = "bandwidth : " + str(bandwidth)
p = ax1.loglog(report["n_samples_calibration_evaluations"], report["medians"],
label=metric_kwargs, linestyle=linestyle, color=color, alpha=alpha)
ax2.loglog(report["n_samples_calibration_evaluations"], report["highs"],
label=metric_kwargs, linestyle=linestyle, color=color, alpha=alpha)
# If a blank space needs to be created
if metric_complete == legends[metric_name][-1][0] and len(legends[metric_name]) < max_entries:
n_empties = max_entries - len(legends[metric_name])
for i in range(n_empties):
ax2.plot([0, 1], [-1, -1], marker='o', label=".", color="white")
ax1.set_xlim(30, cut_at)
ax2.set_xlim(30, cut_at)
#ax1.set_ylim(0, ylim)
#ax2.set_ylim(0, ylim)
ax1.set_xticks([])
ax2.set_xticks([e for e in [30, 100, 200, 300, 400, 500, 5000] if e <= cut_at])
# ax1.set_ylabel("Median deviation to ground truth trajectories")
# ax2.set_ylabel("97.5th percentile deviation to ground truth trajectories")
# ax2.set_xlabel("Number of samples used for the computation")
# plt.legend([p], loc="lower center", bbox_to_anchor=(0.5, -0.3), ncol=3) #ax1.legend(loc=(1.025,0))
plt.legend(loc="lower center", bbox_to_anchor=(0.5, -0.325),
ncol=len(list(legends.keys()))) # ax1.legend(loc=(1.025,0))
# if title is not None:
# fig.title(title)
plt.tight_layout()
ax1.set_ylabel("Median deviation to ground truth trajectories")
ax2.set_ylabel("97.5th percentile deviation to ground truth trajectories")
ax2.set_xlabel("Number of samples used for the computation")
plt.show()
def plot_all(reports_classwise, reports_confidence, font=None):
metric_name_to_colors = {
"classwise_ece": "k",
"direct_classwise_ece": "g",
"classwise_ece_a": "r",
"classwise_ece_ma": "orange",
"classwise_ece_c": "b",
"classwise_ece_ac": "m",
"confidence_ece": "k",
"direct_confidence_ece": "g",
"confidence_ece_a": "r",
"confidence_ece_ma": "orange",
"confidence_ece_c": "b",
"confidence_ece_ac": "m",
"binary_ece": "k",
"direct_binary_ece": "g",
"binary_ece_a": "r",
"binary_ece_ma": "orange",
"binary_ece_c": "b",
"binary_ece_ac": "m",
}
metric_complete_to_linestyle = {
"sqrt": "--",
# "direct": ":", # if silverman, gets replaced by
"silverman": "-.",
}
metric_complete_to_alpha = {
"{'n_bins': 10}": 1.0,
"{'n_bins': 20}": 0.7,
"{'n_bins': 30}": 0.4,
"{'bandwidth': 0.01}": 0.4,
"{'bandwidth': 0.033}": 0.7,
"{'bandwidth': 0.05}": 0.8,
"{'bandwidth': 0.1}": 1.0,
}
metric_name_to_clean_metric_name = {
"binary_ece": "$ECE^1$",
"binary_ece_c": "$ECE^1_c$",
"binary_ece_a": "$ECE^1_a$",
"binary_ece_ma": "$ECE^1_{ma}$",
"binary_ece_ac": "$ECE^1_{ac}$",
"direct_binary_ece": "$ECE^1_{kde}$",
"confidence_ece": "$ECE^{conf}$",
"confidence_ece_c": "$ECE^{conf}_c$",
"confidence_ece_a": "$ECE^{conf}_a$",
"confidence_ece_ma": "$ECE^{conf}_{ma}$",
"confidence_ece_ac": "$ECE^{conf}_{ac}$",
"direct_confidence_ece": "$ECE^{conf}_{kde}$",
"classwise_ece": "$ECE^{cw}$",
"classwise_ece_c": "$ECE^{cw}_c$",
"classwise_ece_a": "$ECE^{cw}_a$",
"classwise_ece_ma": "$ECE^{cw}_{ma}$",
"classwise_ece_ac": "$ECE^{cw}_{ac}$",
"direct_classwise_ece": "$ECE^{cw}_{kde}$",
}
assert reports_classwise is not None
assert reports_confidence is not None
# Setting font
if font is None:
font = {'family': 'DejaVu Sans', 'size': 15}
matplotlib.rc('font', **font)
print("CW : Aggregating {} trajectories.".format(len(reports_classwise)))
print("CONF : Aggregating {} trajectories.".format(len(reports_confidence)))
# Adding normalized trajectories
reports_classwise = add_normalized_trajectories(reports_classwise)
reports_confidence = add_normalized_trajectories(reports_confidence)
# Aggregating reports with the same metric_complete
reports_classwise = aggregate_by_metric_complete(reports_classwise)
reports_confidence = aggregate_by_metric_complete(reports_confidence)
# Sorting reports for consistent colors
reports_classwise = sorted(reports_classwise, key=lambda report: report["metric_complete"])
# Creating figure
fig = plt.figure(figsize=(14, 18))
gs = fig.add_gridspec(2, 1)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
# CLasswise
legends = {}
for report in reports_classwise:
metric_complete = report["metric_complete"]
metric_complete = metric_complete.replace("classwise_", "").replace("binary_", "").replace("confidence_", "")
metric_name = report["metric.__name__"]
if metric_name not in legends:
legends[metric_name] = []
legends[metric_name].append((metric_complete, report))
max_entries = 0
for metric_name in legends:
max_entries = max(max_entries, len(legends[metric_name]))
# Populating figure
for metric_name in legends:
clean_metric_name = metric_name_to_clean_metric_name[metric_name]
ax2.plot([0, 1], [-1, -1], marker='o', linestyle="None", label=clean_metric_name,
color=metric_name_to_colors[metric_name])
for metric_complete, report in legends[metric_name]:
# Setting linestyle
linestyle = "solid"
for part in metric_complete_to_linestyle:
if part in report["metric_complete"]:
linestyle = metric_complete_to_linestyle[part]
# Setting color
color = "fuchsia"
for metric_name in metric_name_to_colors:
if metric_name == report["metric.__name__"]:
color = metric_name_to_colors[metric_name]
# Setting alpha
alpha = 1
for part in metric_complete_to_alpha:
if part in report["metric_complete"]:
alpha = metric_complete_to_alpha[part]
metric_complete = report["metric_complete"]
metric_complete = metric_complete.replace("classwise_", "").replace("binary_", "").replace("confidence_",
"")
metric_name = report["metric.__name__"]
metric_kwargs = report["metric_kwargs"]
# if "direct" in report["metric_complete"]:
# linestyle = ":"
# elif "sqrt" in report["metric_complete"]:
# linestyle = "--"
# elif "silverman" in report["metric_complete"]:
# linestyle = "-."
# else:
# linestyle="solid"
if metric_kwargs == "{'n_bins': 'sqrt'}":
metric_kwargs = "sqrt"
elif metric_kwargs == "{'bandwidth': 'silverman'}":
metric_kwargs = "Silverman"
elif "n_bins" in metric_kwargs:
n_bins = metric_kwargs.split(" ")[1][:-1]
metric_kwargs = str(n_bins) + " bins"
elif "bandwidth" in metric_kwargs:
bandwidth = metric_kwargs.split(" ")[1][:-1]
metric_kwargs = "bandwidth : " + str(bandwidth)
p = ax1.loglog(report["n_samples_calibration_evaluations"], report["highs"],
label=metric_kwargs, linestyle=linestyle, color=color, alpha=alpha)
#ax2.loglog(report["n_samples_calibration_evaluations"], report["highs"],
# label=metric_kwargs, linestyle=linestyle, color=color, alpha=alpha)
# If a blank space needs to be created
if metric_complete == legends[metric_name][-1][0] and len(legends[metric_name]) < max_entries:
n_empties = max_entries - len(legends[metric_name])
for i in range(n_empties):
ax2.plot([0, 1], [-1, -1], marker='o', label=".", color="white")
# Confidence
legends = {}
for report in reports_confidence:
metric_complete = report["metric_complete"]
metric_complete = metric_complete.replace("classwise_", "").replace("binary_", "").replace("confidence_",
"")
metric_name = report["metric.__name__"]
if metric_name not in legends:
legends[metric_name] = []
legends[metric_name].append((metric_complete, report))
max_entries = 0
for metric_name in legends:
max_entries = max(max_entries, len(legends[metric_name]))
# Populating figure
for metric_name in legends:
clean_metric_name = metric_name_to_clean_metric_name[metric_name]
ax2.plot([0, 1], [-1, -1], marker='o', linestyle="None", label=clean_metric_name,
color=metric_name_to_colors[metric_name])
for metric_complete, report in legends[metric_name]:
# Setting linestyle
linestyle = "solid"
for part in metric_complete_to_linestyle:
if part in report["metric_complete"]:
linestyle = metric_complete_to_linestyle[part]
# Setting color
color = "fuchsia"
for metric_name in metric_name_to_colors:
if metric_name == report["metric.__name__"]:
color = metric_name_to_colors[metric_name]
# Setting alpha
alpha = 1
for part in metric_complete_to_alpha:
if part in report["metric_complete"]:
alpha = metric_complete_to_alpha[part]
metric_complete = report["metric_complete"]
metric_complete = metric_complete.replace("classwise_", "").replace("binary_", "").replace(
"confidence_",
"")
metric_name = report["metric.__name__"]
metric_kwargs = report["metric_kwargs"]
# if "direct" in report["metric_complete"]:
# linestyle = ":"
# elif "sqrt" in report["metric_complete"]:
# linestyle = "--"
# elif "silverman" in report["metric_complete"]:
# linestyle = "-."
# else:
# linestyle="solid"
if metric_kwargs == "{'n_bins': 'sqrt'}":
metric_kwargs = "sqrt"
elif metric_kwargs == "{'bandwidth': 'silverman'}":
metric_kwargs = "Silverman"
elif "n_bins" in metric_kwargs:
n_bins = metric_kwargs.split(" ")[1][:-1]
metric_kwargs = str(n_bins) + " bins"
elif "bandwidth" in metric_kwargs:
bandwidth = metric_kwargs.split(" ")[1][:-1]
metric_kwargs = "bandwidth : " + str(bandwidth)
p = ax2.loglog(report["n_samples_calibration_evaluations"], report["highs"],
label=metric_kwargs, linestyle=linestyle, color=color, alpha=alpha)
# ax2.loglog(report["n_samples_calibration_evaluations"], report["highs"],
# label=metric_kwargs, linestyle=linestyle, color=color, alpha=alpha)
# If a blank space needs to be created
if metric_complete == legends[metric_name][-1][0] and len(legends[metric_name]) < max_entries:
n_empties = max_entries - len(legends[metric_name])
for i in range(n_empties):
ax2.plot([0, 1], [-1, -1], marker='o', label=".", color="white")
ax1.set_xlim(30, 500)
#ax2.set_xlim(30, 500)
# ax1.set_ylim(0, ylim)
# ax2.set_ylim(0, ylim)
ax1.set_xticks([])
#ax2.set_xticks([e for e in [30, 100, 200, 300, 400, 500, 5000] if e <= cut_at])
# ax1.set_ylabel("Median deviation to ground truth trajectories")
# ax2.set_ylabel("97.5th percentile deviation to ground truth trajectories")
# ax2.set_xlabel("Number of samples used for the computation")
# plt.legend([p], loc="lower center", bbox_to_anchor=(0.5, -0.3), ncol=3) #ax1.legend(loc=(1.025,0))
plt.legend(loc="lower center", bbox_to_anchor=(0.5, -0.325),
ncol=len(list(legends.keys()))) # ax1.legend(loc=(1.025,0))
# if title is not None:
# fig.title(title)
plt.tight_layout()
ax1.set_ylabel("Median deviation to ground truth trajectories")
#ax2.set_ylabel("97.5th percentile deviation to ground truth trajectories")
#ax2.set_xlabel("Number of samples used for the computation")
plt.show()
| 37.937388 | 117 | 0.579384 | 2,441 | 21,207 | 4.748054 | 0.092995 | 0.07679 | 0.039689 | 0.028473 | 0.839776 | 0.806385 | 0.793098 | 0.790164 | 0.773598 | 0.766005 | 0 | 0.021621 | 0.289008 | 21,207 | 558 | 118 | 38.005376 | 0.747049 | 0.17315 | 0 | 0.792899 | 0 | 0 | 0.202777 | 0.016181 | 0 | 0 | 0 | 0 | 0.008876 | 1 | 0.014793 | false | 0 | 0.014793 | 0 | 0.038462 | 0.011834 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
84020d9347c121077715049f27a44cd997df91ba | 9,008 | py | Python | tests/common/server_sent_events/sse4python/test_event_source.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | tests/common/server_sent_events/sse4python/test_event_source.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | tests/common/server_sent_events/sse4python/test_event_source.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | from yellowdog_client.common.server_sent_events.sse4python import EventSource
from yellowdog_client.common.server_sent_events.sse4python import EventSourceState
import pytest
class TestIsClosed(object):
def test__token_source_cancelled__state_closed__expect_closed(self, mocker):
mock_token = mocker.patch(
"yellowdog_client.common.server_sent_events.sse4python.event_source.CancellationToken"
)
mock_token.return_value.cancelled = True
state = mocker.MagicMock()
state.state.return_value = EventSourceState.CLOSED
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source.__setattr__("__current_state_internal", state)
assert source.is_closed
def test__token_source_non_cancelled__state_closed__expect_not_closed(self, mocker):
mock_token = mocker.patch(
"yellowdog_client.common.server_sent_events.sse4python.event_source.CancellationToken"
)
mock_token.return_value.cancelled = False
state = mocker.MagicMock()
state.state.return_value = EventSourceState.CLOSED
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source.__setattr__("__current_state_internal", state)
assert not source.is_closed
def test__token_source_non_cancelled__state_not_closed__expect_closed(self, mocker):
mock_token = mocker.patch(
"yellowdog_client.common.server_sent_events.sse4python.event_source.CancellationToken"
)
mock_token.return_value.cancelled = True
state = mocker.MagicMock()
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source._current_state_internal = state
state.state = EventSourceState.CONNECTING
assert not source.is_closed
state.state = EventSourceState.OPEN
assert not source.is_closed
class TestSetCurrentState(object):
def test__set_current_state__same_value__expect_no_dispatch(self, mocker):
state = mocker.MagicMock()
mock_on_status_change = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._on_status_changed")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
# part of constructor
mock_on_status_change.assert_called_once()
source._current_state_internal = state
source._current_state = state
assert source._current_state_internal == state
# still called once
mock_on_status_change.assert_called_once()
def test__set_current_state__expect_status_change_dispatch(self, mocker):
state = mocker.MagicMock()
state.state = "MY_CUSTOM_STATE"
mock_on_status_change = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._on_status_changed")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source._current_state = state
assert source._current_state_internal == state
mock_on_status_change.assert_any_call(state="MY_CUSTOM_STATE")
class TestStart(object):
def test__state_not_closed__expect_nothing_run(self, mocker):
state = mocker.MagicMock()
state.state = "RANDOM_STATE"
mock_run = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._run")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
original_token = source._token_source
source._current_state = state
source.start()
assert source._token_source == original_token
mock_run.assert_not_called()
class TestStart(object):
def test__state_not_closed__expect_nothing_run(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.OPEN
mock_run = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._run")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
original_token = source._token_source
source._current_state = state
source.start()
assert source._token_source == original_token
mock_run.assert_not_called()
def test__state_closed__expect_run_called(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.CLOSED
mock_run = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._run")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
original_token = source._token_source
source._current_state = state
source.start()
assert source._token_source != original_token
mock_run.assert_called_once()
class TestStop(object):
def test__token_cancelled__expect_nothing_invoked(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.OPEN
mock_completed = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._on_event_source_completed")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source._token_source.cancel()
source.stop()
mock_completed.assert_not_called()
def test__token_not_cancelled__expect_cancelled_and_complete_invoked(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.OPEN
mock_completed = mocker.patch("yellowdog_client.common.server_sent_events.sse4python.event_source.EventSource._on_event_source_completed")
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
assert not source._token_source.cancelled
source.stop()
assert source._token_source.cancelled
mock_completed.assert_called_once()
class TestContinuationCallback(object):
def test_token_cancelled__state_closed__expect_continuous_run_not_invoked(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.CLOSED
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source._token_source.cancel()
source._continuation_callback(connection_state=state)
state.run.assert_not_called()
def test_token_not_cancelled__state_closed__expect_continuous_run_invoked(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.CLOSED
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
assert not source._token_source.cancelled
source._continuation_callback(connection_state=state)
state.run.assert_called_once_with(
message_received=source._on_event_received,
error_handle=source._on_error_received,
completed=source._on_event_source_completed,
cancel_token=source._token_source,
continuation_callback=source._continuation_callback
)
def test_token_cancelled__state_not_closed__expect_continuous_run_invoked(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.CONNECTING
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source._token_source.cancel()
source._continuation_callback(connection_state=state)
state.run.assert_called_once_with(
message_received=source._on_event_received,
error_handle=source._on_error_received,
completed=source._on_event_source_completed,
cancel_token=source._token_source,
continuation_callback=source._continuation_callback
)
def test_token_not_cancelled__state_not_closed__expect_continuous_run_invoked(self, mocker):
state = mocker.MagicMock()
state.state = EventSourceState.CONNECTING
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
assert not source._token_source.cancelled
source._continuation_callback(connection_state=state)
state.run.assert_called_once_with(
message_received=source._on_event_received,
error_handle=source._on_error_received,
completed=source._on_event_source_completed,
cancel_token=source._token_source,
continuation_callback=source._continuation_callback
)
class TestOnStatusChanged(object):
@pytest.fixture
def result_fixture(self):
self.__result = None
return self.__result
def set_result(self, state):
self.__result = state
def test__event_received(self, mocker, result_fixture):
source = EventSource(url=mocker.MagicMock(), factory=mocker.MagicMock())
source.bind(state_changed=self.set_result)
thread = source._on_status_changed(state=EventSourceState.CONNECTING)
thread.join()
assert self.__result == EventSourceState.CONNECTING
| 38.660944 | 146 | 0.729241 | 996 | 9,008 | 6.164659 | 0.094378 | 0.107492 | 0.0443 | 0.063518 | 0.864169 | 0.829316 | 0.813029 | 0.79544 | 0.783713 | 0.744788 | 0 | 0.001647 | 0.191163 | 9,008 | 232 | 147 | 38.827586 | 0.841065 | 0.004107 | 0 | 0.707317 | 0 | 0 | 0.11095 | 0.106267 | 0 | 0 | 0 | 0 | 0.158537 | 1 | 0.103659 | false | 0 | 0.018293 | 0 | 0.170732 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
840ce98787d2e3c7471c57bcda5eb6a8ddfa194d | 73,811 | py | Python | testsuite/test_sockets.py | ronaldoussoren/objc_asyncio | 89e573fd4c95592515ea8c8a4abfeebdd261fde2 | [
"MIT-0"
] | 2 | 2021-02-20T22:10:54.000Z | 2021-03-26T21:45:06.000Z | testsuite/test_sockets.py | ronaldoussoren/objc_asyncio | 89e573fd4c95592515ea8c8a4abfeebdd261fde2 | [
"MIT-0"
] | null | null | null | testsuite/test_sockets.py | ronaldoussoren/objc_asyncio | 89e573fd4c95592515ea8c8a4abfeebdd261fde2 | [
"MIT-0"
] | null | null | null | import asyncio
import errno
import io
import os
import socket
import tempfile
import threading
import time
import unittest.mock
import objc_asyncio._sockets
from . import utils
class TestSocketEvents(utils.TestCase):
def test_callout_error(self):
class MyException(Exception):
pass
sd1, sd2 = self.make_socketpair()
def callback(sd):
try:
sd.send("hello")
except Exception:
pass
with utils.captured_log() as stream:
with unittest.mock.patch.object(
self.loop, "_process_events", side_effect=MyException
):
async def main():
await asyncio.sleep(0.1)
self.loop.add_writer(sd1, callback, sd1)
self.loop.run_until_complete(main())
self.assertIn("Unexpected exception in selector handling", stream.getvalue())
def test_callout_systemexit(self):
for exception in (SystemExit, KeyboardInterrupt):
with self.subTest(exception=exception):
sd1, sd2 = self.make_socketpair()
def callback(sd):
try:
sd.send("hello")
except Exception:
pass
with unittest.mock.patch.object(
self.loop, "_process_events", side_effect=exception
):
async def main():
try:
await asyncio.sleep(0.1)
except Exception:
pass
self.loop.add_writer(sd1, callback, sd1)
with self.assertRaises(exception):
self.loop.run_until_complete(main())
def test_add_reader(self):
sd1, sd2 = self.make_socketpair()
data = []
def callback(sd):
data.append(sd.recv(100))
self.loop.add_reader(sd1, callback, sd1)
async def writer():
sd2.sendall(b"hello")
await asyncio.sleep(0.1)
sd2.sendall(b"world")
await asyncio.sleep(0.1)
self.loop.run_until_complete(writer())
self.assertEqual(data, [b"hello", b"world"])
count = 0
def callback(sd):
nonlocal count
count += 1
self.loop.add_reader(sd1, callback, sd1)
self.loop.run_until_complete(writer())
# We pass through the loop at least twice without
# consuming the read event, hence the callback should
# be called multiple times.
self.assertGreater(count, 1)
def test_cancel_reader(self):
sd1, sd2 = self.make_socketpair()
data = []
count = 0
def callback(sd):
data.append(sd.recv(100))
def no_callback():
nonlocal count
count += 1
self.loop.add_reader(sd1, callback, sd1)
async def writer():
sd2.sendall(b"hello")
await asyncio.sleep(0.1)
self.loop.add_reader(sd1, no_callback)
sd2.sendall(b"world")
await asyncio.sleep(0.1)
self.loop.run_until_complete(writer())
self.assertEqual(data, [b"hello"])
self.assertGreater(count, 0)
def test_remove_reader(self):
sd1, sd2 = self.make_socketpair()
data = []
def callback(sd):
data.append(sd.recv(100))
self.loop.add_reader(sd1, callback, sd1)
async def writer():
sd2.sendall(b"hello")
await asyncio.sleep(0.1)
self.loop.remove_reader(sd1)
sd2.sendall(b"world")
await asyncio.sleep(0.1)
self.loop.run_until_complete(writer())
self.assertEqual(data, [b"hello"])
def test_add_writer(self):
sd1, sd2 = self.make_socketpair()
data = []
def callback(sd):
sd.send(b"x" * 1024 * 1024)
self.loop.add_writer(sd1, callback, sd1)
async def writer():
await asyncio.sleep(0.1)
self.loop.run_until_complete(writer())
data = sd2.recv(1024 * 1024)
self.assertGreater(len(data), 0)
self.assertRegex(data, b"^x+$")
count = 0
def callback(sd):
nonlocal count
count += 1
self.loop.add_writer(sd1, callback, sd1)
self.loop.run_until_complete(writer())
# We pass through the loop at least twice without
# consuming the read event, hence the callback should
# be called multiple times.
self.assertGreater(count, 1)
def test_cancel_writer(self):
sd1, sd2 = self.make_socketpair()
count = 0
def callback(sd):
sd.send(b"hello world\n")
self.loop.add_writer(sd1, no_callback)
def no_callback():
nonlocal count
count += 1
self.loop.add_writer(sd1, callback, sd1)
async def writer():
await asyncio.sleep(0.1)
await asyncio.sleep(0.1)
self.loop.run_until_complete(writer())
data = sd2.recv(1024)
self.assertTrue(data.startswith(b"hello world\n"))
self.assertGreater(count, 0)
def test_remove_writer(self):
sd1, sd2 = self.make_socketpair()
data = []
def callback(sd):
sd.send(b"hello")
self.loop.remove_writer(sd)
self.loop.add_writer(sd1, callback, sd1)
async def writer():
await asyncio.sleep(0.1)
await asyncio.sleep(0.1)
self.loop.run_until_complete(writer())
data = sd2.recv(1024)
self.assertEqual(data, b"hello")
class TestLowLevelIO(utils.TestCase):
def test_sock_recv_data_available(self):
sd1, sd2 = self.make_socketpair()
data = None
async def main():
nonlocal data
data = await self.loop.sock_recv(sd1, 100)
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertEqual(data, b"hello")
def test_sock_recv_waiting(self):
for debug in (False, True):
with self.subTest(debug=debug):
self.loop.set_debug(debug)
sd1, sd2 = self.make_socketpair()
data = None
async def main():
nonlocal data
data = await self.loop.sock_recv(sd1, 100)
self.loop.call_later(0.5, lambda: sd2.send(b"hello"))
self.loop.run_until_complete(main())
self.assertEqual(data, b"hello")
def test_sock_recv_socket_is_blocking(self):
# The check for blocking sockets is only done
# in debug mode.
self.loop.set_debug(True)
sd1, sd2 = self.make_socketpair()
sd1.setblocking(True)
data = exception = None
async def main():
nonlocal data, exception
try:
data = await self.loop.sock_recv(sd1, 100)
except Exception as exc:
exception = exc
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertEqual(data, None)
self.assertIsInstance(exception, ValueError)
def test_sock_recv_blocking(self):
self.loop.set_debug(True)
for exception_class in (BlockingIOError, InterruptedError):
with self.subTest(exception_class=exception_class):
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.recv.side_effect = [
BlockingIOError(),
exception_class(),
b"world",
]
sd_mock.fileno.return_value = sd1.fileno()
sd_mock.gettimeout.return_value = sd1.gettimeout()
data = exception = None
async def main():
nonlocal data, exception
try:
data = await self.loop.sock_recv(sd_mock, 100)
except Exception as exc:
exception = exc
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertIs(exception, None)
self.assertEqual(data, b"world")
def test_sock_recv_error(self):
class MyException(Exception):
pass
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.recv.side_effect = [BlockingIOError(), MyException()]
sd_mock.fileno.return_value = sd1.fileno()
data = exception = None
async def main():
nonlocal data, exception
try:
data = await self.loop.sock_recv(sd_mock, 100)
except Exception as exc:
exception = exc
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertIsInstance(exception, MyException)
self.assertIs(data, None)
def test_sock_recv_systemexit(self):
# XXX: This test hangs, need to debug
for exception_class in (SystemExit, KeyboardInterrupt):
with self.subTest(exception_class=exception_class):
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.recv.side_effect = [
BlockingIOError(),
exception_class(),
b"dummy",
]
sd_mock.fileno.return_value = sd1.fileno()
data = exception = None
async def main():
nonlocal data, exception
try:
data = await self.loop.sock_recv(sd_mock, 100)
except Exception as exc:
exception = exc
sd2.send(b"hello")
with self.assertRaises(exception_class):
self.loop.run_until_complete(main())
def test_sock_recv_into_data_available(self):
sd1, sd2 = self.make_socketpair()
data = None
n = None
async def main():
nonlocal data, n
data = bytearray(500)
n = await self.loop.sock_recv_into(sd1, data)
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertEqual(n, 5)
self.assertEqual(data[:n], b"hello")
def test_sock_recv_into_waiting(self):
for debug in (False, True):
with self.subTest(debug=debug):
self.loop.set_debug(debug)
sd1, sd2 = self.make_socketpair()
data = None
n = None
async def main():
nonlocal data, n
data = bytearray(500)
n = await self.loop.sock_recv_into(sd1, data)
self.loop.call_later(0.5, lambda: sd2.send(b"hello"))
self.loop.run_until_complete(main())
self.assertEqual(n, 5)
self.assertEqual(data[:n], b"hello")
def test_sock_recv_into_socket_is_blocking(self):
# The check for blocking sockets is only done
# in debug mode.
self.loop.set_debug(True)
sd1, sd2 = self.make_socketpair()
sd1.setblocking(True)
data = exception = n = None
async def main():
nonlocal data, n, exception
try:
data = bytearray(500)
n = await self.loop.sock_recv_into(sd1, data)
except Exception as exc:
exception = exc
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertEqual(data[0], 0)
self.assertIsInstance(exception, ValueError)
def test_sock_recv_into_blocking(self):
self.loop.set_debug(True)
for exception_class in (BlockingIOError, InterruptedError):
with self.subTest(exception_class=exception_class):
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.recv_into.side_effect = [
BlockingIOError(),
exception_class(),
8,
]
sd_mock.fileno.return_value = sd1.fileno()
sd_mock.gettimeout.return_value = sd1.gettimeout()
data = n = exception = None
async def main():
nonlocal data, n, exception
try:
data = bytearray(500)
n = await self.loop.sock_recv_into(sd_mock, data)
except Exception as exc:
exception = exc
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertIs(exception, None)
self.assertEqual(n, 8)
def test_sock_recv_into_error(self):
class MyException(Exception):
pass
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.recv_into.side_effect = [BlockingIOError(), MyException()]
sd_mock.fileno.return_value = sd1.fileno()
data = n = exception = None
async def main():
nonlocal data, n, exception
try:
data = bytearray(500)
n = await self.loop.sock_recv_into(sd_mock, data)
except Exception as exc:
exception = exc
sd2.send(b"hello")
self.loop.run_until_complete(main())
self.assertIsInstance(exception, MyException)
self.assertIs(data[0], 0)
def test_sock_recv_into_systemexit(self):
for exception_class in (SystemExit, KeyboardInterrupt):
with self.subTest(exception_class=exception_class):
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.recv_into.side_effect = [
BlockingIOError(),
exception_class(),
b"dummy",
]
sd_mock.fileno.return_value = sd1.fileno()
data = n = exception = None
async def main():
nonlocal data, n, exception
try:
data = bytearray(500)
n = await self.loop.sock_recv_into(sd_mock, data)
except Exception as exc:
exception = exc
sd2.send(b"hello")
with self.assertRaises(exception_class):
self.loop.run_until_complete(main())
def test_sock_accept(self):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
server_sd.setblocking(False)
client_sd = client_addr = None
sd = None
def cleanup():
if server_sd is not None:
server_sd.close()
if client_sd is not None:
client_sd.close()
if sd is not None:
sd.close()
self.addCleanup(cleanup)
def client():
nonlocal sd
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sd.connect(server_sd.getsockname())
async def main():
nonlocal client_sd, client_addr
client_sd, client_addr = await self.loop.sock_accept(server_sd)
self.loop.call_later(0.1, client)
self.loop.run_until_complete(main())
self.assertIsInstance(client_sd, socket.socket)
self.assertIsInstance(client_addr, tuple)
def test_sock_accept_available(self):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
server_sd.setblocking(False)
client_sd = client_addr = None
sd = None
def cleanup():
if server_sd is not None:
server_sd.close()
if client_sd is not None:
client_sd.close()
if sd is not None:
sd.close()
self.addCleanup(cleanup)
def client():
nonlocal sd
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sd.connect(server_sd.getsockname())
async def main():
nonlocal client_sd, client_addr
client_sd, client_addr = await self.loop.sock_accept(server_sd)
client()
self.loop.run_until_complete(main())
self.assertIsInstance(client_sd, socket.socket)
self.assertIsInstance(client_addr, tuple)
def test_sock_accept_blocking_socket(self):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
self.addCleanup(server_sd.close)
self.loop.set_debug(True)
async def main():
await self.loop.sock_accept(server_sd)
with self.assertRaisesRegex(ValueError, "must be non-blocking"):
self.loop.run_until_complete(main())
def test_sock_accept_systemexit(self):
for exception_class in (SystemExit, KeyboardInterrupt):
with self.subTest(exception_class=exception_class):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
self.addCleanup(server_sd.close)
sd_mock = unittest.mock.create_autospec(server_sd)
sd_mock.accept.side_effect = [
BlockingIOError(),
exception_class(),
b"dummy",
]
sd_mock.fileno.return_value = server_sd.fileno()
exception = None
sd = None
def client():
nonlocal sd
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sd.connect(server_sd.getsockname())
async def main():
nonlocal exception
try:
await self.loop.sock_accept(sd_mock)
except Exception as exc:
exception = exc
client()
self.addCleanup(sd.close)
with self.assertRaises(exception_class):
self.loop.run_until_complete(main())
def test_sock_accept_exception(self):
class MyException(Exception):
pass
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
self.addCleanup(server_sd.close)
sd_mock = unittest.mock.create_autospec(server_sd)
sd_mock.accept.side_effect = [BlockingIOError(), MyException(), b"dummy"]
sd_mock.fileno.return_value = server_sd.fileno()
exception = None
sd = None
def client():
nonlocal sd
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sd.connect(server_sd.getsockname())
async def main():
nonlocal exception
try:
await self.loop.sock_accept(sd_mock)
except Exception as exc:
exception = exc
client()
self.addCleanup(sd.close)
self.loop.run_until_complete(main())
self.assertIsInstance(exception, MyException)
def test_sock_connect(self):
for famname, family, server_addr in (
("INET", socket.AF_INET, ("127.0.0.1", 0)),
("UNIX", socket.AF_UNIX, f"testsocket.{os.getpid()}"),
):
with self.subTest(family=famname):
server_sd = socket.socket(family, socket.SOCK_STREAM, 0)
self.addCleanup(server_sd.close)
server_sd.bind(server_addr)
if family == socket.AF_UNIX:
self.addCleanup(os.unlink, server_addr)
server_sd.listen(5)
server_sd.setblocking(False)
client_sd = socket.socket(family, socket.SOCK_STREAM, 0)
self.addCleanup(client_sd.close)
client_sd.setblocking(False)
def server():
sd, addr = server_sd.accept()
try:
self.assertEqual(sd.getpeername(), client_sd.getsockname())
self.assertEqual(
client_sd.getpeername(), server_sd.getsockname()
)
finally:
sd.close()
async def main():
await self.loop.sock_connect(client_sd, server_sd.getsockname())
await asyncio.sleep(0.2)
self.loop.call_later(0.1, server)
self.loop.run_until_complete(main())
# self.assertEqual(client_sd.getpeername(), server_sd.getsockname())
# self.assertEqual(sd.getpeername(), client_sd.getsockname())
def test_sock_connect_blocking_socket(self):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
self.addCleanup(server_sd.close)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
server_sd.setblocking(False)
client_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
self.addCleanup(client_sd.close)
client_sd.setblocking(True)
self.loop.set_debug(True)
async def main():
await self.loop.sock_connect(client_sd, server_sd.getsockname())
with self.assertRaisesRegex(ValueError, "must be non-blocking"):
self.loop.run_until_complete(main())
def test_sock_connect_no_connection(self):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
server_sd.setblocking(False)
server_addr = server_sd.getsockname()
server_sd.close()
server_sd = None
client_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
client_sd.setblocking(False)
self.addCleanup(client_sd.close)
async def main():
await self.loop.sock_connect(client_sd, server_addr)
with self.assertRaises(socket.error):
self.loop.run_until_complete(main())
def test_sock_connect_systemexit(self):
for exception_class in (SystemExit, KeyboardInterrupt):
with self.subTest(exception_class=exception_class):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
self.addCleanup(server_sd.close)
client_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
self.addCleanup(client_sd.close)
client_sd.setblocking(False)
sd_mock = unittest.mock.create_autospec(client_sd)
sd_mock.connect.side_effect = [exception_class, b"dummy"]
sd_mock.fileno.return_value = client_sd.fileno()
sd_mock.family = client_sd.family
sd_mock.proto = client_sd.proto
sd_mock.getsockopt.side_effect = lambda *args: client_sd.getsockopt(
*args
)
exception = None
async def main():
nonlocal exception
try:
await self.loop.sock_connect(sd_mock, server_sd.getsockname())
except Exception as exc:
exception = exc
with self.assertRaises(exception_class):
self.loop.run_until_complete(main())
self.assertIs(exception, None)
def test_sock_connect_exception(self):
class MyException(Exception):
pass
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
self.addCleanup(server_sd.close)
client_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
self.addCleanup(client_sd.close)
client_sd.setblocking(False)
sd_mock = unittest.mock.create_autospec(client_sd)
sd_mock.connect.side_effect = [MyException, b"dummy"]
sd_mock.fileno.return_value = client_sd.fileno()
sd_mock.family = client_sd.family
sd_mock.proto = client_sd.proto
sd_mock.getsockopt.side_effect = lambda *args: client_sd.getsockopt(*args)
exception = None
async def main():
nonlocal exception
try:
await self.loop.sock_connect(sd_mock, server_sd.getsockname())
except Exception as exc:
exception = exc
self.loop.run_until_complete(main())
self.assertIsInstance(exception, MyException)
def test_connect_hostname(self):
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
self.addCleanup(sd.close)
sd.setblocking(False)
async def main():
await self.loop.sock_connect(sd, ("www.python.org", 80))
self.loop.run_until_complete(main())
# Quick check that the socket is now connected:
sd.getpeername()
def test_sock_sendall_some_data(self):
sd1, sd2 = self.make_socketpair()
data = None
async def main():
await self.loop.sock_sendall(sd1, b"hello world")
self.loop.run_until_complete(main())
data = sd2.recv(100)
self.assertEqual(data, b"hello world")
def test_sock_sendall_bulk(self):
sd1, sd2 = self.make_socketpair()
data = None
blob = b"data" * 1024 * 1024
def client():
sd2.setblocking(True)
buf = []
while True:
data = sd2.recv(1024)
if not data:
break
buf.append(data)
return b"".join(buf)
async def main():
await self.loop.sock_sendall(sd1, blob)
fut = self.loop.run_in_executor(None, client)
self.loop.run_until_complete(main())
sd1.close()
data = self.loop.run_until_complete(fut)
self.assertEqual(data, blob)
def test_sock_sendall_blocking_socket(self):
sd1, sd2 = self.make_socketpair()
sd1.setblocking(True)
self.loop.set_debug(True)
async def main():
await self.loop.sock_sendall(sd1, b"hello world")
with self.assertRaisesRegex(ValueError, "must be non-blocking"):
self.loop.run_until_complete(main())
def test_sock_sendall_blocked(self):
sd1, sd2 = self.make_socketpair()
exceptions = []
def side_effect(*args):
try:
exc = exceptions.pop()
except IndexError:
pass
else:
raise exc from None
return sd1.send(*args)
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.send.side_effect = side_effect
sd_mock.fileno.return_value = sd1.fileno()
async def main():
await self.loop.sock_sendall(sd_mock, b"hello world")
for level in (1, 2):
for exception in (BlockingIOError, InterruptedError):
with self.subTest(exception=exception, level=level):
exceptions = [exception for _ in range(level)]
self.loop.run_until_complete(main())
self.assertEqual(sd2.recv(1024), b"hello world")
def test_sock_sendall_systemexit(self):
sd1, sd2 = self.make_socketpair()
exceptions = []
def side_effect(*args):
try:
exc = exceptions.pop()
except IndexError:
pass
else:
raise exc from None
return sd1.send(*args)
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.send.side_effect = side_effect
sd_mock.fileno.return_value = sd1.fileno()
async def main():
await self.loop.sock_sendall(sd_mock, b"hello world")
for level in (1, 2):
for exc in (SystemExit, KeyboardInterrupt):
exceptions = [exc]
if level == 2:
exceptions.append(BlockingIOError)
with self.subTest(exception=exc, level=level):
with self.assertRaises(exc):
self.loop.run_until_complete(main())
def test_sock_sendall_exception(self):
# Arrange for exeption using mock.
class MyException(Exception):
pass
exceptions = []
def side_effect(*args):
try:
exc = exceptions.pop()
except IndexError:
pass
else:
raise exc
return sd1.send(*args)
sd1, sd2 = self.make_socketpair()
sd_mock = unittest.mock.create_autospec(sd1)
sd_mock.send.side_effect = side_effect
sd_mock.fileno.return_value = sd1.fileno()
async def main():
nonlocal exception
try:
await self.loop.sock_sendall(sd_mock, b"hello world")
except Exception as exc:
exception = exc
for level in (1, 2):
if level == 1:
exceptions = [MyException]
else:
exceptions = [MyException, BlockingIOError]
with self.subTest(level=level):
exception = None
self.loop.run_until_complete(main())
self.assertIsInstance(exception, MyException)
def basic_sendfile(self, stream, count=None, offset=0):
sd1, sd2 = self.make_socketpair()
expected = stream.read()
stream.seek(0)
def receiver(sd, buffer):
sd.setblocking(True)
while True:
buf = sd.recv(1024 * 1024)
if not buf:
break
buffer.append(buf)
async def main():
try:
await self.loop.sock_sendfile(sd1, stream, offset=offset, count=count)
finally:
sd1.close()
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
if count is not None:
self.assertEqual(b"".join(data), expected[offset : offset + count])
self.assertEqual(stream.tell(), offset + count)
else:
self.assertEqual(b"".join(data), expected[offset:])
self.assertEqual(stream.tell(), len(expected))
def test_sendfile_basic_file(self):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream)
def test_sendfile_basic_stringio(self):
stream = io.BytesIO()
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream)
def test_sendfile_basic_file_empty(self):
with tempfile.NamedTemporaryFile() as stream:
self.basic_sendfile(stream)
def test_sendfile_basic_stringio_empty(self):
stream = io.BytesIO()
self.basic_sendfile(stream)
def test_sendfile_basic_file_with_count(self):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream, count=123456)
def test_sendfile_basic_stringio_with_count(self):
stream = io.BytesIO()
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream, count=123456)
def test_sendfile_basic_file_with_offset(self):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"hello world")
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream, offset=5)
def test_sendfile_basic_stringio_with_offset(self):
stream = io.BytesIO()
stream.write(b"hello world")
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream, offset=5)
def test_sendfile_basic_file_with_offset_and_count(self):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"hello world")
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream, offset=5, count=12345)
def test_sendfile_basic_stringio_with_offset_and_count(self):
stream = io.BytesIO()
stream.write(b"hello world")
stream.write(b"X" * 1024 * 1024)
stream.seek(0)
self.basic_sendfile(stream, offset=5, count=12345)
def test_sock_sendfile_blocking_socket(self):
sd1, sd2 = self.make_socketpair()
sd1.setblocking(True)
async def main():
await self.loop.sock_sendfile(sd1, stream)
self.loop.set_debug(True)
with open(__file__, "rb") as stream:
with self.assertRaisesRegex(ValueError, "must be non-blocking"):
self.loop.run_until_complete(main())
self.assertEqual(stream.tell(), 0)
self.loop.set_debug(False)
def test_sock_sendfile_stringio_without_fallback(self):
sd1, sd2 = self.make_socketpair()
stream = io.BytesIO()
stream.write(b"X" * 100)
stream.seek(0)
async def main():
with self.assertRaises(asyncio.SendfileNotAvailableError):
await self.loop.sock_sendfile(sd1, stream, fallback=False)
self.assertEqual(stream.tell(), 0)
self.loop.run_until_complete(main())
def test_sock_sendfile_special_file_without_fallback(self):
# XXX: I have no idea how to trigger this a failure
# of os.fstat without using mock or a closed file.
#
# In particular, os.fstat should never fail unless either the file
# is closed, or there is a serious problem with the filesystem itself.
sd1, sd2 = self.make_socketpair()
with unittest.mock.patch.object(os, "fstat", side_effect=OSError):
with open("/dev/null", "rb") as stream:
async def main():
with self.assertRaises(asyncio.SendfileNotAvailableError):
await self.loop.sock_sendfile(sd1, stream, fallback=False)
self.assertEqual(stream.tell(), 0)
self.loop.run_until_complete(main())
def test_sock_sendfile_no_seek(self):
class MyFile:
def __init__(self, stream):
self._stream = stream
def fileno(self):
return self._stream.fileno()
def readinto(self, buf):
return self._stream.readinto(buf)
sd1, sd2 = self.make_socketpair()
def receiver(sd, buffer):
sd.setblocking(True)
while True:
buf = sd.recv(1024 * 1024)
if not buf:
break
buffer.append(buf)
async def main():
try:
await self.loop.sock_sendfile(sd1, stream)
finally:
sd1.close()
with tempfile.NamedTemporaryFile() as raw_stream:
raw_stream.write(b"X" * 1024 * 1024)
raw_stream.seek(0)
expected = raw_stream.read()
raw_stream.seek(0)
stream = MyFile(raw_stream)
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
self.assertEqual(b"".join(data), expected)
def test_sock_sendfile_blocking_call(self):
os_sendfile = os.sendfile
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024 * 1024)
for n in range(2):
for exception in (BlockingIOError, InterruptedError):
with self.subTest(num_blocks=n, exception=exception):
stream.seek(0)
left = n
def side_effect(*args, **kwds):
nonlocal left
if left > 0:
left -= 1
raise exception
return os_sendfile(*args, **kwds)
with unittest.mock.patch.object(
os, "sendfile", side_effect=side_effect
):
self.basic_sendfile(stream)
def test_sock_sendfile_devzero(self):
sd1, sd2 = self.make_socketpair()
def receiver(sd, buffer):
sd.setblocking(True)
while True:
buf = sd.recv(1024 * 1024)
if not buf:
break
buffer.append(buf)
async def main():
try:
await self.loop.sock_sendfile(sd1, stream, count=1000)
finally:
sd1.close()
with open("/dev/zero", "rb") as stream:
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
self.assertEqual(b"".join(data), b"\0" * 1000)
def test_sock_sendfile_error(self):
class MyException(Exception):
pass
sd1, sd2 = self.make_socketpair()
exception = None
def receiver(sd, buffer):
sd.setblocking(True)
while True:
buf = sd.recv(1024 * 1024)
if not buf:
break
buffer.append(buf)
async def main():
nonlocal exception
try:
try:
await self.loop.sock_sendfile(sd1, stream, count=1000)
finally:
sd1.close()
except Exception as exc:
exception = exc
with unittest.mock.patch.object(os, "sendfile", side_effect=MyException):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024)
stream.seek(0)
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
self.assertIsInstance(exception, MyException)
self.assertEqual(b"".join(data), b"")
def test_sock_sendfile_error_after_sent(self):
sd1, sd2 = self.make_socketpair()
exception = None
def receiver(sd, buffer):
sd.setblocking(True)
while True:
buf = sd.recv(1024 * 1024)
if not buf:
break
buffer.append(buf)
async def main():
nonlocal exception
try:
try:
await self.loop.sock_sendfile(sd1, stream, count=1000)
finally:
sd1.close()
except Exception as exc:
exception = exc
n = False
os_sendfile = os.sendfile
def side_effect(fd, fileno, offset, blocksize):
nonlocal n
if not n:
n = True
return os_sendfile(fd, fileno, offset, blocksize // 2)
raise OSError(errno.EINVAL, "Invalid Argument")
with unittest.mock.patch.object(os, "sendfile", side_effect=side_effect):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024)
stream.seek(0)
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
self.assertIsInstance(exception, OSError)
self.assertEqual(b"".join(data), b"X" * 500)
def test_sock_sendfile_socket_closed(self):
sd1, sd2 = self.make_socketpair()
exception = None
def receiver(sd, buffer):
sd.setblocking(True)
buf = sd.recv(1024 * 1024)
buffer.append(buf)
sd.close()
async def main():
nonlocal exception
try:
try:
await self.loop.sock_sendfile(sd1, stream, count=1000)
finally:
sd1.close()
except Exception as exc:
exception = exc
os_sendfile = os.sendfile
def side_effect(fd, fileno, offset, blocksize):
result = os_sendfile(fd, fileno, offset, blocksize // 2)
time.sleep(0.5)
return result
with unittest.mock.patch.object(os, "sendfile", side_effect=side_effect):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024)
stream.seek(0)
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
self.assertIsInstance(exception, OSError)
self.assertEqual(b"".join(data), b"X" * 500)
def _test_sock_sendfile_systemexit(self):
for exception in (SystemExit, KeyboardInterrupt):
with self.subTest(exception=exception):
sd1, sd2 = self.make_socketpair()
exception = None
def receiver(sd, buffer):
sd.setblocking(True)
while True:
buf = sd.recv(1024 * 1024)
if not buf:
break
buffer.append(buf)
async def main():
nonlocal exception
try:
try:
await self.loop.sock_sendfile(sd1, stream, count=1000)
finally:
sd1.close()
except Exception as exc:
exception = exc
with unittest.mock.patch.object(os, "sendfile", side_effect=exception):
with tempfile.NamedTemporaryFile() as stream:
stream.write(b"X" * 1024)
stream.seek(0)
data = []
fut = self.loop.run_in_executor(None, receiver, sd2, data)
with self.assertRaises(exception):
self.loop.run_until_complete(main())
self.loop.run_until_complete(fut)
self.assertEqual(b"".join(data), b"0" * 1000)
self.assertIs(exception, None)
def test_sock_sendfile_params(self):
sd1, sd2 = self.make_socketpair()
with self.subTest("text mode file"):
with open(__file__, "r") as stream:
with self.assertRaisesRegex(ValueError, "binary mode"):
self.loop.run_until_complete(self.loop.sock_sendfile(sd1, stream))
with open(__file__, "rb") as stream:
with self.subTest("non-stream socket"):
sd_udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sd_udp.setblocking(False)
self.addCleanup(sd_udp.close)
with self.assertRaisesRegex(ValueError, "only SOCK_STREAM"):
self.loop.run_until_complete(
self.loop.sock_sendfile(sd_udp, stream)
)
with self.subTest("count == 0"):
with self.assertRaisesRegex(
ValueError, "count must be a positive integer"
):
self.loop.run_until_complete(
self.loop.sock_sendfile(sd1, stream, count=0)
)
with self.subTest("count < 0"):
with self.assertRaisesRegex(
ValueError, "count must be a positive integer"
):
self.loop.run_until_complete(
self.loop.sock_sendfile(sd1, stream, count=-5)
)
with self.subTest("count not integer"):
with self.assertRaisesRegex(
TypeError, "count must be a positive integer"
):
self.loop.run_until_complete(
self.loop.sock_sendfile(sd1, stream, count="count")
)
with self.subTest("offset < 0"):
with self.assertRaisesRegex(
ValueError, "offset must be a non-negative integer"
):
self.loop.run_until_complete(
self.loop.sock_sendfile(sd1, stream, offset=-5)
)
with self.subTest("offset not integer"):
with self.assertRaisesRegex(
TypeError, "offset must be a non-negative integer"
):
self.loop.run_until_complete(
self.loop.sock_sendfile(sd1, stream, offset="count")
)
class TestSocketHighlevel(utils.TestCase):
def test_create_connection_basic(self):
# Basic test of the functionality. This intentionally uses
# a real website (at least for now)
async def main():
hostname = "www.nu.nl"
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: WebClientProtocol(hostname, on_connection_lost), hostname, 80
)
try:
data, exc = await on_connection_lost
finally:
transport.close()
self.assertIs(exc, None)
self.assertIn(b"301 Moved", data)
self.loop.run_until_complete(main())
def test_create_connection_eyeballs(self):
# Basic test of the functionality. This intentionally uses
# a real website (at least for now)
async def main():
hostname = "www.python.org"
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: WebClientProtocol(hostname, on_connection_lost),
hostname,
80,
happy_eyeballs_delay=0.25,
)
try:
data, exc = await on_connection_lost
finally:
transport.close()
self.assertIs(exc, None)
self.assertIn(b"301 Moved", data)
self.loop.run_until_complete(main())
def test_create_connection_with_localaddr(self):
addr, port = self.make_echoserver()
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
addr,
port,
local_addr=("localhost", 0),
)
sock = transport.get_extra_info("socket")
self.assertEqual(sock.getsockname()[0], "127.0.0.1")
try:
data = await on_connection_lost
finally:
transport.close()
self.assertEqual(data, b"HELLO WORLD\r\n")
self.loop.run_until_complete(main())
def test_create_connection_with_localaddr_invalid(self):
addr, port = self.make_echoserver()
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
with self.assertRaisesRegex(OSError, "error while attempting to bind"):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
addr,
port,
local_addr=("www.python.org", 0),
)
self.loop.run_until_complete(main())
def test_create_connection_with_localaddr_invalid_ipv6(self):
addr, port = self.make_echoserver()
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
with self.assertRaisesRegex(TypeError, "error while attempting to bind"):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
addr,
port,
local_addr=("ipv6.google.com", 0),
)
self.loop.run_until_complete(main())
def test_create_connection_with_socket(self):
addr, port = self.make_echoserver()
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sd.connect((addr, port))
transport, protocol = await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
sock=sd,
local_addr=("localhost", 0),
)
sock = transport.get_extra_info("socket")
self.assertEqual(sock.getsockname(), sd.getsockname())
try:
data = await on_connection_lost
finally:
transport.close()
self.assertEqual(data, b"HELLO WORLD\r\n")
self.loop.run_until_complete(main())
def test_create_connection_with_socket_udp(self):
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
self.addCleanup(sd.close)
with self.assertRaisesRegex(ValueError, "a stream socket was expected"):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost), sock=sd
)
self.loop.run_until_complete(main())
def test_create_connection_without_info(self):
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
with self.assertRaisesRegex(
ValueError, "host and port was not specified and no sock specified"
):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost)
)
self.loop.run_until_complete(main())
def test_create_connection_with_sock_and_info(self):
addr, port = self.make_echoserver()
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sd.connect((addr, port))
self.addCleanup(sd.close)
with self.assertRaisesRegex(
ValueError, "host/port and sock can not be specified at the same time"
):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
addr,
port,
sock=sd,
)
self.loop.run_until_complete(main())
def test_create_connection_no_such_host(self):
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
with self.assertRaises(OSError):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
"nosuchhost.python.org",
80,
)
self.loop.run_until_complete(main())
def test_create_connection_unnecessary_server_hostname(self):
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
with self.assertRaisesRegex(
ValueError, "server_hostname is only meaningful"
):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
"www.python.org",
80,
server_hostname="www.python.org",
)
self.loop.run_until_complete(main())
def test_create_connection_unnecessary_ssl_timeout(self):
async def main():
message = b"hello world"
on_connection_lost = self.loop.create_future()
with self.assertRaisesRegex(
ValueError, "ssl_handshake_timeout is only meaningful"
):
await self.loop.create_connection(
lambda: EchoClientProtocol(message, on_connection_lost),
"www.python.org",
80,
ssl_handshake_timeout=4,
)
self.loop.run_until_complete(main())
def test_create_server_basic(self):
async def main():
server = await self.loop.create_server(
utils.EchoServerProtocol, host="127.0.0.1", port=0
)
self.assertIsInstance(server, asyncio.AbstractServer)
async with server:
await server.start_serving()
addr, port = server.sockets[0].getsockname()
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: EchoClientProtocol(b"hello world", on_connection_lost),
addr,
port,
)
try:
data = await on_connection_lost
finally:
transport.close()
self.assertEqual(data, b"HELLO WORLD\r\n")
self.loop.run_until_complete(main())
def test_create_server_unneeded_ssltime(self):
async def main():
with self.assertRaisesRegex(ValueError, "ssl_handshake_timeout is only"):
await self.loop.create_server(
utils.EchoServerProtocol, "127.0.0.1", 0, ssl_handshake_timeout=4
)
self.loop.run_until_complete(main())
def test_create_server_host_and_sock(self):
async def main():
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sd.listen(5)
self.addCleanup(sd.close)
with self.assertRaisesRegex(
ValueError, "host/port and sock can not be specified"
):
await self.loop.create_server(
utils.EchoServerProtocol, "127.0.0.1", 0, sock=sd
)
self.loop.run_until_complete(main())
def test_sendfile_unsupported(self):
class MyTransport(asyncio.Transport):
def is_closing(self):
return False
with self.subTest("attribute missing"):
async def main():
with open(__file__, "rb") as stream:
with self.assertRaisesRegex(
RuntimeError, "sendfile is not supported for transport"
):
await self.loop.sendfile(MyTransport(), stream)
self.loop.run_until_complete(main())
with self.subTest("attribute UNSUPOORTED"):
MyTransport._sendfile_compatible = (
objc_asyncio._sockets._SendfileMode.UNSUPPORTED
)
async def main():
with open(__file__, "rb") as stream:
with self.assertRaisesRegex(
RuntimeError, "sendfile is not supported for transport"
):
await self.loop.sendfile(MyTransport(), stream)
self.loop.run_until_complete(main())
def sendfile_shared(self, on_connection_made):
server_sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
server_sd.bind(("127.0.0.1", 0))
server_sd.listen(5)
self.addCleanup(server_sd.close)
data = []
def receiver():
nonlocal data
sd, _ = server_sd.accept()
try:
while True:
b = sd.recv(1024)
if not b:
break
data.append(b)
finally:
sd.close()
thr = threading.Thread(target=receiver)
thr.start()
async def main():
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: SendFileProtocol(on_connection_made, on_connection_lost),
*server_sd.getsockname(),
)
try:
result = await on_connection_lost
if protocol.task is not None:
await protocol.task
finally:
transport.close()
self.assertIs(result, None)
self.loop.run_until_complete(main())
thr.join()
return b"".join(data)
def test_sendfile_basic(self):
async def on_connection_made(transport):
try:
with open(__file__, "rb") as stream:
await self.loop.sendfile(transport, stream)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
with open(__file__, "rb") as stream:
self.assertEqual(data, stream.read())
def test_sendfile_offset(self):
OFFSET = 100
async def on_connection_made(transport):
try:
with open(__file__, "rb") as stream:
await self.loop.sendfile(transport, stream, offset=OFFSET)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
with open(__file__, "rb") as stream:
self.assertEqual(data, stream.read()[OFFSET:])
def test_sendfile_count(self):
COUNT = 100
async def on_connection_made(transport):
try:
with open(__file__, "rb") as stream:
await self.loop.sendfile(transport, stream, count=COUNT)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
with open(__file__, "rb") as stream:
self.assertEqual(data, stream.read()[:COUNT])
def test_sendfile_fallback_not_taken_native_transport(self):
async def on_connection_made(transport):
try:
stream = io.BytesIO()
with self.assertRaisesRegex(RuntimeError, "not a regular file"):
await self.loop.sendfile(transport, stream, fallback=False)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
self.assertEqual(data, b"")
def test_sendfile_fallback_not_taken_fallback_transport(self):
async def on_connection_made(transport):
try:
transport._sendfile_compatible = (
objc_asyncio._sockets._SendfileMode.FALLBACK
)
stream = io.BytesIO()
with self.assertRaisesRegex(
RuntimeError, "fallback is disabled and native sendfile"
):
await self.loop.sendfile(transport, stream, fallback=False)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
self.assertEqual(data, b"")
def test_sendfile_fallback(self):
MESSAGE = b"hello world" * 1024
async def on_connection_made(transport):
try:
stream = io.BytesIO()
stream.write(MESSAGE)
stream.seek(0)
await self.loop.sendfile(transport, stream)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
self.assertEqual(data, MESSAGE)
def test_sendfile_fallback_offset(self):
MESSAGE = b"hello world" * 1024
OFFSET = 4535
async def on_connection_made(transport):
try:
stream = io.BytesIO()
stream.write(MESSAGE)
stream.seek(0)
await self.loop.sendfile(transport, stream, offset=OFFSET)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
self.assertEqual(data, MESSAGE[OFFSET:])
def test_sendfile_fallback_offset_count(self):
MESSAGE = b"hello world" * 1024
OFFSET = 4535
COUNT = 655
async def on_connection_made(transport):
try:
stream = io.BytesIO()
stream.write(MESSAGE)
stream.seek(0)
await self.loop.sendfile(transport, stream, offset=OFFSET, count=COUNT)
finally:
transport.close()
data = self.sendfile_shared(on_connection_made)
self.assertEqual(data, MESSAGE[OFFSET : OFFSET + COUNT])
def test_sendfile_closing(self):
async def on_connection_made(transport):
transport.close()
with open(__file__, "rb") as stream:
with self.assertRaisesRegex(RuntimeError, "Transport is closing"):
await self.loop.sendfile(transport, stream)
data = self.sendfile_shared(on_connection_made)
self.assertEqual(data, b"")
def test_create_datagram_endpoint_basic(self):
class DummyProtocol(asyncio.DatagramProtocol):
def datagram_received(self, data, addr):
pass
def error_received(self, exc):
pass
async def main():
transport, protocol = await self.loop.create_datagram_endpoint(
DummyProtocol, ("127.0.0.1", 0)
)
self.assertIsInstance(transport, objc_asyncio.PyObjCDatagramTransport)
self.assertIsInstance(protocol, DummyProtocol)
self.loop.run_until_complete(main())
def test_connect_accepted_socket_basic(self):
async def main():
sd1, sd2 = self.make_socketpair()
try:
transport, protocol = await self.loop.connect_accepted_socket(
utils.EchoServerProtocol, sd1
)
await self.loop.sock_sendall(sd2, b"hello world")
data = await self.loop.sock_recv(sd2, 1024)
self.assertEqual(data, b"HELLO WORLD")
finally:
transport.close()
self.loop.run_until_complete(main())
def test_connect_accepted_socket_not_stream(self):
async def main():
sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
sd.bind(("127.0.0.1", 0))
sd.setblocking(False)
self.addCleanup(sd.close)
with self.assertRaisesRegex(ValueError, "a stream socket was expected"):
await self.loop.connect_accepted_socket(utils.EchoServerProtocol, sd)
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_socket(self):
async def main():
sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sd.bind(("127.0.0.1", 0))
transport, protocol = await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, sock=sd
)
try:
sock = transport.get_extra_info("socket")
self.assertEqual(sock.getsockname(), sd.getsockname())
finally:
transport.close()
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_socket_kwargs(self):
async def main():
sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sd.bind(("127.0.0.1", 0))
self.addCleanup(sd.close)
for kw in (
"local_addr",
"remote_addr",
"family",
"proto",
"flags",
"reuse_address",
"reuse_port",
"allow_broadcast",
):
with self.subTest(keyword=kw):
with self.assertRaisesRegex(ValueError, "socket modifier keyword"):
await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, sock=sd, **{kw: True}
)
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_socket_stream(self):
async def main():
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sd.bind(("127.0.0.1", 0))
self.addCleanup(sd.close)
with self.assertRaisesRegex(ValueError, "a datagram socket was expected"):
await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, sock=sd
)
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_basic_server(self):
async def main():
transport, protocol = await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, local_addr=("127.0.0.1", 0)
)
try:
self.assertIsInstance(transport, objc_asyncio.PyObjCDatagramTransport)
self.assertIsInstance(protocol, utils.EchoServerProtocol)
finally:
transport.close()
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_basic_client(self):
async def main():
transport, protocol = await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, remote_addr=("127.0.0.1", 9)
)
try:
self.assertIsInstance(transport, objc_asyncio.PyObjCDatagramTransport)
self.assertIsInstance(protocol, utils.EchoServerProtocol)
finally:
transport.close()
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_basic_family(self):
async def main():
transport, protocol = await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, family=socket.AF_INET
)
try:
self.assertIsInstance(transport, objc_asyncio.PyObjCDatagramTransport)
self.assertIsInstance(protocol, utils.EchoServerProtocol)
finally:
transport.close()
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_no_info(self):
async def main():
with self.assertRaisesRegex(ValueError, "unexpected address family"):
await self.loop.create_datagram_endpoint(utils.EchoServerProtocol)
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_reuseaddr_true(self):
async def main():
with self.assertRaisesRegex(ValueError, "significant security concern"):
await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, family=socket.AF_INET, reuse_address=True
)
self.loop.run_until_complete(main())
def test_create_datagram_endpoint_reuseaddr_false(self):
async def main():
with self.assertWarnsRegex(
DeprecationWarning, r"\*reuse_address\* parameter"
):
await self.loop.create_datagram_endpoint(
utils.EchoServerProtocol, family=socket.AF_INET, reuse_address=False
)
self.loop.run_until_complete(main())
class TestSocketTLS(utils.TestCase):
def test_create_connection_basic_tls(self):
async def main():
hostname = "www.nu.nl"
context = utils.simple_client_sslcontext()
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: WebClientProtocol(hostname, on_connection_lost),
hostname,
443,
ssl=context,
)
try:
data, exc = await on_connection_lost
finally:
transport.close()
self.assertIs(exc, None)
self.assertIn(b"HTTP/1.1 200 OK", data)
self.assertIn(b"Het laatste nieuws het eerst op NU.nl", data)
self.loop.run_until_complete(main())
def test_create_connection_sock_tls(self):
async def main():
hostname = "www.nu.nl"
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sd.connect((hostname, 443))
context = utils.simple_client_sslcontext()
on_connection_lost = self.loop.create_future()
transport, protocol = await self.loop.create_connection(
lambda: WebClientProtocol(hostname, on_connection_lost),
sock=sd,
ssl=context,
server_hostname=hostname,
)
try:
data, exc = await on_connection_lost
finally:
transport.close()
self.assertIs(exc, None)
self.assertIn(b"HTTP/1.1 200 OK", data)
self.assertIn(b"Het laatste nieuws het eerst op NU.nl", data)
self.loop.run_until_complete(main())
def test_create_connection_sock_tls_missing_servername(self):
async def main():
sd = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
self.addCleanup(sd.close)
context = utils.simple_client_sslcontext()
on_connection_lost = self.loop.create_future()
with self.assertRaisesRegex(ValueError, "You must set server_hostname"):
await self.loop.create_connection(
lambda: WebClientProtocol("www.nu.nl", on_connection_lost),
sock=sd,
ssl=context,
)
self.loop.run_until_complete(main())
def test_create_server_ssl_bool(self):
async def main():
with self.assertRaisesRegex(TypeError, "ssl argument must be"):
await self.loop.create_server(
utils.EchoServerProtocol, "127.0.0.1", 0, ssl=True
)
self.loop.run_until_complete(main())
def test_create_server_ssl(self):
async def main():
context = utils.simple_server_sslcontext()
server = await self.loop.create_server(
utils.EchoServerProtocol, "127.0.0.1", 0, ssl=context
)
async with server:
pass
self.loop.run_until_complete(main())
class SendFileProtocol(asyncio.Protocol):
def __init__(self, on_connection_made, on_connection_lost):
self.on_connection_made = on_connection_made
self.on_connection_lost = on_connection_lost
self.task = None
def connection_made(self, transport):
self.task = asyncio.Task(self.on_connection_made(transport))
def data_received(self, data):
pass
def connection_lost(self, exc):
self.on_connection_lost.set_result(None)
class EchoClientProtocol(asyncio.Protocol):
def __init__(self, message, on_connection_lost):
self.message = message
self.data = []
self.on_connection_lost = on_connection_lost
def connection_made(self, transport):
transport.write(self.message + b"\r\n")
def data_received(self, data):
self.data.append(data)
def connection_lost(self, exc):
self.on_connection_lost.set_result(b"".join(self.data))
class WebClientProtocol(asyncio.Protocol):
def __init__(self, hostname, on_connection_lost):
self.hostname = hostname
self.data = []
self.on_connection_lost = on_connection_lost
def connection_made(self, transport):
transport.write(
b"GET / HTTP/1.0\r\nHost: %s\r\n\r\n" % (self.hostname.encode(),)
)
def data_received(self, data):
self.data.append(data)
def connection_lost(self, exc):
self.on_connection_lost.set_result((b"".join(self.data), exc))
| 31.773999 | 88 | 0.555432 | 7,872 | 73,811 | 5.018801 | 0.051956 | 0.050218 | 0.029791 | 0.040093 | 0.869444 | 0.845702 | 0.819454 | 0.786955 | 0.761137 | 0.742533 | 0 | 0.018695 | 0.354283 | 73,811 | 2,322 | 89 | 31.787683 | 0.810243 | 0.0139 | 0 | 0.735033 | 0 | 0.000593 | 0.035225 | 0.001196 | 0 | 0 | 0 | 0 | 0.082988 | 1 | 0.091286 | false | 0.010077 | 0.00652 | 0.001778 | 0.114404 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
8447812db4a390bf4693c07a5816531d593d11fe | 8,776 | py | Python | src/tests/functional/api/test_api_views.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/tests/functional/api/test_api_views.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/tests/functional/api/test_api_views.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | import json
import pytest
@pytest.mark.django_db
def test_can_only_see_public_events(client, event, other_event):
other_event.is_public = False
other_event.save()
assert event.is_public
assert not other_event.is_public
response = client.get('/api/events', follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert len(content) == 1, content
assert content[0]['name']['en'] == event.name
@pytest.mark.django_db
def test_orga_can_see_nonpublic_events(orga_client, event, other_event):
event.is_public = False
event.save()
assert not event.is_public
assert other_event.is_public
response = orga_client.get('/api/events', follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert len(content) == 2, content
assert content[0]['name']['en'] == event.name
@pytest.mark.django_db
def test_can_only_see_public_submissions(client, slot, accepted_submission, rejected_submission, submission):
response = client.get(submission.event.api_urls.submissions, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 1
assert content['results'][0]['title'] == slot.submission.title
@pytest.mark.django_db
def test_can_only_see_public_submissions_if_public_schedule(client, slot, accepted_submission, rejected_submission, submission):
submission.event.settings.set('show_schedule', False)
response = client.get(submission.event.api_urls.submissions, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 0
@pytest.mark.django_db
def test_orga_can_see_all_submissions(orga_client, slot, accepted_submission, rejected_submission, submission):
response = orga_client.get(submission.event.api_urls.submissions, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 4
assert content['results'][0]['title'] == slot.submission.title
@pytest.mark.django_db
def test_orga_can_see_all_submissions_even_nonpublic(orga_client, slot, accepted_submission, rejected_submission, submission):
submission.event.settings.set('show_schedule', False)
response = orga_client.get(submission.event.api_urls.submissions, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 4
assert content['results'][0]['title'] == slot.submission.title
@pytest.mark.django_db
def test_can_only_see_public_talks(client, slot, accepted_submission, rejected_submission, submission):
response = client.get(submission.event.api_urls.talks, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 1
assert content['results'][0]['title'] == slot.submission.title
@pytest.mark.django_db
def test_can_only_see_public_talks_if_public_schedule(client, slot, accepted_submission, rejected_submission, submission):
submission.event.settings.set('show_schedule', False)
response = client.get(submission.event.api_urls.talks, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 0
@pytest.mark.django_db
def test_orga_can_see_all_talks(orga_client, slot, accepted_submission, rejected_submission, submission):
response = orga_client.get(submission.event.api_urls.talks, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 1
assert content['results'][0]['title'] == slot.submission.title
@pytest.mark.django_db
def test_orga_can_see_all_talks_even_nonpublic(orga_client, slot, accepted_submission, rejected_submission, submission):
submission.event.settings.set('show_schedule', False)
response = orga_client.get(submission.event.api_urls.talks, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 1
assert content['results'][0]['title'] == slot.submission.title
@pytest.mark.django_db
def test_user_can_see_schedule(client, slot):
assert slot.submission.event.schedules.count() == 2
response = client.get(slot.submission.event.api_urls.schedules, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 1
@pytest.mark.django_db
def test_user_cannot_see_wip_schedule(client, slot):
assert slot.submission.event.schedules.count() == 2
response = client.get(slot.submission.event.api_urls.schedules + '/wip', follow=True)
json.loads(response.content.decode())
assert response.status_code == 404
@pytest.mark.django_db
def test_user_cannot_see_schedule_if_not_public(client, slot):
slot.submission.event.settings.set('show_schedule', False)
assert slot.submission.event.schedules.count() == 2
response = client.get(slot.submission.event.api_urls.schedules, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 0
@pytest.mark.django_db
def test_orga_can_see_schedule(orga_client, slot):
assert slot.submission.event.schedules.count() == 2
response = orga_client.get(slot.submission.event.api_urls.schedules, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 2
@pytest.mark.django_db
def test_orga_can_see_wip_schedule(orga_client, slot):
assert slot.submission.event.schedules.count() == 2
response = orga_client.get(slot.submission.event.api_urls.schedules + '/wip', follow=True)
json.loads(response.content.decode())
assert response.status_code == 200
@pytest.mark.django_db
def test_orga_can_see_current_schedule(orga_client, slot):
assert slot.submission.event.schedules.count() == 2
response = orga_client.get(slot.submission.event.api_urls.schedules + '/latest', follow=True)
json.loads(response.content.decode())
assert response.status_code == 200
assert slot.submission.title in response.content.decode()
@pytest.mark.django_db
def test_orga_cannot_see_schedule_even_if_not_public(orga_client, slot):
slot.submission.event.settings.set('show_schedule', False)
assert slot.submission.event.schedules.count() == 2
response = orga_client.get(slot.submission.event.api_urls.schedules, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 2
@pytest.mark.django_db
def test_can_only_see_public_speakers(client, slot, accepted_submission, rejected_submission, submission, impersonal_answer):
response = client.get(submission.event.api_urls.speakers, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 1
assert content['results'][0]['name'] == accepted_submission.speakers.first().name
assert set(content['results'][0].keys()) == {'name', 'code', 'biography', 'submissions'}
@pytest.mark.django_db
def test_can_only_see_public_speakerss_if_public_schedule(client, slot, accepted_submission, rejected_submission, submission):
submission.event.settings.set('show_schedule', False)
response = client.get(submission.event.api_urls.speakers, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 0
@pytest.mark.django_db
def test_orga_can_see_all_speakers(orga_client, slot, accepted_submission, rejected_submission, submission, impersonal_answer):
response = orga_client.get(submission.event.api_urls.speakers, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 2
assert set(content['results'][0].keys()) == {'name', 'code', 'biography', 'submissions', 'answers'}
assert set(content['results'][0]['answers'][0].keys()) == {'answer', 'answer_file', 'person', 'question', 'submission', 'options', 'id'}
@pytest.mark.django_db
def test_orga_can_see_all_speakers_even_nonpublic(orga_client, slot, accepted_submission, rejected_submission, submission):
submission.event.settings.set('show_schedule', False)
response = orga_client.get(submission.event.api_urls.speakers, follow=True)
content = json.loads(response.content.decode())
assert response.status_code == 200
assert content['count'] == 2
| 39.004444 | 140 | 0.750798 | 1,159 | 8,776 | 5.465919 | 0.068162 | 0.080505 | 0.072928 | 0.059669 | 0.926756 | 0.914759 | 0.914759 | 0.90955 | 0.908919 | 0.88824 | 0 | 0.013142 | 0.124316 | 8,776 | 224 | 141 | 39.178571 | 0.811191 | 0 | 0 | 0.726708 | 0 | 0 | 0.052074 | 0 | 0 | 0 | 0 | 0 | 0.391304 | 1 | 0.130435 | false | 0 | 0.012422 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
fffec4f2dd4cc539f5f5916d5a5900c819d7e211 | 22,690 | py | Python | restraintlib/lib/ribose_purine_terminal_C3.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | null | null | null | restraintlib/lib/ribose_purine_terminal_C3.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | 1 | 2021-11-11T18:45:10.000Z | 2021-11-11T18:45:10.000Z | restraintlib/lib/ribose_purine_terminal_C3.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | null | null | null | RIBOSE_PURINE_TERMINAL_C3_PDB_CODES = ['A', 'G', 'IG']
RIBOSE_PURINE_TERMINAL_C3_ALL_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_CHI_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_GAMMA_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_PDB_CODES = RIBOSE_PURINE_TERMINAL_C3_PDB_CODES
RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES = {
"C1'": "C1'",
"C1*": "C1'",
"C2'": "C2'",
"C2*": "C2'",
"C3'": "C3'",
"C3*": "C3'",
"C4": "C4",
"C4'": "C4'",
"C4*": "C4'",
"C5'": "C5'",
"C5*": "C5'",
"C8": "C8",
"N9": "N9",
"O2'": "O2'",
"O2*": "O2'",
"O3'": "O3'",
"O3*": "O3'",
"O4'": "O4'",
"O4*": "O4'",
"O5'": "O5'",
"O5*": "O5'",
"P": "P"
}
RIBOSE_PURINE_TERMINAL_C3_ALL_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_CHI_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_GAMMA_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_ATOM_NAMES = RIBOSE_PURINE_TERMINAL_C3_ATOM_NAMES
RIBOSE_PURINE_TERMINAL_C3_ATOM_RES = {
"C1'": 0,
"C2'": 0,
"C3'": 0,
"C4": 0,
"C4'": 0,
"C5'": 0,
"C8": 0,
"N9": 0,
"O2'": 0,
"O3'": 0,
"O4'": 0,
"O5'": 0
}
RIBOSE_PURINE_TERMINAL_C3_ALL_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_CHI_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_GAMMA_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_ATOM_RES = RIBOSE_PURINE_TERMINAL_C3_ATOM_RES
RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION = [
("C1'", "C2'", 2.0, 0, 0),
("C2'", "C3'", 2.0, 0, 0),
("C3'", "C4'", 2.0, 0, 0),
("C4'", "O4'", 2.0, 0, 0),
("C1'", "O4'", 2.0, 0, 0),
("C3'", "O3'", 2.0, 0, 0),
("C4'", "C5'", 2.0, 0, 0),
("C5'", "O5'", 2.0, 0, 0),
("C2'", "O2'", 2.0, 0, 0),
("C1'", 'N9', 2.0, 0, 0),
("O5'", 'P', 2.5, 0, 0)
]
RIBOSE_PURINE_TERMINAL_C3_ALL_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CHI_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_SUGAR_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_GAMMA_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_REQUIRED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_REQUIRED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION = [
("O3'", 'P', 2.5, 0, 1)
]
RIBOSE_PURINE_TERMINAL_C3_ALL_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CHI_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_SUGAR_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_GAMMA_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_DISALLOWED_CONDITION = RIBOSE_PURINE_TERMINAL_C3_DISALLOWED_CONDITION
RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE = {
'measure': 'euclidean_angles',
'restraint_names': ["aC4'C5'O5'", "aC4'C3'O3'", "aN9C1'C2'", "aC1'N9C4", "aC1'N9C8", "aN9C1'O4'", "aC2'C1'O4'", "aC2'C3'O3'", "aC1'C2'O2'", "aC3'C2'O2'", "aC1'C2'C3'", "aC2'C3'C4'", "aC3'C4'O4'", "aC1'O4'C4'", "aC3'C4'C5'", "aC5'C4'O4'"]
}
RIBOSE_PURINE_TERMINAL_C3_ALL_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CHI_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_SUGAR_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_GAMMA_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE = {
'measure': 'euclidean_angles',
'restraint_names': ["tO4'C1'N9C4", "tC3'C4'C5'O5'", "pC1'C2'C3'C4'O4'"]
}
RIBOSE_PURINE_TERMINAL_C3_ALL_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CHI_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_GAMMA_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_CONDITION_DISTANCE_MEASURE = RIBOSE_PURINE_TERMINAL_C3_CONDITION_DISTANCE_MEASURE
RIBOSE_PURINE_TERMINAL_C3_ALL_RESTRAINTS = [{
'conditions': [], 'name': 'ribose_purine_terminal_C3==All=All', 'restraints': [['dist', "dC1'C2'", ["C1'", "C2'"], 1.525, 0.012], ['dist', "dC2'C3'", ["C2'", "C3'"], 1.523, 0.011]]
}
]
RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA_RESTRAINTS = [
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5], ['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], 60, 8.75]],
'name': 'ribose_purine_terminal_C3==Chi=anti__Gamma=gauche+',
'restraints': [['angle', "aC4'C5'O5'", ["C4'", "C5'", "O5'"], 110.6, 1.9]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5], ['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], -60, 8.75]],
'name': 'ribose_purine_terminal_C3==Chi=anti__Gamma=gauche-',
'restraints': [['angle', "aC4'C5'O5'", ["C4'", "C5'", "O5'"], 109.6, 1.8]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5], ['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], 180, 21.25]],
'name': 'ribose_purine_terminal_C3==Chi=anti__Gamma=trans',
'restraints': [['angle', "aC4'C5'O5'", ["C4'", "C5'", "O5'"], 110.2, 1.9]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5], ['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], 60, 8.75]],
'name': 'ribose_purine_terminal_C3==Chi=syn__Gamma=gauche+',
'restraints': [['angle', "aC4'C5'O5'", ["C4'", "C5'", "O5'"], 112.5, 1.9]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5], ['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], -60, 8.75]],
'name': 'ribose_purine_terminal_C3==Chi=syn__Gamma=gauche-',
'restraints': [['angle', "aC4'C5'O5'", ["C4'", "C5'", "O5'"], 111.0, 0.9]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5], ['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], 180, 21.25]],
'name': 'ribose_purine_terminal_C3==Chi=syn__Gamma=trans',
'restraints': [['angle', "aC4'C5'O5'", ["C4'", "C5'", "O5'"], 110.5, 2.3]]
}
]
RIBOSE_PURINE_TERMINAL_C3_CHI_RESTRAINTS = [
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5]],
'name': 'ribose_purine_terminal_C3==Chi=anti',
'restraints': [['angle', "aC4'C3'O3'", ["C4'", "C3'", "O3'"], 110.9, 2.4]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5]],
'name': 'ribose_purine_terminal_C3==Chi=syn',
'restraints': [['angle', "aC4'C3'O3'", ["C4'", "C3'", "O3'"], 109.7, 2.1]]
}
]
RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI_RESTRAINTS = [
{
'conditions': [],
'name': 'ribose_purine_terminal_C3==Base=purine',
'restraints': [ ['angle', "aN9C1'C2'", ['N9', "C1'", "C2'"], None, None, None, None, "purine-N1-C1'-C2' or N9-C1'-C2'.pickle", ['torsion_chi', ["O4'", "C1'", 'N9', 'C4']]],
['angle', "aC1'N9C4", ["C1'", 'N9', 'C4'], None, None, None, None, "purine-C1'-N1-C2 or C1'-N9-C4.pickle", ['torsion_chi', ["O4'", "C1'", 'N9', 'C4']]],
['angle', "aC1'N9C8", ["C1'", 'N9', 'C8'], None, None, None, None, "purine-C1'-N1-C6 or C1'-N9-C8.pickle", ['torsion_chi', ["O4'", "C1'", 'N9', 'C4']]],
['angle', "aN9C1'O4'", ['N9', "C1'", "O4'"], None, None, None, None, "purine-N1-C1'-O4' or N9-C1'-O4'.pickle", ['torsion_chi', ["O4'", "C1'", 'N9', 'C4']]]]
}
]
RIBOSE_PURINE_TERMINAL_C3_CONFORMATION_RESTRAINTS = [
{
'conditions': [['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 162, 4.5]],
'name': "ribose_purine_terminal_C3==Conformation=C2'-endo",
'restraints': [['dist', "dC3'C4'", ["C3'", "C4'"], 1.527, 0.01], ['dist', "dC2'O2'", ["C2'", "O2'"], 1.41, 0.009], ['angle', "aC2'C1'O4'", ["C2'", "C1'", "O4'"], 106.0, 0.8]]
},
{
'conditions': [['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 18, 4.5]],
'name': "ribose_purine_terminal_C3==Conformation=C3'-endo",
'restraints': [['dist', "dC3'C4'", ["C3'", "C4'"], 1.52, 0.009], ['dist', "dC2'O2'", ["C2'", "O2'"], 1.416, 0.008], ['angle', "aC2'C1'O4'", ["C2'", "C1'", "O4'"], 107.3, 0.6]]
},
{
'conditions': [],
'name': 'ribose_purine_terminal_C3==Conformation=Other',
'restraints': [['dist', "dC3'C4'", ["C3'", "C4'"], 1.531, 0.009], ['dist', "dC2'O2'", ["C2'", "O2'"], 1.413, 0.008], ['angle', "aC2'C1'O4'", ["C2'", "C1'", "O4'"], 106.2, 1.3]]
}
]
RIBOSE_PURINE_TERMINAL_C3_SUGAR_RESTRAINTS = [{
'conditions': [], 'name': 'ribose_purine_terminal_C3==Sugar=ribose', 'restraints': [['dist', "dC4'O4'", ["C4'", "O4'"], 1.45, 0.009]]
}
]
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_RESTRAINTS = [
{
'conditions': [['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 162, 4.5]],
'name': "ribose_purine_terminal_C3==Sugar=ribose__Conformation=C2'-endo",
'restraints': [['dist', "dC3'O3'", ["C3'", "O3'"], 1.422, 0.008]]
},
{
'conditions': [['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 18, 4.5]],
'name': "ribose_purine_terminal_C3==Sugar=ribose__Conformation=C3'-endo",
'restraints': [['dist', "dC3'O3'", ["C3'", "O3'"], 1.413, 0.008]]
},
{
'conditions': [], 'name': 'ribose_purine_terminal_C3==Sugar=ribose__Conformation=Other', 'restraints': [['dist', "dC3'O3'", ["C3'", "O3'"], 1.418, 0.007]]
}
]
RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION_RESTRAINTS = [
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5], ['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 162, 4.5]],
'name': "ribose_purine_terminal_C3==Chi=anti__Conformation=C2'-endo",
'restraints': [ ['angle', "aC2'C3'O3'", ["C2'", "C3'", "O3'"], 109.7, 2.4],
['angle', "aC1'C2'O2'", ["C1'", "C2'", "O2'"], 112.0, 2.1],
['angle', "aC3'C2'O2'", ["C3'", "C2'", "O2'"], 113.6, 2.5]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5], ['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 18, 4.5]],
'name': "ribose_purine_terminal_C3==Chi=anti__Conformation=C3'-endo",
'restraints': [ ['angle', "aC2'C3'O3'", ["C2'", "C3'", "O3'"], 113.6, 1.9],
['angle', "aC1'C2'O2'", ["C1'", "C2'", "O2'"], 108.7, 2.3],
['angle', "aC3'C2'O2'", ["C3'", "C2'", "O2'"], 110.4, 2.1]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 180, 22.5]],
'name': 'ribose_purine_terminal_C3==Chi=anti__Conformation=Other',
'restraints': [ ['angle', "aC2'C3'O3'", ["C2'", "C3'", "O3'"], 112.7, 2.3],
['angle', "aC1'C2'O2'", ["C1'", "C2'", "O2'"], 112.9, 1.4],
['angle', "aC3'C2'O2'", ["C3'", "C2'", "O2'"], 113.3, 0.9]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5], ['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 162, 4.5]],
'name': "ribose_purine_terminal_C3==Chi=syn__Conformation=C2'-endo",
'restraints': [ ['angle', "aC2'C3'O3'", ["C2'", "C3'", "O3'"], 110.3, 2.1],
['angle', "aC1'C2'O2'", ["C1'", "C2'", "O2'"], 112.5, 2.1],
['angle', "aC3'C2'O2'", ["C3'", "C2'", "O2'"], 114.1, 1.9]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5], ['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 18, 4.5]],
'name': "ribose_purine_terminal_C3==Chi=syn__Conformation=C3'-endo",
'restraints': [ ['angle', "aC2'C3'O3'", ["C2'", "C3'", "O3'"], 114.0, 0.8],
['angle', "aC1'C2'O2'", ["C1'", "C2'", "O2'"], 109.9, 2.7],
['angle', "aC3'C2'O2'", ["C3'", "C2'", "O2'"], 110.0, 2.0]]
},
{
'conditions': [['torsion', "tO4'C1'N9C4", ["O4'", "C1'", 'N9', 'C4'], 0, 22.5]],
'name': 'ribose_purine_terminal_C3==Chi=syn__Conformation=Other',
'restraints': [ ['angle', "aC2'C3'O3'", ["C2'", "C3'", "O3'"], 112.6, 1.8],
['angle', "aC1'C2'O2'", ["C1'", "C2'", "O2'"], 107.7, 1.6],
['angle', "aC3'C2'O2'", ["C3'", "C2'", "O2'"], 111.9, 1.1]]
}
]
RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX_RESTRAINTS = [
{
'conditions': [['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 162, 4.5]],
'name': "ribose_purine_terminal_C3==Sugar=ribose__Conformation=C2'-endo",
'restraints': [ ['angle', "aC1'C2'C3'", ["C1'", "C2'", "C3'"], None, None, None, None, "ribose-C2'-endo-C1'-C2'-C3'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC2'C3'C4'", ["C2'", "C3'", "C4'"], None, None, None, None, "ribose-C2'-endo-C2'-C3'-C4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC3'C4'O4'", ["C3'", "C4'", "O4'"], None, None, None, None, "ribose-C2'-endo-C3'-C4'-O4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC1'O4'C4'", ["C1'", "O4'", "C4'"], None, None, None, None, "ribose-C2'-endo-C1'-O4'-C4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]]]
},
{
'conditions': [['pseudorotation', "pC1'C2'C3'C4'O4'", ["C1'", "C2'", "C3'", "C4'", "O4'"], 18, 4.5]],
'name': "ribose_purine_terminal_C3==Sugar=ribose__Conformation=C3'-endo",
'restraints': [ ['angle', "aC1'C2'C3'", ["C1'", "C2'", "C3'"], None, None, None, None, "ribose-C3'-endo-C1'-C2'-C3'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC2'C3'C4'", ["C2'", "C3'", "C4'"], None, None, None, None, "ribose-C3'-endo-C2'-C3'-C4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC3'C4'O4'", ["C3'", "C4'", "O4'"], None, None, None, None, "ribose-C3'-endo-C3'-C4'-O4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC1'O4'C4'", ["C1'", "O4'", "C4'"], None, None, None, None, "ribose-C3'-endo-C1'-O4'-C4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]]]
},
{
'conditions': [],
'name': 'ribose_purine_terminal_C3==Sugar=ribose__Conformation=Other',
'restraints': [ ['angle', "aC1'C2'C3'", ["C1'", "C2'", "C3'"], None, None, None, None, "ribose-Other-C1'-C2'-C3'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC2'C3'C4'", ["C2'", "C3'", "C4'"], None, None, None, None, "ribose-Other-C2'-C3'-C4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC3'C4'O4'", ["C3'", "C4'", "O4'"], None, None, None, None, "ribose-Other-C3'-C4'-O4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]],
['angle', "aC1'O4'C4'", ["C1'", "O4'", "C4'"], None, None, None, None, "ribose-Other-C1'-O4'-C4'.pickle", ['tau_max', ["C1'", "C2'", "C3'", "C4'", "O4'"]]]]
}
]
RIBOSE_PURINE_TERMINAL_C3_GAMMA_RESTRAINTS = [
{
'conditions': [['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], 60, 8.75]],
'name': 'ribose_purine_terminal_C3==Gamma=gauche+',
'restraints': [['dist', "dC4'C5'", ["C4'", "C5'"], 1.508, 0.009], ['angle', "aC3'C4'C5'", ["C3'", "C4'", "C5'"], 115.7, 1.2], ['angle', "aC5'C4'O4'", ["C5'", "C4'", "O4'"], 109.4, 1.0]]
},
{
'conditions': [['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], -60, 8.75]],
'name': 'ribose_purine_terminal_C3==Gamma=gauche-',
'restraints': [['dist', "dC4'C5'", ["C4'", "C5'"], 1.518, 0.009], ['angle', "aC3'C4'C5'", ["C3'", "C4'", "C5'"], 114.5, 1.2], ['angle', "aC5'C4'O4'", ["C5'", "C4'", "O4'"], 107.8, 0.9]]
},
{
'conditions': [['torsion', "tC3'C4'C5'O5'", ["C3'", "C4'", "C5'", "O5'"], 180, 21.25]],
'name': 'ribose_purine_terminal_C3==Gamma=trans',
'restraints': [['dist', "dC4'C5'", ["C4'", "C5'"], 1.509, 0.01], ['angle', "aC3'C4'C5'", ["C3'", "C4'", "C5'"], 113.8, 1.3], ['angle', "aC5'C4'O4'", ["C5'", "C4'", "O4'"], 109.9, 1.2]]
}
]
RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI_RESTRAINTS = [
{
'conditions': [],
'name': 'ribose_purine_terminal_C3==All=All',
'restraints': [ ['dist', "dC1'N9", ["C1'", 'N9'], None, None, None, None, "All-C1'-N1 or C1'-N9.pickle", ['torsion_chi', ["O4'", "C1'", 'N9', 'C4']]],
['dist', "dC1'O4'", ["C1'", "O4'"], None, None, None, None, "All-C1'-O4'.pickle", ['torsion_chi', ["O4'", "C1'", 'N9', 'C4']]]]
}
] | 65.578035 | 241 | 0.634597 | 3,144 | 22,690 | 4.186705 | 0.038804 | 0.184153 | 0.306921 | 0.337613 | 0.949783 | 0.932918 | 0.906024 | 0.874497 | 0.831801 | 0.803464 | 0 | 0.088701 | 0.147378 | 22,690 | 346 | 242 | 65.578035 | 0.591699 | 0 | 0 | 0.06079 | 0 | 0 | 0.277423 | 0.082279 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
f2480b8813ba440580b2e187e6809b3609f706a7 | 19,245 | py | Python | wiki/tests.py | kalevhark/kroonika | a2d7a80666e742e62a3d2bcf72a597bf103ab9c7 | [
"MIT"
] | 1 | 2020-05-12T05:39:03.000Z | 2020-05-12T05:39:03.000Z | wiki/tests.py | kalevhark/kroonika | a2d7a80666e742e62a3d2bcf72a597bf103ab9c7 | [
"MIT"
] | 8 | 2019-12-25T21:32:49.000Z | 2022-02-11T19:28:33.000Z | wiki/tests.py | kalevhark/kroonika | a2d7a80666e742e62a3d2bcf72a597bf103ab9c7 | [
"MIT"
] | null | null | null | from datetime import datetime
from functools import reduce
from operator import or_
import urllib
from django.test import TestCase
from django.urls import reverse
from wiki.models import Artikkel, Isik, Organisatsioon, Objekt
class WikiViewTests(TestCase):
def test_algus_view(self):
time_start = datetime.now()
response = self.client.get(reverse('algus'))
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
def test_info_view(self):
time_start = datetime.now()
response = self.client.get(reverse('wiki:info'))
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
def test_kaart_view(self):
time_start = datetime.now()
response = self.client.get(reverse('kaart'))
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
# def test_j6ul2020_view(self):
# response = self.client.get(reverse('special_j6ul2020'))
# self.assertEqual(response.status_code, 200)
# self.assertContains(response, "Head uut aastat!")
# self.assertQuerysetEqual(response.context['latest_question_list'], [])
# def test_login(self):
# response = self.client.login(username='', password='')
# self.assertEqual(response, True)
# _ = self.client.logout()
class WikiDateViewTests(TestCase):
def test_all_view_1st_page(self):
time_start = datetime.now()
response = self.client.get(
reverse(
'wiki:artikkel_index_archive'
)
)
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
def test_all_view_other_page(self):
time_start = datetime.now()
response = self.client.get(
'/wiki/kroonika/',
{'page': '5'}
)
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
def test_all_view_wrong_page(self):
time_start = datetime.now()
response = self.client.get(
'/wiki/kroonika',
{'page': '5000'}
)
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 301)
self.assertTrue(time_stopp.seconds < 3)
def test_year_view(self):
time_start = datetime.now()
response = self.client.get(
reverse(
'wiki:artikkel_year_archive',
kwargs={'year': 1920}
)
)
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
def test_month_view(self):
time_start = datetime.now()
response = self.client.get(
reverse(
'wiki:artikkel_month_archive',
kwargs={'year': 1920, 'month': 2}
)
)
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
def test_day_view(self):
time_start = datetime.now()
response = self.client.get(
reverse(
'wiki:artikkel_day_archive',
kwargs={'year': 1920, 'month': 2, 'day': 24}
)
)
time_stopp = datetime.now() - time_start
self.assertEqual(response.status_code, 200)
self.assertTrue(time_stopp.seconds < 3)
class ArtikkelViewTests(TestCase):
def test_object_exists(self):
self.assertTrue(Artikkel.objects.filter(kroonika__isnull=True).count() > 0)
obj = Artikkel.objects.filter(kroonika__isnull=True).first()
url = urllib.parse.unquote(obj.get_absolute_url())
self.assertEqual(url, f'/wiki/{obj.id}-{obj.slug}/')
def test_artikkel_view_show_by_url(self):
obj = Artikkel.objects.filter(kroonika__isnull=True).first()
url = f'/wiki/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_artikkel_view_show_by_name_random(self):
SELECT_COUNT = 10
# Juhuslikud artiklid kontrolliks
objs = Artikkel.objects.filter(kroonika__isnull=True).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_artikkel_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_artikkel_HTTP404_for_non_authented_user(self):
SELECT_COUNT = 10
# Juhuslikud artiklid kontrolliks
objs = Artikkel.objects.filter(kroonika__isnull=False).order_by('?')[:SELECT_COUNT]
# obj = Artikkel.objects.filter(kroonika__isnull=False).first()
for obj in objs:
url = f'/wiki/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 404)
def test_artikkel_HTTP404_for_wrong_dateformat(self):
# Valel kujul kuupäevaotsingud
urls = [
'/wiki/kroonika/922/',
'/wiki/kroonika/11922/',
'/wiki/kroonika/1922/13/',
'/wiki/kroonika/1922/4/50/',
'/wiki/kroonika/1933/2/29/'
]
for url in urls:
response = self.client.get(url)
self.assertEqual(response.status_code, 404)
class IsikViewTests(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.test_object_id = 19 # Johannes Märtson
# Anonymous user filter
artikkel_qs = Artikkel.objects.filter(kroonika__isnull=True)
self.initial_queryset = Isik.objects.all()
artikliga = self.initial_queryset. \
filter(artikkel__in=artikkel_qs). \
values_list('id', flat=True)
viitega = self.initial_queryset. \
filter(viited__isnull=False). \
values_list('id', flat=True)
viiteta_artiklita = self.initial_queryset. \
filter(viited__isnull=True, artikkel__isnull=True). \
values_list('id', flat=True)
self.model_ids = reduce(or_, [artikliga, viitega, viiteta_artiklita])
def test_object_exists(self):
self.assertEqual(Isik.objects.filter(id=self.test_object_id).count(), 1)
obj = Isik.objects.get(id=self.test_object_id)
url = urllib.parse.unquote(obj.get_absolute_url())
self.assertEqual(url, f'/wiki/isik/{obj.id}-{obj.slug}/')
def test_view_url_exists_at_desired_location(self):
isik = Isik.objects.get(id=self.test_object_id)
url = f'/wiki/isik/{isik.id}-{isik.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
url = '/wiki/isik/19-johannes-märtson/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_view_url_response_time(self):
time_start = datetime.now()
isik = Isik.objects.get(id=self.test_object_id)
url = f'/wiki/isik/{isik.id}-{isik.slug}/'
_ = self.client.get(url)
time_stopp = datetime.now() - time_start
self.assertTrue(time_stopp.seconds < 5)
def test_view_uses_correct_template(self):
obj = Isik.objects.get(id=self.test_object_id)
url = f'/wiki/isik/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'wiki/isik_detail.html')
def test_view_show_by_name(self):
obj = Isik.objects.get(id=self.test_object_id)
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_isik_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_view_show_by_name_random(self):
SELECT_COUNT = 10
# Juhuslikud isikud kontrolliks
objs = self.initial_queryset.filter(id__in=self.model_ids).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_isik_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_view_HTTP404_for_non_authented_user(self):
SELECT_COUNT = 10
# Juhuslikud isikud kontrolliks
objs = self.initial_queryset.exclude(id__in=self.model_ids).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_isik_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 404)
def test_view_HTTP404_for_wrong_query(self):
# Valel kujul otsingud
urls = [
f'/wiki/isik/{self.test_object_id}/',
'/wiki/isik/{self.test_object_id}-mingi-suvanimi',
]
for url in urls:
response = self.client.get(url)
self.assertEqual(response.status_code, 404)
class OrganisatsioonViewTests(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.test_object_id = 13 # Säde selts
# Anonymous user filter
artikkel_qs = Artikkel.objects.filter(kroonika__isnull=True)
self.initial_queryset = Organisatsioon.objects.all()
artikliga = self.initial_queryset. \
filter(artikkel__in=artikkel_qs). \
values_list('id', flat=True)
viitega = self.initial_queryset. \
filter(viited__isnull=False). \
values_list('id', flat=True)
viiteta_artiklita = self.initial_queryset. \
filter(viited__isnull=True, artikkel__isnull=True). \
values_list('id', flat=True)
self.model_ids = reduce(or_, [artikliga, viitega, viiteta_artiklita])
def test_object_exists(self):
self.assertEqual(Organisatsioon.objects.filter(id=self.test_object_id).count(), 1)
obj = Organisatsioon.objects.get(id=self.test_object_id)
url = urllib.parse.unquote(obj.get_absolute_url())
self.assertEqual(url, f'/wiki/organisatsioon/{obj.id}-{obj.slug}/')
def test_view_url_exists_at_desired_location(self):
obj = Organisatsioon.objects.get(id=self.test_object_id)
url = f'/wiki/organisatsioon/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_view_url_response_time(self):
time_start = datetime.now()
obj = Organisatsioon.objects.get(id=self.test_object_id)
url = f'/wiki/organisatsioon/{obj.id}-{obj.slug}/'
_ = self.client.get(url)
time_stopp = datetime.now() - time_start
self.assertTrue(time_stopp.seconds < 5)
def test_view_uses_correct_template(self):
obj = Organisatsioon.objects.get(id=self.test_object_id)
url = f'/wiki/organisatsioon/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'wiki/organisatsioon_detail.html')
def test_view_show_by_name(self):
obj = Organisatsioon.objects.get(id=self.test_object_id)
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_organisatsioon_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_view_show_by_name_random(self):
SELECT_COUNT = 10
# Juhuslikud objektid kontrolliks
objs = self.initial_queryset.filter(id__in=self.model_ids).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_organisatsioon_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_view_HTTP404_for_non_authented_user(self):
SELECT_COUNT = 10
# Juhuslikud objektid kontrolliks
objs = self.initial_queryset.exclude(id__in=self.model_ids).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_organisatsioon_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 404)
def test_view_HTTP404_for_wrong_query(self):
# Valel kujul otsingud
urls = [
f'/wiki/organisatsioon/{self.test_object_id}/',
'/wiki/organisatsioon/{self.test_object_id}-mingi-suvanimi',
]
for url in urls:
response = self.client.get(url)
self.assertEqual(response.status_code, 404)
class ObjektViewTests(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.test_object_id = 68 # Säde seltsimaja
# Anonymous user filter
artikkel_qs = Artikkel.objects.filter(kroonika__isnull=True)
self.initial_queryset = Objekt.objects.all()
artikliga = self.initial_queryset. \
filter(artikkel__in=artikkel_qs). \
values_list('id', flat=True)
viitega = self.initial_queryset. \
filter(viited__isnull=False). \
values_list('id', flat=True)
viiteta_artiklita = self.initial_queryset. \
filter(viited__isnull=True, artikkel__isnull=True). \
values_list('id', flat=True)
self.model_ids = reduce(or_, [artikliga, viitega, viiteta_artiklita])
def test_object_exists(self):
self.assertEqual(Objekt.objects.filter(id=self.test_object_id).count(), 1)
obj = Objekt.objects.get(id=self.test_object_id)
url = urllib.parse.unquote(obj.get_absolute_url())
self.assertEqual(url, f'/wiki/objekt/{obj.id}-{obj.slug}/')
def test_view_url_exists_at_desired_location(self):
obj = Objekt.objects.get(id=self.test_object_id)
url = f'/wiki/objekt/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_view_url_response_time(self):
time_start = datetime.now()
obj = Objekt.objects.get(id=self.test_object_id)
url = f'/wiki/objekt/{obj.id}-{obj.slug}/'
_ = self.client.get(url)
time_stopp = datetime.now() - time_start
self.assertTrue(time_stopp.seconds < 5)
def test_view_uses_correct_template(self):
obj = Objekt.objects.get(id=self.test_object_id)
url = f'/wiki/objekt/{obj.id}-{obj.slug}/'
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'wiki/objekt_detail.html')
def test_view_show_by_name(self):
obj = Objekt.objects.get(id=self.test_object_id)
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_objekt_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_view_show_by_name_random(self):
SELECT_COUNT = 10
# Juhuslikud objektid kontrolliks
objs = self.initial_queryset.filter(id__in=self.model_ids).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_objekt_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 200)
def test_view_HTTP404_for_non_authented_user(self):
SELECT_COUNT = 10
# Juhuslikud objektid kontrolliks
objs = self.initial_queryset.exclude(id__in=self.model_ids).order_by('?')[:SELECT_COUNT]
for obj in objs:
kwargs = {
'pk': obj.id,
'slug': obj.slug
}
response = self.client.get(reverse('wiki:wiki_objekt_detail', kwargs=kwargs))
self.assertEqual(response.status_code, 404)
def test_view_HTTP404_for_wrong_query(self):
# Valel kujul otsingud
urls = [
f'/wiki/objekt/{self.test_object_id}/',
'/wiki/objekt/{self.test_object_id}-mingi-suvanimi',
]
for url in urls:
response = self.client.get(url)
self.assertEqual(response.status_code, 404)
class FilterViewTests(TestCase):
# def setUp(self):
# # Every test needs access to the request factory.
# self.test_object_id = 68 # Säde seltsimaja
# # Anonymous user filter
# artikkel_qs = Artikkel.objects.filter(kroonika__isnull=True)
# self.initial_queryset = Objekt.objects.all()
# artikliga = self.initial_queryset. \
# filter(artikkel__in=artikkel_qs). \
# values_list('id', flat=True)
# viitega = self.initial_queryset. \
# filter(viited__isnull=False). \
# values_list('id', flat=True)
# viiteta_artiklita = self.initial_queryset. \
# filter(viited__isnull=True, artikkel__isnull=True). \
# values_list('id', flat=True)
# self.model_ids = reduce(or_, [artikliga, viitega, viiteta_artiklita])
def test_filter_objekt_for_non_authented_user(self):
response = self.client.get('/wiki/objekt/', {'nimi_sisaldab': 'säde'})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context['object_list']), 2)
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.webdriver.chrome.webdriver import WebDriver
# class MySeleniumTests(StaticLiveServerTestCase):
# # fixtures = ['user-data.json']
#
# @classmethod
# def setUpClass(cls):
# super().setUpClass()
# cls.selenium = WebDriver()
# cls.selenium.implicitly_wait(10)
#
# @classmethod
# def tearDownClass(cls):
# cls.selenium.quit()
# super().tearDownClass()
#
# def test_login(self):
# from selenium.webdriver.support.wait import WebDriverWait
# timeout = 2
# self.selenium.get('%s%s' % (self.live_server_url, '/accounts/login/'))
# username_input = self.selenium.find_element_by_name("username")
# username_input.send_keys('')
# password_input = self.selenium.find_element_by_name("password")
# password_input.send_keys('')
# self.selenium.find_element_by_xpath('//input[@value="login"]').click()
# # Wait until the response is received
# WebDriverWait(self.selenium, timeout).until(
# lambda driver: driver.find_element_by_tag_name('body')) | 39.84472 | 97 | 0.629722 | 2,278 | 19,245 | 5.088674 | 0.095698 | 0.055642 | 0.041494 | 0.061594 | 0.848948 | 0.838337 | 0.812026 | 0.798223 | 0.792271 | 0.782781 | 0 | 0.016149 | 0.25352 | 19,245 | 483 | 98 | 39.844721 | 0.790756 | 0.144089 | 0 | 0.710306 | 0 | 0 | 0.09473 | 0.080578 | 0 | 0 | 0 | 0 | 0.158774 | 1 | 0.116992 | false | 0 | 0.02507 | 0 | 0.16156 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
f2c71e2b2e903033d40e16b539ed8fb3b99da50d | 1,513 | py | Python | hoverpy/decorators.py | alvarocavalcanti/hoverpy | e153ec57f80634019d827d378f184c01fedc5a0e | [
"Apache-2.0"
] | 88 | 2016-11-10T18:05:28.000Z | 2021-04-26T05:46:34.000Z | hoverpy/decorators.py | alvarocavalcanti/hoverpy | e153ec57f80634019d827d378f184c01fedc5a0e | [
"Apache-2.0"
] | 11 | 2016-12-10T21:03:25.000Z | 2018-10-05T09:46:21.000Z | hoverpy/decorators.py | alvarocavalcanti/hoverpy | e153ec57f80634019d827d378f184c01fedc5a0e | [
"Apache-2.0"
] | 10 | 2016-11-10T19:02:28.000Z | 2018-10-22T10:17:55.000Z | from .hp import HoverPy
class capture(object):
def __init__(self, dbpath="requests.db", capture=True, **kwargs):
self.dbpath = dbpath
self.capture = capture
self.kwargs = kwargs
def __call__(self, f):
def wrapped_f(*args):
with HoverPy(capture=self.capture, dbpath=self.dbpath, **self.kwargs):
return f(*args)
return wrapped_f
class simulate(object):
def __init__(self, dbpath="requests.db", capture=False, **kwargs):
self.dbpath = dbpath
self.capture = capture
self.kwargs = kwargs
def __call__(self, f):
def wrapped_f(*args):
with HoverPy(capture=self.capture, dbpath=self.dbpath, **self.kwargs):
return f(*args)
return wrapped_f
class spy(object):
def __init__(self, dbpath="requests.db", capture=False, **kwargs):
self.dbpath = dbpath
self.capture = capture
self.kwargs = kwargs
def __call__(self, f):
def wrapped_f(*args):
with HoverPy(spy=True, capture=self.capture, dbpath=self.dbpath, **self.kwargs):
return f(*args)
return wrapped_f
class modify(object):
def __init__(self, middleware, **kwargs):
self.middleware = middleware
self.kwargs = kwargs
def __call__(self, f):
def wrapped_f(*args):
with HoverPy(modify=True, middleware=self.middleware, **self.kwargs):
return f(*args)
return wrapped_f
| 28.018519 | 92 | 0.603437 | 178 | 1,513 | 4.904494 | 0.146067 | 0.103093 | 0.059565 | 0.077892 | 0.828179 | 0.828179 | 0.828179 | 0.828179 | 0.742268 | 0.742268 | 0 | 0 | 0.28156 | 1,513 | 53 | 93 | 28.54717 | 0.803128 | 0 | 0 | 0.75 | 0 | 0 | 0.021825 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.025 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
4b4d3f9acf50e90e2b259fa7e187201e6987e61c | 6,710 | py | Python | document_page.py | XiaochenHou/zhiying_android_automation | dc680a489a604221dec9410c577ae30dd5ab12bc | [
"MIT"
] | 2 | 2022-02-11T08:48:50.000Z | 2022-02-11T09:53:38.000Z | document_page.py | XiaochenHou/zhiying_android_automation | dc680a489a604221dec9410c577ae30dd5ab12bc | [
"MIT"
] | null | null | null | document_page.py | XiaochenHou/zhiying_android_automation | dc680a489a604221dec9410c577ae30dd5ab12bc | [
"MIT"
] | null | null | null | from time import sleep
from constant import back
from selenium.webdriver.common.by import By
def document_page_test(driver):
print("========Document Page Test Started========")
# switch to the document page
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout[2]").click()
print("switched to the document page")
print("testing the three dots...")
three_dots = driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.RelativeLayout[2]/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]/android.widget.ImageView")
three_dots.click()
cooperation = driver.find_element(By.ID, "com.iflytek.zhiying:id/tv_cooperation_list")
cooperation.click()
# sleep(10)
back(driver)
print("cooperation done!")
three_dots = driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.RelativeLayout[2]/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.LinearLayout[2]/android.widget.ImageView")
three_dots.click()
share = driver.find_element_by_id("com.iflytek.zhiying:id/tv_pop_share")
share.click()
back(driver)
print("share done!")
print("three dots tests done!")
print("collection test starts...")
document = driver.find_element_by_xpath(
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.RelativeLayout[2]/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]")
document.click()
sleep(1)
# 收藏
star = driver.find_element_by_xpath(
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/android.widget.RelativeLayout[2]/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.ImageView[2]")
star.click()
back(driver)
# 检查收藏
check_collection(driver)
# 与我协作
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[2]/android.widget.TextView").click()
print("now check the upload page")
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[2]").click()
# upload button
driver.find_element(By.ID, "com.iflytek.zhiying:id/iv_upload_file").click()
back(driver)
print("upload page done!")
print("========document page done!========")
# reset the page to home page
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[1]").click()
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout[1]").click()
def check_collection(driver):
# go to the main page
print("now check the collection")
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout[1]").click()
driver.find_element(By.ID, "com.iflytek.zhiying:id/tv_collect").click()
sleep(2)
# 取消收藏
driver.find_element(By.ID, "com.iflytek.zhiying:id/iv_document_collect").click()
print("the star unchecked")
back(driver)
print("collection check done!")
driver.find_element(By.XPATH,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout[2]").click()
| 78.023256 | 654 | 0.783756 | 756 | 6,710 | 6.904762 | 0.104497 | 0.301341 | 0.239464 | 0.219732 | 0.852874 | 0.852874 | 0.838506 | 0.838506 | 0.838506 | 0.838506 | 0 | 0.003785 | 0.094337 | 6,710 | 85 | 655 | 78.941176 | 0.855192 | 0.017437 | 0 | 0.372881 | 0 | 0.186441 | 0.747683 | 0.700289 | 0 | 0 | 0 | 0 | 0 | 1 | 0.033898 | false | 0 | 0.050847 | 0 | 0.084746 | 0.220339 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
4b6aa5cd552add32a9b679291707ca92aeba5a5c | 364 | py | Python | effect.py | vanquisher2122/my-projects | cf1abf90b30aa82b5cf16b9263d2dbcdf2750dd1 | [
"Apache-2.0"
] | null | null | null | effect.py | vanquisher2122/my-projects | cf1abf90b30aa82b5cf16b9263d2dbcdf2750dd1 | [
"Apache-2.0"
] | null | null | null | effect.py | vanquisher2122/my-projects | cf1abf90b30aa82b5cf16b9263d2dbcdf2750dd1 | [
"Apache-2.0"
] | null | null | null | import time
import os
def load():
print("loading. \ ")
time.sleep(1)
os.system('cls')
print("loading.. |")
time.sleep(1)
os.system('cls')
print("loading... /")
time.sleep(1)
os.system('cls')
print("loading.. -")
time.sleep(1)
os.system('cls')
load()
load()
load()
load()
load()
load()
load()
load()
load()
load()
load() | 13 | 24 | 0.552198 | 49 | 364 | 4.102041 | 0.22449 | 0.39801 | 0.537313 | 0.636816 | 0.875622 | 0.875622 | 0.875622 | 0.875622 | 0.875622 | 0.875622 | 0 | 0.013986 | 0.214286 | 364 | 28 | 25 | 13 | 0.688811 | 0 | 0 | 0.730769 | 0 | 0 | 0.180473 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038462 | true | 0 | 0.076923 | 0 | 0.115385 | 0.153846 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
4b8794fd886042b62475832ea317b60b441392a8 | 3,342 | py | Python | pyspedas/mms/tests/eis.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | pyspedas/mms/tests/eis.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | pyspedas/mms/tests/eis.py | shihikoo/pyspedas | 5251c52d074c4f2c3d91f2f8a457d36f3ad2ddb4 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from pyspedas import mms_load_eis, mms_eis_pad
from pyspedas.utilities.data_exists import data_exists
class EISTestCases(unittest.TestCase):
def test_pad_extof_srvy(self):
mms_load_eis(datatype='extof')
mms_eis_pad(datatype='extof')
self.assertTrue(data_exists('mms1_epd_eis_extof_46-10489keV_proton_flux_omni_pad_spin'))
self.assertTrue(data_exists('mms1_epd_eis_extof_46-10489keV_proton_flux_omni_pad'))
self.assertTrue(data_exists('mms1_epd_eis_extof_proton_flux_omni_spin'))
self.assertTrue(data_exists('mms1_epd_eis_extof_proton_flux_omni'))
self.assertTrue(data_exists('mms1_epd_eis_extof_oxygen_energy_range'))
self.assertTrue(data_exists('mms1_epd_eis_extof_proton_energy_range'))
def test_pad_extof_srvy_probe(self):
mms_load_eis(probe=4)
mms_eis_pad(probe=4)
self.assertTrue(data_exists('mms4_epd_eis_extof_44-1315keV_proton_flux_omni_pad_spin'))
self.assertTrue(data_exists('mms4_epd_eis_extof_44-1315keV_proton_flux_omni_pad'))
self.assertTrue(data_exists('mms4_epd_eis_extof_proton_flux_omni_spin'))
self.assertTrue(data_exists('mms4_epd_eis_extof_proton_flux_omni'))
self.assertTrue(data_exists('mms4_epd_eis_extof_oxygen_energy_range'))
self.assertTrue(data_exists('mms4_epd_eis_extof_proton_energy_range'))
def test_pad_extof_brst(self):
mms_load_eis(probe=4, datatype='extof', data_rate='brst', trange=['2015-10-16/13:06', '2015-10-16/13:07'])
mms_eis_pad(probe=4, datatype='extof', data_rate='brst')
self.assertTrue(data_exists('mms4_epd_eis_brst_extof_52-878keV_proton_flux_omni_pad_spin'))
self.assertTrue(data_exists('mms4_epd_eis_brst_extof_52-878keV_proton_flux_omni_pad'))
self.assertTrue(data_exists('mms4_epd_eis_brst_extof_proton_flux_omni'))
self.assertTrue(data_exists('mms4_epd_eis_brst_extof_proton_energy_range'))
self.assertTrue(data_exists('mms4_epd_eis_brst_extof_oxygen_energy_range'))
def test_load_phxtof_data(self):
data = mms_load_eis(trange=['2015-10-16', '2015-10-16/01:00'], datatype='phxtof')
self.assertTrue(data_exists('mms1_epd_eis_phxtof_proton_flux_omni'))
self.assertTrue(data_exists('mms1_epd_eis_phxtof_proton_t5_energy_dminus'))
self.assertTrue(data_exists('mms1_epd_eis_phxtof_proton_t5_energy_dplus'))
def test_load_phxtof_spdf(self):
data = mms_load_eis(trange=['2015-10-16/13:06', '2015-10-16/13:07'], datatype='phxtof', data_rate='brst', spdf=True)
self.assertTrue(data_exists('mms1_epd_eis_brst_phxtof_proton_flux_omni'))
self.assertTrue(data_exists('mms1_epd_eis_brst_phxtof_proton_t5_energy_dminus'))
self.assertTrue(data_exists('mms1_epd_eis_brst_phxtof_proton_t5_energy_dplus'))
def test_load_extof_suffix(self):
data = mms_load_eis(trange=['2015-10-16/13:06', '2015-10-16/13:07'], data_rate='brst', datatype='extof', suffix='_test')
self.assertTrue(data_exists('mms1_epd_eis_brst_extof_proton_flux_omni_test'))
self.assertTrue(data_exists('mms1_epd_eis_brst_extof_proton_t5_energy_dminus_test'))
self.assertTrue(data_exists('mms1_epd_eis_brst_extof_proton_t5_energy_dminus_test'))
if __name__ == '__main__':
unittest.main() | 59.678571 | 128 | 0.770497 | 508 | 3,342 | 4.527559 | 0.124016 | 0.121739 | 0.203478 | 0.271304 | 0.836522 | 0.816087 | 0.801304 | 0.77087 | 0.756957 | 0.699565 | 0 | 0.055935 | 0.122681 | 3,342 | 56 | 129 | 59.678571 | 0.728513 | 0 | 0 | 0.041667 | 0 | 0 | 0.402932 | 0.346695 | 0 | 0 | 0 | 0 | 0.541667 | 1 | 0.125 | false | 0 | 0.083333 | 0 | 0.229167 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
4baf1e80ebb36fd935664d5f882e56c073d19de2 | 94 | py | Python | linora/sample_splits/__init__.py | Hourout/linora | 4269516c9227a18bd1a65e1c6a59e73c74e874d0 | [
"Apache-2.0"
] | 10 | 2018-11-22T03:30:39.000Z | 2020-08-20T04:39:35.000Z | linora/sample_splits/__init__.py | Hourout/linora | 4269516c9227a18bd1a65e1c6a59e73c74e874d0 | [
"Apache-2.0"
] | null | null | null | linora/sample_splits/__init__.py | Hourout/linora | 4269516c9227a18bd1a65e1c6a59e73c74e874d0 | [
"Apache-2.0"
] | 3 | 2019-04-09T12:17:34.000Z | 2020-08-20T04:33:31.000Z | from linora.sample_splits._fold import *
from linora.sample_splits._timeseries_kfold import *
| 31.333333 | 52 | 0.851064 | 13 | 94 | 5.769231 | 0.615385 | 0.266667 | 0.426667 | 0.586667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085106 | 94 | 2 | 53 | 47 | 0.872093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 8 |
d9ac7dd7062e9bca9e27624e12cd278f347bb0b4 | 11,569 | py | Python | utils/models/q_resnet.py | GavinGuan95/HAWQ | a4feff3967739bb9f700c60a19b6c3fd3e8d8377 | [
"MIT"
] | 215 | 2020-11-24T07:08:26.000Z | 2022-03-28T22:31:18.000Z | utils/models/q_resnet.py | GavinGuan95/HAWQ | a4feff3967739bb9f700c60a19b6c3fd3e8d8377 | [
"MIT"
] | 33 | 2020-11-23T05:52:55.000Z | 2022-03-29T03:08:48.000Z | utils/models/q_resnet.py | GavinGuan95/HAWQ | a4feff3967739bb9f700c60a19b6c3fd3e8d8377 | [
"MIT"
] | 54 | 2020-11-24T07:31:25.000Z | 2022-03-31T19:54:26.000Z | """
Quantized ResNet for ImageNet-1K, implemented in PyTorch.
Original paper: 'Deep Residual Learning for Image Recognition,' https://arxiv.org/abs/1512.03385.
"""
import torch
import torch.nn as nn
import copy
from ..quantization_utils.quant_modules import *
from pytorchcv.models.common import ConvBlock
from pytorchcv.models.shufflenetv2 import ShuffleUnit, ShuffleInitBlock
import time
import logging
class Q_ResNet18(nn.Module):
"""
Quantized ResNet50 model from 'Deep Residual Learning for Image Recognition,' https://arxiv.org/abs/1512.03385.
"""
def __init__(self, model):
super().__init__()
features = getattr(model, 'features')
init_block = getattr(features, 'init_block')
self.quant_input = QuantAct()
self.quant_init_block_convbn = QuantBnConv2d()
self.quant_init_block_convbn.set_param(init_block.conv.conv, init_block.conv.bn)
self.quant_act_int32 = QuantAct()
self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.act = nn.ReLU()
self.channel = [2, 2, 2, 2]
for stage_num in range(0, 4):
stage = getattr(features, "stage{}".format(stage_num + 1))
for unit_num in range(0, self.channel[stage_num]):
unit = getattr(stage, "unit{}".format(unit_num + 1))
quant_unit = Q_ResBlockBn()
quant_unit.set_param(unit)
setattr(self, f"stage{stage_num + 1}.unit{unit_num + 1}", quant_unit)
self.final_pool = QuantAveragePool2d(kernel_size=7, stride=1)
self.quant_act_output = QuantAct()
output = getattr(model, 'output')
self.quant_output = QuantLinear()
self.quant_output.set_param(output)
def forward(self, x):
x, act_scaling_factor = self.quant_input(x)
x, weight_scaling_factor = self.quant_init_block_convbn(x, act_scaling_factor)
x = self.pool(x)
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor)
x = self.act(x)
for stage_num in range(0, 4):
for unit_num in range(0, self.channel[stage_num]):
tmp_func = getattr(self, f"stage{stage_num+1}.unit{unit_num+1}")
x, act_scaling_factor = tmp_func(x, act_scaling_factor)
x = self.final_pool(x, act_scaling_factor)
x, act_scaling_factor = self.quant_act_output(x, act_scaling_factor)
x = x.view(x.size(0), -1)
x = self.quant_output(x, act_scaling_factor)
return x
class Q_ResNet50(nn.Module):
"""
Quantized ResNet50 model from 'Deep Residual Learning for Image Recognition,' https://arxiv.org/abs/1512.03385.
"""
def __init__(self, model):
super().__init__()
features = getattr(model, 'features')
init_block = getattr(features, 'init_block')
self.quant_input = QuantAct()
self.quant_init_convbn = QuantBnConv2d()
self.quant_init_convbn.set_param(init_block.conv.conv, init_block.conv.bn)
self.quant_act_int32 = QuantAct()
self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.act = nn.ReLU()
self.channel = [3, 4, 6, 3]
for stage_num in range(0, 4):
stage = getattr(features, "stage{}".format(stage_num + 1))
for unit_num in range(0, self.channel[stage_num]):
unit = getattr(stage, "unit{}".format(unit_num + 1))
quant_unit = Q_ResUnitBn()
quant_unit.set_param(unit)
setattr(self, f"stage{stage_num + 1}.unit{unit_num + 1}", quant_unit)
self.final_pool = QuantAveragePool2d(kernel_size=7, stride=1)
self.quant_act_output = QuantAct()
output = getattr(model, 'output')
self.quant_output = QuantLinear()
self.quant_output.set_param(output)
def forward(self, x):
x, act_scaling_factor = self.quant_input(x)
x, weight_scaling_factor = self.quant_init_convbn(x, act_scaling_factor)
x = self.pool(x)
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor)
x = self.act(x)
for stage_num in range(0, 4):
for unit_num in range(0, self.channel[stage_num]):
tmp_func = getattr(self, f"stage{stage_num+1}.unit{unit_num+1}")
x, act_scaling_factor = tmp_func(x, act_scaling_factor)
x = self.final_pool(x, act_scaling_factor)
x, act_scaling_factor = self.quant_act_output(x, act_scaling_factor)
x = x.view(x.size(0), -1)
x = self.quant_output(x, act_scaling_factor)
return x
class Q_ResNet101(nn.Module):
"""
Quantized ResNet101 model from 'Deep Residual Learning for Image Recognition,' https://arxiv.org/abs/1512.03385.
"""
def __init__(self, model):
super().__init__()
features = getattr(model, 'features')
init_block = getattr(features, 'init_block')
self.quant_input = QuantAct()
self.quant_init_convbn = QuantBnConv2d()
self.quant_init_convbn.set_param(init_block.conv.conv, init_block.conv.bn)
self.quant_act_int32 = QuantAct()
self.pool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.act = nn.ReLU()
self.channel = [3, 4, 23, 3]
for stage_num in range(0, 4):
stage = getattr(features, "stage{}".format(stage_num + 1))
for unit_num in range(0, self.channel[stage_num]):
unit = getattr(stage, "unit{}".format(unit_num + 1))
quant_unit = Q_ResUnitBn()
quant_unit.set_param(unit)
setattr(self, f"stage{stage_num + 1}.unit{unit_num + 1}", quant_unit)
self.final_pool = QuantAveragePool2d(kernel_size=7, stride=1)
self.quant_act_output = QuantAct()
output = getattr(model, 'output')
self.quant_output = QuantLinear()
self.quant_output.set_param(output)
def forward(self, x):
x, act_scaling_factor = self.quant_input(x)
x, weight_scaling_factor = self.quant_init_convbn(x, act_scaling_factor)
x = self.pool(x)
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor, None, None)
x = self.act(x)
for stage_num in range(0, 4):
for unit_num in range(0, self.channel[stage_num]):
tmp_func = getattr(self, f"stage{stage_num+1}.unit{unit_num+1}")
x, act_scaling_factor = tmp_func(x, act_scaling_factor)
x = self.final_pool(x, act_scaling_factor)
x, act_scaling_factor = self.quant_act_output(x, act_scaling_factor)
x = x.view(x.size(0), -1)
x = self.quant_output(x, act_scaling_factor)
return x
class Q_ResUnitBn(nn.Module):
"""
Quantized ResNet unit with residual path.
"""
def __init__(self):
super(Q_ResUnitBn, self).__init__()
def set_param(self, unit):
self.resize_identity = unit.resize_identity
self.quant_act = QuantAct()
convbn1 = unit.body.conv1
self.quant_convbn1 = QuantBnConv2d()
self.quant_convbn1.set_param(convbn1.conv, convbn1.bn)
self.quant_act1 = QuantAct()
convbn2 = unit.body.conv2
self.quant_convbn2 = QuantBnConv2d()
self.quant_convbn2.set_param(convbn2.conv, convbn2.bn)
self.quant_act2 = QuantAct()
convbn3 = unit.body.conv3
self.quant_convbn3 = QuantBnConv2d()
self.quant_convbn3.set_param(convbn3.conv, convbn3.bn)
if self.resize_identity:
self.quant_identity_convbn = QuantBnConv2d()
self.quant_identity_convbn.set_param(unit.identity_conv.conv, unit.identity_conv.bn)
self.quant_act_int32 = QuantAct()
def forward(self, x, scaling_factor_int32=None):
# forward using the quantized modules
if self.resize_identity:
x, act_scaling_factor = self.quant_act(x, scaling_factor_int32)
identity_act_scaling_factor = act_scaling_factor.clone()
identity, identity_weight_scaling_factor = self.quant_identity_convbn(x, act_scaling_factor)
else:
identity = x
x, act_scaling_factor = self.quant_act(x, scaling_factor_int32)
x, weight_scaling_factor = self.quant_convbn1(x, act_scaling_factor)
x = nn.ReLU()(x)
x, act_scaling_factor = self.quant_act1(x, act_scaling_factor, weight_scaling_factor)
x, weight_scaling_factor = self.quant_convbn2(x, act_scaling_factor)
x = nn.ReLU()(x)
x, act_scaling_factor = self.quant_act2(x, act_scaling_factor, weight_scaling_factor)
x, weight_scaling_factor = self.quant_convbn3(x, act_scaling_factor)
x = x + identity
if self.resize_identity:
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor, identity, identity_act_scaling_factor, identity_weight_scaling_factor)
else:
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor, identity, scaling_factor_int32, None)
x = nn.ReLU()(x)
return x, act_scaling_factor
class Q_ResBlockBn(nn.Module):
"""
Quantized ResNet block with residual path.
"""
def __init__(self):
super(Q_ResBlockBn, self).__init__()
def set_param(self, unit):
self.resize_identity = unit.resize_identity
self.quant_act = QuantAct()
convbn1 = unit.body.conv1
self.quant_convbn1 = QuantBnConv2d()
self.quant_convbn1.set_param(convbn1.conv, convbn1.bn)
self.quant_act1 = QuantAct()
convbn2 = unit.body.conv2
self.quant_convbn2 = QuantBnConv2d()
self.quant_convbn2.set_param(convbn2.conv, convbn2.bn)
if self.resize_identity:
self.quant_identity_convbn = QuantBnConv2d()
self.quant_identity_convbn.set_param(unit.identity_conv.conv, unit.identity_conv.bn)
self.quant_act_int32 = QuantAct()
def forward(self, x, scaling_factor_int32=None):
# forward using the quantized modules
if self.resize_identity:
x, act_scaling_factor = self.quant_act(x, scaling_factor_int32)
identity_act_scaling_factor = act_scaling_factor.clone()
identity, identity_weight_scaling_factor = self.quant_identity_convbn(x, act_scaling_factor)
else:
identity = x
x, act_scaling_factor = self.quant_act(x, scaling_factor_int32)
x, weight_scaling_factor = self.quant_convbn1(x, act_scaling_factor)
x = nn.ReLU()(x)
x, act_scaling_factor = self.quant_act1(x, act_scaling_factor, weight_scaling_factor)
x, weight_scaling_factor = self.quant_convbn2(x, act_scaling_factor)
x = x + identity
if self.resize_identity:
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor, identity, identity_act_scaling_factor, identity_weight_scaling_factor)
else:
x, act_scaling_factor = self.quant_act_int32(x, act_scaling_factor, weight_scaling_factor, identity, scaling_factor_int32, None)
x = nn.ReLU()(x)
return x, act_scaling_factor
def q_resnet18(model):
net = Q_ResNet18(model)
return net
def q_resnet50(model):
net = Q_ResNet50(model)
return net
def q_resnet101(model):
net = Q_ResNet101(model)
return net
| 34.846386 | 173 | 0.655804 | 1,546 | 11,569 | 4.603493 | 0.078913 | 0.169875 | 0.141633 | 0.136153 | 0.906702 | 0.89504 | 0.89504 | 0.89504 | 0.885766 | 0.885766 | 0 | 0.026589 | 0.242545 | 11,569 | 331 | 174 | 34.951662 | 0.785576 | 0.056185 | 0 | 0.835681 | 0 | 0 | 0.030808 | 0.009714 | 0 | 0 | 0 | 0 | 0 | 1 | 0.070423 | false | 0 | 0.037559 | 0 | 0.169014 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
d9f34ccd0e8ffbfb725219ae87830961b0c13579 | 5,877 | py | Python | dlint/linters/bad_defusedxml_use.py | DrewDennison/dlint | a2ed49e68638036aa99ea4ba6f095473b5dddd88 | [
"BSD-3-Clause"
] | 335 | 2019-07-17T13:31:21.000Z | 2021-12-09T06:02:21.000Z | dlint/linters/bad_defusedxml_use.py | DrewDennison/dlint | a2ed49e68638036aa99ea4ba6f095473b5dddd88 | [
"BSD-3-Clause"
] | 49 | 2019-07-17T13:34:56.000Z | 2020-08-11T12:22:22.000Z | dlint/linters/bad_defusedxml_use.py | DrewDennison/dlint | a2ed49e68638036aa99ea4ba6f095473b5dddd88 | [
"BSD-3-Clause"
] | 15 | 2019-07-17T20:28:33.000Z | 2021-01-11T11:06:06.000Z | #!/usr/bin/env python
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
from .helpers import bad_kwarg_use
from .. import tree
class BadDefusedxmlUseLinter(bad_kwarg_use.BadKwargUseLinter):
"""This linter looks for lack of "defusedxml" parsing defenses. The
"defusedxml" library offers "forbid_dtd", "forbid_entities", and
"forbid_external" keyword arguments to prevent various XML attack
vectors[1]. All defenses should be enabled.
[1] https://pypi.org/project/defusedxml/
"""
off_by_default = False
_code = 'DUO135'
_error_tmpl = 'DUO135 enable all "forbid_*" defenses when using "defusedxml" parsing'
@property
def kwargs(self):
return [
{
"module_path": "defusedxml.lxml.fromstring",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.lxml.iterparse",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.lxml.parse",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.lxml.fromstring",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.lxml.iterparse",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.lxml.parse",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.lxml.fromstring",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.lxml.iterparse",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.lxml.parse",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.cElementTree.fromstring",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.cElementTree.iterparse",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.cElementTree.parse",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.cElementTree.fromstring",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.cElementTree.iterparse",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.cElementTree.parse",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.cElementTree.fromstring",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.cElementTree.iterparse",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.cElementTree.parse",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.ElementTree.fromstring",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.ElementTree.iterparse",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.ElementTree.parse",
"kwarg_name": "forbid_dtd",
"predicate": tree.kwarg_not_present,
},
{
"module_path": "defusedxml.ElementTree.fromstring",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.ElementTree.iterparse",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.ElementTree.parse",
"kwarg_name": "forbid_entities",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.ElementTree.fromstring",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.ElementTree.iterparse",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
{
"module_path": "defusedxml.ElementTree.parse",
"kwarg_name": "forbid_external",
"predicate": tree.kwarg_false,
},
]
| 35.191617 | 89 | 0.492428 | 451 | 5,877 | 6.113082 | 0.184035 | 0.097933 | 0.195865 | 0.150163 | 0.81284 | 0.81284 | 0.81284 | 0.81284 | 0.804135 | 0.792891 | 0 | 0.00225 | 0.394929 | 5,877 | 166 | 90 | 35.403614 | 0.77306 | 0.051387 | 0 | 0.536424 | 0 | 0 | 0.365537 | 0.141132 | 0 | 0 | 0 | 0 | 0 | 1 | 0.006623 | false | 0 | 0.02649 | 0.006623 | 0.066225 | 0.006623 | 0 | 0 | 0 | null | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
d9f5a049da7c03a6fe6588c4e03bb90920159d25 | 6,269 | py | Python | loldib/getratings/models/NA/na_nunu/na_nunu_jng.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_nunu/na_nunu_jng.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_nunu/na_nunu_jng.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | from getratings.models.ratings import Ratings
class NA_Nunu_Jng_Aatrox(Ratings):
pass
class NA_Nunu_Jng_Ahri(Ratings):
pass
class NA_Nunu_Jng_Akali(Ratings):
pass
class NA_Nunu_Jng_Alistar(Ratings):
pass
class NA_Nunu_Jng_Amumu(Ratings):
pass
class NA_Nunu_Jng_Anivia(Ratings):
pass
class NA_Nunu_Jng_Annie(Ratings):
pass
class NA_Nunu_Jng_Ashe(Ratings):
pass
class NA_Nunu_Jng_AurelionSol(Ratings):
pass
class NA_Nunu_Jng_Azir(Ratings):
pass
class NA_Nunu_Jng_Bard(Ratings):
pass
class NA_Nunu_Jng_Blitzcrank(Ratings):
pass
class NA_Nunu_Jng_Brand(Ratings):
pass
class NA_Nunu_Jng_Braum(Ratings):
pass
class NA_Nunu_Jng_Caitlyn(Ratings):
pass
class NA_Nunu_Jng_Camille(Ratings):
pass
class NA_Nunu_Jng_Cassiopeia(Ratings):
pass
class NA_Nunu_Jng_Chogath(Ratings):
pass
class NA_Nunu_Jng_Corki(Ratings):
pass
class NA_Nunu_Jng_Darius(Ratings):
pass
class NA_Nunu_Jng_Diana(Ratings):
pass
class NA_Nunu_Jng_Draven(Ratings):
pass
class NA_Nunu_Jng_DrMundo(Ratings):
pass
class NA_Nunu_Jng_Ekko(Ratings):
pass
class NA_Nunu_Jng_Elise(Ratings):
pass
class NA_Nunu_Jng_Evelynn(Ratings):
pass
class NA_Nunu_Jng_Ezreal(Ratings):
pass
class NA_Nunu_Jng_Fiddlesticks(Ratings):
pass
class NA_Nunu_Jng_Fiora(Ratings):
pass
class NA_Nunu_Jng_Fizz(Ratings):
pass
class NA_Nunu_Jng_Galio(Ratings):
pass
class NA_Nunu_Jng_Gangplank(Ratings):
pass
class NA_Nunu_Jng_Garen(Ratings):
pass
class NA_Nunu_Jng_Gnar(Ratings):
pass
class NA_Nunu_Jng_Gragas(Ratings):
pass
class NA_Nunu_Jng_Graves(Ratings):
pass
class NA_Nunu_Jng_Hecarim(Ratings):
pass
class NA_Nunu_Jng_Heimerdinger(Ratings):
pass
class NA_Nunu_Jng_Illaoi(Ratings):
pass
class NA_Nunu_Jng_Irelia(Ratings):
pass
class NA_Nunu_Jng_Ivern(Ratings):
pass
class NA_Nunu_Jng_Janna(Ratings):
pass
class NA_Nunu_Jng_JarvanIV(Ratings):
pass
class NA_Nunu_Jng_Jax(Ratings):
pass
class NA_Nunu_Jng_Jayce(Ratings):
pass
class NA_Nunu_Jng_Jhin(Ratings):
pass
class NA_Nunu_Jng_Jinx(Ratings):
pass
class NA_Nunu_Jng_Kalista(Ratings):
pass
class NA_Nunu_Jng_Karma(Ratings):
pass
class NA_Nunu_Jng_Karthus(Ratings):
pass
class NA_Nunu_Jng_Kassadin(Ratings):
pass
class NA_Nunu_Jng_Katarina(Ratings):
pass
class NA_Nunu_Jng_Kayle(Ratings):
pass
class NA_Nunu_Jng_Kayn(Ratings):
pass
class NA_Nunu_Jng_Kennen(Ratings):
pass
class NA_Nunu_Jng_Khazix(Ratings):
pass
class NA_Nunu_Jng_Kindred(Ratings):
pass
class NA_Nunu_Jng_Kled(Ratings):
pass
class NA_Nunu_Jng_KogMaw(Ratings):
pass
class NA_Nunu_Jng_Leblanc(Ratings):
pass
class NA_Nunu_Jng_LeeSin(Ratings):
pass
class NA_Nunu_Jng_Leona(Ratings):
pass
class NA_Nunu_Jng_Lissandra(Ratings):
pass
class NA_Nunu_Jng_Lucian(Ratings):
pass
class NA_Nunu_Jng_Lulu(Ratings):
pass
class NA_Nunu_Jng_Lux(Ratings):
pass
class NA_Nunu_Jng_Malphite(Ratings):
pass
class NA_Nunu_Jng_Malzahar(Ratings):
pass
class NA_Nunu_Jng_Maokai(Ratings):
pass
class NA_Nunu_Jng_MasterYi(Ratings):
pass
class NA_Nunu_Jng_MissFortune(Ratings):
pass
class NA_Nunu_Jng_MonkeyKing(Ratings):
pass
class NA_Nunu_Jng_Mordekaiser(Ratings):
pass
class NA_Nunu_Jng_Morgana(Ratings):
pass
class NA_Nunu_Jng_Nami(Ratings):
pass
class NA_Nunu_Jng_Nasus(Ratings):
pass
class NA_Nunu_Jng_Nautilus(Ratings):
pass
class NA_Nunu_Jng_Nidalee(Ratings):
pass
class NA_Nunu_Jng_Nocturne(Ratings):
pass
class NA_Nunu_Jng_Nunu(Ratings):
pass
class NA_Nunu_Jng_Olaf(Ratings):
pass
class NA_Nunu_Jng_Orianna(Ratings):
pass
class NA_Nunu_Jng_Ornn(Ratings):
pass
class NA_Nunu_Jng_Pantheon(Ratings):
pass
class NA_Nunu_Jng_Poppy(Ratings):
pass
class NA_Nunu_Jng_Quinn(Ratings):
pass
class NA_Nunu_Jng_Rakan(Ratings):
pass
class NA_Nunu_Jng_Rammus(Ratings):
pass
class NA_Nunu_Jng_RekSai(Ratings):
pass
class NA_Nunu_Jng_Renekton(Ratings):
pass
class NA_Nunu_Jng_Rengar(Ratings):
pass
class NA_Nunu_Jng_Riven(Ratings):
pass
class NA_Nunu_Jng_Rumble(Ratings):
pass
class NA_Nunu_Jng_Ryze(Ratings):
pass
class NA_Nunu_Jng_Sejuani(Ratings):
pass
class NA_Nunu_Jng_Shaco(Ratings):
pass
class NA_Nunu_Jng_Shen(Ratings):
pass
class NA_Nunu_Jng_Shyvana(Ratings):
pass
class NA_Nunu_Jng_Singed(Ratings):
pass
class NA_Nunu_Jng_Sion(Ratings):
pass
class NA_Nunu_Jng_Sivir(Ratings):
pass
class NA_Nunu_Jng_Skarner(Ratings):
pass
class NA_Nunu_Jng_Sona(Ratings):
pass
class NA_Nunu_Jng_Soraka(Ratings):
pass
class NA_Nunu_Jng_Swain(Ratings):
pass
class NA_Nunu_Jng_Syndra(Ratings):
pass
class NA_Nunu_Jng_TahmKench(Ratings):
pass
class NA_Nunu_Jng_Taliyah(Ratings):
pass
class NA_Nunu_Jng_Talon(Ratings):
pass
class NA_Nunu_Jng_Taric(Ratings):
pass
class NA_Nunu_Jng_Teemo(Ratings):
pass
class NA_Nunu_Jng_Thresh(Ratings):
pass
class NA_Nunu_Jng_Tristana(Ratings):
pass
class NA_Nunu_Jng_Trundle(Ratings):
pass
class NA_Nunu_Jng_Tryndamere(Ratings):
pass
class NA_Nunu_Jng_TwistedFate(Ratings):
pass
class NA_Nunu_Jng_Twitch(Ratings):
pass
class NA_Nunu_Jng_Udyr(Ratings):
pass
class NA_Nunu_Jng_Urgot(Ratings):
pass
class NA_Nunu_Jng_Varus(Ratings):
pass
class NA_Nunu_Jng_Vayne(Ratings):
pass
class NA_Nunu_Jng_Veigar(Ratings):
pass
class NA_Nunu_Jng_Velkoz(Ratings):
pass
class NA_Nunu_Jng_Vi(Ratings):
pass
class NA_Nunu_Jng_Viktor(Ratings):
pass
class NA_Nunu_Jng_Vladimir(Ratings):
pass
class NA_Nunu_Jng_Volibear(Ratings):
pass
class NA_Nunu_Jng_Warwick(Ratings):
pass
class NA_Nunu_Jng_Xayah(Ratings):
pass
class NA_Nunu_Jng_Xerath(Ratings):
pass
class NA_Nunu_Jng_XinZhao(Ratings):
pass
class NA_Nunu_Jng_Yasuo(Ratings):
pass
class NA_Nunu_Jng_Yorick(Ratings):
pass
class NA_Nunu_Jng_Zac(Ratings):
pass
class NA_Nunu_Jng_Zed(Ratings):
pass
class NA_Nunu_Jng_Ziggs(Ratings):
pass
class NA_Nunu_Jng_Zilean(Ratings):
pass
class NA_Nunu_Jng_Zyra(Ratings):
pass
| 15.033573 | 46 | 0.75642 | 972 | 6,269 | 4.452675 | 0.151235 | 0.223198 | 0.350739 | 0.446396 | 0.791359 | 0.791359 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177221 | 6,269 | 416 | 47 | 15.069712 | 0.839085 | 0 | 0 | 0.498195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.498195 | 0.00361 | 0 | 0.501805 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 7 |
d9f724861cd9371bc40adbb1b68395da714a3792 | 26,041 | py | Python | pybind/nos/v7_1_0/rbridge_id/snmp_server/v3host/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/rbridge_id/snmp_server/v3host/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/rbridge_id/snmp_server/v3host/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
class v3host(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-rbridge - based on the path /rbridge-id/snmp-server/v3host. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__hostip','__username','__udp_port','__notifytype','__engineid','__severity_level',)
_yang_name = 'v3host'
_rest_name = 'v3host'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__username = YANGDynClass(base=unicode, is_leaf=True, yang_name="username", rest_name="username", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Username associated with notification type.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)
self.__severity_level = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'Info': {}, u'None': {}, u'Warning': {}, u'Critical': {}, u'Error': {}, u'Debug': {}},), default=unicode("None"), is_leaf=True, yang_name="severity-level", rest_name="severity-level", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Severity level associated with traps'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='sev-level', is_config=True)
self.__udp_port = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(162), is_leaf=True, yang_name="udp-port", rest_name="udp-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port number used to send notifications.\n(Default=162)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='host-port', is_config=True)
self.__notifytype = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'informs': {'value': 1}, u'traps': {'value': 0}},), default=unicode("traps"), is_leaf=True, yang_name="notifytype", rest_name="notifytype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Type of notification sent to host.\n(Default=traps)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='enumeration', is_config=True)
self.__hostip = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..253']}),], is_leaf=True, yang_name="hostip", rest_name="hostip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ipv4/ipv6/dns address of the notification recipient\nassociated with username. Notifications\nwill be sent to this host'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='inet:host', is_config=True)
self.__engineid = YANGDynClass(base=unicode, default=unicode("00:00:00:00:00:00:00:00:00"), is_leaf=True, yang_name="engineid", rest_name="engineid", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u"Manager's (Remote) engine Id."}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'rbridge-id', u'snmp-server', u'v3host']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'rbridge-id', u'snmp-server', u'v3host']
def _get_hostip(self):
"""
Getter method for hostip, mapped from YANG variable /rbridge_id/snmp_server/v3host/hostip (inet:host)
"""
return self.__hostip
def _set_hostip(self, v, load=False):
"""
Setter method for hostip, mapped from YANG variable /rbridge_id/snmp_server/v3host/hostip (inet:host)
If this variable is read-only (config: false) in the
source YANG file, then _set_hostip is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_hostip() directly.
"""
parent = getattr(self, "_parent", None)
if parent is not None and load is False:
raise AttributeError("Cannot set keys directly when" +
" within an instantiated list")
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..253']}),], is_leaf=True, yang_name="hostip", rest_name="hostip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ipv4/ipv6/dns address of the notification recipient\nassociated with username. Notifications\nwill be sent to this host'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='inet:host', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """hostip must be of a type compatible with inet:host""",
'defined-type': "inet:host",
'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..253']}),], is_leaf=True, yang_name="hostip", rest_name="hostip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ipv4/ipv6/dns address of the notification recipient\nassociated with username. Notifications\nwill be sent to this host'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='inet:host', is_config=True)""",
})
self.__hostip = t
if hasattr(self, '_set'):
self._set()
def _unset_hostip(self):
self.__hostip = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..253']}),], is_leaf=True, yang_name="hostip", rest_name="hostip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'ipv4/ipv6/dns address of the notification recipient\nassociated with username. Notifications\nwill be sent to this host'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='inet:host', is_config=True)
def _get_username(self):
"""
Getter method for username, mapped from YANG variable /rbridge_id/snmp_server/v3host/username (string)
"""
return self.__username
def _set_username(self, v, load=False):
"""
Setter method for username, mapped from YANG variable /rbridge_id/snmp_server/v3host/username (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_username is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_username() directly.
"""
parent = getattr(self, "_parent", None)
if parent is not None and load is False:
raise AttributeError("Cannot set keys directly when" +
" within an instantiated list")
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="username", rest_name="username", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Username associated with notification type.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """username must be of a type compatible with string""",
'defined-type': "string",
'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="username", rest_name="username", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Username associated with notification type.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)""",
})
self.__username = t
if hasattr(self, '_set'):
self._set()
def _unset_username(self):
self.__username = YANGDynClass(base=unicode, is_leaf=True, yang_name="username", rest_name="username", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Username associated with notification type.'}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)
def _get_udp_port(self):
"""
Getter method for udp_port, mapped from YANG variable /rbridge_id/snmp_server/v3host/udp_port (host-port)
"""
return self.__udp_port
def _set_udp_port(self, v, load=False):
"""
Setter method for udp_port, mapped from YANG variable /rbridge_id/snmp_server/v3host/udp_port (host-port)
If this variable is read-only (config: false) in the
source YANG file, then _set_udp_port is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_udp_port() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(162), is_leaf=True, yang_name="udp-port", rest_name="udp-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port number used to send notifications.\n(Default=162)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='host-port', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """udp_port must be of a type compatible with host-port""",
'defined-type': "brocade-snmp:host-port",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(162), is_leaf=True, yang_name="udp-port", rest_name="udp-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port number used to send notifications.\n(Default=162)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='host-port', is_config=True)""",
})
self.__udp_port = t
if hasattr(self, '_set'):
self._set()
def _unset_udp_port(self):
self.__udp_port = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(162), is_leaf=True, yang_name="udp-port", rest_name="udp-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port number used to send notifications.\n(Default=162)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='host-port', is_config=True)
def _get_notifytype(self):
"""
Getter method for notifytype, mapped from YANG variable /rbridge_id/snmp_server/v3host/notifytype (enumeration)
"""
return self.__notifytype
def _set_notifytype(self, v, load=False):
"""
Setter method for notifytype, mapped from YANG variable /rbridge_id/snmp_server/v3host/notifytype (enumeration)
If this variable is read-only (config: false) in the
source YANG file, then _set_notifytype is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_notifytype() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'informs': {'value': 1}, u'traps': {'value': 0}},), default=unicode("traps"), is_leaf=True, yang_name="notifytype", rest_name="notifytype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Type of notification sent to host.\n(Default=traps)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='enumeration', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """notifytype must be of a type compatible with enumeration""",
'defined-type': "brocade-snmp:enumeration",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'informs': {'value': 1}, u'traps': {'value': 0}},), default=unicode("traps"), is_leaf=True, yang_name="notifytype", rest_name="notifytype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Type of notification sent to host.\n(Default=traps)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='enumeration', is_config=True)""",
})
self.__notifytype = t
if hasattr(self, '_set'):
self._set()
def _unset_notifytype(self):
self.__notifytype = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'informs': {'value': 1}, u'traps': {'value': 0}},), default=unicode("traps"), is_leaf=True, yang_name="notifytype", rest_name="notifytype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Type of notification sent to host.\n(Default=traps)'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='enumeration', is_config=True)
def _get_engineid(self):
"""
Getter method for engineid, mapped from YANG variable /rbridge_id/snmp_server/v3host/engineid (string)
"""
return self.__engineid
def _set_engineid(self, v, load=False):
"""
Setter method for engineid, mapped from YANG variable /rbridge_id/snmp_server/v3host/engineid (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_engineid is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_engineid() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=unicode, default=unicode("00:00:00:00:00:00:00:00:00"), is_leaf=True, yang_name="engineid", rest_name="engineid", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u"Manager's (Remote) engine Id."}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """engineid must be of a type compatible with string""",
'defined-type': "string",
'generated-type': """YANGDynClass(base=unicode, default=unicode("00:00:00:00:00:00:00:00:00"), is_leaf=True, yang_name="engineid", rest_name="engineid", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u"Manager's (Remote) engine Id."}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)""",
})
self.__engineid = t
if hasattr(self, '_set'):
self._set()
def _unset_engineid(self):
self.__engineid = YANGDynClass(base=unicode, default=unicode("00:00:00:00:00:00:00:00:00"), is_leaf=True, yang_name="engineid", rest_name="engineid", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u"Manager's (Remote) engine Id."}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='string', is_config=True)
def _get_severity_level(self):
"""
Getter method for severity_level, mapped from YANG variable /rbridge_id/snmp_server/v3host/severity_level (sev-level)
"""
return self.__severity_level
def _set_severity_level(self, v, load=False):
"""
Setter method for severity_level, mapped from YANG variable /rbridge_id/snmp_server/v3host/severity_level (sev-level)
If this variable is read-only (config: false) in the
source YANG file, then _set_severity_level is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_severity_level() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'Info': {}, u'None': {}, u'Warning': {}, u'Critical': {}, u'Error': {}, u'Debug': {}},), default=unicode("None"), is_leaf=True, yang_name="severity-level", rest_name="severity-level", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Severity level associated with traps'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='sev-level', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """severity_level must be of a type compatible with sev-level""",
'defined-type': "brocade-snmp:sev-level",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'Info': {}, u'None': {}, u'Warning': {}, u'Critical': {}, u'Error': {}, u'Debug': {}},), default=unicode("None"), is_leaf=True, yang_name="severity-level", rest_name="severity-level", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Severity level associated with traps'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='sev-level', is_config=True)""",
})
self.__severity_level = t
if hasattr(self, '_set'):
self._set()
def _unset_severity_level(self):
self.__severity_level = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'Info': {}, u'None': {}, u'Warning': {}, u'Critical': {}, u'Error': {}, u'Debug': {}},), default=unicode("None"), is_leaf=True, yang_name="severity-level", rest_name="severity-level", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Severity level associated with traps'}}, namespace='urn:brocade.com:mgmt:brocade-snmp', defining_module='brocade-snmp', yang_type='sev-level', is_config=True)
hostip = __builtin__.property(_get_hostip, _set_hostip)
username = __builtin__.property(_get_username, _set_username)
udp_port = __builtin__.property(_get_udp_port, _set_udp_port)
notifytype = __builtin__.property(_get_notifytype, _set_notifytype)
engineid = __builtin__.property(_get_engineid, _set_engineid)
severity_level = __builtin__.property(_get_severity_level, _set_severity_level)
_pyangbind_elements = {'hostip': hostip, 'username': username, 'udp_port': udp_port, 'notifytype': notifytype, 'engineid': engineid, 'severity_level': severity_level, }
| 84.548701 | 1,186 | 0.686686 | 3,722 | 26,041 | 4.608812 | 0.063407 | 0.007462 | 0.042439 | 0.019587 | 0.850006 | 0.831759 | 0.824298 | 0.810248 | 0.810248 | 0.798298 | 0 | 0.031745 | 0.138704 | 26,041 | 307 | 1,187 | 84.824104 | 0.733069 | 0.111862 | 0 | 0.469388 | 0 | 0.091837 | 0.421488 | 0.214051 | 0 | 0 | 0 | 0 | 0 | 1 | 0.107143 | false | 0 | 0.040816 | 0 | 0.265306 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
8a322ce5f2a80fa8482ffcc73161095bdf967ab5 | 118 | py | Python | scribbler/transformation/__init__.py | belosthomas/scribbler | fbd0bfb68cd30ca451b5d616d372b5e96ec0f8be | [
"MIT"
] | 5 | 2018-07-31T20:26:22.000Z | 2019-05-07T16:36:23.000Z | scribbler/transformation/__init__.py | belosthomas/scribbler | fbd0bfb68cd30ca451b5d616d372b5e96ec0f8be | [
"MIT"
] | 1 | 2019-05-07T18:21:59.000Z | 2020-09-18T10:45:39.000Z | scribbler/transformation/__init__.py | belosthomas/scribbler | fbd0bfb68cd30ca451b5d616d372b5e96ec0f8be | [
"MIT"
] | null | null | null | from .abstract_transformation import AbstractTransformation
from .phantom_transformation import PhantomTransformation
| 39.333333 | 59 | 0.915254 | 10 | 118 | 10.6 | 0.7 | 0.377358 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067797 | 118 | 2 | 60 | 59 | 0.963636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
8a3641b5c223190adf3510e40531f5e0ec9fbf73 | 75 | py | Python | app/views/api/__init__.py | jameydeorio/DjanGoat | 9cdd48474f5fcf577f4d08aa12f65b1a14e4b1b8 | [
"MIT"
] | 1 | 2021-06-04T16:07:45.000Z | 2021-06-04T16:07:45.000Z | app/views/api/__init__.py | miguelfreitas93/DjangoGoat | e72c20065a2b30869f40cb6f16e809ef08fb3615 | [
"MIT"
] | 9 | 2018-11-18T09:48:30.000Z | 2021-08-25T12:54:41.000Z | app/views/api/__init__.py | r0flc0pt4/DjanGoat | 7413d8b01aff4046e9bfe4ea91bd193f540fff0b | [
"MIT"
] | 1 | 2019-04-27T04:38:09.000Z | 2019-04-27T04:38:09.000Z | from app.views.api.mobile import urls
from app.views.api.users import urls
| 25 | 37 | 0.813333 | 14 | 75 | 4.357143 | 0.571429 | 0.229508 | 0.393443 | 0.491803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106667 | 75 | 2 | 38 | 37.5 | 0.910448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.