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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3b13af67a67a4ab53cfd1b3bd595f24e36c5d718
| 82
|
py
|
Python
|
scripts/field/autogen_enter_TownGameMap.py
|
hsienjan/SideQuest-Server
|
3e88debaf45615b759d999255908f99a15283695
|
[
"MIT"
] | null | null | null |
scripts/field/autogen_enter_TownGameMap.py
|
hsienjan/SideQuest-Server
|
3e88debaf45615b759d999255908f99a15283695
|
[
"MIT"
] | null | null | null |
scripts/field/autogen_enter_TownGameMap.py
|
hsienjan/SideQuest-Server
|
3e88debaf45615b759d999255908f99a15283695
|
[
"MIT"
] | null | null | null |
# Character field ID when accessed: 911000820
# ObjectID: 0
# ParentID: 911000820
| 20.5
| 45
| 0.768293
| 10
| 82
| 6.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.275362
| 0.158537
| 82
| 3
| 46
| 27.333333
| 0.637681
| 0.914634
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
8e783dee7802b2d1ae54325d62d58706a08970fa
| 125
|
py
|
Python
|
event/admin.py
|
archit-dwevedi/events-management
|
036910a08ad8bfa6fe3c2b809c215b71b9723815
|
[
"MIT"
] | 1
|
2020-01-22T12:15:20.000Z
|
2020-01-22T12:15:20.000Z
|
event/admin.py
|
arch888/MiStay_REST
|
036910a08ad8bfa6fe3c2b809c215b71b9723815
|
[
"MIT"
] | 3
|
2021-03-18T22:41:08.000Z
|
2021-09-22T18:24:11.000Z
|
event/admin.py
|
arch888/MiStay_REST
|
036910a08ad8bfa6fe3c2b809c215b71b9723815
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import EventPost
admin.site.register(EventPost)
| 17.857143
| 32
| 0.808
| 17
| 125
| 5.941176
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128
| 125
| 7
| 33
| 17.857143
| 0.926606
| 0.208
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 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
| 5
|
8e835de461276f9469d5eb09bc9889e8862fd5c5
| 96
|
py
|
Python
|
tests/strategies/__init__.py
|
lycantropos/robust
|
a4d2df6a2b2ef8079716a608477bee5bd21a867c
|
[
"MIT"
] | 1
|
2022-03-10T11:59:59.000Z
|
2022-03-10T11:59:59.000Z
|
tests/strategies/__init__.py
|
lycantropos/robust
|
a4d2df6a2b2ef8079716a608477bee5bd21a867c
|
[
"MIT"
] | 12
|
2019-12-30T01:06:39.000Z
|
2020-07-28T03:55:06.000Z
|
tests/strategies/__init__.py
|
lycantropos/robust
|
a4d2df6a2b2ef8079716a608477bee5bd21a867c
|
[
"MIT"
] | null | null | null |
from .literals import (numbers_strategies,
numbers_strategies_factories)
| 32
| 52
| 0.666667
| 8
| 96
| 7.625
| 0.75
| 0.557377
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.291667
| 96
| 2
| 53
| 48
| 0.897059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
8eb927e2f391a48159a06c966e0c4ad5b5fda17c
| 286
|
py
|
Python
|
pysb/examples/paper_figures/fig5c.py
|
FFroehlich/pysb
|
8595a4d878181b9bbf11124e008eab7cd78cf7ae
|
[
"BSD-2-Clause"
] | 105
|
2015-01-07T01:52:45.000Z
|
2022-02-25T12:05:55.000Z
|
pysb/examples/paper_figures/fig5c.py
|
zhwycsz/pysb
|
d1afd8bed83cc09476ea871ffcc106b18498dc7f
|
[
"BSD-2-Clause"
] | 440
|
2015-01-06T22:10:22.000Z
|
2022-02-01T20:10:28.000Z
|
pysb/examples/paper_figures/fig5c.py
|
zhwycsz/pysb
|
d1afd8bed83cc09476ea871ffcc106b18498dc7f
|
[
"BSD-2-Clause"
] | 48
|
2015-02-17T20:55:32.000Z
|
2022-02-10T21:30:23.000Z
|
"""Reaction graph for Figure 5C from the PySB publication"""
from __future__ import print_function
import pysb.tools.render_reactions
from earm.mito.lopez_embedded import model
# print out the graphviz representation of the contact map
print(pysb.tools.render_reactions.run(model))
| 26
| 60
| 0.818182
| 42
| 286
| 5.380952
| 0.666667
| 0.079646
| 0.132743
| 0.212389
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003968
| 0.118881
| 286
| 10
| 61
| 28.6
| 0.892857
| 0.391608
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0.5
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
d90d8b285259a384721a58a72e0764211db9d3a9
| 170
|
py
|
Python
|
wagtail_webstories/admin_urls.py
|
sebastianbenz/wagtail-webstories
|
388bdbc65c1f9b8fae07533ec60bc9fc3477352c
|
[
"BSD-3-Clause"
] | 9
|
2020-12-10T13:05:00.000Z
|
2021-10-10T07:42:34.000Z
|
wagtail_webstories/admin_urls.py
|
sebastianbenz/wagtail-webstories
|
388bdbc65c1f9b8fae07533ec60bc9fc3477352c
|
[
"BSD-3-Clause"
] | 9
|
2021-03-10T14:51:47.000Z
|
2022-03-30T23:50:05.000Z
|
wagtail_webstories/admin_urls.py
|
sebastianbenz/wagtail-webstories
|
388bdbc65c1f9b8fae07533ec60bc9fc3477352c
|
[
"BSD-3-Clause"
] | 4
|
2021-02-18T11:07:08.000Z
|
2021-12-01T11:02:31.000Z
|
from django.urls import path
from .views import import_story
app_name = 'wagtail_webstories'
urlpatterns = [
path('import/', import_story, name='import_story'),
]
| 17
| 55
| 0.741176
| 22
| 170
| 5.5
| 0.545455
| 0.272727
| 0.280992
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 170
| 9
| 56
| 18.888889
| 0.834483
| 0
| 0
| 0
| 0
| 0
| 0.217647
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d914472c20f4644115f9fbfce3dd3e93d7149e85
| 7,930
|
py
|
Python
|
admitad/tests/test_base.py
|
fonar/admitad-python-api
|
584b1032edb8c6c3b785d07f58a6480fcc0a698d
|
[
"MIT"
] | 28
|
2016-10-18T15:02:46.000Z
|
2021-11-11T20:47:44.000Z
|
admitad/tests/test_base.py
|
fonar/admitad-python-api
|
584b1032edb8c6c3b785d07f58a6480fcc0a698d
|
[
"MIT"
] | 1
|
2017-10-26T15:34:38.000Z
|
2017-10-26T15:34:38.000Z
|
admitad/tests/test_base.py
|
fonar/admitad-python-api
|
584b1032edb8c6c3b785d07f58a6480fcc0a698d
|
[
"MIT"
] | 20
|
2016-07-01T20:08:22.000Z
|
2022-02-15T09:28:10.000Z
|
# coding: utf-8
from __future__ import unicode_literals
import unittest
from datetime import datetime, date
from admitad.items.base import Item
from admitad.tests.base import BaseTestCase
from admitad.constants import BASE_URL
class ItemTestCase(BaseTestCase):
def test_sanitize_id(self):
self.assertEqual(Item.sanitize_id(2, ''), 2)
self.assertEqual(Item.sanitize_id(2**64, ''), 2**64)
self.assertEqual(Item.sanitize_id('64', ''), '64')
with self.assertRaises(ValueError):
Item.sanitize_id(0, '')
Item.sanitize_id(None, '')
Item.sanitize_id(3.14, '')
Item.sanitize_id('foo', '')
def test_sanitize_fields(self):
fields = {
'field1': lambda x: Item.sanitize_non_blank_value(x, ''),
'field2': lambda x: Item.sanitize_integer_value(x, ''),
'field3': lambda x: Item.sanitize_string_value(x, '', blank=True),
}
data = Item.sanitize_fields(fields, field1='foobarbaz', field2=42, field3='')
self.assertDictEqual(data, {
'field1': 'foobarbaz',
'field2': 42,
'field3': ''
})
data = Item.sanitize_fields(fields, field1='foobarbaz', field2=42, field3='', field4='another')
self.assertDictEqual(data, {
'field1': 'foobarbaz',
'field2': 42,
'field3': ''
})
def test_sanitize_non_blank_value(self):
self.assertEqual(Item.sanitize_non_blank_value(0, ''), 0)
self.assertEqual(Item.sanitize_non_blank_value('a', ''), 'a')
self.assertListEqual(Item.sanitize_non_blank_value([1], ''), [1])
self.assertDictEqual(Item.sanitize_non_blank_value({'a': 1}, ''), {'a': 1})
self.assertTupleEqual(Item.sanitize_non_blank_value((1, 2), ''), (1, 2))
with self.assertRaises(ValueError):
Item.sanitize_non_blank_value('', '')
Item.sanitize_non_blank_value([], '')
Item.sanitize_non_blank_value({}, '')
Item.sanitize_non_blank_value((), '')
Item.sanitize_non_blank_value(None, '')
def test_sanitize_string_value(self):
self.assertEqual(Item.sanitize_string_value('foo', '', 10, None, False), 'foo')
self.assertEqual(Item.sanitize_string_value('foo', '', None, 2, False), 'foo')
self.assertEqual(Item.sanitize_string_value('foobarbaz', '', 10, 5, False), 'foobarbaz')
self.assertEqual(Item.sanitize_string_value('', '', None, None, True), '')
with self.assertRaises(ValueError):
Item.sanitize_string_value('', '', None, None, False)
Item.sanitize_string_value('foo', '', 2, None, False)
Item.sanitize_string_value('foo', '', None, 5, False)
Item.sanitize_string_value('foobarbaz', '', 5, 6, False)
def test_sanitize_integer_value(self):
self.assertEqual(Item.sanitize_integer_value(2, '', False), 2)
self.assertEqual(Item.sanitize_integer_value(0, '', False), 0)
self.assertEqual(Item.sanitize_integer_value(None, '', True), None)
self.assertEqual(Item.sanitize_integer_value(2**64, '', False), 2**64)
self.assertEqual(Item.sanitize_integer_value('64', '', False), '64')
with self.assertRaises(ValueError):
Item.sanitize_integer_value(None, '', False)
Item.sanitize_integer_value(3.14, '', False)
Item.sanitize_integer_value('foo', '', False)
def test_sanitize_float_value(self):
self.assertEqual(Item.sanitize_float_value(1, '', False), 1)
self.assertEqual(Item.sanitize_float_value(0, '', False), 0)
self.assertEqual(Item.sanitize_float_value('12', '', False), '12')
self.assertEqual(Item.sanitize_float_value('3.14', '', False), '3.14')
self.assertEqual(Item.sanitize_float_value(3.14, '', False), 3.14)
self.assertEqual(Item.sanitize_float_value(None, '', True), None)
with self.assertRaises(ValueError):
Item.sanitize_float_value(None, '', False)
Item.sanitize_float_value('foo', '', False)
def test_sanitize_integer_array(self):
self.assertEqual(Item.sanitize_integer_array(None, '', True), None)
self.assertEqual(Item.sanitize_integer_array([], '', True), [])
self.assertListEqual(Item.sanitize_integer_array([0, 1, '12'], '', False), [0, 1, '12'])
self.assertListEqual(Item.sanitize_integer_array([5, None, '1', None], '', True), [5, None, '1', None])
self.assertListEqual(Item.sanitize_integer_array(5, ''), [5])
with self.assertRaises(ValueError):
Item.sanitize_integer_array(None, '', False)
Item.sanitize_integer_array([], '', False)
Item.sanitize_integer_array([1, 2, 3, None, 5], '', False)
def test_sanitize_string_array(self):
self.assertEqual(Item.sanitize_string_array(None, '', None, None, True), None)
self.assertListEqual(Item.sanitize_string_array([], '', None, None, True), [])
self.assertListEqual(Item.sanitize_string_array('foo', ''), ['foo'])
self.assertListEqual(Item.sanitize_string_array([''], '', None, None, True), [''])
self.assertListEqual(Item.sanitize_string_array(['foo', 'bar'], '', 10, 2, False), ['foo', 'bar'])
self.assertListEqual(Item.sanitize_string_array(['foo', 'bar'], '', None, None, False), ['foo', 'bar'])
with self.assertRaises(ValueError):
Item.sanitize_string_array(None, '', False)
Item.sanitize_string_array([], '', False)
Item.sanitize_string_array([''], '', False)
Item.sanitize_string_array(['foobarbaz'], '', 5, 3, False)
Item.sanitize_string_array(['foobarbaz'], '', 5, None, False)
Item.sanitize_string_array(['foo'], '', None, 5, False)
def test_sanitize_currency(self):
self.assertEqual(Item.sanitize_currency_value(None, True), None)
self.assertEqual(Item.sanitize_currency_value('', True), '')
self.assertEqual(Item.sanitize_currency_value('usd', False), 'USD')
self.assertEqual(Item.sanitize_currency_value('EUR', False), 'EUR')
with self.assertRaises(ValueError):
Item.sanitize_currency_value(None, False)
Item.sanitize_currency_value('', False)
Item.sanitize_currency_value('foobarbaz', True)
Item.sanitize_currency_value('12', True)
def test_sanitize_date(self):
self.assertEqual(Item.sanitize_date(None, '', True), None)
self.assertEqual(Item.sanitize_date(datetime(2020, 1, 1), '', False), '01.01.2020')
self.assertEqual(Item.sanitize_date(date(2020, 1, 1), '', False), '01.01.2020')
self.assertEqual(Item.sanitize_date('01.01.2020', '', False), '01.01.2020')
with self.assertRaises(ValueError):
Item.sanitize_date(None, '', False)
Item.sanitize_date('01/01/2020', '', True)
def test_sanitize_long_date(self):
self.assertEqual(Item.sanitize_long_date(None, '', True), None)
self.assertEqual(Item.sanitize_long_date(datetime(2020, 1, 1, 11, 20, 36), '', False), '01.01.2020 11:20:36')
self.assertEqual(Item.sanitize_long_date('01.01.2020 11:20:36', '', False), '01.01.2020 11:20:36')
with self.assertRaises(ValueError):
Item.sanitize_long_date(None, '', False)
Item.sanitize_long_date('01/01/2020', '', True)
Item.sanitize_long_date('01.01.2020 11/22/22', '', False)
def test_prepare_url(self):
self.assertEqual(Item.prepare_url('somepath'), '%ssomepath/' % BASE_URL)
self.assertEqual(Item.prepare_url('somepath/'), '%ssomepath/' % BASE_URL)
self.assertEqual(Item.prepare_url('/somepath'), '%ssomepath/' % BASE_URL)
self.assertEqual(Item.prepare_url('/somepath/'), '%ssomepath/' % BASE_URL)
if __name__ == '__main__':
unittest.main()
| 47.48503
| 117
| 0.632661
| 939
| 7,930
| 5.106496
| 0.088392
| 0.215224
| 0.150574
| 0.191449
| 0.81147
| 0.719082
| 0.47341
| 0.339103
| 0.211887
| 0.211887
| 0
| 0.040171
| 0.205801
| 7,930
| 166
| 118
| 47.771084
| 0.721181
| 0.001639
| 0
| 0.150376
| 0
| 0
| 0.060518
| 0
| 0
| 0
| 0
| 0
| 0.458647
| 1
| 0.090226
| false
| 0
| 0.045113
| 0
| 0.142857
| 0
| 0
| 0
| 0
| null | 1
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
795c4f2aaa6dd09b023ba14a1aaf12c6886ff3d7
| 191
|
py
|
Python
|
images/__init__.py
|
otrenav/dkt-street-analysis
|
e112d2f5c1092a7c39a71d137c35ba61745af41c
|
[
"Apache-2.0"
] | null | null | null |
images/__init__.py
|
otrenav/dkt-street-analysis
|
e112d2f5c1092a7c39a71d137c35ba61745af41c
|
[
"Apache-2.0"
] | null | null | null |
images/__init__.py
|
otrenav/dkt-street-analysis
|
e112d2f5c1092a7c39a71d137c35ba61745af41c
|
[
"Apache-2.0"
] | null | null | null |
from shared import print_
def image_profiles(**kwargs):
print_("IMAGE PROFILES", title=True)
print_(kwargs)
raise NotImplementedError("image_profiles() is not yet implemented")
| 23.875
| 72
| 0.743455
| 23
| 191
| 5.956522
| 0.695652
| 0.284672
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157068
| 191
| 7
| 73
| 27.285714
| 0.850932
| 0
| 0
| 0
| 0
| 0
| 0.277487
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.2
| 0
| 0.4
| 0.6
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
799b84197e3366c533a2e73174eb7e6a1e8ad618
| 1,920
|
py
|
Python
|
qsr_lib/tests/abstractclass_unittest_triadic.py
|
gatsoulis/strands_qsr_lib
|
5768461c01a2184a039e8633b800389dae84e6fb
|
[
"MIT"
] | 15
|
2015-06-15T16:50:37.000Z
|
2022-03-27T09:25:56.000Z
|
qsr_lib/tests/abstractclass_unittest_triadic.py
|
gatsoulis/strands_qsr_lib
|
5768461c01a2184a039e8633b800389dae84e6fb
|
[
"MIT"
] | 205
|
2015-01-22T12:02:59.000Z
|
2022-03-29T11:59:55.000Z
|
qsr_lib/tests/abstractclass_unittest_triadic.py
|
gatsoulis/strands_qsr_lib
|
5768461c01a2184a039e8633b800389dae84e6fb
|
[
"MIT"
] | 16
|
2015-02-04T23:13:18.000Z
|
2022-03-08T13:45:53.000Z
|
#!/usr/bin/env python
from __future__ import print_function, division
from abc import ABCMeta
from abstractclass_unittest import AbstractClass_UnitTest
from qsrlib.qsrlib import QSRlib_Request_Message
from unittests_utils import *
class Abstractclass_Unittest_Triadic(AbstractClass_UnitTest):
__metaclass__ = ABCMeta
def __init__(self, *args):
super(Abstractclass_Unittest_Triadic, self).__init__(*args)
def qsrs_for_global_namespace(self, world_name, gt_filename):
expected = unittest_read_qsrs_as_one_long_list(find_resource(PKG, gt_filename)[0])
req_msg = QSRlib_Request_Message(self._unique_id, self._worlds[world_name],
{"for_all_qsrs": {"qsrs_for": [("o3", "o2", "o1")]}})
actual = unittest_get_qsrs_as_one_long_list(self._qsrlib.request_qsrs(req_msg).qsrs)
return expected, actual
def qsrs_for_qsr_namespace(self, world_name, gt_filename):
expected = unittest_read_qsrs_as_one_long_list(find_resource(PKG, gt_filename)[0])
req_msg = QSRlib_Request_Message(self._unique_id, self._worlds[world_name],
{self._unique_id: {"qsrs_for": [("o1", "o2", "o3")]}})
actual = unittest_get_qsrs_as_one_long_list(self._qsrlib.request_qsrs(req_msg).qsrs)
return expected, actual
def qsrs_for_qsr_namespace_over_global_namespace(self, world_name, gt_filename):
expected = unittest_read_qsrs_as_one_long_list(find_resource(PKG, gt_filename)[0])
req_msg = QSRlib_Request_Message(self._unique_id, self._worlds[world_name],
{"for_all_qsrs": {"qsrs_for": [("o3", "o2", "o1")]},
self._unique_id: {"qsrs_for": [("o1", "o2", "o3")]}})
actual = unittest_get_qsrs_as_one_long_list(self._qsrlib.request_qsrs(req_msg).qsrs)
return actual, expected
| 54.857143
| 95
| 0.685938
| 247
| 1,920
| 4.809717
| 0.238866
| 0.076599
| 0.045455
| 0.065657
| 0.707071
| 0.707071
| 0.707071
| 0.707071
| 0.707071
| 0.707071
| 0
| 0.009875
| 0.208854
| 1,920
| 34
| 96
| 56.470588
| 0.772219
| 0.010417
| 0
| 0.392857
| 0
| 0
| 0.042127
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.178571
| 0
| 0.5
| 0.035714
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
8db24cedec0f2bbc594553a9ef0181d5fcae545f
| 216
|
py
|
Python
|
helper/baselines/RandomAgent.py
|
seungjaeryanlee/osim-rl-helper
|
5a4340321e765089afd3062093c797c04bfdbeec
|
[
"MIT"
] | 41
|
2018-06-27T15:42:26.000Z
|
2020-03-20T21:50:05.000Z
|
helper/baselines/RandomAgent.py
|
decoderkurt/osim-rl-helper
|
511c7478853305b7c74260c793fead194574b9e6
|
[
"MIT"
] | 5
|
2018-08-23T08:07:23.000Z
|
2022-01-02T10:44:52.000Z
|
helper/baselines/RandomAgent.py
|
seungjaeryanlee/osim-rl-helper
|
5a4340321e765089afd3062093c797c04bfdbeec
|
[
"MIT"
] | 8
|
2018-07-29T03:18:02.000Z
|
2018-11-06T16:54:20.000Z
|
from ..templates import Agent
class RandomAgent(Agent):
"""
An agent that chooses random action at every timestep.
"""
def act(self, observation):
return self.action_space.sample().tolist()
| 21.6
| 58
| 0.671296
| 26
| 216
| 5.538462
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 216
| 9
| 59
| 24
| 0.857143
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
8dcc88b7b119ba55c7ce43d701f75c80605dcc0e
| 311
|
py
|
Python
|
python3/pyCity/Services/Exceptions/exceptions_hospital.py
|
satcom886/python_stuff
|
933c900af78769cdf5f174e31b0eea282d9a4606
|
[
"MIT"
] | 1
|
2019-06-06T17:08:18.000Z
|
2019-06-06T17:08:18.000Z
|
python3/pyCity/Services/Exceptions/exceptions_hospital.py
|
satcom886/rugl
|
933c900af78769cdf5f174e31b0eea282d9a4606
|
[
"MIT"
] | 28
|
2019-08-17T13:39:55.000Z
|
2020-08-04T11:48:57.000Z
|
python3/pyCity/Services/Exceptions/exceptions_hospital.py
|
satcom886/rugl
|
933c900af78769cdf5f174e31b0eea282d9a4606
|
[
"MIT"
] | 1
|
2019-06-06T17:03:58.000Z
|
2019-06-06T17:03:58.000Z
|
def CantOpenHospital(Exception):
pass
def CantCloseHospital(Exception):
pass
def CantOpenPharmacy(Exception):
pass
def CantClosePharmacy(Exception):
pass
def DoesntHavePharmacy(Exception):
pass
def InvalidNumberOfEmployees(Exception):
pass
def TooMuchEmployees(Exception):
pass
| 15.55
| 40
| 0.758842
| 28
| 311
| 8.428571
| 0.357143
| 0.385593
| 0.40678
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173633
| 311
| 20
| 41
| 15.55
| 0.918288
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
8dffcb9d1a32b7e45e61c0ac9a165064163ba509
| 172
|
py
|
Python
|
canvas_grab/course_filter/base_filter.py
|
pangbo13/canvas_grab
|
4e73cb9b514059c4fc3c6de167ad581ddb0d7fb9
|
[
"MIT"
] | null | null | null |
canvas_grab/course_filter/base_filter.py
|
pangbo13/canvas_grab
|
4e73cb9b514059c4fc3c6de167ad581ddb0d7fb9
|
[
"MIT"
] | null | null | null |
canvas_grab/course_filter/base_filter.py
|
pangbo13/canvas_grab
|
4e73cb9b514059c4fc3c6de167ad581ddb0d7fb9
|
[
"MIT"
] | null | null | null |
from ..configurable import Configurable
class BaseFilter(Configurable):
def filter_course(self, courses):
pass
def interact(self, courses):
pass
| 17.2
| 39
| 0.686047
| 18
| 172
| 6.5
| 0.666667
| 0.188034
| 0.25641
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238372
| 172
| 9
| 40
| 19.111111
| 0.89313
| 0
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.333333
| 0.166667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
5c075874fda9ea7360edc5a1cff9b311b7c58346
| 214
|
py
|
Python
|
src/pyrin/database/migration/alembic/template/__init__.py
|
wilsonGmn/pyrin
|
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
|
[
"BSD-3-Clause"
] | null | null | null |
src/pyrin/database/migration/alembic/template/__init__.py
|
wilsonGmn/pyrin
|
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
|
[
"BSD-3-Clause"
] | null | null | null |
src/pyrin/database/migration/alembic/template/__init__.py
|
wilsonGmn/pyrin
|
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
alembic template package.
"""
from pyrin.packaging.base import Package
class AlembicTemplatePackage(Package):
"""
alembic template package class.
"""
NAME = __name__
| 14.266667
| 40
| 0.654206
| 21
| 214
| 6.47619
| 0.666667
| 0.220588
| 0.323529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005917
| 0.21028
| 214
| 14
| 41
| 15.285714
| 0.798817
| 0.373832
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
5c0d10551812a8b32a405587631e808d97502c4c
| 675
|
py
|
Python
|
server/featherlight/resolvers/mutation/__init__.py
|
FeatherLightApp/FeatherLight-API
|
1543cc4532f9a8ec1bae51374d4e5d88546c8d15
|
[
"MIT"
] | 3
|
2020-06-28T17:30:57.000Z
|
2022-01-25T18:03:38.000Z
|
server/featherlight/resolvers/mutation/__init__.py
|
FeatherLightApp/FeatherLight-API
|
1543cc4532f9a8ec1bae51374d4e5d88546c8d15
|
[
"MIT"
] | null | null | null |
server/featherlight/resolvers/mutation/__init__.py
|
FeatherLightApp/FeatherLight-API
|
1543cc4532f9a8ec1bae51374d4e5d88546c8d15
|
[
"MIT"
] | 1
|
2021-02-04T07:14:08.000Z
|
2021-02-04T07:14:08.000Z
|
from typing import List
from ariadne import MutationType
from .create_user import MUTATION as _create_user
from .bypass import MUTATION as _bypass
from .login import MUTATION as _login
from .logout import MUTATION as _logout
from .add_invoice import MUTATION as _add_invoice
from .pay_invoice import MUTATION as _pay_invoice
from .bake_macaroon import MUTATION as _bake_macaroon
from .prepay_wallet import MUTATION as _prepay_wallet
from .redeem_wallet import MUTATION as _redeem_wallet
MUTATION: List[MutationType] = [
_create_user,
_bypass,
_login,
_logout,
_add_invoice,
_pay_invoice,
_bake_macaroon,
_prepay_wallet,
_redeem_wallet,
]
| 28.125
| 53
| 0.797037
| 92
| 675
| 5.456522
| 0.228261
| 0.250996
| 0.286853
| 0.091633
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.167407
| 675
| 23
| 54
| 29.347826
| 0.893238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.090909
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
5c130a7f985ce93093e7338bc1d9a65b4329c883
| 218
|
py
|
Python
|
basic/theory/if_statement/if_basic.py
|
Shvana/Python_review
|
eabb3d22a0416a93357d90f3100807cfae16bce2
|
[
"MIT"
] | null | null | null |
basic/theory/if_statement/if_basic.py
|
Shvana/Python_review
|
eabb3d22a0416a93357d90f3100807cfae16bce2
|
[
"MIT"
] | null | null | null |
basic/theory/if_statement/if_basic.py
|
Shvana/Python_review
|
eabb3d22a0416a93357d90f3100807cfae16bce2
|
[
"MIT"
] | null | null | null |
age = int(input('Enter age: '))
if age < 13:
print('You are a preteen.')
elif age < 20:
print('You are a teenager')
elif age <= 30:
print('You are still young.')
else:
print('You are one of the oldies')
| 24.222222
| 38
| 0.610092
| 37
| 218
| 3.594595
| 0.594595
| 0.240602
| 0.330827
| 0.180451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035928
| 0.233945
| 218
| 9
| 38
| 24.222222
| 0.760479
| 0
| 0
| 0
| 0
| 0
| 0.420091
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
5c1e7ddc47314669c9f73452ed6770ed0449ee43
| 163
|
py
|
Python
|
sqerzo/exceptions.py
|
K-Jo/sqerzo
|
a34a500303c3def6ceac942b8e5d69cd1c65dbe4
|
[
"BSD-3-Clause"
] | 19
|
2020-12-12T03:41:14.000Z
|
2021-01-28T10:14:02.000Z
|
sqerzo/exceptions.py
|
K-Jo/sqerzo
|
a34a500303c3def6ceac942b8e5d69cd1c65dbe4
|
[
"BSD-3-Clause"
] | 1
|
2021-06-13T00:29:18.000Z
|
2021-06-13T00:29:18.000Z
|
sqerzo/exceptions.py
|
K-Jo/sqerzo
|
a34a500303c3def6ceac942b8e5d69cd1c65dbe4
|
[
"BSD-3-Clause"
] | 2
|
2021-04-12T14:41:29.000Z
|
2022-02-19T19:49:46.000Z
|
class SQErzoException(Exception):
pass
class SQErzoElementExistException(Exception):
pass
__all__ = ("SQErzoException", "SQErzoElementExistException")
| 16.3
| 60
| 0.779141
| 11
| 163
| 11.181818
| 0.545455
| 0.211382
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134969
| 163
| 9
| 61
| 18.111111
| 0.87234
| 0
| 0
| 0.4
| 0
| 0
| 0.259259
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.4
| 0
| 0
| 0.4
| 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
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
309efa05ea0c3fc33bb125345a4877e75b1e302a
| 11,782
|
py
|
Python
|
tests/graphs/algorithms/test_paths.py
|
ref-humbold/AlgoLib_Python
|
05f725504656ec93b879374a8cd87464d88fff77
|
[
"Apache-2.0"
] | null | null | null |
tests/graphs/algorithms/test_paths.py
|
ref-humbold/AlgoLib_Python
|
05f725504656ec93b879374a8cd87464d88fff77
|
[
"Apache-2.0"
] | null | null | null |
tests/graphs/algorithms/test_paths.py
|
ref-humbold/AlgoLib_Python
|
05f725504656ec93b879374a8cd87464d88fff77
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Tests: Algorithms for shortest paths"""
import unittest
from assertpy import assert_that
from algolib.graphs import DirectedSimpleGraph, UndirectedSimpleGraph
from algolib.graphs.algorithms import Paths, bellman_ford, dijkstra, floyd_warshall
def _from_list(graph, distances):
return {graph.get_vertex(i): d for i, d in enumerate(distances)}
def _from_matrix(graph, distances):
return {(graph.get_vertex(i), graph.get_vertex(j)): d for i, ds in enumerate(distances)
for j, d in enumerate(ds)}
class PathsTest(unittest.TestCase):
INF = Paths.INFINITY
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._directed_graph = None
self._undirected_graph = None
def setUp(self):
self._directed_graph = DirectedSimpleGraph(range(10))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(0),
self._directed_graph.get_vertex(1), self._Weight(4))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(1),
self._directed_graph.get_vertex(4), self._Weight(7))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(1),
self._directed_graph.get_vertex(7), self._Weight(12))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(2),
self._directed_graph.get_vertex(4), self._Weight(6))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(2),
self._directed_graph.get_vertex(6), self._Weight(8))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(3),
self._directed_graph.get_vertex(0), self._Weight(3))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(3),
self._directed_graph.get_vertex(7), self._Weight(5))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(4),
self._directed_graph.get_vertex(5), self._Weight(1))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(4),
self._directed_graph.get_vertex(3), self._Weight(10))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(5),
self._directed_graph.get_vertex(6), self._Weight(4))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(5),
self._directed_graph.get_vertex(8), self._Weight(2))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(6),
self._directed_graph.get_vertex(5), self._Weight(7))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(7),
self._directed_graph.get_vertex(5), self._Weight(2))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(7),
self._directed_graph.get_vertex(8), self._Weight(6))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(8),
self._directed_graph.get_vertex(9), self._Weight(10))
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(9),
self._directed_graph.get_vertex(6), self._Weight(3))
self._undirected_graph = UndirectedSimpleGraph(range(10))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(0),
self._undirected_graph.get_vertex(1),
self._Weight(4))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(1),
self._undirected_graph.get_vertex(4),
self._Weight(7))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(1),
self._undirected_graph.get_vertex(7),
self._Weight(12))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(2),
self._undirected_graph.get_vertex(6),
self._Weight(8))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(3),
self._undirected_graph.get_vertex(0),
self._Weight(3))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(3),
self._undirected_graph.get_vertex(7),
self._Weight(5))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(4),
self._undirected_graph.get_vertex(5),
self._Weight(1))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(4),
self._undirected_graph.get_vertex(3),
self._Weight(10))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(5),
self._undirected_graph.get_vertex(8),
self._Weight(2))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(7),
self._undirected_graph.get_vertex(5),
self._Weight(2))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(7),
self._undirected_graph.get_vertex(8),
self._Weight(6))
self._undirected_graph.add_edge_between(self._undirected_graph.get_vertex(9),
self._undirected_graph.get_vertex(6),
self._Weight(3))
def test__bellman_ford__when_directed_graph(self):
# given
distances = [20, 0, self.INF, 17, 7, 8, 12, 12, 10, 20]
expected = _from_list(self._directed_graph, distances)
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(2),
self._directed_graph.get_vertex(1), self._Weight(-2))
# when
result = bellman_ford(self._directed_graph, self._directed_graph.get_vertex(1))
# then
assert_that(result).is_equal_to(expected)
def test__bellman_ford__when_undirected_graph(self):
# given
distances = [4, 0, self.INF, 7, 7, 8, self.INF, 10, 10, self.INF]
expected = _from_list(self._undirected_graph, distances)
# when
result = bellman_ford(self._undirected_graph.as_directed(),
self._undirected_graph.get_vertex(1))
# then
assert_that(result).is_equal_to(expected)
def test__bellman_ford__when_negative_cycle__then_value_error(self):
# given
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(8),
self._directed_graph.get_vertex(3),
self._Weight(-20.0))
# when
def function(graph):
return bellman_ford(graph, graph.get_vertex(1))
# then
assert_that(function).raises(ValueError).when_called_with(self._directed_graph)
def test__dijkstra__when_directed_graph(self):
# given
distances = [20, 0, self.INF, 17, 7, 8, 12, 12, 10, 20]
expected = _from_list(self._directed_graph, distances)
# when
result = dijkstra(self._directed_graph, self._directed_graph.get_vertex(1))
# then
assert_that(result).is_equal_to(expected)
def test__dijkstra__when_undirected_graph(self):
# given
distances = [4, 0, self.INF, 7, 7, 8, self.INF, 10, 10, self.INF]
expected = _from_list(self._undirected_graph, distances)
# when
result = dijkstra(self._undirected_graph, self._undirected_graph.get_vertex(1))
# then
assert_that(result).is_equal_to(expected)
def test__dijkstra__when_negative_edge__then_value_error(self):
# given
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(2),
self._directed_graph.get_vertex(1), self._Weight(-2))
# when
def function(graph):
dijkstra(graph, graph.get_vertex(1))
# then
assert_that(function).raises(ValueError).when_called_with(self._directed_graph)
def test__floyd_warshall__when_directed_graph(self):
# given
distances = [[0, 4, self.INF, 21, 11, 12, 16, 16, 14, 24],
[20, 0, self.INF, 17, 7, 8, 12, 12, 10, 20],
[18, -2, 0, 15, 5, 6, 8, 10, 8, 18],
[3, 7, self.INF, 0, 14, 7, 11, 5, 9, 19],
[13, 17, self.INF, 10, 0, 1, 5, 15, 3, 13],
[self.INF, self.INF, self.INF, self.INF, self.INF, 0, 4, self.INF, 2, 12],
[self.INF, self.INF, self.INF, self.INF, self.INF, 7, 0, self.INF, 9, 19],
[self.INF, self.INF, self.INF, self.INF, self.INF, 2, 6, 0, 4, 14],
[self.INF, self.INF, self.INF, self.INF, self.INF, 20, 13, self.INF, 0, 10],
[self.INF, self.INF, self.INF, self.INF, self.INF, 10, 3, self.INF, 12, 0]]
expected = _from_matrix(self._directed_graph, distances)
self._directed_graph.add_edge_between(self._directed_graph.get_vertex(2),
self._directed_graph.get_vertex(1), self._Weight(-2))
# when
result = floyd_warshall(self._directed_graph)
# then
assert_that(result).is_equal_to(expected)
def test__floyd_warshall__when_undirected_graph(self):
# given
distances = \
[[0, 4, self.INF, 3, 11, 10, self.INF, 8, 12, self.INF],
[4, 0, self.INF, 7, 7, 8, self.INF, 10, 10, self.INF],
[self.INF, self.INF, 0, self.INF, self.INF, self.INF, 8, self.INF, self.INF, 11],
[3, 7, self.INF, 0, 8, 7, self.INF, 5, 9, self.INF],
[11, 7, self.INF, 8, 0, 1, self.INF, 3, 3, self.INF],
[10, 8, self.INF, 7, 1, 0, self.INF, 2, 2, self.INF],
[self.INF, self.INF, 8, self.INF, self.INF, self.INF, 0, self.INF, self.INF, 3],
[8, 10, self.INF, 5, 3, 2, self.INF, 0, 4, self.INF],
[12, 10, self.INF, 9, 3, 2, self.INF, 4, 0, self.INF],
[self.INF, self.INF, 11, self.INF, self.INF, self.INF, 3, self.INF, self.INF, 0]]
expected = _from_matrix(self._undirected_graph, distances)
# when
result = floyd_warshall(self._undirected_graph.as_directed())
# then
assert_that(result).is_equal_to(expected)
class _Weight:
def __init__(self, weight):
self.weight = weight
| 56.917874
| 99
| 0.566627
| 1,405
| 11,782
| 4.375089
| 0.069039
| 0.094518
| 0.16626
| 0.136652
| 0.850659
| 0.812592
| 0.784448
| 0.765414
| 0.6857
| 0.6857
| 0
| 0.042009
| 0.329231
| 11,782
| 206
| 100
| 57.194175
| 0.735797
| 0.015872
| 0
| 0.371795
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057692
| 1
| 0.096154
| false
| 0
| 0.025641
| 0.019231
| 0.160256
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
30aa4782f49ede8e5a06e3f2644b4ac7e5cdac8f
| 1,047
|
py
|
Python
|
python/anyascii/_data/_04d.py
|
casept/anyascii
|
d4f426b91751254b68eaa84c6cd23099edd668e6
|
[
"ISC"
] | null | null | null |
python/anyascii/_data/_04d.py
|
casept/anyascii
|
d4f426b91751254b68eaa84c6cd23099edd668e6
|
[
"ISC"
] | null | null | null |
python/anyascii/_data/_04d.py
|
casept/anyascii
|
d4f426b91751254b68eaa84c6cd23099edd668e6
|
[
"ISC"
] | null | null | null |
b='Tong Yu Xiang Nao Shun Fen Pu Ling Ao Huan Yi Huan Meng Ying Lei Yan Bao Die Ling Shi Jiao Lie Jing Ju Ti Pi Gang Xiao Wai Chuai Di Huan Yao Li Mi Hu Sheng Jia Yin Wei Piao Lu Ling Yi Cai Shan Hu Shu Tuo Mo Hua Tie Bing Peng Hun Fu Guo Bu Li Chan Pi Cuo Meng Suo Qiang Zhi Kuang Bi Ao Meng Xian Ku Tou Tuan Wei Xian Tan Tuan Lao Chan Ni Ni Li Dong Ju Qian Bo Shai Zha Tao Qian Nong Yi Jing Gan Di Jian Mei Da Jian Yu Xie Zai Mang Li Gun Xun Ta Zhe Yang Tuan Shang Xi Qiao Wei Ying Chua Qu Wa Caau Zhi Ting Gu Shang Ca Fu Tie Ta Ta Zhuo Han Ping He Zhui Zhou Bo Liu Nu Xi Pao Di He Ti Wai Ti Qi Ji Chi Ba Jin Ke Li Ju Qu La Gu Qia Qi Xian Jian Shi Jian Ai Hua Zha Ze Yao Zhan Ji Cha Yan Jian Yan Gwaai Jiao Tong Nan Yue Ceoi Chi Qian Kun Zhun Meng Xu Song Shi Bi XiaoChu Lu Tai Pi TongRen DaYou Qian Yu Sui Gu Lin Guan ShiKe Bi Bo Fu WuWang DaChu Yi DaGuo Kan Li Xian Heng Dun DaZhuang Jin MingYi JiaRen Kui Jian Xie Sun Yi Guai Gou Cui Sheng Kun Jing Ge Ding Zhen Gen Jian GuiMei Feng Lu Xun Dui Huan Jie ZhongFu XiaoGuo JiJi WeiJi'
| 1,047
| 1,047
| 0.753582
| 245
| 1,047
| 3.220408
| 0.64898
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.243553
| 1,047
| 1
| 1,047
| 1,047
| 0.996212
| 0
| 0
| 0
| 0
| 1
| 0.995229
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
30da95366bc25bafc040d368f7c955710755fe72
| 25,726
|
py
|
Python
|
core/test/test_api_rooms_installations.py
|
ClairBerlin/managair
|
44af9f73039ecdb7dd959dacda5470a103795ac3
|
[
"BSD-3-Clause"
] | 4
|
2020-11-22T17:07:14.000Z
|
2020-11-26T07:53:08.000Z
|
core/test/test_api_rooms_installations.py
|
ClairBerlin/managair
|
44af9f73039ecdb7dd959dacda5470a103795ac3
|
[
"BSD-3-Clause"
] | 18
|
2020-12-04T07:48:13.000Z
|
2022-01-26T18:09:33.000Z
|
core/test/test_api_rooms_installations.py
|
ClairBerlin/managair
|
44af9f73039ecdb7dd959dacda5470a103795ac3
|
[
"BSD-3-Clause"
] | 1
|
2021-01-15T10:41:33.000Z
|
2021-01-15T10:41:33.000Z
|
from django.urls import reverse
from rest_framework.test import APITestCase
from rest_framework_json_api.utils import format_resource_type
from .utils import TokenAuthMixin
class RoomsTestCase(TokenAuthMixin, APITestCase):
fixtures = ["user-fixtures.json", "inventory-fixtures.json"]
def setUp(self):
# veraVersuch is owner of the organization Versuchsverbund with pk=2.
# Versuchserbund commands the sites Versuchs-Site (pk=2) and Prüf-Site (pk=3).
# Versuchs-Site has room Versuchsraum 1 (pk=3),
# Prüf-Site has room Prüfstuge (pk=4).
self.auth_response, self.auth_token = self.authenticate(
username="veraVersuch", password="versuch"
)
self.assertIsNotNone(self.auth_token)
# Versuchsverbund owns Versuchsraum 1 with pk=3
self.room_pk = 3
self.detail_url = reverse("room-detail", kwargs={"pk": self.room_pk})
self.collection_url = reverse("room-list")
def tearDown(self):
self.logout()
def test_get_rooms(self):
"""GET /rooms/"""
response = self.client.get(self.collection_url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 2)
def test_get_rooms_public(self):
"""GET /rooms/ without being logged-in"""
# Make sure to not provide an authentication token.
# self.client.defaults.pop("HTTP_AUTHORIZATION")
self.logout()
response = self.client.get(self.collection_url)
self.assertEqual(response.status_code, 200)
# There is one room in the test data set that contains a public installation.
self.assertEqual(len(response.data["results"]), 1)
def test_get_rooms_per_organization(self):
"""GET /rooms/?filter[organization]=<organization_id>"""
# Need a different user for this test case.
# user priskaPrueferin is member in two organizations
self.authenticate(username="priskaPrueferin", password="priska")
response = self.client.get(self.collection_url, {"filter[organization]": 1})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 2)
def test_get_rooms_per_site(self):
"""GET /rooms/?filter[site]=<site_id>"""
response = self.client.get(self.collection_url, {"filter[site]": 2})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 1)
def test_get_room(self):
"""GET /rooms/<room_pk>/"""
response = self.client.get(self.detail_url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["name"], "Versuchsraum 1")
self.assertEqual(response.data["max_occupancy"], 17)
def test_patch_room(self):
"""PATCH /rooms/<room_pk>/"""
request_data = {
"data": {
"type": format_resource_type("Room"),
"id": self.room_pk,
"attributes": {
"description": "Ein Raum für Versuche.",
"height_m": "2.7",
},
}
}
response = self.client.patch(self.detail_url, data=request_data)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["name"], "Versuchsraum 1")
self.assertEqual(response.data["description"], "Ein Raum für Versuche.")
self.assertEqual(response.data["height_m"], "2.7")
def test_create_get_delete_room(self):
request_data = {
"data": {
"type": format_resource_type("Room"),
"attributes": {
"name": "Räumchen",
"description": "Nur zum Test",
"size_sqm": "5",
"height_m": "2.6",
"max_occupancy": 1,
},
"relationships": {
"site": {"data": {"type": "Site", "id": self.room_pk}},
},
}
}
# POST /rooms/
response1 = self.client.post(self.collection_url, data=request_data)
self.assertEqual(response1.status_code, 201)
self.assertEqual(response1.data["name"], "Räumchen")
self.assertEqual(response1.data["description"], "Nur zum Test")
self.assertEqual(response1.data["size_sqm"], "5.0")
self.assertEqual(response1.data["height_m"], "2.6")
self.assertEqual(response1.data["max_occupancy"], 1)
self.assertEqual(response1.data["site"]["id"], "3")
# Fetch the room resource just created.
response_url = response1.data["url"]
# GET /rooms/<room_pk/>
response2 = self.client.get(response_url)
self.assertEqual(response2.status_code, 200)
self.assertEqual(response2.data["name"], "Räumchen")
self.assertEqual(response2.data["description"], "Nur zum Test")
self.assertEqual(response2.data["size_sqm"], "5.0")
self.assertEqual(response2.data["height_m"], "2.6")
self.assertEqual(response2.data["max_occupancy"], 1)
self.assertEqual(response2.data["site"]["id"], "3")
# Delete the room.
# DELETE /room/<room_pk>/
response3 = self.client.delete(response_url)
self.assertEqual(response3.status_code, 204)
# Make sure it is gone.
# GET /room/<room_pk>/
response4 = self.client.get(response_url)
self.assertEqual(response4.status_code, 404)
def test_get_room_installations(self):
"""GET /rooms/<room_pk>/installations/"""
url = reverse("room-related-installations", kwargs={"room_pk": self.room_pk})
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 1)
def test_unauthorized_create_no_member(self):
"""POST /rooms/ for an organization the user ist not a member of."""
request_data = {
"data": {
"type": format_resource_type("Room"),
"attributes": {
"name": "Räumchen",
"description": "Nur zum Test",
"size_sqm": "5",
"height_m": "2.6",
"max_occupancy": 1,
},
"relationships": {
# The currently authenticated user VeraVersuch is not a member of
# the organization Test-Team with Site Test-Site (pk=1).
"site": {"data": {"type": "Site", "id": "1"}},
},
}
}
response = self.client.post(self.collection_url, data=request_data)
self.assertEqual(response.status_code, 403)
def test_unauthorized_create_no_owner(self):
"""POST /rooms/ for an organization where the user is not an OWNER."""
# Need a different user for this test case.
# User horstHilfsarbeiter is ASSISTANT in Versuchsverbung (pk=2).
self.authenticate(username="horstHilfsarbeiter", password="horst")
request_data = {
"data": {
"type": format_resource_type("Room"),
"attributes": {
"name": "Räumchen",
"description": "Nur zum Test",
"size_sqm": "5",
"height_m": "2.6",
"max_occupancy": 1,
},
"relationships": {
# The currently authenticated user horstHilfsarbeiter is not an
# OWNER of the organization Versuchsverbund with Versuchs-Site
# (pk=2).
"site": {"data": {"type": "Site", "id": "2"}},
},
}
}
response = self.client.post(self.collection_url, data=request_data)
self.assertEqual(response.status_code, 403)
def test_unauthorized_patch_no_member(self):
"""PATCH /rooms/ of an organization of which the use ist not a member."""
room_pk = 1 # Testraum 1 belongs to Organization Test-Team.
detail_url = reverse("room-detail", kwargs={"pk": room_pk})
request_data = {
"data": {
"type": format_resource_type("Room"),
"id": room_pk,
"attributes": {
"description": "Ein Raum für Versuche.",
"height_m": "2.7",
},
}
}
response = self.client.patch(detail_url, data=request_data)
# Expect a HTTP 404 error code, because the object to be patched should not be
# accessible to the logged-in user.
self.assertEqual(response.status_code, 404)
def test_unauthorized_patch_no_owner(self):
"""PATCH /rooms/ of an organization where the user ist not an OWNER."""
# Need a different user for this test case.
# User horstHilfsarbeiter is ASSISTANT in Versuchsverbung (pk=2).
self.authenticate(username="horstHilfsarbeiter", password="horst")
request_data = {
"data": {
"type": format_resource_type("Room"),
"id": self.room_pk,
"attributes": {
"description": "Ein Raum für Versuche.",
"height_m": "2.7",
},
}
}
response = self.client.patch(self.detail_url, data=request_data)
# Expect a HTTP 403 error code, because the user has access to the Node but is
# not sufficiently privileged to alter it.
self.assertEqual(response.status_code, 403)
class InstallationsTestCase(TokenAuthMixin, APITestCase):
fixtures = ["user-fixtures.json", "inventory-fixtures.json", "data-fixtures.json"]
node_id = "3b95a1b2-74e7-9e98-52c4-4acae441f0ae" # Clairchen Schwarz
node2_id = "9d02faee-4260-1377-22ec-936428b572ee" # ERS Test-Node
room_pk = 4 # Prüfstube
inst_pk = 2
def setUp(self):
# veraVersuch is owner of the organization Versuchsverbund with pk=2.
# Versuchserbund commands the sites Versuchs-Site (pk=2) and Prüf-Site (pk=3).
# Versuchs-Site has room Versuchsraum 1 (pk=3),
# Prüf-Site has room Prüfstuge (pk=4).
self.auth_response, self.auth_token = self.authenticate(
username="veraVersuch", password="versuch"
)
self.assertIsNotNone(self.auth_token)
# Versuchsverbund owns
# Clairchen Schwarz (id=3b95a1b2-74e7-9e98-52c4-4acae441f0ae) and
# ERS Test-Node (id=9d02faee-4260-1377-22ec-936428b572ee).
self.detail_url = reverse("installation-detail", kwargs={"pk": self.inst_pk})
self.collection_url = reverse("installation-list")
def tearDown(self):
self.logout()
def test_get_installations(self):
"""GET /installations/"""
response = self.client.get(self.collection_url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 2)
# Ensure that no timeseries is returned if we do not query for it.
self.assertFalse("timeseries" in response.data)
def test_get_installations_public(self):
""" GET /installations/ without authentication."""
# Make sure to not provide an authentication token.
# self.client.defaults.pop("HTTP_AUTHORIZATION")
self.logout()
response = self.client.get(self.collection_url)
self.assertEqual(response.status_code, 200)
# There is exactly one public node installation in the test data.
self.assertEqual(len(response.data["results"]), 1)
def test_get_installations_per_organization(self):
"""GET /installations/?filter[organization]=<organization_id>"""
# Need a different user for this test case.
# user priskaPrueferin is member in two organizations
self.authenticate(username="priskaPrueferin", password="priska")
response = self.client.get(self.collection_url, {"filter[organization]": 1})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 1)
def test_get_installations_per_site(self):
"""GET /installations/?filter[site]=<site_id>"""
response = self.client.get(self.collection_url, {"filter[site]": 3})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 1)
self.assertEqual(response.data["results"][0]["from_timestamp_s"], 1602720001)
def test_get_installations_per_room(self):
"""GET /installations/?filter[room]=<room_pk>"""
response = self.client.get(self.collection_url, {"filter[room]": 3})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 1)
self.assertEqual(response.data["results"][0]["from_timestamp_s"], 1601510400)
def test_get_installations_per_node(self):
"""GET /installations/?filter[node]=<node_id>"""
response = self.client.get(self.collection_url, {"filter[node]": self.node_id})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["results"]), 2)
def test_get_installation(self):
"""GET /installations/<installation_pk>/"""
response = self.client.get(self.detail_url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["from_timestamp_s"], 1601510400)
def test_get_installation_with_timeseries(self):
"""GET /installations/<installation_pk>/?include_timeseries=true"""
response = self.client.get(self.detail_url, {"include_timeseries": True})
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["timeseries"]), 468)
def test_get_installation_with_timeseries_slice(self):
"""GET /installations/<installation_pk>/?include_timeseries=true&filter[from]=1601675365&filter[to]=1601738613"""
response = self.client.get(
self.detail_url,
{
"include_timeseries": True,
"filter[from]": 1601675365,
"filter[to]": 1601738613,
},
)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data["timeseries"]), 71)
def test_patch_installation(self):
"""PATCH /installations/<installation_pk>/"""
request_data = {
"data": {
"type": format_resource_type("Installation"),
"id": self.inst_pk,
"attributes": {"from_timestamp_s": 1601510000, "is_public": True},
"relationships": {
"node": {
"data": {
"type": format_resource_type("Node"),
"id": self.node_id,
}
},
"room": {
"data": {
"type": format_resource_type("Room"),
"id": 3,
}
},
},
}
}
response = self.client.patch(self.detail_url, data=request_data)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["from_timestamp_s"], 1601510000)
self.assertEqual(response.data["is_public"], True)
def test_toggle_installation_publicity(self):
"""PATCH /installations/<installation_pk>/"""
request_data = {
"data": {
"type": format_resource_type("Installation"),
"id": self.inst_pk,
"attributes": {"is_public": True},
},
}
response = self.client.patch(self.detail_url, data=request_data)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["is_public"], True)
request_data["data"]["attributes"]["is_public"] = False
response = self.client.patch(self.detail_url, data=request_data)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["is_public"], False)
# TODO: Test illegal time-slice overlaps
def test_create_get_delete_installation(self):
request_data = {
"data": {
"type": format_resource_type("Installation"),
"attributes": {
"from_timestamp_s": 1601500000,
# Leave end timestamp open.
"description": "Testinstallation",
"is_public": False,
},
"relationships": {
# Install the ERS Test-Node (id=9d02faee-4260-1377-22ec-936428b572ee) in Prüfstube (id=4).
"node": {
"data": {
"type": format_resource_type("Node"),
"id": self.node2_id,
}
},
"room": {
"data": {
"type": format_resource_type("Room"),
"id": self.room_pk,
}
},
},
}
}
# POST /memberships/
response1 = self.client.post(self.collection_url, data=request_data)
self.assertEqual(response1.status_code, 201)
self.assertEqual(response1.data["from_timestamp_s"], 1601500000)
self.assertEqual(response1.data["to_timestamp_s"], 2147483647)
self.assertEqual(
response1.data["node"]["id"], "9d02faee-4260-1377-22ec-936428b572ee"
)
self.assertEqual(response1.data["room"]["id"], "4")
# Fetch the installation resource just created.
response_url = response1.data["url"]
# GET /installations/<installation_pk/>
response2 = self.client.get(response_url)
self.assertEqual(response2.status_code, 200)
self.assertEqual(response2.data["from_timestamp_s"], 1601500000)
self.assertEqual(response2.data["node"]["id"], self.node2_id)
self.assertEqual(response2.data["room"]["id"], "4")
# Delete the installation.
# DELETE /installations/<installation_pk>/
response3 = self.client.delete(response_url)
self.assertEqual(response3.status_code, 204)
# Make sure it is gone.
# GET /installations/<installation_pk>/
response4 = self.client.get(response_url)
self.assertEqual(response4.status_code, 404)
def test_upload_image(self):
upload_url = reverse("installation-image", args=["2"])
image_file = open("/code/core/test/test_data/sensor.jpeg", "rb")
data = {"image": image_file}
response = self.client.put(upload_url, data, format="multipart")
self.assertEqual(response.status_code, 200)
def test_node_room_owner_mismatch(self):
"""POST /installations/ where the owner of the room and the node differ."""
# Clairchen Rot belongs to Test-Team
incorrect_node_id = "c727b2f8-8377-d4cb-0e95-ac03200b8c93"
request_data = {
"data": {
"type": format_resource_type("Installation"),
"attributes": {
"from_timestamp_s": 1601500000,
"to_timestamp_s": 2147483647,
"description": "Testinstallation",
"is_public": True,
},
"relationships": {
# Try to install Clairchen Rot in Prüfstube (id=4).
"node": {
"data": {
"type": format_resource_type("Node"),
"id": incorrect_node_id,
}
},
"room": {
"data": {
"type": format_resource_type("Room"),
"id": self.room_pk,
}
},
},
}
}
response = self.client.post(self.collection_url, data=request_data)
# Expect a HTTP 400 (Bad Request) error code, because the request data is
# inconsistent.
self.assertEqual(response.status_code, 400)
def test_get_installation_room(self):
"""GET /installations/<installation_pk>/room/"""
url = reverse(
"installation-related", kwargs={"pk": self.inst_pk, "related_field": "room"}
)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["name"], "Versuchsraum 1")
def test_get_installation_node(self):
"""GET /installations/<installation_pk>/node/"""
url = reverse(
"installation-related-node", kwargs={"installation_pk": self.inst_pk}
)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.data["id"], self.node_id)
def test_unauthorized_create_no_member(self):
"""POST /installations/ for an organization the user ist not a member of."""
node_id = "c727b2f8-8377-d4cb-0e95-ac03200b8c93"
request_data = {
"data": {
"type": format_resource_type("Installation"),
"attributes": {
"from_timestamp_s": 1601500000,
"to_timestamp_s": 2147483647,
"description": "Testinstallation",
"is_public": True,
},
"relationships": {
# Install Clairchen Rot in Testraum 1 (pk=1).
# The currently authenticated user VeraVersuch is not a member of
# the organization that owns Testraum 1 and Clairchen Rot.
"node": {
"data": {
"type": format_resource_type("Node"),
"id": node_id,
}
},
"room": {
"data": {
"type": format_resource_type("Room"),
"id": 1,
}
},
},
}
}
response = self.client.post(self.collection_url, data=request_data)
self.assertEqual(response.status_code, 403)
def test_unauthorized_create_no_owner(self):
"""POST /installations/ for an organization where the user is not an OWNER."""
# Need a different user for this test case.
# User horstHilfsarbeiter is ASSISTANT in Versuchsverbung (pk=2).
self.authenticate(username="horstHilfsarbeiter", password="horst")
request_data = {
"data": {
"type": format_resource_type("Installation"),
"attributes": {
"from_timestamp_s": 1601500000,
"to_timestamp_s": 2147483647,
"description": "Testinstallation",
"is_public": False,
},
"relationships": {
# Install the ERS Test-Node (id=9d02faee-4260-1377-22ec-936428b572ee) in Prüfstube (id=4).
"node": {
"data": {
"type": format_resource_type("Node"),
"id": self.node2_id,
}
},
"room": {
"data": {
"type": format_resource_type("Room"),
"id": self.room_pk,
}
},
},
}
}
response = self.client.post(self.collection_url, data=request_data)
self.assertEqual(response.status_code, 403)
def test_unauthorized_patch_no_member(self):
"""PATCH /installations/ of an organization of which the use ist not a member."""
installation_id = 1 # Installation of Clairchen Rot in Testraum 2 (Test-Team)
detail_url = reverse("installation-detail", kwargs={"pk": installation_id})
request_data = {
"data": {
"type": format_resource_type("Installation"),
"id": installation_id,
"attributes": {"from_timestamp_s": 1601510000, "is_public": True},
}
}
response = self.client.patch(detail_url, data=request_data)
# Expect a HTTP 404 error code, because the object to be patched should not be
# accessible to the authenticated user.
self.assertEqual(response.status_code, 404)
def test_unauthorized_patch_no_owner(self):
"""PATCH /installations/ of an organization where the user ist not an OWNER."""
# Need a different user for this test case.
# User horstHilfsarbeiter is ASSISTANT in Versuchsverbung (pk=2).
self.authenticate(username="horstHilfsarbeiter", password="horst")
request_data = {
"data": {
"type": format_resource_type("Installation"),
"id": 2,
"attributes": {"from_timestamp_s": 1601510000, "is_public": False},
}
}
response = self.client.patch(self.detail_url, data=request_data)
# Expect a HTTP 403 error code, because the user has access to the Node but is
# not sufficiently privileged to alter it.
self.assertEqual(response.status_code, 403)
| 44.355172
| 121
| 0.568685
| 2,645
| 25,726
| 5.372779
| 0.097543
| 0.089719
| 0.072831
| 0.063261
| 0.821617
| 0.784744
| 0.757653
| 0.717402
| 0.690662
| 0.648652
| 0
| 0.038142
| 0.313107
| 25,726
| 579
| 122
| 44.431779
| 0.766057
| 0.192179
| 0
| 0.579545
| 0
| 0
| 0.138605
| 0.015271
| 0
| 0
| 0
| 0.001727
| 0.2
| 1
| 0.081818
| false
| 0.018182
| 0.009091
| 0
| 0.109091
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
eb4935b1061c5222d23524493dcb0784598f85d7
| 116
|
py
|
Python
|
py/shared/emails/__init__.py
|
samuelcolvin/nosht
|
9e4d9bea8ff6bfae86cae948cc3028ccc68d0188
|
[
"MIT"
] | 26
|
2018-07-28T23:11:27.000Z
|
2022-02-09T13:40:33.000Z
|
py/shared/emails/__init__.py
|
samuelcolvin/nosht
|
9e4d9bea8ff6bfae86cae948cc3028ccc68d0188
|
[
"MIT"
] | 336
|
2018-05-25T17:57:00.000Z
|
2022-03-11T23:24:36.000Z
|
py/shared/emails/__init__.py
|
samuelcolvin/nosht
|
9e4d9bea8ff6bfae86cae948cc3028ccc68d0188
|
[
"MIT"
] | 4
|
2018-07-18T08:37:19.000Z
|
2022-01-31T14:42:48.000Z
|
from .defaults import Triggers # noqa
from .main import EmailActor # noqa
from .plumbing import UserEmail # noqa
| 29
| 39
| 0.767241
| 15
| 116
| 5.933333
| 0.6
| 0.179775
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181034
| 116
| 3
| 40
| 38.666667
| 0.936842
| 0.12069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
eb6eed404d38fce9d1591be092d0dc05722b149f
| 165
|
py
|
Python
|
pipeline/locusextractor/tests/LocusExtractorTest.py
|
82ndAirborneDiv/BMGAP
|
4913ec6331d19d47fd58cf4962e1a428f3f47dcb
|
[
"Apache-2.0"
] | 1
|
2022-02-02T19:49:58.000Z
|
2022-02-02T19:49:58.000Z
|
pipeline/locusextractor/tests/LocusExtractorTest.py
|
82ndAirborneDiv/BMGAP
|
4913ec6331d19d47fd58cf4962e1a428f3f47dcb
|
[
"Apache-2.0"
] | 5
|
2021-03-11T04:25:19.000Z
|
2022-03-02T09:50:25.000Z
|
pipeline/locusextractor/tests/LocusExtractorTest.py
|
82ndAirborneDiv/BMGAP
|
4913ec6331d19d47fd58cf4962e1a428f3f47dcb
|
[
"Apache-2.0"
] | 4
|
2020-11-12T17:04:58.000Z
|
2022-02-27T23:12:46.000Z
|
import sys
sys.path.append('..')
import LocusExtractor
import unittest
class TestLocusExtractor(unittest.TestCase):
def test_repository(self):
pass
| 18.333333
| 44
| 0.733333
| 18
| 165
| 6.666667
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175758
| 165
| 9
| 45
| 18.333333
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0.012048
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0.142857
| 0.428571
| 0
| 0.714286
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
eb7c5a32c80628e5fd2d6798e054f6a60e353344
| 69
|
py
|
Python
|
src/Capitulo_1/hello_world.py
|
rogerio5ouza/python-crash-course
|
70c00bcf3e9446adc9b104c9b4f9b6125ebefc71
|
[
"MIT"
] | null | null | null |
src/Capitulo_1/hello_world.py
|
rogerio5ouza/python-crash-course
|
70c00bcf3e9446adc9b104c9b4f9b6125ebefc71
|
[
"MIT"
] | null | null | null |
src/Capitulo_1/hello_world.py
|
rogerio5ouza/python-crash-course
|
70c00bcf3e9446adc9b104c9b4f9b6125ebefc71
|
[
"MIT"
] | null | null | null |
# Impressão de mensagem de texto
print("Hello Python interpreter!")
| 17.25
| 34
| 0.768116
| 9
| 69
| 5.888889
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144928
| 69
| 3
| 35
| 23
| 0.898305
| 0.434783
| 0
| 0
| 0
| 0
| 0.675676
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
ebc57676cee76af7f34ead4fcb7474f91288b2f7
| 25
|
py
|
Python
|
Castessoft_School_Bag/models/Register.py
|
JuanDiegoCastellanos/All-in-one-Python-Full
|
ba28a3d129a060d5a83c1d99ff97cf5c9d3d2afa
|
[
"MIT"
] | 1
|
2021-11-23T02:46:50.000Z
|
2021-11-23T02:46:50.000Z
|
Castessoft_School_Bag/models/Register.py
|
JuanDiegoCastellanos/All-in-one-Python-Full
|
ba28a3d129a060d5a83c1d99ff97cf5c9d3d2afa
|
[
"MIT"
] | null | null | null |
Castessoft_School_Bag/models/Register.py
|
JuanDiegoCastellanos/All-in-one-Python-Full
|
ba28a3d129a060d5a83c1d99ff97cf5c9d3d2afa
|
[
"MIT"
] | null | null | null |
class Register:
pass
| 8.333333
| 15
| 0.68
| 3
| 25
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.28
| 25
| 2
| 16
| 12.5
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ebdcd6d32d8b19a64734fccfc14bbb519f14927d
| 241
|
py
|
Python
|
glow/core/wrap/__init__.py
|
arquolo/glow
|
c4c63e36551cd1eec2e34129dbc0f06c788099de
|
[
"MIT"
] | null | null | null |
glow/core/wrap/__init__.py
|
arquolo/glow
|
c4c63e36551cd1eec2e34129dbc0f06c788099de
|
[
"MIT"
] | null | null | null |
glow/core/wrap/__init__.py
|
arquolo/glow
|
c4c63e36551cd1eec2e34129dbc0f06c788099de
|
[
"MIT"
] | null | null | null |
from .cache import memoize
from .concurrency import call_once, shared_call, stream_batched, threadlocal
from .reusable import Reusable
__all__ = [
'call_once', 'memoize', 'shared_call', 'stream_batched', 'threadlocal',
'Reusable'
]
| 26.777778
| 76
| 0.751037
| 28
| 241
| 6.107143
| 0.464286
| 0.093567
| 0.187135
| 0.269006
| 0.397661
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141079
| 241
| 8
| 77
| 30.125
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0.248963
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 0
| 0.428571
| 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
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
693c016bcecaa166888eab55c64afcb4fd9f977d
| 1,218
|
py
|
Python
|
cardgame/cards/migrations/0002_auto_20181113_0508.py
|
Tjorriemorrie/cardgame
|
892c0a16675f372afff13995035306128c505888
|
[
"Apache-2.0"
] | null | null | null |
cardgame/cards/migrations/0002_auto_20181113_0508.py
|
Tjorriemorrie/cardgame
|
892c0a16675f372afff13995035306128c505888
|
[
"Apache-2.0"
] | null | null | null |
cardgame/cards/migrations/0002_auto_20181113_0508.py
|
Tjorriemorrie/cardgame
|
892c0a16675f372afff13995035306128c505888
|
[
"Apache-2.0"
] | null | null | null |
# Generated by Django 2.1.3 on 2018-11-13 05:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cards', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='carditem',
name='card',
),
migrations.RemoveField(
model_name='deck',
name='carditem_ptr',
),
migrations.RemoveField(
model_name='deck',
name='player',
),
migrations.RemoveField(
model_name='grave',
name='carditem_ptr',
),
migrations.RemoveField(
model_name='grave',
name='player',
),
migrations.RemoveField(
model_name='hand',
name='carditem_ptr',
),
migrations.RemoveField(
model_name='hand',
name='player',
),
migrations.DeleteModel(
name='CardItem',
),
migrations.DeleteModel(
name='Deck',
),
migrations.DeleteModel(
name='Grave',
),
migrations.DeleteModel(
name='Hand',
),
]
| 22.555556
| 47
| 0.486043
| 94
| 1,218
| 6.180851
| 0.361702
| 0.253012
| 0.313253
| 0.361446
| 0.473322
| 0.473322
| 0.232358
| 0
| 0
| 0
| 0
| 0.025921
| 0.398194
| 1,218
| 53
| 48
| 22.981132
| 0.766712
| 0.036946
| 0
| 0.723404
| 1
| 0
| 0.111016
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.021277
| 0
| 0.085106
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
69722f6759b2c1ad16120c2c05490b0b528d0d02
| 87
|
py
|
Python
|
wowapi/mixins/__init__.py
|
hanipman/python-wowapi
|
cb948745bf8ff654487e2153d11c9d86217bdaf8
|
[
"MIT"
] | 59
|
2015-03-11T16:37:06.000Z
|
2021-12-09T16:46:53.000Z
|
wowapi/mixins/__init__.py
|
hanipman/python-wowapi
|
cb948745bf8ff654487e2153d11c9d86217bdaf8
|
[
"MIT"
] | 21
|
2015-03-13T11:28:23.000Z
|
2022-02-05T12:37:10.000Z
|
wowapi/mixins/__init__.py
|
hanipman/python-wowapi
|
cb948745bf8ff654487e2153d11c9d86217bdaf8
|
[
"MIT"
] | 21
|
2016-08-19T12:46:23.000Z
|
2022-02-13T19:54:54.000Z
|
from .game_data import GameDataMixin # noqa
from .profile import ProfileMixin # noqa
| 29
| 44
| 0.793103
| 11
| 87
| 6.181818
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16092
| 87
| 2
| 45
| 43.5
| 0.931507
| 0.103448
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
15c93e96d0074204e1f35fb9307fa6112e2e5908
| 224
|
py
|
Python
|
scripts/ssc/deprecated/euler_scripts_TopoAE/run_topoae_euler_swissroll_1.py
|
MrBellamonte/MT-VAEs-TDA
|
8881b5db607c673fb558f7b74ece27f244b16b77
|
[
"MIT"
] | null | null | null |
scripts/ssc/deprecated/euler_scripts_TopoAE/run_topoae_euler_swissroll_1.py
|
MrBellamonte/MT-VAEs-TDA
|
8881b5db607c673fb558f7b74ece27f244b16b77
|
[
"MIT"
] | 1
|
2020-09-22T13:04:58.000Z
|
2020-09-22T13:05:23.000Z
|
scripts/ssc/deprecated/euler_scripts_TopoAE/run_topoae_euler_swissroll_1.py
|
MrBellamonte/AEs-VAEs-TDA
|
8881b5db607c673fb558f7b74ece27f244b16b77
|
[
"MIT"
] | null | null | null |
from scripts.ssc.models.TopoAE import swissroll_midsize_lowbs_euler_seed1_1
from src.models.TopoAE.train_engine import simulator_TopoAE
if __name__ == "__main__":
simulator_TopoAE(swissroll_midsize_lowbs_euler_seed1_1)
| 37.333333
| 75
| 0.861607
| 32
| 224
| 5.375
| 0.59375
| 0.139535
| 0.244186
| 0.302326
| 0.372093
| 0.372093
| 0
| 0
| 0
| 0
| 0
| 0.019417
| 0.080357
| 224
| 5
| 76
| 44.8
| 0.815534
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 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
| 0
| 0
|
0
| 5
|
c64d8ac97feaf2bad679f2e6226d0281ea64a6da
| 55,991
|
py
|
Python
|
cltk/corpus/greek/tlg/id_author.py
|
michiboo/cltk
|
f4ab93b836a995f88a007ed78246ea6db0bef377
|
[
"MIT"
] | 2
|
2018-11-08T12:48:27.000Z
|
2018-11-08T17:01:55.000Z
|
cltk/corpus/greek/tlg/id_author.py
|
michiboo/cltk
|
f4ab93b836a995f88a007ed78246ea6db0bef377
|
[
"MIT"
] | 4
|
2021-02-02T23:07:04.000Z
|
2021-12-13T20:48:54.000Z
|
cltk/corpus/greek/tlg/id_author.py
|
michiboo/cltk
|
f4ab93b836a995f88a007ed78246ea6db0bef377
|
[
"MIT"
] | 1
|
2019-06-16T06:41:47.000Z
|
2019-06-16T06:41:47.000Z
|
ID_AUTHOR = {'2434': 'Aelius Dius Hist.', '2035': 'Athanasius Theol.', '2012': 'Acta Eupli', '1578': 'Phaenias Phil.', '1220': 'Batrachomyomachia', '1222': 'Beros(s)us Astrol. et Hist.', '0474': 'Magnes Comic.', '0559': 'Heron Mech.', '4138': 'Ephraem Syrus Theol.', '1639': 'Pseudo-Auctores Hellenistae (PsVTGr)', '4075': 'Marinus Phil.', '1413': 'Heraclitus Paradox.', '2120': 'Panteleius Epic.', '2595': 'Philo Paradox.', '2744': 'Historia Monachorum In Aegypto', '1397': 'Hegesippus Hist.', '1634': 'Prodicus Soph.', '2566': '[Agathon] Hist.', '4291': 'Verba In Scripturis De Christo', '0373': 'Melanippides Lyr.', '2648': 'Adespota Papyracea (SH)', '1817': 'Fragmenta Anonyma (PsVTGr)', '1871': 'Bion Hist.', '1105': 'Timaeus Praxidas Astrol.', '0552': 'Archimedes Geom.', '1407': 'Heraclides Lembus Hist.', '0766': 'Alcmaeon Phil.', '1725': 'Theophilus Apol.', '2391': 'Hippostratus Hist.', '0446': 'Dioxippus Comic.', '2650': 'Arrianus Epic.', '2371': 'Chronicon Paschale', '2657': 'Martyrium Ignatii', '0673': 'Aeschines Socraticus Phil.', '4290': 'Lexicon Artis Grammaticae', '1527': 'Nepualius Med. et Phil.', '2109': 'Pseudo-Macarius Scr. Eccl.', '2571': 'Hierocles Phil.', '1149': 'Antonini Pii Imperatoris Epistula', '0252': 'Hermippus Comic.', '1227': 'Blaesus Comic.', '0726': 'Palladius Med.', '1836': 'Anonymi Aulodia', '1324': 'Dionysius Hist.', '0562': 'Marcus Aurelius Antoninus Imperator Phil.', '4339': 'Archelaus Alchem. et Poeta', '0644': 'Aristophanes Gramm.', '1351': 'Epigoni', '4032': 'Anonymi In Aristotelis Librum Primum Analyticorum Posteriorum Commentarium', '4018': 'Asclepius Phil.', '1843': 'Nicomachus Trag.', '0558': 'Hellenica', '1163': 'Claudius Apollinarius Apol.', '2482': 'Daimachus Hist.', '2397': 'Boethus Phil.', '9009': 'Michael Apostolius Paroemiogr.', '0303': 'Phrynichus Trag.', '1219': 'Bato Hist. et Rhet.', '0647': 'Triphiodorus Epic. et Gramm.', '2547': 'Antigonus', '5004': 'Epimerismi', '1354': 'Ergias Hist.', '1760': 'Gaius Suetonius Tranquillus Gramm. et Hist.', '0721': 'Anonymi Medici Med.', '1172': 'Arcesilaus Phil.', '4287': 'Etymologia Alphabeti', '0399': 'Eudoxus Comic.', '0062': 'Lucianus Soph.', '1489': 'Megasthenes Hist.', '4303': 'Lexica In Opera Gregorii Nazianzeni', '2956': 'Sextus Julius Africanus Hist.', '2894': 'Constitutiones Apostolorum', '0638': 'Flavius Philostratus Soph.', '0040': 'Calani Epistula', '0291': 'Alcman Lyr.', '0337': 'Python Trag.', '0492': 'Philonides Comic.', '1846': 'Spintharus Trag.', '0077': 'Periplus Maris Magni', '1923': 'Stesimbrotus Hist.', '2063': 'Gregorius Thaumaturgus Scr. Eccl.', '0635': 'Zeno Phil.', '0417': 'Archippus Comic.', '0695': 'Alcimus Hist.', '1752': 'Xenagoras Geogr. et Hist.', '0346': 'Pompeius Macer [Trag.]', '0509': '[Myia] Phil.', '0398': 'Simylus Comic.', '1194': 'Aristonicus Gramm.', '0257': 'Philiscus Rhet.', '0324': 'Patrocles Trag.', '3139': 'Laonicus Chalcocondyles Hist.', '2703': 'Anna Comnena Hist.', '5009': 'Scholia In Aeschinem', '0313': 'Theognis Trag.', '2237': 'Theodorus Math.', '2277': 'Hypermenes Hist.', '4171': 'Anonymi In Oppiani Opera', '0547': 'Anaximenes Hist. et Rhet.', '2995': 'Orus Gramm.', '2331': 'Myrsilus Hist.', '4346': 'Menecrates Hist.', '4374': 'Anonymi De Astrologia Dialogus Astrol.', '5030': 'Scholia In Lycophronem', '0751': 'Pseudo-Hippocrates Med.', '2644': 'Sminthes Astron.', '1321': 'Diogenes Phil.', '1833': 'Pratinas Trag.', '0525': 'Pausanias Perieg.', '1890': 'Moderatus Phil.', '2051': 'Himerius Soph.', '1805': 'Vitae Homeri', '1439': 'Hermarchus Phil.', '2307': 'Artemon Hist.', '0368': 'Cydias Lyr.', '0582': 'Paradoxographus Vaticanus', '1123': 'Andron Hist.', '2970': 'Severus Phil.', '2236': 'Eutropius Hist.', '0458': 'Eubulus Comic.', '0042': 'Alexandri Magni Epistulae', '1907': 'Cratippus Hist.', '0201': 'Isyllus Lyr.', '0404': 'Amphis Comic.', '4174': 'Paraphrases In Dionysium Periegetam', '1587': 'Philiades Eleg.', '0319': 'Critias Eleg., Phil. et Trag.', '1596': 'Philolaus Phil.', '2011': 'Martyrium Agapae, Irenae, Chionae Et Sodalium', '4324': 'Synesius Alchem.', '0730': 'Meletius Med.', '0022': 'Nicander Epic.', '1801': 'Parodica Anonyma', '5045': 'Anonymi In Aphthonium Rhet.', '1260': '[Chersias] Epic.', '1257': 'Charinus Choliamb.', '2696': 'Theodorus Poeta', '1693': 'Sphaerus Phil.', '1204': 'Athenaeus Mech.', '3143': 'Georgius Sphrantzes Hist.', '3100': 'Nicolaus I Mysticus Theol. et Epist.', '0633': '[Lysis] Phil.', '2216': 'Aristippus Hist.', '0545': 'Claudius Aelianus Soph.', '1237': '[Callicratidas] Phil.', '1436': '[Hippodamus] Phil.', '1726': 'Theopompus Epic.', '0540': 'Lysias Orat.', '1241': 'Carmen Naupactium', '9008': 'Macarius Chrysocephalus Paroemiogr.', '1627': 'Polycrates Hist.', '0571': 'Aristocles Paradox.', '0473': 'Machon Comic.', '2182': 'Staphylus Hist.', '1361': 'Eumedes Comic.', '4237': 'Joannes Argyropulus Gramm.', '4301': 'Lexicon Rhetoricum Cantabrigiense', '0256': 'Panarces Scriptor Aenigmatum', '1604': 'Phocylides Eleg. et Gnom.', '1797': 'Choliambica Adespota (ALG)', '1746': 'Valentinus Gnost.', '0074': 'Flavius Arrianus Hist. et Phil.', '1785': 'Paramonus Comic.', '2002': 'Anonymus Seguerianus Rhet.', '4338': 'Theophrastus Alchem. et Poeta', '2654': 'Physiologus', '0039': 'Mithridatis Epistula', '0500': 'Posidippus Comic.', '2173': 'Antileon Hist.', '0390': 'Martyrium Carpi, Papyli Et Agathonicae', '4326': 'Pappus Alchem.', '1978': 'Leo Hist.', '2148': 'Aristodemus Hist.', '1463': 'Liber Enoch', '2313': 'Antisthenes Phil.', '1228': '[Boeo] Epic.', '2061': 'Asterius Sophista Scr. Eccl.', '4390': 'Democles Hist.', '1602': 'Philoxenus Gramm.', '4292': 'Lexicon De Atticis Nominibus', '1545': 'Ocellus Phil.', '2055': 'Serenus Geom.', '3156': 'Anonymi Exegesis In Hesiodi Theogoniam', '2968': 'Monimus Phil.', '1212': 'Atridarum Reditus', '0241': 'Aristoxenus [Comic.]', '0043': 'Amasis Epistulae', '1511': 'Mimnermus Trag.', '0031': 'Novum Testamentum, New Testament', '2949': 'Acta Barnabae', '2053': 'Paulus Astrol.', '0388': 'Acta Pauli', '4036': 'Proclus Phil.', '1584': 'Pherecydes Hist.', '0889': 'Timesitheus Trag.', '0661': 'Archigenes Med.', '1783': 'Callicrates Comic.', '2022': 'Gregorius Nazianzenus Theol.', '2019': 'Pelagius Alchem.', '0317': 'Acta Joannis', '0092': 'Anonymi Geographiae Expositio Compendiaria', '0687': 'Agaclytus Hist.', '5026': 'Scholia In Homerum', '4236': 'Trophonius Rhet. et Soph.', '1868': 'Damastes Hist.', '1368': 'Evangelium Ebionitum', '0511': 'Theognetus Comic.', '4097': 'Etymologicum Genuinum', '1338': 'Dosiadas Hist.', '0693': 'Albinus Phil.', '2946': 'Priscus Hist. et Rhet.', '0483': 'Nicophon Comic.', '0097': 'Diogenianus Gramm.', '0508': 'Strattis Comic.', '2247': 'Petron Phil.', '2314': 'Diogenes Phil.', '2158': 'Eutychianus Hist.', '2892': 'Maximus Confessor Theol.', '2384': 'Hermias Hist.', '1390': 'Hecataeus Hist.', '1555': 'Pancrates Epic.', '9022': 'Joannes Tzetzes Gramm. et Poeta', '0059': 'Plato Phil.', '1795': 'Chaerion Comic.', '2546': 'Publius Rutilius Rufus Hist.', '2015': 'Testamentum XL Martyrum', '2001': 'Themistius Phil. et Rhet.', '9006': 'Gregorius Paroemiogr.', '0066': 'Dicaearchus Phil.', '3181': 'Nicephorus II Phocas Imperator Tact.', '1566': 'Parmeno Iamb.', '2945': 'Gnomologium Vaticanum', '4149': 'Sophronius Gramm.', '2000': 'Plotinus Phil.', '0279': 'Discipulorum Cantiuncula', '0445': 'Dionysius Comic.', '2157': 'Magnus Hist.', '1648': 'Pyrgion Hist.', '4017': 'Syrianus Phil.', '0615': 'Aspasius Phil.', '1521': 'Vita Et Sententiae Secundi', '1782': 'Augeas Comic.', '3039': 'Joannes Galenus Gramm.', '0234': 'Elegiaca Adespota (IEG)', '2618': 'Didymarchus Poeta', '0555': 'Clemens Alexandrinus Theol.', '1633': 'Praxiteles [Epigr.]', '1179': '[Arimnestus] Phil.', '1320': 'Diogenes Phil.', '0401': 'Alexander Comic.', '1136': 'Anonymus Presbyter Scr. Eccl.', '0344': 'Melanthius Trag.', '1970': 'Silenus Hist.', '2115': 'Hippolytus Scr. Eccl.', '4395': 'Menetor Hist.', '4193': 'Anonymi In Aristotelis Sophisticos Elenchos Phil.', '1242': 'Canon Librorum', '1867': 'Crito Hist.', '2533': 'Timolaus Hist.', '2333': 'Possis Hist.', '1174': 'Archemachus Hist.', '2412': 'Androetas Hist.', '1551': 'Oracula Sibyllina', '0442': 'Dexicrates Comic.', '0465': 'Heniochus Comic.', '1311': 'Didache XII Apostolorum', '2020': 'Theodosius Gramm.', '0353': '[Sclerias] Trag.', '0420': 'Aristonymus Comic.', '0825': 'Melito Trag.', '1792': 'Biottus Comic.', '0240': 'Hermolochus Lyr.', '2187': 'Posidonius Hist.', '1344': 'Epica Adespota (CA)', '0514': 'Thugenides Comic.', '0489': 'Philetaerus Comic.', '0348': 'Biotus Trag.', '0451': 'Epicrates Comic.', '1369': 'Evangelium Mariae', '0506': 'Stephanus Comic.', '1406': 'Heraclides Hist.', '4337': 'Heliodorus Alchem. et Poeta', '2587': 'Ariston Phil.', '3142': 'Georgius Pachymeres Hist.', '1171': 'Apollonius Scr. Eccl.', '5039': 'Scholia In Thucydidem', '0485': 'Ophelio Comic.', '2317': 'Hermias Phil.', '1157': 'Apocalypsis Esdrae', '2615': 'Daphitas Gramm. vel Soph.', '0554': 'Chariton Scr. Erot.', '2219': 'Amelesagoras Hist.', '0250': 'Euclides Comic. vel Iamb.', '0488': 'Philemon Junior Comic.', '2762': 'Gennadius I Scr. Eccl.', '0533': 'Callimachus Philol.', '0209': 'Seleucus Lyr.', '0383': 'Alcaeus Lyr.', '0696': 'Alcmaeonis', '2681': 'Diodorus Phil.', '0298': 'Eumelus Epic.', '1274': 'Cleobulus Epigr. et Lyr.', '1329': 'Dionysius Scr. Eccl.', '0505': 'Sotades Comic.', '1231': '[Bryson] Phil.', '0522': 'Pisander Epic.', '2021': 'Epiphanius Scr. Eccl.', '1523': 'Myron Hist.', '1188': 'Aristocles Phil.', '1259': '[Charondas Nomographus] [Phil.]', '4302': 'Lexicon Patmense', '5013': 'Scholia In Aratum', '0469': 'Laon Comic.', '1362': '[Eurytus] Phil.', '2228': 'Menestor Phil.', '1186': 'Aristobulus Judaeus Phil.', '0374': 'Licymnius Lyr.', '2638': 'Philo Poeta', '0396': 'Euphanes Comic.', '1391': 'Hegemon Epic.', '2466': 'Dionysius Hist.', '2127': 'Troilus Soph.', '4361': 'Apomasar Astrol.', '5034': 'Scholia In Pindarum', '0014': 'Demosthenes Orat.', '2049': 'Sallustius Phil.', '1815': 'Sappho et Alcaeus Lyr.', '1546': 'Oechaliae Halosis', '2040': 'Basilius Theol.', '3027': 'Joannes Doxapatres Rhet.', '0698': 'Alexander Rhet.', '1766': 'Tatianus Apol.', '0561': 'Longus Scr. Erot.', '4311': 'Etymologicum Symeonis', '1835': 'Agroetas Hist.', '2042': 'Origenes Theol.', '0369': 'Telesilla Lyr.', '1643': 'Ptolemaeus Gramm.', '0232': 'Archilochus Eleg. et Iamb.', '4099': 'Etymologicum Magnum', '4016': 'Ammonius Phil.', '4034': 'Michael Phil.', '0750': 'Heliodorus Trag.', '0616': 'Polyaenus Rhet.', '4201': 'Joannes Chortasmenus Phil.', '2548': 'Promathion Hist.', '0601': '[Zaleucus Nomographus] [Phil.]', '1121': 'Anaximenis Milesii Epistulae', '3063': 'Joannes Scylitzes Hist.', '1599': 'Philo Mech.', '2282': 'Melisseus Hist.', '1229': '[Boeus] Epic.', '1626': 'Polycrates Scr. Eccl.', '1156': 'Apocalypsis Eliae', '2010': 'Martyrium Dasii', '4340': 'Salmanas Alchem.', '0263': 'Solon Nomographus et Poeta', '0343': 'Ezechiel Trag.', '1381': 'Fragmentum Synodicae Epistulae Concilii Caesariensis', '2234': 'Oenopides Phil.', '2608': 'Archebulus Poeta', '4334': '[Isis Prophetissa] Alchem.', '4076': 'Menander Protector Hist.', '0009': 'Sappho Lyr.', '0244': 'Cleobulina Scriptor Aenigmatum', '2621': 'Diophilus vel Diophila Poeta', '0493': 'Philostephanus Comic.', '2162': 'Aratus Hist.', '0325': 'Astydamas Trag.', '0019': 'Aristophanes Comic.', '0266': 'Tyrtaeus Eleg.', '1949': 'Potamon Hist.', '2116': 'Arcadius Gramm.', '0690': 'Erasistratus Med.', '1326': 'Dionysius Epic.', '1698': 'Telephus Gramm.', '1507': '[Metopus] Phil.', '0233': 'Hipponax Iamb.', '4170': 'Vitae Pindari Et Varia De Pindaro', '2027': 'Valerius Apsines Rhet.', '0603': 'Silenus Trag.', '5016': 'Scholia In Callimachum', '5028': 'Scholia In Isocratem', '0649': 'Lesbonax Rhet.', '1141': 'Antimachus Epic.', '1736': 'Timonax Hist.', '2770': 'Callinicus Biogr.', '0443': 'Diocles Comic.', '1386': 'Historia Alexandri Magni', '1771': 'Montanus et Montanistae Theol.', '4392': 'Joannes Epiphaniensis Hist.', '4000': 'Aristaenetus Epist.', '2194': '[Aristides] Hist.', '3070': 'Symeon Logothetes Hist.', '3045': 'Georgius Syncellus Chronogr.', '2555': 'Agesilaus Hist.', '0083': 'Dionysius Geogr.', '0660': 'Apollonius Med.', '2455': 'Aristocreon Hist.', '1256': 'Chares Gnom.', '5021': 'Scholia In Diophantum', '1332': '[Diotogenes] Phil.', '0275': 'Peirazomene', '1372': 'Evangelium Evae', '5003': 'Erotica Adespota', '1296': 'Cypria', '0703': 'Numenius Poet. Didac.', '1232': '[Butherus] Phil.', '2007': 'Martyrium Potamiaenae Et Basilidis', '0604': 'Ptolemaeus IV Philopator Trag.', '3043': 'Georgius Monachus Chronogr.', '5008': 'Scholia In Aelium Aristidem', '4335': 'Cleopatra Alchem.', '2800': 'Basilius Scr. Eccl.', '2635': 'Persinus Poeta', '0478': 'Nausicrates Comic.', '1953': 'Hieronymus Hist.', '0326': 'Sophocles Junior Trag.', '2816': 'Joannes Gramm. et Theol.', '1691': 'Sotades Iamb.', '1569': 'Pausanias Attic.', '1343': 'Eparchides Hist.', '2153': 'Bion Math. et Phil.', '1490': '[Megillus] Phil.', '0332': 'Cleaenetus Trag.', '1568': 'Parthax Hist.', '0429': 'Cephisodorus Comic.', '1729': 'Thrasymachus Rhet. et Soph.', '2396': 'Hyperochus Hist.', '1430': 'Hieronymus Phil.', '0336': 'Crates Poet. Phil.', '1096': 'Euaretus Trag.', '1216': 'Barnabae Epistula', '1757': 'Julius Epic.', '0312': 'Philocles Trag.', '1574': 'Persaeus Phil.', '9004': 'Anonymi In Aristotelis Librum Alterum Analyticorum Posteriorum Commentarium', '1969': 'Philinus Hist.', '2357': 'Gorgon Hist.', '1411': 'Heracliti Ephesii Epistulae', '1402': 'Hephaestion Gramm.', '2865': 'Olympiodorus Diaconus Scr. Eccl.', '2330': 'Scamon Hist.', '0421': 'Aristophon Comic.', '0515': 'Timocles Comic.', '1786': 'Sogenes Comic.', '4327': 'Joannes Archiereus Alchem.', '2239': 'Pythagoristae (D-K) Phil.', '1327': 'Dionis Epistulae', '4003': 'Marcianus Geogr.', '0205': 'Philodamus Lyr.', '2328': 'Diogenes Hist.', '2474': 'Nicander Hist.', '1371': 'Evangelium Petri', '1132': 'Anonymus Alexandri Phil.', '0044': 'Antiochi Regis Epistulae', '2647': 'Zenothemis Geogr.', '0307': 'Neophron Trag.', '0345': 'Apollonides Trag.', '2742': 'Apophthegmata', '2058': 'Philostorgius Scr. Eccl.', '0058': 'Aeneas Tact.', '2059': 'Alexander Theol.', '2475': 'Menecrates Hist.', '2346': 'Andriscus Hist.', '1270': 'Clearchus Phil.', '1486': 'Matron Parodius', '0749': 'Antyllus Med.', '0254': 'Melanthius Eleg. et Trag.', '1263': 'Choerilus Epic.', '2227': 'Paron Phil.', '0724': 'Stephanus Med. et Phil.', '0481': 'Nicolaus Comic.', '1544': 'Nymphis Hist.', '5022': 'Scholia In Euclidem', '0971': 'Oeniades Lyr.', '0038': 'Arcesilai Epistula', '0624': 'Demetrius Hist. et Phil.', '2611': 'Butas Eleg.', '1450': 'Ister Hist.', '2609': 'Asopodorus Iamb.', '4396': 'Timagetus Hist.', '0447': 'Diphilus Comic.', '0456': 'Euangelus Comic.', '0713': 'Anaxagoras Phil.', '4040': 'Photius Lexicogr., Scr. Eccl. et Theol.', '2270': 'Callippus Hist.', '2589': 'Olympiodorus Alchem.', '0648': 'Onasander Tact.', '0295': 'Carmina Popularia (PMG)', '2322': 'Antenor Hist.', '1224': 'Bion Phil.', '2383': 'Diodorus Phil.', '2387': 'Athanis Hist.', '2117': 'Anonymus De Metrorum Ratione', '2226': 'Iccus Phil.', '3047': 'Michael Glycas Astrol. et Hist.', '4019': 'Olympiodorus Phil.', '0090': 'Agathemerus Geogr.', '0605': 'Polybius Rhet.', '0733': 'Cassius Iatrosophista Med.', '0028': 'Antiphon Orat.', '0564': 'Rufus Med.', '0551': 'Appianus Hist.', '2605': 'Agamestor Eleg.', '0288': 'Pisander Epic.', '0315': 'Sthenelus Trag.', '1632': 'Posidippus Epigr.', '1845': 'Callistratus Trag.', '0752': 'Eutecnius Soph.', '2345': 'Agl(a)osthenes Hist.', '3075': 'Pseudo-Mauricius Tact.', '1713': 'Themison Hist.', '1374': 'Evangelium Secundum Hebraeos', '0538': 'Hecataeus Hist.', '2655': '[Damigeron Magus]', '0045': 'Artaxerxis Epistulae', '2031': 'Sopater Rhet.', '0876': 'Phrynichus II Trag.', '0490': 'Philippides Comic.', '4037': 'Anonymi Paradoxographi', '0203': 'Limenius Lyr.', '4029': 'Procopius Hist.', '1728': 'Theseus Hist.', '0556': 'Asclepiodotus Tact.', '1679': 'Socrates Hist.', '3173': 'Joannes Theol.', '2230': 'Boïdas Phil.', '1483': 'Martyrium Et Ascensio Isaiae', '2118': 'Gryllus', '0088': 'Aristoxenus Mus.', '1269': 'Cleanthes Phil.', '0521': 'Epicharmus Comic. et Pseudepicharmea', '2971': 'Georgius Peccator Poeta', '1211': 'Balagrus Hist.', '0716': 'Erotianus Gramm. et Med.', '4139': 'Severianus Scr. Eccl.', '5017': 'Scholia In Demosthenem', '1498': 'Menander Hist.', '0054': '[Theano] Phil.', '0364': 'Danaïs vel Danaïdes', '0544': 'Sextus Empiricus Phil.', '4147': 'Florilegium Cyrillianum', '0536': 'Ephorus Hist.', '0386': 'Chilonis Epistula', '0516': 'Timostratus Comic.', '0339': 'Moschion Trag.', '2617': 'Demetrius Poeta', '0067': 'Agatharchides Geogr.', '1754': 'Xenophontis Epistulae', '0457': 'Eubulides Comic.', '1148': 'Antonius Diogenes Scr. Erot.', '4397': 'Myronianus Hist.', '0282': 'Anonymus De Viribus Herbarum', '1541': 'Nostoi', '1094': 'Theodorides Trag.', '0592': 'Hermogenes Rhet.', '1475': 'Maiistas Epic.', '0602': 'Comica Adespota (FCG)', '1432': '[Hipparchus] Phil.', '1305': 'Democritus Hist.', '0833': 'Anaxion Trag.', '0472': 'Lysippus Comic.', '2029': 'Anonymi Geographia In Sphaera Intelligenda', '0283': 'Heraclides Ponticus Junior Gramm.', '1625': 'Polyclitus Phil.', '4166': 'Vitae Aeschinis', '3023': 'Constantinus VII Porphyrogenitus Imperator Hist.', '1364': 'Evangelium Aegyptium', '0125': 'Zenonis Epistula', '4021': 'David Phil.', '1146': 'Antipater Phil.', '0466': 'Heraclides Comic.', '1360': '[Euryphamus] Phil.', '1387': '(H)agias-Dercylus Hist.', '1688': 'Sostratus Gramm.', '4094': 'Choricius Rhet. et Soph.', '1702': 'Testamentum Jobi', '0579': 'Orphica', '0001': 'Apollonius Rhodius Epic.', '0462': 'Euthycles Comic.', '0455': 'Eriphus Comic.', '1611': 'Tyrannion Junior Gramm.', '0572': 'Gaius Scr. Eccl.', '4096': 'Dositheus Magister Gramm.', '0496': 'Phrynichus Comic.', '0422': 'Athenio Comic.', '0261': 'Simonides Lyr.', '4300': 'Lexicon Sabbaiticum', '2679': 'Testamentum Salomonis', '1277': '[Clinias] Phil.', '0666': 'Adrianus Rhet. et Soph.', '2583': 'Manetho Astrol.', '2641': 'Priscus Epic.', '0370': 'Lamprocles Lyr.', '1839': 'Polyphrasmon Trag.', '1124': 'Andronicus Rhodius Phil.', '2542': 'Quintus Fabius Pictor Hist.', '2680': 'Scythinus Epigr.', '0523': 'Menecrates Comic.', '4242': 'Cyrus Rhet.', '1431': 'Hipparchus Astron. et Geogr.', '0204': 'Aristonous Lyr.', '0720': 'Harmodius Trag.', '7051': 'Doctrina Patrum', '4082': 'Musaeus Grammaticus Epic.', '0056': 'Thrasybuli Epistula', '0746': 'Theophilus Protospatharius et Stephanus Atheniensis Med.', '1840': 'Euripides II Trag.', '2531': 'Metrophanes Hist.', '0541': 'Menander Comic.', '3145': 'Joannes Anagnostes Hist. et Poeta', '0449': 'Ecphantides Comic.', '1945': 'Antigenes Hist.', '3168': 'Pseudo-Codinus Hist.', '1358': 'Eudoxus Astron.', '1298': 'Demetrii Phalerei Epistula', '1180': '[Aristaeus] Phil.', '1524': 'Naumachius Epic.', '4184': 'Dionysius Soph.', '0631': 'Pittacus [Lyr.]', '0273': 'Scolia Alphabetica', '0212': 'Philetas Eleg. et Gramm.', '5014': 'Scholia In Aristophanem', '0392': 'Acusilaus Hist.', '9012': 'Ignatius Biogr. et Poeta', '2217': 'Nicias Hist.', '0034': 'Lycurgus Orat.', '1488': 'Maximus Theol.', '1464': 'Liber Jubilaeorum', '1787': '[Menippus] Comic.', '1735': 'Timon Phil.', '4394': 'Joannes Antiochenus Hist.', '0012': 'Homerus Epic., Homer', '0264': 'Susarion Comic.', '2598': 'Procopius Rhet. et Scr. Eccl.', '2274': 'Hesychius Illustrius Hist.', '0096': 'Aesopus Scr. Fab. et Aesopica', '1976': 'Metrodorus Hist.', '2291': 'Cratylus Phil.', '0394': 'Apollonius Comic.', '0341': 'Lycophron Trag.', '0718': 'Aëtius Med.', '0691': 'Harpocrationis Epistula', '0688': 'Agathocles Hist.', '1286': 'Corpus Hermeticum', '1799': 'Euclides Geom.', '0416': 'Archedicus Comic.', '0290': 'Encomium Ducis Thebaidos', '2062': 'Joannes Chrysostomus Scr. Eccl., John Chrysostom', '2336': 'Hereas Hist.', '0239': 'Antimachus Eleg. et Epic.', '1811': 'Metrodorus Major Phil.', '0377': 'Telestes Lyr.', '4039': 'Paulus Silentiarius Poeta', '1676': 'Simylus Iamb.', '1981': 'Theophanes Hist.', '1485': 'Martyrium Ptolemaei Et Lucii', '0502': 'Sophilus Comic.', '1506': 'Menodotus Hist.', '0426': 'Callias Comic.', '3130': 'Theophylactus Simocatta Epist. et Hist.', '0734': '[Lucas Apostolus] Med.', '0497': 'Plato Comic.', '0460': 'Euphro Comic.', '1664': 'Seniores Alexandrini Scr. Eccl.', '1583': 'Phanodemus Hist.', '4165': 'Anonymi In Aristotelis Librum De Interpretatione Phil.', '0499': 'Polyzelus Comic.', '2025': 'Maximus Rhet.', '2355': 'Xeniades Soph.', '0334': 'Diogenes Phil. et Trag.', '2205': 'Autesion Hist.', '4091': 'Callistratus Soph.', '0453': 'Epilycus Comic.', '0643': 'Anonymus Londinensis Med.', '3120': 'Patria Constantinopoleos', '0981': 'Stesichorus II Lyr.', '1549': '[Onatas] Phil.', '0338': 'Sosiphanes Trag.', '2972': 'Anonymi De Terrae Motibus', '1302': 'Demetrius Rhet.', '0046': 'Niciae Epistula', '1328': 'Dionysius Hist.', '1365': 'Melampus Scriptor De Divinatione', '2218': 'Calliphon et Democedes Med. et Phil.', '4304': 'Glossae In Herodotum', '0360': 'Armenidas Hist.', '3002': 'Prolegomena De Comoedia', '2557': '[Aristobulus] Hist.', '2030': 'Geographica Adespota (GGM)', '0744': 'Alexander Med.', '1750': 'Vitae Prophetarum', '0543': 'Polybius Hist.', '1607': 'Phoronis', '4072': 'Eutocius Math.', '1977': 'Lucius Licinius Lucullus Hist.', '1276': 'Clidemus Hist.', '1941': 'Leo Hist.', '4325': '[Hermes] Alchem.', '2458': 'Marcellus Hist.', '2294': 'Zeno Phil.', '0653': 'Aratus Astron. et Epic.', '0482': 'Nicomachus Comic.', '4332': 'Hierotheus Alchem. et Poeta', '1414': 'Heraclitus Phil.', '0727': 'Joannes Med.', '0598': 'Rhetorica Anonyma', '1203': 'Paeanes (CA)', '1505': 'Menesthenes Hist.', '4028': 'Stephanus Gramm.', '2645': 'Stratonicus Poeta', '1665': 'Seniores Apud Irenaeum Scr. Eccl.', '0349': 'Demonax [Trag.]', '1670': 'Serapion Scr. Eccl.', '1398': 'Hegesippus Scr. Eccl.', '0412': 'Apollodorus Carystius vel Apollodorus Gelous Comic.', '2160': 'Pyrrhus Hist.', '9021': 'Stephanus Alchem.', '1530': 'Nicanor Gramm.', '0397': 'Pronomus Lyr.', '2181': 'Moses Alchem.', '2697': 'Timolaus Rhet.', '2560': 'Pythocles Hist.', '1083': 'Isigonus Paradox.', '1315': 'Dinolochus Comic.', '1389': 'Harpocration Gramm.', '2456': 'Nessas Phil.', '1515': 'Moeris Attic.', '2032': 'Pappus Math.', '0027': 'Andocides Orat.', '2937': 'Lachares Soph.', '0900': 'Cleomenes Lyr.', '0549': 'Apollodorus Gramm.', '2423': 'Asclepiades Gramm. et Hist.', '1732': 'Timachidas Hist.', '1734': 'Timaeus Phil.', '2539': 'Diophantus Hist.', '2192': '[Agatharchides] Hist.', '5037': 'Scholia In Sophoclem', '2225': 'Parm(en)iscus Phil.', '0297': 'Lyrica Adespota (PMG)', '0646': 'Pseudo-Justinus Martyr', '4347': 'Andron Hist.', '1004': 'Thessalus Astrol. et Med.', '1310': 'Dictys Hist.', '1303': 'Demochares Hist. et Orat.', '0098': 'Zenobius Sophista [Paroemiogr.]', '0198': 'Hedylus Epigr.', '1821': 'Iambica Adespota (ALG)', '2568': '[Sosthenes] Hist.', '0606': 'Rufus Soph.', '2714': 'Theodorus Studites Scr. Eccl. et Theol.', '1325': 'Diogenis Sinopensis Epistulae', '4105': 'Julianus Scr. Eccl.', '1349': 'Epistula A Martyribus Lugdunensibus', '1832': 'Acesander Hist.', '0498': 'Poliochus Comic.', '1476': 'Mamercus Eleg.', '2006': 'Synesius Phil.', '0249': 'Echembrotus Eleg. et Lyr.', '1637': 'Protevangelium Jacobi', '3169': 'Joannes VI Cantacuzenus', '2642': '[Astrampsychus Magus] Onir.', '0340': 'Sositheus Trag.', '2048': 'Salaminius Hermias Sozomenus Scr. Eccl.', '1812': 'Demaratus Hist.', '2807': 'Antonius Hagiographus Scr. Eccl.', '1491': 'Melanthius Hist.', '0331': '[Polyidus] Trag.', '2215': 'Ar(i)aethus Hist.', '4391': 'Glaucus Hist.', '1479': 'Marci Aurelii Epistula', '1427': 'Herodorus Hist.', '1508': 'Metrodorus Phil.', '3136': 'Pseudo-Zonaras Lexicogr.', '2169': 'Herillus Phil.', '2729': 'Prorus Phil.', '1281': '[Clitophon] Hist.', '1289': 'Crates Hist.', '0041': 'Chionis Epistulae', '0418': 'Aristagoras Comic.', '2594': 'Phillis Hist.', '1451': 'Josephus Et Aseneth', '0237': 'Anacreon Lyr.', '1308': 'Demosthenes Epic.', '2636': 'Pherenicus Epic.', '0301': 'Thespis Trag.', '0082': 'Apollonius Dyscolus Gramm.', '0127': 'Aulus Licinius Archias Epigr.', '0260': 'Semonides Eleg. et Iamb.', '0484': 'Nicostratus Comic.', '0513': 'Theopompus Comic.', '1447': 'Irenaeus Theol.', '1247': '[Cebes] Phil.', '0230': 'Lyrica Adespota (CA)', '0286': 'Carmen Astrologicum', '4089': 'Theodoretus Scr. Eccl. et Theol.', '1813': 'Anonymus De Plantis Aegyptiis', '0477': 'Myrtilus Comic.', '1794': 'Philocles Comic.', '3094': 'Nicetas Choniates Hist., Scr. Eccl. et Rhet.', '0581': 'Paradoxographus Palatinus', '2278': 'Phanodicus Hist.', '1239': 'Domitius Callistratus Hist.', '0053': 'Phalaridis Epistulae', '0272': 'De Arboribus Avibusque Fabulae', '0657': 'Crateuas Med.', '1775': 'Pseudo-Agathon Epigr.', '0371': 'Diagoras Lyr.', '2240': 'Hicetas Phil.', '1383': 'Geminus Astron.', '1165': 'Apollodorus Mech.', '1606': 'Phoenix Iamb.', '4005': 'Anonymus Discipulus Isidori Milesii Mech.', '2189': 'Callinicus Soph.', '2233': 'Pseudo-Polemon', '0655': 'Parthenius Myth.', '2625': 'Herodicus Gramm.', '1814': 'Ptolemais Phil.', '1133': 'Anonymus Diodori Phil.', '2133': 'Achilles Tatius Astron.', '1301': 'Demetrius Poet. Phil.', '0197': 'Hedyle Epigr.', '0071': 'Periplus Maris Erythraei', '0289': 'Ammonius Epigr.', '4150': 'Anacreontea', '1285': 'Conon Hist.', '3177': 'Scriptor Incertus De Leone Armenio Hist.', '1275': 'Cleostratus Poet. Phil.', '1297': 'Damippus Phil.', '2601': 'Tiberius Rhet.', '2241': 'Xenophilus Mus. et Phil.', '1685': 'Sosibius Gramm.', '0450': 'Ephippus Comic.', '5010': 'Scholia In Aeschylum', '2235': 'Hippocrates Math.', '1577': 'Phaedimus Epigr.', '1802': 'Homerica', '2367': 'Theognis Hist.', '1282': 'Clytus Hist.', '5032': 'Scholia In Oppianum', '0611': 'Theodorus Trag.', '1682': 'Sopater Comic.', '1788': 'Phormis Comic.', '1125': 'Androtion Hist.', '1649': 'Pythaenetus Hist.', '1662': 'Sciras Comic.', '2151': 'Praxagoras Hist.', '3015': 'Joannes Cameniates Hist.', '1675': 'Simylus Eleg.', '0441': 'Demonicus Comic.', '2255': 'Gorgias Hist.', '2246': 'Lycon Phil.', '1912': 'Euphantus Phil.', '2229': 'Xuthus Phil.', '4329': 'Philosophus Anonymus Alchem.', '4014': 'Priscianus Phil.', '0593': 'Gorgias Rhet. et Soph.', '2334': 'Nausiphanes Phil.', '1322': 'Diogenianus Phil.', '0294': 'Corinna Lyr.', '0008': 'Athenaeus Soph.', '0199': 'Bacchylides Lyr.', '0548': 'Pseudo-Apollodorus Myth.', '1687': 'Sosicrates Hist.', '2532': '[Hermesianax] Hist.', '0049': 'Pisistrati Epistula', '0531': 'Hermias Apol.', '1727': 'Theotimus Hist.', '3146': 'Ducas Hist.', '2620': 'Dionysius Iambus Gramm. et Poeta', '5048': 'Scholia In Clementem Alexandrinum', '2967': 'Theodorus Heracleensis vel Theodorus Mopsuestenus Scr. Eccl.', '1710': '[Theages] Phil.', '3079': 'Michael Attaliates Hist.', '2701': 'Georgius Pisides Poeta', '0619': 'Apollonius Phil.', '1816': 'Epica Adespota (GDRK)', '2556': '[Alexarchus] Hist.', '1319': 'Diogenes Phil.', '1352': 'Epistula Ecclesiarum Apud Lugdunum Et Viennam', '1399': 'Pamphilus Trag.', '2196': '[Dercyllus] Hist.', '0361': 'Cleonides Mus.', '2592': 'Joannes Pediasimus Philol. et Rhet.', '1382': 'Fragmentum Teliambicum', '1567': 'Parrhasius Epigr.', '1590': 'Philippus Hist.', '0618': 'Antigoni Epistula', '1667': '[Septem Sapientes] Phil.', '1138': 'Lycon Phil.', '3128': 'Theognostus Gramm.', '0243': 'Callinus Eleg.', '1595': 'Philodemus Phil.', '1753': 'Xenion Hist.', '3147': 'Michael Critobulus Hist.', '1441': 'Iamblichus Scr. Erot.', '1143': 'Antiochus Phil.', '1556': 'Pancrates Epigr.', '2585': 'Marcellinus Biogr.', '0586': 'Polemon Perieg.', '2610': 'Boiscus Iamb.', '1318': 'Diodorus Rhet.', '1663': 'Semus Gramm.', '0211': 'Simias Gramm.', '0051': '[Melissa] Phil.', '0430': 'Chariclides Comic.', '1911': 'Diyllus Hist.', '3155': 'Joannes Protospatharius Gramm.', '4333': 'Nicephorus Blemmydes Alchem.', '1500': 'Menecrates Poet. Phil.', '3157': 'Theodorus Scutariota Hist.', '1896': '[Dositheus] Hist.', '1287': 'Crantor Phil.', '1800': 'Euboeus Parodius', '0723': 'Leo Phil.', '3178': 'Anonymi Lexeis Rhetoricae', '1323': 'Aelius Dionysius Attic.', '0578': 'Nymphodorus Hist.', '2074': 'Apollinaris Theol.', '1737': 'Titanomachia', '2623': 'Euanthes Epic.', '2036': 'Dexippus Phil.', '4345': 'Menecrates Hist.', '0717': 'Hypsicles Astron. et Math.', '1803': 'Bruti Epistulae', '2738': 'Chronographiae Anonymae', '4163': 'Telegonia', '2111': 'Palladius Scr. Eccl.', '0023': 'Oppianus Epic.', '2041': 'Marcellus Theol.', '2499': 'Eustochius Soph.', '0574': 'Lysimachus Hist.', '1638': 'Proxenus Hist.', '0089': 'Praxiphanes Phil.', '2614': 'Cleomachus Poeta', '0621': '[Ath]enodorus Trag.', '1712': 'Thebaïs', '1493': 'Melinno Lyr.', '0372': 'Praxilla Lyr.', '1353': 'Epitaphium Abercii', '2626': 'Hipparchus Parodius', '1804': 'Ninus', '5024': 'Anonymi In Hermogenem Rhet.', '0740': 'Jusjurandum Medicum', '5000': 'Concilia Oecumenica (ACO)', '2349': '[Pyrander] Hist.', '1512': 'Minyas', '0068': 'Pseudo-Scymnus Geogr.', '2630': 'Lobo Poeta', '1175': 'Archestratus Parodius', '2284': 'Anaxandridas Hist.', '0708': '[Ammonius] Gramm.', '1230': '[Brotinus] Phil.', '1608': 'Phrynichus Attic.', '1756': 'Demetrius Gramm.', '2506': 'Capito Hist.', '0617': 'Anaximenes Phil.', '0350': '[Dionysius Scymnaeus] Trag. vel Comic.', '0504': 'Sosipater Comic.', '1972': 'Eumachus Hist.', '2034': 'Porphyrius Phil.', '1115': 'Archestratus Trag.', '0335': 'Philiscus Trag.', '1557': 'Panyassis Epic.', '1495': 'Melito Apol.', '4157': 'Joannes Rhet.', '1376': 'Eudemus Rhet.', '5027': 'Scholia In Iamblichum Philosophum', '5029': 'Scholia In Lucianum', '2607': 'Alexinus Phil.', '3176': 'Pseudo-Sphrantzes Hist.', '0439': 'Demetrius Comic.', '1690': 'Sotadea', '0061': 'Pseudo-Lucianus Soph.', '0235': 'Iambica Adespota (IEG)', '2691': '[Musaeus] Phil.', '1428': 'Hestiaeus Hist.', '1954': 'Heraclides Phil.', '2243': 'Apocalypsis Sedrach', '1622': 'Polycarpus Scr. Eccl.', '2175': '[Autocharis] Hist.', '2693': 'Ptolemaeus III Euergetes I [Epigr.]', '2651': 'Artemidorus Eleg.', '0748': 'Severus Iatrosophista Med.', '2033': 'Theon Math.', '0206': 'Theocles Lyr.', '2242': 'Echecrates Phil.', '4024': 'Agathias Scholasticus Epigr. et Hist.', '0583': 'Philochorus Hist.', '0219': 'Rhianus Epic.', '1482': 'Cyranides', '1334': 'Dius Phil.', '0628': 'Gaius Musonius Rufus Phil.', '1164': 'Apollodorus Hist.', '1254': 'Charax Hist.', '2461': 'Uranius Hist.', '1208': 'Atticus Phil.', '0530': 'Pseudo-Galenus Med.', '0277': 'Monodia', '9019': 'Stephanus Phil.', '4038': 'Pamprepius Epic.', '1293': 'Crinis Phil.', '0622': 'Cleobuli Epistula', '0013': 'Hymni Homerici, Homeric Hymns', '1791': 'Menandri Et Philistionis Sententiae', '2289': 'Echephylidas Hist.', '0656': 'Dioscorides Pedanius Med.', '4027': 'Anonymi In Aristotelis Categorias Phil.', '1278': 'Clitarchus Gnom.', '0236': 'Alcibiades [Eleg.]', '0207': 'Hermocles Lyr.', '4172': 'Vitae Oppiani', '0221': 'Euphorion Epic.', '0245': 'Demodocus Eleg.', '5012': 'Scholia In Apollonium Rhodium', '4282': 'Anonymus Manichaeus Biogr.', '0086': 'Aristoteles Phil. et Corpus Aristotelicum, Aristotle', '2386': 'Timonides Hist.', '1466': 'Lollianus Scr. Erot.', '2171': 'Stesiclides Hist.', '0065': 'Scylax Perieg.', '0650': 'Herodas Mimogr.', '1635': 'Protagoras Soph.', '3125': 'Theodosius Diaconus Hist. et Poeta', '2121': 'Dioscorus Poeta', '2340': 'Diotimus Phil.', '2871': 'Joannes Malalas Chronogr.', '1445': 'Iliu Persis', '2962': 'Petrus Scr. Eccl. et Theol.', '0200': 'Mantissa Proverbiorum', '1346': 'Ephraem Scr. Eccl.', '2045': 'Nonnus Epic.', '0030': 'Hyperides Orat.', '2591': 'Orion Gramm.', '2479': 'Patrocles Hist.', '0255': 'Mimnermus Eleg.', '1533': 'Nicias Epigr.', '2275': 'Theagenes Phil.', '0316': 'Xenocles Trag.', '1571': '[Pempelus] Phil.', '2695': 'Vitae Aristotelis', '0510': 'Teleclides Comic.', '0087': 'Aelius Herodianus et Pseudo-Herodianus Gramm. et Rhet.', '0210': 'Euphronius Lyr.', 'DOCCAN2': 'TLG Canon, data base', '2305': 'Clidemus Phil.', '0048': 'Philippus II Rex Macedonum [Epist.]', '1609': 'Phylarchus Hist.', '1494': 'Melissus Phil.', '0085': 'Aeschylus Trag.', '1181': 'Aristarchus Astron.', '0532': 'Achilles Tatius Scr. Erot.', '0528': 'Aëtius Doxogr.', '2616': 'Demareta Poeta', '4026': 'Anonymi In Aristotelis Artem Rhetoricam Rhet.', '1459': 'Lepidus Hist.', '0384': 'Acta Justini Et Septem Sodalium', '0213': 'Hermesianax Eleg.', '4161': 'Vitae Arati Et Varia De Arato', '1168': 'Apollonius Soph.', '0405': 'Anaxandrides Comic.', '0378': 'Ariphron Lyr.', '0300': 'Acta Alexandrinorum', '4098': 'Etymologicum Gudianum', '0016': 'Herodotus Hist.', '1192': 'Ariston Phil.', '0352': 'Isidorus Trag.', '0471': 'Lynceus Comic.', '2213': '[Timotheus] Hist.', '1503': 'Menecrates Hist.', '0609': 'Tryphon I Gramm.', '1162': 'Apollas Hist.', '0063': 'Dionysius Thrax Gramm.', '0299': 'Terpander Lyr.', '0246': 'Dionysius Chalcus Eleg.', '2008': 'Martyrium Cononis', '1408': 'Heraclides Gramm.', '1535': 'Nicocrates Hist.', '0736': 'Stephanus Med.', '1899': 'Aristonicus Hist.', '0036': 'Bion Bucol.', '2178': 'Cassius Longinus Phil. et Rhet.', '1700': 'Testamenta XII Patriarcharum', '1340': '[Eccelus] Phil.', '0640': 'Alciphron Rhet. et Soph.', '2960': 'Oracula Tiburtina', '0093': 'Theophrastus Phil.', '2057': 'Socrates Scholasticus Hist.', '1161': 'Apocryphon Ezechiel', '0375': 'Cinesias Lyr.', '2702': 'Michael Psellus Polyhist.', '3170': 'Ephraem Hist. et Poeta', '3074': 'Constantinus Manasses Hist. et Poeta', '0614': 'Valerius Babrius Scr. Fab.', '1875': 'Aristodemus Hist. et Myth.', '0632': '[Pythagoras] Phil.', '2604': 'Ulpianus Gramm. et Rhet.', '0918': 'Lamynthius Lyr.', '4110': 'Evagrius Scr. Eccl.', '4117': 'Eustathius Scr. Eccl. et Theol.', '1646': 'Ptolemaeus Hist.', '2543': 'Lucius Cincius Alimentus Hist.', '0706': 'Philo Med.', '0637': 'Socraticorum Epistulae', '0566': 'Theopompus Hist.', '2860': 'Alexander Scr. Eccl.', '0308': 'Ion Phil. et Poeta', '1764': 'Vettius Valens Astrol.', '2047': 'Syriani, Sopatri Et Marcellini Scholia Ad Hermogenis Status', '0424': 'Axionicus Comic.', '0613': '[Demetrius] Rhet.', '0251': 'Euenus Eleg.', '0535': 'Demades Orat. et Rhet.', '0026': 'Aeschines Orat.', '2948': 'Acta Philippi', '0553': 'Artemidorus Onir.', '1435': 'Hippias Hist.', '1838': 'Theon Gramm.', '2628': 'Idaeus Epic.', '0248': 'Diphilus Epic. et Iamb.', '1438': 'Hippys Hist.', '0050': 'Ptolemaei II Philadelphi Et Eleazari Epistulae', '1763': 'Tryphon II Gramm.', '0387': 'Sapphus vel Alcaei Fragmenta', '0380': 'Philoxenus Lyr.', '4239': 'Severus Soph.', '3020': 'Joannes Cinnamus Gramm. et Hist.', '1196': 'Aristophanes Hist.', '1167': 'Apollonius Biogr.', '1967': 'Leschides Epic.', '0385': 'Cassius Dio Hist., Dio Cassius', '0700': 'Apollodorus Trag.', '1724': 'Theon Phil.', '2372': 'Euagon Hist.', '2545': 'Gaius Acilius Hist. et Phil.', '1704': 'Teucer Hist.', '2903': 'Minucianus Junior Rhet.', '4330': 'Cosmas Hieromonachus Alchem.', '1918': 'Timagenes Hist.', '1189': 'Aristocrates Hist.', '4090': 'Cyrillus Theol.', '1692': 'Speusippus Phil.', '1580': 'Phaestus Epic.', '1591': 'Philistus Hist.', '2559': '[Chrysippus] Hist.', '0409': 'Antidotus Comic.', '0322': 'Dicaeogenes Trag.', '1373': 'Evangelium Philippi', '0503': 'Sosicrates Comic.', '2578': 'Joannes Gramm. et Poeta', '2718': 'Manuel Philes Poeta et Scr. Rerum Nat.', '2798': 'Pseudo-Dionysius Areopagita Scr. Eccl. et Theol.', '1182': '[Aristeas] Epic.', '1201': 'Assumptio Mosis', '1715': 'Theodoridas Epigr.', '0679': 'Aeschrion Lyr.', '2633': 'Niceratus Epic.', '0321': 'Aeschylus Trag.', '1779': 'Anonymus Epicureus Phil.', '0402': 'Alexis Comic.', '2409': 'Dioscurides Hist.', '2613': 'Callimachus Junior Epic.', '0007': 'Plutarchus Biogr. et Phil.', '2303': 'Archelaus Phil.', '1273': 'Cleon Eleg.', '0311': 'Iophon Trag.', '2016': 'Passio Perpetuae Et Felicitatis', '0610': 'Alcidamas Rhet.', '0636': 'Socratis Epistulae', '1437': 'Hippon Phil.', '0594': 'Alexander Rhet. et Soph.', '4238': 'Athanasius Soph.', '0005': 'Theocritus Bucol.', '1153': 'Apocalypsis Adam', '0668': 'Aegimius', '0327': 'Carcinus Junior Trag.', '2577': 'Anatolius Math. et Phil.', '1213': 'Julia Balbilla Lyr.', '0410': 'Antiphanes Comic.', '1416': '(H)eren(n)ius Philo Gramm. et Hist.', '1193': 'Ariston Phil.', '1709': 'Theagenes Hist.', '1337': 'Dorotheus Astrol.', '0351': '[Hippothoon] Trag.', '0268': 'Mesomedes Lyr.', '0218': 'Nicaenetus Epic.', '1288': 'Craterus Hist.', '9018': 'Arsenius Paroemiogr.', '3185': 'Anonymus De Scientia Politica Hist.', '2110': 'Cyrillus Scr. Eccl.', '1603': '[Phintys] Phil.', '0314': 'Morsimus Trag.', '1314': 'Dinias Hist.', '1881': 'Dionysius Scytobrachion Gramm.', '2612': 'Caecalus (?) Epic.', '1309': 'Dialexeis (Δισσοὶ λόγοι)', '2724': 'Ammonius Scr. Eccl.', '0524': 'Sophron Mimogr.', '0347': 'Serapion Trag.', '0448': 'Dromo Comic.', '0732': 'Alexander Phil.', '0467': 'Timotheus Trag.', '2186': 'Leo Hist.', '2445': 'Amometus Hist.', '0208': 'Dosiadas Lyr.', '0406': 'Anaxilas Comic.', '0414': 'Apollophanes Comic.', '2619': 'Dionysius Epic.', '1681': 'Solonis Epistulae', '2004': 'Amelii Epistula', '1271': 'Clemens Romanus Theol. et Clementina', '2273': 'Damon Hist.', '2260': 'Hippasus Phil.', '0550': 'Apollonius Geom.', '0146': 'Boethus Epigr.', '0433': 'Crates Comic.', '0630': 'Pherecydes Myth. et Phil.', '0663': 'Praecepta Salubria', '4393': 'Nonnosus Hist.', '1016': 'Ostanes Magus Alchem.', '0623': 'Cratetis Epistulae', '0470': 'Leuco Comic.', '1304': 'Democritus Phil.', '0585': 'Publius Aelius Phlegon Paradox.', '1225': 'Bion Hist.', '0052': 'Menippus Phil.', '1395': '[Hegesinus] Epic.', '2364': 'Zeno Hist.', '1412': 'Pseudo-Heracliti Epistulae', '0342': 'Nicomachus Trag.', '1160': 'Apocalypsis Sophoniae', '0463': 'Hegemon Parodius', '1772': 'Paraleipomena Jeremiou', '0057': 'Galenus Med.', '0395': 'Diophantus Comic.', '0141': 'Athenaeus Epigr.', '0512': 'Theophilus Comic.', '0719': 'Aretaeus Med.', '2043': 'Hephaestion Astrol.', '0494': 'Philyllius Comic.', '0265': 'Timocreon Lyr.', '1529': 'Nicander Gramm.', '0743': 'Nemesius Theol.', '1516': 'Molpis Hist.', '2580': 'Joannes Laurentius Lydus Hist.', '3141': 'Georgius Acropolites Hist.', '0542': 'Julius Pollux Gramm.', '1210': 'Autolycus Astron.', '1393': 'Hegesianax Astron. et Epic.', '0520': 'Arcesilaus Comic.', '1701': 'Testamentum Abrahae', '0518': 'Xenarchus Comic.', '0529': 'Arius Didymus Doxogr.', '0220': 'Moero Epic.', '1460': 'Lesbonax Gramm.', '2023': 'Iamblichus Phil.', '2404': 'Philogelos', '0376': 'Timotheus Lyr.', '2204': 'Autocrates Hist.', '0333': 'Timocles Trag.', '0707': 'Alexis Hist.', '0645': 'Justinus Martyr Apol.', '1248': 'Celsus Phil.', '1316': 'Dinon Hist.', '0729': 'Theophilus Protospatharius Med.', '1705': 'Thales Phil.', '0174': 'Diotimus Epic.', '2914': 'Leontius Scr. Eccl.', '1377': 'Favorinus Phil. et Rhet.', '1127': 'Anonyma De Musica Scripta Bellermanniana', '0437': 'Crobylus Comic.', '1345': 'Epica Incerta (CA)', '0217': 'Anacreon Junior Eleg.', '1680': '[Sodamus] Eleg.', '0292': 'Stesichorus Lyr.', '2201': '[Ctesiphon] Hist.', '2733': 'Evagrius Scholasticus Scr. Eccl.', '0714': 'Anaxarchus Phil.', '1629': 'Polystratus Phil.', '2881': 'Romanus Melodus Hymnographus', '1190': 'Aristagoras Hist.', '2039': 'Diophantus Math.', '0591': 'Antisthenes Phil. et Rhet.', '3127': 'Pseudo-Nonnus', '2766': 'Eudocia Augusta Poeta', '0436': 'Crito Comic.', '1191': '[Aristombrotus] Phil.', '4015': 'Joannes Philoponus Phil.', '0253': '[Homerus] [Epic.]', '0444': 'Diodorus Comic.', '1514': 'Mnaseas Perieg.', '3188': 'Joannes Actuarius Med.', '0557': 'Epictetus Phil.', '2300': 'Promathidas Hist.', '1202': '[Athamas] Phil.', '0137': 'Asclepiades Epigr.', '1723': 'Theolytus Epic.', '1206': 'Athenodorus Phil.', '3135': 'Joannes Zonaras Gramm. et Hist.', '0302': 'Choerilus Trag.', '1720': 'Theodotus Judaeus Epic.', '2428': 'Thrasyllus Hist.', '0612': 'Dio Chrysostomus Soph.', '4081': 'Colluthus Epic.', '2009': 'Martyrium Marini', '2969': 'Demonax Phil.', '0029': 'Dinarchus Orat.', '1844': 'Hera[clides] Trag.', '5035': 'Scholia In Platonem', '5019': 'Scholia In Dionysium Periegetam', '0003': 'Thucydides Hist.', '0856': 'Dieuches Med.', '9020': 'Stephanus Gramm.', '7052': 'Anthologiae Graecae Appendix', '1177': 'Pseudo-Archytas Phil.', '1292': 'Crito Phil.', '1594': 'Philo Judaeus Senior Epic.', '0710': 'Amphiarai Exilium (?)', '0526': 'Flavius Josephus Hist.', '1477': 'Manetho Hist.', '0037': 'Anacharsidis Epistulae', '0634': 'Xenocrates Phil.', '2640': 'Eusebius Phil.', '0284': 'Aelius Aristides Rhet.', '1509': '[Milon] [Phil.]', '0597': 'Zenodorus Gramm.', '2005': 'Martyrium Pionii', '2797': 'Hesychius Scr. Eccl.', '2424': 'Chaeremon Hist. et Phil.', '4286': 'Lexica Syntactica', '4173': 'Vitae Dionysii Periegetae', '2052': 'Horapollo Gramm.', '1434': 'Hippias Soph.', '4323': 'Eugenius Alchem.', '1155': 'Apocalypsis Syriaca Baruchi', '0269': 'Nautarum Cantiunculae', '4088': 'Anthemius Math. et Mech.', '1484': 'Martyrium Polycarpi', '0095': 'Hermodorus Phil.', '4093': 'Georgius Choeroboscus Gramm.', '2565': 'Mnesimachus Hist.', '4344': 'Menecrates Hist.', '1733': 'Timaeus Hist.', '0075': 'Periplus Ponti Euxini', '2586': 'Menander Rhet.', '0020': 'Hesiodus Epic.', '5038': 'Scholia In Theocritum', '0435': 'Cratinus Junior Comic.', '1597': '[Telauges] Phil.', '5040': 'Scholia In Xenophontem', '3086': 'Nicephorus I Scr. Eccl., Hist. et Theol.', '1367': 'Euripidis Epistulae', '1426': 'Herodes Atticus Soph.', '1572': '[Perictione] Phil.', '2653': 'Erycius Poeta', '0461': 'Eupolis Comic.', '1780': 'Alcimenes Comic.', '5015': 'Scholia In Aristotelem', '1154': 'Apocalypsis Baruch', '1135': 'Anonymus Photii Phil.', '1859': 'Liber Jannes Et Jambres', '1134': 'Anonymus Iamblichi Phil.', '1350': 'Epistula Ad Diognetum', '0238': 'Ananius Iamb.', '2646': 'Fragmenta Adespota (SH)', '1849': 'Demetrius Trag.', '0320': 'Diogenes Trag.', '2511': 'Demetrius Hist.', '1366': 'Evangelium Bartholomaei', '0438': 'Damoxenus Comic.', '1207': 'Attalus Astron. et Math.', '2631': 'Menophilus Poeta', '0304': 'Acta Et Martyrium Apollonii', '1636': 'Protagorides Hist.', '1738': 'Tragica Adespota', '2734': 'Flavius Justinianus Imperator Theol.', '1147': 'Antiphon Soph.', '4145': 'Nicephorus Gregoras Hist.', '0534': 'Callisthenes Hist.', '0079': 'Menippus Geogr.', '0408': 'Comica Adespota (CAF)', '1129': 'Anonymi De Barbarismo Et Soloecismo Gramm.', '0006': 'Euripides Trag.', '1552': 'Oratio Josephi', '4066': 'Damascius Phil.', '0069': 'Dionysius Geogr.', '4085': 'Hesychius Lexicogr.', '0480': 'Nicochares Comic.', '4135': 'Theodorus Theol.', '1600': 'Philostratus Major Soph.', '0017': 'Isaeus Orat.', '5031': 'Scholia In Nicandrum', '0507': 'Straton Comic.', '3158': 'Theodorus Epist.', '0367': 'Tynnichus Lyr.', '1294': 'Critolaus Phil.', '0517': 'Timotheus Comic.', '0423': 'Autocrates Comic.', '5052': 'Scholia in Maximum Confessorem', '2950': 'Adamantius Theol.', '2385': 'Polycritus Hist.', '1379': 'Fragmenta Alchemica', '2130': 'Arethas Philol. et Scr. Eccl.', '2634': 'Pamphilus Poeta', '1534': 'Nicocles Hist.', '0641': 'Xenophon Scr. Erot.', '0651': 'Antoninus Liberalis Myth.', '1452': 'Juba II Rex Mauretaniae [Hist.]', '1312': 'Didymus Gramm.', '2084': 'Basilius Med. et Scr. Eccl.', '1642': 'Pseudo-Ptolemaeus', '0363': 'Claudius Ptolemaeus Math.', '1550': 'Oracula Chaldaica', '0676': 'Aglaïs Poet. Med.', '1240': 'Callixenus Hist.', '1559': 'Bucolicum', '2536': 'Andron Geogr.', '2287': 'Fragmentum Stoicum', '2122': 'Gaius Asinius Quadratus Hist.', '2573': 'Pausanias Hist.', '0222': 'Eratosthenes et Eratosthenica Philol.', '4084': 'Zosimus Hist.', '0577': 'Nicolaus Hist.', '4235': 'Joannes Rhet.', '1244': 'Carneiscus Phil.', '0686': 'Aethlius Hist.', '4100': 'Aphthonius Rhet.', '0391': 'Acta Scillitanorum Martyrum', '2140': 'Iamblichus Alchem.', '0569': 'Apollonius Paradox.', '2512': 'Paeon Hist.', '2649': 'Amyntas Epigr.', '1499': 'Menecles Hist.', '4033': 'Anonymi In Aristotelis Ethica Nicomachea Phil.', '1139': 'Anonymi Historici (FGrH)', '0576': 'Musaeus Epic.', '0434': 'Cratinus Comic.', '2632': 'Comarius Alchem.', '2721': 'Theodorus Prodromus Poeta et Polyhist.', '1197': 'Artemon Gramm.', '0259': 'Scythinus Poet. Phil.', '0072': 'Anonymi Grammatici Gramm.', '0658': 'Heliodorus Scr. Erot.', '0024': 'Oppianus Epic.', '0033': 'Pindarus Lyr.', '0323': 'Antiphon Trag.', '1425': 'Hermonax Epic.', '0519': 'Xeno Comic.', '4318': 'Vita Sophoclis', '0330': 'Dionysius I [Trag.]', '1828': 'Pamphila Hist.', '0486': 'Pherecrates Comic.', '1547': 'Oedipodea', '1347': 'Epimenides Phil.', '0731': 'Adamantius Judaeus Med.', '4101': 'Etymologicum Parvum', '4124': 'Eusebius Scr. Eccl.', '0227': 'Anonymi Curetum Hymnus', '1748': 'Sosigenes Phil.', '2652': 'Diodorus Eleg.', '1747': 'Vita Adam Et Evae', '0432': 'Clearchus Comic.', '0845': 'Ctesias Hist. et Med.', '1703': 'Teucer Astrol.', '4086': '[Agathodaemon] Alchem.', '4031': 'Eustratius Phil.', '2102': 'Didymus Caecus Scr. Eccl., Didymus the Blind', '0464': 'Hegesippus Comic.', '0271': 'Conventus Avium', '1342': 'Empedocles Poet. Phil.', '2866': 'Oecumenius Phil. et Rhet.', '1526': 'Neoptolemus Gramm.', '0428': 'Cantharus Comic.', '0365': 'Apollodorus Lyr.', '1339': 'Duris Hist.', '1917': 'Demetrius Hist.', '0247': 'Dionysius II [Eleg.]', '2624': 'Hermias Poeta', '1218': 'Basilis Hist.', '1021': 'Meropis', '0459': 'Eunicus Comic.', '0329': 'Theodectas Trag.', '1471': 'Lyrica Adespota (SLG)', '0032': 'Xenophon Hist.', '2037': 'Joannes Stobaeus Anthologus', '4115': 'Theophilus Scr. Eccl.', '2622': 'Dorieus Poeta', '1152': 'Apion Gramm.', '0004': 'Diogenes Laertius Biogr.', '5033': 'Scholia In Pausaniam', '2806': 'Marcus Diaconus Scr. Eccl.', '1645': 'Ptolemaeus VIII Euergetes II [Hist.]', '0094': 'Pseudo-Plutarchus', '1183': 'Aristeae Epistula', '2699': 'Amphicrates Rhet.', '0281': 'Marcellus Poet. Med.', '4175': 'Commentaria In Dionysii Thracis Artem Grammaticam', '9023': 'Thomas Magister Philol.', '1560': 'Matthiae Traditiones', '5046': 'Scholia In Theonem Rhetorem', '2444': 'Lycophron Soph.', '3140': 'Joel Chronogr.', '0697': 'Cornelius Alexander Polyhist.', '3088': 'Nicephorus Bryennius Hist.', '1487': 'Maximus Astrol.', '0228': 'Anonymi Hymnus In Dactylos Idaeos', '1793': 'Timoxenus Comic.', '2038': 'Acta Thomae', '1131': 'Anonymus Ad Avircium Marcellum Contra Cataphrygas', '0671': 'Philumenus Med.', '0563': 'Maximus Soph.', '5023': 'Scholia In Euripidem', '2319': 'Apollodorus Phil.', '0667': 'Marcellinus I Med.', '5002': 'Magica', '0683': 'Aethiopis', '0099': 'Strabo Geogr.', '0654': 'Lucius Annaeus Cornutus Phil.', '0231': 'Elegiaca Adespota (CA)', '1699': 'Teles Phil.', '1683': 'Sophaenetus Hist.', '2210': 'Anaxicrates Hist.', '0725': 'Anaximander Phil.', '0214': 'Phanocles Eleg.', '0568': 'Antigonus Paradox.', '4134': 'Diodorus Scr. Eccl.', '0897': 'Euthydemus Med.', '0639': 'Menecrates Med.', '0309': 'Achaeus Trag.', '1615': 'Platonius Gramm.', '1258': 'Charon Hist.', '2112': 'Amphilochius Scr. Eccl.', '1375': 'Evangelium Thomae', '0476': 'Mnesimachus Comic.', '0888': 'Eudemus Poet. Med.', '4331': 'Hierotheus Alchem.', '1251': 'Chamaeleon Phil.', '4307': 'Lexica Synonymica', '0595': 'Zeno Phil.', '2399': 'Eudromus Phil.', '1307': 'Demon Hist.', '1496': 'Memnon Hist.', '0258': 'Pigres Eleg.', '1446': 'Ion Eleg.', '1666': 'Sententiae Sexti', '1585': 'Pherecydis Epistula', '0570': 'Archelaus Paradox.', '1223': 'Bias [Phil.]', '4061': 'Cosmas Indicopleustes Geogr.', '4288': 'Lexicon αἱμωδεῖν', '0662': 'Comica Adespota (CGFPR)', '1357': 'Eudemus Phil.', '2966': 'Phileas Scr. Eccl.', '2231': 'Thrasyalces Phil.', '2190': '[Clitonymus] Hist.', '0018': 'Philo Judaeus Phil.', '1118': 'Pseudo-Dioscorides Med.', '1848': 'Meletus Junior Trag.', 'DOCCAN1': 'TLG Canon, bibliography', '1605': 'Pseudo-Phocylides Gnom.', '0475': 'Metagenes Comic.', '0479': 'Nico Comic.', '1915': 'Eudoxus Hist.', '0060': 'Diodorus Siculus Hist.', '0537': 'Epicurus Phil.', '1184': 'Aristides Apol.', '2185': 'Dionysius Μεταθέμενος Phil.', '2354': 'Dionysius Hist.', '0620': 'Archytas Phil.', '5018': 'Scholia In Dionysium Byzantium', '2202': '[Menyllus] Hist.', '0186': 'Marcus Cornelius Fronto Rhet.', '1548': 'Oenomaus Phil.', '1245': 'Carystius Hist.', '4126': 'Theodorus Scr. Eccl.', '0427': '[Callippus] Comic.', '2398': 'Basilides Phil.', '0440': 'Demetrius Junior Comic.', '0495': 'Phoenicides Comic.', '0816': 'Theudo[tus] Trag.', '2141': 'Publius Herennius Dexippus Hist.', '2602': 'Timaeus Sophista Gramm.', '1711': '[Thearidas] Phil.', '0738': 'Hippiatrica', '0468': 'Hipparchus Comic.', '0722': 'Oribasius Med.', '0580': 'Paradoxographus Florentinus', '3069': 'Leo Diaconus Hist.', '0652': 'Philostratus Junior Soph.', '3051': 'Georgius Monachus Continuatus', '2877': 'Cyrillus Biogr.', '2232': 'Damon Mus.', '3014': 'Joannes Camaterus Astrol. et Astron.', '0737': 'Julianus Scriptor Legis De Medicis', '1525': 'Neanthes Hist.', '2606': 'Agathyllus Eleg.', '2525': 'Laetus Hist.', '2172': 'Andron Hist.', '0306': 'Aristarchus Trag.', '0382': 'Castorion Lyr.', '1987': 'Theodorus Poeta', '0728': 'Theophilus Protospatharius, Damascius et Stephanus Atheniensis Med.', '0431': 'Chionides Comic.', '1409': 'Heraclides Ponticus Phil.', '0527': 'Septuaginta', '1128': 'Anonymi Commentarius In Platonis Theaetetum', '0355': 'Zopyrus Trag.', '0047': 'Pausaniae I Et Xerxis Epistulae', '1421': 'Hermippus Gramm. et Hist.', '1420': 'Hermias Iamb.', '4102': 'Catenae (Novum Testamentum)', '0267': 'Xenophanes Poet. Phil.', '2304': 'Idaeus Phil.', '0010': 'Isocrates Orat.', '0131': 'Archimelus Epigr.', '1173': 'Archedemus Phil.', '0358': 'Nicomachus Math.', '0055': 'Themistoclis Epistulae', '1178': '[Aresas] Phil.', '1087': 'Cleophon Trag.', '1504': 'Menelaus Epic.', '2265': 'Diodorus Perieg.', '1470': 'Lycus Hist.', '1461': 'Leucippus Phil.', '0715': 'Paulus Med.', '4293': 'Fragmentum Lexici Graeci', '1176': 'Archytas Epic.', '2326': 'Dei(l)ochus Hist.', '0425': 'Bato Comic.', '0407': 'Anaxippus Comic.', '1819': 'Pseudo-Demosthenes Epigr.', '1200': 'Asclepiades Myth.', '0165': 'Diodorus Rhet.', '1443': 'Ignatius Scr. Eccl.', '1419': 'Hermas Scr. Eccl., Pastor Hermae', '2268': 'Timagoras Hist.', '2119': 'Christodorus Epic.', '0411': 'Apollodorus Comic.', '1252': 'Certamen Homeri Et Hesiodi', '2904': 'Nicolaus Rhet. et Soph.', '0278': 'Praelusio Mimi', '0359': 'Isidorus Scriptor Hymnorum', '4187': 'Leo Magentinus Phil.', '1388': 'Harmodius Hist.', '0262': 'Socrates Phil.', '0487': 'Philemon Comic.', '2552': 'Critolaus Hist.', '3159': 'Barlaam Math., Theol. et Epist.', '2060': 'Asterius Scr. Eccl.', '2449': 'Timotheus Gramm.', '0491': 'Philiscus Comic.', '4046': 'Theophanes Confessor Chronogr.', '2639': 'Posidonius Epic.', '0216': 'Alexander Lyr. et Trag.', '0607': 'Aelius Theon Rhet.', '1272': 'Cleomedes Astron.', '0357': 'Didymus Scriptor De Mensuris', '1266': 'Tyrannion Gramm.', '1696': 'Straton Phil.', '0454': 'Epinicus Comic.', '1158': 'Apocalypsis Joannis', '0011': 'Sophocles Trag.', '3040': 'Josephus Genesius Hist.', '4153': 'Theophanes Continuatus', '2200': 'Libanius Rhet. et Soph.', '2306': 'Xenomedes Hist.', '2193': '[Aretades] Hist.', '1906': 'Simonides Epic.', '0452': 'Epigenes Comic.', '0625': 'Polemaeus Trag.', '1166': 'Apollodorus Phil.', '1442': 'Idomeneus Hist.', '4080': 'Geoponica', '2298': 'Lysanias Hist.', '1306': 'Bolus Med. et Phil.', '2393': 'Andreas Hist.', '0081': 'Dionysius Halicarnassensis Hist. et Rhet.', '0389': 'Acta Petri', '0354': 'Zenodotus Trag.', '1462': 'Liber Eldad Et Modad', '3144': 'Joannes Cananus Hist.', '1562': 'Parmenides Poet. Phil.', '4289': 'Lexica Segueriana', '9007': 'Appendix Proverbiorum', '1313': 'Dieuchidas Hist.', '1588': 'Philicus Lyr.', '1651': 'Pythermus Hist.', '1170': 'Apollonius Hist.', '1199': 'Asclepiades Gramm. et Hist.', '1784': '[Heraclitus] Comic.', '0215': 'Antagoras Epic.', '2627': 'Damianus Scriptor De Opticis', '2418': 'Archinus Hist.', '0002': 'Theognis Eleg.', '0366': 'Lasus Lyr.', '0242': 'Asius Eleg. et Epic.', '1262': 'Choerilus Epic.', '3182': 'Pseudo-Symeon Hist.', '0035': 'Moschus Bucol.', '1641': 'Ptolemaeus Gnost.', '1765': 'Vitae Aesopi', '2168': 'Apollophanes Phil.', '2203': '[Theophilus] Hist.', '0629': 'Periander [Phil.]', '1052': 'Posidonius Phil.', '0560': '[Longinus] Rhet., Pseudo-Longinus', '4020': 'Elias Phil.', '4030': 'Sophonias Phil.', '1650': 'Pytheas Perieg.', '1264': 'Chrysippus Phil.', '0565': 'Soranus Med.', '2426': 'Hermaeus Hist.', '1205': 'Athenagoras Apol.', '2014': 'Acta Phileae', '2054': 'Aristides Quintilianus Mus.', '1249': 'Cephalion Hist. et Rhet.', '0296': 'Carmina Convivialia (PMG)', '1661': 'Satyrus Hist.', '2245': 'Simus Phil.', '1759': 'Sententiae Pythagoreorum', '1706': 'Thallus Hist.', '2286': 'Cercops Phil.', '4227': 'Anonymus De Philosophia Platonica Phil.', '5025': 'Scholia In Hesiodum', '1553': '[Palaephatus] Myth.', '4013': 'Simplicius Phil.', '3064': 'Scylitzes Continuatus', '0381': 'Lycophronides Lyr.', '0415': 'Araros Comic.', '0403': 'Amipsias Comic.', '0539': 'Hellanicus Hist.', '2018': 'Eusebius Scr. Eccl. et Theol.', '0293': 'Ibycus Lyr.', '0501': 'Sannyrion Comic.', '1392': 'Hegesander Hist.', '2460': 'Glaucus Hist.', '2017': 'Gregorius Nyssenus Theol.', '4305': 'Claudius Casilon Gramm.', '1623': 'Polycharmus Hist.', '0015': 'Herodianus Hist.', '2694': 'Sostratus Poeta', '0116': 'Abydenus Hist.', '2417': 'Cineas Rhet.', '1433': 'Hipparchus [Epigr.]', '0379': 'Philoxenus Lyr.', '2212': 'Lyceas Hist.', '0310': 'Carcinus Trag.', '2934': 'Joannes Damascenus Scr. Eccl. et Theol., John of Damascus', '0202': 'Mace(donius) Lyr.', '1226': 'Biton Mech.', '4001': 'Aeneas Phil. et Rhet.', '1751': 'Xanthus Hist.', '0745': 'Hierophilus Phil. et Soph.', '1678': 'Socrates Hist.', '1719': 'Theodosius Astron. et Math.', '0328': 'Chaeremon Trag.', '2392': 'Artemon Hist.', '0419': 'Aristomenes Comic.', '2003': 'Flavius Claudius Julianus Imperator Phil., Julian the Apostate', '2339': 'Maeandrius Hist.', '0276': 'Cantus Lugubris', '1992': 'Ariston Apol.', '1695': '[Sthenidas] Phil.', '1405': 'Heraclides Criticus Perieg.', '2064': 'Acacius Theol.', '0400': 'Alcaeus Comic.', '0608': 'Satyrus Biogr.', '1355': 'Erinna Lyr.', '0280': 'Andromachus Poet. Med.', '2050': 'Eunapius Hist. et Soph.', '1400': 'Heliodorus Perieg.', '2195': '[Chrysermus] Hist.', '1250': 'Cercidas Iamb.', '1749': 'Vitae Hesiodi Particula', '9003': 'Anonymus Lexicographus Lexicogr.', '3187': 'Georgius Gramm.', '2341': 'Aristocritus Hist.', '0318': 'Agathon Trag.', '1654': 'Rhinthon Comic.', '1570': 'Epitaphium Pectorii', '2046': 'Quintus Epic.', '7000': 'Anthologia Graeca, AG', '1558': 'Papias Scr. Eccl.', '1469': 'Lyceas Hist.', '2244': 'Damon et Phintias Phil.', '1714': 'Theocritus Soph.', '0626': 'Heraclitus Phil.', '1444': 'Ilias Parva', '4328': 'Philosophus Christianus Alchem.', '0627': 'Hippocrates Med. et Corpus Hippocraticum', '4167': 'Leontius Mech.', '2600': 'Simon Scriptor De Re Equestri', '1268': 'Claudius Iolaus Hist.', '4083': 'Eustathius Philol. et Scr. Eccl.', '1150': 'Aphareus Rhet.', '3186': 'Anonymus Dialogus Cum Judaeis', '1908': 'Daimachus Hist.', '0064': 'Periplus Hannonis', '4319': 'Zosimus Alchem.', '0413': 'Apollodorus Comic.', '1341': '[Ecphantus] Phil.', '1781': 'Philippus Comic.', '0742': 'Hymni Anonymi', '0587': 'Sotion [Paradox.]', '1858': 'Oratio Manassis', '1429': 'Hierocles Phil.', '9010': 'Suda, Suidas', '1145': 'Antiochus Hist.', '1542': 'Numenius Phil.', '3115': 'Symeon Metaphrastes Biogr. et Hist.', '4294': 'Lexicon Vindobonense', '0546': 'Aelianus Tact.', '3018': 'Georgius Cedrenus Chronogr.', '2596': 'Phoebammon Soph.', '0584': 'Philostephanus Hist.', '1613': 'Pittaci Epistula', '1617': 'Marcus Antonius Polemon Soph.', '1576': 'Phaedimus [Epic.]', '1291': 'Creophylus Hist.', '0084': 'Dionysius Perieg.', '0305': 'Aristias Trag.', '2248': 'Acta Xanthippae Et Polyxenae', '0659': 'Comica Adespota (Suppl. Com.)'}
| 55,991
| 55,991
| 0.654837
| 6,423
| 55,991
| 5.708236
| 0.560174
| 0.011455
| 0.002455
| 0.003055
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147018
| 0.113911
| 55,991
| 1
| 55,991
| 55,991
| 0.591982
| 0
| 0
| 0
| 0
| 0
| 0.739016
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
d66f911b5b0f82cf22f2122892cbd7596162fb43
| 445
|
py
|
Python
|
Codewars/8kyu/remove-the-time/Python/test.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | 7
|
2017-09-20T16:40:39.000Z
|
2021-08-31T18:15:08.000Z
|
Codewars/8kyu/remove-the-time/Python/test.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | null | null | null |
Codewars/8kyu/remove-the-time/Python/test.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | null | null | null |
# Python - 2.7.6
Test.describe('Basic tests')
Test.assert_equals(shorten_to_date('Monday February 2, 8pm'), 'Monday February 2')
Test.assert_equals(shorten_to_date('Tuesday May 29, 8pm'), 'Tuesday May 29')
Test.assert_equals(shorten_to_date('Wed September 1, 3am'), 'Wed September 1')
Test.assert_equals(shorten_to_date('Friday May 2, 9am'), 'Friday May 2')
Test.assert_equals(shorten_to_date('Tuesday January 29, 10pm'), 'Tuesday January 29')
| 49.444444
| 85
| 0.761798
| 73
| 445
| 4.438356
| 0.369863
| 0.154321
| 0.246914
| 0.354938
| 0.496914
| 0.496914
| 0.228395
| 0.228395
| 0
| 0
| 0
| 0.057072
| 0.094382
| 445
| 8
| 86
| 55.625
| 0.746898
| 0.031461
| 0
| 0
| 0
| 0
| 0.440559
| 0
| 0
| 0
| 0
| 0
| 0.833333
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d6a5c0111b1fa9e68da617e91138e9754fdb2cdd
| 2,535
|
py
|
Python
|
test/test_build_controller_api.py
|
coveooss/spinnaker_python_client
|
6f5ae436798cb4985ada65cd8169fcc9494d048f
|
[
"Apache-2.0"
] | null | null | null |
test/test_build_controller_api.py
|
coveooss/spinnaker_python_client
|
6f5ae436798cb4985ada65cd8169fcc9494d048f
|
[
"Apache-2.0"
] | null | null | null |
test/test_build_controller_api.py
|
coveooss/spinnaker_python_client
|
6f5ae436798cb4985ada65cd8169fcc9494d048f
|
[
"Apache-2.0"
] | 2
|
2019-10-17T07:49:21.000Z
|
2021-08-10T23:12:41.000Z
|
# coding: utf-8
"""
Spinnaker API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import spinnaker-python-client
from spinnaker-python-client.api.build_controller_api import BuildControllerApi # noqa: E501
from spinnaker-python-client.rest import ApiException
class TestBuildControllerApi(unittest.TestCase):
"""BuildControllerApi unit test stubs"""
def setUp(self):
self.api = spinnaker-python-client.api.build_controller_api.BuildControllerApi() # noqa: E501
def tearDown(self):
pass
def test_get_build_masters_using_get(self):
"""Test case for get_build_masters_using_get
Get build masters # noqa: E501
"""
pass
def test_get_build_using_get(self):
"""Test case for get_build_using_get
Get build for build master # noqa: E501
"""
pass
def test_get_builds_using_get(self):
"""Test case for get_builds_using_get
Get builds for build master # noqa: E501
"""
pass
def test_get_job_config_using_get(self):
"""Test case for get_job_config_using_get
Get job config # noqa: E501
"""
pass
def test_get_jobs_for_build_master_using_get(self):
"""Test case for get_jobs_for_build_master_using_get
Get jobs for build master # noqa: E501
"""
pass
def test_v3_get_build_masters_using_get(self):
"""Test case for v3_get_build_masters_using_get
Get build masters # noqa: E501
"""
pass
def test_v3_get_build_using_get(self):
"""Test case for v3_get_build_using_get
Get build for build master # noqa: E501
"""
pass
def test_v3_get_builds_using_get(self):
"""Test case for v3_get_builds_using_get
Get builds for build master # noqa: E501
"""
pass
def test_v3_get_job_config_using_get(self):
"""Test case for v3_get_job_config_using_get
Get job config # noqa: E501
"""
pass
def test_v3_get_jobs_for_build_master_using_get(self):
"""Test case for v3_get_jobs_for_build_master_using_get
Get jobs for build master # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 24.142857
| 119
| 0.657988
| 341
| 2,535
| 4.548387
| 0.175953
| 0.103159
| 0.070922
| 0.103159
| 0.728562
| 0.72147
| 0.72147
| 0.618311
| 0.549323
| 0.439716
| 0
| 0.028525
| 0.267061
| 2,535
| 104
| 120
| 24.375
| 0.806243
| 0.013807
| 0
| 0.34375
| 1
| 0
| 0.006723
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.34375
| 0.15625
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ba65d6b245623b16e50954250543448d2f0c3146
| 52
|
py
|
Python
|
tests/__init__.py
|
betfund/betfund-lines
|
9fe3e2aa69bb493df3efc2a3923889f444f2c66d
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
betfund/betfund-lines
|
9fe3e2aa69bb493df3efc2a3923889f444f2c66d
|
[
"MIT"
] | 1
|
2020-04-01T00:35:21.000Z
|
2020-04-01T00:35:21.000Z
|
tests/__init__.py
|
betfund/betfund-lines
|
9fe3e2aa69bb493df3efc2a3923889f444f2c66d
|
[
"MIT"
] | null | null | null |
"""Tests namespace."""
from .utils import load_json
| 17.333333
| 28
| 0.730769
| 7
| 52
| 5.285714
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 52
| 2
| 29
| 26
| 0.804348
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
ba6cacccb15ca2ce3c863b083d816a4369ab194e
| 92
|
py
|
Python
|
packages/girder_worker/girder_worker/plugins/types/format/table/jsonlines_to_objectlist.py
|
ShenQianwithC/HistomicsTK
|
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
|
[
"Apache-2.0"
] | null | null | null |
packages/girder_worker/girder_worker/plugins/types/format/table/jsonlines_to_objectlist.py
|
ShenQianwithC/HistomicsTK
|
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
|
[
"Apache-2.0"
] | null | null | null |
packages/girder_worker/girder_worker/plugins/types/format/table/jsonlines_to_objectlist.py
|
ShenQianwithC/HistomicsTK
|
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
|
[
"Apache-2.0"
] | null | null | null |
import bson.json_util
output = [bson.json_util.loads(line) for line in input.splitlines()]
| 23
| 68
| 0.771739
| 15
| 92
| 4.6
| 0.733333
| 0.231884
| 0.347826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108696
| 92
| 3
| 69
| 30.666667
| 0.841463
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ba6ef87d78686c0aa9df9a3d5c34714f191468cb
| 52
|
py
|
Python
|
fncache/__init__.py
|
lockwooddev/python-fncache
|
bcbfe9e7e0c3354ef8eee7ddcf61eec47b639e32
|
[
"MIT"
] | null | null | null |
fncache/__init__.py
|
lockwooddev/python-fncache
|
bcbfe9e7e0c3354ef8eee7ddcf61eec47b639e32
|
[
"MIT"
] | null | null | null |
fncache/__init__.py
|
lockwooddev/python-fncache
|
bcbfe9e7e0c3354ef8eee7ddcf61eec47b639e32
|
[
"MIT"
] | 1
|
2020-12-01T12:03:11.000Z
|
2020-12-01T12:03:11.000Z
|
from .decorators import fncache_read, fncache_revoke
| 52
| 52
| 0.884615
| 7
| 52
| 6.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 52
| 1
| 52
| 52
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 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
| 5
|
bac4eba10c3d036eb17b2899ae988e9d0be39184
| 6,083
|
py
|
Python
|
pypipeline/cell/compositecell/topology/descriptive.py
|
JohannesVerherstraeten/pypipeline
|
1ccb2a2567dc3159123f6cacf6b25b6c6b1fbff2
|
[
"Apache-2.0"
] | 3
|
2022-02-20T18:45:11.000Z
|
2022-02-20T19:09:40.000Z
|
pypipeline/cell/compositecell/topology/descriptive.py
|
JohannesVerherstraeten/pypipeline
|
1ccb2a2567dc3159123f6cacf6b25b6c6b1fbff2
|
[
"Apache-2.0"
] | null | null | null |
pypipeline/cell/compositecell/topology/descriptive.py
|
JohannesVerherstraeten/pypipeline
|
1ccb2a2567dc3159123f6cacf6b25b6c6b1fbff2
|
[
"Apache-2.0"
] | 1
|
2022-03-07T17:06:00.000Z
|
2022-03-07T17:06:00.000Z
|
# Copyright 2021 Johannes Verherstraeten
#
# 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.
"""
TODO the functions in this file are nowhere used anymore. -> Remove them?
"""
from typing import TYPE_CHECKING, Set, Any, Tuple, Collection
if TYPE_CHECKING:
from pypipeline.cell import ICell
from pypipeline.connection import IConnection
from pypipeline.cellio import IConnectionExitPoint, IConnectionEntryPoint
def get_downstream_neighbours(cell: "ICell",
recurrently: bool = True) -> "Tuple[Collection[ICell], Collection[IConnection]]":
"""
Get cells that are directly connected to an output of this cell.
Args:
cell: the cells to get the downstream neighbours from.
recurrently: include (upstream) neighbours that can be reached using an outgoing recurrent connection or not.
Returns:
A collection with the downstream neighbour cells, next to a collection of all connections to them.
Raises:
IndeterminableTopologyException
"""
result_cells: Set["ICell"] = set()
result_connections: Set["IConnection"] = set()
for output in cell.get_outputs():
outgoing_connections = output.get_outgoing_connections()
for connection in outgoing_connections:
target: "IConnectionEntryPoint[Any]" = connection.get_target()
if not connection.is_inter_cell_connection():
continue
if not recurrently and connection.is_recurrent():
continue
result_cells.add(target.get_cell())
result_connections.add(connection)
return result_cells, result_connections
def get_upstream_neighbours(cell: "ICell",
recurrently: bool = True) -> "Tuple[Collection[ICell], Collection[IConnection]]":
"""
Get cells that are directly connected to an input of this cell.
Args:
cell: the cells to get the upstream neighbours from.
recurrently: include (downstream) neighbours that can be reached using an incoming recurrent connection or not.
Returns:
A collection with the upstream neighbour cells, next to a collection of all connections from them.
Raises:
IndeterminableTopologyException
"""
result_cells: Set["ICell"] = set()
result_connections: Set["IConnection"] = set()
for input_ in cell.get_inputs():
incoming_connections = input_.get_incoming_connections()
for connection in incoming_connections:
source: "IConnectionExitPoint[Any]" = connection.get_source()
if not connection.is_inter_cell_connection():
continue
if not recurrently and connection.is_recurrent():
continue
result_cells.add(source.get_cell())
result_connections.add(connection)
return result_cells, result_connections
def get_all_downstream_cells(cell: "ICell",
recurrently: bool = True) -> "Tuple[Collection[ICell], Collection[IConnection]]":
"""
Get all cells that can be reached when continuously following all connections downstream, starting from the given
cell.
Args:
cell: the cells to get all downstream cells from.
recurrently: include (upstream) neighbours that can be reached using an outgoing recurrent connection or not.
Returns:
A collection with all downstream cells, next to a collection of all connections to them.
Raises:
IndeterminableTopologyException
"""
result_cells: Set["ICell"] = set()
neighbour_cells, neighbour_connections = get_downstream_neighbours(cell, recurrently)
result_connections: Set["IConnection"] = set(neighbour_connections)
cells_to_check: Set["ICell"] = set(neighbour_cells)
while len(cells_to_check) > 0:
cell_to_check = cells_to_check.pop()
result_cells.add(cell_to_check)
neighbour_cells, neighbour_connections = get_downstream_neighbours(cell_to_check, recurrently)
result_connections.update(neighbour_connections)
neighbours_to_check = set(neighbour_cells).difference(result_cells)
cells_to_check.update(neighbours_to_check)
return result_cells, result_connections
def get_all_upstream_cells(cell: "ICell",
recurrently: bool = True) -> "Tuple[Collection[ICell], Collection[IConnection]]":
"""
Get all cells that can be reached when continuously following all connections upstream, starting from the given
cell.
Args:
cell: the cells to get all upstream cells from.
recurrently: include (downstream) neighbours that can be reached using an incoming recurrent connection or not.
Returns:
A collection with all upstream cells, next to a collection of all connections from them.
Raises:
IndeterminableTopologyException
"""
result_cells: Set["ICell"] = set()
neighbour_cells, neighbour_connections = get_upstream_neighbours(cell, recurrently)
result_connections: Set["IConnection"] = set(neighbour_connections)
cells_to_check: Set["ICell"] = set(neighbour_cells)
while len(cells_to_check) > 0:
cell_to_check = cells_to_check.pop()
result_cells.add(cell_to_check)
neighbour_cells, neighbour_connections = get_upstream_neighbours(cell_to_check, recurrently)
result_connections.update(neighbour_connections)
neighbours_to_check = set(neighbour_cells).difference(result_cells)
cells_to_check.update(neighbours_to_check)
return result_cells, result_connections
| 44.40146
| 119
| 0.709683
| 720
| 6,083
| 5.826389
| 0.191667
| 0.030036
| 0.022884
| 0.022884
| 0.715614
| 0.715614
| 0.715614
| 0.715614
| 0.704172
| 0.69702
| 0
| 0.002107
| 0.219628
| 6,083
| 136
| 120
| 44.727941
| 0.881609
| 0.380733
| 0
| 0.634921
| 0
| 0
| 0.095599
| 0.068124
| 0
| 0
| 0
| 0.007353
| 0
| 1
| 0.063492
| false
| 0
| 0.063492
| 0
| 0.190476
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bac6a73a0178cf3cddb9feac952adc43c79e452f
| 128
|
py
|
Python
|
src/preprocessor/interface.py
|
William9923/IF4072-SentimentClassification
|
5e22a6da418056955243c310bab0382e4683b781
|
[
"MIT"
] | null | null | null |
src/preprocessor/interface.py
|
William9923/IF4072-SentimentClassification
|
5e22a6da418056955243c310bab0382e4683b781
|
[
"MIT"
] | null | null | null |
src/preprocessor/interface.py
|
William9923/IF4072-SentimentClassification
|
5e22a6da418056955243c310bab0382e4683b781
|
[
"MIT"
] | null | null | null |
from abc import ABC, abstractmethod
class IPreprocessor(ABC):
@abstractmethod
def preprocess(self):
pass
| 18.285714
| 35
| 0.671875
| 13
| 128
| 6.615385
| 0.769231
| 0.395349
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.265625
| 128
| 7
| 36
| 18.285714
| 0.914894
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
241ded237c6ca3efaba7de960d47c6a0f255abfa
| 85
|
py
|
Python
|
spark_application/entities/__init__.py
|
ketanvatsalya/pyspark_project_template
|
72f6cc843ce04cbbf15eaf49c2435b7f31366194
|
[
"MIT"
] | null | null | null |
spark_application/entities/__init__.py
|
ketanvatsalya/pyspark_project_template
|
72f6cc843ce04cbbf15eaf49c2435b7f31366194
|
[
"MIT"
] | null | null | null |
spark_application/entities/__init__.py
|
ketanvatsalya/pyspark_project_template
|
72f6cc843ce04cbbf15eaf49c2435b7f31366194
|
[
"MIT"
] | null | null | null |
"""
Package to hold the Data Classes
"""
from . import base
from . import employees
| 12.142857
| 32
| 0.705882
| 12
| 85
| 5
| 0.833333
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 85
| 6
| 33
| 14.166667
| 0.882353
| 0.376471
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
2426388f1b212926bc589102c35981a66a7ac220
| 477
|
py
|
Python
|
src/architectures/nmp/fixed_nmp/__init__.py
|
isaachenrion/jets
|
59aeba81788d0741af448192d9dfb764fb97cf8d
|
[
"BSD-3-Clause"
] | 9
|
2017-10-09T17:01:52.000Z
|
2018-06-12T18:06:05.000Z
|
src/architectures/nmp/fixed_nmp/__init__.py
|
isaachenrion/jets
|
59aeba81788d0741af448192d9dfb764fb97cf8d
|
[
"BSD-3-Clause"
] | 31
|
2017-11-01T14:39:02.000Z
|
2018-04-18T15:34:24.000Z
|
src/architectures/nmp/fixed_nmp/__init__.py
|
isaachenrion/jets
|
59aeba81788d0741af448192d9dfb764fb97cf8d
|
[
"BSD-3-Clause"
] | 10
|
2017-10-17T19:23:14.000Z
|
2020-07-05T04:44:45.000Z
|
#from .fixed_nmp import PhysicsNMP
#from .fixed_nmp import PhysicsStackNMP
#from .fixed_nmp import OnesNMP
#from .fixed_nmp import EyeNMP
#from .fixed_nmp import LearnedFixedNMP
#from .fixed_nmp import PhysicsPlusLearnedNMP
from .fixed_nmp import FixedNMP
'''
This module contains NMPs that use a single, fixed adjacency matrix to pass
messages. The matrix is kept constant across layers/iterations of message passing.
This matrix can be learned from the inputs or given.
'''
| 34.071429
| 82
| 0.813417
| 70
| 477
| 5.442857
| 0.571429
| 0.165354
| 0.220472
| 0.330709
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136268
| 477
| 13
| 83
| 36.692308
| 0.924757
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
246088d31b3b2341e35b085983fc56e90e5adc09
| 36
|
py
|
Python
|
python/testData/formatter/spaceInAnnotations_after.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/formatter/spaceInAnnotations_after.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/formatter/spaceInAnnotations_after.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
def foo(x: int) -> object:
pass
| 12
| 26
| 0.555556
| 6
| 36
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277778
| 36
| 2
| 27
| 18
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
79f3c4d8d93d85c7ea217ea4e0f3a257cd055a73
| 192
|
py
|
Python
|
molpal/models/mpnn/__init__.py
|
mchaker/lab-molpal
|
f4db7ee2ca51515b4246604867a93a3aac08107d
|
[
"MIT"
] | 1
|
2022-03-27T10:17:25.000Z
|
2022-03-27T10:17:25.000Z
|
molpal/models/mpnn/__init__.py
|
mchaker/lab-molpal
|
f4db7ee2ca51515b4246604867a93a3aac08107d
|
[
"MIT"
] | 2
|
2022-03-27T20:08:23.000Z
|
2022-03-28T11:47:11.000Z
|
molpal/models/mpnn/__init__.py
|
mchaker/lab-molpal
|
f4db7ee2ca51515b4246604867a93a3aac08107d
|
[
"MIT"
] | 1
|
2022-03-27T20:20:01.000Z
|
2022-03-27T20:20:01.000Z
|
from .evaluate import evaluate
from .model import MoleculeModel
from .predict import predict
from .ptl import EpochAndStepProgressBar, LitMPNN
from .train import train
from . import sgd, utils
| 32
| 49
| 0.828125
| 25
| 192
| 6.36
| 0.48
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130208
| 192
| 6
| 50
| 32
| 0.952096
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
0307409c9a4deee7ea7c0f269c67503d5a38855a
| 105
|
py
|
Python
|
models/gannet/__init__.py
|
zhen8838/AnimeGAN
|
1c050777e2f361e98cd53cd4a6373e89a86ffd35
|
[
"MIT"
] | 10
|
2020-04-27T06:45:40.000Z
|
2021-08-25T05:30:07.000Z
|
models/gannet/__init__.py
|
zhen8838/AnimeGAN
|
1c050777e2f361e98cd53cd4a6373e89a86ffd35
|
[
"MIT"
] | null | null | null |
models/gannet/__init__.py
|
zhen8838/AnimeGAN
|
1c050777e2f361e98cd53cd4a6373e89a86ffd35
|
[
"MIT"
] | 2
|
2020-05-23T05:34:54.000Z
|
2020-07-23T09:05:53.000Z
|
from .dcgannet import dcgan_mnist
from .pix2pixnet import pix2pix_facde
from .animegannet import animenet
| 35
| 37
| 0.866667
| 14
| 105
| 6.357143
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.104762
| 105
| 3
| 38
| 35
| 0.925532
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
0312fb9ea012591fade0b15f9eafd2c21427592e
| 46
|
py
|
Python
|
wormpose/dataset/loaders/__init__.py
|
AntonioCCosta/wormpose
|
ebd0acf39b92072f00008731e77c5ac2b8ea4406
|
[
"BSD-3-Clause"
] | 29
|
2020-05-14T02:58:59.000Z
|
2022-03-16T10:06:36.000Z
|
wormpose/dataset/loaders/__init__.py
|
Tubbz-alt/wormpose
|
a92c0459f940d6e1f517b90d3a445ad3c0689ed8
|
[
"BSD-3-Clause"
] | 8
|
2020-08-14T06:23:14.000Z
|
2022-01-03T04:28:58.000Z
|
wormpose/dataset/loaders/__init__.py
|
Tubbz-alt/wormpose
|
a92c0459f940d6e1f517b90d3a445ad3c0689ed8
|
[
"BSD-3-Clause"
] | 11
|
2020-07-18T20:43:00.000Z
|
2022-03-17T18:27:57.000Z
|
"""
Custom loaders for different datasets
"""
| 11.5
| 37
| 0.717391
| 5
| 46
| 6.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152174
| 46
| 3
| 38
| 15.333333
| 0.846154
| 0.804348
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
031bf84f9d64353a8983dec28cbecfe2cefeff67
| 34
|
py
|
Python
|
passenger_wsgi.py
|
shivjeetbhullar/institute-management
|
ae9fde137cf17afeb393d08fcafdeb285e13e286
|
[
"MIT"
] | 1
|
2021-02-03T16:36:38.000Z
|
2021-02-03T16:36:38.000Z
|
passenger_wsgi.py
|
shivjeetbhullar/institute-management
|
ae9fde137cf17afeb393d08fcafdeb285e13e286
|
[
"MIT"
] | null | null | null |
passenger_wsgi.py
|
shivjeetbhullar/institute-management
|
ae9fde137cf17afeb393d08fcafdeb285e13e286
|
[
"MIT"
] | null | null | null |
from Web import app as application
| 34
| 34
| 0.852941
| 6
| 34
| 4.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 34
| 1
| 34
| 34
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
03773bdc45fa59a305e61e0a2cddb2ba268457e3
| 174
|
py
|
Python
|
symposion/schedule/apps.py
|
theofanislekkas/updated-symp
|
2bf5fa85ef2adb71325cbdd2bdfef2b0742b614a
|
[
"BSD-3-Clause"
] | null | null | null |
symposion/schedule/apps.py
|
theofanislekkas/updated-symp
|
2bf5fa85ef2adb71325cbdd2bdfef2b0742b614a
|
[
"BSD-3-Clause"
] | null | null | null |
symposion/schedule/apps.py
|
theofanislekkas/updated-symp
|
2bf5fa85ef2adb71325cbdd2bdfef2b0742b614a
|
[
"BSD-3-Clause"
] | null | null | null |
from django.apps import AppConfig
class ScheduleConfig(AppConfig):
name = "symposion.schedule"
label = "symposion_schedule"
verbose_name = "Symposion Schedule"
| 21.75
| 39
| 0.747126
| 18
| 174
| 7.111111
| 0.666667
| 0.398438
| 0.328125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 174
| 7
| 40
| 24.857143
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0.310345
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 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
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
cee8441a2974b3729933b4c274d7877eb2599edc
| 249
|
py
|
Python
|
languages/python/src/src/hello.py
|
at0x0ft/VSCode-Remote-Container-Development-Environments
|
023d7736e0877452e56a31321695be689cf16bec
|
[
"MIT"
] | null | null | null |
languages/python/src/src/hello.py
|
at0x0ft/VSCode-Remote-Container-Development-Environments
|
023d7736e0877452e56a31321695be689cf16bec
|
[
"MIT"
] | null | null | null |
languages/python/src/src/hello.py
|
at0x0ft/VSCode-Remote-Container-Development-Environments
|
023d7736e0877452e56a31321695be689cf16bec
|
[
"MIT"
] | null | null | null |
import os
import sys
from pathlib import Path
def main() -> None:
print(
"Hello, huge huge huge huge huge huge huge huge huge huge huge huge huge huge huge huge huge huge long long World!"
)
if __name__ == "__main__":
main()
| 17.785714
| 123
| 0.666667
| 38
| 249
| 4.157895
| 0.421053
| 0.860759
| 1.21519
| 1.518987
| 0.455696
| 0.455696
| 0.455696
| 0.455696
| 0.455696
| 0.455696
| 0
| 0
| 0.261044
| 249
| 13
| 124
| 19.153846
| 0.858696
| 0
| 0
| 0
| 0
| 0.111111
| 0.485944
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| true
| 0
| 0.333333
| 0
| 0.444444
| 0.111111
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
30018186d5a6357b80f654fb62da08b103f5d7aa
| 14,779
|
py
|
Python
|
sensirion_shdlc_svm41/commands/algorithm_parameters.py
|
Sensirion/python-shdlc-svm41
|
8712818bfbecaa0f1b40ece042f3969a921ed64e
|
[
"BSD-3-Clause"
] | null | null | null |
sensirion_shdlc_svm41/commands/algorithm_parameters.py
|
Sensirion/python-shdlc-svm41
|
8712818bfbecaa0f1b40ece042f3969a921ed64e
|
[
"BSD-3-Clause"
] | null | null | null |
sensirion_shdlc_svm41/commands/algorithm_parameters.py
|
Sensirion/python-shdlc-svm41
|
8712818bfbecaa0f1b40ece042f3969a921ed64e
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
# (c) Copyright 2021 Sensirion AG, Switzerland
##############################################################################
##############################################################################
# _____ _ _ _______ _____ ____ _ _
# / ____| /\ | | | |__ __|_ _/ __ \| \ | |
# | | / \ | | | | | | | || | | | \| |
# | | / /\ \| | | | | | | || | | | . ` |
# | |____ / ____ \ |__| | | | _| || |__| | |\ |
# \_____/_/ \_\____/ |_| |_____\____/|_| \_|
#
# THIS FILE IS AUTOMATICALLY GENERATED AND MUST NOT BE EDITED MANUALLY!
#
# Generator: sensirion-shdlc-interface-generator 0.9.0
# Product: SVM41
# Version: 0.8.4
#
##############################################################################
##############################################################################
# flake8: noqa
from __future__ import absolute_import, division, print_function
from sensirion_shdlc_driver.command import ShdlcCommand
from struct import pack, unpack
import logging
log = logging.getLogger(__name__)
class Svm41CmdAlgorithmParametersBase(ShdlcCommand):
"""
SHDLC command 0x60: "Algorithm Parameters".
"""
def __init__(self, *args, **kwargs):
"""
Constructor.
"""
super(Svm41CmdAlgorithmParametersBase, self).__init__(
0x60, *args, **kwargs)
class Svm41CmdGetTemperatureOffsetForRhtMeasurements(Svm41CmdAlgorithmParametersBase):
"""
Get Temperature Offset For Rht Measurements Command
Gets the T-Offset for the temperature compensation of the RHT algorithm.
"""
def __init__(self):
"""
Constructor.
"""
super(Svm41CmdGetTemperatureOffsetForRhtMeasurements, self).__init__(
data=b"".join([bytes(bytearray([0x01]))]),
max_response_time=0.05,
post_processing_time=0.0,
min_response_length=2,
max_response_length=2
)
@staticmethod
def interpret_response(data):
"""
:return: Temperature offset which is used for the RHT measurements.
Values are in degrees celsius with a scaling of 200. Thus the
received value must be divided by 200.
:rtype: int
"""
t_offset = int(unpack(">h", data[0:2])[0]) # int16
return t_offset
class Svm41CmdGetVocTuningParameters(Svm41CmdAlgorithmParametersBase):
"""
Get Voc Tuning Parameters Command
Gets the currently set parameters for customizing the VOC algorithm.
"""
def __init__(self):
"""
Constructor.
"""
super(Svm41CmdGetVocTuningParameters, self).__init__(
data=b"".join([bytes(bytearray([0x0D]))]),
max_response_time=0.05,
post_processing_time=0.0,
min_response_length=12,
max_response_length=12
)
@staticmethod
def interpret_response(data):
"""
:return:
- voc_index_offset (int) -
VOC index representing typical (average) conditions.
- learning_time_offset_hours (int) -
Time constant to estimate the VOC algorithm offset from the
history in hours. Past events will be forgotten after about twice
the learning time.
- learning_time_gain_hours (int) -
Time constant to estimate the VOC algorithm gain from the history
in hours. Past events will be forgotten after about twice the
learning time.
- gating_max_duration_minutes (int) -
Maximum duration of gating in minutes (freeze of estimator during
high VOC index signal). Set to zero to disable the gating.
- std_initial (int) -
Initial estimate for standard deviation. Lower value boosts
events during initial learning period, but may result in larger
device-to-device variations.
- gain_factor (int) -
Gain factor to amplify or to attenuate the VOC index output.
:rtype: tuple
"""
voc_index_offset = int(unpack(">h", data[0:2])[0]) # int16
learning_time_offset_hours = int(unpack(">h", data[2:4])[0]) # int16
learning_time_gain_hours = int(unpack(">h", data[4:6])[0]) # int16
gating_max_duration_minutes = int(unpack(">h", data[6:8])[0]) # int16
std_initial = int(unpack(">h", data[8:10])[0]) # int16
gain_factor = int(unpack(">h", data[10:12])[0]) # int16
return voc_index_offset,\
learning_time_offset_hours,\
learning_time_gain_hours,\
gating_max_duration_minutes,\
std_initial,\
gain_factor
class Svm41CmdGetNoxTuningParameters(Svm41CmdAlgorithmParametersBase):
"""
Get Nox Tuning Parameters Command
Gets the currently set parameters for customizing the NOx algorithm.
"""
def __init__(self):
"""
Constructor.
"""
super(Svm41CmdGetNoxTuningParameters, self).__init__(
data=b"".join([bytes(bytearray([0x0E]))]),
max_response_time=0.05,
post_processing_time=0.0,
min_response_length=12,
max_response_length=12
)
@staticmethod
def interpret_response(data):
"""
:return:
- nox_index_offset (int) -
NOx index representing typical (average) conditions.
- learning_time_offset_hours (int) -
Time constant to estimate the NOx algorithm offset from the
history in hours. Past events will be forgotten after about twice
the learning time.
- learning_time_gain_hours (int) -
The time constant to estimate the NOx algorithm gain from the
history has no impact for NOx. This parameter is still in place
for consistency reasons with the VOC tuning parameters command.
This getter will always return the default value.
- gating_max_duration_minutes (int) -
Maximum duration of gating in minutes (freeze of estimator during
high NOx index signal). Set to zero to disable the gating.
- std_initial (int) -
The initial estimate for standard deviation has no impact for
NOx. This parameter is still in place for consistency reasons
with the VOC tuning parameters command. This getter will always
return the default value.
- gain_factor (int) -
Gain factor to amplify or to attenuate the NOx index output.
:rtype: tuple
"""
nox_index_offset = int(unpack(">h", data[0:2])[0]) # int16
learning_time_offset_hours = int(unpack(">h", data[2:4])[0]) # int16
learning_time_gain_hours = int(unpack(">h", data[4:6])[0]) # int16
gating_max_duration_minutes = int(unpack(">h", data[6:8])[0]) # int16
std_initial = int(unpack(">h", data[8:10])[0]) # int16
gain_factor = int(unpack(">h", data[10:12])[0]) # int16
return nox_index_offset,\
learning_time_offset_hours,\
learning_time_gain_hours,\
gating_max_duration_minutes,\
std_initial,\
gain_factor
class Svm41CmdStoreNvData(Svm41CmdAlgorithmParametersBase):
"""
Store Nv Data Command
Stores all algorithm parameters to the non-volatile memory.
"""
def __init__(self):
"""
Constructor.
"""
super(Svm41CmdStoreNvData, self).__init__(
data=b"".join([bytes(bytearray([0x80]))]),
max_response_time=0.5,
post_processing_time=0.0,
min_response_length=0,
max_response_length=0
)
class Svm41CmdSetTemperatureOffsetForRhtMeasurements(Svm41CmdAlgorithmParametersBase):
"""
Set Temperature Offset For Rht Measurements Command
Sets the T-Offset for the temperature compensation of the RHT algorithm.
.. note:: Execute the store command after writing the parameter to store it
in the non-volatile memory of the device otherwise the parameter
will be reset upton a device reset.
"""
def __init__(self, t_offset):
"""
Constructor.
:param int t_offset:
Temperature offset in degrees celsius. Accepted data formats is a
int16 value (2 bytes). Values are in degrees celsius with a scaling
of 200. Thus the provided value must be multiplied by 200.
"""
super(Svm41CmdSetTemperatureOffsetForRhtMeasurements, self).__init__(
data=b"".join([bytes(bytearray([0x81])),
pack(">h", t_offset)]),
max_response_time=0.05,
post_processing_time=0.0,
min_response_length=0,
max_response_length=0
)
class Svm41CmdSetVocTuningParameters(Svm41CmdAlgorithmParametersBase):
"""
Set Voc Tuning Parameters Command
Sets parameters to customize the VOC algorithm. This command is only
available in idle mode.
.. note:: Execute the store command after writing the parameter to store it
in the non-volatile memory of the device otherwise the parameter
will be reset upton a device reset.
"""
def __init__(self, voc_index_offset, learning_time_offset_hours, learning_time_gain_hours, gating_max_duration_minutes, std_initial, gain_factor):
"""
Constructor.
:param int voc_index_offset:
VOC index representing typical (average) conditions. Allowed values
are in range 1..250. The default value is 100.
:param int learning_time_offset_hours:
Time constant to estimate the VOC algorithm offset from the history
in hours. Past events will be forgotten after about twice the
learning time. Allowed values are in range 1..1000. The default
value is 12 hours.
:param int learning_time_gain_hours:
Time constant to estimate the VOC algorithm gain from the history
in hours. Past events will be forgotten after about twice the
learning time. Allowed values are in range 1..1000. The default
value is 12 hours.
:param int gating_max_duration_minutes:
Maximum duration of gating in minutes (freeze of estimator during
high VOC index signal). Set to zero to disable the gating. Allowed
values are in range 0..3000. The default value is 180 minutes.
:param int std_initial:
Initial estimate for standard deviation. Lower value boosts events
during initial learning period, but may result in larger
device-to-device variations. Allowed values are in range 10..5000.
The default value is 50.
:param int gain_factor:
Gain factor to amplify or to attenuate the VOC index output.
Allowed values are in range 1..1000. The default value is 230.
"""
super(Svm41CmdSetVocTuningParameters, self).__init__(
data=b"".join([bytes(bytearray([0x8D])),
pack(">h", voc_index_offset),
pack(">h", learning_time_offset_hours),
pack(">h", learning_time_gain_hours),
pack(">h", gating_max_duration_minutes),
pack(">h", std_initial),
pack(">h", gain_factor)]),
max_response_time=0.05,
post_processing_time=0.0,
min_response_length=0,
max_response_length=0
)
class Svm41CmdSetNoxTuningParameters(Svm41CmdAlgorithmParametersBase):
"""
Set Nox Tuning Parameters Command
Sets parameters to customize the NOx algorithm. This command is only
available in idle mode.
.. note:: Execute the store command after writing the parameter to store it
in the non-volatile memory of the device otherwise the parameter
will be reset upton a device reset.
"""
def __init__(self, nox_index_offset, learning_time_offset_hours, learning_time_gain_hours, gating_max_duration_minutes, std_initial, gain_factor):
"""
Constructor.
:param int nox_index_offset:
NOx index representing typical (average) conditions. Allowed values
are in range 1..250. The default value is 1.
:param int learning_time_offset_hours:
Time constant to estimate the NOx algorithm offset from the history
in hours. Past events will be forgotten after about twice the
learning time. Allowed values are in range 1..1000. The default
value is 12 hours.
:param int learning_time_gain_hours:
The time constant to estimate the NOx algorithm gain from the
history has no impact for the NOx algorithm. This parameter is
still in place for consistency reasons with the VOC tuning
parameters command. This parameter must always be set to 12 hours.
:param int gating_max_duration_minutes:
Maximum duration of gating in minutes (freeze of estimator during
high NOx index signal). Set to zero to disable the gating. Allowed
values are in range 0..3000. The default value is 720 minutes.
:param int std_initial:
The initial estimate for standard deviation parameter has no impact
for the NOx algorithm. This parameter is still in place for
consistency reasons with the VOC tuning parameters command. This
parameter must always be set to 50.
:param int gain_factor:
Gain factor to amplify or to attenuate the NOx index output.
Allowed values are in range 1..1000. The default value is 230.
"""
super(Svm41CmdSetNoxTuningParameters, self).__init__(
data=b"".join([bytes(bytearray([0x8E])),
pack(">h", nox_index_offset),
pack(">h", learning_time_offset_hours),
pack(">h", learning_time_gain_hours),
pack(">h", gating_max_duration_minutes),
pack(">h", std_initial),
pack(">h", gain_factor)]),
max_response_time=0.05,
post_processing_time=0.0,
min_response_length=0,
max_response_length=0
)
| 41.514045
| 150
| 0.599296
| 1,652
| 14,779
| 5.138015
| 0.13862
| 0.042413
| 0.015316
| 0.021442
| 0.789232
| 0.777451
| 0.740575
| 0.715009
| 0.702992
| 0.699694
| 0
| 0.029028
| 0.305366
| 14,779
| 355
| 151
| 41.630986
| 0.797779
| 0.511604
| 0
| 0.555556
| 0
| 0
| 0.00922
| 0
| 0
| 0
| 0.005674
| 0
| 0
| 1
| 0.094017
| false
| 0
| 0.034188
| 0
| 0.222222
| 0.008547
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
30309be84ac55979572e507b05a5e1c36717038c
| 97
|
py
|
Python
|
Flask/market/ext/encrypt.py
|
marcosfelipp/DevelopementStudies
|
8dc962dbe445d756ba9634a0e21f1e244c1762bd
|
[
"MIT"
] | null | null | null |
Flask/market/ext/encrypt.py
|
marcosfelipp/DevelopementStudies
|
8dc962dbe445d756ba9634a0e21f1e244c1762bd
|
[
"MIT"
] | null | null | null |
Flask/market/ext/encrypt.py
|
marcosfelipp/DevelopementStudies
|
8dc962dbe445d756ba9634a0e21f1e244c1762bd
|
[
"MIT"
] | null | null | null |
from flask_bcrypt import Bcrypt
bcrypt = Bcrypt()
def init_app(app):
bcrypt.init_app(app)
| 12.125
| 31
| 0.731959
| 15
| 97
| 4.533333
| 0.466667
| 0.352941
| 0.294118
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175258
| 97
| 7
| 32
| 13.857143
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3062807d4d1a3f976987b3bde372e579db440385
| 24
|
py
|
Python
|
app/data.py
|
kevthecoder/luftdaten-bristol
|
8caf8a79cd32abb81f972dba1e1d7bc63d137119
|
[
"Apache-2.0"
] | 1
|
2020-06-16T10:49:21.000Z
|
2020-06-16T10:49:21.000Z
|
app/data.py
|
kevthecoder/luftdaten-bristol
|
8caf8a79cd32abb81f972dba1e1d7bc63d137119
|
[
"Apache-2.0"
] | 7
|
2018-08-17T16:53:55.000Z
|
2018-10-28T17:44:35.000Z
|
app/data.py
|
kevthecoder/luftdaten-bristol
|
8caf8a79cd32abb81f972dba1e1d7bc63d137119
|
[
"Apache-2.0"
] | 2
|
2018-10-11T14:12:24.000Z
|
2020-03-06T13:57:11.000Z
|
"""Process data."""
| 4
| 19
| 0.458333
| 2
| 24
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 24
| 5
| 20
| 4.8
| 0.611111
| 0.541667
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 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
| 0
| 0
| 0
| 0
|
0
| 5
|
30686be5664b64d64e1c1409c489160f0ef58406
| 129
|
py
|
Python
|
parler/__init__.py
|
perecasxiru/django-parler
|
6c5c7a968728e713f538dbab4ed86ee483c3856d
|
[
"Apache-2.0"
] | null | null | null |
parler/__init__.py
|
perecasxiru/django-parler
|
6c5c7a968728e713f538dbab4ed86ee483c3856d
|
[
"Apache-2.0"
] | null | null | null |
parler/__init__.py
|
perecasxiru/django-parler
|
6c5c7a968728e713f538dbab4ed86ee483c3856d
|
[
"Apache-2.0"
] | null | null | null |
# following PEP 440
__version__ = "2.3"
__all__ = ("is_multilingual_project",)
from .utils.i18n import is_multilingual_project
| 18.428571
| 47
| 0.775194
| 17
| 129
| 5.176471
| 0.823529
| 0.318182
| 0.477273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061947
| 0.124031
| 129
| 6
| 48
| 21.5
| 0.716814
| 0.131783
| 0
| 0
| 0
| 0
| 0.236364
| 0.209091
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
306e021b288710a49bd8af19e47075abc9a72e08
| 197
|
py
|
Python
|
tests/context.py
|
andrewlrogers/srvy
|
51d164fc73be94a46da9e24145ce5d28aa9c64c8
|
[
"MIT"
] | 1
|
2017-06-18T21:37:08.000Z
|
2017-06-18T21:37:08.000Z
|
tests/context.py
|
andrewlrogers/srvy
|
51d164fc73be94a46da9e24145ce5d28aa9c64c8
|
[
"MIT"
] | 12
|
2017-07-13T04:31:07.000Z
|
2018-03-04T03:47:55.000Z
|
tests/context.py
|
andrewlrogers/srvy
|
51d164fc73be94a46da9e24145ce5d28aa9c64c8
|
[
"MIT"
] | null | null | null |
"""Allows unittest to use relative imports (e.g. testing a function imported from srvy/synch) """
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
| 32.833333
| 97
| 0.761421
| 32
| 197
| 4.5625
| 0.71875
| 0.123288
| 0.178082
| 0.205479
| 0.219178
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101523
| 197
| 5
| 98
| 39.4
| 0.824859
| 0.456853
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
3075ce53e0b0d2cc766eeb64409299e42034328d
| 39
|
py
|
Python
|
gearbox/commands/basic_package/__init__.py
|
jknapka/gearbox
|
79dca3e3de37f67d597b8692733471803b84a9e4
|
[
"MIT"
] | 12
|
2015-04-01T19:49:58.000Z
|
2020-04-03T00:50:39.000Z
|
gearbox/commands/basic_package/__init__.py
|
jknapka/gearbox
|
79dca3e3de37f67d597b8692733471803b84a9e4
|
[
"MIT"
] | 23
|
2015-04-01T19:49:38.000Z
|
2022-01-26T11:34:32.000Z
|
gearbox/commands/basic_package/__init__.py
|
jknapka/gearbox
|
79dca3e3de37f67d597b8692733471803b84a9e4
|
[
"MIT"
] | 10
|
2015-10-13T14:20:28.000Z
|
2021-01-02T16:05:51.000Z
|
from .command import MakePackageCommand
| 39
| 39
| 0.897436
| 4
| 39
| 8.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 39
| 1
| 39
| 39
| 0.972222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0621557544ce64a8144492edcc1eb79d22e9fe57
| 2,459
|
py
|
Python
|
tests/rnd/jumper_finder_test.py
|
gmarciani/demule
|
72168ba3aca84f58a882bebc821bbf85ee08dcde
|
[
"MIT"
] | 1
|
2021-03-06T11:05:22.000Z
|
2021-03-06T11:05:22.000Z
|
tests/rnd/jumper_finder_test.py
|
gmarciani/pydes
|
72168ba3aca84f58a882bebc821bbf85ee08dcde
|
[
"MIT"
] | null | null | null |
tests/rnd/jumper_finder_test.py
|
gmarciani/pydes
|
72168ba3aca84f58a882bebc821bbf85ee08dcde
|
[
"MIT"
] | null | null | null |
import unittest
from pydes.core.rnd.inspection import jumper_finder
class JumperTest(unittest.TestCase):
@unittest.skip("Test too expensive for this machine.")
def test_find_jumper_8bit(self):
"""
Verify the correctness of the jumper finder process, for 8bit modulus.
:return: None
"""
MODULUS = 127
MULTIPLIER = 3
STREAMS = 64
JUMPER = 3
JSIZE = 127
jumper, jsize = jumper_finder.find_jumpers(MODULUS, MULTIPLIER, STREAMS)
self.assertEqual(jumper, JUMPER, "Jumper (8 bit) not correct.")
self.assertEqual(jsize, JSIZE, "Jump Size (8 bit) not correct.")
@unittest.skip("Test too expensive for this machine.")
def test_find_jumper_16bit(self):
"""
Verify the correctness of the jumper finder process, for 16bit modulus.
:return: None
"""
MODULUS = 32479
MULTIPLIER = 16374
STREAMS = 128
JUMPER = 32748
JSIZE = 127
jumper, jsize = jumper_finder.find_jumpers(MODULUS, MULTIPLIER, STREAMS)
self.assertEqual(jumper, JUMPER, "Jumper (16 bit) not correct.")
self.assertEqual(jsize, JSIZE, "Jump size (16 bit) not correct.")
@unittest.skip("Test too expensive for this machine.")
def test_find_jumper_32bit(self):
"""
Verify the correctness of the jumper finder process, for 32bit modulus.
:return: None
"""
MODULUS = 2147483647
MULTIPLIER = 48271
STREAMS = 256
JUMPER = 22925
JSIZE = 127
jumper, jsize = jumper_finder.find_jumpers(MODULUS, MULTIPLIER, STREAMS)
self.assertEqual(jumper, JUMPER, "Jumper (32 bit) not correct.")
self.assertEqual(jsize, JSIZE, "Jump size (32 bit) not correct.")
@unittest.skip("Test too expensive for this machine.")
def test_find_jumper_64bit(self):
"""
Verify the correctness of the jumper finder process, for 64bit modulus.
:return: None
"""
MODULUS = 2147483647 # 9223372036854775783
MULTIPLIER = 48271 # -
STREAMS = 256
JUMPER = 22925
JSIZE = 127
jumper, jsize = jumper_finder.find_jumpers(MODULUS, MULTIPLIER, STREAMS)
self.assertEqual(jumper, JUMPER, "Jumper (64 bit) not correct.")
self.assertEqual(jsize, JSIZE, "Jump size (64 bit) not correct.")
if __name__ == "__main__":
unittest.main()
| 31.525641
| 80
| 0.627084
| 280
| 2,459
| 5.403571
| 0.221429
| 0.071381
| 0.068738
| 0.050231
| 0.792465
| 0.747521
| 0.747521
| 0.747521
| 0.747521
| 0.625909
| 0
| 0.073529
| 0.281009
| 2,459
| 77
| 81
| 31.935065
| 0.78224
| 0.148434
| 0
| 0.444444
| 0
| 0
| 0.196138
| 0
| 0
| 0
| 0
| 0
| 0.177778
| 1
| 0.088889
| false
| 0
| 0.044444
| 0
| 0.155556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
06528e96fc200099b00724138ffa0fa43ba7956a
| 803
|
py
|
Python
|
densepose/__init__.py
|
zetyquickly/DensePoseFnL
|
f70ccaeb208eb4814a865523ea732ed99541ea9c
|
[
"MIT"
] | 95
|
2020-06-30T02:25:40.000Z
|
2022-03-17T07:21:18.000Z
|
densepose/__init__.py
|
rakhimovv/DensePoseFnL
|
309609b2545364f561ae0a07ecc3020468cf316b
|
[
"MIT"
] | 17
|
2020-06-30T10:03:01.000Z
|
2022-03-16T21:09:05.000Z
|
densepose/__init__.py
|
rakhimovv/DensePoseFnL
|
309609b2545364f561ae0a07ecc3020468cf316b
|
[
"MIT"
] | 17
|
2020-06-30T02:25:43.000Z
|
2022-01-20T01:03:06.000Z
|
from . import dataset # just to register data
from .config import add_densepose_config
from .dataset_mapper import DatasetMapper
from .densepose_head import ROI_DENSEPOSE_HEAD_REGISTRY
from .evaluator import DensePoseCOCOEvaluator
from .modeling.config import add_efficientnet_config, add_roi_shared_config
from .modeling.geffnet_backbone import *
from .modeling.geffnet_backbone_v2 import *
from .modeling.geffnet_box_head import *
from .modeling.geffnet_densepose_head import *
from .modeling.geffnet_mask_head import *
from .modeling.geffnet_rpn import *
from .modeling.shared_roi_head import *
from .modeling.layers.bifpn import BiFPN, Conv3x3BnReLU, FastNormalizedFusion
from .roi_head import DensePoseROIHeads
from .structures import DensePoseDataRelative, DensePoseList, DensePoseTransformData
| 44.611111
| 84
| 0.856787
| 100
| 803
| 6.63
| 0.35
| 0.162896
| 0.190045
| 0.188537
| 0.131222
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004127
| 0.094645
| 803
| 17
| 85
| 47.235294
| 0.90784
| 0.026152
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
066238b71c64c2c243b0f6453a39f49dae2b505f
| 66
|
py
|
Python
|
python/8Kyu/Grasshopper - Debug sayHello.py
|
athasv/Codewars-data
|
5e106466e709fd776f23585ad9f652d0d65b48d3
|
[
"MIT"
] | null | null | null |
python/8Kyu/Grasshopper - Debug sayHello.py
|
athasv/Codewars-data
|
5e106466e709fd776f23585ad9f652d0d65b48d3
|
[
"MIT"
] | null | null | null |
python/8Kyu/Grasshopper - Debug sayHello.py
|
athasv/Codewars-data
|
5e106466e709fd776f23585ad9f652d0d65b48d3
|
[
"MIT"
] | null | null | null |
def say_hello(name):
return "{}".format("Hello, " + str(name))
| 33
| 45
| 0.606061
| 9
| 66
| 4.333333
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 66
| 2
| 45
| 33
| 0.696429
| 0
| 0
| 0
| 0
| 0
| 0.134328
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
0667ac88205594183ce7b8d41bc6f92077c0f8e4
| 20
|
py
|
Python
|
helloWorld.py
|
Shreya202/profiles-rest-api
|
bb5d0c5ccba326ec09c46ca7e99880c61d1a22cd
|
[
"MIT"
] | null | null | null |
helloWorld.py
|
Shreya202/profiles-rest-api
|
bb5d0c5ccba326ec09c46ca7e99880c61d1a22cd
|
[
"MIT"
] | null | null | null |
helloWorld.py
|
Shreya202/profiles-rest-api
|
bb5d0c5ccba326ec09c46ca7e99880c61d1a22cd
|
[
"MIT"
] | null | null | null |
print ("HelloWorld")
| 20
| 20
| 0.75
| 2
| 20
| 7.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05
| 20
| 1
| 20
| 20
| 0.789474
| 0
| 0
| 0
| 0
| 0
| 0.47619
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
0678c6c5fb9a0bce002b1fc9d61f5d43d4c105bc
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/pip/_vendor/chardet/codingstatemachine.py
|
Retraces/UkraineBot
|
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/pip/_vendor/chardet/codingstatemachine.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/pip/_vendor/chardet/codingstatemachine.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/55/8a/7f/e9ccb2922e6c1e05c34999d75b8ab5a1e94773772ef40c904d7eeeba0f
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.395833
| 0
| 96
| 1
| 96
| 96
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 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 | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0688cb97639797df23194145dce03d754c381793
| 204
|
py
|
Python
|
ragpicker/utils/pyasn1/codec/der/decoder.py
|
K4lium/Snakepit
|
c11f3fb7f78b886dad09421bc84a97ee14b9bf0b
|
[
"MIT"
] | 7
|
2016-09-09T08:09:24.000Z
|
2018-03-28T11:51:56.000Z
|
ragpicker/utils/pyasn1/codec/der/decoder.py
|
Kalium/Snakepit
|
c11f3fb7f78b886dad09421bc84a97ee14b9bf0b
|
[
"MIT"
] | 2
|
2016-11-13T01:43:29.000Z
|
2017-08-16T07:51:51.000Z
|
ragpicker/utils/pyasn1/codec/der/decoder.py
|
K4lium/Snakepit
|
c11f3fb7f78b886dad09421bc84a97ee14b9bf0b
|
[
"MIT"
] | 8
|
2016-09-09T08:09:37.000Z
|
2018-08-15T20:58:14.000Z
|
# DER decoder
from utils.pyasn1.type import univ
from utils.pyasn1.codec.cer import decoder
tagMap = decoder.tagMap
typeMap = decoder.typeMap
Decoder = decoder.Decoder
decode = Decoder(tagMap, typeMap)
| 20.4
| 42
| 0.794118
| 28
| 204
| 5.785714
| 0.464286
| 0.240741
| 0.185185
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011236
| 0.127451
| 204
| 9
| 43
| 22.666667
| 0.898876
| 0.053922
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0697080e2499dd0d281c4ab50c420e929ec86375
| 40
|
py
|
Python
|
zimports/vendored/__init__.py
|
sqlalchemyorg/zimports
|
66f65b6ecf9f8fc434aff2b4ded1d6738085bbd7
|
[
"MIT"
] | 65
|
2019-01-02T05:44:38.000Z
|
2021-11-08T11:47:09.000Z
|
zimports/vendored/__init__.py
|
sqlalchemyorg/zimports
|
66f65b6ecf9f8fc434aff2b4ded1d6738085bbd7
|
[
"MIT"
] | 32
|
2019-01-07T15:43:15.000Z
|
2022-02-09T20:36:32.000Z
|
zimports/vendored/__init__.py
|
sqlalchemyorg/zimports
|
66f65b6ecf9f8fc434aff2b4ded1d6738085bbd7
|
[
"MIT"
] | 7
|
2019-01-07T15:11:31.000Z
|
2020-07-08T17:42:13.000Z
|
"""Vendored code from other packages"""
| 20
| 39
| 0.725
| 5
| 40
| 5.8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 40
| 1
| 40
| 40
| 0.828571
| 0.825
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
2322217ab58976b1c9a91475b7120259e7b2e9d3
| 32
|
py
|
Python
|
unstdlib/__init__.py
|
wolever/unstdlib.py
|
ecf803d5bd0458ff916f9bff11251100be3e2ad1
|
[
"MIT"
] | 83
|
2015-01-02T22:57:14.000Z
|
2022-03-13T00:48:57.000Z
|
unstdlib/__init__.py
|
wolever/unstdlib.py
|
ecf803d5bd0458ff916f9bff11251100be3e2ad1
|
[
"MIT"
] | 11
|
2015-01-03T20:00:21.000Z
|
2019-09-08T14:46:32.000Z
|
unstdlib/__init__.py
|
wolever/unstdlib.py
|
ecf803d5bd0458ff916f9bff11251100be3e2ad1
|
[
"MIT"
] | 11
|
2015-02-25T19:43:03.000Z
|
2021-09-18T00:03:44.000Z
|
from unstdlib.standard import *
| 16
| 31
| 0.8125
| 4
| 32
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 32
| 1
| 32
| 32
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
232b6c6662e8bc20e6b4488ebb58ba67cf2da7d8
| 90
|
py
|
Python
|
supreme/photometry/__init__.py
|
KirillDZR/supreme
|
c296722599363bd0cbcce6877bd9de9b066cb74b
|
[
"BSD-3-Clause"
] | 95
|
2015-01-17T09:48:20.000Z
|
2021-11-07T16:02:38.000Z
|
supreme/photometry/__init__.py
|
KirillDZR/supreme
|
c296722599363bd0cbcce6877bd9de9b066cb74b
|
[
"BSD-3-Clause"
] | 4
|
2015-10-23T15:13:34.000Z
|
2019-09-23T22:47:10.000Z
|
supreme/photometry/__init__.py
|
KirillDZR/supreme
|
c296722599363bd0cbcce6877bd9de9b066cb74b
|
[
"BSD-3-Clause"
] | 34
|
2015-02-22T20:54:40.000Z
|
2022-02-27T13:39:32.000Z
|
"""Photometry, includes high-dynamic range imaging."""
from register import *
import hdr
| 18
| 54
| 0.755556
| 11
| 90
| 6.181818
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 90
| 4
| 55
| 22.5
| 0.871795
| 0.533333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
235743bbf3c16fc70804969728e6883b071746b5
| 37
|
py
|
Python
|
mpf/migrator/__init__.py
|
Scottacus64/mpf
|
fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a
|
[
"MIT"
] | 163
|
2015-01-25T02:19:50.000Z
|
2022-03-26T12:00:28.000Z
|
mpf/migrator/__init__.py
|
Scottacus64/mpf
|
fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a
|
[
"MIT"
] | 1,086
|
2015-03-23T19:53:17.000Z
|
2022-03-24T20:46:11.000Z
|
mpf/migrator/__init__.py
|
Scottacus64/mpf
|
fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a
|
[
"MIT"
] | 148
|
2015-01-28T02:31:39.000Z
|
2022-03-22T13:54:01.000Z
|
"""Contains the migrator classes."""
| 18.5
| 36
| 0.702703
| 4
| 37
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 37
| 1
| 37
| 37
| 0.787879
| 0.810811
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
88cac6dc9350a0d39c41bbdc0f30e24dd70bbffd
| 89
|
py
|
Python
|
feature1-add/addition.py
|
HARISHM055/the-true-pythons
|
1254679d782a715afc923571c4e459faab6f5de9
|
[
"MIT"
] | null | null | null |
feature1-add/addition.py
|
HARISHM055/the-true-pythons
|
1254679d782a715afc923571c4e459faab6f5de9
|
[
"MIT"
] | null | null | null |
feature1-add/addition.py
|
HARISHM055/the-true-pythons
|
1254679d782a715afc923571c4e459faab6f5de9
|
[
"MIT"
] | null | null | null |
a=int(input("Enter a value"))
b=int(input("Enter a value"))
c=a+b
print("Addition is",c)
| 17.8
| 29
| 0.662921
| 19
| 89
| 3.105263
| 0.526316
| 0.271186
| 0.440678
| 0.474576
| 0.644068
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101124
| 89
| 4
| 30
| 22.25
| 0.7375
| 0
| 0
| 0
| 0
| 0
| 0.41573
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
002ca7a9a0a351defa088d10dd4be69b2ee7385d
| 51
|
py
|
Python
|
__init__.py
|
sayebms1/binary_evolution
|
a2821963b45135013e9fb383291f3614c5723210
|
[
"MIT"
] | 1
|
2020-09-21T20:54:36.000Z
|
2020-09-21T20:54:36.000Z
|
__init__.py
|
sayebms1/binary_evolution
|
a2821963b45135013e9fb383291f3614c5723210
|
[
"MIT"
] | null | null | null |
__init__.py
|
sayebms1/binary_evolution
|
a2821963b45135013e9fb383291f3614c5723210
|
[
"MIT"
] | null | null | null |
# binary_evolution initializing script
import h5py
| 17
| 38
| 0.862745
| 6
| 51
| 7.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.117647
| 51
| 2
| 39
| 25.5
| 0.933333
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
aea2438d99a29bdb64e56b834fefbe9e2a8eb1e3
| 243
|
py
|
Python
|
converter/xmltoknml.py
|
kdap/kdap
|
95ab7b02ba6dcef202c2109c31a0c32c12ecd29c
|
[
"BSD-3-Clause"
] | null | null | null |
converter/xmltoknml.py
|
kdap/kdap
|
95ab7b02ba6dcef202c2109c31a0c32c12ecd29c
|
[
"BSD-3-Clause"
] | null | null | null |
converter/xmltoknml.py
|
kdap/kdap
|
95ab7b02ba6dcef202c2109c31a0c32c12ecd29c
|
[
"BSD-3-Clause"
] | null | null | null |
from compressor import compress
from wiki_converter import wiki_knml_converter
import os
file_name = input("Enter path of XML file:")
wiki_knml_converter(file_name)
file_name = file_name[:-4] + '.knml'
compress(file_name)
os.remove(file_name)
| 27
| 46
| 0.806584
| 39
| 243
| 4.74359
| 0.435897
| 0.259459
| 0.183784
| 0.172973
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004587
| 0.102881
| 243
| 9
| 47
| 27
| 0.844037
| 0
| 0
| 0
| 0
| 0
| 0.114754
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.375
| 0
| 0.375
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
aeef6ea5f367b0c1bba4f77b8b2a2803c0591e7c
| 223
|
py
|
Python
|
Configuration/StandardSequences/python/Accelerators_cff.py
|
PKUfudawei/cmssw
|
8fbb5ce74398269c8a32956d7c7943766770c093
|
[
"Apache-2.0"
] | 1
|
2021-11-30T16:24:46.000Z
|
2021-11-30T16:24:46.000Z
|
Configuration/StandardSequences/python/Accelerators_cff.py
|
PKUfudawei/cmssw
|
8fbb5ce74398269c8a32956d7c7943766770c093
|
[
"Apache-2.0"
] | 4
|
2021-11-29T13:57:56.000Z
|
2022-03-29T06:28:36.000Z
|
Configuration/StandardSequences/python/Accelerators_cff.py
|
PKUfudawei/cmssw
|
8fbb5ce74398269c8a32956d7c7943766770c093
|
[
"Apache-2.0"
] | 1
|
2022-02-27T06:12:26.000Z
|
2022-02-27T06:12:26.000Z
|
import FWCore.ParameterSet.Config as cms
# This fragment is intended to collect all ProcessAccelerator objects
# used in production
from HeterogeneousCore.CUDACore.ProcessAcceleratorCUDA_cfi import ProcessAcceleratorCUDA
| 31.857143
| 88
| 0.865471
| 25
| 223
| 7.68
| 0.92
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107623
| 223
| 6
| 89
| 37.166667
| 0.964824
| 0.38565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
4e19d17fd732051cc406b3424df0ffc924ed660a
| 42
|
py
|
Python
|
utils/__init__.py
|
cogtoolslab/projection_block_construction
|
faae126fbb7da45f2c5f4df05a2ff606a2b86d59
|
[
"MIT"
] | null | null | null |
utils/__init__.py
|
cogtoolslab/projection_block_construction
|
faae126fbb7da45f2c5f4df05a2ff606a2b86d59
|
[
"MIT"
] | 1
|
2022-02-19T00:04:14.000Z
|
2022-02-19T00:04:14.000Z
|
utils/__init__.py
|
cogtoolslab/tools_block_construction
|
e573b28b2a53d27268414dab17b9be4dda257230
|
[
"MIT"
] | null | null | null |
#Marks this as module to allow for imports
| 42
| 42
| 0.809524
| 8
| 42
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 42
| 1
| 42
| 42
| 0.971429
| 0.97619
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4e20df361d441c700e44b5380d67eab163e102b5
| 7,013
|
py
|
Python
|
Ryven/packages/auto_generated/compileall/nodes.py
|
tfroehlich82/Ryven
|
cb57c91d13949712844a4410a9302c4a90d28dcd
|
[
"MIT"
] | 2,872
|
2020-07-01T09:06:34.000Z
|
2022-03-31T05:52:32.000Z
|
Ryven/packages/auto_generated/compileall/nodes.py
|
dhf327/Ryven
|
a11e361528d982a9dd3c489dd536f8b05ffd56e1
|
[
"MIT"
] | 59
|
2020-06-28T12:50:50.000Z
|
2022-03-27T19:07:54.000Z
|
Ryven/packages/auto_generated/compileall/nodes.py
|
dhf327/Ryven
|
a11e361528d982a9dd3c489dd536f8b05ffd56e1
|
[
"MIT"
] | 339
|
2020-07-05T04:36:20.000Z
|
2022-03-24T07:25:18.000Z
|
from NENV import *
import compileall
class NodeBase(Node):
pass
class _Walk_Dir_Node(NodeBase):
"""
"""
title = '_walk_dir'
type_ = 'compileall'
init_inputs = [
NodeInputBP(label='dir'),
NodeInputBP(label='maxlevels'),
NodeInputBP(label='quiet', dtype=dtypes.Data(default=0, size='s')),
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color = '#32DA22'
def update_event(self, inp=-1):
self.set_output_val(0, compileall._walk_dir(self.input(0), self.input(1), self.input(2)))
class Compile_Dir_Node(NodeBase):
"""
Byte-compile all modules in the given directory tree.
Arguments (only dir is required):
dir: the directory to byte-compile
maxlevels: maximum recursion level (default `sys.getrecursionlimit()`)
ddir: the directory that will be prepended to the path to the
file as it is compiled into each byte-code file.
force: if True, force compilation, even if timestamps are up-to-date
quiet: full output with False or 0, errors only with 1,
no output with 2
legacy: if True, produce legacy pyc paths instead of PEP 3147 paths
optimize: int or list of optimization levels or -1 for level of
the interpreter. Multiple levels leads to multiple compiled
files each with one optimization level.
workers: maximum number of parallel workers
invalidation_mode: how the up-to-dateness of the pyc will be checked
stripdir: part of path to left-strip from source file path
prependdir: path to prepend to beginning of original file path, applied
after stripdir
limit_sl_dest: ignore symlinks if they are pointing outside of
the defined path
hardlink_dupes: hardlink duplicated pyc files
"""
title = 'compile_dir'
type_ = 'compileall'
init_inputs = [
NodeInputBP(label='dir'),
NodeInputBP(label='maxlevels', dtype=dtypes.Data(default=None, size='s')),
NodeInputBP(label='ddir', dtype=dtypes.Data(default=None, size='s')),
NodeInputBP(label='force', dtype=dtypes.Data(default=False, size='s')),
NodeInputBP(label='rx', dtype=dtypes.Data(default=None, size='s')),
NodeInputBP(label='quiet', dtype=dtypes.Data(default=0, size='s')),
NodeInputBP(label='legacy', dtype=dtypes.Data(default=False, size='s')),
NodeInputBP(label='optimize', dtype=dtypes.Data(default=-1, size='s')),
NodeInputBP(label='workers', dtype=dtypes.Data(default=1, size='s')),
NodeInputBP(label='invalidation_mode', dtype=dtypes.Data(default=None, size='s')),
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color = '#32DA22'
def update_event(self, inp=-1):
self.set_output_val(0, compileall.compile_dir(self.input(0), self.input(1), self.input(2), self.input(3), self.input(4), self.input(5), self.input(6), self.input(7), self.input(8), self.input(9)))
class Compile_File_Node(NodeBase):
"""
Byte-compile one file.
Arguments (only fullname is required):
fullname: the file to byte-compile
ddir: if given, the directory name compiled in to the
byte-code file.
force: if True, force compilation, even if timestamps are up-to-date
quiet: full output with False or 0, errors only with 1,
no output with 2
legacy: if True, produce legacy pyc paths instead of PEP 3147 paths
optimize: int or list of optimization levels or -1 for level of
the interpreter. Multiple levels leads to multiple compiled
files each with one optimization level.
invalidation_mode: how the up-to-dateness of the pyc will be checked
stripdir: part of path to left-strip from source file path
prependdir: path to prepend to beginning of original file path, applied
after stripdir
limit_sl_dest: ignore symlinks if they are pointing outside of
the defined path.
hardlink_dupes: hardlink duplicated pyc files
"""
title = 'compile_file'
type_ = 'compileall'
init_inputs = [
NodeInputBP(label='fullname'),
NodeInputBP(label='ddir', dtype=dtypes.Data(default=None, size='s')),
NodeInputBP(label='force', dtype=dtypes.Data(default=False, size='s')),
NodeInputBP(label='rx', dtype=dtypes.Data(default=None, size='s')),
NodeInputBP(label='quiet', dtype=dtypes.Data(default=0, size='s')),
NodeInputBP(label='legacy', dtype=dtypes.Data(default=False, size='s')),
NodeInputBP(label='optimize', dtype=dtypes.Data(default=-1, size='s')),
NodeInputBP(label='invalidation_mode', dtype=dtypes.Data(default=None, size='s')),
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color = '#32DA22'
def update_event(self, inp=-1):
self.set_output_val(0, compileall.compile_file(self.input(0), self.input(1), self.input(2), self.input(3), self.input(4), self.input(5), self.input(6), self.input(7)))
class Compile_Path_Node(NodeBase):
"""
Byte-compile all module on sys.path.
Arguments (all optional):
skip_curdir: if true, skip current directory (default True)
maxlevels: max recursion level (default 0)
force: as for compile_dir() (default False)
quiet: as for compile_dir() (default 0)
legacy: as for compile_dir() (default False)
optimize: as for compile_dir() (default -1)
invalidation_mode: as for compiler_dir()
"""
title = 'compile_path'
type_ = 'compileall'
init_inputs = [
NodeInputBP(label='skip_curdir', dtype=dtypes.Data(default=1, size='s')),
NodeInputBP(label='maxlevels', dtype=dtypes.Data(default=0, size='s')),
NodeInputBP(label='force', dtype=dtypes.Data(default=False, size='s')),
NodeInputBP(label='quiet', dtype=dtypes.Data(default=0, size='s')),
NodeInputBP(label='legacy', dtype=dtypes.Data(default=False, size='s')),
NodeInputBP(label='optimize', dtype=dtypes.Data(default=-1, size='s')),
NodeInputBP(label='invalidation_mode', dtype=dtypes.Data(default=None, size='s')),
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color = '#32DA22'
def update_event(self, inp=-1):
self.set_output_val(0, compileall.compile_path(self.input(0), self.input(1), self.input(2), self.input(3), self.input(4), self.input(5), self.input(6)))
class Main_Node(NodeBase):
"""
Script main program."""
title = 'main'
type_ = 'compileall'
init_inputs = [
]
init_outputs = [
NodeOutputBP(type_='data'),
]
color = '#32DA22'
def update_event(self, inp=-1):
self.set_output_val(0, compileall.main())
export_nodes(
_Walk_Dir_Node,
Compile_Dir_Node,
Compile_File_Node,
Compile_Path_Node,
Main_Node,
)
| 37.303191
| 204
| 0.645943
| 916
| 7,013
| 4.85262
| 0.175764
| 0.100787
| 0.08099
| 0.118785
| 0.794151
| 0.772553
| 0.742407
| 0.740382
| 0.740382
| 0.718335
| 0
| 0.016126
| 0.230714
| 7,013
| 187
| 205
| 37.502674
| 0.807785
| 0.362185
| 0
| 0.553191
| 0
| 0
| 0.089078
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.053191
| false
| 0.010638
| 0.021277
| 0
| 0.404255
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4e214d3929998d56a4b318a1682ea62ade915bf7
| 61
|
py
|
Python
|
boilerplate/middlewares/helpers/__init__.py
|
ham2qur/paper_monolithic_microservices
|
0442dabe9e05d92b176257c111002ff688c4b3cb
|
[
"MIT"
] | 17
|
2018-08-07T03:59:19.000Z
|
2020-12-03T14:28:46.000Z
|
boilerplate/middlewares/helpers/__init__.py
|
ham2qur/paper_monolithic_microservices
|
0442dabe9e05d92b176257c111002ff688c4b3cb
|
[
"MIT"
] | 3
|
2020-06-05T18:24:14.000Z
|
2021-06-10T20:28:20.000Z
|
boilerplate/middlewares/helpers/__init__.py
|
shreybatra/Blog-O-Mania-Backend
|
8847e7b9c29c402b30d439294fc9deaf7005d0ce
|
[
"MIT"
] | 3
|
2018-08-11T18:17:24.000Z
|
2020-04-28T06:56:05.000Z
|
from .request_validator_model import RequestValidationConfig
| 30.5
| 60
| 0.918033
| 6
| 61
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065574
| 61
| 1
| 61
| 61
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
9d75f16eb6f1de4b9d8e10559e1c26892d29e361
| 281
|
py
|
Python
|
Color.py
|
saurabhgupta17888/Fraud-Analysis
|
a0267abea9a8174f3c832aa178d91aaf3c912318
|
[
"MIT"
] | 39
|
2018-09-12T02:35:15.000Z
|
2022-02-24T07:12:29.000Z
|
Color.py
|
saurabhgupta17888/Fraud-Analysis
|
a0267abea9a8174f3c832aa178d91aaf3c912318
|
[
"MIT"
] | 5
|
2018-10-10T19:53:21.000Z
|
2019-11-20T12:58:32.000Z
|
Color.py
|
saurabhgupta17888/Fraud-Analysis
|
a0267abea9a8174f3c832aa178d91aaf3c912318
|
[
"MIT"
] | 27
|
2018-07-10T08:11:20.000Z
|
2021-12-19T16:29:37.000Z
|
class Color:
PURPLE = '\033[1m\033[95m'
CYAN = '\033[1m\033[96m'
DARKCYAN = '\033[1m\033[36m'
BLUE = '\033[1m\033[94m'
GREEN = '\033[1m\033[92m'
YELLOW = '\033[1m\033[93m'
RED = '\033[1m\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
| 23.416667
| 31
| 0.548043
| 46
| 281
| 3.347826
| 0.5
| 0.25974
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.342466
| 0.220641
| 281
| 11
| 32
| 25.545455
| 0.360731
| 0
| 0
| 0
| 0
| 0
| 0.448399
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
9d7e4d569ddf23c8a24f662a351da726d4ec351b
| 211
|
py
|
Python
|
FCB1010/__init__.py
|
gaelhuot/FCB1010-Ableton-live
|
d3cbe36a3d85d5632a09517f7137c68a2206598f
|
[
"Apache-2.0"
] | 2
|
2021-10-08T11:46:52.000Z
|
2021-12-15T20:15:53.000Z
|
FCB1010/__init__.py
|
gaelhuot/FCB1010-Ableton-live
|
d3cbe36a3d85d5632a09517f7137c68a2206598f
|
[
"Apache-2.0"
] | null | null | null |
FCB1010/__init__.py
|
gaelhuot/FCB1010-Ableton-live
|
d3cbe36a3d85d5632a09517f7137c68a2206598f
|
[
"Apache-2.0"
] | 2
|
2021-10-17T02:24:55.000Z
|
2022-03-31T02:41:30.000Z
|
# emacs-mode: -*- python-*-
# -*- coding: utf-8 -*-
import Live
from .FCB1010 import FCB1010
def create_instance(c_instance):
return FCB1010(c_instance)
# local variables:
# tab-width: 4
| 15.071429
| 33
| 0.630332
| 26
| 211
| 5
| 0.769231
| 0.138462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08642
| 0.232227
| 211
| 13
| 34
| 16.230769
| 0.716049
| 0.364929
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
9d96ce3ff52d232a5da7fd3a36fc9401a6b256b9
| 128
|
py
|
Python
|
jwxt/admin.py
|
paressuex11/mysite
|
416e49ebe041aa8a1f67e56c9664961f5f714ccc
|
[
"Apache-2.0"
] | null | null | null |
jwxt/admin.py
|
paressuex11/mysite
|
416e49ebe041aa8a1f67e56c9664961f5f714ccc
|
[
"Apache-2.0"
] | 7
|
2020-02-12T02:36:37.000Z
|
2022-02-10T10:10:11.000Z
|
jwxt/admin.py
|
paressuex11/mysite
|
416e49ebe041aa8a1f67e56c9664961f5f714ccc
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import ArticlePost
admin.site.register(ArticlePost)
| 21.333333
| 32
| 0.820313
| 17
| 128
| 6.176471
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117188
| 128
| 6
| 33
| 21.333333
| 0.929204
| 0.203125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 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
| 5
|
d18d2231e33b1398489d8cb8ae750e5dfd0e3996
| 32
|
py
|
Python
|
Exercicios - Mundo1/Ex001.py
|
BrianMath/ExerciciosPythonCeV
|
4960f1a58d281b32afd5dfd6ea65e0ae5ad48b4f
|
[
"MIT"
] | null | null | null |
Exercicios - Mundo1/Ex001.py
|
BrianMath/ExerciciosPythonCeV
|
4960f1a58d281b32afd5dfd6ea65e0ae5ad48b4f
|
[
"MIT"
] | null | null | null |
Exercicios - Mundo1/Ex001.py
|
BrianMath/ExerciciosPythonCeV
|
4960f1a58d281b32afd5dfd6ea65e0ae5ad48b4f
|
[
"MIT"
] | null | null | null |
# Ex. 001
print("Olá, Mundo!")
| 8
| 20
| 0.5625
| 5
| 32
| 3.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 0.1875
| 32
| 3
| 21
| 10.666667
| 0.576923
| 0.21875
| 0
| 0
| 0
| 0
| 0.478261
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
d19501c133b8e56632bda2474bba94a980d501bc
| 42,180
|
py
|
Python
|
src/tests/test_DerivationADV.py
|
s231644/DerivBaseRu
|
0f246dc0ba7886e5dca76ab9a730b2a4a9995ae2
|
[
"Apache-2.0"
] | 2
|
2019-05-07T15:24:35.000Z
|
2021-02-25T22:50:11.000Z
|
src/tests/test_DerivationADV.py
|
s231644/DerivBaseRu
|
0f246dc0ba7886e5dca76ab9a730b2a4a9995ae2
|
[
"Apache-2.0"
] | null | null | null |
src/tests/test_DerivationADV.py
|
s231644/DerivBaseRu
|
0f246dc0ba7886e5dca76ab9a730b2a4a9995ae2
|
[
"Apache-2.0"
] | null | null | null |
import unittest
from src.Derivation import Derivation
class TestDerivation(unittest.TestCase):
def setUp(self):
self.derivation = Derivation()
def tearDown(self):
del self.derivation
def test_adv_977(self):
results = self.derivation.derive(word_b='быстрый', pos_b='adj', pos_a='adv')
self.assertIn('быстро', results)
results = self.derivation.derive(word_b='искренний', pos_b='adj', pos_a='adv')
self.assertIn('искренне', results)
results = self.derivation.derive(word_b='двоякий', pos_b='adj', pos_a='adv')
self.assertIn('двояко', results)
results = self.derivation.derive(word_b='певучий', pos_b='adj', pos_a='adv')
self.assertIn('певуче', results)
results = self.derivation.derive(word_b='свежий', pos_b='adj', pos_a='adv')
self.assertIn('свежо', results)
def test_adv_977_2(self):
results = self.derivation.derive(word_b='броский', pos_b='adj', pos_a='adv')
self.assertIn('броско', results)
results = self.derivation.derive(word_b='веский', pos_b='adj', pos_a='adv')
self.assertIn('веско', results)
def test_adv_979(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='всяческий', pos_b='adj', pos_a='adv')
self.assertIn('всячески', results)
results = self.derivation.derive(word_b='воровской', pos_b='adj', pos_a='adv')
self.assertIn('воровски', results)
def test_adv_979_2(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='медвежий', pos_b='adj', pos_a='adv')
self.assertIn('медвежьи', results)
results = self.derivation.derive(word_b='бабий', pos_b='adj', pos_a='adv')
self.assertIn('бабьи', results)
@unittest.skip
def test_adv_980(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='пеший', pos_b='adj', pos_a='adv')
self.assertIn('пешком', results)
results = self.derivation.derive(word_b='тихий', pos_b='adj', pos_a='adv')
self.assertIn('тишком', results)
results = self.derivation.derive(word_b='тайный', pos_b='adj', pos_a='adv')
self.assertIn('тайком', results)
@unittest.skip
def test_adv_980_2(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='босой', pos_b='adj', pos_a='adv')
self.assertIn('босиком', results)
results = self.derivation.derive(word_b='целый', pos_b='adj', pos_a='adv')
self.assertIn('целиком', results)
results = self.derivation.derive(word_b='прямой', pos_b='adj', pos_a='adv')
self.assertIn('прямиком', results)
@unittest.skip
def test_adv_980_3(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='пеший', pos_b='adj', pos_a='adv')
self.assertIn('пёхом', results)
@unittest.skip
def test_adv_980_4(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='живой', pos_b='adj', pos_a='adv')
self.assertIn('живьём', results)
results = self.derivation.derive(word_b='голый', pos_b='adj', pos_a='adv')
self.assertIn('гольём', results)
@unittest.skip
def test_adv_980_5(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='особый', pos_b='adj', pos_a='adv')
self.assertIn('особняком', results)
@unittest.skip
def test_adv_980_6(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='нагой', pos_b='adj', pos_a='adv')
self.assertIn('нагишом', results)
@unittest.skip
def test_adv_981_1(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='белый', pos_b='adj', pos_a='adv')
self.assertIn('белым', results)
results = self.derivation.derive(word_b='давний', pos_b='adj', pos_a='adv')
self.assertIn('давным', results)
@unittest.skip
def test_adv_981_2(self):
""" Проверка правила 979. """
results = self.derivation.derive(word_b='полный', pos_b='adj', pos_a='adv')
self.assertIn('полностью', results)
def test_adv_982(self):
results = self.derivation.derive(word_b='зима', pos_b='noun', pos_a='adv')
self.assertIn('зимой', results)
results = self.derivation.derive(word_b='воля', pos_b='noun', pos_a='adv')
self.assertIn('волей', results)
results = self.derivation.derive(word_b='рысь', pos_b='noun', pos_a='adv')
self.assertIn('рысью', results)
results = self.derivation.derive(word_b='день', pos_b='noun', pos_a='adv')
self.assertIn('днем', results)
results = self.derivation.derive(word_b='волчок', pos_b='noun', pos_a='adv')
self.assertIn('волчком', results)
results = self.derivation.derive(word_b='наскок', pos_b='noun', pos_a='adv')
self.assertIn('наскоком', results)
results = self.derivation.derive(word_b='молодец', pos_b='noun', pos_a='adv')
self.assertIn('молодцом', results)
results = self.derivation.derive(word_b='утро', pos_b='noun', pos_a='adv')
self.assertIn('утром', results)
results = self.derivation.derive(word_b='дни', pos_b='noun', pos_a='adv')
self.assertIn('днями', results)
results = self.derivation.derive(word_b='времена', pos_b='noun', pos_a='adv')
self.assertIn('временами', results)
@unittest.skip
def test_adv_982_2(self):
results = self.derivation.derive(word_b='дом', pos_b='noun', pos_a='adv')
self.assertIn('дома', results)
@unittest.skip
def test_adv_982_3(self):
results = self.derivation.derive(word_b='сила', pos_b='noun', pos_a='adv')
self.assertIn('силком', results)
results = self.derivation.derive(word_b='гусь', pos_b='noun', pos_a='adv')
self.assertIn('гуськом', results)
@unittest.skip
def test_adv_982_4(self):
results = self.derivation.derive(word_b='сила', pos_b='noun', pos_a='adv')
self.assertIn('силом', results)
@unittest.skip
def test_adv_983(self):
results = self.derivation.derive(word_b='шесть', pos_b='num', pos_a='adv')
self.assertIn('шестью', results)
@unittest.skip
def test_adv_984(self):
results = self.derivation.derive(word_b='два', pos_b='num', pos_a='adv')
self.assertIn('дважды', results)
results = self.derivation.derive(word_b='три', pos_b='num', pos_a='adv')
self.assertIn('трижды', results)
results = self.derivation.derive(word_b='четыре', pos_b='num', pos_a='adv')
self.assertIn('четырежды', results)
@unittest.skip
def test_adv_984_2(self):
results = self.derivation.derive(word_b='один', pos_b='num', pos_a='adv')
self.assertIn('однажды', results)
results = self.derivation.derive(word_b='много', pos_b='num', pos_a='adv')
self.assertIn('многажды', results)
@unittest.skip
def test_adv_984_3(self):
results = self.derivation.derive(word_b='один', pos_b='num', pos_a='adv')
self.assertIn('единожды', results)
def test_adv_985(self):
results = self.derivation.derive(word_b='стоять', pos_b='verb', pos_a='adv')
self.assertIn('стоймя', results)
results = self.derivation.derive(word_b='сидеть', pos_b='verb', pos_a='adv')
self.assertIn('сидмя', results)
results = self.derivation.derive(word_b='хлестать', pos_b='verb', pos_a='adv')
self.assertIn('хлестмя', results)
results = self.derivation.derive(word_b='валить', pos_b='verb', pos_a='adv')
self.assertIn('вальмя', results)
results = self.derivation.derive(word_b='жить', pos_b='verb', pos_a='adv')
self.assertIn('живмя', results)
results = self.derivation.derive(word_b='лить', pos_b='verb', pos_a='adv')
self.assertIn('ливмя', results)
# results = self.derivation.derive(word_b='пластать', pos_b='verb', pos_a='adv')
# self.assertIn('плашмя', results)
@unittest.skip
def test_adv_986(self):
results = self.derivation.derive(word_b='кувыркаться', pos_b='verb', pos_a='adv')
self.assertIn('кувырком', results)
results = self.derivation.derive(word_b='волочь', pos_b='verb', pos_a='adv')
self.assertIn('волоком', results)
results = self.derivation.derive(word_b='дыбиться', pos_b='verb', pos_a='adv')
self.assertIn('дыбом', results)
results = self.derivation.derive(word_b='насыпать', pos_b='verb', pos_a='adv')
self.assertIn('насыпом', results)
results = self.derivation.derive(word_b='наезжать', pos_b='verb', pos_a='adv')
self.assertIn('наездом', results)
@unittest.skip
def test_adv_986_2(self):
results = self.derivation.derive(word_b='ползти', pos_b='verb', pos_a='adv')
self.assertIn('ползком', results)
results = self.derivation.derive(word_b='молчать', pos_b='verb', pos_a='adv')
self.assertIn('молчком', results)
results = self.derivation.derive(word_b='щипать', pos_b='verb', pos_a='adv')
self.assertIn('щипком', results)
results = self.derivation.derive(word_b='стоять', pos_b='verb', pos_a='adv')
self.assertIn('стойком', results)
results = self.derivation.derive(word_b='трусить', pos_b='verb', pos_a='adv')
self.assertIn('труском', results)
@unittest.skip
def test_adv_986_3(self):
results = self.derivation.derive(word_b='рвать', pos_b='verb', pos_a='adv')
self.assertIn('рывом', results)
@unittest.skip
def test_adv_986_4(self):
results = self.derivation.derive(word_b='набиться', pos_b='verb', pos_a='adv')
self.assertIn('битком', results)
@unittest.skip
def test_adv_986_5(self):
results = self.derivation.derive(word_b='ходить', pos_b='verb', pos_a='adv')
self.assertIn('ходуном', results)
@unittest.skip
def test_adv_987_1(self):
results = self.derivation.derive(word_b='ощупать', pos_b='verb', pos_a='adv')
self.assertIn('ощупью', results)
results = self.derivation.derive(word_b='насыпать', pos_b='verb', pos_a='adv')
self.assertIn('насыпью', results)
@unittest.skip
def test_adv_987_2(self):
results = self.derivation.derive(word_b='сторожить', pos_b='verb', pos_a='adv')
self.assertIn('настороже', results)
@unittest.skip
def test_adv_987_3(self):
results = self.derivation.derive(word_b='урывать', pos_b='verb', pos_a='adv')
self.assertIn('урывками', results)
@unittest.skip
def test_adv_987_4(self):
results = self.derivation.derive(word_b='мочь', pos_b='verb', pos_a='adv')
self.assertIn('можно', results)
results = self.derivation.derive(word_b='жалеть', pos_b='verb', pos_a='adv')
self.assertIn('жаль', results)
def test_adv_987_5(self):
results = self.derivation.derive(word_b='уметь', pos_b='verb', pos_a='adv')
self.assertIn('умеючи', results)
def test_adv_988(self):
results = self.derivation.derive(word_b='рано', pos_b='adv', pos_a='adv')
self.assertIn('рановато', results)
def test_adv_989(self):
results = self.derivation.derive(word_b='трудно', pos_b='adv', pos_a='adv')
self.assertIn('трудненько', results)
results = self.derivation.derive(word_b='хорошо', pos_b='adv', pos_a='adv')
self.assertIn('хорошенько', results)
results = self.derivation.derive(word_b='тихо', pos_b='adv', pos_a='adv')
self.assertIn('тихонько', results)
results = self.derivation.derive(word_b='высоко', pos_b='adv', pos_a='adv')
self.assertIn('высоконько', results)
def test_adv_990(self):
results = self.derivation.derive(word_b='рано', pos_b='adv', pos_a='adv')
self.assertIn('ранёхонько', results)
results = self.derivation.derive(word_b='рано', pos_b='adv', pos_a='adv')
self.assertIn('ранёшенько', results)
results = self.derivation.derive(word_b='тихо', pos_b='adv', pos_a='adv')
self.assertIn('тихохонько', results)
results = self.derivation.derive(word_b='близко', pos_b='adv', pos_a='adv')
self.assertIn('близёхонько', results)
def test_adv_991(self):
results = self.derivation.derive(word_b='боком', pos_b='adv', pos_a='adv')
self.assertIn('бочком', results)
results = self.derivation.derive(word_b='пешком', pos_b='adv', pos_a='adv')
self.assertIn('пешочком', results)
results = self.derivation.derive(word_b='босиком', pos_b='adv', pos_a='adv')
self.assertIn('босичком', results)
def test_adv_991_2(self):
results = self.derivation.derive(word_b='стороной', pos_b='adv', pos_a='adv')
self.assertIn('сторонкой', results)
results = self.derivation.derive(word_b='украдкой', pos_b='adv', pos_a='adv')
self.assertIn('украдочкой', results)
def test_adv_991_3(self):
results = self.derivation.derive(word_b='вразвалку', pos_b='adv', pos_a='adv')
self.assertIn('вразвалочку', results)
results = self.derivation.derive(word_b='потихоньку', pos_b='adv', pos_a='adv')
self.assertIn('потихонечку', results)
def test_adv_991_4(self):
results = self.derivation.derive(word_b='хорошенько', pos_b='adv', pos_a='adv')
self.assertIn('хорошенечко', results)
@unittest.skip
def test_adv_991_5(self):
results = self.derivation.derive(word_b='рядом', pos_b='adv', pos_a='adv')
self.assertIn('рядышком', results)
def test_adv_992(self):
results = self.derivation.derive(word_b='вдалеке', pos_b='adv', pos_a='adv')
self.assertIn('невдалеке', results)
results = self.derivation.derive(word_b='хотя', pos_b='tgr', pos_a='adv')
self.assertIn('нехотя', results)
@unittest.skip
def test_adv_993(self):
results = self.derivation.derive(word_b='вне', pos_b='adv', pos_a='adv')
self.assertIn('вовне', results)
@unittest.skip
def test_adv_993_2(self):
results = self.derivation.derive(word_b='светло', pos_b='adv', pos_a='adv')
self.assertIn('засветло', results)
@unittest.skip
def test_adv_993_3(self):
results = self.derivation.derive(word_b='сюда', pos_b='adv', pos_a='adv')
self.assertIn('досюда', results)
@unittest.skip
def test_adv_993_4(self):
results = self.derivation.derive(word_b='всегда', pos_b='adv', pos_a='adv')
self.assertIn('навсегда', results)
@unittest.skip
def test_adv_993_5(self):
results = self.derivation.derive(word_b='всюду', pos_b='adv', pos_a='adv')
self.assertIn('повсюду', results)
@unittest.skip
def test_adv_993_6(self):
results = self.derivation.derive(word_b='куда', pos_b='adv', pos_a='adv')
self.assertIn('откуда', results)
results = self.derivation.derive(word_b='всюду', pos_b='adv', pos_a='adv')
self.assertIn('отовсюду', results)
@unittest.skip
def test_adv_993_7(self):
results = self.derivation.derive(word_b='даром', pos_b='adv', pos_a='adv')
self.assertIn('задаром', results)
@unittest.skip
def test_adv_993_8(self):
results = self.derivation.derive(word_b='завтра', pos_b='adv', pos_a='adv')
self.assertIn('назавтра', results)
@unittest.skip
def test_adv_993_9(self):
results = self.derivation.derive(word_b='вне', pos_b='adv', pos_a='adv')
self.assertIn('извне', results)
@unittest.skip
def test_adv_993_10(self):
results = self.derivation.derive(word_b='выше', pos_b='adv', pos_a='adv')
self.assertIn('свыше', results)
@unittest.skip
def test_adv_993_11(self):
results = self.derivation.derive(word_b='завтра', pos_b='adv', pos_a='adv')
self.assertIn('послезавтра', results)
@unittest.skip
def test_adv_993_12(self):
results = self.derivation.derive(word_b='вчера', pos_b='adv', pos_a='adv')
self.assertIn('позавчера', results)
def test_adv_994_1(self):
results = self.derivation.derive(word_b='прежний', pos_b='adj', pos_a='adv')
self.assertIn('по-прежнему', results)
results = self.derivation.derive(word_b='деловой', pos_b='adj', pos_a='adv')
self.assertIn('по-деловому', results)
results = self.derivation.derive(word_b='хороший', pos_b='adj', pos_a='adv')
self.assertIn('по-хорошему', results)
def test_adv_994_2(self):
results = self.derivation.derive(word_b='птичий', pos_b='adj', pos_a='adv')
self.assertIn('по-птичьему', results)
def test_adv_994_3(self):
results = self.derivation.derive(word_b='мамин', pos_b='adj1', pos_a='adv')
self.assertIn('по-маминому', results)
results = self.derivation.derive(word_b='наш', pos_b='adj1', pos_a='adv')
self.assertIn('по-нашему', results)
results = self.derivation.derive(word_b='твой', pos_b='adj1', pos_a='adv')
self.assertIn('по-твоему', results)
@unittest.skip
def test_adv_994_4(self):
results = self.derivation.derive(word_b='его', pos_b='adj3', pos_a='adv')
self.assertIn('по-его', results)
results = self.derivation.derive(word_b='ее', pos_b='adj3', pos_a='adv')
self.assertIn('по-ее', results)
def test_adv_995(self):
results = self.derivation.derive(word_b='дружеский', pos_b='adj', pos_a='adv')
self.assertIn('по-дружески', results)
results = self.derivation.derive(word_b='бабий', pos_b='adj', pos_a='adv')
self.assertIn('по-бабьи', results)
results = self.derivation.derive(word_b='охотничий', pos_b='adj', pos_a='adv')
self.assertIn('по-охотничьи', results)
results = self.derivation.derive(word_b='свойский', pos_b='adj', pos_a='adv')
self.assertIn('по-свойски', results)
@unittest.skip
def test_adv_996(self):
results = self.derivation.derive(word_b='напрасный', pos_b='adj', pos_a='adv')
self.assertIn('понапрасну', results)
results = self.derivation.derive(word_b='сухой', pos_b='adj', pos_a='adv')
self.assertIn('посуху', results)
@unittest.skip
def test_adv_997(self):
results = self.derivation.derive(word_b='маленький', pos_b='adj', pos_a='adv')
self.assertIn('помаленьку', results)
results = self.derivation.derive(word_b='легонький', pos_b='adj', pos_a='adv')
self.assertIn('полегоньку', results)
results = self.derivation.derive(word_b='тихонький', pos_b='adj', pos_a='adv')
self.assertIn('потихоньку', results)
def test_adv_998(self):
results = self.derivation.derive(word_b='новый', pos_b='adj', pos_a='adv')
self.assertIn('по-новой', results)
def test_adv_999(self):
results = self.derivation.derive(word_b='плотный', pos_b='adj', pos_a='adv')
self.assertIn('вплотную', results)
results = self.derivation.derive(word_b='пеший', pos_b='adj', pos_a='adv')
self.assertIn('впешую', results)
@unittest.skip
def test_adv_1000(self):
results = self.derivation.derive(word_b='живой', pos_b='adj', pos_a='adv')
self.assertIn('вживе', results)
results = self.derivation.derive(word_b='краткий', pos_b='adj', pos_a='adv')
self.assertIn('вкратце', results)
results = self.derivation.derive(word_b='явный', pos_b='adj', pos_a='adv')
self.assertIn('въяве', results)
results = self.derivation.derive(word_b='общий', pos_b='adj', pos_a='adv')
self.assertIn('вообще', results)
@unittest.skip
def test_adv_1000_2(self):
results = self.derivation.derive(word_b='близкий', pos_b='adj', pos_a='adv')
self.assertIn('вблизи', results)
results = self.derivation.derive(word_b='запертый', pos_b='adj', pos_a='adv')
self.assertIn('взаперти', results)
@unittest.skip
def test_adv_1000_3(self):
results = self.derivation.derive(word_b='правый', pos_b='adj', pos_a='adv')
self.assertIn('вправо', results)
results = self.derivation.derive(word_b='левый', pos_b='adj', pos_a='adv')
self.assertIn('влево', results)
@unittest.skip
def test_adv_1000_4(self):
results = self.derivation.derive(word_b='третий', pos_b='adj4', pos_a='adv')
self.assertIn('в-третьих', results)
results = self.derivation.derive(word_b='десятый', pos_b='adj4', pos_a='adv')
self.assertIn('в-десятых', results)
@unittest.skip
def test_adv_1000_5(self):
results = self.derivation.derive(word_b='второй', pos_b='adj4', pos_a='adv')
self.assertIn('во-вторых', results)
results = self.derivation.derive(word_b='первый', pos_b='adj4', pos_a='adv')
self.assertIn('во-первых', results)
def test_adv_1001(self):
results = self.derivation.derive(word_b='белый', pos_b='adj', pos_a='adv')
self.assertIn('добела', results)
results = self.derivation.derive(word_b='сухой', pos_b='adj', pos_a='adv')
self.assertIn('досуха', results)
results = self.derivation.derive(word_b='синий', pos_b='adj', pos_a='adv')
self.assertIn('досиня', results)
@unittest.skip
def test_adv_1002(self):
results = self.derivation.derive(word_b='живой', pos_b='adj', pos_a='adv')
self.assertIn('заживо', results)
results = self.derivation.derive(word_b='единый', pos_b='adj', pos_a='adv')
self.assertIn('заодно', results)
def test_adv_1003(self):
results = self.derivation.derive(word_b='желтый', pos_b='adj', pos_a='adv')
self.assertIn('изжелта', results)
results = self.derivation.derive(word_b='синий', pos_b='adj', pos_a='adv')
self.assertIn('иссиня', results)
results = self.derivation.derive(word_b='чужой', pos_b='adj', pos_a='adv')
self.assertIn('исчужа', results)
results = self.derivation.derive(word_b='далекий', pos_b='adj', pos_a='adv')
self.assertIn('издалека', results)
def test_adv_1004(self):
results = self.derivation.derive(word_b='грубый', pos_b='adj', pos_a='adv')
self.assertIn('нагрубо', results)
results = self.derivation.derive(word_b='глухой', pos_b='adj', pos_a='adv')
self.assertIn('наглухо', results)
results = self.derivation.derive(word_b='долгий', pos_b='adj', pos_a='adv')
self.assertIn('надолго', results)
@unittest.skip
def test_adv_1005(self):
results = self.derivation.derive(word_b='веселый', pos_b='adj', pos_a='adv')
self.assertIn('навеселе', results)
@unittest.skip
def test_adv_1005_2(self):
results = self.derivation.derive(word_b='чистый', pos_b='adj', pos_a='adv')
self.assertIn('начистую', results)
@unittest.skip
def test_adv_1006(self):
results = self.derivation.derive(word_b='полный', pos_b='adj', pos_a='adv')
self.assertIn('сполна', results)
results = self.derivation.derive(word_b='легкий', pos_b='adj', pos_a='adv')
self.assertIn('слегка', results)
results = self.derivation.derive(word_b='!общий', pos_b='adj', pos_a='adv')
self.assertIn('сообща', results)
results = self.derivation.derive(word_b='горячий', pos_b='adj', pos_a='adv')
self.assertIn('сгоряча', results)
@unittest.skip
def test_adv_1006_2(self):
results = self.derivation.derive(word_b='молодой', pos_b='adj', pos_a='adv')
self.assertIn('смолоду', results)
results = self.derivation.derive(word_b='дурной', pos_b='adj', pos_a='adv')
self.assertIn('сдуру', results)
results = self.derivation.derive(word_b='слепой', pos_b='adj', pos_a='adv')
self.assertIn('сослепу', results)
@unittest.skip
def test_adv_1007(self):
results = self.derivation.derive(word_b='новый', pos_b='adj', pos_a='adv')
self.assertIn('сызнова', results)
results = self.derivation.derive(word_b='давний', pos_b='adj', pos_a='adv')
self.assertIn('сыздавна', results)
@unittest.skip
def test_adv_1008_1(self):
results = self.derivation.derive(word_b='горячий', pos_b='adj', pos_a='adv')
self.assertIn('вгорячах', results)
@unittest.skip
def test_adv_1008_2(self):
results = self.derivation.derive(word_b='первый', pos_b='adj4', pos_a='adv')
self.assertIn('впервой', results)
@unittest.skip
def test_adv_1008_3(self):
results = self.derivation.derive(word_b='первый', pos_b='adj4', pos_a='adv')
self.assertIn('впервые', results)
@unittest.skip
def test_adv_1008_4(self):
results = self.derivation.derive(word_b='единый', pos_b='adj', pos_a='adv')
self.assertIn('воедино', results)
@unittest.skip
def test_adv_1008_5(self):
results = self.derivation.derive(word_b='частый', pos_b='adj', pos_a='adv')
self.assertIn('зачастую', results)
@unittest.skip
def test_adv_1008_6(self):
results = self.derivation.derive(word_b='панибратский', pos_b='adj', pos_a='adv')
self.assertIn('запанибрата', results)
@unittest.skip
def test_adv_1008_7(self):
results = self.derivation.derive(word_b='древлий', pos_b='adj', pos_a='adv')
self.assertIn('издревле', results)
@unittest.skip
def test_adv_1008_8(self):
results = self.derivation.derive(word_b='старый', pos_b='adj', pos_a='adv')
self.assertIn('исстари', results)
@unittest.skip
def test_adv_1008_9(self):
results = self.derivation.derive(word_b='верный', pos_b='adj', pos_a='adv')
self.assertIn('наверное', results)
@unittest.skip
def test_adv_1008_10(self):
results = self.derivation.derive(word_b='верный', pos_b='adj', pos_a='adv')
self.assertIn('наверняка', results)
@unittest.skip
def test_adv_1008_11(self):
results = self.derivation.derive(word_b='прямой', pos_b='adj', pos_a='adv')
self.assertIn('напрямик', results)
results = self.derivation.derive(word_b='косой', pos_b='adj', pos_a='adv')
self.assertIn('наискосок', results)
@unittest.skip
def test_adv_1008_12(self):
results = self.derivation.derive(word_b='прямой', pos_b='adj', pos_a='adv')
self.assertIn('напрямки', results)
results = self.derivation.derive(word_b='косой', pos_b='adj', pos_a='adv')
self.assertIn('наискоски', results)
@unittest.skip
def test_adv_1008_13(self):
results = self.derivation.derive(word_b='далекий', pos_b='adj', pos_a='adv')
self.assertIn('неподалёку', results)
@unittest.skip
def test_adv_1008_14(self):
results = self.derivation.derive(word_b='чистый', pos_b='adj', pos_a='adv')
self.assertIn('подчистую', results)
@unittest.skip
def test_adv_1008_15(self):
results = self.derivation.derive(word_b='малый', pos_b='adj', pos_a='adv')
self.assertIn('сызмальства', results)
@unittest.skip
def test_adv_1008_16(self):
results = self.derivation.derive(word_b='тихий', pos_b='adj', pos_a='adv')
self.assertIn('исподтишка', results)
def test_adv_1009(self):
results = self.derivation.derive(word_b='низ', pos_b='noun', pos_a='adv')
self.assertIn('вниз', results)
results = self.derivation.derive(word_b='даль', pos_b='noun', pos_a='adv')
self.assertIn('вдаль', results)
results = self.derivation.derive(word_b='разнобой', pos_b='noun', pos_a='adv')
self.assertIn('вразнобой', results)
results = self.derivation.derive(word_b='правда', pos_b='noun', pos_a='adv')
self.assertIn('вправду', results)
results = self.derivation.derive(word_b='ничья', pos_b='noun', pos_a='adv')
self.assertIn('вничью', results)
results = self.derivation.derive(word_b='истина', pos_b='noun', pos_a='adv')
self.assertIn('воистину', results)
results = self.derivation.derive(word_b='век', pos_b='noun', pos_a='adv')
self.assertIn('вовек', results)
results = self.derivation.derive(word_b='круг', pos_b='noun', pos_a='adv')
self.assertIn('вокруг', results)
def test_adv_1010(self):
results = self.derivation.derive(word_b='верх', pos_b='noun', pos_a='adv')
self.assertIn('наверх', results)
results = self.derivation.derive(word_b='встреча', pos_b='noun', pos_a='adv')
self.assertIn('навстречу', results)
results = self.derivation.derive(word_b='конец', pos_b='noun', pos_a='adv')
self.assertIn('наконец', results)
@unittest.skip
def test_adv_1011(self):
results = self.derivation.derive(word_b='верх', pos_b='noun', pos_a='adv')
self.assertIn('вверху', results)
results = self.derivation.derive(word_b='начало', pos_b='noun', pos_a='adv')
self.assertIn('вначале', results)
results = self.derivation.derive(word_b='право', pos_b='noun', pos_a='adv')
self.assertIn('вправе', results)
results = self.derivation.derive(word_b='даль', pos_b='noun', pos_a='adv')
self.assertIn('вдали', results)
results = self.derivation.derive(word_b='последствие', pos_b='noun', pos_a='adv')
self.assertIn('впоследствии', results)
@unittest.skip
def test_adv_1011_2(self):
results = self.derivation.derive(word_b='заем', pos_b='noun', pos_a='adv')
self.assertIn('взаймы', results)
results = self.derivation.derive(word_b='наем', pos_b='noun', pos_a='adv')
self.assertIn('внаймы', results)
@unittest.skip
def test_adv_1012(self):
results = self.derivation.derive(word_b='верх', pos_b='noun', pos_a='adv')
self.assertIn('наверху', results)
results = self.derivation.derive(word_b='дни', pos_b='noun', pos_a='adv')
self.assertIn('на днях', results)
@unittest.skip
def test_adv_1013(self):
results = self.derivation.derive(word_b='утро', pos_b='noun', pos_a='adv')
self.assertIn('поутру', results)
results = self.derivation.derive(word_b='середина', pos_b='noun', pos_a='adv')
self.assertIn('посредине', results)
results = self.derivation.derive(word_b='близость', pos_b='noun', pos_a='adv')
self.assertIn('поблизости', results)
@unittest.skip
def test_adv_1014(self):
results = self.derivation.derive(word_b='низ', pos_b='noun', pos_a='adv')
self.assertIn('донизу', results)
results = self.derivation.derive(word_b='зарез', pos_b='noun', pos_a='adv')
self.assertIn('до зарезу', results)
@unittest.skip
def test_adv_1015_1(self):
results = self.derivation.derive(word_b='бок', pos_b='noun', pos_a='adv')
self.assertIn('сбоку', results)
@unittest.skip
def test_adv_1015_2(self):
results = self.derivation.derive(word_b='разбег', pos_b='noun', pos_a='adv')
self.assertIn('с разбегу', results)
results = self.derivation.derive(word_b='поворот', pos_b='noun', pos_a='adv')
self.assertIn('с поворота', results)
@unittest.skip
def test_adv_1015_3(self):
results = self.derivation.derive(word_b='перед', pos_b='noun', pos_a='adv')
self.assertIn('спереди', results)
results = self.derivation.derive(word_b='зад', pos_b='noun', pos_a='adv')
self.assertIn('сзади', results)
@unittest.skip
def test_adv_1016_1(self):
results = self.derivation.derive(word_b='верх', pos_b='noun', pos_a='adv')
self.assertIn('кверху', results)
results = self.derivation.derive(word_b='низ', pos_b='noun', pos_a='adv')
self.assertIn('книзу', results)
@unittest.skip
def test_adv_1016_2(self):
results = self.derivation.derive(word_b='перед', pos_b='noun', pos_a='adv')
self.assertIn('впереди', results)
@unittest.skip
def test_adv_1016_3(self):
results = self.derivation.derive(word_b='зад', pos_b='noun', pos_a='adv')
self.assertIn('позади', results)
@unittest.skip
def test_adv_1016_4(self):
results = self.derivation.derive(word_b='даль', pos_b='noun', pos_a='adv')
self.assertIn('издали', results)
@unittest.skip
def test_adv_1016_5(self):
results = self.derivation.derive(word_b='часть', pos_b='noun', pos_a='adv')
self.assertIn('отчасти', results)
@unittest.skip
def test_adv_1016_6(self):
results = self.derivation.derive(word_b='утро', pos_b='noun', pos_a='adv')
self.assertIn('наутро', results)
@unittest.skip
def test_adv_1016_7(self):
results = self.derivation.derive(word_b='муж', pos_b='noun', pos_a='adv')
self.assertIn('замужем', results)
@unittest.skip
def test_adv_1016_8(self):
results = self.derivation.derive(word_b='детство', pos_b='noun', pos_a='adv')
self.assertIn('сыздетства', results)
@unittest.skip
def test_adv_1017(self):
results = self.derivation.derive(word_b='двое', pos_b='num1', pos_a='adv')
self.assertIn('вдвоём', results)
results = self.derivation.derive(word_b='четверо', pos_b='num1', pos_a='adv')
self.assertIn('вчетвером', results)
@unittest.skip
def test_adv_1018(self):
results = self.derivation.derive(word_b='двое', pos_b='num1', pos_a='adv')
self.assertIn('вдвое', results)
results = self.derivation.derive(word_b='пятеро', pos_b='num1', pos_a='adv')
self.assertIn('впятеро', results)
@unittest.skip
def test_adv_1019(self):
results = self.derivation.derive(word_b='двое', pos_b='num1', pos_a='adv')
self.assertIn('надвое', results)
results = self.derivation.derive(word_b='трое', pos_b='num1', pos_a='adv')
self.assertIn('натрое', results)
@unittest.skip
def test_adv_1019_2(self):
results = self.derivation.derive(word_b='сколько', pos_b='num', pos_a='adv')
self.assertIn('насколько', results)
results = self.derivation.derive(word_b='много', pos_b='num', pos_a='adv')
self.assertIn('намного', results)
def test_adv_1020(self):
results = self.derivation.derive(word_b='догонять', pos_b='verb', pos_a='adv')
self.assertIn('вдогонку', results)
results = self.derivation.derive(word_b='приглядывать', pos_b='verb', pos_a='adv')
self.assertIn('вприглядку', results)
results = self.derivation.derive(word_b='распахивать', pos_b='verb', pos_a='adv')
self.assertIn('нараспашку', results)
@unittest.skip
def test_adv_1021_1(self):
results = self.derivation.derive(word_b='торопиться', pos_b='verb', pos_a='adv')
self.assertIn('второпях', results)
results = self.derivation.derive(word_b='бегать', pos_b='verb', pos_a='adv')
self.assertIn('в бегах', results)
@unittest.skip
def test_adv_1021_2(self):
results = self.derivation.derive(word_b='висеть', pos_b='verb', pos_a='adv')
self.assertIn('на весу', results)
@unittest.skip
def test_adv_1021_3(self):
results = self.derivation.derive(word_b='просыпаться', pos_b='verb', pos_a='adv')
self.assertIn('без просыпу', results)
@unittest.skip
def test_adv_1021_4(self):
results = self.derivation.derive(word_b='упасть', pos_b='verb', pos_a='adv')
self.assertIn('доупаду', results)
results = self.derivation.derive(word_b='отвалиться', pos_b='verb', pos_a='adv')
self.assertIn('до отвала', results)
@unittest.skip
def test_adv_1021_5(self):
results = self.derivation.derive(word_b='родиться', pos_b='verb', pos_a='adv')
self.assertIn('сроду', results)
results = self.derivation.derive(word_b='рвать', pos_b='verb', pos_a='adv')
self.assertIn('срыву', results)
@unittest.skip
def test_adv_1021_6(self):
results = self.derivation.derive(word_b='родиться', pos_b='verb', pos_a='adv')
self.assertIn('отроду', results)
@unittest.skip
def test_adv_1021_7(self):
results = self.derivation.derive(word_b='перегонять', pos_b='verb', pos_a='adv')
self.assertIn('вперегонки', results)
@unittest.skip
def test_adv_1021_8(self):
results = self.derivation.derive(word_b='перегонять', pos_b='verb', pos_a='adv')
self.assertIn('наперегонки', results)
@unittest.skip
def test_adv_1021_9(self):
results = self.derivation.derive(word_b='проснуться', pos_b='verb', pos_a='adv')
self.assertIn('впросонках', results)
@unittest.skip
def test_adv_1021_10(self):
results = self.derivation.derive(word_b='проснуться', pos_b='verb', pos_a='adv')
self.assertIn('спросонок', results)
@unittest.skip
def test_adv_1021_11(self):
results = self.derivation.derive(word_b='проснуться', pos_b='verb', pos_a='adv')
self.assertIn('спросонья', results)
@unittest.skip
def test_adv_1021_12(self):
results = self.derivation.derive(word_b='мочь', pos_b='verb', pos_a='adv')
self.assertIn('невмоготу', results)
@unittest.skip
def test_adv_1021_13(self):
results = self.derivation.derive(word_b='удаться', pos_b='verb', pos_a='adv')
self.assertIn('наудалую', results)
@unittest.skip
def test_adv_1021_14(self):
results = self.derivation.derive(word_b='перекосить', pos_b='verb', pos_a='adv')
self.assertIn('наперекосяк', results)
@unittest.skip
def test_adv_1022(self):
results = self.derivation.derive(word_b='долгий', pos_b='adj', pos_a='adv')
self.assertIn('подолгу', results)
@unittest.skip
def test_adv_1022_2(self):
results = self.derivation.derive(word_b='нарочно', pos_b='adv', pos_a='adv')
self.assertIn('понарошку', results)
@unittest.skip
def test_adv_1023(self):
results = self.derivation.derive(word_b='косой', pos_b='adj', pos_a='adv')
self.assertIn('вкось', results)
results = self.derivation.derive(word_b='довольный', pos_b='adj', pos_a='adv')
self.assertIn('вдоволь', results)
results = self.derivation.derive(word_b='ровный', pos_b='adj', pos_a='adv')
self.assertIn('вровень', results)
def test_adv_1024(self):
results = self.derivation.derive(word_b='догонять', pos_b='verb', pos_a='adv')
self.assertIn('вдогон', results)
# results = self.derivation.derive(word_b='перебивать', pos_b='verb', pos_a='adv')
# self.assertIn('вперебой', results)
results = self.derivation.derive(word_b='плавать', pos_b='verb', pos_a='adv')
self.assertIn('вплавь', results)
results = self.derivation.derive(word_b='скакать', pos_b='verb', pos_a='adv')
self.assertIn('вскачь', results)
@unittest.skip
def test_adv_1024_2(self):
results = self.derivation.derive(word_b='перечесть', pos_b='verb', pos_a='adv')
self.assertIn('наперечет', results)
results = self.derivation.derive(word_b='прерывать', pos_b='verb', pos_a='adv')
self.assertIn('наперерыв', results)
results = self.derivation.derive(word_b='выворачивать', pos_b='verb', pos_a='adv')
self.assertIn('навыворот', results)
results = self.derivation.derive(word_b='ощупать', pos_b='verb', pos_a='adv')
self.assertIn('наощупь', results)
@unittest.skip
def test_adv_1025_1(self):
results = self.derivation.derive(word_b='проворачивать', pos_b='verb', pos_a='adv')
self.assertIn('невпроворот', results)
results = self.derivation.derive(word_b='догадываться', pos_b='verb', pos_a='adv')
self.assertIn('невдогад', results)
@unittest.skip
def test_adv_1025_2(self):
results = self.derivation.derive(word_b='терпеть', pos_b='verb', pos_a='adv')
self.assertIn('невтерпёж', results)
results = self.derivation.derive(word_b='мочь', pos_b='verb', pos_a='adv')
self.assertIn('невмочь', results)
@unittest.skip
def test_adv_1025_3(self):
results = self.derivation.derive(word_b='голодать', pos_b='verb', pos_a='adv')
self.assertIn('впроголодь', results)
@unittest.skip
def test_adv_1025_4(self):
results = self.derivation.derive(word_b='отиахиваться', pos_b='verb', pos_a='adv')
self.assertIn('наотмашь', results)
@unittest.skip
def test_adv_1025_5(self):
results = self.derivation.derive(word_b='косить', pos_b='verb', pos_a='adv')
self.assertIn('наискось', results)
@unittest.skip
def test_adv_1025_6(self):
results = self.derivation.derive(word_b='земля', pos_b='noun', pos_a='adv')
self.assertIn('наземь', results)
@unittest.skip
def test_adv_1025_7(self):
results = self.derivation.derive(word_b='муж', pos_b='noun', pos_a='adv')
self.assertIn('замуж', results)
results = self.derivation.derive(word_b='раз', pos_b='noun', pos_a='adv')
self.assertIn('зараз', results)
@unittest.skip
def test_adv_1025_8(self):
results = self.derivation.derive(word_b='бок', pos_b='noun', pos_a='adv')
self.assertIn('обок', results)
@unittest.skip
def test_adv_1025_9(self):
results = self.derivation.derive(word_b='верх', pos_b='noun', pos_a='adv')
self.assertIn('поверх', results)
@unittest.skip
def test_adv_1025_10(self):
results = self.derivation.derive(word_b='зарезать', pos_b='verb', pos_a='adv')
self.assertIn('позарез', results)
@unittest.skip
def test_adv_1025_11(self):
results = self.derivation.derive(word_b='запас', pos_b='noun', pos_a='adv')
self.assertIn('про запас', results)
if __name__ == '__main__':
unittest.main(verbosity=2)
| 42.18
| 91
| 0.645733
| 5,801
| 42,180
| 4.484572
| 0.101362
| 0.14853
| 0.22118
| 0.284374
| 0.858505
| 0.850855
| 0.834903
| 0.542802
| 0.314242
| 0.295483
| 0
| 0.02009
| 0.192817
| 42,180
| 999
| 92
| 42.222222
| 0.744001
| 0.010858
| 0
| 0.274293
| 0
| 0
| 0.130419
| 0
| 0
| 0
| 0
| 0
| 0.334563
| 1
| 0.179582
| false
| 0
| 0.00246
| 0
| 0.183272
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d1b3c6d902e5edb1f880f8690e7e1fa85aff89ac
| 144
|
py
|
Python
|
picamera2/outputs/__init__.py
|
IanTBlack/picamera2
|
4d31a56cdb0d8360e71927e754fc6bef50bec360
|
[
"BSD-2-Clause"
] | 71
|
2022-02-15T14:24:34.000Z
|
2022-03-29T16:36:46.000Z
|
picamera2/outputs/__init__.py
|
IanTBlack/picamera2
|
4d31a56cdb0d8360e71927e754fc6bef50bec360
|
[
"BSD-2-Clause"
] | 37
|
2022-02-16T12:35:45.000Z
|
2022-03-31T13:18:42.000Z
|
picamera2/outputs/__init__.py
|
IanTBlack/picamera2
|
4d31a56cdb0d8360e71927e754fc6bef50bec360
|
[
"BSD-2-Clause"
] | 15
|
2022-02-16T12:12:57.000Z
|
2022-03-31T15:17:58.000Z
|
from .output import Output
from .fileoutput import FileOutput
from .circularoutput import CircularOutput
from .ffmpegoutput import FfmpegOutput
| 28.8
| 42
| 0.861111
| 16
| 144
| 7.75
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 144
| 4
| 43
| 36
| 0.96875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
d1bfc32576157388e4d741ca871f47fee8554500
| 189
|
py
|
Python
|
functions/deformer.py
|
enriquevelmai/utils
|
3a810a438abc318347036a4c71fbff002e51713c
|
[
"MIT"
] | null | null | null |
functions/deformer.py
|
enriquevelmai/utils
|
3a810a438abc318347036a4c71fbff002e51713c
|
[
"MIT"
] | null | null | null |
functions/deformer.py
|
enriquevelmai/utils
|
3a810a438abc318347036a4c71fbff002e51713c
|
[
"MIT"
] | null | null | null |
import maya.cmds as mc
def get_set(deformer):
return mc.listConnections('{}.message'.format(deformer), source=True)[0]
def find_related_skincluster():
raise NotImplementedError
| 18.9
| 76
| 0.751323
| 24
| 189
| 5.791667
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006098
| 0.132275
| 189
| 9
| 77
| 21
| 0.841463
| 0
| 0
| 0
| 0
| 0
| 0.05291
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.2
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
d1d2e187aa173990997169b776d497e1f1829528
| 30
|
py
|
Python
|
fp_api/__main__.py
|
FlashpointProject/Flashpoint-API
|
626195cdf88a51ff2d5496884037d5fa3c838962
|
[
"MIT"
] | 2
|
2020-01-21T18:16:53.000Z
|
2020-12-16T00:21:56.000Z
|
fp_api/__main__.py
|
FlashpointProject/Flashpoint-API
|
626195cdf88a51ff2d5496884037d5fa3c838962
|
[
"MIT"
] | null | null | null |
fp_api/__main__.py
|
FlashpointProject/Flashpoint-API
|
626195cdf88a51ff2d5496884037d5fa3c838962
|
[
"MIT"
] | null | null | null |
from .app import app
app.run()
| 15
| 20
| 0.733333
| 6
| 30
| 3.666667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 30
| 2
| 21
| 15
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
06005a7afb10cacbc231c820bb9d504ddf898513
| 749
|
py
|
Python
|
src/tests/v12/test_lowercase_with_none.py
|
isaacna/FireO
|
749132d9d7fc7d361ff4cbc86d9c8e02c096aec2
|
[
"Apache-2.0"
] | 231
|
2019-10-27T10:52:54.000Z
|
2022-03-22T10:25:21.000Z
|
src/tests/v12/test_lowercase_with_none.py
|
isaacna/FireO
|
749132d9d7fc7d361ff4cbc86d9c8e02c096aec2
|
[
"Apache-2.0"
] | 97
|
2019-10-26T09:21:47.000Z
|
2022-03-26T04:41:57.000Z
|
src/tests/v12/test_lowercase_with_none.py
|
isaacna/FireO
|
749132d9d7fc7d361ff4cbc86d9c8e02c096aec2
|
[
"Apache-2.0"
] | 34
|
2019-10-30T18:57:05.000Z
|
2022-02-14T17:07:02.000Z
|
from fireo.fields import TextField
from fireo.models import Model
def test_lowercase_model_with_none_value():
class LowercaseNone(Model):
name = TextField()
address = TextField()
class Meta:
to_lowercase = True
ln = LowercaseNone()
ln.name = 'name'
ln.save()
ln2 = LowercaseNone.collection.get(ln.key)
assert ln2.name == 'name'
assert ln2.address is None
def test_lowercase_field_with_none_value():
class LowercaseNone(Model):
name = TextField()
address = TextField(to_lowercase=True)
ln = LowercaseNone()
ln.name = 'name'
ln.save()
ln2 = LowercaseNone.collection.get(ln.key)
assert ln2.name == 'name'
assert ln2.address is None
| 20.243243
| 46
| 0.6502
| 90
| 749
| 5.277778
| 0.322222
| 0.067368
| 0.067368
| 0.075789
| 0.774737
| 0.774737
| 0.774737
| 0.774737
| 0.774737
| 0.774737
| 0
| 0.010714
| 0.252336
| 749
| 37
| 47
| 20.243243
| 0.8375
| 0
| 0
| 0.666667
| 0
| 0
| 0.021333
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 1
| 0.083333
| false
| 0
| 0.083333
| 0
| 0.458333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ae28c4d20e4aefc8b7d51f7d73e5499dc2bfda9a
| 33
|
py
|
Python
|
recruit_cv/hr.py
|
Treetreewu/ArkNights-Farmer
|
e0b8c1a41fbcd590df61639b8e561c2054ef9192
|
[
"MIT"
] | 15
|
2019-07-03T09:45:04.000Z
|
2022-01-23T08:51:20.000Z
|
recruit_cv/hr.py
|
Treetreewu/ArkNights-Farmer
|
e0b8c1a41fbcd590df61639b8e561c2054ef9192
|
[
"MIT"
] | 3
|
2019-11-04T07:18:44.000Z
|
2020-09-07T05:17:17.000Z
|
recruit_cv/hr.py
|
Treetreewu/ArkNights-Farmer
|
e0b8c1a41fbcd590df61639b8e561c2054ef9192
|
[
"MIT"
] | null | null | null |
import cv2
cv2.imread("1.png")
| 6.6
| 19
| 0.666667
| 6
| 33
| 3.666667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 0.151515
| 33
| 4
| 20
| 8.25
| 0.678571
| 0
| 0
| 0
| 0
| 0
| 0.15625
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ae2e61a663c2ce37cd82e9d12bc673f6d2350425
| 203
|
py
|
Python
|
gameIdGenerator.py
|
theDrinkMD/twibbage
|
c0aba60bd2df50f0a5688db4a01048ea1efd1a45
|
[
"MIT"
] | null | null | null |
gameIdGenerator.py
|
theDrinkMD/twibbage
|
c0aba60bd2df50f0a5688db4a01048ea1efd1a45
|
[
"MIT"
] | null | null | null |
gameIdGenerator.py
|
theDrinkMD/twibbage
|
c0aba60bd2df50f0a5688db4a01048ea1efd1a45
|
[
"MIT"
] | null | null | null |
import random
import string
def createNewGameId():
#insert code to randomly generate
resp = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(5))
return str(resp)
| 25.375
| 91
| 0.729064
| 27
| 203
| 5.407407
| 0.814815
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005952
| 0.172414
| 203
| 7
| 92
| 29
| 0.863095
| 0.157635
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ae690d235e4c0b50349b820639bfaa5b7bf2b3dc
| 234
|
py
|
Python
|
ACM-Solution/MKLABEL.py
|
wasi0013/Python-CodeBase
|
4a7a36395162f68f84ded9085fa34cc7c9b19233
|
[
"MIT"
] | 2
|
2016-04-26T15:40:40.000Z
|
2018-07-18T10:16:42.000Z
|
ACM-Solution/MKLABEL.py
|
wasi0013/Python-CodeBase
|
4a7a36395162f68f84ded9085fa34cc7c9b19233
|
[
"MIT"
] | 1
|
2016-04-26T15:44:15.000Z
|
2016-04-29T14:44:40.000Z
|
ACM-Solution/MKLABEL.py
|
wasi0013/Python-CodeBase
|
4a7a36395162f68f84ded9085fa34cc7c9b19233
|
[
"MIT"
] | 1
|
2018-10-02T16:12:19.000Z
|
2018-10-02T16:12:19.000Z
|
n=int(input())
c=1
while n:
print("Case %d, N = %d, # of different labelings = %d"%(c,n,n**(n-2)))
n=int(input())
c+=1
01010111011001010110110001100011011011110110110101100101001000000110001001101111011011000110111101100100
| 29.25
| 105
| 0.726496
| 27
| 234
| 6.296296
| 0.518519
| 0.047059
| 0.105882
| 0.117647
| 0.129412
| 0
| 0
| 0
| 0
| 0
| 0
| 0.519417
| 0.119658
| 234
| 7
| 106
| 33.428571
| 0.305825
| 0
| 0
| 0.285714
| 0
| 0
| 0.202643
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.142857
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ae864cea0582322506b8ddf9e4b6a1ed4e81bef6
| 156
|
py
|
Python
|
networkapi/usuario/admin/__init__.py
|
brunodevel/GloboNetworkAPI
|
ea8eebc0337636f9250e628cc392514934db8edd
|
[
"Apache-2.0"
] | null | null | null |
networkapi/usuario/admin/__init__.py
|
brunodevel/GloboNetworkAPI
|
ea8eebc0337636f9250e628cc392514934db8edd
|
[
"Apache-2.0"
] | null | null | null |
networkapi/usuario/admin/__init__.py
|
brunodevel/GloboNetworkAPI
|
ea8eebc0337636f9250e628cc392514934db8edd
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from .usuario import UsuarioAdmin
from networkapi.usuario.models import Usuario
admin.site.register(Usuario, UsuarioAdmin)
| 31.2
| 45
| 0.852564
| 20
| 156
| 6.65
| 0.55
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089744
| 156
| 5
| 46
| 31.2
| 0.93662
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
881804927714d18dc3aaf79786f411477291e6db
| 64
|
py
|
Python
|
bdpy3/__init__.py
|
birkin/borrowdirect3.py
|
1d083dd15e38dc7df15ff018236716dff93bee11
|
[
"MIT"
] | null | null | null |
bdpy3/__init__.py
|
birkin/borrowdirect3.py
|
1d083dd15e38dc7df15ff018236716dff93bee11
|
[
"MIT"
] | null | null | null |
bdpy3/__init__.py
|
birkin/borrowdirect3.py
|
1d083dd15e38dc7df15ff018236716dff93bee11
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .borrowdirect import BorrowDirect
| 16
| 38
| 0.6875
| 7
| 64
| 6.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018519
| 0.15625
| 64
| 3
| 39
| 21.333333
| 0.796296
| 0.328125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
8830ad6689f37c4c010c5cfa7b042f6e54e883be
| 53
|
py
|
Python
|
acnportal/acndata/__init__.py
|
irasus-technologies/acnportal
|
f6ac7b9ddb28ab48177c51a676f1619e88ea91e0
|
[
"BSD-3-Clause"
] | 32
|
2019-05-01T03:55:12.000Z
|
2022-03-27T06:37:04.000Z
|
acnportal/acndata/__init__.py
|
irasus-technologies/acnportal
|
f6ac7b9ddb28ab48177c51a676f1619e88ea91e0
|
[
"BSD-3-Clause"
] | 66
|
2019-08-16T22:13:21.000Z
|
2022-03-10T13:50:29.000Z
|
acnportal/acndata/__init__.py
|
irasus-technologies/acnportal
|
f6ac7b9ddb28ab48177c51a676f1619e88ea91e0
|
[
"BSD-3-Clause"
] | 21
|
2019-06-04T04:29:56.000Z
|
2022-03-27T06:36:46.000Z
|
from .data_client import DataClient
del data_client
| 13.25
| 35
| 0.849057
| 8
| 53
| 5.375
| 0.75
| 0.465116
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132075
| 53
| 3
| 36
| 17.666667
| 0.934783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
887febf15d67e32b5dec1e0e20267d53fa1263df
| 8,477
|
py
|
Python
|
python_scripts/generate_keras_training_data.py
|
GoldenholzLab/LPC-RCT
|
b14bc440ad3f8acfbf6f776ddd749475818af70d
|
[
"MIT"
] | null | null | null |
python_scripts/generate_keras_training_data.py
|
GoldenholzLab/LPC-RCT
|
b14bc440ad3f8acfbf6f776ddd749475818af70d
|
[
"MIT"
] | null | null | null |
python_scripts/generate_keras_training_data.py
|
GoldenholzLab/LPC-RCT
|
b14bc440ad3f8acfbf6f776ddd749475818af70d
|
[
"MIT"
] | null | null | null |
from clinical_trial_generation import generate_true_and_false_drug_histograms
import numpy as np
import json
import time
import sys
def generate_training_data(one_or_two,
num_placebo_arm_patients,
num_drug_arm_patients,
num_baseline_months,
num_maintenance_months,
baseline_time_scale,
maintenance_time_scale,
minimum_cumulative_baseline_seizure_count,
placebo_percent_effect_mean_upper_bound,
placebo_percent_effect_mean_lower_bound,
placebo_percent_effect_std_dev,
drug_percent_effect_mean_upper_bound,
drug_percent_effect_mean_lower_bound,
drug_percent_effect_std_dev,
num_bins,
hist_range,
num_training_samples_per_classification):
placebo_arm_hists = np.zeros((2*num_training_samples_per_classification, num_bins, 1))
drug_arm_hists = np.zeros((2*num_training_samples_per_classification, num_bins, 1))
labels = np.zeros(2*num_training_samples_per_classification)
for bi_sample_index in range(num_training_samples_per_classification):
[true_drug_placebo_arm_rotated_percent_change_hist,
true_drug_treatment_arm_rotated_percent_change_hist,
false_drug_placebo_arm_rotated_percent_change_hist,
false_drug_treatment_arm_rotated_percent_change_hist] = \
generate_true_and_false_drug_histograms(one_or_two,
num_placebo_arm_patients,
num_drug_arm_patients,
num_baseline_months,
num_maintenance_months,
baseline_time_scale,
maintenance_time_scale,
minimum_cumulative_baseline_seizure_count,
placebo_percent_effect_mean_upper_bound,
placebo_percent_effect_mean_lower_bound,
placebo_percent_effect_std_dev,
drug_percent_effect_mean_upper_bound,
drug_percent_effect_mean_lower_bound,
drug_percent_effect_std_dev,
num_bins,
hist_range)
placebo_arm_hists[2*bi_sample_index, :, 0] = true_drug_placebo_arm_rotated_percent_change_hist
drug_arm_hists[2*bi_sample_index, :, 0] = true_drug_treatment_arm_rotated_percent_change_hist
placebo_arm_hists[2*bi_sample_index + 1, :, 0] = false_drug_placebo_arm_rotated_percent_change_hist
drug_arm_hists[2*bi_sample_index + 1, :, 0] = false_drug_treatment_arm_rotated_percent_change_hist
labels[2*bi_sample_index] = 1
labels[2*bi_sample_index + 1] = 0
print('training sample #' + str(2*bi_sample_index + 1) + ' done')
print('training sample #' + str(2*bi_sample_index + 2) + ' done')
return [placebo_arm_hists,
drug_arm_hists,
labels]
def store_training_data(placebo_arm_hists,
drug_arm_hists,
labels,
training_data_dir,
training_data_file_name):
training_data_file_path = training_data_dir + '/' + training_data_file_name + '.json'
data = []
data.append(placebo_arm_hists.tolist())
data.append(drug_arm_hists.tolist())
data.append(labels.tolist())
with open(training_data_file_path, 'w+') as json_training_data_storage_file:
json.dump(data, json_training_data_storage_file)
def get_inputs():
one_or_two = sys.argv[1]
num_patients_per_trial = int(sys.argv[2])
placebo_percent_effect_mean_upper_bound = float(sys.argv[3])
placebo_percent_effect_mean_lower_bound = float(sys.argv[4])
drug_percent_effect_mean_upper_bound = float(sys.argv[5])
drug_percent_effect_mean_lower_bound = float(sys.argv[6])
placebo_percent_effect_std_dev = float(sys.argv[7])
drug_percent_effect_std_dev = float(sys.argv[8])
num_training_samples_per_classification = int(sys.argv[9])
training_data_file_name = sys.argv[10]
#======================================================================================================#
if(num_patients_per_trial % 2):
raise ValueError('The number of patients per trial needs to divisible by 2.')
num_placebo_arm_patients = int(num_patients_per_trial/2)
num_drug_arm_patients = int(num_patients_per_trial/2)
num_baseline_months = 2
num_maintenance_months = 3
baseline_time_scale = 'weekly'
maintenance_time_scale = 'weekly'
minimum_cumulative_baseline_seizure_count = 4
num_bins = 80
hist_range = [-3, 1]
import os
training_data_dir = os.getcwd()
return [one_or_two,
num_placebo_arm_patients,
num_drug_arm_patients,
num_baseline_months,
num_maintenance_months,
baseline_time_scale,
maintenance_time_scale,
minimum_cumulative_baseline_seizure_count,
placebo_percent_effect_mean_upper_bound,
placebo_percent_effect_mean_lower_bound,
placebo_percent_effect_std_dev,
drug_percent_effect_mean_upper_bound,
drug_percent_effect_mean_lower_bound,
drug_percent_effect_std_dev,
num_bins,
hist_range,
num_training_samples_per_classification,
training_data_dir,
training_data_file_name]
def main():
[one_or_two,
num_placebo_arm_patients,
num_drug_arm_patients,
num_baseline_months,
num_maintenance_months,
baseline_time_scale,
maintenance_time_scale,
minimum_cumulative_baseline_seizure_count,
placebo_percent_effect_mean_upper_bound,
placebo_percent_effect_mean_lower_bound,
placebo_percent_effect_std_dev,
drug_percent_effect_mean_upper_bound,
drug_percent_effect_mean_lower_bound,
drug_percent_effect_std_dev,
num_bins,
hist_range,
num_training_samples_per_classification,
training_data_dir,
training_data_file_name] = \
get_inputs()
[placebo_arm_hists,
drug_arm_hists,
labels] = \
generate_training_data(one_or_two,
num_placebo_arm_patients,
num_drug_arm_patients,
num_baseline_months,
num_maintenance_months,
baseline_time_scale,
maintenance_time_scale,
minimum_cumulative_baseline_seizure_count,
placebo_percent_effect_mean_upper_bound,
placebo_percent_effect_mean_lower_bound,
placebo_percent_effect_std_dev,
drug_percent_effect_mean_upper_bound,
drug_percent_effect_mean_lower_bound,
drug_percent_effect_std_dev,
num_bins,
hist_range,
num_training_samples_per_classification)
store_training_data(placebo_arm_hists,
drug_arm_hists,
labels,
training_data_dir,
training_data_file_name)
if(__name__=='__main__'):
start_time_in_seconds = time.time()
main()
stop_time_in_seconds = time.time()
total_runtime_in_minutes_str = str(np.round((stop_time_in_seconds - start_time_in_seconds)/60, 3)) + ' minutes'
print(total_runtime_in_minutes_str)
| 40.366667
| 115
| 0.584405
| 889
| 8,477
| 4.953881
| 0.129359
| 0.106267
| 0.092643
| 0.065395
| 0.850136
| 0.782925
| 0.743642
| 0.703451
| 0.586058
| 0.561081
| 0
| 0.008991
| 0.357084
| 8,477
| 209
| 116
| 40.559809
| 0.799083
| 0.012033
| 0
| 0.52439
| 1
| 0
| 0.016362
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.02439
| false
| 0
| 0.036585
| 0
| 0.073171
| 0.018293
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
888f9820d11c6d25bb3c866d4a73e64cc73003b9
| 286
|
py
|
Python
|
portfolio_project/intro/views.py
|
KimEunYeol/web-portfolio
|
cd56191bdf12c712b252015d3ecb31b037f922ed
|
[
"MIT"
] | null | null | null |
portfolio_project/intro/views.py
|
KimEunYeol/web-portfolio
|
cd56191bdf12c712b252015d3ecb31b037f922ed
|
[
"MIT"
] | 7
|
2021-03-19T03:41:33.000Z
|
2022-03-12T00:30:35.000Z
|
portfolio_project/intro/views.py
|
KimEunYeol/web-portfolio
|
cd56191bdf12c712b252015d3ecb31b037f922ed
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
def index(request):
return render(request, 'intro/index.html', context=None)
def about(request):
return render(request, 'intro/about.html', context=None)
def project(request):
return render(request, 'intro/project.html', context=None)
| 26
| 62
| 0.741259
| 38
| 286
| 5.578947
| 0.394737
| 0.183962
| 0.268868
| 0.367925
| 0.438679
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129371
| 286
| 11
| 62
| 26
| 0.851406
| 0
| 0
| 0
| 0
| 0
| 0.174216
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0.142857
| 0.428571
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
889a9efacde3e59bc07dea0252ba91618051c6fb
| 45
|
py
|
Python
|
custom_components/mitemp_bt/__init__.py
|
Alexious-sh/sensor.mitemp_bt
|
c03c156ad774456c2dd9053c92f80e00779ae3cf
|
[
"MIT"
] | null | null | null |
custom_components/mitemp_bt/__init__.py
|
Alexious-sh/sensor.mitemp_bt
|
c03c156ad774456c2dd9053c92f80e00779ae3cf
|
[
"MIT"
] | null | null | null |
custom_components/mitemp_bt/__init__.py
|
Alexious-sh/sensor.mitemp_bt
|
c03c156ad774456c2dd9053c92f80e00779ae3cf
|
[
"MIT"
] | null | null | null |
"""Xiaomi BLE monitor sensor integration."""
| 22.5
| 44
| 0.733333
| 5
| 45
| 6.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 45
| 1
| 45
| 45
| 0.825
| 0.844444
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
88a916ed231d64e7cb5befde7af096ea43f0ef63
| 79
|
py
|
Python
|
src/debug_toolbar/panels/sql/__init__.py
|
simeonnetworks/sentry
|
93e9646acca76f7bd79368ed538605c9920f4e35
|
[
"BSD-3-Clause"
] | 2
|
2015-09-24T20:24:55.000Z
|
2015-10-23T08:05:35.000Z
|
debug_toolbar/panels/sql/__init__.py
|
aldryn/django-debug-toolbar
|
f878ec075d94344e2b16c8d21832b422990f65fd
|
[
"BSD-3-Clause"
] | null | null | null |
debug_toolbar/panels/sql/__init__.py
|
aldryn/django-debug-toolbar
|
f878ec075d94344e2b16c8d21832b422990f65fd
|
[
"BSD-3-Clause"
] | null | null | null |
from debug_toolbar.panels.sql.panel import SQLPanel # noqa
| 39.5
| 78
| 0.620253
| 9
| 79
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.329114
| 79
| 1
| 79
| 79
| 0.90566
| 0.050633
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
88af65cea3bc92b0190d12366371afa8d32760db
| 6,312
|
py
|
Python
|
tests/components/climate/common.py
|
pcaston/core
|
e74d946cef7a9d4e232ae9e0ba150d18018cfe33
|
[
"Apache-2.0"
] | 1
|
2021-07-08T20:09:55.000Z
|
2021-07-08T20:09:55.000Z
|
tests/components/climate/common.py
|
pcaston/core
|
e74d946cef7a9d4e232ae9e0ba150d18018cfe33
|
[
"Apache-2.0"
] | 47
|
2021-02-21T23:43:07.000Z
|
2022-03-31T06:07:10.000Z
|
tests/components/climate/common.py
|
OpenPeerPower/core
|
f673dfac9f2d0c48fa30af37b0a99df9dd6640ee
|
[
"Apache-2.0"
] | 1
|
2019-04-24T14:10:08.000Z
|
2019-04-24T14:10:08.000Z
|
"""Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from openpeerpower.components.climate import _LOGGER
from openpeerpower.components.climate.const import (
ATTR_AUX_HEAT,
ATTR_FAN_MODE,
ATTR_HUMIDITY,
ATTR_HVAC_MODE,
ATTR_PRESET_MODE,
ATTR_SWING_MODE,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
DOMAIN,
SERVICE_SET_AUX_HEAT,
SERVICE_SET_FAN_MODE,
SERVICE_SET_HUMIDITY,
SERVICE_SET_HVAC_MODE,
SERVICE_SET_PRESET_MODE,
SERVICE_SET_SWING_MODE,
SERVICE_SET_TEMPERATURE,
)
from openpeerpower.const import (
ATTR_ENTITY_ID,
ATTR_TEMPERATURE,
ENTITY_MATCH_ALL,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from openpeerpower.loader import bind_opp
async def async_set_preset_mode(opp, preset_mode, entity_id=ENTITY_MATCH_ALL):
"""Set new preset mode."""
data = {ATTR_PRESET_MODE: preset_mode}
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_SET_PRESET_MODE, data, blocking=True)
@bind_opp
def set_preset_mode(opp, preset_mode, entity_id=ENTITY_MATCH_ALL):
"""Set new preset mode."""
data = {ATTR_PRESET_MODE: preset_mode}
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
opp.services.call(DOMAIN, SERVICE_SET_PRESET_MODE, data)
async def async_set_aux_heat(opp, aux_heat, entity_id=ENTITY_MATCH_ALL):
"""Turn all or specified climate devices auxiliary heater on."""
data = {ATTR_AUX_HEAT: aux_heat}
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_SET_AUX_HEAT, data, blocking=True)
@bind_opp
def set_aux_heat(opp, aux_heat, entity_id=ENTITY_MATCH_ALL):
"""Turn all or specified climate devices auxiliary heater on."""
data = {ATTR_AUX_HEAT: aux_heat}
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
opp.services.call(DOMAIN, SERVICE_SET_AUX_HEAT, data)
async def async_set_temperature(
opp,
temperature=None,
entity_id=ENTITY_MATCH_ALL,
target_temp_high=None,
target_temp_low=None,
hvac_mode=None,
):
"""Set new target temperature."""
kwargs = {
key: value
for key, value in [
(ATTR_TEMPERATURE, temperature),
(ATTR_TARGET_TEMP_HIGH, target_temp_high),
(ATTR_TARGET_TEMP_LOW, target_temp_low),
(ATTR_ENTITY_ID, entity_id),
(ATTR_HVAC_MODE, hvac_mode),
]
if value is not None
}
_LOGGER.debug("set_temperature start data=%s", kwargs)
await opp.services.async_call(
DOMAIN, SERVICE_SET_TEMPERATURE, kwargs, blocking=True
)
@bind_opp
def set_temperature(
opp,
temperature=None,
entity_id=ENTITY_MATCH_ALL,
target_temp_high=None,
target_temp_low=None,
hvac_mode=None,
):
"""Set new target temperature."""
kwargs = {
key: value
for key, value in [
(ATTR_TEMPERATURE, temperature),
(ATTR_TARGET_TEMP_HIGH, target_temp_high),
(ATTR_TARGET_TEMP_LOW, target_temp_low),
(ATTR_ENTITY_ID, entity_id),
(ATTR_HVAC_MODE, hvac_mode),
]
if value is not None
}
_LOGGER.debug("set_temperature start data=%s", kwargs)
opp.services.call(DOMAIN, SERVICE_SET_TEMPERATURE, kwargs)
async def async_set_humidity(opp, humidity, entity_id=ENTITY_MATCH_ALL):
"""Set new target humidity."""
data = {ATTR_HUMIDITY: humidity}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_SET_HUMIDITY, data, blocking=True)
@bind_opp
def set_humidity(opp, humidity, entity_id=ENTITY_MATCH_ALL):
"""Set new target humidity."""
data = {ATTR_HUMIDITY: humidity}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
opp.services.call(DOMAIN, SERVICE_SET_HUMIDITY, data)
async def async_set_fan_mode(opp, fan, entity_id=ENTITY_MATCH_ALL):
"""Set all or specified climate devices fan mode on."""
data = {ATTR_FAN_MODE: fan}
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_SET_FAN_MODE, data, blocking=True)
@bind_opp
def set_fan_mode(opp, fan, entity_id=ENTITY_MATCH_ALL):
"""Set all or specified climate devices fan mode on."""
data = {ATTR_FAN_MODE: fan}
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
opp.services.call(DOMAIN, SERVICE_SET_FAN_MODE, data)
async def async_set_hvac_mode(opp, hvac_mode, entity_id=ENTITY_MATCH_ALL):
"""Set new target operation mode."""
data = {ATTR_HVAC_MODE: hvac_mode}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_SET_HVAC_MODE, data, blocking=True)
@bind_opp
def set_operation_mode(opp, hvac_mode, entity_id=ENTITY_MATCH_ALL):
"""Set new target operation mode."""
data = {ATTR_HVAC_MODE: hvac_mode}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
opp.services.call(DOMAIN, SERVICE_SET_HVAC_MODE, data)
async def async_set_swing_mode(opp, swing_mode, entity_id=ENTITY_MATCH_ALL):
"""Set new target swing mode."""
data = {ATTR_SWING_MODE: swing_mode}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_SET_SWING_MODE, data, blocking=True)
@bind_opp
def set_swing_mode(opp, swing_mode, entity_id=ENTITY_MATCH_ALL):
"""Set new target swing mode."""
data = {ATTR_SWING_MODE: swing_mode}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
opp.services.call(DOMAIN, SERVICE_SET_SWING_MODE, data)
async def async_turn_on(opp, entity_id=ENTITY_MATCH_ALL):
"""Turn on device."""
data = {}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_TURN_ON, data, blocking=True)
async def async_turn_off(opp, entity_id=ENTITY_MATCH_ALL):
"""Turn off device."""
data = {}
if entity_id is not None:
data[ATTR_ENTITY_ID] = entity_id
await opp.services.async_call(DOMAIN, SERVICE_TURN_OFF, data, blocking=True)
| 27.443478
| 87
| 0.707858
| 915
| 6,312
| 4.522404
| 0.085246
| 0.121798
| 0.108265
| 0.073465
| 0.844369
| 0.829386
| 0.793378
| 0.738521
| 0.698888
| 0.698888
| 0
| 0
| 0.202788
| 6,312
| 229
| 88
| 27.563319
| 0.822337
| 0.061946
| 0
| 0.560811
| 0
| 0
| 0.010432
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.047297
| false
| 0
| 0.027027
| 0
| 0.074324
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
31fed3e9882f72377eac58f2bfcc580b96ab29ff
| 145
|
py
|
Python
|
component/widget/__init__.py
|
12rambau/sdg_indicators_module
|
034b3e8dc2aa801ad806bf103f4a2bf0e41870c0
|
[
"MIT"
] | 1
|
2021-12-03T12:26:47.000Z
|
2021-12-03T12:26:47.000Z
|
component/widget/__init__.py
|
12rambau/sdg_indicators_module
|
034b3e8dc2aa801ad806bf103f4a2bf0e41870c0
|
[
"MIT"
] | 67
|
2020-12-11T09:34:32.000Z
|
2021-11-22T17:19:00.000Z
|
component/widget/__init__.py
|
12rambau/sdg_indicators_module
|
034b3e8dc2aa801ad806bf103f4a2bf0e41870c0
|
[
"MIT"
] | null | null | null |
from .climate_regime import *
from .picker_line import *
from .sensor_select import *
from .transition_matrix import *
from .result_map import *
| 24.166667
| 32
| 0.793103
| 20
| 145
| 5.5
| 0.6
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 145
| 5
| 33
| 29
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ee0aeeeba809863f4f0c93f68c33ac91972924ff
| 198
|
py
|
Python
|
09-functional-programming/higherorderfunctions/higher-order3.py
|
johnehunt/PythonCleanCode
|
b0ade446cc98cdc1379f06ad20cc3c6de772a2bb
|
[
"Apache-2.0"
] | 1
|
2020-05-11T13:58:29.000Z
|
2020-05-11T13:58:29.000Z
|
09-functional-programming/higherorderfunctions/higher-order3.py
|
johnehunt/PythonCleanCode
|
b0ade446cc98cdc1379f06ad20cc3c6de772a2bb
|
[
"Apache-2.0"
] | null | null | null |
09-functional-programming/higherorderfunctions/higher-order3.py
|
johnehunt/PythonCleanCode
|
b0ade446cc98cdc1379f06ad20cc3c6de772a2bb
|
[
"Apache-2.0"
] | null | null | null |
import math
def simple_tax_calculator(amount):
return math.ceil(amount * 0.3)
def calculate_tax(salary, func):
return func(salary)
print(calculate_tax(45000.0, simple_tax_calculator))
| 15.230769
| 52
| 0.752525
| 29
| 198
| 4.931034
| 0.551724
| 0.125874
| 0.265734
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047337
| 0.146465
| 198
| 12
| 53
| 16.5
| 0.798817
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.333333
| 0.833333
| 0.166667
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ee6195033fa1a90e0f4e4d68cdb6054a374af243
| 101,897
|
py
|
Python
|
envs/anaconda-project-dev/Lib/site-packages/yapftests/reformatter_test.py
|
vertingo/Anaconda_Videos_Tutos
|
f30f2a0549a7b81c17f4d5d249edc59eb3c05458
|
[
"BSD-3-Clause"
] | null | null | null |
envs/anaconda-project-dev/Lib/site-packages/yapftests/reformatter_test.py
|
vertingo/Anaconda_Videos_Tutos
|
f30f2a0549a7b81c17f4d5d249edc59eb3c05458
|
[
"BSD-3-Clause"
] | null | null | null |
envs/anaconda-project-dev/Lib/site-packages/yapftests/reformatter_test.py
|
vertingo/Anaconda_Videos_Tutos
|
f30f2a0549a7b81c17f4d5d249edc59eb3c05458
|
[
"BSD-3-Clause"
] | null | null | null |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for yapf.reformatter."""
import sys
import textwrap
import unittest
from yapf.yapflib import blank_line_calculator
from yapf.yapflib import comment_splicer
from yapf.yapflib import continuation_splicer
from yapf.yapflib import py3compat
from yapf.yapflib import pytree_unwrapper
from yapf.yapflib import pytree_utils
from yapf.yapflib import pytree_visitor
from yapf.yapflib import reformatter
from yapf.yapflib import split_penalty
from yapf.yapflib import style
from yapf.yapflib import subtype_assigner
from yapf.yapflib import verifier
class ReformatterTest(unittest.TestCase):
def assertCodeEqual(self, expected_code, code):
if code != expected_code:
msg = 'Code format mismatch:\n'
msg += 'Expected:\n > '
msg += '\n > '.join(expected_code.splitlines())
msg += '\nActual:\n > '
msg += '\n > '.join(code.splitlines())
# TODO(sbc): maybe using difflib here to produce easy to read deltas?
self.fail(msg)
class BasicReformatterTest(ReformatterTest):
@classmethod
def setUpClass(cls):
style.SetGlobalStyle(style.CreateChromiumStyle())
def testSimple(self):
unformatted_code = textwrap.dedent("""\
if a+b:
pass
""")
expected_formatted_code = textwrap.dedent("""\
if a + b:
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSimpleFunctions(self):
unformatted_code = textwrap.dedent("""\
def g():
pass
def f():
pass
""")
expected_formatted_code = textwrap.dedent("""\
def g():
pass
def f():
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSimpleFunctionsWithTrailingComments(self):
unformatted_code = textwrap.dedent("""\
def g(): # Trailing comment
if (xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0].mmmmmmmm[0]) == 'bbbbbbb'):
pass
def f( # Intermediate comment
):
if (xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0].mmmmmmmm[0]) == 'bbbbbbb'):
pass
""")
expected_formatted_code = textwrap.dedent("""\
def g(): # Trailing comment
if (xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0].mmmmmmmm[0]) == 'bbbbbbb'):
pass
def f( # Intermediate comment
):
if (xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0].mmmmmmmm[0]) == 'bbbbbbb'):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testBlankLinesAtEndOfFile(self):
unformatted_code = textwrap.dedent("""\
def foobar(): # foo
pass
""")
expected_formatted_code = textwrap.dedent("""\
def foobar(): # foo
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent("""\
x = { 'a':37,'b':42,
'c':927}
""")
expected_formatted_code = textwrap.dedent("""\
x = {'a': 37, 'b': 42, 'c': 927}
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testMultipleUgliness(self):
unformatted_code = textwrap.dedent("""\
x = { 'a':37,'b':42,
'c':927}
y = 'hello ''world'
z = 'hello '+'world'
a = 'hello {}'.format('world')
class foo ( object ):
def f (self ):
return 37*-+2
def g(self, x,y=42):
return y
def f ( a ) :
return 37+-+a[42-x : y**3]
""")
expected_formatted_code = textwrap.dedent("""\
x = {'a': 37, 'b': 42, 'c': 927}
y = 'hello ' 'world'
z = 'hello ' + 'world'
a = 'hello {}'.format('world')
class foo(object):
def f(self):
return 37 * -+2
def g(self, x, y=42):
return y
def f(a):
return 37 + -+a[42 - x:y**3]
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testComments(self):
unformatted_code = textwrap.dedent("""\
class Foo(object):
pass
# End class Foo
# Attached comment
class Bar(object):
pass
global_assignment = 42
# Comment attached to class with decorator.
# Comment attached to class with decorator.
@noop
@noop
class Baz(object):
pass
# Intermediate comment
class Qux(object):
pass
""")
expected_formatted_code = textwrap.dedent("""\
class Foo(object):
pass
# End class Foo
# Attached comment
class Bar(object):
pass
global_assignment = 42
# Comment attached to class with decorator.
# Comment attached to class with decorator.
@noop
@noop
class Baz(object):
pass
# Intermediate comment
class Qux(object):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSingleComment(self):
code = textwrap.dedent("""\
# Thing 1
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testCommentsInDataLiteral(self):
code = textwrap.dedent("""\
def f():
return collections.OrderedDict({
# First comment.
'fnord': 37,
# Second comment.
# Continuation of second comment.
'bork': 42,
# Ending comment.
})
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testEndingWhitespaceAfterSimpleStatement(self):
code = textwrap.dedent("""\
import foo as bar
# Thing 1
# Thing 2
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testDocstrings(self):
unformatted_code = textwrap.dedent('''\
u"""Module-level docstring."""
import os
class Foo(object):
"""Class-level docstring."""
# A comment for qux.
def qux(self):
"""Function-level docstring.
A multiline function docstring.
"""
print('hello {}'.format('world'))
return 42
''')
expected_formatted_code = textwrap.dedent('''\
u"""Module-level docstring."""
import os
class Foo(object):
"""Class-level docstring."""
# A comment for qux.
def qux(self):
"""Function-level docstring.
A multiline function docstring.
"""
print('hello {}'.format('world'))
return 42
''')
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testDocstringAndMultilineComment(self):
unformatted_code = textwrap.dedent('''\
"""Hello world"""
# A multiline
# comment
class bar(object):
"""class docstring"""
# class multiline
# comment
def foo(self):
"""Another docstring."""
# Another multiline
# comment
pass
''')
expected_formatted_code = textwrap.dedent('''\
"""Hello world"""
# A multiline
# comment
class bar(object):
"""class docstring"""
# class multiline
# comment
def foo(self):
"""Another docstring."""
# Another multiline
# comment
pass
''')
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testMultilineDocstringAndMultilineComment(self):
unformatted_code = textwrap.dedent('''\
"""Hello world
RIP Dennis Richie.
"""
# A multiline
# comment
class bar(object):
"""class docstring
A classy class.
"""
# class multiline
# comment
def foo(self):
"""Another docstring.
A functional function.
"""
# Another multiline
# comment
pass
''')
expected_formatted_code = textwrap.dedent('''\
"""Hello world
RIP Dennis Richie.
"""
# A multiline
# comment
class bar(object):
"""class docstring
A classy class.
"""
# class multiline
# comment
def foo(self):
"""Another docstring.
A functional function.
"""
# Another multiline
# comment
pass
''')
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testTupleCommaBeforeLastParen(self):
unformatted_code = textwrap.dedent("""\
a = ( 1, )
""")
expected_formatted_code = textwrap.dedent("""\
a = (1,)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testNoBreakOutsideOfBracket(self):
# FIXME(morbo): How this is formatted is not correct. But it's syntactically
# correct.
unformatted_code = textwrap.dedent("""\
def f():
assert port >= minimum, \
'Unexpected port %d when minimum was %d.' % (port, minimum)
""")
expected_formatted_code = textwrap.dedent("""\
def f():
assert port >= minimum, 'Unexpected port %d when minimum was %d.' % (port,
minimum)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testBlankLinesBeforeDecorators(self):
unformatted_code = textwrap.dedent("""\
@foo()
class A(object):
@bar()
@baz()
def x(self):
pass
""")
expected_formatted_code = textwrap.dedent("""\
@foo()
class A(object):
@bar()
@baz()
def x(self):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testCommentBetweenDecorators(self):
unformatted_code = textwrap.dedent("""\
@foo()
# frob
@bar
def x (self):
pass
""")
expected_formatted_code = textwrap.dedent("""\
@foo()
# frob
@bar
def x(self):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testListComprehension(self):
unformatted_code = textwrap.dedent("""\
def given(y):
[k for k in ()
if k in y]
""")
expected_formatted_code = textwrap.dedent("""\
def given(y):
[k for k in () if k in y]
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testOpeningAndClosingBrackets(self):
unformatted_code = textwrap.dedent("""\
foo( ( 1, 2, 3, ) )
""")
expected_formatted_code = textwrap.dedent("""\
foo((1, 2, 3,))
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSingleLineFunctions(self):
unformatted_code = textwrap.dedent("""\
def foo(): return 42
""")
expected_formatted_code = textwrap.dedent("""\
def foo():
return 42
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testNoQueueSeletionInMiddleOfLine(self):
# If the queue isn't properly consttructed, then a token in the middle of
# the line may be selected as the one with least penalty. The tokens after
# that one are then splatted at the end of the line with no formatting.
# FIXME(morbo): The formatting here isn't ideal.
unformatted_code = textwrap.dedent("""\
find_symbol(node.type) + "< " + " ".join(find_pattern(n) for n in \
node.child) + " >"
""")
expected_formatted_code = textwrap.dedent("""\
find_symbol(node.type) + "< " + " ".join(find_pattern(n)
for n in node.child) + " >"
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testNoSpacesBetweenSubscriptsAndCalls(self):
unformatted_code = textwrap.dedent("""\
aaaaaaaaaa = bbbbbbbb.ccccccccc() [42] (a, 2)
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaa = bbbbbbbb.ccccccccc()[42](a, 2)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testNoSpacesBetweenOpeningBracketAndStartingOperator(self):
# Unary operator.
unformatted_code = textwrap.dedent("""\
aaaaaaaaaa = bbbbbbbb.ccccccccc[ -1 ]( -42 )
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaa = bbbbbbbb.ccccccccc[-1](-42)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
# Varargs and kwargs.
unformatted_code = textwrap.dedent("""\
aaaaaaaaaa = bbbbbbbb.ccccccccc( *varargs )
aaaaaaaaaa = bbbbbbbb.ccccccccc( **kwargs )
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaa = bbbbbbbb.ccccccccc(*varargs)
aaaaaaaaaa = bbbbbbbb.ccccccccc(**kwargs)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testMultilineCommentReformatted(self):
unformatted_code = textwrap.dedent("""\
if True:
# This is a multiline
# comment.
pass
""")
expected_formatted_code = textwrap.dedent("""\
if True:
# This is a multiline
# comment.
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testDictionaryMakerFormatting(self):
unformatted_code = textwrap.dedent("""\
_PYTHON_STATEMENTS = frozenset({
lambda x, y: 'simple_stmt': 'small_stmt', 'expr_stmt': 'print_stmt', 'del_stmt':
'pass_stmt', lambda: 'break_stmt': 'continue_stmt', 'return_stmt': 'raise_stmt',
'yield_stmt': 'import_stmt', lambda: 'global_stmt': 'exec_stmt', 'assert_stmt':
'if_stmt', 'while_stmt': 'for_stmt',
})
""")
expected_formatted_code = textwrap.dedent("""\
_PYTHON_STATEMENTS = frozenset({
lambda x, y: 'simple_stmt': 'small_stmt',
'expr_stmt': 'print_stmt',
'del_stmt': 'pass_stmt',
lambda: 'break_stmt': 'continue_stmt',
'return_stmt': 'raise_stmt',
'yield_stmt': 'import_stmt',
lambda: 'global_stmt': 'exec_stmt',
'assert_stmt': 'if_stmt',
'while_stmt': 'for_stmt',
})
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSimpleMultilineCode(self):
unformatted_code = textwrap.dedent("""\
if True:
aaaaaaaaaaaaaa.bbbbbbbbbbbbbb.ccccccc(zzzzzzzzzzzz, \
xxxxxxxxxxx, yyyyyyyyyyyy, vvvvvvvvv)
aaaaaaaaaaaaaa.bbbbbbbbbbbbbb.ccccccc(zzzzzzzzzzzz, \
xxxxxxxxxxx, yyyyyyyyyyyy, vvvvvvvvv)
""")
expected_formatted_code = textwrap.dedent("""\
if True:
aaaaaaaaaaaaaa.bbbbbbbbbbbbbb.ccccccc(zzzzzzzzzzzz, xxxxxxxxxxx, yyyyyyyyyyyy,
vvvvvvvvv)
aaaaaaaaaaaaaa.bbbbbbbbbbbbbb.ccccccc(zzzzzzzzzzzz, xxxxxxxxxxx, yyyyyyyyyyyy,
vvvvvvvvv)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testMultilineComment(self):
code = textwrap.dedent("""\
if Foo:
# Hello world
# Yo man.
# Yo man.
# Yo man.
# Yo man.
a = 42
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testMultilineString(self):
code = textwrap.dedent("""\
code = textwrap.dedent('''\
if Foo:
# Hello world
# Yo man.
# Yo man.
# Yo man.
# Yo man.
a = 42
''')
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent('''\
def f():
email_text += """<html>This is a really long docstring that goes over the column limit and is multi-line.<br><br>
<b>Czar: </b>"""+despot["Nicholas"]+"""<br>
<b>Minion: </b>"""+serf["Dmitri"]+"""<br>
<b>Residence: </b>"""+palace["Winter"]+"""<br>
</body>
</html>"""
''')
expected_formatted_code = textwrap.dedent('''\
def f():
email_text += """<html>This is a really long docstring that goes over the column limit and is multi-line.<br><br>
<b>Czar: </b>""" + despot["Nicholas"] + """<br>
<b>Minion: </b>""" + serf["Dmitri"] + """<br>
<b>Residence: </b>""" + palace["Winter"] + """<br>
</body>
</html>"""
''')
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSimpleMultilineWithComments(self):
code = textwrap.dedent("""\
if ( # This is the first comment
a and # This is the second comment
# This is the third comment
b): # A trailing comment
# Whoa! A normal comment!!
pass # Another trailing comment
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testMatchingParenSplittingMatching(self):
unformatted_code = textwrap.dedent("""\
def f():
raise RuntimeError('unable to find insertion point for target node',
(target,))
""")
expected_formatted_code = textwrap.dedent("""\
def f():
raise RuntimeError('unable to find insertion point for target node',
(target,))
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testContinuationIndent(self):
unformatted_code = textwrap.dedent('''\
class F:
def _ProcessArgLists(self, node):
"""Common method for processing argument lists."""
for child in node.children:
if isinstance(child, pytree.Leaf):
self._SetTokenSubtype(
child, subtype=_ARGLIST_TOKEN_TO_SUBTYPE.get(
child.value, format_token.Subtype.NONE))
''')
expected_formatted_code = textwrap.dedent('''\
class F:
def _ProcessArgLists(self, node):
"""Common method for processing argument lists."""
for child in node.children:
if isinstance(child, pytree.Leaf):
self._SetTokenSubtype(child,
subtype=_ARGLIST_TOKEN_TO_SUBTYPE.get(
child.value, format_token.Subtype.NONE))
''')
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testTrailingCommaAndBracket(self):
unformatted_code = textwrap.dedent('''\
a = { 42, }
b = ( 42, )
c = [ 42, ]
''')
expected_formatted_code = textwrap.dedent('''\
a = {42,}
b = (42,)
c = [42,]
''')
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testI18n(self):
code = textwrap.dedent("""\
N_('Some years ago - never mind how long precisely - having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.') # A comment is here.
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
code = textwrap.dedent("""\
foo('Fake function call') #. Some years ago - never mind how long precisely - having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testI18nCommentsInDataLiteral(self):
code = textwrap.dedent("""\
def f():
return collections.OrderedDict({
#. First i18n comment.
'bork': 'foo',
#. Second i18n comment.
'snork': 'bar#.*=\\\\0',
})
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testClosingBracketIndent(self):
code = textwrap.dedent('''\
def f():
def g():
while (
xxxxxxxxxxxxxxxxxxxxx(yyyyyyyyyyyyy[zzzzz]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxxxxxxxxxxx(yyyyyyyyyyyyy[zzzzz].aaaaaaaa[0]) == 'bbbbbbb'):
pass
''')
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testClosingBracketsInlinedInCall(self):
unformatted_code = textwrap.dedent("""\
class Foo(object):
def bar(self):
self.aaaaaaaa = xxxxxxxxxxxxxxxxxxx.yyyyyyyyyyyyy(
self.cccccc.ddddddddd.eeeeeeee,
options={
"forkforkfork": 1,
"borkborkbork": 2,
"corkcorkcork": 3,
"horkhorkhork": 4,
"porkporkpork": 5,
})
""")
expected_formatted_code = textwrap.dedent("""\
class Foo(object):
def bar(self):
self.aaaaaaaa = xxxxxxxxxxxxxxxxxxx.yyyyyyyyyyyyy(
self.cccccc.ddddddddd.eeeeeeee,
options={
"forkforkfork": 1,
"borkborkbork": 2,
"corkcorkcork": 3,
"horkhorkhork": 4,
"porkporkpork": 5,
})
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testLineWrapInForExpression(self):
code = textwrap.dedent("""\
class A:
def x(self, node, name, n=1):
for i, child in enumerate(itertools.ifilter(
lambda c: pytree_utils.NodeName(c) == name, node.pre_order())):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testFunctionCallContinuationLine(self):
code = textwrap.dedent("""\
class foo:
def bar(self, node, name, n=1):
if True:
if True:
return [(aaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(
cccc, ddddddddddddddddddddddddddddddddddddd))]
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testI18nNonFormatting(self):
code = textwrap.dedent("""\
class F(object):
def __init__(self, fieldname,
#. Error message indicating an invalid e-mail address.
message=N_('Please check your email address.'), **kwargs):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoSpaceBetweenUnaryOpAndOpeningParen(self):
code = textwrap.dedent("""\
if ~(a or b):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testCommentBeforeFuncDef(self):
code = textwrap.dedent("""\
class Foo(object):
a = 42
# This is a comment.
def __init__(self,
xxxxxxx,
yyyyy=0,
zzzzzzz=None,
aaaaaaaaaaaaaaaaaa=False,
bbbbbbbbbbbbbbb=False):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testExcessLineCountWithDefaultKeywords(self):
unformatted_code = textwrap.dedent("""\
class Fnord(object):
def Moo(self):
aaaaaaaaaaaaaaaa = self._bbbbbbbbbbbbbbbbbbbbbbb(
ccccccccccccc=ccccccccccccc, ddddddd=ddddddd, eeee=eeee,
fffff=fffff, ggggggg=ggggggg, hhhhhhhhhhhhh=hhhhhhhhhhhhh,
iiiiiii=iiiiiiiiiiiiii)
""")
expected_formatted_code = textwrap.dedent("""\
class Fnord(object):
def Moo(self):
aaaaaaaaaaaaaaaa = self._bbbbbbbbbbbbbbbbbbbbbbb(
ccccccccccccc=ccccccccccccc,
ddddddd=ddddddd,
eeee=eeee,
fffff=fffff,
ggggggg=ggggggg,
hhhhhhhhhhhhh=hhhhhhhhhhhhh,
iiiiiii=iiiiiiiiiiiiii)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSpaceAfterNotOperator(self):
code = textwrap.dedent("""\
if not (this and that):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoPenaltySplitting(self):
code = textwrap.dedent("""\
def f():
if True:
if True:
python_files.extend(os.path.join(filename, f)
for f in os.listdir(filename)
if IsPythonFile(os.path.join(filename, f)))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testExpressionPenalties(self):
code = textwrap.dedent("""\
def f():
if ((left.value == '(' and right.value == ')') or
(left.value == '[' and right.value == ']') or
(left.value == '{' and right.value == '}')):
return False
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testLineDepthOfSingleLineStatement(self):
unformatted_code = textwrap.dedent("""\
while True: continue
for x in range(3): continue
try: a = 42
except: b = 42
with open(a) as fd: a = fd.read()
""")
expected_formatted_code = textwrap.dedent("""\
while True:
continue
for x in range(3):
continue
try:
a = 42
except:
b = 42
with open(a) as fd:
a = fd.read()
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSplitListWithTerminatingComma(self):
unformatted_code = textwrap.dedent("""\
FOO = ['bar', 'baz', 'mux', 'qux', 'quux', 'quuux', 'quuuux',
'quuuuux', 'quuuuuux', 'quuuuuuux', lambda a, b: 37,]
""")
expected_formatted_code = textwrap.dedent("""\
FOO = ['bar',
'baz',
'mux',
'qux',
'quux',
'quuux',
'quuuux',
'quuuuux',
'quuuuuux',
'quuuuuuux',
lambda a, b: 37,]
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSplitListWithInterspersedComments(self):
unformatted_code = textwrap.dedent("""\
FOO = ['bar', # bar
'baz', # baz
'mux', # mux
'qux', # qux
'quux', # quux
'quuux', # quuux
'quuuux', # quuuux
'quuuuux', # quuuuux
'quuuuuux', # quuuuuux
'quuuuuuux', # quuuuuuux
lambda a, b: 37 # lambda
]
""")
expected_formatted_code = textwrap.dedent("""\
FOO = ['bar', # bar
'baz', # baz
'mux', # mux
'qux', # qux
'quux', # quux
'quuux', # quuux
'quuuux', # quuuux
'quuuuux', # quuuuux
'quuuuuux', # quuuuuux
'quuuuuuux', # quuuuuuux
lambda a, b: 37 # lambda
]
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testRelativeImportStatements(self):
code = textwrap.dedent("""\
from ... import bork
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testSingleLineList(self):
# A list on a single line should prefer to remain contiguous.
unformatted_code = textwrap.dedent("""\
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = aaaaaaaaaaa(
("...", "."), "..",
".............................................."
)
""")
expected_formatted_code = textwrap.dedent("""\
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = aaaaaaaaaaa(
("...", "."), "..", "..............................................")
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testBlankLinesBeforeFunctionsNotInColumnZero(self):
unformatted_code = textwrap.dedent("""\
import signal
try:
signal.SIGALRM
# ..................................................................
# ...............................................................
def timeout(seconds=1):
pass
except:
pass
""")
expected_formatted_code = textwrap.dedent("""\
import signal
try:
signal.SIGALRM
# ..................................................................
# ...............................................................
def timeout(seconds=1):
pass
except:
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testNoKeywordArgumentBreakage(self):
code = textwrap.dedent("""\
class A(object):
def b(self):
if self.aaaaaaaaaaaaaaaaaaaa not in self.bbbbbbbbbb(
cccccccccccccccccccc=True):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testTrailerOnSingleLine(self):
code = textwrap.dedent("""\
urlpatterns = patterns('', url(r'^$', 'homepage_view'),
url(r'^/login/$', 'login_view'),
url(r'^/login/$', 'logout_view'),
url(r'^/user/(?P<username>\\w+)/$', 'profile_view'))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testIfConditionalParens(self):
code = textwrap.dedent("""\
class Foo:
def bar():
if True:
if (child.type == grammar_token.NAME and
child.value in substatement_names):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testContinuationMarkers(self):
code = textwrap.dedent("""\
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. "\\
"Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur "\\
"ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis "\\
"sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. "\\
"Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet"
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
code = textwrap.dedent("""\
from __future__ import nested_scopes, generators, division, absolute_import, with_statement, \\
print_function, unicode_literals
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
code = textwrap.dedent("""\
if aaaaaaaaa == 42 and bbbbbbbbbbbbbb == 42 and \\
cccccccc == 42:
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testCommentsWithContinuationMarkers(self):
code = textwrap.dedent("""\
def fn(arg):
v = fn2(key1=True,
#c1
key2=arg)\\
.fn3()
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testEmptyContainers(self):
code = textwrap.dedent("""\
flags.DEFINE_list(
'output_dirs', [],
'Lorem ipsum dolor sit amet, consetetur adipiscing elit. Donec a diam lectus. '
'Sed sit amet ipsum mauris. Maecenas congue.')
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testSplitStringsIfSurroundedByParens(self):
unformatted_code = textwrap.dedent("""\
a = foo.bar({'xxxxxxxxxxxxxxxxxxxxxxx' 'yyyyyyyyyyyyyyyyyyyyyyyyyy': baz[42]} + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbb' 'cccccccccccccccccccccccccccccccc' 'ddddddddddddddddddddddddddddd')
""")
expected_formatted_code = textwrap.dedent("""\
a = foo.bar({'xxxxxxxxxxxxxxxxxxxxxxx'
'yyyyyyyyyyyyyyyyyyyyyyyyyy': baz[42]
} + 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
'bbbbbbbbbbbbbbbbbbbbbbbbbb'
'cccccccccccccccccccccccccccccccc'
'ddddddddddddddddddddddddddddd')
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
code = textwrap.dedent("""\
a = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
'bbbbbbbbbbbbbbbbbbbbbbbbbb' 'cccccccccccccccccccccccccccccccc' \
'ddddddddddddddddddddddddddddd'
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testMultilineShebang(self):
code = textwrap.dedent("""\
#!/bin/sh
if "true" : '''\'
then
export FOO=123
exec /usr/bin/env python "$0" "$@"
exit 127
fi
'''
import os
assert os.environ['FOO'] == '123'
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoSplittingAroundTermOperators(self):
code = textwrap.dedent("""\
a_very_long_function_call_yada_yada_etc_etc_etc(long_arg1,
long_arg2 / long_arg3)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoSplittingWithinSubscriptList(self):
code = textwrap.dedent("""\
somequitelongvariablename.somemember[(a, b)] = {
'somelongkey': 1,
'someotherlongkey': 2
}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testExcessCharacters(self):
code = textwrap.dedent("""\
class foo:
def bar(self):
self.write(s=['%s%s %s' % ('many of really', 'long strings',
'+ just makes up 81')])
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testDictSetGenerator(self):
code = textwrap.dedent("""\
foo = {
variable: 'hello world. How are you today?'
for variable in fnord if variable != 37
}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testUnaryOpInDictionaryValue(self):
code = textwrap.dedent("""\
beta = "123"
test = {'alpha': beta[-1]}
print(beta[-1])
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testUnaryNotOperator(self):
code = textwrap.dedent("""\
if True:
if True:
if True:
if True:
remote_checksum = self.get_checksum(conn, tmp, dest, inject,
not directory_prepended, source)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testRelaxArraySubscriptAffinity(self):
code = textwrap.dedent("""\
class A(object):
def f(self, aaaaaaaaa, bbbbbbbbbbbbb, row):
if True:
if True:
if True:
if True:
if row[4] is None or row[5] is None:
bbbbbbbbbbbbb['..............'] = row[
5] if row[5] is not None else 5
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testFunctionCallInDict(self):
code = "a = {'a': b(c=d, **e)}\n"
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testFunctionCallInNestedDict(self):
code = "a = {'a': {'a': {'a': b(c=d, **e)}}}\n"
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testUnbreakableNot(self):
code = textwrap.dedent("""\
def test():
if not "Foooooooooooooooooooooooooooooo" or "Foooooooooooooooooooooooooooooo" == "Foooooooooooooooooooooooooooooo":
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testSplitListWithComment(self):
code = textwrap.dedent("""\
a = [
'a',
'b',
'c' # hello world
]
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testOverColumnLimit(self):
unformatted_code = textwrap.dedent("""\
class Test:
def testSomething(self):
expected = {
('aaaaaaaaaaaaa', 'bbbb'): 'ccccccccccccccccccccccccccccccccccccccccccc',
('aaaaaaaaaaaaa', 'bbbb'): 'ccccccccccccccccccccccccccccccccccccccccccc',
('aaaaaaaaaaaaa', 'bbbb'): 'ccccccccccccccccccccccccccccccccccccccccccc',
}
""")
expected_formatted_code = textwrap.dedent("""\
class Test:
def testSomething(self):
expected = {
('aaaaaaaaaaaaa', 'bbbb'):
'ccccccccccccccccccccccccccccccccccccccccccc',
('aaaaaaaaaaaaa', 'bbbb'):
'ccccccccccccccccccccccccccccccccccccccccccc',
('aaaaaaaaaaaaa', 'bbbb'):
'ccccccccccccccccccccccccccccccccccccccccccc',
}
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testEndingComment(self):
code = textwrap.dedent("""\
a = f(a="something",
b="something requiring comment which is quite long", # comment about b (pushes line over 79)
c="something else, about which comment doesn't make sense")
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testContinuationSpaceRetention(self):
code = textwrap.dedent("""\
def fn():
return module \\
.method(Object(data,
fn2(arg)
))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testIfExpressionWithFunctionCall(self):
code = textwrap.dedent("""\
if x or z.y(a,
c,
aaaaaaaaaaaaaaaaaaaaa=aaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbb=bbbbbbbbbbbbbbbbbb):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testUnformattedAfterMultilineString(self):
code = textwrap.dedent("""\
def foo():
com_text = \\
'''
TEST
''' % (input_fname, output_fname)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoSpacesAroundKeywordDefaultValues(self):
code = textwrap.dedent("""\
sources = {
'json': request.get_json(silent=True) or {},
'json2': request.get_json(silent=True),
}
json = request.get_json(silent=True) or {}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoSplittingBeforeEndingSubscriptBracket(self):
unformatted_code = textwrap.dedent("""\
if True:
if True:
status = cf.describe_stacks(StackName=stackname)[u'Stacks'][0][u'StackStatus']
""")
expected_formatted_code = textwrap.dedent("""\
if True:
if True:
status = cf.describe_stacks(
StackName=stackname)[u'Stacks'][0][u'StackStatus']
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testNoSplittingOnSingleArgument(self):
unformatted_code = textwrap.dedent("""\
xxxxxxxxxxxxxx = (re.search(r'(\\d+\\.\\d+\\.\\d+\\.)\\d+',
aaaaaaa.bbbbbbbbbbbb).group(1) +
re.search(r'\\d+\\.\\d+\\.\\d+\\.(\\d+)',
ccccccc).group(1))
xxxxxxxxxxxxxx = (re.search(r'(\\d+\\.\\d+\\.\\d+\\.)\\d+',
aaaaaaa.bbbbbbbbbbbb).group(a.b) +
re.search(r'\\d+\\.\\d+\\.\\d+\\.(\\d+)',
ccccccc).group(c.d))
""")
expected_formatted_code = textwrap.dedent("""\
xxxxxxxxxxxxxx = (
re.search(r'(\\d+\\.\\d+\\.\\d+\\.)\\d+', aaaaaaa.bbbbbbbbbbbb).group(1) +
re.search(r'\\d+\\.\\d+\\.\\d+\\.(\\d+)', ccccccc).group(1))
xxxxxxxxxxxxxx = (
re.search(r'(\\d+\\.\\d+\\.\\d+\\.)\\d+', aaaaaaa.bbbbbbbbbbbb).group(a.b) +
re.search(r'\\d+\\.\\d+\\.\\d+\\.(\\d+)', ccccccc).group(c.d))
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSplittingArraysSensibly(self):
unformatted_code = textwrap.dedent("""\
while True:
while True:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = list['bbbbbbbbbbbbbbbbbbbbbbbbb'].split(',')
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = list('bbbbbbbbbbbbbbbbbbbbbbbbb').split(',')
""")
expected_formatted_code = textwrap.dedent("""\
while True:
while True:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = list[
'bbbbbbbbbbbbbbbbbbbbbbbbb'].split(',')
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = list(
'bbbbbbbbbbbbbbbbbbbbbbbbb').split(',')
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testComprehensionForAndIf(self):
unformatted_code = textwrap.dedent("""\
class f:
def __repr__(self):
tokens_repr = ','.join(['{0}({1!r})'.format(tok.name, tok.value) for tok in self._tokens])
""")
expected_formatted_code = textwrap.dedent("""\
class f:
def __repr__(self):
tokens_repr = ','.join(['{0}({1!r})'.format(tok.name, tok.value)
for tok in self._tokens])
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testFunctionCallArguments(self):
unformatted_code = textwrap.dedent("""\
def f():
if True:
pytree_utils.InsertNodesBefore(_CreateCommentsFromPrefix(
comment_prefix, comment_lineno, comment_column,
standalone=True), ancestor_at_indent)
pytree_utils.InsertNodesBefore(_CreateCommentsFromPrefix(
comment_prefix, comment_lineno, comment_column,
standalone=True))
""")
expected_formatted_code = textwrap.dedent("""\
def f():
if True:
pytree_utils.InsertNodesBefore(
_CreateCommentsFromPrefix(comment_prefix,
comment_lineno,
comment_column,
standalone=True),
ancestor_at_indent)
pytree_utils.InsertNodesBefore(_CreateCommentsFromPrefix(comment_prefix,
comment_lineno,
comment_column,
standalone=True))
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testBinaryOperators(self):
unformatted_code = textwrap.dedent("""\
a = b ** 37
""")
expected_formatted_code = textwrap.dedent("""\
a = b**37
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testBinaryOperators(self):
code = textwrap.dedent("""\
def f():
if True:
if (self.stack[-1].split_before_closing_bracket and
# FIXME(morbo): Use the 'matching_bracket' instead of this.
# FIXME(morbo): Don't forget about tuples!
current.value in ']}'):
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testContiguousList(self):
code = textwrap.dedent("""\
[retval1, retval2] = a_very_long_function(argument_1, argument2, argument_3,
argument_4)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testArgsAndKwargsFormatting(self):
code = textwrap.dedent("""\
a(a=aaaaaaaaaaaaaaaaaaaaa,
b=aaaaaaaaaaaaaaaaaaaaaaaa,
c=aaaaaaaaaaaaaaaaaa,
*d,
**e)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testCommentColumnLimitOverflow(self):
code = textwrap.dedent("""\
def f():
if True:
TaskManager.get_tags = MagicMock(
name='get_tags_mock',
return_value=[157031694470475],
# side_effect=[(157031694470475), (157031694470475),],
)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
class BuganizerFixes(ReformatterTest):
@classmethod
def setUpClass(cls):
style.SetGlobalStyle(style.CreateChromiumStyle())
def testB25324261(self):
code = textwrap.dedent("""\
aaaaaaaaa = set(bbbb.cccc
for ddd in eeeeee.fffffffffff.gggggggggggggggg
for cccc in ddd.specification)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB25136704(self):
code = textwrap.dedent("""\
class f:
def test(self):
self.bbbbbbb[0][
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
{'xxxxxx': 'yyyyyy'}] = cccccc.ddd('1m', '10x1+1')
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB25165602(self):
code = textwrap.dedent("""\
def f():
ids = {u: i for u, i in zip(self.aaaaa, xrange(42, 42 + len(self.aaaaaa)))}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB25157123(self):
code = textwrap.dedent("""\
def ListArgs():
FairlyLongMethodName(
[relatively_long_identifier_for_a_list],
another_argument_with_a_long_identifier)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB25136820(self):
unformatted_code = textwrap.dedent("""\
def foo():
return collections.OrderedDict({
# Preceding comment.
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa':
'$bbbbbbbbbbbbbbbbbbbbbbbb',
})
""")
expected_formatted_code = textwrap.dedent("""\
def foo():
return collections.OrderedDict({
# Preceding comment.
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa':
'$bbbbbbbbbbbbbbbbbbbbbbbb',
})
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB25131481(self):
unformatted_code = textwrap.dedent("""\
APPARENT_ACTIONS = ('command_type', {
'materialize': lambda x: some_type_of_function('materialize ' + x.command_def),
'#': lambda x: x # do nothing
})
""")
expected_formatted_code = textwrap.dedent("""\
APPARENT_ACTIONS = (
'command_type',
{
'materialize':
lambda x: some_type_of_function('materialize ' + x.command_def),
'#': lambda x: x # do nothing
})
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB23445244(self):
unformatted_code = textwrap.dedent("""\
def foo():
if True:
return xxxxxxxxxxxxxxxx(
command,
extra_env={
"OOOOOOOOOOOOOOOOOOOOO": FLAGS.zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
"PPPPPPPPPPPPPPPPPPPPP":
FLAGS.aaaaaaaaaaaaaa + FLAGS.bbbbbbbbbbbbbbbbbbb,
})
""")
expected_formatted_code = textwrap.dedent("""\
def foo():
if True:
return xxxxxxxxxxxxxxxx(
command,
extra_env={
"OOOOOOOOOOOOOOOOOOOOO":
FLAGS.zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
"PPPPPPPPPPPPPPPPPPPPP": FLAGS.aaaaaaaaaaaaaa +
FLAGS.bbbbbbbbbbbbbbbbbbb,
})
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB20559654(self):
unformatted_code = textwrap.dedent("""\
class A(object):
def foo(self):
unused_error, result = server.Query(
['AA BBBB CCC DDD EEEEEEEE X YY ZZZZ FFF EEE AAAAAAAA'],
aaaaaaaaaaa=True, bbbbbbbb=None)
""")
expected_formatted_code = textwrap.dedent("""\
class A(object):
def foo(self):
unused_error, result = server.Query(
['AA BBBB CCC DDD EEEEEEEE X YY ZZZZ FFF EEE AAAAAAAA'],
aaaaaaaaaaa=True,
bbbbbbbb=None)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB23943842(self):
unformatted_code = textwrap.dedent("""\
class F():
def f():
self.assertDictEqual(
accounts, {
'foo':
{'account': 'foo',
'lines': 'l1\\nl2\\nl3\\n1 line(s) were elided.'},
'bar': {'account': 'bar',
'lines': 'l5\\nl6\\nl7'},
'wiz': {'account': 'wiz',
'lines': 'l8'}
})
""")
expected_formatted_code = textwrap.dedent("""\
class F():
def f():
self.assertDictEqual(accounts, {
'foo': {'account': 'foo',
'lines': 'l1\\nl2\\nl3\\n1 line(s) were elided.'},
'bar': {'account': 'bar',
'lines': 'l5\\nl6\\nl7'},
'wiz': {'account': 'wiz',
'lines': 'l8'}
})
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB20551180(self):
unformatted_code = textwrap.dedent("""\
def foo():
if True:
return (struct.pack('aaaa', bbbbbbbbbb, ccccccccccccccc, dddddddd) + eeeeeee)
""")
expected_formatted_code = textwrap.dedent("""\
def foo():
if True:
return (
struct.pack('aaaa', bbbbbbbbbb, ccccccccccccccc, dddddddd) + eeeeeee)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB23944849(self):
unformatted_code = textwrap.dedent("""\
class A(object):
def xxxxxxxxx(self, aaaaaaa, bbbbbbb=ccccccccccc, dddddd=300, eeeeeeeeeeeeee=None, fffffffffffffff=0):
pass
""")
expected_formatted_code = textwrap.dedent("""\
class A(object):
def xxxxxxxxx(self,
aaaaaaa,
bbbbbbb=ccccccccccc,
dddddd=300,
eeeeeeeeeeeeee=None,
fffffffffffffff=0):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB23935890(self):
unformatted_code = textwrap.dedent("""\
class F():
def functioni(self, aaaaaaa, bbbbbbb, cccccc, dddddddddddddd, eeeeeeeeeeeeeee):
pass
""")
expected_formatted_code = textwrap.dedent("""\
class F():
def functioni(self, aaaaaaa, bbbbbbb, cccccc, dddddddddddddd,
eeeeeeeeeeeeeee):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB20127686(self):
code = textwrap.dedent("""\
def f():
if True:
return ((m.fffff(
m.rrr('xxxxxxxxxxxxxxxx',
'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'),
mmmmmmmm)
| m.wwwwww(m.rrrr(self.tttttttttt, self.mmmmmmmmmmmmmmmmmmmmm))
| m.ggggggg(self.gggggggg, m.sss()), m.fffff('aaaaaaaaaaaaaaaa')
| m.wwwwww(m.ddddd(self.tttttttttt, self.mmmmmmmmmmmmmmmmmmmmm))
| m.ggggggg(self.gggggggg)) | m.jjjj()
| m.ppppp(m.VAL[0] / m.VAL[1]))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB20016122(self):
try:
style.SetGlobalStyle(style.CreateStyleFromConfig(
'{based_on_style: chromium, SPLIT_BEFORE_LOGICAL_OPERATOR: True}'))
code = textwrap.dedent("""\
class foo():
def __eq__(self, other):
return (isinstance(other, type(self))
and self.xxxxxxxxxxx == other.xxxxxxxxxxx
and self.xxxxxxxx == other.xxxxxxxx
and self.aaaaaaaaaaaa == other.aaaaaaaaaaaa
and self.bbbbbbbbbbb == other.bbbbbbbbbbb
and self.ccccccccccccccccc == other.ccccccccccccccccc
and self.ddddddddddddddddddddddd == other.ddddddddddddddddddddddd
and self.eeeeeeeeeeee == other.eeeeeeeeeeee
and self.ffffffffffffff == other.time_completed
and self.gggggg == other.gggggg and self.hhh == other.hhh
and len(self.iiiiiiii) == len(other.iiiiiiii)
and all(jjjjjjj in other.iiiiiiii for jjjjjjj in self.iiiiiiii))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
finally:
style.SetGlobalStyle(style.CreateChromiumStyle())
def testB22527411(self):
unformatted_code = textwrap.dedent("""\
def f():
if True:
aaaaaa.bbbbbbbbbbbbbbbbbbbb[-1].cccccccccccccc.ddd().eeeeeeee(ffffffffffffff)
""")
expected_formatted_code = textwrap.dedent("""\
def f():
if True:
aaaaaa.bbbbbbbbbbbbbbbbbbbb[-1].cccccccccccccc.ddd().eeeeeeee(
ffffffffffffff)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB20849933(self):
code = textwrap.dedent("""\
def main(unused_argv):
if True:
aaaaaaaa = {
'xxx': '%s/cccccc/ddddddddddddddddddd.jar' %
(eeeeee.FFFFFFFFFFFFFFFFFF),
}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB20813997(self):
code = textwrap.dedent("""\
def myfunc_1():
myarray = numpy.zeros((2, 2, 2))
print(myarray[:, 1, :])
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB20605036(self):
code = textwrap.dedent("""\
foo = {
'aaaa': {
# A comment for no particular reason.
'xxxxxxxx': 'bbbbbbbbb',
'yyyyyyyyyyyyyyyyyy': 'cccccccccccccccccccccccccccccc'
'dddddddddddddddddddddddddddddddddddddddddd',
}
}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB20562732(self):
code = textwrap.dedent("""\
foo = [
# Comment about first list item
'First item',
# Comment about second list item
'Second item',
]
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB20128830(self):
code = textwrap.dedent("""\
a = {
'xxxxxxxxxxxxxxxxxxxx': {
'aaaa': 'mmmmmmm',
'bbbbb': 'mmmmmmmmmmmmmmmmmmmmm',
'cccccccccc': [
'nnnnnnnnnnn',
'ooooooooooo',
'ppppppppppp',
'qqqqqqqqqqq',
],
},
}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB20073838(self):
code = textwrap.dedent("""\
class DummyModel(object):
def do_nothing(self, class_1_count):
if True:
class_0_count = num_votes - class_1_count
return ('{class_0_name}={class_0_count}, {class_1_name}={class_1_count}'
.format(class_0_name=self.class_0_name,
class_0_count=class_0_count,
class_1_name=self.class_1_name,
class_1_count=class_1_count))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB19626808(self):
code = textwrap.dedent("""\
if True:
aaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbb('ccccccccccc',
ddddddddd='eeeee').fffffffff([
ggggggggggggggggggggg
])
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB19547210(self):
code = textwrap.dedent("""\
while True:
if True:
if True:
if True:
if xxxxxxxxxxxx.yyyyyyy(aa).zzzzzzz() not in (
xxxxxxxxxxxx.yyyyyyyyyyyyyy.zzzzzzzz,
xxxxxxxxxxxx.yyyyyyyyyyyyyy.zzzzzzzz):
continue
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB19377034(self):
code = textwrap.dedent("""\
def f():
if (aaaaaaaaaaaaaaa.start >= aaaaaaaaaaaaaaa.end or
bbbbbbbbbbbbbbb.start >= bbbbbbbbbbbbbbb.end):
return False
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB19372573(self):
code = textwrap.dedent("""\
def f():
if a: return 42
while True:
if b: continue
if c: break
return 0
""")
uwlines = _ParseAndUnwrap(code)
try:
style.SetGlobalStyle(style.CreatePEP8Style())
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
finally:
style.SetGlobalStyle(style.CreateChromiumStyle())
def testB19353268(self):
code = textwrap.dedent("""\
a = {1, 2, 3}[x]
b = {'foo': 42, 'bar': 37}['foo']
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB19287512(self):
unformatted_code = textwrap.dedent("""\
class Foo(object):
def bar(self):
with xxxxxxxxxx.yyyyy(
'aaaaaaa.bbbbbbbb.ccccccc.dddddddddddddddddddd.eeeeeeeeeee',
fffffffffff=(aaaaaaa.bbbbbbbb.ccccccc.dddddddddddddddddddd
.Mmmmmmmmmmmmmmmmmm(-1, 'permission error'))):
self.assertRaises(nnnnnnnnnnnnnnnn.ooooo, ppppp.qqqqqqqqqqqqqqqqq)
""")
expected_formatted_code = textwrap.dedent("""\
class Foo(object):
def bar(self):
with xxxxxxxxxx.yyyyy(
'aaaaaaa.bbbbbbbb.ccccccc.dddddddddddddddddddd.eeeeeeeeeee',
fffffffffff=(
aaaaaaa.bbbbbbbb.ccccccc.dddddddddddddddddddd.Mmmmmmmmmmmmmmmmmm(
-1, 'permission error'))):
self.assertRaises(nnnnnnnnnnnnnnnn.ooooo, ppppp.qqqqqqqqqqqqqqqqq)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB19194420(self):
code = textwrap.dedent("""\
method.Set(
'long argument goes here that causes the line to break',
lambda arg2=0.5: arg2)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB19073499(self):
code = textwrap.dedent("""\
instance = (aaaaaaa.bbbbbbb().ccccccccccccccccc().ddddddddddd(
{'aa': 'context!'}).eeeeeeeeeeeeeeeeeee(
{ # Inline comment about why fnord has the value 6.
'fnord': 6
}))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB18257115(self):
code = textwrap.dedent("""\
if True:
if True:
self._Test(aaaa, bbbbbbb.cccccccccc, dddddddd, eeeeeeeeeee,
[ffff, ggggggggggg, hhhhhhhhhhhh, iiiiii, jjjj])
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB18256666(self):
code = textwrap.dedent("""\
class Foo(object):
def Bar(self):
aaaaa.bbbbbbb(
ccc='ddddddddddddddd',
eeee='ffffffffffffffffffffff-%s-%s' % (gggg, int(time.time())),
hhhhhh={
'iiiiiiiiiii': iiiiiiiiiii,
'jjjj': jjjj.jjjjj(),
'kkkkkkkkkkkk': kkkkkkkkkkkk,
},
llllllllll=mmmmmm.nnnnnnnnnnnnnnnn)
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB18256826(self):
code = textwrap.dedent("""\
if True:
pass
# A multiline comment.
# Line two.
elif False:
pass
if True:
pass
# A multiline comment.
# Line two.
elif False:
pass
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB18255697(self):
code = textwrap.dedent("""\
AAAAAAAAAAAAAAA = {
'XXXXXXXXXXXXXX': 4242, # Inline comment
# Next comment
'YYYYYYYYYYYYYYYY': ['zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'],
}
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testB17534869(self):
unformatted_code = textwrap.dedent("""\
if True:
self.assertLess(abs(time.time()-aaaa.bbbbbbbbbbb(
datetime.datetime.now())), 1)
""")
expected_formatted_code = textwrap.dedent("""\
if True:
self.assertLess(
abs(time.time() - aaaa.bbbbbbbbbbb(datetime.datetime.now())), 1)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB17489866(self):
unformatted_code = textwrap.dedent("""\
def f():
if True:
if True:
return aaaa.bbbbbbbbb(ccccccc=dddddddddddddd({('eeee', \
'ffffffff'): str(j)}))
""")
expected_formatted_code = textwrap.dedent("""\
def f():
if True:
if True:
return aaaa.bbbbbbbbb(
ccccccc=dddddddddddddd({('eeee', 'ffffffff'): str(j)}))
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB17133019(self):
unformatted_code = textwrap.dedent("""\
class aaaaaaaaaaaaaa(object):
def bbbbbbbbbb(self):
with io.open("/dev/null", "rb"):
with io.open(os.path.join(aaaaa.bbbbb.ccccccccccc,
DDDDDDDDDDDDDDD,
"eeeeeeeee ffffffffff"
), "rb") as gggggggggggggggggggg:
print(gggggggggggggggggggg)
""")
expected_formatted_code = textwrap.dedent("""\
class aaaaaaaaaaaaaa(object):
def bbbbbbbbbb(self):
with io.open("/dev/null", "rb"):
with io.open(
os.path.join(aaaaa.bbbbb.ccccccccccc, DDDDDDDDDDDDDDD,
"eeeeeeeee ffffffffff"), "rb") as gggggggggggggggggggg:
print(gggggggggggggggggggg)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB17011869(self):
unformatted_code = textwrap.dedent("""\
'''blah......'''
class SomeClass(object):
'''blah.'''
AAAAAAAAAAAA = { # Comment.
'BBB': 1.0,
'DDDDDDDD': 0.4811
}
""")
expected_formatted_code = textwrap.dedent("""\
'''blah......'''
class SomeClass(object):
'''blah.'''
AAAAAAAAAAAA = { # Comment.
'BBB': 1.0,
'DDDDDDDD': 0.4811
}
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB16783631(self):
unformatted_code = textwrap.dedent("""\
if True:
with aaaaaaaaaaaaaa.bbbbbbbbbbbbb.ccccccc(ddddddddddddd,
eeeeeeeee=self.fffffffffffff
)as gggg:
pass
""")
expected_formatted_code = textwrap.dedent("""\
if True:
with aaaaaaaaaaaaaa.bbbbbbbbbbbbb.ccccccc(
ddddddddddddd,
eeeeeeeee=self.fffffffffffff) as gggg:
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB16572361(self):
unformatted_code = textwrap.dedent("""\
def foo(self):
def bar(my_dict_name):
self.my_dict_name['foo-bar-baz-biz-boo-baa-baa'].IncrementBy.assert_called_once_with('foo_bar_baz_boo')
""")
expected_formatted_code = textwrap.dedent("""\
def foo(self):
def bar(my_dict_name):
self.my_dict_name[
'foo-bar-baz-biz-boo-baa-baa'].IncrementBy.assert_called_once_with(
'foo_bar_baz_boo')
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB15884241(self):
unformatted_code = textwrap.dedent("""\
if 1:
if 1:
for row in AAAA:
self.create(aaaaaaaa="/aaa/bbbb/cccc/dddddd/eeeeeeeeeeeeeeeeeeeeeeeeee/%s" % row [0].replace(".foo", ".bar"), aaaaa=bbb[1], ccccc=bbb[2], dddd=bbb[3], eeeeeeeeeee=[s.strip() for s in bbb[4].split(",")], ffffffff=[s.strip() for s in bbb[5].split(",")], gggggg=bbb[6])
""")
expected_formatted_code = textwrap.dedent("""\
if 1:
if 1:
for row in AAAA:
self.create(aaaaaaaa="/aaa/bbbb/cccc/dddddd/eeeeeeeeeeeeeeeeeeeeeeeeee/%s"
% row[0].replace(".foo", ".bar"),
aaaaa=bbb[1],
ccccc=bbb[2],
dddd=bbb[3],
eeeeeeeeeee=[s.strip() for s in bbb[4].split(",")],
ffffffff=[s.strip() for s in bbb[5].split(",")],
gggggg=bbb[6])
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB15697268(self):
unformatted_code = textwrap.dedent("""\
def main(unused_argv):
ARBITRARY_CONSTANT_A = 10
an_array_with_an_exceedingly_long_name = range(ARBITRARY_CONSTANT_A + 1)
ok = an_array_with_an_exceedingly_long_name[:ARBITRARY_CONSTANT_A]
bad_slice = map(math.sqrt, an_array_with_an_exceedingly_long_name[:ARBITRARY_CONSTANT_A])
a_long_name_slicing = an_array_with_an_exceedingly_long_name[:ARBITRARY_CONSTANT_A]
bad_slice = ("I am a crazy, no good, string whats too long, etc." + " no really ")[:ARBITRARY_CONSTANT_A]
""")
expected_formatted_code = textwrap.dedent("""\
def main(unused_argv):
ARBITRARY_CONSTANT_A = 10
an_array_with_an_exceedingly_long_name = range(ARBITRARY_CONSTANT_A + 1)
ok = an_array_with_an_exceedingly_long_name[:ARBITRARY_CONSTANT_A]
bad_slice = map(math.sqrt,
an_array_with_an_exceedingly_long_name[:ARBITRARY_CONSTANT_A])
a_long_name_slicing = an_array_with_an_exceedingly_long_name[:
ARBITRARY_CONSTANT_A]
bad_slice = ("I am a crazy, no good, string whats too long, etc." +
" no really ")[:ARBITRARY_CONSTANT_A]
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB15597568(self):
unformatted_code = textwrap.dedent("""\
if True:
if True:
if True:
print(("Return code was %d" + (", and the process timed out." if did_time_out else ".")) % errorcode)
""")
expected_formatted_code = textwrap.dedent("""\
if True:
if True:
if True:
print(("Return code was %d" + (", and the process timed out."
if did_time_out else ".")) % errorcode)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB15542157(self):
unformatted_code = textwrap.dedent("""\
aaaaaaaaaaaa = bbbb.ccccccccccccccc(dddddd.eeeeeeeeeeeeee, ffffffffffffffffff, gggggg.hhhhhhhhhhhhhhhhh)
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaaaa = bbbb.ccccccccccccccc(dddddd.eeeeeeeeeeeeee, ffffffffffffffffff,
gggggg.hhhhhhhhhhhhhhhhh)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB15438132(self):
unformatted_code = textwrap.dedent("""\
if aaaaaaa.bbbbbbbbbb:
cccccc.dddddddddd(eeeeeeeeeee=fffffffffffff.gggggggggggggggggg)
if hhhhhh.iiiii.jjjjjjjjjjjjj:
# This is a comment in the middle of it all.
kkkkkkk.llllllllll.mmmmmmmmmmmmm = True
if (aaaaaa.bbbbb.ccccccccccccc != ddddddd.eeeeeeeeee.fffffffffffff or
eeeeee.fffff.ggggggggggggggggggggggggggg() != hhhhhhh.iiiiiiiiii.jjjjjjjjjjjj):
aaaaaaaa.bbbbbbbbbbbb(
aaaaaa.bbbbb.cc,
dddddddddddd=eeeeeeeeeeeeeeeeeee.fffffffffffffffff(
gggggg.hh,
iiiiiiiiiiiiiiiiiii.jjjjjjjjjj.kkkkkkk,
lllll.mm),
nnnnnnnnnn=ooooooo.pppppppppp)
""")
expected_formatted_code = textwrap.dedent("""\
if aaaaaaa.bbbbbbbbbb:
cccccc.dddddddddd(eeeeeeeeeee=fffffffffffff.gggggggggggggggggg)
if hhhhhh.iiiii.jjjjjjjjjjjjj:
# This is a comment in the middle of it all.
kkkkkkk.llllllllll.mmmmmmmmmmmmm = True
if (aaaaaa.bbbbb.ccccccccccccc != ddddddd.eeeeeeeeee.fffffffffffff or
eeeeee.fffff.ggggggggggggggggggggggggggg() !=
hhhhhhh.iiiiiiiiii.jjjjjjjjjjjj):
aaaaaaaa.bbbbbbbbbbbb(
aaaaaa.bbbbb.cc,
dddddddddddd=eeeeeeeeeeeeeeeeeee.fffffffffffffffff(
gggggg.hh, iiiiiiiiiiiiiiiiiii.jjjjjjjjjj.kkkkkkk, lllll.mm),
nnnnnnnnnn=ooooooo.pppppppppp)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB14468247(self):
unformatted_code = textwrap.dedent("""\
call(a=1,
b=2,
)
""")
expected_formatted_code = textwrap.dedent("""\
call(a=1, b=2,)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB14406499(self):
unformatted_code = textwrap.dedent("""\
def foo1(parameter_1, parameter_2, parameter_3, parameter_4, \
parameter_5, parameter_6): pass
""")
expected_formatted_code = textwrap.dedent("""\
def foo1(parameter_1, parameter_2, parameter_3, parameter_4, parameter_5,
parameter_6):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB13900309(self):
unformatted_code = textwrap.dedent("""\
self.aaaaaaaaaaa( # A comment in the middle of it all.
948.0/3600, self.bbb.ccccccccccccccccccccc(dddddddddddddddd.eeee, True))
""")
expected_formatted_code = textwrap.dedent("""\
self.aaaaaaaaaaa( # A comment in the middle of it all.
948.0 / 3600, self.bbb.ccccccccccccccccccccc(dddddddddddddddd.eeee, True))
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
code = textwrap.dedent("""\
aaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbb.cccccccccccccccccccccccccccccc(
DC_1, (CL - 50, CL), AAAAAAAA, BBBBBBBBBBBBBBBB, 98.0,
CCCCCCC).ddddddddd( # Look! A comment is here.
AAAAAAAA - (20 * 60 - 5))
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbb.ccccccccccccccccccccccccc().dddddddddddddddddddddddddd(1, 2, 3, 4)
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbb.ccccccccccccccccccccccccc(
).dddddddddddddddddddddddddd(1, 2, 3, 4)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbb.ccccccccccccccccccccccccc(x).dddddddddddddddddddddddddd(1, 2, 3, 4)
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbb.ccccccccccccccccccccccccc(
x).dddddddddddddddddddddddddd(1, 2, 3, 4)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).dddddddddddddddddddddddddd(1, 2, 3, 4)
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa(
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).dddddddddddddddddddddddddd(1, 2, 3, 4)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa().bbbbbbbbbbbbbbbbbbbbbbbb().ccccccccccccccccccc().\
dddddddddddddddddd().eeeeeeeeeeeeeeeeeeeee().fffffffffffffffff().gggggggggggggggggg()
""")
expected_formatted_code = textwrap.dedent("""\
aaaaaaaaaaaaaaaaaaaaaaaa().bbbbbbbbbbbbbbbbbbbbbbbb().ccccccccccccccccccc(
).dddddddddddddddddd().eeeeeeeeeeeeeeeeeeeee().fffffffffffffffff(
).gggggggggggggggggg()
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
class TestsForPEP8Style(ReformatterTest):
@classmethod
def setUpClass(cls):
style.SetGlobalStyle(style.CreatePEP8Style())
def testIndent4(self):
unformatted_code = textwrap.dedent("""\
if a+b:
pass
""")
expected_formatted_code = textwrap.dedent("""\
if a + b:
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSingleLineIfStatements(self):
code = textwrap.dedent("""\
if True: a = 42
elif False: b = 42
else: c = 42
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testNoBlankBetweenClassAndDef(self):
unformatted_code = textwrap.dedent("""\
class Foo:
def joe():
pass
""")
expected_formatted_code = textwrap.dedent("""\
class Foo:
def joe():
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSingleWhiteBeforeTrailingComment(self):
unformatted_code = textwrap.dedent("""\
if a+b: # comment
pass
""")
expected_formatted_code = textwrap.dedent("""\
if a + b: # comment
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSplittingSemicolonStatements(self):
unformatted_code = textwrap.dedent("""\
def f():
x = y + 42 ; z = n * 42
if True: a += 1 ; b += 1; c += 1
""")
expected_formatted_code = textwrap.dedent("""\
def f():
x = y + 42
z = n * 42
if True:
a += 1
b += 1
c += 1
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testSpaceBetweenEndingCommandAndClosingBracket(self):
unformatted_code = textwrap.dedent("""\
a = [
1,
]
""")
expected_formatted_code = textwrap.dedent("""\
a = [1, ]
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testContinuedNonOudentedLine(self):
code = textwrap.dedent("""\
class eld(d):
if str(geom.geom_type).upper(
) != self.geom_type and not self.geom_type == 'GEOMETRY':
ror(code='om_type')
""")
uwlines = _ParseAndUnwrap(code)
self.assertCodeEqual(code, reformatter.Reformat(uwlines))
def testWrappingPercentExpressions(self):
unformatted_code = textwrap.dedent("""\
def f():
if True:
zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxx.yyy + 1)
zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxx.yyy + 1)
zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxxxxxx + 1)
zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxx + 1, xxxxxxxxxxxxxxxxxxxxx + 1)
""")
expected_formatted_code = textwrap.dedent("""\
def f():
if True:
zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxxxxx + 1,
xxxxxxxxxxxxxxxxx.yyy + 1)
zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxxxxx + 1,
xxxxxxxxxxxxxxxxx.yyy + 1)
zzzzz = '%s-%s' % (xxxxxxxxxxxxxxxxxxxxxxx + 1,
xxxxxxxxxxxxxxxxxxxxx + 1)
zzzzz = '%s-%s'.ww(xxxxxxxxxxxxxxxxxxxxxxx + 1,
xxxxxxxxxxxxxxxxxxxxx + 1)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testAlignClosingBracketWithVisualIndentation(self):
unformatted_code = textwrap.dedent("""\
TEST_LIST = ('foo', 'bar', # first comment
'baz' # second comment
)
""")
expected_formatted_code = textwrap.dedent("""\
TEST_LIST = ('foo',
'bar', # first comment
'baz' # second comment
)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
unformatted_code = textwrap.dedent("""\
def f():
def g():
while (xxxxxxxxxxxxxxxxxxxx(yyyyyyyyyyyyy[zzzzz]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxxxxxxxxxx(yyyyyyyyyyyyy[zzzzz].aaaaaaaa[0]) == 'bbbbbbb'
):
pass
""")
expected_formatted_code = textwrap.dedent("""\
def f():
def g():
while (xxxxxxxxxxxxxxxxxxxx(yyyyyyyyyyyyy[zzzzz]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxxxxxxxxxx(yyyyyyyyyyyyy[zzzzz].aaaaaaaa[0]) ==
'bbbbbbb'):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testIndentSizeChanging(self):
unformatted_code = textwrap.dedent("""\
if True:
runtime_mins = (program_end_time - program_start_time).total_seconds() / 60.0
""")
expected_formatted_code = textwrap.dedent("""\
if True:
runtime_mins = (
program_end_time - program_start_time).total_seconds() / 60.0
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testHangingIndentCollision(self):
unformatted_code = textwrap.dedent("""\
if (aaaaaaaaaaaaaa + bbbbbbbbbbbbbbbb == ccccccccccccccccc and xxxxxxxxxxxxx or yyyyyyyyyyyyyyyyy):
pass
elif (xxxxxxxxxxxxxxx(aaaaaaaaaaa, bbbbbbbbbbbbbb, cccccccccccc, dddddddddd=None)):
pass
def h():
if (xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0]) == 'aaaaaaaaaaa' and xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0].mmmmmmmm[0]) == 'bbbbbbb'):
pass
for connection in itertools.chain(branch.contact, branch.address, morestuff.andmore.andmore.andmore.andmore.andmore.andmore.andmore):
dosomething(connection)
""")
expected_formatted_code = textwrap.dedent("""\
if (aaaaaaaaaaaaaa + bbbbbbbbbbbbbbbb == ccccccccccccccccc and xxxxxxxxxxxxx or
yyyyyyyyyyyyyyyyy):
pass
elif (xxxxxxxxxxxxxxx(aaaaaaaaaaa,
bbbbbbbbbbbbbb,
cccccccccccc,
dddddddddd=None)):
pass
def h():
if (xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0]) == 'aaaaaaaaaaa' and
xxxxxxxxxxxx.yyyyyyyy(zzzzzzzzzzzzz[0].mmmmmmmm[0]) == 'bbbbbbb'):
pass
for connection in itertools.chain(
branch.contact, branch.address,
morestuff.andmore.andmore.andmore.andmore.andmore.andmore.andmore):
dosomething(connection)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testB20016122(self):
try:
style.SetGlobalStyle(style.CreateStyleFromConfig(
'{based_on_style: pep8, SPLIT_PENALTY_IMPORT_NAMES: 35}'))
unformatted_code = textwrap.dedent("""\
from a_very_long_or_indented_module_name_yada_yada import (long_argument_1,
long_argument_2)
""")
expected_formatted_code = textwrap.dedent("""\
from a_very_long_or_indented_module_name_yada_yada import (
long_argument_1, long_argument_2)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code,
reformatter.Reformat(uwlines))
finally:
style.SetGlobalStyle(style.CreatePEP8Style())
class TestingNotInParameters(unittest.TestCase):
def testNotInParams(self):
unformatted_code = textwrap.dedent("""\
list("a long line to break the line. a long line to break the brk a long lin", not True)
""")
expected_code = textwrap.dedent("""\
list("a long line to break the line. a long line to break the brk a long lin",
not True)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertEqual(expected_code, reformatter.Reformat(uwlines))
@unittest.skipIf(py3compat.PY3, 'Requires Python 2')
class TestVerifyNoVerify(ReformatterTest):
@classmethod
def setUpClass(cls):
style.SetGlobalStyle(style.CreatePEP8Style())
def testVerifyException(self):
unformatted_code = textwrap.dedent("""\
class ABC(metaclass=type):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
with self.assertRaises(verifier.InternalError):
reformatter.Reformat(uwlines, verify=True)
with self.assertRaises(verifier.InternalError):
# default should be True
reformatter.Reformat(uwlines)
def testNoVerify(self):
unformatted_code = textwrap.dedent("""\
class ABC(metaclass=type):
pass
""")
expected_formatted_code = textwrap.dedent("""\
class ABC(metaclass=type):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code,
reformatter.Reformat(uwlines,
verify=False))
def testVerifyFutureImport(self):
unformatted_code = textwrap.dedent("""\
from __future__ import print_function
def call_my_function(the_function):
the_function("hi")
if __name__ == "__main__":
call_my_function(print)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
with self.assertRaises(verifier.InternalError):
reformatter.Reformat(uwlines, verify=True)
expected_formatted_code = textwrap.dedent("""\
from __future__ import print_function
def call_my_function(the_function):
the_function("hi")
if __name__ == "__main__":
call_my_function(print)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code,
reformatter.Reformat(uwlines,
verify=False))
def testContinuationLineShouldBeDistinguished(self):
unformatted_code = textwrap.dedent("""\
class Foo(object):
def bar(self):
if self.solo_generator_that_is_long is None and len(
self.generators + self.next_batch) == 1:
pass
""")
expected_formatted_code = textwrap.dedent("""\
class Foo(object):
def bar(self):
if self.solo_generator_that_is_long is None and len(
self.generators + self.next_batch) == 1:
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code,
reformatter.Reformat(uwlines,
verify=False))
@unittest.skipUnless(py3compat.PY3, 'Requires Python 3')
class TestsForPython3Code(ReformatterTest):
"""Test a few constructs that are new Python 3 syntax."""
@classmethod
def setUpClass(cls):
style.SetGlobalStyle(style.CreatePEP8Style())
def testKeywordOnlyArgSpecifier(self):
unformatted_code = textwrap.dedent("""\
def foo(a, *, kw):
return a+kw
""")
expected_formatted_code = textwrap.dedent("""\
def foo(a, *, kw):
return a + kw
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testAnnotations(self):
unformatted_code = textwrap.dedent("""\
def foo(a: list, b: "bar") -> dict:
return a+b
""")
expected_formatted_code = textwrap.dedent("""\
def foo(a: list, b: "bar") -> dict:
return a + b
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testExecAsNonKeyword(self):
unformatted_code = 'methods.exec( sys.modules[name])\n'
expected_formatted_code = 'methods.exec(sys.modules[name])\n'
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
class TestsForFBStyle(ReformatterTest):
@classmethod
def setUpClass(cls):
style.SetGlobalStyle(style.CreateFacebookStyle())
def testNoNeedForLineBreaks(self):
unformatted_code = textwrap.dedent("""\
def overly_long_function_name(
just_one_arg, **kwargs):
pass
""")
expected_formatted_code = textwrap.dedent("""\
def overly_long_function_name(just_one_arg, **kwargs):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testDedentClosingBracket(self):
unformatted_code = textwrap.dedent("""\
def overly_long_function_name(
first_argument_on_the_same_line,
second_argument_makes_the_line_too_long):
pass
""")
expected_formatted_code = textwrap.dedent("""\
def overly_long_function_name(
first_argument_on_the_same_line, \
second_argument_makes_the_line_too_long
):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testBreakAfterOpeningBracketIfContentsTooBig(self):
unformatted_code = textwrap.dedent("""\
def overly_long_function_name(a, b, c, d, e, f, g, h, i, j, k, l, m,
n, o, p, q, r, s, t, u, v, w, x, y, z):
pass
""")
expected_formatted_code = textwrap.dedent("""\
def overly_long_function_name(
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, \
v, w, x, y, z
):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testDedentClosingBracketWithComments(self):
unformatted_code = textwrap.dedent("""\
def overly_long_function_name(
# comment about the first argument
first_argument_with_a_very_long_name_or_so,
# comment about the second argument
second_argument_makes_the_line_too_long):
pass
""")
expected_formatted_code = textwrap.dedent("""\
def overly_long_function_name(
# comment about the first argument
first_argument_with_a_very_long_name_or_so,
# comment about the second argument
second_argument_makes_the_line_too_long
):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def testDedentImportAsNames(self):
unformatted_code = textwrap.dedent("""\
from module import (
internal_function as function,
SOME_CONSTANT_NUMBER1,
SOME_CONSTANT_NUMBER2,
SOME_CONSTANT_NUMBER3,
)
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(unformatted_code, reformatter.Reformat(uwlines))
def testDedentTestListGexp(self):
# TODO(ambv): Arguably _DetermineMustSplitAnnotation shouldn't enforce
# breaks only on the basis of a trailing comma if the entire thing fits
# in a single line.
unformatted_code = textwrap.dedent("""\
try:
pass
except (
IOError, OSError, LookupError, RuntimeError, OverflowError
) as exception:
pass
try:
pass
except (
IOError,
OSError,
LookupError,
RuntimeError,
OverflowError,
) as exception:
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(unformatted_code, reformatter.Reformat(uwlines))
def testBrokenIdempotency(self):
# TODO(ambv): The following behaviour should be fixed.
pass0_code = textwrap.dedent("""\
try:
pass
except (IOError, OSError, LookupError, RuntimeError, OverflowError\
) as exception:
pass
""")
pass1_code = textwrap.dedent("""\
try:
pass
except (IOError, OSError, LookupError, RuntimeError,
OverflowError) as exception:
pass
""")
uwlines = _ParseAndUnwrap(pass0_code)
self.assertCodeEqual(pass1_code, reformatter.Reformat(uwlines))
pass2_code = textwrap.dedent("""\
try:
pass
except (
IOError, OSError, LookupError, RuntimeError, OverflowError
) as exception:
pass
""")
uwlines = _ParseAndUnwrap(pass1_code)
self.assertCodeEqual(pass2_code, reformatter.Reformat(uwlines))
def testIfExprHangingIndent(self):
unformatted_code = textwrap.dedent("""\
if True:
if True:
if True:
if not self.frobbies and (
self.foobars.counters['db.cheeses'] != 1 or
self.foobars.counters['db.marshmellow_skins'] != 1):
pass
""")
expected_formatted_code = textwrap.dedent("""\
if True:
if True:
if True:
if not self.frobbies and (
self.foobars.counters['db.cheeses'] != 1 or
self.foobars.counters['db.marshmellow_skins'] != 1
):
pass
""")
uwlines = _ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
def _ParseAndUnwrap(code, dumptree=False):
"""Produces unwrapped lines from the given code.
Parses the code into a tree, performs comment splicing and runs the
unwrapper.
Arguments:
code: code to parse as a string
dumptree: if True, the parsed pytree (after comment splicing) is dumped
to stderr. Useful for debugging.
Returns:
List of unwrapped lines.
"""
tree = pytree_utils.ParseCodeToTree(code)
comment_splicer.SpliceComments(tree)
continuation_splicer.SpliceContinuations(tree)
subtype_assigner.AssignSubtypes(tree)
split_penalty.ComputeSplitPenalties(tree)
blank_line_calculator.CalculateBlankLines(tree)
if dumptree:
pytree_visitor.DumpPyTree(tree, target_stream=sys.stderr)
uwlines = pytree_unwrapper.UnwrapPyTree(tree)
for uwl in uwlines:
uwl.CalculateFormattingInformation()
return uwlines
if __name__ == '__main__':
unittest.main()
| 35.112681
| 280
| 0.586779
| 9,033
| 101,897
| 6.472268
| 0.132293
| 0.054598
| 0.081897
| 0.088773
| 0.786416
| 0.764402
| 0.744441
| 0.72785
| 0.70729
| 0.690031
| 0
| 0.013271
| 0.298939
| 101,897
| 2,901
| 281
| 35.124785
| 0.80514
| 0.01689
| 0
| 0.685295
| 0
| 0.010702
| 0.582726
| 0.133508
| 0.000793
| 0
| 0
| 0.000345
| 0.075307
| 1
| 0.066587
| false
| 0.04241
| 0.013476
| 0
| 0.095918
| 0.005945
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ee8521a3ce79ac739ba9f700723002bb49bfaabb
| 130
|
py
|
Python
|
trader/tests/core/utils/test_math_utils.py
|
JustasZaltauskas/Trader
|
554b788dbb856a81dc599ba90d9acdef2d9a340c
|
[
"MIT"
] | 3
|
2018-09-28T09:55:21.000Z
|
2019-04-19T08:30:12.000Z
|
trader/tests/core/utils/test_math_utils.py
|
JustasZaltauskas/Trader
|
554b788dbb856a81dc599ba90d9acdef2d9a340c
|
[
"MIT"
] | null | null | null |
trader/tests/core/utils/test_math_utils.py
|
JustasZaltauskas/Trader
|
554b788dbb856a81dc599ba90d9acdef2d9a340c
|
[
"MIT"
] | null | null | null |
import pytest
import core.utils.math_utils as math_utils
def test_mul():
mul_2 = math_utils.mul(2)
assert mul_2(3) == 6
| 16.25
| 42
| 0.707692
| 24
| 130
| 3.583333
| 0.541667
| 0.313953
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 0.192308
| 130
| 7
| 43
| 18.571429
| 0.771429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c9978a21d7af2b469c6037dc859271e211b77af0
| 22
|
py
|
Python
|
tests/tests.py
|
CS5331-GROUP-7/rest-api-development
|
4d421497d2802fe1c5441bee1ea7d55d36df354e
|
[
"Apache-2.0"
] | 2
|
2018-02-28T05:12:23.000Z
|
2018-02-28T08:45:17.000Z
|
tests/tests.py
|
CS5331-GROUP-7/rest-api-development
|
4d421497d2802fe1c5441bee1ea7d55d36df354e
|
[
"Apache-2.0"
] | null | null | null |
tests/tests.py
|
CS5331-GROUP-7/rest-api-development
|
4d421497d2802fe1c5441bee1ea7d55d36df354e
|
[
"Apache-2.0"
] | null | null | null |
print "Doing nothing"
| 11
| 21
| 0.772727
| 3
| 22
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 22
| 1
| 22
| 22
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0.590909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
c9c725e523b53cc6349fdbb3bb19c6d208314ed5
| 72
|
py
|
Python
|
chaosswarm/__init__.py
|
bittrance/chaostoolkit-docker-swarm
|
1c774b596734ded4c2bc6113dd1ebc5eed5004c4
|
[
"Apache-2.0"
] | 1
|
2020-05-29T16:40:58.000Z
|
2020-05-29T16:40:58.000Z
|
chaosswarm/__init__.py
|
bittrance/chaostoolkit-docker-swarm
|
1c774b596734ded4c2bc6113dd1ebc5eed5004c4
|
[
"Apache-2.0"
] | null | null | null |
chaosswarm/__init__.py
|
bittrance/chaostoolkit-docker-swarm
|
1c774b596734ded4c2bc6113dd1ebc5eed5004c4
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
import os
import os.path
__version__ = '0.3.0'
| 12
| 23
| 0.611111
| 12
| 72
| 3.333333
| 0.75
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067797
| 0.180556
| 72
| 5
| 24
| 14.4
| 0.610169
| 0.291667
| 0
| 0
| 0
| 0
| 0.102041
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c9ce7da29cf9e3825e183e4b3f782e92a4704372
| 20,474
|
py
|
Python
|
tests/PushoverAPI/test_PushoverAPI.py
|
scolby33/pushover_complete
|
17c9ff573cc30f0ace13b5637686e0b5e6eaac8c
|
[
"MIT"
] | 2
|
2016-04-19T19:44:10.000Z
|
2018-03-28T03:29:34.000Z
|
tests/PushoverAPI/test_PushoverAPI.py
|
scolby33/pushover_complete
|
17c9ff573cc30f0ace13b5637686e0b5e6eaac8c
|
[
"MIT"
] | 12
|
2016-05-09T13:49:41.000Z
|
2019-04-07T16:38:53.000Z
|
tests/PushoverAPI/test_PushoverAPI.py
|
scolby33/pushover_complete
|
17c9ff573cc30f0ace13b5637686e0b5e6eaac8c
|
[
"MIT"
] | 2
|
2016-05-10T20:36:37.000Z
|
2018-01-24T03:52:38.000Z
|
"""Tests for the :mod:`pushover_complete.pushover_api.PushoverAPI` class."""
from io import BytesIO
import re
try:
from urllib.parse import urljoin, parse_qs
except ImportError:
from urlparse import urljoin, parse_qs
import pytest
import responses
from pushover_complete.error import BadAPIRequestError
from tests.constants import *
from tests.fixtures import *
from tests.responses_callbacks import *
@responses.activate
def test_generic_get_with_payload(PushoverAPI):
"""Test the functionality of _generic_get that is missed by current uses."""
responses.add_callback(
responses.GET,
urljoin(PUSHOVER_API_URL, 'foobar.json'),
callback=generic_callback,
content_type='application/json'
)
resp = PushoverAPI._generic_get('foobar.json', payload={'payload-test': 'test'})
assert resp == {
'status': 1,
'payload-test': 'test'
}
@responses.activate
def test_generic_post_without_payload(PushoverAPI):
"""Test the functionality of _generic_post that is missed by current uses."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'foobar.json'),
callback=generic_callback,
content_type='application/json'
)
resp = PushoverAPI._generic_post('foobar.json')
assert resp == {
'status': 1,
'payload-test': False
}
@responses.activate
def test_PushoverAPI_sends_simple_message(PushoverAPI):
"""Test the sending of a simple message."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
resp = PushoverAPI.send_message(TEST_USER, TEST_MESSAGE)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert request_body['user'][0] == TEST_USER
# assert request_body['message'][0] == TEST_MESSAGE
# assert request_body['html'][0] == 'False'
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_sends_complex_message(PushoverAPI):
"""Test sending a more complex message."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
resp = PushoverAPI.send_message(
TEST_USER,
TEST_MESSAGE,
device=TEST_DEVICES[0],
title=TEST_TITLE,
url=TEST_URL,
url_title=TEST_URL_TITLE,
priority=1,
timestamp=100,
sound='gamelan'
)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert request_body['user'][0] == TEST_USER
# assert request_body['device'][0] == TEST_DEVICES[0]
# assert request_body['title'][0] == TEST_TITLE
# assert request_body['url'][0] == TEST_URL
# assert request_body['url_title'][0] == TEST_URL_TITLE
# assert int(request_body['priority'][0]) == 1
# assert int(request_body['timestamp'][0]) == 100
# assert request_body['sound'][0] == 'gamelan'
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_sends_message_with_image(PushoverAPI):
"""Test the sending of an image attachment"""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
image_io = BytesIO(TEST_IMAGE_BYTES)
resp = PushoverAPI.send_message(
TEST_USER,
TEST_MESSAGE,
image=image_io
)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
# Pushover doesn't seem to validate the received images in any way
#@responses.activate
# def test_PushoverAPI_raises_error_on_bad_image(PushoverAPI):
# """Test the sending of a corrupt image"""
# responses.add_callback(
# responses.POST,
# urljoin(PUSHOVER_API_URL, 'messages.json'),
# callback=messages_callback,
# content_type='application/json'
# )
#
# image_io = BytesIO(TEST_IMAGE_BYTES[10:]) # "corrupt" the image by removing some of the beginning
#
# with pytest.raises(BadAPIRequestError):
# PushoverAPI.send_message(
# TEST_USER,
# TEST_MESSAGE,
# image=image_io
# )
@responses.activate
def test_PushoverAPI_sends_message_with_image_from_path(PushoverAPI, tmpdir):
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
img_path = tmpdir.join('pushover.png')
img_path.write_binary(TEST_IMAGE_BYTES)
resp = PushoverAPI.send_message(
TEST_USER,
TEST_MESSAGE,
image=img_path.strpath
)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_raises_error_on_bad_message(PushoverAPI):
"""Test proper error behavior when a malformed message is sent."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
with pytest.raises(BadAPIRequestError):
PushoverAPI.send_message(TEST_MESSAGE, TEST_BAD_GENERAL_ID)
@responses.activate
def test_PushoverAPI_sends_multiple_simple_messages(PushoverAPI):
"""Test sending multiple simple messages through one HTTP session."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
messages = [{
'user': TEST_USER,
'message': TEST_MESSAGE
}] * 3
resps = PushoverAPI.send_messages(messages)
# request_bodies = [parse_qs(resp.request.body) for resp in resps]
# assert len(resps) == 3
# assert all(request_body['token'][0] == TEST_TOKEN for request_body in request_bodies)
# assert all(request_body['user'][0] == TEST_USER for request_body in request_bodies)
# assert all(request_body['message'][0] == TEST_MESSAGE for request_body in request_bodies)
# assert all(request_body['html'][0] == 'False' for request_body in request_bodies)
assert all(resp == {
'status': 1,
'request': TEST_REQUEST_ID
} for resp in resps)
@responses.activate
def test_PushoverAPI_sends_multiple_complex_messages(PushoverAPI):
"""Test sending multiple complex messages through one HTTP session."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'messages.json'),
callback=messages_callback,
content_type='application/json'
)
messages = [{
'user': TEST_USER,
'message': TEST_MESSAGE,
'device': TEST_DEVICES[0],
'title': TEST_TITLE,
'url': TEST_URL,
'url_title': TEST_URL_TITLE,
'priority': 1,
'timestamp': 100,
'sound': 'gamelan'
}] * 3
resps = PushoverAPI.send_messages(messages)
# request_bodies = [parse_qs(resp.request.body) for resp in resps]
# assert len(resps) == 3
# assert all(request_body['token'][0] == TEST_TOKEN for request_body in request_bodies)
# assert all(request_body['user'][0] == TEST_USER for request_body in request_bodies)
# assert all(request_body['device'][0] == TEST_DEVICES[0] for request_body in request_bodies)
# assert all(request_body['title'][0] == TEST_TITLE for request_body in request_bodies)
# assert all(request_body['url'][0] == TEST_URL for request_body in request_bodies)
# assert all(request_body['url_title'][0] == TEST_URL_TITLE for request_body in request_bodies)
# assert all(int(request_body['priority'][0]) == 1 for request_body in request_bodies)
# assert all(int(request_body['timestamp'][0]) == 100 for request_body in request_bodies)
# assert all(request_body['sound'][0] == 'gamelan' for request_body in request_bodies)
assert all(resp == {
'status': 1,
'request': TEST_REQUEST_ID
} for resp in resps)
@responses.activate
def test_PushoverAPI_gets_sounds(PushoverAPI):
"""Test the retrieval of sounds."""
responses.add_callback(
responses.GET,
urljoin(PUSHOVER_API_URL, 'sounds.json'),
callback=sounds_callback,
content_type='application/json'
)
sounds = PushoverAPI.get_sounds()
assert sounds == SOUNDS
@responses.activate
def test_PushoverAPI_rasies_error_on_getting_sounds_with_bad_token(BadTokenPushoverAPI):
"""Test proper error behavior when a malformed request to get sounds is sent."""
responses.add_callback(
responses.GET,
urljoin(PUSHOVER_API_URL, 'sounds.json'),
callback=sounds_callback,
content_type='application/json'
)
with pytest.raises(BadAPIRequestError):
BadTokenPushoverAPI.get_sounds()
@responses.activate
def test_PushoverAPI_validates_user(PushoverAPI):
"""Test validation of a user token."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'users/validate.json'),
callback=validate_callback,
content_type='application/json'
)
resp = PushoverAPI.validate(TEST_USER)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert request_body['user'][0] == TEST_USER
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'group': 0,
'devices': TEST_DEVICES
}
@responses.activate
def test_PushoverAPI_validates_group(PushoverAPI):
"""Test validation of a group token."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'users/validate.json'),
callback=validate_callback,
content_type='application/json'
)
resp = PushoverAPI.validate(TEST_GROUP)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert request_body['user'][0] == TEST_GROUP
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'group': 1,
'devices': []
}
@responses.activate
def test_PushoverAPI_raises_error_on_bad_user_validation(PushoverAPI):
"""Test failed validation of a token."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'users/validate.json'),
callback=validate_callback,
content_type='application/json'
)
with pytest.raises(BadAPIRequestError):
PushoverAPI.validate(TEST_BAD_GENERAL_ID)
@responses.activate
def test_PushoverAPI_gets_receipt(PushoverAPI):
"""Test the retrieval of receipt details."""
url_re = re.compile('https://api\.pushover\.net/1/receipts/r[a-zA-Z0-9]*\.json')
responses.add_callback(
responses.GET,
url_re,
callback=receipt_callback,
content_type='application/json'
)
resp = PushoverAPI.check_receipt(TEST_RECEIPT_ID)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert resp.request.path_url.split('/')[-1].split('.')[0] == TEST_RECEIPT_ID
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'acknowledged': 1,
'acknowledged_at': 100,
'acknowledged_by': TEST_USER,
'acknowledged_by_device': TEST_DEVICES[0],
'last_delivered_at': 100,
'expired': 1,
'expires_at': 100,
'called_back': 0,
'called_back_at': 100
}
@responses.activate
def test_PushoverAPI_raises_error_on_bad_receipt(PushoverAPI):
"""Test the getting of a bad receipt value."""
url_re = re.compile('https://api\.pushover\.net/1/receipts/r[a-zA-Z0-9]*\.json')
responses.add_callback(
responses.GET,
url_re,
callback=receipt_callback,
content_type='application/json'
)
with pytest.raises(BadAPIRequestError):
PushoverAPI.check_receipt('r' + TEST_BAD_GENERAL_ID) # needs to start with 'r' for the regex url match
@responses.activate
def test_PushoverAPI_cancels_receipt(PushoverAPI):
"""Test cancelling a receipt."""
url_re = re.compile('https://api\.pushover\.net/1/receipts/r[a-zA-Z0-9]*/cancel\.json')
responses.add_callback(
responses.POST,
url_re,
callback=receipt_cancel_callback,
content_type='application/json'
)
resp = PushoverAPI.cancel_receipt(TEST_RECEIPT_ID)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert resp.request.path_url.split('/')[-2] == TEST_RECEIPT_ID
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_raises_error_on_bad_receipt_cancel(PushoverAPI):
"""Test the cancelling of a bad receipt value."""
url_re = re.compile('https://api\.pushover\.net/1/receipts/r[a-zA-Z0-9]*/cancel\.json')
responses.add_callback(
responses.POST,
url_re,
callback=receipt_cancel_callback,
content_type='application/json'
)
with pytest.raises(BadAPIRequestError):
PushoverAPI.cancel_receipt('r' + TEST_BAD_GENERAL_ID)
@responses.activate
def test_PushoverAPI_migrates_subscription(PushoverAPI):
"""Test migrating a user key to a subscription key."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'subscriptions/migrate.json'),
callback=subscription_migrate_callback,
content_type='application/json'
)
resp = PushoverAPI.migrate_to_subscription(TEST_USER, TEST_SUBSCRIPTION_CODE)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert request_body['user'][0] == TEST_USER
# assert request_body['subscription'][0] == TEST_SUBSCRIPTION_CODE
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'subscribed_user_key': TEST_SUBSCRIBED_USER_KEY
}
@responses.activate
def test_PushoverAPI_raises_error_on_subscription_migration_with_bad_user(PushoverAPI):
"""Test a migration of a bad user key."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'subscriptions/migrate.json'),
callback=subscription_migrate_callback,
content_type='application/json'
)
with pytest.raises(BadAPIRequestError):
PushoverAPI.migrate_to_subscription(TEST_BAD_GENERAL_ID, TEST_SUBSCRIPTION_CODE)
@responses.activate
def test_PushoverAPI_migrates_multiple_subscriptions(PushoverAPI):
"""Test a migration of multiple user keys at once."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'subscriptions/migrate.json'),
callback=subscription_migrate_callback,
content_type='application/json'
)
users = [{
'user': TEST_USER
}] * 3
resps = PushoverAPI.migrate_multiple_to_subscription(users, TEST_SUBSCRIPTION_CODE)
# request_bodies = [parse_qs(resp.request.body) for resp in resps]
# assert len(resps) == 3
# assert all(request_body['token'][0] == TEST_TOKEN for request_body in request_bodies)
# assert all(request_body['user'][0] == TEST_USER for request_body in request_bodies)
# assert all(request_body['subscription'][0] == TEST_SUBSCRIPTION_CODE for request_body in request_bodies)
assert all(resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'subscribed_user_key': TEST_SUBSCRIBED_USER_KEY
} for resp in resps)
@responses.activate
def test_PushoverAPI_gets_group_info(PushoverAPI):
"""Test getting group info"""
url_re = re.compile('https://api\.pushover\.net/1/groups/g[a-zA-Z0-9]*\.json')
responses.add_callback(
responses.GET,
url_re,
callback=groups_callback,
content_type='application/json'
)
resp = PushoverAPI.group_info(TEST_GROUP)
# request_body = parse_qs(resp.request.body)
# assert request_body['token'][0] == TEST_TOKEN
# assert resp.request.path_url.split('/')[-1].split('.')[0] == TEST_GROUP
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'name': TEST_GROUP_NAME,
'users': [
{
'user': TEST_USER,
'device': TEST_DEVICES[0],
'memo': '',
'disabled': False
},
{
'user': TEST_USER,
'device': TEST_DEVICES[1],
'memo': '',
'disabled': False
}
]
}
@responses.activate
def test_PushoverAPI_adds_user_to_group(PushoverAPI):
"""Test adding a user to a group"""
url_re = re.compile('https://api\.pushover\.net/1/groups/g[a-zA-Z0-9]*/add_user\.json')
responses.add_callback(
responses.POST,
url_re,
callback=groups_add_user_callback,
content_type='application/json'
)
resp = PushoverAPI.group_add_user(TEST_GROUP, TEST_USER)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_deletes_user_from_group(PushoverAPI):
"""Test removing a user from a group"""
url_re = re.compile('https://api\.pushover\.net/1/groups/g[a-zA-Z0-9]*/delete_user\.json')
responses.add_callback(
responses.POST,
url_re,
callback=groups_delete_user_callback,
content_type='application/json'
)
resp = PushoverAPI.group_delete_user(TEST_GROUP, TEST_USER)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_disables_user_in_group(PushoverAPI):
"""Test disabling a user in a group."""
url_re = re.compile('https://api\.pushover\.net/1/groups/g[a-zA-Z0-9]*/disable_user\.json')
responses.add_callback(
responses.POST,
url_re,
callback=groups_disable_user_callback,
content_type='application/json'
)
resp = PushoverAPI.group_disable_user(TEST_GROUP, TEST_USER)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_enables_user_in_group(PushoverAPI):
"""Test enabling a user in a group."""
url_re = re.compile('https://api\.pushover\.net/1/groups/g[a-zA-Z0-9]*/enable_user\.json')
responses.add_callback(
responses.POST,
url_re,
callback=groups_enable_user_callback,
content_type='application/json'
)
resp = PushoverAPI.group_enable_user(TEST_GROUP, TEST_USER)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_changes_group_name(PushoverAPI):
"""Test changing group name."""
url_re = re.compile('https://api\.pushover\.net/1/groups/g[a-zA-Z0-9]*/rename\.json')
responses.add_callback(
responses.POST,
url_re,
callback=groups_rename_callback,
content_type='application/json'
)
resp = PushoverAPI.group_rename(TEST_GROUP, TEST_GROUP_NAME + 'New')
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID
}
@responses.activate
def test_PushoverAPI_assigns_license_to_user(PushoverAPI):
"""Test assigning a license to a user."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'licenses/assign.json'),
callback=licenses_assign_callback,
content_type='application/json'
)
resp = PushoverAPI.assign_license(TEST_USER)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'credits': 0
}
@responses.activate
def test_PushoverAPI_assigns_license_to_email(PushoverAPI):
"""Test assigning a license to an email."""
responses.add_callback(
responses.POST,
urljoin(PUSHOVER_API_URL, 'licenses/assign.json'),
callback=licenses_assign_callback,
content_type='application/json'
)
resp = PushoverAPI.assign_license(TEST_USER_EMAIL)
assert resp == {
'status': 1,
'request': TEST_REQUEST_ID,
'credits': 0
}
| 31.791925
| 111
| 0.666943
| 2,444
| 20,474
| 5.318331
| 0.085106
| 0.062625
| 0.046161
| 0.055393
| 0.841899
| 0.802585
| 0.742499
| 0.71611
| 0.688414
| 0.640714
| 0
| 0.00912
| 0.21813
| 20,474
| 643
| 112
| 31.841369
| 0.802849
| 0.256569
| 0
| 0.612472
| 0
| 0.022272
| 0.139409
| 0.006667
| 0
| 0
| 0
| 0
| 0.051225
| 1
| 0.064588
| false
| 0
| 0.024499
| 0
| 0.089087
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c9def7291584c0264d192dffe28e291258f3febd
| 107
|
py
|
Python
|
backend/app/core/crud/__init__.py
|
air-services/boilerplate
|
8c69927c299882048f9aaaaa58483eea2a6a1cd0
|
[
"MIT"
] | null | null | null |
backend/app/core/crud/__init__.py
|
air-services/boilerplate
|
8c69927c299882048f9aaaaa58483eea2a6a1cd0
|
[
"MIT"
] | null | null | null |
backend/app/core/crud/__init__.py
|
air-services/boilerplate
|
8c69927c299882048f9aaaaa58483eea2a6a1cd0
|
[
"MIT"
] | null | null | null |
from .crud_router import CrudRouter
from .crud_serializer import CrudSerializer
from .view import CrudView
| 26.75
| 43
| 0.859813
| 14
| 107
| 6.428571
| 0.642857
| 0.177778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11215
| 107
| 3
| 44
| 35.666667
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
c9df09da7f806e7c40b97e82e8c869164bd3ee70
| 146
|
py
|
Python
|
prefixcommons/__init__.py
|
hsolbrig/prefixcommons-py
|
f0a40603739e5bcd3fb9d15b6e9432155d2b6dd7
|
[
"BSD-3-Clause"
] | 3
|
2020-10-01T23:43:22.000Z
|
2022-01-27T19:35:57.000Z
|
prefixcommons/__init__.py
|
hsolbrig/prefixcommons-py
|
f0a40603739e5bcd3fb9d15b6e9432155d2b6dd7
|
[
"BSD-3-Clause"
] | 10
|
2021-06-16T20:48:32.000Z
|
2021-10-04T18:22:02.000Z
|
prefixcommons/__init__.py
|
hsolbrig/prefixcommons-py
|
f0a40603739e5bcd3fb9d15b6e9432155d2b6dd7
|
[
"BSD-3-Clause"
] | 5
|
2017-05-11T15:15:26.000Z
|
2020-06-12T21:02:24.000Z
|
from __future__ import absolute_import
from .curie_util import expand_uri, contract_uri, NoPrefix
from .curie_transformer import CsvTransformer
| 24.333333
| 58
| 0.863014
| 19
| 146
| 6.157895
| 0.631579
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109589
| 146
| 5
| 59
| 29.2
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
c9e3e1dbd14959ae43395071dbbfc6276bcc0fe5
| 135
|
py
|
Python
|
python-stdin-to-json.py
|
peterwwillis/junkdrawer
|
64b9ff130f1aa15cf4a7f8e170b0b8ab677eef8e
|
[
"MIT"
] | null | null | null |
python-stdin-to-json.py
|
peterwwillis/junkdrawer
|
64b9ff130f1aa15cf4a7f8e170b0b8ab677eef8e
|
[
"MIT"
] | null | null | null |
python-stdin-to-json.py
|
peterwwillis/junkdrawer
|
64b9ff130f1aa15cf4a7f8e170b0b8ab677eef8e
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# Dump standard input stream as a JSON-formatted output
import sys,json;json.dump(sys.stdin.read(), sys.stdout)
| 33.75
| 55
| 0.762963
| 23
| 135
| 4.478261
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008264
| 0.103704
| 135
| 3
| 56
| 45
| 0.842975
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 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
| 5
|
c9f96815169892cf91619614503926b72d864ac1
| 80
|
py
|
Python
|
setup..py
|
Virbus125/pl8.exe
|
52f93848443d58db52306d1de8c04f3a4bc9fe9b
|
[
"MIT"
] | null | null | null |
setup..py
|
Virbus125/pl8.exe
|
52f93848443d58db52306d1de8c04f3a4bc9fe9b
|
[
"MIT"
] | null | null | null |
setup..py
|
Virbus125/pl8.exe
|
52f93848443d58db52306d1de8c04f3a4bc9fe9b
|
[
"MIT"
] | null | null | null |
from distutils.core import setup
import py2exe
setup(console=['main..py'])
| 20
| 33
| 0.725
| 11
| 80
| 5.272727
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014706
| 0.15
| 80
| 4
| 34
| 20
| 0.838235
| 0
| 0
| 0
| 0
| 0
| 0.102564
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a0033b01d8664b68aa2efb7c15a0fc3b60d1522f
| 633
|
py
|
Python
|
scripts/field/aranTutorMobgen.py
|
Snewmy/swordie
|
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
|
[
"MIT"
] | 2
|
2020-08-25T06:55:19.000Z
|
2021-03-15T14:37:34.000Z
|
scripts/field/aranTutorMobgen.py
|
Snewmy/swordie
|
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
|
[
"MIT"
] | null | null | null |
scripts/field/aranTutorMobgen.py
|
Snewmy/swordie
|
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
|
[
"MIT"
] | 3
|
2020-08-25T06:55:25.000Z
|
2020-12-01T13:07:43.000Z
|
# Aran Introduction
sm.killMobs()
if sm.getFieldID() == 914000200:
sm.spawnMob(9300379, 2099, 2, False, 10)
sm.spawnMob(9300379, 1799, 2, False, 10)
sm.spawnMob(9300379, 1515, 2, False, 10)
elif sm.getFieldID() == 914000210:
sm.spawnMob(9300380, 667, 2, False, 15)
sm.spawnMob(9300380, 382, 2, False, 15)
sm.spawnMob(9300380, 97, 2, False, 15)
elif sm.getFieldID() == 914000220:
sm.spawnMob(9300381, -716, 2, False, 20)
sm.spawnMob(9300381, -839, 2, False, 20)
sm.spawnMob(9300381, -1046, 2, False, 20)
sm.spawnMob(9300381, -1186, 2, False, 20)
sm.spawnMob(9300381, -1332, 2, False, 20)
| 33.315789
| 45
| 0.650869
| 93
| 633
| 4.430108
| 0.322581
| 0.26699
| 0.206311
| 0.097087
| 0.485437
| 0.485437
| 0
| 0
| 0
| 0
| 0
| 0.339147
| 0.184834
| 633
| 19
| 46
| 33.315789
| 0.459302
| 0.026856
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a00f1c720d0705815c08ec0d671267d8f214e71c
| 102
|
py
|
Python
|
backend/kesaseteli/applications/admin.py
|
City-of-Helsinki/kesaseteli
|
964f801c2dba72c4105b6e436b12b821b199d6d2
|
[
"MIT"
] | 2
|
2021-05-10T09:28:35.000Z
|
2021-05-17T12:15:34.000Z
|
backend/kesaseteli/applications/admin.py
|
City-of-Helsinki/yjdh
|
1c07576b456d2be9c3171363450ed46de2c1bbcb
|
[
"MIT"
] | 931
|
2021-05-21T15:24:35.000Z
|
2022-03-31T20:07:40.000Z
|
backend/kesaseteli/applications/admin.py
|
City-of-Helsinki/yjdh
|
1c07576b456d2be9c3171363450ed46de2c1bbcb
|
[
"MIT"
] | 6
|
2021-07-06T11:07:02.000Z
|
2022-02-07T12:42:21.000Z
|
from django.contrib import admin
from applications.models import School
admin.site.register(School)
| 17
| 38
| 0.833333
| 14
| 102
| 6.071429
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107843
| 102
| 5
| 39
| 20.4
| 0.934066
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 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
| 5
|
a01a11a429e6178f1c34de057ce72f27748afef0
| 1,618
|
py
|
Python
|
analytics/models.py
|
whitews/BAMA_Analytics
|
9f32e3f0c99b2384fac80ffd1a7c5fd83773f5f7
|
[
"BSD-2-Clause"
] | null | null | null |
analytics/models.py
|
whitews/BAMA_Analytics
|
9f32e3f0c99b2384fac80ffd1a7c5fd83773f5f7
|
[
"BSD-2-Clause"
] | null | null | null |
analytics/models.py
|
whitews/BAMA_Analytics
|
9f32e3f0c99b2384fac80ffd1a7c5fd83773f5f7
|
[
"BSD-2-Clause"
] | null | null | null |
from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
class Species(models.Model):
name = models.CharField(
unique=True,
max_length=128,
null=False,
blank=False
)
description = models.TextField(
null=True,
blank=True
)
class Analyte(models.Model):
name = models.CharField(
unique=True,
max_length=128,
null=False,
blank=False
)
description = models.TextField(
null=True,
blank=True
)
subtrahend = models.ForeignKey(
'self',
null=True,
blank=True
)
class Conjugate(models.Model):
name = models.CharField(
unique=True,
max_length=128,
null=False,
blank=False
)
description = models.TextField(
null=True,
blank=True
)
class Isotype(models.Model):
name = models.CharField(
unique=True,
max_length=128,
null=False,
blank=False
)
description = models.TextField(
null=True,
blank=True
)
class Buffer(models.Model):
name = models.CharField(
unique=True,
max_length=128,
null=False,
blank=False
)
description = models.TextField(
null=True,
blank=True
)
class SampleType(models.Model):
name = models.CharField(
unique=True,
max_length=128,
null=False,
blank=False
)
description = models.TextField(
null=True,
blank=True
)
| 18.597701
| 58
| 0.572311
| 165
| 1,618
| 5.575758
| 0.2
| 0.06087
| 0.098913
| 0.129348
| 0.78913
| 0.765217
| 0.765217
| 0.765217
| 0.765217
| 0.765217
| 0
| 0.016744
| 0.3356
| 1,618
| 86
| 59
| 18.813953
| 0.83907
| 0
| 0
| 0.675676
| 0
| 0
| 0.002472
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.040541
| 0
| 0.297297
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.