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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8b01e78c26802f3c0870a0a521ee085e05aafff3
| 399
|
py
|
Python
|
src/base.py
|
RickardKarl/LearningUsingPrivilegedTimeSeries
|
863a11b0999022cfcd44a95c0781d775d908e568
|
[
"MIT"
] | 5
|
2021-06-22T06:59:35.000Z
|
2022-01-18T13:06:59.000Z
|
src/base.py
|
RickardKarl/LearningUsingPrivilegedTimeSeries
|
863a11b0999022cfcd44a95c0781d775d908e568
|
[
"MIT"
] | null | null | null |
src/base.py
|
RickardKarl/LearningUsingPrivilegedTimeSeries
|
863a11b0999022cfcd44a95c0781d775d908e568
|
[
"MIT"
] | 1
|
2021-12-17T22:26:26.000Z
|
2021-12-17T22:26:26.000Z
|
import abc
class Data(abc.ABC):
@abc.abstractmethod
def sample(self):
pass
class Model(abc.ABC):
@abc.abstractmethod
def fit(self):
pass
@abc.abstractmethod
def predict(self):
pass
class ParamGen(abc.ABC):
@abc.abstractmethod
def gen(self):
pass
@abc.abstractmethod
def get_size(self):
pass
| 14.25
| 24
| 0.566416
| 45
| 399
| 5
| 0.355556
| 0.16
| 0.444444
| 0.306667
| 0.595556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.340852
| 399
| 27
| 25
| 14.777778
| 0.855513
| 0
| 0
| 0.526316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.263158
| false
| 0.263158
| 0.052632
| 0
| 0.473684
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
8b38a3aa492d3325040ac7542b03a619217217e5
| 285
|
py
|
Python
|
src/genie/libs/parser/iosxe/tests/ShowEndpointTrackerStaticRoute/cli/equal/golden_output_expected.py
|
nielsvanhooy/genieparser
|
9a1955749697a6777ca614f0af4d5f3a2c254ccd
|
[
"Apache-2.0"
] | null | null | null |
src/genie/libs/parser/iosxe/tests/ShowEndpointTrackerStaticRoute/cli/equal/golden_output_expected.py
|
nielsvanhooy/genieparser
|
9a1955749697a6777ca614f0af4d5f3a2c254ccd
|
[
"Apache-2.0"
] | null | null | null |
src/genie/libs/parser/iosxe/tests/ShowEndpointTrackerStaticRoute/cli/equal/golden_output_expected.py
|
nielsvanhooy/genieparser
|
9a1955749697a6777ca614f0af4d5f3a2c254ccd
|
[
"Apache-2.0"
] | null | null | null |
expected_output = {
'tracker_name': {
'tcp-10001': {
'status': 'UP',
'rtt_in_msec': 2,
'probe_id': 2
},
'udp-10001': {
'status': 'UP',
'rtt_in_msec': 1,
'probe_id': 3
}
}
}
| 19
| 29
| 0.354386
| 26
| 285
| 3.576923
| 0.653846
| 0.236559
| 0.27957
| 0.344086
| 0.473118
| 0.473118
| 0
| 0
| 0
| 0
| 0
| 0.094595
| 0.480702
| 285
| 14
| 30
| 20.357143
| 0.533784
| 0
| 0
| 0.142857
| 0
| 0
| 0.294737
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8b3e06a01a7afc7d61215e3bb32ffc61e0a47bbe
| 304
|
py
|
Python
|
asyncpg/protocol/__init__.py
|
baltitenger/asyncpg
|
a2f093df6aceec7842709eaf92c5ff9df093efae
|
[
"Apache-2.0"
] | 5,714
|
2016-07-19T06:42:22.000Z
|
2022-03-31T13:26:46.000Z
|
asyncpg/protocol/__init__.py
|
baltitenger/asyncpg
|
a2f093df6aceec7842709eaf92c5ff9df093efae
|
[
"Apache-2.0"
] | 715
|
2016-07-20T11:28:45.000Z
|
2022-03-27T22:14:47.000Z
|
asyncpg/protocol/__init__.py
|
baltitenger/asyncpg
|
a2f093df6aceec7842709eaf92c5ff9df093efae
|
[
"Apache-2.0"
] | 405
|
2016-07-20T00:30:22.000Z
|
2022-03-31T02:39:58.000Z
|
# Copyright (C) 2016-present the asyncpg authors and contributors
# <see AUTHORS file>
#
# This module is part of asyncpg and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
# flake8: NOQA
from .protocol import Protocol, Record, NO_TIMEOUT, BUILTIN_TYPE_NAME_MAP
| 30.4
| 73
| 0.769737
| 48
| 304
| 4.791667
| 0.791667
| 0.017391
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0.141447
| 304
| 9
| 74
| 33.777778
| 0.846743
| 0.707237
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8c6cfa168b243d2ba1b60f32a8ee8140bfffc108
| 4,059
|
py
|
Python
|
mppsolar/protocols/jk02.py
|
20after4/mpp-solar
|
31181f69abd18137c8a7f2c088691d464fb75acb
|
[
"MIT"
] | null | null | null |
mppsolar/protocols/jk02.py
|
20after4/mpp-solar
|
31181f69abd18137c8a7f2c088691d464fb75acb
|
[
"MIT"
] | null | null | null |
mppsolar/protocols/jk02.py
|
20after4/mpp-solar
|
31181f69abd18137c8a7f2c088691d464fb75acb
|
[
"MIT"
] | null | null | null |
import logging
from .jkabstractprotocol import jkAbstractProtocol
log = logging.getLogger("MPP-Solar")
NEW_COMMANDS = {
"getCellData": {
"name": "getCellData",
"command_code": "96",
"record_type": "2",
"description": "BLE Cell Data inquiry",
"help": " -- queries the ble device for the cell data",
"type": "QUERY",
"response": [
["hex", 4, "Header", ""],
["hex", 1, "Record Type", ""],
["int", 1, "Record Counter", ""],
["loop", 24, "Voltage Cell", "V", "2ByteHex"],
["discard", 4, "", ""],
["2ByteHex", 1, "Average Cell Voltage", "V"],
["2ByteHex", 1, "Delta Cell Voltage", "V"],
["2ByteHexU", 1, "", ""],
["loop", 25, "Resistance Cell", "Ohm", "2ByteHex"],
["discard", 4, "", ""],
["2ByteHex", 1, "Battery Voltage", "V"],
["discard", 10, "", ""],
["2ByteHexC", 1, "Battery T1", "°C"],
["2ByteHexC", 1, "Battery T2", "°C"],
["2ByteHexC", 1, "MOS Temp", "°C"],
["discard", 4, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["discard", 4, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["uptime", 3, "Time", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["discard", 12, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["2ByteHexU", 1, "", ""],
["rem"],
],
"test_responses": [
bytes.fromhex(
"55aaeb9002b52e0d280dfa0c2e0d2f0d220d220d130d190d1d0d1d0d170d1f0d160dfb0c1f0d00000000000000000000000000000000ffff00001c0d350004029b00c600a000b300bc00cc00be00b100b4002d013d01b000a100ab00b200ad0000000000000000000000000000000000000000000000bcd1000000000000000000001e0116013c010000000000636b0c0300400d030000000000dc4d010064000000781e16000101480a000000000000000000000000070101000000980400000000260141400000000037feffff00000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080"
),
bytes.fromhex(
"55aaeb9002bb2e0d280dfa0c2e0d2f0d220d220d130d190d1d0d1d0d170d1f0d160dfb0c1f0d00000000000000000000000000000000ffff00001b0d350004029b00c600a000b300bc00cc00be00b100b4002d013d01b000a100ab00b200ad0000000000000000000000000000000000000000000000b8d1000000000000000000001e0114013c010000000000636b0c0300400d030000000000dc4d0100640000007a1e16000101480a000000000000000000000000070101000000980400000000260141400000000037feffff00000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000081"
),
],
"regex": "",
},
}
class jk02(jkAbstractProtocol):
"""
JK02 - Handler for JKBMS 2 byte data communication
- e.g. ASAS = ??V
"""
def __init__(self, *args, **kwargs) -> None:
super().__init__()
self._protocol_id = b"JK02"
self.COMMANDS.update(NEW_COMMANDS)
self.STATUS_COMMANDS = [
"getCellData",
]
self.SETTINGS_COMMANDS = [
"getInfo",
]
self.DEFAULT_COMMAND = "getCellData"
| 44.119565
| 618
| 0.561715
| 217
| 4,059
| 10.437788
| 0.428571
| 0.110375
| 0.16777
| 0.1766
| 0.13819
| 0.116115
| 0.116115
| 0.099779
| 0.099779
| 0.099779
| 0
| 0.384485
| 0.272727
| 4,059
| 91
| 619
| 44.604396
| 0.381775
| 0.017985
| 0
| 0.4375
| 0
| 0
| 0.485628
| 0.302572
| 0
| 0
| 0
| 0
| 0
| 1
| 0.0125
| false
| 0
| 0.025
| 0
| 0.05
| 0
| 0
| 0
| 1
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8c7300ad06a8a22b6d55b1d4bdb99502a7a2d5ff
| 200
|
py
|
Python
|
blogApp/admin.py
|
saurabh00031/building_a_blog_project
|
ffa4b3086660e597d9efd8eeaa68777ebaa524ab
|
[
"MIT"
] | 2
|
2021-11-18T20:34:24.000Z
|
2021-12-18T04:48:24.000Z
|
blogApp/admin.py
|
saurabh00031/building_a_blog_project
|
ffa4b3086660e597d9efd8eeaa68777ebaa524ab
|
[
"MIT"
] | null | null | null |
blogApp/admin.py
|
saurabh00031/building_a_blog_project
|
ffa4b3086660e597d9efd8eeaa68777ebaa524ab
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import Postinfo
@admin.register(Postinfo)
class PostDisp(admin.ModelAdmin):
list_display=['id','title','desc']
| 22.222222
| 38
| 0.73
| 25
| 200
| 5.8
| 0.72
| 0.17931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155
| 200
| 9
| 38
| 22.222222
| 0.857988
| 0.13
| 0
| 0
| 0
| 0
| 0.066667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8c7e117d87ee31e2d4384517fb4374003b8ed9f4
| 331
|
py
|
Python
|
pava/implementation/natives/java/lang/Float.py
|
laffra/pava
|
54d10cf7f8def2f96e254c0356623d08f221536f
|
[
"MIT"
] | 4
|
2017-03-30T16:51:16.000Z
|
2020-10-05T12:25:47.000Z
|
pava/implementation/natives/java/lang/Float.py
|
laffra/pava
|
54d10cf7f8def2f96e254c0356623d08f221536f
|
[
"MIT"
] | null | null | null |
pava/implementation/natives/java/lang/Float.py
|
laffra/pava
|
54d10cf7f8def2f96e254c0356623d08f221536f
|
[
"MIT"
] | null | null | null |
def add_native_methods(clazz):
def floatToRawIntBits__float__(a0):
raise NotImplementedError()
def intBitsToFloat__int__(a0):
raise NotImplementedError()
clazz.floatToRawIntBits__float__ = staticmethod(floatToRawIntBits__float__)
clazz.intBitsToFloat__int__ = staticmethod(intBitsToFloat__int__)
| 30.090909
| 79
| 0.782477
| 29
| 331
| 8.034483
| 0.448276
| 0.283262
| 0.223176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007143
| 0.154079
| 331
| 10
| 80
| 33.1
| 0.825
| 0
| 0
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0
| 0
| 0.428571
| 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
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8c8c274fb9ce5c673d2084175b2bb2b59fabf967
| 22
|
py
|
Python
|
cloudmesh/oracle/__init__.py
|
cloudmesh/cloudmesh-oracle
|
5e3aad2d9d77b7857717a03d32b70e77c8164902
|
[
"Apache-2.0"
] | null | null | null |
cloudmesh/oracle/__init__.py
|
cloudmesh/cloudmesh-oracle
|
5e3aad2d9d77b7857717a03d32b70e77c8164902
|
[
"Apache-2.0"
] | 7
|
2019-12-19T15:17:54.000Z
|
2020-05-01T18:09:56.000Z
|
cloudmesh/oracle/__init__.py
|
cloudmesh/cloudmesh-oracle
|
5e3aad2d9d77b7857717a03d32b70e77c8164902
|
[
"Apache-2.0"
] | 4
|
2019-12-19T01:37:02.000Z
|
2020-04-30T17:57:55.000Z
|
__version__ = "4.1.4"
| 11
| 21
| 0.636364
| 4
| 22
| 2.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 0.136364
| 22
| 1
| 22
| 22
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0.227273
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8c95fee019ef5e24aca713c9f51382982167d493
| 12,224
|
py
|
Python
|
ksp_parser_test.py
|
rongoro/ksp_parser
|
710de8dbdbca348da43268073c911cbe12aaed04
|
[
"MIT"
] | null | null | null |
ksp_parser_test.py
|
rongoro/ksp_parser
|
710de8dbdbca348da43268073c911cbe12aaed04
|
[
"MIT"
] | null | null | null |
ksp_parser_test.py
|
rongoro/ksp_parser
|
710de8dbdbca348da43268073c911cbe12aaed04
|
[
"MIT"
] | null | null | null |
import io
import ksp_parser
import unittest
class KSPFileTest(unittest.TestCase):
def setUp(self):
self.originalfile = io.BytesIO(ORIGINAL_TEXT)
self.editedfile = io.BytesIO(EDITED_TEXT)
self.kspfile_original = ksp_parser.KSPFile(self.originalfile)
self.kspfile_edited = ksp_parser.KSPFile(self.editedfile)
def test_compare_original_vs_edited_file(self):
self.assertEqual(self.kspfile_original.key_fingerprints,
self.kspfile_edited.key_fingerprints)
self.assertFalse(self.kspfile_original.verified_key_fingerprints)
def test_sha256_section(self):
self.assertEqual("""SHA256 Checksum: 1A4D 5BF8 02C0 EB2F 81E8 01F9 BDF8 E489
036D B243 1ADB ADC7 9477 0F14 AE0E 6A1B [ ]""",
self.kspfile_edited.sha256_section)
def test_calculate_sha256(self):
self.assertEqual("1A4D5BF802C0EB2F81E801F9BDF8E489036DB2431ADBADC794770F14AE0E6A1B",
self.kspfile_original.calculate_sha256())
def test_calculate_ripemd160(self):
self.assertEqual("1C9213C1E8569E3632F6496111FFF0DA5AB3F792",
self.kspfile_original.calculate_ripemd160())
def test_read_sha256(self):
self.assertEqual("1A4D5BF802C0EB2F81E801F9BDF8E489036DB2431ADBADC794770F14AE0E6A1B",
self.kspfile_edited.read_sha256)
self.assertIsNone(self.kspfile_original.read_sha256)
def test_read_ripemd160(self):
self.assertEqual("1C9213C1E8569E3632F6496111FFF0DA5AB3F792",
self.kspfile_edited.read_ripemd160)
self.assertIsNone(self.kspfile_original.read_ripemd160)
def test_ripemd160_section(self):
self.assertEqual("""RIPEMD160 Checksum: 1C92 13C1 E856 9E36 32F6 4961 11FF F0DA 5AB3 F792 [ ]""",
self.kspfile_edited.ripemd160_section)
def test_check_file_checksums(self):
self.assertTrue(self.kspfile_edited.file_checksums_ok(self.kspfile_original))
self.assertFalse(self.kspfile_edited.file_checksums_ok(
ksp_parser.KSPFile(io.BytesIO(b'FOO' + ORIGINAL_TEXT))))
def test_keys(self):
self.assertEqual(5, len(self.kspfile_edited.keys))
def test_get_key_fingerprint(self):
self.assertEqual('B8D4 EFF2 5588 DFDF 0000 1234 A2B1 0448 912B F510',
self.kspfile_edited.keys[0].fingerprint)
self.assertEqual('FFCC 7766 3434 F35D BCA3 112C DB44 A6B3 FFE2 75BA',
self.kspfile_edited.keys[2].fingerprint)
def test_keynum(self):
self.assertEqual(1, self.kspfile_edited.keys[0].keynum)
self.assertEqual(5, self.kspfile_edited.keys[4].keynum)
def test_fingerprint_ok(self):
self.assertTrue(self.kspfile_edited.keys[2].fingerprint_ok)
self.assertFalse(self.kspfile_edited.keys[1].fingerprint_ok)
self.assertTrue(self.kspfile_edited.keys[3].fingerprint_ok)
def test_id_ok(self):
self.assertFalse(self.kspfile_edited.keys[1].id_ok)
self.assertTrue(self.kspfile_edited.keys[2].id_ok)
self.assertTrue(self.kspfile_edited.keys[3].id_ok)
def test_verified_keys(self):
self.assertEqual(2, len(self.kspfile_edited.verified_keys))
self.assertEqual(['FFCC 7766 3434 F35D BCA3 112C DB44 A6B3 FFE2 75BA',
'EEA4 CB62 5862 5BC3 CA7F F344 E56C B333 5A7B EF89',],
[key.fingerprint for key in self.kspfile_edited.verified_keys])
def test_verified_key_fingerprints(self):
self.assertEqual(['FFCC 7766 3434 F35D BCA3 112C DB44 A6B3 FFE2 75BA',
'EEA4 CB62 5862 5BC3 CA7F F344 E56C B333 5A7B EF89',],
self.kspfile_edited.verified_key_fingerprints)
def test_create_edited_text(self):
self.assertRaises(ksp_parser.KSPParseException,
self.kspfile_edited.create_edited_file)
self.assertEqual(PREPARED_TEXT,
self.kspfile_original.create_edited_file().encode())
class ParserCommandTest(unittest.TestCase):
def test_prepare_file(self):
pass
ORIGINAL_TEXT = b"""Friday, June 10, 2016; 10:15
Signing Wizard <wizard@sign.example.com>
E X A M P L E K E Y S I G N I N G P A R T Y # 1
List of Participants (v 1.0)
Here's what you have to do with this file:
(1) Print this UTF-8 encoded file to paper.
(2) Compute this file's SHA256 and RIPEMD160 checksums.
gpg --print-md SHA256 ksp-file.txt
gpg --print-md RIPEMD160 ksp-file.txt
(3) Fill in the hash values on the printout.
(4) Bring the printout, a pen, and proof of identity to the key signing party
(and be on time!).
SHA256 Checksum: ____ ____ ____ ____ ____ ____ ____ ____
____ ____ ____ ____ ____ ____ ____ ____ [ ]
RIPEMD160 Checksum: ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ [ ]
001 [ ] Fingerprint OK [ ] ID OK
pub 4096R/AB5283DD 2013-12-08 [expires: 2021-03-23]
Key fingerprint = B8D4 EFF2 5588 DFDF 0000 1234 A2B1 0448 912B F510
uid Alice Aaron <alice@aaron.example.com>
uid Alice Aaron <aaaron@eng.school.edu>
_______________________________________________________________________________
002 [ ] Fingerprint OK [ ] ID OK
pub 4096R/B6273DDF 2005-02-24 [expires: 2025-11-05]
Key fingerprint = AA33 172C BAAA EE78 9562 A162 9833 2DDD BB15 6633
uid Bob Baron <bobbar@baron.example.org>
uid Bob Baron <baron@bar.on>
uid Bob Baron <bobbar@baron.example.com>
uid Bob Baron <bobbaron@common.example.com>
_______________________________________________________________________________
003 [ ] Fingerprint OK [ ] ID OK
pub 2048R/BBAA4343 2017-05-22
Key fingerprint = FFCC 7766 3434 F35D BCA3 112C DB44 A6B3 FFE2 75BA
uid Carl Casper Carson <carl.carson@common.example.com>
_______________________________________________________________________________
004 [ ] Fingerprint OK [ ] ID OK
pub 4096R/FF447611 2005-04-01 [expires: 2018-05-08]
Key fingerprint = EEA4 CB62 5862 5BC3 CA7F F344 E56C B333 5A7B EF89
uid example.io/danadavids <danadavids@example.io>
_______________________________________________________________________________
005 [ ] Fingerprint OK [ ] ID OK
pub 4096R/CC388FDC 2017-04-22 [expires: 2019-12-03]
Key fingerprint = 0997 7BEE A8FF C8CC E845 23CD 83FD FC87 23CD D822
uid Eve Earl <eveearl@common.example.com>
_______________________________________________________________________________
"""
PREPARED_TEXT = b"""Friday, June 10, 2016; 10:15
Signing Wizard <wizard@sign.example.com>
E X A M P L E K E Y S I G N I N G P A R T Y # 1
List of Participants (v 1.0)
Here's what you have to do with this file:
(1) Print this UTF-8 encoded file to paper.
(2) Compute this file's SHA256 and RIPEMD160 checksums.
gpg --print-md SHA256 ksp-file.txt
gpg --print-md RIPEMD160 ksp-file.txt
(3) Fill in the hash values on the printout.
(4) Bring the printout, a pen, and proof of identity to the key signing party
(and be on time!).
SHA256 Checksum: 1A4D 5BF8 02C0 EB2F 81E8 01F9 BDF8 E489
036D B243 1ADB ADC7 9477 0F14 AE0E 6A1B [ ]
RIPEMD160 Checksum: 1C92 13C1 E856 9E36 32F6 4961 11FF F0DA 5AB3 F792 [ ]
001 [ ] Fingerprint OK [ ] ID OK
pub 4096R/AB5283DD 2013-12-08 [expires: 2021-03-23]
Key fingerprint = B8D4 EFF2 5588 DFDF 0000 1234 A2B1 0448 912B F510
uid Alice Aaron <alice@aaron.example.com>
uid Alice Aaron <aaaron@eng.school.edu>
_______________________________________________________________________________
002 [ ] Fingerprint OK [ ] ID OK
pub 4096R/B6273DDF 2005-02-24 [expires: 2025-11-05]
Key fingerprint = AA33 172C BAAA EE78 9562 A162 9833 2DDD BB15 6633
uid Bob Baron <bobbar@baron.example.org>
uid Bob Baron <baron@bar.on>
uid Bob Baron <bobbar@baron.example.com>
uid Bob Baron <bobbaron@common.example.com>
_______________________________________________________________________________
003 [ ] Fingerprint OK [ ] ID OK
pub 2048R/BBAA4343 2017-05-22
Key fingerprint = FFCC 7766 3434 F35D BCA3 112C DB44 A6B3 FFE2 75BA
uid Carl Casper Carson <carl.carson@common.example.com>
_______________________________________________________________________________
004 [ ] Fingerprint OK [ ] ID OK
pub 4096R/FF447611 2005-04-01 [expires: 2018-05-08]
Key fingerprint = EEA4 CB62 5862 5BC3 CA7F F344 E56C B333 5A7B EF89
uid example.io/danadavids <danadavids@example.io>
_______________________________________________________________________________
005 [ ] Fingerprint OK [ ] ID OK
pub 4096R/CC388FDC 2017-04-22 [expires: 2019-12-03]
Key fingerprint = 0997 7BEE A8FF C8CC E845 23CD 83FD FC87 23CD D822
uid Eve Earl <eveearl@common.example.com>
_______________________________________________________________________________
"""
EDITED_TEXT = b"""Friday, June 10, 2016; 10:15
Signing Wizard <wizard@sign.example.com>
E X A M P L E K E Y S I G N I N G P A R T Y # 1
List of Participants (v 1.0)
Here's what you have to do with this file:
(1) Print this UTF-8 encoded file to paper.
(2) Compute this file's SHA256 and RIPEMD160 checksums.
gpg --print-md SHA256 ksp-file.txt
gpg --print-md RIPEMD160 ksp-file.txt
(3) Fill in the hash values on the printout.
(4) Bring the printout, a pen, and proof of identity to the key signing party
(and be on time!).
SHA256 Checksum: 1A4D 5BF8 02C0 EB2F 81E8 01F9 BDF8 E489
036D B243 1ADB ADC7 9477 0F14 AE0E 6A1B [ ]
RIPEMD160 Checksum: 1C92 13C1 E856 9E36 32F6 4961 11FF F0DA 5AB3 F792 [ ]
001 [ ] Fingerprint OK [ ] ID OK
pub 4096R/AB5283DD 2013-12-08 [expires: 2021-03-23]
Key fingerprint = B8D4 EFF2 5588 DFDF 0000 1234 A2B1 0448 912B F510
uid Alice Aaron <alice@aaron.example.com>
uid Alice Aaron <aaaron@eng.school.edu>
_______________________________________________________________________________
002 [ ] Fingerprint OK [ ] ID OK
pub 4096R/B6273DDF 2005-02-24 [expires: 2025-11-05]
Key fingerprint = AA33 172C BAAA EE78 9562 A162 9833 2DDD BB15 6633
uid Bob Baron <bobbar@baron.example.org>
uid Bob Baron <baron@bar.on>
uid Bob Baron <bobbar@baron.example.com>
uid Bob Baron <bobbaron@common.example.com>
_______________________________________________________________________________
003 [X] Fingerprint OK [X] ID OK
pub 2048R/BBAA4343 2017-05-22
Key fingerprint = FFCC 7766 3434 F35D BCA3 112C DB44 A6B3 FFE2 75BA
uid Carl Casper Carson <carl.carson@common.example.com>
_______________________________________________________________________________
004 [X] Fingerprint OK [X] ID OK
pub 4096R/FF447611 2005-04-01 [expires: 2018-05-08]
Key fingerprint = EEA4 CB62 5862 5BC3 CA7F F344 E56C B333 5A7B EF89
uid example.io/danadavids <danadavids@example.io>
_______________________________________________________________________________
005 [ ] Fingerprint OK [ ] ID OK
pub 4096R/CC388FDC 2017-04-22 [expires: 2019-12-03]
Key fingerprint = 0997 7BEE A8FF C8CC E845 23CD 83FD FC87 23CD D822
uid Eve Earl <eveearl@common.example.com>
_______________________________________________________________________________
"""
if __name__ == "__main__":
unittest.main()
| 38.440252
| 111
| 0.669912
| 1,482
| 12,224
| 4.574224
| 0.17139
| 0.051925
| 0.057678
| 0.032601
| 0.788022
| 0.761912
| 0.731229
| 0.657619
| 0.64036
| 0.64036
| 0
| 0.149513
| 0.260798
| 12,224
| 317
| 112
| 38.561514
| 0.600708
| 0
| 0
| 0.642857
| 0
| 0.014286
| 0.704655
| 0.177289
| 0
| 0
| 0
| 0
| 0.133333
| 1
| 0.085714
| false
| 0.004762
| 0.014286
| 0
| 0.109524
| 0.261905
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8ca9f336edecaca90865835057b15706e12b1acd
| 20
|
py
|
Python
|
taggit/__init__.py
|
alpsayin/django-taggit
|
3089f23322962bfd7e95de435d9c1aa3e408af6b
|
[
"BSD-3-Clause"
] | 2
|
2015-01-05T21:09:24.000Z
|
2015-07-31T16:52:38.000Z
|
taggit/__init__.py
|
alpsayin/django-taggit
|
3089f23322962bfd7e95de435d9c1aa3e408af6b
|
[
"BSD-3-Clause"
] | null | null | null |
taggit/__init__.py
|
alpsayin/django-taggit
|
3089f23322962bfd7e95de435d9c1aa3e408af6b
|
[
"BSD-3-Clause"
] | null | null | null |
VERSION = (0, 9, 4)
| 10
| 19
| 0.5
| 4
| 20
| 2.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0.25
| 20
| 1
| 20
| 20
| 0.466667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8cb17c96467e27f4277e716db5784822475bcf04
| 10,245
|
py
|
Python
|
cpp/swig_board/board.py
|
hwangyale/AlphaGomoku
|
7c85a71c710fa8d114b3591e4fd27c8649caccbb
|
[
"MIT"
] | 3
|
2018-10-30T07:07:40.000Z
|
2019-11-22T12:32:32.000Z
|
cpp/swig_board/board.py
|
hwangyale/AlphaGomoku
|
7c85a71c710fa8d114b3591e4fd27c8649caccbb
|
[
"MIT"
] | null | null | null |
cpp/swig_board/board.py
|
hwangyale/AlphaGomoku
|
7c85a71c710fa8d114b3591e4fd27c8649caccbb
|
[
"MIT"
] | null | null | null |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_board')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_board')
_board = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_board', [dirname(__file__)])
except ImportError:
import _board
return _board
try:
_mod = imp.load_module('_board', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_board = swig_import_helper()
del swig_import_helper
else:
import _board
del _swig_python_version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr(self, class_type, name):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except __builtin__.Exception:
class _object:
pass
_newclass = 0
class SwigPyIterator(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _board.delete_SwigPyIterator
__del__ = lambda self: None
def value(self):
return _board.SwigPyIterator_value(self)
def incr(self, n=1):
return _board.SwigPyIterator_incr(self, n)
def decr(self, n=1):
return _board.SwigPyIterator_decr(self, n)
def distance(self, x):
return _board.SwigPyIterator_distance(self, x)
def equal(self, x):
return _board.SwigPyIterator_equal(self, x)
def copy(self):
return _board.SwigPyIterator_copy(self)
def next(self):
return _board.SwigPyIterator_next(self)
def __next__(self):
return _board.SwigPyIterator___next__(self)
def previous(self):
return _board.SwigPyIterator_previous(self)
def advance(self, n):
return _board.SwigPyIterator_advance(self, n)
def __eq__(self, x):
return _board.SwigPyIterator___eq__(self, x)
def __ne__(self, x):
return _board.SwigPyIterator___ne__(self, x)
def __iadd__(self, n):
return _board.SwigPyIterator___iadd__(self, n)
def __isub__(self, n):
return _board.SwigPyIterator___isub__(self, n)
def __add__(self, n):
return _board.SwigPyIterator___add__(self, n)
def __sub__(self, *args):
return _board.SwigPyIterator___sub__(self, *args)
def __iter__(self):
return self
SwigPyIterator_swigregister = _board.SwigPyIterator_swigregister
SwigPyIterator_swigregister(SwigPyIterator)
class IntVector(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, IntVector, name)
__repr__ = _swig_repr
def iterator(self):
return _board.IntVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _board.IntVector___nonzero__(self)
def __bool__(self):
return _board.IntVector___bool__(self)
def __len__(self):
return _board.IntVector___len__(self)
def __getslice__(self, i, j):
return _board.IntVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _board.IntVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _board.IntVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _board.IntVector___delitem__(self, *args)
def __getitem__(self, *args):
return _board.IntVector___getitem__(self, *args)
def __setitem__(self, *args):
return _board.IntVector___setitem__(self, *args)
def pop(self):
return _board.IntVector_pop(self)
def append(self, x):
return _board.IntVector_append(self, x)
def empty(self):
return _board.IntVector_empty(self)
def size(self):
return _board.IntVector_size(self)
def swap(self, v):
return _board.IntVector_swap(self, v)
def begin(self):
return _board.IntVector_begin(self)
def end(self):
return _board.IntVector_end(self)
def rbegin(self):
return _board.IntVector_rbegin(self)
def rend(self):
return _board.IntVector_rend(self)
def clear(self):
return _board.IntVector_clear(self)
def get_allocator(self):
return _board.IntVector_get_allocator(self)
def pop_back(self):
return _board.IntVector_pop_back(self)
def erase(self, *args):
return _board.IntVector_erase(self, *args)
def __init__(self, *args):
this = _board.new_IntVector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def push_back(self, x):
return _board.IntVector_push_back(self, x)
def front(self):
return _board.IntVector_front(self)
def back(self):
return _board.IntVector_back(self)
def assign(self, n, x):
return _board.IntVector_assign(self, n, x)
def resize(self, *args):
return _board.IntVector_resize(self, *args)
def insert(self, *args):
return _board.IntVector_insert(self, *args)
def reserve(self, n):
return _board.IntVector_reserve(self, n)
def capacity(self):
return _board.IntVector_capacity(self)
__swig_destroy__ = _board.delete_IntVector
__del__ = lambda self: None
IntVector_swigregister = _board.IntVector_swigregister
IntVector_swigregister(IntVector)
class Board(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Board, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Board, name)
__repr__ = _swig_repr
__swig_setmethods__["bitboard"] = _board.Board_bitboard_set
__swig_getmethods__["bitboard"] = _board.Board_bitboard_get
if _newclass:
bitboard = _swig_property(_board.Board_bitboard_get, _board.Board_bitboard_set)
__swig_setmethods__["is_over"] = _board.Board_is_over_set
__swig_getmethods__["is_over"] = _board.Board_is_over_get
if _newclass:
is_over = _swig_property(_board.Board_is_over_get, _board.Board_is_over_set)
__swig_setmethods__["player"] = _board.Board_player_set
__swig_getmethods__["player"] = _board.Board_player_get
if _newclass:
player = _swig_property(_board.Board_player_get, _board.Board_player_set)
__swig_setmethods__["winner"] = _board.Board_winner_set
__swig_getmethods__["winner"] = _board.Board_winner_get
if _newclass:
winner = _swig_property(_board.Board_winner_get, _board.Board_winner_set)
__swig_setmethods__["step"] = _board.Board_step_set
__swig_getmethods__["step"] = _board.Board_step_get
if _newclass:
step = _swig_property(_board.Board_step_get, _board.Board_step_set)
__swig_setmethods__["zobristKey"] = _board.Board_zobristKey_set
__swig_getmethods__["zobristKey"] = _board.Board_zobristKey_get
if _newclass:
zobristKey = _swig_property(_board.Board_zobristKey_get, _board.Board_zobristKey_set)
def __init__(self, *args):
this = _board.new_Board(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def move(self, action):
return _board.Board_move(self, action)
def get_history(self):
return _board.Board_get_history(self)
def get_board(self):
return _board.Board_get_board(self)
def get_actions(self, is_player, gomoku_type):
return _board.Board_get_actions(self, is_player, gomoku_type)
def Vct(self, max_depth, max_time):
return _board.Board_Vct(self, max_depth, max_time)
__swig_destroy__ = _board.delete_Board
__del__ = lambda self: None
Board_swigregister = _board.Board_swigregister
Board_swigregister(Board)
# This file is compatible with both classic and new-style classes.
| 30.58209
| 93
| 0.681015
| 1,240
| 10,245
| 5.048387
| 0.158871
| 0.093131
| 0.099042
| 0.065176
| 0.350958
| 0.195687
| 0.158626
| 0.130192
| 0.092492
| 0.092492
| 0
| 0.002392
| 0.224793
| 10,245
| 334
| 94
| 30.673653
| 0.785822
| 0.028795
| 0
| 0.242188
| 1
| 0
| 0.026761
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.246094
| false
| 0.007813
| 0.074219
| 0.214844
| 0.671875
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
8cc2d9ed9788bf6c2a5917f9619fae7ef26b551c
| 3,417
|
py
|
Python
|
run.py
|
taojy123/GoCMS
|
3bb7bef696ac99ae8feba930d387ed7b9c8e2ec4
|
[
"MIT"
] | null | null | null |
run.py
|
taojy123/GoCMS
|
3bb7bef696ac99ae8feba930d387ed7b9c8e2ec4
|
[
"MIT"
] | null | null | null |
run.py
|
taojy123/GoCMS
|
3bb7bef696ac99ae8feba930d387ed7b9c8e2ec4
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
import os
import sys
import webbrowser
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gocms.settings")
#these pertain to your application
import gocms.wsgi
import gocms.urls
import gocms.settings
import gocms.models
import gocms.views
import django.contrib.auth
import django.contrib.contenttypes
import django.contrib.sessions
import django.contrib.sites
import django.contrib.admin
import django.db.models.sql.compiler
from django.contrib.auth.backends import *
from django.conf.urls.defaults import *
#these are django imports
import django.template.loaders.filesystem
import django.template.loaders.app_directories
import django.middleware.common
import django.contrib.sessions.middleware
import django.contrib.auth.middleware
import django.middleware.doc
import django.contrib.messages
import django.contrib.staticfiles
import django.contrib.messages.middleware
import django.contrib.sessions.backends.db
#import django.contrib.messages.storage.user_messages
import django.contrib.messages.storage.fallback
import django.db.backends.sqlite3.base
import django.db.backends.sqlite3.introspection
import django.db.backends.sqlite3.creation
import django.db.backends.sqlite3.client
import django.contrib.auth.context_processors
from django.core.context_processors import *
import django.contrib.messages.context_processors
import django.contrib.auth.models
import django.contrib.contenttypes.models
import django.contrib.sessions.models
import django.contrib.sites.models
import django.contrib.messages.models
import django.contrib.staticfiles.models
import django.contrib.admin.models
import django.template.defaulttags
import django.template.defaultfilters
import django.template.loader_tags
#dont need to import these pkgs
#need to know how to exclude them
import email.mime.audio
import email.mime.base
import email.mime.image
import email.mime.message
import email.mime.multipart
import email.mime.nonmultipart
import email.mime.text
import email.charset
import email.encoders
import email.errors
import email.feedparser
import email.generator
import email.header
import email.iterators
import email.message
import email.parser
import email.utils
import email.base64mime
import email.quoprimime
import django.core.cache.backends.locmem
import django.templatetags.i18n
import django.templatetags.future
import django.views.i18n
import django.core.context_processors
import django.template.defaulttags
import django.template.defaultfilters
import django.template.loader_tags
from django.conf.urls.defaults import *
import django.contrib.admin.views.main
import django.core.context_processors
import django.contrib.auth.views
import django.contrib.auth.backends
import django.views.static
import django.contrib.admin.templatetags.log
import django.contrib.admin.templatetags.adminmedia
import django.conf.urls.shortcut
import django.views.defaults
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers.basehttp import AdminMediaHandler
from django.conf import settings
from django.utils import translation
import django.contrib.staticfiles.urls
if __name__ == "__main__":
if len(sys.argv)==1:
sys.argv.append("runserver")
sys.argv.append("0.0.0.0:8000")
else:
webbrowser.open_new_tab('http://127.0.0.1:8000')
print sys.argv
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 31.934579
| 65
| 0.839918
| 474
| 3,417
| 5.99789
| 0.263713
| 0.219486
| 0.187126
| 0.04854
| 0.271896
| 0.134717
| 0.094267
| 0.066831
| 0.066831
| 0.066831
| 0
| 0.009247
| 0.082236
| 3,417
| 106
| 66
| 32.235849
| 0.897321
| 0.055897
| 0
| 0.104167
| 0
| 0
| 0.026716
| 0.006834
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.90625
| null | null | 0.010417
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8cfcefdbf9e586f5d3a3e8b6dd0d12946246a652
| 114
|
py
|
Python
|
nexus/core/interfaces/command.py
|
epicosy/nexus
|
a6342283592aec4dfe8ff02d47721edde829d38d
|
[
"MIT"
] | null | null | null |
nexus/core/interfaces/command.py
|
epicosy/nexus
|
a6342283592aec4dfe8ff02d47721edde829d38d
|
[
"MIT"
] | null | null | null |
nexus/core/interfaces/command.py
|
epicosy/nexus
|
a6342283592aec4dfe8ff02d47721edde829d38d
|
[
"MIT"
] | null | null | null |
from cement import Interface
class CommandInterface(Interface):
class Meta:
interface = "commands"
| 14.25
| 34
| 0.710526
| 11
| 114
| 7.363636
| 0.727273
| 0.345679
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.22807
| 114
| 7
| 35
| 16.285714
| 0.920455
| 0
| 0
| 0
| 0
| 0
| 0.070796
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
506e2f3c202a9b37deb3522cfe70994064c4302d
| 26
|
py
|
Python
|
rio_tiler_pds/cbers/__init__.py
|
Blockchainforcommons/rio-tiler-pds
|
5864189a8157cf42ba9bd311f7a9958a22a5e7d1
|
[
"BSD-3-Clause"
] | null | null | null |
rio_tiler_pds/cbers/__init__.py
|
Blockchainforcommons/rio-tiler-pds
|
5864189a8157cf42ba9bd311f7a9958a22a5e7d1
|
[
"BSD-3-Clause"
] | null | null | null |
rio_tiler_pds/cbers/__init__.py
|
Blockchainforcommons/rio-tiler-pds
|
5864189a8157cf42ba9bd311f7a9958a22a5e7d1
|
[
"BSD-3-Clause"
] | null | null | null |
"""rio-tiler-pds.cbers"""
| 13
| 25
| 0.615385
| 4
| 26
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038462
| 26
| 1
| 26
| 26
| 0.64
| 0.730769
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
507b6a087ce000b1fcd53d4286d0ef5de763dcbc
| 506
|
py
|
Python
|
set_finder.py
|
SaarLevy/set-finder
|
02bdcf6a484f73fb808cc467142f18304036a97c
|
[
"MIT"
] | null | null | null |
set_finder.py
|
SaarLevy/set-finder
|
02bdcf6a484f73fb808cc467142f18304036a97c
|
[
"MIT"
] | null | null | null |
set_finder.py
|
SaarLevy/set-finder
|
02bdcf6a484f73fb808cc467142f18304036a97c
|
[
"MIT"
] | null | null | null |
from card import *
def find_sets(cards):
triplets = combinations(cards, 3)
sets = []
for t in triplets:
if check_set(t):
sets.push(t)
return sets
def values_consistent(a, b, c):
return a == b == c or a != b != c
def check_set(c1, c2, c3):
return (values_consistent(c1.color, c2.color, c3.color) and
values_consistent(c1.suit, c2.suit, c3.suit) and
values_consistent(c1.fill, c2.fill, c3.fill) and
values_consistent(c1.value, c2.value, c3.value))
| 25.3
| 63
| 0.636364
| 81
| 506
| 3.876543
| 0.395062
| 0.254777
| 0.229299
| 0.200637
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041237
| 0.233202
| 506
| 20
| 64
| 25.3
| 0.768041
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.066667
| 0.133333
| 0.466667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
507d78315592af1d04f8eaf53ab95c0d20707e9a
| 139
|
py
|
Python
|
rum_app/test.py
|
Technosasquach/RRRrrrrLab-aaS
|
6e67d841dfa542e660bf52e7cc436b63fed096fa
|
[
"Apache-2.0"
] | null | null | null |
rum_app/test.py
|
Technosasquach/RRRrrrrLab-aaS
|
6e67d841dfa542e660bf52e7cc436b63fed096fa
|
[
"Apache-2.0"
] | null | null | null |
rum_app/test.py
|
Technosasquach/RRRrrrrLab-aaS
|
6e67d841dfa542e660bf52e7cc436b63fed096fa
|
[
"Apache-2.0"
] | null | null | null |
from assets.lib import *
set_process(0)
watch_ye_cannons_func()
fire_ye_cannons_func()
reveal_ye_plunder_func()
man_of_war_func(shots=2.0)
| 19.857143
| 26
| 0.834532
| 26
| 139
| 3.961538
| 0.730769
| 0.174757
| 0.252427
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023077
| 0.064748
| 139
| 6
| 27
| 23.166667
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.166667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
508eaa1d9e69721fe4ca92902a4189e740546cfa
| 439
|
py
|
Python
|
server/language_specific_settings.py
|
rsennrich/tramooc-mt
|
e4e92cfe3b31295276a5ce1a25dd8388dc849624
|
[
"BSD-2-Clause"
] | null | null | null |
server/language_specific_settings.py
|
rsennrich/tramooc-mt
|
e4e92cfe3b31295276a5ce1a25dd8388dc849624
|
[
"BSD-2-Clause"
] | null | null | null |
server/language_specific_settings.py
|
rsennrich/tramooc-mt
|
e4e92cfe3b31295276a5ce1a25dd8388dc849624
|
[
"BSD-2-Clause"
] | null | null | null |
input_tokenizer = {}
input_tokenizer['en-bg'] = '-l en -a'
input_tokenizer['en-cs'] = '-l en -a'
input_tokenizer['en-de'] = '-l en -a'
input_tokenizer['en-el'] = '-l en -a'
input_tokenizer['en-hr'] = '-l en -a'
input_tokenizer['en-it'] = '-l en -a'
input_tokenizer['en-nl'] = '-l en -a'
input_tokenizer['en-pl'] = '-l en -a'
input_tokenizer['en-pt'] = '-l en -a'
input_tokenizer['en-ru'] = '-l en -a'
input_tokenizer['en-zh'] = '-l en -a'
| 33.769231
| 37
| 0.610478
| 79
| 439
| 3.240506
| 0.202532
| 0.65625
| 0.6875
| 0.351563
| 0.78125
| 0.78125
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132118
| 439
| 12
| 38
| 36.583333
| 0.671916
| 0
| 0
| 0
| 0
| 0
| 0.32574
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
50b1d1fbb3551bb252d2f57e91210b39031035f3
| 69
|
py
|
Python
|
ginjinn/commandline/commandline_app/utils/__init__.py
|
AGOberprieler/GinJinn2
|
527feac125f476165e332277823c11016565f99d
|
[
"Apache-2.0"
] | 17
|
2021-07-24T20:55:58.000Z
|
2022-02-09T05:15:04.000Z
|
ginjinn/commandline/commandline_app/utils/__init__.py
|
AGOberprieler/GinJinn2
|
527feac125f476165e332277823c11016565f99d
|
[
"Apache-2.0"
] | 1
|
2021-12-21T06:33:56.000Z
|
2022-02-05T13:57:53.000Z
|
ginjinn/commandline/commandline_app/utils/__init__.py
|
AGOberprieler/GinJinn2
|
527feac125f476165e332277823c11016565f99d
|
[
"Apache-2.0"
] | null | null | null |
''' ginjinn command line utils
'''
from .utils import ginjinn_utils
| 13.8
| 32
| 0.73913
| 9
| 69
| 5.555556
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15942
| 69
| 4
| 33
| 17.25
| 0.862069
| 0.376812
| 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
| 0
| 0
|
0
| 4
|
50b9ef50250ba834bb3a56b4e5b2a1d5a52788f4
| 5,142
|
py
|
Python
|
notebooks/frey_face_mnist_reproduce.py
|
peekxc/tallem
|
949af20c1f50f9b6784ee32463e59123cd64294b
|
[
"Apache-2.0"
] | null | null | null |
notebooks/frey_face_mnist_reproduce.py
|
peekxc/tallem
|
949af20c1f50f9b6784ee32463e59123cd64294b
|
[
"Apache-2.0"
] | null | null | null |
notebooks/frey_face_mnist_reproduce.py
|
peekxc/tallem
|
949af20c1f50f9b6784ee32463e59123cd64294b
|
[
"Apache-2.0"
] | 1
|
2021-07-25T04:58:58.000Z
|
2021-07-25T04:58:58.000Z
|
# %% Imports
from tallem import TALLEM
from tallem.dimred import *
from tallem.cover import *
from tallem.distance import dist
from tallem.samplers import landmarks
from tallem.datasets import *
import matplotlib.pyplot as plt
# %% Load frey faces
import pickle
ff = pickle.load(open('/Users/mpiekenbrock/tallem/data/frey_faces.pickle', "rb")).T # 20 x 28
# %% Run TALLEM on frey faces
from tallem.dimred import rnn_graph, knn_graph, geodesic_dist
#G = rnn_graph(ff)
G = knn_graph(ff, k=20)
D = geodesic_dist(np.ascontiguousarray(G.A, dtype=np.float64))
cover = LandmarkCover(D, n_sets=25, scale=1.15)
# [len(subset) for subset in cover.values()]
top = TALLEM(cover, local_map="pca2", D=2)
emb = top.fit_transform(X=ff)
# %% Plot the points + the faces as images using matplotlib
fig = plt.figure(figsize=(8, 8), dpi=300)
ax = plt.gca()
ax.axis('off')
plt.scatter(*emb.T, alpha=0.70, s=8, edgecolor='gray',linewidth=0.30)
Lind, Lrad = landmarks(emb, k = 120)
img_width = 0.02*np.max(dist(emb)) # size of plotted images
for i in Lind:
bbox = np.array([emb[i,0] + img_width*np.array([-1.0, 1.0]), emb[i,1] + img_width*np.array([-1.0, 1.0])]).flatten()
face_im = ax.imshow(ff[i,:].reshape((28,20)), origin='upper', extent=bbox, cmap='gray', vmin=0, vmax=255)
face_im.set_zorder(20)
ax.set_xlim(left=np.min(emb[:,0])-img_width, right=np.max(emb[:,0])+img_width)
ax.set_ylim(bottom=np.min(emb[:,1])-img_width, top=np.max(emb[:,1])+img_width)
# plt.savefig("frey_faces.png", dpi=300, format="png", pad_inches=0.0, transparent=True)
plt.show()
# %% (Optional) Plot the points + the faces as images using matplotlib + datashader
import datashader as ds
from datashader.mpl_ext import dsshow, alpha_colormap
from pandas import DataFrame # bleh why is this necessary datashader
import datashader.transfer_functions as tf
from functools import partial
fig = plt.figure(figsize=(3.25, 3.25), dpi=300)
ax = plt.gca()
ax.axis('off')
df = DataFrame(emb, columns = ['x','y'])
shade_hook=partial(tf.dynspread, threshold=0.001, how='add', max_px=100)
dsshow(df, ds.Point('x', 'y'), norm='eq_hist', aspect='equal', ax=ax)
for i in Lind:
bbox = np.array([emb[i,0] + img_width*np.array([-1.0, 1.0]), emb[i,1] + img_width*np.array([-1.0, 1.0])]).flatten()
face_im = ax.imshow(ff[i,:].reshape((28,20)), origin='upper', extent=bbox, cmap='gray', vmin=0, vmax=255)
face_im.set_zorder(20)
ax.set_xlim(left=np.min(emb[:,0])-img_width, right=np.max(emb[:,0])+img_width)
ax.set_ylim(bottom=np.min(emb[:,1])-img_width, top=np.max(emb[:,1])+img_width)
plt.savefig("frey_faces.png", dpi=300, format="png", pad_inches=0.0, transparent=True)
plt.show()
# da = DSArtist(ax_r[0], df, 'x', 'y', ds.mean('z'), norm = mcolors.LogNorm())
# %% MNIST eights
import pickle
mn = pickle.load(open('/Users/mpiekenbrock/tallem/data/mnist_eights.pickle', "rb")).T # 28 x 28
rotate = lambda x: np.fliplr(x.T)
mn = np.array([rotate(mn[:,:,i]).flatten() for i in range(mn.shape[2])])
# %% Parameterize TALLEM
G = rnn_graph(mn, p=0.001)
# G = knn_graph(mn, k=20)
D = geodesic_dist(rnn_graph(mn, p=0.001).A)
cover = LandmarkCover(D, n_sets=80, scale=1.15) # 80, scale=1.10
[len(subset) for subset in cover.values()]
top = TALLEM(cover, local_map="pca2", D=2)
emb = top.fit_transform(X=mn)
# LI, LR = landmarks(mn, 80)
# %% Make scatter plot + images
fig = plt.figure(figsize=(5, 5), dpi=300)
ax = plt.gca()
ax.axis('off')
plt.scatter(*emb.T, alpha=0.70, s=8, edgecolor='gray',linewidth=0.30)
Lind, Lrad = landmarks(emb, k = 120)
img_width = 0.02*np.max(dist(emb))
Lind, Lrad = landmarks(emb, k = 120)
for i in Lind:
bbox = np.array([emb[i,0] + img_width*np.array([-1.0, 1.0]), emb[i,1] + img_width*np.array([-1.0, 1.0])]).flatten()
face_im = ax.imshow(mn[i,:].reshape((28,28)), origin='upper', extent=bbox, cmap='gray', vmin=0, vmax=255)
face_im.set_zorder(20)
ax.set_xlim(left=np.min(emb[:,0]), right=np.max(emb[:,0]))
ax.set_ylim(bottom=np.min(emb[:,1]), top=np.max(emb[:,1]))
# plt.savefig("mnist_eights.png", dpi=300, format="png", pad_inches=0.0, transparent=True)
plt.show()
# %% (optional) MNIST datashader figure
import datashader as ds
from datashader.mpl_ext import dsshow, alpha_colormap
from pandas import DataFrame # bleh why is this necessary datashader
import datashader.transfer_functions as tf
from functools import partial
fig = plt.figure(figsize=(3.25, 3.25), dpi=300)
ax = plt.gca()
ax.axis('off')
df = DataFrame(emb, columns = ['x','y'])
shade_hook=partial(tf.dynspread, threshold=0.999, how='add', max_px=100)
dsshow(df, ds.Point('x', 'y'), norm='linear', aspect='equal', vmax=10, ax=ax, vmin=1, cmap="viridis")
for i in Lind:
bbox = np.array([emb[i,0] + img_width*np.array([-1.0, 1.0]), emb[i,1] + img_width*np.array([-1.0, 1.0])]).flatten()
face_im = ax.imshow(mn[i,:].reshape((28,28)), origin='upper', extent=bbox, cmap='gray', vmin=0, vmax=255)
face_im.set_zorder(20)
ax.set_xlim(left=np.min(emb[:,0])+img_width, right=np.max(emb[:,0])+img_width)
ax.set_ylim(bottom=np.min(emb[:,1])+img_width, top=np.max(emb[:,1])+img_width)
plt.savefig("mnist_eights.png", dpi=300, format="png", pad_inches=0.0, transparent=True)
plt.show()
| 40.809524
| 116
| 0.690782
| 936
| 5,142
| 3.709402
| 0.205128
| 0.050691
| 0.025922
| 0.034562
| 0.773618
| 0.743088
| 0.727535
| 0.703917
| 0.697005
| 0.671659
| 0
| 0.051209
| 0.107546
| 5,142
| 126
| 117
| 40.809524
| 0.705382
| 0.156165
| 0
| 0.633333
| 0
| 0
| 0.057447
| 0.023164
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.222222
| 0
| 0.222222
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 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
| 4
|
50f3b34c5d942597d2492c8cd238908791452c86
| 17,498
|
py
|
Python
|
src/cmudict_parser/CMUDict.tests.py
|
stefantaubert/cmudict-parser
|
8f5d1b191a41929f1ce8c7acf391c23c08d2be15
|
[
"MIT"
] | null | null | null |
src/cmudict_parser/CMUDict.tests.py
|
stefantaubert/cmudict-parser
|
8f5d1b191a41929f1ce8c7acf391c23c08d2be15
|
[
"MIT"
] | 14
|
2020-12-01T08:45:16.000Z
|
2021-06-01T08:00:39.000Z
|
src/cmudict_parser/CMUDict.tests.py
|
stefantaubert/cmudict-parser
|
8f5d1b191a41929f1ce8c7acf391c23c08d2be15
|
[
"MIT"
] | null | null | null |
import unittest
from typing import Optional
from cmudict_parser.CMUDict import CMUDict, get_dict
cmu_dict_instance: Optional[CMUDict] = None
class UnitTests(unittest.TestCase):
def __init__(self, methodName: str) -> None:
global cmu_dict_instance
if cmu_dict_instance is None:
cmu_dict_instance = get_dict(silent=True)
self.cmu_dict = cmu_dict_instance
super().__init__(methodName)
def test_sentence_to_ipa__with_caching__executes_custom_func_only_once(self):
input_word = "xyzxyz"
assert not self.cmu_dict.contains(input_word.upper())
res = [self.cmu_dict.sentence_to_ipa(
sentence=input_word,
replace_unknown_with=lambda _: str(i),
use_caching=True
) for i in range(2)]
self.assertEqual(["0", "0"], res)
def test_sentence_to_ipa__without_caching__executes_custom_func(self):
input_word = "xyzxyz"
assert not self.cmu_dict.contains(input_word.upper())
res = [self.cmu_dict.sentence_to_ipa(
sentence=input_word,
replace_unknown_with=lambda _: str(i),
use_caching=False
) for i in range(2)]
self.assertEqual(["0", "1"], res)
def test_sentence_to_ipa__uses_caching_by_default(self):
input_word = "xyzxyz"
assert not self.cmu_dict.contains(input_word.upper())
res = [self.cmu_dict.sentence_to_ipa(
sentence=input_word,
replace_unknown_with=lambda _: str(i)
) for i in range(2)]
self.assertEqual(["0", "0"], res)
def test_len(self):
res = len(self.cmu_dict)
self.assertEqual(125022, res)
def test_get_all_arpa__to(self):
res = self.cmu_dict.get_all_arpa("to")
self.assertEqual(['T UW1', 'T IH0', 'T AH0'], res)
def test_get_all_ipa__to(self):
res = self.cmu_dict.get_all_ipa("to")
self.assertEqual(['tˈu', 'tɪ', 'tʌ'], res)
def test_get_first_ipa__to(self):
res = self.cmu_dict.get_first_ipa("to")
self.assertEqual('tˈu', res)
def test_get_first_ipa__allo(self):
res = self.cmu_dict.get_first_ipa("'Allo")
self.assertEqual('ˌɑlˈoʊ', res)
def test_sentence_to_ipa_no_replace_unknown_keep_original(self):
# should return ipa of to and keep xxl
res = self.cmu_dict.sentence_to_ipa(
"to to. xxl xxl.", replace_unknown_with=None, use_caching=False)
self.assertEqual("tˈu tˈu. xxl xxl.", res)
def test_sentence_to_ipa_replace_unknown_with_underscore(self):
# should return ipa of to and replace xxl with ___
res = self.cmu_dict.sentence_to_ipa(
"to to. xxl xxl.", replace_unknown_with="_", use_caching=False)
self.assertEqual("tˈu tˈu. ___ ___.", res)
def test_sentence_to_ipa_replace_unknown_with_nothing(self):
# should return ipa of to and replace xxl with empty string (but keep space in between)
res = self.cmu_dict.sentence_to_ipa(
"to to. xxl xxl.", replace_unknown_with="", use_caching=False)
self.assertEqual("tˈu tˈu. .", res)
def test_sentence_to_ipa_replace_unknown_with_custom_func(self):
# should return ipa of to and keep xxl with an added X
res = self.cmu_dict.sentence_to_ipa(
"to to. xxl xxl.", replace_unknown_with=lambda x: x + "X", use_caching=False)
self.assertEqual("tˈu tˈu. xxlX xxlX.", res)
def test_sentence_to_ipa__double_space__is_kept(self):
# should return ipa of to with a double space in between
res = self.cmu_dict.sentence_to_ipa("to to", replace_unknown_with="_", use_caching=False)
self.assertEqual("tˈu tˈu", res)
def test_sentence_to_ipa__single_punctuation__is_kept(self):
# should return .
res = self.cmu_dict.sentence_to_ipa(".", replace_unknown_with="_", use_caching=False)
self.assertEqual(".", res)
def test_sentence_to_ipa__too_long_replacement__throws_exception(self):
# should throw exception
try:
self.cmu_dict.sentence_to_ipa("ewjoigf", replace_unknown_with="__", use_caching=False)
self.fail()
except Exception as e:
self.assertEqual("Parameter replace_unknown_with can only be 0 or 1 char.", e.args[0])
def test_sentence_to_ipa__minus_sign(self):
# should return ipa of to with hyphen in between
res = self.cmu_dict.sentence_to_ipa("to-to-to", replace_unknown_with="_", use_caching=False)
self.assertEqual("tˈu-tˈu-tˈu", res)
def test_sentence_to_ipa__minus_sign_different_words(self):
# should return ipa of the single words with hyphen in between
res = self.cmu_dict.sentence_to_ipa("to-no-so", replace_unknown_with="_", use_caching=False)
self.assertEqual("tˈu-nˈoʊ-sˈoʊ", res)
def test_sentence_to_ipa__closing_parenthesis(self):
# should return ipa of to with ) at end
res = self.cmu_dict.sentence_to_ipa("to to)", replace_unknown_with="_", use_caching=False)
self.assertEqual("tˈu tˈu)", res)
def test_sentence_to_ipa__opening_parenthesis(self):
# should return ipa of to with ( at beginning
res = self.cmu_dict.sentence_to_ipa("(to to", replace_unknown_with="_", use_caching=False)
self.assertEqual("(tˈu tˈu", res)
def test_sentence_to_ipa__minus_is_kept(self):
# should return hyphen
res = self.cmu_dict.sentence_to_ipa("-", replace_unknown_with="_", use_caching=False)
self.assertEqual("-", res)
def test_sentence_to_ipa__single_quotation_mark_is_kept(self):
# should return ipa of to with ' at beginning
res = self.cmu_dict.sentence_to_ipa("'to", replace_unknown_with="_", use_caching=False)
self.assertEqual("'tˈu", res)
def test_sentence_to_ipa__double_quotation_mark_is_kept(self):
# should return ipa of to with \" at beginning
res = self.cmu_dict.sentence_to_ipa("\"to", replace_unknown_with="_", use_caching=False)
self.assertEqual("\"tˈu", res)
def test_sentence_to_ipa__minus_sign_and_parenthesis(self):
# should return ipa of to with hyphens in between and parenthesis at beginning and end
res = self.cmu_dict.sentence_to_ipa("(to-to-to)", replace_unknown_with="_", use_caching=False)
self.assertEqual("(tˈu-tˈu-tˈu)", res)
def test_sentence_to_ipa__double_punctuation_marks(self):
# should return ipa of to with double hyphens in between and double parenthesis at beginning and end
res = self.cmu_dict.sentence_to_ipa(
"((to--to--to))", replace_unknown_with="_", use_caching=False)
self.assertEqual("((tˈu--tˈu--tˈu))", res)
def test_sentence_to_ipa__big_letter_abbreviation(self):
# should return the ipa of every single letter
res = self.cmu_dict.sentence_to_ipa("PRS", replace_unknown_with="_", use_caching=False)
self.assertEqual("pˈiˈɑɹˈɛs", res)
def test_sentence_to_ipa__big_letter_abbreviation_with_punctuation(self):
# should return the ipa of every single letter with \" at beginning
res = self.cmu_dict.sentence_to_ipa("\"PRS)", replace_unknown_with="_", use_caching=False)
self.assertEqual("\"pˈiˈɑɹˈɛs)", res)
def test_sentence_to_ipa__small_letter_abbreviation_is_not_replaced(self):
# should return _ for every single letter
res = self.cmu_dict.sentence_to_ipa("prs", replace_unknown_with="_", use_caching=False)
self.assertEqual("___", res)
def test_sentence_to_ipa__mix_of_different_scenarios(self):
# should keep the punctuation at the corresponding places, return the ipa of to, the ipa of every single letter in PRS and replace every letter of xxl with _
res = self.cmu_dict.sentence_to_ipa(
"((to-?PRS --to xxl))", replace_unknown_with="_", use_caching=False)
self.assertEqual("((tˈu-?pˈiˈɑɹˈɛs --tˈu ___))", res)
def test_sentence_to_ipa__allo(self):
# should get the ipa of 'Allo, no apostrophe should be in ipa
res = self.cmu_dict.sentence_to_ipa("'Allo", replace_unknown_with="_", use_caching=False)
self.assertEqual('ˌɑlˈoʊ', res)
def test_sentence_to_ipa__theyre(self):
# should get the ipa of they're, no apostrophe should be in ipa
res = self.cmu_dict.sentence_to_ipa("they're", replace_unknown_with="_", use_caching=False)
self.assertEqual('ðˈɛɹ', res)
def test_sentence_to_ipa__cat_o_nine_tails(self):
# cat-o-nine-tails is really a single word in the dictionary, should return its ipa
res = self.cmu_dict.sentence_to_ipa(
"cat-o-nine-tails", replace_unknown_with="_", use_caching=False)
self.assertEqual('kˈætoʊnˌaɪntˌeɪlz', res)
def test_sentence_to_ipa__to_cat_o_nine_tails_to(self):
# should return ipa of to, hyphen, ipa of cat-o-nine-tails, hyphen, ipa of to
res = self.cmu_dict.sentence_to_ipa(
"to-cat-o-nine-tails-to", replace_unknown_with="_", use_caching=False)
self.assertEqual('tˈu-kˈætoʊnˌaɪntˌeɪlz-tˈu', res)
def test_sentence_to_ipa__ha_ha_ha(self):
# ha-ha-ha is a word in the dictionary, herefore no hyphen should appear in ipa
res = self.cmu_dict.sentence_to_ipa("ha-ha-ha", replace_unknown_with="_", use_caching=False)
self.assertEqual('hˌɑhˌɑhˈɑ', res)
def test_sentence_to_ipa__day_by_day_to_day(self):
# day-by-day and day-to-day are both words in the dictionary
# the code should recognize day-by-day as a word and not day-to-day
# therefore should return ipa of day-by-day (with no hyphen), hyphen, ipa of to, hyphen, ipa of day
res = self.cmu_dict.sentence_to_ipa(
"day-by-day-to-day", replace_unknown_with="_", use_caching=False)
self.assertEqual('dˈeɪbaɪdˌeɪ-tˈu-dˈeɪ', res)
def test_sentence_to_ipa__end_inner_quote(self):
# 'end-inner-qoute is a word in the dictionary, therefore no ' should appear in ipa
res = self.cmu_dict.sentence_to_ipa(
"'end-inner-quote", replace_unknown_with="_", use_caching=False)
self.assertEqual("ˈɛndˈɪnɝkwˈoʊt", res)
def test_sentence_to_ipa__non_smokers(self):
# non-smokers' is a word in the dictionary, therefore no ' should appear in ipa
res = self.cmu_dict.sentence_to_ipa("non-smokers'", replace_unknown_with="_", use_caching=False)
self.assertEqual('nˈɑnsmˈoʊkɝz', res)
def test_sentence_to_ipa__cat_o_nine_tails_to_with_punctuation(self):
# should return apostrophe and ipa of cat-o-nine-tails-to
res = self.cmu_dict.sentence_to_ipa(
"'cat-o-nine-tails-to", replace_unknown_with="_", use_caching=False)
self.assertEqual("'kˈætoʊnˌaɪntˌeɪlz-tˈu", res)
def test_sentence_to_ipa__apos(self):
# should return apostrophe
res = self.cmu_dict.sentence_to_ipa("'", replace_unknown_with="_", use_caching=False)
self.assertEqual("'", res)
def test_sentence_to_ipa__sentence_with_apos(self):
# all apostrophes in the sentence should not appear in the ipa as they belong to the words
res = self.cmu_dict.sentence_to_ipa(
"'Allo, to they're?", replace_unknown_with="_", use_caching=False)
self.assertEqual("ˌɑlˈoʊ, tˈu ðˈɛɹ?", res)
def test_sentence_to_ipa__theyre_with_apos_at_beginning_and_question_mark_at_end(self):
# should return apostrophe and ipa of they're
res = self.cmu_dict.sentence_to_ipa("'they're?", replace_unknown_with="_", use_caching=False)
self.assertEqual("'ðˈɛɹ?", res)
def test_sentence_to_ipa__theyre_with_apos_at_beginning_and_end(self):
# should return ipa of they're with apostrophes at beginning and end
res = self.cmu_dict.sentence_to_ipa("'they're'", replace_unknown_with="_", use_caching=False)
self.assertEqual("'ðˈɛɹ'", res)
def test_sentence_to_ipa__allo_with_apos_at_end(self):
# should return ipa of 'Allo with apostrophe at end
res = self.cmu_dict.sentence_to_ipa("'Allo'", replace_unknown_with="_", use_caching=False)
self.assertEqual("ˌɑlˈoʊ'", res)
def test_sentence_to_ipa__stones_genitive(self):
# stones' is a word in the dictionary, no apostrophe should appear in ipa
res = self.cmu_dict.sentence_to_ipa("stones'", replace_unknown_with="_", use_caching=False)
self.assertEqual("stˈoʊnz", res)
def test_sentence_to_ipa__stones_genitive_with_apos_at_beginning(self):
# stones' is a word in the dictionary, therefore only apostrophe at beginning should appear in ipa
res = self.cmu_dict.sentence_to_ipa("'stones'", replace_unknown_with="_", use_caching=False)
self.assertEqual("'stˈoʊnz", res)
def test_sentence_to_ipa__no_brainer(self):
# no-brainer is a word in the dictionary, therefore the hyphen should not appear in ipa
res = self.cmu_dict.sentence_to_ipa("no-brainer", replace_unknown_with="_", use_caching=False)
self.assertEqual("nˌoʊbɹˈeɪnɝ", res)
def test_sentence_to_ipa__etc(self):
# dict only contains ETC but not ETC.
res = self.cmu_dict.sentence_to_ipa("etc.", replace_unknown_with="_", use_caching=False)
self.assertEqual("ˌɛtsˈɛtɝʌ.", res)
def test_sentence_to_ipa__word_with_hyphen_and_newline_at_end(self):
# should return ipa of no-brainer and \n at end
res = self.cmu_dict.sentence_to_ipa("no-brainer\n", replace_unknown_with="_", use_caching=False)
self.assertEqual("nˌoʊbɹˈeɪnɝ\n", res)
def test_sentence_to_ipa__normal_word_and_newline_at_end(self):
# should return ipa of no and \n at end
res = self.cmu_dict.sentence_to_ipa("no\n", replace_unknown_with="_", use_caching=False)
self.assertEqual("nˈoʊ\n", res)
def test_sentence_to_ipa__normal_word_and_hyphen_and_newline_at_end(self):
# should return ipa of no, followed by -\n
res = self.cmu_dict.sentence_to_ipa("no-\n", replace_unknown_with="_", use_caching=False)
self.assertEqual("nˈoʊ-\n", res)
def test_sentence_to_ipa__sentence_with_commas(self):
# should keep the commas and return the ipa of all the words
res = self.cmu_dict.sentence_to_ipa(
"it is not a real gain, for the modern printer throws the gain away by putting inordinately wide spaces between his lines, which, probably,", replace_unknown_with="_", use_caching=False)
self.assertEqual(
"ˈɪt ˈɪz nˈɑt ʌ ɹˈil gˈeɪn, fˈɔɹ ðʌ mˈɑdɝn pɹˈɪntɝ θɹˈoʊz ðʌ gˈeɪn ʌwˈeɪ bˈaɪ pˈʌtɪŋ ˌɪnˈɔɹdʌnʌtli wˈaɪd spˈeɪsʌz bɪtwˈin hˈɪz lˈaɪnz, wˈɪʧ, pɹˈɑbʌblˌi,", res)
def test_sentence_to_ipa__ipa_of_number(self):
# should return _, as 1 is not in the dictionary
res = self.cmu_dict.sentence_to_ipa("1", replace_unknown_with="_", use_caching=False)
self.assertEqual("_", res)
def test_sentence_to_ipa__big_letter_and_number(self):
# should return __ as A1 is not in the dictionary (it should be treated as a single word, not like in big letter abbreviation)
res = self.cmu_dict.sentence_to_ipa("A1", replace_unknown_with="_", use_caching=False)
self.assertEqual("__", res)
def test_get_first_ipa__theyre(self):
res = self.cmu_dict.get_first_ipa("they're")
self.assertEqual('ðˈɛɹ', res)
def test_sentence_to_ipa__sentence_with_word_ending_with_apo_and_two_hyphen(self):
# should return ipa of the words and keep punctuation
res = self.cmu_dict.sentence_to_ipa(
"\"'Whose name is'--", replace_unknown_with="_", use_caching=False)
self.assertEqual("\"'hˈuz nˈeɪm ˈɪz'--", res)
def test_sentence_to_ipa__sentence_with_word_with_apo_and_two_hyphen_followed_by_another_word(self):
# should return ipa of the words and keep punctuation
res = self.cmu_dict.sentence_to_ipa(
"\"'Whose name is'--is'", replace_unknown_with="_", use_caching=False)
self.assertEqual("\"'hˈuz nˈeɪm ˈɪz'--ˈɪz'", res)
def test_sentence_to_ipa__sentence_with_words_with_different_apo_combinations(self):
# should return ipa of the words and keep punctuation
res = self.cmu_dict.sentence_to_ipa(
"\"'Whose'-'stones'''-'Allo''", replace_unknown_with="_", use_caching=False)
self.assertEqual("\"'hˈuz'-'stˈoʊnz''-ˌɑlˈoʊ''", res)
def test_sentence_to_ipa__sentence_with_words_with_apos_belonging_to_the_word_but_some_are_not_in_dict__plus_combination_of_apo_and_hyphens_between_words(self):
# should return ipa of the words which are in dict and keep punctuation where it does not belong to any word
res = self.cmu_dict.sentence_to_ipa(
"Suckin'--I mean helpin' people an' fightin' an' all that.", replace_unknown_with="_")
self.assertEqual("_______--ˈaɪ mˈin ______' pˈipʌl ˈæn' fˈaɪtɪn ˈæn' ˈɔl ðˈæt.", res)
def test_sentence_to_ipa__sentence_with_words_with_apos_belonging_to_the_word_but_some_are_not_in_dict__plus_combination_of_apo_and_hyphens_between_words2(self):
# should return ipa of the words which are in dict and keep punctuation where it does not belong to any word
res = self.cmu_dict.sentence_to_ipa(
"Fightin'--I mean helpin' people an' suckin' an' all that.", replace_unknown_with="_")
self.assertEqual("fˈaɪtɪn--ˈaɪ mˈin ______' pˈipʌl ˈæn' ______' ˈæn' ˈɔl ðˈæt.", res)
def test_sentence_to_ipa__sentence_with_words_with_hypen_in_which_parts_are_unknown(self):
# should return _ in the length of the unknown parts, keep the hyphens and return ipa for the known words
res = self.cmu_dict.sentence_to_ipa(
"higgledy-piggledy, myself-piggledy, higgledy-i", replace_unknown_with="_")
self.assertEqual("________-________, mˌaɪsˈɛlf-________, ________-ˈaɪ", res)
def test_sentence_to_ipa__sentence_with_words_with_double_hypen_in_which_parts_are_unknown(self):
# should return _ in the length of the unknown parts, keep the double hyphens and return ipa for the known words
res = self.cmu_dict.sentence_to_ipa(
"higgledy--piggledy, myself--piggledy, higgledy--i", replace_unknown_with="_")
self.assertEqual("________--________, mˌaɪsˈɛlf--________, ________--ˈaɪ", res)
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(UnitTests)
unittest.TextTestRunner(verbosity=2).run(suite)
| 42.574209
| 192
| 0.745171
| 2,674
| 17,498
| 4.472326
| 0.10546
| 0.090309
| 0.117401
| 0.067899
| 0.801488
| 0.770633
| 0.727569
| 0.682248
| 0.609499
| 0.532988
| 0
| 0.00182
| 0.15196
| 17,498
| 410
| 193
| 42.678049
| 0.804097
| 0.195051
| 0
| 0.182979
| 0
| 0.008511
| 0.136412
| 0.012401
| 0
| 0
| 0
| 0
| 0.268085
| 1
| 0.259574
| false
| 0
| 0.012766
| 0
| 0.276596
| 0.004255
| 0
| 0
| 0
| null | 0
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0f9dbf38ecff541494ced5f38d3a3d927d27e410
| 74
|
py
|
Python
|
vvsa/conf/global_settings.py
|
goncalovf/security-analysis
|
72b80ea7c0c5c93b6fd80a4e347ecdb401b7667e
|
[
"MIT"
] | 1
|
2021-09-16T13:36:13.000Z
|
2021-09-16T13:36:13.000Z
|
vvsa/conf/global_settings.py
|
goncalovf/security-analysis
|
72b80ea7c0c5c93b6fd80a4e347ecdb401b7667e
|
[
"MIT"
] | null | null | null |
vvsa/conf/global_settings.py
|
goncalovf/security-analysis
|
72b80ea7c0c5c93b6fd80a4e347ecdb401b7667e
|
[
"MIT"
] | null | null | null |
DATA_LOCATION = "C:/Users/gonca/Dev/valuvalu/security_analysis/vvsa/data"
| 37
| 73
| 0.810811
| 11
| 74
| 5.272727
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.040541
| 74
| 1
| 74
| 74
| 0.816901
| 0
| 0
| 0
| 0
| 0
| 0.743243
| 0.743243
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0fa116874685f52428b61fac6d1465ff3110f448
| 174
|
py
|
Python
|
Assignments/utils_3a.py
|
rvrheenen/python-for-text-analysis
|
b56305fcdd691768572175a4b08e27a81114020b
|
[
"Apache-2.0"
] | null | null | null |
Assignments/utils_3a.py
|
rvrheenen/python-for-text-analysis
|
b56305fcdd691768572175a4b08e27a81114020b
|
[
"Apache-2.0"
] | null | null | null |
Assignments/utils_3a.py
|
rvrheenen/python-for-text-analysis
|
b56305fcdd691768572175a4b08e27a81114020b
|
[
"Apache-2.0"
] | null | null | null |
import string
def preprocess(text):
text = ''.join(char for char in text.lower().strip().replace("\t", "") if char not in string.punctuation)
return text.split(" ")
| 29
| 109
| 0.66092
| 25
| 174
| 4.6
| 0.72
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 174
| 5
| 110
| 34.8
| 0.793103
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
0fd19ca22716e7e2ca02362e8f2bb93c609173a2
| 402
|
py
|
Python
|
lang/tags/comment_block.py
|
quadfather85/knausj_talon
|
68420c57da64b7a3a4a6759b1acc823068110706
|
[
"MIT"
] | 298
|
2020-02-23T03:00:51.000Z
|
2022-03-30T02:11:00.000Z
|
lang/tags/comment_block.py
|
quadfather85/knausj_talon
|
68420c57da64b7a3a4a6759b1acc823068110706
|
[
"MIT"
] | 521
|
2020-02-21T18:21:17.000Z
|
2022-03-31T16:40:34.000Z
|
lang/tags/comment_block.py
|
quadfather85/knausj_talon
|
68420c57da64b7a3a4a6759b1acc823068110706
|
[
"MIT"
] | 499
|
2020-03-07T05:43:52.000Z
|
2022-03-28T12:24:54.000Z
|
from talon import Context, Module
ctx = Context()
mod = Module()
mod.tag("code_comment_block", desc="Tag for enabling generic block comment commands")
@mod.action_class
class Actions:
def code_comment_block():
"""Block comment"""
def code_comment_block_prefix():
"""Block comment start syntax"""
def code_comment_block_suffix():
"""Block comment end syntax"""
| 21.157895
| 85
| 0.686567
| 51
| 402
| 5.196078
| 0.490196
| 0.166038
| 0.241509
| 0.215094
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.199005
| 402
| 18
| 86
| 22.333333
| 0.822981
| 0.161692
| 0
| 0
| 0
| 0
| 0.202492
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.111111
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
0fdd03abd14611a0d919a7b202fc8e51a81face0
| 1,155
|
py
|
Python
|
tpRigToolkit-tools-{{cookiecutter.tool_name}}/tpRigToolkit/tools/{{cookiecutter.tool_name}}/core/view.py
|
tpRigToolkit/tpRigToolkit-tools-cookiecutter
|
395849083e791febbbfb2cec8ecd8d2ccba7ccd1
|
[
"MIT"
] | null | null | null |
tpRigToolkit-tools-{{cookiecutter.tool_name}}/tpRigToolkit/tools/{{cookiecutter.tool_name}}/core/view.py
|
tpRigToolkit/tpRigToolkit-tools-cookiecutter
|
395849083e791febbbfb2cec8ecd8d2ccba7ccd1
|
[
"MIT"
] | null | null | null |
tpRigToolkit-tools-{{cookiecutter.tool_name}}/tpRigToolkit/tools/{{cookiecutter.tool_name}}/core/view.py
|
tpRigToolkit/tpRigToolkit-tools-cookiecutter
|
395849083e791febbbfb2cec8ecd8d2ccba7ccd1
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains view implementation for tpRigToolkit-tools-{{cookiecutter.tool_name}}
"""
from __future__ import print_function, division, absolute_import
from tpDcc.libs.qt.core import base
class {{cookiecutter.tool_class}}View(base.BaseWidget):
def __init__(self, model, controller, parent=None):
self._model = model
self._controller = controller
super({{cookiecutter.tool_class}}View, self).__init__(parent=parent)
self.refresh()
# =================================================================================================================
# OVERRIDES
# =================================================================================================================
def ui(self):
super({{cookiecutter.tool_class}}View, self).ui()
# =================================================================================================================
# BASE
# =================================================================================================================
def refresh(self):
pass
| 32.083333
| 119
| 0.394805
| 80
| 1,155
| 5.45
| 0.55
| 0.146789
| 0.144495
| 0.172018
| 0.155963
| 0.155963
| 0
| 0
| 0
| 0
| 0
| 0.001002
| 0.135931
| 1,155
| 35
| 120
| 33
| 0.435872
| 0.444156
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.083333
| 0.166667
| null | null | 0.083333
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
0fe490f74c41b6852bfe412dcc0a432230fc14f9
| 156
|
py
|
Python
|
fig/falcon/__init__.py
|
robertcorreiro/falcon-integration-gateway
|
d862e3a60f477ce7199232d0f2c64f162a65e5d8
|
[
"Unlicense"
] | 10
|
2021-04-02T02:45:07.000Z
|
2021-12-17T19:03:10.000Z
|
fig/falcon/__init__.py
|
robertcorreiro/falcon-integration-gateway
|
d862e3a60f477ce7199232d0f2c64f162a65e5d8
|
[
"Unlicense"
] | 50
|
2021-03-19T14:30:43.000Z
|
2022-03-22T21:07:29.000Z
|
fig/falcon/__init__.py
|
robertcorreiro/falcon-integration-gateway
|
d862e3a60f477ce7199232d0f2c64f162a65e5d8
|
[
"Unlicense"
] | 11
|
2021-03-19T11:36:21.000Z
|
2022-03-22T23:33:13.000Z
|
from .api import FalconAPI
from .models import Event
from .stream import StreamManagementThread
__all__ = ['Event', 'FalconAPI', 'StreamManagementThread']
| 26
| 58
| 0.794872
| 16
| 156
| 7.5
| 0.5625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 156
| 5
| 59
| 31.2
| 0.869565
| 0
| 0
| 0
| 0
| 0
| 0.230769
| 0.141026
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
0ff511c56d2f398d6dc6de80ee64c5cfca88098f
| 140
|
py
|
Python
|
functions/__init__.py
|
yoshikawat64m/python-packages
|
862034d88965fdaf73d363f52ce6e7cc83448255
|
[
"MIT"
] | null | null | null |
functions/__init__.py
|
yoshikawat64m/python-packages
|
862034d88965fdaf73d363f52ce6e7cc83448255
|
[
"MIT"
] | null | null | null |
functions/__init__.py
|
yoshikawat64m/python-packages
|
862034d88965fdaf73d363f52ce6e7cc83448255
|
[
"MIT"
] | null | null | null |
from .src.exception import exception
from .src.cached_property import cached_property
__all__ = (
"exception",
"cached_property"
)
| 17.5
| 48
| 0.75
| 16
| 140
| 6.125
| 0.4375
| 0.428571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164286
| 140
| 7
| 49
| 20
| 0.837607
| 0
| 0
| 0
| 0
| 0
| 0.171429
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 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
| 0
| 0
|
0
| 4
|
e839a91645ec5f615f9d2058721b47926235baf6
| 246
|
py
|
Python
|
voxel_globe/vip/asgi.py
|
ngageoint/voxel-globe
|
91f386de652b704942165889c10468b2c4cf4eec
|
[
"MIT"
] | 28
|
2015-07-27T23:57:24.000Z
|
2020-04-05T15:10:52.000Z
|
voxel_globe/vip/asgi.py
|
VisionSystemsInc/voxel_globe
|
6eb3fca5586726428e9d914f7b730ca164c64a52
|
[
"MIT"
] | 50
|
2016-02-11T15:50:22.000Z
|
2016-10-27T22:38:27.000Z
|
voxel_globe/vip/asgi.py
|
ngageoint/voxel-globe
|
91f386de652b704942165889c10468b2c4cf4eec
|
[
"MIT"
] | 8
|
2015-07-27T19:22:03.000Z
|
2021-01-04T09:44:48.000Z
|
import os
from channels.asgi import get_channel_layer
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", os.environ['VIP_DJANGO_SETTINGS_MODULE'])
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "vip.settings")
channel_layer = get_channel_layer()
| 41
| 91
| 0.833333
| 34
| 246
| 5.676471
| 0.411765
| 0.186529
| 0.310881
| 0.259067
| 0.554404
| 0.404145
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056911
| 246
| 6
| 92
| 41
| 0.831897
| 0.361789
| 0
| 0
| 0
| 0
| 0.217949
| 0.141026
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e84a3efed6bfebb5457eeb1c5da27e827c05c035
| 73
|
py
|
Python
|
src/test.py
|
morrigan/user-behavior-anomaly-detector
|
2cca2b04429d14cde6cfc21eb31a73194ff680a4
|
[
"MIT"
] | 35
|
2017-11-01T09:47:43.000Z
|
2021-10-10T21:14:27.000Z
|
src/test.py
|
morrigan/user-behavior-anomaly-detector
|
2cca2b04429d14cde6cfc21eb31a73194ff680a4
|
[
"MIT"
] | 1
|
2020-05-19T08:03:25.000Z
|
2020-05-19T08:03:25.000Z
|
src/test.py
|
morrigan/user-behavior-anomaly-detector
|
2cca2b04429d14cde6cfc21eb31a73194ff680a4
|
[
"MIT"
] | 7
|
2017-07-23T15:12:10.000Z
|
2021-05-19T10:02:07.000Z
|
from lstm import LSTM
lstm = LSTM("settings.ini")
lstm.run_on_datasets()
| 18.25
| 27
| 0.767123
| 12
| 73
| 4.5
| 0.666667
| 0.296296
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109589
| 73
| 4
| 28
| 18.25
| 0.830769
| 0
| 0
| 0
| 0
| 0
| 0.162162
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 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
| 0
| 0
|
0
| 4
|
e8c5dc9fb49a4025f02b367a26470b3e76d78d50
| 76
|
py
|
Python
|
deliravision/torch/models/gans/energy_based/__init__.py
|
delira-dev/vision_torch
|
d944aa67d319bd63a2add5cb89e8308413943de6
|
[
"BSD-2-Clause"
] | 4
|
2019-08-03T09:56:50.000Z
|
2019-09-05T09:32:06.000Z
|
deliravision/torch/models/gans/energy_based/__init__.py
|
delira-dev/vision_torch
|
d944aa67d319bd63a2add5cb89e8308413943de6
|
[
"BSD-2-Clause"
] | 23
|
2019-08-03T14:16:47.000Z
|
2019-10-22T10:15:10.000Z
|
deliravision/torch/models/gans/energy_based/__init__.py
|
delira-dev/vision_torch
|
d944aa67d319bd63a2add5cb89e8308413943de6
|
[
"BSD-2-Clause"
] | null | null | null |
from deliravision.models.gans.energy_based.energy_gan import EnergyBasedGAN
| 38
| 75
| 0.894737
| 10
| 76
| 6.6
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 76
| 1
| 76
| 76
| 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
| 0
| 0
|
0
| 4
|
2cdcd92bbf9df0254d8a732e1a59fec957493bd6
| 54
|
py
|
Python
|
03 - Utilizing modules/Des_021.py
|
o-Ian/Practice-Python
|
1e4b2d0788e70006096a53a7cf038db3148ba4b7
|
[
"MIT"
] | 4
|
2021-04-23T18:07:58.000Z
|
2021-05-12T11:38:14.000Z
|
03 - Utilizing modules/Des_021.py
|
o-Ian/Practice-Python
|
1e4b2d0788e70006096a53a7cf038db3148ba4b7
|
[
"MIT"
] | null | null | null |
03 - Utilizing modules/Des_021.py
|
o-Ian/Practice-Python
|
1e4b2d0788e70006096a53a7cf038db3148ba4b7
|
[
"MIT"
] | null | null | null |
from playsound import playsound
playsound('creep.mp3')
| 27
| 31
| 0.833333
| 7
| 54
| 6.428571
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.074074
| 54
| 2
| 32
| 27
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0.163636
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
| 0
| 0
|
0
| 4
|
2ce0b3403d962d2b9b64057ddb05dc28323828d9
| 4,758
|
py
|
Python
|
test/test_interpreter.py
|
jerabaul29/fenics-calc
|
74c2dc85bf0752fd4944eb37ef8e43b86fbd769e
|
[
"MIT"
] | null | null | null |
test/test_interpreter.py
|
jerabaul29/fenics-calc
|
74c2dc85bf0752fd4944eb37ef8e43b86fbd769e
|
[
"MIT"
] | 1
|
2020-05-14T12:50:32.000Z
|
2020-05-14T12:50:55.000Z
|
test/test_interpreter.py
|
thw1021/fenics-calc
|
383bd21b8fa4478c39b66947609882becf3c1c5a
|
[
"MIT"
] | 1
|
2020-05-13T01:09:19.000Z
|
2020-05-13T01:09:19.000Z
|
from xcalc.interpreter import Eval
from dolfin import *
import unittest
def error(true, me):
mesh = me.function_space().mesh()
return sqrt(abs(assemble(inner(me - true, me - true)*dx(domain=mesh))))
class TestCases(unittest.TestCase):
'''UnitTest for (some of) xcalc.interpreter (no timeseries)'''
def test_sanity0(self):
mesh = UnitSquareMesh(4, 4)
V = FunctionSpace(mesh, 'CG', 1)
f = Expression('x[0]', degree=1)
g = Expression('x[1]', degree=1)
a = 3
b = -2
u = interpolate(f, V)
v = interpolate(g, V)
expr = a*u + b*v
me = Eval(expr)
true = Expression('a*f+b*g', f=f, g=g, a=a, b=b, degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity1(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'DG', 0)
u = interpolate(Expression((('x[0]', 'x[1]'),
('2*x[0]+x[1]', 'x[0]+3*x[1]')), degree=1), T)
expr = sym(u) + skew(u)
me = Eval(expr)
true = u
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity2(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('x[0]', 'x[1]'),
('2*x[0]+x[1]', 'x[0]+3*x[1]')), degree=1), T)
expr = tr(sym(A) + skew(A))
me = Eval(expr)
true = Expression('x[0] + x[0] + 3*x[1]', degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity3(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('x[0]', 'x[1]'),
('2*x[0]+x[1]', 'x[0]+3*x[1]')), degree=1), T)
expr = (sym(A) + skew(A))[0, 0]
me = Eval(expr)
true = Expression('x[0]', degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity4(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('x[0]', 'x[1]'),
('2*x[0]+x[1]', 'x[0]+3*x[1]')), degree=1), T)
expr = (sym(A) + skew(A))[:, 0]
me = Eval(expr)
true = Expression(('x[0]', '2*x[0]+x[1]'), degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity5(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('1', 'x[0]'),
('2', 'x[1]')), degree=1), T)
expr = det(A)
me = Eval(expr)
true = Expression('x[1]-2*x[0]', degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity6(self):
mesh = UnitCubeMesh(5, 5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('x[0]', '0', '1'),
('0', '1', 'x[1]'),
('x[2]', '0', '1')), degree=1), T)
expr = det(A)
me = Eval(expr)
true = Expression('x[0]-x[2]', degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity7(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('1', 'x[0]'),
('2', 'x[1]')), degree=1), T)
V = VectorFunctionSpace(mesh, 'CG', 1)
v = interpolate(Expression(('x[0]+x[1]', '1'), degree=1), V)
me = Eval(dot(A, v))
true = Expression(('x[1]+2*x[0]', '2*x[0]+3*x[1]'), degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity8(self):
mesh = UnitSquareMesh(5, 5)
T = TensorFunctionSpace(mesh, 'CG', 1)
A = interpolate(Expression((('1', 'x[0]'),
('2', 'x[1]')), degree=1), T)
V = VectorFunctionSpace(mesh, 'CG', 1)
v = interpolate(Expression(('x[0]+x[1]', '1'), degree=1), V)
me = Eval(dot(v, transpose(A)))
true = Expression(('x[1]+2*x[0]', '2*x[0]+3*x[1]'), degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
def test_sanity8(self):
mesh = UnitSquareMesh(5, 5)
V = VectorFunctionSpace(mesh, 'CG', 1)
v0 = interpolate(Expression(('x[0]+x[1]', '1'), degree=1), V)
v1 = interpolate(Expression(('1', 'x[0]'), degree=1), V)
me = Eval(inner(v0, v1))
true = Expression('x[1]+2*x[0]', degree=1)
e = error(true, me)
self.assertTrue(e < 1E-14)
| 29.552795
| 82
| 0.469315
| 648
| 4,758
| 3.429012
| 0.118827
| 0.029703
| 0.057606
| 0.048605
| 0.777228
| 0.727273
| 0.727273
| 0.727273
| 0.682718
| 0.669667
| 0
| 0.063803
| 0.334594
| 4,758
| 160
| 83
| 29.7375
| 0.638029
| 0.01177
| 0
| 0.584071
| 0
| 0
| 0.076759
| 0
| 0
| 0
| 0
| 0
| 0.088496
| 1
| 0.097345
| false
| 0
| 0.026549
| 0
| 0.141593
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 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
| 4
|
2cfdcfbfee24db292d9462aac0a1756e830d5336
| 1,605
|
py
|
Python
|
statistical_modeling/factories/variance.py
|
fedorpashin/statistical-modeling
|
2630e6811afca29cf8a616bab130ae7f9547a043
|
[
"MIT"
] | 2
|
2021-05-21T15:29:05.000Z
|
2021-08-11T14:08:31.000Z
|
statistical_modeling/factories/variance.py
|
fedorpashin/statistical-modeling
|
2630e6811afca29cf8a616bab130ae7f9547a043
|
[
"MIT"
] | 59
|
2021-08-11T14:08:36.000Z
|
2021-09-30T11:15:33.000Z
|
statistical_modeling/factories/variance.py
|
fedorpashin/statistical-modeling
|
2630e6811afca29cf8a616bab130ae7f9547a043
|
[
"MIT"
] | null | null | null |
from ..sample import AnySample, SampleVariance
from ..distributions import (
binomial,
chi_square,
continuous_uniform,
discrete_uniform,
exponential,
geometric,
logarithmic,
poisson,
standard_normal,
student,
)
from multimethod import multimeta
from final_class import final
__all__ = [
'Variance',
]
@final
class Variance(metaclass=multimeta):
def __new__(cls, sample: AnySample):
return SampleVariance(sample)
def __new__(cls, distribution: binomial.Distribution):
return binomial.Variance(distribution)
def __new__(cls, distribution: chi_square.Distribution):
return chi_square.Variance(distribution)
def __new__(cls, distribution: continuous_uniform.Distribution):
return continuous_uniform.Variance(distribution)
def __new__(cls, distribution: discrete_uniform.Distribution):
return discrete_uniform.Variance(distribution)
def __new__(cls, distribution: exponential.Distribution):
return exponential.Variance(distribution)
def __new__(cls, distribution: geometric.Distribution):
return geometric.Variance(distribution)
def __new__(cls, distribution: logarithmic.Distribution):
return logarithmic.Variance(distribution)
def __new__(cls, distribution: poisson.Distribution):
return poisson.Variance(distribution)
def __new__(cls, distribution: standard_normal.Distribution):
return standard_normal.Variance(distribution)
def __new__(cls, distribution: student.Distribution):
return student.Variance(distribution)
| 28.660714
| 68
| 0.74081
| 154
| 1,605
| 7.324675
| 0.201299
| 0.058511
| 0.087766
| 0.18617
| 0.339539
| 0.339539
| 0.085106
| 0
| 0
| 0
| 0
| 0
| 0.181308
| 1,605
| 55
| 69
| 29.181818
| 0.858447
| 0
| 0
| 0
| 0
| 0
| 0.004984
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.261905
| false
| 0
| 0.095238
| 0.261905
| 0.642857
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
fa1006b9241e40decca212d43fb7143139ecff46
| 114
|
py
|
Python
|
Practice/Python/Math/Find_Angle_MBC.py
|
alexanderbauer89/HackerRank
|
0fb6face083b0183692c9251ffe4bb635591393f
|
[
"MIT"
] | 1
|
2021-11-17T02:47:11.000Z
|
2021-11-17T02:47:11.000Z
|
Practice/Python/Math/Find_Angle_MBC.py
|
alexanderbauer89/HackerRank
|
0fb6face083b0183692c9251ffe4bb635591393f
|
[
"MIT"
] | null | null | null |
Practice/Python/Math/Find_Angle_MBC.py
|
alexanderbauer89/HackerRank
|
0fb6face083b0183692c9251ffe4bb635591393f
|
[
"MIT"
] | null | null | null |
import math
AB, BC = int(input()), int(input())
print(str(int(round(math.degrees(math.atan2(AB,BC)))))+chr(176))
| 28.5
| 64
| 0.666667
| 20
| 114
| 3.8
| 0.65
| 0.105263
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038095
| 0.078947
| 114
| 3
| 65
| 38
| 0.685714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fa16c45a8c6d88ff2c2d08b0196dbcfe5f31f3e1
| 587
|
py
|
Python
|
reggy/regularizers.py
|
kpj/regreg
|
30bfea9b282fea908ff9560affaa73339c8da045
|
[
"MIT"
] | 2
|
2022-01-20T00:29:42.000Z
|
2022-01-20T10:56:57.000Z
|
reggy/regularizers.py
|
kpj/reggy
|
30bfea9b282fea908ff9560affaa73339c8da045
|
[
"MIT"
] | null | null | null |
reggy/regularizers.py
|
kpj/reggy
|
30bfea9b282fea908ff9560affaa73339c8da045
|
[
"MIT"
] | null | null | null |
import tensorflow as tf
def ridge(alpha, beta, family):
return tf.reduce_sum(tf.square(beta))
def lasso(alpha, beta, family):
return tf.reduce_sum(tf.abs(beta))
def network_fusion_x(graph):
graph = tf.cast(graph, tf.float32)
def tmp(alpha, beta, family):
return tf.linalg.trace(tf.matmul(tf.transpose(beta), tf.matmul(graph, beta)))
return tmp
def network_fusion_y(graph):
graph = tf.cast(graph, tf.float32)
def tmp(alpha, beta, family):
return tf.linalg.trace(tf.matmul(beta, tf.matmul(graph, tf.transpose(beta))))
return tmp
| 20.964286
| 85
| 0.679727
| 90
| 587
| 4.366667
| 0.3
| 0.089059
| 0.152672
| 0.21374
| 0.569975
| 0.569975
| 0.569975
| 0.569975
| 0.396947
| 0.396947
| 0
| 0.008351
| 0.183986
| 587
| 27
| 86
| 21.740741
| 0.812109
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.066667
| 0.266667
| 0.866667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
fa227b5ce0eea1e78f971580d12ec681ff044864
| 1,196
|
py
|
Python
|
webstack/backend/app/app/api/api_v1/endpoints/modes.py
|
wifinigel/webstack
|
2539132815d6e842f537f03b40f98e40dd4184bd
|
[
"BSD-3-Clause"
] | null | null | null |
webstack/backend/app/app/api/api_v1/endpoints/modes.py
|
wifinigel/webstack
|
2539132815d6e842f537f03b40f98e40dd4184bd
|
[
"BSD-3-Clause"
] | null | null | null |
webstack/backend/app/app/api/api_v1/endpoints/modes.py
|
wifinigel/webstack
|
2539132815d6e842f537f03b40f98e40dd4184bd
|
[
"BSD-3-Clause"
] | null | null | null |
from fastapi import APIRouter
router = APIRouter()
@router.get("/")
def get_current_mode():
return "TBD"
@router.get("/wifi_console")
def switch_to_wifi_console_mode():
return "TBD"
@router.get("/hotspot")
def switch_to_hotspot_mode():
return "TBD"
@router.get("/wiperf")
def switch_to_wiperf_mode():
return "TBD"
@router.get("/server")
def switch_to_server_mode():
return "TBD"
@router.get("/beacon_collector/start")
def start_beacon_collector():
"""
The idea:
1. Enable the audit tool via the FPMS and walk around the area being audited.
2. WLAN Pi collects beacons
3. End audit collection via FPMS
4. WLAN Pi dumps a local file of unique beacons in a PCAP
5. File can be retrieved when return to base, and inspected in WFE or similar tool to report on networks detected in audit area.
"""
return "START COLLECTOR"
@router.get("/beacon_collector/stop")
def stop_beacon_collector():
"""
Stops the beacon collector and stores the data locally.
"""
@router.get("/beacon_collector/")
def list_beacon_collector_data():
pass
@router.get("/beacon_collector/:object")
def get_beacon_collector_data():
pass
| 19.933333
| 132
| 0.703177
| 172
| 1,196
| 4.715116
| 0.430233
| 0.099877
| 0.080148
| 0.117139
| 0.135635
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005139
| 0.186455
| 1,196
| 59
| 133
| 20.271186
| 0.828366
| 0.327759
| 0
| 0.25
| 0
| 0
| 0.204515
| 0.092961
| 0
| 0
| 0
| 0
| 0
| 1
| 0.321429
| false
| 0.071429
| 0.035714
| 0.178571
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
fa24bfde34c4e8783bc0095205fabd5697ca275f
| 242
|
py
|
Python
|
market/admin.py
|
zhanhailiu/Market
|
640975c2d83edcdc9ab6ab1723e4efaaec00904d
|
[
"MIT"
] | 39
|
2017-03-05T10:42:19.000Z
|
2021-09-22T04:00:51.000Z
|
market/admin.py
|
VNRKDOEA/flea_market
|
d4fa8a0834edc1f902632d8ac5c0316245e63d7c
|
[
"MIT"
] | 3
|
2018-03-24T11:13:09.000Z
|
2019-04-16T03:30:20.000Z
|
market/admin.py
|
VNRKDOEA/flea_market
|
d4fa8a0834edc1f902632d8ac5c0316245e63d7c
|
[
"MIT"
] | 14
|
2017-03-05T10:55:43.000Z
|
2019-04-27T10:47:36.000Z
|
from django.contrib import admin
from market.models import Category,Goods,UserProfile,Comment
# Register your models here.
admin.site.register(Category)
admin.site.register(Goods)
admin.site.register(UserProfile)
admin.site.register(Comment)
| 30.25
| 60
| 0.834711
| 33
| 242
| 6.121212
| 0.454545
| 0.178218
| 0.336634
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070248
| 242
| 8
| 61
| 30.25
| 0.897778
| 0.107438
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fa44d1bbabc706aee7b946669403d7587a367e3e
| 299
|
py
|
Python
|
manual/unico/src/script/is_enclosing_combining_unico.py
|
Tikubonn/unico
|
c76de5309f8a3a6fda3110e463b7e9718ea530e3
|
[
"MIT"
] | null | null | null |
manual/unico/src/script/is_enclosing_combining_unico.py
|
Tikubonn/unico
|
c76de5309f8a3a6fda3110e463b7e9718ea530e3
|
[
"MIT"
] | null | null | null |
manual/unico/src/script/is_enclosing_combining_unico.py
|
Tikubonn/unico
|
c76de5309f8a3a6fda3110e463b7e9718ea530e3
|
[
"MIT"
] | null | null | null |
import json
from lib.generator import predicate_function
with open("json/enclosing-combining.json", "r") as stream:
characters = json.load(stream)
with open("dist/is_enclosing_combining_unico.c", "w") as stream:
predicate_function.write("is_enclosing_combining_unico", characters, stream)
| 29.9
| 78
| 0.782609
| 41
| 299
| 5.512195
| 0.536585
| 0.238938
| 0.176991
| 0.221239
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107023
| 299
| 9
| 79
| 33.222222
| 0.846442
| 0
| 0
| 0
| 0
| 0
| 0.315436
| 0.308725
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d70ed12e60d0e9e1e30de3fc853ce3bbba91f7ef
| 30
|
py
|
Python
|
version.py
|
Jaybone25/OoT-Randomizer
|
151dea0df6472b03272611954e1b1c469ccf36d6
|
[
"MIT"
] | 1
|
2021-11-02T20:32:43.000Z
|
2021-11-02T20:32:43.000Z
|
version.py
|
Jaybone25/OoT-Randomizer
|
151dea0df6472b03272611954e1b1c469ccf36d6
|
[
"MIT"
] | null | null | null |
version.py
|
Jaybone25/OoT-Randomizer
|
151dea0df6472b03272611954e1b1c469ccf36d6
|
[
"MIT"
] | null | null | null |
__version__ = '6.0.127 f.LUM'
| 15
| 29
| 0.666667
| 6
| 30
| 2.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192308
| 0.133333
| 30
| 1
| 30
| 30
| 0.423077
| 0
| 0
| 0
| 0
| 0
| 0.433333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
d72bcba9f2b662516257decec968a53b52033642
| 95
|
py
|
Python
|
retrieval_rs/retrieval_rs/constants/__init__.py
|
microsoft/MRS
|
1213bf21b1f76d9822e0426dfd81222112a40e05
|
[
"MIT"
] | 2
|
2021-08-11T18:00:33.000Z
|
2021-09-04T09:38:05.000Z
|
retrieval_rs/retrieval_rs/constants/__init__.py
|
microsoft/MRS
|
1213bf21b1f76d9822e0426dfd81222112a40e05
|
[
"MIT"
] | null | null | null |
retrieval_rs/retrieval_rs/constants/__init__.py
|
microsoft/MRS
|
1213bf21b1f76d9822e0426dfd81222112a40e05
|
[
"MIT"
] | 1
|
2021-09-13T12:29:10.000Z
|
2021-09-13T12:29:10.000Z
|
"""
Empty files are not supported by Signed VSO Builds. Adding dummy file
@author: shagup
"""
| 15.833333
| 69
| 0.726316
| 14
| 95
| 4.928571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178947
| 95
| 5
| 70
| 19
| 0.884615
| 0.905263
| 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
| 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
| 4
|
d745019f78d3553fdaadc2936fe7b2e641833a0e
| 325
|
py
|
Python
|
src/tests/UtilTests.py
|
lookvc0001/voronoi_hsi
|
2dce4e67f020f5a85ed79c2cc52c596bca14a7bc
|
[
"BSD-3-Clause"
] | 25
|
2019-03-29T03:28:17.000Z
|
2022-02-10T03:56:49.000Z
|
src/tests/UtilTests.py
|
lookvc0001/voronoi_hsi
|
2dce4e67f020f5a85ed79c2cc52c596bca14a7bc
|
[
"BSD-3-Clause"
] | 1
|
2019-05-08T09:02:51.000Z
|
2020-06-17T14:49:14.000Z
|
src/tests/UtilTests.py
|
lookvc0001/voronoi_hsi
|
2dce4e67f020f5a85ed79c2cc52c596bca14a7bc
|
[
"BSD-3-Clause"
] | 5
|
2019-03-29T03:28:22.000Z
|
2021-09-28T07:54:08.000Z
|
import traceback
def error_str(func_name, exception):
return func_name + " failed with exception: " + str(exception) + "\n" + str(traceback.print_exc())
def print_dict(dictn):
for elem in dictn:
print(elem, repr(dictn[elem]))
def dump_attrs(obj):
for attr in dir(obj):
print("obj.%s" % attr)
| 21.666667
| 102
| 0.649231
| 47
| 325
| 4.361702
| 0.553191
| 0.078049
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.212308
| 325
| 15
| 103
| 21.666667
| 0.800781
| 0
| 0
| 0
| 0
| 0
| 0.09816
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.111111
| 0.111111
| 0.555556
| 0.444444
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
|
0
| 4
|
d74d78640930aad7af9e483edab5fa40789574d0
| 155
|
py
|
Python
|
aula10/ex030.py
|
avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1
|
f04a3b0bc360318b1420b23df3325908220773aa
|
[
"MIT"
] | null | null | null |
aula10/ex030.py
|
avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1
|
f04a3b0bc360318b1420b23df3325908220773aa
|
[
"MIT"
] | null | null | null |
aula10/ex030.py
|
avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1
|
f04a3b0bc360318b1420b23df3325908220773aa
|
[
"MIT"
] | null | null | null |
num = int(input('Insira um num inteiro: '))
if num % 2 == 0:
print('O numero {} é par'.format(num))
else:
print('O numero {} é impar'.format(num))
| 25.833333
| 44
| 0.593548
| 26
| 155
| 3.538462
| 0.653846
| 0.130435
| 0.26087
| 0.282609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01626
| 0.206452
| 155
| 5
| 45
| 31
| 0.731707
| 0
| 0
| 0
| 0
| 0
| 0.380645
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.4
| 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
| 0
| 0
| 0
| 0
|
0
| 4
|
d758aaa476728484775440d0ab369842870e344f
| 81
|
py
|
Python
|
uno/apps.py
|
busbauen/uno
|
98115603b45a2bc1506a800e337fe5aa4be7a38f
|
[
"MIT"
] | null | null | null |
uno/apps.py
|
busbauen/uno
|
98115603b45a2bc1506a800e337fe5aa4be7a38f
|
[
"MIT"
] | 5
|
2020-02-12T01:05:16.000Z
|
2022-02-11T03:40:49.000Z
|
uno/apps.py
|
kmille/uno
|
ce0c62beafb7bd11e8abbd27848161c0452b3923
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class UnoConfig(AppConfig):
name = 'uno'
| 13.5
| 33
| 0.728395
| 10
| 81
| 5.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.185185
| 81
| 5
| 34
| 16.2
| 0.893939
| 0
| 0
| 0
| 0
| 0
| 0.037037
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ad0fecca075a1497ebb1afb6a430a67eb75f7f66
| 2,954
|
py
|
Python
|
src/schedules/views.py
|
kucharzyk-sebastian/make-my-day
|
0fef6d1e2ef6d7a2d89e81880b5e44b2d5116c75
|
[
"MIT"
] | null | null | null |
src/schedules/views.py
|
kucharzyk-sebastian/make-my-day
|
0fef6d1e2ef6d7a2d89e81880b5e44b2d5116c75
|
[
"MIT"
] | null | null | null |
src/schedules/views.py
|
kucharzyk-sebastian/make-my-day
|
0fef6d1e2ef6d7a2d89e81880b5e44b2d5116c75
|
[
"MIT"
] | null | null | null |
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.shortcuts import get_object_or_404
from django.views.generic import CreateView, DeleteView, DetailView, ListView, UpdateView
from django.urls import reverse
from schedules.models import Schedule, ScheduleEntry
class IsOwnerMixin(UserPassesTestMixin):
def test_func(self):
return self.get_object().author == self.request.user
class ScheduleListView(LoginRequiredMixin, ListView):
model = Schedule
def get_queryset(self):
return self.model.objects.filter(author=self.request.user)
class ScheduleCreateView(LoginRequiredMixin, CreateView):
model = Schedule
fields = ('name', )
def form_valid(self, form):
form.instance.author = self.request.user
return super().form_valid(form)
def get_success_url(self):
return reverse('schedules:schedule_detail', args=[self.object.pk])
class ScheduleDetailView(LoginRequiredMixin, IsOwnerMixin, DetailView):
model = Schedule
class ScheduleUpdateView(LoginRequiredMixin, IsOwnerMixin, UpdateView):
model = Schedule
fields = ('name', )
def get_success_url(self):
return reverse('schedules:schedule_detail', args=[self.object.pk])
class ScheduleDeleteView(LoginRequiredMixin, IsOwnerMixin, DeleteView):
model = Schedule
success_url = '/'
def get_success_url(self):
return reverse('schedules:schedule_list')
class ScheduleEntryCreate(LoginRequiredMixin, UserPassesTestMixin, CreateView):
model = ScheduleEntry
fields = ('title', 'description', 'day', 'start_time', 'end_time')
def __init__(self):
self.schedule = None
super().__init__()
def test_func(self):
self.schedule = get_object_or_404(Schedule, pk=self.kwargs['schedule_id'])
return self.schedule.author == self.request.user
def form_valid(self, form):
form.instance.schedule = self.schedule
return super().form_valid(form)
def get_success_url(self):
return reverse('schedules:schedule_detail', args=[self.object.schedule.pk])
class ScheduleEntryDelete(LoginRequiredMixin, UserPassesTestMixin, DeleteView):
model = ScheduleEntry
def test_func(self):
schedule = get_object_or_404(Schedule, pk=self.kwargs['schedule_id'])
return schedule.author == self.request.user
def get_success_url(self):
return reverse('schedules:schedule_detail', args=[self.object.schedule.pk])
class ScheduleEntryUpdateView(LoginRequiredMixin, UserPassesTestMixin, UpdateView):
model = ScheduleEntry
fields = ('title', 'description', 'day', 'start_time', 'end_time')
def test_func(self):
schedule = get_object_or_404(Schedule, pk=self.kwargs['schedule_id'])
return schedule.author == self.request.user
def get_success_url(self):
return reverse('schedules:schedule_detail', args=[self.object.schedule.pk])
| 31.763441
| 89
| 0.72715
| 328
| 2,954
| 6.378049
| 0.213415
| 0.038241
| 0.048757
| 0.060229
| 0.516252
| 0.469407
| 0.455545
| 0.424952
| 0.424952
| 0.401052
| 0
| 0.004884
| 0.168246
| 2,954
| 92
| 90
| 32.108696
| 0.846561
| 0
| 0
| 0.57377
| 0
| 0
| 0.08937
| 0.050102
| 0
| 0
| 0
| 0
| 0
| 1
| 0.229508
| false
| 0.081967
| 0.081967
| 0.131148
| 0.885246
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
ad30b75c1b6649e7d21000c63f15b475b798857f
| 59
|
py
|
Python
|
main.py
|
Sigmanificient/Py-Tac-Toe
|
677c158f1ddcef2b8e21ed80732ae2d6c291e11b
|
[
"MIT"
] | 1
|
2021-11-08T11:18:40.000Z
|
2021-11-08T11:18:40.000Z
|
main.py
|
Sigmanificient/Py-Tac-Toe
|
677c158f1ddcef2b8e21ed80732ae2d6c291e11b
|
[
"MIT"
] | null | null | null |
main.py
|
Sigmanificient/Py-Tac-Toe
|
677c158f1ddcef2b8e21ed80732ae2d6c291e11b
|
[
"MIT"
] | 1
|
2021-07-02T22:30:47.000Z
|
2021-07-02T22:30:47.000Z
|
import app
if __name__ == '__main__':
app.game.main()
| 11.8
| 26
| 0.644068
| 8
| 59
| 3.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20339
| 59
| 4
| 27
| 14.75
| 0.638298
| 0
| 0
| 0
| 0
| 0
| 0.135593
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 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
| 0
| 0
|
0
| 4
|
ad3d39e0a9951b38619e91b0e473e0f111884974
| 203
|
py
|
Python
|
users/serializer.py
|
ChegeDaniella/awards
|
9b2bd27b089a87bbd7595b51395fdc7cfedda349
|
[
"MIT"
] | null | null | null |
users/serializer.py
|
ChegeDaniella/awards
|
9b2bd27b089a87bbd7595b51395fdc7cfedda349
|
[
"MIT"
] | 4
|
2021-03-30T13:32:53.000Z
|
2021-09-08T02:08:19.000Z
|
users/serializer.py
|
ChegeDaniella/awards
|
9b2bd27b089a87bbd7595b51395fdc7cfedda349
|
[
"MIT"
] | null | null | null |
from rest_framework import serializers
from .models import Profile
class ProfileSerializers(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ('user','avatar','Bio')
| 29
| 54
| 0.724138
| 21
| 203
| 6.952381
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.187192
| 203
| 7
| 55
| 29
| 0.884848
| 0
| 0
| 0
| 0
| 0
| 0.063725
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ad6545049646545c43a722b7b1735fd2aedca48b
| 396
|
py
|
Python
|
pathtests/admin.py
|
SACGF/variantgrid
|
515195e2f03a0da3a3e5f2919d8e0431babfd9c9
|
[
"RSA-MD"
] | 5
|
2021-01-14T03:34:42.000Z
|
2022-03-07T15:34:18.000Z
|
pathtests/admin.py
|
SACGF/variantgrid
|
515195e2f03a0da3a3e5f2919d8e0431babfd9c9
|
[
"RSA-MD"
] | 551
|
2020-10-19T00:02:38.000Z
|
2022-03-30T02:18:22.000Z
|
pathtests/admin.py
|
SACGF/variantgrid
|
515195e2f03a0da3a3e5f2919d8e0431babfd9c9
|
[
"RSA-MD"
] | null | null | null |
from django.contrib import admin
from pathtests import models
#admin.site.register(models.Case)
#admin.site.register(models.CaseClinician)
#admin.site.register(models.FollowLeadScientist)
admin.site.register(models.PathologyTest)
admin.site.register(models.PathologyTestVersion)
admin.site.register(models.PathologyTestSynonyms)
admin.site.register(models.PathologyTestGeneModificationRequest)
| 33
| 64
| 0.858586
| 44
| 396
| 7.727273
| 0.363636
| 0.185294
| 0.35
| 0.473529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042929
| 396
| 11
| 65
| 36
| 0.897098
| 0.30303
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 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
| 0
| 0
|
0
| 4
|
ad7a77cbf8f3d56b8139c60e2a1f39b534229ae2
| 76
|
py
|
Python
|
configs/mmedit/super-resolution/super-resolution_ncnn_dynamic.py
|
aegis-rider/mmdeploy
|
230596bad92fafadb36cf0a69c57d80522cc7c60
|
[
"Apache-2.0"
] | 746
|
2021-12-27T10:50:28.000Z
|
2022-03-31T13:34:14.000Z
|
configs/mmedit/super-resolution/super-resolution_ncnn_dynamic.py
|
aegis-rider/mmdeploy
|
230596bad92fafadb36cf0a69c57d80522cc7c60
|
[
"Apache-2.0"
] | 253
|
2021-12-28T05:59:13.000Z
|
2022-03-31T18:22:25.000Z
|
configs/mmedit/super-resolution/super-resolution_ncnn_dynamic.py
|
aegis-rider/mmdeploy
|
230596bad92fafadb36cf0a69c57d80522cc7c60
|
[
"Apache-2.0"
] | 147
|
2021-12-27T10:50:33.000Z
|
2022-03-30T10:44:20.000Z
|
_base_ = ['./super-resolution_dynamic.py', '../../_base_/backends/ncnn.py']
| 38
| 75
| 0.671053
| 9
| 76
| 5.111111
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 76
| 1
| 76
| 76
| 0.638889
| 0
| 0
| 0
| 0
| 0
| 0.763158
| 0.763158
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ad85f7f98036c8faae73cfde551a2725e6a4bbe6
| 131
|
py
|
Python
|
terra/__init__.py
|
NoahRJohnson/terra
|
131954ee42fb5905ceff35101e34d89c5eb6de6c
|
[
"MIT"
] | null | null | null |
terra/__init__.py
|
NoahRJohnson/terra
|
131954ee42fb5905ceff35101e34d89c5eb6de6c
|
[
"MIT"
] | null | null | null |
terra/__init__.py
|
NoahRJohnson/terra
|
131954ee42fb5905ceff35101e34d89c5eb6de6c
|
[
"MIT"
] | null | null | null |
from terra.core.settings import settings
try:
from . import _terra
except ImportError:
pass
__all__ = ['settings', '_terra']
| 14.555556
| 40
| 0.732824
| 16
| 131
| 5.625
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.167939
| 131
| 8
| 41
| 16.375
| 0.825688
| 0
| 0
| 0
| 0
| 0
| 0.10687
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.166667
| 0.5
| 0
| 0.5
| 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
| 0
| 0
|
0
| 4
|
ad8e1de01fa723f44dc166803342e8849b2d81ae
| 123
|
py
|
Python
|
run.py
|
xstsp/bio-query-expansion
|
b6cc9f404b7d554ef55ba8f0728c129ca5396a11
|
[
"MIT"
] | 4
|
2018-02-27T06:49:35.000Z
|
2019-05-07T09:01:31.000Z
|
run.py
|
xstsp/bio-query-expansion
|
b6cc9f404b7d554ef55ba8f0728c129ca5396a11
|
[
"MIT"
] | null | null | null |
run.py
|
xstsp/bio-query-expansion
|
b6cc9f404b7d554ef55ba8f0728c129ca5396a11
|
[
"MIT"
] | 1
|
2021-07-22T02:16:44.000Z
|
2021-07-22T02:16:44.000Z
|
from api import app as application
if __name__ == '__main__':
application.run(host='0.0.0.0', port=777, debug=True)
| 30.75
| 57
| 0.691057
| 20
| 123
| 3.85
| 0.8
| 0.077922
| 0.077922
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067961
| 0.162602
| 123
| 4
| 57
| 30.75
| 0.679612
| 0
| 0
| 0
| 0
| 0
| 0.123967
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 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
| 0
| 0
|
0
| 4
|
ad981c50ee9e91ad87153a09aba59d64034e42c1
| 65
|
py
|
Python
|
src/dbspy/core/__init__.py
|
ZhengKeli/PositronSpector
|
be0281fe50fe634183b6f239f03b7140c1dc0b7f
|
[
"MIT"
] | 1
|
2019-06-18T09:23:42.000Z
|
2019-06-18T09:23:42.000Z
|
src/dbspy/core/__init__.py
|
ZhengKeli/DBSpy
|
be0281fe50fe634183b6f239f03b7140c1dc0b7f
|
[
"MIT"
] | null | null | null |
src/dbspy/core/__init__.py
|
ZhengKeli/DBSpy
|
be0281fe50fe634183b6f239f03b7140c1dc0b7f
|
[
"MIT"
] | null | null | null |
from . import spectrum, analyze
from ._main import Conf, Process
| 21.666667
| 32
| 0.784615
| 9
| 65
| 5.555556
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 65
| 2
| 33
| 32.5
| 0.909091
| 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
| 0
| 0
|
0
| 4
|
d12a87c61141e317a890972efe02ec75c41f2867
| 350
|
py
|
Python
|
entry/tests/custom_view/views/entity_has_list_without_context.py
|
userlocalhost/airone-1
|
8aabeabb65fd2117876380f1f69a04f0cf39889d
|
[
"MIT"
] | null | null | null |
entry/tests/custom_view/views/entity_has_list_without_context.py
|
userlocalhost/airone-1
|
8aabeabb65fd2117876380f1f69a04f0cf39889d
|
[
"MIT"
] | null | null | null |
entry/tests/custom_view/views/entity_has_list_without_context.py
|
userlocalhost/airone-1
|
8aabeabb65fd2117876380f1f69a04f0cf39889d
|
[
"MIT"
] | null | null | null |
from airone.lib.http import render
from django.http import HttpResponse
def list_entry_without_context(request, entity):
return HttpResponse("return no data") if request.GET.get("return_resp", None) else None
def list_entry(request, entity, context):
return render(request, "list_entry.html", dict(context, **{"test_key": "test_value"}))
| 31.818182
| 91
| 0.76
| 50
| 350
| 5.16
| 0.56
| 0.104651
| 0.093023
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 350
| 10
| 92
| 35
| 0.837662
| 0
| 0
| 0
| 0
| 0
| 0.165714
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
d13462c8afa614c79a9ba84f76853fd6dca4abb9
| 122
|
py
|
Python
|
storm/internal_types/asgi/connection_properties.py
|
Rud356/Storm
|
18f8b7ac89babf9252da28c39c2cc84087f2afaf
|
[
"Apache-2.0"
] | 1
|
2022-03-18T18:14:34.000Z
|
2022-03-18T18:14:34.000Z
|
storm/internal_types/asgi/connection_properties.py
|
Rud356/Storm
|
18f8b7ac89babf9252da28c39c2cc84087f2afaf
|
[
"Apache-2.0"
] | 1
|
2021-12-23T19:39:27.000Z
|
2021-12-23T19:39:27.000Z
|
storm/internal_types/asgi/connection_properties.py
|
Rud356/Storm
|
18f8b7ac89babf9252da28c39c2cc84087f2afaf
|
[
"Apache-2.0"
] | null | null | null |
from typing import NamedTuple, Optional
class ConnectionProperties(NamedTuple):
origin: str
port: Optional[int]
| 17.428571
| 39
| 0.762295
| 13
| 122
| 7.153846
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172131
| 122
| 6
| 40
| 20.333333
| 0.920792
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.25
| 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
| 0
| 0
| 1
| 0
|
0
| 4
|
d135a79e618fb81c14b58575e623181b2c24f2c3
| 69
|
py
|
Python
|
tests/test_diff.py
|
kentik/nomad-diff
|
2d9828f189d7e7e77376dd90fe2aa0b90f8a742b
|
[
"Apache-2.0"
] | 1
|
2022-02-21T22:02:45.000Z
|
2022-02-21T22:02:45.000Z
|
tests/test_diff.py
|
kentik/nomad-diff
|
2d9828f189d7e7e77376dd90fe2aa0b90f8a742b
|
[
"Apache-2.0"
] | null | null | null |
tests/test_diff.py
|
kentik/nomad-diff
|
2d9828f189d7e7e77376dd90fe2aa0b90f8a742b
|
[
"Apache-2.0"
] | null | null | null |
class TestBase(object):
def test_base(self):
assert True
| 17.25
| 24
| 0.652174
| 9
| 69
| 4.888889
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.26087
| 69
| 3
| 25
| 23
| 0.862745
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| false
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
d15c37ca93f97d5b83ec5281b7e86a4201f236fc
| 69
|
py
|
Python
|
wsgi.py
|
LupusInFabula/api-reflector
|
35eb0be23c1cce27531ca7ce396405694faa9ba6
|
[
"MIT"
] | 4
|
2021-09-24T13:58:37.000Z
|
2022-03-01T22:19:41.000Z
|
wsgi.py
|
LupusInFabula/api-reflector
|
35eb0be23c1cce27531ca7ce396405694faa9ba6
|
[
"MIT"
] | 10
|
2021-09-21T16:28:06.000Z
|
2022-03-25T16:48:36.000Z
|
wsgi.py
|
LupusInFabula/api-reflector
|
35eb0be23c1cce27531ca7ce396405694faa9ba6
|
[
"MIT"
] | 2
|
2021-09-13T13:00:33.000Z
|
2022-02-24T14:55:46.000Z
|
from api_reflector.api import create_app
application = create_app()
| 17.25
| 40
| 0.826087
| 10
| 69
| 5.4
| 0.7
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115942
| 69
| 3
| 41
| 23
| 0.885246
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d1629b6ccfe483a39c36f06f837421e5ce5f11c4
| 98
|
py
|
Python
|
python/testData/codeInsight/runLineMarker/not_runnable.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/codeInsight/runLineMarker/not_runnable.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/codeInsight/runLineMarker/not_runnable.py
|
truthiswill/intellij-community
|
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
def f():
def g():
pass
if __name__ == '__main__':
g()
print(1)
f()
| 8.909091
| 30
| 0.387755
| 12
| 98
| 2.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018182
| 0.438776
| 98
| 10
| 31
| 9.8
| 0.527273
| 0
| 0
| 0
| 0
| 0
| 0.081633
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| true
| 0.142857
| 0
| 0
| 0.285714
| 0.142857
| 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
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
0f313b04c062ea8e622fb2fb6cf39a8a9910f51a
| 544
|
py
|
Python
|
lib/systems/acetaldehyde.py
|
pulsar-chem/BPModule
|
f8e64e04fdb01947708f098e833600c459c2ff0e
|
[
"BSD-3-Clause"
] | null | null | null |
lib/systems/acetaldehyde.py
|
pulsar-chem/BPModule
|
f8e64e04fdb01947708f098e833600c459c2ff0e
|
[
"BSD-3-Clause"
] | null | null | null |
lib/systems/acetaldehyde.py
|
pulsar-chem/BPModule
|
f8e64e04fdb01947708f098e833600c459c2ff0e
|
[
"BSD-3-Clause"
] | null | null | null |
import pulsar as psr
def load_ref_system():
""" Returns acetaldehyde as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
H 1.8870 -0.2640 0.6645
C 1.2203 -0.2396 -0.2074
H 1.4534 0.6668 -0.7811
H 1.4662 -1.1053 -0.8363
C -0.2092 -0.3158 0.2358
H -0.5002 -1.2065 0.8165
O -1.0303 0.5372 -0.0127
""")
| 36.266667
| 68
| 0.472426
| 78
| 544
| 3.25641
| 0.653846
| 0.023622
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 0.420956
| 544
| 14
| 69
| 38.857143
| 0.473016
| 0.200368
| 0
| 0
| 0
| 0
| 0.79759
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.090909
| true
| 0
| 0.090909
| 0
| 0.272727
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0f5449fcfbe687f3ca69911a33dd200a433777e1
| 3,968
|
py
|
Python
|
FSPSFiles.py
|
AlexaVillaume/FSPS
|
2799ff00054c0ee2abb3d9799c2c644187345f43
|
[
"MIT"
] | 1
|
2017-09-03T04:01:32.000Z
|
2017-09-03T04:01:32.000Z
|
FSPSFiles.py
|
AlexaVillaume/FSPS
|
2799ff00054c0ee2abb3d9799c2c644187345f43
|
[
"MIT"
] | null | null | null |
FSPSFiles.py
|
AlexaVillaume/FSPS
|
2799ff00054c0ee2abb3d9799c2c644187345f43
|
[
"MIT"
] | null | null | null |
import os
'''
Read an FSPS spec file
'''
class specmodel(object):
def __init__(self, attr, wave, flux):
self.agegyr = round(10**attr[0] / 1e9, 3)
self.mass = attr[1]
self.lbol = attr[2]
self.sfr = attr[3]
self.wave = wave
self.flux = flux
class readspec(object):
def __init__(self, fname):
self.data = open(fname, "r")
# Burn header
while True:
line = self.data.readline()
if line[0] != '#':
break
cols = line.split()
self.tstep = float(cols[0])
self.sdim = float(cols[1])
# Get wavelength
line = self.data.readline()
cols = line.split()
self.wave = map(lambda col: float(col)*1e-4, cols)
def next(self):
line = self.data.readline()
if line == "":
self.data.close()
raise StopIteration()
cols = line.split()
attr = map(lambda col: float(col), cols)
line = self.data.readline()
cols = line.split()
flux = map(lambda col: float(col), cols)
return specmodel(attr, self.wave, flux)
def __iter__(self):
return self
'''
For FSPS .cmd files
'''
class readcmd:
def __init__(self, fname):
self.data = open(fname, 'r')
# Read header to find the columns in the file
while True:
line = self.data.readline()
line = line.lstrip()
if line[0] == '#':
header = line.replace('#', '')
header = header.replace('mags', '')
header = header.split()
break
self.header = header
def next(self):
line = self.data.readline()
if line == "":
self.data.close()
raise StopIteration()
# Read in and assign the attributes of the models
cols = line.split()
for i, name in enumerate(self.header):
self.__dict__[name] = float(cols[i])
# Update the attributes with filter names and values
with open('/Users/alexawork/FSPS_python/filters.txt', 'r') as names:
for i, _filter in enumerate(names):
_filter = _filter.rstrip()
#print _filter, cols[i + len(self.header)]
self.__dict__.update({_filter:float(cols[i + len(self.header)])})
return self.__dict__.copy()
def __iter__(self):
return self
'''
For FSPS .mags files
'''
class readmags:
def __init__(self, fname):
self.data = open(fname, 'r')
# Read header to find the columns in the file
line_count = 0
while True:
if line_count < 7:
self.data.readline()
else:
line = self.data.readline()
line = line.lstrip()
if line[0] == '#':
header = line.replace('#', '')
header = header.replace('mags', '')
header = header.replace('(see FILTER_LIST)', '')
header = header.split()
break
line_count+=1
self.header = header
def next(self):
line = self.data.readline()
if line == "":
self.data.close()
raise StopIteration()
# Read in and assign the attributes of the models
cols = line.split()
for i, name in enumerate(self.header):
self.__dict__[name] = float(cols[i])
# Update the attributes with filter names and values
with open('/Users/alexawork/FSPS_python/filters.txt', 'r') as names:
for i, _filter in enumerate(names):
_filter = _filter.rstrip()
#print _filter, cols[i + len(self.header)]
self.__dict__.update({_filter:float(cols[i + len(self.header)])})
return self.__dict__.copy()
def __iter__(self):
return self
| 29.176471
| 81
| 0.517641
| 453
| 3,968
| 4.384106
| 0.220751
| 0.060423
| 0.066465
| 0.080564
| 0.759819
| 0.749748
| 0.703424
| 0.652568
| 0.652568
| 0.635448
| 0
| 0.007483
| 0.360131
| 3,968
| 135
| 82
| 29.392593
| 0.774714
| 0.099798
| 0
| 0.726316
| 0
| 0
| 0.033094
| 0.023022
| 0
| 0
| 0
| 0
| 0
| 1
| 0.105263
| false
| 0
| 0.010526
| 0.031579
| 0.221053
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0f56b680b0b227dca957901f7ef6add9c744cd20
| 787
|
py
|
Python
|
Algorithms_easy/1025. Divisor Game.py
|
VinceW0/Leetcode_Python_solutions
|
09e9720afce21632372431606ebec4129eb79734
|
[
"Xnet",
"X11"
] | 4
|
2020-08-11T20:45:15.000Z
|
2021-03-12T00:33:34.000Z
|
Algorithms_easy/1025. Divisor Game.py
|
VinceW0/Leetcode_Python_solutions
|
09e9720afce21632372431606ebec4129eb79734
|
[
"Xnet",
"X11"
] | null | null | null |
Algorithms_easy/1025. Divisor Game.py
|
VinceW0/Leetcode_Python_solutions
|
09e9720afce21632372431606ebec4129eb79734
|
[
"Xnet",
"X11"
] | null | null | null |
"""
1025. Divisor Game
Easy
Alice and Bob take turns playing a game, with Alice starting first.
Initially, there is a number N on the chalkboard. On each player's turn, that player makes a move consisting of:
Choosing any x with 0 < x < N and N % x == 0.
Replacing the number N on the chalkboard with N - x.
Also, if a player cannot make a move, they lose the game.
Return True if and only if Alice wins the game, assuming both players play optimally.
Example 1:
Input: 2
Output: true
Explanation: Alice chooses 1, and Bob has no more moves.
Example 2:
Input: 3
Output: false
Explanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves.
Note:
1 <= N <= 1000
"""
class Solution:
def divisorGame(self, N: int) -> bool:
return N % 2 == 0
| 19.675
| 113
| 0.693774
| 136
| 787
| 4.014706
| 0.536765
| 0.043956
| 0.032967
| 0.043956
| 0.080586
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033223
| 0.23507
| 787
| 40
| 114
| 19.675
| 0.873754
| 0.865311
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
0f6fe4f26947e3846b4dd4a55de49799a5654968
| 95
|
py
|
Python
|
file_sort/FileSortException.py
|
Aalmann/FileSort
|
e66b734194271e922086d3da188257204eb52ebc
|
[
"MIT"
] | null | null | null |
file_sort/FileSortException.py
|
Aalmann/FileSort
|
e66b734194271e922086d3da188257204eb52ebc
|
[
"MIT"
] | null | null | null |
file_sort/FileSortException.py
|
Aalmann/FileSort
|
e66b734194271e922086d3da188257204eb52ebc
|
[
"MIT"
] | null | null | null |
'''
Created on 05.03.2018
@author: Alex
'''
class ImageSorterException(Exception):
pass
| 9.5
| 38
| 0.684211
| 11
| 95
| 5.909091
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102564
| 0.178947
| 95
| 9
| 39
| 10.555556
| 0.730769
| 0.378947
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
0f72540d60d7c0920f7e518fb6478df827bf4ffe
| 47
|
py
|
Python
|
spdyn_update/consts.py
|
johnathanvidu/spdyn-update
|
e212f8536924118a61b64e4ba52013bd8ee490f8
|
[
"MIT"
] | null | null | null |
spdyn_update/consts.py
|
johnathanvidu/spdyn-update
|
e212f8536924118a61b64e4ba52013bd8ee490f8
|
[
"MIT"
] | 1
|
2021-04-06T10:46:01.000Z
|
2021-04-06T10:47:46.000Z
|
spdyn_update/consts.py
|
johnathanvidu/spdyn-update
|
e212f8536924118a61b64e4ba52013bd8ee490f8
|
[
"MIT"
] | null | null | null |
SPDYN_FOLDER = r'%LOCALAPPDATA%\spdyn-update'
| 23.5
| 46
| 0.765957
| 6
| 47
| 5.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 47
| 1
| 47
| 47
| 0.813953
| 0
| 0
| 0
| 0
| 0
| 0.586957
| 0.586957
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0f7d521ca47081b3eb50d35f381bef52f1b9b572
| 83
|
py
|
Python
|
tests/basic/for_range2.py
|
MoonStarCZW/py2rb
|
89b247717d33d780fbf143e1583bfe9252984da4
|
[
"MIT"
] | 124
|
2017-08-19T05:37:16.000Z
|
2022-03-08T18:24:18.000Z
|
tests/basic/for_range2.py
|
MoonStarCZW/py2rb
|
89b247717d33d780fbf143e1583bfe9252984da4
|
[
"MIT"
] | 15
|
2017-12-16T05:59:31.000Z
|
2022-02-08T02:51:17.000Z
|
tests/basic/for_range2.py
|
MoonStarCZW/py2rb
|
89b247717d33d780fbf143e1583bfe9252984da4
|
[
"MIT"
] | 18
|
2017-09-25T11:57:04.000Z
|
2022-02-19T17:33:48.000Z
|
for i in range(5):
for j in range(i+1, 5):
print("i:%s, j:%s" % (i,j))
| 20.75
| 35
| 0.445783
| 19
| 83
| 1.947368
| 0.473684
| 0.378378
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.051724
| 0.301205
| 83
| 3
| 36
| 27.666667
| 0.586207
| 0
| 0
| 0
| 0
| 0
| 0.120482
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 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
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7e344839dee1e7c94a365b3f7569d75707c40679
| 140
|
py
|
Python
|
hackassembler/helpers.py
|
ZaiusDR/hack_assembler
|
553e576c148815e5551ab05a59456824820f69f5
|
[
"MIT"
] | null | null | null |
hackassembler/helpers.py
|
ZaiusDR/hack_assembler
|
553e576c148815e5551ab05a59456824820f69f5
|
[
"MIT"
] | null | null | null |
hackassembler/helpers.py
|
ZaiusDR/hack_assembler
|
553e576c148815e5551ab05a59456824820f69f5
|
[
"MIT"
] | null | null | null |
def symbol_to_binary(number, bits):
binary = '{0:b}'.format(int(number))
return '{0}{1}'.format('0' * (bits - len(binary)), binary)
| 35
| 62
| 0.614286
| 21
| 140
| 4
| 0.619048
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033613
| 0.15
| 140
| 3
| 63
| 46.666667
| 0.672269
| 0
| 0
| 0
| 0
| 0
| 0.085714
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
7e34ec561c4b30254110a22eece3391805a5024b
| 277
|
py
|
Python
|
02. Identify numerical and categorial data/categorial_trait.py
|
SausanCantik/descriptive-stats-phenotype-data
|
04aab439530013b78cdf8f850d2f1c06fa73cbd7
|
[
"MIT"
] | null | null | null |
02. Identify numerical and categorial data/categorial_trait.py
|
SausanCantik/descriptive-stats-phenotype-data
|
04aab439530013b78cdf8f850d2f1c06fa73cbd7
|
[
"MIT"
] | null | null | null |
02. Identify numerical and categorial data/categorial_trait.py
|
SausanCantik/descriptive-stats-phenotype-data
|
04aab439530013b78cdf8f850d2f1c06fa73cbd7
|
[
"MIT"
] | null | null | null |
#A function to show the list of trait with categorial data
def categorial_trait(dataframe):
numeric, categorial = classifying_column(dataframe)
print('Traits with categorial data : ','\n',categorial, '\n')
print('Total count : ' ,len(categorial) , 'Traits')
| 39.571429
| 66
| 0.700361
| 34
| 277
| 5.647059
| 0.647059
| 0.145833
| 0.1875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180505
| 277
| 6
| 67
| 46.166667
| 0.845815
| 0.205776
| 0
| 0
| 0
| 0
| 0.253521
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.25
| 0.5
| 0
| 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
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7e61708e8c6ee0c548f0cb6d5cd37c037e9b11d5
| 119
|
py
|
Python
|
exec.py
|
hosiet/ustcbbs-archiver
|
432ced4c5ede704f425368f4d298db6a2dc0dfc1
|
[
"MIT"
] | 1
|
2017-07-03T02:55:56.000Z
|
2017-07-03T02:55:56.000Z
|
exec.py
|
hosiet/ustcbbs-archiver
|
432ced4c5ede704f425368f4d298db6a2dc0dfc1
|
[
"MIT"
] | null | null | null |
exec.py
|
hosiet/ustcbbs-archiver
|
432ced4c5ede704f425368f4d298db6a2dc0dfc1
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# 作者:hosiet
import os
import sys
import sqlite3
import config
import requests
import urllib
| 9.153846
| 22
| 0.773109
| 18
| 119
| 5.111111
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020202
| 0.168067
| 119
| 12
| 23
| 9.916667
| 0.909091
| 0.260504
| 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
| 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
| 4
|
7e652109442cc4d4fc0dd66cfcaf13c34b90dc5a
| 1,438
|
py
|
Python
|
models/user.py
|
BernarBerdikul/Auth_sprint_2
|
9286803f7e073456b2f02f2072072773331b9e5b
|
[
"BSD-3-Clause"
] | null | null | null |
models/user.py
|
BernarBerdikul/Auth_sprint_2
|
9286803f7e073456b2f02f2072072773331b9e5b
|
[
"BSD-3-Clause"
] | null | null | null |
models/user.py
|
BernarBerdikul/Auth_sprint_2
|
9286803f7e073456b2f02f2072072773331b9e5b
|
[
"BSD-3-Clause"
] | null | null | null |
from werkzeug.security import check_password_hash, generate_password_hash
from db import db
from models.mixins import CreatedUpgradeTimeMixin
from utils import constants
from utils.validators import password_validation
class User(CreatedUpgradeTimeMixin):
"""
username:
псевдоним для пользователя. Должен быть определен для всех пользователей и
обязательно должен быть уникальным.
email:
адрес электронной почты пользователя. Этот столбец не является обязательным.
"""
__tablename__ = "user"
username = db.Column(
db.String(length=constants.USERNAME_MAX_LENGTH), nullable=False, unique=True
)
password = db.Column(db.String(length=256), nullable=False)
email = db.Column(
db.String(length=constants.EMAIL_MAX_LENGTH), nullable=False, unique=True
)
def __repr__(self) -> str:
return f"<Username: {self.username}>"
@classmethod
def find_by_email(cls, email: str):
return cls.query.filter_by(email=email).first()
@classmethod
def find_by_username(cls, username: str):
return cls.query.filter_by(username=username).first()
def set_password(self, password: str):
password: str = password_validation(value=password)
self.password = generate_password_hash(password=password)
def check_password(self, password):
return check_password_hash(pwhash=self.password, password=password)
| 31.955556
| 84
| 0.722531
| 170
| 1,438
| 5.935294
| 0.382353
| 0.047572
| 0.029732
| 0.047572
| 0.196234
| 0.17443
| 0
| 0
| 0
| 0
| 0
| 0.00258
| 0.191238
| 1,438
| 44
| 85
| 32.681818
| 0.865004
| 0.150209
| 0
| 0.074074
| 1
| 0
| 0.02605
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.185185
| false
| 0.296296
| 0.185185
| 0.148148
| 0.703704
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
7e8585f083367bf55a2261974f3a259fa6d27e3a
| 45
|
py
|
Python
|
xt/model/dqn/default_config.py
|
ZZHsunsky/xingtian
|
0484e2c968d9e6b2e5f43a3b86c0213a095ba309
|
[
"MIT"
] | 1
|
2020-08-15T15:42:30.000Z
|
2020-08-15T15:42:30.000Z
|
xt/model/dqn/default_config.py
|
ZZHsunsky/xingtian
|
0484e2c968d9e6b2e5f43a3b86c0213a095ba309
|
[
"MIT"
] | 3
|
2021-03-31T20:15:40.000Z
|
2022-02-09T23:50:46.000Z
|
built-in/TensorFlow/Research/reinforcement-learning/ModelZoo_PPO_TensorFlow/rl/xt/model/dqn/default_config.py
|
Huawei-Ascend/modelzoo
|
df51ed9c1d6dbde1deef63f2a037a369f8554406
|
[
"Apache-2.0"
] | null | null | null |
HIDDEN_SIZE = 128
NUM_LAYERS = 1
LR = 0.0003
| 11.25
| 17
| 0.711111
| 9
| 45
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 0.2
| 45
| 3
| 18
| 15
| 0.583333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7e91b67940d28cc34a49ff412cf1b3585ae89aaa
| 226
|
py
|
Python
|
funsor/compat/ops.py
|
fritzo/funsor
|
1d07af18c21894dd56e2f4f877c7845430c3b729
|
[
"Apache-2.0"
] | 198
|
2019-02-04T19:13:14.000Z
|
2022-03-26T18:33:47.000Z
|
funsor/compat/ops.py
|
fritzo/funsor
|
1d07af18c21894dd56e2f4f877c7845430c3b729
|
[
"Apache-2.0"
] | 334
|
2019-02-14T19:33:32.000Z
|
2022-03-18T00:55:40.000Z
|
funsor/compat/ops.py
|
fritzo/funsor
|
1d07af18c21894dd56e2f4f877c7845430c3b729
|
[
"Apache-2.0"
] | 19
|
2019-05-18T01:58:10.000Z
|
2022-03-04T16:40:00.000Z
|
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from torch import ones, randn, tensor, zeros # noqa F401
from funsor.testing import allclose # noqa F401
from .ops import * # noqa F401
| 25.111111
| 57
| 0.747788
| 33
| 226
| 5.121212
| 0.757576
| 0.142012
| 0.142012
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05914
| 0.176991
| 226
| 8
| 58
| 28.25
| 0.849462
| 0.482301
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
7eb1b4fe4c8e011b71536fbbf7adb44d66522a89
| 114
|
py
|
Python
|
tests/__init__.py
|
gnagel/flake8-datetime-utcnow-plugin
|
da9250ebc56389aa164a63b7d17affc338bb97a9
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
gnagel/flake8-datetime-utcnow-plugin
|
da9250ebc56389aa164a63b7d17affc338bb97a9
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
gnagel/flake8-datetime-utcnow-plugin
|
da9250ebc56389aa164a63b7d17affc338bb97a9
|
[
"MIT"
] | null | null | null |
from pathlib import Path
import os
import sys
sys.path.append((Path(__file__).parent / ".." / "src").as_posix())
| 19
| 66
| 0.701754
| 17
| 114
| 4.411765
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122807
| 114
| 5
| 67
| 22.8
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.04386
| 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
| 0
| 0
|
0
| 4
|
0e1fdbd09a655e89fb62fade8eafbc5dcd405922
| 32,780
|
py
|
Python
|
tests/__init__.py
|
DavisDevasia/acoustid-server
|
b4b2acbc198b3d0497df04c2294d9f030133ede5
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
DavisDevasia/acoustid-server
|
b4b2acbc198b3d0497df04c2294d9f030133ede5
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
DavisDevasia/acoustid-server
|
b4b2acbc198b3d0497df04c2294d9f030133ede5
|
[
"MIT"
] | null | null | null |
# Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import os
import json
import pprint
import difflib
import logging
import sqlalchemy
import sqlalchemy.pool
from contextlib import closing
from nose.tools import *
from acoustic.script import Script
from acoustic.config import Config
from acoustic.tables import metadata
TEST_2_LENGTH = 320
TEST_2_FP = 'AQABVtuUZFGShAqO-h9OHD96SvhwBVNCKQnOIYmiIc-ENwF7TDe8Hr0W_AjhvRCP2sfT4DTS7zjyOYeqaI-RSxee5RmaWzhOHnlcaB6HnPgpdE-DkWIH2ysYG_Eh9zJCyfCXGOdw-EGoD2p69IavWOhzMD-a9tBx9FgPVz2qNDvQH3744ISIXRKeHto5_MhyeMtxc-COnYJ_lHLwRAgPvShz_Hga4zd8HD9UKXWOPP3xRLmGnlbQHKfxGPeRvAt6UngMvcF-gkpRi0bUZjGaH6FUHb_xGDt6aHmM__ghfkmH70B4fWiuCj8y8uj3oImZY8d3NFWWHuGF-3hCPEd_uEOyE_nw4w8ueXi24znCHOHxSWtw9BnSBzrSHF2Y4S0e_EioZoh9XMGfo2dqNMeP80aQPM5xGT9efMeTYL-KIqmHdDraHs-P8IcYjoj0I7_Q43iJ9BF64nSKKth2SjG-cvCHH-2OL8txHsUt9HhF4LiK5j16lAf1FkjvQiN55FSOkkOPkmj4GK-OH80eIeyh98HhE_qhPwjzKAV-HJ2OZkd4Q_vhp0d_6Id-_IeWW9CKoP3RKM-Bo3mOfvhxND_6HMgZ6EfXHB-8Q8-iok1znOi-ozmx54P2Dg5V_PCgLxy8KiH6C0cbHU3Ebtiho9Rxw8er47tw7jgRNxl84ziPJ-B1_DiNNClzaGSCvMGPGxePMD5qZYEuAwdTXYSYcIkmodc2nMqg_WgqBk_yBdVx0vCjQD8uhNRxXTgvVFSOSOmx61C1KMaNsFwM93h-PBdmFm8o45nxDabx48cTbGl4hHuhasjSwPtxPvAV1A7yQMukREERR-nxL8j-EbWYQ8sj4joABQQmjQhkjLFCKSAo4QoxYiQwQhgmkGjCKGAIMMA4BIwQwjhAFMBUCCUAYEIxpYxUCDlEjJYOScSMgsIIAgADwjKEFBAUCkMEMYAagoARzAAHCDCIISKANkgYYBiQwgDDjHEMIGWZFUBQLhgohBGkhECOMEAMIYghogTgQghgiSLCYUegAsJApIQjxABNDFWCa6AIAQ4Q4KgAgIABgGDCMNGIMgQJRQAQTACpgBNIJkUcBMkpoKAgXCjAgAAGKIcYIVAYbZgwggkEmKLEiYGYAYQQShFAAAQBFEEAEuEIgwYRQoARnBkAmAGMEAGFGIgQBigCwAkABEIA'
TEST_2_FP_RAW = [-772063964, -772066012, -1007079116, -1011011276, -1027788492, -1029889740, -1031261916, -1031269084, -1031270620, -1031021744, -1031079600, -1031078425, -1031032346, -1018580506, -1018646290, -1022775046, -1056337446, -1056261686, -1073039030, -1073039013, -1068976005, -1001867175, -733365175, -733302711, -737435575, -603332504, -603365272, -737516311, -188076117, -175490390, -745993558, -758642022, -767030630, -1034347878, -1038412133, -1039584631, -1039654264, -1034345784, -1030086056, -1011141092, -1045873092, -1045939676, -1045947803, -2132276505, -2132259914, -2140415082, -2140472938, -2140481130, -2140546634, -2140603929, -2144802523, -2144536267, -2123540203, -2115147515, -2081855203, -2098598611, -2098606801, -2098606737, -2106995329, -2090217989, -2123638309, -2140477173, -2140477173, -2123634405, -2106992325, -2107061957, -2107061991, -2107007715, -1033140963, -1023769329, -1025864433, -1026913002, -1010133962, -1017409482, -1017540482, -1022848902, -1056337830, -1056271030, -1056261302, -1073038501, -1068975271, -1060587447, -993477559, -1001672631, -737435575, -737566615, -737550231, -737419031, 1422585259, 1955228586, 1367940010, 1388841914, 1380453258, 1376328586, 1376458634, 1107956618, 1107899017, 1113072281, 1121657497, 1119494811, 1135224479, 1135226615, 1139489511, 1130891874, 1126713938, 1109977859, 1114237187, 1122691331, 1122695431, 1122687255, 1114233125, 1130944869, 1126746469, 1097554247, 1105885511, 1105885511, 1135270230, 1122523494, 1114135910, 1109939695, 1093236223, 1076520335, 1080714635, 1089107851, 11092923, 11010986, 15209450, 15492074, 7103274, 2913082, 2905882, 2940681, 2947848, 7138056, 32303368, 61716744, 44932552, 1118668232, 1118406137, 1122600424, 1110167912, 1110167848, 1110106424, 1122689305, 1118495003, 1118478714, 1118540010, 1122599146, 1110016234, 1110147562, 1110094153, 1076535560, 1076538376, -1058363384, -794183656, -794249176, -790063064, -261519320, -261519319, -529562582, -529628886, -530153430, -530280406, -534465494, -534459350, -517027794, -517027778, -517056387, 1630428508, 1634606924, 1643060940, -508616995, -508740929, -475252054, -487834709, -496223301, -496231493, -496092485, -488752486, -489735542, -494125366, -494125542, 1641889598, 1627335998, 1617898782, 1613703454, 1614756622, 537664270, 541854222, 541854238, 541874782, 558651982, 558168910, 558168910, 558168398, 566360398, 1636039038, 1669593454, 1938028670, 1942087766, 1942087766, 1665394807, 1631779173, 1640192868, 1640221300, 1640483428, 1640487796, 1631902020, 1627682884, 553932868, 554654068, 554589029, 567179879, 562985575, 562846279, 562879301, 558684487, 554678646, 554678646, 558873462, 567262070, 563067366, 562936022, 567064775, 558692565, 1628436725, 1661925605, 1661893095, 1666087909, 592329573, 567032663, 567032133, 567032132, 1640840020, 1909340900, 1909340900, -238142748, -775079212, -775152956, -1043580220, -1047774524, -2121450764, -2138162460, -2138162460, -2138232091, -2121520409, -2117330313, -2124670345, -2124604585, -2092205227, -2083848891, -2083787451, -2117489195, -2117550619, -2124902943, -2139517453, -2139383405, -2122597997, -2122598221, -2093090639, -2095162991, -2107737727, -2107754111, -2108805231, -2099495199, -2099499291, -2097402137, -2098451465, -2098709513, -2098717737, -2081859113, -2123773481, -2140434985, -2140496425, -2140428906, -2132171338, -2132236874, -2065124170, -2023181130, -2039964482, -2044162882, -2044098306, -2111137761, -2111117043, -2111165684, -2144720372, -2140460532, -2132132340, -2136328643, -2136407507, -2136471761, -2136471761, -2132277457, -2114187977, -2091268651, -2083809851, -2083872379, -2117361257, -2117552729, -2141681241, -2139584009, -2143708937, -2143618857, -2126874411, -2126894891, -2093339196, -2105923644, -2099628348, -2103836012, -2103966047, -2099751259, -2097639449, -2031579161, -2039763466, -2031375914, -2014728234, -2056675370, -2056548654, -2073127278, -2077251950, -2077233262, -2077266510, -2077332302, -2073154382, -2014434126, -2031143722, -2039794617, -2039792379, -2039792868, -2107033028, -2081936836, -2136462820, -2136265204, -2136263155, -2136456385, -2136456401, -2132228626, -2122791506, -2091070041, -2107647561, -2108769915, -2100384379]
# MP3, 320kbps
TEST_1A_LENGTH = 260
TEST_1A_FP = 'AQABVkmYaEmkJEsiaGvhH33xXNDyol2Pz-jhW2h1_Bb6w4d2dIbPo8dzVA_Es0E1C9_RCGH1DDmP3hX8DD2-Bdq0ojmPa9CeS_CPdi0-9EFz4bqE02iOQzs6w-fR7-gP9R0ct2ipoEeqD60u5EyFPoSPfjF0NNKOXsMP7TkcMxyq3bjQ_GiP05TQw4d24ejQfDl-VD7EN8JdtFTQHWH8DN8RPhXsED_6BdoOv0df_IJ2FuZ69MaF5hba47dQ-OihC42MvjmeQPthvSRqaR3-HfUFH33YoC-UHddRWSL6Gr6gHd0DO-i0Hj1-WMJjXAdeqoN5_MfhrbgOVzyeGRfOCpbIauh7IY8evEGYo0_woIePyxDtFTgJt8d96BM64UZ1mLfQFw96-EW77Oh__Eb64WLwz_DxZXgHU6HRfbjQozlxhOfgH_rRHz0D60eF6-gPvw6Ow0-G_tBzNKxy9BZyoWOI5smR78HDQtMP-0X1Pfjwo9GPfslRiHksoVWIo1zRrMtxo-dhkviPwzo0PniDXsdOWGYLHfZ0_Ef_oGcK0aHxB7uIT7BwGeqP1_CmA_9hnDizGSd-WIfXo8c7VDZ8_Hgo_McP_3ha_Cl8utCD4xS8B8LhzUc9tAcabT1-aBXM4xBx2DrywyS-Z_A5XMVhK0f7ICf6wxb048R15BfOI3eHE0F-4AzM5dCNH4cPO-iOD7_QPELf4egDpzp6dM0g2jh-CSdEEj_yHt6O_ijSG8cDmSSMG3cAn-hxaNE0BbeO_tPQH_5RizGeAwWAQgg4hIwwgBkmgGKKAieMAgBYI4ACBAmHqDECSyYAIQIZDY0CQggFnAIIOCSYABg5AZxCCFBjkHJEGACAUgIoh5QwmCkAFBIEAKQsEEgRYYAU2CHrAABEAMuQcBwAwgBDgmIsjUBEKSKEIgAIAQwACgBrLHEYGKEEBMQAg5wBFAAGlEBGKAYEQcwQBACkigABjBNAKEEAtYIIYhwBgBAjABCSGMEUMIIJZ6QwnFgGJUDCACKYIEBRRcRAACBIrqECOCGtcEwRZpgEijiGjDKCSsYcIApAwQwimDlhhRHGMaGceFZwBxwhDAjCCA'
TEST_1A_FP_RAW = [-1124735545, -1124600491, -1107954315, -1108017819, -1082858139, -1084889769, -1101531321, -1105799353, -1105832105, -1084795017, -1082696345, -1107993113, -1124772361, -1124739625, -1124608571, -1124600491, -1107962507, -1108028059, -1074469531, -1099635403, -1105857257, -1105758393, -1089054905, -1089054729, -1116316186, -1107866137, -1128970761, -1129024041, -1124829753, -1124735033, -1124600491, -1107962523, -1108017819, -1084955273, -1101666985, -1105725625, -1105799353, -1105766569, -1084795033, -1107862169, -1107995161, -1124772393, -1124739625, -1124608571, -1124600491, -1107962507, -1074465435, -1082858123, -1101667017, -1105726121, -1105832121, -1089054889, -1118414858, -1107927578, -1128968729, -1129032201, -1129024041, -1124735545, -1124735035, -1107954315, -1108026011, -1074463387, -1082858121, -1101531881, -1105791161, -1105832121, -1088989321, -1084795545, -1107993113, -1107995145, -1124772393, -1124608571, -1124600379, -1124600491, -1108028059, -1074465435, -1082858187, -1105861353, -1105726121, -1105832121, -1089054761, -1116315674, -1107931674, -1128968713, -1129032233, -1124829737, -1124735545, -1124604587, -1107954315, -1108017819, -1082854043, -1084889737, -1101531305, -1105791161, -1105832121, -1084795017, -1082698393, -1107995161, -1107995145, -1124772393, -1124641337, -1124600379, -1124608651, -1108026011, -1108023963, -1116445321, -1621793321, -1659424313, -1793715833, -1806297705, -1797909065, -1799942745, -1800069705, -1800135279, -1795934831, -1796905535, -1805158959, -1805257231, -1805255197, -1780089485, -1780095661, -1746405437, -1754794029, -1771579437, -1771580045, -1755196045, -1759414925, -1759414925, -1788609229, -1788674285, -1780220397, -1780351469, -1780418765, -1746884813, -1763593453, -1771842797, -1774988525, -1775151277, -1619823117, -1787658781, -1796006430, -1795879454, -1795945005, -1795916349, -1795719741, -1804108333, -1787331085, -1779040781, -1746405935, -1746405935, -1746544687, -1754967055, -1788585999, -1788774413, -1788775069, -1788641949, -1788609229, -1746796781, -1746669821, -1746667773, -1746675949, -1746811085, -1755253469, -1619991245, -1624119501, -1624148206, -1623761134, -1619624110, -1611235470, -1611182734, -1649062542, -1644931246, -1644341310, -1644300350, -1652688942, -1652758558, -1652759070, -1653213709, -1619528237, -1611205167, -1619601983, -1619567151, -1888133775, -1888133855, -1921647327, -1653213903, -1661475567, -1661475503, -1661471407, -1661631119, -1644919455, -1653295773, -1619527853, -1640564925, -1640605886, -1640542254, -1636352030, -1611190813, -1615520285, -1649140303, -1779165807, -1804257855, -1804110399, -2072611391, -2064157327, -2047548063, -2047548047, -1887967981, -1888026877, -1888035069, -1887971821, -1921714397, -1921718429, -1653213325, -1653090989, -1644767789, -1644702253, -1611147917, -1611344799, -1611352735, -1619729039, -1619659403, -1757948459, -1757981225, -1791615497, -1787413065, -1795809881, -1800073801, -1795943019, -1795918379, -1795857967, -1797135919, -1797136015, -1797200783, -1780358093, -1788611533, -1755063021, -1755063021, -1771905709, -1771905677, -1771844237, -1754835469, -1754958349, -1788512269, -1788479661, -1780099469, -1746545053, -1746602141, -1746868429, -1755257069, -1621035245, -1624148205, -1657571501, -1657637549, -1653459597, -1644821133, -1649080845, -1779165741, -1779141167, -1779075631, -1778909743, -1779303183, -1779303181, -1787691789, -1754008109, -1754017341, -1755065389, -1755065389, -1788348573, -1788479709, -1788478159, -1805254895, -1788477679, -1788477645, -1788346573, -1779968237, -1746544878, -1746537166, -1637484686, -1636313262, -1640671406, -1640540334, -1636352142, -1611186846, -1611326109, -1644946061, -1644939949, -1661700783, -1661639343, -1644698287, -1655179952, -581577392, -552084143, -552075439, -552075440, -547885231, -547885231, -547883055, -1621637647, -1613380109, -1646930445, -1646922253, -1646926381, -1646920205, -1646985885, -1647004317, -1653295837, -1653222125, -1623730941, -1623730429, -1623828717, -1619624077, -1611235485, -1611182093, -1611315247, -1611311151, -1655343151, -1653114927, -1653123597, -1653254797, -1644858254, -1611301550, -1644724926, -1644724910, -1653244557, -1653252749, -1661641357, -1661086223, -1661086255, -1661602351, -1653082671, -1653082671, -1653221903, -1619667487, -1619659295, -1619828397, -1888276205, -986509053, -1003417325, -999214797, -990763741, -994962141]
# WMA, 160kbps
TEST_1B_LENGTH = TEST_1A_LENGTH
TEST_1B_FP = 'AQABVkmYaEmkJEsiaDv8Hr0GXRd6FuZ69DP6wBdaHb-FHj60CzeaH33wHNUD8WxQPTiF7ghDPcN5hHcFP0OPb4HWFY3M4xr0XGjeoV2LD33QPMKP_2iOQzs6w-fRa-hz4R_EmClaKjjCCK2eCDkt9GHgo18MoVF79At-aD-cd6g2prjQHw2P05TQw4d2AZ3h8-i1o2oO_1BdBi0V9Ej1DK1y5KnQh_CPfoF2WO3Ra_gF7TnMMUdvXGhuoT1OW-jho4cudEbj5ngCbT_8kri0DtV31Bd8oc_RM1B2XEdliegNf0Ih80HjoNOP_vhh4j-uEXipDuZx_IG34jpc8XhmXMVZwSSPjvWQ5xnOoLkQXviCHj4uQ7SP4xl8GT_0ohOO6oJ5C33xoIdftOPR58dvpB8uBv8MH1_wdLCkEP2GCz18tEf4w8-hox965rB-VLiO_vDr4Dj8DD2P59By5WhvIRc6hmie49ODPCw0_bBfVA8eBUf3F_6SExDzS0GrMDjKFV55VObREyaJ_zisQ-ODN-h17IT1Frpg9_hzoT96BnYI9cEu4hMs_FDp4zW86cCPwyfObMaJH9bh9dAOvUN1-MePh8J_HGZJPMefwqfxHDpOwXsgXPBm1EN7wHKP-tA04YchHoetIz98_Bl8Dj9gK0f7ICf644L448R15BfOIy8uHUF-4AzM5dCNH4cPO-iOD7_QPELf4egDpzp6dM0g2jh-CSdEEj_yHt6O_ihyw8cDmYePG3cAH_1xaJsGx1qOfkXPD_7R17hoAAMAMEYAgqgRBmAkBFJMUWAMNQwAYA1QBiGHpHHCCCyZAAAgAMlRQAhAnBLIOCWYABgJAAhCQjskgSCCAeAMIEA5pATATAElBEIAKQmMQIowoIQQyCFhgANAFMGQcBwARhgSDmMpuDEIKkWEUAQAAYABQAFgDVUOAyAAEp4AYJAzgALAhBDMEAEYIIYoQxB1lAAADHBCCUGAKYIIYowiAAhiBBCSCMEUMCQIZ6QwHCiAGJQACcqMIMAxqIhIABiIraFCACokEI4poohhEijiGDVKGUElYw4QBaBgBhHMnLDCCOOYoEIM46xgwhlLgCACAQ'
TEST_1B_FP_RAW = [-1124735545, -1124604587, -1107954315, -1108026011, -1082854041, -1084889737, -1101531305, -1105799353, -1105766569, -1084795017, -1082696345, -1107993113, -1107995145, -1124772393, -1124608571, -1124600507, -1107831435, -1108028059, -1074469531, -1099635403, -1105857257, -1105791673, -1105832121, -1089054761, -1116316186, -1107866138, -1128970761, -1129024041, -1124829753, -1124735033, -1124600363, -1107962523, -1108017819, -1082858137, -1101666985, -1105725625, -1105799353, -1105766569, -1082697881, -1074309785, -1107995161, -1124772393, -1124739625, -1124608571, -1124600491, -1107962507, -1108017819, -1082858123, -1101732555, -1105726121, -1105832121, -1089054905, -1089054730, -1107927578, -1128837657, -1129032201, -1129024041, -1124735545, -1124735547, -1107823243, -1108028059, -1074465435, -1082858121, -1101667049, -1105791161, -1105832121, -1088989353, -1084795545, -1107993113, -1107995145, -1124772393, -1124608571, -1124608571, -1124600491, -1107962507, -1074463387, -1082858187, -1099569899, -1105726121, -1105832121, -1089054889, -1116317706, -1107931674, -1128968729, -1129032201, -1124829737, -1124735545, -1124604459, -1107954315, -1108026011, -1082851995, -1084955273, -1101531305, -1105791161, -1105832121, -1084795017, -1082698393, -1107993113, -1107995145, -1124772393, -1124641337, -1124600379, -1124608683, -1108026011, -1108023963, -1116445193, -1621793321, -1659424297, -1793715833, -1806297705, -1795811913, -1800008281, -1800069705, -1800135279, -1795934831, -1796905535, -1805163055, -1805257231, -1805257247, -1780089501, -1780095661, -1746409533, -1754794029, -1771579437, -1771579917, -1754933901, -1759414925, -1759414925, -1788609229, -1788674285, -1780285677, -1780351469, -1780418765, -1746884813, -1763593453, -1771842797, -1640770797, -1640933549, -1624017549, -1653441053, -1796071966, -1796141598, -1795945006, -1795924541, -1795719741, -1804108333, -1787331085, -1779040781, -1745357359, -1746405935, -1746414639, -1754967055, -1788520463, -1788774413, -1788775069, -1788773021, -1788609229, -1746796781, -1746669821, -1746667773, -1746675949, -1746811085, -1755261661, -1619991245, -1624119501, -1624148206, -1623761134, -1619624110, -1611235470, -1611248270, -1649062542, -1649125422, -1644341310, -1644300350, -1652688942, -1652693006, -1652759070, -1653279245, -1619528237, -1611139631, -1611213375, -1619567151, -1888133775, -1888133855, -1921647327, -1653213903, -1661475567, -1661475503, -1661471407, -1661627023, -1644919455, -1653295775, -1619528365, -1640564925, -1640605886, -1640542254, -1636335646, -1611190814, -1615520285, -1649140303, -1779165807, -1804331583, -1804110399, -1804175935, -2064157359, -1779112591, -1779112591, -1888099053, -1888026877, -1888035069, -1887971821, -1921648845, -1653282973, -1653213325, -1653090989, -1644767789, -1611213357, -1611147917, -1611344799, -1611352735, -1619729039, -1619659403, -1757940267, -1757981225, -1791599113, -1804190281, -1795809881, -1795879497, -1795943017, -1795918379, -1795857967, -1797135919, -1797136015, -1797201807, -1780358093, -1788611533, -1755063021, -1755063021, -1755128493, -1771905709, -1771844237, -1754835469, -1754958349, -1788512269, -1788479661, -1780099469, -1746545055, -1746602141, -1746864333, -1755257069, -1621035245, -1624148205, -1657571501, -1657637037, -1653197453, -1644821133, -1649080845, -1644948013, -1779141165, -1779075631, -1778909743, -1779303183, -1779303181, -1754137357, -1754008109, -1754017341, -1755065389, -1755065389, -1788349581, -1788479645, -1788478159, -1805254863, -1805254895, -1788477645, -1788346573, -1779968237, -1746544878, -1746536654, -1637484686, -1636313262, -1640540334, -1640540334, -1636352142, -1611186846, -1611326109, -1644946061, -1644939917, -1661700783, -1661639343, -1644698287, -1655179952, -581577392, -585640623, -552075439, -552075440, -547885231, -547885231, -547883055, -1621637647, -1613380109, -1646930445, -1646922253, -1646926381, -1646920205, -1646985885, -1647004317, -1653295837, -1653222125, -1623730941, -1623730429, -1623828717, -1619624077, -1611235485, -1611182093, -1611315247, -1611311151, -1655343151, -1653114927, -1653123597, -1653254797, -1644858254, -1611301550, -1644724926, -1644724910, -1653244589, -1653252749, -1661641357, -1661118991, -1661086255, -1661602351, -1653082671, -1653082671, -1653090831, -1619667487, -1619659295, -1619697293, -1888276205, -852283133, -1003417325, -999214797, -990699229, -994953949]
# Vorbis, 64kbps
TEST_1C_LENGTH = TEST_1A_LENGTH
TEST_1C_FP = 'AQABYpESSUkiJYmSCD30C81RbeXwG7zQvBFa4bfQg_rRQ5vh8-jxHJoe-AyD6sF5NEJYPUPOo3cFP0N7fCm0F40k8fgOPUfzo12LDz0a3sIv4TSa44KGDv7Ra-hz4e8gxi1aBz8aHWF1CXlooWfgg_mO9hDVg6nwQ3sOnx2YvriC_mioBxc6Gj566ASzwyf6Hf0h5h3uFqeCw5I-9Bf6VLBD_OgXaD0srRz64tB-wdmYozp6IX2EVsgtdISPHjoaHX3woPshviQurUP1HfUFH30b9LCLH5oscXgx5YJ2dIedo12P7vhh3MJ9nHipDuZx_IG34jpcEc8cXMVZwRJZoe_xsMGZo3ExXbgWFNsf6Bvs43gG3_ihr-g0vCl6mLfQFw_RD36PdjzRLid848PF4J_h48uQv4OpEP2GS-gNn2gRnsN_iPvRC_1hyUL1D5eOwn9w3PCJXof2w1eO9hZyoWPRPEe-Bw8LTT_so_oefMePRj_6JUcPMW0stCOOckWzLsd99IRJCh9x-OgDPeh17IQos_jhtMdzoT-0M7BD_MFF7BNh4Tp0HTe86Tj-4_CJM5txwjxuCcp2lMe-Q5MN8_g-PMZ_HOaJJ8efwqeh5zhOwTt0XPBm1EN7oNHW4zu04zAMHbYuHOmP34F_XMUJ_2j14CHCh4cPXcdxHXmp48iPXDqOHDgDc4FuFcdh2OguPLgvNI_wdyj6wKmOHl0ziDZ-_NApWCKB_IKHcsYR3vDxBzoJ48YdwOdRHFq04l-Ofuj5Df5RizGeC-FD-AkeTLrxJsePUP1x7dCxc0Z8-DvCdcEvAIUQAsYgYYAhTADFFAXEIKMAAIwJ4IBhSDgElBFYKgAAAsYhaJAQAgBFCUBAOCWMyEhRQYhABhiSBFGOCKHMIEASSTFzVDEhEAJIWcAcYQZQJKRDRiAMgCiCIccBII4ZoYyQzholDQFICEUAAAAxBYA1wCjHgCBECAAUIMZAgCwQRhBDBGBCEMQMQQBAQxUBAoAngBTUJKUEMVIRJ4gRACAGJFFWOWCEA8JJAQki1ggJkKCEEUGAYlQRKhIAAhhprHAACSAdEYoBIphgEijgqCAELCGZAwoQYQQimDEnJDOmCSGNs0I4IIwlQBAGAGJGEEkAYEAJIASgAA'
TEST_1C_FP_RAW =[-1107954315, -1108019867, -1082858137, -1082792617, -1101531385, -1105791161, -1105832113, -1082697857, -1082696337, -1107993105, -1107995137, -1124739625, -1124608569, -1124600491, -1107962507, -1108028059, -1074469531, -1099635401, -1105726185, -1105824441, -1089054905, -1089054729, -1116316186, -1107866137, -1128970761, -1129024041, -1124829241, -1126832185, -1126697003, -1110057627, -1118503579, -1084955289, -1101666985, -1105725625, -1105799353, -1105832105, -1084795545, -1107862169, -1107995161, -1124772393, -1124608553, -1124608571, -1124608683, -1107962507, -1108017819, -1082858123, -1101667019, -1105726121, -1105823929, -1089054905, -1084860425, -1107927578, -1128839705, -1129032201, -1129024041, -1124801073, -1124735009, -1107953795, -1107952283, -1074463387, -1082858121, -1101662889, -1105725617, -1105832113, -1088989345, -1082696337, -1107862161, -1107995137, -1124772385, -1124739633, -1124600371, -1107823275, -1107962507, -1074465435, -1082858123, -1101667049, -1105726121, -1105832105, -1089054889, -1118413321, -1107931673, -1128968713, -1129032233, -1124829737, -1124735545, -1124603947, -1110051467, -1108019867, -1074465435, -1084955273, -1101531369, -1105725625, -1105766569, -1082697866, -1082696346, -1107993241, -1107995145, -1124772393, -1124641337, -1124608571, -1107831435, -1108028059, -1108023963, -1116445195, -1621793321, -1659424297, -1793715833, -1806297705, -1797909065, -1799938649, -1800069705, -1800137321, -1795934825, -1805294139, -1805158971, -1805257231, -1805255197, -1788478093, -1780095661, -1746405565, -1754794029, -1771579437, -1771579405, -1771743757, -1754958477, -1759414925, -1788609229, -1788674285, -1780285677, -1780351469, -1780418765, -1746884813, -1746816237, -1771842797, -1640770797, -1640933549, -1619823117, -1653441053, -1661592093, -1795879453, -1795947053, -1795926585, -1795719737, -1795719721, -1787298317, -1780089359, -1746537007, -1746405935, -1746414639, -1754934287, -1788521487, -1788774413, -1788779165, -1788642013, -1788609229, -1746796781, -1746669821, -1746733309, -1746675949, -1763588301, -1637821149, -1619990733, -1624119533, -1624148205, -1623761133, -1619624109, -1611235469, -1611182733, -1649062414, -1649125422, -1644341310, -1644169278, -1652688942, -1652758542, -1652759070, -1653213709, -1619528461, -1611205167, -1611211327, -1619534383, -1619697807, -1921655007, -1653213919, -1653213903, -1661606639, -1661475567, -1661471407, -1661610639, -1644915359, -1653295757, -1619528365, -1640564925, -1640605886, -1640538158, -1636352030, -1611190813, -1615520285, -1649140303, -1644948079, -1670040127, -1804110399, -2072611391, -2064157327, -2047548063, -1913330319, -1887965933, -1888026877, -1888035069, -1887971821, -1921714397, -1653282973, -1653213325, -1652566701, -1644767917, -1611213485, -1611147917, -1611344541, -1611352735, -1619729039, -1619659403, -1623730729, -1757981225, -1791599177, -1804190281, -1795809881, -1795879499, -1795943019, -1795918379, -1795857963, -1780358703, -1780358799, -1797136335, -1780353997, -1788611533, -1755063021, -1755054829, -1771897517, -1771905709, -1771844237, -1754835469, -1754958349, -1788512301, -1788356781, -1779968395, -1780099227, -1746602143, -1746868429, -1612651245, -1619986669, -1624148205, -1657571501, -1657637037, -1653181069, -1644821133, -1649080845, -1644948013, -1779141167, -1779075631, -1778909743, -1779041039, -1779303181, -1754137357, -1754008109, -1754017341, -1755065389, -1755065389, -1788348573, -1788480221, -1788478159, -1788477647, -1788477679, -1788477647, -1788346573, -1746413805, -1746544877, -1612318926, -1637353614, -1636313262, -1640671406, -1640532142, -1636354190, -1611186846, -1611330206, -1644948109, -1644939949, -1661635247, -1661639343, -1644698287, -581569200, -581577392, -547891887, -552075440, -547881136, -547885231, -547885231, -547883055, -547895823, -1646934541, -1646930445, -1646922253, -1646922285, -1646920205, -1647002269, -1647008413, -1653295837, -1653222125, -1623730413, -1623730429, -1623828717, -1619624077, -1611235485, -1611182093, -1611315247, -1644865583, -1646954543, -1653114925, -1653254797, -1653254797, -1611303566, -1611303854, -1611170494, -1644724926, -1653244589, -1653252749, -1661641229, -1661086223, -1661086255, -1661602351, -1653082671, -1653082671, -1619667471, -1619667487, -1619659295, -1619693229, -1888276205, -1926024957, -1003417325, -999214797, -990763741, -996010717, -995947214, -995881710, -995869422, -991609530, -999993914, -983183930, -949893737, -966552169, -966543979, -958271087, -958279216, -941559312, -941530783, -983473887]
# WMA, 32kbps
TEST_1D_LENGTH = TEST_1A_LENGTH
TEST_1D_FP = 'AQABVkmYaEkkZUkE7bDao4e-C9VhHtWLHtQFphJ-CT3sQ7vQGT76Bc_RB-LZ4Bb6HR3CUB9yVugr2MnQH_qITieah8eL_oIYs8O3FkUvNK6Fv0L3wz4O7egMn0e_oz_UD45pnBJ-pPLRShdyFn1awZ9xfIQorUdPfIf2C455tC-OXhcaqngldId99IKODs2X40d_OG8E1UXrox9SSR_6C3kq9CH8o1-gHVaPfsUvaD-cjTmq40JjXQjLIxc6Gj56XNAi9MvxBtotwSe-FtVP9BZ89HnQB3aIHz2Jn0Vz9DyOxjmm3sKPHy189MdR7R1s_PBRrofWHmL94Bl-4azQyDzySR725MGZojn65MiJ32g-6Me2_fjxDL7xHM_moWunQzVaUYePkniPcjr8oucR_vCP7_jxJsR_mAv-dIIdyWiPoz_RPPiQH_2h5ceLe0dzVDe-oRfSuA5w-BnC83gOLVc6hP1xoWPRPMf3DHlYNDEPPUf_4Ffwo_mDrkugwXmMVuFxlOvhdUGPmzu0koePH97RB3M__OglwzLxQ_SO6rPwoyfsMHhxSjiPY1Nw6sFhGzmQ74aD91Cm48R9eLfQ4x2gaTv8o9qN6-hhHk-OzylOuMuh4xSMH_phH6VGoEWjFyd2QouFAzquw3yOHM6-BdeL4_AZon_wZTm60sgvGLqE_0beEaeL_BtO_Phx4xrhBz9eEuKD5xDRszNOqEcfHeaL8OhVOKbRH-G0TDC1FdczHDd-I5WOw84u_MKRGz70bDhTIe_hGzcOoz9yaFsVw_mFfuh5pD96xrhyAAaIAgYiRIVjDGHCFAaGCKQYAkIAQIkBxAAjmGQCECIQNFQQo4CQBhBHBBECEEANQ0oApwQyhCBBJBBEUEWcEQRIRwTIzBEgEIBAKQuIckQAAQAUSjDljCKEDAIVkcAZBAAhhiEhFCFAIQWcMko6I4RlgAIBCACGKSoUEEQQ4AQwBgsFlFACKAkCE0IwQ4BwQhikiDHEAEEdAoY4IoBgFiKkEENCEgScEQ5QIwEipAkljBGKMIKAAFIoxohgAipClHEMICyVEYAJBywUChjBCDICAIeEs4gZJQAFTCglBCVEICAQA846IZywglHhhTLCkibQEJwAQQQiAA'
TEST_1D_FP_RAW = [-1126832697, -1126701611, -1110051467, -1110059675, -1084951193, -1084885705, -1101662441, -1105725625, -1105758377, -1084786817, -1084793497, -1107862041, -1107993097, -1124772393, -1124608571, -1124600491, -1107823243, -1108028059, -1074469531, -1099635339, -1105857193, -1105758377, -1089054905, -1089054761, -1118413338, -1107866137, -1128968713, -1129024041, -1124796985, -1124735035, -1126701739, -1110059675, -1108028059, -1082854027, -1101667049, -1105725609, -1105725625, -1105766569, -1084858521, -1074307737, -1107993097, -1124772393, -1124739625, -1124608571, -1124600491, -1107962507, -1074465435, -1082858123, -1101732553, -1105857193, -1105766569, -1089054889, -1084852234, -1110024730, -1107866137, -1128966665, -1124829737, -1124796969, -1124735017, -1107823243, -1107962523, -1074465435, -1084955273, -1101662953, -1105725689, -1105725625, -1084795049, -1084859033, -1107862169, -1107993097, -1124772393, -1124608569, -1124600379, -1124600491, -1108028059, -1074465435, -1082858123, -1105861355, -1105726121, -1088981177, -1089054889, -1118413322, -1107931674, -1128968729, -1129032201, -1124829737, -1124735545, -1126832683, -1110051467, -1108028059, -1082854043, -1084955273, -1101531369, -1105725625, -1105766585, -1084784777, -1082696346, -1107862169, -1107995145, -1124772393, -1124641337, -1124600377, -1124600459, -1108028059, -1108023835, -1084987913, -1084918313, -1223215657, -1793649273, -1806297705, -1797909065, -1800008281, -1800073801, -1800137321, -1795934825, -1796921977, -1805556281, -1805552137, -731775513, -731775641, -715004585, -672929981, -689703101, -698099901, -698100397, -698231437, -702417565, -685640349, -714868941, -714866925, -706478573, -706609613, -673122525, -1746881231, -1771982573, -1771843309, -1774988525, -1775151277, -1758234653, -1787681310, -1796071962, -1800335898, -1800401450, -1796178490, -1796117049, -1804374841, -1804337929, -1787568907, -705440303, -671877679, -671886383, -680406031, -1754246159, -1791920655, -714906271, -714902237, -681443533, -673054957, -673059325, -689701373, -1763453165, -1763588301, -1772038365, -1770981582, -1775180014, -1640990958, -1624148206, -1619624174, -1611251886, -1611264654, -1783296526, -1779149358, -1779083326, -1779075134, -1786943534, -1786976286, -1786972702, -1653279261, -1644825101, -1611139647, -1611203135, -1619534527, -1619665551, -1892295391, -1653220063, -1653213903, -1661475504, -1661475504, -1661471408, -1661627024, -1644919455, -1653295775, -1623722669, -1640564926, -1640605886, -1640538158, -1636352030, -1745408542, -1749738013, -1783362157, -1779165807, -1804323455, -1804110399, -730434111, -705202703, -705370783, -705370765, -713562861, -680067325, -680075517, -713566701, -713754829, -713758941, -578947229, -1652566671, -1644178095, -1610640047, -1611164559, -1611361183, -1762347675, -1770740379, -1774848651, -1774725675, -1757981227, -1791549961, -1804190297, -1795809881, -1795748425, -1795943017, -1796196969, -1796185641, -723426857, -723394089, -723394445, -715000781, -715000525, -714867437, -681313006, -681313006, -1771905773, -1771905677, -1755064973, -1755195947, -1755187243, -1788749995, -1746676107, -1746807195, -1746864283, -1746864283, -1755257545, -1754204905, -1758333113, -1791789241, -1791854761, -1787660937, -1779301001, -1783561737, -1783623177, -1779403305, -1779337771, -1779171883, -1779171851, -1779303179, -1787699977, -1754147625, -1754009145, -1754009145, -1754008617, -1788611737, -1788610777, -1788750045, -1788739823, -1788477679, -1788477679, -1788346605, -1779968237, -1746807501, -1746799310, -1770784942, -1640802478, -1640933550, -1640949934, -1636354190, -1611253918, -1644886686, -1649142286, -1661717005, -1661717037, -1661639215, -570988591, -570427568, -847390896, -818553007, -818413743, -550109359, -545919151, -545790127, -545851951, -545864207, -537410063, -573188623, -573196845, -589976109, -589976079, -1644904991, -1644907167, -1653295837, -1619667661, -1623730413, -1623763198, -1624015086, -1619890318, -1611497630, -1611182605, -1615525933, -1646962733, -1646954541, -1655212077, -1787340845, -1787472526, -1787464334, -1745490606, -1644696238, -1644692142, -1653211821, -1653219981, -722084495, -721435151, -587344400, -587860528, -596118064, -579340848, -579340816, -545917472, -680135199, -697077389, -684510957, -986500861, -1003417325, -999214798, -990764766, -994962142]
TEST_1_LENGTH = TEST_1A_LENGTH
TEST_1_FP = TEST_1A_FP
TEST_1_FP_RAW = TEST_1A_FP_RAW
script = None
SEQUENCES = [
('account', 'id'),
('application', 'id'),
('format', 'id'),
('foreignid', 'id'),
('foreignid_vendor', 'id'),
('source', 'id'),
('submission', 'id'),
('track', 'id'),
('track_mbid', 'id'),
('track_mbid_source', 'id'),
('track_mbid_change', 'id'),
('track_mbid_flag', 'id'),
('track_puid', 'id'),
('track_puid_source', 'id'),
('track_meta', 'id'),
('track_meta_source', 'id'),
('track_foreignid', 'id'),
('track_foreignid_source', 'id'),
('fingerprint', 'id'),
('fingerprint_source', 'id'),
('meta', 'id'),
]
TABLES = [
'account',
'application',
'format',
'foreignid',
'foreignid_vendor',
'source',
'stats',
'track',
'track_mbid',
'track_mbid_source',
'track_mbid_change',
'track_mbid_flag',
'track_puid',
'track_puid_source',
'track_meta',
'track_meta_source',
'track_foreignid',
'track_foreignid_source',
'meta',
'musicbrainz.artist_credit_name',
'musicbrainz.artist_credit',
'musicbrainz.artist_name',
'musicbrainz.artist',
'musicbrainz.track_name',
'musicbrainz.track',
'musicbrainz.release',
'musicbrainz.medium',
'musicbrainz.medium_format',
'musicbrainz.recording',
'musicbrainz.release_name',
'musicbrainz.release_group',
'musicbrainz.clientversion',
'musicbrainz.tracklist',
]
BASE_SQL = '''
INSERT INTO account (name, apikey, lastlogin) VALUES ('User 1', 'user1key', now() - INTERVAL '2 day');
INSERT INTO account (name, apikey, lastlogin) VALUES ('User 2', 'user2key', now() - INTERVAL '5 day');
INSERT INTO application (name, apikey, version, account_id) VALUES ('App 1', 'app1key', '0.1', 1);
INSERT INTO application (name, apikey, version, account_id) VALUES ('App 2', 'app2key', '0.1', 2);
INSERT INTO format (name) VALUES ('FLAC');
INSERT INTO source (account_id, application_id) VALUES (1, 1);
INSERT INTO source (account_id, application_id) VALUES (2, 2);
INSERT INTO track (id, gid) VALUES
(1, 'eb31d1c3-950e-468b-9e36-e46fa75b1291'),
(2, '92732e4b-97c6-4250-b237-1636384d466f'),
(3, '30e66c45-f761-490a-b1bd-55763e8b59be'),
(4, '014e973b-368e-42bf-b619-84cab14c4af6');
INSERT INTO track_mbid (track_id, mbid, submission_count) VALUES (1, 'b81f83ee-4da4-11e0-9ed8-0025225356f3', 1);
'''
def prepare_sequences(conn):
with conn.begin():
for table, column in SEQUENCES:
conn.execute("""
SELECT setval('%(table)s_%(column)s_seq',
coalesce((SELECT max(%(column)s) FROM %(table)s), 0) + 1, false)
""" % {'table': table, 'column': column})
def prepare_database(conn, sql, params=None):
with conn.begin():
prepare_sequences(conn)
conn.execute(sql, params)
prepare_sequences(conn)
def with_database(func):
def wrapper(*args, **kwargs):
with closing(script.engine.connect()) as conn:
prepare_sequences(conn)
trans = conn.begin()
try:
func(conn, *args, **kwargs)
finally:
trans.rollback()
wrapper = make_decorator(func)(wrapper)
return wrapper
def setup():
global script
config_path = os.path.dirname(os.path.abspath(__file__)) + '/../acoustid-test.conf'
script = Script(config_path, tests=True)
if not os.environ.get('SKIP_DB_SETUP'):
with closing(script.engine.connect()) as conn:
with conn.begin():
metadata.create_all(conn)
for table in reversed(metadata.sorted_tables):
conn.execute(table.delete())
prepare_database(conn, BASE_SQL)
def assert_dict_equals(d1, d2, msg=None):
if d1 != d2:
standardMsg = '%s != %s' % (repr(d1), repr(d2))
diff = ('\n' + '\n'.join(difflib.ndiff(
pprint.pformat(d1).splitlines(),
pprint.pformat(d2).splitlines())))
assert d1 == d2, standardMsg + '\n' + diff
def assert_json_equals(expected, actual):
#import pprint
#pprint.pprint(expected)
#pprint.pprint(json.loads(actual))
assert_dict_equals(expected, json.loads(actual))
| 181.104972
| 4,593
| 0.786943
| 2,573
| 32,780
| 9.924213
| 0.602798
| 0.003015
| 0.00235
| 0.006266
| 0.123595
| 0.083963
| 0.055375
| 0.04159
| 0.028275
| 0.028275
| 0
| 0.597791
| 0.085662
| 32,780
| 180
| 4,594
| 182.111111
| 0.254171
| 0.006833
| 0
| 0.054422
| 0
| 0.07483
| 0.23466
| 0.190997
| 0
| 0
| 0
| 0
| 0.027211
| 1
| 0.047619
| false
| 0
| 0.081633
| 0
| 0.136054
| 0.034014
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0e845e8eaa4d10606a1ceff4d593eca6c371ba95
| 838
|
py
|
Python
|
app/api/models/Base.py
|
nurely/lxdui
|
8cb31dc1117719b140f440f8a705282781db7b35
|
[
"Apache-2.0"
] | 589
|
2017-10-22T04:11:08.000Z
|
2022-03-26T22:50:30.000Z
|
app/api/models/Base.py
|
nurely/lxdui
|
8cb31dc1117719b140f440f8a705282781db7b35
|
[
"Apache-2.0"
] | 134
|
2017-11-14T02:52:03.000Z
|
2022-03-22T12:51:09.000Z
|
app/api/models/Base.py
|
nurely/lxdui
|
8cb31dc1117719b140f440f8a705282781db7b35
|
[
"Apache-2.0"
] | 170
|
2017-10-06T06:22:43.000Z
|
2022-03-15T02:12:34.000Z
|
from abc import ABC, abstractmethod
class Base(ABC):
@abstractmethod
def info(self):
raise NotImplementedError()
@abstractmethod
def create(self):
raise NotImplementedError()
@abstractmethod
def delete(self):
raise NotImplementedError()
@abstractmethod
def start(self):
raise NotImplementedError()
@abstractmethod
def stop(self):
raise NotImplementedError()
@abstractmethod
def restart(self):
raise NotImplementedError()
@abstractmethod
def update(self):
raise NotImplementedError()
@abstractmethod
def move(self):
raise NotImplementedError()
@abstractmethod
def clone(self):
raise NotImplementedError()
@abstractmethod
def snapshot(self):
raise NotImplementedError()
| 19.488372
| 35
| 0.652745
| 68
| 838
| 8.044118
| 0.294118
| 0.310786
| 0.511883
| 0.691042
| 0.740402
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.270883
| 838
| 42
| 36
| 19.952381
| 0.895254
| 0
| 0
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3125
| false
| 0
| 0.03125
| 0
| 0.375
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0e868c1c874a54f63d087cffb05487afb9dbfad7
| 111
|
py
|
Python
|
examples/exception_example.py
|
kootenpv/cliche
|
e2c10b9d5b4c2596dff174daac9e92df7eb74062
|
[
"MIT"
] | 100
|
2020-02-25T07:35:42.000Z
|
2022-03-30T14:48:32.000Z
|
examples/exception_example.py
|
kootenpv/mincli
|
176a120bd90c5359e3dd6086da2807f7234925df
|
[
"MIT"
] | 9
|
2020-03-25T00:40:18.000Z
|
2022-01-25T01:50:38.000Z
|
cells/cliche/entrypoints/example/exception_example.py
|
GTrunSec/DevSecOps-Cells-Lab
|
5f70b60696497d54bb27d3f1d863076e6978c9bf
|
[
"MIT"
] | 7
|
2020-03-25T00:32:14.000Z
|
2022-02-15T03:34:54.000Z
|
from cliche import cli
@cli
def exception_example():
raise ValueError("No panic! This is a known error")
| 15.857143
| 55
| 0.72973
| 17
| 111
| 4.705882
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189189
| 111
| 6
| 56
| 18.5
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0.279279
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0ea9b3531621571a59e607768f5b833b881a08f4
| 221
|
py
|
Python
|
build/lib/huji_lab/__init__.py
|
stormage2/huji_lab
|
07734f1891d05177dd1395a4a3e4694e258ca0f8
|
[
"MIT"
] | null | null | null |
build/lib/huji_lab/__init__.py
|
stormage2/huji_lab
|
07734f1891d05177dd1395a4a3e4694e258ca0f8
|
[
"MIT"
] | 7
|
2018-10-16T17:02:15.000Z
|
2018-10-31T13:39:30.000Z
|
build/lib/huji_lab/__init__.py
|
stormage2/huji_lab
|
07734f1891d05177dd1395a4a3e4694e258ca0f8
|
[
"MIT"
] | 1
|
2018-10-21T11:43:55.000Z
|
2018-10-21T11:43:55.000Z
|
import seaborn as _sns
from . import Errors
from . import Graph
from . import DataProc
from . import Generators
from . import Display
from IPython.display import display
_sns.set(font_scale=2)
_sns.set_style("whitegrid")
| 22.1
| 35
| 0.79638
| 33
| 221
| 5.181818
| 0.515152
| 0.292398
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005236
| 0.135747
| 221
| 10
| 36
| 22.1
| 0.890052
| 0
| 0
| 0
| 0
| 0
| 0.040541
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.777778
| 0
| 0.777778
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
7ede75554aebd9bd033c9c014e500f35b4e072f4
| 1,638
|
py
|
Python
|
sjtuface/core/models.py
|
vinx13/sjtuface-web
|
ea50591fa4dd15d27eef0a8e3e5c10c045d42707
|
[
"Apache-2.0"
] | null | null | null |
sjtuface/core/models.py
|
vinx13/sjtuface-web
|
ea50591fa4dd15d27eef0a8e3e5c10c045d42707
|
[
"Apache-2.0"
] | 2
|
2016-08-15T14:54:42.000Z
|
2017-04-13T05:50:04.000Z
|
sjtuface/core/models.py
|
vinx13/sjtuface-web
|
ea50591fa4dd15d27eef0a8e3e5c10c045d42707
|
[
"Apache-2.0"
] | null | null | null |
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class User(db.Model):
__tablename__ = 'user'
user_id = db.Column(db.Integer, autoincrement=True)
username = db.Column(db.Unicode(64), primary_key=True)
password = db.Column(db.Unicode(128))
def __init__(self, username, password):
self.username = username
self.password = password
# These methods are required by Flask-Login
def get_id(self):
return self.username
def __unicode__(self):
return self.username
def is_authenticated(self):
return True
def is_active(self):
return True
def is_anonymous(self):
return False
class Person(db.Model):
__tablename__ = 'person'
id = db.Column(db.Unicode(64), primary_key=True)
name = db.Column(db.Unicode(64))
def __init__(self, id, name):
self.id = id
self.name = name
class Photo(db.Model):
__tablename__ = 'photo'
filename = db.Column(db.Unicode(64), primary_key=True)
owner_id = db.Column(db.Unicode(64), db.ForeignKey('person.id'))
owner = db.relationship(Person, backref=db.backref('photos'))
def __init__(self, filename, owner):
self.filename = filename
self.owner = owner
class AttendancePhoto(db.Model):
__tablename__ = 'attendance_photo'
filename = db.Column(db.Unicode(64), primary_key=True)
owner_name = db.Column(db.Unicode(64), db.ForeignKey('user.username'))
owner = db.relationship(User, backref=db.backref('photos'))
def __init__(self, filename, owner):
self.filename = filename
self.owner = owner
| 24.088235
| 74
| 0.660562
| 208
| 1,638
| 4.966346
| 0.230769
| 0.0697
| 0.087125
| 0.131655
| 0.49274
| 0.407551
| 0.377541
| 0.317522
| 0.25363
| 0.25363
| 0
| 0.013333
| 0.221612
| 1,638
| 67
| 75
| 24.447761
| 0.796863
| 0.025031
| 0
| 0.27907
| 0
| 0
| 0.040752
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.209302
| false
| 0.069767
| 0.023256
| 0.116279
| 0.790698
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
7eec38a77300084fe6341f46a4a208af96414bd0
| 127
|
py
|
Python
|
pluto/action/__init__.py
|
agoragames/pluto
|
c5f8b01a74a2c63d376b2436745a590708b62304
|
[
"MIT"
] | null | null | null |
pluto/action/__init__.py
|
agoragames/pluto
|
c5f8b01a74a2c63d376b2436745a590708b62304
|
[
"MIT"
] | null | null | null |
pluto/action/__init__.py
|
agoragames/pluto
|
c5f8b01a74a2c63d376b2436745a590708b62304
|
[
"MIT"
] | null | null | null |
'''
Copyright (c) 2014, Aaron Westendorf All rights reserved.
https://github.com/agoragames/pluto/blob/master/LICENSE.txt
'''
| 21.166667
| 59
| 0.748031
| 17
| 127
| 5.588235
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034783
| 0.094488
| 127
| 5
| 60
| 25.4
| 0.791304
| 0.929134
| 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
| 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
| 4
|
7eefae14897bf2a68c659ac71c19294b153e904c
| 112
|
py
|
Python
|
Chapter02/animals/sheep.py
|
RoyMcCrain/Mastering-Vim
|
4ae35ffe656929104a784bac24c2cabebd845c40
|
[
"MIT"
] | 155
|
2018-12-11T00:46:26.000Z
|
2022-03-31T14:47:36.000Z
|
Chapter02/animals/sheep.py
|
RoyMcCrain/Mastering-Vim
|
4ae35ffe656929104a784bac24c2cabebd845c40
|
[
"MIT"
] | null | null | null |
Chapter02/animals/sheep.py
|
RoyMcCrain/Mastering-Vim
|
4ae35ffe656929104a784bac24c2cabebd845c40
|
[
"MIT"
] | 64
|
2018-10-15T01:35:45.000Z
|
2022-03-20T02:26:50.000Z
|
"""A sheep."""
import animal
class Sheep(animal.Animal):
def __init__(self):
self.kind = 'sheep'
| 12.444444
| 27
| 0.607143
| 14
| 112
| 4.571429
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.232143
| 112
| 8
| 28
| 14
| 0.744186
| 0.071429
| 0
| 0
| 0
| 0
| 0.05102
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
7efd616179af55ca2e557751ccb4b35a913d138f
| 22,167
|
py
|
Python
|
givefood/const/parlcon_party.py
|
Kazade/givefood
|
340dc411e422d02b83dae7d5206d8c418791a50f
|
[
"Unlicense"
] | null | null | null |
givefood/const/parlcon_party.py
|
Kazade/givefood
|
340dc411e422d02b83dae7d5206d8c418791a50f
|
[
"Unlicense"
] | null | null | null |
givefood/const/parlcon_party.py
|
Kazade/givefood
|
340dc411e422d02b83dae7d5206d8c418791a50f
|
[
"Unlicense"
] | null | null | null |
parlcon_party = {'Morecambe and Lunesdale': 'Conservative', 'North East Hertfordshire': 'Conservative', 'Blaydon': 'Labour', 'Thornbury and Yate': 'Conservative', 'South Antrim': 'DUP', 'Belfast North': 'Sinn F\xc3\xa9in', 'Fermanagh and South Tyrone': 'Sinn F\xc3\xa9in', 'Ipswich': 'Conservative', 'Castle Point': 'Conservative', 'Rochdale': 'Labour', 'Neath': 'Labour Co-operative', 'Leeds West': 'Labour', 'South Leicestershire': 'Conservative', 'Ashton-under-Lyne': 'Labour', 'Epsom and Ewell': 'Conservative', 'Walsall North': 'Conservative', 'Penistone and Stocksbridge': 'Conservative', 'New Forest East': 'Conservative', 'Chipping Barnet': 'Conservative', 'Kilmarnock and Loudoun': 'Scottish National', 'Kettering': 'Conservative', 'Orkney and Shetland': 'Liberal Democrats', 'Aberavon': 'Labour', 'Rossendale and Darwen': 'Conservative', 'Angus': 'Scottish National', 'Westmorland and Lonsdale': 'Liberal Democrats', 'Solihull': 'Conservative', 'Totnes': 'Conservative', 'Manchester Withington': 'Labour', 'Garston and Halewood': 'Labour', 'Warwick and Leamington': 'Labour', 'Chesterfield': 'Labour', 'Dundee West': 'Scottish National', 'Exeter': 'Labour', 'Harwich and North Essex': 'Conservative', 'Bristol North West': 'Labour', 'Aberdeen South': 'Scottish National', 'Edmonton': 'Labour Co-operative', 'Hereford and South Herefordshire': 'Conservative', 'North East Bedfordshire': 'Conservative', 'Sheffield Central': 'Labour', 'Witham': 'Conservative', 'Lewisham Deptford': 'Labour', 'Eastbourne': 'Conservative', 'Heywood and Middleton': 'Conservative', 'Cardiff South and Penarth': 'Labour Co-operative', 'Southport': 'Conservative', 'Bolton South East': 'Labour', 'Vale of Glamorgan': 'Conservative', 'Bristol West': 'Labour', 'Derby North': 'Conservative', 'Winchester': 'Conservative', 'Staffordshire Moorlands': 'Conservative', 'Redditch': 'Conservative', 'Great Grimsby': 'Conservative', 'Milton Keynes North': 'Conservative', 'Ogmore': 'Labour', 'Wolverhampton South West': 'Conservative', 'Pendle': 'Conservative', 'Huddersfield': 'Labour Co-operative', 'City of Durham': 'Labour', 'Milton Keynes South': 'Conservative', 'Banff and Buchan': 'Conservative', 'Richmond (Yorks)': 'Conservative', 'Edinburgh South': 'Labour', 'Chippenham': 'Conservative', 'Buckingham': 'Conservative', 'Dumfriesshire, Clydesdale and Tweeddale': 'Conservative', 'Bradford East': 'Labour', 'North Dorset': 'Conservative', 'Halesowen and Rowley Regis': 'Conservative', 'Stourbridge': 'Conservative', 'Bury St Edmunds': 'Conservative', 'Battersea': 'Labour', 'Clwyd South': 'Conservative', 'High Peak': 'Conservative', 'Tooting': 'Labour', 'Stalybridge and Hyde': 'Labour Co-operative', 'Dudley North': 'Conservative', 'Oxford East': 'Labour Co-operative', 'South Basildon and East Thurrock': 'Conservative', 'Cardiff North': 'Labour', 'Luton South': 'Labour', 'Camborne and Redruth': 'Conservative', 'Alyn and Deeside': 'Labour', 'Sittingbourne and Sheppey': 'Conservative', 'Copeland': 'Conservative', 'Normanton, Pontefract and Castleford': 'Labour', 'Newton Abbot': 'Conservative', 'Hove': 'Labour', 'North West Hampshire': 'Conservative', 'Grantham and Stamford': 'Conservative', 'Chichester': 'Conservative', 'Mole Valley': 'Conservative', 'Bexleyheath and Crayford': 'Conservative', 'Tamworth': 'Conservative', 'South East Cornwall': 'Conservative', 'Brighton Pavilion': 'Green', 'Hitchin and Harpenden': 'Conservative', 'Bradford West': 'Labour', 'North Norfolk': 'Conservative', 'The Cotswolds': 'Conservative', 'Brentwood and Ongar': 'Conservative', 'Ynys M\xc3\xb4n': 'Conservative', 'Hammersmith': 'Labour', 'Mid Sussex': 'Conservative', 'Leeds North West': 'Labour Co-operative', 'Twickenham': 'Liberal Democrats', 'Henley': 'Conservative', 'Ashfield': 'Conservative', 'Kingston upon Hull North': 'Labour', 'Scunthorpe': 'Conservative', 'Liverpool Wavertree': 'Labour', 'Stretford and Urmston': 'Labour', 'South Swindon': 'Conservative', 'Cheltenham': 'Conservative', 'Mid Derbyshire': 'Conservative', 'North Down': 'Alliance', 'Bath': 'Liberal Democrats', 'Stoke-on-Trent North': 'Conservative', 'Stratford-on-Avon': 'Conservative', 'Hertsmere': 'Conservative', 'Leeds North East': 'Labour', 'St Albans': 'Liberal Democrats', 'Halifax': 'Labour', 'Brighton Kemptown': 'Labour Co-operative', 'Chelmsford': 'Conservative', 'North Shropshire': 'Conservative', 'Waveney': 'Conservative', 'Broxbourne': 'Conservative', 'Chatham and Aylesford': 'Conservative', 'Torfaen': 'Labour', 'Bassetlaw': 'Conservative', 'Forest of Dean': 'Conservative', 'Sheffield South East': 'Labour', 'Sefton Central': 'Labour', 'Wansbeck': 'Labour', 'Islington South and Finsbury': 'Labour', 'South Holland and The Deepings': 'Conservative', 'Sheffield Hallam': 'Labour', 'East Devon': 'Conservative', 'Mid Ulster': 'Sinn F\xc3\xa9in', 'Sheffield Brightside and Hillsborough': 'Labour', 'East Londonderry': 'DUP', 'Gower': 'Labour', 'Stafford': 'Conservative', 'Lanark and Hamilton East': 'Scottish National', 'Inverclyde': 'Scottish National', 'Harrow West': 'Labour Co-operative', 'Ealing North': 'Labour Co-operative', 'Stirling': 'Scottish National', 'Newcastle upon Tyne North': 'Labour', 'Lagan Valley': 'DUP', 'Crewe and Nantwich': 'Conservative', 'Walthamstow': 'Labour Co-operative', 'West Lancashire': 'Labour', 'Rushcliffe': 'Conservative', 'St Helens North': 'Labour', 'Great Yarmouth': 'Conservative', 'Reading East': 'Labour', 'Barnsley Central': 'Labour', 'South Cambridgeshire': 'Conservative', 'Welwyn Hatfield': 'Conservative', 'Southend West': 'Conservative', 'Beckenham': 'Conservative', 'Wyre and Preston North': 'Conservative', 'Dundee East': 'Scottish National', 'Salisbury': 'Conservative', 'Colne Valley': 'Conservative', 'Birmingham Erdington': 'Labour', 'Ilford North': 'Labour', 'Kirkcaldy and Cowdenbeath': 'Scottish National', 'Wyre Forest': 'Conservative', 'Peterborough': 'Conservative', 'Epping Forest': 'Conservative', 'South West Bedfordshire': 'Conservative', 'Wrexham': 'Conservative', 'Newark': 'Conservative', 'South Staffordshire': 'Conservative', 'Weston-Super-Mare': 'Conservative', 'Bournemouth East': 'Conservative', 'Bristol East': 'Labour', 'Weaver Vale': 'Labour', 'Glasgow South West': 'Scottish National', 'Northampton North': 'Conservative', 'Witney': 'Conservative', 'Ochil and South Perthshire': 'Scottish National', 'Llanelli': 'Labour', 'Rochester and Strood': 'Conservative', 'Gloucester': 'Conservative', 'Warrington North': 'Labour', 'Wirral West': 'Labour', 'Lewisham East': 'Labour', 'West Bromwich East': 'Conservative', 'Altrincham and Sale West': 'Conservative', 'Hendon': 'Conservative', 'Stockton South': 'Conservative', 'Middlesbrough South and East Cleveland': 'Conservative', 'Gordon': 'Scottish National', 'Brigg and Goole': 'Conservative', 'Louth and Horncastle': 'Conservative', 'Wallasey': 'Labour', 'Gateshead': 'Labour', 'Falkirk': 'Scottish National', 'Kensington': 'Conservative', 'Vale of Clwyd': 'Conservative', 'Somerton and Frome': 'Conservative', 'Oxford West and Abingdon': 'Liberal Democrats', 'Enfield Southgate': 'Labour', 'West Bromwich West': 'Conservative', 'Camberwell and Peckham': 'Labour', 'Hartlepool': 'Labour', 'Dudley South': 'Conservative', 'Kenilworth and Southam': 'Conservative', 'Birmingham Perry Barr': 'Labour', 'Sevenoaks': 'Conservative', 'Truro and Falmouth': 'Conservative', 'Halton': 'Labour', 'Bradford South': 'Labour', 'Birmingham Ladywood': 'Labour', 'Glenrothes': 'Scottish National', 'Newcastle-under-Lyme': 'Conservative', 'Broadland': 'Conservative', 'Dewsbury': 'Conservative', 'South West Surrey': 'Conservative', 'Wigan': 'Labour', 'Finchley and Golders Green': 'Conservative', 'Rotherham': 'Labour', 'Coventry South': 'Labour', 'Feltham and Heston': 'Labour Co-operative', 'Stone': 'Conservative', 'Calder Valley': 'Conservative', 'Northampton South': 'Conservative', 'Barrow and Furness': 'Conservative', 'Harrow East': 'Conservative', 'Croydon South': 'Conservative', 'Tynemouth': 'Labour', 'Berwick-upon-Tweed': 'Conservative', 'Ross, Skye and Lochaber': 'Scottish National', 'Leicester South': 'Labour Co-operative', 'Beverley and Holderness': 'Conservative', 'Cambridge': 'Labour', 'Holborn and St Pancras': 'Labour', 'Woking': 'Conservative', 'Washington and Sunderland West': 'Labour', 'Motherwell and Wishaw': 'Scottish National', 'Romsey and Southampton North': 'Conservative', 'Coventry North East': 'Labour', 'Hornsey and Wood Green': 'Labour', 'East Renfrewshire': 'Scottish National', 'Sutton Coldfield': 'Conservative', 'North Durham': 'Labour', 'North West Durham': 'Conservative', 'Bristol South': 'Labour', 'Mid Worcestershire': 'Conservative', 'Dagenham and Rainham': 'Labour', 'Suffolk Coastal': 'Conservative', 'Newbury': 'Conservative', 'Birmingham Yardley': 'Labour', 'Loughborough': 'Conservative', 'Clwyd West': 'Conservative', 'Liverpool Walton': 'Labour', 'Haltemprice and Howden': 'Conservative', 'Gedling': 'Conservative', 'Carmarthen West and South Pembrokeshire': 'Conservative', 'South Shields': 'Labour', 'North Somerset': 'Conservative', 'Ayr, Carrick and Cumnock': 'Scottish National', 'Lincoln': 'Conservative', 'Swansea West': 'Labour Co-operative', 'Nottingham North': 'Labour Co-operative', 'Moray': 'Conservative', 'Belfast West': 'Sinn F\xc3\xa9in', 'Ceredigion': 'Plaid Cymru', 'Amber Valley': 'Conservative', 'Crawley': 'Conservative', 'Hampstead and Kilburn': 'Labour', 'Plymouth Moor View': 'Conservative', 'Caerphilly': 'Labour', 'Cannock Chase': 'Conservative', 'Bermondsey and Old Southwark': 'Labour', 'Derby South': 'Labour', 'Maidenhead': 'Conservative', 'Knowsley': 'Labour', 'Broxtowe': 'Conservative', 'Burton': 'Conservative', 'Hemsworth': 'Labour', 'Cynon Valley': 'Labour', 'North Herefordshire': 'Conservative', 'Ealing Southall': 'Labour', 'Wimbledon': 'Conservative', 'West Suffolk': 'Conservative', 'South Northamptonshire': 'Conservative', 'Runnymede and Weybridge': 'Conservative', 'Portsmouth North': 'Conservative', 'Erewash': 'Conservative', 'Aylesbury': 'Conservative', 'Blackpool North and Cleveleys': 'Conservative', 'Midlothian': 'Scottish National', 'Boston and Skegness': 'Conservative', 'Aberconwy': 'Conservative', 'Southampton Test': 'Labour', 'Worthing West': 'Conservative', 'Upper Bann': 'DUP', 'North East Derbyshire': 'Conservative', 'Meon Valley': 'Conservative', 'Stroud': 'Conservative', 'Bromley and Chislehurst': 'Conservative', 'Newry and Armagh': 'Sinn F\xc3\xa9in', 'Morley and Outwood': 'Conservative', 'Lancaster and Fleetwood': 'Labour', 'Guildford': 'Conservative', 'Plymouth Sutton and Devonport': 'Labour Co-operative', 'Birmingham Northfield': 'Conservative', 'Makerfield': 'Labour', 'Newcastle upon Tyne East': 'Labour', 'Fylde': 'Conservative', 'Rutland and Melton': 'Conservative', 'Ludlow': 'Conservative', 'North East Fife': 'Liberal Democrats', 'North Swindon': 'Conservative', 'Poole': 'Conservative', 'South Thanet': 'Conservative', 'Paisley and Renfrewshire North': 'Scottish National', 'Rhondda': 'Labour', 'Wycombe': 'Conservative', 'Wirral South': 'Labour', 'Barking': 'Labour', 'Tewkesbury': 'Conservative', 'Rayleigh and Wickford': 'Conservative', 'Huntingdon': 'Conservative', 'Fareham': 'Conservative', 'West Tyrone': 'Sinn F\xc3\xa9in', 'Bolsover': 'Conservative', 'Chingford and Woodford Green': 'Conservative', 'York Outer': 'Conservative', 'The Wrekin': 'Conservative', 'Tunbridge Wells': 'Conservative', 'Filton and Bradley Stoke': 'Conservative', 'Blaenau Gwent': 'Labour', 'Mid Norfolk': 'Conservative', 'Hackney South and Shoreditch': 'Labour Co-operative', 'Nottingham East': 'Labour', 'Ribble Valley': 'Conservative', 'Manchester Central': 'Labour Co-operative', 'Newcastle upon Tyne Central': 'Labour', 'Central Devon': 'Conservative', 'Stockport': 'Labour', 'York Central': 'Labour Co-operative', 'Arundel and South Downs': 'Conservative', 'North East Cambridgeshire': 'Conservative', 'Preseli Pembrokeshire': 'Conservative', 'Chesham and Amersham': 'Conservative', 'Ealing Central and Acton': 'Labour', 'Maidstone and The Weald': 'Conservative', 'Bedford': 'Labour', 'Thirsk and Malton': 'Conservative', 'Ruislip, Northwood and Pinner': 'Conservative', 'Kingston and Surbiton': 'Liberal Democrats', 'Spelthorne': 'Conservative', 'Wakefield': 'Conservative', 'Stockton North': 'Labour', 'Havant': 'Conservative', 'North Warwickshire': 'Conservative', 'Lewisham West and Penge': 'Labour', 'Wythenshawe and Sale East': 'Labour', 'Delyn': 'Conservative', 'Aldershot': 'Conservative', 'Windsor': 'Conservative', 'Oldham East and Saddleworth': 'Labour', 'Telford': 'Conservative', 'Mid Dorset and North Poole': 'Conservative', 'Sedgefield': 'Conservative', 'Darlington': 'Conservative', 'Stevenage': 'Conservative', 'Eddisbury': 'Conservative', 'Birmingham Selly Oak': 'Labour', 'Carshalton and Wallington': 'Conservative', 'Slough': 'Labour', 'North Thanet': 'Conservative', 'East Hampshire': 'Conservative', 'Easington': 'Labour', 'Leeds Central': 'Labour', 'Gravesham': 'Conservative', 'North Ayrshire and Arran': 'Scottish National', 'Colchester': 'Conservative', 'Arfon': 'Plaid Cymru', 'Harlow': 'Conservative', 'Doncaster North': 'Labour', 'Congleton': 'Conservative', 'Basingstoke': 'Conservative', 'Blackburn': 'Labour', 'Luton North': 'Labour', 'Yeovil': 'Conservative', 'Wokingham': 'Conservative', 'Blackpool South': 'Conservative', 'Horsham': 'Conservative', 'Newport West': 'Labour', 'Streatham': 'Labour', 'Lewes': 'Conservative', 'Wantage': 'Conservative', 'Richmond Park': 'Liberal Democrats', 'Scarborough and Whitby': 'Conservative', 'Middlesbrough': 'Labour', 'Watford': 'Conservative', 'Maldon': 'Conservative', 'Bishop Auckland': 'Conservative', 'Cardiff Central': 'Labour', 'Reigate': 'Conservative', 'Carlisle': 'Conservative', 'Berwickshire, Roxburgh and Selkirk': 'Conservative', 'Keighley': 'Conservative', 'Hayes and Harlington': 'Labour', 'Torbay': 'Conservative', 'Kingston upon Hull West and Hessle': 'Labour', 'Tiverton and Honiton': 'Conservative', 'Sherwood': 'Conservative', 'Blackley and Broughton': 'Labour', 'Inverness, Nairn, Badenoch and Strathspey': 'Scottish National', 'East Yorkshire': 'Conservative', 'Norwich South': 'Labour', 'Orpington': 'Conservative', 'Dartford': 'Conservative', 'Bury South': 'Conservative', 'Linlithgow and East Falkirk': 'Scottish National', 'Bracknell': 'Conservative', 'Monmouth': 'Conservative', 'Batley and Spen': 'Labour Co-operative', 'Foyle': 'SDLP', 'Chorley': 'Speaker', 'Mansfield': 'Conservative', 'Leyton and Wanstead': 'Labour', 'Daventry': 'Conservative', 'Hornchurch and Upminster': 'Conservative', 'Strangford': 'DUP', 'Glasgow Central': 'Scottish National', 'Bootle': 'Labour', 'Cleethorpes': 'Conservative', 'North Antrim': 'DUP', 'Devizes': 'Conservative', 'Nuneaton': 'Conservative', 'Enfield North': 'Labour', 'Hastings and Rye': 'Conservative', 'Livingston': 'Scottish National', 'Walsall South': 'Labour', 'Edinburgh East': 'Scottish National', 'Braintree': 'Conservative', 'Harrogate and Knaresborough': 'Conservative', 'Denton and Reddish': 'Labour', 'St Austell and Newquay': 'Conservative', 'Warley': 'Labour', 'Cardiff West': 'Labour', 'Esher and Walton': 'Conservative', 'Kingston upon Hull East': 'Labour', 'New Forest West': 'Conservative', 'Doncaster Central': 'Labour', 'South Derbyshire': 'Conservative', 'Brent Central': 'Labour', 'Belfast South': 'SDLP', 'Cumbernauld, Kilsyth and Kirkintilloch East': 'Scottish National', 'North Wiltshire': 'Conservative', 'East Ham': 'Labour', 'Bolton West': 'Conservative', 'Oldham West and Royton': 'Labour Co-operative', 'Aberdeen North': 'Scottish National', 'Ashford': 'Conservative', 'Beaconsfield': 'Conservative', 'North Devon': 'Conservative', 'Corby': 'Conservative', 'East Dunbartonshire': 'Scottish National', 'Greenwich and Woolwich': 'Labour', 'St Helens South and Whiston': 'Labour', 'East Antrim': 'DUP', 'Ellesmere Port and Neston': 'Labour', 'Paisley and Renfrewshire South': 'Scottish National', 'Edinburgh South West': 'Scottish National', 'Leicester East': 'Labour', 'South West Norfolk': 'Conservative', 'Leeds East': 'Labour', 'North Cornwall': 'Conservative', 'West Dunbartonshire': 'Scottish National', 'Pontypridd': 'Labour', 'Shipley': 'Conservative', 'Basildon and Billericay': 'Conservative', 'Brentford and Isleworth': 'Labour', 'Wentworth and Dearne': 'Labour', 'Islington North': 'Labour', 'Folkestone and Hythe': 'Conservative', 'Swansea East': 'Labour', 'Hazel Grove': 'Conservative', 'Hexham': 'Conservative', 'Mid Bedfordshire': 'Conservative', 'Pudsey': 'Conservative', 'East Kilbride, Strathaven and Lesmahagow': 'Scottish National', 'Liverpool Riverside': 'Labour', 'Stoke-on-Trent Central': 'Conservative', 'Harborough': 'Conservative', 'Workington': 'Conservative', 'Elmet and Rothwell': 'Conservative', 'Edinburgh North and Leith': 'Scottish National', 'Warrington South': 'Conservative', 'Stoke-on-Trent South': 'Conservative', 'Shrewsbury and Atcham': 'Conservative', 'Merthyr Tydfil and Rhymney': 'Labour', 'Glasgow South': 'Scottish National', 'North West Cambridgeshire': 'Conservative', 'Sheffield Heeley': 'Labour', 'Bromsgrove': 'Conservative', 'Edinburgh West': 'Liberal Democrats', 'Old Bexley and Sidcup': 'Conservative', 'Croydon Central': 'Labour', 'Thurrock': 'Conservative', 'Bosworth': 'Conservative', 'Chelsea and Fulham': 'Conservative', 'Rutherglen and Hamilton West': 'Scottish National', 'Hackney North and Stoke Newington': 'Labour', 'Charnwood': 'Conservative', 'North East Somerset': 'Conservative', 'East Worthing and Shoreham': 'Conservative', 'Christchurch': 'Conservative', 'Tonbridge and Malling': 'Conservative', 'South East Cambridgeshire': 'Conservative', 'Faversham and Mid Kent': 'Conservative', 'Don Valley': 'Conservative', 'Birmingham Hodge Hill': 'Labour', 'Glasgow North West': 'Scottish National', 'Cities of London and Westminster': 'Conservative', 'Tottenham': 'Labour', 'Putney': 'Labour', 'Selby and Ainsty': 'Conservative', 'Kingswood': 'Conservative', 'Brecon and Radnorshire': 'Conservative', 'Redcar': 'Conservative', 'Airdrie and Shotts': 'Scottish National', 'Southampton Itchen': 'Conservative', 'Blyth Valley': 'Conservative', 'Mitcham and Morden': 'Labour', 'Central Suffolk and North Ipswich': 'Conservative', 'Rugby': 'Conservative', 'Banbury': 'Conservative', 'Bexhill and Battle': 'Conservative', 'Hemel Hempstead': 'Conservative', 'Uxbridge and South Ruislip': 'Conservative', 'Hertford and Stortford': 'Conservative', 'Wealden': 'Conservative', 'Croydon North': 'Labour Co-operative', 'St Ives': 'Conservative', 'South Down': 'Sinn F\xc3\xa9in', 'Liverpool West Derby': 'Labour', 'Perth and North Perthshire': 'Scottish National', 'Dwyfor Meirionnydd': 'Plaid Cymru', 'Dunfermline and West Fife': 'Scottish National', 'Bolton North East': 'Conservative', 'Portsmouth South': 'Labour', 'Surrey Heath': 'Conservative', 'Leigh': 'Conservative', 'Houghton and Sunderland South': 'Labour', 'Sunderland Central': 'Labour', 'Hyndburn': 'Conservative', 'Bridgend': 'Conservative', 'West Worcestershire': 'Conservative', 'Bognor Regis and Littlehampton': 'Conservative', 'Rother Valley': 'Conservative', 'Tatton': 'Conservative', 'Manchester Gorton': 'Labour', 'East Lothian': 'Scottish National', 'Glasgow North': 'Scottish National', 'South West Wiltshire': 'Conservative', 'Meriden': 'Conservative', 'South Dorset': 'Conservative', 'Glasgow North East': 'Scottish National', 'Skipton and Ripon': 'Conservative', 'Worsley and Eccles South': 'Labour', 'Jarrow': 'Labour', 'Taunton Deane': 'Conservative', 'Coventry North West': 'Labour', 'Sleaford and North Hykeham': 'Conservative', 'Gainsborough': 'Conservative', 'Caithness, Sutherland and Easter Ross': 'Liberal Democrats', 'Na h-Eileanan an Iar': 'Scottish National', 'Macclesfield': 'Conservative', 'Bridgwater and West Somerset': 'Conservative', 'South Suffolk': 'Conservative', 'Erith and Thamesmead': 'Labour', 'South Ribble': 'Conservative', 'Reading West': 'Conservative', 'Torridge and West Devon': 'Conservative', 'Nottingham South': 'Labour', 'West Dorset': 'Conservative', 'Newport East': 'Labour', 'Bournemouth West': 'Conservative', 'Canterbury': 'Labour', 'Westminster North': 'Labour', 'North West Leicestershire': 'Conservative', 'South West Devon': 'Conservative', 'North West Norfolk': 'Conservative', 'Bury North': 'Conservative', 'Aldridge-Brownhills': 'Conservative', 'Montgomeryshire': 'Conservative', 'Preston': 'Labour Co-operative', 'Brent North': 'Labour', 'North Tyneside': 'Labour', 'North East Hampshire': 'Conservative', 'Birmingham Edgbaston': 'Labour Co-operative', 'East Surrey': 'Conservative', 'Penrith and The Border': 'Conservative', 'Romford': 'Conservative', 'Salford and Eccles': 'Labour', 'Wolverhampton South East': 'Labour', 'Bethnal Green and Bow': 'Labour', 'Vauxhall': 'Labour Co-operative', 'Central Ayrshire': 'Scottish National', 'Rochford and Southend East': 'Conservative', 'Argyll and Bute': 'Scottish National', 'Isle of Wight': 'Conservative', 'Wolverhampton North East': 'Conservative', 'Barnsley East': 'Labour', 'Belfast East': 'DUP', 'Gillingham and Rainham': 'Conservative', 'Islwyn': 'Labour Co-operative', 'Dulwich and West Norwood': 'Labour', 'Lichfield': 'Conservative', 'Birmingham Hall Green': 'Labour', 'Burnley': 'Conservative', 'Wells': 'Conservative', 'West Aberdeenshire and Kincardine': 'Conservative', 'Cheadle': 'Conservative', 'South West Hertfordshire': 'Conservative', 'Glasgow East': 'Scottish National', 'Leicester West': 'Labour', 'Wellingborough': 'Conservative', 'Gosport': 'Conservative', 'West Ham': 'Labour', 'Birkenhead': 'Labour', 'Poplar and Limehouse': 'Labour', 'Carmarthen East and Dinefwr': 'Plaid Cymru', 'Clacton': 'Conservative', 'South Norfolk': 'Conservative', 'Dover': 'Conservative', 'Derbyshire Dales': 'Conservative', 'Sutton and Cheam': 'Conservative', 'Norwich North': 'Conservative', 'Dumfries and Galloway': 'Conservative', 'Coatbridge, Chryston and Bellshill': 'Scottish National', 'Eastleigh': 'Conservative', 'Worcester': 'Conservative', 'Ilford South': 'Labour', 'Saffron Walden': 'Conservative', 'City of Chester': 'Labour', 'Eltham': 'Labour'}
| 11,083.5
| 22,166
| 0.723282
| 2,218
| 22,167
| 7.228133
| 0.341749
| 0.047904
| 0.02757
| 0.005676
| 0.00237
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0008
| 0.097352
| 22,167
| 1
| 22,167
| 22,167
| 0.80044
| 0
| 0
| 0
| 0
| 0
| 0.76465
| 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
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7d07edb26f61894f9d059d3d710191cb31f400ba
| 3,355
|
py
|
Python
|
arrow/commands/cmd_annotations.py
|
trstickland/python-apollo
|
04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb
|
[
"MIT"
] | null | null | null |
arrow/commands/cmd_annotations.py
|
trstickland/python-apollo
|
04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb
|
[
"MIT"
] | null | null | null |
arrow/commands/cmd_annotations.py
|
trstickland/python-apollo
|
04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb
|
[
"MIT"
] | null | null | null |
import click
from arrow.commands.annotations.add_attribute import cli as add_attribute
from arrow.commands.annotations.add_comment import cli as add_comment
from arrow.commands.annotations.add_dbxref import cli as add_dbxref
from arrow.commands.annotations.add_feature import cli as add_feature
from arrow.commands.annotations.add_transcript import cli as add_transcript
from arrow.commands.annotations.delete_attribute import cli as delete_attribute
from arrow.commands.annotations.delete_dbxref import cli as delete_dbxref
from arrow.commands.annotations.delete_feature import cli as delete_feature
from arrow.commands.annotations.delete_sequence_alteration import cli as delete_sequence_alteration
from arrow.commands.annotations.duplicate_transcript import cli as duplicate_transcript
from arrow.commands.annotations.flip_strand import cli as flip_strand
from arrow.commands.annotations.get_comments import cli as get_comments
from arrow.commands.annotations.get_feature_sequence import cli as get_feature_sequence
from arrow.commands.annotations.get_features import cli as get_features
from arrow.commands.annotations.get_gff3 import cli as get_gff3
from arrow.commands.annotations.get_search_tools import cli as get_search_tools
from arrow.commands.annotations.get_sequence_alterations import cli as get_sequence_alterations
from arrow.commands.annotations.merge_exons import cli as merge_exons
from arrow.commands.annotations.set_boundaries import cli as set_boundaries
from arrow.commands.annotations.set_description import cli as set_description
from arrow.commands.annotations.set_longest_orf import cli as set_longest_orf
from arrow.commands.annotations.set_name import cli as set_name
from arrow.commands.annotations.set_readthrough_stop_codon import cli as set_readthrough_stop_codon
from arrow.commands.annotations.set_sequence import cli as set_sequence
from arrow.commands.annotations.set_status import cli as set_status
from arrow.commands.annotations.set_symbol import cli as set_symbol
from arrow.commands.annotations.set_translation_end import cli as set_translation_end
from arrow.commands.annotations.set_translation_start import cli as set_translation_start
from arrow.commands.annotations.update_attribute import cli as update_attribute
from arrow.commands.annotations.update_dbxref import cli as update_dbxref
@click.group()
def cli():
pass
cli.add_command(add_attribute)
cli.add_command(add_comment)
cli.add_command(add_dbxref)
cli.add_command(add_feature)
cli.add_command(add_transcript)
cli.add_command(delete_attribute)
cli.add_command(delete_dbxref)
cli.add_command(delete_feature)
cli.add_command(delete_sequence_alteration)
cli.add_command(duplicate_transcript)
cli.add_command(flip_strand)
cli.add_command(get_comments)
cli.add_command(get_feature_sequence)
cli.add_command(get_features)
cli.add_command(get_gff3)
cli.add_command(get_search_tools)
cli.add_command(get_sequence_alterations)
cli.add_command(merge_exons)
cli.add_command(set_boundaries)
cli.add_command(set_description)
cli.add_command(set_longest_orf)
cli.add_command(set_name)
cli.add_command(set_readthrough_stop_codon)
cli.add_command(set_sequence)
cli.add_command(set_status)
cli.add_command(set_symbol)
cli.add_command(set_translation_end)
cli.add_command(set_translation_start)
cli.add_command(update_attribute)
cli.add_command(update_dbxref)
| 48.623188
| 99
| 0.877496
| 514
| 3,355
| 5.441634
| 0.093385
| 0.096532
| 0.182338
| 0.300322
| 0.392563
| 0.030032
| 0
| 0
| 0
| 0
| 0
| 0.000958
| 0.066766
| 3,355
| 68
| 100
| 49.338235
| 0.892367
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.015625
| true
| 0.015625
| 0.484375
| 0
| 0.5
| 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
| 0
| 0
|
0
| 4
|
7d091ce7676e9379cd2d3466d27ffd9cbe7f4968
| 429
|
py
|
Python
|
test/test_callnumber.py
|
BCLibraries/bc-lib-search
|
68e8404d9529d20e6936a95c86323abd92401ce3
|
[
"MIT"
] | null | null | null |
test/test_callnumber.py
|
BCLibraries/bc-lib-search
|
68e8404d9529d20e6936a95c86323abd92401ce3
|
[
"MIT"
] | null | null | null |
test/test_callnumber.py
|
BCLibraries/bc-lib-search
|
68e8404d9529d20e6936a95c86323abd92401ce3
|
[
"MIT"
] | null | null | null |
from unittest import TestCase
import indexer.callnumber as CallNumber
class TestCallnumber(TestCase):
def test_normalization(self):
self.assertEqual('QL 073700C250G650 000 2012', CallNumber.normalize('QL737.C25 G65 2012'))
self.assertEqual('HV 088100P725 000 000 2011', CallNumber.normalize('HV881 .P725 2011'))
self.assertEqual('E 017300K870 000 000 2013', CallNumber.normalize('E173 .K87 2013'))
| 42.9
| 98
| 0.745921
| 52
| 429
| 6.134615
| 0.615385
| 0.141066
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.239669
| 0.153846
| 429
| 9
| 99
| 47.666667
| 0.639118
| 0
| 0
| 0
| 0
| 0
| 0.293706
| 0
| 0
| 0
| 0
| 0
| 0.428571
| 1
| 0.142857
| false
| 0
| 0.285714
| 0
| 0.571429
| 0
| 0
| 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 | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
7d09f559b9cc30732a23f7eb79a37b3318f51344
| 189
|
py
|
Python
|
controlpanel/frontend/views/help.py
|
ministryofjustice/analytics-platform-control-panel-public
|
289143280ed79a05be470d57dc3b1fd9179758cf
|
[
"MIT"
] | null | null | null |
controlpanel/frontend/views/help.py
|
ministryofjustice/analytics-platform-control-panel-public
|
289143280ed79a05be470d57dc3b1fd9179758cf
|
[
"MIT"
] | 93
|
2021-08-09T16:09:59.000Z
|
2022-03-28T16:13:31.000Z
|
controlpanel/frontend/views/help.py
|
ministryofjustice/analytics-platform-control-panel-public
|
289143280ed79a05be470d57dc3b1fd9179758cf
|
[
"MIT"
] | 2
|
2021-03-30T15:13:24.000Z
|
2021-04-11T06:26:09.000Z
|
from django.views.generic.base import TemplateView
from controlpanel.oidc import OIDCLoginRequiredMixin
class Help(OIDCLoginRequiredMixin, TemplateView):
template_name = "help.html"
| 23.625
| 52
| 0.825397
| 20
| 189
| 7.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 189
| 7
| 53
| 27
| 0.922619
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ada49931c6972382f3b4fa567218f0aaa21d4aee
| 209
|
py
|
Python
|
Login-App/app/modules.py
|
No-Name-404/YouTube-Kivy
|
1c4e1d5419cdf02e782090002293115290155e31
|
[
"MIT"
] | 3
|
2020-07-13T16:29:16.000Z
|
2020-11-09T10:44:24.000Z
|
Login-App/app/modules.py
|
No-Name-404/YouTube-Kivy
|
1c4e1d5419cdf02e782090002293115290155e31
|
[
"MIT"
] | null | null | null |
Login-App/app/modules.py
|
No-Name-404/YouTube-Kivy
|
1c4e1d5419cdf02e782090002293115290155e31
|
[
"MIT"
] | 7
|
2020-08-04T17:18:36.000Z
|
2021-07-01T13:45:48.000Z
|
from kivymd.uix.menu import MDDropdownMenu
from kivymd.uix.floatlayout import MDFloatLayout
from kivymd.toast import toast
from kivy.properties import ObjectProperty
from kivy.lang import Builder
import os
| 23.222222
| 48
| 0.84689
| 29
| 209
| 6.103448
| 0.517241
| 0.169492
| 0.146893
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119617
| 209
| 8
| 49
| 26.125
| 0.961957
| 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
| 0
| 0
|
0
| 4
|
adc065d0ff240f1f39bf10accfbe0e429fb0f022
| 201
|
py
|
Python
|
v2.5.7/toontown/building/KnockKnockJokes.py
|
TTOFFLINE-LEAK/ttoffline
|
bb0e91704a755d34983e94288d50288e46b68380
|
[
"MIT"
] | 4
|
2019-07-01T15:46:43.000Z
|
2021-07-23T16:26:48.000Z
|
v2.5.7/toontown/building/KnockKnockJokes.py
|
TTOFFLINE-LEAK/ttoffline
|
bb0e91704a755d34983e94288d50288e46b68380
|
[
"MIT"
] | 1
|
2019-06-29T03:40:05.000Z
|
2021-06-13T01:15:16.000Z
|
v2.5.7/toontown/building/KnockKnockJokes.py
|
TTOFFLINE-LEAK/ttoffline
|
bb0e91704a755d34983e94288d50288e46b68380
|
[
"MIT"
] | 4
|
2019-07-28T21:18:46.000Z
|
2021-02-25T06:37:25.000Z
|
from toontown.toonbase import TTLocalizer
KnockKnockJokes = TTLocalizer.KnockKnockJokes
KnockKnockContestJokes = TTLocalizer.KnockKnockContestJokes
KnockKnockDoorNames = TTLocalizer.KnockKnockDoorNames
| 50.25
| 59
| 0.905473
| 14
| 201
| 13
| 0.571429
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.059701
| 201
| 4
| 60
| 50.25
| 0.962963
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 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
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
adc5ffe2da240d3be1e51cc56123cf16cc9c8007
| 218
|
py
|
Python
|
intent/ingestion/TextParser.py
|
rgeorgi/intent
|
9920798c126f6d354029f7bb0a345e7cdb649f3a
|
[
"MIT"
] | 3
|
2016-08-05T01:11:57.000Z
|
2017-08-26T15:35:51.000Z
|
intent/ingestion/TextParser.py
|
rgeorgi/intent
|
9920798c126f6d354029f7bb0a345e7cdb649f3a
|
[
"MIT"
] | 2
|
2016-03-01T22:41:24.000Z
|
2016-09-14T18:39:25.000Z
|
intent/ingestion/TextParser.py
|
rgeorgi/intent
|
9920798c126f6d354029f7bb0a345e7cdb649f3a
|
[
"MIT"
] | null | null | null |
'''
Created on Oct 31, 2013/.>"
@author: rgeorgi
'''
class TextParser(object):
'''
classdocs
'''
def parse(self):
pass
def __init__(self):
'''
Constructor
'''
class ParserException(Exception):
pass
| 10.380952
| 33
| 0.623853
| 23
| 218
| 5.73913
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034682
| 0.206422
| 218
| 21
| 34
| 10.380952
| 0.728324
| 0.307339
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.333333
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
add15e500bfedf73fcff20f645549a97dd4ebccb
| 6,964
|
py
|
Python
|
data/models/sources.py
|
arjenpoppe/istimewa-bvp
|
d925bd475967e60fc7e80de8f2225c5ed85726fb
|
[
"MIT"
] | null | null | null |
data/models/sources.py
|
arjenpoppe/istimewa-bvp
|
d925bd475967e60fc7e80de8f2225c5ed85726fb
|
[
"MIT"
] | null | null | null |
data/models/sources.py
|
arjenpoppe/istimewa-bvp
|
d925bd475967e60fc7e80de8f2225c5ed85726fb
|
[
"MIT"
] | null | null | null |
from django.db import models
from django.db.models import Sum
class Ultimo(models.Model):
code = models.CharField(max_length=50, primary_key=True)
code_contract = models.CharField(max_length=30, blank=True, null=True)
voortgangsstatus = models.CharField(max_length=30, blank=True, null=True)
omschrijving_jobsoort = models.CharField(max_length=40, blank=True, null=True)
sap_nr = models.CharField(max_length=30, blank=True, null=True)
vervolgjob_van = models.CharField(max_length=30, blank=True, null=True)
omschrijving = models.TextField(blank=True, null=True)
code_complex = models.CharField(max_length=30, blank=True, null=True)
code_object = models.CharField(max_length=30, blank=True, null=True)
omschrijving_object = models.CharField(max_length=50, blank=True, null=True)
storingsnummer = models.CharField(max_length=50, blank=True, null=True)
melddatum = models.DateTimeField(blank=True, null=True)
gepl_startdatum = models.DateTimeField(blank=True, null=True)
vertrektijd_thuis = models.DateTimeField(blank=True, null=True)
aankomsttijd = models.DateTimeField(blank=True, null=True)
functioneel_herstel_tijd = models.DateTimeField(blank=True, null=True)
gereedmeldtijd = models.DateTimeField(blank=True, null=True)
vertrektijd = models.DateTimeField(blank=True, null=True)
aankomsttijd_thuis = models.DateTimeField(blank=True, null=True)
medewerker = models.CharField(max_length=30, blank=True, null=True)
code_installatie = models.CharField(max_length=30, blank=True, null=True)
code_installatie2 = models.CharField(max_length=25, blank=True, null=True)
installatie = models.TextField(blank=True, null=True)
medewerker2 = models.CharField(max_length=40, blank=True, null=True)
meldtext = models.TextField(blank=True, null=True)
functiehersteltijd_voor = models.DateTimeField(blank=True, null=True)
streefdatum_gereed_voor = models.DateTimeField(blank=True, null=True)
info_tekst = models.TextField(blank=True, null=True)
storingsoorzaak = models.CharField(max_length=100, blank=True, null=True)
omschrijving_contract = models.CharField(max_length=100, blank=True, null=True)
prioriteit = models.CharField(max_length=40, blank=True, null=True)
vestiging = models.CharField(max_length=10, blank=True, null=True)
vakgroep = models.CharField(max_length=50, blank=True, null=True)
leverancier = models.CharField(max_length=60, blank=True, null=True)
stremming_ja = models.BooleanField(blank=True, null=True)
scheepvaart = models.BooleanField(blank=True, null=True)
landverkeer = models.BooleanField(blank=True, null=True)
geplande_stremming = models.BooleanField(blank=True, null=True)
stremming_van = models.DateTimeField(blank=True, null=True)
stremming_tot = models.DateTimeField(blank=True, null=True)
stremmingsduur = models.FloatField(blank=True, null=True)
geplande_uren = models.CharField(max_length=30, blank=True, null=True)
geaccepteerd = models.CharField(max_length=5, blank=True, null=True)
code_medewerker = models.CharField(max_length=10, blank=True, null=True)
medewerker3 = models.CharField(max_length=30, blank=True, null=True)
datum_geaccepteerd = models.DateTimeField(blank=True, null=True)
meerwerk = models.BooleanField(blank=True, null=True)
code_document = models.CharField(max_length=10, blank=True, null=True)
omschrijving_document = models.CharField(max_length=100, blank=True, null=True)
code_jobplan = models.CharField(max_length=10, blank=True, null=True)
omschrijving_jobplan = models.CharField(max_length=100, blank=True, null=True)
omschrijving_job = models.TextField(blank=True, null=True)
werkinstructie = models.TextField(blank=True, null=True)
observatietekst = models.TextField(blank=True, null=True)
onderzoektekst = models.TextField(blank=True, null=True)
conclusietekst = models.TextField(blank=True, null=True)
uitgevoerde_werkzaamheden = models.TextField(blank=True, null=True)
controletekst = models.TextField(blank=True, null=True)
opmerking_advies = models.TextField(blank=True, null=True)
afbeelding = models.CharField(max_length=100, blank=True, null=True)
afbeelding2 = models.CharField(max_length=100, blank=True, null=True)
afbeelding3 = models.CharField(max_length=100, blank=True, null=True)
afbeelding4 = models.CharField(max_length=100, blank=True, null=True)
gewerkte_uren = models.FloatField(blank=True, null=True)
installatie2 = models.CharField(max_length=100, blank=True, null=True)
installatie3 = models.CharField(max_length=100, blank=True, null=True)
code_installatie3 = models.CharField(max_length=30, blank=True, null=True)
gevalideerd_door_rws = models.BooleanField(blank=True, null=True)
ontvangen_rws = models.DateTimeField(blank=True, null=True)
def __str__(self):
return self.code
class Sap(models.Model):
object = models.CharField(max_length=100, null=True, blank=True)
wbs_element = models.CharField(max_length=100, null=True, blank=True)
objectomschrijving = models.CharField(max_length=100, null=True, blank=True)
kost_soort = models.CharField(max_length=100, null=True, blank=True)
omschrijving = models.CharField(max_length=255, null=True, blank=True)
personeelsnummer = models.CharField(max_length=100, null=True, blank=True)
naam_kost_soort = models.CharField(max_length=100, null=True, blank=True)
achternaam_voornaam = models.CharField(max_length=100, null=True, blank=True)
per = models.IntegerField(blank=True, null=True)
aan_afw = models.CharField(max_length=100, null=True, blank=True)
parprs = models.CharField(max_length=100, null=True, blank=True)
doc_number = models.CharField(max_length=100, null=True, blank=True)
doc_datum = models.DateField(blank=True, null=True)
boek_datum = models.DateField(blank=True, null=True)
hoeveelheid_totaal = models.FloatField(blank=True, null=True)
he = models.CharField(max_length=100, null=True, blank=True)
waarde_co_valuta = models.FloatField(blank=True, null=True)
omschrijving2 = models.CharField(max_length=100, null=True, blank=True)
categorie = models.CharField(max_length=100, null=True, blank=True)
jaar = models.CharField(max_length=255, null=True, blank=True)
maand = models.CharField(max_length=255, null=True, blank=True)
week = models.CharField(max_length=255, null=True, blank=True)
surcharge = models.CharField(max_length=255, null=True, blank=True)
overhead = models.CharField(max_length=255, null=True, blank=True)
besteltekst = models.TextField(blank=True, null=True)
def totaal_uren_per_activiteit(self):
data = self.objects.values('object', 'objectomschrijving') \
.filter(he='H') \
.order_by('object') \
.annotate(total=Sum('hoeveelheid_totaal'))
return data
| 59.016949
| 83
| 0.751867
| 919
| 6,964
| 5.573449
| 0.161045
| 0.163413
| 0.187817
| 0.245607
| 0.777821
| 0.723741
| 0.526552
| 0.45041
| 0.45041
| 0.160875
| 0
| 0.024132
| 0.131246
| 6,964
| 117
| 84
| 59.521368
| 0.822479
| 0
| 0
| 0
| 0
| 0
| 0.00704
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.018868
| false
| 0
| 0.018868
| 0.009434
| 0.962264
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
addacf3ab435b2778eded93e1e1f05193e7b0d60
| 147
|
py
|
Python
|
novoed/apps.py
|
umarmughal824/bootcamp-ecommerce
|
681bcc788a66867b8f240790c0ed33680b73932b
|
[
"BSD-3-Clause"
] | 2
|
2018-06-20T19:37:03.000Z
|
2021-01-06T09:51:40.000Z
|
novoed/apps.py
|
mitodl/bootcamp-ecommerce
|
ba7d6aefe56c6481ae2a5afc84cdd644538b6d50
|
[
"BSD-3-Clause"
] | 1,226
|
2017-02-23T14:52:28.000Z
|
2022-03-29T13:19:54.000Z
|
novoed/apps.py
|
umarmughal824/bootcamp-ecommerce
|
681bcc788a66867b8f240790c0ed33680b73932b
|
[
"BSD-3-Clause"
] | 3
|
2017-03-20T03:51:27.000Z
|
2021-03-19T15:54:31.000Z
|
"""App config for NovoEd"""
from django.apps import AppConfig
class NovoEdConfig(AppConfig):
"""AppConfig for NovoEd"""
name = "novoed"
| 16.333333
| 33
| 0.687075
| 17
| 147
| 5.941176
| 0.705882
| 0.178218
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183673
| 147
| 8
| 34
| 18.375
| 0.841667
| 0.285714
| 0
| 0
| 0
| 0
| 0.06383
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
adeec563823441fc2c53c6500e0bc39b5d919621
| 20
|
py
|
Python
|
src/test/resources/files/byteString.py
|
rendner/py-prefix-fstring-plugin
|
c2e2ca7cca1b3833e988543fda5bce05c6860309
|
[
"MIT"
] | null | null | null |
src/test/resources/files/byteString.py
|
rendner/py-prefix-fstring-plugin
|
c2e2ca7cca1b3833e988543fda5bce05c6860309
|
[
"MIT"
] | null | null | null |
src/test/resources/files/byteString.py
|
rendner/py-prefix-fstring-plugin
|
c2e2ca7cca1b3833e988543fda5bce05c6860309
|
[
"MIT"
] | 1
|
2021-05-24T09:32:06.000Z
|
2021-05-24T09:32:06.000Z
|
x = b'test {<caret>'
| 20
| 20
| 0.55
| 4
| 20
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 20
| 1
| 20
| 20
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0.619048
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
adfd1e69659b04c25ea821b79ed299407111e2de
| 162
|
py
|
Python
|
Spider/DouBanSpider/htmlStudy/script.py
|
Rdjroot/BookLadder
|
d4e1f90572f2dda2e7c25890b99c965ded0f02c8
|
[
"MIT"
] | null | null | null |
Spider/DouBanSpider/htmlStudy/script.py
|
Rdjroot/BookLadder
|
d4e1f90572f2dda2e7c25890b99c965ded0f02c8
|
[
"MIT"
] | null | null | null |
Spider/DouBanSpider/htmlStudy/script.py
|
Rdjroot/BookLadder
|
d4e1f90572f2dda2e7c25890b99c965ded0f02c8
|
[
"MIT"
] | null | null | null |
# -*- coding = utf-8 -*-
# @Time:2021/2/2821:58
# @Author:Linyu
# @Software:PyCharm
def response(flow):
print(flow.request.url)
print(flow.response.text)
| 20.25
| 29
| 0.654321
| 23
| 162
| 4.608696
| 0.826087
| 0.169811
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086957
| 0.148148
| 162
| 8
| 29
| 20.25
| 0.681159
| 0.462963
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.333333
| 0.666667
| 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
| 0
| 0
| 1
|
0
| 4
|
bc080a96d9d90e97646ae956129aaa79b197d5b0
| 284
|
py
|
Python
|
000577MyerPy/000577_20_tuple_20190915.py
|
SafonovMikhail/python_000577
|
739f764e80f1ca354386f00b8e9db1df8c96531d
|
[
"Apache-2.0"
] | null | null | null |
000577MyerPy/000577_20_tuple_20190915.py
|
SafonovMikhail/python_000577
|
739f764e80f1ca354386f00b8e9db1df8c96531d
|
[
"Apache-2.0"
] | null | null | null |
000577MyerPy/000577_20_tuple_20190915.py
|
SafonovMikhail/python_000577
|
739f764e80f1ca354386f00b8e9db1df8c96531d
|
[
"Apache-2.0"
] | null | null | null |
states_in_order_of_founding = ("Delaware", "Pennsylvania", "New Jersey", "Georgia")
# You use parentheses instead of square brackets.
print(states_in_order_of_founding)
second_state_founded = states_in_order_of_founding[1]
print("The second state founded was " + second_state_founded)
| 56.8
| 83
| 0.816901
| 41
| 284
| 5.268293
| 0.560976
| 0.111111
| 0.180556
| 0.208333
| 0.319444
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003876
| 0.091549
| 284
| 5
| 84
| 56.8
| 0.833333
| 0.165493
| 0
| 0
| 0
| 0
| 0.279661
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 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
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
70c9436b0a9830ed064107faecae7b3cfc793dbd
| 976
|
py
|
Python
|
bg_backend/bitglitter/config/presetmodels.py
|
MarkMichon1/BitGlitter-Backend
|
af399d82b19a7828b15ea1789bc980987f1049fe
|
[
"MIT"
] | 2
|
2021-07-20T06:31:41.000Z
|
2021-07-21T11:29:33.000Z
|
bg_backend/bitglitter/config/presetmodels.py
|
MarkMichon1/BitGlitter-Backend
|
af399d82b19a7828b15ea1789bc980987f1049fe
|
[
"MIT"
] | null | null | null |
bg_backend/bitglitter/config/presetmodels.py
|
MarkMichon1/BitGlitter-Backend
|
af399d82b19a7828b15ea1789bc980987f1049fe
|
[
"MIT"
] | null | null | null |
from sqlalchemy import Boolean, Column, DateTime, Integer, String
from datetime import datetime
from bg_backend.bitglitter.config.config import engine, SQLBaseClass
class Preset(SQLBaseClass):
__tablename__ = 'presets'
__abstract__ = False
nickname = Column(String, unique=True, nullable=False)
datetime_created = Column(DateTime, default=datetime.now)
output_mode = Column(String, nullable=False)
compression_enabled = Column(Boolean, nullable=False)
scrypt_n = Column(Integer, nullable=False)
scrypt_r = Column(Integer, nullable=False)
scrypt_p = Column(Integer, nullable=False)
cpu_cores = Column(Integer, nullable=False)
stream_palette_id = Column(String, nullable=False)
pixel_width = Column(Integer, nullable=False)
block_height = Column(Integer, nullable=False)
block_width = Column(Integer, nullable=False)
frames_per_second = Column(Integer, nullable=False)
SQLBaseClass.metadata.create_all(engine)
| 33.655172
| 68
| 0.760246
| 115
| 976
| 6.243478
| 0.434783
| 0.21727
| 0.233983
| 0.289694
| 0.225627
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150615
| 976
| 28
| 69
| 34.857143
| 0.866104
| 0
| 0
| 0
| 0
| 0
| 0.007172
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.15
| 0
| 0.95
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
70dc80c193b90b56bd1425d5c7f4eee128cc823b
| 210
|
py
|
Python
|
src/window.py
|
ytyaru/Python.Pyxel.Draw.Rect.20200331084747
|
2fd2f59b54d091c62058ebfe1b7b71b54270302a
|
[
"CC0-1.0"
] | null | null | null |
src/window.py
|
ytyaru/Python.Pyxel.Draw.Rect.20200331084747
|
2fd2f59b54d091c62058ebfe1b7b71b54270302a
|
[
"CC0-1.0"
] | null | null | null |
src/window.py
|
ytyaru/Python.Pyxel.Draw.Rect.20200331084747
|
2fd2f59b54d091c62058ebfe1b7b71b54270302a
|
[
"CC0-1.0"
] | null | null | null |
#!/usr/bin/env python3
# coding: utf8
import pyxel
def update(): pass
def draw():
pyxel.cls(0)
pyxel.rect(0, 0, 64, 64, 8) # x, y, w, h, col
pyxel.init(256, 256, border_width=0)
pyxel.run(update, draw)
| 21
| 49
| 0.642857
| 39
| 210
| 3.435897
| 0.692308
| 0.089552
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098266
| 0.17619
| 210
| 9
| 50
| 23.333333
| 0.676301
| 0.238095
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| true
| 0.142857
| 0.142857
| 0
| 0.428571
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
70de5bb1f10d5e1f75e784988744163b9704a457
| 249
|
py
|
Python
|
main/models/pretreated_query.py
|
wissembrdj/welink
|
ebc0cd4742578ad22014bd8067796e8cc1869f02
|
[
"MIT"
] | null | null | null |
main/models/pretreated_query.py
|
wissembrdj/welink
|
ebc0cd4742578ad22014bd8067796e8cc1869f02
|
[
"MIT"
] | null | null | null |
main/models/pretreated_query.py
|
wissembrdj/welink
|
ebc0cd4742578ad22014bd8067796e8cc1869f02
|
[
"MIT"
] | null | null | null |
class PretreatedQuery:
'''
DBpedia resultat
'''
def __init__(self, mentions_list, detected_ne):
'''
Constructor
'''
self.mentions_list=mentions_list
self.detected_ne=detected_ne
| 19.153846
| 52
| 0.566265
| 22
| 249
| 5.954545
| 0.545455
| 0.274809
| 0.244275
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.345382
| 249
| 12
| 53
| 20.75
| 0.803681
| 0.11245
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 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
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
70e10233b355c35569a3f81ace4229dac058fdfb
| 121
|
py
|
Python
|
test/news_pipeline/news_monitor_test.py
|
XinliWang/NewsCrawler
|
43ac9ab5251bc3274d34e3416fa159fc30f3a83e
|
[
"MIT"
] | 1
|
2019-02-21T07:22:53.000Z
|
2019-02-21T07:22:53.000Z
|
test/news_pipeline/news_monitor_test.py
|
XinliWang/NewsCrawler
|
43ac9ab5251bc3274d34e3416fa159fc30f3a83e
|
[
"MIT"
] | null | null | null |
test/news_pipeline/news_monitor_test.py
|
XinliWang/NewsCrawler
|
43ac9ab5251bc3274d34e3416fa159fc30f3a83e
|
[
"MIT"
] | null | null | null |
sys.path.append(os.path.join(os.path.dirname(__file__), '../..', 'news_pipeline'))
import news_monitor
def test():
| 20.166667
| 82
| 0.677686
| 17
| 121
| 4.470588
| 0.764706
| 0.157895
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107438
| 121
| 5
| 83
| 24.2
| 0.703704
| 0
| 0
| 0
| 0
| 0
| 0.14876
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
70ead20f043d642da051bf2f8ea2cb910ce079d6
| 127
|
py
|
Python
|
cotidia/admin/templates/generation/snippets/factory.py
|
hayden5-mwac/cotidia-admin
|
cfdd9d2677dd1098019fafbec8a6d07e1a42f9eb
|
[
"BSD-3-Clause"
] | 2
|
2019-07-20T14:43:21.000Z
|
2021-04-30T15:43:49.000Z
|
cotidia/admin/templates/generation/snippets/factory.py
|
hayden5-mwac/cotidia-admin
|
cfdd9d2677dd1098019fafbec8a6d07e1a42f9eb
|
[
"BSD-3-Clause"
] | 16
|
2020-07-17T04:26:20.000Z
|
2022-03-23T14:47:31.000Z
|
cotidia/admin/templates/generation/snippets/factory.py
|
hayden5-mwac/cotidia-admin
|
cfdd9d2677dd1098019fafbec8a6d07e1a42f9eb
|
[
"BSD-3-Clause"
] | 1
|
2020-05-18T20:56:45.000Z
|
2020-05-18T20:56:45.000Z
|
class {{model_name}}Factory(factory.django.DjangoModelFactory):
class Meta:
model = '{{app_label}}.{{model_name}}'
| 31.75
| 63
| 0.677165
| 14
| 127
| 5.928571
| 0.642857
| 0.216867
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149606
| 127
| 3
| 64
| 42.333333
| 0.768519
| 0
| 0
| 0
| 0
| 0
| 0.220472
| 0.220472
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cb158a29a4fdb0bb7052695d698a517c5b163a5a
| 2,993
|
py
|
Python
|
script/agents/init_agents.py
|
SeunghyunLim/Dpoom_gazebo
|
bcb28d3a691e2b49856e39ee9c8778bd88570201
|
[
"Apache-2.0"
] | 2
|
2021-04-30T05:34:08.000Z
|
2021-08-31T06:03:12.000Z
|
script/agents/init_agents.py
|
SeunghyunLim/Ball_bot
|
9427cdb921bc5d60387da8f437f4b4d93052724d
|
[
"Apache-2.0"
] | null | null | null |
script/agents/init_agents.py
|
SeunghyunLim/Ball_bot
|
9427cdb921bc5d60387da8f437f4b4d93052724d
|
[
"Apache-2.0"
] | 2
|
2021-01-03T14:21:32.000Z
|
2021-02-07T13:01:28.000Z
|
import rospy
import rospkg
from gazebo_msgs.msg import ModelState
from gazebo_msgs.srv import SetModelState
from utils import *
DPoom_init = [0.0, -8.0, 0.2, 1.57]
init_list = ['', '', '', '', '']
init_list[0] = [-1.8, -1.0, 0.2, 0.0]
init_list[1] = [1.8, -1.0, 0.2, -3.14]
init_list[2] = [0.0, 0.0, 0.2, -1.57]
init_list[3] = [-1.2, -3.0, 0.2, 1.0]
init_list[4] = [1.2, -3.0, 0.2, 2.0]
def main():
rospy.init_node('set_pose')
# Init pose for DPoom
state_msg = ModelState()
state_msg.model_name = 'dpoom'
state_msg.pose.position.x = DPoom_init[0]
state_msg.pose.position.y = DPoom_init[1]
state_msg.pose.position.z = DPoom_init[2]
(x, y, z, w) = eu2qut(yaw = DPoom_init[3])
state_msg.pose.orientation.x = x
state_msg.pose.orientation.y = y
state_msg.pose.orientation.z = z
state_msg.pose.orientation.w = w
rospy.wait_for_service('/gazebo/set_model_state')
try:
set_state = rospy.ServiceProxy('/gazebo/set_model_state', SetModelState)
resp = set_state( state_msg )
except rospy.ServiceException, e:
print "Service call failed: %s" % e
# Init pose for agents
for i in range(5):
state_msg = ModelState()
state_msg.model_name = 'tb3_%s' % i
state_msg.pose.position.x = init_list[i][0]
state_msg.pose.position.y = init_list[i][1]
state_msg.pose.position.z = init_list[i][2]
(x, y, z, w) = eu2qut(yaw = init_list[i][3])
state_msg.pose.orientation.x = x
state_msg.pose.orientation.y = y
state_msg.pose.orientation.z = z
state_msg.pose.orientation.w = w
rospy.wait_for_service('/gazebo/set_model_state')
try:
set_state = rospy.ServiceProxy('/gazebo/set_model_state', SetModelState)
resp = set_state( state_msg )
except rospy.ServiceException, e:
print "Service call failed: %s" % e
if __name__ == '__main__':
try:
main()
except rospy.ROSInterruptException:
pass
#
# rosservice call /gazebo/set_model_state '{model_state: { model_name: tb3_0, pose: { position: { x: -1.74811633133, y: -0.996556746752 ,z: 0.188792623379 }, orientation: {x: -1.97054213262e-05, y: 0.00158948611954, z: 0.0114769113202, w: 0.999932874573 } }, twist: { linear: {x: 0.0 , y: 0 ,z: 0 } , angular: { x: 0.0 , y: 0 , z: 0.0 } } , reference_frame: world } }'
#
#
# rosservice call /gazebo/set_model_state '{model_state: { model_name: tb3_0, pose: { position: { x: 1.74811633133, y: -0.996556746752 ,z: 0.188792623379 }, orientation: {x: -1.97054213262e-05, y: 0.00158948611954, z: 0.0114769113202, w: 0.999932874573 } }, twist: { linear: {x: 0.0 , y: 0 ,z: 0 } , angular: { x: 0.0 , y: 0 , z: 0.0 } } , reference_frame: world } }'
# position:
# x: -1.74811633133
# y: -0.996556746752
# z: 0.188792623379
# orientation:
# x: -1.97054213262e-05
# y: 0.00158948611954
# z: 0.0114769113202
# w: 0.999932874573
| 35.630952
| 368
| 0.622118
| 457
| 2,993
| 3.90372
| 0.164114
| 0.089686
| 0.09417
| 0.103139
| 0.789798
| 0.766256
| 0.703475
| 0.632848
| 0.632848
| 0.632848
| 0
| 0.159862
| 0.222519
| 2,993
| 83
| 369
| 36.060241
| 0.60679
| 0.315403
| 0
| 0.442308
| 0
| 0
| 0.081201
| 0.045276
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.019231
| 0.096154
| null | null | 0.038462
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cb1d1cfd8303ebf6fc91669c801b51c03cf70f91
| 198
|
py
|
Python
|
betterconf/__init__.py
|
RMuskovets/betterconf
|
7f6be416c672b2fc23d3df6678c411ab572f96a3
|
[
"MIT"
] | 22
|
2019-12-24T18:51:57.000Z
|
2021-10-12T17:36:29.000Z
|
betterconf/__init__.py
|
RMuskovets/betterconf
|
7f6be416c672b2fc23d3df6678c411ab572f96a3
|
[
"MIT"
] | 4
|
2020-04-19T06:21:35.000Z
|
2020-11-05T10:57:14.000Z
|
betterconf/__init__.py
|
RMuskovets/betterconf
|
7f6be416c672b2fc23d3df6678c411ab572f96a3
|
[
"MIT"
] | 3
|
2020-04-18T23:53:05.000Z
|
2022-01-18T17:16:48.000Z
|
"""Simple and very small Python library for configs. Doesn't have type-casts and other funcs, just parse env."""
from .config import Config
from .config import field
__author__ = "prostomarkeloff"
| 33
| 112
| 0.772727
| 29
| 198
| 5.137931
| 0.827586
| 0.134228
| 0.214765
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146465
| 198
| 5
| 113
| 39.6
| 0.881657
| 0.535354
| 0
| 0
| 0
| 0
| 0.174419
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 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
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
cb23b23ea5f84859189d295cfff471accfa6c50c
| 128
|
py
|
Python
|
RecoTauTag/RecoTau/python/PFRecoTauProducer_cfi.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
RecoTauTag/RecoTau/python/PFRecoTauProducer_cfi.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
RecoTauTag/RecoTau/python/PFRecoTauProducer_cfi.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
from RecoTauTag.RecoTau.pfRecoTauProducerDef_cfi import pfRecoTauProducerDef
pfRecoTauProducer = pfRecoTauProducerDef.clone()
| 25.6
| 76
| 0.882813
| 10
| 128
| 11.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070313
| 128
| 4
| 77
| 32
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
cb4f2999fce65fc01c250e070003fcfff062272a
| 126
|
py
|
Python
|
testes-python/basic_bottle.py
|
elzasimoes/selenium-python
|
50e4ad8a46864b06193eda09aa2a2a047f98974c
|
[
"CC0-1.0"
] | 2
|
2020-06-03T04:45:35.000Z
|
2020-07-10T03:21:17.000Z
|
testes-python/basic_bottle.py
|
elzasimoes/selenium-python
|
50e4ad8a46864b06193eda09aa2a2a047f98974c
|
[
"CC0-1.0"
] | null | null | null |
testes-python/basic_bottle.py
|
elzasimoes/selenium-python
|
50e4ad8a46864b06193eda09aa2a2a047f98974c
|
[
"CC0-1.0"
] | 2
|
2020-06-03T11:52:33.000Z
|
2020-06-07T00:01:57.000Z
|
from bottle import route, run
@route('/')
def index():
return "<h1>OI RAFAEL</h1>"
if __name__ == '__main__':
run()
| 14
| 31
| 0.603175
| 17
| 126
| 4
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.206349
| 126
| 8
| 32
| 15.75
| 0.66
| 0
| 0
| 0
| 0
| 0
| 0.214286
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0.166667
| 0.166667
| 0.5
| 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
| 0
| 1
| 0
| 0
|
0
| 4
|
cba592a351334744e01ed06e68a3ae61dcd6f0a2
| 563
|
py
|
Python
|
user/models.py
|
Time-xg/bookmanager_django
|
3d8f2e9b38570e0e4ea5498f6ab4fe16b7d2f969
|
[
"MIT"
] | null | null | null |
user/models.py
|
Time-xg/bookmanager_django
|
3d8f2e9b38570e0e4ea5498f6ab4fe16b7d2f969
|
[
"MIT"
] | null | null | null |
user/models.py
|
Time-xg/bookmanager_django
|
3d8f2e9b38570e0e4ea5498f6ab4fe16b7d2f969
|
[
"MIT"
] | null | null | null |
from django.db import models
# Create your models here.
class UserInfo(models.Model):
# USER_CHOICES = (
# ('reader', 'Reader'),
# ('admin', 'Administrator'),
# )
# GENDER_CHOICES = (
# ('male', 'male'),
# ('female', 'female'),
# )
name = models.CharField(unique=True, max_length=50)
password = models.CharField(max_length=25)
permission = models.CharField(max_length=20, default='reader')
gender = models.CharField(max_length=20, default='male')
def __str__(self):
return self.name
| 25.590909
| 66
| 0.60746
| 61
| 563
| 5.442623
| 0.57377
| 0.180723
| 0.162651
| 0.216867
| 0.198795
| 0.198795
| 0
| 0
| 0
| 0
| 0
| 0.018648
| 0.238011
| 563
| 22
| 67
| 25.590909
| 0.755245
| 0.301954
| 0
| 0
| 0
| 0
| 0.026042
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0.125
| 0.125
| 0.125
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
cba5a871d6c5b8647c0e25943133c0a6dcf78dd8
| 232
|
py
|
Python
|
lemon/__init__.py
|
trilan/lemon
|
7f55b72a84fcae2c4b6372279dda2a05332f1e4c
|
[
"BSD-3-Clause"
] | 2
|
2018-11-11T16:15:21.000Z
|
2021-07-30T20:02:31.000Z
|
lemon/__init__.py
|
trilan/lemon
|
7f55b72a84fcae2c4b6372279dda2a05332f1e4c
|
[
"BSD-3-Clause"
] | null | null | null |
lemon/__init__.py
|
trilan/lemon
|
7f55b72a84fcae2c4b6372279dda2a05332f1e4c
|
[
"BSD-3-Clause"
] | 2
|
2016-10-07T06:42:03.000Z
|
2021-07-30T20:02:34.000Z
|
from .options import ModelAdmin, AppAdmin
from .options import StackedInline, TabularInline
from .sites import AdminSite, site
__all__ = [
'ModelAdmin', 'AppAdmin', 'StackedInline', 'TabularInline', 'AdminSite',
'site',
]
| 23.2
| 76
| 0.732759
| 22
| 232
| 7.545455
| 0.5
| 0.13253
| 0.204819
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150862
| 232
| 9
| 77
| 25.777778
| 0.84264
| 0
| 0
| 0
| 0
| 0
| 0.24569
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 0
| 0.428571
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
cbabe1eaeee076ff5ee4616cfc45708950971fbf
| 140
|
py
|
Python
|
2020/03/SlopeGradient.py
|
zseen/advent-of-code
|
0c3f8e8f4d7fd7b7193e417f841ddec6997f265a
|
[
"MIT"
] | null | null | null |
2020/03/SlopeGradient.py
|
zseen/advent-of-code
|
0c3f8e8f4d7fd7b7193e417f841ddec6997f265a
|
[
"MIT"
] | null | null | null |
2020/03/SlopeGradient.py
|
zseen/advent-of-code
|
0c3f8e8f4d7fd7b7193e417f841ddec6997f265a
|
[
"MIT"
] | null | null | null |
class SlopeGradient:
def __init__(self, rightSteps, downSteps):
self.rightSteps = rightSteps
self.downSteps = downSteps
| 28
| 46
| 0.7
| 13
| 140
| 7.230769
| 0.538462
| 0.297872
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228571
| 140
| 4
| 47
| 35
| 0.87037
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cbad0baa0573dca4ef392e142db91dcacea1a176
| 867
|
py
|
Python
|
tests/util_test/ngrams_test.py
|
alisoltanirad/Reason
|
9062dc8e365efa424706a309de5cfb90ab497e9a
|
[
"MIT"
] | 1
|
2020-12-21T21:26:27.000Z
|
2020-12-21T21:26:27.000Z
|
tests/util_test/ngrams_test.py
|
alisoltanirad/Reason
|
9062dc8e365efa424706a309de5cfb90ab497e9a
|
[
"MIT"
] | 10
|
2020-12-26T18:55:43.000Z
|
2021-01-10T09:15:32.000Z
|
tests/util_test/ngrams_test.py
|
alisoltanirad/reason
|
9062dc8e365efa424706a309de5cfb90ab497e9a
|
[
"MIT"
] | null | null | null |
import pytest
from reason.util import ngrams, bigrams, trigrams
@pytest.fixture
def input_value():
input_value = 'Reason is easy to use'
return input_value
def test_bigrams(input_value):
output = [('Reason', 'is'), ('is', 'easy'), ('easy', 'to'), ('to', 'use')]
assert bigrams(input_value) == output
def test_trigrams(input_value):
output = [('Reason', 'is', 'easy'), ('is', 'easy', 'to'),
('easy', 'to', 'use')]
assert trigrams(input_value) == output
def test_ngrams(input_value):
output = [('Reason',), ('is',), ('easy',), ('to',), ('use',)]
assert ngrams(input_value) == output
def test_ngrams_with_n(input_value):
output = [('Reason', 'is', 'easy', 'to'), ('is', 'easy', 'to', 'use')]
assert ngrams(input_value, 4) == output
def test_bad_input():
with pytest.raises(TypeError):
ngrams(1)
| 27.09375
| 78
| 0.604383
| 111
| 867
| 4.54955
| 0.243243
| 0.217822
| 0.221782
| 0.174257
| 0.510891
| 0.384158
| 0.233663
| 0.130693
| 0
| 0
| 0
| 0.002841
| 0.188005
| 867
| 31
| 79
| 27.967742
| 0.714489
| 0
| 0
| 0
| 0
| 0
| 0.134948
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 1
| 0.272727
| false
| 0
| 0.090909
| 0
| 0.409091
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cbaf0d8346b0aee5818850ad435cbf2557b2feb3
| 226
|
py
|
Python
|
lux/__init__.py
|
jaywoo123/lux
|
52d6b326264ced2f9cf3c380a320fb1856166535
|
[
"Apache-2.0"
] | null | null | null |
lux/__init__.py
|
jaywoo123/lux
|
52d6b326264ced2f9cf3c380a320fb1856166535
|
[
"Apache-2.0"
] | null | null | null |
lux/__init__.py
|
jaywoo123/lux
|
52d6b326264ced2f9cf3c380a320fb1856166535
|
[
"Apache-2.0"
] | null | null | null |
# Register the commonly used modules (similar to how pandas does it: https://github.com/pandas-dev/pandas/blob/master/pandas/__init__.py)
from lux.context.Spec import Spec
from lux.luxDataFrame.LuxDataframe import LuxDataFrame
| 75.333333
| 137
| 0.823009
| 34
| 226
| 5.352941
| 0.735294
| 0.076923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088496
| 226
| 3
| 138
| 75.333333
| 0.883495
| 0.597345
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.