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
c3f7de2c5cf9f818c4f945ecaee77a66aa71555d
202
py
Python
wotpy/wot/consumed/__init__.py
JKRhb/wot-py
3eaa780189b686c82b7dbdea404fd8077bd3c9f9
[ "MIT" ]
24
2019-02-15T09:00:27.000Z
2021-12-23T05:45:03.000Z
wotpy/wot/consumed/__init__.py
JKRhb/wot-py
3eaa780189b686c82b7dbdea404fd8077bd3c9f9
[ "MIT" ]
20
2020-03-17T09:41:51.000Z
2021-07-14T12:29:02.000Z
wotpy/wot/consumed/__init__.py
JKRhb/wot-py
3eaa780189b686c82b7dbdea404fd8077bd3c9f9
[ "MIT" ]
5
2019-10-10T13:38:20.000Z
2021-12-22T14:22:26.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ConsumedThing and related entities. .. autosummary:: :toctree: _consumed wotpy.wot.consumed.interaction_map wotpy.wot.consumed.thing """
15.538462
38
0.668317
23
202
5.782609
0.826087
0.120301
0.240602
0
0
0
0
0
0
0
0
0.005952
0.168317
202
12
39
16.833333
0.785714
0.935644
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
1
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
c3fd29de7c6223e3b08abc03cc59e06aacacb15c
112
py
Python
wsgi.py
wj1796/back
0e486fa8a7b27c633600c49643f798ec215d3c7a
[ "MIT" ]
12
2019-10-16T00:40:27.000Z
2022-01-30T15:03:10.000Z
wsgi.py
wj1796/back
0e486fa8a7b27c633600c49643f798ec215d3c7a
[ "MIT" ]
null
null
null
wsgi.py
wj1796/back
0e486fa8a7b27c633600c49643f798ec215d3c7a
[ "MIT" ]
7
2019-10-16T09:23:07.000Z
2021-06-30T10:58:42.000Z
from app import create_app application = create_app('production') # To Be used by a WSGI Server like Gunicorn
18.666667
43
0.776786
18
112
4.722222
0.833333
0.211765
0
0
0
0
0
0
0
0
0
0
0.169643
112
5
44
22.4
0.913978
0.366071
0
0
0
0
0.144928
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
7f02271afe77457250bbcd96fbbbcb36e670e610
337
py
Python
cmdapp.py
AmyBeisel/SRAM_ASSESSMENT
eabb73d5f24476e8628723f00d92529d853309cd
[ "MIT" ]
null
null
null
cmdapp.py
AmyBeisel/SRAM_ASSESSMENT
eabb73d5f24476e8628723f00d92529d853309cd
[ "MIT" ]
null
null
null
cmdapp.py
AmyBeisel/SRAM_ASSESSMENT
eabb73d5f24476e8628723f00d92529d853309cd
[ "MIT" ]
null
null
null
import requests r = requests.get("http://localhost:8000/Bike/") r1 = requests.get("http://localhost:8000/RearWheel/") r2 = requests.get("http://localhost:8000/FrontWheel/") r = requests.post("http://localhost:8000/FrontWheel/", json={'bike': {'brand': 'Enve', 'size': '29', 'weight':1} print(r.json()) print(r1.json()) print(r2.json())
33.7
112
0.676558
47
337
4.851064
0.446809
0.22807
0.298246
0.315789
0.368421
0
0
0
0
0
0
0.073482
0.071217
337
10
113
33.7
0.654952
0
0
0
0
0
0.443787
0
0
0
0
0
0
0
null
null
0
0.125
null
null
0.375
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
1
0
0
0
0
0
0
0
0
4
7f0c40a9780b0da510e32fb6d3b38b804fd42340
75
py
Python
backend/similar_ticks.py
wuxianliang/StockBrain
371188035b898760446a0e6c957dd05e7abdf60a
[ "MIT" ]
2
2019-03-15T02:23:34.000Z
2020-06-26T11:18:37.000Z
backend/similar_ticks.py
wuxianliang/StockBrain
371188035b898760446a0e6c957dd05e7abdf60a
[ "MIT" ]
null
null
null
backend/similar_ticks.py
wuxianliang/StockBrain
371188035b898760446a0e6c957dd05e7abdf60a
[ "MIT" ]
null
null
null
import tushare as ts from flask import jsonify #def get_t(ticks, params):
15
26
0.773333
13
75
4.384615
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.16
75
4
27
18.75
0.904762
0.333333
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
6161d6720e3ce2df7b2e1b4535e221b16ce9e3d8
200
py
Python
Module6/pefile_example.py
ioef/SPSE
37eaeb0fd7c5cf564c3b60590f6bfe4de928b920
[ "MIT" ]
16
2017-03-23T16:27:20.000Z
2022-03-31T07:04:40.000Z
Module6/pefile_example.py
indiancyberhunter/SPSE
37eaeb0fd7c5cf564c3b60590f6bfe4de928b920
[ "MIT" ]
null
null
null
Module6/pefile_example.py
indiancyberhunter/SPSE
37eaeb0fd7c5cf564c3b60590f6bfe4de928b920
[ "MIT" ]
8
2016-10-11T13:18:08.000Z
2022-02-12T19:38:57.000Z
#!/usr/bin/env python import pefile import sys import pprint pe = pefile.PE('Server-Strcpy.exe') for section in pe.sections: print section.Name print section.SizeOfRawData print '\n'
13.333333
35
0.71
29
200
4.896552
0.689655
0.169014
0
0
0
0
0
0
0
0
0
0
0.19
200
14
36
14.285714
0.876543
0.1
0
0
0
0
0.106145
0
0
0
0
0
0
0
null
null
0
0.375
null
null
0.5
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
1
0
0
0
1
0
0
1
0
4
618bb567ade1d2a72ad1334d3e365ca94890ae41
176
py
Python
run.py
ksk6348/bot
72376b07b5b5f61a947e2b63b81866eaccb2ce21
[ "MIT" ]
null
null
null
run.py
ksk6348/bot
72376b07b5b5f61a947e2b63b81866eaccb2ce21
[ "MIT" ]
6
2020-01-28T22:31:17.000Z
2022-02-10T00:11:19.000Z
run.py
ksk6348/karenbot
72376b07b5b5f61a947e2b63b81866eaccb2ce21
[ "MIT" ]
null
null
null
from app import app import warnings import views if __name__ == '__main__': warnings.filterwarnings('ignore') app.debug = True app.run(host='0.0.0.0', port=5000)
17.6
38
0.6875
26
176
4.346154
0.653846
0.053097
0.053097
0
0
0
0
0
0
0
0
0.055556
0.181818
176
9
39
19.555556
0.729167
0
0
0
0
0
0.119318
0
0
0
0
0
0
1
0
true
0
0.428571
0
0.428571
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
6190d3d537a081192133fcf708f8b521cb47a5ac
517
py
Python
pynumdiff/__init__.py
fossabot/PyNumDiff
dccad2ad7a875f2ecccb0db2bb6e2afa392916d1
[ "MIT" ]
null
null
null
pynumdiff/__init__.py
fossabot/PyNumDiff
dccad2ad7a875f2ecccb0db2bb6e2afa392916d1
[ "MIT" ]
null
null
null
pynumdiff/__init__.py
fossabot/PyNumDiff
dccad2ad7a875f2ecccb0db2bb6e2afa392916d1
[ "MIT" ]
null
null
null
from pynumdiff.__version__ import __version__ as __version__ import pynumdiff.finite_difference as finite_difference import pynumdiff.smooth_finite_difference as smooth_finite_difference import pynumdiff.total_variation_regularization as total_variation_regularization import pynumdiff.linear_model as linear_model import pynumdiff.kalman_smooth as kalman_smooth import pynumdiff.nnet as nnet import pynumdiff.augmented_data as augmented_data import pynumdiff.utils as utils import pynumdiff.optimize as optimize
36.928571
81
0.891683
68
517
6.367647
0.279412
0.311778
0.083141
0.143187
0
0
0
0
0
0
0
0
0.088975
517
13
82
39.769231
0.919321
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
619d74634d1d850f5fd1fcadb34526e684ac7cd0
927
py
Python
urban_AD_env/__init__.py
munirjojoverge/rl_AD_urban_baselines
c17cb97fb6a1edd3134b340194e82f4c3ca4f065
[ "MIT" ]
6
2019-02-05T08:17:29.000Z
2022-03-22T12:47:53.000Z
urban_AD_env/__init__.py
munirjojoverge/rl_AD_urban_baselines
c17cb97fb6a1edd3134b340194e82f4c3ca4f065
[ "MIT" ]
null
null
null
urban_AD_env/__init__.py
munirjojoverge/rl_AD_urban_baselines
c17cb97fb6a1edd3134b340194e82f4c3ca4f065
[ "MIT" ]
1
2019-09-08T14:15:56.000Z
2019-09-08T14:15:56.000Z
from gym.envs.registration import register register( id='urban_AD-multilane-v1', entry_point='urban_AD_env.envs:MultiLaneEnv', ) register( id='urban_AD-merge-v1', entry_point='urban_AD_env.envs:MergeEnv', ) register( id='urban_AD-roundabout-v1', entry_point='urban_AD_env.envs:RoundaboutEnv', ) register( id='urban_AD-continuous-v1', entry_point='urban_AD_env.envs:ContinuousEnv', tags={'wrapper_config.TimeLimit.max_episode_steps': 20} ) register( id='continuous-multi-env-v1', entry_point='urban_AD_env.envs:ContinuousMultiEnv', tags={'wrapper_config.TimeLimit.max_episode_steps': 20} ) register( id='parking-v1', entry_point='urban_AD_env.envs:ParkingEnv', tags={'wrapper_config.TimeLimit.max_episode_steps': 20} ) register( id='sidepass-v0', entry_point='urban_AD_env.envs:SidepassEnv', tags={'wrapper_config.TimeLimit.max_episode_steps': 30} )
23.175
59
0.731392
125
927
5.128
0.296
0.120125
0.163807
0.185647
0.592824
0.592824
0.555382
0.24805
0.24805
0.24805
0
0.018541
0.127292
927
40
60
23.175
0.773795
0
0
0.30303
0
0
0.544181
0.503233
0
0
0
0
0
1
0
true
0.060606
0.030303
0
0.030303
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
1
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
61b1ae67a3a67f6b1d849169afbb5c870cf364ee
258
py
Python
niddk_covid_sicr/__init__.py
cannin/covid-sicr-test
f842946357428730265b7d0a6640172dc757ecae
[ "MIT" ]
null
null
null
niddk_covid_sicr/__init__.py
cannin/covid-sicr-test
f842946357428730265b7d0a6640172dc757ecae
[ "MIT" ]
null
null
null
niddk_covid_sicr/__init__.py
cannin/covid-sicr-test
f842946357428730265b7d0a6640172dc757ecae
[ "MIT" ]
null
null
null
"""The NIDDK SICR model for estimating the fraction infected with SARS-CoV-2""" import numexpr numexpr.set_num_threads(numexpr.detect_number_of_cores()) from .io import * from .stats import * from .analysis import * from .data import * from .prep import *
23.454545
79
0.767442
39
258
4.948718
0.692308
0.207254
0
0
0
0
0
0
0
0
0
0.004505
0.139535
258
10
80
25.8
0.864865
0.282946
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.857143
0
0.857143
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
61b2a239da7114746f0684e068c61c08da10b022
283
py
Python
src/rectangle.py
xhajnal/DiPS
2e5d6e0a26d2b1cd44522dc521992e6d7cfe6883
[ "BSD-3-Clause" ]
4
2020-04-25T22:29:43.000Z
2022-01-14T07:52:55.000Z
src/rectangle.py
xhajnal/DiPS
2e5d6e0a26d2b1cd44522dc521992e6d7cfe6883
[ "BSD-3-Clause" ]
64
2020-01-06T18:38:56.000Z
2022-02-27T18:38:45.000Z
src/rectangle.py
xhajnal/DiPS
2e5d6e0a26d2b1cd44522dc521992e6d7cfe6883
[ "BSD-3-Clause" ]
3
2020-02-13T16:46:54.000Z
2021-11-26T11:47:56.000Z
class My_Rectangle: def __init__(self, region, is_white=False, model=(None, None)): self.region = region self.is_white = is_white self.model = model def is_white(self): return self.is_white def get_model(self): return self.model
23.583333
67
0.628975
39
283
4.282051
0.358974
0.209581
0.131737
0
0
0
0
0
0
0
0
0
0.279152
283
11
68
25.727273
0.818627
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.222222
0.666667
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
0
0
1
1
0
0
4
61bbc76b4f166e6a96a5348a61a8bb164c07cd0a
1,422
py
Python
generator/generator_builder.py
wangermeng2021/SnapMix-tensorflow2
61a46de49cd3586e387d990e6f617455da78d35d
[ "Apache-2.0" ]
9
2021-01-13T00:02:31.000Z
2021-04-25T10:21:21.000Z
generator/generator_builder.py
wangermeng2021/SnapMix-tensorflow2
61a46de49cd3586e387d990e6f617455da78d35d
[ "Apache-2.0" ]
2
2021-02-01T14:34:20.000Z
2021-09-02T19:33:06.000Z
generator/generator_builder.py
wangermeng2021/SnapMix-tensorflow2
61a46de49cd3586e387d990e6f617455da78d35d
[ "Apache-2.0" ]
1
2021-02-08T09:52:50.000Z
2021-02-08T09:52:50.000Z
from generator.cars_generator import CarsGenerator from generator.cub_generator import CubGenerator from generator.custom_generator import CustomGenerator def get_generator(args): if args.dataset == 'cars': train_generator = CarsGenerator(root_dir=args.dataset_dir, mode="train", batch_size=args.batch_size, augment=args.augment) val_generator = CarsGenerator(root_dir=args.dataset_dir, mode="valid", batch_size=args.batch_size, augment=args.augment) return train_generator,val_generator if args.dataset == 'cub': train_generator = CubGenerator(root_dir=args.dataset_dir, mode="train", batch_size=args.batch_size, augment=args.augment) val_generator = CubGenerator(root_dir=args.dataset_dir, mode="valid", batch_size=args.batch_size, augment=args.augment) return train_generator, val_generator if args.dataset == 'custom': train_generator = CustomGenerator(root_dir=args.dataset_dir, mode="train", batch_size=args.batch_size, augment=args.augment) val_generator = CustomGenerator(root_dir=args.dataset_dir, mode="valid", batch_size=args.batch_size, augment=args.augment) return train_generator, val_generator
59.25
88
0.648383
157
1,422
5.617834
0.152866
0.122449
0.07483
0.122449
0.776644
0.776644
0.776644
0.776644
0.655329
0.655329
0
0
0.269339
1,422
24
89
59.25
0.848893
0
0
0.409091
0
0
0.030239
0
0
0
0
0
0
1
0.045455
false
0
0.136364
0
0.318182
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
4edfde216b649136d43d5b676cf7763440d5c02c
439
py
Python
utils/summaries.py
LK-Peng/CNN-based-Cloud-Detection-Methods
1393a6886e62f1ed5a612d57c5a725c763a6b2cc
[ "MIT" ]
2
2022-02-16T03:30:19.000Z
2022-03-18T08:02:39.000Z
utils/summaries.py
LK-Peng/CNN-based-Cloud-Detection-Methods
1393a6886e62f1ed5a612d57c5a725c763a6b2cc
[ "MIT" ]
null
null
null
utils/summaries.py
LK-Peng/CNN-based-Cloud-Detection-Methods
1393a6886e62f1ed5a612d57c5a725c763a6b2cc
[ "MIT" ]
1
2022-02-16T03:30:20.000Z
2022-02-16T03:30:20.000Z
import os import torch from torchvision.utils import make_grid from torch.utils.tensorboard import SummaryWriter class TensorboardSummary(object): def __init__(self, directory): self.directory = directory def create_summary(self): writer = SummaryWriter(log_dir=os.path.join(self.directory)) return writer def visualize_image(self, writer, dataset, image, target, output, global_step): pass
25.823529
83
0.733485
53
439
5.90566
0.622642
0.124601
0
0
0
0
0
0
0
0
0
0
0.191344
439
16
84
27.4375
0.88169
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.083333
0.333333
0
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
1
0
1
0
0
4
4ef0b8f1c22a9f1c4bedb0ea277378802d0191a7
169
py
Python
accounts/forms.py
SuperLeet-CTF/SuperLeet-CTF
3af085d310a8303ef3aff376ba930649586d5993
[ "MIT" ]
4
2017-10-09T21:53:44.000Z
2020-12-02T19:11:08.000Z
accounts/forms.py
SuperLeet-CTF/SuperLeet-CTF
3af085d310a8303ef3aff376ba930649586d5993
[ "MIT" ]
null
null
null
accounts/forms.py
SuperLeet-CTF/SuperLeet-CTF
3af085d310a8303ef3aff376ba930649586d5993
[ "MIT" ]
1
2020-09-02T06:02:31.000Z
2020-09-02T06:02:31.000Z
from django import forms from .models import UserProfile class UserProfileForm(forms.ModelForm): class Meta: model = UserProfile fields = ['bio']
16.9
39
0.686391
18
169
6.444444
0.722222
0
0
0
0
0
0
0
0
0
0
0
0.242604
169
9
40
18.777778
0.90625
0
0
0
0
0
0.017751
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
f6497921ff9db3203cfe7cdacaa7cdba45ee9aeb
623
py
Python
CodeWars/Convert string to camel case.py
a3X3k/Competitive-programing-hacktoberfest-2021
bc3997997318af4c5eafad7348abdd9bf5067b4f
[ "Unlicense" ]
12
2021-06-05T09:40:10.000Z
2021-10-07T17:59:51.000Z
CodeWars/Convert string to camel case.py
a3X3k/Competitive-programing-hacktoberfest-2021
bc3997997318af4c5eafad7348abdd9bf5067b4f
[ "Unlicense" ]
21
2020-10-10T10:41:03.000Z
2020-10-31T10:41:23.000Z
CodeWars/Convert string to camel case.py
a3X3k/Competitive-programing-hacktoberfest-2021
bc3997997318af4c5eafad7348abdd9bf5067b4f
[ "Unlicense" ]
67
2021-08-01T10:04:52.000Z
2021-10-10T00:25:04.000Z
''' 6 kyu Convert string to camel case.py https://www.codewars.com/kata/517abf86da9663f1d2000003/train/python Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized (known as Upper Camel Case, also often referred to as Pascal case). Examples to_camel_case("the-stealth-warrior") # returns "theStealthWarrior" to_camel_case("The_Stealth_Warrior") # returns "TheStealthWarrior" ''' def to_camel_case(text): return text[:1] + text.title()[1:].replace('_', '').replace('-', '')
44.5
264
0.76886
89
623
5.280899
0.662921
0.095745
0.093617
0.059574
0.221277
0.221277
0.221277
0.221277
0
0
0
0.036496
0.120385
623
14
265
44.5
0.821168
0.831461
0
0
0
0
0.02
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
f67ff1a9344eee58185e66ae847b056071b9a454
89
py
Python
albumes/apps.py
jealuna/Album
7083aca387dab5cd58c67afcfd1492f22a53d972
[ "MIT" ]
null
null
null
albumes/apps.py
jealuna/Album
7083aca387dab5cd58c67afcfd1492f22a53d972
[ "MIT" ]
13
2021-03-10T08:04:08.000Z
2022-03-12T00:15:30.000Z
albumes/apps.py
jealuna/Album
7083aca387dab5cd58c67afcfd1492f22a53d972
[ "MIT" ]
null
null
null
from django.apps import AppConfig class AlbumesConfig(AppConfig): name = 'albumes'
14.833333
33
0.752809
10
89
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.905405
0
0
0
0
0
0.078652
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
9c9bf897df337538062376e0a020b71b771ba8c5
14,651
py
Python
spanda/sql/column.py
guyd1995/spanda
5481642eebfdff183eb465cd5b9a78c9abc2ad51
[ "MIT" ]
null
null
null
spanda/sql/column.py
guyd1995/spanda
5481642eebfdff183eb465cd5b9a78c9abc2ad51
[ "MIT" ]
null
null
null
spanda/sql/column.py
guyd1995/spanda
5481642eebfdff183eb465cd5b9a78c9abc2ad51
[ "MIT" ]
null
null
null
import re from copy import deepcopy import pandas as pd from spanda.core.typing import * from spanda.core.utils import wrap_col_args class _SpecialSpandaColumn: """ This kind of column is created for special column transformations that do not make sense as standard columns because the flexibility allowed by usual columns do not apply to them. Such columns include exploded rows which can only come inside a select operation (at least in Spanda). These columns do not allow any further transformation other than simple ones such as name aliases. They are "leaf-transformations" that can only appear in a select(...) clause. """ EXPLODE_ROWS_TYPE = 1 EXPLODE_COLS_TYPE = 2 def __init__(self, transformation_type, extra_data, name): self._name = name self._transformation_type = transformation_type self._extra_data = extra_data def alias(self, name): new_copy = deepcopy(self) new_copy._name = name return new_copy @staticmethod def _apply_special_preprocess(col, df): if col._transformation_type == _SpecialSpandaColumn.EXPLODE_ROWS_TYPE: return elif col._transformation_type == _SpecialSpandaColumn.EXPLODE_COLS_TYPE: if col._extra_data == '*': return {'add_columns': list(df.columns), 'actual_columns': []} else: raise NotImplementedError @staticmethod def _apply_special(col, df, metadata): if col._transformation_type == _SpecialSpandaColumn.EXPLODE_ROWS_TYPE: orig_col_name = col._extra_data return df[orig_col_name] elif col._transformation_type == _SpecialSpandaColumn.EXPLODE_COLS_TYPE: col_names = [] if col._extra_data == '*': col_names = metadata['actual_columns'] return df.apply(lambda row: {name: row[name] for name in col_names}, axis=1) else: raise NotImplementedError @staticmethod def _apply_special_postprocess(df: pd.DataFrame, col_name: str, trans_type: int, metadata: dict, all_col_names: list) -> pd.DataFrame: if trans_type == _SpecialSpandaColumn.EXPLODE_ROWS_TYPE: return df.explode([col_name]) elif trans_type == _SpecialSpandaColumn.EXPLODE_COLS_TYPE: col_dicts = df[col_name].tolist() new_df = pd.DataFrame.from_records(col_dicts, index=df.index) pos = all_col_names.index(col_name) all_col_names[:] = all_col_names[:pos] + metadata['add_columns'] + all_col_names[pos+1:] return pd.concat([df, new_df], axis=1) else: raise NotImplementedError class SpandaStruct: def __init__(self, values: Sequence, names=None): assert (names is None) or (len(names) == len(values)), "if field names are specified they should match field" \ " values in the number of parameters" if names is None: names = list(range(len(values))) self._struct_keys = tuple(names) self._struct_vals = tuple(values) def __iter__(self): def _my_iter(): for i in range(len(self)): yield self[i] return _my_iter() def __len__(self): return len(self._struct_vals) def __repr__(self): return str(self._struct_vals) def __getitem__(self, item): assert isinstance(item, int), "SpandaStruct does not take in field names but only ints at the moments" return self._struct_vals[item] @staticmethod def _get_field(struct: 'SpandaStruct', field_name: str): assert field_name in struct._struct_keys, f'`{field_name}` is not in struct' idx = struct._struct_keys.index(field_name) # TODO: need to alert on duplicate keys but we can't disallow them because # we must also support them (for e.g., F.array(..) internal implementation) return struct._struct_vals[idx] def udf(func: Callable) -> Callable: """ Transforms function `func` into a function that applies `func` elementwise on a column """ @wrap_col_args def f(*cols: Column) -> Column: return Column._transformColumn(f"UDF `{func.__name__}` ({', '.join([Column.getName(col) for col in cols])})", lambda df: pd.concat([Column._apply(col, df) for col in cols], axis='columns').apply(lambda c: func(*c), axis='columns')) return f class Column: """ A column in Spanda dataframe """ def __init__(self, name: Optional[str]): self._name = name self._op = lambda df: df[name] def _set_op(self, op: Callable): self._op = op @staticmethod def getName(col: Union['Column', str]) -> str: if isinstance(col, Column): return col._name else: return str(col) @staticmethod def _apply(col: 'Column', df: pd.DataFrame) -> Union[pd.Series, Any]: if isinstance(col, Column): return col._op(df) elif isinstance(col, _SpecialSpandaColumn): assert False, f"cannot apply anything special columns such as {Column.getName(col)}" else: return col @staticmethod def _transformColumn(name: str, operation: Callable) -> 'Column': col = Column(None) col._name = name col._op = operation return col def _simpleBinaryTransformColumn(self, opname: str, opfunc: Callable, other: Union['Column', Any], is_other_col: bool = True) -> 'Column': return Column._transformColumn(f"({Column.getName(self)} {opname} {Column.getName(other)})", lambda df: opfunc(Column._apply(self, df), Column._apply(other, df) if is_other_col else other)) def _simpleUnaryTransformColumn(self, opname: str, opfunc: Callable) -> 'Column': return Column._transformColumn(f"({opname}{Column.getName(self)})", lambda df: opfunc(Column._apply(self, df))) def __repr__(self): return f"<Column {self._name}>" def alias(self, name): """ Return column with new name """ return Column._transformColumn(name, self._op) def between(self, start, end): """ A boolean expression that is evaluated to true if the value of this expression is between the given columns. >>> df.select('name', F.col('age').between(2, 4)) +-----+---------------------------+ | name|((age >= 2) AND (age <= 4))| +-----+---------------------------+ |Alice| true| | Bob| false| +-----+---------------------------+ """ return (self >= start) & (self <= end) def getItem(self, key: Union[int, Hashable]): """ An expression that gets an item at position ordinal out of a list, or gets an item by key out of a dict """ return self._simpleUnaryTransformColumn(f'GET_ITEM [{str(key)}]', lambda x: x[key]) def isNotNull(self): """ True if the current expression is NOT null. """ return self._simpleUnaryTransformColumn('IS NOT NULL ', lambda x: x is not None) def isNull(self): """ True if the current expression is null. """ return self._simpleUnaryTransformColumn('IS NULL ', lambda x: x is None) def rlike(self, other: str): """ SQL RLIKE expression (LIKE with Regex). Returns a boolean Column based on a regex match. """ pattern = re.compile(other) return self._simpleUnaryTransformColumn(f'RLIKE ({str(pattern)}) ', lambda x: pattern.search(x) is not None) def like(self, other: str): """ SQL like expression. Returns a boolean Column based on a SQL LIKE match. """ _special_regex_chars = { ch: '\\' + ch for ch in '.^$*+?{}[]|()\\' } def _sql_like_fragment_to_regex_string(fragment): # https://codereview.stackexchange.com/a/36864/229677 safe_fragment = ''.join([ _special_regex_chars.get(ch, ch) for ch in fragment ]) return '^' + safe_fragment.replace('%', '.*?').replace('_', '.') + '$' return self.rlike(_sql_like_fragment_to_regex_string(other)) def apply(self, func: Callable) -> 'Column': return udf(func)(self) def isin(self, values): """ A boolean expression that is evaluated to true if the value of this expression is contained by the evaluated values of the arguments. """ return self._simpleBinaryTransformColumn('IN', lambda x, y: x.isin(y), values, is_other_col=False) def substr(self, startPos: int, length: int): """ Return a Column which is a substring of the column """ # TODO: assert is string return self._simpleUnaryTransformColumn(f'SUBSTR ({startPos}, {length}) ', lambda x: x[startPos: startPos + length]) def startswith(self, other: str): """ True if string begins with `other` """ return self._simpleUnaryTransformColumn(f'STARTSWITH ("{other}") ', lambda x: x.startswith(other)) def endswith(self, other: str): """ True if string ends with `other` """ return self._simpleUnaryTransformColumn(f'ENDSWITH ("{other}") ', lambda x: x.endswith(other)) def contains(self, other: str): """ True if string contains string `other` """ # TODO: assert string return self._simpleUnaryTransformColumn(f'CONTAINS ("{other}") ', lambda x: other in x) def getField(self, name: str) -> 'Column': """ Get the field of a SpandaStruct by the name `name` """ full_name = Column.getName(self) + "." + name return self.apply(lambda x: SpandaStruct._get_field(x, name)).alias(full_name) # operators def __eq__(self, other): return self._simpleBinaryTransformColumn('==', lambda x, y: x == y, other) def __ne__(self, other): return self._simpleBinaryTransformColumn('!=', lambda x, y: x != y, other) def __gt__(self, other): return self._simpleBinaryTransformColumn('>', lambda x, y: x > y, other) def __lt__(self, other): return self._simpleBinaryTransformColumn('<', lambda x, y: x < y, other) def __ge__(self, other): return self._simpleBinaryTransformColumn('>=', lambda x, y: x >= y, other) def __le__(self, other): return self._simpleBinaryTransformColumn('<=', lambda x, y: x <= y, other) def __add__(self, other): return self._simpleBinaryTransformColumn('+', lambda x, y: x + y, other) def __mul__(self, other): return self._simpleBinaryTransformColumn('*', lambda x, y: x * y, other) def __div__(self, other): return self._simpleBinaryTransformColumn('/', lambda x, y: x / y, other) def __sub__(self, other): return self._simpleBinaryTransformColumn('-', lambda x, y: x - y, other) def __and__(self, other): return self._simpleBinaryTransformColumn(' AND ', lambda x, y: x & y, other) def __or__(self, other): return self._simpleBinaryTransformColumn(' OR ', lambda x, y: x | y, other) def __neg__(self, other): return self._simpleUnaryTransformColumn('-', lambda x: -x) def __invert__(self): return self._simpleUnaryTransformColumn('NOT ', lambda x: ~x) class AggColumn: def __init__(self, name, orig_col, op): self._name = name self._orig_col = orig_col self._op = op def alias(self, name): # TODO: might want to clone orig_col and op (maybe also in Column) return AggColumn(name=name, orig_col=self._orig_col, op=self._op) @staticmethod def getName(agg_col): return f"{agg_col._name} ({Column.getName(agg_col._orig_col)})" @staticmethod def _apply(agg_col: 'AggColumn', df: pd.DataFrame) -> pd.Series: return agg_col._op(Column._apply(agg_col._orig_col, df)) def over(self, window_spec) -> Column: def f(df): inputs = Column._apply(self._orig_col, df) # in the following, row2grp represents the representative group of each row, while grp2rows is a dictionary # of all rows that the group aggregates over. possibly not intuitive but group may include rows that are # not represented by this group (for example if we apply lead(...) we aggregate over the next row which is # not represented by the current group) row2grp, grp2rows = window_spec._get_group_data(df) grp_agg_val = {grp: self._op(inputs.loc[vals]) for grp, vals in grp2rows.items()} data = {row_idx: grp_agg_val[grp_name] for row_idx, grp_name in row2grp.items()} return pd.Series(data=data, index=inputs.index) col = Column(name=f"{AggColumn.getName(self)} OVER ({window_spec._name})") col._set_op(f) return col class WindowTransformationColumn(AggColumn): def __init(self, name: str, orig_col: Column, op: Callable): self._name = name self._orig_col = orig_col self._op = op @staticmethod def _apply(agg_col, df: pd.DataFrame): assert False, f"cannot aggregate grouped data using `{agg_col._name}`. can be used only over windows." def over(self, window_spec) -> Column: def f(df): orig_col = self._orig_col if orig_col is None: orig_col = window_spec._get_orderby_col() inputs = Column._apply(orig_col, df) row2grp, grp2rows = window_spec._get_group_data(df) data = {row_idx: self._op(inputs, grp2rows[grp_name], grp2rows[grp_name].index(row_idx)) for row_idx, grp_name in row2grp.items()} return pd.Series(data=data, index=inputs.index) col = Column(name=f"{AggColumn.getName(self)} OVER ({window_spec._name})") col._set_op(f) return col
38.353403
119
0.596615
1,747
14,651
4.785346
0.174585
0.032297
0.028708
0.013995
0.351196
0.263876
0.219139
0.179665
0.142584
0.134689
0
0.002987
0.291652
14,651
381
120
38.454068
0.802563
0.160262
0
0.239316
0
0.004274
0.087004
0.021603
0
0
0
0.010499
0.021368
1
0.260684
false
0
0.021368
0.102564
0.559829
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
9caf75bb0e3d26dd6d8ce4d5a0e72cd6463cafab
1,594
py
Python
src/python/datastructures/tribonacci.py
Binjaaa/CodeWarsOldRepublic
6d27ef9426f956243fdcf908898856815cfe022d
[ "MIT" ]
null
null
null
src/python/datastructures/tribonacci.py
Binjaaa/CodeWarsOldRepublic
6d27ef9426f956243fdcf908898856815cfe022d
[ "MIT" ]
6
2017-11-16T11:05:31.000Z
2017-12-03T18:31:07.000Z
src/python/datastructures/tribonacci.py
Binjaaa/CodeWarsOldRepublic
6d27ef9426f956243fdcf908898856815cfe022d
[ "MIT" ]
null
null
null
def tribonacci(signature, n): len_sig = len(signature) trib_list = signature if n <= 3: return trib_list[:n] for i in range(0, n-len_sig): trib_list.append(trib_list[i] + trib_list[i+1] + trib_list[i+2]) return trib_list print tribonacci([1, 1, 1], 0) print tribonacci([1, 1, 1], 1) print tribonacci([1, 1, 1], 2) # print tribonacci([0, 0, 1], 10) # print tribonacci([1, 0, 0], 10) # print tribonacci([1, 2, 3], 10) # https://www.codewars.com/kata/tribonacci-sequence # Test.describe("Basic tests") # Test.assert_equals(tribonacci([1, 1, 1], 10), [1, 1, 1, 3, 5, 9, 17, 31, 57, 105]) # Test.assert_equals(tribonacci([0, 0, 1], 10), [0, 0, 1, 1, 2, 4, 7, 13, 24, 44]) # Test.assert_equals(tribonacci([0, 1, 1], 10), [0, 1, 1, 2, 4, 7, 13, 24, 44, 81]) # Test.assert_equals(tribonacci([1, 0, 0], 10), [1, 0, 0, 1, 1, 2, 4, 7, 13, 24]) # Test.assert_equals(tribonacci([0, 0, 0], 10), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) # Test.assert_equals(tribonacci([1, 2, 3], 10), [1, 2, 3, 6, 11, 20, 37, 68, 125, 230]) # Test.assert_equals(tribonacci([3, 2, 1], 10), [3, 2, 1, 6, 9, 16, 31, 56, 103, 190]) # Test.assert_equals(tribonacci([1, 1, 1], 1), [1]) # Test.assert_equals(tribonacci([300, 200, 100], 0), []) # Test.assert_equals(tribonacci([0.5, 0.5, 0.5], 30), # [0.5, 0.5, 0.5, 1.5, 2.5, 4.5, 8.5, 15.5, 28.5, 52.5, 96.5, 177.5, 326.5, 600.5, 1104.5, 2031.5, # 3736.5, 6872.5, 12640.5, 23249.5, 42762.5, 78652.5, 144664.5, 266079.5, 489396.5, 900140.5, # 1655616.5, 3045153.5, 5600910.5, 10301680.5])
43.081081
117
0.572146
304
1,594
2.9375
0.276316
0.042553
0.179171
0.291153
0.43897
0.192609
0.116461
0.051512
0.051512
0
0
0.26022
0.202008
1,594
37
118
43.081081
0.441824
0.752823
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.272727
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
9cdaf795af1da0407c8197e8f48029a14f50ebca
107
py
Python
tests/__init__.py
phillips96/similarity
3794f288f17f47f1f90b5368e5c0eeac1e81e10d
[ "Apache-2.0" ]
706
2021-09-04T02:11:05.000Z
2022-03-31T13:29:14.000Z
tests/__init__.py
phillips96/similarity
3794f288f17f47f1f90b5368e5c0eeac1e81e10d
[ "Apache-2.0" ]
119
2021-09-01T22:32:40.000Z
2022-03-30T22:39:27.000Z
tests/__init__.py
phillips96/similarity
3794f288f17f47f1f90b5368e5c0eeac1e81e10d
[ "Apache-2.0" ]
57
2021-09-04T02:11:14.000Z
2022-03-31T13:29:15.000Z
from pathlib import Path CURRRENT_DIR = Path(__file__).parent.absolute() DATA_DIR = CURRRENT_DIR / 'data/'
26.75
47
0.775701
15
107
5.066667
0.666667
0.289474
0
0
0
0
0
0
0
0
0
0
0.11215
107
3
48
35.666667
0.8
0
0
0
0
0
0.046729
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
143513d211986efa6baf417a7ffbaf76cb4a104b
227
py
Python
src/mailguard/configuration/models/serializers/checks_serializers.py
derMonarch/mailguard
8fdfe756ea9dbe4b2ef044b12fd133d24893415a
[ "Apache-2.0" ]
2
2021-08-05T17:31:47.000Z
2021-08-19T19:36:38.000Z
src/mailguard/configuration/models/serializers/checks_serializers.py
derMonarch/mailguard
8fdfe756ea9dbe4b2ef044b12fd133d24893415a
[ "Apache-2.0" ]
null
null
null
src/mailguard/configuration/models/serializers/checks_serializers.py
derMonarch/mailguard
8fdfe756ea9dbe4b2ef044b12fd133d24893415a
[ "Apache-2.0" ]
null
null
null
from rest_framework import serializers from ..checks_model import ChecksModel class ChecksSerializer(serializers.ModelSerializer): class Meta: model = ChecksModel fields = ["account_id", "time_interval"]
22.7
52
0.744493
23
227
7.173913
0.73913
0
0
0
0
0
0
0
0
0
0
0
0.185022
227
9
53
25.222222
0.891892
0
0
0
0
0
0.101322
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
149216e53024dbb01ef864a987e924a7e51e9cde
58
py
Python
src/config_example.py
DeveloperAnonymous/quota-lex
caaf30408a7642b24d5ec78c899ff761d35a4889
[ "MIT" ]
null
null
null
src/config_example.py
DeveloperAnonymous/quota-lex
caaf30408a7642b24d5ec78c899ff761d35a4889
[ "MIT" ]
null
null
null
src/config_example.py
DeveloperAnonymous/quota-lex
caaf30408a7642b24d5ec78c899ff761d35a4889
[ "MIT" ]
null
null
null
TOKEN="xxxx_your_token_here_xxxx" OWNER=000000000000000000
29
33
0.913793
8
58
6.125
0.75
0
0
0
0
0
0
0
0
0
0
0.315789
0.017241
58
2
34
29
0.54386
0
0
0
0
0
0.423729
0.423729
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
1
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
1492e316a2d9ea7cbcabea0934c340bd0068cdb9
273
py
Python
csc_new/pages/admin.py
rit-csc/CSCWebsite
70cd292685389df849d330e7fcef62e9575bb6c2
[ "MIT" ]
3
2015-02-08T19:54:06.000Z
2017-05-09T15:44:49.000Z
csc_new/pages/admin.py
rit-csc/CSCWebsite
70cd292685389df849d330e7fcef62e9575bb6c2
[ "MIT" ]
41
2015-01-09T19:37:00.000Z
2016-10-06T01:59:40.000Z
csc_new/pages/admin.py
rit-csc/CSCWebsite
70cd292685389df849d330e7fcef62e9575bb6c2
[ "MIT" ]
6
2015-05-14T18:05:46.000Z
2016-09-07T22:27:47.000Z
from django.contrib import admin from pages.models import ExamReview, Photo, GeneralMeetingSlides, Attendance # Register your models here. admin.site.register(ExamReview) admin.site.register(Photo) admin.site.register(GeneralMeetingSlides) admin.site.register(Attendance)
30.333333
76
0.838828
33
273
6.939394
0.454545
0.157205
0.296943
0
0
0
0
0
0
0
0
0
0.076923
273
8
77
34.125
0.90873
0.095238
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
149473d6c99060feea249d8dfcf619ea2227fa93
184
py
Python
_fred-v1/model/models/residuals.py
elviva404/frontend-regression-validator
21df2a127712bdf0688dc9aedf478c6a2a90a3c3
[ "ECL-2.0", "Apache-2.0" ]
70
2019-09-16T13:30:49.000Z
2022-02-25T17:46:23.000Z
_fred-v1/model/models/residuals.py
elviva404/frontend-regression-validator
21df2a127712bdf0688dc9aedf478c6a2a90a3c3
[ "ECL-2.0", "Apache-2.0" ]
2
2020-01-13T09:15:47.000Z
2020-07-29T11:49:25.000Z
_fred-v1/model/models/residuals.py
elviva404/frontend-regression-validator
21df2a127712bdf0688dc9aedf478c6a2a90a3c3
[ "ECL-2.0", "Apache-2.0" ]
10
2019-10-06T08:22:05.000Z
2022-02-03T18:45:08.000Z
class Residuals: def __init__(self, resnet_layer): resnet_layer.register_forward_hook(self.hook) def hook(self, module, input, output): self.features = output
26.285714
53
0.695652
23
184
5.217391
0.608696
0.183333
0
0
0
0
0
0
0
0
0
0
0.211957
184
6
54
30.666667
0.827586
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0
0.6
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
1ae9a48a1c6c06fa0d6dce87205c40011eedaa6a
2,983
py
Python
Spiders/test.py
Rainstyd/rainsty
9a0d5f46c20faf909c4194f315fb9960652cffc6
[ "Apache-2.0" ]
1
2020-03-25T01:13:35.000Z
2020-03-25T01:13:35.000Z
Spiders/test.py
Rainstyed/rainsty
f74e0ccaf16d1871c9d1870bd8a7c8a63243fcf5
[ "Apache-2.0" ]
1
2022-01-06T23:49:21.000Z
2022-01-06T23:49:21.000Z
Spiders/test.py
rainstyd/rainsty
9a0d5f46c20faf909c4194f315fb9960652cffc6
[ "Apache-2.0" ]
1
2020-03-20T08:48:36.000Z
2020-03-20T08:48:36.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- """ @author: rainsty @file: test.py @time: 2020-04-28 13:13:29 @description: """ # import time # from selenium import webdriver # from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware # # browser = webdriver.Chrome() # link1 = 'https://www.baidu.com/' # time.sleep(10) # browser.get(link1) # time.sleep(10) # browser.find_element_by_id('kw').send_keys('mczaiyun.top') # time.sleep(10) # browser.find_element_by_id('su').click() # user_agent_list = [ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 " "(KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1", "Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 " "(KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 " "(KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 " "(KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 " "(KHTML, like Gecko) Chrome/19.77.34.5 Safari/537.1", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 " "(KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5", "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/536.5 " "(KHTML, like Gecko) Chrome/19.0.1084.36 Safari/536.5", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 " "(KHTML, like Gecko) Chrome/19.0.1061.0 Safari/536.3", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.24 " "(KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.24 " "(KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24" ] import requests proxies = {'http': 'http://rainsty:keyile@47.99.139.144:8388'} url = 'http://47.99.139.144:8001/rain' res = requests.get(url, proxies=proxies, verify=False) print(res.status_code)
43.231884
75
0.63292
494
2,983
3.793522
0.238866
0.076841
0.086446
0.192102
0.719317
0.71825
0.705977
0.683031
0.598719
0.503735
0
0.188123
0.192759
2,983
68
76
43.867647
0.590116
0.152531
0
0.325581
0
0.023256
0.769753
0
0
0
0
0
0
1
0
false
0
0.023256
0
0.023256
0.023256
0
0
0
null
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
212fea3251b77f2f681c5a29b77e15cbdfbfcbee
103
py
Python
3.7.0/lldb-3.7.0.src/test/functionalities/command_script/import/foo/bar/foobar.py
androm3da/clang_sles
2ba6d0711546ad681883c42dfb8661b842806695
[ "MIT" ]
3
2016-02-10T14:18:40.000Z
2018-02-05T03:15:56.000Z
3.7.0/lldb-3.7.0.src/test/functionalities/command_script/import/foo/bar/foobar.py
androm3da/clang_sles
2ba6d0711546ad681883c42dfb8661b842806695
[ "MIT" ]
1
2016-02-10T15:40:03.000Z
2016-02-10T15:40:03.000Z
3.7.0/lldb-3.7.0.src/test/functionalities/command_script/import/foo/bar/foobar.py
androm3da/clang_sles
2ba6d0711546ad681883c42dfb8661b842806695
[ "MIT" ]
null
null
null
def foo_function(debugger, args, result, dict): print >>result, ("foobar says " + args) return None
25.75
47
0.699029
14
103
5.071429
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.165049
103
3
48
34.333333
0.825581
0
0
0
0
0
0.116505
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
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
1
0
0
0
0
1
0
0
4
214e15024394546f0f8ef7d723401096be7f23e6
289
py
Python
tests/feats/django/__init__.py
roverdotcom/feats.py
382f13e2f616b874d181ab9279a4a1a1652f8b83
[ "MIT" ]
3
2019-12-11T21:56:21.000Z
2021-02-17T00:17:01.000Z
tests/feats/django/__init__.py
roverdotcom/feats.py
382f13e2f616b874d181ab9279a4a1a1652f8b83
[ "MIT" ]
1
2020-02-12T00:29:58.000Z
2020-02-12T00:30:15.000Z
tests/feats/django/__init__.py
roverdotcom/feats.py
382f13e2f616b874d181ab9279a4a1a1652f8b83
[ "MIT" ]
null
null
null
import django from django.conf import settings from example.project import settings as project_settings import feats from feats.storage import Memory if not settings.configured: settings.configure(INSTALLED_APPS=['feats.django'], FEATS=feats.App(storage=Memory())) django.setup()
28.9
90
0.799308
39
289
5.871795
0.487179
0.122271
0
0
0
0
0
0
0
0
0
0
0.114187
289
9
91
32.111111
0.894531
0
0
0
0
0
0.041522
0
0
0
0
0
0
1
0
true
0
0.625
0
0.625
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
dccd7b58bf255c8735597e1120b8f3a4214783fa
297
py
Python
interpolated_torchdiffeq/_impl/__init__.py
Daulbaev/IRDM
4bb60191ac0072e4349ca47092675d06b39a979a
[ "MIT" ]
10
2020-12-06T13:04:33.000Z
2021-02-04T23:10:43.000Z
interpolated_torchdiffeq/_impl/__init__.py
Daulbaev/IRDM
4bb60191ac0072e4349ca47092675d06b39a979a
[ "MIT" ]
null
null
null
interpolated_torchdiffeq/_impl/__init__.py
Daulbaev/IRDM
4bb60191ac0072e4349ca47092675d06b39a979a
[ "MIT" ]
null
null
null
from .odeint import odeint from .adjoint import odeint_adjoint from .cheb import cheb1_interp_torch, compute_barycentric_weights, r8vec_cheby1space from .odeint_interpolated import odeint_linear_func, odeint_chebyshev_func from .odeint_interpolated import odeint_chebyshev_func, odeint_linear_func
59.4
84
0.892256
40
297
6.225
0.425
0.192771
0.176707
0.2249
0.273092
0
0
0
0
0
0
0.010949
0.077441
297
5
85
59.4
0.89781
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
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
0d4a3774b44263c4c10da96e8233da7e0c489e90
119
py
Python
examples/packfloat_simpletest.py
mcauser/CircuitPython_packfloat
837c79817b6dcdf65756a0418c2fe76eb99d06ff
[ "MIT" ]
1
2021-01-27T04:12:14.000Z
2021-01-27T04:12:14.000Z
examples/packfloat_simpletest.py
mcauser/CircuitPython_packfloat
837c79817b6dcdf65756a0418c2fe76eb99d06ff
[ "MIT" ]
null
null
null
examples/packfloat_simpletest.py
mcauser/CircuitPython_packfloat
837c79817b6dcdf65756a0418c2fe76eb99d06ff
[ "MIT" ]
1
2020-12-07T14:12:25.000Z
2020-12-07T14:12:25.000Z
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries # # SPDX-License-Identifier: Unlicense
29.75
79
0.815126
13
119
7.461538
0.923077
0
0
0
0
0
0
0
0
0
0
0.037736
0.109244
119
3
80
39.666667
0.877358
0.941176
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
0d4f1a73ddba0300696d4f26fe795d8f7791c9e9
292
py
Python
Programing_Basics_with_Python/2 Conditional Statements/More/Excellent.py
eclipse-ib/Software-University-Entry-Module
7d287dc32340ae301872d6e45cbd7d8bf56110a2
[ "MIT" ]
null
null
null
Programing_Basics_with_Python/2 Conditional Statements/More/Excellent.py
eclipse-ib/Software-University-Entry-Module
7d287dc32340ae301872d6e45cbd7d8bf56110a2
[ "MIT" ]
null
null
null
Programing_Basics_with_Python/2 Conditional Statements/More/Excellent.py
eclipse-ib/Software-University-Entry-Module
7d287dc32340ae301872d6e45cbd7d8bf56110a2
[ "MIT" ]
null
null
null
# grade = float(input()) # # if grade >= 5.50: # print("Excellent!") # else: # print("Not excellent.") # ---------------------------------- # color = "red" # if color == "red": # print("Red") # else: # print("Yellow") # print("bye") # ---------------------------------
13.272727
36
0.373288
25
292
4.36
0.56
0.165138
0
0
0
0
0
0
0
0
0
0.012987
0.208904
292
21
37
13.904762
0.458874
0.876712
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
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b4b13aff01f2919a0708f4e11e530f1d11cf457a
453
py
Python
terrascript/resource/clc.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
terrascript/resource/clc.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
terrascript/resource/clc.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
# terrascript/resource/clc.py import terrascript class clc_server(terrascript.Resource): pass class clc_group(terrascript.Resource): pass class clc_public_ip(terrascript.Resource): pass class clc_load_balancer(terrascript.Resource): pass class clc_load_balancer_pool(terrascript.Resource): pass __all__ = [ "clc_server", "clc_group", "clc_public_ip", "clc_load_balancer", "clc_load_balancer_pool", ]
13.727273
51
0.728477
55
453
5.6
0.272727
0.37013
0.373377
0.363636
0.480519
0.279221
0.279221
0
0
0
0
0
0.178808
453
32
52
14.15625
0.827957
0.059603
0
0.277778
0
0
0.167453
0.051887
0
0
0
0
0
1
0
false
0.277778
0.055556
0
0.333333
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
1
0
0
0
0
0
4
b4b2eb65ec8b54f23e9245ef37a287049982578d
282
py
Python
kiwi/__init__.py
SysBioChalmers/Kiwi
91c8d7e5e02367c119043d8d507b2a2110ad66c5
[ "MIT" ]
2
2018-08-14T08:29:16.000Z
2019-01-28T14:08:05.000Z
kiwi/__init__.py
SysBioChalmers/Kiwi
91c8d7e5e02367c119043d8d507b2a2110ad66c5
[ "MIT" ]
2
2021-12-21T09:26:26.000Z
2021-12-22T08:07:14.000Z
kiwi/__init__.py
SysBioChalmers/Kiwi
91c8d7e5e02367c119043d8d507b2a2110ad66c5
[ "MIT" ]
3
2016-12-21T11:41:15.000Z
2019-02-05T15:44:14.000Z
# -*- coding: utf-8 -*- """Kiwi: a tool to combine gene-set analyses with biological networks. :author: Francesco Gatto and Leif Väremo, 2014 :email: kiwi@sysbio.se :affiliation: Department of Biological Engineering, Chalmers, Göteborg, Sweden""" from kiwi.kiwi_module import plot
35.25
81
0.758865
39
282
5.461538
0.897436
0
0
0
0
0
0
0
0
0
0
0.020408
0.131206
282
7
82
40.285714
0.84898
0.847518
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
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
b4c34e3f7233462fc479ab28386a2e4a1b28371b
2,080
py
Python
core/models.py
XSonecaX/api-receita
9a293426771bc7bea075c4b6b37c87725720634b
[ "MIT" ]
null
null
null
core/models.py
XSonecaX/api-receita
9a293426771bc7bea075c4b6b37c87725720634b
[ "MIT" ]
null
null
null
core/models.py
XSonecaX/api-receita
9a293426771bc7bea075c4b6b37c87725720634b
[ "MIT" ]
1
2021-11-27T05:46:45.000Z
2021-11-27T05:46:45.000Z
from django.db import models class Cpf(models.Model): NUM_CPF = models.CharField(max_length=11, primary_key=True) NOME = models.CharField(max_length=500, blank=True, null=True) DATA_NASCIMENTO = models.CharField(max_length=12, blank=True, null=True) IND_SEXO = models.CharField(max_length=2, blank=True, null=True) NOME_MAE = models.CharField(max_length=500, blank=True, null=True) NUM_TITULO_ELEITOR = models.CharField(max_length=12, blank=True, null=True) TIPO_LOGRADOURO = models.CharField(max_length=50, blank=True, null=True) DESCR_LOGRADOURO = models.CharField(max_length=100, blank=True, null=True) NUM_LOGRADOURO = models.CharField(max_length=50, blank=True, null=True) DESCR_COMPLEMENTO_LOGRADOURO = models.CharField(max_length=800, blank=True, null=True) NOME_BAIRRO = models.CharField(max_length=500, blank=True, null=True) NUM_CEP = models.CharField(max_length=50, blank=True, null=True) NOME_MUNICIPIO = models.CharField(max_length=200, blank=True, null=True) SIGLA_UF = models.CharField(max_length=50, blank=True, null=True) NUM_DDD = models.CharField(max_length=50, blank=True, null=True) NUM_TELEFONE = models.CharField(max_length=50, blank=True, null=True) NUM_FAX = models.CharField(max_length=50, blank=True, null=True) SE_ESTRANGEIRO = models.CharField(max_length=2, blank=True, null=True) NOME_PAIS_NACIONALIDADE = models.CharField(max_length=500, blank=True, null=True) COD_SITUACAO_CADASTRAL = models.CharField(max_length=2, blank=True, null=True) DESCR_SITUACAO_CADASTRAL = models.CharField(max_length=50, blank=True, null=True) DATA_SITUACAO_CADASTRAL = models.CharField(max_length=12, blank=True, null=True) DATA_INSCRICAO = models.CharField(max_length=12, blank=True, null=True) ANO_OBITO = models.CharField(max_length=10, blank=True, null=True) ANO_ULTIMA_ENTREGA_DECLARACAO = models.CharField(max_length=10, blank=True, null=True) DATA_BASE = models.CharField(max_length=12, blank=True, null=True) def __str__(self): return self.NOME
65
90
0.761058
307
2,080
4.947883
0.208469
0.256748
0.308097
0.410797
0.784068
0.691903
0.658328
0.658328
0.658328
0.289664
0
0.030702
0.123077
2,080
32
91
65
0.802083
0
0
0
0
0
0
0
0
0
0
0
0
1
0.033333
false
0
0.033333
0.033333
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
b4e2eb06215cefbb754cba5a5b9e2bbff8336b99
83
py
Python
src/coloring/__main__.py
Nazime/coloring
4e519a5b440bb4af628048ec9cef2b8698128db6
[ "MIT" ]
22
2020-07-28T19:45:32.000Z
2022-03-09T04:48:51.000Z
src/coloring/__main__.py
Nazime/coloring
4e519a5b440bb4af628048ec9cef2b8698128db6
[ "MIT" ]
null
null
null
src/coloring/__main__.py
Nazime/coloring
4e519a5b440bb4af628048ec9cef2b8698128db6
[ "MIT" ]
1
2021-11-12T19:23:59.000Z
2021-11-12T19:23:59.000Z
# Entry point from coloring.cli import main if __name__ == "__main__": main()
13.833333
29
0.686747
11
83
4.454545
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.204819
83
5
30
16.6
0.742424
0.13253
0
0
0
0
0.114286
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
b4f4eb56b07c639e1a8ba77d836e4aeb6231b4e5
87
py
Python
src/patios/apps.py
ANIKIMPA/Agrobonano
21aada645f4d27fa15819c547d9ed1201ced30b3
[ "bzip2-1.0.6" ]
null
null
null
src/patios/apps.py
ANIKIMPA/Agrobonano
21aada645f4d27fa15819c547d9ed1201ced30b3
[ "bzip2-1.0.6" ]
12
2020-02-12T03:04:12.000Z
2022-02-10T08:54:59.000Z
src/patios/apps.py
ANIKIMPA/Agrobonano
21aada645f4d27fa15819c547d9ed1201ced30b3
[ "bzip2-1.0.6" ]
null
null
null
from django.apps import AppConfig class PatiosConfig(AppConfig): name = 'patios'
14.5
33
0.747126
10
87
6.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.172414
87
5
34
17.4
0.902778
0
0
0
0
0
0.068966
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
3702feccbd563ed55b295ab2090269ff8a8d2e59
10
py
Python
course/__init__.py
inducer/courseflow
0f9786e3616dbedf08365d81a731f672b97ba9f5
[ "Unlicense" ]
4
2019-04-25T21:09:39.000Z
2020-07-26T08:57:00.000Z
course/__init__.py
inducer/courseflow
0f9786e3616dbedf08365d81a731f672b97ba9f5
[ "Unlicense" ]
1
2019-08-11T00:27:18.000Z
2019-08-12T17:36:42.000Z
course/__init__.py
inducer/courseflow
0f9786e3616dbedf08365d81a731f672b97ba9f5
[ "Unlicense" ]
null
null
null
# (empty)
5
9
0.5
1
10
5
1
0
0
0
0
0
0
0
0
0
0
0
0.2
10
1
10
10
0.625
0.7
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
370dd9220bcee56a5a1b0424586772001fcef740
266
py
Python
generated-libraries/python/netapp/job/cron_month.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
2
2017-03-28T15:31:26.000Z
2018-08-16T22:15:18.000Z
generated-libraries/python/netapp/job/cron_month.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
null
null
null
generated-libraries/python/netapp/job/cron_month.py
radekg/netapp-ontap-lib-get
6445ebb071ec147ea82a486fbe9f094c56c5c40d
[ "MIT" ]
null
null
null
class CronMonth(int): """ Job Manager cron scheduling month. -1 represents all months and only supported for cron schedule create and modify. Range : [-1..11]. """ @staticmethod def get_api_name(): return "cron-month"
22.166667
67
0.609023
32
266
5
0.84375
0
0
0
0
0
0
0
0
0
0
0.021277
0.293233
266
11
68
24.181818
0.829787
0.5
0
0
0
0
0.091743
0
0
0
0
0
0
1
0.25
true
0
0
0.25
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
1
0
0
4
3728ee6e0b27c708030744e7845ccbf90c14a6c4
178
py
Python
lib/JumpScale/grid/agentcontroller/__init__.py
Jumpscale/jumpscale6_core
0502ddc1abab3c37ed982c142d21ea3955d471d3
[ "BSD-2-Clause" ]
1
2015-10-26T10:38:13.000Z
2015-10-26T10:38:13.000Z
lib/JumpScale/grid/agentcontroller/__init__.py
Jumpscale/jumpscale6_core
0502ddc1abab3c37ed982c142d21ea3955d471d3
[ "BSD-2-Clause" ]
null
null
null
lib/JumpScale/grid/agentcontroller/__init__.py
Jumpscale/jumpscale6_core
0502ddc1abab3c37ed982c142d21ea3955d471d3
[ "BSD-2-Clause" ]
null
null
null
from JumpScale import j from .AgentControllerFactory import AgentControllerFactory j.base.loader.makeAvailable(j, 'clients') j.clients.agentcontroller = AgentControllerFactory()
35.6
58
0.848315
18
178
8.388889
0.555556
0.10596
0
0
0
0
0
0
0
0
0
0
0.073034
178
4
59
44.5
0.915152
0
0
0
0
0
0.039326
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
2e9d76a75719b7711c46832406a6aafc19879499
676
py
Python
app/decorators.py
DXYyang/shenNeng_gasAnalysis
d94e2451d1938c090d1377dfbd487d0c6a649188
[ "MIT" ]
1
2020-02-16T04:32:15.000Z
2020-02-16T04:32:15.000Z
app/decorators.py
DXYyang/shenNeng_gasAnalysis
d94e2451d1938c090d1377dfbd487d0c6a649188
[ "MIT" ]
null
null
null
app/decorators.py
DXYyang/shenNeng_gasAnalysis
d94e2451d1938c090d1377dfbd487d0c6a649188
[ "MIT" ]
null
null
null
from functools import wraps from flask import abort from flask_login import current_user from .models import Permission def permission_required(permission): def decorator(f): @wraps(f) def decorated_function(*args,**kwargs): if not current_user.can(permission): abort(403) return f(*args,**kwargs) return decorated_function return decorator def admin_required(f): return permission_required(Permission.Administrator)(f) def customer_required(f): return permission_required(Permission.AI_Recommend)(f) def gas_analysis_required(f): return permission_required(Permission.GasData_Analysis)(f)
33.8
62
0.727811
82
676
5.817073
0.390244
0.150943
0.234801
0.157233
0.27044
0.27044
0
0
0
0
0
0.005505
0.193787
676
19
63
35.578947
0.869725
0
0
0
0
0
0
0
0
0
0
0
0
1
0.315789
false
0
0.210526
0.157895
0.842105
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
2edb276731ce2543130e13abb6925963875bce8c
95
py
Python
LuoguCodes/AT3693.py
Anguei/OI-Codes
0ef271e9af0619d4c236e314cd6d8708d356536a
[ "MIT" ]
null
null
null
LuoguCodes/AT3693.py
Anguei/OI-Codes
0ef271e9af0619d4c236e314cd6d8708d356536a
[ "MIT" ]
null
null
null
LuoguCodes/AT3693.py
Anguei/OI-Codes
0ef271e9af0619d4c236e314cd6d8708d356536a
[ "MIT" ]
null
null
null
l, r = map(int, raw_input().split()) s = raw_input() print [';NO';, ';YES';][l <= len(s) <= r]
23.75
41
0.505263
17
95
2.705882
0.705882
0.347826
0
0
0
0
0
0
0
0
0
0
0.157895
95
3
42
31.666667
0.575
0
0
0
0
0
0.073684
0
0
0
0
0
0
0
null
null
0
0
null
null
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
2ee873d6f9f42d58dfae004cdc89d445e5381a58
135
py
Python
src/orders/apps.py
BergLucas/DjangoMollieExample
6cdc28aabe15811fbcf2f50dbaef8c96fab32eb3
[ "MIT" ]
1
2022-01-28T12:06:45.000Z
2022-01-28T12:06:45.000Z
src/orders/apps.py
BergLucas/DjangoMollieExample
6cdc28aabe15811fbcf2f50dbaef8c96fab32eb3
[ "MIT" ]
null
null
null
src/orders/apps.py
BergLucas/DjangoMollieExample
6cdc28aabe15811fbcf2f50dbaef8c96fab32eb3
[ "MIT" ]
null
null
null
from django.apps import AppConfig class OrdersConfig(AppConfig): """This type represents the app config.""" name = "orders"
16.875
46
0.703704
16
135
5.9375
0.9375
0
0
0
0
0
0
0
0
0
0
0
0.192593
135
7
47
19.285714
0.87156
0.266667
0
0
0
0
0.064516
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
2efc4eb61f451d3b538d17627914fb8c7de81d7a
724
py
Python
generalinfo/migrations/0007_auto_20170809_1442.py
Dachckol/MichalDackoTutoring
205654e7cdfd474400cf35a7015b213fa146a1e6
[ "Apache-2.0" ]
null
null
null
generalinfo/migrations/0007_auto_20170809_1442.py
Dachckol/MichalDackoTutoring
205654e7cdfd474400cf35a7015b213fa146a1e6
[ "Apache-2.0" ]
1
2021-06-10T18:43:43.000Z
2021-06-10T18:43:43.000Z
generalinfo/migrations/0007_auto_20170809_1442.py
Dachckol/MichalDackoTutoring
205654e7cdfd474400cf35a7015b213fa146a1e6
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-09 14:42 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('generalinfo', '0006_auto_20170218_1634'), ] operations = [ migrations.RemoveField( model_name='profile', name='higher', ), migrations.RemoveField( model_name='profile', name='joint_discount', ), migrations.RemoveField( model_name='profile', name='nat5', ), migrations.RemoveField( model_name='profile', name='skype_discount', ), ]
22.625
51
0.558011
66
724
5.909091
0.606061
0.215385
0.266667
0.307692
0.420513
0.420513
0
0
0
0
0
0.069959
0.328729
724
31
52
23.354839
0.73251
0.093923
0
0.5
1
0
0.153139
0.035222
0
0
0
0
0
1
0
false
0
0.083333
0
0.208333
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2c13b6ebf82cc3724f0cc10b59624e1b4571da81
1,906
py
Python
tests/core/test_configuration.py
KrusnikViers/NCloud
d98d35bcd3de6182a4e65b173ca603d2d722b56f
[ "MIT" ]
1
2020-09-07T10:31:15.000Z
2020-09-07T10:31:15.000Z
tests/core/test_configuration.py
KrusnikViers/NCloud
d98d35bcd3de6182a4e65b173ca603d2d722b56f
[ "MIT" ]
null
null
null
tests/core/test_configuration.py
KrusnikViers/NCloud
d98d35bcd3de6182a4e65b173ca603d2d722b56f
[ "MIT" ]
null
null
null
import os from pathlib import Path from unittest import TestCase from unittest.mock import patch from app.core.configuration import Configuration class TestConfiguration(TestCase): test_configuration = Path(os.path.realpath(__file__)).parent.joinpath('data', 'configuration.json') @patch('sys.argv', ['_', '-c', str(test_configuration)]) def test_read_from_file(self): config = Configuration.load() self.assertEqual(180.634, config.get('location.lat', float)) self.assertEqual(50.0, config.get('location.lon', float)) self.assertEqual('abcdef', config.get('location.ipinfo_token', str)) self.assertEqual('email@example.com', config.get('email.login', str)) self.assertEqual('password', config.get('email.password', str)) @patch('sys.argv', ['_', '-c', str(test_configuration), 'location.lat=222.22']) def test_command_line_override(self): config = Configuration.load() self.assertEqual(222.22, config.get('location.lat', float)) self.assertEqual(50.0, config.get('location.lon', float)) self.assertEqual('abcdef', config.get('location.ipinfo_token', str)) self.assertEqual('email@example.com', config.get('email.login', str)) self.assertEqual('password', config.get('email.password', str)) @patch('sys.argv', ['_', '-c', str(test_configuration)]) def test_default_get(self): config = Configuration.load() self.assertEqual(180.634, config.get('location.lat', float)) self.assertEqual(50.0, config.get('location.lon', float)) self.assertEqual('abcdef', config.get('location.ipinfo_token', str)) self.assertEqual('email@example.com', config.get('email.login', str)) self.assertEqual('password', config.get('email.password', str)) self.assertEqual('imap.google.com', config.get('email.imap_server', str, 'imap.google.com'))
48.871795
103
0.682057
236
1,906
5.411017
0.241525
0.18794
0.119812
0.05325
0.713391
0.713391
0.680501
0.680501
0.680501
0.643696
0
0.019148
0.150577
1,906
38
104
50.157895
0.769611
0
0
0.59375
0
0
0.222455
0.033054
0
0
0
0
0.5
1
0.09375
false
0.09375
0.15625
0
0.3125
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
1
0
0
0
0
0
4
2585b6d565e5f6a9268f70b94d51841c2272617c
1,630
py
Python
pyscium/commands/commands.py
feannag/pyscium
cc785aa13479cdb02a6641df68297d6638ca415f
[ "MIT" ]
null
null
null
pyscium/commands/commands.py
feannag/pyscium
cc785aa13479cdb02a6641df68297d6638ca415f
[ "MIT" ]
9
2019-12-25T03:48:51.000Z
2020-01-27T13:16:28.000Z
pyscium/commands/commands.py
feannag/pyscium
cc785aa13479cdb02a6641df68297d6638ca415f
[ "MIT" ]
null
null
null
import sys class Command(object): def __init__(self, obj): self.obj = obj def execute(self): raise NotImplementedError # __file commands class CreateFileCommand(Command): def execute(self): self.obj.create_file() class OpenFileCommand(Command): def execute(self): self.obj.open_file() class SaveFileCommand(Command): def execute(self): self.obj.save_file() class CloseFileCommand(Command): def execute(self): self.obj.close_file() # window commands class InsertChCommand(Command): def __init__(self, obj, ch): super().__init__(obj) self.ch = ch def execute(self): self.obj.ins_ch(self.ch) # movement commands class MoveToBeginningOfLineCommand(Command): def execute(self): self.obj.move_to_beginning_of_line() class MoveToEndOfLineCommand(Command): def execute(self): self.obj.move_to_end_of_line() class MoveForwardOneCharCommand(Command): def execute(self): self.obj.move_forward_one_char() class MoveBackwardOneCharCommand(Command): def execute(self): self.obj.move_backward_one_char() class MoveToPreviousLineCommand(Command): def execute(self): self.obj.move_to_previous_line() class MoveToNextLineCommand(Command): def execute(self): self.obj.move_to_next_line() # other commands class BackspaceCommand(Command): def execute(self): self.obj.backspace() class NewlineCommand(Command): def execute(self): self.obj.newline() class ExitCommand(Command): def execute(self): sys.exit()
18.522727
44
0.683436
188
1,630
5.718085
0.281915
0.104186
0.195349
0.253953
0.36186
0.342326
0.186047
0.126512
0
0
0
0
0.213497
1,630
87
45
18.735632
0.838534
0.039264
0
0.294118
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.019608
0
0.647059
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
2588f87623d212cbb94074a763ddbac9aef59627
92
py
Python
Todo_List/apps.py
TrueBackDeveloper/CooL_TodoList
1e91daf6ad3e24c4511ef92ca6cc3d50a213f1a4
[ "MIT" ]
null
null
null
Todo_List/apps.py
TrueBackDeveloper/CooL_TodoList
1e91daf6ad3e24c4511ef92ca6cc3d50a213f1a4
[ "MIT" ]
null
null
null
Todo_List/apps.py
TrueBackDeveloper/CooL_TodoList
1e91daf6ad3e24c4511ef92ca6cc3d50a213f1a4
[ "MIT" ]
null
null
null
from django.apps import AppConfig class TodoListConfig(AppConfig): name = 'Todo_List'
15.333333
33
0.76087
11
92
6.272727
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.163043
92
5
34
18.4
0.896104
0
0
0
0
0
0.097826
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
259ad9bc46551cf039a1137241f0b5bda29b05ec
25,193
py
Python
tests/card_tests/mage_tests.py
anuragpapineni/Hearthbreaker-evolved-agent
d519d42babd93e3567000c33a381e93db065301c
[ "MIT" ]
null
null
null
tests/card_tests/mage_tests.py
anuragpapineni/Hearthbreaker-evolved-agent
d519d42babd93e3567000c33a381e93db065301c
[ "MIT" ]
null
null
null
tests/card_tests/mage_tests.py
anuragpapineni/Hearthbreaker-evolved-agent
d519d42babd93e3567000c33a381e93db065301c
[ "MIT" ]
null
null
null
import random import unittest from hearthbreaker.agents.basic_agents import PredictableBot, DoNothingBot from hearthbreaker.constants import CHARACTER_CLASS, MINION_TYPE from hearthbreaker.game_objects import Game from hearthbreaker.replay import SavedGame from tests.agents.testing_agents import SpellTestingAgent, MinionPlayingAgent, MinionAttackingAgent,\ OneSpellTestingAgent, EnemySpellTestingAgent from tests.testing_utils import generate_game_for, StackedDeck from hearthbreaker.cards import * class TestMage(unittest.TestCase): def setUp(self): random.seed(1857) def test_ArcaneMissiles(self): game = generate_game_for(MogushanWarden, ArcaneMissiles, MinionPlayingAgent, SpellTestingAgent) game.play_single_turn() game.play_single_turn() self.assertEqual(27, game.other_player.hero.health) game.play_single_turn() game.play_single_turn() game.play_single_turn() game.play_single_turn() game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual("Mogu'shan Warden", game.current_player.minions[0].card.name) game.play_single_turn() # The random numbers work so that the arcane missiles hit thrice on each target self.assertEqual(9, game.other_player.hero.health) self.assertEqual(4, game.other_player.minions[0].health) def test_ArcaneMissilesWithSpellPower(self): game = SavedGame("tests/replays/card_tests/ArcaneMissilesWithSpellDamage.rep") game.start() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(1, len(game.other_player.minions)) self.assertEqual(1, game.other_player.minions[0].health) self.assertEqual(2, game.other_player.minions[0].calculate_max_health()) self.assertEqual(27, game.other_player.hero.health) return game def test_WaterElemental(self): game = generate_game_for(WaterElemental, StonetuskBoar, PredictableBot, DoNothingBot) for turn in range(0, 11): game.play_single_turn() self.assertEqual(25, game.other_player.hero.health) self.assertFalse(game.other_player.hero.frozen_this_turn) self.assertFalse(game.other_player.hero.frozen) self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(3, game.current_player.minions[0].calculate_attack()) self.assertEqual(6, game.current_player.minions[0].health) self.assertEqual("Water Elemental", game.current_player.minions[0].card.name) game.play_single_turn() game.play_single_turn() self.assertEqual(22, game.other_player.hero.health) # Always false after the end of a turn self.assertFalse(game.other_player.hero.frozen_this_turn) self.assertTrue(game.other_player.hero.frozen) # Now make sure that attacking the Water Elemental directly will freeze a character random.seed(1857) game = generate_game_for(WaterElemental, IronbarkProtector, MinionPlayingAgent, PredictableBot) for turn in range(0, 8): game.play_single_turn() self.assertEqual(1, len(game.other_player.minions)) self.assertEqual(5, game.other_player.minions[0].health) # The player won't have taken damage because of armor, and so shouldn't be frozen self.assertEqual(30, game.current_player.hero.health) self.assertFalse(game.current_player.hero.frozen) game.play_single_turn() game.play_single_turn() self.assertEqual(28, game.current_player.hero.health) self.assertTrue(game.current_player.hero.frozen) def test_IceLance(self): game = generate_game_for(IceLance, OasisSnapjaw, SpellTestingAgent, MinionPlayingAgent) game.play_single_turn() self.assertTrue(game.other_player.hero.frozen) self.assertEqual(30, game.other_player.hero.health) game.play_single_turn() game.play_single_turn() self.assertTrue(game.other_player.hero.frozen) self.assertEqual(26, game.other_player.hero.health) for turn in range(0, 6): game.play_single_turn() self.assertEqual(1, len(game.other_player.minions)) self.assertTrue(game.other_player.minions[0].frozen) self.assertEqual(7, game.other_player.minions[0].health) def test_ManaWyrm(self): deck1 = StackedDeck([ManaWyrm(), IceLance(), ManaWyrm(), IceLance(), IceLance(), IceLance()], CHARACTER_CLASS.MAGE) deck2 = StackedDeck([IronbeakOwl()], CHARACTER_CLASS.PALADIN) game = Game([deck1, deck2], [SpellTestingAgent(), MinionPlayingAgent()]) game.pre_game() game.current_player = 1 game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(1, game.current_player.minions[0].calculate_attack()) self.assertEqual(3, game.current_player.minions[0].health) self.assertEqual(3, game.current_player.minions[0].calculate_max_health()) self.assertEqual("Mana Wyrm", game.current_player.minions[0].card.name) game.play_single_turn() game.play_single_turn() self.assertEqual(2, len(game.current_player.minions)) self.assertEqual(1, game.current_player.minions[0].calculate_attack()) self.assertEqual(3, game.current_player.minions[0].health) self.assertEqual(3, game.current_player.minions[0].calculate_max_health()) self.assertEqual(2, game.current_player.minions[1].calculate_attack()) self.assertEqual(3, game.current_player.minions[1].health) self.assertEqual(3, game.current_player.minions[1].calculate_max_health()) game.play_single_turn() game.play_single_turn() self.assertEqual(2, len(game.current_player.minions)) self.assertEqual(1, game.current_player.minions[0].calculate_attack()) self.assertEqual(3, game.current_player.minions[0].health) self.assertEqual(3, game.current_player.minions[0].calculate_max_health()) self.assertEqual(5, game.current_player.minions[1].calculate_attack()) self.assertEqual(3, game.current_player.minions[1].health) self.assertEqual(3, game.current_player.minions[1].calculate_max_health()) def test_MirrorImage(self): game = generate_game_for(MirrorImage, StonetuskBoar, SpellTestingAgent, DoNothingBot) game.play_single_turn() self.assertEqual(2, len(game.current_player.minions)) self.assertEqual(0, game.current_player.minions[0].calculate_attack()) self.assertEqual(2, game.current_player.minions[0].health) self.assertTrue(game.current_player.minions[0].taunt) self.assertEqual("Mirror Image", game.current_player.minions[0].card.name) self.assertEqual(0, game.current_player.minions[0].card.mana) self.assertEqual(0, game.current_player.minions[1].calculate_attack()) self.assertEqual(2, game.current_player.minions[1].health) self.assertTrue(game.current_player.minions[1].taunt) self.assertEqual("Mirror Image", game.current_player.minions[1].card.name) self.assertEqual(0, game.current_player.minions[1].card.mana) def test_ArcaneExplosion(self): game = generate_game_for(BloodfenRaptor, ArcaneExplosion, MinionPlayingAgent, SpellTestingAgent) game.play_single_turn() game.play_single_turn() game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) game.play_single_turn() self.assertEqual(1, len(game.other_player.minions)) self.assertEqual(1, game.other_player.minions[0].health) self.assertEqual(30, game.other_player.hero.health) game.play_single_turn() game.play_single_turn() self.assertEqual(1, len(game.other_player.minions)) self.assertEqual(1, game.other_player.minions[0].health) self.assertEqual(30, game.other_player.hero.health) def test_Frostbolt(self): game = generate_game_for(OasisSnapjaw, Frostbolt, MinionPlayingAgent, SpellTestingAgent) for turn in range(0, 4): game.play_single_turn() self.assertTrue(game.other_player.hero.frozen) self.assertEqual(27, game.other_player.hero.health) for turn in range(0, 4): game.play_single_turn() self.assertEqual(24, game.other_player.hero.health) self.assertEqual(1, len(game.other_player.minions)) self.assertEqual(1, game.other_player.minions[0].health) self.assertTrue(game.other_player.minions[0].frozen) def test_SorcerersApprentice(self): game = generate_game_for([SorcerersApprentice, ArcaneMissiles, SorcerersApprentice, Frostbolt, Frostbolt, Frostbolt], StonetuskBoar, SpellTestingAgent, DoNothingBot) game.play_single_turn() game.play_single_turn() game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(3, game.current_player.minions[0].calculate_attack()) self.assertEqual(2, game.current_player.minions[0].health) self.assertEqual("Sorcerer's Apprentice", game.current_player.minions[0].card.name) # Arcane missiles should also have been played, since it is now free self.assertEqual(27, game.other_player.hero.health) # Make sure the other frostbolts have been properly reduced self.assertEqual(1, game.current_player.hand[1].mana_cost(game.current_player)) self.assertEqual(1, game.current_player.hand[2].mana_cost(game.current_player)) game.play_single_turn() game.play_single_turn() # Both Sorcer's Apprentices are killed by friendly Frostbolts. self.assertEqual(0, len(game.current_player.minions)) # Make sure that the cards in hand are no longer reduced self.assertEqual(2, game.current_player.hand[0].mana_cost(game.current_player)) def test_ArcaneIntellect(self): game = generate_game_for(ArcaneIntellect, StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 5): game.play_single_turn() self.assertEqual(7, len(game.current_player.hand)) def test_FrostNova(self): game = generate_game_for(FrostNova, StonetuskBoar, SpellTestingAgent, MinionPlayingAgent) for turn in range(0, 5): game.play_single_turn() for minion in game.other_player.minions: self.assertTrue(minion.frozen) self.assertFalse(game.other_player.hero.frozen) def test_Counterspell(self): game = generate_game_for(Counterspell, Frostbolt, SpellTestingAgent, SpellTestingAgent) for turn in range(0, 5): game.play_single_turn() self.assertEqual(1, len(game.current_player.secrets)) self.assertEqual("Counterspell", game.current_player.secrets[0].name) game.play_single_turn() self.assertFalse(game.other_player.hero.frozen) self.assertEqual(27, game.other_player.hero.health) # Ensure that secrets are being removed after being revealed self.assertEqual(0, len(game.other_player.secrets)) def test_IceBarrier(self): game = generate_game_for(IceBarrier, StonetuskBoar, SpellTestingAgent, PredictableBot) for turn in range(0, 5): game.play_single_turn() self.assertEqual(1, len(game.current_player.secrets)) self.assertEqual("Ice Barrier", game.current_player.secrets[0].name) game.play_single_turn() # only one minion because PredictableBot will shoot its own minions if there isn't anything else to shoot. self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(7, game.other_player.hero.armor) # Attacked twice on the first turn, then fireballed before getting the armor up self.assertEqual(27, game.other_player.hero.health) # Make sure we can't have two identical secrets at the same time random.seed(1857) game = generate_game_for(IceBarrier, StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 6): game.play_single_turn() self.assertEqual(1, len(game.other_player.secrets)) self.assertEqual("Ice Barrier", game.other_player.secrets[0].name) game.play_single_turn() self.assertEqual(1, len(game.current_player.secrets)) self.assertEqual("Ice Barrier", game.current_player.secrets[0].name) def test_IceBlock(self): game = generate_game_for(IceBlock, Frostbolt, SpellTestingAgent, SpellTestingAgent) for turn in range(0, 12): game.play_single_turn() self.assertEqual(game.other_player.hero.health, 3) self.assertEqual(1, len(game.other_player.secrets)) game.play_single_turn() game.play_single_turn() self.assertEqual(3, game.other_player.hero.health) self.assertEqual(0, len(game.other_player.secrets)) def test_MirrorEntity(self): game = generate_game_for([StonetuskBoar, MirrorEntity], IronfurGrizzly, SpellTestingAgent, MinionPlayingAgent) for turn in range(0, 5): game.play_single_turn() self.assertEqual(1, len(game.current_player.secrets)) self.assertEqual("Mirror Entity", game.current_player.secrets[0].name) game.play_single_turn() self.assertEqual(2, len(game.other_player.minions)) self.assertEqual("Ironfur Grizzly", game.other_player.minions[1].card.name) self.assertEqual(game.other_player, game.other_player.minions[1].player) self.assertEqual(1, game.other_player.minions[1].index) def test_Spellbender(self): game = generate_game_for([Spellbender, Wisp], Moonfire, SpellTestingAgent, SpellTestingAgent) for turn in range(0, 6): game.play_single_turn() # The moonfire should have been re-directed to the Spellbender, which should have taken one damage self.assertEqual(2, len(game.other_player.minions)) self.assertEqual(2, game.other_player.minions[1].health) self.assertEqual(1, game.other_player.minions[1].calculate_attack()) self.assertEqual("Spellbender", game.other_player.minions[1].card.name) # Now make sure it won't work when the hero is targeted random.seed(1857) game = generate_game_for(Spellbender, Moonfire, SpellTestingAgent, SpellTestingAgent) for turn in range(0, 6): game.play_single_turn() self.assertEqual(0, len(game.other_player.minions)) self.assertEqual(1, len(game.other_player.secrets)) self.assertEqual(23, game.other_player.hero.health) # Now make sure it doesn't activate when a non-targeted spell is used random.seed(1857) game = generate_game_for(Spellbender, ArcaneIntellect, SpellTestingAgent, SpellTestingAgent) for turn in range(0, 6): game.play_single_turn() # The arcane intellect should not have caused the Spellbender to activate self.assertEqual(0, len(game.other_player.minions)) self.assertEqual(1, len(game.other_player.secrets)) def test_Vaporize(self): game = generate_game_for(Vaporize, FaerieDragon, SpellTestingAgent, MinionAttackingAgent) for turn in range(0, 6): game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(0, len(game.other_player.secrets)) self.assertEqual(30, game.other_player.hero.health) random.seed(1857) game = generate_game_for(Vaporize, Swipe, SpellTestingAgent, PredictableBot) for turn in range(0, 6): game.play_single_turn() self.assertEqual(28, game.other_player.hero.health) self.assertEqual(1, len(game.other_player.secrets)) self.assertFalse(game.current_player.hero.dead) def test_KirinTorMage(self): game = generate_game_for([KirinTorMage, Vaporize, Spellbender], StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 5): game.play_single_turn() self.assertEqual(1, len(game.current_player.secrets)) self.assertEqual("Vaporize", game.current_player.secrets[0].name) self.assertEqual(1, len(game.current_player.minions)) self.assertEqual("Kirin Tor Mage", game.current_player.minions[0].card.name) self.assertEqual(3, game.current_player.hand[0].mana_cost(game.current_player)) self.assertEqual("Spellbender", game.current_player.hand[0].name) random.seed(1857) game = generate_game_for([KirinTorMage, Vaporize], StonetuskBoar, OneSpellTestingAgent, DoNothingBot) for turn in range(0, 5): game.play_single_turn() self.assertEqual(0, len(game.current_player.secrets)) self.assertEqual(1, len(game.current_player.minions)) self.assertEqual("Kirin Tor Mage", game.current_player.minions[0].card.name) self.assertEqual(3, game.current_player.hand[2].mana_cost(game.current_player)) self.assertEqual("Vaporize", game.current_player.hand[2].name) def test_EtherealArcanist(self): game = generate_game_for([Spellbender, EtherealArcanist], StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 6): game.play_single_turn() self.assertEqual(1, len(game.other_player.secrets)) game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(5, game.current_player.minions[0].calculate_attack()) self.assertEqual(5, game.current_player.minions[0].health) self.assertEqual(5, game.current_player.minions[0].calculate_max_health()) game.play_single_turn() game.play_single_turn() self.assertEqual(7, game.current_player.minions[0].calculate_attack()) self.assertEqual(7, game.current_player.minions[0].health) self.assertEqual(7, game.current_player.minions[0].calculate_max_health()) game.current_player.minions[0].silence() self.assertEqual(3, game.current_player.minions[0].calculate_attack()) self.assertEqual(3, game.current_player.minions[0].health) self.assertEqual(3, game.current_player.minions[0].calculate_max_health()) game.play_single_turn() game.play_single_turn() self.assertEqual(3, game.current_player.minions[0].calculate_attack()) self.assertEqual(3, game.current_player.minions[0].health) self.assertEqual(3, game.current_player.minions[0].calculate_max_health()) # Test when the player has no secrets at all random.seed(1857) game = generate_game_for(EtherealArcanist, StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 7): game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual(3, game.current_player.minions[0].calculate_attack()) self.assertEqual(3, game.current_player.minions[0].health) self.assertEqual(3, game.current_player.minions[0].calculate_max_health()) def test_ConeOfCold(self): game = generate_game_for(ConeOfCold, [StonetuskBoar, BloodfenRaptor, BloodfenRaptor], SpellTestingAgent, MinionPlayingAgent) for turn in range(0, 6): game.play_single_turn() self.assertEqual(3, len(game.current_player.minions)) game.play_single_turn() self.assertEqual(3, len(game.other_player.minions)) self.assertTrue(game.other_player.minions[0].frozen) self.assertEqual(1, game.other_player.minions[0].health) self.assertTrue(game.other_player.minions[1].frozen) self.assertEqual(1, game.other_player.minions[1].health) self.assertFalse(game.other_player.minions[2].frozen) self.assertEqual(1, game.other_player.minions[2].health) self.assertEqual(30, game.other_player.hero.health) # Now check to ensure that it will work when targeting the other end of the minion list game.current_player.agent.choose_target = lambda targets: targets[len(targets) - 1] game.play_single_turn() game.play_single_turn() # Neither of the minions which survive Cone of Cold will be frozen, since they weren't touched this round self.assertEqual(2, len(game.other_player.minions)) self.assertFalse(game.other_player.minions[0].frozen) self.assertFalse(game.other_player.minions[1].frozen) def test_Fireball(self): game = generate_game_for([Fireball, KoboldGeomancer], StonetuskBoar, EnemySpellTestingAgent, DoNothingBot) for turn in range(0, 7): game.play_single_turn() self.assertEqual(24, game.other_player.hero.health) for turn in range(0, 4): game.play_single_turn() self.assertEqual(17, game.other_player.hero.health) def test_Polymorph(self): game = generate_game_for(MogushanWarden, Polymorph, MinionPlayingAgent, SpellTestingAgent) for turn in range(0, 7): game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertTrue(game.current_player.minions[0].taunt) self.assertEqual(1, game.current_player.minions[0].calculate_attack()) self.assertEqual(7, game.current_player.minions[0].health) self.assertEqual("Mogu'shan Warden", game.current_player.minions[0].card.name) game.play_single_turn() self.assertEqual(1, len(game.other_player.minions)) self.assertFalse(game.other_player.minions[0].taunt) self.assertEqual(1, game.other_player.minions[0].calculate_attack()) self.assertEqual(1, game.other_player.minions[0].health) self.assertEqual("Sheep", game.other_player.minions[0].card.name) self.assertEqual(MINION_TYPE.BEAST, game.other_player.minions[0].card.minion_type) def test_Blizzard(self): game = generate_game_for(Blizzard, MogushanWarden, SpellTestingAgent, MinionPlayingAgent) for turn in range(0, 10): game.play_single_turn() self.assertEqual(2, len(game.current_player.minions)) self.assertEqual(7, game.current_player.minions[0].health) self.assertEqual(7, game.current_player.minions[1].health) self.assertFalse(game.current_player.minions[0].frozen) self.assertFalse(game.current_player.minions[1].frozen) game.play_single_turn() self.assertEqual(2, len(game.other_player.minions)) self.assertEqual(5, game.other_player.minions[0].health) self.assertEqual(5, game.other_player.minions[1].health) self.assertTrue(game.other_player.minions[0].frozen) self.assertTrue(game.other_player.minions[1].frozen) def test_Flamestrike(self): game = generate_game_for(Flamestrike, MogushanWarden, SpellTestingAgent, MinionPlayingAgent) for turn in range(0, 12): game.play_single_turn() self.assertEqual(3, len(game.current_player.minions)) self.assertEqual(7, game.current_player.minions[0].health) self.assertEqual(7, game.current_player.minions[1].health) self.assertEqual(7, game.current_player.minions[2].health) game.play_single_turn() self.assertEqual(3, len(game.other_player.minions)) self.assertEqual(3, game.other_player.minions[0].health) self.assertEqual(3, game.other_player.minions[1].health) self.assertEqual(3, game.other_player.minions[2].health) def test_Pyroblast(self): game = generate_game_for(Pyroblast, StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 18): game.play_single_turn() self.assertEqual(30, game.current_player.hero.health) game.play_single_turn() self.assertEqual(20, game.other_player.hero.health) def test_ArchmageAntonidas(self): game = generate_game_for([ArchmageAntonidas, Vaporize], StonetuskBoar, SpellTestingAgent, DoNothingBot) for turn in range(0, 12): game.play_single_turn() game.play_single_turn() self.assertEqual(1, len(game.current_player.minions)) self.assertEqual("Archmage Antonidas", game.current_player.minions[0].card.name) game.play_single_turn() game.play_single_turn() self.assertEqual("Fireball", game.current_player.hand[9].name) def test_Duplicate(self): game = generate_game_for([BloodfenRaptor, Duplicate], ShadowBolt, MinionPlayingAgent, SpellTestingAgent) for turn in range(0, 6): game.play_single_turn() self.assertEqual(6, len(game.other_player.hand)) self.assertEqual("Bloodfen Raptor", game.other_player.hand[4].name) self.assertEqual("Bloodfen Raptor", game.other_player.hand[5].name) self.assertEqual(0, len(game.other_player.secrets))
44.432099
119
0.70083
3,141
25,193
5.450175
0.089462
0.157719
0.116187
0.117764
0.805596
0.767276
0.721187
0.647468
0.557042
0.52357
0
0.019459
0.192196
25,193
566
120
44.510601
0.821729
0.053428
0
0.594203
0
0
0.015067
0.002434
0
0
0
0
0.502415
1
0.067633
false
0
0.021739
0
0.094203
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
259da6c64ac806012f0b308f19a707a26b2be6eb
47
py
Python
jft/logging.py
isimluk/jft
998a6d4248f6b4757f9e0cb281c9b2cb51d3558f
[ "Unlicense" ]
null
null
null
jft/logging.py
isimluk/jft
998a6d4248f6b4757f9e0cb281c9b2cb51d3558f
[ "Unlicense" ]
null
null
null
jft/logging.py
isimluk/jft
998a6d4248f6b4757f9e0cb281c9b2cb51d3558f
[ "Unlicense" ]
null
null
null
import logging log = logging.getLogger('jft')
11.75
30
0.744681
6
47
5.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.12766
47
3
31
15.666667
0.853659
0
0
0
0
0
0.06383
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
25a4569db126eb31566e1a305c3cebfc3b1fe76b
10,974
py
Python
__init__.py
Nadro-J/FoldingAtHome_front-end
a169b21c158876421ba94e609b8d6c5a3f4a4878
[ "MIT" ]
1
2021-05-21T17:51:36.000Z
2021-05-21T17:51:36.000Z
__init__.py
bitgreen/FatH-frontend
a169b21c158876421ba94e609b8d6c5a3f4a4878
[ "MIT" ]
null
null
null
__init__.py
bitgreen/FatH-frontend
a169b21c158876421ba94e609b8d6c5a3f4a4878
[ "MIT" ]
null
null
null
from flask import Flask, render_template from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import func from sqlalchemy.sql import desc from flask import Flask, jsonify from datetime import timedelta from flask import Response import json from cryptography.fernet import Fernet import os root_path = os.path.dirname(os.path.realpath(__file__)) class Cryptography: def __init__(self, public_key): self.public_key = public_key def decrypt_pubkey(self): try: with open(f"/{os.path.dirname(os.path.realpath(__file__))}/WPK.key") as key: private_key = Fernet(key.readline().encode('utf-8')) string = private_key.decrypt(self.public_key.encode("utf-8")) return string.decode("utf-8") except Exception as decrypt_error: return decrypt_error app = Flask(__name__) with open(f"/{os.path.dirname(os.path.realpath(__file__))}/config.json") as config: config = json.load(config) sql_server = Cryptography(config['sql-connection']) app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_DATABASE_URI'] = sql_server.decrypt_pubkey() db = SQLAlchemy(app) # transaction SQL table class transaction_audit(db.Model): txid = db.Column(db.String(125), primary_key=True) transacted = db.Column(db.String(125), unique=False) total_workers = db.Column(db.String(125), unique=False) timestamp = db.Column(db.String(125), unique=False) class fath_team_stats(db.Model): wus = db.Column(db.String(125), primary_key=True) rank = db.Column(db.String(125), unique=False) active_50 = db.Column(db.String(125), unique=False) lastupdate = db.Column(db.String(125), unique=False) class fath_team_stats_detailed(db.Model): rank = db.Column(db.String(125), primary_key=True) active_users = db.Column(db.String(125), unique=False) total_users = db.Column(db.String(125), unique=False) change_rank_24hr = db.Column(db.String(125), unique=False) points_24hr_avg = db.Column(db.String(125), unique=False) points_last_24hr = db.Column(db.String(125), unique=False) points_update = db.Column(db.String(125), unique=False) points_today = db.Column(db.String(125), unique=False) points_week = db.Column(db.String(125), unique=False) timestamp = db.Column(db.String(125), unique=False) @app.route('/') def index(): team_stats = fath_team_stats.query.order_by(fath_team_stats.lastupdate.desc()).first() team_stats_detailed = fath_team_stats_detailed.query.order_by(fath_team_stats_detailed.timestamp.desc()).first() # Team stats (used to calculate the different between the last stats = fath_team_stats.query.with_entities( fath_team_stats.lastupdate.distinct().label("lastupdate"), # 0 fath_team_stats.wus, # 1 fath_team_stats.rank, # 2 fath_team_stats.active_50 # 3 )\ .order_by(fath_team_stats.lastupdate.desc())\ .limit(2)\ .all() detailed_stats = fath_team_stats_detailed.query.with_entities( fath_team_stats_detailed.timestamp.distinct().label("timestamp"), # 0 fath_team_stats_detailed.active_users # 1 )\ .order_by(fath_team_stats_detailed.timestamp.desc())\ .limit(2)\ .all() wus_diff = stats[0][1] - stats[1][1] active_user_diff = detailed_stats[0][1] - detailed_stats[1][1] # Dates timestamp = transaction_audit.query.order_by(transaction_audit.timestamp.desc()).first() yesterday = timestamp.timestamp - timedelta(days=1) # All transactions that have happened in the last 24hrs _24hr_txs = transaction_audit.query.filter( transaction_audit.timestamp > yesterday ).order_by( transaction_audit.timestamp.desc()) # Calculate 24hrs volume (to be changes into sqlalchemy query) n = 0 for i in _24hr_txs: n = n + i.transacted # Total amount of BitGreen distributed since the beginning total_distributed = transaction_audit.query.with_entities( func.sum(transaction_audit.transacted).label("total") ).first() return render_template("index.html", sum='{0:,.2f}'.format(n), transacted='{0:,.2f}'.format(total_distributed.total), work_units='{:,}'.format(team_stats.wus), wus_diff = wus_diff, active_workers=team_stats_detailed.active_users, active_workers_diff=active_user_diff ) @app.route('/folding') def transactions(): ''' Populates transactions.html with data Returns: The last 24hrs of transactions carried out by the controller. ''' team_stats = fath_team_stats.query.order_by(fath_team_stats.lastupdate.desc()).first() team_stats_detailed = fath_team_stats_detailed.query.order_by(fath_team_stats_detailed.timestamp.desc()).first() # Total amount of BitGreen distributed since the beginning total_distributed = transaction_audit.query.with_entities( func.sum(transaction_audit.transacted).label("total") ).first() # Team stats (used to calculate the different between the last stats = fath_team_stats.query.with_entities( fath_team_stats.lastupdate.distinct().label("lastupdate"), # 0 fath_team_stats.wus, # 1 fath_team_stats.rank, # 2 fath_team_stats.active_50 # 3 )\ .order_by(fath_team_stats.lastupdate.desc())\ .limit(2)\ .all() detailed_stats = fath_team_stats_detailed.query.with_entities( fath_team_stats_detailed.timestamp.distinct().label("timestamp"), # 0 fath_team_stats_detailed.active_users # 1 )\ .order_by(fath_team_stats_detailed.timestamp.desc())\ .limit(2)\ .all() rank_diff = stats[1][2] - stats[0][2] wus_diff = stats[0][1] - stats[1][1] active_user_diff = detailed_stats[0][1] - detailed_stats[1][1] # Dates timestamp = transaction_audit.query.order_by(transaction_audit.timestamp.desc()).first() yesterday = timestamp.timestamp - timedelta(days=1) # All transactions that have happened in the last 24hrs _24hr_txs = transaction_audit.query.filter( transaction_audit.timestamp > yesterday ).order_by( transaction_audit.timestamp.desc()) # Calculate 24hrs volume (to be changes into sqlalchemy query) n = 0 for i in _24hr_txs: n = n + i.transacted return render_template("folding.html", wallet_txs=_24hr_txs, sum='{0:,.2f}'.format(n), work_units='{:,}'.format(team_stats.wus), team_rank=team_stats.rank, transacted='{0:,.2f}'.format(total_distributed.total), rank_diff=rank_diff, wus_diff=wus_diff, active_workers=team_stats_detailed.active_users, active_workers_diff=active_user_diff ) @app.route('/help') def help(): return render_template("help.html") @app.route('/faq') def faq(): return render_template("faq.html") ## Generate .CSV outout for user to download @app.route('/fah_transactions_7Days.csv') def generate_7days_csv(): ''' Generate .csv file for user to download Returns: The last 7 days of transactions carried out by the controller. ''' def generate(): latest_timestamp = transaction_audit.query.order_by(transaction_audit.timestamp.desc()).first() yesterday = latest_timestamp.timestamp - timedelta(days=7) _7day_txs = transaction_audit.query.filter(transaction_audit.timestamp > yesterday).order_by( transaction_audit.timestamp.desc()) yield ','.join(['txid', 'transacted', 'total_workers', 'timestamp']) + '\n' for row in _7day_txs: yield ','.join([str(row.txid), str(row.transacted), str(row.total_workers), str(row.timestamp)]) + '\n' return Response(generate(), mimetype='text/csv') @app.route('/fah_transactions_14Days.csv') def generate_14days_csv(): ''' Generate .csv file for user to download Returns: The last 7 days of transactions carried out by the controller. ''' def generate(): latest_timestamp = transaction_audit.query.order_by(transaction_audit.timestamp.desc()).first() yesterday = latest_timestamp.timestamp - timedelta(days=14) _14day_txs = transaction_audit.query.filter(transaction_audit.timestamp > yesterday).order_by( transaction_audit.timestamp.desc()) yield ','.join(['txid', 'transacted', 'total_workers', 'timestamp']) + '\n' for row in _14day_txs: yield ','.join([str(row.txid), str(row.transacted), str(row.total_workers), str(row.timestamp)]) + '\n' return Response(generate(), mimetype='text/csv') @app.route('/fah_transactions_1Month.csv') def generate_1month_csv(): ''' Generate .csv file for user to download Returns: The last 31 days of transactions carried out by the controller. ''' def generate(): latest_timestamp = transaction_audit.query.order_by(transaction_audit.timestamp.desc()).first() yesterday = latest_timestamp.timestamp - timedelta(days=31) _1month_txs = transaction_audit.query.filter(transaction_audit.timestamp > yesterday).order_by(transaction_audit.timestamp.desc()) yield ','.join(['txid', 'transacted', 'total_workers', 'timestamp']) + '\n' for row in _1month_txs: yield ','.join([str(row.txid), str(row.transacted), str(row.total_workers), str(row.timestamp)]) + '\n' return Response(generate(), mimetype='text/csv') if __name__ == '__main__': # Method to be implemented into the back-end which will deprecate the use of psycopg2 # in favor of flask_sqlalchemy. # > postgresql://USERNAME:PASSWORD@SQLSERVER:5432/DATABASE app.run(host='0.0.0.0')
41.411321
139
0.613541
1,278
10,974
5.035994
0.151017
0.057334
0.060597
0.044748
0.767091
0.763052
0.753418
0.720789
0.671535
0.659105
0
0.021534
0.276381
10,974
264
140
41.568182
0.788943
0.109987
0
0.533708
0
0
0.06256
0.026431
0
0
0
0
0
1
0.067416
false
0
0.05618
0.011236
0.297753
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
25aa86e5de37667e6abea2251b434b40ddad7856
86
py
Python
sn_server/sn_api/apps.py
Sunkek/DreamTeam-Test-Assignment
d4655f5a6361dc783d8be793c47e9cb18cb5b30a
[ "MIT" ]
null
null
null
sn_server/sn_api/apps.py
Sunkek/DreamTeam-Test-Assignment
d4655f5a6361dc783d8be793c47e9cb18cb5b30a
[ "MIT" ]
2
2021-03-30T12:41:36.000Z
2021-06-04T22:23:09.000Z
sn_server/sn_api/apps.py
Sunkek/DreamTeam-Test-Assignment
d4655f5a6361dc783d8be793c47e9cb18cb5b30a
[ "MIT" ]
null
null
null
from django.apps import AppConfig class SnApiConfig(AppConfig): name = 'sn_api'
14.333333
33
0.744186
11
86
5.727273
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.174419
86
5
34
17.2
0.887324
0
0
0
0
0
0.069767
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
25b563824dee77df09caae05c3c22f9617e231a9
9,912
py
Python
trab1.py
andreus89/trabalho_python1
2b6be54076b7984da54db1c624e078d651ba5b91
[ "Apache-2.0" ]
null
null
null
trab1.py
andreus89/trabalho_python1
2b6be54076b7984da54db1c624e078d651ba5b91
[ "Apache-2.0" ]
null
null
null
trab1.py
andreus89/trabalho_python1
2b6be54076b7984da54db1c624e078d651ba5b91
[ "Apache-2.0" ]
null
null
null
import sys import matplotlib.pyplot as plt import numpy as np def isReal(txt): try: float(txt) return True except ValueError: return False #dicionários med_dic={1:{'ID':1,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 2:{'ID':2,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 3:{'ID':3,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 4:{'ID':4,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 5:{'ID':5,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 6:{'ID':6,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 7:{'ID':7,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 8:{'ID':8,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 9:{'ID':9,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}}, 10:{'ID':10,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de comprimidos por embalagem':0,'Preço da embalagem em 3 fornecedores':{'A':0,'B':0,'C':0},'Quantidade do composto principal por comprimido':0,'Dose diária para um adulto':0,'As 3 reações adversa mais comuns':{'A':0,'B':0,'C':0}} } #listas nc_list=[] cp_list=[] fq_list=[] mde_list=[] nce_list=[] pef_list=[] mpef_list=[] qcc_list=[] dda_list=[] rac_list=[] mqcc_list=[] #input for i in range(1,11): while True: med_dic[i]['Nome Comercial']=(input('Nome Comercial?')) nc_list.append(med_dic[i]['Nome Comercial']) nc=med_dic[i]['Nome Comercial'] if nc == "exit": sys.exit('Parada abrupta do programa!') elif nc.isalpha(): break print("Valor inválido!") while True: med_dic[i]['Composto principal']=input('Composto principal?') cp_list.append(med_dic[i]['Composto principal']) cp=med_dic[i]['Composto principal'] if cp == "exit": sys.exit('Parada abrupta do programa!') elif cp.isalpha(): break print("Valor inválido!") while True: med_dic[i]['Fórmula Química']=input('Fórmula Química?') fq_list.append(med_dic[i]['Fórmula Química']) fq=med_dic[i]['Fórmula Química'] if fq == "exit": sys.exit('Parada abrupta do programa!') elif fq.isalnum(): break print("Valor inválido!") while True: med_dic[i]['Meia-vida de eliminação']=input('Meia-vida de eliminação (horas)?') mde_list.append(med_dic[i]['Meia-vida de eliminação']) mde=med_dic[i]['Meia-vida de eliminação'] if mde == "exit": sys.exit('Parada abrupta do programa!') elif mde.isdigit(): break print("Valor inválido!") while True: med_dic[i]['Número de comprimidos por embalagem']=input('Número de comprimidos por embalagem?') nce_list.append(med_dic[i]['Número de comprimidos por embalagem']) nce=med_dic[i]['Número de comprimidos por embalagem'] if nce == "exit": sys.exit('Parada abrupta do programa!') elif nce.isdigit(): break print("Valor inválido!") while True: try: med_dic[i]['Preço da embalagem em 3 fornecedores']['A']=float(input('Preço da embalagem em 3 fornecedores? Embalagem A: R$')) a=med_dic[i]['Preço da embalagem em 3 fornecedores']['A'] break except ValueError: print("Valor inválido!") continue while True: try: med_dic[i]['Preço da embalagem em 3 fornecedores']['B']=float(input('Preço da embalagem em 3 fornecedores? Embalagem B: R$')) b=med_dic[i]['Preço da embalagem em 3 fornecedores']['B'] break except ValueError: print("Valor inválido!") continue while True: try: med_dic[i]['Preço da embalagem em 3 fornecedores']['C']=float(input('Preço da embalagem em 3 fornecedores? Embalagem C: R$')) c=med_dic[i]['Preço da embalagem em 3 fornecedores']['C'] break except ValueError: print("Valor inválido!") continue mpef=(a+b+c)/3 mpef_list.append(mpef) while True: try: med_dic[i]['Quantidade do composto principal por comprimido']=float(input('Quantidade do composto principal por comprimido?(em mg)')) qcc_list.append(med_dic[i]['Quantidade do composto principal por comprimido']) qcc=med_dic[i]['Quantidade do composto principal por comprimido'] break except ValueError: print("Valor inválido!") continue mqcc=mpef/qcc mqcc_list.append(mqcc) while True: med_dic[i]['Dose diária para um adulto']=input('Dose diária para um adulto?(em mg)') dda_list.append(med_dic[i]['Dose diária para um adulto']) dda=med_dic[i]['Dose diária para um adulto'] if dda == "exit": sys.exit('Parada abrupta do programa!') elif isReal(dda): break print("Valor inválido!") while True: med_dic[i]['As 3 reações adversa mais comuns']['A']=input('As 3 reações adversas mais comuns? Reação A: ') a=med_dic[i]['As 3 reações adversa mais comuns']['A'] if a == "exit": sys.exit('Parada abrupta do programa!') elif a.isalpha(): break print("Valor inválido!") while True: med_dic[i]['As 3 reações adversa mais comuns']['B']=input('As 3 reações adversas mais comuns? Reação B: ') b=med_dic[i]['As 3 reações adversa mais comuns']['B'] if b == "exit": sys.exit('Parada abrupta do programa!') elif b.isalpha(): break print("Valor inválido!") while True: med_dic[i]['As 3 reações adversa mais comuns']['C']=input('As 3 reações adversas mais comuns? Reação C: ') c=med_dic[i]['As 3 reações adversa mais comuns']['C'] if c == "exit": sys.exit('Parada abrupta do programa!') elif c.isalpha(): break print("Valor inválido!") rac_list.append(med_dic[i]['As 3 reações adversa mais comuns']) if i==10: break else: continuar=input("Digite 'p' para parar: ") if continuar == "p": break #gráfico 1 fig, ax = plt.subplots() index = np.arange(i) bar_width = 0.15 opacity = 0.8 rects1 = plt.bar(index, mpef_list, bar_width, alpha=opacity, color='r', label='Média de Preço') plt.xlabel('Medicamentos') plt.ylabel('Reais(R$)') plt.title('Valores por Medicamento') plt.xticks(index, (nc_list)) plt.legend() plt.tight_layout() plt.show() #gráfico 2 fig1, ax1 = plt.subplots() index = np.arange(i) bar_width = 0.15 opacity = 0.8 rects1 = plt.bar(index, mqcc_list, bar_width, alpha=opacity, color='r', label='Média por 1 mg') plt.xlabel('Medicamentos') plt.ylabel('Reais(R$)') plt.title('Média de Preço por Miligramas do Componente Principal') plt.xticks(index, (nc_list)) plt.legend() plt.tight_layout() plt.show()
44.850679
348
0.607143
1,415
9,912
4.20636
0.100353
0.035282
0.039987
0.013441
0.876512
0.820901
0.805612
0.771169
0.661458
0.564516
0
0.028378
0.239205
9,912
220
349
45.054545
0.760907
0.004036
0
0.467391
0
0
0.484399
0
0
0
0
0
0
1
0.005435
false
0
0.016304
0
0.032609
0.070652
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
25bc530544cc6d58b13e441ba2e6d567142e49fd
132
py
Python
src/conquista/admin.py
roginaldosemog/unbind
ab3e43aa03f49ba00fc048fa0846e8bf9d533961
[ "MIT" ]
null
null
null
src/conquista/admin.py
roginaldosemog/unbind
ab3e43aa03f49ba00fc048fa0846e8bf9d533961
[ "MIT" ]
93
2019-04-05T12:15:34.000Z
2022-03-11T23:47:11.000Z
src/conquista/admin.py
roginaldosemog/unbind
ab3e43aa03f49ba00fc048fa0846e8bf9d533961
[ "MIT" ]
6
2019-04-16T02:07:52.000Z
2019-09-20T22:53:59.000Z
from django.contrib import admin from conquista.models import Conquista # Register your models here. admin.site.register(Conquista)
26.4
38
0.833333
18
132
6.111111
0.611111
0
0
0
0
0
0
0
0
0
0
0
0.106061
132
4
39
33
0.932203
0.19697
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
25d6637d9fc639ed48a93f6d3e2bb4953493b1bf
1,244
py
Python
app/__init__.py
ExiledNarwal28/glo-2005-project
3b5b5f9cdcfe53d1e6e702609587068c4bd3310d
[ "MIT" ]
null
null
null
app/__init__.py
ExiledNarwal28/glo-2005-project
3b5b5f9cdcfe53d1e6e702609587068c4bd3310d
[ "MIT" ]
null
null
null
app/__init__.py
ExiledNarwal28/glo-2005-project
3b5b5f9cdcfe53d1e6e702609587068c4bd3310d
[ "MIT" ]
1
2020-05-21T10:07:07.000Z
2020-05-21T10:07:07.000Z
from flask import Flask, render_template from flask_bcrypt import Bcrypt from flask_bootstrap import Bootstrap from flask_cors import CORS from app.admin.ui.views import admin_blueprint from app.auth.ui.views import auth_blueprint from app.equipments.ui.views import equipment_blueprint from app.practice_centers.ui.views import practice_center_blueprint from app.search.ui.views import search_blueprint from app.shops.ui.views import shop_blueprint from app.sports.ui.views import sport_blueprint from app.users.ui.views import user_blueprint app = Flask(__name__, instance_relative_config=True) app.config.from_pyfile('flask.cfg') bcrypt = Bcrypt(app) cors = CORS(app, resources={r"/*": {"origins": "*"}}) Bootstrap(app) app.register_blueprint(admin_blueprint) app.register_blueprint(search_blueprint) app.register_blueprint(sport_blueprint) app.register_blueprint(practice_center_blueprint) app.register_blueprint(shop_blueprint) app.register_blueprint(equipment_blueprint) app.register_blueprint(user_blueprint) app.register_blueprint(auth_blueprint) @app.errorhandler(400) def page_bad_request(): return render_template('400.html'), 400 @app.errorhandler(404) def page_not_found(): return render_template('404.html'), 404
30.341463
67
0.828778
178
1,244
5.544944
0.269663
0.109422
0.10537
0.205674
0
0
0
0
0
0
0
0.015748
0.08119
1,244
40
68
31.1
0.847769
0
0
0
0
0
0.028135
0
0
0
0
0
0
1
0.064516
false
0
0.387097
0.064516
0.516129
0.516129
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
1
0
4
d34a7f61f5e56ecdf5e3577612662f4a7232f632
933
py
Python
fjord/base.py
dkuntz2/fjord
f38cc6e5e07c0f479b3589dbf7a2056c3f77b0a1
[ "BSD-3-Clause" ]
null
null
null
fjord/base.py
dkuntz2/fjord
f38cc6e5e07c0f479b3589dbf7a2056c3f77b0a1
[ "BSD-3-Clause" ]
null
null
null
fjord/base.py
dkuntz2/fjord
f38cc6e5e07c0f479b3589dbf7a2056c3f77b0a1
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals class Parser(object): def __init__(self, options): self.options = options self.setup() def parse(self, content): raise NotImplementedError('A parser must implement parse.') def setup(self): pass class Renderer(object): def __init__(self, path, options, globals_ = {}): self.path = path self.options = options self.globals = globals_ self.setup() def from_string(self, source, vars_ = {}): raise NotImplementedError('A renderer must implement from_string.') def register(self, key, value): raise NotImplementedError('A renderer must implement register.') def render(self, template, vars_ = {}): raise NotImplementedError('A renderer must implement render.') def setup(self): pass
23.923077
75
0.604502
97
933
5.618557
0.360825
0.176147
0.183486
0.181651
0.26789
0.26789
0.183486
0
0
0
0
0.001522
0.29582
933
38
76
24.552632
0.828006
0.022508
0
0.347826
0
0
0.149451
0
0
0
0
0
0
1
0.347826
false
0.086957
0.043478
0
0.478261
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
d3540cd1db3adb2b6d831630883c8e39c67f6829
1,020
py
Python
ETC/__init__.py
pranaysy/ETCPy
d08c50ae5e379ee11cc9d9eb076ae4319516314c
[ "Apache-2.0" ]
10
2020-07-30T12:03:24.000Z
2022-02-14T17:45:29.000Z
ETC/__init__.py
HarikrishnanNB/ETCPy
afb476629c5cd858fdc8bcbbab23d74efe18c871
[ "Apache-2.0" ]
null
null
null
ETC/__init__.py
HarikrishnanNB/ETCPy
afb476629c5cd858fdc8bcbbab23d74efe18c871
[ "Apache-2.0" ]
2
2021-02-18T07:20:34.000Z
2021-03-15T04:10:33.000Z
# -*- coding: utf-8 -*- __import__("pkg_resources").declare_namespace(__name__) from ETC.seq.IO import read, save from ETC.seq.process import generate, entropy from ETC.seq.recode import cast, recode_lexical, partition, partition_numpy from ETC.seq import check from ETC.NSRWS.x1D.etc import compute as compute_1D # from ETC.NSRWS.x1D.etc import compute_save as compute_save_1D # from ETC.NSRWS.x1D.onestep import onestep as onestep_1D from ETC.NSRWS.x2D.etc import compute as compute_2D # from ETC.NSRWS.x2D.etc import compute_save as compute_save_2D # from ETC.NSRWS.x2D.onestep import onestep as onestep_2D # from ETC.CCC.compute_CCC import compute as compute_CCC from ETC.NSRWS.x1D.parallel import ( pcompute_multiple_seq, pcompute_single, pcompute_files, pcompute_numpy, ) from ETC.LZ76.lzc import compute_complexity as LZC from ETC.CCMC.pairs import CCM_causality from ETC.CCMC.pairs_parallel import parallelized as CCM_causality_parallel from ETC.CCMC.pairs_parallel import get_rowpairs
30
75
0.804902
163
1,020
4.815951
0.294479
0.142675
0.107006
0.076433
0.42293
0.277707
0.201274
0
0
0
0
0.017957
0.126471
1,020
33
76
30.909091
0.863075
0.305882
0
0
1
0
0.018545
0
0
0
0
0
0
1
0
true
0
0.705882
0
0.705882
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
d36580ec16c0e2255ab2c3365c2fc7c36732b291
65
py
Python
georiviere/watershed/__init__.py
Georiviere/Georiviere-admin
f59e1b979a758958a64899916b8b72d580128ee9
[ "BSD-2-Clause" ]
7
2021-11-05T14:52:25.000Z
2022-03-24T21:18:02.000Z
georiviere/watershed/__init__.py
Georiviere/Georiviere-admin
f59e1b979a758958a64899916b8b72d580128ee9
[ "BSD-2-Clause" ]
57
2021-11-02T10:27:34.000Z
2022-03-31T14:08:32.000Z
georiviere/watershed/__init__.py
Georiviere/Georiviere-admin
f59e1b979a758958a64899916b8b72d580128ee9
[ "BSD-2-Clause" ]
1
2021-12-05T14:55:42.000Z
2021-12-05T14:55:42.000Z
default_app_config = 'georiviere.watershed.apps.WatershedConfig'
32.5
64
0.861538
7
65
7.714286
1
0
0
0
0
0
0
0
0
0
0
0
0.046154
65
1
65
65
0.870968
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
d37910fc6d6bf63a4018cec728dbb5b588740664
92
py
Python
problem/10000~19999/13241/13241.py3.py
njw1204/BOJ-AC
1de41685725ae4657a7ff94e413febd97a888567
[ "MIT" ]
1
2019-04-19T16:37:44.000Z
2019-04-19T16:37:44.000Z
problem/10000~19999/13241/13241.py3.py
njw1204/BOJ-AC
1de41685725ae4657a7ff94e413febd97a888567
[ "MIT" ]
1
2019-04-20T11:42:44.000Z
2019-04-20T11:42:44.000Z
problem/10000~19999/13241/13241.py3.py
njw1204/BOJ-AC
1de41685725ae4657a7ff94e413febd97a888567
[ "MIT" ]
3
2019-04-19T16:37:47.000Z
2021-10-25T00:45:00.000Z
def gcd(a,b):return gcd(b,a%b) if b else a a,b=map(int,input().split()) print(a*b//gcd(a,b))
30.666667
42
0.630435
25
92
2.32
0.48
0.172414
0.172414
0
0
0
0
0
0
0
0
0
0.086957
92
3
43
30.666667
0.690476
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
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
1
0
0
0
1
0
0
0
4
d379df31d175aa28fbc1b52b378668c20b634606
145
py
Python
{{cookiecutter.project_slug}}/config.py
bmwant/templio
002c3b0cb81bdc02df52eeb7224ae8b27cde6ca4
[ "Unlicense" ]
3
2018-03-03T13:50:39.000Z
2018-04-04T22:00:57.000Z
{{cookiecutter.project_slug}}/config.py
bmwant/templio
002c3b0cb81bdc02df52eeb7224ae8b27cde6ca4
[ "Unlicense" ]
null
null
null
{{cookiecutter.project_slug}}/config.py
bmwant/templio
002c3b0cb81bdc02df52eeb7224ae8b27cde6ca4
[ "Unlicense" ]
null
null
null
import os from pathlib import Path PROJECT_ROOT = Path(os.path.dirname(os.path.realpath(__file__))) TEMPLATES_DIR = PROJECT_ROOT / 'templates'
20.714286
64
0.786207
21
145
5.095238
0.571429
0.205607
0
0
0
0
0
0
0
0
0
0
0.110345
145
6
65
24.166667
0.829457
0
0
0
0
0
0.062069
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
d37f6e3665927ed5d709f756572c75eb08221908
400
py
Python
acoular/version.py
ishine/acoular
4d790517adb38dc012b1f06966262b94f3625358
[ "BSD-3-Clause" ]
294
2015-03-24T09:19:12.000Z
2022-03-11T02:59:11.000Z
acoular/version.py
ishine/acoular
4d790517adb38dc012b1f06966262b94f3625358
[ "BSD-3-Clause" ]
45
2015-11-06T15:15:22.000Z
2022-03-18T07:05:30.000Z
acoular/version.py
ishine/acoular
4d790517adb38dc012b1f06966262b94f3625358
[ "BSD-3-Clause" ]
100
2015-05-05T15:18:57.000Z
2022-03-21T09:48:05.000Z
# coding=UTF-8 #------------------------------------------------------------------------------ # Copyright (c) 2007-2021, Acoular Development Team. #------------------------------------------------------------------------------ # separate file to find out about version without importing the acoular lib __author__ = "Acoular Development Team" __date__ = "5 May 2021" __version__ = "21.05"
40
80
0.4375
33
400
4.939394
0.818182
0.220859
0.269939
0
0
0
0
0
0
0
0
0.050992
0.1175
400
9
81
44.444444
0.410765
0.7325
0
0
0
0
0.423913
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
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
d394390009f57ae75a1d1d1fbaf9c9228a1deb71
4,244
py
Python
analysis/getCntgRegions.py
dnolivieri/MResVgene
08d5cc2368b051ab64ac593b8ebb1b725265f30a
[ "MIT" ]
null
null
null
analysis/getCntgRegions.py
dnolivieri/MResVgene
08d5cc2368b051ab64ac593b8ebb1b725265f30a
[ "MIT" ]
null
null
null
analysis/getCntgRegions.py
dnolivieri/MResVgene
08d5cc2368b051ab64ac593b8ebb1b725265f30a
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ dnolivieri: updated ...15 marzo 2015 - get the regions from huge scaffolds. """ import collections import numpy as np import matplotlib.pyplot as plt import time import os, fnmatch import sys import itertools from operator import itemgetter, attrgetter import math from Bio import SeqIO from Bio import Seq from Bio.SeqRecord import SeqRecord from Bio.Alphabet import IUPAC from scipy import * import struct import re import json import cPickle as pickle from copy import deepcopy import timeit import operator class getCntgRegions: def __init__(self, S): self.S = S def get_region(self, fbar): outfile = fbar.replace(".fasta", "4.fasta") ofile = open(outfile, "w") Sbar = [ k for k in self.S.iterkeys() ] for record in SeqIO.parse(fbar, "fasta"): rec_desc = record.description cntg= rec_desc.split(":")[3] print cntg if cntg in Sbar: print cntg, rec_desc for j in range(len(S[cntg]) ): q0 = S[cntg][j][0] q1 = S[cntg][j][1] print cntg, j, q0, q1 seq= record.seq[q0:q1] recordB=SeqRecord(seq, id = cntg +"_"+str(j), description=record.description ) ofile.write(recordB.format("fasta")) ofile.close() #------------------- if __name__ == '__main__': ### For the reduced study of genes that didn't come out....17march infile="./MacacaMstudy/Macaca_mulatta_MMUL1_r.fasta" """ S = { '1099214732309':[[1450,1850]], '7':[[1263900, 1264300], [987200, 987600], [376200, 376600], [839300, 839700] ], '3':[[849120,849520], [874900,875300] ] } """ S = {'7':[ [376200, 376600]]} M = getCntgRegions(S) M.get_region(infile) """ def get_max( x ): s = list(itertools.chain.from_iterable(x)) s.sort() return np.array(s) res=[] S1=[[238,537]] res.append( ('1099214757507', 0, 5000) ) S2=[[797,1845]] res.append( ('1099214148171', 0, 5000) ) S3=[[700393,701553], [654699,654992], [187218,187895] ] x = get_max(S3) res.append( ('1099548049584', 0, np.max(x)+500000) ) print np.abs(np.min(x)-500000- np.max(x)+500000) S4=[[627,1136]] res.append( ('1099214128018', 0, 30000) ) S5=[[1261,1818]] res.append( ('1099214732309', 0, 30000) ) Chr10=[ [66038886,66039290], [66222287,66222580], [66252992,66253527], [66335879,66336272], [66226801,66227112], [65906638,65906946], [65929928,65930221], [65803593,65803889]] x = get_max(Chr10) res.append( ('10', np.min(x)-500000, np.max(x)+500000) ) print "chr10", np.abs(np.min(x)-500000- (np.max(x)+500000)) Chr13=[[89436957,89437895], [90246706,90247293], [89827964,89828257] ] x = get_max(Chr13) res.append( ('13', np.min(x)-500000, np.max(x)+500000) ) print "chr13", np.abs(np.min(x)-500000- (np.max(x)+500000) ) Chr13B=[[113209235,113209678]] x = get_max(Chr13B) res.append( ('13B', np.min(x)-500000, np.max(x)+500000) ) print "chr13B", np.abs(np.min(x)-500000- (np.max(x)+500000) ) Chr7=[ [84639642,84640144], [84695438,84695874],[85118821,85119249],[84991102,84991653],[84934218,84934823], [84496390,84496913],[84486442,84486950],[84467455,84468214],[84971778,84972336],[84716663,84717140], [84732052,84732598],[84564285,84564755],[85125178,85125679]] x = get_max(Chr7) res.append( ('7', np.min(x)-500000, np.max(x)+500000) ) print "chr7", np.abs(np.min(x)-500000- (np.max(x)+500000) ) Chr3=[ [180086601,180112240],[179988975,179989609],[179951177,179951702],[179877783,179878247], [179805555,179806016],[179921910,179922345],[180168975,180169600],[180093458,180093897]] x = get_max(Chr3) res.append( ('3', np.min(x)-500000, np.max(x)+500000) ) print "chr3", np.abs(np.min(x)-500000- (np.max(x)+500000) ) print print res for k in res: #print "'",k[0],"'",":[[",k[1], ",", k[2],"]]" print "'%s':[[%d,%d]]," % (k[0], k[1], k[2]) """
28.10596
117
0.582941
544
4,244
4.494485
0.439338
0.065849
0.029448
0.058896
0.144376
0.137423
0.132515
0.132515
0.132515
0.071166
0
0.312771
0.239868
4,244
150
118
28.293333
0.445133
0.024034
0
0
0
0
0.05249
0.028937
0
0
0
0
0
0
null
null
0
0.446809
null
null
0.06383
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
6cead5ce0f1b4482017b26b00d60f537b5670b35
65
py
Python
Mundos/Mundo 2/Aulas/Aula 13/ex047.py
NicolasdeLimaAlves/Curso-de-Python
4987a2c8075a76f676aa69bfd968fdf8d1c7fa52
[ "MIT" ]
null
null
null
Mundos/Mundo 2/Aulas/Aula 13/ex047.py
NicolasdeLimaAlves/Curso-de-Python
4987a2c8075a76f676aa69bfd968fdf8d1c7fa52
[ "MIT" ]
null
null
null
Mundos/Mundo 2/Aulas/Aula 13/ex047.py
NicolasdeLimaAlves/Curso-de-Python
4987a2c8075a76f676aa69bfd968fdf8d1c7fa52
[ "MIT" ]
null
null
null
for c in range(2, 51, 2): print(c, '{}'.format('\033[0;31m'))
32.5
39
0.523077
13
65
2.615385
0.846154
0
0
0
0
0
0
0
0
0
0
0.185185
0.169231
65
2
39
32.5
0.444444
0
0
0
0
0
0.181818
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
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
1
0
4
9f0906d5344e4a824224d10c526923112036af32
11,422
py
Python
Probabilistic/Plot results of multiple ROI.py
El-Suri/process_monkey_brains
c3d53b7386b78663ea96e8335f7da907a1d02297
[ "MIT" ]
null
null
null
Probabilistic/Plot results of multiple ROI.py
El-Suri/process_monkey_brains
c3d53b7386b78663ea96e8335f7da907a1d02297
[ "MIT" ]
2
2020-09-15T13:21:29.000Z
2020-09-15T13:22:22.000Z
Probabilistic/Plot results of multiple ROI.py
El-Suri/Analyse-Monkey-Brain-Tracts
c3d53b7386b78663ea96e8335f7da907a1d02297
[ "MIT" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 # # Plot & analyse results # In[21]: import os import pandas as pd import numpy as np import glob import seaborn as sns from matplotlib import pyplot as plt import statistics # In[22]: # Read in data df_gschwind = pd.read_csv('/cubric/data/c1639425/Monkey_Brains/results_df/proportion_gschwind_bst_ncc_subic_antthal_globpal_df') display(df_gschwind) #df_eickhoff = pd.read_csv('/cubric/data/c1639425/Monkey_Brains/proportion_eickhoff_distance_corrected_just_subiculum_streamline_corrected_hipp_ant_thal_caudate_df') #display(df_eickhoff) df_eickhoff = pd.read_csv('/cubric/data/c1639425/Monkey_Brains/results_df/proportion_eickhoff_streamline_corrected_bst_subic_ncc_ant_thal_extglobpal_df') display(df_eickhoff) df_raw_data = pd.read_csv('/cubric/data/c1639425/Monkey_Brains/results_df/distance_corrected_raw_data_bst_subic_ncc_ant_thal_extGP_df') display(df_raw_data) # # Plot Raw Data # In[23]: raw_figure, axes = plt.subplots(figsize=(20,10)) # ax1 - Subic Connections subic_data = df_raw_data[['subic_ant_thal','subic_bst','subic_ncc','subic_ext_glob_pal']] ax1 = plt.subplot(1,3,1) sns.boxplot(ax = ax1, x = "variable", y = "value", data = pd.melt(subic_data)) ax1.set_xticklabels(['Ant Thal','BNST','NCC','Ext-GP'], fontsize = 11) ax1.set_title('Subiculum') ax1.set_xlabel('Target Regions') ax1.set_ylabel('\"Connections\"') raw_figure.tight_layout() raw_figure.savefig('/home/c1639425/Desktop/Monkey_processing/Multiple_roi_results/raw_data_dist_corrected.png') # ## Plot Gschwind # In[8]: list(df_gschwind.columns) # In[24]: # PLOT GSCHWIND axis_names = list(df_gschwind.columns.values)[1:] gschwind_figure, axes = plt.subplots(figsize=(20,10)) # ax1 - Subic Connections subic_data = df_gschwind[['bst_subic','subic_ant_thal','ncc_subic','subic_ext_glob_pal',]] ax1 = plt.subplot(2,3,1) sns.boxplot(ax = ax1, x = "variable", y = "value", data = pd.melt(subic_data)) ax1.set_xticklabels(['BNST', 'Ant Thal','NCC','Glob Pal',], fontsize = 11) ax1.set_title('Subiculum') ax1.set_xlabel('ROIs') ax1.set_ylabel('Connection Proportion') plt.setp(ax1.xaxis.get_majorticklabels(), rotation=45) gschwind_figure.tight_layout() gschwind_figure.savefig('/home/c1639425/Desktop/Monkey_processing/Multiple_roi_results/gschwind_bst_ncc_subic_antthal_globpal.png') # ## Run t-tests # In[28]: test_df = df_gschwind[['Subjects','bst_subic','subic_ant_thal','ncc_subic','subic_ext_glob_pal',]] test_long = pd.melt(test_df, id_vars=['Subjects'], value_vars=['bst_subic','subic_ant_thal','ncc_subic','subic_ext_glob_pal']) print(test_long) # In[23]: from scipy import stats subic_result = stats.wilcoxon(x = subic_data['bst_subic'], y=subic_data['ncc_subic'], zero_method='wilcox', correction=False) print(subic_result) # ## Plot Eickhoff Method, subic only # In[18]: axis_names = list(df_eickhoff.columns.values)[1:] eickhoff_figure, axes = plt.subplots(figsize=(20,10)) # ax1 - Subic Connections subic_data = df_eickhoff[['subic_bst','subic_ant_thal','subic_ncc','subic_ext_glob_pal']] ax1 = plt.subplot(1,3,1) sns.boxplot(ax = ax1, x = "variable", y = "value", data = pd.melt(subic_data)) ax1.set_xticklabels(['BNST','Ant Thal','NCC','Glob Pal'], fontsize = 11) ax1.set_title('Subiculum') ax1.set_xlabel('Target Regions') ax1.set_ylabel('Connection Proportion') #ax1.set_ylim(0,0.6) plt.setp(ax1.xaxis.get_majorticklabels(), rotation=45) eickhoff_figure.savefig('/home/c1639425/Desktop/Monkey_processing/Multiple_roi_results/eickhoff_bst_ncc_subic_antthal_globpal.png') # # Eickhoff, all ROIS # In[35]: eickhoff_figure, axes = plt.subplots(figsize=(20,10)) # ax1 - Subic Connections subic_data = df_eickhoff[['subic_bst','subic_ncc','subic_hippocampus','subic_caudate','subic_ant_thal']] ax1 = plt.subplot(2,3,1) sns.boxplot(ax = ax1, x = "variable", y = "value", data = pd.melt(subic_data)) ax1.set_xticklabels(['BNST','NCC','Hippocampus', 'Caudate','Ant Thal'], fontsize = 11) ax1.set_title('Subiculum') ax1.set_xlabel('Target Regions') ax1.set_ylabel('Connection Proportion') #ax1.set_ylim(0,0.6) #plt.setp(ax1.xaxis.get_majorticklabels(), rotation=45) # ax2 - BST Connections bst_connections = df_eickhoff[['bst_subic','bst_ncc','bst_hippocampus','bst_caudate','bst_ant_thal']] ax2 = plt.subplot(2,3,2, sharey = ax1) sns.boxplot(ax = ax2, x = "variable", y = "value", data = pd.melt(bst_connections)) ax2.set_xticklabels(['Subiculum', 'NCC', 'Hippocampus', 'Caudate', ' Ant Thal'], fontsize = 11) ax2.set_title('BNST') ax2.set_xlabel('Target Regions') ax2.set_ylabel('Connection Proportion') #plt.setp(ax2.xaxis.get_majorticklabels(), rotation=45) # ax3 - NCC Connections ncc_connections = df_eickhoff[['ncc_subic','ncc_bst','ncc_hippocampus','ncc_caudate','ncc_ant_thal']] ax3 = plt.subplot(2,3,3, sharey = ax1) sns.boxplot(ax = ax3, x = "variable", y = "value", data = pd.melt(ncc_connections)) ax3.set_xticklabels(['Subiculum', 'BNST', 'Hippocampus', 'Caudate', 'Ant Thal'], fontsize = 11) ax3.set_title('NCC') ax3.set_xlabel('Target Regions') ax3.set_ylabel('Connection Proportion') #plt.setp(ax3.xaxis.get_majorticklabels(), rotation=45) # ax4 - Hippocampus Connections hippocampus_connections = df_eickhoff[['hippocampus_subic','hippocampus_bst','hippocampus_ncc','hippocampus_caudate','hippocampus_ant_thal']] ax4 = plt.subplot(2,3,4,sharey = ax1) sns.boxplot(ax = ax4, x = "variable", y = "value", data = pd.melt(hippocampus_connections)) ax4.set_xticklabels(['Subiculum','BNST','NCC','Caudate','Ant Thal'], fontsize = 11) ax4.set_title('Hippocampus') ax4.set_xlabel('Target Regions') ax4.set_ylabel('Connection Proportion') #plt.setp(ax4.xaxis.get_majorticklabels(), rotation=45) # ax5 - Caudate Connections caudate_connections = df_eickhoff[['caudate_subic','caudate_bst','caudate_ncc','caudate_hippocampus','caudate_ant_thal']] ax5 = plt.subplot(2,3,5,sharey = ax1) sns.boxplot(ax = ax5, x = "variable", y = "value", data = pd.melt(caudate_connections)) ax5.set_xticklabels(['Subiculum','BNST','NCC','Hippocampus','Ant Thal'], fontsize = 11) ax5.set_title('Caudate') ax5.set_xlabel('Target Regions') ax5.set_ylabel('Connection Proportion') #plt.setp(ax5.xaxis.get_majorticklabels(), rotation=45) # ax6 - Ant Thal Connections ant_thal_connections = df_eickhoff[['ant_thal_subic','ant_thal_bst','ant_thal_ncc','ant_thal_hippocampus','ant_thal_caudate']] ax6 = plt.subplot(2,3,6,sharey = ax1) sns.boxplot(ax = ax6, x = "variable", y = "value", data = pd.melt(ant_thal_connections)) ax6.set_xticklabels(['Subiculum','BNST','NCC','Hippocampus','Caudate'], fontsize = 11) ax6.set_title('Ant Thal') ax6.set_xlabel('Target Regions') ax6.set_ylabel('Connection Proportion') #plt.setp(ax6.xaxis.get_majorticklabels(), rotation=45) eickhoff_figure.tight_layout() eickhoff_figure.savefig('/home/c1639425/Desktop/Monkey_processing/Multiple_roi_results/eickhoff_all_distance_corrected.png') # In[26]: from scipy import stats subic_result = stats.wilcoxon(x = subic_data['subic_bst'], y=subic_data['subic_ncc'], zero_method='wilcox', correction=False) print(subic_result) bnst_result = stats.wilcoxon(x = bst_connections['bst_ncc'], y=bst_connections['bst_subic'], zero_method='wilcox', correction=False) print(bnst_result) ncc_result = stats.wilcoxon(x = ncc_connections['ncc_subic'], y=ncc_connections['ncc_bst'], zero_method='wilcox', correction=False) print(ncc_result) # ## Plot mean ROI sizes # In[27]: gschwind_just_subic, axes = plt.subplots(figsize=(10,5)) # ax1 - Subic Connections subic_data = df_gschwind[['bst_subic','ncc_subic','subic_hippocampus','subic_caudate','subic_ant_thal']] ax1 = plt.subplot(1,1,1) sns.boxplot(ax = ax1, x = "variable", y = "value", data = pd.melt(subic_data)) ax1.set_xticklabels(['BNST', 'NCC','Hippocampus','Caudate','Ant Thal'], fontsize = 11) ax1.set_title('Subiculum') ax1.set_xlabel('ROIs') ax1.set_ylabel('Connection Proportion') plt.setp(ax1.xaxis.get_majorticklabels(), rotation=45) gschwind_just_subic.tight_layout() # In[80]: means = connections_df.mean(axis = 0, numeric_only= True) sems = connections_df.sem(axis = 0, numeric_only=True) z_score = 1.96 lcb = means - z_score* sems ucb = means + z_score* sems mean_vols = before_multiplication_df.mean(axis = 0, numeric_only= True) stds_vols = before_multiplication_df.std(axis = 0, numeric_only=True) plot_roi_sizes = before_multiplication_df.drop(['Subjects'], axis = 1) fig, ax = plt.subplots(figsize = (12,8)) ax = sns.boxplot(ax = ax, data = plot_roi_sizes) fig.savefig('/home/c1639425/Desktop/Monkey_processing/Multiple_roi_results/subic_tracts_bst_sizes.png') # In[38]: # ax2 - BST Connections bst_connections = df_gschwind[['bst_subic','bst_ncc','bst_hippocampus','bst_caudate','bst_ant_thal']] ax2 = plt.subplot(2,3,2) sns.boxplot(ax = ax2, x = "variable", y = "value", data = pd.melt(bst_connections)) ax2.set_xticklabels(['Subiculum', 'NCC','Hippocampus','Caudate','Ant Thal'], fontsize = 11) ax2.set_title('BNST') ax2.set_xlabel('ROIs') ax2.set_ylabel('Connection Proportion') plt.setp(ax2.xaxis.get_majorticklabels(), rotation=45) # ax3 - NCC Connections ncc_connections = df_gschwind[['ncc_subic','bst_ncc','ncc_hippocampus','ncc_caudate','ncc_ant_thal']] ax3 = plt.subplot(2,3,3) sns.boxplot(ax = ax3, x = "variable", y = "value", data = pd.melt(ncc_connections)) ax3.set_xticklabels(['Subiculum', 'BNST','Hippocampus','Caudate','Ant Thal'], fontsize = 11) ax3.set_title('NCC') ax3.set_xlabel('ROIs') ax3.set_ylabel('Connection Proportion') plt.setp(ax3.xaxis.get_majorticklabels(), rotation=45) # ax4 - Hippocampus Connections hippocampus_connections = df_gschwind[['subic_hippocampus','bst_hippocampus','ncc_hippocampus','hippocampus_caudate','hippocampus_ant_thal']] ax4 = plt.subplot(2,3,4) sns.boxplot(ax = ax4, x = "variable", y = "value", data = pd.melt(hippocampus_connections)) ax4.set_xticklabels(['Subiculum','BNST','NCC','Caudate','Ant Thal'], fontsize = 11) ax4.set_title('Hippocampus') ax4.set_xlabel('ROIs') ax4.set_ylabel('Connection Proportion') plt.setp(ax4.xaxis.get_majorticklabels(), rotation=45) # ax5 - Caudate Connections caudate_connections = df_gschwind[['subic_caudate','bst_caudate','ncc_caudate','hippocampus_caudate','caudate_ant_thal']] ax5 = plt.subplot(2,3,5) sns.boxplot(ax = ax5, x = "variable", y = "value", data = pd.melt(caudate_connections)) ax5.set_xticklabels(['Subiculum','BNST','NCC','Hippocampus','Ant Thal'], fontsize = 11) ax5.set_title('Caudate') ax5.set_xlabel('ROIs') ax5.set_ylabel('Connection Proportion') plt.setp(ax5.xaxis.get_majorticklabels(), rotation=45) # ax6 - Ant Thal Connections ant_thal_connections = df_gschwind[['subic_ant_thal','bst_ant_thal','ncc_ant_thal','hippocampus_ant_thal','caudate_ant_thal']] ax6 = plt.subplot(2,3,6) sns.boxplot(ax = ax6, x = "variable", y = "value", data = pd.melt(ant_thal_connections)) ax6.set_xticklabels(['Subiculum','BNST','NCC','Hippocampus','Caudate'], fontsize = 11) ax6.set_title('Ant Thal') ax6.set_xlabel('ROIs') ax6.set_ylabel('Connection Proportion') plt.setp(ax6.xaxis.get_majorticklabels(), rotation=45) gschwind_figure.tight_layout() gschwind_figure.savefig('/home/c1639425/Desktop/Monkey_processing/Multiple_roi_results/gschwind_distance_corrected.png') #stats.ttest_rel(plotting_data['Subic_BST'], plotting_data['Subic_NCC'])
35.47205
165
0.745841
1,667
11,422
4.853629
0.106179
0.042393
0.02373
0.027809
0.791497
0.770239
0.73316
0.719318
0.696206
0.6747
0
0.035012
0.092278
11,422
321
166
35.582555
0.74537
0.120644
0
0.452381
0
0
0.331931
0.090572
0
0
0
0
0
1
0
false
0
0.053571
0
0.053571
0.029762
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
9f27ef6d98cc3d25450e25bc7380091cfda4621c
105
py
Python
triggercmd_cli/__main__.py
omadson/triggercmd-cli
52392024cc5f3f00f66207b460ba7296c838964e
[ "MIT" ]
null
null
null
triggercmd_cli/__main__.py
omadson/triggercmd-cli
52392024cc5f3f00f66207b460ba7296c838964e
[ "MIT" ]
null
null
null
triggercmd_cli/__main__.py
omadson/triggercmd-cli
52392024cc5f3f00f66207b460ba7296c838964e
[ "MIT" ]
null
null
null
import typer from triggercmd_cli import command if __name__ == "__main__": typer.run(command.list)
15
34
0.752381
14
105
5
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.161905
105
6
35
17.5
0.795455
0
0
0
0
0
0.07619
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
9f3022633562f2a88dc02e570fb855c5bf59dfda
79
py
Python
doggo/wsgi.py
besson/ds-capstone-project
638865c175bedfe7fd81940e74872ddc716b567f
[ "MIT" ]
null
null
null
doggo/wsgi.py
besson/ds-capstone-project
638865c175bedfe7fd81940e74872ddc716b567f
[ "MIT" ]
null
null
null
doggo/wsgi.py
besson/ds-capstone-project
638865c175bedfe7fd81940e74872ddc716b567f
[ "MIT" ]
null
null
null
from doggo import run, app if __name__ == "__main__": run() app.run()
13.166667
26
0.607595
11
79
3.636364
0.727273
0.3
0
0
0
0
0
0
0
0
0
0
0.253165
79
5
27
15.8
0.677966
0
0
0
0
0
0.101266
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
9f3924978d036d1d1f9a52bba470f7a3f44e0917
104
py
Python
Deployment/Heroku-Deployment/Files/universities/apps.py
ShahriarDhruvo/DU_Hackathon
30650287a61a3314e6adb9e1c26206d4d8dbe312
[ "MIT" ]
3
2021-02-27T21:06:05.000Z
2021-08-03T16:56:22.000Z
server/universities/apps.py
ShahriarDhruvo/Class-Portal-Project-350-
8ebc311a7992b61e5d15da19f0ba7dfdc059a705
[ "MIT" ]
1
2021-02-13T07:22:09.000Z
2021-02-13T07:22:09.000Z
server/universities/apps.py
ShahriarDhruvo/Class-Portal-Project-350-
8ebc311a7992b61e5d15da19f0ba7dfdc059a705
[ "MIT" ]
1
2021-06-14T13:25:36.000Z
2021-06-14T13:25:36.000Z
from django.apps import AppConfig class UniversitiesConfig(AppConfig): name = 'universities'
17.333333
37
0.740385
10
104
7.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.192308
104
5
38
20.8
0.916667
0
0
0
0
0
0.121212
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
9f4b0a8e3c5cce3bee0f08aca0393aadf24812aa
182
py
Python
backend/__init__.py
NoviceMaster/blog
e5958dad8c65db9443fbf2b229478e2abe7ffb34
[ "MIT" ]
null
null
null
backend/__init__.py
NoviceMaster/blog
e5958dad8c65db9443fbf2b229478e2abe7ffb34
[ "MIT" ]
null
null
null
backend/__init__.py
NoviceMaster/blog
e5958dad8c65db9443fbf2b229478e2abe7ffb34
[ "MIT" ]
null
null
null
# !/usr/bin/env python # -*- coding: utf-8 -*- # @Author : NoviceMaster # @Email : mrchenbin@126.com # @Time : 2021/1/5 17:50 # @File : __init__.py.py # @Software: PyCharm
22.75
30
0.593407
25
182
4.16
0.96
0
0
0
0
0
0
0
0
0
0
0.097222
0.208791
182
7
31
26
0.625
0.917582
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
9f5907c624ffc56358f4c8f2152e35dd4dd9e91b
112
py
Python
src/mytime.py
o-x-y-g-e-n/whatsapp-assistant-bot
f22f4176fe14efc35638f092f722b180d4688d36
[ "MIT" ]
6
2018-06-09T17:44:46.000Z
2020-08-09T19:03:27.000Z
src/mytime.py
o-x-y-g-e-n/whatsapp-assistant-bot
f22f4176fe14efc35638f092f722b180d4688d36
[ "MIT" ]
2
2021-04-06T18:21:29.000Z
2021-06-02T03:35:01.000Z
src/mytime.py
o-x-y-g-e-n/whatsapp-assistant-bot
f22f4176fe14efc35638f092f722b180d4688d36
[ "MIT" ]
3
2018-02-24T15:39:49.000Z
2021-03-06T19:33:21.000Z
from datetime import datetime def time_generator(): str = datetime.now().strftime('%Y-%m-%d %A') return str
16
45
0.696429
17
112
4.529412
0.823529
0
0
0
0
0
0
0
0
0
0
0
0.142857
112
6
46
18.666667
0.802083
0
0
0
0
0
0.099099
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
9f7303bd041ac18f1ba7ca601eef6c93f7a31f5a
105
py
Python
main.py
Jamesits/ZhihuZhuanlan2Hugo
db47a2430fb0e0b7bcc5ae14ddd55c1d4fe68ec4
[ "MIT" ]
null
null
null
main.py
Jamesits/ZhihuZhuanlan2Hugo
db47a2430fb0e0b7bcc5ae14ddd55c1d4fe68ec4
[ "MIT" ]
null
null
null
main.py
Jamesits/ZhihuZhuanlan2Hugo
db47a2430fb0e0b7bcc5ae14ddd55c1d4fe68ec4
[ "MIT" ]
null
null
null
import sys import ZhihuZhuanlan2Hugo if __name__ == "__main__": ZhihuZhuanlan2Hugo.main(*sys.argv)
15
38
0.761905
11
105
6.545455
0.636364
0
0
0
0
0
0
0
0
0
0
0.022222
0.142857
105
6
39
17.5
0.777778
0
0
0
0
0
0.07619
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
9f77d41b64520f3221c9a7dcdaa739f7aa058738
121
py
Python
tests/test_dummy.py
gabrielDonnantuoni/drf-nested-routers
38ab52b39b4cc6236056305715eb5de548722a9d
[ "Apache-2.0" ]
1,254
2015-01-02T14:00:36.000Z
2022-03-31T03:55:34.000Z
tests/test_dummy.py
CZZLEGEND/drf-nested-routers
f2cc449535726a06235fb8054e89c9973338e381
[ "Apache-2.0" ]
162
2015-01-07T17:47:23.000Z
2022-03-28T19:21:50.000Z
tests/test_dummy.py
CZZLEGEND/drf-nested-routers
f2cc449535726a06235fb8054e89c9973338e381
[ "Apache-2.0" ]
158
2015-02-10T09:43:30.000Z
2022-03-18T22:44:49.000Z
from django.test import TestCase class TestDummy(TestCase): def test_one_plus_one(self): assert 1 + 1 == 2
17.285714
32
0.68595
18
121
4.444444
0.777778
0
0
0
0
0
0
0
0
0
0
0.032258
0.231405
121
6
33
20.166667
0.827957
0
0
0
0
0
0
0
0
0
0
0
0.25
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
9f82970b7d72d5b5c4dc0eeb98a362d2111e0819
238
py
Python
lona/__init__.py
fscherf/lona
cf822b88d97db9bd2b36431341317418acefdaa9
[ "MIT" ]
155
2020-09-12T21:54:10.000Z
2021-08-15T15:12:40.000Z
lona/__init__.py
fscherf/lona
cf822b88d97db9bd2b36431341317418acefdaa9
[ "MIT" ]
9
2020-09-30T19:34:07.000Z
2021-08-15T17:20:14.000Z
lona/__init__.py
fscherf/lona
cf822b88d97db9bd2b36431341317418acefdaa9
[ "MIT" ]
9
2020-09-30T19:28:41.000Z
2021-08-14T15:39:39.000Z
from .exceptions import * # NOQA: F403 from .routing import MATCH_ALL, Route from .errors import * # NOQA: F403 from .view import LonaView from .app import LonaApp VERSION = (1, 8, 5) VERSION_STRING = '.'.join(str(i) for i in VERSION)
26.444444
50
0.714286
37
238
4.540541
0.648649
0.119048
0.166667
0.214286
0
0
0
0
0
0
0
0.045918
0.176471
238
8
51
29.75
0.811224
0.088235
0
0
0
0
0.004673
0
0
0
0
0
0
1
0
false
0
0.714286
0
0.714286
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
1
0
1
0
0
4
9f8a4283c2d8062650292c05581d76c8829800f1
58
py
Python
setup.py
otomarukanta/kabu
2e2d4d80fe4d8b6acaabe0cb99176cc0275b7a72
[ "MIT" ]
3
2019-09-07T21:47:47.000Z
2020-08-16T12:38:35.000Z
setup.py
adam-urbanczyk/pyqtconsole
9aad5fa27be81d51028932715c1652e8f05e37ff
[ "MIT" ]
1
2021-04-25T03:21:37.000Z
2021-04-25T03:21:37.000Z
setup.py
otomarukanta/kabu
2e2d4d80fe4d8b6acaabe0cb99176cc0275b7a72
[ "MIT" ]
null
null
null
#!/usr/bin/env python from setuptools import setup setup()
19.333333
28
0.775862
9
58
5
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.103448
58
3
29
19.333333
0.865385
0.344828
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
9fbf52f22b80a0345802ea482f53fb3bc913eb31
89
py
Python
django/seelviz/clarityviz/apps.py
NeuroDataDesign/seelviz-archive
cb9bcf7c0f32f0256f71be59dd7d7a9086d0f3b3
[ "Apache-2.0" ]
null
null
null
django/seelviz/clarityviz/apps.py
NeuroDataDesign/seelviz-archive
cb9bcf7c0f32f0256f71be59dd7d7a9086d0f3b3
[ "Apache-2.0" ]
2
2017-04-18T02:50:14.000Z
2017-04-18T18:04:20.000Z
django/seelviz/clarityviz/apps.py
NeuroDataDesign/seelviz-archive
cb9bcf7c0f32f0256f71be59dd7d7a9086d0f3b3
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class SeelvizConfig(AppConfig): name = 'seelviz'
14.833333
33
0.752809
10
89
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.905405
0
0
0
0
0
0.078652
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
9fc76686b61ca7c056513108bbe29ac2004a311d
88
py
Python
src/hcb/codes/surface/__init__.py
Strilanc/honeycomb-boundaries
cc33baac44c7831bd643db81d0053f8ec6eae9d8
[ "Apache-2.0" ]
null
null
null
src/hcb/codes/surface/__init__.py
Strilanc/honeycomb-boundaries
cc33baac44c7831bd643db81d0053f8ec6eae9d8
[ "Apache-2.0" ]
2
2022-02-25T22:28:24.000Z
2022-03-23T21:09:04.000Z
src/hcb/codes/surface/__init__.py
Strilanc/honeycomb-boundaries
cc33baac44c7831bd643db81d0053f8ec6eae9d8
[ "Apache-2.0" ]
null
null
null
""" This package contains classes and methods for generating surface code circuits. """
22
79
0.772727
11
88
6.181818
1
0
0
0
0
0
0
0
0
0
0
0
0.147727
88
3
80
29.333333
0.906667
0.897727
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
4ca63570b2f1f89d7981e8145cbf1da63a90433f
76
py
Python
src/izi/apps/dashboard/users/__init__.py
izi-core/izi-core
21176be2d41f0cf54ca954f294209c585f643dba
[ "BSD-3-Clause" ]
null
null
null
src/izi/apps/dashboard/users/__init__.py
izi-core/izi-core
21176be2d41f0cf54ca954f294209c585f643dba
[ "BSD-3-Clause" ]
null
null
null
src/izi/apps/dashboard/users/__init__.py
izi-core/izi-core
21176be2d41f0cf54ca954f294209c585f643dba
[ "BSD-3-Clause" ]
null
null
null
default_app_config = 'izi.apps.dashboard.users.config.UsersDashboardConfig'
38
75
0.855263
9
76
7
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.039474
76
1
76
76
0.863014
0
0
0
0
0
0.684211
0.684211
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
4cf1c3ad501a722c0f3380a7d47c7f4ae1b51592
580
py
Python
examples/comment/master_comment.py
moreno19/instabot2
55128d4563612e82544b66d8f6e2f81551cdc3af
[ "Apache-2.0" ]
null
null
null
examples/comment/master_comment.py
moreno19/instabot2
55128d4563612e82544b66d8f6e2f81551cdc3af
[ "Apache-2.0" ]
null
null
null
examples/comment/master_comment.py
moreno19/instabot2
55128d4563612e82544b66d8f6e2f81551cdc3af
[ "Apache-2.0" ]
null
null
null
import os import subprocess from instabot import Bot import sys subprocess.call(["python","comment_hashtags.py","turtlecomments.txt", "turtlebaby", "savetheturtles"]) subprocess.call(["python","comment_hashtags.py","bobacomments.txt", "boba", "bubbletea"]) subprocess.call(["python","comment_hashtags.py","smoothiecomments.txt", "smoothiebowls", "smoothies", "smoothietime"]) subprocess.call(["python","comment_hashtags.py","strawcomments.txt", "strawssuck", "plastic"]) subprocess.call(["python","comment_hashtags.py","beachresortcomments.txt", "beachcleanup", "ecoresorts"])
44.615385
118
0.763793
61
580
7.180328
0.47541
0.159817
0.228311
0.308219
0.422374
0.422374
0
0
0
0
0
0
0.05
580
12
119
48.333333
0.794918
0
0
0
0
0
0.567241
0.039655
0
0
0
0
0
1
0
true
0
0.444444
0
0.444444
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
981d8fe39e966dd3b40db76f186c2687629b0e3d
805
py
Python
fluidml/common/exception.py
fluidml/fluidml
4bee9b180d84ea9c7e5d98e1ffc48fcc5080e045
[ "Apache-2.0" ]
15
2021-01-06T14:03:49.000Z
2022-03-04T19:30:27.000Z
fluidml/common/exception.py
fluidml/fluidml
4bee9b180d84ea9c7e5d98e1ffc48fcc5080e045
[ "Apache-2.0" ]
16
2021-01-24T00:24:39.000Z
2021-08-04T20:56:03.000Z
fluidml/common/exception.py
fluidml/fluidml
4bee9b180d84ea9c7e5d98e1ffc48fcc5080e045
[ "Apache-2.0" ]
1
2021-07-09T06:34:49.000Z
2021-07-09T06:34:49.000Z
class NoTasksError(Exception): """Exception raised when there are no tasks passed""" pass class TaskResultKeyAlreadyExists(Exception): """Exception raised when two tasks produce same key-ed result""" pass class TaskResultObjectMissing(Exception): """Exception raised when one or more expected input results could not be retrieved from predecessor tasks""" pass class TaskNameError(Exception): """Exception raised when an other object with the name of a task exists. Task names have to be unique for pickling. """ pass class GridSearchExpansionError(Exception): """Exception raised when Grid Search expansion fails.""" pass class CyclicGraphError(Exception): """Exception raised when task spec graph contains circular dependencies.""" pass
25.967742
112
0.734161
95
805
6.221053
0.621053
0.182741
0.243655
0.284264
0
0
0
0
0
0
0
0
0.192547
805
30
113
26.833333
0.909231
0.550311
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
e22eedef40662e825ac787ce1da7f3c9e8f99586
269
py
Python
catalog/admin.py
algorithm-ssau/booksearch
00b3d3942ca4b21089aad35dd087699d795d148c
[ "bzip2-1.0.6" ]
null
null
null
catalog/admin.py
algorithm-ssau/booksearch
00b3d3942ca4b21089aad35dd087699d795d148c
[ "bzip2-1.0.6" ]
null
null
null
catalog/admin.py
algorithm-ssau/booksearch
00b3d3942ca4b21089aad35dd087699d795d148c
[ "bzip2-1.0.6" ]
null
null
null
from django.contrib import admin from .models import Country, Author, Genre, Category, Book, Review admin.site.register(Country) admin.site.register(Author) admin.site.register(Genre) admin.site.register(Category) admin.site.register(Book) admin.site.register(Review)
26.9
66
0.810409
38
269
5.736842
0.368421
0.247706
0.46789
0
0
0
0
0
0
0
0
0
0.074349
269
9
67
29.888889
0.875502
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
e27725a05501e7b7796f7dc731fa45006c6868c5
395
py
Python
bindings/python/src/gravix2/__init__.py
avitase/libgravix2
52cf7f68f5d19785f8c23325225f8f3e5142cf74
[ "MIT" ]
null
null
null
bindings/python/src/gravix2/__init__.py
avitase/libgravix2
52cf7f68f5d19785f8c23325225f8f3e5142cf74
[ "MIT" ]
7
2022-01-31T19:45:55.000Z
2022-03-16T16:08:34.000Z
bindings/python/src/gravix2/__init__.py
avitase/libgravix2
52cf7f68f5d19785f8c23325225f8f3e5142cf74
[ "MIT" ]
null
null
null
""" We alias import :class:`gravix2.gravix2.Gravix2` as ``load_library`` for convenience, such that loading and interacting with ``libgravix2.so`` becomes straightforward: **Example:** .. highlight:: python .. code-block:: python import gravix2 lib = gravix2.load_library('path_to_libgravix2.so') lat = lib.get_lat(z=45) ... """ from .gravix2 import Gravix2 as load_library
21.944444
85
0.708861
51
395
5.372549
0.647059
0.120438
0.094891
0.145985
0
0
0
0
0
0
0
0.033033
0.156962
395
17
86
23.235294
0.78979
0.860759
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
e293a74d6f6b3f4196f0a1c79eda4cd14b377aa9
962
py
Python
python/phonenumbers/shortdata/region_NE.py
rodgar-nvkz/python-phonenumbers
4c7c4892211dbc9bc328bc3356b03853eaf993dc
[ "Apache-2.0" ]
2,424
2015-01-05T05:34:45.000Z
2022-03-28T22:37:53.000Z
python/phonenumbers/shortdata/region_NE.py
rodgar-nvkz/python-phonenumbers
4c7c4892211dbc9bc328bc3356b03853eaf993dc
[ "Apache-2.0" ]
166
2015-01-30T23:59:18.000Z
2022-03-14T21:08:42.000Z
python/phonenumbers/shortdata/region_NE.py
rodgar-nvkz/python-phonenumbers
4c7c4892211dbc9bc328bc3356b03853eaf993dc
[ "Apache-2.0" ]
345
2015-01-02T00:33:27.000Z
2022-03-26T13:06:57.000Z
"""Auto-generated file, do not edit by hand. NE metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_NE = PhoneMetadata(id='NE', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='[1-3578]\\d(?:\\d(?:\\d{3})?)?', possible_length=(2, 3, 6)), toll_free=PhoneNumberDesc(national_number_pattern='1(?:18|[578])|723\\d{3}', example_number='15', possible_length=(2, 3, 6)), emergency=PhoneNumberDesc(national_number_pattern='1(?:18|[578])|723141', example_number='15', possible_length=(2, 3, 6)), short_code=PhoneNumberDesc(national_number_pattern='1(?:0[01]|1[128]|2[034]|3[013]|[46]0|55?|[78])|222|333|555|723141|888', example_number='15', possible_length=(2, 3, 6)), carrier_specific=PhoneNumberDesc(national_number_pattern='1(?:0[01]|1[12]|2[034]|3[013]|[46]0|55)|222|333|555|888', example_number='100', possible_length=(3,)), short_data=True)
87.454545
176
0.724532
145
962
4.613793
0.434483
0.171898
0.216741
0.269058
0.511211
0.430493
0.430493
0.266069
0
0
0
0.137584
0.070686
962
10
177
96.2
0.610738
0.055094
0
0
1
0.25
0.230343
0.196013
0
0
0
0
0
1
0
false
0
0.125
0
0.125
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
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
e2ad8819c8548192561fb3219760894df64f15a5
2,943
py
Python
tests/test_up_parser.py
lukh/microparcel-python
9a5cf14492bacbcdcca2e2ce0875bab46906a1c7
[ "MIT" ]
1
2020-03-11T14:07:24.000Z
2020-03-11T14:07:24.000Z
tests/test_up_parser.py
lukh/microparcel-python
9a5cf14492bacbcdcca2e2ce0875bab46906a1c7
[ "MIT" ]
null
null
null
tests/test_up_parser.py
lukh/microparcel-python
9a5cf14492bacbcdcca2e2ce0875bab46906a1c7
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `microparcel` package.""" import unittest from microparcel import microparcel as up class TestMicroparcelParser(unittest.TestCase): """Tests for `microparcel` package.""" def setUp(self): """Set up test fixtures, if any.""" def tearDown(self): """Tear down test fixtures, if any.""" def test_encode(self): """Test Parser Encoding.""" parser = up.make_parser_cls(4)() msg = up.Message(4) msg.data[0] = 0 msg.data[1] = 1 msg.data[2] = 2 msg.data[3] = 3 frame = parser.encode(msg) self.assertEqual(frame.SOF, 0xAA) self.assertEqual(frame.message.data[0], 0) self.assertEqual(frame.message.data[1], 1) self.assertEqual(frame.message.data[2], 2) self.assertEqual(frame.message.data[3], 3) self.assertEqual(frame.checksum, 0xAA + sum([0,1,2,3])) def test_decode(self): """Test Parser Decoding.""" parser = up.make_parser_cls(4)() msg = up.Message() # valid message self.assertEqual(parser.parse(0xAA, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x0, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x1, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x2, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x3, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0xFF & (0xAA + 0 + 1 + 2 + 3), msg), parser.Status.Complete) self.assertEqual(msg.data[0], 0) self.assertEqual(msg.data[1], 1) self.assertEqual(msg.data[2], 2) self.assertEqual(msg.data[3], 3) # invalid CS self.assertEqual(parser.parse(0xAA, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x44, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x99, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0xB, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x4, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0xFF, msg), parser.Status.Error) # Invalid SOF self.assertEqual(parser.parse(0xDD, msg), parser.Status.Error) self.assertEqual(parser.parse(0xEE, msg), parser.Status.Error) self.assertEqual(parser.parse(0xBB, msg), parser.Status.Error) self.assertEqual(parser.parse(0xAA, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x4, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x5, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x6, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0x7, msg), parser.Status.NotComplete) self.assertEqual(parser.parse(0xFF & (0xAA + 4+5+6+7), msg), parser.Status.Complete)
38.723684
98
0.652735
370
2,943
5.175676
0.208108
0.24282
0.230287
0.285117
0.683551
0.56188
0.56188
0.56188
0.313316
0.275718
0
0.033276
0.203534
2,943
76
99
38.723684
0.783703
0.085627
0
0.148936
0
0
0
0
0
0
0.033873
0
0.659574
1
0.085106
false
0
0.042553
0
0.148936
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
1
0
0
0
0
0
0
0
0
0
4
2c5f60569aae0cd2c81589d4ebbe9b40493592ec
656
py
Python
trade_remedies_api/contacts/migrations/0006_auto_20190617_0850.py
uktrade/trade-remedies-api
fbe2d142ef099c7244788a0f72dd1003eaa7edce
[ "MIT" ]
1
2020-08-13T10:37:15.000Z
2020-08-13T10:37:15.000Z
trade_remedies_api/contacts/migrations/0006_auto_20190617_0850.py
uktrade/trade-remedies-api
fbe2d142ef099c7244788a0f72dd1003eaa7edce
[ "MIT" ]
4
2020-09-10T13:41:52.000Z
2020-12-16T09:00:21.000Z
trade_remedies_api/contacts/migrations/0006_auto_20190617_0850.py
uktrade/trade-remedies-api
fbe2d142ef099c7244788a0f72dd1003eaa7edce
[ "MIT" ]
null
null
null
# Generated by Django 2.0.13 on 2019-06-17 08:50 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("contacts", "0005_auto_20190520_1322"), ] operations = [ migrations.RemoveField(model_name="contactuser", name="case",), migrations.RemoveField(model_name="contactuser", name="contact",), migrations.RemoveField(model_name="contactuser", name="created_by",), migrations.RemoveField(model_name="contactuser", name="modified_by",), migrations.RemoveField(model_name="contactuser", name="user",), migrations.DeleteModel(name="ContactUser",), ]
32.8
78
0.6875
69
656
6.391304
0.507246
0.204082
0.294785
0.340136
0.519274
0.519274
0.213152
0
0
0
0
0.058824
0.170732
656
19
79
34.526316
0.751838
0.070122
0
0
1
0
0.21875
0.037829
0
0
0
0
0
1
0
false
0
0.076923
0
0.307692
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2c8b56921329467a7f988dd9f9fd671fb8715962
159
py
Python
polls/forms.py
standragosexpleo/djangoapp
53a7e6fbf00f571d2159856ee421f75bdf4f85b9
[ "MIT" ]
null
null
null
polls/forms.py
standragosexpleo/djangoapp
53a7e6fbf00f571d2159856ee421f75bdf4f85b9
[ "MIT" ]
null
null
null
polls/forms.py
standragosexpleo/djangoapp
53a7e6fbf00f571d2159856ee421f75bdf4f85b9
[ "MIT" ]
null
null
null
# forms.py from django import forms from .models import * class PhotoForm(forms.ModelForm): class Meta: model = Photo fields = ['photo']
15.9
33
0.641509
19
159
5.368421
0.684211
0
0
0
0
0
0
0
0
0
0
0
0.264151
159
9
34
17.666667
0.871795
0.050314
0
0
0
0
0.033557
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
2c9afa2bd875c5691390979f08e4a253c929d672
143
py
Python
sanic_jwt/base.py
jekel/sanic-jwt
4f6ab07376ad90011d40e205feacae8219359d6f
[ "MIT" ]
226
2017-09-05T08:23:58.000Z
2022-03-28T09:23:47.000Z
sanic_jwt/base.py
jekel/sanic-jwt
4f6ab07376ad90011d40e205feacae8219359d6f
[ "MIT" ]
179
2017-09-27T08:33:16.000Z
2022-01-28T20:35:23.000Z
sanic_jwt/base.py
jekel/sanic-jwt
4f6ab07376ad90011d40e205feacae8219359d6f
[ "MIT" ]
45
2017-10-14T10:26:46.000Z
2022-02-04T15:01:20.000Z
class BaseDerivative: def __init__(self, config, instance, *args, **kwargs): self.config = config self.instance = instance
28.6
58
0.657343
15
143
6
0.6
0.222222
0
0
0
0
0
0
0
0
0
0
0.237762
143
4
59
35.75
0.825688
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
2cb12a7afaca85f0cebd275b6301ae9ea8fe3d06
351
py
Python
sanatkpy/__init__.py
zhs007/sanatkpy
796232b5f326ae10c71f69296e560592a7053985
[ "Apache-2.0" ]
null
null
null
sanatkpy/__init__.py
zhs007/sanatkpy
796232b5f326ae10c71f69296e560592a7053985
[ "Apache-2.0" ]
null
null
null
sanatkpy/__init__.py
zhs007/sanatkpy
796232b5f326ae10c71f69296e560592a7053985
[ "Apache-2.0" ]
null
null
null
# -*- coding:utf-8 -*- """ sanatkpy - 三国志战略版的python实现 """ # pylint: disable = invalid-name # pylint: disable = line-too-long from sanatkpy.zfwzhx import WZHX from sanatkpy.zfyrpx import YRPX from sanatkpy.atkresult import AtkResult from sanatkpy.general import General from sanatkpy.atk import simAttack2 from sanatkpy.atkreport import AtkReport
25.071429
40
0.774929
44
351
6.181818
0.522727
0.264706
0
0
0
0
0
0
0
0
0
0.006601
0.136752
351
13
41
27
0.891089
0.316239
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
e2b9fc801eef137d38b43e71010cbc05d49da55f
10,443
py
Python
dtApp/dtCode/crossvalidation.py
Digital-Twin-Operational-Platform/Cristallo
20e21f6ae0f0f99002a229c8c966fd72020698c3
[ "BSD-3-Clause" ]
6
2021-07-14T08:43:20.000Z
2022-02-02T19:40:26.000Z
dtApp/dtCode/crossvalidation.py
Digital-Twin-Operational-Platform/Cristallo
20e21f6ae0f0f99002a229c8c966fd72020698c3
[ "BSD-3-Clause" ]
null
null
null
dtApp/dtCode/crossvalidation.py
Digital-Twin-Operational-Platform/Cristallo
20e21f6ae0f0f99002a229c8c966fd72020698c3
[ "BSD-3-Clause" ]
2
2021-07-05T08:08:43.000Z
2022-03-28T09:46:02.000Z
''' This function compares the experimental FRFs of each structure with the simulated FRFs of their respective numerical models. ''' from flask import render_template from dtApp import app from dtApp import date import plotly import plotly.graph_objs as go from plotly.subplots import make_subplots import pandas as pd import numpy as np import json from dtLib.crossval.example import tSW,tSO,tSH,tBR,youtSW,youtSO,youtSH,youtBR from dtLib.crossval.example import tNumSW,tNumSWmiddle,tNumSO,tNumSH,tNumBR,tNumSHmiddle,youtNumSW,youtNumSO,youtNumSH,youtNumBR @app.route('/crossval')#@app.route('/ExpValidation_Updated') def ExpValidation_Updated(): return render_template('crossvalidation.html',date=date) @app.route('/crossval_1') def Exp_Data(): """ This function gathers the experimental data and displays them. """ # Figure1 fig1 = make_subplots(rows=2, cols=2,vertical_spacing=0.15, subplot_titles=("<b>Prototype 1<b>","<b>Prototype 2<b>", "<b>Prototype 3<b>", "<b>Prototype 4<b>")) # Fig1.a fig1.add_scatter(x=tSW,y=youtSW[0], name='Acc floor 1', mode = 'lines', row=1, col=1) fig1.add_scatter(x=tSW,y=youtSW[1], name='Acc floor 2', mode = 'lines', row=1, col=1) fig1.add_scatter(x=tSW,y=youtSW[2], name='Acc floor 3', mode = 'lines', row=1, col=1) # Update xaxis properties fig1.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=1, col=1) # Update yaxis properties fig1.update_yaxes(title_text="dB", titlefont=dict(size=15), row=1, col=1) ## Fig1.b fig1.add_scatter(x=tSO,y=youtSO[0], name='Acc floor 1', mode = 'lines', row=1, col=2) fig1.add_scatter(x=tSO,y=youtSO[1], name='Acc floor 2', mode = 'lines', row=1, col=2) fig1.add_scatter(x=tSO,y=youtSO[2], name='Acc floor 3', mode = 'lines', row=1, col=2) # Update xaxis properties fig1.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=1, col=2) # Update yaxis properties fig1.update_yaxes(title_text="dB", titlefont=dict(size=15), row=1, col=2) #Fig1.c fig1.add_scatter(x=tSH,y=youtSH[0], name='Acc floor 1', mode = 'lines', row=2, col=1) fig1.add_scatter(x=tSH,y=youtSH[1], name='Acc floor 2', mode = 'lines', row=2, col=1) fig1.add_scatter(x=tSH,y=youtSH[2], name='Acc floor 3', mode = 'lines', row=2, col=1) # Update xaxis properties fig1.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=2, col=1) # Update yaxis properties fig1.update_yaxes(title_text="dB", titlefont=dict(size=15), row=2, col=1) #Fig1.d fig1.add_scatter(x=tBR,y=youtBR[0], name='Acc floor 1', mode = 'lines', row=2, col=2) fig1.add_scatter(x=tBR,y=youtBR[1], name='Acc floor 2', mode = 'lines', row=2, col=2) fig1.add_scatter(x=tBR,y=youtBR[2], name='Acc floor 3', mode = 'lines', row=2, col=2) # Update xaxis properties fig1.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=2, col=2) # Update yaxis properties fig1.update_yaxes(title_text="dB", titlefont=dict(size=15), row=2, col=2) # Update Figure properties fig1.update_layout(title_text="<b>--- Experimental Data ---<b>", font=dict(size=20), width=1650, height=600) fig1.update_layout(showlegend=True, font=dict(size=15)) fig1.update_layout(height=800, width=1400) fig1.update_layout(title={'y':0.99,'x':0.48,'xanchor': 'center'}) graph1 = json.dumps(fig1, cls=plotly.utils.PlotlyJSONEncoder) return render_template('crossvalidation_1.html', plot1=graph1,date=date) @app.route('/crossval_2') def Exp_Num_Data(): """ This function compares the experimental and numerical data for each prototype This does not compare the different prototypes """ # Figure3 fig3 = make_subplots(rows=2, cols=2,vertical_spacing=0.15, subplot_titles=("<b>Prototype 1<b>","<b>Prototype 2<b>", "<b>Prototype 3<b>", "<b>Prototype 4<b>")) # Fig3.a fig3.add_scatter(x=tSW,y=youtSW[0], name='Exp Data', mode = 'lines', row=1, col=1) fig3.add_scatter(x=tNumSW,y=youtNumSW[0], name='Num Data', mode = 'markers', marker=dict(size= 1.5), row=1, col=1) # Update xaxis properties fig3.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=1, col=1) # Update yaxis properties fig3.update_yaxes(title_text="dB", titlefont=dict(size=15),row=1,col=1) ## Fig3.b fig3.add_scatter(x=tSO,y=youtSO[0], name='Exp Data', mode = 'lines', row=1, col=2) fig3.add_scatter(x=tNumSO,y=youtNumSO[0], name='Num Data', mode = 'markers', marker=dict(size= 1.5), row=1, col=2) # Update xaxis properties fig3.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=1, col=2) # Update yaxis properties fig3.update_yaxes(title_text="dB", titlefont=dict(size=15),row=1,col=2) #Fig3.c fig3.add_scatter(x=tSH,y=youtSH[0], name='Exp Data', mode = 'lines', row=2, col=1) fig3.add_scatter(x=tNumSH,y=youtNumSH[0], name='Num Data', mode = 'markers', marker=dict(size= 1.5), row=2, col=1) # Update xaxis properties fig3.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=2, col=1) # Update yaxis properties fig3.update_yaxes(title_text="dB", titlefont=dict(size=15),row=2,col=1) #Fig3.d fig3.add_scatter(x=tBR,y=youtBR[0], name='Exp Data', mode = 'lines', row=2, col=2) fig3.add_scatter(x=tNumBR,y=youtNumBR[0], name='Num Data', mode = 'markers', marker=dict(size= 3), row=2, col=2) # Update xaxis properties fig3.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=2, col=2) # Update yaxis properties fig3.update_yaxes(title_text="dB", titlefont=dict(size=15),row=2,col=2) # Update Figure properties fig3.update_layout(title_text="<b>--- Experimental vs Numerical Data ---<b>", font=dict(size=20), width=1650, height=600) fig3.update_layout(showlegend=True, font=dict(size=15)) fig3.update_layout(height=800, width=1400) fig3.update_layout(title={'y':0.99,'x':0.48,'xanchor': 'center'}) graph3 = json.dumps(fig3, cls=plotly.utils.PlotlyJSONEncoder) return render_template('crossvalidation_2.html', plot3=graph3,date=date) @app.route('/crossval_3')# @app.route('/Num_Data') def Num_Data(): """ This function displays the numerical results for each prototype """ # Figure2 fig2 = make_subplots(rows=2, cols=2, shared_xaxes=True, vertical_spacing=0.15, subplot_titles=("<b>Prototype 1<b>","<b>Prototype 2<b>", "<b>Prototype 3<b>", "<b>Prototype 4<b>")) # Fig2.a fig2.add_scatter(x=tNumSW,y=youtNumSW[0], name='Acc floor 1', mode = 'lines', row=1, col=1) fig2.add_scatter(x=tNumSWmiddle,y=youtNumSW[1], name='Acc floor 2', mode = 'lines', row=1, col=1) fig2.add_scatter(x=tNumSW,y=youtNumSW[2], name='Acc floor 3', mode = 'lines', row=1, col=1) # Update xaxis properties fig2.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=1, col=1) # Update yaxis properties fig2.update_yaxes(title_text="dB", titlefont=dict(size=15), row=1, col=1) ## Fig2.b fig2.add_scatter(x=tNumSO,y=youtNumSO[0], name='Acc floor 1', mode = 'lines', row=1, col=2) fig2.add_scatter(x=tNumSO,y=youtNumSO[1], name='Acc floor 2', mode = 'lines', row=1, col=2) fig2.add_scatter(x=tNumSO,y=youtNumSO[2], name='Acc floor 3', mode = 'lines', row=1, col=2) # Update xaxis properties fig2.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=1, col=2) # Update yaxis properties fig2.update_yaxes(title_text="dB", titlefont=dict(size=15), row=1, col=2) #Fig2.c fig2.add_scatter(x=tNumSH,y=youtNumSH[0], name='Acc floor 1', mode = 'lines', row=2, col=1) fig2.add_scatter(x=tNumSHmiddle,y=youtNumSH[1], name='Acc floor 2', mode = 'lines', row=2, col=1) fig2.add_scatter(x=tNumSH,y=youtNumSH[2], name='Acc floor 3', mode = 'lines', row=2, col=1) # Update xaxis properties fig2.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=2, col=1) # Update yaxis properties fig2.update_yaxes(title_text="dB", titlefont=dict(size=15), row=2, col=1) #Fig2.d fig2.add_scatter(x=tNumBR,y=youtNumBR[0], name='Acc floor 1', mode = 'lines', row=2, col=2) fig2.add_scatter(x=tNumBR,y=youtNumBR[1], name='Acc floor 2', mode = 'lines', row=2, col=2) fig2.add_scatter(x=tNumBR,y=youtNumBR[2], name='Acc floor 3', mode = 'lines', row=2, col=2) # Update xaxis properties fig2.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=15), row=2, col=2) # Update yaxis properties fig2.update_yaxes(title_text="dB", titlefont=dict(size=15), row=2, col=2) # Update Figure properties fig2.update_layout(title_text="<b>--- Numerical Data ---<b>", font=dict(size=20), width=1650, height=600) fig2.update_layout(showlegend=True, font=dict(size=15)) fig2.update_layout(height=800, width=1400) fig2.update_layout(title={'y':0.99,'x':0.48,'xanchor': 'center'}) graph2 = json.dumps(fig2, cls=plotly.utils.PlotlyJSONEncoder) return render_template('crossvalidation_3.html', plot2=graph2,date=date) @app.route('/crossval_4') # @app.route('/Exp_Exp_Data') def Exp_Exp_Data(): """ This compares the experimental data across all the prototypes to denote manufacturing/testing variability """ # Figure4 fig4 = make_subplots(rows=1, cols=1, shared_xaxes=True, vertical_spacing=0.01) fig4.add_scatter(x=tSW,y=youtSW[0], name='Prototype 1 - Exp Data', mode = 'lines', row=1, col=1) fig4.add_scatter(x=tSO,y=youtSO[0], name='Prototype 2 - Exp Data', mode = 'lines', row=1, col=1) fig4.add_scatter(x=tSH,y=youtSH[0], name='Prototype 3 - Exp Data', mode = 'lines', row=1, col=1) fig4.add_scatter(x=tBR,y=youtBR[0], name='Prototype 4 - Exp Data', mode = 'lines', row=1, col=1) # Update xaxis properties fig4.update_xaxes(title_text="Freq (Hz)", titlefont=dict(size=20), row=1, col=1) # Update yaxis properties fig4.update_yaxes(title_text="dB", titlefont=dict(size=20),row=1,col=1) # Update Figure properties fig4.update_layout(title_text="<b>--- Experimental vs Experimental Data ---<b>", font=dict(size=20), width=1600, height=800) fig4.update_layout(showlegend=True, font=dict(size=15)) fig4.update_layout(title={'y':0.99,'x':0.48,'xanchor': 'center'}) graph4 = json.dumps(fig4, cls=plotly.utils.PlotlyJSONEncoder) return render_template('crossvalidation_4.html', plot4=graph4,date=date)
48.347222
128
0.683424
1,700
10,443
4.111765
0.099412
0.043491
0.056652
0.065236
0.81774
0.77711
0.748641
0.726323
0.589413
0.549499
0
0.054722
0.144307
10,443
215
129
48.572093
0.727507
0.13454
0
0.026316
0
0
0.148289
0.009871
0
0
0
0
0
1
0.04386
false
0
0.096491
0.008772
0.184211
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
e2bb4ba3faa14f8b8d3ac9771a18994ccc20f6d5
89
py
Python
PEATSA/Database/__init__.py
shambo001/peat
7a26e896aa9914b084a9064df09ed15df4047cf3
[ "MIT" ]
3
2016-11-11T06:11:03.000Z
2021-09-12T22:13:51.000Z
PEATSA/Database/__init__.py
shambo001/peat
7a26e896aa9914b084a9064df09ed15df4047cf3
[ "MIT" ]
null
null
null
PEATSA/Database/__init__.py
shambo001/peat
7a26e896aa9914b084a9064df09ed15df4047cf3
[ "MIT" ]
2
2016-02-15T16:10:36.000Z
2018-02-27T10:33:21.000Z
'''Module containing classes and functions for working with PEATSA data in a database'''
44.5
88
0.786517
13
89
5.384615
1
0
0
0
0
0
0
0
0
0
0
0
0.146067
89
1
89
89
0.921053
0.921348
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
e2eec5185b77f29d0517f4292a2838f6b74f9a8d
55
py
Python
3rdparty/rpcz/python/rpcz/service.py
marinadudarenko/bigartm
c7072663581c59e970ef165a577dc4969810a19d
[ "Apache-2.0" ]
97
2015-01-08T17:10:25.000Z
2022-03-05T02:29:44.000Z
3rdparty/rpcz/python/rpcz/service.py
marinadudarenko/bigartm
c7072663581c59e970ef165a577dc4969810a19d
[ "Apache-2.0" ]
18
2015-01-17T12:14:14.000Z
2017-03-26T04:19:09.000Z
3rdparty/rpcz/python/rpcz/service.py
marinadudarenko/bigartm
c7072663581c59e970ef165a577dc4969810a19d
[ "Apache-2.0" ]
41
2015-01-10T17:37:42.000Z
2021-06-25T07:58:48.000Z
#!/usr/bin/env python class Service(object): pass
11
22
0.672727
8
55
4.625
1
0
0
0
0
0
0
0
0
0
0
0
0.181818
55
4
23
13.75
0.822222
0.363636
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
391d31aaf7030fff770c4b9eca9f9246d8d5703e
284
py
Python
luciani/algorithms/__init__.py
mastrogiovanni/rmi-luciani
51efd07ac61660438b11c9d877967f454240d0c1
[ "Apache-2.0" ]
null
null
null
luciani/algorithms/__init__.py
mastrogiovanni/rmi-luciani
51efd07ac61660438b11c9d877967f454240d0c1
[ "Apache-2.0" ]
null
null
null
luciani/algorithms/__init__.py
mastrogiovanni/rmi-luciani
51efd07ac61660438b11c9d877967f454240d0c1
[ "Apache-2.0" ]
null
null
null
from .centrality import * from .clustering import * # from .generative import * from .modularity import * from .core import * from .degree import * from .distance import * # from .motifs import * from .physical_connectivity import * from .reference import * from .similarity import *
23.666667
36
0.753521
34
284
6.264706
0.411765
0.469484
0
0
0
0
0
0
0
0
0
0
0.161972
284
11
37
25.818182
0.894958
0.165493
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
3948671ddb912a2a1243695fe32740345b2a96d3
351
py
Python
statzcw/exam2_tests.py
WesleyThorpe/Py21-BasicStats
55f67c61eff2aa0ca2bd9b5c886f1e188514fde7
[ "MIT" ]
null
null
null
statzcw/exam2_tests.py
WesleyThorpe/Py21-BasicStats
55f67c61eff2aa0ca2bd9b5c886f1e188514fde7
[ "MIT" ]
null
null
null
statzcw/exam2_tests.py
WesleyThorpe/Py21-BasicStats
55f67c61eff2aa0ca2bd9b5c886f1e188514fde7
[ "MIT" ]
null
null
null
import math class Solution(object): def add_digits(num): #return (num - 1) % 9 + 1 if num > 0 else 0 #print(add_digits(48)) #print(add_digits(59)) class Solution(object): def add_digits(self, val:int): val = int sum_int = 0 While float(val)/10>=.1 r = n%10 sum_int +=
16.714286
51
0.527066
51
351
3.509804
0.529412
0.201117
0.212291
0.24581
0.346369
0.346369
0
0
0
0
0
0.065789
0.350427
351
21
52
16.714286
0.719298
0.239316
0
0.2
0
0
0
0
0
0
0
0
0
0
null
null
0
0.1
null
null
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
1
0
0
0
0
0
0
0
0
4
1a4f0bbce5fa3e0d1a8ca820cf13a531c3877567
86
py
Python
app/API/v0/__init__.py
Goomba41/site.cgako
9f0ec58c1730f7ea9c69fc307eff79648d9a974f
[ "Apache-2.0" ]
null
null
null
app/API/v0/__init__.py
Goomba41/site.cgako
9f0ec58c1730f7ea9c69fc307eff79648d9a974f
[ "Apache-2.0" ]
4
2019-06-27T19:01:31.000Z
2021-06-02T00:24:11.000Z
app/API/v0/__init__.py
Goomba41/site.cgako
9f0ec58c1730f7ea9c69fc307eff79648d9a974f
[ "Apache-2.0" ]
1
2019-06-27T18:58:39.000Z
2019-06-27T18:58:39.000Z
#! env/bin/python3.6 # -*- coding: utf8 -*- """Инициализация пакета API версии 0."""
17.2
40
0.616279
11
86
4.818182
1
0
0
0
0
0
0
0
0
0
0
0.054795
0.151163
86
4
41
21.5
0.671233
0.872093
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
1a50cdfbdb469584d70aa18e6832a197c42df676
69
py
Python
OOP/dota3test.py
SyamsulAlterra/Alta
13e8c185e91414e3f46e5d20f39370f8e58e7cd0
[ "MIT" ]
null
null
null
OOP/dota3test.py
SyamsulAlterra/Alta
13e8c185e91414e3f46e5d20f39370f8e58e7cd0
[ "MIT" ]
6
2021-09-02T18:50:40.000Z
2022-02-27T11:06:31.000Z
OOP/dota3test.py
SyamsulAlterra/Alta
13e8c185e91414e3f46e5d20f39370f8e58e7cd0
[ "MIT" ]
null
null
null
from dota3 import Hero, Game battlefield=Game() battlefield.start()
13.8
28
0.782609
9
69
6
0.777778
0.555556
0
0
0
0
0
0
0
0
0
0.016393
0.115942
69
4
29
17.25
0.868852
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
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
1a59ff3d49df131f9536260f111840a68525b875
4,984
py
Python
backend/garpix_page/codegenerator.py
griviala/garpix_page
55f1d9bc6d1de29d18e15369bebcbef18811b5a4
[ "MIT" ]
18
2021-05-12T09:56:56.000Z
2022-02-09T07:15:50.000Z
backend/garpix_page/codegenerator.py
griviala/garpix_page
55f1d9bc6d1de29d18e15369bebcbef18811b5a4
[ "MIT" ]
9
2021-08-30T07:56:11.000Z
2022-02-16T08:44:46.000Z
backend/garpix_page/codegenerator.py
griviala/garpix_page
55f1d9bc6d1de29d18e15369bebcbef18811b5a4
[ "MIT" ]
6
2021-03-18T08:20:19.000Z
2021-12-27T08:25:58.000Z
import os from django.conf import settings from .constants import * def snake_to_camel_case(text_snake): return '{}'.format( text_snake.title().replace('_', ''), ) def create_file(directory, file_name, file_content): path = os.path.join(directory, file_name) if not os.path.isfile(path): with open(path, 'w') as f: f.write(file_content) def create_or_append_file(directory, file_name, file_content): path = os.path.join(directory, file_name) if not os.path.isfile(path): create_file(directory, file_name, file_content) else: with open(path, 'r') as f: lines = f.readlines() if file_content in lines: return with open(path, 'a') as f: f.write(file_content) def generate_page(app, page, base): base_directory = os.path.abspath(os.path.join(settings.BASE_DIR)) available_bases = ['page', 'list', 'search'] if base not in available_bases: raise Exception(f'Неправильно выбран параметр base. Допустимые значения: {", ".join(available_bases)}') # create models directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_MODEL.format(app=app, page=page))) os.makedirs( directory, exist_ok=True ) # models page base_name = os.path.basename(FILE_NAME_MODEL.format(app=app, page=page)) content = FILE_CONTENT_MODEL_DICT[base].format(app=app, page=page, page_capitalize=snake_to_camel_case(page)) create_file(directory, base_name, content) # models init base_name = os.path.basename(FILE_NAME_MODEL_INIT.format(app=app, page=page)) content = FILE_CONTENT_MODEL_INIT.format(page=page, page_capitalize=snake_to_camel_case(page)) create_or_append_file(directory, base_name, content) print(f'Не забудьте поменять verbose_name и verbose_name_plural в файлах: backend/{FILE_NAME_MODEL.format(app=app, page=page)}') # create admin directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_ADMIN.format(app=app, page=page))) os.makedirs( directory, exist_ok=True ) # admin page base_name = os.path.basename(FILE_NAME_ADMIN.format(app=app, page=page)) content = FILE_CONTENT_ADMIN.format(app=app, page=page, page_capitalize=snake_to_camel_case(page)) create_file(directory, base_name, content) # admin init base_name = os.path.basename(FILE_NAME_ADMIN_INIT.format(app=app, page=page)) content = FILE_CONTENT_ADMIN_INIT.format(page=page, page_capitalize=snake_to_camel_case(page)) create_or_append_file(directory, base_name, content) # create translation directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_TRANSLATION.format(app=app, page=page))) os.makedirs( directory, exist_ok=True ) # translation page base_name = os.path.basename(FILE_NAME_TRANSLATION.format(app=app, page=page)) content = FILE_CONTENT_TRANSLATION.format(app=app, page=page, page_capitalize=snake_to_camel_case(page)) create_file(directory, base_name, content) # translation init base_name = os.path.basename(FILE_NAME_TRANSLATION_INIT.format(app=app, page=page)) content = FILE_CONTENT_TRANSLATION_INIT.format(page=page, page_capitalize=snake_to_camel_case(page)) create_or_append_file(directory, base_name, content) # create template directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_TEMPLATE.format(page=page))) os.makedirs( directory, exist_ok=True ) # template page base_name = os.path.basename(FILE_NAME_TEMPLATE.format(page=page)) content = FILE_CONTENT_TEMPLATE_DICT[base] create_file(directory, base_name, content) # create app init directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_APP_INIT.format(app=app))) os.makedirs( directory, exist_ok=True ) # app init base_name = os.path.basename(FILE_NAME_APP_INIT.format(app=app)) content = FILE_CONTENT_APP_INIT.format(app=app, app_capitalize=snake_to_camel_case(app)) create_file(directory, base_name, content) # create app apps directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_APPS.format(app=app))) os.makedirs( directory, exist_ok=True ) # app apps base_name = os.path.basename(FILE_NAME_APPS.format(app=app)) content = FILE_CONTENT_APPS.format(app=app, app_capitalize=snake_to_camel_case(app)) create_file(directory, base_name, content) print(f'Не забудьте проверить, что verbose_name указан верно в файле: backend/{FILE_NAME_APPS.format(app=app)}') # create migrations directory = os.path.join(base_directory, os.path.dirname(FILE_NAME_MIGRATIONS_INIT.format(app=app))) os.makedirs( directory, exist_ok=True ) # app apps base_name = os.path.basename(FILE_NAME_MIGRATIONS_INIT.format(app=app)) create_file(directory, base_name, '')
38.9375
132
0.713483
704
4,984
4.791193
0.12642
0.053365
0.078269
0.061666
0.805218
0.793656
0.75126
0.707382
0.571598
0.478506
0
0
0.177769
4,984
127
133
39.244094
0.823084
0.046549
0
0.382979
0
0.021277
0.06823
0.021969
0
0
0
0
0
1
0.042553
false
0
0.031915
0.010638
0.095745
0.021277
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
1a6c1a2f2b1af0f395f1685f8eccd6408ca00b97
2,020
py
Python
m2isar/metamodel/behav.py
fabianpedd/M2-ISA-R
c26208d5b344d903d6ad1356f88e3fe42ee665e2
[ "Apache-2.0" ]
null
null
null
m2isar/metamodel/behav.py
fabianpedd/M2-ISA-R
c26208d5b344d903d6ad1356f88e3fe42ee665e2
[ "Apache-2.0" ]
null
null
null
m2isar/metamodel/behav.py
fabianpedd/M2-ISA-R
c26208d5b344d903d6ad1356f88e3fe42ee665e2
[ "Apache-2.0" ]
null
null
null
from typing import List, Union, TYPE_CHECKING if TYPE_CHECKING: from .arch import Scalar, Function class BaseNode: def generate(self, context): raise NotImplementedError() class Operator(BaseNode): def __init__(self, op: str): self.value = op class Operation(BaseNode): def __init__(self, statements: List[BaseNode]) -> None: self.statements = statements class BinaryOperation(BaseNode): def __init__(self, left: BaseNode, op: Operator, right: BaseNode): self.left = left self.op = op self.right = right class NumberLiteral(BaseNode): def __init__(self, value): self.value = value class Assignment(BaseNode): def __init__(self, target: BaseNode, expr: BaseNode): self.target = target self.expr = expr class Conditional(BaseNode): def __init__(self, cond: BaseNode, then_stmts: List[BaseNode], else_stmts: List[BaseNode]): self.cond = cond self.then_stmts = then_stmts if then_stmts is not None else [] self.else_stmts = else_stmts if else_stmts is not None else [] class ScalarDefinition(BaseNode): def __init__(self, scalar: "Scalar"): self.scalar = scalar class Return(BaseNode): def __init__(self, expr: BaseNode): self.expr = expr class UnaryOperation(BaseNode): def __init__(self, op: Operator, right: BaseNode): self.op = op self.right = right class NamedReference(BaseNode): def __init__(self, reference): self.reference = reference class IndexedReference(BaseNode): def __init__(self, reference, index): self.reference = reference self.index = index class TypeConv(BaseNode): def __init__(self, data_type, size, expr: BaseNode): self.data_type = data_type self.size = size self.expr = expr class Callable(BaseNode): def __init__(self, ref_or_name: Union[str, "Function"], args: List[BaseNode]) -> None: self.ref_or_name = ref_or_name self.args = args if args is not None else [] class FunctionCall(Callable): pass class ProcedureCall(Callable): pass class Group(BaseNode): def __init__(self, expr: BaseNode): self.expr = expr
24.938272
92
0.740099
272
2,020
5.220588
0.220588
0.116197
0.147887
0.187324
0.242958
0.098592
0.098592
0.060563
0.060563
0
0
0
0.152475
2,020
81
93
24.938272
0.829439
0
0
0.225806
1
0
0.006927
0
0
0
0
0
0
1
0.241935
false
0.032258
0.032258
0
0.548387
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
1acee4c2ecd880c8610d0278af4d36b30f3627ef
134
py
Python
1.Chapter-Python/presentation/ch02/__init__.py
zinebabercha/zineb-abercha
7d477eb7f7b642ea6117eff7c4a132b9aba85a78
[ "CC0-1.0" ]
8
2018-07-09T07:01:28.000Z
2020-09-01T06:31:52.000Z
1.Chapter-Python/presentation/ch02/__init__.py
zinebabercha/zineb-abercha
7d477eb7f7b642ea6117eff7c4a132b9aba85a78
[ "CC0-1.0" ]
null
null
null
1.Chapter-Python/presentation/ch02/__init__.py
zinebabercha/zineb-abercha
7d477eb7f7b642ea6117eff7c4a132b9aba85a78
[ "CC0-1.0" ]
1
2018-10-15T06:29:17.000Z
2018-10-15T06:29:17.000Z
__all__ = ['credit_card', 'predatory_credit_card', 'progressions', 'range', 'sequence_abc', 'sequence_iterator', 'vector']
44.666667
75
0.679104
13
134
6.307692
0.769231
0.243902
0
0
0
0
0
0
0
0
0
0
0.149254
134
2
76
67
0.719298
0
0
0
0
0
0.626866
0.156716
0
0
0
0
0
1
0
false
0
0
0
0
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
46e05d38aff3e0052ab4a4fde78ea899c4c6f7cf
39
py
Python
euler/template.py
rdewalt/python_training
cbec6e3efa34a5693135a703bbed5904186209b6
[ "Unlicense" ]
null
null
null
euler/template.py
rdewalt/python_training
cbec6e3efa34a5693135a703bbed5904186209b6
[ "Unlicense" ]
null
null
null
euler/template.py
rdewalt/python_training
cbec6e3efa34a5693135a703bbed5904186209b6
[ "Unlicense" ]
null
null
null
#!/usr/bin/python # Project Euler # #
7.8
17
0.615385
5
39
4.8
1
0
0
0
0
0
0
0
0
0
0
0
0.179487
39
4
18
9.75
0.75
0.769231
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
2001e0cb73ae782838eeb7dbc4df09b1611640e2
3,455
py
Python
src/backend/rrflow/config.py
rropen/rrflow
61bc4b0be4efbd840af8f7ad442922052d3e449c
[ "MIT" ]
null
null
null
src/backend/rrflow/config.py
rropen/rrflow
61bc4b0be4efbd840af8f7ad442922052d3e449c
[ "MIT" ]
null
null
null
src/backend/rrflow/config.py
rropen/rrflow
61bc4b0be4efbd840af8f7ad442922052d3e449c
[ "MIT" ]
null
null
null
from pydantic import BaseSettings import os from dotenv import load_dotenv from functools import lru_cache load_dotenv() def generate_db_string( ENV: str, DBHOST: str, DBPORT: str, DBNAME: str, DBUSER: str, DBPASS: str ): # pragma: no cover """Take in env variables and generate correct db string.""" if ENV == "test": # TODO: Implement "test" environment variable db connection string return "mongomock://localhost" pass if ENV == "local": # return "mongodb://localhost:/27017" # local mongodb for local development # return "mongodb://{}:{}@{}:{}/{}?authSource=admin".format(DBUSER, DBPASS, DBHOST, DBPORT, DBNAME) return "mongodb://{}:{}/".format(DBHOST, DBPORT) if ENV == "development" or "production": # TODO: Implement "dev,prod" environment variable db connection string pass class Settings(BaseSettings): """ App settings class. These values should be exposed as environment variables. If running locally, this can be a `.env` file (see included `.env.example` file). If running in another enviornment you should use a modern approach to manage secrets. Many of these values are secrets and should not be exposed in the source code or to a user of the application. Many settings and decisions are based on the `ENV` variable's value. APP_NAME: name of the app hard-coded here ENV: Marker of the environment. acceptable values are test, local, development, and production DEBUG: Boolean on whether debugging log messages should be visible. TESTING: Boolean on whether you are running unit or integration tests. Among other things, this will drive an in-memory database to be used. SECRET_KEY: Long random string of characters to use in hashing and encryption. Don't expose this value. ADMIN_KEY: Long string that will set the admin key used to generate new project keys. FRONTEND_URL: Location from which API requests will be made by the frontend. This will need refactored if we start to have other tools using this API. DBHOST: Hostname for a database used in building a connection string DBPORT: Port where the database is found DBNAME: Database name used in building a connection string DBUSER: Username used in building a connection string DBPASS: User's Password used in building a connection string AZURELOGGING_CONN_STR: Connection string to azure log handler """ APP_NAME: str = "vvuq" # dev or test ENV: str = os.environ.get("ENV") or "test" DEBUG: bool = os.getenv("DEBUG", "False") == "True" TESTING: bool = os.getenv("TESTING", "False") == "True" SECRET_KEY: str = os.environ.get("SECRET_KEY") or "unset" ADMIN_KEY: str = os.environ.get("ADMIN_KEY") or "unset" FRONTEND_URL: str = os.environ.get("FRONTEND_URL") or "unset" DBHOST: str = os.environ.get("DBHOST") or "unset" DBPORT: str = os.environ.get("DBPORT") or "unset" DBNAME: str = os.environ.get("DBNAME") or "unset" DBUSER: str = os.environ.get("DBUSER") or "unset" DBPASS: str = os.environ.get("DBPASS") or "unset" AZURELOGGING_CONN_STR: str = os.environ.get("AZURELOGGING_CONN_STR") or "unset" GITHUB_API_TOKEN: str = os.environ.get("GITHUB_API_TOKEN") or "unset" CONN_STR: str = generate_db_string(ENV, DBHOST, DBPORT, DBNAME, DBUSER, DBPASS) @lru_cache() def get_settings() -> Settings: return Settings() # reads environment variables
50.072464
433
0.707381
496
3,455
4.864919
0.346774
0.022793
0.054704
0.06838
0.096975
0.051388
0
0
0
0
0
0.001802
0.197106
3,455
68
434
50.808824
0.868061
0.545297
0
0.058824
1
0
0.171697
0.028169
0
0
0
0.014706
0
1
0.058824
false
0.147059
0.117647
0.029412
0.735294
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
0
0
1
0
0
1
0
0
4
200b478ebc090c9f3989f0615a84a29555052e43
126
py
Python
Code Accdemy/Strings_immutable.py
JackVoice/Testing
11e1b83c7b2e51fa0a8cdde67c5c1eab650e018a
[ "Unlicense" ]
null
null
null
Code Accdemy/Strings_immutable.py
JackVoice/Testing
11e1b83c7b2e51fa0a8cdde67c5c1eab650e018a
[ "Unlicense" ]
null
null
null
Code Accdemy/Strings_immutable.py
JackVoice/Testing
11e1b83c7b2e51fa0a8cdde67c5c1eab650e018a
[ "Unlicense" ]
null
null
null
first_name = "Bob" last_name = "Daily" #first_name[0] = "R" fixed_first_name = "R" + first_name[-2:] print(fixed_first_name)
18
40
0.698413
21
126
3.809524
0.47619
0.5625
0.35
0
0
0
0
0
0
0
0
0.018182
0.126984
126
6
41
21
0.709091
0.150794
0
0
0
0
0.084906
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2018f527a3c44bdeb30eb744082209a343bc4222
248
py
Python
src/msdp/mysite/analytics/forms.py
shanebird92/MSDP
a364c27befd7f20c4312f75fd20e91de8a129725
[ "MIT" ]
1
2019-02-14T20:39:26.000Z
2019-02-14T20:39:26.000Z
src/msdp/mysite/analytics/forms.py
shanebird92/MSDP
a364c27befd7f20c4312f75fd20e91de8a129725
[ "MIT" ]
null
null
null
src/msdp/mysite/analytics/forms.py
shanebird92/MSDP
a364c27befd7f20c4312f75fd20e91de8a129725
[ "MIT" ]
null
null
null
from django import forms from .models import Analytics class AnalyticsForm(forms.ModelForm): class Meta: model = Analytics #fields = ['TripId', 'DayOfService', 'ProgrNumber', 'StopPointId'] fields = ['LineId', 'Month']
27.555556
74
0.66129
24
248
6.833333
0.75
0
0
0
0
0
0
0
0
0
0
0
0.217742
248
8
75
31
0.845361
0.262097
0
0
0
0
0.06044
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
20347f45da5bf176ca1ea3d8b2df0c915a05b00a
119
py
Python
scikit-learn/scikit-learn-contrib/imbalanced-learn.py
kingreatwill/penter
2d027fd2ae639ac45149659a410042fe76b9dab0
[ "MIT" ]
13
2020-01-04T07:37:38.000Z
2021-08-31T05:19:58.000Z
scikit-learn/scikit-learn-contrib/imbalanced-learn.py
kingreatwill/penter
2d027fd2ae639ac45149659a410042fe76b9dab0
[ "MIT" ]
3
2020-06-05T22:42:53.000Z
2020-08-24T07:18:54.000Z
scikit-learn/scikit-learn-contrib/imbalanced-learn.py
kingreatwill/penter
2d027fd2ae639ac45149659a410042fe76b9dab0
[ "MIT" ]
9
2020-10-19T04:53:06.000Z
2021-08-31T05:20:01.000Z
# pip install -U imbalanced-learn # 处理不均衡数据 """ 欠采样 under_sampling 把多的砍掉 上/过采样 Over sampling 把少的数据样本补齐 联合采样 集成采样 """
13.222222
33
0.739496
17
119
5.117647
0.941176
0
0
0
0
0
0
0
0
0
0
0
0.168067
119
9
34
13.222222
0.878788
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
644e0abccfb66f7bd05d5e83957a4b278d785908
21
py
Python
blog/migrations/__init__.py
kpi-web-guild/django-girls-blog-igorkruglyak
97bc1df281377b81f70098ae2bb830d2d8ae7447
[ "MIT" ]
null
null
null
blog/migrations/__init__.py
kpi-web-guild/django-girls-blog-igorkruglyak
97bc1df281377b81f70098ae2bb830d2d8ae7447
[ "MIT" ]
33
2019-05-20T01:06:16.000Z
2021-01-09T18:16:33.000Z
blog/migrations/__init__.py
kpi-web-guild/django-girls-blog-igorkruglyak
97bc1df281377b81f70098ae2bb830d2d8ae7447
[ "MIT" ]
2
2019-08-02T19:44:14.000Z
2021-01-08T21:28:04.000Z
"""DB migrations."""
10.5
20
0.571429
2
21
6
1
0
0
0
0
0
0
0
0
0
0
0
0.095238
21
1
21
21
0.631579
0.666667
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
6453bd37c7b49bf2e6ee2b03d0379839e9bd0b19
2,910
py
Python
z2/part3/updated_part2_batch/jm/parser_errors_2/788796976.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
1
2020-04-16T12:13:47.000Z
2020-04-16T12:13:47.000Z
z2/part3/updated_part2_batch/jm/parser_errors_2/788796976.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
18
2020-03-06T17:50:15.000Z
2020-05-19T14:58:30.000Z
z2/part3/updated_part2_batch/jm/parser_errors_2/788796976.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
18
2020-03-06T17:45:13.000Z
2020-06-09T19:18:31.000Z
from part1 import ( gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new, ) """ scenario: test_random_actions uuid: 788796976 """ """ random actions, total chaos """ board = gamma_new(3, 5, 4, 5) assert board is not None assert gamma_move(board, 1, 0, 4) == 1 board535480128 = gamma_board(board) assert board535480128 is not None assert board535480128 == ("1..\n" "...\n" "...\n" "...\n" "...\n") del board535480128 board535480128 = None assert gamma_move(board, 2, 2, 1) == 1 assert gamma_move(board, 2, 0, 0) == 1 assert gamma_move(board, 3, 0, 2) == 1 assert gamma_move(board, 3, 2, 3) == 1 assert gamma_move(board, 4, 0, 4) == 0 assert gamma_move(board, 4, 1, 1) == 1 assert gamma_move(board, 1, 3, 1) == 0 assert gamma_move(board, 2, 3, 1) == 0 assert gamma_move(board, 3, 0, 1) == 1 assert gamma_move(board, 3, 0, 3) == 1 assert gamma_move(board, 4, 0, 2) == 0 assert gamma_move(board, 1, 1, 1) == 0 assert gamma_move(board, 1, 1, 1) == 0 assert gamma_move(board, 2, 1, 1) == 0 assert gamma_move(board, 3, 3, 1) == 0 assert gamma_move(board, 4, 2, 2) == 1 assert gamma_move(board, 4, 2, 3) == 0 assert gamma_free_fields(board, 4) == 6 assert gamma_move(board, 1, 0, 1) == 0 assert gamma_move(board, 2, 0, 2) == 0 assert gamma_move(board, 2, 1, 3) == 1 assert gamma_move(board, 3, 0, 4) == 0 assert gamma_move(board, 3, 0, 4) == 0 assert gamma_move(board, 4, 0, 2) == 0 assert gamma_move(board, 1, 4, 1) == 0 assert gamma_move(board, 1, 0, 3) == 0 assert gamma_move(board, 2, 4, 1) == 0 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_move(board, 3, 2, 1) == 0 assert gamma_move(board, 1, 1, 0) == 1 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_move(board, 2, 1, 4) == 1 assert gamma_move(board, 3, 4, 2) == 0 assert gamma_free_fields(board, 3) == 3 board745238701 = gamma_board(board) assert board745238701 is not None assert board745238701 == ("12.\n" "323\n" "3.4\n" "342\n" "21.\n") del board745238701 board745238701 = None assert gamma_move(board, 4, 0, 1) == 0 board210815408 = gamma_board(board) assert board210815408 is not None assert board210815408 == ("12.\n" "323\n" "3.4\n" "342\n" "21.\n") del board210815408 board210815408 = None assert gamma_move(board, 1, 1, 3) == 0 assert gamma_free_fields(board, 1) == 3 assert gamma_move(board, 2, 0, 2) == 0 assert gamma_move(board, 3, 2, 0) == 1 assert gamma_move(board, 3, 0, 2) == 0 assert gamma_free_fields(board, 3) == 2 assert gamma_move(board, 4, 2, 1) == 0 assert gamma_free_fields(board, 4) == 2 assert gamma_move(board, 1, 4, 2) == 0 assert gamma_busy_fields(board, 1) == 2 assert gamma_golden_possible(board, 1) == 1 assert gamma_move(board, 2, 4, 2) == 0 assert gamma_move(board, 2, 2, 4) == 1 assert gamma_golden_possible(board, 2) == 1 gamma_delete(board)
26.697248
44
0.662199
513
2,910
3.606238
0.079922
0.297297
0.340541
0.454054
0.683784
0.637297
0.495676
0.317838
0.243784
0.216757
0
0.150231
0.1811
2,910
108
45
26.944444
0.626102
0
0
0.233333
0
0
0.026577
0
0
0
0
0
0.633333
1
0
false
0
0.011111
0
0.011111
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
1
0
0
0
0
0
0
0
0
0
4
647009ba584a36b8fd70924f69dc8cd4d0690ecd
35
py
Python
__init__.py
Jacarlianda/FinMind
181e478727c7cda498da2b42495e2a6fea9688e3
[ "Apache-2.0" ]
null
null
null
__init__.py
Jacarlianda/FinMind
181e478727c7cda498da2b42495e2a6fea9688e3
[ "Apache-2.0" ]
null
null
null
__init__.py
Jacarlianda/FinMind
181e478727c7cda498da2b42495e2a6fea9688e3
[ "Apache-2.0" ]
null
null
null
# __init__ __version__ = '1.1.0'
7
21
0.628571
5
35
2.8
0.8
0
0
0
0
0
0
0
0
0
0
0.107143
0.2
35
4
22
8.75
0.392857
0.228571
0
0
0
0
0.208333
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
647ac48e7a7d10aad9afe13a40efe6ef28ed69a5
82
py
Python
bevis/__init__.py
bkjones/bevis
a586096aaf3eaa713d50c4954c6d028f82be158a
[ "BSD-3-Clause" ]
18
2015-02-14T03:07:01.000Z
2021-10-16T01:49:57.000Z
bevis/__init__.py
bkjones/bevis
a586096aaf3eaa713d50c4954c6d028f82be158a
[ "BSD-3-Clause" ]
null
null
null
bevis/__init__.py
bkjones/bevis
a586096aaf3eaa713d50c4954c6d028f82be158a
[ "BSD-3-Clause" ]
3
2015-08-26T06:16:05.000Z
2019-05-25T11:38:10.000Z
from bevis_server import Bevis from daemonize import daemonize version = (0, 9, 5)
27.333333
31
0.792683
13
82
4.923077
0.692308
0
0
0
0
0
0
0
0
0
0
0.042857
0.146341
82
3
32
27.333333
0.871429
0
0
0
0
0
0
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