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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a4003638d13fcbfcaeb1d5448af065d290fd9595
| 598
|
py
|
Python
|
system/views.py
|
TheFutureLegends/club_management_system_backend_django
|
d3b2677e61575579a778ecccebf8c18d0aa5b8d3
|
[
"MIT"
] | null | null | null |
system/views.py
|
TheFutureLegends/club_management_system_backend_django
|
d3b2677e61575579a778ecccebf8c18d0aa5b8d3
|
[
"MIT"
] | null | null | null |
system/views.py
|
TheFutureLegends/club_management_system_backend_django
|
d3b2677e61575579a778ecccebf8c18d0aa5b8d3
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
from rest_framework import viewsets
# Import member's model and serializer
from .models import Member, Event, KPI
from .serializers import MemberSerializer, EventSerializer, KPISerializer
# Create your views here.
class MemberView(viewsets.ModelViewSet):
queryset = Member.objects.all()
serializer_class = MemberSerializer
class EventView(viewsets.ModelViewSet):
queryset = Event.objects.all()
serializer_class = EventSerializer
class KPIView(viewsets.ModelViewSet):
queryset = KPI.objects.all()
serializer_class = KPISerializer
| 23.92
| 73
| 0.784281
| 65
| 598
| 7.153846
| 0.492308
| 0.129032
| 0.180645
| 0.16129
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147157
| 598
| 24
| 74
| 24.916667
| 0.911765
| 0.100334
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.307692
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
cfb87e438d07d1328caf21c248bb969906874e79
| 5,200
|
py
|
Python
|
code/python/dynamo/data/_visit.py
|
tnorlund/Blog-backend
|
d231c32c9e37c38955fc07a6dd3cfaf833c8c99d
|
[
"MIT"
] | null | null | null |
code/python/dynamo/data/_visit.py
|
tnorlund/Blog-backend
|
d231c32c9e37c38955fc07a6dd3cfaf833c8c99d
|
[
"MIT"
] | 22
|
2021-02-27T19:50:35.000Z
|
2021-03-22T19:36:59.000Z
|
code/python/dynamo/data/_visit.py
|
tnorlund/Blog-backend
|
d231c32c9e37c38955fc07a6dd3cfaf833c8c99d
|
[
"MIT"
] | null | null | null |
import os
import sys
from botocore.exceptions import ClientError
sys.path.append(
os.path.dirname( os.path.dirname( os.path.abspath( __file__ ) ) )
)
from dynamo.entities import Visit # pylint: disable=wrong-import-position
from dynamo.data.util import chunkList # pylint: disable=wrong-import-position
class _Visit():
def addVisit( self, visit ):
'''Adds a visitor's page visit to the table.
Parameters
----------
visit : Visit
The visitor's page visit to be added to the table.
Returns
-------
result : dict
The result of adding a visitor's page visit to the table.
'''
if not isinstance( visit, Visit ):
raise ValueError( 'Must pass a Visit object' )
try:
self.client.put_item(
TableName = self.tableName,
Item = visit.toItem(),
ConditionExpression = 'attribute_not_exists(PK)'
)
return { 'visit': visit }
except ClientError as e:
print( f'ERROR addVisit: { e }')
if e.response['Error']['Code'] == 'ConditionalCheckFailedException':
return {
'error': f'Visitor\'s page visit is already in table { visit }'
}
return { 'error': 'Could not add new page visit to table' }
def removeVisit( self, visit ):
'''Removes a visit from the table.
Parameters
----------
visit : Visit
The visit to be removed from the table.
Returns
-------
result : dict
The result of removing the visit from the table.
'''
if not isinstance( visit, Visit ):
raise ValueError( 'Must pass a Visit object' )
try:
self.client.delete_item(
TableName = self.tableName,
Key = visit.key(),
ConditionExpression = 'attribute_exists(PK)'
)
return { 'visit': visit }
except ClientError as e:
print( f'ERROR removeVisit: { e }' )
if e.response['Error']['Code'] == 'ConditionalCheckFailedException':
return { 'error': f'Visit not in table { visit }' }
return { 'error': 'Could not remove visit from table' }
def addVisits( self, visits ):
'''Adds a visitor's page visit to the table.
Parameters
----------
visits : list[ Visit ]
The visitor's page visits to be added to the table.
Returns
-------
result : dict
The result of adding a visitor's page visits to the table.
'''
if not isinstance( visits, list ):
raise ValueError( 'Must pass a list' )
if any( not isinstance( visit, Visit ) for visit in visits ):
raise ValueError( 'Must pass Visit objects' )
try:
if len( visits ) > 25:
for sub_visits in chunkList( visits, 25 ):
self.client.batch_write_item(
RequestItems = {
self.tableName: [
{ 'PutRequest': { 'Item': visit.toItem() } }
for visit in sub_visits
] },
)
else:
self.client.batch_write_item(
RequestItems = {
self.tableName: [
{ 'PutRequest': { 'Item': visit.toItem() } }
for visit in visits
] },
)
return { 'visits': visits }
except ClientError as e:
print( f'ERROR addVisits: { e }')
return { 'error': 'Could not add new page visits to table' }
def updateVisit( self, visit ):
'''Updates a visit with new attributes.
Parameters
----------
visit : Visit
The visit to change the scroll events, previous and next pages, and the
start time.
'''
if not isinstance( visit, Visit ):
raise ValueError( 'Must pass Visit object' )
try:
self.client.put_item(
TableName = self.tableName,
Item = visit.toItem,
ConditionExpression = 'attribute_exists(PK)'
)
return { 'visit': visit }
except ClientError as e:
if e.response['Error']['Code'] == 'ConditionalCheckFailedException':
return { 'error': 'Visit not in table' }
return { 'error': 'Could not update visit in table' }
def updateVisits( self, visits ):
'''Updates visitor's pages with new attributes.
Parameters
----------
visits : list[ Visits ]
The visits to updates the scroll events, previous and next pages, and the
start times.
'''
if not isinstance( visits, list ):
raise ValueError( 'Must pass a list' )
if any( not isinstance( visit, Visit ) for visit in visits ):
raise ValueError( 'Must pass Visit objects' )
try:
if len( visits ) > 25:
for sub_visits in chunkList( visits, 25 ):
self.client.batch_write_item(
RequestItems = {
self.tableName: [
{ 'PutRequest': { 'Item': visit.toItem() } }
for visit in sub_visits
] },
)
else:
self.client.batch_write_item(
RequestItems = {
self.tableName: [
{ 'PutRequest': { 'Item': visit.toItem() } }
for visit in visits
] },
)
return { 'visits': visits }
except ClientError as e:
print( f'ERROR addVisits: { e }')
return { 'error': 'Could not add new page visits to table' }
| 31.137725
| 79
| 0.577115
| 593
| 5,200
| 5.020236
| 0.190556
| 0.03695
| 0.028216
| 0.054081
| 0.787034
| 0.738327
| 0.707759
| 0.683574
| 0.66913
| 0.63218
| 0
| 0.002232
| 0.310577
| 5,200
| 166
| 80
| 31.325301
| 0.828173
| 0.205962
| 0
| 0.66055
| 0
| 0
| 0.196651
| 0.029688
| 0
| 0
| 0
| 0
| 0
| 1
| 0.045872
| false
| 0.06422
| 0.045872
| 0
| 0.220183
| 0.036697
| 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
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
32041830bfa13e1487c892d8b80f7a0ad2d2ea83
| 3,577
|
py
|
Python
|
tests/api/test_no_driver.py
|
JosephWardDotTech/helium
|
fb01f5bb11908aa341502e332739d26b9712f615
|
[
"MIT"
] | 1,656
|
2020-02-25T15:55:07.000Z
|
2020-04-01T09:48:01.000Z
|
tests/api/test_no_driver.py
|
JosephWardDotTech/helium
|
fb01f5bb11908aa341502e332739d26b9712f615
|
[
"MIT"
] | 67
|
2020-04-09T17:32:25.000Z
|
2022-03-31T12:49:00.000Z
|
tests/api/test_no_driver.py
|
JosephWardDotTech/helium
|
fb01f5bb11908aa341502e332739d26b9712f615
|
[
"MIT"
] | 207
|
2020-04-06T09:30:31.000Z
|
2022-03-31T06:34:51.000Z
|
from helium import *
from helium._impl import APIImpl
from unittest import TestCase
class NoDriverTest(TestCase):
def test_go_to_requires_driver(self):
self._check_requires_driver(lambda: go_to('google.com'))
def test_write_requires_driver(self):
self._check_requires_driver(lambda: write('foo'))
def test_press_requires_driver(self):
self._check_requires_driver(lambda: press(ENTER))
def test_click_requires_driver(self):
self._check_requires_driver(lambda: click("Sign in"))
def test_doubleclick_requires_driver(self):
self._check_requires_driver(lambda: doubleclick("Sign in"))
def test_drag_requires_driver(self):
self._check_requires_driver(lambda: drag("Drag me", to="Drop here"))
def test_find_all_requires_driver(self):
self._check_requires_driver(lambda: find_all(Button()))
def test_scroll_down_requires_driver(self):
self._check_requires_driver(lambda: scroll_down())
def test_scroll_up_requires_driver(self):
self._check_requires_driver(lambda: scroll_up())
def test_scroll_right_requires_driver(self):
self._check_requires_driver(lambda: scroll_right())
def test_scroll_left_requires_driver(self):
self._check_requires_driver(lambda: scroll_left())
def test_hover_requires_driver(self):
self._check_requires_driver(lambda: hover("Hi there!"))
def test_rightclick_requires_driver(self):
self._check_requires_driver(lambda: rightclick("Hi there!"))
def test_select_requires_driver(self):
self._check_requires_driver(lambda: select("Language", "English"))
def test_drag_file_requires_driver(self):
self._check_requires_driver(
lambda: drag_file(r'C:\test.txt', to="Here")
)
def test_attach_file_requires_driver(self):
self._check_requires_driver(lambda: attach_file(r'C:\test.txt'))
def test_refresh_requires_driver(self):
self._check_requires_driver(lambda: refresh())
def test_wait_until_requires_driver(self):
self._check_requires_driver(lambda: wait_until(lambda: True))
def test_switch_to_requires_driver(self):
self._check_requires_driver(lambda: switch_to('Popup'))
def test_kill_browser_requires_driver(self):
self._check_requires_driver(lambda: switch_to('Popup'))
def test_highlight_requires_driver(self):
self._check_requires_driver(lambda: switch_to('Popup'))
def test_s_requires_driver(self):
self._check_requires_driver(lambda: S('#home'))
def test_text_requires_driver(self):
self._check_requires_driver(lambda: Text('Home'))
def test_link_requires_driver(self):
self._check_requires_driver(lambda: Link('Home'))
def test_list_item_requires_driver(self):
self._check_requires_driver(lambda: ListItem('Home'))
def test_button_requires_driver(self):
self._check_requires_driver(lambda: Button('Home'))
def test_image_requires_driver(self):
self._check_requires_driver(lambda: Image('Logo'))
def test_text_field_requires_driver(self):
self._check_requires_driver(lambda: TextField('File name'))
def test_combo_box_requires_driver(self):
self._check_requires_driver(lambda: ComboBox('Language'))
def test_check_box_requires_driver(self):
self._check_requires_driver(lambda: CheckBox('True?'))
def test_radio_button_requires_driver(self):
self._check_requires_driver(lambda: RadioButton('Option A'))
def test_window_requires_driver(self):
self._check_requires_driver(lambda: Window('Main'))
def test_alert_requires_driver(self):
self._check_requires_driver(lambda: Alert())
def _check_requires_driver(self, function):
with self.assertRaises(RuntimeError) as cm:
function()
self.assertEqual(APIImpl.DRIVER_REQUIRED_MESSAGE, cm.exception.args[0])
| 46.454545
| 73
| 0.811015
| 510
| 3,577
| 5.233333
| 0.188235
| 0.351442
| 0.229299
| 0.272012
| 0.636568
| 0.626827
| 0.626827
| 0.626827
| 0.309854
| 0.075309
| 0
| 0.000303
| 0.078837
| 3,577
| 77
| 73
| 46.454545
| 0.809712
| 0
| 0
| 0.039474
| 0
| 0
| 0.049189
| 0
| 0
| 0
| 0
| 0
| 0.026316
| 1
| 0.447368
| false
| 0
| 0.039474
| 0
| 0.5
| 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
|
321bc4f6d56352630d63d0df32316e13981d635a
| 325
|
py
|
Python
|
deepART/__init__.py
|
nicholaslaw/deepART
|
ffd425128bec02ca22ac64a6b55425fc1b29f9ba
|
[
"MIT"
] | 1
|
2021-05-22T00:34:25.000Z
|
2021-05-22T00:34:25.000Z
|
deepART/__init__.py
|
nicholaslaw/deepART
|
ffd425128bec02ca22ac64a6b55425fc1b29f9ba
|
[
"MIT"
] | null | null | null |
deepART/__init__.py
|
nicholaslaw/deepART
|
ffd425128bec02ca22ac64a6b55425fc1b29f9ba
|
[
"MIT"
] | null | null | null |
# Helper functions and classes #
from .base import *
from .dataset import *
from .metrics import *
from .nlp import *
from .feature_transformer import *
# Neural networks #
from .art1 import *
from .fuzzyART import *
from .fuzzyARTMAPs import FuzzyARTMAPs
from .fuzzyARTMAPg import FuzzyARTMAPg
from .probART import ProbART
| 25
| 38
| 0.778462
| 40
| 325
| 6.3
| 0.475
| 0.238095
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00365
| 0.156923
| 325
| 13
| 39
| 25
| 0.916058
| 0.141538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
|
5c608e947184364a2505ed35a2600a402b5d9514
| 110
|
py
|
Python
|
models/__init__.py
|
bhuyle/PAN_ocr
|
bcd03892d4eb08a779a0a7ae63d526d8ea38cb01
|
[
"Apache-2.0"
] | null | null | null |
models/__init__.py
|
bhuyle/PAN_ocr
|
bcd03892d4eb08a779a0a7ae63d526d8ea38cb01
|
[
"Apache-2.0"
] | null | null | null |
models/__init__.py
|
bhuyle/PAN_ocr
|
bcd03892d4eb08a779a0a7ae63d526d8ea38cb01
|
[
"Apache-2.0"
] | null | null | null |
from .pan import PAN
from .psenet import PSENet
from .builder import build_model
__all__ = ['PAN', 'PSENet']
| 18.333333
| 32
| 0.745455
| 16
| 110
| 4.8125
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154545
| 110
| 5
| 33
| 22
| 0.827957
| 0
| 0
| 0
| 0
| 0
| 0.081818
| 0
| 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
|
5c84ed50eee492b8eece418a6cf09af567f4d4d3
| 58
|
py
|
Python
|
pyfgaws/__init__.py
|
fulcrumgenomics/pyfgaws
|
1f040666c869ce56b3df3ee8053d747dae4d54ef
|
[
"MIT"
] | 6
|
2020-06-04T20:35:31.000Z
|
2021-12-28T18:51:31.000Z
|
pyfgaws/__init__.py
|
fulcrumgenomics/pyfgaws
|
1f040666c869ce56b3df3ee8053d747dae4d54ef
|
[
"MIT"
] | 13
|
2020-06-04T20:35:59.000Z
|
2020-07-16T19:08:06.000Z
|
pyfgaws/__init__.py
|
fulcrumgenomics/pyfgaws
|
1f040666c869ce56b3df3ee8053d747dae4d54ef
|
[
"MIT"
] | null | null | null |
from pyfgaws.core import logging
logging.setup_logging()
| 14.5
| 32
| 0.827586
| 8
| 58
| 5.875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103448
| 58
| 3
| 33
| 19.333333
| 0.903846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 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
|
5cba407b32619abb457bccc20177778516c394cf
| 160
|
py
|
Python
|
wc_school_2019/__init__.py
|
KarrLab/wc_school_2019
|
59bdf7c06b1c8e903fc114e0c415459dae46cf29
|
[
"MIT"
] | null | null | null |
wc_school_2019/__init__.py
|
KarrLab/wc_school_2019
|
59bdf7c06b1c8e903fc114e0c415459dae46cf29
|
[
"MIT"
] | null | null | null |
wc_school_2019/__init__.py
|
KarrLab/wc_school_2019
|
59bdf7c06b1c8e903fc114e0c415459dae46cf29
|
[
"MIT"
] | null | null | null |
import pkg_resources
# read version
with open(pkg_resources.resource_filename('wc_school_2019', 'VERSION'), 'r') as file:
__version__ = file.read().strip()
| 32
| 85
| 0.75
| 22
| 160
| 5.045455
| 0.727273
| 0.216216
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028169
| 0.1125
| 160
| 5
| 86
| 32
| 0.753521
| 0.075
| 0
| 0
| 0
| 0
| 0.14966
| 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
|
7a22fc3e68283c89707dc53e9c1c5651328342a7
| 31
|
py
|
Python
|
Chapter 01/keyword_aruguments1_3_3_second_code.py
|
bpbpublications/Advance-Core-Python-Programming
|
8902ceb270f55c04c12e818032f90d641c14d7b1
|
[
"MIT"
] | null | null | null |
Chapter 01/keyword_aruguments1_3_3_second_code.py
|
bpbpublications/Advance-Core-Python-Programming
|
8902ceb270f55c04c12e818032f90d641c14d7b1
|
[
"MIT"
] | null | null | null |
Chapter 01/keyword_aruguments1_3_3_second_code.py
|
bpbpublications/Advance-Core-Python-Programming
|
8902ceb270f55c04c12e818032f90d641c14d7b1
|
[
"MIT"
] | null | null | null |
next is 1.3.4 section ka code
| 15.5
| 30
| 0.709677
| 8
| 31
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0.225806
| 31
| 1
| 31
| 31
| 0.791667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7a558737c0fc1dfaea7797df4d620381a98eaedf
| 88
|
py
|
Python
|
markups/__init__.py
|
saidaibrg/markups
|
bd97c60e152b0cff88280f38cb610ae1d72b423a
|
[
"MIT"
] | null | null | null |
markups/__init__.py
|
saidaibrg/markups
|
bd97c60e152b0cff88280f38cb610ae1d72b423a
|
[
"MIT"
] | null | null | null |
markups/__init__.py
|
saidaibrg/markups
|
bd97c60e152b0cff88280f38cb610ae1d72b423a
|
[
"MIT"
] | null | null | null |
from .highlighting import HighlightExtractor
from .underlines import UnderlineExtractor
| 29.333333
| 44
| 0.886364
| 8
| 88
| 9.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 88
| 2
| 45
| 44
| 0.975
| 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
|
7a598962930b6724bd8dc0f5af5b3b357811f8f1
| 121
|
py
|
Python
|
file_lesson/file_operations_app.py
|
farooq-teqniqly/pakt-complete-python-course
|
01717bbe97181f70c38166b3dc82ba7b00098430
|
[
"MIT"
] | null | null | null |
file_lesson/file_operations_app.py
|
farooq-teqniqly/pakt-complete-python-course
|
01717bbe97181f70c38166b3dc82ba7b00098430
|
[
"MIT"
] | null | null | null |
file_lesson/file_operations_app.py
|
farooq-teqniqly/pakt-complete-python-course
|
01717bbe97181f70c38166b3dc82ba7b00098430
|
[
"MIT"
] | null | null | null |
import file_lesson.file_operations as fops
fops.save("Hello World!", "foo.txt")
print(fops.read_as_string("foo.txt"))
| 17.285714
| 42
| 0.752066
| 20
| 121
| 4.35
| 0.7
| 0.137931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 121
| 6
| 43
| 20.166667
| 0.790909
| 0
| 0
| 0
| 0
| 0
| 0.218487
| 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
|
7a5fdf94dec847f9ed344a8b27f09590660533eb
| 1,420
|
py
|
Python
|
src/demo/cache.py
|
shenshaoyong/recommender-system-dev-workshop-code
|
ce422627181472ad513f473b65bf42410c46304a
|
[
"Apache-2.0"
] | 10
|
2021-07-14T09:14:47.000Z
|
2022-01-24T09:21:41.000Z
|
src/demo/cache.py
|
shenshaoyong/recommender-system-dev-workshop-code
|
ce422627181472ad513f473b65bf42410c46304a
|
[
"Apache-2.0"
] | null | null | null |
src/demo/cache.py
|
shenshaoyong/recommender-system-dev-workshop-code
|
ce422627181472ad513f473b65bf42410c46304a
|
[
"Apache-2.0"
] | 92
|
2021-06-18T05:13:53.000Z
|
2022-01-25T08:15:49.000Z
|
import redis
import logging
import pickle
class RedisCache:
news_type_news_ids = 'news_type_news_ids_dict'
def __init__(self, host='localhost', port=6379, db=0):
logging.info('Initial RedisCache ...')
# Initial connection to Redis
logging.info('Connect to Redis %s:%s ...', host, port)
self.rCon = redis.Redis(host=host, port=port, db=db)
self.news_type_news_ids_dict_local = {}
def connection_status(self):
return self.rCon.client_list()
def load_data_into_hash(self, field, key, data):
return self.rCon.hset(field, key, data)
def get_data_from_hash(self, field, key):
return self.rCon.hget(field, key)
def news_type_news_ids_dict(self):
if not bool(self.news_type_news_ids_dict_local):
self.news_type_news_ids_dict_local = pickle.loads(self.rCon.get(self.news_type_news_ids))
if not len(self.news_type_news_ids_dict_local)>0:
logging.error('Failed to load pickle - %s from Redis.?!', self.news_type_news_ids)
return self.news_type_news_ids_dict_local
def get_zrange(self, field, start, end):
return self.rCon.zrange(field, start, end)
def get_zcard(self, field):
return self.rCon.zcard(field)
def zadd(self, field, data):
self.rCon.zadd(field, data)
def incr(self, key):
return self.incr(key)
| 27.307692
| 101
| 0.659859
| 208
| 1,420
| 4.235577
| 0.259615
| 0.090806
| 0.136209
| 0.170261
| 0.251986
| 0.165721
| 0.165721
| 0.070375
| 0
| 0
| 0
| 0.00551
| 0.233099
| 1,420
| 51
| 102
| 27.843137
| 0.803489
| 0.019014
| 0
| 0
| 0
| 0
| 0.086455
| 0.016571
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0
| 0.1
| 0.2
| 0.7
| 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
|
7aa646cb41070984509667b94b6864af2eea7ad9
| 110
|
py
|
Python
|
python GTWR/mgtwr-1.0.4/new_mgtwr/__init__.py
|
RobinYaoWenbin/python-
|
9607219b8d057ab896ecae5326daadd7dcfb6112
|
[
"MIT"
] | 12
|
2020-09-28T03:25:03.000Z
|
2022-03-20T07:44:09.000Z
|
python GTWR/mgtwr-1.0.4/new_mgtwr/__init__.py
|
RobinYaoWenbin/python-
|
9607219b8d057ab896ecae5326daadd7dcfb6112
|
[
"MIT"
] | null | null | null |
python GTWR/mgtwr-1.0.4/new_mgtwr/__init__.py
|
RobinYaoWenbin/python-
|
9607219b8d057ab896ecae5326daadd7dcfb6112
|
[
"MIT"
] | 21
|
2020-03-19T00:44:35.000Z
|
2022-01-30T03:46:18.000Z
|
__version__ = "1.0.1"
from . import gtwr
from . import sel_bws
from . import diagnosis
from . import kernels
| 15.714286
| 23
| 0.736364
| 17
| 110
| 4.470588
| 0.588235
| 0.526316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.181818
| 110
| 6
| 24
| 18.333333
| 0.811111
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 0
| 0.8
| 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
|
7ac1d0ca5c90b68df131504d7caa23dc18099ff2
| 1,340
|
py
|
Python
|
project/project3/tests/q2_1_2.py
|
ds-modules/Colab-demo
|
cccaff13633f8a5ec697cd4aeca9087f2feec2e4
|
[
"BSD-3-Clause"
] | null | null | null |
project/project3/tests/q2_1_2.py
|
ds-modules/Colab-demo
|
cccaff13633f8a5ec697cd4aeca9087f2feec2e4
|
[
"BSD-3-Clause"
] | null | null | null |
project/project3/tests/q2_1_2.py
|
ds-modules/Colab-demo
|
cccaff13633f8a5ec697cd4aeca9087f2feec2e4
|
[
"BSD-3-Clause"
] | null | null | null |
test = { 'name': 'q2_1_2',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> # Make sure you can use any two movies;\n'
'>>> correct_dis = 0.000541242;\n'
'>>> dis = distance_two_features("clerks.", "the avengers", "water", "feel");\n'
'>>> np.isclose(np.round(dis, 9), correct_dis)\n'
'True',
'hidden': False,
'locked': False},
{ 'code': '>>> # Make sure you can use any two movies;\n'
'>>> correct_dis = 0.006486728;\n'
'>>> dis = distance_two_features("clerks.", "the avengers", "your", "that");\n'
'>>> np.isclose(np.round(dis, 9), correct_dis)\n'
'True',
'hidden': False,
'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
| 63.809524
| 127
| 0.294776
| 93
| 1,340
| 4.139785
| 0.483871
| 0.103896
| 0.062338
| 0.077922
| 0.742857
| 0.742857
| 0.742857
| 0.742857
| 0.535065
| 0.535065
| 0
| 0.044905
| 0.56791
| 1,340
| 20
| 128
| 67
| 0.620035
| 0
| 0
| 0.3
| 0
| 0
| 0.373134
| 0.083582
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 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
|
8f945328e6860233ee9efd5d306a6824ab262620
| 77
|
py
|
Python
|
resolwe/flow/exceptions.py
|
plojyon/resolwe
|
1bee6f0860fdd087534adf1680e9350d79ab97cf
|
[
"Apache-2.0"
] | 27
|
2015-12-07T18:29:12.000Z
|
2022-03-16T08:01:47.000Z
|
resolwe/flow/exceptions.py
|
plojyon/resolwe
|
1bee6f0860fdd087534adf1680e9350d79ab97cf
|
[
"Apache-2.0"
] | 681
|
2015-12-01T11:52:24.000Z
|
2022-03-21T07:43:37.000Z
|
resolwe/flow/exceptions.py
|
plojyon/resolwe
|
1bee6f0860fdd087534adf1680e9350d79ab97cf
|
[
"Apache-2.0"
] | 28
|
2015-12-01T08:32:57.000Z
|
2021-12-14T00:04:16.000Z
|
"""Custom exceptions."""
class SlugError(Exception):
"""Slug error."""
| 12.833333
| 27
| 0.623377
| 7
| 77
| 6.857143
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155844
| 77
| 5
| 28
| 15.4
| 0.738462
| 0.38961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 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
|
8f95f14f2d9cff7310af468c7bbe3465bed3242d
| 164
|
py
|
Python
|
vizdoomgymmaze/envs/vizdoommazeone3.py
|
WangChen100/vizdoomgymmaze
|
51f750405a762e3f19193c09ef34380786c11efe
|
[
"MIT"
] | 6
|
2019-08-22T09:19:24.000Z
|
2020-11-21T03:29:39.000Z
|
vizdoomgymmaze/envs/vizdoommazeone3.py
|
BillOmg/vizdoomgymmaze
|
51f750405a762e3f19193c09ef34380786c11efe
|
[
"MIT"
] | 2
|
2019-08-10T06:50:02.000Z
|
2021-11-30T13:57:41.000Z
|
vizdoomgymmaze/envs/vizdoommazeone3.py
|
BillOmg/vizdoomgymmaze
|
51f750405a762e3f19193c09ef34380786c11efe
|
[
"MIT"
] | 6
|
2019-08-23T13:17:05.000Z
|
2021-06-18T20:24:53.000Z
|
from vizdoomgymmaze.envs.vizdoomenv import VizdoomEnv
class VizdoomMazeOne3(VizdoomEnv):
def __init__(self):
super(VizdoomMazeOne3, self).__init__(16)
| 27.333333
| 53
| 0.77439
| 17
| 164
| 7
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028369
| 0.140244
| 164
| 6
| 54
| 27.333333
| 0.815603
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
8fb4acbdfcc77d226052e100a618286e1898572d
| 6,386
|
py
|
Python
|
master/asm_information/admin_finder_php.py
|
awesome-security/maryam
|
3dd1381598fe69af95919e1068293b178b76120e
|
[
"MIT"
] | 1
|
2020-03-17T18:00:36.000Z
|
2020-03-17T18:00:36.000Z
|
master/asm_information/admin_finder_php.py
|
Warlockk/maryam
|
3dd1381598fe69af95919e1068293b178b76120e
|
[
"MIT"
] | null | null | null |
master/asm_information/admin_finder_php.py
|
Warlockk/maryam
|
3dd1381598fe69af95919e1068293b178b76120e
|
[
"MIT"
] | 1
|
2020-03-17T18:00:33.000Z
|
2020-03-17T18:00:33.000Z
|
# import modules for colors
from lib.color.dtectcolors import Style,Fore,Back,init
init()
W = Style.BRIGHT+Fore.WHITE # white
GR = Style.DIM+Fore.WHITE # gray
C = Style.BRIGHT+Fore.GREEN # green
R = Fore.RED # red
B = Fore.BLUE # blue
Y = Fore.YELLOW # yellow
import sys
def start():
# import
from httplib import HTTPConnection
from urllib import urlopen
from lib.check import chost,flib
def z(host):
try:
return urllib.urlopen('http://'+str(host)).code
except:
return None
host = raw_input(C+'[*]'+W+'asm>[admin_finder_php] Host: ') # Target
dom = flib(host) # Bad protocot [http:// https://]
if chost(dom) == True: # Check Host
php = ['admin/slider.php','admin/add-slider.php','admin/add_gallery_image.php','config/','robots.txt','admin/welcome.php','admin/configration.php','admin/dashbord.php','manage_admin.php','admin/form.php','admin/my_account.php','admin/specializations.php','admin/initialadmin.php','admin/pages/home_admin.php','admin/home.php','admin/save.php','admin/enter.php','admin/userpage.php','admin/banners_report.php','admin/login-home.php','admin/category.php','admin/dashboard/index.php','admin/add_banner.php','admin/add_testimonials.php','admin/userpage.php','admin_main.html','admin/addblog.php','admin/products.php','admin/admin_management.php','admin/add.php','admin/add-room.php','admin/main_page.php','admin/adminview.php','admin/welcomepage.php','admin/index-digital.php','admin/overview.php','admin_home.php','admin/admin_users.php','admin/upload.php','admin/index_ref.php','admin/checklogin.php','admin/member_home.php','admin/banner.php','admin/manageImages.php','admin/login_success.php','admin/leads.php','admin/uhome.html','admin/AdminDashboard.php','admin/cpanel.php','admin/manage_team.php','admin/voucher.php','admin/ManageAdmin.php','admin/dashboard.php','admin/account.php','admin/change_gallery.php','admin/list_gallery.php','admin/viewblog.php','admin/main.php','admin/AdminHome.php','admin/dash.php','admin/gallery.php','admin/product.php','admin/loginsuccess.php','admin/gallery.php','admin/headline.php','admin/page_management.php','admin/index.php','admin/event.php','admin/admin-home.php','admin/myaccount.php','admin/admin_index.php','admin/viewmembers.php','admin/default.php','admin/CPhome.php','admin/control_pages/admin_home.php','admin/adminarea.php','admin/','administrator/','admin1/','admin2/','admin3/','admin4/','admin5/','usuarios/','usuario/','administrator/','moderator/','webadmin/','adminarea/','bb-admin/','adminLogin/','admin_area/','panel-administracion/','instadmin/','memberadmin/','administratorlogin/','adm/','admin/account.php','admin/index.php','admin/login.php','admin/admin.php','admin/account.php','admin_area/admin.php','admin_area/login.php','siteadmin/login.php','siteadmin/index.php','siteadmin/login.html','admin/account.html','admin/index.html','admin/login.html','admin/admin.html','admin_area/index.php','bb-admin/index.php','bb-admin/login.php','bb-admin/admin.php','admin/home.php','admin_area/login.html','admin_area/index.html','admin/controlpanel.php','admin.php','admincp/index.php','admincp/login.php','admincp/index.html','admin/account.html','adminpanel.html','webadmin.html','webadmin/index.html','webadmin/admin.html','webadmin/login.html','admin/admin_login.html','admin_login.html','panel-administracion/login.html','admin/cp.php','cp.php','administrator/index.php','administrator/login.php','nsw/admin/login.php','webadmin/login.php','admin/admin_login.php','admin_login.php','administrator/account.php','administrator.php','admin_area/admin.html','pages/admin/admin-login.php','admin/admin-login.php','admin-login.php','bb-admin/index.html','bb-admin/login.html','acceso.php','bb-admin/admin.html','admin/home.html','login.php','modelsearch/login.php','moderator.php','moderator/login.php','moderator/admin.php','account.php','pages/admin/admin-login.html','admin/admin-login.html','admin-login.html','controlpanel.php','admincontrol.php','admin/adminLogin.html','adminLogin.html','admin/adminLogin.html','home.html','rcjakar/admin/login.php','adminarea/index.html','adminarea/admin.html','webadmin.php','webadmin/index.php','webadmin/admin.php','admin/controlpanel.html','admin.html','admin/cp.html','cp.html','adminpanel.php','moderator.html','administrator/index.html','administrator/login.html','user.html','administrator/account.html','administrator.html','login.html','modelsearch/login.html','moderator/login.html','adminarea/login.html','panel-administracion/index.html','panel-administracion/admin.html','modelsearch/index.html','modelsearch/admin.html','admincontrol/login.html','adm/index.html','adm.html','moderator/admin.html','user.php','account.html','controlpanel.html','admincontrol.html','panel-administracion/login.php','wp-login.php','adminLogin.php','admin/adminLogin.php','home.php','admin.php','adminarea/index.php','adminarea/admin.php','adminarea/login.php','panel-administracion/index.php','panel-administracion/admin.php','modelsearch/index.php','modelsearch/admin.php','admincontrol/login.php','adm/admloginuser.php','admloginuser.php','admin2.php','admin2/login.php','admin2/index.php','usuarios/login.php','adm/index.php','adm_auth.php','memberadmin.php','administratorlogin.php','adm.php']
try:
print '[*] Starting ... [*]'
print '[*] ip/host %s is Activ [*]'%dom
print '[*] Please White ... [*]'
def requests(host,adm):
for page in adm:
page = '/'+str(page).replace('\n','')
url = str(host)+page
con = HTTPConnection(host) # Send Requests
con.request('GET',page)
res = con.getresponse().status
recv = '\t[+]> '+url+' => '+str(res);
if res == 200:
print C+recv # True Request
else:
print R+recv
print Y+'\t{'+str(len(adm))+' We checked the page }'
requests(dom,php)
print W+'[*] END [*]' # End Process
print GR+'[Type 98 to Back]'+W
print GR+'[Type 99 to Exit]'+W
print GR+'[Type 100 to options]'+W
except:
print '[-] oops error [-]' # Error Null :(
else:
print R+'[-] oops Error(%s) occured; invalid URL [-]'%dom # Error Host
print W+'[*] END [*]' # End Process
start() # Continue
if __name__ == '__main__':
print "Let's just keep the files open only you can open the file %s and access and use these modules."%str(sys.argv[0])
sys.exit(1)
| 116.109091
| 4,593
| 0.712653
| 909
| 6,386
| 4.955996
| 0.240924
| 0.158047
| 0.025971
| 0.018868
| 0.120089
| 0.047059
| 0.03596
| 0.03596
| 0.03596
| 0
| 0
| 0.00337
| 0.070623
| 6,386
| 55
| 4,594
| 116.109091
| 0.755687
| 0.031319
| 0
| 0.150943
| 0
| 0.018868
| 0.703795
| 0.240432
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.09434
| null | null | 0.264151
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8fd2a9e67c6b9e3a9df651e3896bbd3aa782822d
| 1,864
|
py
|
Python
|
Registration/migrations/0001_initial.py
|
RohanDukare/OnlineVoting
|
e1c355fab0fdd21cc63c4be9e16fc55731479f17
|
[
"MIT"
] | 7
|
2019-05-17T06:12:57.000Z
|
2021-02-07T03:48:57.000Z
|
Registration/migrations/0001_initial.py
|
RohanDukare/OnlineVoting
|
e1c355fab0fdd21cc63c4be9e16fc55731479f17
|
[
"MIT"
] | null | null | null |
Registration/migrations/0001_initial.py
|
RohanDukare/OnlineVoting
|
e1c355fab0fdd21cc63c4be9e16fc55731479f17
|
[
"MIT"
] | 5
|
2019-05-17T06:13:10.000Z
|
2021-02-07T03:49:21.000Z
|
# Generated by Django 2.0.6 on 2018-06-24 15:07
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Candidate',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cunm', models.CharField(max_length=100)),
('cpass', models.CharField(max_length=100)),
('candidate_name', models.CharField(max_length=100)),
('candidate_dob', models.DateField(blank=True, default=datetime.date.today)),
('gender', models.CharField(max_length=10)),
('area', models.CharField(max_length=100)),
('party_name', models.CharField(max_length=100)),
('Description', models.CharField(blank=True, max_length=1000)),
('logo', models.ImageField(blank=True, upload_to='img0')),
('face', models.ImageField(blank=True, upload_to='img1')),
],
),
migrations.CreateModel(
name='Voter',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('vunm', models.CharField(max_length=100)),
('vpass', models.CharField(max_length=100)),
('voter_name', models.CharField(max_length=100)),
('voter_dob', models.DateField(blank=True, default=datetime.date.today)),
('gender', models.CharField(max_length=10)),
('area', models.CharField(max_length=100)),
('flag', models.IntegerField()),
('flag1', models.IntegerField()),
],
),
]
| 40.521739
| 114
| 0.563305
| 185
| 1,864
| 5.540541
| 0.367568
| 0.17561
| 0.193171
| 0.257561
| 0.66439
| 0.611707
| 0.376585
| 0.376585
| 0.376585
| 0.376585
| 0
| 0.04
| 0.289163
| 1,864
| 45
| 115
| 41.422222
| 0.733585
| 0.024142
| 0
| 0.368421
| 1
| 0
| 0.083654
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.052632
| 0.052632
| 0
| 0.157895
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
8fd5647287e9417c178827a8449c5ed94eec355a
| 62
|
py
|
Python
|
pydemic_ui/st/conf.py
|
GCES-Pydemic/pydemic-ui
|
8e3d8bc9f73887edf6bd8ab78a4ead29fe8239ed
|
[
"MIT"
] | 1
|
2020-09-30T13:02:53.000Z
|
2020-09-30T13:02:53.000Z
|
pydemic_ui/st/conf.py
|
GCES-Pydemic/pydemic-ui
|
8e3d8bc9f73887edf6bd8ab78a4ead29fe8239ed
|
[
"MIT"
] | 29
|
2020-10-03T02:10:38.000Z
|
2020-12-07T22:19:13.000Z
|
pydemic_ui/st/conf.py
|
GCES-Pydemic/pydemic-ui
|
8e3d8bc9f73887edf6bd8ab78a4ead29fe8239ed
|
[
"MIT"
] | null | null | null |
def pydemic():
"""
Patch the streamlit module
"""
| 12.4
| 30
| 0.532258
| 6
| 62
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.322581
| 62
| 4
| 31
| 15.5
| 0.785714
| 0.419355
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| true
| 0
| 0
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8fd754aa9eb2cc3a03c7c88ba309926242220101
| 79
|
py
|
Python
|
AI_Web/SA/apps.py
|
xwy27/ArtificialIntelligenceProjects
|
e2b0154f07d749084e2d670260fa82f8f5ea23ed
|
[
"MIT"
] | 4
|
2018-12-19T14:10:56.000Z
|
2021-07-12T06:05:17.000Z
|
AI_Web/SA/apps.py
|
xwy27/ArtificialIntelligenceProjects
|
e2b0154f07d749084e2d670260fa82f8f5ea23ed
|
[
"MIT"
] | 1
|
2019-08-06T01:57:41.000Z
|
2019-08-06T01:57:41.000Z
|
AI_Web/SA/apps.py
|
xwy27/ArtificialIntelligenceProjects
|
e2b0154f07d749084e2d670260fa82f8f5ea23ed
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class SaConfig(AppConfig):
name = 'SA'
| 13.166667
| 33
| 0.721519
| 10
| 79
| 5.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189873
| 79
| 5
| 34
| 15.8
| 0.890625
| 0
| 0
| 0
| 0
| 0
| 0.025316
| 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
|
8fe4013b795f9e68d6c6ccb2eb1dae5955c343b4
| 1,564
|
py
|
Python
|
addcardscreen.py
|
solointer11/KivyBusApp
|
2eaa0158e3594c4b2ffc81affd0ec177adc60d8d
|
[
"MIT"
] | null | null | null |
addcardscreen.py
|
solointer11/KivyBusApp
|
2eaa0158e3594c4b2ffc81affd0ec177adc60d8d
|
[
"MIT"
] | null | null | null |
addcardscreen.py
|
solointer11/KivyBusApp
|
2eaa0158e3594c4b2ffc81affd0ec177adc60d8d
|
[
"MIT"
] | null | null | null |
from kivy.uix.screenmanager import Screen
from kivy.app import App
class AddCardScreen(Screen):
def card_number_input(self):
# Link the main screen
self.app = App.get_running_app()
# Link the specific screen
self.screen = self.app.root.ids['add_card_screen']
#Link the label
self.card_number = self.screen.ids['number']
a = self.card_number.text
first = a[0:4]
second = a[4:8]
third = a[8:12]
fourth = a[12:16]
#print(len(a))
#print(first + " " + second + " " + third + " " + fourth)
new = first + " " + second + " " + third + " " + fourth
# Link the screen
self.screen = self.app.root.ids['add_card_screen']
#Link the label
self.card_number = self.screen.ids['updated_number']
self.card_number.text = new
def card_month_input(self):
# Link the main screen
self.app = App.get_running_app()
# Link the specific screen
self.screen = self.app.root.ids['add_card_screen']
#Link the label
self.card_number = self.screen.ids['month']
a = self.card_number.text
first = a[0:2]
#print(len(a))
#print(first + " " + second + " " + third + " " + fourth)
new = first+"/"
# Link the screen
self.screen = self.app.root.ids['add_card_screen']
#Link the label
self.card_number = self.screen.ids['updated_month']
self.card_number.text = new
| 22.666667
| 69
| 0.554348
| 199
| 1,564
| 4.226131
| 0.20603
| 0.083234
| 0.133175
| 0.095125
| 0.791914
| 0.741974
| 0.741974
| 0.741974
| 0.680143
| 0.680143
| 0
| 0.012299
| 0.324169
| 1,564
| 68
| 70
| 23
| 0.783349
| 0.202685
| 0
| 0.384615
| 0
| 0
| 0.087948
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.076923
| false
| 0
| 0.076923
| 0
| 0.192308
| 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
|
890ef2431a516202d68a8c8680e5edb26c6dc338
| 51
|
py
|
Python
|
mpu9250/__init__.py
|
watch4thesky/mpu9250
|
cb30d3301282ba0d5fc3c1ba31db6d312626e3f1
|
[
"MIT"
] | 18
|
2017-12-31T02:31:42.000Z
|
2020-09-15T23:45:07.000Z
|
mpu9250/__init__.py
|
watch4thesky/mpu9250
|
cb30d3301282ba0d5fc3c1ba31db6d312626e3f1
|
[
"MIT"
] | 2
|
2018-01-16T23:10:45.000Z
|
2020-09-17T20:35:36.000Z
|
mpu9250/__init__.py
|
watch4thesky/mpu9250
|
cb30d3301282ba0d5fc3c1ba31db6d312626e3f1
|
[
"MIT"
] | 19
|
2018-04-20T10:09:05.000Z
|
2020-09-03T20:37:34.000Z
|
__version__ = '0.0.1'
from mpu9250 import mpu9250
| 12.75
| 27
| 0.745098
| 8
| 51
| 4.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.255814
| 0.156863
| 51
| 3
| 28
| 17
| 0.534884
| 0
| 0
| 0
| 0
| 0
| 0.098039
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8f4d1e7d40ccf08c10e9e7730b208f7942e36628
| 113
|
py
|
Python
|
scripts/battlefunctions.py
|
DaveNair/Pokemon
|
245f18128dace423b0cfb66294bdc8e84dbb5f27
|
[
"MIT"
] | null | null | null |
scripts/battlefunctions.py
|
DaveNair/Pokemon
|
245f18128dace423b0cfb66294bdc8e84dbb5f27
|
[
"MIT"
] | null | null | null |
scripts/battlefunctions.py
|
DaveNair/Pokemon
|
245f18128dace423b0cfb66294bdc8e84dbb5f27
|
[
"MIT"
] | null | null | null |
## AUTHOR: Dave Nair
## these are BATTLE functions
## these are functions that are primarily used DURING battle
| 22.6
| 60
| 0.761062
| 16
| 113
| 5.375
| 0.6875
| 0.186047
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176991
| 113
| 4
| 61
| 28.25
| 0.924731
| 0.902655
| 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
|
8f56aaef12fd78a977d838899305fbf945ffeeb3
| 156
|
py
|
Python
|
Codewars/8kyu/color-ghost/Python/solution1.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | 7
|
2017-09-20T16:40:39.000Z
|
2021-08-31T18:15:08.000Z
|
Codewars/8kyu/color-ghost/Python/solution1.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | null | null | null |
Codewars/8kyu/color-ghost/Python/solution1.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | null | null | null |
# Python - 3.6.0
from random import choice
class Ghost(object):
def __init__(self):
self.color = choice(['white', 'yellow', 'purple', 'red'])
| 19.5
| 65
| 0.621795
| 21
| 156
| 4.428571
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024194
| 0.205128
| 156
| 7
| 66
| 22.285714
| 0.725806
| 0.089744
| 0
| 0
| 0
| 0
| 0.142857
| 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
|
8f67cc91519ea20645ed935b2ce30733ace234a1
| 488
|
py
|
Python
|
generic/py-backend/tests/mocks/Libertine.py
|
Vistaus/seabass2
|
58b9361e53120d594a74e6fabf034fcb66217eab
|
[
"MIT"
] | 13
|
2020-05-23T08:54:18.000Z
|
2022-02-14T12:55:03.000Z
|
generic/py-backend/tests/mocks/Libertine.py
|
Vistaus/seabass2
|
58b9361e53120d594a74e6fabf034fcb66217eab
|
[
"MIT"
] | 74
|
2020-05-09T08:37:37.000Z
|
2021-11-02T15:22:33.000Z
|
generic/py-backend/tests/mocks/Libertine.py
|
Vistaus/seabass2
|
58b9361e53120d594a74e6fabf034fcb66217eab
|
[
"MIT"
] | 8
|
2020-05-09T08:12:28.000Z
|
2021-07-18T16:30:45.000Z
|
from unittest.mock import Mock
class LibertineContainer:
def __init__(self, container_id, containers_config=None, service=None):
pass
def configure_add_archive(self, url, key):
pass
def update_libertine_container(self):
pass
def install_package(self, package, update_cache, no_dialog):
return True
class ContainersConfig:
def container_exists(self, container_id):
return False
def refresh_database(self):
pass
| 22.181818
| 75
| 0.69877
| 58
| 488
| 5.603448
| 0.603448
| 0.064615
| 0.092308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235656
| 488
| 21
| 76
| 23.238095
| 0.871314
| 0
| 0
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0.266667
| 0.066667
| 0.133333
| 0.733333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
56f21a37d9b800bb8d42b5a6bbbb229ad5ecef5d
| 1,272
|
py
|
Python
|
FastSimulation/Tracking/python/hltSeeds_cff.py
|
pasmuss/cmssw
|
566f40c323beef46134485a45ea53349f59ae534
|
[
"Apache-2.0"
] | null | null | null |
FastSimulation/Tracking/python/hltSeeds_cff.py
|
pasmuss/cmssw
|
566f40c323beef46134485a45ea53349f59ae534
|
[
"Apache-2.0"
] | null | null | null |
FastSimulation/Tracking/python/hltSeeds_cff.py
|
pasmuss/cmssw
|
566f40c323beef46134485a45ea53349f59ae534
|
[
"Apache-2.0"
] | null | null | null |
import FWCore.ParameterSet.Config as cms
import FastSimulation.Tracking.TrajectorySeedProducer_cfi
import FastSimulation.Tracking.InitialStep_cff
# tracking regions
hltPixelTripletTrackingRegions = FastSimulation.Tracking.InitialStep_cff.initialStepTrackingRegions.clone()
# pixel triplet seeds
import RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi
hltPixelTripletSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
layerList = RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi.PixelLayerTriplets.layerList,
skipSeedFinderSelector = cms.untracked.bool(True),
trackingRegions = "hltPixelTripletTrackingRegions"
)
# pixel pair seeds
# todo: import layerlist
import FastSimulation.Tracking.TrajectorySeedProducer_cfi
import RecoTracker.TkSeedingLayers.MixedLayerPairs_cfi
hltPixelPairSeeds = FastSimulation.Tracking.TrajectorySeedProducer_cfi.trajectorySeedProducer.clone(
layerList = RecoTracker.TkSeedingLayers.MixedLayerPairs_cfi.MixedLayerPairs.layerList,
skipSeedFinderSelector = cms.untracked.bool(True),
trackingRegions = "hltPixelTripletTrackingRegions"
)
# todo: add mixed pair seeds?
hltSeedSequence =cms.Sequence(hltPixelTripletTrackingRegions+hltPixelTripletSeeds+hltPixelPairSeeds)
| 43.862069
| 107
| 0.857704
| 102
| 1,272
| 10.598039
| 0.362745
| 0.122109
| 0.162812
| 0.173913
| 0.488437
| 0.488437
| 0.379278
| 0.379278
| 0.201665
| 0
| 0
| 0
| 0.081761
| 1,272
| 28
| 108
| 45.428571
| 0.925514
| 0.082547
| 0
| 0.333333
| 0
| 0
| 0.05168
| 0.05168
| 0
| 0
| 0
| 0.035714
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
71026eebfb320880ba56ba222155c94353139198
| 45
|
py
|
Python
|
liexperiment/raman/spectrum3d.py
|
MaxParsons/amo-physics
|
f4ba2e2f6576130af6f67b18413ff5ece10b69b2
|
[
"MIT"
] | null | null | null |
liexperiment/raman/spectrum3d.py
|
MaxParsons/amo-physics
|
f4ba2e2f6576130af6f67b18413ff5ece10b69b2
|
[
"MIT"
] | null | null | null |
liexperiment/raman/spectrum3d.py
|
MaxParsons/amo-physics
|
f4ba2e2f6576130af6f67b18413ff5ece10b69b2
|
[
"MIT"
] | null | null | null |
'''
Created on Dec 12, 2014
@author: MP
'''
| 7.5
| 23
| 0.577778
| 7
| 45
| 3.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171429
| 0.222222
| 45
| 5
| 24
| 9
| 0.571429
| 0.8
| 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
|
854f0b09a6626e2b749b6e43d252d4674858f407
| 2,218
|
py
|
Python
|
src/Actions/TextOperations.py
|
willfleetw/Joy
|
9fcc83994af2c03359c0b729ce3ed63106febec7
|
[
"MIT"
] | 2
|
2021-09-06T01:38:51.000Z
|
2022-02-18T20:51:52.000Z
|
src/Actions/TextOperations.py
|
willfleetw/Joy
|
9fcc83994af2c03359c0b729ce3ed63106febec7
|
[
"MIT"
] | null | null | null |
src/Actions/TextOperations.py
|
willfleetw/Joy
|
9fcc83994af2c03359c0b729ce3ed63106febec7
|
[
"MIT"
] | null | null | null |
from Actions.Action import Action
import Variables
from word2number import w2n
class TextRemovePrefix(Action):
_text: str
_prefix: str
_output_variable_name: str
def __init__(self, text: str = "", prefix: str = "", output_variable_name: str = "") -> None:
self._text = text
self._output_variable_name = output_variable_name
self._prefix = prefix
super().__init__()
def execute(self, cmd_context) -> None:
Variables.Variables[self._output_variable_name] = Variables.replace_tags_in_string(self._text, cmd_context).removeprefix(self._prefix)
return super().execute(cmd_context)
class TextRemoveSuffix(Action):
_text: str
_suffix: str
_output_variable_name: str
def __init__(self, text: str = "", suffix: str = "", output_variable_name: str = "") -> None:
self._text = text
self._output_variable_name = output_variable_name
self._suffix = suffix
super().__init__()
def execute(self, cmd_context) -> None:
Variables.Variables[self._output_variable_name] = Variables.replace_tags_in_string(self._text, cmd_context).removesuffix(self._suffix)
return super().execute(cmd_context)
class TextParseNumber(Action):
_text: str
_output_variable_name: str
def __init__(self, text: str = "", output_variable_name: str = "") -> None:
self._text = text
self._output_variable_name = output_variable_name
super().__init__()
def execute(self, cmd_context) -> None:
value = str(w2n.word_to_num(Variables.replace_tags_in_string(self._text, cmd_context)))
Variables.Variables[self._output_variable_name] = value
return super().execute(cmd_context)
class SetVariable(Action):
_value: str
_output_variable_name: str
def __init__(self, value: str = "", output_variable_name: str = "") -> None:
self._value = value
self._output_variable_name = output_variable_name
super().__init__()
def execute(self, cmd_context) -> None:
Variables.Variables[self._output_variable_name] = Variables.replace_tags_in_string(self._value, cmd_context)
return super().execute(cmd_context)
| 32.144928
| 142
| 0.692516
| 266
| 2,218
| 5.293233
| 0.142857
| 0.198864
| 0.255682
| 0.119318
| 0.806108
| 0.786222
| 0.677557
| 0.65483
| 0.602983
| 0.570313
| 0
| 0.001698
| 0.203336
| 2,218
| 69
| 143
| 32.144928
| 0.795133
| 0
| 0
| 0.541667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.0625
| 0
| 0.604167
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
85513ca01a4b9fc09050ba9fad7828ef9d90d64a
| 59
|
py
|
Python
|
pycqed/instrument_drivers/virtual_instruments/__init__.py
|
nuttamas/PycQED_py3
|
1ee35c7428d36ed42ba4afb5d4bda98140b2283e
|
[
"MIT"
] | 60
|
2016-08-03T10:00:18.000Z
|
2021-11-10T11:46:16.000Z
|
pycqed/instrument_drivers/virtual_instruments/__init__.py
|
nuttamas/PycQED_py3
|
1ee35c7428d36ed42ba4afb5d4bda98140b2283e
|
[
"MIT"
] | 512
|
2016-08-03T17:10:02.000Z
|
2022-03-31T14:03:43.000Z
|
pycqed/instrument_drivers/virtual_instruments/__init__.py
|
nuttamas/PycQED_py3
|
1ee35c7428d36ed42ba4afb5d4bda98140b2283e
|
[
"MIT"
] | 34
|
2016-10-19T12:00:52.000Z
|
2022-03-19T04:43:26.000Z
|
"""
This module is used to contain virtual instruments
"""
| 14.75
| 50
| 0.728814
| 8
| 59
| 5.375
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169492
| 59
| 3
| 51
| 19.666667
| 0.877551
| 0.847458
| 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
|
8552b85253e5afcb53e579c9d3013ecf7ec41614
| 31
|
py
|
Python
|
barbante/data/tests/__init__.py
|
hypermindr/barbante
|
40056e9e4f4564461294b3a1d9afc855062350ac
|
[
"MIT"
] | 10
|
2015-06-01T21:48:16.000Z
|
2021-08-20T20:18:48.000Z
|
barbante/data/tests/__init__.py
|
hypermindr/barbante
|
40056e9e4f4564461294b3a1d9afc855062350ac
|
[
"MIT"
] | null | null | null |
barbante/data/tests/__init__.py
|
hypermindr/barbante
|
40056e9e4f4564461294b3a1d9afc855062350ac
|
[
"MIT"
] | 2
|
2015-06-03T21:54:32.000Z
|
2015-11-24T23:13:05.000Z
|
""" Tests for module data.
"""
| 10.333333
| 26
| 0.580645
| 4
| 31
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.193548
| 31
| 2
| 27
| 15.5
| 0.72
| 0.709677
| 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
|
8560ceeffab325db3234fe62704271f4165d8ed6
| 290
|
py
|
Python
|
a2e/optimizer/smac/_bayesian_random_forrest_optimizer.py
|
maechler/a2e
|
c28f546ca5fc3fdb9c740ea5f0f85d2aca044a00
|
[
"MIT"
] | 1
|
2021-03-19T09:09:41.000Z
|
2021-03-19T09:09:41.000Z
|
a2e/optimizer/smac/_bayesian_random_forrest_optimizer.py
|
maechler/a2e
|
c28f546ca5fc3fdb9c740ea5f0f85d2aca044a00
|
[
"MIT"
] | null | null | null |
a2e/optimizer/smac/_bayesian_random_forrest_optimizer.py
|
maechler/a2e
|
c28f546ca5fc3fdb9c740ea5f0f85d2aca044a00
|
[
"MIT"
] | null | null | null |
from typing import Callable
from smac.facade.smac_bohb_facade import BOHB4HPO
from a2e.optimizer.smac._abstract_smac_optimizer import AbstractSMACOptimizer
class BayesianRandomForrestOptimizer(AbstractSMACOptimizer):
def get_optimizer_class(self) -> Callable:
return BOHB4HPO
| 32.222222
| 77
| 0.837931
| 32
| 290
| 7.375
| 0.5625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011719
| 0.117241
| 290
| 8
| 78
| 36.25
| 0.910156
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.5
| 0.166667
| 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
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
85c257a99d878f565ffed61a0093756d63e4f175
| 8,520
|
py
|
Python
|
python-backend/app/api/mines/incidents/resources/mine_incidents.py
|
ActionAnalytics/mds
|
7ac61b0b73b1d310db7dcf2d830b5746b851fe4a
|
[
"Apache-2.0"
] | null | null | null |
python-backend/app/api/mines/incidents/resources/mine_incidents.py
|
ActionAnalytics/mds
|
7ac61b0b73b1d310db7dcf2d830b5746b851fe4a
|
[
"Apache-2.0"
] | null | null | null |
python-backend/app/api/mines/incidents/resources/mine_incidents.py
|
ActionAnalytics/mds
|
7ac61b0b73b1d310db7dcf2d830b5746b851fe4a
|
[
"Apache-2.0"
] | null | null | null |
from flask_restplus import Resource, reqparse, fields, inputs
from flask import request
from datetime import datetime
from werkzeug.exceptions import BadRequest, NotFound, InternalServerError
from app.extensions import api
from app.api.utils.resources_mixins import UserMixin
from app.api.utils.access_decorators import requires_role_mine_view, requires_role_mine_create
from app.api.mines.mine.models.mine import Mine
from ..models.mine_incident import MineIncident
from app.api.mines.compliance.models.compliance_article import ComplianceArticle
from ...mine_api_models import MINE_INCIDENT_MODEL
def _compliance_article_is_do_subparagraph(ca):
if ca is None:
return False
return ca.article_act_code == 'HSRCM' and ca.section == '1' and ca.sub_section == '7' and ca.paragraph == '3' and ca.sub_paragraph is not None
class MineIncidentListResource(Resource, UserMixin):
parser = reqparse.RequestParser(trim=True)
#required
parser.add_argument(
'incident_timestamp',
help='Datetime of when the incident occured ',
type=lambda x: datetime.strptime(x, '%Y-%m-%d %H:%M') if x else None,
location='json',
required=True)
parser.add_argument(
'incident_description',
help='reported details of the incident',
type=str,
location='json',
required=True)
#optional and defaulted
parser.add_argument(
'determination_type_code',
help='Mark incident as a dangerous occurance',
type=str,
location='json'),
parser.add_argument(
'followup_type_code',
help='Mark incident to have a follow up inspection',
type=str,
location='json')
#nullable
parser.add_argument(
'dangerous_occurrence_subparagraph_ids',
help='List of dangerous occurrence sub-paragraphs from the HSRC code',
type=list,
location='json')
parser.add_argument(
'followup_inspection_no', help='NRIS ID of follow up inspection', type=str, location='json')
parser.add_argument(
'reported_timestamp',
help='Datetime of when the incident was reported',
type=lambda x: datetime.strptime(x, '%Y-%m-%d %H:%M') if x else None,
location='json')
parser.add_argument(
'reported_by', help='Name of party who reported the incident', type=str, location='json')
parser.add_argument(
'reported_by_role', help='Job title of incident reporter', type=str, location='json')
@api.marshal_with(MINE_INCIDENT_MODEL, envelope='mine_incidents', code=200, as_list=True)
@api.doc(description='returns the incidents for a given mine.')
@requires_role_mine_view
def get(self, mine_guid):
mine = Mine.find_by_mine_guid(mine_guid)
if not mine:
raise NotFound("Mine not found")
return mine.mine_incidents
@api.expect(parser)
@api.doc(description='creates a new incident for the mine')
@api.marshal_with(MINE_INCIDENT_MODEL, code=201)
@requires_role_mine_create
def post(self, mine_guid):
mine = Mine.find_by_mine_guid(mine_guid)
if not mine:
raise NotFound('Mine not found')
data = self.parser.parse_args()
do_sub_codes = []
if data['determination_type_code'] == 'DO':
do_sub_codes = data['dangerous_occurrence_subparagraph_ids']
if not do_sub_codes:
raise BadRequest(
'Dangerous occurrences require one or more cited sections of HSRC code 1.7.3')
incident = MineIncident.create(
mine,
data['incident_timestamp'],
data['incident_description'],
determination_type_code=data['determination_type_code'] or 'PEN',
followup_type_code=data['followup_type_code'] or 'UND',
followup_inspection_no=data['followup_inspection_no'],
reported_timestamp=data['reported_timestamp'],
reported_by=data['reported_by'],
reported_by_role=data['reported_by_role'],
)
for id in do_sub_codes:
sub = ComplianceArticle.find_by_compliance_article_id(id)
if not _compliance_article_is_do_subparagraph(sub):
raise BadRequest(
'One of the provided compliance articles is not a sub-paragraph of section 1.7.3 (dangerous occurrences)'
)
incident.dangerous_occurrence_subparagraphs.append(sub)
try:
incident.save()
except Exception as e:
raise InternalServerError(f'Error when saving: {e}')
return incident, 201
class MineIncidentResource(Resource, UserMixin):
parser = reqparse.RequestParser(trim=True)
parser.add_argument(
'incident_timestamp',
help='Datetime of when the incident occured ',
type=lambda x: datetime.strptime(x, '%Y-%m-%d %H:%M') if x else None,
location='json',
store_missing=False)
parser.add_argument(
'incident_description',
help='reported details of the incident',
type=str,
location='json',
store_missing=False)
parser.add_argument(
'reported_timestamp',
help='Datetime of when the incident was reported',
type=lambda x: datetime.strptime(x, '%Y-%m-%d %H:%M') if x else None,
location='json',
store_missing=False)
parser.add_argument(
'reported_by',
help='Name of party who reported the incident',
type=str,
location='json',
store_missing=False)
parser.add_argument(
'reported_by_role',
help='Job title of incident reporter',
type=str,
location='json',
store_missing=False)
parser.add_argument(
'determination_type_code',
help='Mark incident as a dangerous occurance',
type=str,
location='json',
store_missing=False)
parser.add_argument(
'followup_type_code',
help='Mark incident to have a follow up inspection',
location='json',
type=str,
store_missing=False)
parser.add_argument(
'dangerous_occurrence_subparagraph_ids',
help='List of dangerous occurrence sub-paragraphs from the HSRC code',
type=list,
location='json',
store_missing=False)
parser.add_argument(
'followup_inspection_no',
help='NRIS inspection related to this incident',
location='json',
type=str,
store_missing=False)
parser.add_argument(
'closing_report_summary',
help='Report from mine in reaction to the incident',
location='json',
type=str,
store_missing=False)
@api.marshal_with(MINE_INCIDENT_MODEL, code=200)
@requires_role_mine_view
def get(self, mine_incident_guid):
incident = MineIncident.find_by_mine_incident_guid(mine_incident_guid)
if not incident:
raise NotFound("Mine Incident not found")
return incident
@api.expect(parser)
@api.marshal_with(MINE_INCIDENT_MODEL, code=200)
@requires_role_mine_create
def put(self, mine_incident_guid):
incident = MineIncident.find_by_mine_incident_guid(mine_incident_guid)
if not incident:
raise NotFound("Mine Incident not found")
data = self.parser.parse_args()
do_sub_codes = []
if data['determination_type_code'] == 'DO':
do_sub_codes = data['dangerous_occurrence_subparagraph_ids']
if not do_sub_codes:
raise BadRequest(
'Dangerous occurrences require one or more cited sections of HSRC code 1.7.3')
for key, value in data.items():
if key == 'dangerous_occurrence_subparagraph_ids':
continue
setattr(incident, key, value)
incident.dangerous_occurrence_subparagraphs = []
for id in do_sub_codes:
sub = ComplianceArticle.find_by_compliance_article_id(id)
if not _compliance_article_is_do_subparagraph(sub):
raise BadRequest(
'One of the provided compliance articles is not a sub-paragraph of section 1.7.3 (dangerous occurrences)'
)
incident.dangerous_occurrence_subparagraphs.append(sub)
try:
incident.save()
except Exception as e:
raise InternalServerError(f'Error when saving: {e}')
return incident
| 37.866667
| 146
| 0.652817
| 1,029
| 8,520
| 5.196307
| 0.173955
| 0.031981
| 0.060408
| 0.035534
| 0.725828
| 0.712549
| 0.706751
| 0.673836
| 0.641668
| 0.633813
| 0
| 0.004748
| 0.258451
| 8,520
| 225
| 147
| 37.866667
| 0.841564
| 0.00446
| 0
| 0.706468
| 0
| 0.00995
| 0.25566
| 0.045755
| 0
| 0
| 0
| 0
| 0
| 1
| 0.024876
| false
| 0
| 0.054726
| 0
| 0.129353
| 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
|
a42b802638a50395bbba9349b9d7082c7d04d502
| 11,570
|
py
|
Python
|
tests/utils/test_parser.py
|
gvalentini85/betrack-cli
|
981dc22baf0b60914816ac5965a1a9f171767e47
|
[
"MIT"
] | null | null | null |
tests/utils/test_parser.py
|
gvalentini85/betrack-cli
|
981dc22baf0b60914816ac5965a1a9f171767e47
|
[
"MIT"
] | 10
|
2018-05-12T00:49:27.000Z
|
2018-06-05T17:31:14.000Z
|
tests/utils/test_parser.py
|
gvalentini85/betrack-cli
|
981dc22baf0b60914816ac5965a1a9f171767e47
|
[
"MIT"
] | null | null | null |
#------------------------------------------------------------------------------#
# Copyright 2018 Gabriele Valentini. All rights reserved. Use of this source #
# code is governed by a MIT license that can be found in the LICENSE file. #
#------------------------------------------------------------------------------#
"""
Tests for our module `betrack.utils.parser`.
"""
from unittest import TestCase, skip
from tempfile import NamedTemporaryFile
from os import remove
from os.path import dirname, abspath
from betrack.utils.parser import *
class TestParser(TestCase):
def test_open_configuration(self):
cf = NamedTemporaryFile(mode='w', suffix='.yml', delete=False)
cf.write('test-open-configuration: True')
cf.close()
config = open_configuration(cf.name)
self.assertDictEqual({'test-open-configuration': True}, config)
remove(cf.name)
def test_open_configuration_IOError(self):
cf = NamedTemporaryFile(suffix='.yml')
cf.close()
with self.assertRaises(IOError):
config = open_configuration(cf.name)
def test_parse_file(self):
cf = NamedTemporaryFile(mode='w', suffix='.yml', delete=False)
cf.write('test-parse-file: ' + cf.name)
cf.close()
config = open_configuration(cf.name)
fname = parse_file(config, 'test-parse-file')
self.assertEqual(cf.name, fname)
remove(cf.name)
def test_parse_file_IOError(self):
cf = NamedTemporaryFile(suffix='.yml')
cf.close()
config = {'test-parse-file': cf.name}
with self.assertRaises(IOError):
fname = parse_file(config, 'test-parse-file')
def test_parse_file_KeyError(self):
config = {'test-parse-file-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_file(config, 'missing-attribute')
def test_parse_directory(self):
cf = NamedTemporaryFile(mode='w', suffix='.yml', delete=False)
dnamew = dirname(abspath(cf.name))
cf.write('test-parse-directory: ' + dnamew)
cf.close()
config = open_configuration(cf.name)
dnamer = parse_directory(config, 'test-parse-directory')
self.assertEqual(dnamer, dnamew)
remove(cf.name)
def test_parse_directory_IOError(self):
cf = NamedTemporaryFile(mode='w', suffix='.yml', delete=False)
dnamew = dirname(abspath(cf.name)) + cf.name
cf.write('test-parse-directory: ' + dnamew)
cf.close()
config = open_configuration(cf.name)
with self.assertRaises(IOError):
dnamer = parse_directory(config, 'test-parse-directory')
remove(cf.name)
def test_parse_directory_KeyError(self):
config = {'test-parse-directory-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_directory(config, 'missing-attribute')
def test_parse_int(self):
val = 1
key = 'test-parse-int'
rval = parse_int({key: val}, key)
self.assertEqual(rval, val)
def test_parse_int_list(self):
val = [1, 2]
key = 'test-parse-int'
rval = parse_int({key: val}, key, nentries=2)
self.assertEqual(rval, val)
def test_parse_int_invalid_nentries(self):
val = 1
key = 'test-parse-int'
with self.assertRaises(ValueError):
rval = parse_int({key: val}, key, nentries=0)
with self.assertRaises(ValueError):
rval = parse_int({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1, 2]
rval = parse_int({key: val}, key, nentries=1)
def test_parse_not_int(self):
key = 'test-parse-int'
with self.assertRaises(ValueError):
val = '1'
rval = parse_int({key: val}, key, nentries=1)
with self.assertRaises(ValueError):
val = ['1', 2]
rval = parse_int({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1, '2']
rval = parse_int({key: val}, key, nentries=2)
def test_parse_int_KeyError(self):
config = {'test-parse-int-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_int(config, 'missing-attribute')
def test_parse_float(self):
val = 1.0
key = 'test-parse-float'
rval = parse_float({key: val}, key)
self.assertEqual(rval, val)
def test_parse_float_list(self):
val = [1.0, 2.0]
key = 'test-parse-float'
rval = parse_float({key: val}, key, nentries=2)
self.assertEqual(rval, val)
def test_parse_float_invalid_nentries(self):
val = 1.0
key = 'test-parse-float'
with self.assertRaises(ValueError):
rval = parse_float({key: val}, key, nentries=0)
with self.assertRaises(ValueError):
rval = parse_float({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1.0, 2.0]
rval = parse_float({key: val}, key, nentries=1)
def test_parse_not_float(self):
key = 'test-parse-float'
with self.assertRaises(ValueError):
val = '1'
rval = parse_float({key: val}, key, nentries=1)
with self.assertRaises(ValueError):
val = ['1', 2]
rval = parse_float({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1, '2']
rval = parse_float({key: val}, key, nentries=2)
def test_parse_float_KeyError(self):
config = {'test-parse-float-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_float(config, 'missing-attribute')
def test_parse_int_or_float(self):
val = 1
key = 'test-parse-int-or-float'
rval = parse_int_or_float({key: val}, key)
self.assertEqual(rval, val)
val = 1.0
key = 'test-parse-int-or-float'
rval = parse_int_or_float({key: val}, key)
self.assertEqual(rval, val)
def test_parse_int_or_float_list(self):
val = [1, 2]
key = 'test-parse-int-or-float'
rval = parse_int_or_float({key: val}, key, nentries=2)
self.assertEqual(rval, val)
val = [1.0, 2]
key = 'test-parse-int-or-float'
rval = parse_int_or_float({key: val}, key, nentries=2)
self.assertEqual(rval, val)
val = [1.0, 2.0]
key = 'test-parse-int-or-float'
rval = parse_int_or_float({key: val}, key, nentries=2)
self.assertEqual(rval, val)
def test_parse_int_or_float_invalid_nentries(self):
val = 1
key = 'test-parse-int-or-float'
with self.assertRaises(ValueError):
rval = parse_int_or_float({key: val}, key, nentries=0)
with self.assertRaises(ValueError):
rval = parse_int_or_float({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1.0, 2]
rval = parse_int_or_float({key: val}, key, nentries=1)
def test_parse_not_int_or_float(self):
key = 'test-parse-int-or-float'
with self.assertRaises(ValueError):
val = '1'
rval = parse_int_or_float({key: val}, key, nentries=1)
with self.assertRaises(ValueError):
val = ['1', 2]
rval = parse_int_or_float({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1, '2']
rval = parse_int_or_float({key: val}, key, nentries=2)
def test_parse_int_or_float_KeyError(self):
config = {'test-parse-int-or-float-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_int_or_float(config, 'missing-attribute')
def test_parse_bool(self):
val = True
key = 'test-parse-bool'
rval = parse_bool({key: val}, key)
self.assertEqual(rval, val)
def test_parse_bool_list(self):
val = [True, False]
key = 'test-parse-bool'
rval = parse_bool({key: val}, key, nentries=2)
self.assertEqual(rval, val)
def test_parse_bool_invalid_nentries(self):
val = True
key = 'test-parse-bool'
with self.assertRaises(ValueError):
rval = parse_bool({key: val}, key, nentries=0)
with self.assertRaises(ValueError):
rval = parse_bool({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [1.0, 2.0]
rval = parse_bool({key: val}, key, nentries=1)
def test_parse_not_bool(self):
key = 'test-parse-bool'
with self.assertRaises(ValueError):
val = 'True'
rval = parse_bool({key: val}, key, nentries=1)
with self.assertRaises(ValueError):
val = ['1', False]
rval = parse_bool({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = [True, '2']
rval = parse_bool({key: val}, key, nentries=2)
def test_parse_bool_KeyError(self):
config = {'test-parse-bool-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_bool(config, 'missing-attribute')
def test_parse_str(self):
val = 'string'
key = 'test-parse-str'
rval = parse_str({key: val}, key)
self.assertEqual(rval, val.encode())
def test_parse_str_list(self):
val = ['a string', 'another string']
key = 'test-parse-str'
rval = parse_str({key: val}, key, nentries=2)
self.assertEqual(rval, val)
def test_parse_str_invalid_nentries(self):
val = 'string'
key = 'test-parse-str'
with self.assertRaises(ValueError):
rval = parse_str({key: val}, key, nentries=0)
with self.assertRaises(ValueError):
rval = parse_str({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = ['a string', 'another string']
rval = parse_str({key: val}, key, nentries=1)
def test_parse_not_str(self):
key = 'test-parse-str'
with self.assertRaises(ValueError):
val = 1
rval = parse_str({key: val}, key, nentries=1)
with self.assertRaises(ValueError):
val = [1, 'another string']
rval = parse_str({key: val}, key, nentries=2)
with self.assertRaises(ValueError):
val = ['a string', 2]
rval = parse_str({key: val}, key, nentries=2)
def test_parse_str_KeyError(self):
config = {'test-parse-str-KeyError': 0}
with self.assertRaises(KeyError):
fname = parse_str(config, 'missing-attribute')
| 33.439306
| 80
| 0.544339
| 1,319
| 11,570
| 4.631539
| 0.072024
| 0.101653
| 0.063349
| 0.102963
| 0.879195
| 0.842364
| 0.785726
| 0.706171
| 0.60681
| 0.525782
| 0
| 0.013588
| 0.325756
| 11,570
| 345
| 81
| 33.536232
| 0.769517
| 0.030856
| 0
| 0.685714
| 0
| 0
| 0.090641
| 0.0384
| 0
| 0
| 0
| 0
| 0.228571
| 1
| 0.134694
| false
| 0
| 0.020408
| 0
| 0.159184
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
|
a432432763a48ac3e59bddc43f319634b79504b7
| 118
|
py
|
Python
|
server/runserver.py
|
harshpatel0/Tycoon
|
773c483c5d6fc8e63b8d9408740c97043fb11ef0
|
[
"MIT"
] | null | null | null |
server/runserver.py
|
harshpatel0/Tycoon
|
773c483c5d6fc8e63b8d9408740c97043fb11ef0
|
[
"MIT"
] | null | null | null |
server/runserver.py
|
harshpatel0/Tycoon
|
773c483c5d6fc8e63b8d9408740c97043fb11ef0
|
[
"MIT"
] | null | null | null |
import uvicorn
if __name__ == "__main__":
uvicorn.run("mainserver:app", host="127.0.0.1", port=8000, reload = True)
| 29.5
| 75
| 0.694915
| 18
| 118
| 4.111111
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096154
| 0.118644
| 118
| 4
| 75
| 29.5
| 0.615385
| 0
| 0
| 0
| 0
| 0
| 0.260504
| 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
|
a43ac0547dc4b96db3f58fc5f31dfd18db0227fa
| 65
|
py
|
Python
|
sdk/lusid_notifications/utilities/__init__.py
|
finbourne/notifications-sdk-python-preview
|
2368e05445c74dc248afc1c98efa9f2ca895de3b
|
[
"MIT"
] | null | null | null |
sdk/lusid_notifications/utilities/__init__.py
|
finbourne/notifications-sdk-python-preview
|
2368e05445c74dc248afc1c98efa9f2ca895de3b
|
[
"MIT"
] | null | null | null |
sdk/lusid_notifications/utilities/__init__.py
|
finbourne/notifications-sdk-python-preview
|
2368e05445c74dc248afc1c98efa9f2ca895de3b
|
[
"MIT"
] | null | null | null |
from lusid_notifications.utilities.config_keys import ConfigKeys
| 32.5
| 64
| 0.907692
| 8
| 65
| 7.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061538
| 65
| 1
| 65
| 65
| 0.934426
| 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
|
a4a778f51b3518f3143d018353277b53d0a2a613
| 192
|
py
|
Python
|
QuickDemos/ModulesExample/example.py
|
owenbres01/CMPT-120L-910-20F
|
c9840f5316688f023b7cca555ffc97ccb429aae8
|
[
"MIT"
] | 1
|
2020-08-25T23:50:45.000Z
|
2020-08-25T23:50:45.000Z
|
QuickDemos/ModulesExample/example.py
|
owenbres01/CMPT-120L-910-20F
|
c9840f5316688f023b7cca555ffc97ccb429aae8
|
[
"MIT"
] | 1
|
2020-09-18T01:20:58.000Z
|
2020-09-18T01:20:58.000Z
|
QuickDemos/ModulesExample/example.py
|
owenbres01/CMPT-120L-910-20F
|
c9840f5316688f023b7cca555ffc97ccb429aae8
|
[
"MIT"
] | 21
|
2020-08-25T03:52:56.000Z
|
2020-09-09T01:32:45.000Z
|
import Shapes
purple = Shapes.Quadrilateral()
purple.num_sides()
purple = Shapes.Octagon()
purple.num_sides()
purple = Shapes.Septagon()
purple.num_sides()
Shapes.favoriteShape("Triangle")
| 16
| 32
| 0.770833
| 23
| 192
| 6.304348
| 0.434783
| 0.248276
| 0.289655
| 0.275862
| 0.358621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09375
| 192
| 12
| 32
| 16
| 0.833333
| 0
| 0
| 0.375
| 0
| 0
| 0.041451
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.125
| 0
| 0.125
| 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
|
f12bd47a8289f773ea0a2d31e65628daf29c5efe
| 162
|
py
|
Python
|
app/app/tests.py
|
stelioskoumou/rest-api-project
|
d40f0f070e23fc22bdae47d3cefd444503c79fcc
|
[
"MIT"
] | null | null | null |
app/app/tests.py
|
stelioskoumou/rest-api-project
|
d40f0f070e23fc22bdae47d3cefd444503c79fcc
|
[
"MIT"
] | null | null | null |
app/app/tests.py
|
stelioskoumou/rest-api-project
|
d40f0f070e23fc22bdae47d3cefd444503c79fcc
|
[
"MIT"
] | null | null | null |
from django.test import TestCase
from calc import addition
class CalcTests(TestCase):
def test_add_nums(self):
self.assertEqual((addition(3,8), 11))
| 23.142857
| 45
| 0.734568
| 23
| 162
| 5.086957
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02963
| 0.166667
| 162
| 7
| 45
| 23.142857
| 0.837037
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
74aeedb35fd8cee8ed9581efb76a8457d5f719b6
| 65
|
py
|
Python
|
src/oscar/apps/wishlists/__init__.py
|
QueoLda/django-oscar
|
8dd992d82e31d26c929b3caa0e08b57e9701d097
|
[
"BSD-3-Clause"
] | 4,639
|
2015-01-01T00:42:33.000Z
|
2022-03-29T18:32:12.000Z
|
src/oscar/apps/wishlists/__init__.py
|
QueoLda/django-oscar
|
8dd992d82e31d26c929b3caa0e08b57e9701d097
|
[
"BSD-3-Clause"
] | 2,215
|
2015-01-02T22:32:51.000Z
|
2022-03-29T12:16:23.000Z
|
src/oscar/apps/wishlists/__init__.py
|
QueoLda/django-oscar
|
8dd992d82e31d26c929b3caa0e08b57e9701d097
|
[
"BSD-3-Clause"
] | 2,187
|
2015-01-02T06:33:31.000Z
|
2022-03-31T15:32:36.000Z
|
default_app_config = 'oscar.apps.wishlists.apps.WishlistsConfig'
| 32.5
| 64
| 0.846154
| 8
| 65
| 6.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046154
| 65
| 1
| 65
| 65
| 0.854839
| 0
| 0
| 0
| 0
| 0
| 0.630769
| 0.630769
| 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
|
74c9c4f9f016c4007886285b6234607f53b399bd
| 5,604
|
py
|
Python
|
tests.py
|
eferos93/data-handling
|
678be25991f851c306a25d3c7cff0463b4f22761
|
[
"MIT"
] | null | null | null |
tests.py
|
eferos93/data-handling
|
678be25991f851c306a25d3c7cff0463b4f22761
|
[
"MIT"
] | null | null | null |
tests.py
|
eferos93/data-handling
|
678be25991f851c306a25d3c7cff0463b4f22761
|
[
"MIT"
] | null | null | null |
import unittest
import unittest.mock
import pathlib as pl
from data_handling_utils import get_input
expected_output1 ="""{"sample-sheet-path": "test_folder_1/SampleSheet1.csv", "fastq-names": "[{"file1": "Survey_Covid24/1_S1_R1_001.fastq.gz", "file2": "Survey_Covid24/1_S1_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/2_S2_R1_001.fastq.gz", "file2": "Survey_Covid24/2_S2_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/3_S3_R1_001.fastq.gz", "file2": "Survey_Covid24/3_S3_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/4_S4_R1_001.fastq.gz", "file2": "Survey_Covid24/4_S4_R2_001.fas
tq.gz"}, {"file1": "Survey_Covid24/5_S5_R1_001.fastq.gz", "file2": "Survey_Covid24/5_S5_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/6_S6_R1_001.fastq.gz", "file2": "Survey_Covid24/6_S6_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/7_S7_R1_001.fastq.gz", "file2": "Survey_Covid24/7_S7_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/8
_S8_R1_001.fastq.gz", "file2": "Survey_Covid24/8_S8_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/9_S9_R1_001.fastq.gz", "file2": "Survey_Covid24/9_S9_R2_001.fastq.gz"
}, {"file1": "Survey_Covid24/10_S10_R1_001.fastq.gz", "file2": "Survey_Covid24/10_S10_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/11_S11_R1_001.fastq.gz", "file2":
"Survey_Covid24/11_S11_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/12_S12_R1_001.fastq.gz", "file2": "Survey_Covid24/12_S12_R2_001.fastq.gz"}, {"file1": "Survey_Covi
d24/13_S13_R1_001.fastq.gz", "file2": "Survey_Covid24/13_S13_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/14_S14_R1_001.fastq.gz", "file2": "Survey_Covid24/14_S14_R2_0
01.fastq.gz"}, {"file1": "Survey_Covid24/15_S15_R1_001.fastq.gz", "file2": "Survey_Covid24/15_S15_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/16_S16_R1_001.fastq.gz"
, "file2": "Survey_Covid24/16_S16_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/17_S17_R1_001.fastq.gz", "file2": "Survey_Covid24/17_S17_R2_001.fastq.gz"}, {"file1":
"Survey_Covid24/18_S18_R1_001.fastq.gz", "file2": "Survey_Covid24/18_S18_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/19_S19_R1_001.fastq.gz", "file2": "Survey_Covid2
4/19_S19_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/20_S20_R1_001.fastq.gz", "file2": "Survey_Covid24/20_S20_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/21_S21_R1_0
01.fastq.gz", "file2": "Survey_Covid24/21_S21_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/22_S22_R1_001.fastq.gz", "file2": "Survey_Covid24/22_S22_R2_001.fastq.gz"},
{"file1": "Survey_Covid24/23_S23_R1_001.fastq.gz", "file2": "Survey_Covid24/23_S23_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/24_S24_R1_001.fastq.gz", "file2": "
Survey_Covid24/24_S24_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/25_S25_R1_001.fastq.gz", "file2": "Survey_Covid24/25_S25_R2_001.fastq.gz"}, {"file1": "Survey_Covid2
4/26_S26_R1_001.fastq.gz", "file2": "Survey_Covid24/26_S26_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/27_S27_R1_001.fastq.gz", "file2": "Survey_Covid24/27_S27_R2_001
.fastq.gz"}, {"file1": "Survey_Covid24/28_S28_R1_001.fastq.gz", "file2": "Survey_Covid24/28_S28_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/29_S29_R1_001.fastq.gz",
"file2": "Survey_Covid24/29_S29_R2_001.fastq.gz"}, {"file1": "Survey_Covid24/30_S30_R1_001.fastq.gz", "file2": "Survey_Covid24/30_S30_R2_001.fastq.gz"}]"}"""
expected_output2 = """{"sample-sheet-path": "test_folder_2/SampleSheet2.csv", "fastq-names": "[{"file1": "14_S1_R1_001.fastq.gz", "file2": "14_S1_R2_001.fastq.gz"}, {"file1": "44_S2_R1_001.fastq.gz", "file2": "44_S2_R2_001.fastq.gz"}, {"file1": "67_S3_R1_001.fastq.gz", "file2": "67_S3_R2_001.fastq.gz"}, {"file1": "68_S4_R1_001.fastq.gz", "file2": "68_S4_R2_001.fastq.gz"}, {"file1": "72_S5_R1_001.fastq.gz", "file2": "72_S5_R2_001.fastq.gz"}, {"file1": "76_S6_R1_001.fastq.gz", "file2": "76_S6_R2_001.fastq.gz"}, {"file1": "87_S7_R1_001.fastq.gz", "file2": "87_S7_R2_001.fastq.gz"}, {"file1": "88_S8_R1_001.fastq.gz", "file2": "88_S8_R2_001.fastq.gz"}, {"file1": "61_S9_R1_001.fastq.gz", "file2": "61_S9_R2_001.fastq.gz"}]"}"""
# class TestDataHandling(unittest.TestCase):
# maxDiff = None
# @unittest.mock.patch('sys.stdout', new_callable=io.StringIO)
# def assert_stdout(self, input_dir, output_path, samples_filename, expected_output, mock_stdout):
# build_fastq_names(input_dir, output_path, samples_filename)
# output = json.loads(mock_stdout.getvalue())
# print(mock_stdout.getvalue())
# ex_output = json.loads(expected_output)
# self.assertEqual(output, ex_output)
# def test_data_handling(self):
# self.assert_stdout('test_folder_2', 'test_folder_2/output/', 'samples.csv', expected_output2)
# self.assert_stdout('test_folder_1', 'test_folder_1/output/', 'samples.csv', expected_output1)
class TestCaseBase(unittest.TestCase):
def assertIsFile(self, path):
if not pl.Path(path).resolve().is_file():
raise AssertionError("File does not exist: %s" % str(path))
class ActualTest(TestCaseBase):
def execute_program(self, args):
get_input(args)
def test(self):
self.execute_program(["", 'test_folder_1', 'test_folder_1/output', 'samples.csv'])
path = pl.Path("test_folder_1/output/samples.csv")
self.assertIsFile(path)
self.execute_program(["", 'test_folder_2', 'test_folder_2/output', 'samples.csv'])
path = pl.Path("test_folder_2/output/samples.csv")
self.assertIsFile(path)
self.execute_program(["", "test_folder_3", "test_folder_3/output", "samples.csv", "SampleSheet3.csv"])
path = pl.Path("test_folder_3/output/samples.csv")
self.assertIsFile(path)
| 87.5625
| 729
| 0.72591
| 917
| 5,604
| 4.045802
| 0.165758
| 0.145283
| 0.202156
| 0.122911
| 0.712399
| 0.663073
| 0.512129
| 0.083558
| 0.072776
| 0.034501
| 0
| 0.154629
| 0.08833
| 5,604
| 64
| 730
| 87.5625
| 0.57154
| 0.118308
| 0
| 0.078947
| 0
| 0.447368
| 0.827957
| 0.595455
| 0
| 0
| 0
| 0
| 0.131579
| 1
| 0.078947
| false
| 0
| 0.105263
| 0
| 0.236842
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
74cff555dd2dda68bede52343f1bb7b222fabda5
| 3,844
|
py
|
Python
|
core.py
|
aiman-al-masoud/highflyer_chat
|
40eab9d823cbc6dd6f0bca2ea72750c288c6f606
|
[
"MIT"
] | 2
|
2021-11-18T09:56:20.000Z
|
2021-11-19T06:26:22.000Z
|
core.py
|
aiman-al-masoud/highflyer_chat
|
40eab9d823cbc6dd6f0bca2ea72750c288c6f606
|
[
"MIT"
] | null | null | null |
core.py
|
aiman-al-masoud/highflyer_chat
|
40eab9d823cbc6dd6f0bca2ea72750c288c6f606
|
[
"MIT"
] | null | null | null |
import hashlib
from time import time
import random
import pandas as pd
# (private) constants
__PASSWORDS_TABLE_PATH = "./user_data/passwords_table.csv"
__MESSAGES_TABLE_PATH = "./user_data/messages_table.csv"
def create_user(username, password):
df = __get_passwords_table()
row = pd.DataFrame([(username, hash_password(password), 0)], columns=["username", "hashed_password", "last_login_time"])
df = df.append(row)
__store_passwords_table(df)
def get_passhash(username):
df = __get_passwords_table()
return df[df.username==username].hashed_password.to_list()[0]
def set_password(username, password):
pass
# TODO: retrieve sender and timestamp info, not just content, maybe make a Message class
def get_users_inbox(receiver):
df = __get_messages_table()
return df[df.receiver==receiver].message.to_list()
def refresh_last_login(username):
df = __get_passwords_table()
df.loc[df.username == username, 'last_login_time'] = time()
__store_passwords_table(df)
def get_last_login(username):
df = __get_passwords_table()
return float(df.set_index("username").at[username, "last_login_time"])
def send_message(sender, receiver, message, time):
# TODO: error of some sort
if not user_exists(sender) or not user_exists(receiver):
return
# TODO: redirect user to login
if not session_expired(sender):
return False
# append new message to table
df = __get_messages_table()
row = pd.DataFrame( [(time, sender, receiver, message)] , columns=["timestamp", "sender", "receiver", "message"])
df = df.append(row)
__store_messages_table(df)
return True
def user_exists(username):
"""
Checks if a username is taken.
"""
df = __get_passwords_table()
return (df.username==username).sum() != 0
def hash_password(password):
h = hashlib.sha1(password.encode("utf-8")).hexdigest()
return h
# TODO: improve rule to determine if user is logged in
def session_expired(username):
# in seconds
last_time = get_last_login(username)
current_time = time()
# 5 minutes
if current_time - last_time < 300:
return True
return False
def generate_session_id():
return random.randint(0 , 1000000000)
def set_session_id(username, new_session_id):
"""
Sets a user's new session id.
"""
df = __get_passwords_table()
df.loc[df.username == username, 'session_id'] = new_session_id
__store_passwords_table(df)
def get_session_id(username):
"""
Get a user's current session id.
"""
df = __get_passwords_table()
return df.loc[df.username == username, 'session_id'].to_list()[0]
# ----------PRIVATE FUNCTIONS-------------:
def __get_passwords_table():
"""
Load the passwords table.
"""
try:
# read the table from a csv
return pd.read_csv(__PASSWORDS_TABLE_PATH)
except:
# initialize a new empty passwords table if file not found
return __create_passwords_table()
def __create_passwords_table():
return pd.DataFrame([], columns=["username", "hashed_password", "last_login_time", "session_id"])
# TODO: add RSA encryption
def __create_messages_table():
return pd.DataFrame([], columns=["timestamp","sender", "receiver", "message"])
def __get_messages_table():
try:
# read the table from a csv
return pd.read_csv(__MESSAGES_TABLE_PATH)
except:
# initialize a new empty messages table if file not found
return __create_messages_table()
def __store_passwords_table(df):
"""
Store the passwords table.
Arguments: passwords dataframe.
"""
df.to_csv(__PASSWORDS_TABLE_PATH, index=False)
def __store_messages_table(df):
df.to_csv(__MESSAGES_TABLE_PATH, index=False)
| 21.965714
| 125
| 0.682882
| 502
| 3,844
| 4.896414
| 0.229084
| 0.119609
| 0.05533
| 0.054109
| 0.333198
| 0.272579
| 0.194467
| 0.069162
| 0.069162
| 0.034988
| 0
| 0.006867
| 0.204475
| 3,844
| 174
| 126
| 22.091954
| 0.796926
| 0.176379
| 0
| 0.293333
| 0
| 0
| 0.087919
| 0.019863
| 0
| 0
| 0
| 0.017241
| 0
| 1
| 0.253333
| false
| 0.346667
| 0.053333
| 0.04
| 0.546667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
74dfc7924ffd6bea11aa4aaabc65376deae0b1fa
| 450
|
py
|
Python
|
src/wallet/core/entities/__init__.py
|
clayman-micro/wallet
|
b78f650aed7d57167db81a0530fd78dbc12d527e
|
[
"MIT"
] | 2
|
2015-10-18T15:36:37.000Z
|
2015-10-19T04:57:00.000Z
|
src/wallet/core/entities/__init__.py
|
clayman74/wallet
|
b78f650aed7d57167db81a0530fd78dbc12d527e
|
[
"MIT"
] | 7
|
2021-06-26T16:51:13.000Z
|
2021-11-29T19:05:00.000Z
|
src/wallet/core/entities/__init__.py
|
clayman-micro/wallet
|
b78f650aed7d57167db81a0530fd78dbc12d527e
|
[
"MIT"
] | null | null | null |
from wallet.core.entities.abc import Balance, OperationType
from wallet.core.entities.accounts import Account, AccountFilters, AccountPayload
from wallet.core.entities.categories import Category, CategoryFilters, CategoryPayload
from wallet.core.entities.operations import (
Operation,
OperationDependencies,
OperationFilters,
OperationPayload,
OperationStream,
)
from wallet.core.entities.tags import Tag, TagFilters, TagPayload
| 37.5
| 86
| 0.817778
| 46
| 450
| 8
| 0.565217
| 0.13587
| 0.190217
| 0.298913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117778
| 450
| 11
| 87
| 40.909091
| 0.926952
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.454545
| 0
| 0.454545
| 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
|
2d1d1971e2572670af5bee01616fa1a1df73828b
| 190
|
py
|
Python
|
signed-commits.py
|
felsen/git-signed-commits
|
689a078ffc2ca8912dcf57629db4a56b4f73c43e
|
[
"MIT"
] | null | null | null |
signed-commits.py
|
felsen/git-signed-commits
|
689a078ffc2ca8912dcf57629db4a56b4f73c43e
|
[
"MIT"
] | null | null | null |
signed-commits.py
|
felsen/git-signed-commits
|
689a078ffc2ca8912dcf57629db4a56b4f73c43e
|
[
"MIT"
] | 1
|
2021-01-27T11:57:46.000Z
|
2021-01-27T11:57:46.000Z
|
# coded by Rajeev Arakkal
# coded by Sajna
# coded by Jagadeesh
# coded by Shubhangi
# coded by Sakshi
# coded by Deepika
# coded by Sachin
# coded by Sujit
# coded by felix gpgsign
| 10.555556
| 25
| 0.710526
| 29
| 190
| 4.655172
| 0.448276
| 0.466667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.242105
| 190
| 17
| 26
| 11.176471
| 0.9375
| 0.857895
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 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
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2d20afe75c62b5e299ee9d146ad3dd4c1ab64542
| 291
|
py
|
Python
|
InitiativeWASH/gateway/admin.py
|
corinnherrick/InitiativeWASH
|
b053b31626f79d4b773f28449abee792c3e29729
|
[
"MIT"
] | null | null | null |
InitiativeWASH/gateway/admin.py
|
corinnherrick/InitiativeWASH
|
b053b31626f79d4b773f28449abee792c3e29729
|
[
"MIT"
] | 3
|
2015-04-08T03:06:17.000Z
|
2015-04-08T03:08:16.000Z
|
InitiativeWASH/gateway/admin.py
|
corinnherrick/InitiativeWASH
|
b053b31626f79d4b773f28449abee792c3e29729
|
[
"MIT"
] | null | null | null |
# gsteway/admin.py
from django.contrib import admin
from .models import Neighborhood
from .models import Source
from .models import Test
from .models import TestResult
admin.site.register(Neighborhood)
admin.site.register(Source)
admin.site.register(Test)
admin.site.register(TestResult)
| 20.785714
| 33
| 0.817869
| 40
| 291
| 5.95
| 0.35
| 0.168067
| 0.268908
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099656
| 291
| 13
| 34
| 22.384615
| 0.908397
| 0.054983
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.555556
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
2d360987b1097b0aaa25f8ac57a674fe420f0101
| 113
|
py
|
Python
|
pics/tests.py
|
elvisbkt/My-Gallery
|
e785227f1dbb1b63833cd841ad279e2bc67f5b15
|
[
"PostgreSQL",
"MIT"
] | null | null | null |
pics/tests.py
|
elvisbkt/My-Gallery
|
e785227f1dbb1b63833cd841ad279e2bc67f5b15
|
[
"PostgreSQL",
"MIT"
] | 3
|
2020-02-12T02:27:09.000Z
|
2021-06-10T21:52:29.000Z
|
pics/tests.py
|
elvisbkt/My-Gallery
|
e785227f1dbb1b63833cd841ad279e2bc67f5b15
|
[
"PostgreSQL",
"MIT"
] | null | null | null |
from django.test import TestCase
from .models import Location,Category,Image
class LocationTestClass(TestClass)
| 22.6
| 43
| 0.849558
| 14
| 113
| 6.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097345
| 113
| 5
| 44
| 22.6
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.666667
| 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
|
745463e803117c453f9dedc4c342a9c392ba7819
| 4,502
|
py
|
Python
|
horno/datos/Encriptacion.py
|
alejsch/horno
|
3c502a479b36f63cc67842ec82173ef8acb46677
|
[
"MIT"
] | null | null | null |
horno/datos/Encriptacion.py
|
alejsch/horno
|
3c502a479b36f63cc67842ec82173ef8acb46677
|
[
"MIT"
] | null | null | null |
horno/datos/Encriptacion.py
|
alejsch/horno
|
3c502a479b36f63cc67842ec82173ef8acb46677
|
[
"MIT"
] | null | null | null |
from horno.utiles.IO import IOSistema
#=============================================================================================
class Crypt:
#------------------------------------------------------------------------------------------
def Nombre(self):
return '<Generico>'
#------------------------------------------------------------------------------------------
def Encriptar(self, texto):
return '?'
#------------------------------------------------------------------------------------------
def Comparar(self, texto, hash_texto):
return False
#------------------------------------------------------------------------------------------
def Testear(self, texto):
h = self.Encriptar(texto)
IOSistema().PrintLine('Test de [ %s ]: texto = [ %s ] -> hash = [ %s ]; igual? = %s' % (self.Nombre(), texto, h, self.Comparar(texto, h)))
#=============================================================================================
class CryptMD5 (Crypt):
#------------------------------------------------------------------------------------------
def Nombre(self):
return 'MD5'
#------------------------------------------------------------------------------------------
def Encriptar(self, texto):
import hashlib # POR SI NO ANDA
if not texto:
return ''
return hashlib.md5(texto.encode()).hexdigest()
#------------------------------------------------------------------------------------------
def Comparar(self, texto, hash_texto):
return hash_texto == self.Encriptar(texto)
#=============================================================================================
class CryptBlowFish (Crypt):
#------------------------------------------------------------------------------------------
def __init__(self, rounds):
self._rounds = rounds
#------------------------------------------------------------------------------------------
def Nombre(self):
return 'BlowFish'
#------------------------------------------------------------------------------------------
def Encriptar(self, texto, salt=None):
import bcrypt # POR SI NO ANDA
if not texto:
return ''
salt_a_usar = salt or bcrypt.gensalt(self._rounds)
return bcrypt.hashpw(texto, salt_a_usar)
#------------------------------------------------------------------------------------------
def Comparar(self, texto, hash_texto):
return hash_texto == self.Encriptar(texto, hash_texto)
#=============================================================================================
class CryptNTLM (Crypt):
#------------------------------------------------------------------------------------------
def Nombre(self):
return 'NTLM'
#------------------------------------------------------------------------------------------
def Encriptar(self, texto, tipo='NT'):
import passlib.hash # POR SI NO ANDA
if not texto:
return ''
if tipo == 'NT':
return passlib.hash.lmhash.encrypt(texto).upper()
elif tipo == 'LM':
return passlib.hash.nthash.encrypt(texto).upper()
else:
return '?'
#------------------------------------------------------------------------------------------
def Comparar(self, texto, hash_texto):
return hash_texto == self.Encriptar(texto)
#=============================================================================================
class CryptGuarani (Crypt):
#------------------------------------------------------------------------------------------
def Nombre(self):
return 'Guarani'
#------------------------------------------------------------------------------------------
def Encriptar(self, texto):
if not texto:
return ''
h_md5 = CryptMD5().Encriptar(texto)
h_bfs = CryptBlowFish(10).Encriptar(h_md5)
return h_bfs
#------------------------------------------------------------------------------------------
def Comparar(self, texto, hash_texto):
c_md5 = CryptMD5().Encriptar(texto)
cmp_bfs = CryptBlowFish(10).Comparar(c_md5, hash_texto)
return cmp_bfs
| 34.366412
| 146
| 0.29187
| 267
| 4,502
| 4.816479
| 0.247191
| 0.076983
| 0.065319
| 0.073872
| 0.349145
| 0.274495
| 0.251944
| 0.251944
| 0.152411
| 0.152411
| 0
| 0.003627
| 0.203909
| 4,502
| 130
| 147
| 34.630769
| 0.35519
| 0.453132
| 0
| 0.403226
| 0
| 0.016129
| 0.041034
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.274194
| false
| 0.048387
| 0.064516
| 0.16129
| 0.758065
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 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
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
747d694d86103d9ab5028080211f4133c629beb3
| 179
|
py
|
Python
|
bin/trigs/polytrigs-123-trapezoid-7x2-1.py
|
tiwo/puzzler
|
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
|
[
"Intel"
] | null | null | null |
bin/trigs/polytrigs-123-trapezoid-7x2-1.py
|
tiwo/puzzler
|
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
|
[
"Intel"
] | null | null | null |
bin/trigs/polytrigs-123-trapezoid-7x2-1.py
|
tiwo/puzzler
|
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
|
[
"Intel"
] | 1
|
2022-01-02T16:54:14.000Z
|
2022-01-02T16:54:14.000Z
|
#!/usr/bin/env python
# $Id$
"""
many solutions.
"""
import puzzler
from puzzler.puzzles.polytrigs123 import Polytrigs123Trapezoid7x2_1
puzzler.run(Polytrigs123Trapezoid7x2_1)
| 14.916667
| 67
| 0.787709
| 20
| 179
| 6.95
| 0.75
| 0.359712
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093168
| 0.100559
| 179
| 11
| 68
| 16.272727
| 0.770186
| 0.22905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 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
| 0
| 0
|
0
| 4
|
7489711524bb148e42c5f9dace1b012ffdd6518f
| 127
|
py
|
Python
|
Chapter15/listing15-4.py
|
TYRMars/PythonLearn
|
573c8d0b94b890924942e6ba7882eaf73597fb63
|
[
"MIT"
] | null | null | null |
Chapter15/listing15-4.py
|
TYRMars/PythonLearn
|
573c8d0b94b890924942e6ba7882eaf73597fb63
|
[
"MIT"
] | null | null | null |
Chapter15/listing15-4.py
|
TYRMars/PythonLearn
|
573c8d0b94b890924942e6ba7882eaf73597fb63
|
[
"MIT"
] | 1
|
2018-08-23T14:41:32.000Z
|
2018-08-23T14:41:32.000Z
|
#!/usr/bin/env python
print 'Content-type: text/plain'
print # Prints an empty line, to end the headers
print 'Hello, world!'
| 21.166667
| 48
| 0.724409
| 21
| 127
| 4.380952
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149606
| 127
| 6
| 49
| 21.166667
| 0.851852
| 0.480315
| 0
| 0
| 0
| 0
| 0.569231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7497991b87352e4301948750ecc2dd399a91c157
| 327
|
py
|
Python
|
freqerica/analysis/ft.py
|
ymtz03/freqerica
|
d79e76181a037da5c11b47f8a4e1bf4387a0468f
|
[
"BSD-2-Clause"
] | 1
|
2020-05-08T15:28:04.000Z
|
2020-05-08T15:28:04.000Z
|
freqerica/analysis/ft.py
|
ymtz03/freqerica
|
d79e76181a037da5c11b47f8a4e1bf4387a0468f
|
[
"BSD-2-Clause"
] | null | null | null |
freqerica/analysis/ft.py
|
ymtz03/freqerica
|
d79e76181a037da5c11b47f8a4e1bf4387a0468f
|
[
"BSD-2-Clause"
] | null | null | null |
import numpy as np
def window_func(time):
return np.exp(-(time/time[-1]*2)**2)
def ft(time, corr, energy_range, use_window=True):
if use_window:
return np.sum(np.exp(1j*time*energy_range.reshape(-1,1))*corr*window_func(time), axis=1)
return np.sum(np.exp(1j*time*energy_range.reshape(-1,1))*corr, axis=1)
| 32.7
| 96
| 0.688073
| 61
| 327
| 3.57377
| 0.377049
| 0.110092
| 0.12844
| 0.119266
| 0.422018
| 0.422018
| 0.422018
| 0.422018
| 0.422018
| 0.422018
| 0
| 0.038732
| 0.131498
| 327
| 9
| 97
| 36.333333
| 0.728873
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.857143
| 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
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
74ab3abb8efa80d5783077440f4f14fb26b666eb
| 76
|
py
|
Python
|
sitetables/exceptions.py
|
idlesign/django-sitetables
|
9ed851f646c5517234eb40304cfa38fa71c57884
|
[
"BSD-3-Clause"
] | 4
|
2020-08-15T14:42:29.000Z
|
2022-01-16T16:09:20.000Z
|
sitetables/exceptions.py
|
idlesign/django-sitetables
|
9ed851f646c5517234eb40304cfa38fa71c57884
|
[
"BSD-3-Clause"
] | null | null | null |
sitetables/exceptions.py
|
idlesign/django-sitetables
|
9ed851f646c5517234eb40304cfa38fa71c57884
|
[
"BSD-3-Clause"
] | null | null | null |
class SiteTablesException(Exception):
"""Base sitetables exception."""
| 19
| 37
| 0.736842
| 6
| 76
| 9.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131579
| 76
| 3
| 38
| 25.333333
| 0.848485
| 0.342105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 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
|
77c3a84613bde26d679232826ba3536c0a89abfc
| 808
|
py
|
Python
|
FuzzingTool_Dialog_MinimizeFuzz.py
|
Ryu-Miyaki/Fuzz4B
|
8546f165d4dbdd97eb6ab5a6f4c445ee81ec364b
|
[
"MIT"
] | 16
|
2020-06-25T11:56:59.000Z
|
2022-02-05T14:00:12.000Z
|
FuzzingTool_Dialog_MinimizeFuzz.py
|
Ryu-Miyaki/Fuzz4B
|
8546f165d4dbdd97eb6ab5a6f4c445ee81ec364b
|
[
"MIT"
] | null | null | null |
FuzzingTool_Dialog_MinimizeFuzz.py
|
Ryu-Miyaki/Fuzz4B
|
8546f165d4dbdd97eb6ab5a6f4c445ee81ec364b
|
[
"MIT"
] | null | null | null |
"""Subclass of Dialog_MinimizeFuzz, which is generated by wxFormBuilder."""
import wx
import FuzzingTool
# Implementing Dialog_MinimizeFuzz
class FuzzingTool_Dialog_MinimizeFuzz( FuzzingTool.Dialog_MinimizeFuzz ):
def __init__( self, parent ):
FuzzingTool.Dialog_MinimizeFuzz.__init__( self, parent )
# Handlers for Dialog_MinimizeFuzz events.
def checkBox_GrammarReduceOnCheckBox( self, event ):
# TODO: Implement checkBox_GrammarReduceOnCheckBox
pass
def FilePicker_GrammarFileOnFileChanged( self, event ):
# TODO: Implement FilePicker_GrammarFileOnFileChanged
pass
def bSizer_YesorNoOnNoButtonClick( self, event ):
# TODO: Implement bSizer_YesorNoOnNoButtonClick
pass
def bSizer_YesorNoOnYesButtonClick( self, event ):
# TODO: Implement bSizer_YesorNoOnYesButtonClick
pass
| 27.862069
| 75
| 0.810644
| 78
| 808
| 8.102564
| 0.410256
| 0.170886
| 0.082278
| 0.139241
| 0.088608
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129951
| 808
| 28
| 76
| 28.857143
| 0.899004
| 0.418317
| 0
| 0.307692
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0
| 1
| 0.384615
| false
| 0.307692
| 0.153846
| 0
| 0.615385
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
7ad2022d02a791ed95cb519092e69d7a07916088
| 255
|
py
|
Python
|
broadside/_run.py
|
biomicrodev/broadside
|
f76fa14e7656a255b16483947591d8855e06782d
|
[
"MIT"
] | null | null | null |
broadside/_run.py
|
biomicrodev/broadside
|
f76fa14e7656a255b16483947591d8855e06782d
|
[
"MIT"
] | null | null | null |
broadside/_run.py
|
biomicrodev/broadside
|
f76fa14e7656a255b16483947591d8855e06782d
|
[
"MIT"
] | null | null | null |
"""
Not sure why, but the entry point for PyInstaller has to be a python script, and it has
to lie within the main project folder. I'm probably misunderstanding how PyInstaller
works, but at least this works for now.
"""
from broadside import run
run()
| 25.5
| 87
| 0.760784
| 44
| 255
| 4.409091
| 0.818182
| 0.051546
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184314
| 255
| 9
| 88
| 28.333333
| 0.932692
| 0.831373
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
7ae17217dc724555f8d09e1b44ce683defbe41fb
| 14
|
py
|
Python
|
newfile.py
|
tfergusson/cs3240-labdemo
|
71d5a7d6295563b55897cb8290290da1ce8573ea
|
[
"MIT"
] | null | null | null |
newfile.py
|
tfergusson/cs3240-labdemo
|
71d5a7d6295563b55897cb8290290da1ce8573ea
|
[
"MIT"
] | null | null | null |
newfile.py
|
tfergusson/cs3240-labdemo
|
71d5a7d6295563b55897cb8290290da1ce8573ea
|
[
"MIT"
] | null | null | null |
def()
return 0
| 7
| 8
| 0.714286
| 3
| 14
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0.142857
| 14
| 2
| 8
| 7
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7ae2a64b295912a8882f4cae2e28b172d3effd91
| 108
|
py
|
Python
|
cnsproject/network/__init__.py
|
NimaVahdat/SNN-Framework-
|
59c3b307b6930647f187a0e105cc7f191d8dd6c0
|
[
"MIT"
] | null | null | null |
cnsproject/network/__init__.py
|
NimaVahdat/SNN-Framework-
|
59c3b307b6930647f187a0e105cc7f191d8dd6c0
|
[
"MIT"
] | null | null | null |
cnsproject/network/__init__.py
|
NimaVahdat/SNN-Framework-
|
59c3b307b6930647f187a0e105cc7f191d8dd6c0
|
[
"MIT"
] | null | null | null |
from .network import Network
from . import (
neural_populations,
connections,
monitors,
)
| 15.428571
| 29
| 0.657407
| 10
| 108
| 7
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277778
| 108
| 6
| 30
| 18
| 0.897436
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
bb0ff08b52c7890d8003af1c8c0bf4b6f1617c44
| 117
|
py
|
Python
|
affo_email_service/celery.py
|
fossabot/affo-email-service
|
4e224c025a410504601651f1a85762c91300f4e9
|
[
"BSD-3-Clause"
] | null | null | null |
affo_email_service/celery.py
|
fossabot/affo-email-service
|
4e224c025a410504601651f1a85762c91300f4e9
|
[
"BSD-3-Clause"
] | 1
|
2019-11-25T14:25:18.000Z
|
2019-11-25T14:25:18.000Z
|
affo_email_service/celery.py
|
fossabot/affo-email-service
|
4e224c025a410504601651f1a85762c91300f4e9
|
[
"BSD-3-Clause"
] | 1
|
2019-11-25T14:21:58.000Z
|
2019-11-25T14:21:58.000Z
|
from affo_email_service.application import create_app, create_celery
app = create_app()
celery = create_celery(app)
| 23.4
| 68
| 0.82906
| 17
| 117
| 5.352941
| 0.529412
| 0.197802
| 0.32967
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102564
| 117
| 4
| 69
| 29.25
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 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
|
bb2fa7a765873701e6266db57b5bfda6099c4837
| 288
|
py
|
Python
|
recipes/Python/496889_Dynamically_determine_executipath/recipe-496889.py
|
tdiprima/code
|
61a74f5f93da087d27c70b2efe779ac6bd2a3b4f
|
[
"MIT"
] | 2,023
|
2017-07-29T09:34:46.000Z
|
2022-03-24T08:00:45.000Z
|
recipes/Python/496889_Dynamically_determine_executipath/recipe-496889.py
|
unhacker/code
|
73b09edc1b9850c557a79296655f140ce5e853db
|
[
"MIT"
] | 32
|
2017-09-02T17:20:08.000Z
|
2022-02-11T17:49:37.000Z
|
recipes/Python/496889_Dynamically_determine_executipath/recipe-496889.py
|
unhacker/code
|
73b09edc1b9850c557a79296655f140ce5e853db
|
[
"MIT"
] | 780
|
2017-07-28T19:23:28.000Z
|
2022-03-25T20:39:41.000Z
|
import os, sys, inspect
def execution_path(filename):
return os.path.join(os.path.dirname(inspect.getfile(sys._getframe(1))), filename)
# open a file in a test
open(execution_path('sample.txt')).read()
# get the absolute path of the file
os.path.abspath(execution_path('sample.txt'))
| 28.8
| 83
| 0.753472
| 47
| 288
| 4.531915
| 0.574468
| 0.183099
| 0.178404
| 0.206573
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003876
| 0.104167
| 288
| 9
| 84
| 32
| 0.821705
| 0.190972
| 0
| 0
| 0
| 0
| 0.086957
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0.2
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
2480a8f7dbb6d19fca45c17f99a47fab75eac605
| 95
|
py
|
Python
|
others_problems/problem_3.py
|
loftwah/Daily-Coding-Problem
|
0327f0b4f69ef419436846c831110795c7a3c1fe
|
[
"MIT"
] | 129
|
2018-10-14T17:52:29.000Z
|
2022-01-29T15:45:57.000Z
|
others_problems/problem_3.py
|
loftwah/Daily-Coding-Problem
|
0327f0b4f69ef419436846c831110795c7a3c1fe
|
[
"MIT"
] | 2
|
2019-11-30T23:28:23.000Z
|
2020-01-03T16:30:32.000Z
|
others_problems/problem_3.py
|
loftwah/Daily-Coding-Problem
|
0327f0b4f69ef419436846c831110795c7a3c1fe
|
[
"MIT"
] | 60
|
2019-02-21T09:18:31.000Z
|
2022-03-25T21:01:04.000Z
|
"""Given a list, sort it using this method: reverse(lst, i, j), which sorts lst from i to j."""
| 95
| 95
| 0.673684
| 19
| 95
| 3.368421
| 0.842105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178947
| 95
| 1
| 95
| 95
| 0.820513
| 0.936842
| 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
|
249f7edf7238c80106ab58e6830cf21e961e1e7d
| 4,210
|
py
|
Python
|
apps/material/migrations/0003_auto_20180617_2210.py
|
PyCN/BlogBackendProject
|
144ea98d54c624cf93a69816779e4f3483ab80a2
|
[
"Apache-2.0"
] | 335
|
2018-02-06T11:40:44.000Z
|
2022-02-01T07:55:24.000Z
|
apps/material/migrations/0003_auto_20180617_2210.py
|
PyCN/BlogBackendProject
|
144ea98d54c624cf93a69816779e4f3483ab80a2
|
[
"Apache-2.0"
] | 18
|
2018-03-11T05:02:27.000Z
|
2022-03-11T23:18:34.000Z
|
apps/material/migrations/0003_auto_20180617_2210.py
|
PyCN/BlogBackendProject
|
144ea98d54c624cf93a69816779e4f3483ab80a2
|
[
"Apache-2.0"
] | 83
|
2018-03-02T03:24:06.000Z
|
2021-12-15T05:04:09.000Z
|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-17 14:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('material', '0002_auto_20180524_0951'),
]
operations = [
migrations.RenameField(
model_name='materialpicture',
old_name='abstract',
new_name='en_desc',
),
migrations.RenameField(
model_name='materialpicture',
old_name='subtitle',
new_name='en_title',
),
migrations.RemoveField(
model_name='materialcategory',
name='subname',
),
migrations.RemoveField(
model_name='materiallicense',
name='subname',
),
migrations.RemoveField(
model_name='materialtag',
name='subname',
),
migrations.RemoveField(
model_name='postbaseinfo',
name='abstract',
),
migrations.RemoveField(
model_name='postbaseinfo',
name='subtitle',
),
migrations.AddField(
model_name='materialbanner',
name='en_title',
field=models.CharField(blank=True, help_text='标题', max_length=100, null=True, verbose_name='标题'),
),
migrations.AddField(
model_name='materialcategory',
name='en_desc',
field=models.TextField(blank=True, help_text='类别描述', null=True, verbose_name='类别描述'),
),
migrations.AddField(
model_name='materialcategory',
name='en_name',
field=models.CharField(blank=True, help_text='英文名', max_length=30, null=True, verbose_name='英文名'),
),
migrations.AddField(
model_name='materiallicense',
name='en_desc',
field=models.CharField(blank=True, help_text='简介', max_length=255, null=True, verbose_name='简介'),
),
migrations.AddField(
model_name='materiallicense',
name='en_name',
field=models.CharField(blank=True, help_text='英文名', max_length=30, null=True, verbose_name='英文名'),
),
migrations.AddField(
model_name='materialmaster',
name='en_desc',
field=models.CharField(blank=True, help_text='简介', max_length=100, null=True, verbose_name='简介'),
),
migrations.AddField(
model_name='materialmaster',
name='en_name',
field=models.CharField(blank=True, help_text='名称', max_length=30, null=True, verbose_name='名称'),
),
migrations.AddField(
model_name='materialsocial',
name='en_desc',
field=models.CharField(blank=True, help_text='简介', max_length=100, null=True, verbose_name='简介'),
),
migrations.AddField(
model_name='materialsocial',
name='en_name',
field=models.CharField(blank=True, help_text='名称', max_length=30, null=True, verbose_name='名称'),
),
migrations.AddField(
model_name='materialtag',
name='en_name',
field=models.CharField(blank=True, help_text='英文名', max_length=30, null=True, verbose_name='英文名'),
),
migrations.AddField(
model_name='postbaseinfo',
name='en_desc',
field=models.CharField(blank=True, help_text='英文简介', max_length=255, null=True, verbose_name='英文简介'),
),
migrations.AddField(
model_name='postbaseinfo',
name='en_title',
field=models.CharField(blank=True, help_text='英文标题', max_length=100, null=True, verbose_name='英文标题'),
),
migrations.AlterField(
model_name='materialcategory',
name='desc',
field=models.TextField(blank=True, help_text='类别描述', null=True, verbose_name='类别描述'),
),
migrations.AlterField(
model_name='materialmaster',
name='desc',
field=models.CharField(blank=True, help_text='简介', max_length=100, null=True, verbose_name='简介'),
),
]
| 36.293103
| 113
| 0.574347
| 424
| 4,210
| 5.497642
| 0.17217
| 0.081081
| 0.078078
| 0.102102
| 0.793222
| 0.793222
| 0.713857
| 0.534106
| 0.534106
| 0.513514
| 0
| 0.021614
| 0.296675
| 4,210
| 115
| 114
| 36.608696
| 0.76562
| 0.016152
| 0
| 0.824074
| 1
| 0
| 0.136265
| 0.005557
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.018519
| 0
| 0.046296
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
24c551296c84d1f23cac7e905fac2ba3b50c367c
| 314
|
py
|
Python
|
docs/src/tutorial/authentication/basic01.py
|
eadwinCode/django-ninja
|
4033b70399f3f58db747fa1a41075488306accb7
|
[
"MIT"
] | 2,809
|
2020-06-21T08:48:40.000Z
|
2022-03-30T16:42:11.000Z
|
docs/src/tutorial/authentication/basic01.py
|
eadwinCode/django-ninja
|
4033b70399f3f58db747fa1a41075488306accb7
|
[
"MIT"
] | 311
|
2020-06-22T07:59:27.000Z
|
2022-03-31T18:01:23.000Z
|
docs/src/tutorial/authentication/basic01.py
|
eadwinCode/django-ninja
|
4033b70399f3f58db747fa1a41075488306accb7
|
[
"MIT"
] | 178
|
2020-07-08T00:40:43.000Z
|
2022-03-29T02:05:20.000Z
|
from ninja.security import HttpBasicAuth
class BasicAuth(HttpBasicAuth):
def authenticate(self, request, username, password):
if username == "admin" and password == "secret":
return username
@api.get("/basic", auth=BasicAuth())
def basic(request):
return {"httpuser": request.auth}
| 24.153846
| 56
| 0.684713
| 34
| 314
| 6.323529
| 0.676471
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.191083
| 314
| 12
| 57
| 26.166667
| 0.846457
| 0
| 0
| 0
| 0
| 0
| 0.079618
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.125
| 0.125
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
24cd5b1e1deb06e70477d252adc179e762e9bb54
| 409
|
py
|
Python
|
katas/kyu_5/scramblies.py
|
the-zebulan/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 40
|
2016-03-09T12:26:20.000Z
|
2022-03-23T08:44:51.000Z
|
katas/kyu_5/scramblies.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | null | null | null |
katas/kyu_5/scramblies.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 36
|
2016-11-07T19:59:58.000Z
|
2022-03-31T11:18:27.000Z
|
from collections import Counter
def scramble(s1, s2):
# Minor refactor of a solution by 00kevin on CodeWars
return not(Counter(s2) - Counter(s1))
# def scramble(s1, s2):
# cnt = 0
# length = len(s2)
# s2 = sorted(s2)
# for letter in sorted(s1):
# if letter == s2[cnt]:
# cnt += 1
# if cnt == length:
# return True
# return False
| 21.526316
| 57
| 0.540342
| 53
| 409
| 4.169811
| 0.584906
| 0.099548
| 0.117647
| 0.135747
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05618
| 0.347188
| 409
| 18
| 58
| 22.722222
| 0.771536
| 0.689487
| 0
| 0
| 0
| 0
| 0
| 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
|
24f7679e5a45a03100185732eaace43c03d62f5d
| 6,193
|
py
|
Python
|
tests/postprocess_integrate_func_group_macros_test.py
|
malaterre/DICOM-Standard
|
dcdda5c6a86c17f1dd1082a887943095d915f74b
|
[
"MIT"
] | 71
|
2017-04-28T22:59:22.000Z
|
2022-02-19T20:30:32.000Z
|
tests/postprocess_integrate_func_group_macros_test.py
|
malaterre/DICOM-Standard
|
dcdda5c6a86c17f1dd1082a887943095d915f74b
|
[
"MIT"
] | 57
|
2017-05-17T18:39:19.000Z
|
2022-03-23T16:48:50.000Z
|
tests/postprocess_integrate_func_group_macros_test.py
|
malaterre/DICOM-Standard
|
dcdda5c6a86c17f1dd1082a887943095d915f74b
|
[
"MIT"
] | 11
|
2018-04-18T16:34:05.000Z
|
2021-12-23T06:08:39.000Z
|
from dicom_standard.postprocess_integrate_func_group_macros import (
update_description,
process_mffg_macro_attributes,
process_cffg_macro_attributes,
process_fg_attributes,
)
from dicom_standard.process_modules import MF_FUNC_GROUP_MODULE_ID, CF_FUNC_GROUP_MODULE_ID
example_macro_attrs = [
{
'macroId': 'example-macro-1',
'path': 'example-macro-1:0001',
'description': 'Attribute of Example Macro 1.'
},
{
'macroId': 'example-macro-1',
'path': 'example-macro-1:0001:0002',
'description': 'Sub-attribute of Example Macro 1.'
},
]
example_macro = {
'macroName': 'Example Macro 1',
'ciodId': 'example-ciod',
'macroId': 'example-macro-1',
'usage': 'C',
'conditionalStatement': 'Required if Test Macro present.',
}
def test_update_description_adds_period_to_conditional():
example_attr = {
'macroId': 'example-macro-1',
'path': 'example-macro-1:0001',
'description': 'Attribute of Example Macro 1.'
}
example_macro_without_period = {
'macroName': 'Example Macro 1',
'usage': 'C',
'conditionalStatement': 'Conditional without period',
}
expected_updated_conditonal = 'Conditional without period.'
update_description(example_attr, example_macro_without_period)
assert expected_updated_conditonal in example_attr['description']
def test_process_mffg_macro_attributes():
expected_processed_attrs = [
{
'moduleId': 'example-ciod-multi-frame-functional-groups',
'path': 'example-ciod-multi-frame-functional-groups:52009229:0001',
'description': 'Attribute of Example Macro 1.<h3>Note</h3>'
'<p>Part of the Example Macro 1 Functional Group Macro with usage: C</p>'
'<p>Required if Test Macro present.</p>'
},
{
'moduleId': 'example-ciod-multi-frame-functional-groups',
'path': 'example-ciod-multi-frame-functional-groups:52009230:0001',
'description': 'Attribute of Example Macro 1.<h3>Note</h3>'
'<p>Part of the Example Macro 1 Functional Group Macro with usage: C</p>'
'<p>Required if Test Macro present.</p>'
},
{
'moduleId': 'example-ciod-multi-frame-functional-groups',
'path': 'example-ciod-multi-frame-functional-groups:52009229:0001:0002',
'description': 'Sub-attribute of Example Macro 1.<h3>Note</h3>'
'<p>Part of the Example Macro 1 Functional Group Macro with usage: C</p>'
'<p>Required if Test Macro present.</p>'
},
{
'moduleId': 'example-ciod-multi-frame-functional-groups',
'path': 'example-ciod-multi-frame-functional-groups:52009230:0001:0002',
'description': 'Sub-attribute of Example Macro 1.<h3>Note</h3>'
'<p>Part of the Example Macro 1 Functional Group Macro with usage: C</p>'
'<p>Required if Test Macro present.</p>'
},
]
assert process_mffg_macro_attributes(example_macro_attrs, example_macro) == expected_processed_attrs
def test_process_cffg_macro_attributes():
expected_processed_attrs = [
{
'moduleId': 'example-ciod-current-frame-functional-groups',
'path': 'example-ciod-current-frame-functional-groups:00060001:0001',
'description': 'Attribute of Example Macro 1.<h3>Note</h3>'
'<p>Part of the Example Macro 1 Functional Group Macro with usage: C</p>'
'<p>Required if Test Macro present.</p>'
},
{
'moduleId': 'example-ciod-current-frame-functional-groups',
'path': 'example-ciod-current-frame-functional-groups:00060001:0001:0002',
'description': 'Sub-attribute of Example Macro 1.<h3>Note</h3>'
'<p>Part of the Example Macro 1 Functional Group Macro with usage: C</p>'
'<p>Required if Test Macro present.</p>'
},
]
assert process_cffg_macro_attributes(example_macro_attrs, example_macro) == expected_processed_attrs
def test_process_fg_attributes():
example_ciods = ['example-ciod-1', 'example-ciod-2']
example_module_to_attr = [
{
'moduleId': 'multi-frame-functional-groups',
'path': 'multi-frame-functional-groups:0001',
},
{
'moduleId': 'multi-frame-functional-groups',
'path': 'multi-frame-functional-groups:0001:0002',
},
{
'moduleId': 'current-frame-functional-groups',
'path': 'current-frame-functional-groups:1001',
},
]
expected_processed_mffg_attrs = [
{
'moduleId': 'example-ciod-1-multi-frame-functional-groups',
'path': 'example-ciod-1-multi-frame-functional-groups:0001',
},
{
'moduleId': 'example-ciod-1-multi-frame-functional-groups',
'path': 'example-ciod-1-multi-frame-functional-groups:0001:0002',
},
{
'moduleId': 'example-ciod-2-multi-frame-functional-groups',
'path': 'example-ciod-2-multi-frame-functional-groups:0001',
},
{
'moduleId': 'example-ciod-2-multi-frame-functional-groups',
'path': 'example-ciod-2-multi-frame-functional-groups:0001:0002',
},
]
expected_processed_cffg_attrs = [
{
'moduleId': 'example-ciod-1-current-frame-functional-groups',
'path': 'example-ciod-1-current-frame-functional-groups:1001',
},
{
'moduleId': 'example-ciod-2-current-frame-functional-groups',
'path': 'example-ciod-2-current-frame-functional-groups:1001',
},
]
assert process_fg_attributes(example_module_to_attr, example_ciods, MF_FUNC_GROUP_MODULE_ID) == expected_processed_mffg_attrs
assert process_fg_attributes(example_module_to_attr, example_ciods, CF_FUNC_GROUP_MODULE_ID) == expected_processed_cffg_attrs
| 42.417808
| 129
| 0.610367
| 682
| 6,193
| 5.375367
| 0.107038
| 0.104746
| 0.171849
| 0.141844
| 0.816694
| 0.773595
| 0.732679
| 0.675941
| 0.655756
| 0.633115
| 0
| 0.043336
| 0.262232
| 6,193
| 145
| 130
| 42.710345
| 0.759028
| 0
| 0
| 0.323529
| 0
| 0
| 0.497174
| 0.227676
| 0
| 0
| 0
| 0
| 0.036765
| 1
| 0.029412
| false
| 0
| 0.014706
| 0
| 0.044118
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7013dc2492089ff2059c81f874a70f4f04ae6bd8
| 313
|
py
|
Python
|
src/evaluation/evaluator_jobtitle_structural.py
|
tiefenauer/ip7-python
|
512105ba39110ec77d2ea0961dd7c2a42d4ec26d
|
[
"MIT"
] | null | null | null |
src/evaluation/evaluator_jobtitle_structural.py
|
tiefenauer/ip7-python
|
512105ba39110ec77d2ea0961dd7c2a42d4ec26d
|
[
"MIT"
] | null | null | null |
src/evaluation/evaluator_jobtitle_structural.py
|
tiefenauer/ip7-python
|
512105ba39110ec77d2ea0961dd7c2a42d4ec26d
|
[
"MIT"
] | null | null | null |
from src.database.classification_results import StructuralClassificationResults
from src.evaluation.evaluator_jobtitle import JobtitleEvaluator
class StructuralEvaluator(JobtitleEvaluator):
def __init__(self, args):
super(StructuralEvaluator, self).__init__(args, StructuralClassificationResults())
| 39.125
| 90
| 0.840256
| 27
| 313
| 9.37037
| 0.666667
| 0.055336
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095847
| 313
| 7
| 91
| 44.714286
| 0.893993
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
701eeae3a8f34bb34de495f31ac2bb9687ba1af2
| 417
|
py
|
Python
|
Queue/Queue.py
|
riyasyash/CompetitiveProgramming
|
9cb5c71a2b4297fa8681f0e380ee7a7bb3ee5b5e
|
[
"Apache-2.0"
] | null | null | null |
Queue/Queue.py
|
riyasyash/CompetitiveProgramming
|
9cb5c71a2b4297fa8681f0e380ee7a7bb3ee5b5e
|
[
"Apache-2.0"
] | 79
|
2019-01-26T10:45:16.000Z
|
2022-02-21T22:16:24.000Z
|
Queue/Queue.py
|
riyasyash/CompetitiveProgramming
|
9cb5c71a2b4297fa8681f0e380ee7a7bb3ee5b5e
|
[
"Apache-2.0"
] | null | null | null |
class Queue:
def __init__(self):
self.__items = []
def enqueue(self, item):
self.__items.append(item)
def dequeue(self):
if not self.length():
raise QueueEmptyException()
item = self.__items[0]
self.__items = self.__items[1:]
return item
def length(self):
return len(self.__items)
class QueueEmptyException(Exception):
pass
| 19.857143
| 39
| 0.592326
| 46
| 417
| 5.021739
| 0.456522
| 0.233766
| 0.112554
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006873
| 0.302158
| 417
| 20
| 40
| 20.85
| 0.786942
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.266667
| false
| 0.066667
| 0
| 0.066667
| 0.533333
| 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
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
7047101e3cff5ada681aa63653fde8a27070fade
| 275
|
py
|
Python
|
tests/test_dbspecial.py
|
steverobbins/mycli
|
ad19b143da483f97a657a69eeff88f9a74966520
|
[
"BSD-3-Clause"
] | 2
|
2015-08-01T03:39:58.000Z
|
2015-11-08T07:54:59.000Z
|
tests/test_dbspecial.py
|
steverobbins/mycli
|
ad19b143da483f97a657a69eeff88f9a74966520
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_dbspecial.py
|
steverobbins/mycli
|
ad19b143da483f97a657a69eeff88f9a74966520
|
[
"BSD-3-Clause"
] | null | null | null |
from mycli.packages.completion_engine import suggest_type
from test_completion_engine import sorted_dicts
def test_u_suggests_databases():
suggestions = suggest_type('\u ', '\u ')
assert sorted_dicts(suggestions) == sorted_dicts([
{'type': 'database'}])
| 34.375
| 57
| 0.734545
| 33
| 275
| 5.787879
| 0.545455
| 0.172775
| 0.230366
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156364
| 275
| 7
| 58
| 39.285714
| 0.823276
| 0
| 0
| 0
| 0
| 0
| 0.065455
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 0
| null | null | 0
| 0.333333
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
7068b51119eb6c7237ca94d7fc31796fb5da7bdb
| 208
|
py
|
Python
|
fetch/__main__.py
|
simonoldfield/fetch
|
9e9e19ed964e485e04258dd283213aa46ad67fc5
|
[
"Apache-2.0"
] | 2
|
2018-05-24T11:20:27.000Z
|
2021-04-22T05:25:36.000Z
|
fetch/__main__.py
|
simonoldfield/fetch
|
9e9e19ed964e485e04258dd283213aa46ad67fc5
|
[
"Apache-2.0"
] | 4
|
2017-08-15T06:27:25.000Z
|
2021-04-22T05:26:45.000Z
|
fetch/__main__.py
|
simonoldfield/fetch
|
9e9e19ed964e485e04258dd283213aa46ad67fc5
|
[
"Apache-2.0"
] | 8
|
2017-03-27T00:14:25.000Z
|
2021-04-07T05:29:02.000Z
|
"""
Automatically download ancillary, given
a YAML config file. See the auto module.
"""
from __future__ import absolute_import
if __name__ == '__main__':
from .scripts import service
service.main()
| 20.8
| 40
| 0.740385
| 26
| 208
| 5.423077
| 0.807692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173077
| 208
| 9
| 41
| 23.111111
| 0.819767
| 0.384615
| 0
| 0
| 0
| 0
| 0.066667
| 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
|
706fc0962b36e785c23959fab4e4b3e8f2bf0731
| 92
|
py
|
Python
|
src/compas_3gs/rhino/forms/__init__.py
|
BlockResearchGroup/compas_3gs
|
66bd1545ce0f0034bd629753da9b8cd45fff6abd
|
[
"MIT"
] | 9
|
2020-04-29T03:21:45.000Z
|
2022-01-23T02:54:27.000Z
|
src/compas_3gs/rhino/forms/__init__.py
|
BlockResearchGroup/compas_3gs
|
66bd1545ce0f0034bd629753da9b8cd45fff6abd
|
[
"MIT"
] | 8
|
2020-01-30T15:17:17.000Z
|
2021-09-28T16:56:42.000Z
|
src/compas_3gs/rhino/forms/__init__.py
|
BlockResearchGroup/compas_3gs
|
66bd1545ce0f0034bd629753da9b8cd45fff6abd
|
[
"MIT"
] | 5
|
2020-03-31T12:53:29.000Z
|
2020-12-07T21:57:50.000Z
|
from __future__ import absolute_import
from .browser import Browser
__all__ = ["Browser"]
| 15.333333
| 38
| 0.793478
| 11
| 92
| 5.818182
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141304
| 92
| 5
| 39
| 18.4
| 0.810127
| 0
| 0
| 0
| 0
| 0
| 0.076087
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
70a8388458c8719cf4c82b1d0b4077f943f2789e
| 18
|
py
|
Python
|
Micropython/webrepl_cfg.py
|
alpha-timtauri/Mecanum-Car
|
cd426c028b4a3a84ac257045aafd3dbf4e220384
|
[
"CC0-1.0"
] | 1
|
2019-01-26T12:13:59.000Z
|
2019-01-26T12:13:59.000Z
|
Micropython/webrepl_cfg.py
|
alpha-timtauri/Mecanum-Car
|
cd426c028b4a3a84ac257045aafd3dbf4e220384
|
[
"CC0-1.0"
] | null | null | null |
Micropython/webrepl_cfg.py
|
alpha-timtauri/Mecanum-Car
|
cd426c028b4a3a84ac257045aafd3dbf4e220384
|
[
"CC0-1.0"
] | null | null | null |
PASS = 'password'
| 9
| 17
| 0.666667
| 2
| 18
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 18
| 1
| 18
| 18
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 1
| 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
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
560f423991c746a687b8923c6c6a8ab38f3782a2
| 8,400
|
py
|
Python
|
experiments/jex_eval/run_jex.py
|
racai-ai/pyeurovoc
|
84b58b5faf1a9c6fbe3fe2c69987537e3fe23ea5
|
[
"MIT"
] | 12
|
2021-08-05T04:09:37.000Z
|
2022-02-13T14:52:18.000Z
|
experiments/jex_eval/run_jex.py
|
racai-ai/pyeurovoc
|
84b58b5faf1a9c6fbe3fe2c69987537e3fe23ea5
|
[
"MIT"
] | 2
|
2022-01-08T20:13:25.000Z
|
2022-02-03T07:58:07.000Z
|
experiments/jex_eval/run_jex.py
|
racai-ai/pyeurovoc
|
84b58b5faf1a9c6fbe3fe2c69987537e3fe23ea5
|
[
"MIT"
] | 3
|
2021-07-30T19:20:58.000Z
|
2021-12-29T10:50:17.000Z
|
import os
from random import shuffle
import random
import shutil
jex_path = "eurovoc"
config_dir = "config_splits"
classifiers_dir = "classifiers_splits"
results_dir = "results"
SEEDS = [110, 221]
def create_splits(directory):
if not os.path.exists(os.path.join(jex_path, directory, "workspace", "splits")):
os.makedirs(os.path.join(jex_path, directory, "workspace", "splits"))
else:
shutil.rmtree(os.path.join(jex_path, directory, "workspace", "splits"))
os.makedirs(os.path.join(jex_path, directory, "workspace", "splits"))
list_samples = []
with open(os.path.join(jex_path, directory, "workspace", "corpus.cf"), "r", encoding="utf-8") as file:
for labels in file:
document = file.readline()
list_samples.append((document, labels))
for i, seed in enumerate(SEEDS):
random.seed(seed)
shuffle(list_samples)
ratio = int(len(list_samples) * 0.9)
train = list_samples[:ratio]
test = list_samples[ratio:]
if not os.path.exists(os.path.join(jex_path, directory, "workspace", "splits", "split_train_{}".format(i))):
os.makedirs(os.path.join(jex_path, directory, "workspace", "splits", "split_train_{}".format(i)))
if not os.path.exists(os.path.join(jex_path, directory, "workspace", "splits", "split_test_{}".format(i))):
os.makedirs(os.path.join(jex_path, directory, "workspace", "splits", "split_test_{}".format(i)))
with open(os.path.join(jex_path, directory, "workspace", "splits", "split_train_{}".format(i), "train.cf"), "w", encoding="utf-8") as file:
for document, label in train:
file.write(label)
file.write(document)
with open(os.path.join(jex_path, directory, "workspace", "splits", "split_test_{}".format(i), "test.cf"), "w", encoding="utf-8") as file:
for document, label in test:
file.write(label)
file.write(document)
def create_configs(directory):
if not os.path.exists(os.path.join(jex_path, directory, "workspace", config_dir)):
os.makedirs(os.path.join(jex_path, directory, "workspace", config_dir))
for i in range(len(SEEDS)):
with open(os.path.join(jex_path, directory, "workspace", config_dir, "PreProcess.properties".format(i)), "w") as file:
file.write("inputDir = {}/{}/workspace/cf\n".format(jex_path, directory))
file.write("stopwords = {}/{}/resources/stopwords.txt\n".format(jex_path, directory))
file.write("output = {}/{}/workspace/corpus.cf\n".format(jex_path, directory, i))
file.write("forTraining = true\n")
file.write("MultiWordsFile = {}/{}/resources/stopwords_multi.txt\n".format(jex_path, directory))
if not os.path.exists(os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i))):
os.makedirs(os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i)))
with open(os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i), "Train.properties"), "w") as file:
file.write("input = {}/{}/workspace/splits/split_train_{}/train.cf\n".format(jex_path, directory, i))
file.write("classifiersDir = {}/{}/workspace/{}/classifiers_{}/\n".format(jex_path, directory, classifiers_dir, i))
file.write("dict = {}/{}/workspace/dict_{}\n".format(jex_path, directory, i))
file.write("dumpReadable = true\n")
file.write("RefCorpusWordMinFreq = 4\n")
file.write("LlhThreshold = 5\n")
file.write("beta = 10\n")
file.write("minDocLength = 100\n")
file.write("minNumTrainingDocsPerDescriptor = 4\n")
file.write("minWeightOfAssociates = 2\n")
file.write("minNumAssociatesPerDescriptor = 1\n")
file.write("maxNumAssociatesPerDescriptor = 5000\n")
file.write("ThesaurusInfo = {}/{}/resources/ThesaurusStructure/\n".format(jex_path, directory))
file.write("DeprecatedFile = {}/{}/workspace/deprecated_{}.txt\n".format(jex_path, directory, i))
with open(os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i), "Evaluate.properties"), "w") as file:
file.write("input = {}/{}/workspace/splits/split_test_{}/test.cf\n".format(jex_path, directory, i))
file.write("output = {}/{}/workspace/{}/evaluate-result_{}.txt\n".format(jex_path, directory, results_dir, i))
file.write("dict = {}/{}/workspace/dict_{}\n".format(jex_path, directory, i))
file.write("blacklist = {}/{}/resources/blacklist.txt\n".format(jex_path, directory))
file.write("classifiersDir = {}/{}/workspace/{}/classifiers_{}/\n".format(jex_path, directory, classifiers_dir, i))
file.write("minNumCommonTokens = 1\n")
file.write("rank = 6\n")
file.write("displayClassifierInfo = true\n")
with open(os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i), "Index.properties"), "w") as file:
file.write("input = {}/{}/workspace/splits/split_test_{}/test.cf\n".format(jex_path, directory, i))
file.write("output = {}/{}/workspace/{}/Assign_Result_{}.xml\n".format(jex_path, directory, results_dir, i))
file.write("dict = {}/{}/workspace/dict_{}\n".format(jex_path, directory, i))
file.write("blacklist = {}/{}/resources/blacklist.txt\n".format(jex_path, directory))
file.write("classifiersDir = {}/{}/workspace/{}/classifiers_{}/\n".format(jex_path, directory, classifiers_dir, i))
file.write("minNumDesc = 1\n")
file.write("rank = 6\n")
file.write("minNumCommonTokens = 1\n")
def preprocess_files(directory):
os.system("java -Dlogback.configurationFile={} -Xms1400M -jar {} {}".format(
os.path.join(jex_path, directory, "workspace", "config", "logback.xml"),
os.path.join(jex_path, directory, "lib", "CreateCompactFormat.jar"),
os.path.join(jex_path, directory, "workspace", config_dir, "PreProcess.properties"),
))
def train_models(directory):
for i in range(len(SEEDS)):
if not os.path.exists(os.path.join(jex_path, directory, "workspace", classifiers_dir, "classifiers_{}".format(i))):
os.makedirs(os.path.join(jex_path, directory, "workspace", classifiers_dir, "classifiers_{}".format(i)))
os.system("java -Dlogback.configurationFile={} -Xms1400M -jar {} {}".format(
os.path.join(jex_path, directory, "workspace", "config", "logback.xml"),
os.path.join(jex_path, directory, "lib", "EuroVocIndexer.jar"),
os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i), "Train.properties"),
))
def evaluate_models(directory):
if not os.path.exists(os.path.join(jex_path, directory, "workspace", results_dir)):
os.makedirs(os.path.join(jex_path, directory, "workspace", results_dir))
for i in range(len(SEEDS)):
os.system("java -Dlogback.configurationFile={} -Xms1400M -jar {} {}".format(
os.path.join(jex_path, directory, "workspace", "config", "logback.xml"),
os.path.join(jex_path, directory, "lib", "EuroVocIndexer.jar"),
os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i), "Evaluate.properties"),
))
def index_test(directory):
if not os.path.exists(os.path.join(jex_path, directory, "workspace", results_dir)):
os.makedirs(os.path.join(jex_path, directory, "workspace", results_dir))
for i in range(len(SEEDS)):
os.system("java -Dlogback.configurationFile={} -Xms1400M -jar {} {}".format(
os.path.join(jex_path, directory, "workspace", "config", "logback.xml"),
os.path.join(jex_path, directory, "lib", "EuroVocIndexer.jar"),
os.path.join(jex_path, directory, "workspace", config_dir, "split_{}".format(i), "Index.properties"),
))
def run_jex():
for directory in os.listdir(jex_path):
create_configs(directory)
preprocess_files(directory)
create_splits(directory)
train_models(directory)
evaluate_models(directory)
index_test(directory)
if __name__ == '__main__':
run_jex()
| 49.122807
| 147
| 0.636905
| 1,027
| 8,400
| 5.06037
| 0.121714
| 0.078122
| 0.172407
| 0.092553
| 0.757745
| 0.747354
| 0.718491
| 0.702521
| 0.695786
| 0.665769
| 0
| 0.006769
| 0.190952
| 8,400
| 170
| 148
| 49.411765
| 0.757946
| 0
| 0
| 0.34127
| 0
| 0
| 0.285578
| 0.113374
| 0
| 0
| 0
| 0
| 0
| 1
| 0.055556
| false
| 0
| 0.031746
| 0
| 0.087302
| 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
|
563c22cbf5a3c3475b889e4b8d5bf42951306937
| 14,446
|
py
|
Python
|
aether-kernel/aether/kernel/api/migrations/0019_verbose_name.py
|
eHealthAfrica/aether
|
6845d7eeebd4ae57332f73d74db3617e00032204
|
[
"Apache-2.0"
] | 14
|
2018-08-09T20:57:16.000Z
|
2020-10-11T12:22:18.000Z
|
aether-kernel/aether/kernel/api/migrations/0019_verbose_name.py
|
eHealthAfrica/aether
|
6845d7eeebd4ae57332f73d74db3617e00032204
|
[
"Apache-2.0"
] | 148
|
2018-07-24T10:52:29.000Z
|
2022-02-10T09:06:44.000Z
|
aether-kernel/aether/kernel/api/migrations/0019_verbose_name.py
|
eHealthAfrica/aether
|
6845d7eeebd4ae57332f73d74db3617e00032204
|
[
"Apache-2.0"
] | 6
|
2018-07-25T13:33:10.000Z
|
2019-09-23T03:02:09.000Z
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-15 16:16
from __future__ import unicode_literals
import aether.kernel.api.models
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('kernel', '0018_schema_family'),
]
operations = [
migrations.AlterModelOptions(
name='attachment',
options={'ordering': ['submission__id', 'name'], 'verbose_name': 'attachment', 'verbose_name_plural': 'attachments'},
),
migrations.AlterModelOptions(
name='entity',
options={'ordering': ['project__id', '-modified'], 'verbose_name': 'entity', 'verbose_name_plural': 'entities'},
),
migrations.AlterModelOptions(
name='mapping',
options={'ordering': ['project__id', '-modified'], 'verbose_name': 'mapping', 'verbose_name_plural': 'mappings'},
),
migrations.AlterModelOptions(
name='mappingset',
options={'ordering': ['project__id', '-modified'], 'verbose_name': 'mapping set', 'verbose_name_plural': 'mapping sets'},
),
migrations.AlterModelOptions(
name='project',
options={'ordering': ['-modified'], 'verbose_name': 'project', 'verbose_name_plural': 'projects'},
),
migrations.AlterModelOptions(
name='projectschema',
options={'ordering': ['project__id', '-modified'], 'verbose_name': 'project schema', 'verbose_name_plural': 'project schemas'},
),
migrations.AlterModelOptions(
name='schema',
options={'ordering': ['-modified'], 'verbose_name': 'schema', 'verbose_name_plural': 'schemas'},
),
migrations.AlterModelOptions(
name='submission',
options={'ordering': ['project__id', '-modified'], 'verbose_name': 'submission', 'verbose_name_plural': 'submissions'},
),
migrations.AlterField(
model_name='attachment',
name='attachment_file',
field=models.FileField(upload_to=aether.kernel.api.models.__attachment_path__, verbose_name='file'),
),
migrations.AlterField(
model_name='attachment',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='attachment',
name='md5sum',
field=models.CharField(blank=True, max_length=36, verbose_name='file MD5'),
),
migrations.AlterField(
model_name='attachment',
name='name',
field=models.CharField(max_length=255, verbose_name='filename'),
),
migrations.AlterField(
model_name='attachment',
name='submission',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='kernel.Submission', verbose_name='submission'),
),
migrations.AlterField(
model_name='attachment',
name='submission_revision',
field=models.TextField(verbose_name='submission revision'),
),
migrations.AlterField(
model_name='entity',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='entity',
name='mapping',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entities', to='kernel.Mapping', verbose_name='mapping'),
),
migrations.AlterField(
model_name='entity',
name='mapping_revision',
field=models.TextField(verbose_name='mapping revision'),
),
migrations.AlterField(
model_name='entity',
name='modified',
field=models.CharField(editable=False, max_length=100, verbose_name='modified'),
),
migrations.AlterField(
model_name='entity',
name='payload',
field=django.contrib.postgres.fields.jsonb.JSONField(verbose_name='payload'),
),
migrations.AlterField(
model_name='entity',
name='project',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entities', to='kernel.Project', verbose_name='project'),
),
migrations.AlterField(
model_name='entity',
name='projectschema',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entities', to='kernel.ProjectSchema', verbose_name='project schema'),
),
migrations.AlterField(
model_name='entity',
name='revision',
field=models.TextField(default='1', verbose_name='revision'),
),
migrations.AlterField(
model_name='entity',
name='status',
field=models.CharField(choices=[('Pending Approval', 'Pending Approval'), ('Publishable', 'Publishable')], max_length=20, verbose_name='status'),
),
migrations.AlterField(
model_name='entity',
name='submission',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entities', to='kernel.Submission', verbose_name='submission'),
),
migrations.AlterField(
model_name='mapping',
name='definition',
field=django.contrib.postgres.fields.jsonb.JSONField(verbose_name='mapping rules'),
),
migrations.AlterField(
model_name='mapping',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='mapping',
name='is_active',
field=models.BooleanField(default=True, verbose_name='active?'),
),
migrations.AlterField(
model_name='mapping',
name='is_read_only',
field=models.BooleanField(default=False, verbose_name='read only?'),
),
migrations.AlterField(
model_name='mapping',
name='mappingset',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mappings', to='kernel.MappingSet', verbose_name='mapping set'),
),
migrations.AlterField(
model_name='mapping',
name='name',
field=models.CharField(max_length=50, unique=True, verbose_name='name'),
),
migrations.AlterField(
model_name='mapping',
name='project',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mappings', to='kernel.Project', verbose_name='project'),
),
migrations.AlterField(
model_name='mapping',
name='projectschemas',
field=models.ManyToManyField(blank=True, editable=False, related_name='mappings', to='kernel.ProjectSchema', verbose_name='project schemas'),
),
migrations.AlterField(
model_name='mapping',
name='revision',
field=models.TextField(default='1', verbose_name='revision'),
),
migrations.AlterField(
model_name='mappingset',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='mappingset',
name='input',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True, verbose_name='input sample'),
),
migrations.AlterField(
model_name='mappingset',
name='name',
field=models.CharField(max_length=50, unique=True, verbose_name='name'),
),
migrations.AlterField(
model_name='mappingset',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='mappingsets', to='kernel.Project', verbose_name='project'),
),
migrations.AlterField(
model_name='mappingset',
name='revision',
field=models.TextField(default='1', verbose_name='revision'),
),
migrations.AlterField(
model_name='mappingset',
name='schema',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True, verbose_name='AVRO schema'),
),
migrations.AlterField(
model_name='project',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='project',
name='jsonld_context',
field=models.TextField(blank=True, null=True, verbose_name='JSON LD context', help_text='JSON for Linking Data https://json-ld.org/'),
),
migrations.AlterField(
model_name='project',
name='name',
field=models.CharField(max_length=50, unique=True, verbose_name='name'),
),
migrations.AlterField(
model_name='project',
name='rdf_definition',
field=models.TextField(blank=True, null=True, verbose_name='RDF definition', help_text='Resource Description Framework https://www.w3.org/TR/rdf-schema/'),
),
migrations.AlterField(
model_name='project',
name='revision',
field=models.TextField(default='1', verbose_name='revision'),
),
migrations.AlterField(
model_name='project',
name='salad_schema',
field=models.TextField(blank=True, null=True, verbose_name='salad schema', help_text='Semantic Annotations for Linked Avro Data (SALAD) https://www.commonwl.org/draft-3/SchemaSalad.html')
),
migrations.AlterField(
model_name='projectschema',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='projectschema',
name='is_encrypted',
field=models.BooleanField(default=False, verbose_name='encrypted?'),
),
migrations.AlterField(
model_name='projectschema',
name='mandatory_fields',
field=models.TextField(blank=True, null=True, verbose_name='mandatory fields'),
),
migrations.AlterField(
model_name='projectschema',
name='masked_fields',
field=models.TextField(blank=True, null=True, verbose_name='masked fields'),
),
migrations.AlterField(
model_name='projectschema',
name='name',
field=models.CharField(max_length=50, unique=True, verbose_name='name'),
),
migrations.AlterField(
model_name='projectschema',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projectschemas', to='kernel.Project', verbose_name='project'),
),
migrations.AlterField(
model_name='projectschema',
name='schema',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projectschemas', to='kernel.Schema', verbose_name='schema'),
),
migrations.AlterField(
model_name='projectschema',
name='transport_rule',
field=models.TextField(blank=True, null=True, verbose_name='transport rule'),
),
migrations.AlterField(
model_name='schema',
name='definition',
field=django.contrib.postgres.fields.jsonb.JSONField(verbose_name='AVRO schema'),
),
migrations.AlterField(
model_name='schema',
name='family',
field=models.TextField(blank=True, null=True, verbose_name='schema family'),
),
migrations.AlterField(
model_name='schema',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='schema',
name='name',
field=models.CharField(max_length=50, unique=True, verbose_name='name'),
),
migrations.AlterField(
model_name='schema',
name='revision',
field=models.TextField(default='1', verbose_name='revision'),
),
migrations.AlterField(
model_name='schema',
name='type',
field=models.CharField(default='org.ehealthafrica.aether', max_length=50, verbose_name='schema type'),
),
migrations.AlterField(
model_name='submission',
name='id',
field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='submission',
name='mappingset',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='kernel.MappingSet', verbose_name='mapping set'),
),
migrations.AlterField(
model_name='submission',
name='payload',
field=django.contrib.postgres.fields.jsonb.JSONField(verbose_name='payload'),
),
migrations.AlterField(
model_name='submission',
name='project',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='submissions', to='kernel.Project', verbose_name='project'),
),
migrations.AlterField(
model_name='submission',
name='revision',
field=models.TextField(default='1', verbose_name='revision'),
),
]
| 43.512048
| 200
| 0.602658
| 1,382
| 14,446
| 6.137482
| 0.109262
| 0.093374
| 0.165055
| 0.191464
| 0.768687
| 0.752063
| 0.628036
| 0.545272
| 0.524287
| 0.495992
| 0
| 0.005842
| 0.265402
| 14,446
| 331
| 201
| 43.643505
| 0.793441
| 0.004776
| 0
| 0.765432
| 1
| 0.003086
| 0.188117
| 0.00167
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.018519
| 0
| 0.027778
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5647c5ebc59cbacc58fd4a79a65df2351ab0d4e4
| 23
|
py
|
Python
|
custom_components/afvalbeheer/__init__.py
|
tombruin/Home-Assistant-Sensor-Afvalbeheer
|
132aa67d0b0db4a1041e0cd4a9a538ef47e8b703
|
[
"Apache-2.0"
] | null | null | null |
custom_components/afvalbeheer/__init__.py
|
tombruin/Home-Assistant-Sensor-Afvalbeheer
|
132aa67d0b0db4a1041e0cd4a9a538ef47e8b703
|
[
"Apache-2.0"
] | null | null | null |
custom_components/afvalbeheer/__init__.py
|
tombruin/Home-Assistant-Sensor-Afvalbeheer
|
132aa67d0b0db4a1041e0cd4a9a538ef47e8b703
|
[
"Apache-2.0"
] | null | null | null |
__version__ = '4.7.31'
| 11.5
| 22
| 0.652174
| 4
| 23
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0.130435
| 23
| 1
| 23
| 23
| 0.35
| 0
| 0
| 0
| 0
| 0
| 0.26087
| 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
|
564dfbdd878e4d091c380b40438e0b68264021ab
| 237
|
py
|
Python
|
tests/main.py
|
OlaWod/SmartBin
|
1b3db59a118e9526f137abed6594bf12c720c34b
|
[
"MIT"
] | null | null | null |
tests/main.py
|
OlaWod/SmartBin
|
1b3db59a118e9526f137abed6594bf12c720c34b
|
[
"MIT"
] | null | null | null |
tests/main.py
|
OlaWod/SmartBin
|
1b3db59a118e9526f137abed6594bf12c720c34b
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
from bottle import get,post,run,request,template
@get("/")
def index():
return template("index")
@post("/cmd")
def cmd():
print("按下按钮: "+request.body.read().decode())
run(host="0.0.0.0",port="8080")
| 26.333333
| 49
| 0.628692
| 36
| 237
| 4.138889
| 0.694444
| 0.040268
| 0.040268
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043902
| 0.135021
| 237
| 9
| 50
| 26.333333
| 0.682927
| 0.088608
| 0
| 0
| 0
| 0
| 0.129808
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.125
| 0.125
| 0.5
| 0.125
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
568531c25eab12f88ec688bf8cc0ec77e28e3188
| 841
|
py
|
Python
|
client/tinychain/__init__.py
|
MuhamedEssam/tinychain
|
842b259dd55bd8e8bf8e1f1dc826acc8116e98de
|
[
"Apache-2.0"
] | 39
|
2021-03-04T07:43:33.000Z
|
2021-12-31T06:41:59.000Z
|
client/tinychain/__init__.py
|
MuhamedEssam/tinychain
|
842b259dd55bd8e8bf8e1f1dc826acc8116e98de
|
[
"Apache-2.0"
] | 56
|
2021-06-23T16:02:44.000Z
|
2022-03-30T11:40:20.000Z
|
client/tinychain/__init__.py
|
MuhamedEssam/tinychain
|
842b259dd55bd8e8bf8e1f1dc826acc8116e98de
|
[
"Apache-2.0"
] | 10
|
2021-03-05T22:48:32.000Z
|
2022-02-11T20:02:29.000Z
|
import tinychain.chain
import tinychain.collection.bound as bound
import tinychain.error
import tinychain.graph
import tinychain.graph.edge
import tinychain.host
import tinychain.ml.cnn
import tinychain.ml.dnn
import tinychain.op
import tinychain.ref
from tinychain.cluster import Cluster, write_cluster
from tinychain.collection import Column
from tinychain.collection import btree, table, tensor
from tinychain.decorators import closure, delete_method, get_method, post_method, put_method, delete_op, get_op, post_op, put_op
from tinychain.ml import linalg
from tinychain.ref import After, Case, If, While
from tinychain.reflect import Meta, Object
from tinychain.state import Class, Instance, Map, State, Scalar, Stream, Tuple
from tinychain.value import *
from tinychain.util import form_of, print_json, to_json, uri, use, Context, URI
| 38.227273
| 128
| 0.831153
| 124
| 841
| 5.540323
| 0.435484
| 0.218341
| 0.058224
| 0.084425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107015
| 841
| 21
| 129
| 40.047619
| 0.91478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.05
| 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
|
3b290847606ef016e347fbce7f9b1ecb86b98c14
| 33
|
py
|
Python
|
__init__.py
|
timurk1234/bqstream
|
e630efb01cbf9039c108cc4b0c1e8d0f62a14e16
|
[
"Apache-2.0"
] | null | null | null |
__init__.py
|
timurk1234/bqstream
|
e630efb01cbf9039c108cc4b0c1e8d0f62a14e16
|
[
"Apache-2.0"
] | null | null | null |
__init__.py
|
timurk1234/bqstream
|
e630efb01cbf9039c108cc4b0c1e8d0f62a14e16
|
[
"Apache-2.0"
] | null | null | null |
__author__ = 'alexandereroshkin'
| 16.5
| 32
| 0.818182
| 2
| 33
| 11.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 33
| 1
| 33
| 33
| 0.766667
| 0
| 0
| 0
| 0
| 0
| 0.515152
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3b3145456d49a73bf3431e024badebb2c2e56c82
| 8,201
|
py
|
Python
|
qcm/Box2InPlaceCalibration.py
|
golfit/work-archive
|
bdd37d46fda3fde15ec2164d3335d6b4ed576bd7
|
[
"MIT"
] | null | null | null |
qcm/Box2InPlaceCalibration.py
|
golfit/work-archive
|
bdd37d46fda3fde15ec2164d3335d6b4ed576bd7
|
[
"MIT"
] | null | null | null |
qcm/Box2InPlaceCalibration.py
|
golfit/work-archive
|
bdd37d46fda3fde15ec2164d3335d6b4ed576bd7
|
[
"MIT"
] | null | null | null |
#This calibration is for Box 2 in ANT position, "in-place" (in front of antenna, being driven by Shoelace system with matching network, and with data from oscilloscope when digitizer is connected in parallel (with long cable run) as normal).
#The digitizer and cable run affects the calibration on the order of a few percent. This is true more for the magnitude than the phase, it seems.
#Ted Golfinopoulos, 12 June 2012
from numpy import *
fspS=[ 39848.197, 44275.775, 48703.352, 53130.930, 57558.507, 62126.643, 66554.220, 70841.240, 75198.538, 79555.837, 83983.414, 88270.434, 92698.011, 97055.310,101412.608,105769.907,110197.484,114484.503,118701.244,122988.263,127345.562,131632.581,135919.601,140066.062,144423.361,148710.380,152997.400,157073.582,161430.881,165577.342,169723.803,174010.823,178157.284,182374.025,186590.765,190666.948,194953.967,199100.429,203246.890,207393.352,211469.534,215686.275,219762.457,223838.639,227985.101,232131.562,236207.745,240354.206,244289.831,248366.013,252512.475,256448.099,260664.839,264670.743,268676.646,272752.829,276688.453,280834.915,284770.539,288706.163,292852.625,296788.249,300723.874,304870.335]
HspSr=[188.91982,194.00594,196.66930,198.14938,199.17017,200.03872,201.23134,202.03042,202.65639,203.20845,203.75990,204.25180,204.70009,205.16597,205.59184,205.98638,206.36240,206.69198,206.97254,207.18472,207.35006,207.49144,207.60894,207.70176,207.76518,207.80086,207.81446,207.80823,207.79016,207.77804,207.76011,207.73411,207.70842,207.66686,207.62001,207.56680,207.48246,207.39647,207.29827,207.18024,207.06212,206.92122,206.77538,206.60875,206.45883,206.31952,206.19577,206.08717,206.00079,205.92964,205.86550,205.84544,205.83519,205.85486,205.88401,205.92064,205.98395,206.05217,206.13552,206.20043,206.26638,206.36735,206.50613,206.50290]
HspSi=[-7.01132,-6.22033,-5.80039,-5.52676,-5.25152,-5.04925,-4.84408,-4.62726,-4.47023,-4.32798,-4.19967,-4.10291,-4.05392,-3.98891,-3.94984,-3.89579,-3.86835,-3.86771,-3.85806,-3.86046,-3.86552,-3.85326,-3.84119,-3.85559,-3.86694,-3.89581,-3.90785,-3.91012,-3.91881,-3.94021,-3.95842,-3.98396,-4.02229,-4.04596,-4.06991,-4.08844,-4.11467,-4.15118,-4.18551,-4.21613,-4.25985,-4.31608,-4.35402,-4.40052,-4.44865,-4.48271,-4.52464,-4.57073,-4.61331,-4.65878,-4.70115,-4.73273,-4.76789,-4.80472,-4.83431,-4.87819,-4.92755,-4.97088,-5.01529,-5.05385,-5.09998,-5.15952,-5.15774,-5.23538]
fsdS=[ 41794.586, 45641.853, 48044.476, 49621.429, 51494.400, 53370.623, 55916.151, 57820.785, 59872.649, 62421.513, 64861.492, 66694.092, 68241.450, 70274.602, 72125.716, 73873.204, 75182.915, 76941.931, 78877.585, 80509.334, 82091.738, 83935.100, 85496.389, 86778.098, 88512.024, 90271.444, 91489.635, 93122.788, 94740.485, 95968.940, 97649.662, 99196.089,101072.389,102533.367,104235.774,105670.256,107332.761,109137.035,110631.153,112277.908,114015.808,115576.191,116643.009,118260.724,119648.785,121230.212,122670.507,123829.287,125365.598,126554.878,128131.676,129242.160,130755.219,132173.715,133855.635,135584.415,137076.120,138285.798,139914.624,141042.279,142588.603,143813.525,145286.005,146543.986,147878.488,149260.989,150682.446,152305.871,153659.182,155097.950,156112.243,157733.895,159021.040,160328.747,161741.117,162940.248,164419.024,165564.464,167568.279,168838.563,170481.897,171587.671,173074.720,174299.220,175680.907,177020.175,178425.565,180044.574,181123.783,182726.479,183743.957,185397.487,186362.582,187864.435,189009.666,190574.292,191797.771,193319.555,194463.221,195963.008,197139.639,198611.190,199616.837,201273.595,202255.988,203891.037,204875.995,206410.690,207610.757,209202.470,210218.287,211803.485,212818.721,214473.962,215442.104,216941.121,218088.703,219641.398,220699.689,222381.379,223737.027,225530.712,226664.173,228178.134,229264.409,230915.010,231885.237,233418.031,234553.472,236078.733,237116.437,238611.396,239779.632,241055.027,242440.530,243423.584,244951.986,246079.380,247612.904,248667.636,249935.116,251282.835,252635.872,253920.430,254943.926,256488.166,257637.675,259142.355,260133.234,261733.314,262773.228,264216.286,265386.883,266510.792,268026.683,269006.650,270615.650,271642.876,273115.890,274254.588,275382.417,276890.100,278072.921,279517.403,280515.423,282015.574,283121.575,284267.799,285949.363,286975.910,288493.383,289639.059,291178.456,292210.911,293472.536,294878.619,295855.710,297392.477,298441.465,299684.135,301126.336,302360.528,303736.031]
HsdSr=[194.03212,194.94301,196.31019,197.30997,198.07278,198.68026,199.51482,200.00975,200.52698,200.94047,201.29896,201.52038,201.74643,201.96905,202.17473,202.36743,202.54352,202.72634,202.80854,202.99596,203.13476,203.33362,203.50993,203.71460,203.87927,204.04374,204.21151,204.43524,204.67976,204.89346,205.09531,205.26987,205.43683,205.61085,205.79430,205.91345,206.03679,206.14775,206.23255,206.30478,206.39968,206.50338,206.57704,206.63626,206.69513,206.81930,206.89488,206.96275,207.01482,207.08556,207.16035,207.20919,207.27602,207.34690,207.38710,207.41022,207.44745,207.48589,207.50215,207.51461,207.52499,207.53396,207.53750,207.52795,207.56044,207.56126,207.56135,207.57511,207.60494,207.61675,207.62600,207.63701,207.63331,207.60486,207.58869,207.60592,207.59568,207.57349,207.55786,207.53310,207.52116,207.51317,207.49461,207.50300,207.49910,207.47241,207.48812,207.48433,207.48197,207.46877,207.47693,207.46908,207.47157,207.47556,207.47189,207.46322,207.44516,207.42188,207.38533,207.38340,207.36044,207.33819,207.30840,207.26174,207.23038,207.18960,207.15220,207.10156,207.04442,206.95935,206.90968,206.86534,206.80948,206.76021,206.69788,206.65107,206.59718,206.55878,206.51654,206.50666,206.48227,206.44600,206.42283,206.37399,206.30581,206.24428,206.18597,206.14045,206.11770,206.02564,205.93876,205.85306,205.78297,205.74833,205.74925,205.72934,205.69237,205.65150,205.60076,205.58231,205.59064,205.59888,205.59422,205.58016,205.55320,205.54029,205.56170,205.57166,205.59171,205.60648,205.61550,205.62552,205.64432,205.67586,205.70011,205.72669,205.74399,205.76044,205.79040,205.80667,205.80978,205.82957,205.83695,205.85144,205.85941,205.88153,205.89996,205.90271,205.90342,205.92683,205.97013,205.99686,206.03684,206.06291,206.09687,206.12750,206.16449,206.22918,206.27835,206.31403,206.36396,206.43467,206.47144]
HsdSi=[-7.16117,-6.00870,-5.86492,-5.68195,-5.49802,-5.35888,-5.23983,-5.10353,-4.97698,-4.81126,-4.76922,-4.66156,-4.61081,-4.52373,-4.46331,-4.42396,-4.39187,-4.37538,-4.38571,-4.37428,-4.30946,-4.22580,-4.17808,-4.16732,-4.11893,-4.08864,-4.02682,-3.97422,-3.93153,-3.92079,-3.90334,-3.91942,-3.91856,-3.89879,-3.91565,-3.90289,-3.92269,-3.92981,-3.90112,-3.87871,-3.91362,-3.91087,-3.88198,-3.87590,-3.85826,-3.87113,-3.87236,-3.86266,-3.89323,-3.89794,-3.85745,-3.85041,-3.85462,-3.87542,-3.87408,-3.87448,-3.83922,-3.83242,-3.83142,-3.82051,-3.85485,-3.86371,-3.84865,-3.83873,-3.79623,-3.78067,-3.80321,-3.80695,-3.82391,-3.82684,-3.82880,-3.83911,-3.85998,-3.87217,-3.94540,-3.95292,-3.97590,-3.99119,-3.99154,-3.99363,-3.98719,-3.99079,-4.01168,-4.00423,-3.96243,-3.98198,-3.97785,-3.97966,-3.98115,-4.00701,-4.00667,-4.01784,-4.01471,-4.02802,-4.04750,-4.05626,-4.07023,-4.08522,-4.11551,-4.11116,-4.12004,-4.13928,-4.16112,-4.17062,-4.19027,-4.21479,-4.21391,-4.22748,-4.23046,-4.24848,-4.26048,-4.25751,-4.28753,-4.31025,-4.31417,-4.29727,-4.31811,-4.31106,-4.32741,-4.35410,-4.38234,-4.39608,-4.41166,-4.43335,-4.46466,-4.49606,-4.51406,-4.53864,-4.56131,-4.57866,-4.58277,-4.61450,-4.62365,-4.63382,-4.63920,-4.63209,-4.64019,-4.65131,-4.66170,-4.66924,-4.68875,-4.69399,-4.70943,-4.69159,-4.70457,-4.71541,-4.72352,-4.72559,-4.74473,-4.75233,-4.76266,-4.76667,-4.78049,-4.81686,-4.82631,-4.85658,-4.86545,-4.89102,-4.88840,-4.90320,-4.92095,-4.93483,-4.93815,-4.94513,-4.95123,-4.95576,-4.98105,-4.98785,-5.01865,-5.04068,-5.05843,-5.07257,-5.10205,-5.11389,-5.13045,-5.15216,-5.16247,-5.15357,-5.14811,-5.14665,-5.12523,-5.14489,-5.07689]
#Combine real and imaginary parts of transfer function
HspS=double(HspSr)+1j*double(HspSi) #Synchronous detection
HsdS=double(HsdSr)+1j*double(HsdSi) #Spectrogram method
#Save data to numpy binary array
save("fsdSBox2", fsdS)
save("HsdSBox2", HsdS)
save("fspSBox2", fspS)
save("HspSBox2", HspS)
| 303.740741
| 2,019
| 0.760761
| 1,605
| 8,201
| 3.887227
| 0.660436
| 0.002565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.70275
| 0.019998
| 8,201
| 26
| 2,020
| 315.423077
| 0.073535
| 0.065724
| 0
| 0
| 0
| 0
| 0.00418
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.076923
| 0
| 0.076923
| 0
| 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
|
3b96236decdf77fdf29676d3ca4ab4d498898ac8
| 184
|
py
|
Python
|
run.py
|
ShaderLight/autochampselect
|
b7d346cc99011b5f84867f3a01dc2e8d815c05d7
|
[
"MIT"
] | null | null | null |
run.py
|
ShaderLight/autochampselect
|
b7d346cc99011b5f84867f3a01dc2e8d815c05d7
|
[
"MIT"
] | null | null | null |
run.py
|
ShaderLight/autochampselect
|
b7d346cc99011b5f84867f3a01dc2e8d815c05d7
|
[
"MIT"
] | null | null | null |
import logging
from modules.gui import rendergui
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt='%d/%m/%Y %H:%M:%S', level=logging.DEBUG)
rendergui()
| 30.666667
| 121
| 0.711957
| 27
| 184
| 4.851852
| 0.703704
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086957
| 184
| 6
| 122
| 30.666667
| 0.779762
| 0
| 0
| 0
| 0
| 0
| 0.313514
| 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
|
3b9bfa5eabb4cd97dee1866c12a024040fd5f0c1
| 423
|
py
|
Python
|
cpc/entity/Scope.py
|
U-Ar/Cpresto
|
f723458fb237c9e3e8bc8a6afdf7c81858a65363
|
[
"BSD-3-Clause"
] | 1
|
2021-05-09T07:10:19.000Z
|
2021-05-09T07:10:19.000Z
|
cpc/entity/Scope.py
|
U-Ar/Cpresto
|
f723458fb237c9e3e8bc8a6afdf7c81858a65363
|
[
"BSD-3-Clause"
] | null | null | null |
cpc/entity/Scope.py
|
U-Ar/Cpresto
|
f723458fb237c9e3e8bc8a6afdf7c81858a65363
|
[
"BSD-3-Clause"
] | null | null | null |
from abc import ABCMeta,abstractmethod
class Scope(metaclass=ABCMeta):
def __init__(self):
self.children = []
@abstractmethod
def is_toplevel(self):
pass
@abstractmethod
def toplevel(self):
pass
@abstractmethod
def parent(self):
pass
def add_child(self,s):
self.children.append(s)
@abstractmethod
def get(self,name):
pass
| 17.625
| 38
| 0.602837
| 45
| 423
| 5.533333
| 0.488889
| 0.273092
| 0.128514
| 0.240964
| 0.26506
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.309693
| 423
| 24
| 39
| 17.625
| 0.85274
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.222222
| 0.055556
| 0
| 0.444444
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
8e659d1abc18c1deae95df874eea7232ca782852
| 48
|
py
|
Python
|
src/rowmapy/__init__.py
|
rowma/rowmapy
|
ce7e7e1be0039c5898e0bb9ceeb902516e862e5b
|
[
"MIT"
] | null | null | null |
src/rowmapy/__init__.py
|
rowma/rowmapy
|
ce7e7e1be0039c5898e0bb9ceeb902516e862e5b
|
[
"MIT"
] | 1
|
2021-01-02T03:54:23.000Z
|
2021-01-02T03:58:37.000Z
|
src/rowmapy/__init__.py
|
rowma/rowmapy
|
ce7e7e1be0039c5898e0bb9ceeb902516e862e5b
|
[
"MIT"
] | null | null | null |
__version__ = '1.0.6'
from .rowma import Rowma
| 12
| 24
| 0.708333
| 8
| 48
| 3.75
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.075
| 0.166667
| 48
| 3
| 25
| 16
| 0.675
| 0
| 0
| 0
| 0
| 0
| 0.104167
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8e69fc93e177c839eeb13edf32db9d82441e77ac
| 119
|
py
|
Python
|
src/utils.py
|
rtfreedman/CS512
|
1c0f6aef79d6b6636dabfc713b1d69e7a95ba772
|
[
"MIT"
] | null | null | null |
src/utils.py
|
rtfreedman/CS512
|
1c0f6aef79d6b6636dabfc713b1d69e7a95ba772
|
[
"MIT"
] | null | null | null |
src/utils.py
|
rtfreedman/CS512
|
1c0f6aef79d6b6636dabfc713b1d69e7a95ba772
|
[
"MIT"
] | null | null | null |
import pip
def install(package):
print("Attempting to pip install {}", package)
pip.main(['install', package])
| 23.8
| 50
| 0.680672
| 15
| 119
| 5.4
| 0.6
| 0.518519
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168067
| 119
| 4
| 51
| 29.75
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0.294118
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0.25
| 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
|
8e78ae7a1b58779045718b050f2a7e7876af22a3
| 13,905
|
py
|
Python
|
mhs/common/mhs_common/state/tests/test_work_description.py
|
tomzo/integration-adaptors
|
d4f296d3e44475df6f69a78a27fac6ed5b67513b
|
[
"Apache-2.0"
] | null | null | null |
mhs/common/mhs_common/state/tests/test_work_description.py
|
tomzo/integration-adaptors
|
d4f296d3e44475df6f69a78a27fac6ed5b67513b
|
[
"Apache-2.0"
] | 4
|
2021-03-31T19:46:30.000Z
|
2021-03-31T19:55:03.000Z
|
mhs/common/mhs_common/state/tests/test_work_description.py
|
tomzo/integration-adaptors
|
d4f296d3e44475df6f69a78a27fac6ed5b67513b
|
[
"Apache-2.0"
] | 2
|
2020-04-02T11:22:17.000Z
|
2021-04-11T07:24:48.000Z
|
import copy
import unittest
from unittest.mock import MagicMock, patch
from utilities import test_utilities
from utilities.test_utilities import async_test
from mhs_common import workflow
from mhs_common.state import work_description as wd
input_data = {
wd.DATA_KEY: 'aaa-aaa-aaa',
wd.DATA: {
wd.CREATED_TIMESTAMP: '11:59',
wd.LATEST_TIMESTAMP: '12:00',
wd.VERSION_KEY: 1,
wd.INBOUND_STATUS: None,
wd.OUTBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_PREPARED,
wd.WORKFLOW: workflow.SYNC
}
}
old_data = {
wd.DATA_KEY: 'aaa-aaa-aaa',
wd.DATA: {
wd.VERSION_KEY: 0,
wd.CREATED_TIMESTAMP: '11:59',
wd.LATEST_TIMESTAMP: '12:00',
wd.INBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_PREPARED,
wd.OUTBOUND_STATUS: None,
wd.WORKFLOW: workflow.SYNC
}
}
class TestWorkDescription(unittest.TestCase):
def test_constructor(self):
persistence = MagicMock()
work_description = wd.WorkDescription(persistence, input_data)
self.assertEqual(work_description.outbound_status, wd.MessageStatus.OUTBOUND_MESSAGE_PREPARED)
self.assertEqual(work_description.version, 1)
self.assertEqual(work_description.created_timestamp, '11:59')
self.assertEqual(work_description.last_modified_timestamp, '12:00')
@patch('utilities.timing.get_time')
@async_test
async def test_publish_updates(self, time_mock):
time_mock.return_value = '12:00'
future = test_utilities.awaitable(old_data)
persistence = MagicMock()
persistence.get.return_value = future
persistence.add.return_value = future
work_description = wd.WorkDescription(persistence, input_data)
await work_description.publish()
persistence.add.assert_called_with(input_data[wd.DATA_KEY], input_data)
@patch('utilities.timing.get_time')
@async_test
async def test_publish_update_latest_is_none(self, time_mock):
time_mock.return_value = '12:00'
future = test_utilities.awaitable(None)
persistence = MagicMock()
persistence.get.return_value = future
persistence.add.return_value = future
work_description = wd.WorkDescription(persistence, input_data)
await work_description.publish()
persistence.add.assert_called_with(input_data[wd.DATA_KEY], input_data)
@async_test
async def test_out_of_date_version(self):
future = test_utilities.awaitable({
wd.DATA_KEY: 'aaa-aaa-aaa',
wd.DATA: {
wd.VERSION_KEY: 3,
wd.LATEST_TIMESTAMP: '11:00',
wd.OUTBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_PREPARED
}
})
persistence = MagicMock()
persistence.get.return_value = future
persistence.add.return_value = future
work_description = wd.WorkDescription(persistence, input_data)
with self.assertRaises(wd.OutOfDateVersionError):
await work_description.publish()
@patch('utilities.timing.get_time')
@async_test
async def test_auto_increase_version(self, time_mock):
time_mock.return_value = '12:00'
future = test_utilities.awaitable({
wd.DATA_KEY: 'aaa-aaa-aaa',
wd.DATA: {
wd.VERSION_KEY: 1,
wd.LATEST_TIMESTAMP: '11:00',
wd.OUTBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_PREPARED,
}
})
persistence = MagicMock()
persistence.get.return_value = future
persistence.add.return_value = future
work_description = wd.WorkDescription(persistence, input_data)
await work_description.publish()
updated = copy.deepcopy(input_data)
updated[wd.DATA][wd.VERSION_KEY] = 2
# Check local version updated
self.assertEqual(work_description.version, 2)
persistence.add.assert_called_with('aaa-aaa-aaa', updated)
@patch('utilities.timing.get_time')
@async_test
async def test_set_outbound_status(self, time_mock):
time_mock.return_value = '12:00'
future = test_utilities.awaitable(old_data)
persistence = MagicMock()
persistence.get.return_value = future
persistence.add.return_value = future
work_description = wd.WorkDescription(persistence, input_data)
new_data = copy.deepcopy(input_data)
new_data[wd.DATA][wd.OUTBOUND_STATUS] = wd.MessageStatus.OUTBOUND_MESSAGE_ACKD
await work_description.set_outbound_status(wd.MessageStatus.OUTBOUND_MESSAGE_ACKD)
persistence.add.assert_called_with(input_data[wd.DATA_KEY], new_data)
@patch('utilities.timing.get_time')
@async_test
async def test_set_inbound_status(self, time_mock):
time_mock.return_value = '12:00'
future = test_utilities.awaitable(old_data)
persistence = MagicMock()
persistence.get.return_value = future
persistence.add.return_value = future
work_description = wd.WorkDescription(persistence, input_data)
new_data = copy.deepcopy(input_data)
new_data[wd.DATA][wd.INBOUND_STATUS] = wd.MessageStatus.INBOUND_RESPONSE_FAILED
await work_description.set_inbound_status(wd.MessageStatus.INBOUND_RESPONSE_FAILED)
persistence.add.assert_called_with(input_data[wd.DATA_KEY], new_data)
def test_null_persistence(self):
with self.assertRaises(ValueError):
wd.WorkDescription(None, {'None': 'None'})
@async_test
async def test_update_status(self):
new_data = {
wd.DATA_KEY: 'aaa-aaa-aaa',
wd.DATA: {
wd.CREATED_TIMESTAMP: '11:59',
wd.LATEST_TIMESTAMP: '13:00',
wd.VERSION_KEY: 1,
wd.INBOUND_STATUS: None,
wd.OUTBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_ACKD,
wd.WORKFLOW: workflow.SYNC
}
}
persistence = MagicMock()
persistence.get.return_value = test_utilities.awaitable(new_data)
work_description = wd.WorkDescription(persistence, old_data)
await work_description.update()
self.assertEqual(work_description.version, 1)
self.assertEqual(work_description.outbound_status, wd.MessageStatus.OUTBOUND_MESSAGE_ACKD)
self.assertEqual(work_description.last_modified_timestamp, '13:00')
@async_test
async def test_update_status_no_data_returned(self):
persistence = MagicMock()
persistence.get.return_value = test_utilities.awaitable(None)
work_description = wd.WorkDescription(persistence, old_data)
with self.assertRaises(wd.EmptyWorkDescriptionError):
await work_description.update()
@async_test
async def test_deserialize(self):
new_data = {
wd.DATA_KEY: 'aaa-aaa-aaa',
wd.DATA: {
wd.CREATED_TIMESTAMP: '12:00',
wd.LATEST_TIMESTAMP: '13:00',
wd.VERSION_KEY: 1,
wd.INBOUND_STATUS: wd.MessageStatus.INBOUND_RESPONSE_FAILED,
wd.OUTBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_ACKD,
wd.WORKFLOW: workflow.SYNC_ASYNC
}
}
work_description = wd.WorkDescription(MagicMock(), old_data)
work_description._deserialize_data(new_data)
self.assertEqual(work_description.version, 1)
self.assertEqual(work_description.created_timestamp, '12:00')
self.assertEqual(work_description.last_modified_timestamp, '13:00')
self.assertEqual(work_description.inbound_status, wd.MessageStatus.INBOUND_RESPONSE_FAILED)
self.assertEqual(work_description.outbound_status, wd.MessageStatus.OUTBOUND_MESSAGE_ACKD)
self.assertEqual(work_description.workflow, workflow.SYNC_ASYNC)
class TestWorkDescriptionFactory(unittest.TestCase):
@patch('mhs_common.state.work_description.WorkDescription')
@async_test
async def test_get_from_store(self, work_mock):
persistence = MagicMock()
persistence.get.return_value = test_utilities.awaitable(old_data)
await wd.get_work_description_from_store(persistence, 'aaa-aaa-aaa')
persistence.get.assert_called_with('aaa-aaa-aaa')
work_mock.assert_called_with(persistence, old_data)
@async_test
async def test_get_from_store_no_result_found(self):
persistence = MagicMock()
persistence.get.return_value = test_utilities.awaitable(None)
with self.assertRaises(wd.EmptyWorkDescriptionError):
await wd.get_work_description_from_store(persistence, 'aaa-aaa-aaa')
@async_test
async def test_get_from_store_empty_store(self):
with self.assertRaises(ValueError):
await wd.get_work_description_from_store(None, 'aaa')
@async_test
async def test_get_from_store_empty_message_id(self):
with self.assertRaises(ValueError):
await wd.get_work_description_from_store(MagicMock(), None)
@patch('utilities.timing.get_time')
@patch('mhs_common.state.work_description.WorkDescription')
def test_create_work_description(self, work_mock, time_mock):
time_mock.return_value = '12'
persistence = MagicMock()
wd.create_new_work_description(persistence,
key='aaa-aaa',
outbound_status=wd.MessageStatus.OUTBOUND_MESSAGE_RECEIVED,
workflow=workflow.SYNC
)
work_mock.assert_called_with(
persistence,
{
wd.DATA_KEY: 'aaa-aaa',
wd.DATA: {
wd.CREATED_TIMESTAMP: '12',
wd.LATEST_TIMESTAMP: '12',
wd.INBOUND_STATUS: None,
wd.OUTBOUND_STATUS: wd.MessageStatus.OUTBOUND_MESSAGE_RECEIVED,
wd.VERSION_KEY: 1,
wd.WORKFLOW: workflow.SYNC
}
})
def test_create_wd_null_parameters(self):
persistence = MagicMock()
with self.subTest('Null key'):
with self.assertRaises(ValueError):
wd.create_new_work_description(
persistence,
key=None,
outbound_status=wd.MessageStatus.OUTBOUND_MESSAGE_RECEIVED,
workflow=workflow.SYNC
)
with self.subTest('Null persistence'):
with self.assertRaises(ValueError):
wd.create_new_work_description(
None,
key='aaa',
outbound_status=wd.MessageStatus.OUTBOUND_MESSAGE_RECEIVED,
workflow=workflow.SYNC
)
with self.subTest('Null workflow'):
with self.assertRaises(ValueError):
wd.create_new_work_description(
persistence,
key='aaa',
outbound_status=wd.MessageStatus.OUTBOUND_MESSAGE_RECEIVED,
workflow=None
)
with self.subTest('Null statuses'):
with self.assertRaises(ValueError):
wd.create_new_work_description(
persistence,
key='aaa',
outbound_status=None,
inbound_status=None,
workflow=workflow.SYNC_ASYNC
)
with self.subTest('Single null status should not raise error'):
wd.create_new_work_description(
persistence,
key='aaa',
outbound_status=wd.MessageStatus.INBOUND_RESPONSE_FAILED,
inbound_status=None,
workflow=workflow.SYNC_ASYNC
)
class TestWorkDescriptionStatusUpdateRetry(unittest.TestCase):
@test_utilities.async_test
async def test_update_success(self):
wdo = MagicMock()
wdo.update.return_value = test_utilities.awaitable(True)
wdo.set_outbound_status.return_value = test_utilities.awaitable(True)
await wd.update_status_with_retries(wdo, wdo.set_outbound_status,
wd.MessageStatus.OUTBOUND_MESSAGE_ACKD,
20)
self.assertEqual(wdo.update.call_count, 1)
self.assertEqual(wdo.set_outbound_status.call_count, 1)
@test_utilities.async_test
async def test_should_try_updating_outbound_status_expected_number_of_times(self):
wdo = MagicMock()
wdo.update.return_value = test_utilities.awaitable(True)
wdo.set_outbound_status.side_effect = wd.OutOfDateVersionError
with self.assertRaises(wd.OutOfDateVersionError):
await wd.update_status_with_retries(wdo, wdo.set_outbound_status,
wd.MessageStatus.OUTBOUND_MESSAGE_ACKD,
20)
self.assertEqual(wdo.update.call_count, 21)
self.assertEqual(wdo.set_outbound_status.call_count, 21)
@test_utilities.async_test
async def test_should_try_updating_outbound_status_twice_if_retries_set_to_one(self):
wdo = MagicMock()
wdo.update.return_value = test_utilities.awaitable(True)
wdo.set_outbound_status.side_effect = wd.OutOfDateVersionError
with self.assertRaises(wd.OutOfDateVersionError):
await wd.update_status_with_retries(wdo, wdo.set_outbound_status,
wd.MessageStatus.OUTBOUND_MESSAGE_ACKD,
1)
self.assertEqual(wdo.update.call_count, 2)
self.assertEqual(wdo.set_outbound_status.call_count, 2)
| 39.390935
| 102
| 0.646027
| 1,505
| 13,905
| 5.671096
| 0.085714
| 0.082601
| 0.059051
| 0.064558
| 0.847217
| 0.815817
| 0.77024
| 0.691037
| 0.636321
| 0.604687
| 0
| 0.010959
| 0.271557
| 13,905
| 352
| 103
| 39.502841
| 0.831671
| 0.001942
| 0
| 0.633898
| 0
| 0
| 0.042664
| 0.017873
| 0
| 0
| 0
| 0
| 0.135593
| 1
| 0.013559
| false
| 0
| 0.023729
| 0
| 0.047458
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8ee27ad5af8f9a51f81f27bf70eb145f7c98f4e1
| 316
|
py
|
Python
|
backend/pages/models/__init__.py
|
draihal/main-pr
|
81814c5370b592963e91ad0683caa560b0ea9579
|
[
"MIT"
] | 2
|
2021-01-28T08:23:15.000Z
|
2021-03-09T06:06:58.000Z
|
backend/pages/models/__init__.py
|
draihal/main-pr
|
81814c5370b592963e91ad0683caa560b0ea9579
|
[
"MIT"
] | 9
|
2020-01-02T15:31:04.000Z
|
2021-12-09T01:59:26.000Z
|
backend/pages/models/__init__.py
|
draihal/main-pr
|
81814c5370b592963e91ad0683caa560b0ea9579
|
[
"MIT"
] | 1
|
2021-03-09T06:11:16.000Z
|
2021-03-09T06:11:16.000Z
|
from .about_us import AboutUsPage
from .contacts import ContactsPage
from .course import Course
from .course_category import CourseCategory
from .mass_media import MassMediaPublication
from .site_configuration import SiteConfiguration
from .review import Review
from .event import Event
from .index import IndexPage
| 31.6
| 49
| 0.857595
| 40
| 316
| 6.675
| 0.5
| 0.074906
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113924
| 316
| 9
| 50
| 35.111111
| 0.953571
| 0
| 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
|
d925cc85e0d64b6f07c55301573048509a30c94a
| 226
|
py
|
Python
|
projects/ide/sublime/src/Bolt/api/plasma/open.py
|
boltjs/bolt
|
c2666c876b34b1a61486a432eef3141ca8d1e411
|
[
"BSD-3-Clause"
] | 11
|
2015-09-29T19:19:34.000Z
|
2020-11-20T09:14:46.000Z
|
projects/ide/sublime/src/Bolt/api/plasma/open.py
|
boltjs/bolt
|
c2666c876b34b1a61486a432eef3141ca8d1e411
|
[
"BSD-3-Clause"
] | null | null | null |
projects/ide/sublime/src/Bolt/api/plasma/open.py
|
boltjs/bolt
|
c2666c876b34b1a61486a432eef3141ca8d1e411
|
[
"BSD-3-Clause"
] | null | null | null |
from ui.show import browse
from ui.show import file as ui_file
def file_list_open(view, candidates):
def show_file(filename):
ui_file.file(view, filename)
browse.list_if_needed(view, candidates, show_file)
| 20.545455
| 54
| 0.743363
| 36
| 226
| 4.444444
| 0.416667
| 0.075
| 0.125
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176991
| 226
| 10
| 55
| 22.6
| 0.860215
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 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
| 1
| 0
| 1
| 0
|
0
| 4
|
d94ce66c4c6d04c289d75a28791059958db658b0
| 91
|
py
|
Python
|
pic_first.py
|
KingOfBanana/taomm
|
9c4c7c16b0481058fa6ef73d6a2d642a85b71eaf
|
[
"MIT"
] | 1
|
2018-02-24T15:29:16.000Z
|
2018-02-24T15:29:16.000Z
|
pic_first.py
|
KingOfBanana/taomm
|
9c4c7c16b0481058fa6ef73d6a2d642a85b71eaf
|
[
"MIT"
] | null | null | null |
pic_first.py
|
KingOfBanana/taomm
|
9c4c7c16b0481058fa6ef73d6a2d642a85b71eaf
|
[
"MIT"
] | null | null | null |
# coding:utf-8
from tasks import pic
if __name__ == '__main__':
pic.excute_pic_task()
| 15.166667
| 26
| 0.703297
| 14
| 91
| 3.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013333
| 0.175824
| 91
| 6
| 27
| 15.166667
| 0.706667
| 0.131868
| 0
| 0
| 0
| 0
| 0.102564
| 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
|
d96aec2dd8a7e557d47f95c3e23f6cdb279d7e25
| 1,600
|
py
|
Python
|
kapua-client/python-client/test/test_data_messages_api.py
|
liang-faan/SmartIOT-Diec
|
8336a4b558295295f10a82cf350d8b7ff3fb9f5c
|
[
"MIT"
] | 5
|
2019-05-30T02:55:16.000Z
|
2020-03-03T14:18:23.000Z
|
kapua-client/python-client/test/test_data_messages_api.py
|
liang-faan/SmartIOT-Diec
|
8336a4b558295295f10a82cf350d8b7ff3fb9f5c
|
[
"MIT"
] | 3
|
2019-12-27T00:53:23.000Z
|
2020-02-17T05:29:19.000Z
|
kapua-client/python-client/test/test_data_messages_api.py
|
liang-faan/SmartIOT-Diec
|
8336a4b558295295f10a82cf350d8b7ff3fb9f5c
|
[
"MIT"
] | 4
|
2019-06-04T06:26:14.000Z
|
2021-01-07T04:25:32.000Z
|
# coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.api.data_messages_api import DataMessagesApi # noqa: E501
from swagger_client.rest import ApiException
class TestDataMessagesApi(unittest.TestCase):
"""DataMessagesApi unit test stubs"""
def setUp(self):
self.api = swagger_client.api.data_messages_api.DataMessagesApi() # noqa: E501
def tearDown(self):
pass
def test_data_message_count(self):
"""Test case for data_message_count
Counts the DatastoreMessages # noqa: E501
"""
pass
def test_data_message_find(self):
"""Test case for data_message_find
Gets an DatastoreMessage # noqa: E501
"""
pass
def test_data_message_query(self):
"""Test case for data_message_query
Queries the DatastoreMessages # noqa: E501
"""
pass
def test_data_message_simple_query(self):
"""Test case for data_message_simple_query
Gets the DatastoreMessage list in the scope # noqa: E501
"""
pass
def test_data_message_store(self):
"""Test case for data_message_store
Stores a new KapuaDataMessage # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 22.857143
| 119
| 0.666875
| 193
| 1,600
| 5.279793
| 0.367876
| 0.107949
| 0.053974
| 0.073602
| 0.451423
| 0.429833
| 0.292444
| 0.098135
| 0.098135
| 0
| 0
| 0.022632
| 0.254375
| 1,600
| 69
| 120
| 23.188406
| 0.831517
| 0.440625
| 0
| 0.272727
| 1
| 0
| 0.010667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.318182
| false
| 0.272727
| 0.227273
| 0
| 0.590909
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
d96f5c9b1b5cd870130f2b517892f6053161f7e1
| 225
|
py
|
Python
|
registration/urls.py
|
Diksha-Rathi/Smart--Bin-GHC
|
2bb4e8605be72c1f913dbf7814aa29cd87432423
|
[
"MIT"
] | 5
|
2015-11-16T16:20:33.000Z
|
2021-02-24T09:57:20.000Z
|
registration/urls.py
|
Diksha-Rathi/Smart--Bin-GHC
|
2bb4e8605be72c1f913dbf7814aa29cd87432423
|
[
"MIT"
] | 1
|
2015-11-12T16:52:45.000Z
|
2015-11-12T16:52:45.000Z
|
registration/urls.py
|
Diksha-Rathi/Smart--Bin-GHC
|
2bb4e8605be72c1f913dbf7814aa29cd87432423
|
[
"MIT"
] | 4
|
2015-10-22T06:25:38.000Z
|
2016-10-03T18:18:03.000Z
|
# from django.conf.urls import patterns, include, url
# urlpatterns = patterns('',
# url(r'^login/$','registration.views.myLogin', name='login'),
# url(r'^logout/$','registration.views.logoutview', name='logout'),
# )
| 45
| 71
| 0.666667
| 26
| 225
| 5.769231
| 0.653846
| 0.053333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115556
| 225
| 5
| 72
| 45
| 0.753769
| 0.955556
| 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
|
7946fffaba9c93c4ec0138fc131478b28bfaf59f
| 89
|
py
|
Python
|
run.py
|
rabramley/telomere
|
e0246c0be18ce0b7e9d4ca88999626a005fede80
|
[
"MIT"
] | null | null | null |
run.py
|
rabramley/telomere
|
e0246c0be18ce0b7e9d4ca88999626a005fede80
|
[
"MIT"
] | null | null | null |
run.py
|
rabramley/telomere
|
e0246c0be18ce0b7e9d4ca88999626a005fede80
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
from app import telomere
telomere.run(host='0.0.0.0', debug=True)
| 17.8
| 40
| 0.719101
| 17
| 89
| 3.764706
| 0.764706
| 0.09375
| 0.09375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05
| 0.101124
| 89
| 4
| 41
| 22.25
| 0.75
| 0.224719
| 0
| 0
| 0
| 0
| 0.104478
| 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
|
797e5223d6b3dfa36faa975c79f2b9c9ab6961c5
| 530
|
py
|
Python
|
library/flask_app.py
|
superDB12/pi_led_contraption
|
7b9fdc236be098ffd912ab5e424ef974a558b660
|
[
"MIT"
] | null | null | null |
library/flask_app.py
|
superDB12/pi_led_contraption
|
7b9fdc236be098ffd912ab5e424ef974a558b660
|
[
"MIT"
] | null | null | null |
library/flask_app.py
|
superDB12/pi_led_contraption
|
7b9fdc236be098ffd912ab5e424ef974a558b660
|
[
"MIT"
] | null | null | null |
# Flask interface setup
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index.htm')
def index():
return render_template("index.htm")
@app.route('/individual.htm')
def individual():
return render_template("individual.htm")
@app.route('/group.htm')
def group():
return render_template("group.htm")
@app.route('/blaster.htm')
def blaster():
return render_template("blaster.htm")
@app.route('/pattern.htm')
def pattern():
return render_template("pattern.htm")
| 17.666667
| 44
| 0.698113
| 69
| 530
| 5.217391
| 0.26087
| 0.233333
| 0.277778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128302
| 530
| 29
| 45
| 18.275862
| 0.779221
| 0.039623
| 0
| 0
| 0
| 0
| 0.225743
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.277778
| false
| 0
| 0.055556
| 0.277778
| 0.611111
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
797f00b5d4a5d7fa2d560cd4345328f6503ccb63
| 959
|
py
|
Python
|
subway/exceptions.py
|
Rails-on-HPC/subway
|
bacdc387fce66aab78753aa48f36ec1a79d9d64b
|
[
"MIT"
] | 4
|
2020-03-02T01:34:28.000Z
|
2021-02-22T07:55:28.000Z
|
subway/exceptions.py
|
Rails-on-HPC/subway
|
bacdc387fce66aab78753aa48f36ec1a79d9d64b
|
[
"MIT"
] | null | null | null |
subway/exceptions.py
|
Rails-on-HPC/subway
|
bacdc387fce66aab78753aa48f36ec1a79d9d64b
|
[
"MIT"
] | 1
|
2020-09-23T01:55:15.000Z
|
2020-09-23T01:55:15.000Z
|
"""
Exception classes for subway.
"""
# TODO: more organized and hierachical exceptions.
class SubwayException(Exception):
def __init__(self, message, code=10):
"""
:param message: str.
:param code: int. 10 general, 11 jobid unmatch, 12 only valid for general without id
13 no such atrribute in history of conf
"""
self.message = message
self.code = code
def __str__(self):
return "%s %s" % (self.__class__.__name__, self.message)
class CLIException(SubwayException):
def __init__(self, message, code=10):
super().__init__(message, code)
class MatchError(CLIException):
def __init__(self, message, code=11):
super().__init__(message, code)
class NoAttribute(CLIException):
def __init__(self, message, code=13):
super().__init__(message, code)
class EndingBubble(SubwayException):
pass
class TestBubble(SubwayException):
pass
| 22.302326
| 92
| 0.65902
| 109
| 959
| 5.431193
| 0.440367
| 0.130068
| 0.074324
| 0.121622
| 0.322635
| 0.195946
| 0
| 0
| 0
| 0
| 0
| 0.021798
| 0.234619
| 959
| 42
| 93
| 22.833333
| 0.784741
| 0.23879
| 0
| 0.368421
| 0
| 0
| 0.007331
| 0
| 0
| 0
| 0
| 0.02381
| 0
| 1
| 0.263158
| false
| 0.105263
| 0
| 0.052632
| 0.631579
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
799dd1b4c243e6bd5bb8786e3ccd5a002739167d
| 119
|
py
|
Python
|
pynovice/algorithm/leetcode/python_alg/base_vip/__init__.py
|
wqwangchn/novice
|
d52190a9cd5045726e49aff8610b718636c304c7
|
[
"MIT"
] | 2
|
2020-06-28T08:30:47.000Z
|
2020-11-04T07:55:42.000Z
|
pynovice/algorithm/leetcode/python_alg/base_vip/__init__.py
|
wqwangchn/novice
|
d52190a9cd5045726e49aff8610b718636c304c7
|
[
"MIT"
] | 8
|
2020-11-13T18:56:02.000Z
|
2022-02-10T03:16:52.000Z
|
pynovice/algorithm/leetcode/python_alg/base_vip/__init__.py
|
wqwangchn/novice
|
d52190a9cd5045726e49aff8610b718636c304c7
|
[
"MIT"
] | 2
|
2020-09-17T00:12:36.000Z
|
2020-11-04T07:55:55.000Z
|
# coding=utf-8
# /usr/bin/env python
'''
Author: wenqiangw
Email: wenqiangw@opera.com
Date: 2020-07-30 11:05
Desc:
'''
| 13.222222
| 26
| 0.689076
| 20
| 119
| 4.1
| 0.95
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0.12605
| 119
| 9
| 27
| 13.222222
| 0.663462
| 0.89916
| 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
|
79cbce096fd27b30f8b2cbc6a70edafbfe13eee6
| 244
|
py
|
Python
|
snewpdag/plugins/renderers/__init__.py
|
SNEWS2/snewpdag
|
57f886cf08e1acd8af48ee486a1c2400e2b77b8b
|
[
"BSD-3-Clause"
] | null | null | null |
snewpdag/plugins/renderers/__init__.py
|
SNEWS2/snewpdag
|
57f886cf08e1acd8af48ee486a1c2400e2b77b8b
|
[
"BSD-3-Clause"
] | 21
|
2021-06-09T10:31:40.000Z
|
2022-03-21T17:14:03.000Z
|
snewpdag/plugins/renderers/__init__.py
|
SNEWS2/snewpdag
|
57f886cf08e1acd8af48ee486a1c2400e2b77b8b
|
[
"BSD-3-Clause"
] | 9
|
2021-07-11T17:45:42.000Z
|
2021-09-09T22:07:18.000Z
|
from .Histogram1D import Histogram1D
from .TimeProfile import TimeProfile
from .Skymap import Skymap
from .FitsSkymap import FitsSkymap
from .Mollview import Mollview
from .DistErrPlot import DistErrPlot
from .ScatterPlot import ScatterPlot
| 22.181818
| 36
| 0.844262
| 28
| 244
| 7.357143
| 0.321429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00939
| 0.127049
| 244
| 10
| 37
| 24.4
| 0.957746
| 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
| 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
|
79d17342157363d66894e9df1cfdf032bff23519
| 744
|
py
|
Python
|
revibe/utils/asyncs.py
|
Revibe-Music/core-services
|
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
|
[
"MIT"
] | 2
|
2022-01-24T23:30:18.000Z
|
2022-01-26T00:21:22.000Z
|
revibe/utils/asyncs.py
|
Revibe-Music/core-services
|
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
|
[
"MIT"
] | null | null | null |
revibe/utils/asyncs.py
|
Revibe-Music/core-services
|
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
|
[
"MIT"
] | null | null | null |
"""
Created 11 Mar. 2020
Author: Jordan Prechac
"""
from django.db import connection
import gc
import threading
# -----------------------------------------------------------------------------
# def perform_async_request(function, *args, **kwargs):
# """
# Wrapper for performing asyncronous functions
# Will automatically close connections and collect garbage before closing the thread
# """
# def call_function(function, *args, **kwargs):
# result = function(*args, **kwargs)
# gc.collect()
# connection.close()
# args = [function] + [arg for arg in args]
# thread = threading.Thread(target=call_function, args=args, kwargs=kwargs)
# thread.setDaemon(True)
# thread.start()
| 24
| 88
| 0.590054
| 75
| 744
| 5.8
| 0.6
| 0.110345
| 0.124138
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010084
| 0.200269
| 744
| 30
| 89
| 24.8
| 0.721008
| 0.858871
| 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
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8db2a26ed7a377c2fa159c79781a59cff49a7800
| 1,087
|
py
|
Python
|
src/perf_gan/losses/hinge_loss.py
|
gle-bellier/expressive-perf
|
e99d49c67ecc7b26b48834207d41113c4d9ea5dc
|
[
"MIT"
] | 1
|
2022-03-29T09:36:38.000Z
|
2022-03-29T09:36:38.000Z
|
src/perf_gan/losses/hinge_loss.py
|
gle-bellier/expressive-perf
|
e99d49c67ecc7b26b48834207d41113c4d9ea5dc
|
[
"MIT"
] | null | null | null |
src/perf_gan/losses/hinge_loss.py
|
gle-bellier/expressive-perf
|
e99d49c67ecc7b26b48834207d41113c4d9ea5dc
|
[
"MIT"
] | null | null | null |
import torch
class Hinge_loss:
def __init__(self):
"""Hinge loss for GANs
"""
pass
def d_loss(self, dx: torch.Tensor, dgz: torch.Tensor) -> torch.Tensor:
"""Compute the discriminator term in the Hinge loss
Args:
dx (torch.Tensor): output of the discriminator for real samples
dgz (torch.Tensor): output of the discriminator for generated samples
Returns:
torch.Tensor: loss of the discriminator
"""
loss_real = torch.mean(torch.relu(1 - dx))
loss_fake = torch.mean(torch.relu(1 + dgz))
return loss_real + loss_fake
def g_loss(self, dx: torch.Tensor, dgz: torch.Tensor) -> torch.Tensor:
"""Compute the generator term in the Hinge loss
Args:
dx (torch.Tensor): output of the generator for real samples
dgz (torch.Tensor): output of the generator for generated samples
Returns:
torch.Tensor: loss of the generator
"""
loss_fake = -torch.mean(dgz)
return loss_fake
| 27.175
| 81
| 0.601656
| 138
| 1,087
| 4.644928
| 0.246377
| 0.205928
| 0.081123
| 0.118565
| 0.711388
| 0.652106
| 0.652106
| 0.583463
| 0.583463
| 0.318253
| 0
| 0.002681
| 0.313707
| 1,087
| 39
| 82
| 27.871795
| 0.856568
| 0.475621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0.090909
| 0.090909
| 0
| 0.636364
| 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
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
8db435895d09db0fa84430c3274c229cc179e521
| 722
|
py
|
Python
|
core/views.py
|
Luizrebelatto/ProjetoFCamara
|
de1074f5ade9fe9c864d96d1a575618718ad11fb
|
[
"MIT"
] | 3
|
2021-04-05T23:40:22.000Z
|
2021-08-31T19:58:57.000Z
|
core/views.py
|
ramonvm18/ProjetoFCamara
|
de1074f5ade9fe9c864d96d1a575618718ad11fb
|
[
"MIT"
] | 1
|
2021-04-05T00:08:28.000Z
|
2021-04-05T00:08:28.000Z
|
core/views.py
|
ramonvm18/ProjetoFCamara
|
de1074f5ade9fe9c864d96d1a575618718ad11fb
|
[
"MIT"
] | 5
|
2021-03-24T12:57:18.000Z
|
2021-04-15T20:37:58.000Z
|
from django.shortcuts import render
from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'core/index.html'
class DoacoesView(TemplateView):
template_name = 'core/doacoes.html'
class SobreView(TemplateView):
template_name = 'core/sobre.html'
class SejaDoadorView(TemplateView):
template_name = 'core/sejadoador.html'
class PontosColetaView(TemplateView):
template_name = 'core/pontoscoleta.html'
class PontosDoacaoView(TemplateView):
template_name = 'core/pontodoacao.html'
class FacaDoacoesView(TemplateView):
template_name = 'core/facadoacoes.html'
class DoadorListaView(TemplateView):
template_name = 'core/listamateriaisdoador.html'
| 21.235294
| 52
| 0.775623
| 75
| 722
| 7.36
| 0.386667
| 0.289855
| 0.347826
| 0.405797
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131579
| 722
| 34
| 52
| 21.235294
| 0.880383
| 0
| 0
| 0
| 0
| 0
| 0.222683
| 0.130014
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
8db71701f357ae71a8cf88bfd0146b70ff52e631
| 76
|
py
|
Python
|
20-functions/declaration.py
|
ehsankorhani/python-lessons
|
a1974cb2b43b73751fc4737e3e3aa830aa16a644
|
[
"MIT"
] | null | null | null |
20-functions/declaration.py
|
ehsankorhani/python-lessons
|
a1974cb2b43b73751fc4737e3e3aa830aa16a644
|
[
"MIT"
] | null | null | null |
20-functions/declaration.py
|
ehsankorhani/python-lessons
|
a1974cb2b43b73751fc4737e3e3aa830aa16a644
|
[
"MIT"
] | null | null | null |
def multiply(a, b):
return a * b
result = multiply(2,3)
print(result)
| 10.857143
| 22
| 0.631579
| 13
| 76
| 3.692308
| 0.692308
| 0.083333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033898
| 0.223684
| 76
| 6
| 23
| 12.666667
| 0.779661
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.25
| 0.5
| 0.25
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
8db910215337b76337d64566f7a03d41374e7015
| 558
|
py
|
Python
|
packages/PIPS/validation/Benchmarks/NPB3.3.sub/IS.sub/is.py
|
DVSR1966/par4all
|
86b33ca9da736e832b568c5637a2381f360f1996
|
[
"MIT"
] | 51
|
2015-01-31T01:51:39.000Z
|
2022-02-18T02:01:50.000Z
|
packages/PIPS/validation/Benchmarks/NPB3.3.sub/IS.sub/is.py
|
DVSR1966/par4all
|
86b33ca9da736e832b568c5637a2381f360f1996
|
[
"MIT"
] | 7
|
2017-05-29T09:29:00.000Z
|
2019-03-11T16:01:39.000Z
|
packages/PIPS/validation/Benchmarks/NPB3.3.sub/IS.sub/is.py
|
DVSR1966/par4all
|
86b33ca9da736e832b568c5637a2381f360f1996
|
[
"MIT"
] | 12
|
2015-03-26T08:05:38.000Z
|
2022-02-18T02:01:51.000Z
|
from __future__ import with_statement
from pyps import workspace, module
from glob import glob
with workspace(*(glob("*.c") + glob("../common.sub/*s.c") + [ "../common.sub/wtime.c"]), cppflags="-I.. -I../common.sub -DCLASS=S", ldflags="-lm", name="ia") as w:
w.all_functions.display()
w.all_functions.print_code_proper_effects()
w.all_functions.print_code_cumulated_effects()
w.all_functions.print_code_transformers()
w.all_functions.print_code_preconditions()
w.activate(module.must_regions)
w.all_functions.print_code_regions()
| 46.5
| 163
| 0.732975
| 81
| 558
| 4.753086
| 0.444444
| 0.062338
| 0.202597
| 0.233766
| 0.322078
| 0.150649
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 558
| 11
| 164
| 50.727273
| 0.77621
| 0
| 0
| 0
| 0
| 0
| 0.137993
| 0.037634
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.272727
| 0
| 0.272727
| 0.454545
| 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
| 0
| 0
| 0
| 1
|
0
| 4
|
5c0128e16186e5692850ddd36fd2638ecacd1952
| 548
|
py
|
Python
|
backend/presentation/Serializers/__init__.py
|
Weida-W/CMPUT404-project-socialdistribution
|
41d8a7f7f013723d2a3878156953fbc11c2e6156
|
[
"W3C-20150513"
] | null | null | null |
backend/presentation/Serializers/__init__.py
|
Weida-W/CMPUT404-project-socialdistribution
|
41d8a7f7f013723d2a3878156953fbc11c2e6156
|
[
"W3C-20150513"
] | 75
|
2021-01-13T23:48:48.000Z
|
2021-04-16T19:39:38.000Z
|
backend/presentation/Serializers/__init__.py
|
Weida-W/CMPUT404-project-socialdistribution
|
41d8a7f7f013723d2a3878156953fbc11c2e6156
|
[
"W3C-20150513"
] | 12
|
2021-01-13T23:22:35.000Z
|
2021-04-28T08:13:38.000Z
|
from .author_serializer import AuthorSerializer
from .comment_serializer import CommentSerializer
from .follower_serializer import FollowerSerializer
from .inbox_serializer import InboxSerializer
from .liked_serializer import LikedSerializer
from .likes_serializer import LikesSerializer
from .post_serializer import PostSerializer
from .request_serializer import RequestSerializer
from .user_serializer import UserSerializer, UserSerializerWithToken
from .usermod_serializer import UsermodSerializer
from .friend_serializer import FriendSerializer
| 49.818182
| 68
| 0.89781
| 56
| 548
| 8.589286
| 0.464286
| 0.365904
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.080292
| 548
| 11
| 69
| 49.818182
| 0.954365
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 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
|
30acc68c912a5b49a5e73a67e69d4b997ac28921
| 57
|
py
|
Python
|
wotapy/util/palette.py
|
VeloceWattwing/Will-of-the-Alpha-Python
|
1f94094646cd190c57b25bb58b2262cfa0657506
|
[
"Apache-2.0"
] | null | null | null |
wotapy/util/palette.py
|
VeloceWattwing/Will-of-the-Alpha-Python
|
1f94094646cd190c57b25bb58b2262cfa0657506
|
[
"Apache-2.0"
] | null | null | null |
wotapy/util/palette.py
|
VeloceWattwing/Will-of-the-Alpha-Python
|
1f94094646cd190c57b25bb58b2262cfa0657506
|
[
"Apache-2.0"
] | null | null | null |
from terminal_palette import Palette
palette = Palette()
| 19
| 36
| 0.824561
| 7
| 57
| 6.571429
| 0.571429
| 0.608696
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122807
| 57
| 3
| 37
| 19
| 0.92
| 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
|
30d77d8d43cddd1a8afc28d0e1b64522eb4eeea6
| 105
|
py
|
Python
|
rasa_nlu_examples/extractors/__init__.py
|
armanjindal/rasa-nlu-examples
|
05aabf18182a1b9ef8b4fcb40d99c1dd597a63c0
|
[
"Apache-2.0"
] | null | null | null |
rasa_nlu_examples/extractors/__init__.py
|
armanjindal/rasa-nlu-examples
|
05aabf18182a1b9ef8b4fcb40d99c1dd597a63c0
|
[
"Apache-2.0"
] | null | null | null |
rasa_nlu_examples/extractors/__init__.py
|
armanjindal/rasa-nlu-examples
|
05aabf18182a1b9ef8b4fcb40d99c1dd597a63c0
|
[
"Apache-2.0"
] | null | null | null |
from .flashtext_entity_extractor import FlashTextEntityExtractor
__all__ = ["FlashTextEntityExtractor"]
| 26.25
| 64
| 0.866667
| 8
| 105
| 10.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07619
| 105
| 3
| 65
| 35
| 0.876289
| 0
| 0
| 0
| 0
| 0
| 0.228571
| 0.228571
| 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
|
eb488574ef1d3a7ab36a4ea99a06a7551190bd9b
| 77
|
py
|
Python
|
ubb/fop/lab05-07/model/validator.py
|
AlexanderChristian/private_courses
|
c80f3526af539e35f93b460f3909f669aaef573c
|
[
"MIT"
] | null | null | null |
ubb/fop/lab05-07/model/validator.py
|
AlexanderChristian/private_courses
|
c80f3526af539e35f93b460f3909f669aaef573c
|
[
"MIT"
] | 6
|
2020-03-04T20:52:39.000Z
|
2022-03-31T00:33:07.000Z
|
ubb/fop/lab05-07/model/validator.py
|
AlexanderChristian/private_courses
|
c80f3526af539e35f93b460f3909f669aaef573c
|
[
"MIT"
] | null | null | null |
__author__ = 'cosmin'
class Validator:
def __init__(self):
pass
| 12.833333
| 23
| 0.636364
| 8
| 77
| 5.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 77
| 6
| 24
| 12.833333
| 0.732143
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 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
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
eb5a7b3793c9f822c051ff4316ff3aac106d1bb4
| 470
|
py
|
Python
|
test_dataframe.py
|
UWSEDS/homework-3-4-testing-exceptions-and-coding-style-ebm94
|
30c7e814e9dd4865aa2f7c239923c92a4fbfbe8c
|
[
"MIT"
] | null | null | null |
test_dataframe.py
|
UWSEDS/homework-3-4-testing-exceptions-and-coding-style-ebm94
|
30c7e814e9dd4865aa2f7c239923c92a4fbfbe8c
|
[
"MIT"
] | null | null | null |
test_dataframe.py
|
UWSEDS/homework-3-4-testing-exceptions-and-coding-style-ebm94
|
30c7e814e9dd4865aa2f7c239923c92a4fbfbe8c
|
[
"MIT"
] | null | null | null |
"""Collection of function to test the unit test cases"""
from dataframe import col_checker
from dataframe import minonerow
def test_expected_cols():
"""Testing for matching columns"""
assert col_checker('http://www-bcf.usc.edu/~gareth/ISL/Auto.csv')
def test_atleast_one_row():
"""Testing for min one row"""
assert minonerow('http://www-bcf.usc.edu/~gareth/ISL/Auto.csv')
# For running the unit tests
# test_expected_cols()
# test_atleast_one_row()
| 26.111111
| 69
| 0.731915
| 71
| 470
| 4.676056
| 0.521127
| 0.054217
| 0.114458
| 0.078313
| 0.192771
| 0.192771
| 0.192771
| 0.192771
| 0.192771
| 0
| 0
| 0
| 0.138298
| 470
| 17
| 70
| 27.647059
| 0.819753
| 0.37234
| 0
| 0
| 0
| 0
| 0.310469
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
eb81a53111f12fca5fa42ee22d8282f35909cf04
| 132
|
py
|
Python
|
test/entrypoint.py
|
xu-hao/tx-queue
|
d9f7a912a417aecc4718df500484f6ac22001ff1
|
[
"MIT"
] | null | null | null |
test/entrypoint.py
|
xu-hao/tx-queue
|
d9f7a912a417aecc4718df500484f6ac22001ff1
|
[
"MIT"
] | null | null | null |
test/entrypoint.py
|
xu-hao/tx-queue
|
d9f7a912a417aecc4718df500484f6ac22001ff1
|
[
"MIT"
] | 1
|
2019-08-22T22:03:13.000Z
|
2019-08-22T22:03:13.000Z
|
import logging
import json
import time
def run(data):
s = "from rqworker " + json.dumps(data)
logging.info(s)
return s
| 14.666667
| 43
| 0.666667
| 20
| 132
| 4.4
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.234848
| 132
| 8
| 44
| 16.5
| 0.871287
| 0
| 0
| 0
| 0
| 0
| 0.106061
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.428571
| 0
| 0.714286
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ebb502f3b72306011b7935b93fb35edb199fc25b
| 61
|
py
|
Python
|
strops/schemes/utils/__init__.py
|
ckoerber/strops
|
2131354fd6822b3aa7b7d9c3c0db79723b06b8ca
|
[
"BSD-3-Clause"
] | 1
|
2020-12-29T19:57:47.000Z
|
2020-12-29T19:57:47.000Z
|
strops/schemes/utils/__init__.py
|
ckoerber/strops
|
2131354fd6822b3aa7b7d9c3c0db79723b06b8ca
|
[
"BSD-3-Clause"
] | 13
|
2020-06-29T11:15:59.000Z
|
2021-09-22T19:18:36.000Z
|
strops/schemes/utils/__init__.py
|
ckoerber/strops
|
2131354fd6822b3aa7b7d9c3c0db79723b06b8ca
|
[
"BSD-3-Clause"
] | null | null | null |
"""Utility functions for the exapnsion scheme sub module."""
| 30.5
| 60
| 0.754098
| 8
| 61
| 5.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131148
| 61
| 1
| 61
| 61
| 0.867925
| 0.885246
| 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
|
ccd81936907a4e83d9882edbb957cf63b1e1dc21
| 201
|
py
|
Python
|
backend/api/serializers.py
|
oboynitro/vault
|
4dd6708a8bd978976c7f03ef647389e237155824
|
[
"MIT"
] | null | null | null |
backend/api/serializers.py
|
oboynitro/vault
|
4dd6708a8bd978976c7f03ef647389e237155824
|
[
"MIT"
] | null | null | null |
backend/api/serializers.py
|
oboynitro/vault
|
4dd6708a8bd978976c7f03ef647389e237155824
|
[
"MIT"
] | null | null | null |
from rest_framework import serializers
from secretos.models import Secretos
class SecretosSerializer(serializers.ModelSerializer):
class Meta:
model = Secretos
fields = "__all__"
| 22.333333
| 54
| 0.751244
| 20
| 201
| 7.3
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.199005
| 201
| 9
| 55
| 22.333333
| 0.906832
| 0
| 0
| 0
| 0
| 0
| 0.034653
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.