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
672e9c42d3f2d17647b4b2896d62df2d841f8b01
8,084
py
Python
test_quiz.py
jjberg83/oving_10
1b70b1a43d0dfa7316c14a9ad81db7cc07422e01
[ "MIT" ]
null
null
null
test_quiz.py
jjberg83/oving_10
1b70b1a43d0dfa7316c14a9ad81db7cc07422e01
[ "MIT" ]
null
null
null
test_quiz.py
jjberg83/oving_10
1b70b1a43d0dfa7316c14a9ad81db7cc07422e01
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 23 14:12:04 2021 @author: jjberg """ import unittest from quiz import * class TestMultipleChoice(unittest.TestCase): def test_answer_check(self): liste_med_alle_instansene = read_the_document() # Question 1 self.assertFalse(liste_med_alle_instansene[0].answer_check(1)) self.assertFalse(liste_med_alle_instansene[0].answer_check(2)) self.assertFalse(liste_med_alle_instansene[0].answer_check(4)) self.assertTrue(liste_med_alle_instansene[0].answer_check(3)) # Question 2 self.assertFalse(liste_med_alle_instansene[1].answer_check(1)) self.assertFalse(liste_med_alle_instansene[1].answer_check(3)) self.assertFalse(liste_med_alle_instansene[1].answer_check(4)) self.assertTrue(liste_med_alle_instansene[1].answer_check(2)) # Question 3 self.assertFalse(liste_med_alle_instansene[2].answer_check(2)) self.assertFalse(liste_med_alle_instansene[2].answer_check(3)) self.assertFalse(liste_med_alle_instansene[2].answer_check(4)) self.assertTrue(liste_med_alle_instansene[2].answer_check(1)) # Question 4 self.assertFalse(liste_med_alle_instansene[3].answer_check(1)) self.assertFalse(liste_med_alle_instansene[3].answer_check(2)) self.assertFalse(liste_med_alle_instansene[3].answer_check(4)) self.assertTrue(liste_med_alle_instansene[3].answer_check(3)) # Question 5 self.assertFalse(liste_med_alle_instansene[4].answer_check(1)) self.assertFalse(liste_med_alle_instansene[4].answer_check(3)) self.assertFalse(liste_med_alle_instansene[4].answer_check(4)) self.assertTrue(liste_med_alle_instansene[4].answer_check(2)) # Question 6 self.assertFalse(liste_med_alle_instansene[5].answer_check(1)) self.assertFalse(liste_med_alle_instansene[5].answer_check(3)) self.assertFalse(liste_med_alle_instansene[5].answer_check(4)) self.assertFalse(liste_med_alle_instansene[5].answer_check(5)) self.assertTrue(liste_med_alle_instansene[5].answer_check(2)) # Question 7 self.assertFalse(liste_med_alle_instansene[6].answer_check(1)) self.assertFalse(liste_med_alle_instansene[6].answer_check(2)) self.assertFalse(liste_med_alle_instansene[6].answer_check(3)) self.assertFalse(liste_med_alle_instansene[6].answer_check(5)) self.assertTrue(liste_med_alle_instansene[6].answer_check(4)) # Question 8 self.assertFalse(liste_med_alle_instansene[7].answer_check(1)) self.assertTrue(liste_med_alle_instansene[7].answer_check(2)) def test_korrekt_svar_tekst(self): liste_med_alle_instansene = read_the_document() # Question 1 self.assertFalse(liste_med_alle_instansene[0].korrekt_svar_tekst()=='RAM') self.assertFalse(liste_med_alle_instansene[0].korrekt_svar_tekst()=='Harddisk') self.assertFalse(liste_med_alle_instansene[0].korrekt_svar_tekst()=='Sekundærlager') self.assertTrue(liste_med_alle_instansene[0].korrekt_svar_tekst()=='CPU') # Question 2 self.assertFalse(liste_med_alle_instansene[1].korrekt_svar_tekst()=='bit') self.assertFalse(liste_med_alle_instansene[1].korrekt_svar_tekst()=='bryter') self.assertFalse(liste_med_alle_instansene[1].korrekt_svar_tekst()=='transistor') self.assertTrue(liste_med_alle_instansene[1].korrekt_svar_tekst()=='byte') # Question 3 self.assertFalse(liste_med_alle_instansene[2].korrekt_svar_tekst()=='instruksjoner') self.assertFalse(liste_med_alle_instansene[2].korrekt_svar_tekst()=='variabler') self.assertFalse(liste_med_alle_instansene[2].korrekt_svar_tekst()=='CPU-er') self.assertTrue(liste_med_alle_instansene[2].korrekt_svar_tekst()=='bits') # Question 4 self.assertFalse(liste_med_alle_instansene[3].korrekt_svar_tekst()=='heksadesimal') self.assertFalse(liste_med_alle_instansene[3].korrekt_svar_tekst()=='oktal') self.assertFalse(liste_med_alle_instansene[3].korrekt_svar_tekst()=='desimal') self.assertTrue(liste_med_alle_instansene[3].korrekt_svar_tekst()=='binær') # Question 5 self.assertFalse(liste_med_alle_instansene[4].korrekt_svar_tekst()=='38') self.assertFalse(liste_med_alle_instansene[4].korrekt_svar_tekst()=='173') self.assertFalse(liste_med_alle_instansene[4].korrekt_svar_tekst()=='1011001') self.assertTrue(liste_med_alle_instansene[4].korrekt_svar_tekst()=='89') # Question 6 self.assertFalse(liste_med_alle_instansene[5].korrekt_svar_tekst()=='1011') self.assertFalse(liste_med_alle_instansene[5].korrekt_svar_tekst()=='11011') self.assertFalse(liste_med_alle_instansene[5].korrekt_svar_tekst()=='101111') self.assertFalse(liste_med_alle_instansene[5].korrekt_svar_tekst()=='111011') self.assertTrue(liste_med_alle_instansene[5].korrekt_svar_tekst()=='10111') # Question 7 self.assertFalse(liste_med_alle_instansene[6].korrekt_svar_tekst()=='assembly') self.assertFalse(liste_med_alle_instansene[6].korrekt_svar_tekst()=='c') self.assertFalse(liste_med_alle_instansene[6].korrekt_svar_tekst()=='java') self.assertFalse(liste_med_alle_instansene[6].korrekt_svar_tekst()=='python') self.assertTrue(liste_med_alle_instansene[6].korrekt_svar_tekst()=='maskinkode') # Question 8 self.assertFalse(liste_med_alle_instansene[7].korrekt_svar_tekst()=='kompilert') self.assertTrue(liste_med_alle_instansene[7].korrekt_svar_tekst()=='tolket') if __name__ == '__main__': unittest.main() # def read_the_document(): # question_list = list() # with open('sporsmaalsfil.txt', 'r', encoding='UTF8') as fila: # for linje in fila: # linje_liste = linje.replace(':', ',').strip('\n').split(',') # sporsmaal = linje_liste.pop(0) # rett_svar = int(linje_liste.pop(0)) # alternativer = [x.strip(' []') for x in linje_liste] # ny_instans = MultipleChoice(sporsmaal, rett_svar, alternativer) # question_list.append(ny_instans) # return question_list # class MultipleChoice: # #Constructor # def __init__(self, question, correct_answer, alternatives): # self.question = question # self.correct_answer = correct_answer # self.alternatives = alternatives # def answer_check(self, entered_integer): # if entered_integer == self.correct_answer+1: # return True # else: # return False # def korrekt_svar_tekst(self): # return self.alternatives[self.correct_answer] # def __str__(self): # return f'{self.question}\n' + '\n'.join(f'{indeks} - {element}' for indeks, element in enumerate(self.alternatives,1))+ '\n' # if __name__ == '__main__': # liste_med_alle_instansene = read_the_document() # sum_spiller1 = 0 # sum_spiller2 = 0 # for sporsmaal in liste_med_alle_instansene: # print(sporsmaal) # svar_spiller1 = int(input("Velg et svaralternativ for spiller 1: ")) # svar_spiller2 = int(input("Velg et svaralternativ for spiller 2: ")) # print(f'Korrekt svar: {sporsmaal.korrekt_svar_tekst()}') # if sporsmaal.answer_check(svar_spiller1): # sum_spiller1 += 1 # print('Spiller 1: Korrekt') # else: # print('Spiller 1: Feil') # if sporsmaal.answer_check(svar_spiller2): # sum_spiller2 += 1 # print('Spiller 2: Korrekt') # else: # print('Spiller 2: Feil') # print(f'Sum spiller 1: {sum_spiller1}') # print(f'Sum spiller 2: {sum_spiller2}')
45.931818
134
0.679861
999
8,084
5.129129
0.139139
0.106167
0.159251
0.291959
0.720921
0.710773
0.710773
0.638759
0.574746
0.300742
0
0.02983
0.199654
8,084
176
135
45.931818
0.762133
0.28043
0
0.027397
0
0
0.035341
0
0
0
0
0
0.876712
1
0.027397
false
0
0.027397
0
0.068493
0
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
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
674905efb4cf96cee3c1a694e401c0bc8fa6243d
3,672
py
Python
plot_holographic_example.py
ftonolini45/VICI
7508328b474492edc7479bb41527cbbfd5f43a1d
[ "CC0-1.0" ]
null
null
null
plot_holographic_example.py
ftonolini45/VICI
7508328b474492edc7479bb41527cbbfd5f43a1d
[ "CC0-1.0" ]
null
null
null
plot_holographic_example.py
ftonolini45/VICI
7508328b474492edc7479bb41527cbbfd5f43a1d
[ "CC0-1.0" ]
null
null
null
import numpy as np import scipy.io as sio import matplotlib.pyplot as plt # Plot Forward Model Results n_plots = 3 # number of examples to plot samp_index = [0,1,2,3] # Load the test results for the multi-fidelity forward model results = sio.loadmat('results/holographic_forward_model_examples.mat') x_exp_test = results['target'] y_exp_lf_test = results['low_fidelity'] y_exp_hf_test = results['ground_truth'] samples = results['samples'] samples[samples<0.0]=0.0 mu = results['mean'] sig = results['standard_deviation'] cost_plot = results['cost'][0] plt.figure() plt.plot(cost_plot) plt.title('Multi-Fidelity Forward Model Cost') plt.figure() for i in range(n_plots): target_i = x_exp_test[i,:] target_i = np.reshape(target_i,(28,28)) lf_i = y_exp_lf_test[i,:] lf_i = np.reshape(lf_i,(28,28)) hf_i = y_exp_hf_test[i,:] hf_i = np.reshape(hf_i,(28,28)) mu_i = mu[i,:] mu_i = np.reshape(mu_i,(28,28)) sig_i = sig[i,:] sig_i = np.reshape(sig_i,(28,28)) samp_i = samples[i,:,:] samples_i = np.zeros((28*2,28*2)) for j in range(4): samp_ij = samp_i[:,samp_index[j]] samp_ij = np.reshape(samp_ij,(28,28)) if j<2: samples_i[j*28:(j+1)*28,0:28] = samp_ij else: samples_i[(j-2)*28:(j-1)*28,28:2*28] = samp_ij plt.subplot(n_plots,6,i*6+1) plt.imshow(target_i) plt.title('Target') plt.subplot(n_plots,6,i*6+2) plt.imshow(lf_i) plt.title('Low Fidelity Measurements') plt.subplot(n_plots,6,i*6+3) plt.imshow(hf_i) plt.title('High Fidelity Measurements') plt.subplot(n_plots,6,i*6+4) plt.imshow(mu_i) plt.title('Emulated Mean') plt.subplot(n_plots,6,i*6+5) plt.imshow(sig_i) plt.title('Emulated STD') plt.subplot(n_plots,6,i*6+6) plt.imshow(samples_i) plt.title('Emulated Samples') # Plot Inverse Model Results n_plots = 3 # number of examples to plot samp_index = [0,1,2,3] # Load the test results for the multi-fidelity forward model results = sio.loadmat('results/holographic_inverse_model_examples.mat') x_exp_test = results['target'] y_exp_hf_test = results['measurements'] samples = results['samples'] mu = results['mean'] sig = results['standard_deviation'] cost_plot = results['cost'][0] plt.figure() plt.plot(cost_plot) plt.title('Inverse Model Model Cost') plt.figure() for i in range(n_plots): target_i = x_exp_test[i,:] target_i = np.reshape(target_i,(28,28)) hf_i = y_exp_hf_test[i,:] hf_i = np.reshape(hf_i,(28,28)) mu_i = mu[i,:] mu_i = np.reshape(mu_i,(28,28)) sig_i = sig[i,:] sig_i = np.reshape(sig_i,(28,28)) samp_i = samples[i,:,:] samples_i = np.zeros((28*2,28*2)) for j in range(4): samp_ij = samp_i[:,samp_index[j]] samp_ij = np.reshape(samp_ij,(28,28)) if j<2: samples_i[j*28:(j+1)*28,0:28] = samp_ij else: samples_i[(j-2)*28:(j-1)*28,28:2*28] = samp_ij plt.subplot(n_plots,5,i*5+1) plt.imshow(target_i) plt.title('Target') plt.subplot(n_plots,5,i*5+2) plt.imshow(hf_i) plt.title('High Fidelity Measurements') plt.subplot(n_plots,5,i*5+3) plt.imshow(mu_i) plt.title('Reconstructed Mean') plt.subplot(n_plots,5,i*5+4) plt.imshow(sig_i) plt.title('Reconstructed STD') plt.subplot(n_plots,5,i*5+5) plt.imshow(samples_i) plt.title('Reconstructed Samples')
26.228571
72
0.605392
613
3,672
3.435563
0.120718
0.042735
0.057455
0.083571
0.823362
0.802469
0.739791
0.696581
0.696581
0.676638
0
0.052859
0.242647
3,672
140
73
26.228571
0.704423
0.061275
0
0.686275
0
0
0.135978
0.027862
0
0
0
0
0
1
0
false
0
0.029412
0
0.029412
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6760ad5bc199398ac01024e2e42beaa778e34029
334
py
Python
tests/test_plugins.py
asmeurer/nikola
ea1c651bfed0fd6337f1d22cf8dd99899722912c
[ "MIT" ]
null
null
null
tests/test_plugins.py
asmeurer/nikola
ea1c651bfed0fd6337f1d22cf8dd99899722912c
[ "MIT" ]
null
null
null
tests/test_plugins.py
asmeurer/nikola
ea1c651bfed0fd6337f1d22cf8dd99899722912c
[ "MIT" ]
1
2021-07-07T11:32:42.000Z
2021-07-07T11:32:42.000Z
""" Simple plugin tests. More advanced tests should be in a separate module. """ def test_command_version(): """Test `nikola version`.""" from nikola.plugins.command.version import CommandVersion CommandVersion().execute() def test_importing_plugin_task_galleries(): import nikola.plugins.task.galleries # NOQA
19.647059
61
0.736527
40
334
6
0.625
0.058333
0
0
0
0
0
0
0
0
0
0
0.158683
334
16
62
20.875
0.854093
0.305389
0
0
0
0
0
0
0
0
0
0
0
1
0.4
true
0
0.6
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
4
678a299ea29d23227c6e615595693d7197b3f816
79
py
Python
SoftLayer/CLI/cdn/__init__.py
dvzrv/softlayer-python
9a5f6c6981bcc370084537b4d1769383499ce90d
[ "MIT" ]
126
2015-01-05T05:09:22.000Z
2021-07-02T00:16:35.000Z
SoftLayer/CLI/cdn/__init__.py
dvzrv/softlayer-python
9a5f6c6981bcc370084537b4d1769383499ce90d
[ "MIT" ]
969
2015-01-05T15:55:31.000Z
2022-03-31T19:55:20.000Z
SoftLayer/CLI/cdn/__init__.py
dvzrv/softlayer-python
9a5f6c6981bcc370084537b4d1769383499ce90d
[ "MIT" ]
176
2015-01-22T11:23:40.000Z
2022-02-11T13:16:58.000Z
"""Content Delivery Network.""" # :license: MIT, see LICENSE for more details.
26.333333
46
0.708861
10
79
5.6
0.9
0
0
0
0
0
0
0
0
0
0
0
0.139241
79
2
47
39.5
0.823529
0.898734
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
67907226614f1b77ed7a73f3d2d69546ddddb58c
142
py
Python
tests/conftest.py
vault-the/rigor
02f5ddb18092a114dc0a23c8fb60975e2b906e85
[ "MIT" ]
null
null
null
tests/conftest.py
vault-the/rigor
02f5ddb18092a114dc0a23c8fb60975e2b906e85
[ "MIT" ]
null
null
null
tests/conftest.py
vault-the/rigor
02f5ddb18092a114dc0a23c8fb60975e2b906e85
[ "MIT" ]
null
null
null
import pytest import rigor @pytest.fixture(scope="module") def pytest_runtest_setup(item): rigor.setup_logging(quiet=False, json=False)
17.75
48
0.78169
20
142
5.4
0.7
0
0
0
0
0
0
0
0
0
0
0
0.105634
142
7
49
20.285714
0.850394
0
0
0
0
0
0.042254
0
0
0
0
0
0
1
0.2
false
0
0.4
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
0
0
0
1
0
1
0
0
4
67ae604d7b7cc40f5d5a19e5d3d721d826d891c7
54
py
Python
Edabit/Return the Next Number from the Integer Passed/Sol.py
Pandz18/C-Programs
9d9b47516d3f65d348f9f72b9c0edda8246e9fab
[ "MIT" ]
null
null
null
Edabit/Return the Next Number from the Integer Passed/Sol.py
Pandz18/C-Programs
9d9b47516d3f65d348f9f72b9c0edda8246e9fab
[ "MIT" ]
null
null
null
Edabit/Return the Next Number from the Integer Passed/Sol.py
Pandz18/C-Programs
9d9b47516d3f65d348f9f72b9c0edda8246e9fab
[ "MIT" ]
null
null
null
def addition(num): b=num+1 return b
3.857143
18
0.481481
8
54
3.25
0.75
0
0
0
0
0
0
0
0
0
0
0.032258
0.425926
54
13
19
4.153846
0.806452
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
67c0c873af503588d7f4a352e82ea3823ed8f714
4,955
py
Python
data_collection/TestDataProcessing.py
rmarathay/hedgehogs_rcos
07129fbd215e4b6a68f0ce4f9a47101f56222aa9
[ "MIT" ]
9
2018-02-06T19:08:16.000Z
2022-03-15T13:31:57.000Z
data_collection/TestDataProcessing.py
rmarathay/hedgehogs_rcos
07129fbd215e4b6a68f0ce4f9a47101f56222aa9
[ "MIT" ]
37
2018-02-09T21:22:58.000Z
2021-12-13T19:51:24.000Z
data_collection/TestDataProcessing.py
rmarathay/hedgehogs_rcos
07129fbd215e4b6a68f0ce4f9a47101f56222aa9
[ "MIT" ]
10
2018-02-27T20:26:55.000Z
2021-02-06T02:26:30.000Z
import datetime from DataProcessing import StockData # ----------------------------------------------------------------------------------------------------------------- def Accessors_Test(): ticker1 = "TICKER1" ticker2 = "TICKER2" indicator1 = "close" indicator2 = "open" data1 = [100, 200, 300] dates1 = [datetime.datetime(2019,3,16,0,0),datetime.datetime(2019,3,17,0,0),datetime.datetime(2019,3,18,0,0)] data2 = [100, 200, 300, 400] dates2 = [datetime.datetime(2019,3,16,0,0),datetime.datetime(2019,3,17,0,0),datetime.datetime(2019,3,18,0,0)] sd1 = StockData(ticker1,indicator1,dates1,data1) sd2 = StockData(ticker2,indicator2,dates2,data2) assert(sd1.getTicker() == "TICKER1") # Test ticker1 assert(sd2.getTicker() == "TICKER2") # Test ticker2 assert(sd1.getIndicator() == "close") # Test indicator1 assert(sd2.getIndicator() == "open") # Test indicator2 assert(sd1.getMedian() == 200) # Test median1 assert(sd2.getMedian() == 250) # Test median2 assert(sd1.getMax() == 300) # Test max1 assert(sd2.getMax() == 400) # Test max2 range1 = sd1.getTimeRange() range2 = sd2.getTimeRange() assert(range1[0] == range2[0] and range1[1] == range2[1]) # ----------------------------------------------------------------------------------------------------------------- def SimpleMA_Test(): # Test 10 data points for simple moving average, WINDOW=10 & WINDOW=5 data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] dates = [datetime.datetime(2019,3,16,0,0),datetime.datetime(2019,3,17,0,0),datetime.datetime(2019,3,18,0,0), datetime.datetime(2019,3,19,0,0),datetime.datetime(2019,3,20,0,0),datetime.datetime(2019,3,21,0,0), datetime.datetime(2019,3,22,0,0),datetime.datetime(2019,3,23,0,0),datetime.datetime(2019,3,24,0,0), datetime.datetime(2019,3,25,0,0)] sd = StockData("APPL","open",dates,data) print("Data Set: ", data) print("WINDOW=5 Simple MA Data:", sd.simpleMA(5)) print("Data Set: ", data) print("WINDOW=10 Simple MA Data:", sd.simpleMA(10)) print("") # Test 1 data point for simple moving average, WINDOW=1 data = [5] dates = [datetime.datetime(2019,3,16,0,0)] sd = StockData("APPL","open",dates,data) print("Data Set: ", data) print("WINDOW=1 Simple MA Data: ", sd.simpleMA(1)) print("") # Test window out of range data = [5, 10, 15] dates = [datetime.datetime(2019,3,16,0,0),datetime.datetime(2019,3,17,0,0),datetime.datetime(2019,3,18,0,0)] sd = StockData("APPL","open",dates,data) print("Data Set: ", data) print("WINDOW=5 Simple MA Data: ", sd.simpleMA(5)) # ----------------------------------------------------------------------------------------------------------------- def ExponentialMA_Test(): # Test 10 data points for exp. moving average, WINDOW=10 & WINDOW=5 data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] dates = [datetime.datetime(2019,3,16,0,0),datetime.datetime(2019,3,17,0,0),datetime.datetime(2019,3,18,0,0), datetime.datetime(2019,3,19,0,0),datetime.datetime(2019,3,20,0,0),datetime.datetime(2019,3,21,0,0), datetime.datetime(2019,3,22,0,0),datetime.datetime(2019,3,23,0,0),datetime.datetime(2019,3,24,0,0), datetime.datetime(2019,3,25,0,0)] sd = StockData("MSFT","open",dates,data) print("Data Set: ", data) print("WINDOW=10 Exp Data Set:", sd.simpleMA(10)) print("WINDOW=5 Exp Data Set:", sd.simpleMA(5)) # Test 1 data point for exp. moving average, WINDOW=1 data = [5] dates = [datetime.datetime(2019,3,16,0,0)] sd = StockData("MSFT","open",dates,data) print("Data Set: ", data) print("WINDOW=1 Exp Data Set: ", sd.expMA(1)) # Test window out of range data = [5, 10, 15] dates = [datetime.datetime(2019,3,16,0,0),datetime.datetime(2019,3,17,0,0),datetime.datetime(2019,3,18,0,0)] sd = StockData("MSFT","open",dates,data) print("Data Set: ", data) try: print("WINDOW=5 ExpMA Data Set:", sd.expMA(5)) catch (ValueError e): print("Caught an exception for an invalid range. Should be |3|, was |5|") # ----------------------------------------------------------------------------------------------------------------- if __name__ == "__main__": print("Beginning a test for StockData accessor methods...") Accessors_Test() print("\tALL TESTS PASSED!\n") print("Beginning a test for Simple MA and Exponential MA...\n") print("=========================== SIMPLE MA TEST ==========================\n") SimpleMA_Test() print("\n=========================== EXP MA TEST ===========================\n") ExponentialMA_Test() print("\tALL TESTS PASSED!")
47.190476
115
0.535822
645
4,955
4.094574
0.164341
0.205983
0.257478
0.270352
0.661871
0.57554
0.558122
0.546384
0.546384
0.546384
0
0.115968
0.201211
4,955
104
116
47.644231
0.551289
0.171342
0
0.4375
0
0
0.199413
0.027649
0
0
0
0
0.1125
0
null
null
0.025
0.025
null
null
0.3
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
67c9694e1c5c3a7aa02804bd04d9377839e361b8
363
py
Python
16.Functional Programming with Python - SW/03.Advanced Functional Concepts/basic_currying.py
ptyadana/python-dojo
98c7234b84f0afea99a091c7198342d66bbdff5b
[ "MIT" ]
3
2020-06-01T04:17:18.000Z
2020-12-18T03:05:55.000Z
16.Functional Programming with Python - SW/03.Advanced Functional Concepts/basic_currying.py
ptyadana/python-dojo
98c7234b84f0afea99a091c7198342d66bbdff5b
[ "MIT" ]
1
2020-04-25T08:01:59.000Z
2020-04-25T08:01:59.000Z
16.Functional Programming with Python - SW/03.Advanced Functional Concepts/basic_currying.py
ptyadana/python-dojo
98c7234b84f0afea99a091c7198342d66bbdff5b
[ "MIT" ]
7
2020-04-26T10:02:36.000Z
2021-06-08T05:12:46.000Z
# similar to partial application, but only with one level deeper def curry_add(x): def curry_add_inner(y): def curry_add_inner_2(z): return x + y + z return curry_add_inner_2 return curry_add_inner add_5 = curry_add(5) add_5_and_6 = add_5(6) print(add_5_and_6(7)) # or we can even call like below print(curry_add(5)(6)(7))
21.352941
64
0.683196
69
363
3.289855
0.449275
0.246696
0.229075
0.140969
0
0
0
0
0
0
0
0.05
0.22865
363
16
65
22.6875
0.760714
0.256198
0
0
0
0
0
0
0
0
0
0
0
1
0.3
false
0
0
0.1
0.6
0.2
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
67e5034bcd6af04c69e191b2d637fda10835d3b5
335
py
Python
tests/constructors.py
codemee/micropython-ulab
882294dabfae41e8c27396325334ec7952271598
[ "MIT" ]
4
2020-02-12T12:08:56.000Z
2022-03-18T00:30:04.000Z
tests/constructors.py
codemee/micropython-ulab
882294dabfae41e8c27396325334ec7952271598
[ "MIT" ]
null
null
null
tests/constructors.py
codemee/micropython-ulab
882294dabfae41e8c27396325334ec7952271598
[ "MIT" ]
2
2022-01-11T11:47:22.000Z
2022-01-20T03:41:36.000Z
from ulab import linalg import ulab print(ulab.ones(3)) print(ulab.ones((2,3))) print(ulab.zeros(3)) print(ulab.zeros((2,3))) print(ulab.eye(3)) print(ulab.ones(1, dtype=ulab.int8)) print(ulab.ones(2, dtype=ulab.uint8)) print(ulab.ones(3, dtype=ulab.int16)) print(ulab.ones(4, dtype=ulab.uint16)) print(ulab.ones(5, dtype=ulab.float))
25.769231
38
0.725373
63
335
3.857143
0.301587
0.37037
0.374486
0.115226
0
0
0
0
0
0
0
0.057325
0.062687
335
12
39
27.916667
0.716561
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
0.833333
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
67f92a2772cde248c692d61df4632481f30aeb2c
1,110
py
Python
wallet_lib/wallet_base.py
Bitcoin-com/wallet-lib
291d4986e5718adeb0e1001030841f0bf6c30943
[ "MIT" ]
1
2021-11-03T16:16:40.000Z
2021-11-03T16:16:40.000Z
wallet_lib/wallet_base.py
Bitcoin-com/wallet-lib
291d4986e5718adeb0e1001030841f0bf6c30943
[ "MIT" ]
4
2019-12-11T00:19:08.000Z
2020-01-22T09:40:25.000Z
wallet_lib/wallet_base.py
Bitcoin-com/wallet-lib
291d4986e5718adeb0e1001030841f0bf6c30943
[ "MIT" ]
1
2021-11-03T16:16:31.000Z
2021-11-03T16:16:31.000Z
import simplejson as json from simplejson.errors import JSONDecodeError from abc import ABCMeta, abstractmethod from .adapters import WalletAdapterBase from .wallet_exceptions import WalletException from .zmq_notifier import ZMQNotifier class WalletBase(metaclass=ABCMeta): def load_json(self, val: str, raw: bool): invalid_type = type(val) in [dict, list, float] if raw: return val elif invalid_type: return val else: try: return json.loads(val) except JSONDecodeError: return val @abstractmethod def __init__(self, *args): pass @abstractmethod def create_address(self, *args): pass @abstractmethod def get_balance(self, *args): pass @abstractmethod def get_transaction(self, *args): pass @abstractmethod def get_transactions(self, *args): pass @abstractmethod def send(self, *args): pass @abstractmethod def get_transactions_since(self, *args): pass @abstractmethod def run(self, *args): pass def get_zmq_notifier(self, **kwargs): return ZMQNotifier(**kwargs)
24.666667
55
0.695495
130
1,110
5.807692
0.415385
0.180132
0.127152
0.24106
0.316556
0.201325
0.116556
0
0
0
0
0
0.224324
1,110
44
56
25.227273
0.876887
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0.3125
false
0.25
0.1875
0.03125
0.5625
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
db01fb213a6eb66e7efa42d8ee39466529715e82
22
py
Python
axelrod/version.py
rjsu26/Axelrod
677f6da86d7ba56d3b2ec031de558c4f2a0675b0
[ "MIT" ]
null
null
null
axelrod/version.py
rjsu26/Axelrod
677f6da86d7ba56d3b2ec031de558c4f2a0675b0
[ "MIT" ]
null
null
null
axelrod/version.py
rjsu26/Axelrod
677f6da86d7ba56d3b2ec031de558c4f2a0675b0
[ "MIT" ]
null
null
null
__version__ = "4.6.0"
11
21
0.636364
4
22
2.5
1
0
0
0
0
0
0
0
0
0
0
0.157895
0.136364
22
1
22
22
0.368421
0
0
0
0
0
0.227273
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
db05f1454e6cc433f350a3445dde418510efd33a
501
py
Python
events/__init__.py
yemikudaisi/GIS-Lite
9a366fae77142b5c3887907bb2a3e7824897f17c
[ "MIT" ]
2
2021-03-26T06:34:49.000Z
2021-04-01T12:55:45.000Z
events/__init__.py
yemikudaisi/GIS-Lite
9a366fae77142b5c3887907bb2a3e7824897f17c
[ "MIT" ]
2
2019-04-27T16:21:25.000Z
2019-11-15T07:13:41.000Z
events/__init__.py
yemikudaisi/GIS-Lite
9a366fae77142b5c3887907bb2a3e7824897f17c
[ "MIT" ]
1
2020-08-17T15:01:58.000Z
2020-08-17T15:01:58.000Z
import wx from mapmouseover import MapMouseOverEvent, EVT_MAP_MOUSE_DRAG from mapscalechanged import MapScaleChangedEvent, EVT_MAP_SCALE_CHANGED from maptoolactivated import MapToolActivatedEvent, EVT_MAP_TOOL_ACTIVATED from maptooldeactivated import MapToolDeactivatedEvent, EVT_MAP_TOOL_DEACTIVATED from maplayerschanged import MapLayersChangedEvent, EVT_MAP_LAYERS_CHANGED from mapstyleschanged import MapStylesChangedEvent, EVT_MAP_STYLE_CHANGED from mapready import MapReadyEvent, EVT_MAP_READY
50.1
80
0.91018
57
501
7.649123
0.508772
0.09633
0.045872
0
0
0
0
0
0
0
0
0
0.075848
501
9
81
55.666667
0.941685
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
db2f734c1bfdc95a626a54c1f6eff35f3f92d18e
475
py
Python
logger.py
ImGabe/Tamagochi
0478c4525ae7b535f491e4de50a0b12ecb30d0bc
[ "MIT" ]
11
2018-12-06T12:35:12.000Z
2019-06-22T12:54:06.000Z
logger.py
ImGabe/tamagochi
0478c4525ae7b535f491e4de50a0b12ecb30d0bc
[ "MIT" ]
15
2018-12-09T01:51:24.000Z
2018-12-23T16:47:33.000Z
logger.py
ImGabe/Tamagochi
0478c4525ae7b535f491e4de50a0b12ecb30d0bc
[ "MIT" ]
5
2018-12-09T23:45:26.000Z
2019-03-15T18:16:30.000Z
import logging logging.basicConfig(filename='tamagochi_logs.log', level=logging.DEBUG, format='%(asctime)s [%(levelname)s] %(message)s', datefmt='%m/%d/%Y %I:%M:%S') def log_info(x): return logging.info(x) def log_debug(x): return logging.debug(x) def log_error(x): return logging.error(x) def log_warning(x): return logging.warning(x) def log_critical(x): return logging.critical(x)
17.592593
69
0.602105
65
475
4.307692
0.4
0.107143
0.25
0
0
0
0
0
0
0
0
0
0.252632
475
26
70
18.269231
0.788732
0
0
0
0
0
0.155789
0
0
0
0
0
0
1
0.333333
false
0
0.066667
0.333333
0.733333
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
db3206e0630c4a5221866da435009e68ada96f48
560
py
Python
src/fpm_tablut_player/utils/network.py
contimatteo/PMF-Tablut-Player
9886583d2027beb2c0941c753f78bfb42ba8ae36
[ "MIT" ]
null
null
null
src/fpm_tablut_player/utils/network.py
contimatteo/PMF-Tablut-Player
9886583d2027beb2c0941c753f78bfb42ba8ae36
[ "MIT" ]
null
null
null
src/fpm_tablut_player/utils/network.py
contimatteo/PMF-Tablut-Player
9886583d2027beb2c0941c753f78bfb42ba8ae36
[ "MIT" ]
null
null
null
import struct ### class NetworkUtils: @staticmethod def is_value_sent(bytes_sent: int, expected_bytes_sent: int): return bytes_sent == expected_bytes_sent @staticmethod def integer_request(integer: int): return struct.pack('>i', integer) @staticmethod def string_request(string): return string.encode('utf-8') @staticmethod def integer_response(integer: int): return struct.unpack("!i", integer)[0] @staticmethod def string_response(string): return string.decode('utf-8')
20.740741
65
0.667857
65
560
5.569231
0.384615
0.207182
0.066298
0.121547
0
0
0
0
0
0
0
0.006928
0.226786
560
26
66
21.538462
0.829099
0
0
0.294118
0
0
0.025135
0
0
0
0
0
0
1
0.294118
false
0
0.058824
0.294118
0.705882
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
e1d5805c51e0b83912c4864bc54df34539d64faf
60
py
Python
locale/pot/api/plotting/_autosummary/pyvista-themes-ParaViewTheme-outline_color-1.py
tkoyama010/pyvista-doc-translations
23bb813387b7f8bfe17e86c2244d5dd2243990db
[ "MIT" ]
4
2020-08-07T08:19:19.000Z
2020-12-04T09:51:11.000Z
locale/pot/api/plotting/_autosummary/pyvista-themes-DefaultTheme-outline_color-1.py
tkoyama010/pyvista-doc-translations
23bb813387b7f8bfe17e86c2244d5dd2243990db
[ "MIT" ]
19
2020-08-06T00:24:30.000Z
2022-03-30T19:22:24.000Z
locale/pot/api/plotting/_autosummary/pyvista-themes-ParaViewTheme-outline_color-1.py
tkoyama010/pyvista-doc-translations
23bb813387b7f8bfe17e86c2244d5dd2243990db
[ "MIT" ]
1
2021-03-09T07:50:40.000Z
2021-03-09T07:50:40.000Z
import pyvista pyvista.global_theme.outline_color = 'white'
20
44
0.833333
8
60
6
0.875
0
0
0
0
0
0
0
0
0
0
0
0.083333
60
2
45
30
0.872727
0
0
0
0
0
0.083333
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
e1df797c87e40099a1407df06ab155f1ca3d1c2f
2,336
py
Python
SAP Script - FB50.py
LeandroPOliveira/SAP-Scripting
8a0f50a1e14a9e1040300bbdefb671c917cc32e9
[ "MIT" ]
null
null
null
SAP Script - FB50.py
LeandroPOliveira/SAP-Scripting
8a0f50a1e14a9e1040300bbdefb671c917cc32e9
[ "MIT" ]
null
null
null
SAP Script - FB50.py
LeandroPOliveira/SAP-Scripting
8a0f50a1e14a9e1040300bbdefb671c917cc32e9
[ "MIT" ]
null
null
null
# Importar o pacote pandas para trabalhar com arquivos excel import pandas as pd # Abrir arquivo de script gerado pelo SAP arquivo = open('FB50.vbs', 'a') # modo 'a' de append, insere novos dados no arquivo sem excluir os que estavam # Abrir arquivo com os dados a serem lançados dados_cab = pd.read_excel('FB50.xlsx', nrows=4, usecols=[0, 1], header=None) arquivo.write(f''' session.findById("wnd[0]").maximize session.findById("wnd[0]/tbar[0]/okcd").text = "fb50" session.findById("wnd[0]").sendVKey 0 session.findById("wnd[0]/usr/tabsTABSTRIP_HEAD/tabpTAB1/ssubHEAD:SAPMF05A:1010/ctxtACGL_HEAD-BLDAT").text ="{dados_cab.iloc[0][1]}" session.findById("wnd[0]/usr/tabsTABSTRIP_HEAD/tabpTAB1/ssubHEAD:SAPMF05A:1010/ctxtACGL_HEAD-BUDAT").text ="{dados_cab.iloc[1][1]}" session.findById("wnd[0]/usr/tabsTABSTRIP_HEAD/tabpTAB1/ssubHEAD:SAPMF05A:1010/txtACGL_HEAD-XBLNR").text ="{dados_cab.iloc[2][1]}" session.findById("wnd[0]/usr/tabsTABSTRIP_HEAD/tabpTAB1/ssubHEAD:SAPMF05A:1010/txtACGL_HEAD-BKTXT").text ="{dados_cab.iloc[3][1]}"''') # Abrir arquivo com os dados a serem lançados dados = pd.read_excel('FB50.xlsx', skiprows=5) dados.fillna('', inplace=True) # print(dados) for index, row in dados.iterrows(): arquivo.write(f''' session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,{index}]").text = "{row['Cta.Razão']}" session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/cmbACGL_ITEM-SHKZG[3,{index}]").key = {'"S"' if row['D/C'] == 'D' else '"H"'} session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/txtACGL_ITEM-WRBTR[4,{index}]").text = "{row['Mont.em moeda doc.']}" session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-SGTXT[11,{index}]").text = "{row['Texto']}" session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-KOSTL[17,{index}]").text = "{row['Centro custo']}" session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-AUFNR[18,{index}]").text = "{row['Ordem']}" session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-PRCTR[27,{index}]").text = "{row['Centro lucro']}" session.findById("wnd[0]/usr/ssubITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-PROJK[29,{index}]").text = "{row['Elemen.PEP']}" ''') arquivo.close()
64.888889
147
0.742723
346
2,336
4.947977
0.355491
0.131425
0.15771
0.166472
0.596963
0.574766
0.574766
0.548481
0.548481
0.431659
0
0.050114
0.06036
2,336
36
148
64.888889
0.729841
0.118151
0
0.08
0
0.48
0.856378
0.735638
0
0
0
0
0
1
0
false
0
0.04
0
0.04
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
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
e1ea904855fc06013587410d741049ec33ca9618
61
py
Python
tests/__init__.py
boweeb/wikiup
2694a8a9bc3914507803abc0540850e25ec64fd2
[ "ISC" ]
null
null
null
tests/__init__.py
boweeb/wikiup
2694a8a9bc3914507803abc0540850e25ec64fd2
[ "ISC" ]
null
null
null
tests/__init__.py
boweeb/wikiup
2694a8a9bc3914507803abc0540850e25ec64fd2
[ "ISC" ]
null
null
null
# -*- coding: utf-8 -*- """Unit test package for wikiup."""
15.25
35
0.557377
8
61
4.25
1
0
0
0
0
0
0
0
0
0
0
0.02
0.180328
61
3
36
20.333333
0.66
0.852459
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
e1fa01d7ff0815944c8193d5b90fac0d025e0556
308
py
Python
utils/operations.py
hmeretti/grid-world
03a91dcb89f960ffca7918639365402c9a750814
[ "MIT" ]
1
2022-02-06T12:50:02.000Z
2022-02-06T12:50:02.000Z
utils/operations.py
hmeretti/grid-world
03a91dcb89f960ffca7918639365402c9a750814
[ "MIT" ]
1
2022-02-01T12:41:03.000Z
2022-02-01T12:41:03.000Z
utils/operations.py
hmeretti/grid-world
03a91dcb89f960ffca7918639365402c9a750814
[ "MIT" ]
null
null
null
import numpy as np def add_tuples(a: tuple[int, ...], b: tuple[int, ...]) -> tuple[int, ...]: return tuple(p + q for p, q in zip(a, b)) def float_dict_comparison(d0: dict[any, float], d1: dict[any, float]) -> bool: return np.all([np.isclose(d0[x], d1[x]) for x in d0]) and d0.keys() == d1.keys()
30.8
84
0.597403
57
308
3.175439
0.508772
0.132597
0.132597
0
0
0
0
0
0
0
0
0.027778
0.181818
308
9
85
34.222222
0.690476
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.2
0.4
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
e1fb5f4836567ff682af78ed27c3946aadec55b6
5,592
py
Python
tests/test_query_generator.py
zedrem/coast_search
6216b3b0505f00eba39f1ec947ea1e4ba4bb55c6
[ "MIT" ]
null
null
null
tests/test_query_generator.py
zedrem/coast_search
6216b3b0505f00eba39f1ec947ea1e4ba4bb55c6
[ "MIT" ]
null
null
null
tests/test_query_generator.py
zedrem/coast_search
6216b3b0505f00eba39f1ec947ea1e4ba4bb55c6
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_citations ---------------------------------- Tests for `citations` module. """ import os import unittest from coast_search import query_generator class TestQueryGenerator(unittest.TestCase): def setUp(self): self.dimensions_dict = { "reasoning": ['because', 'however', 'conclude', 'but', 'for example'], "experience": ['i', 'me', 'our', 'we', 'in my experience'], "topic": ['trustworthy', 'software'] } self.one_dimension_queries = [ {'segment_id': 2, 'logic': 'topic', 'query': '("credibility" OR "assessment")'}, {'segment_id': 0, 'logic': 'random + !(topic)', 'query': '"annexs mug regions" -"credibility" -"assessment" '}, {'segment_id': 1, 'logic': 'seed + !(topic)', 'query': '"software" -"credibility" -"assessment" '} ] self.three_search_engines = [ { "name": "cse-1", "api_key": "aaa2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:aaa" }, { "name": "cse-2", "api_key": "bbb2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:bbb" }, { "name": "cse-3", "api_key": "cccfcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:ccc" }] def test_generate_result_list_one_dimension(self): one_dimension_data = { 'topic': { 'wordsList': ['credibility', 'assessment'], 'pos': '("credibility" OR "assessment")', 'neg': '-"credibility" -"assessment" ' } } actual_1_dimension = query_generator.generate_result_list(one_dimension_data, ["topic"], "software", "annexs mug regions") self.assertEqual(self.one_dimension_queries, actual_1_dimension) def test_add_api_config_1D_unique_keys(self): search_engines = self.three_search_engines expected = [ { 'segment_id': 2, 'logic': 'topic', 'query': '("credibility" OR "assessment")', "se_name": "cse-1", "api_key": "aaa2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:aaa" }, { 'segment_id': 0, 'logic': 'random + !(topic)', 'query': '"annexs mug regions" -"credibility" -"assessment" ', "se_name": "cse-2", "api_key": "bbb2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:bbb" }, { 'segment_id': 1, 'logic': 'seed + !(topic)', 'query': '"software" -"credibility" -"assessment" ', "se_name": "cse-3", "api_key": "cccfcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:ccc" } ] actual = query_generator.add_api_config_to_queries(self.one_dimension_queries, search_engines) self.assertEqual(expected, actual) def test_add_api_config_1D_one_key(self): search_engines = self.three_search_engines[0:1] expected = [ { 'segment_id': 2, 'logic': 'topic', 'query': '("credibility" OR "assessment")', "se_name": "cse-1", "api_key": "aaa2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:aaa" }, { 'segment_id': 0, 'logic': 'random + !(topic)', 'query': '"annexs mug regions" -"credibility" -"assessment" ', "se_name": "cse-1", "api_key": "aaa2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:aaa" }, { 'segment_id': 1, 'logic': 'seed + !(topic)', 'query': '"software" -"credibility" -"assessment" ', "se_name": "cse-1", "api_key": "aaa2fcb8f-9c52-44b9-8a71-6d7dcdbfdbd8", "search_engine_id": "82260244545522837893:aaa" } ] actual = query_generator.add_api_config_to_queries(self.one_dimension_queries, search_engines) self.assertEqual(expected, actual) def test_add_api_config_1D_incorrect_keys(self): search_engines = self.three_search_engines[0:2] self.assertRaises(Exception, query_generator.add_api_config_to_queries, self.one_dimension_queries, search_engines) def test_check_length(self): self.assertRaises(Exception, query_generator.check_length,"seed", "random", self.dimensions_dict, 5) self.assertRaises(Exception, query_generator.check_length, "seed", "random", self.dimensions_dict, 25) expect_pass = query_generator.check_length("seed", "random", self.dimensions_dict, 50) self.assertTrue(expect_pass) expect_pass_border = query_generator.check_length("seed", "random", self.dimensions_dict, 26) self.assertTrue(expect_pass_border)
37.530201
123
0.528612
508
5,592
5.545276
0.216535
0.046148
0.038339
0.076677
0.753994
0.72382
0.716365
0.716365
0.671282
0.616613
0
0.090812
0.332439
5,592
148
124
37.783784
0.663809
0.021817
0
0.403509
0
0
0.326314
0.100165
0
0
0
0
0.070175
1
0.052632
false
0.035088
0.026316
0
0.087719
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
c008d051baf823c63ce751f3fb44cf8afd5d33bd
310
py
Python
bzt/engine/__init__.py
IamSaurabh1/taurus
928d44e30e6cd5b979e675bfdce4c1dbeb5d0eff
[ "Apache-2.0" ]
1
2019-12-05T14:57:58.000Z
2019-12-05T14:57:58.000Z
bzt/engine/__init__.py
IamSaurabh1/taurus
928d44e30e6cd5b979e675bfdce4c1dbeb5d0eff
[ "Apache-2.0" ]
null
null
null
bzt/engine/__init__.py
IamSaurabh1/taurus
928d44e30e6cd5b979e675bfdce4c1dbeb5d0eff
[ "Apache-2.0" ]
null
null
null
from .names import EXEC, TAURUS_ARTIFACTS_DIR, SETTINGS from .engine import Engine from .dicts import Scenario, Configuration from .templates import FileLister, HavingInstallableTools, Singletone, SelfDiagnosable from .modules import Provisioning, Reporter, Service, Aggregator, EngineModule, ScenarioExecutor
51.666667
96
0.848387
33
310
7.909091
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.1
310
5
97
62
0.935484
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
c0393b9aa0efe5e0ae6c0a7a0e71e718ff387015
134
py
Python
profiler/profiler/utils/inference_url_parser.py
Hydrospheredata/hydro-profiler
bca177f8d71d9d8c93091f9a9fdf9a337582e194
[ "Apache-2.0" ]
null
null
null
profiler/profiler/utils/inference_url_parser.py
Hydrospheredata/hydro-profiler
bca177f8d71d9d8c93091f9a9fdf9a337582e194
[ "Apache-2.0" ]
14
2021-11-22T18:07:28.000Z
2022-01-14T08:51:45.000Z
profiler/profiler/utils/inference_url_parser.py
rufusnufus/hydro-profiler
a729ffa2575bb8bfe9a080c2562fd592ed37521d
[ "Apache-2.0" ]
1
2021-11-19T11:16:50.000Z
2021-11-19T11:16:50.000Z
from urllib.parse import urlparse def extract_file_name(url: str): parsed = urlparse(url) return parsed.path.split("/")[-1]
19.142857
37
0.701493
19
134
4.842105
0.842105
0
0
0
0
0
0
0
0
0
0
0.008929
0.164179
134
6
38
22.333333
0.8125
0
0
0
0
0
0.007463
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
c055cae955a199d416db77300f1d5f0e76cebf6e
7,092
py
Python
Teste.py
NunoMarquesRM/Logica-AlgHorn
51b00596dcc09c7541f15ff0059422d19ae50144
[ "MIT" ]
null
null
null
Teste.py
NunoMarquesRM/Logica-AlgHorn
51b00596dcc09c7541f15ff0059422d19ae50144
[ "MIT" ]
null
null
null
Teste.py
NunoMarquesRM/Logica-AlgHorn
51b00596dcc09c7541f15ff0059422d19ae50144
[ "MIT" ]
null
null
null
from abc import abstractproperty s = '(~p | R ) & (~x) & (p) & (~p | x | ~R | x)' s = "(~q | ~S | ~Q | ~p | ~p | ~q | ~y | ~X | ~p | ~L | ~V | ~Y | ~U | ~q | ~u | ~R | ~R | ~P | ~V | ~O | ~m | ~w | ~J | ~u | ~S | ~d | ~s | ~w | ~f | ~p | ~X | ~i | ~C) & (s) & (~B | ~O | ~X | ~r | ~T | ~f | ~A | ~t | ~u | ~e | ~C | ~F | ~d | ~r | S | ~G | ~H | ~U | ~H | ~l | ~H | ~R) & (~O | ~p | ~n | ~W | ~t | ~g | ~S | ~E | ~V | ~X | ~l | ~U | ~r | ~r | ~r | T | ~N | ~V | ~C | ~O | ~r) & (~q | ~Z | J | ~J | ~l) & (~s | ~i | h | ~t | ~w | ~U | ~w | ~E | ~P | ~t | ~X | ~N) & (~w | ~c | ~x | ~D | ~y | ~o | ~b | ~t | ~N | ~a | ~W | ~F | ~h | ~R | ~g | ~K | ~k | ~I | ~w | ~c | ~k | ~J | ~d | ~Z | ~W | ~L | ~g | ~N | ~Q | ~I | ~d | ~K | ~B | ~g | ~r | t | ~c | ~B | ~t | ~A | ~c) & (~b | l | ~K | ~v | ~s | ~v | ~X | ~P | ~S | ~W | ~h | ~A | ~O | ~W | ~a | ~G | ~Y | ~S | ~g | ~t | ~o | ~q | ~f | ~U | ~d | ~K | ~n | ~e | ~o | ~A | ~z | ~n | ~C | ~H | ~T | ~Q | ~T) & (~Q | ~F | ~g | ~e | ~N | ~h | ~l | ~U | ~V | ~E | ~b | ~r | ~B | ~a | ~J | ~Y | ~Y) & (~X | ~U | ~f | ~w | ~d | ~a | ~b | ~c | ~o | ~T | ~t | ~F | ~x | ~h | ~O | ~W | ~K | ~O | ~V | ~T | ~J | ~r | ~C | ~E | ~j | ~Y | ~y | ~x | ~Y | ~H | ~u | ~q | ~v | ~p | ~n | ~f | ~I | ~O) & (~l | ~L | ~q | ~T | ~z | ~k | ~Z | ~O | ~P | ~G | ~Y | ~g | ~i | ~Y | ~w | ~x | ~V | ~Z | ~i | ~s | ~O | ~Q | ~q | ~K | ~g | ~g | ~T | ~h | ~H | ~X | ~w | ~D | ~N | ~M | ~y | ~n | ~t) & (~f) & (~j | ~G | ~t | ~C | ~W | ~m | ~W | ~l | ~N | T | ~y | ~v | ~y | ~U | ~H | ~o | ~I | ~X | ~k | ~b | ~O | ~C | ~j) & (~A | ~A | ~s | ~O | ~Y | ~Q | ~S | ~B | ~Y | ~k | ~D | ~N | ~o | ~T | ~i | ~k | ~m | ~X | ~P | ~I | ~G | ~C | ~s | ~J | ~X | ~U | ~F | ~h | ~t | ~X | ~s | ~F | ~S | ~q | ~x | ~E | ~I | ~V | ~Q | ~L | ~p | ~J | ~Q | ~e | ~m | z | ~B | ~w | ~N | ~C) & (~H | ~h | ~g | ~h | ~E | ~u | ~B | ~g | ~v | ~u | ~Y | ~D | ~D | ~a | ~d | ~T | ~f | ~v | ~y | ~K | ~R | ~V | ~U | ~j | ~t | ~D | ~h) & (~m | ~Z | ~G | ~B | ~x | ~c | ~k | ~P | ~j | ~F | ~x | ~j | ~a | ~I) & (~b | ~w | ~y | ~x | ~d | ~S | ~W | ~S | ~F | ~U | ~K | ~H | ~K | ~Q | ~S | ~U | ~i | ~z | ~P | ~J | ~l | ~B | ~K | ~i | ~o | ~i | ~T | ~m | ~h | ~G | ~v | ~B | ~t | ~a | ~X | ~B | ~o | ~Q | ~Y | ~s | ~g | ~L | ~C | ~R | ~N | ~H | ~v | ~H | ~y | ~N | ~H | ~x) & (~d | ~a | ~G | ~x | ~a | ~O | ~e | ~l | ~g | a) & (~e | ~f | ~i | ~L | ~E | ~p | ~d | ~V | ~U | ~o | ~Z | ~W | ~P | ~p | ~h | ~f | ~j | ~i | ~S | ~K | ~E | ~B | ~b | ~k | ~H | ~c | ~l | ~y | ~r | ~F | ~l | ~K | ~T | ~S | ~r | ~L | ~Q | ~n | ~M | ~q | ~R | ~z | ~N | ~X | ~M | ~C | ~G | ~w) & (~d | ~h) & (~R | ~b | ~H | ~N | ~B | ~e | ~f | ~d | ~o | ~f | ~M | ~A | ~Y | ~q | ~O | ~K | ~s | ~X | ~X | ~z | ~y | ~i | ~y | ~d | ~Q | ~Y | ~t | ~M | ~z | ~P | ~x | ~F) & (~O | ~N | ~x | ~w | ~u | ~r | ~M | ~o | ~c | ~x | ~j | ~D | ~e | ~O | ~I | ~j | ~I | ~A | ~X | ~c | ~W | ~E | ~C | ~e | ~l | ~o | ~O | ~b | ~N | ~p | ~p | ~I | ~D | ~h | ~j | ~C | ~N | ~N | ~d | ~v | ~O | ~R | ~X | ~C | ~T | ~h | ~c) & (~D | ~S | ~V | ~g | ~z | ~u | ~M | ~Y | ~A | ~w | ~i | ~N | ~w | ~E | ~H | ~X | ~N | ~t | ~B | ~E | ~L | ~G | ~L | ~z | ~g | ~L | ~Z | ~M | ~h | ~Q | ~y | ~q | ~h | ~f | ~l | ~i | ~p | ~M | ~o | ~e | ~b | ~S | ~D | ~a | ~C | ~K | ~U | ~z | ~X | ~Z | ~n) & (~D | ~W | ~j | ~Y | ~K | ~W | ~i | ~b | ~r | ~o | ~L | ~K | ~j | ~F | ~k | ~Z | ~x | ~p | ~d | ~V | ~k | ~D | ~h | ~a | ~t | ~p | ~R | ~N | ~a | ~C | ~f | ~C) & (~u | ~r | ~j | ~s | ~S | ~S | ~b | ~b | ~f | ~i | ~e | ~Y | ~q | ~Q | ~T | ~N | ~P | ~n | ~h | ~t | ~C | ~a | ~F | ~b | ~O | ~M) & (~H | ~q | ~y | ~M | ~q | ~G | n | ~o | ~V | ~O | ~h | ~n | ~I | ~L | ~y | ~K | ~c | ~T | ~Y) & (~s | ~F) & (~P | ~d | ~i | ~M | ~k | ~A | ~T | ~d | ~K | ~a | ~t | ~X | ~d | ~x | ~N | Y | ~U | ~T | ~t | ~h | ~v | ~b | ~f | ~h | ~F | ~E | ~f | ~j | ~a | ~V | ~d | ~b | ~q | ~e | ~x | ~Y | ~l | ~E | ~i | ~t | ~O | ~U | ~r | ~Y | ~V | ~n | ~X) & (~p | ~h | ~P | ~a | ~r | ~l | ~J | ~g | ~B | ~l | ~e | ~Z | O | ~W | ~m | ~j | ~D | ~X | ~C | ~R | ~w | ~a | ~n | ~I) & (~J | ~r | ~M | ~D | ~N | ~X | ~F | ~u | ~Q | ~l | ~r | ~O | ~e | ~P | ~D | ~t | ~j | ~W | ~Y | ~z | ~A | ~s | ~e | ~l | ~r | ~w | ~E | ~G | ~i | ~L | ~h | ~y | ~y | ~R | ~D | ~b | ~c | ~v | ~P | ~Y | ~C | ~h | ~V) & (~n | ~b | ~u | ~M | ~P | ~n | ~I | ~g | ~j | ~w | ~Y | ~t | ~Y | ~Q | ~y | ~y) & (~e | ~S | ~N | ~Q | ~d | ~h | ~c | ~D | ~x | ~n | ~X | ~Q | ~o | ~p | ~N | ~a | ~g | ~Q | ~E | ~l | ~n | ~f | ~u | ~H | ~M | ~z | ~S | ~w | ~i | ~M | ~Y | ~X | ~Z | ~J | ~y | ~e | ~C | ~y | ~d | ~R) & (~u | ~i | ~y | ~x | ~m | ~S | e) & (~F | ~C | ~f | ~X | ~U | ~c | ~E | ~L | ~D | ~q | ~I | ~P | ~T | ~h | ~M | ~M | ~z | ~A | ~X | ~u | ~T | ~c | ~R | ~X | ~U | ~L | ~G | ~B | ~c | ~V | ~o | ~Q | ~u | ~l | ~t | ~w | ~C | ~z | ~S | ~j | ~D | ~y | ~f | ~z | ~z | ~B | ~k | ~s)" s = '(~p | a ) & (p) & (~p | ~R | x) & (~W | P | ~h) & (F) & (~f | ~q | e) & (~t | ~k | ~l)' s = '(~p | Q | ~r) & (~t) & (P) & (~T | x | Z) & (F)' i, target = 0, len( s ) formulas, temp, flag = [], [], False def put_vagina( subform ) : flag = False for y, _ in subform : if y : flag = True if not flag : return subform + [(True, 'ç')] return subform while i != target : key = s[ i ] if key == '(' : flag = True elif key == ' ' : pass elif key == '|' : pass elif key == '&' : pass elif key == '~' : temp.append(( False, s[ i + 1 ] )) i += 1 elif key == ')' : formulas.append( put_vagina( temp ) ) temp = [] flag == False else : temp.append(( True, s[ i ])) i += 1 #for f in formulas : print( f ) def is_formula( x ) : def more_than_one( x ) : c = [] for y1, y2 in x : if y1 : if y2 not in c : c.append( y2 ) if len( c ) < 2 : return True return False for xx in x : if not more_than_one( xx ) : return False return True def horn( x ) : verified = [] new = [] # PARTE INICIAL for x in x : if len( x ) == 1 and x[ 0 ][ 0 ] : verified.append( x[ 0 ][ 1 ] ) else : new.append( x ) line = len( new ) def verified2( subformula, verified ) : aux = '' for y1, y2 in subformula : if y1 : aux = y2 else : if not y2 in verified : return False, '-1' return True, aux while True : print( new ) new_new = [] for n in new : flag, novel = verified2( n, verified ) if flag : verified.append( novel ) else : new_new.append( n ) if 'ç' in verified : return False # TAMOS AQUI CRL if line == len( new_new ) : return True else : line = len( new_new ) new = new_new if not len( new ) : return True if not is_formula( formulas ) : print( 'NA' ) else : if horn( formulas ) : print( 'SAT' ) else : print( 'UNSAT' )
59.1
4,682
0.271151
1,226
7,092
1.557096
0.066884
0.025144
0.018858
0.023573
0.020953
0.020953
0.020953
0.020953
0
0
0
0.005529
0.413424
7,092
120
4,683
59.1
0.453365
0.008319
0
0.197674
0
0.046512
0.692789
0
0
0
0
0
0
1
0.05814
false
0.034884
0.011628
0
0.186047
0.046512
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c05c2ed3f73c6d91e67567062b596f9684fbe057
228
py
Python
pokemon_image_dataset/data_sources/__init__.py
jneuendorf/pokemon-image-dataset
120b5beb4f058ee7c8fa86cc7e5b8030b75a03f1
[ "MIT" ]
null
null
null
pokemon_image_dataset/data_sources/__init__.py
jneuendorf/pokemon-image-dataset
120b5beb4f058ee7c8fa86cc7e5b8030b75a03f1
[ "MIT" ]
null
null
null
pokemon_image_dataset/data_sources/__init__.py
jneuendorf/pokemon-image-dataset
120b5beb4f058ee7c8fa86cc7e5b8030b75a03f1
[ "MIT" ]
null
null
null
from .archive import ArchiveDataSource, RemoteArchiveDataSource from .base import DataSource from .sprite_set import SpriteSetConfig, SpriteSetDataSource from .path_dict import PathDict from .battlers import BattlersDataSource
32.571429
63
0.868421
24
228
8.166667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.100877
228
6
64
38
0.956098
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
fbe51356ffacd7b71b1c2e88e52d5526bc5b2ffd
224
py
Python
hitcount/urls.py
Ione03/django-hitcount
6212b44f3830c29bcef809543f9eaeb88fcb037d
[ "MIT" ]
null
null
null
hitcount/urls.py
Ione03/django-hitcount
6212b44f3830c29bcef809543f9eaeb88fcb037d
[ "MIT" ]
null
null
null
hitcount/urls.py
Ione03/django-hitcount
6212b44f3830c29bcef809543f9eaeb88fcb037d
[ "MIT" ]
null
null
null
from __future__ import unicode_literals from django.conf.urls import url from hitcount.views import HitCountJSONView app_name = 'hitcount' urlpatterns = [url('^hit/ajax/$', HitCountJSONView.as_view(), name='hit_ajax')]
37.333333
80
0.776786
29
224
5.724138
0.655172
0.084337
0
0
0
0
0
0
0
0
0
0
0.111607
224
5
81
44.8
0.834171
0
0
0
0
0
0.123288
0
0
0
0
0
0
1
0
false
0
0.6
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
0
0
0
1
0
1
0
0
4
fbf195859d145c9edc62ce791dbd3d712c1e02d1
81
py
Python
kivy3/loaders/__init__.py
poikilos/kivy3
e3364b39ec61a69aa31bf88e77fadaa148359ec6
[ "MIT" ]
13
2020-04-27T10:58:35.000Z
2021-09-22T20:39:16.000Z
kivy3/loaders/__init__.py
poikilos/kivy3
e3364b39ec61a69aa31bf88e77fadaa148359ec6
[ "MIT" ]
8
2020-04-27T11:12:38.000Z
2022-03-13T16:31:28.000Z
kivy3/loaders/__init__.py
poikilos/kivy3
e3364b39ec61a69aa31bf88e77fadaa148359ec6
[ "MIT" ]
6
2020-05-14T17:00:44.000Z
2022-03-13T16:29:19.000Z
from .objloader import OBJLoader, OBJMTLLoader from .stlloader import STLLoader
20.25
46
0.839506
9
81
7.555556
0.555556
0
0
0
0
0
0
0
0
0
0
0
0.123457
81
3
47
27
0.957746
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
2201f288b845e1976ecea9ca5e7e9639183116bb
635
py
Python
Helper/Base/Chess.py
jingege315/gobang
983a0ce34dc2120464f42441ef6b190ef2433f08
[ "MIT" ]
4
2019-04-20T07:04:02.000Z
2020-06-23T14:12:15.000Z
Helper/Base/Chess.py
jingege315/gobang_alphazero
983a0ce34dc2120464f42441ef6b190ef2433f08
[ "MIT" ]
null
null
null
Helper/Base/Chess.py
jingege315/gobang_alphazero
983a0ce34dc2120464f42441ef6b190ef2433f08
[ "MIT" ]
null
null
null
from enum import Enum class Chess(Enum): """ the chess's enum """ BLACK = 1 WHITE = 2 NONE = 3 def is_black(self) -> bool: return self == self.BLACK def is_white(self) -> bool: return self == self.WHITE def is_none(self) -> bool: return self == self.NONE def exchange(self): return self.BLACK if self.is_white() else self.WHITE def is_chess_color(self) -> bool: return self.is_black() or self.is_white() def is_chess(self) -> bool: return self.is_chess_color() or self.is_none() def __str__(self) -> str: if self.is_black(): return '1' elif self.is_white(): return '2' else: return ' '
17.162162
54
0.653543
103
635
3.854369
0.242718
0.105793
0.176322
0.2267
0.267003
0
0
0
0
0
0
0.00996
0.209449
635
36
55
17.638889
0.780876
0.025197
0
0
0
0
0.004926
0
0
0
0
0
0
1
0.291667
false
0
0.041667
0.25
0.875
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
2205eb2f75d5a1fb0ec2337d8dd63ce09412e990
864
py
Python
lib/systems/d-cysteine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/d-cysteine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/d-cysteine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
import pulsar as psr def load_ref_system(): """ Returns d-cysteine as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C -0.2529 -0.1635 -0.4344 C 0.1089 -1.5934 -0.0355 O 0.9646 -2.3176 -0.5120 O -0.6270 -2.1189 0.9673 C 0.3653 0.8052 0.5791 S -0.3580 2.4713 0.5904 N 0.1922 0.1748 -1.8067 H -1.3683 -0.0544 -0.4148 H -0.3367 -3.0058 1.1586 H 1.4633 0.8563 0.4496 H 0.1967 0.4284 1.6080 H -0.1184 2.8528 -0.6389 H -0.2910 -0.3946 -2.4679 H 1.1768 0.0345 -1.8996 """)
39.272727
66
0.423611
128
864
2.835938
0.601563
0.022039
0
0
0
0
0
0
0
0
0
0.460526
0.472222
864
21
67
41.142857
0.335526
0.123843
0
0
0
0
0.886024
0
0
0
0
0
0
1
0.055556
true
0
0.055556
0
0.166667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
220ac7d76f7e04b60c04a1fcd6500a774749fbeb
196
py
Python
sberbank/apps.py
Zagrebelin/django-sberbank
29a30ae72d9d243c69677323eed048e0931e8ccd
[ "BSD-2-Clause" ]
1
2021-07-22T11:00:31.000Z
2021-07-22T11:00:31.000Z
sberbank/apps.py
Zagrebelin/django-sberbank
29a30ae72d9d243c69677323eed048e0931e8ccd
[ "BSD-2-Clause" ]
null
null
null
sberbank/apps.py
Zagrebelin/django-sberbank
29a30ae72d9d243c69677323eed048e0931e8ccd
[ "BSD-2-Clause" ]
null
null
null
from django.apps import AppConfig as BaseAppConfig from django.utils.translation import ugettext_lazy as _ class AppConfig(BaseAppConfig): name = 'sberbank' verbose_name = _('sberbank')
24.5
55
0.77551
23
196
6.434783
0.652174
0.135135
0
0
0
0
0
0
0
0
0
0
0.153061
196
7
56
28
0.891566
0
0
0
0
0
0.081633
0
0
0
0
0
0
1
0
false
0
0.4
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
222885319f49c9f429cf1dab45fefb15c2a8f61a
135
py
Python
testsuite/N806_py35.py
danielpatrickdotdev/pep8-naming
884f3c40880fcc4c4e3f83e0006f7ec4113213fe
[ "MIT" ]
335
2015-12-18T00:05:05.000Z
2022-03-30T09:40:56.000Z
testsuite/N806_py35.py
DalavanCloud/pep8-naming
6fc2dc694c729403360f10e2545c6602b9a53727
[ "MIT" ]
118
2015-12-17T03:42:54.000Z
2022-02-05T15:25:48.000Z
testsuite/N806_py35.py
DalavanCloud/pep8-naming
6fc2dc694c729403360f10e2545c6602b9a53727
[ "MIT" ]
64
2015-12-28T11:46:52.000Z
2022-03-23T09:45:42.000Z
# python_version >= '3.5' #: Okay async def test(): good = 1 #: N806 async def f(): async with expr as ASYNC_VAR: pass
15
33
0.577778
21
135
3.619048
0.809524
0.210526
0
0
0
0
0
0
0
0
0
0.0625
0.288889
135
8
34
16.875
0.729167
0.259259
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.2
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
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
2246b3f98f4136835b8bf402e5bea97ba9c69563
109
py
Python
hostsmgr/exceptions.py
starofrainnight/hostsmgr
ac62fea4ce4542a4755cbb5818a1153c3be999fe
[ "Apache-2.0" ]
null
null
null
hostsmgr/exceptions.py
starofrainnight/hostsmgr
ac62fea4ce4542a4755cbb5818a1153c3be999fe
[ "Apache-2.0" ]
null
null
null
hostsmgr/exceptions.py
starofrainnight/hostsmgr
ac62fea4ce4542a4755cbb5818a1153c3be999fe
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- class HostsNotFound(OSError): pass class InvalidFormat(ValueError): pass
10.9
32
0.651376
11
109
6.454545
0.818182
0
0
0
0
0
0
0
0
0
0
0.011628
0.211009
109
9
33
12.111111
0.813953
0.192661
0
0.5
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
226569b7a9cfa76260cc6b28ca1f5e17e5df5341
20,923
py
Python
src/teachpyx/faq/faq_python.py
sdpython/teachpyx
93bd7164cfcf285866ac268a6e1e719a16d96ebf
[ "MIT" ]
3
2018-04-13T15:06:52.000Z
2019-05-26T09:11:18.000Z
src/teachpyx/faq/faq_python.py
sdpython/teachpyx
93bd7164cfcf285866ac268a6e1e719a16d96ebf
[ "MIT" ]
17
2016-09-25T12:35:50.000Z
2021-11-20T21:44:16.000Z
src/teachpyx/faq/faq_python.py
sdpython/teachpyx
93bd7164cfcf285866ac268a6e1e719a16d96ebf
[ "MIT" ]
1
2019-07-29T12:11:33.000Z
2019-07-29T12:11:33.000Z
# -*- coding: utf-8 -*- """ @file @brief Quelques questions d'ordre général autour du langage Python. """ import os import io import re def entier_grande_taille(): """ .. faqref:: :tag: python :title: Quel est l'entier le plus grand ? La version 3 du langage Python a supprimé la constante ``sys.maxint`` qui définissait l'entier le plus grand (voir `What's New In Python 3.0 <https://docs.python.org/3.1/whatsnew/3.0.html#integers>`_). De ce fait la fonction `getrandbit <https://docs.python.org/3/library/random.html#random.getrandbits>`_ retourne un entier aussi grand que l'on veut. :: import random,sys x = random.getrandbits(2048) print(type(x),x) Qui affiche :: <class 'int'> 2882159224557107513165483098383814837021447484558010147211921304219017212673656549681269862792029... Les calculs en nombre réels se font toujours avec huit octets de précision. Au delà, il faut utiliser la librairie `gmpy2 <http://gmpy2.readthedocs.org/en/latest/>`_. Il est également recommandé d'utiliser cette librairie pour les grands nombres entiers (entre 20 et 40 chiffres). La librairie est plus rapide que l'implémentation du langage Python (voir `Overview of gmpy2 <https://gmpy2.readthedocs.org/en/latest/overview.html>`_). .. faqref:: :tag: python :title: Tabulations ou espace ? Il est préférable de ne pas utiliser les tabulations et de les remplacer par des espaces. Lorsqu'on passe d'un Editeur à un autre, les espaces ne bougent pas. Les tabulations sont plus ou moins grandes visuellement. L'essentiel est de ne pas mélanger. Dans `SciTE <http://www.scintilla.org/SciTE.html>`_, il faut aller dans le menu Options / Change Indentation Settings... Tous les éditeurs ont une option similaire. """ pass def difference_div(): """ .. faqref:: :tag: python :title: Quelle est la différence entre / et // - division ? Le résultat de la division avec l'opérateur ``/`` est toujours réel : la division de deux entiers ``1/2`` donne ``0.5``. Le résultat de la division avec l'opérateur ``//`` est toujours entier. Il correspond au quotient de la division. .. runpython:: :showcode: div1 = 1/2 div2 = 4/2 div3 = 1//2 div4 = 1.0//2.0 print(div1, div2, div3, div4) # affiche (0.5, 2.0, 0, 0) Le reste d'une division entière est obtenue avec l'opérateur ``%``. .. runpython:: :showcode: print( 5 % 2 ) # affiche 1 C'est uniquement vrai pour les version Python 3.x. Pour les versions 2.x, les opérateurs ``/`` et ``//`` avaient des comportements différents (voir `What’s New In Python 3.0 <https://docs.python.org/3/whatsnew/3.0.html#integers>`_). """ div1 = 1 / 2 div2 = 4 / 2 div3 = 1 // 2 div4 = 1.0 // 2.0 return div1, div2, div3, div4 def python_path(): """ .. faqref:: :tag: module :title: Comment éviter sys.path.append... quand on développe un module ? Lorsqu'on développe un module, on ne veut pas l'installer. On ne veut pas qu'il soit présent dans le répertoire ``site-packages`` de la distribution de Python car cela introduit deux versions : celle qu'on développe et celle qu'on a installer. Avant, je faisais cela pour créer un petit programme utilisant mon propre module (et on en trouve quelque trace dans mon code) : :: import sys sys.path.append("c:/moncode/monmodule/src") import monmodule Quand je récupère un programme utilisant ce module, il me faudrait ajouter ces petites lignes à chaque fois et c'est barbant. Pour éviter cela, il est possible de dire à l'interpréteur Python d'aller chercher ailleurs pour trouver des modules en ajoutant le chemin à la `variable d'environnement <http://fr.wikipedia.org/wiki/Variable_d'environnement>`_ `PYTHONPATH <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH>`_. Sous Windows : :: set PYTHON_PATH=%PYTHON_PATH%;c:\\moncode\\monmodule\\src """ return os.environ.get("PYTHON_PATH", "") def same_variable(a, b): """ Cette fonction dit si les deux objets sont en fait le même objet (True) ou non (False) s'ils sont différents (même s'ils contiennent la même information). @param a n'importe quel objet @param b n'importe quel objet @return ``True`` ou ``False`` .. faqref:: :tag: python :title: Qu'est-ce qu'un type immuable ou immutable ? :lid: faq-py-immutable Une variable de type *immuable* ne peut être modifiée. Cela concerne principalement : - ``int``, ``float``, ``str``, ``tuple`` Si une variable est de type *immuable*, lorsqu'on effectue une opération, on créé implicitement une copie de l'objet. Les dictionnaires et les listes sont *modifiables* (ou *mutable*). Pour une variable de ce type, lorsqu'on écrit ``a = b``, ``a`` et ``b`` désigne le même objet même si ce sont deux noms différentes. C'est le même emplacement mémoire accessible paur deux moyens (deux identifiants). Par exemple :: a = (2,3) b = a a += (4,5) print( a == b ) # --> False print(a,b) # --> (2, 3, 4, 5) (2, 3) a = [2,3] b = a a += [4,5] print( a == b ) # --> True print(a,b) # --> [2, 3, 4, 5] [2, 3, 4, 5] Dans le premier cas, le type (``tuple``) est _immutable_, l'opérateur ``+=`` cache implicitement une copie. Dans le second cas, le type (``list``) est _mutable_, l'opérateur ``+=`` évite la copie car la variable peut être modifiée. Même si ``b=a`` est exécutée avant l'instruction suivante, elle n'a **pas** pour effet de conserver l'état de ``a`` avant l'ajout d'élément. Un autre exemple :: a = [1, 2] b = a a [0] = -1 print(a) # --> [-1, 2] print(b) # --> [-1, 2] Pour copier une liste, il faut expliciter la demander :: a = [1, 2] b = list(a) a [0] = -1 print(a) # --> [-1, 2] print(b) # --> [1, 2] La page `Immutable Sequence Types <https://docs.python.org/3/library/stdtypes.html?highlight=immutable#immutable-sequence-types>`_ détaille un peu plus le type qui sont *mutable* et ceux qui sont *immutable*. Parmi les types standards : * **mutable** * `bool <https://docs.python.org/3/library/functions.html#bool>`_ * `int <https://docs.python.org/3/library/functions.html#int>`_, `float <https://docs.python.org/3/library/functions.html#float>`_, `complex <https://docs.python.org/3/library/functions.html#complex>`_ * `str <https://docs.python.org/3/library/functions.html#func-str>`_, `bytes <https://docs.python.org/3/library/functions.html#bytes>`_ * `None <https://docs.python.org/3/library/constants.html?highlight=none#None>`_ * `tuple <https://docs.python.org/3/library/functions.html#func-tuple>`_, `frozenset <https://docs.python.org/3/library/functions.html#func-frozenset>`_ * **immutable**, par défaut tous les autres types dont : * `list <https://docs.python.org/3/library/functions.html#func-list>`_ * `dict <https://docs.python.org/3/library/functions.html#func-dict>`_ * `set <https://docs.python.org/3/library/functions.html#func-set>`_ * `bytearray <https://docs.python.org/3/library/functions.html#bytearray>`_ Une instance de classe est mutable. Il est possible de la rendre immutable par quelques astuces : * `__slots__ <https://docs.python.org/3/reference/datamodel.html?highlight=_slots__#object.__slots__>`_ * `How to Create Immutable Classes in Python <http://www.blog.pythonlibrary.org/2014/01/17/how-to-create-immutable-classes-in-python/>`_ * `Ways to make a class immutable in Python <http://stackoverflow.com/questions/4996815/ways-to-make-a-class-immutable-in-python>`_ * `freeze <https://freeze.readthedocs.org/en/latest/>`_ Enfin, pour les objects qui s'imbriquent les uns dans les autres, une liste de listes, une classe qui incluent des dictionnaires et des listes, on distingue une copie simple d'une copie intégrale (**deepcopy**). Dans le cas d'une liste de listes, la copie simple recopie uniquement la première liste :: import copy l1 = [ [0,1], [2,3] ] l2 = copy.copy(l1) l1 [0][0] = '##' print(l1,l2) # --> [['##', 1], [2, 3]] [['##', 1], [2, 3]] l1 [0] = [10,10] print(l1,l2) # --> [[10, 10], [2, 3]] [['##', 1], [2, 3]] La copie intégrale recopie également les objets inclus :: import copy l1 = [ [0,1], [2,3] ] l2 = copy.deepcopy(l1) l1 [0][0] = '##' print(l1,l2) # --> [['##', 1], [2, 3]] [[0, 1], [2, 3]] Les deux fonctions s'appliquent à tout object Python : `module copy <https://docs.python.org/3/library/copy.html>`_. """ return id(a) == id(b) def stringio(text): """ returns a StringIO object on a text @param text any text @return StringIO object .. faqref:: :tag: python :title: A quoi sert un ``StringIO`` ? La plupart du temps, lorsqu'on récupère des données, elles sont sur le disque dur de votre ordinateur dans un fichier texte. Lorsqu'on souhaite automatiser un processur qu'on répète souvent avec ce fichier, on écrit une fonction qui prend le nom du fichier en entrée. :: def processus_quotidien(nom_fichier) : # on compte les lignes nb = 0 with open(nom_fichier,"r") as f : for line in f : nb += 1 return nb Et puis un jour, les données ne sont plus dans un fichier mais sur Internet. Le plus simple dans ce cas est de recopier ces données sur disque dur et d'appeler la même fonction. Simple. Un autre les données qu'on doit télécharger font plusieurs gigaoctets. Tout télécharger prend du temps pour finir pour s'apercevoir qu'elles sont corrompues. On a perdu plusieurs heures pour rien. On aurait bien voulu que la fonction ``processus_quotidien`` commence à traiter les données dès le début du téléchargement. Pour cela, on a inventé la notion de **stream** ou **flux** qui sert d'interface entre la fonction qui traite les données et la source des données. Le flux lire les données depuis n'importe quel source (fichier, internet, mémoire), la fonction qui les traite n'a pas besoin d'en connaître la provenance. `StringIO <https://docs.python.org/3/library/io.html#io.StringIO>`_ est un flux qui considère la mémoire comme source de données. :: def processus_quotidien(data_stream): # on compte toujours les lignes nb = 0 for line in data_stream : nb += 1 return nb La fonction ``processus_quotidien`` fonctionne pour des données en mémoire et sur un fichier. :: fichier = __file__ f = open(fichier,"r") nb = processus_quotidien(f) print(nb) text = "ligne1\nligne2" st = io.StringIO(text) nb = processus_quotidien(st) print(nb) """ return io.StringIO(text) def property_example(): """ .. faqref:: :tag: class :title: property Une `property <https://docs.python.org/3/library/functions.html#property>`_ est une écriture qui sert à transformer l'appel d'une méthode de classe en un attribut. :: class ClasseAvecProperty: def __init__(self,x,y): self._x, self._y = x,y @property def x(self): return self._x @property def y(self): return self._y @property def norm2(self): return self._y**2 + self._x**2 c = ClasseAvecProperty(1,2) print(c.x) print(c.y) ``x`` est définit comme une méthode mais elle retourne simplement l'attribut ``_x``. De cette façon, il est impossible de changer ``x`` en écrivant:: c.x = 5 Cela déclenche l'erreur:: Traceback (most recent call last): File "faq_python.py", line 455, in <module> c.x = 5 AttributeError: can't set attribute On fait cela parce que l'écriture est plus courte et que cela évite certaines erreurs. """ pass def enumerate_regex_search(exp, text): """ Cette fonction itère sur les différentes occurences d'une expression régulière. @param exp expression régulière @param text text à parser @return itérateur .. faqref:: :tag: regex :title: Comment itérer sur les résultats d'une expression régulière ? On utilise la méthode `finditer <https://docs.python.org/3/library/re.html#re.regex.finditer>`_. :: found = exp.search(text) for m in exp.finditer(text): # ... Voir également `Petites subtilités avec les expressions régulières en Python <http://www.xavierdupre.fr/blog/2014-12-02_nojs.html>`_. """ # found = exp.search(text) if isinstance(exp, str): exp = re.compile(exp) for m in exp.finditer(text): yield m def sortable_class(cl): """ .. faqref:: :tag: class :title: Classe sortable Il faut prononcer *sortable* à l'anglaise. Comment rendre une classe *sortable* ? Pour faire simple, on veut écrire :: l = [ o1, o2 ] l.sort() Où ``o1`` et ``o2`` sont des objets d'une classe que vous avez définie :: class MaClasse: ... Pour que cela fonctionne, il suffit juste de surcharger l'opérateur ``<`` ou plus exactement ``__lt__``. Par exemple :: class MaClasse: def __lt__(self, autre_instance): if self.jenesaispas < autre.jenesaispas: return True elif self.jenesaispas > autre.jenesaispas: return False: else: if self.jenesaispas2 < autre.jenesaispas2: return True else: return False """ pass def list_of_installed_packages(): """ calls ``pip list`` to retrieve the list of packages .. faqref:: :tag: module :title: Obtenir des informations sur les packages installés Le module `pip <https://pip.pypa.io/en/stable/>`_ retourne des informations sur n'importe quel module installé, sa version, sa license :: pip show pandas On peut également l'obtenir depuis l'interpréteur python :: import pip pip.main(["show", "pandas"]) Exemple :: Name: pandas Version: 0.16.0 Summary: Powerful data structures for data analysis, time series,and statistics Home-page: http://pandas.pydata.org Author: The PyData Development Team Author-email: pydata@googlegroups.com License: BSD Location: c:\\python35_x64\\lib\\site-packages Requires: python-dateutil, pytz, numpy On utilise également ``pip freeze`` pour répliquer l'environnement dans lequel on a développé un programme. `pip freeze <https://pip.pypa.io/en/latest/reference/pip_freeze.html>`_ produit la liste des modules avec la version utilisée :: docutils==0.11 Jinja2==2.7.2 MarkupSafe==0.19 Pygments==1.6 Sphinx==1.2.2 Ce qu'on utilise pour répliquer l'environnement de la manière suivante :: pip freeze > requirements.txt pip install -r requirements.txt Cette façon de faire fonctionne très bien sous Linux mais n'est pas encore opérationnelle sous Windows à moins d'installer le compilateur C++ utilisée pour compiler Python. """ from pyquickhelper.pycode.pip_helper import get_packages_list # pylint: disable=C0415 return get_packages_list() def information_about_package(name): """ calls ``pip show`` to retrieve information about packages .. faqref:: :tag: module :title: Récupérer la liste des modules installés Le module `pip <https://pip.pypa.io/en/stable/>`_ permet d'installer de nouveaux modules mais aussi d'obtenir la liste des packages installés :: pip list On peut également l'obtenir depuis l'interpréteur python :: import pip pip.main(["list"]) .. faqref:: :tag: python :title: Pourquoi l'installation de pandas (ou numpy) ne marche pas sous Windows avec pip ? Python est un langage très lent et c'est pourquoi la plupart des modules de calculs numériques incluent des parties implémentées en langage C++. `numpy <http://www.numpy.org/>`_, `pandas <http://pandas.pydata.org/>`_, `matplotlib <http://matplotlib.org/>`_, `scipy <http://www.scipy.org/>`_, `scikit-learn <http://scikit-learn.org/stable/>`_, ... Sous Linux, le compilateur est intégré au système et l'installation de ces modules via l'instruction ``pip install <module>`` met implicitement le compilateur à contribution. Sous Windows, il n'existe pas de compilateur C++ par défaut à moins de l'installer. Il faut faire attention alors d'utiliser exactement le même que celui utilisé pour compiler Python (voir `Compiling Python on Windows <https://docs.python.org/3/using/windows.html#compiling-python-on-windows>`_). C'est pour cela qu'on préfère utiliser des distributions comme `Anaconda <http://continuum.io/downloads#py34>`_ qui propose par défaut une version de Python accompagnée des modules les plus utilisés. Elle propose également une façon simple d'installer des modules précompilés avec l'instruction :: conda install <module_compile> L'autre option est d'utilser le site `Unofficial Windows Binaries for Python Extension Packages <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_ qui propose des versions compilées sous Windows d'un grand nombre de modules. Il faut télécharger le fichier *.whl* puis l'installer avec l'instruction ``pip install <fichier.whl>``. La différence entre les deux ooptions tient aux environnements virtuels, voir `Python virtual environments <http://astropy.readthedocs.org/en/stable/development/workflow/virtual_pythons.html>`_. """ from pyquickhelper.pycode.pip_helper import get_package_info # pylint: disable=C0415 return get_package_info(name) def get_month_name(date): """ returns the month name for a give date @param date datatime @return month name .. faqref:: :tag: python :title: Récupérer le nom du mois à partir d'une date .. runpython:: :showcode: import datetime dt = datetime.datetime(2016, 1, 1) print(dt.strftime("%B")) """ return date.strftime("%B") def get_day_name(date): """ returns the day name for a give date @param date datatime @return month name .. faqref:: :tag: python :title: Récupérer le nom du jour à partir d'une date .. runpython:: :showcode: import datetime dt = datetime.datetime(2016, 1, 1) print(dt.strftime("%A")) """ return date.strftime("%A")
36.261698
139
0.591024
2,673
20,923
4.577628
0.260007
0.017653
0.029421
0.035306
0.188787
0.159284
0.139179
0.126757
0.099052
0.072246
0
0.026013
0.307317
20,923
576
140
36.324653
0.818257
0.881614
0
0.083333
0
0
0.014299
0
0
0
0
0
0
1
0.333333
false
0.083333
0.138889
0
0.694444
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
1
0
0
1
0
0
4
97fec7fe8d25a158135aaf942fd80baafbf67a15
2,198
py
Python
tests/pricing.py
RossLote/lingo24
44d33b2c7dd040ba90f4ea090038aaa22721c9df
[ "MIT" ]
null
null
null
tests/pricing.py
RossLote/lingo24
44d33b2c7dd040ba90f4ea090038aaa22721c9df
[ "MIT" ]
null
null
null
tests/pricing.py
RossLote/lingo24
44d33b2c7dd040ba90f4ea090038aaa22721c9df
[ "MIT" ]
1
2021-04-21T06:58:29.000Z
2021-04-21T06:58:29.000Z
# -*- coding: utf-8 -*- from lingo24.business_documents.pricing import Price, TotalPrice from .base import BaseTestCase class PriceTestCase(BaseTestCase): def test_equality(self): self.assertEqual(Price('GBP', 123, 456), Price('GBP', 123, 456)) self.assertNotEqual(Price('GBP', 123, 456), Price('USD', 123, 456)) self.assertNotEqual(Price('GBP', 123, 456), Price('GBP', 111, 456)) self.assertNotEqual(Price('GBP', 123, 456), Price('GBP', 123, 111)) def test_tax(self): price = Price('GBP', 123, 456) self.assertEqual(price.tax, 333) def test_formatted_net(self): self.assertEqual(Price('GBP', 123, 456).formatted_net, u'£123') self.assertEqual(Price('EUR', 123, 456).formatted_net, u'€123') self.assertEqual(Price('USD', 123, 456).formatted_net, u'$123') self.assertEqual(Price('AUD', 123, 456).formatted_net, u'AUD 123') def test_formatted_gross(self): self.assertEqual(Price('GBP', 123, 456).formatted_gross, u'£456') self.assertEqual(Price('EUR', 123, 456).formatted_gross, u'€456') self.assertEqual(Price('USD', 123, 456).formatted_gross, u'$456') self.assertEqual(Price('AUD', 123, 456).formatted_gross, u'AUD 456') def test_formatted_tax(self): self.assertEqual(Price('GBP', 123, 456).formatted_tax, u'£333') self.assertEqual(Price('EUR', 123, 456).formatted_tax, u'€333') self.assertEqual(Price('USD', 123, 456).formatted_tax, u'$333') self.assertEqual(Price('AUD', 123, 456).formatted_tax, u'AUD 333') class TotalPriceTestCase(BaseTestCase): def test_equality(self): self.assertEqual( TotalPrice(Price('GBP', 111, 222), Price('GBP', 333, 444)), TotalPrice(Price('GBP', 111, 222), Price('GBP', 333, 444)), ) self.assertNotEqual( TotalPrice(Price('GBP', 111, 222), Price('GBP', 333, 444)), TotalPrice(Price('USD', 111, 222), Price('GBP', 333, 444)), ) self.assertNotEqual( TotalPrice(Price('GBP', 111, 222), Price('GBP', 333, 444)), TotalPrice(Price('GBP', 111, 222), Price('USD', 333, 444)), )
43.098039
76
0.620564
287
2,198
4.696864
0.135889
0.124629
0.207715
0.093472
0.773739
0.718843
0.718843
0.378338
0.284866
0.186944
0
0.137378
0.205187
2,198
50
77
43.96
0.630796
0.009554
0
0.2
0
0
0.071724
0
0
0
0
0
0.5
1
0.15
false
0
0.05
0
0.25
0
0
0
0
null
0
1
0
0
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
3f33416f7906ecb5711fdfe46e800f78d39df718
249
py
Python
Model/predictor_dl_model/predictor_dl_model/trainer/trainer_run.py
spyglass700/blue-marlin
b2e4689b2ebc0966db6a96f6c5ecb4478998d605
[ "Apache-2.0" ]
null
null
null
Model/predictor_dl_model/predictor_dl_model/trainer/trainer_run.py
spyglass700/blue-marlin
b2e4689b2ebc0966db6a96f6c5ecb4478998d605
[ "Apache-2.0" ]
null
null
null
Model/predictor_dl_model/predictor_dl_model/trainer/trainer_run.py
spyglass700/blue-marlin
b2e4689b2ebc0966db6a96f6c5ecb4478998d605
[ "Apache-2.0" ]
null
null
null
import os if __name__ == '__main__': os.system('python tfrecord_reader.py --add_days=63 data/vars') os.system('python trainer.py --name s32 --hparam_set=s32 --n_models=3 --no_forward_split --no_eval --asgd_decay=0.99 --max_epoch=150')
41.5
139
0.702811
41
249
3.853659
0.804878
0.101266
0.177215
0
0
0
0
0
0
0
0
0.060465
0.136546
249
5
140
49.8
0.674419
0
0
0
0
0.25
0.729508
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
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
1
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
3f35b0149cea791424e4ce7e06c1ffc79ae4a07b
170
py
Python
variant_db/MySQLVariantDB.py
dawidsielski/medical-data-share
e462ffcfe0650b4fed2bb113c331a2a7438a8509
[ "MIT" ]
null
null
null
variant_db/MySQLVariantDB.py
dawidsielski/medical-data-share
e462ffcfe0650b4fed2bb113c331a2a7438a8509
[ "MIT" ]
null
null
null
variant_db/MySQLVariantDB.py
dawidsielski/medical-data-share
e462ffcfe0650b4fed2bb113c331a2a7438a8509
[ "MIT" ]
null
null
null
from variant_db.VariantDB import VariantDB class MySQLVarinatDB(VariantDB): @staticmethod def get_variants(chrom=None, start=None, end=None): pass
18.888889
55
0.717647
20
170
6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.205882
170
8
56
21.25
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0.2
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
3f47f69357bdcd3a89beb841e87168976fe2c42f
82
py
Python
MLB-pyMatchups/__init__.py
FranB57/MLB-pyMatchups
6a8ea5bc7b6f475eac6ada08c4ee3d03ad989301
[ "MIT" ]
1
2020-12-25T22:08:17.000Z
2020-12-25T22:08:17.000Z
MLB-pyMatchups/__init__.py
FranB57/MLB-pyMatchups
6a8ea5bc7b6f475eac6ada08c4ee3d03ad989301
[ "MIT" ]
null
null
null
MLB-pyMatchups/__init__.py
FranB57/MLB-pyMatchups
6a8ea5bc7b6f475eac6ada08c4ee3d03ad989301
[ "MIT" ]
null
null
null
#develop an init.py once the project reaches phase 2 to publish it as a library
20.5
79
0.768293
16
82
3.9375
1
0
0
0
0
0
0
0
0
0
0
0.015385
0.207317
82
3
80
27.333333
0.953846
0.95122
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
3f64073a62636ecf19174d8b00ab70245fcb6a63
693
py
Python
theapp/migrations/0007_auto_20191027_1606.py
je-ss-y/awards
c7633c4cb8a50fcebc05003e8a4d3e2719b13ef3
[ "CNRI-Python" ]
null
null
null
theapp/migrations/0007_auto_20191027_1606.py
je-ss-y/awards
c7633c4cb8a50fcebc05003e8a4d3e2719b13ef3
[ "CNRI-Python" ]
3
2020-06-05T23:53:13.000Z
2021-06-10T22:09:59.000Z
theapp/migrations/0007_auto_20191027_1606.py
je-ss-y/awards
c7633c4cb8a50fcebc05003e8a4d3e2719b13ef3
[ "CNRI-Python" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-27 16:06 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('theapp', '0006_auto_20191027_0942'), ] operations = [ migrations.RemoveField( model_name='snap', name='content', ), migrations.RemoveField( model_name='snap', name='design', ), migrations.RemoveField( model_name='snap', name='link', ), migrations.RemoveField( model_name='snap', name='usability', ), ]
21.65625
46
0.539683
63
693
5.746032
0.603175
0.232044
0.287293
0.331492
0.41989
0.41989
0
0
0
0
0
0.07033
0.343434
693
31
47
22.354839
0.725275
0.095238
0
0.5
1
0
0.113782
0.036859
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
3f705c845143482cfeb57f7612ead011c15c6520
63
py
Python
GoPiGo_J/src/server/python/increase_speed.py
theplatypus/GoPiGo_Java
85544c93146d898bf08f0898350a9ef80da6754f
[ "Unlicense", "MIT" ]
1
2016-01-22T20:35:24.000Z
2016-01-22T20:35:24.000Z
GoPiGo_J/src/server/python/increase_speed.py
theplatypus/GoPiGo_Java
85544c93146d898bf08f0898350a9ef80da6754f
[ "Unlicense", "MIT" ]
null
null
null
GoPiGo_J/src/server/python/increase_speed.py
theplatypus/GoPiGo_Java
85544c93146d898bf08f0898350a9ef80da6754f
[ "Unlicense", "MIT" ]
null
null
null
#!/usr/bin/env python import gopigo gopigo.increase_speed()
10.5
23
0.746032
9
63
5.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.126984
63
5
24
12.6
0.836364
0.31746
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
58b77a93cfda4e77dd29f130442b70ce30e13fc0
368
py
Python
Which are in.py
lluxury/codewars
2cacc9d5411a248c199ad21949617c5acc9c7f24
[ "MIT" ]
null
null
null
Which are in.py
lluxury/codewars
2cacc9d5411a248c199ad21949617c5acc9c7f24
[ "MIT" ]
null
null
null
Which are in.py
lluxury/codewars
2cacc9d5411a248c199ad21949617c5acc9c7f24
[ "MIT" ]
null
null
null
def in_array(a1, a2): return sorted({sub for sub in a1 if any(sub in s for s in a2)}) # return sorted({sub for sub in a1 if 1}) # any 传入空可迭代对象时返回False,当可迭代对象中有任意一个不为False,则返回True # all 传入空可迭代对象时返回True,当可迭代对象中有任意一个不为True,则返回False # if 真有返回,if假无返回, 真假由 ()里内容决定,对a1里的每个sub反回真,假 # 不知道使用{}的原因,但是换掉会报错 ['duplicates', 'duplicates'] should equal ['duplicates']
46
77
0.722826
53
368
5
0.603774
0.056604
0.10566
0.128302
0.218868
0.218868
0.218868
0.218868
0.218868
0
0
0.022654
0.160326
368
8
77
46
0.834951
0.695652
0
0
0
0
0
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
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
58c74d86eff7f75e85efb442571cd8932f5b7778
196
py
Python
examples/tutorial/tutorial/users/amodels.py
carbonariy/dvhb-hybrid
adbb250767ea255addc607fb6f6755c9add447db
[ "MIT" ]
27
2018-05-08T16:03:24.000Z
2020-02-20T06:39:19.000Z
examples/tutorial/tutorial/users/amodels.py
carbonariy/dvhb-hybrid
adbb250767ea255addc607fb6f6755c9add447db
[ "MIT" ]
7
2018-10-20T16:03:36.000Z
2021-11-03T11:09:22.000Z
examples/tutorial/tutorial/users/amodels.py
carbonariy/dvhb-hybrid
adbb250767ea255addc607fb6f6755c9add447db
[ "MIT" ]
16
2018-12-11T15:34:22.000Z
2022-01-25T00:20:55.000Z
from dvhb_hybrid.amodels import Model from .models import User as DjangoUser class User(Model): # Build sqlalchemy model by Django model table = Model.get_table_from_django(DjangoUser)
21.777778
51
0.780612
28
196
5.321429
0.607143
0
0
0
0
0
0
0
0
0
0
0
0.168367
196
8
52
24.5
0.91411
0.193878
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
58c7d376c2fb7bd1e705a6c7dcc2ca76d379ea5b
309
py
Python
trade_utilities/executions.py
bkarjoo/pysim
5d4e6ae337cac5b588a98ed33807e97677e36922
[ "MIT" ]
null
null
null
trade_utilities/executions.py
bkarjoo/pysim
5d4e6ae337cac5b588a98ed33807e97677e36922
[ "MIT" ]
null
null
null
trade_utilities/executions.py
bkarjoo/pysim
5d4e6ae337cac5b588a98ed33807e97677e36922
[ "MIT" ]
null
null
null
class Executions(object): def __init__(self): self.executions = [] def append(self, execution): self.executions.append(execution) def shares_traded(self): return sum([abs(item.qty) for item in self.executions]) def __len__(self): return len(self.executions)
23.769231
63
0.647249
37
309
5.162162
0.486486
0.293194
0.17801
0
0
0
0
0
0
0
0
0
0.239482
309
12
64
25.75
0.812766
0
0
0
0
0
0
0
0
0
0
0
0
1
0.444444
false
0
0
0.222222
0.777778
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
58d6151f82f31cb94db1d639deb715ae93b58aea
1,482
py
Python
tests/test_choice_from_list.py
zheyu-wang-tony/datahub
40bcf2e225f74c914afee6843ace11a8dea20bf9
[ "Apache-2.0" ]
null
null
null
tests/test_choice_from_list.py
zheyu-wang-tony/datahub
40bcf2e225f74c914afee6843ace11a8dea20bf9
[ "Apache-2.0" ]
null
null
null
tests/test_choice_from_list.py
zheyu-wang-tony/datahub
40bcf2e225f74c914afee6843ace11a8dea20bf9
[ "Apache-2.0" ]
null
null
null
import numpy as np import datahub_core.generators as gen def test_address_generation(): df = gen.generate( props={ 'region': gen.choice(['NAM', 'EMEA', 'APAC', 'LATAM']), }, count=100, randomstate=np.random.RandomState(13031981) ).to_dataframe() found_nam = False found_emea = False found_apac = False found_latam = False for row in df['region']: if row == 'NAM': found_nam = True if row == 'EMEA': found_emea = True if row == 'APAC': found_apac = True if row == 'LATAM': found_latam = True assert found_nam assert found_emea assert found_apac assert found_latam def test_test_weighting(): df = gen.generate( props={ 'region': gen.choice( data=['NAM', 'EMEA', 'APAC', 'LATAM'], weights=[0, 0.5, 0.5, 0]), }, count=100, randomstate=np.random.RandomState(13031981) ).to_dataframe() found_nam = False found_emea = False found_apac = False found_latam = False for row in df['region']: if row == 'NAM': found_nam = True if row == 'EMEA': found_emea = True if row == 'APAC': found_apac = True if row == 'LATAM': found_latam = True assert not found_nam assert found_emea assert found_apac assert not found_latam
23.15625
67
0.537787
174
1,482
4.402299
0.241379
0.052219
0.070496
0.046997
0.78329
0.78329
0.78329
0.697128
0.697128
0.582245
0
0.029289
0.354926
1,482
63
68
23.52381
0.771967
0
0
0.740741
1
0
0.059379
0
0
0
0
0
0.148148
1
0.037037
false
0
0.037037
0
0.074074
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
58feec3a171a7d23967fb87272b47eaf4d82e5bc
30
py
Python
cosmos/ingestion/ingest/process/detection/src/torch_model/train/anchor_targets/__init__.py
ilmcconnell/Cosmos
84245034727c30e20ffddee9e02c7e96f3aa115e
[ "Apache-2.0" ]
30
2019-03-14T08:24:34.000Z
2022-03-09T06:05:44.000Z
cosmos/ingestion/ingest/process/detection/src/torch_model/train/anchor_targets/__init__.py
ilmcconnell/Cosmos
84245034727c30e20ffddee9e02c7e96f3aa115e
[ "Apache-2.0" ]
78
2019-02-07T22:14:48.000Z
2022-03-09T05:59:18.000Z
cosmos/ingestion/ingest/process/detection/src/torch_model/train/anchor_targets/__init__.py
ilmcconnell/Cosmos
84245034727c30e20ffddee9e02c7e96f3aa115e
[ "Apache-2.0" ]
11
2019-03-02T01:20:06.000Z
2022-03-25T07:25:46.000Z
""" Anchor targets module """
7.5
21
0.633333
3
30
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
30
3
22
10
0.76
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
18ef39fe736f8e8ad6e7df9847943aa98bca2c9e
17,944
py
Python
netbox/dcim/migrations/0044_virtualization_squashed_0061_platform_napalm_args.py
BrnoPCmaniak/netbox
7b517abdb68a6324950dfd0375861163c7bfff00
[ "Apache-2.0" ]
1
2021-09-23T00:06:51.000Z
2021-09-23T00:06:51.000Z
netbox/dcim/migrations/0044_virtualization_squashed_0061_platform_napalm_args.py
BrnoPCmaniak/netbox
7b517abdb68a6324950dfd0375861163c7bfff00
[ "Apache-2.0" ]
2
2021-06-08T21:05:10.000Z
2021-09-08T01:46:58.000Z
netbox/dcim/migrations/0044_virtualization_squashed_0061_platform_napalm_args.py
BrnoPCmaniak/netbox
7b517abdb68a6324950dfd0375861163c7bfff00
[ "Apache-2.0" ]
null
null
null
import django.contrib.postgres.fields.jsonb import django.core.validators import django.db.models.deletion import taggit.managers import timezone_field.fields from django.conf import settings from django.db import migrations, models import utilities.fields class Migration(migrations.Migration): replaces = [('dcim', '0044_virtualization'), ('dcim', '0045_devicerole_vm_role'), ('dcim', '0046_rack_lengthen_facility_id'), ('dcim', '0047_more_100ge_form_factors'), ('dcim', '0048_rack_serial'), ('dcim', '0049_rackreservation_change_user'), ('dcim', '0050_interface_vlan_tagging'), ('dcim', '0051_rackreservation_tenant'), ('dcim', '0052_virtual_chassis'), ('dcim', '0053_platform_manufacturer'), ('dcim', '0054_site_status_timezone_description'), ('dcim', '0055_virtualchassis_ordering'), ('dcim', '0056_django2'), ('dcim', '0057_tags'), ('dcim', '0058_relax_rack_naming_constraints'), ('dcim', '0059_site_latitude_longitude'), ('dcim', '0060_change_logging'), ('dcim', '0061_platform_napalm_args')] dependencies = [ ('virtualization', '0001_virtualization'), ('tenancy', '0003_unicode_literals'), ('ipam', '0020_ipaddress_add_role_carp'), ('dcim', '0043_device_component_name_lengths'), ('taggit', '0002_auto_20150616_2121'), ] operations = [ migrations.AddField( model_name='device', name='cluster', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devices', to='virtualization.Cluster'), ), migrations.AddField( model_name='interface', name='virtual_machine', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='interfaces', to='virtualization.VirtualMachine'), ), migrations.AlterField( model_name='interface', name='device', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='interfaces', to='dcim.Device'), ), migrations.AddField( model_name='devicerole', name='vm_role', field=models.BooleanField(default=True, help_text='Virtual machines may be assigned to this role', verbose_name='VM Role'), ), migrations.AlterField( model_name='rack', name='facility_id', field=utilities.fields.NullableCharField(blank=True, max_length=50, null=True, verbose_name='Facility ID'), ), migrations.AlterField( model_name='interface', name='form_factor', field=models.PositiveSmallIntegerField(choices=[['Virtual interfaces', [[0, 'Virtual'], [200, 'Link Aggregation Group (LAG)']]], ['Ethernet (fixed)', [[800, '100BASE-TX (10/100ME)'], [1000, '1000BASE-T (1GE)'], [1150, '10GBASE-T (10GE)'], [1170, '10GBASE-CX4 (10GE)']]], ['Ethernet (modular)', [[1050, 'GBIC (1GE)'], [1100, 'SFP (1GE)'], [1200, 'SFP+ (10GE)'], [1300, 'XFP (10GE)'], [1310, 'XENPAK (10GE)'], [1320, 'X2 (10GE)'], [1350, 'SFP28 (25GE)'], [1400, 'QSFP+ (40GE)'], [1500, 'CFP (100GE)'], [1510, 'CFP2 (100GE)'], [1520, 'CFP4 (100GE)'], [1550, 'Cisco CPAK (100GE)'], [1600, 'QSFP28 (100GE)']]], ['Wireless', [[2600, 'IEEE 802.11a'], [2610, 'IEEE 802.11b/g'], [2620, 'IEEE 802.11n'], [2630, 'IEEE 802.11ac'], [2640, 'IEEE 802.11ad']]], ['FibreChannel', [[3010, 'SFP (1GFC)'], [3020, 'SFP (2GFC)'], [3040, 'SFP (4GFC)'], [3080, 'SFP+ (8GFC)'], [3160, 'SFP+ (16GFC)']]], ['Serial', [[4000, 'T1 (1.544 Mbps)'], [4010, 'E1 (2.048 Mbps)'], [4040, 'T3 (45 Mbps)'], [4050, 'E3 (34 Mbps)']]], ['Stacking', [[5000, 'Cisco StackWise'], [5050, 'Cisco StackWise Plus'], [5100, 'Cisco FlexStack'], [5150, 'Cisco FlexStack Plus'], [5200, 'Juniper VCP']]], ['Other', [[32767, 'Other']]]], default=1200), ), migrations.AlterField( model_name='interfacetemplate', name='form_factor', field=models.PositiveSmallIntegerField(choices=[['Virtual interfaces', [[0, 'Virtual'], [200, 'Link Aggregation Group (LAG)']]], ['Ethernet (fixed)', [[800, '100BASE-TX (10/100ME)'], [1000, '1000BASE-T (1GE)'], [1150, '10GBASE-T (10GE)'], [1170, '10GBASE-CX4 (10GE)']]], ['Ethernet (modular)', [[1050, 'GBIC (1GE)'], [1100, 'SFP (1GE)'], [1200, 'SFP+ (10GE)'], [1300, 'XFP (10GE)'], [1310, 'XENPAK (10GE)'], [1320, 'X2 (10GE)'], [1350, 'SFP28 (25GE)'], [1400, 'QSFP+ (40GE)'], [1500, 'CFP (100GE)'], [1510, 'CFP2 (100GE)'], [1520, 'CFP4 (100GE)'], [1550, 'Cisco CPAK (100GE)'], [1600, 'QSFP28 (100GE)']]], ['Wireless', [[2600, 'IEEE 802.11a'], [2610, 'IEEE 802.11b/g'], [2620, 'IEEE 802.11n'], [2630, 'IEEE 802.11ac'], [2640, 'IEEE 802.11ad']]], ['FibreChannel', [[3010, 'SFP (1GFC)'], [3020, 'SFP (2GFC)'], [3040, 'SFP (4GFC)'], [3080, 'SFP+ (8GFC)'], [3160, 'SFP+ (16GFC)']]], ['Serial', [[4000, 'T1 (1.544 Mbps)'], [4010, 'E1 (2.048 Mbps)'], [4040, 'T3 (45 Mbps)'], [4050, 'E3 (34 Mbps)']]], ['Stacking', [[5000, 'Cisco StackWise'], [5050, 'Cisco StackWise Plus'], [5100, 'Cisco FlexStack'], [5150, 'Cisco FlexStack Plus'], [5200, 'Juniper VCP']]], ['Other', [[32767, 'Other']]]], default=1200), ), migrations.AddField( model_name='rack', name='serial', field=models.CharField(blank=True, max_length=50, verbose_name='Serial number'), ), migrations.AlterField( model_name='rackreservation', name='user', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='interface', name='mode', field=models.PositiveSmallIntegerField(blank=True, choices=[[100, 'Access'], [200, 'Tagged'], [300, 'Tagged All']], null=True), ), migrations.AddField( model_name='interface', name='tagged_vlans', field=models.ManyToManyField(blank=True, related_name='interfaces_as_tagged', to='ipam.VLAN', verbose_name='Tagged VLANs'), ), migrations.AddField( model_name='rackreservation', name='tenant', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='rackreservations', to='tenancy.Tenant'), ), migrations.CreateModel( name='VirtualChassis', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('domain', models.CharField(blank=True, max_length=30)), ('master', models.OneToOneField(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='vc_master_for', to='dcim.Device')), ], options={ 'ordering': ['master'], 'verbose_name_plural': 'virtual chassis', }, ), migrations.AddField( model_name='device', name='virtual_chassis', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='members', to='dcim.VirtualChassis'), ), migrations.AddField( model_name='device', name='vc_position', field=models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)]), ), migrations.AddField( model_name='device', name='vc_priority', field=models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)]), ), migrations.AlterUniqueTogether( name='device', unique_together={('rack', 'position', 'face'), ('virtual_chassis', 'vc_position')}, ), migrations.AlterField( model_name='platform', name='napalm_driver', field=models.CharField(blank=True, help_text='The name of the NAPALM driver to use when interacting with devices', max_length=50, verbose_name='NAPALM driver'), ), migrations.AddField( model_name='site', name='description', field=models.CharField(blank=True, max_length=100), ), migrations.AddField( model_name='site', name='status', field=models.PositiveSmallIntegerField(choices=[[1, 'Active'], [2, 'Planned'], [4, 'Retired']], default=1), ), migrations.AddField( model_name='site', name='time_zone', field=timezone_field.fields.TimeZoneField(blank=True), ), migrations.AlterField( model_name='virtualchassis', name='master', field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='vc_master_for', to='dcim.Device'), ), migrations.AddField( model_name='interface', name='untagged_vlan', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='interfaces_as_untagged', to='ipam.VLAN', verbose_name='Untagged VLAN'), ), migrations.AddField( model_name='platform', name='manufacturer', field=models.ForeignKey(blank=True, help_text='Optionally limit this platform to devices of a certain manufacturer', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='platforms', to='dcim.Manufacturer'), ), migrations.AddField( model_name='device', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='devicetype', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='rack', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='site', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='consoleport', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='consoleserverport', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='devicebay', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='interface', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='inventoryitem', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='poweroutlet', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='powerport', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AddField( model_name='virtualchassis', name='tags', field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'), ), migrations.AlterModelOptions( name='rack', options={'ordering': ['site', 'group', 'name']}, ), migrations.AlterUniqueTogether( name='rack', unique_together={('group', 'name'), ('group', 'facility_id')}, ), migrations.AddField( model_name='site', name='latitude', field=models.DecimalField(blank=True, decimal_places=6, max_digits=8, null=True), ), migrations.AddField( model_name='site', name='longitude', field=models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True), ), migrations.AddField( model_name='devicerole', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='devicerole', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='devicetype', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='devicetype', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='manufacturer', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='manufacturer', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='platform', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='platform', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='rackgroup', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='rackgroup', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='rackreservation', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='rackrole', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='rackrole', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='region', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='region', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='virtualchassis', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AddField( model_name='virtualchassis', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AlterField( model_name='device', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AlterField( model_name='device', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AlterField( model_name='rack', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AlterField( model_name='rack', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AlterField( model_name='rackreservation', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AlterField( model_name='site', name='created', field=models.DateField(auto_now_add=True, null=True), ), migrations.AlterField( model_name='site', name='last_updated', field=models.DateTimeField(auto_now=True, null=True), ), migrations.AddField( model_name='platform', name='napalm_args', field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text='Additional arguments to pass when initiating the NAPALM driver (JSON format)', null=True, verbose_name='NAPALM arguments'), ), ]
50.546479
1,210
0.597693
1,858
17,944
5.62648
0.181378
0.052516
0.103405
0.121389
0.757413
0.725751
0.646929
0.623493
0.618232
0.604266
0
0.049248
0.247492
17,944
354
1,211
50.689266
0.72495
0
0
0.758621
0
0
0.251393
0.029202
0
0
0
0
0
1
0
false
0.002874
0.022989
0
0.034483
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
7a19be530f5cea0c8e3abb4854d0dbd9712c508a
187
py
Python
dataformat-json-jackson/src/test/resources/org/camunda/spin/python/json/tree/JsonTreeSetPropertyPythonTest.shouldReplaceObjectProperty.py
ingorichtsmeier/camunda-spin
f6f929cb4b49f5be3c06fcecf03008fec9fe25c1
[ "Apache-2.0" ]
27
2015-02-15T22:01:39.000Z
2022-03-02T05:41:29.000Z
dataformat-json-jackson/src/test/resources/org/camunda/spin/python/json/tree/JsonTreeSetPropertyPythonTest.shouldReplaceObjectProperty.py
ingorichtsmeier/camunda-spin
f6f929cb4b49f5be3c06fcecf03008fec9fe25c1
[ "Apache-2.0" ]
101
2015-06-05T06:53:56.000Z
2022-02-28T19:32:44.000Z
dataformat-json-jackson/src/test/resources/org/camunda/spin/python/json/tree/JsonTreeSetPropertyPythonTest.shouldReplaceObjectProperty.py
ingorichtsmeier/camunda-spin
f6f929cb4b49f5be3c06fcecf03008fec9fe25c1
[ "Apache-2.0" ]
25
2015-05-26T21:28:42.000Z
2021-07-06T10:04:01.000Z
node = S(input, "application/json") oldValue = node.prop("order") jsonObject = { "name": "test", "comment": "42!" } node.prop("order", jsonObject) newValue = node.prop("order")
17
35
0.625668
22
187
5.318182
0.636364
0.205128
0.333333
0.393162
0
0
0
0
0
0
0
0.012739
0.160428
187
11
36
17
0.732484
0
0
0
0
0
0.260638
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
e13295df6149bfe10f3c7dc3aca345513f5d842d
1,378
py
Python
application/models/user.py
Rsl1122/Forum-Aurum
d9f2d6687b4411a3d9cba4c1a01923f6d4ba0c69
[ "MIT" ]
null
null
null
application/models/user.py
Rsl1122/Forum-Aurum
d9f2d6687b4411a3d9cba4c1a01923f6d4ba0c69
[ "MIT" ]
2
2018-04-22T20:08:25.000Z
2018-08-11T20:57:47.000Z
application/models/user.py
Rsl1122/Forum-Aurum
d9f2d6687b4411a3d9cba4c1a01923f6d4ba0c69
[ "MIT" ]
null
null
null
from sqlalchemy import text from application import db from application.models.user_role import UserRole class User(db.Model): __tablename__ = "account" id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100)) created = db.Column(db.DateTime, default=db.func.current_timestamp()) password = db.Column(db.String(150)) topics = db.relationship("Topic", back_populates='account', lazy=True) messages = db.relationship("Message", back_populates='account', lazy=True) roles = db.relationship('Role', secondary=UserRole, backref='User') def __init__(self, name, hashedPassword): self.name = name self.password = hashedPassword def get_id(self): return self.id def is_active(self): return True def is_anonymous(self): return False def is_authenticated(self): return True def has_role(self, role): for r in self.roles: if r.name == role: return True return False def role_names(self): # Turn user's roles into a list of role names return list(map(lambda role: role.name, self.roles)) @staticmethod def find_user_count(): stmt = text("SELECT COUNT(*) as c FROM account LIMIT 1") res = db.engine.execute(stmt) for row in res: return row[0]
26
78
0.640784
181
1,378
4.762431
0.447514
0.037123
0.046404
0.037123
0.064965
0
0
0
0
0
0
0.007805
0.256168
1,378
52
79
26.5
0.833171
0.031205
0
0.138889
0
0
0.061515
0
0
0
0
0
0
1
0.222222
false
0.083333
0.083333
0.138889
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
e14c8dbfc8bc358b24ede1903a6a39230071e498
117
py
Python
office365/sharepoint/pages/template_file_type.py
wreiner/Office365-REST-Python-Client
476bbce4f5928a140b4f5d33475d0ac9b0783530
[ "MIT" ]
null
null
null
office365/sharepoint/pages/template_file_type.py
wreiner/Office365-REST-Python-Client
476bbce4f5928a140b4f5d33475d0ac9b0783530
[ "MIT" ]
null
null
null
office365/sharepoint/pages/template_file_type.py
wreiner/Office365-REST-Python-Client
476bbce4f5928a140b4f5d33475d0ac9b0783530
[ "MIT" ]
null
null
null
class TemplateFileType: def __init__(self): pass StandardPage = 0 WikiPage = 1 FormPage = 2
14.625
23
0.606838
12
117
5.583333
1
0
0
0
0
0
0
0
0
0
0
0.038462
0.333333
117
7
24
16.714286
0.820513
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
e15b454b5cf405b40d8aee4544d849cebf8a71b0
118
py
Python
qtoggleserver/mppsolar/commands/pbdv.py
qtoggle/qtoggleserver-mppsolar
cc3a68f3ba9f5695946989ea5fa32364c5e28f70
[ "Apache-2.0" ]
1
2021-11-30T01:04:37.000Z
2021-11-30T01:04:37.000Z
qtoggleserver/mppsolar/commands/pbdv.py
qtoggle/qtoggleserver-mppsolar
cc3a68f3ba9f5695946989ea5fa32364c5e28f70
[ "Apache-2.0" ]
null
null
null
qtoggleserver/mppsolar/commands/pbdv.py
qtoggle/qtoggleserver-mppsolar
cc3a68f3ba9f5695946989ea5fa32364c5e28f70
[ "Apache-2.0" ]
null
null
null
from .base import Command class PBDV(Command): REQUEST_FMT = 'PBDV{battery_back_to_discharging_voltage:04.1f}'
16.857143
67
0.771186
17
118
5.058824
0.882353
0
0
0
0
0
0
0
0
0
0
0.029412
0.135593
118
6
68
19.666667
0.813725
0
0
0
0
0
0.401709
0.401709
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
1
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
e15cf002aeee90b8a8e4fb51920ec2785dea62e9
222
py
Python
scripts/util/si_formatter.py
iQoo/NYState-COVID-19-Tracker
2c39c182e3420768bc60902d220d6b257eb7b73f
[ "MIT" ]
16
2020-04-01T16:22:32.000Z
2020-08-10T20:14:19.000Z
scripts/util/si_formatter.py
iQoo/NYState-COVID-19-Tracker
2c39c182e3420768bc60902d220d6b257eb7b73f
[ "MIT" ]
11
2020-04-02T14:21:22.000Z
2022-03-12T00:28:20.000Z
scripts/util/si_formatter.py
iQoo/NYState-COVID-19-Tracker
2c39c182e3420768bc60902d220d6b257eb7b73f
[ "MIT" ]
8
2020-04-02T14:10:31.000Z
2020-10-24T05:06:24.000Z
import si_prefix from matplotlib.ticker import LogFormatter class LogFormatterSI(LogFormatter): def _num_to_string(self, x, vmin, vmax): return si_prefix.si_format(x, precision=0, format_str='{value}{prefix}')
37
80
0.765766
31
222
5.258065
0.741935
0.09816
0
0
0
0
0
0
0
0
0
0.005181
0.130631
222
6
80
37
0.839378
0
0
0
0
0
0.067265
0
0
0
0
0
0
1
0.2
false
0
0.4
0.2
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
e16a99338edffe6ebb1c178aec99baa780c71941
7,031
py
Python
gnuradio-3.7.13.4/gr-digital/python/digital/qa_pfb_clock_sync.py
v1259397/cosmic-gnuradio
64c149520ac6a7d44179c3f4a38f38add45dd5dc
[ "BSD-3-Clause" ]
1
2021-03-09T07:32:37.000Z
2021-03-09T07:32:37.000Z
gnuradio-3.7.13.4/gr-digital/python/digital/qa_pfb_clock_sync.py
v1259397/cosmic-gnuradio
64c149520ac6a7d44179c3f4a38f38add45dd5dc
[ "BSD-3-Clause" ]
null
null
null
gnuradio-3.7.13.4/gr-digital/python/digital/qa_pfb_clock_sync.py
v1259397/cosmic-gnuradio
64c149520ac6a7d44179c3f4a38f38add45dd5dc
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # # Copyright 2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # import random import cmath import time from gnuradio import gr, gr_unittest, filter, digital, blocks class test_pfb_clock_sync(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() def tearDown(self): self.tb = None def test01(self): # Test BPSK sync excess_bw = 0.35 sps = 4 loop_bw = cmath.pi/100.0 nfilts = 32 init_phase = nfilts/2 max_rate_deviation = 0.5 osps = 1 ntaps = 11 * int(sps*nfilts) taps = filter.firdes.root_raised_cosine(nfilts, nfilts*sps, 1.0, excess_bw, ntaps) self.test = digital.pfb_clock_sync_ccf(sps, loop_bw, taps, nfilts, init_phase, max_rate_deviation, osps) data = 10000*[complex(1,0), complex(-1,0)] self.src = blocks.vector_source_c(data, False) # pulse shaping interpolation filter rrc_taps = filter.firdes.root_raised_cosine( nfilts, # gain nfilts, # sampling rate based on 32 filters in resampler 1.0, # symbol rate excess_bw, # excess bandwidth (roll-off factor) ntaps) self.rrc_filter = filter.pfb_arb_resampler_ccf(sps, rrc_taps) self.snk = blocks.vector_sink_c() self.tb.connect(self.src, self.rrc_filter, self.test, self.snk) self.tb.run() expected_result = 10000*[complex(1,0), complex(-1,0)] dst_data = self.snk.data() # Only compare last Ncmp samples Ncmp = 1000 len_e = len(expected_result) len_d = len(dst_data) expected_result = expected_result[len_e - Ncmp:] dst_data = dst_data[len_d - Ncmp:] #for e,d in zip(expected_result, dst_data): # print e, d self.assertComplexTuplesAlmostEqual(expected_result, dst_data, 1) def test02(self): # Test real BPSK sync excess_bw = 0.35 sps = 4 loop_bw = cmath.pi/100.0 nfilts = 32 init_phase = nfilts/2 max_rate_deviation = 0.5 osps = 1 ntaps = 11 * int(sps*nfilts) taps = filter.firdes.root_raised_cosine(nfilts, nfilts*sps, 1.0, excess_bw, ntaps) self.test = digital.pfb_clock_sync_fff(sps, loop_bw, taps, nfilts, init_phase, max_rate_deviation, osps) data = 10000*[1, -1] self.src = blocks.vector_source_f(data, False) # pulse shaping interpolation filter rrc_taps = filter.firdes.root_raised_cosine( nfilts, # gain nfilts, # sampling rate based on 32 filters in resampler 1.0, # symbol rate excess_bw, # excess bandwidth (roll-off factor) ntaps) self.rrc_filter = filter.pfb_arb_resampler_fff(sps, rrc_taps) self.snk = blocks.vector_sink_f() self.tb.connect(self.src, self.rrc_filter, self.test, self.snk) self.tb.run() expected_result = 10000*[1, -1] dst_data = self.snk.data() # Only compare last Ncmp samples Ncmp = 1000 len_e = len(expected_result) len_d = len(dst_data) expected_result = expected_result[len_e - Ncmp:] dst_data = dst_data[len_d - Ncmp:] #for e,d in zip(expected_result, dst_data): # print e, d self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 1) def test03(self): # Test resting of taps excess_bw0 = 0.35 excess_bw1 = 0.22 sps = 4 loop_bw = cmath.pi/100.0 nfilts = 32 init_phase = nfilts/2 max_rate_deviation = 0.5 osps = 1 ntaps = 11 * int(sps*nfilts) taps = filter.firdes.root_raised_cosine(nfilts, nfilts*sps, 1.0, excess_bw0, ntaps) self.test = digital.pfb_clock_sync_ccf(sps, loop_bw, taps, nfilts, init_phase, max_rate_deviation, osps) self.src = blocks.null_source(gr.sizeof_gr_complex) self.snk = blocks.null_sink(gr.sizeof_gr_complex) self.tb.connect(self.src, self.test, self.snk) self.tb.start() time.sleep(0.1) taps = filter.firdes.root_raised_cosine(nfilts, nfilts*sps, 1.0, excess_bw1, ntaps) self.test.update_taps(taps) self.tb.stop() self.tb.wait() self.assertTrue(True) def test03_f(self): # Test resting of taps excess_bw0 = 0.35 excess_bw1 = 0.22 sps = 4 loop_bw = cmath.pi/100.0 nfilts = 32 init_phase = nfilts/2 max_rate_deviation = 0.5 osps = 1 ntaps = 11 * int(sps*nfilts) taps = filter.firdes.root_raised_cosine(nfilts, nfilts*sps, 1.0, excess_bw0, ntaps) self.test = digital.pfb_clock_sync_fff(sps, loop_bw, taps, nfilts, init_phase, max_rate_deviation, osps) self.src = blocks.null_source(gr.sizeof_float) self.snk = blocks.null_sink(gr.sizeof_float) self.tb.connect(self.src, self.test, self.snk) self.tb.start() time.sleep(0.1) taps = filter.firdes.root_raised_cosine(nfilts, nfilts*sps, 1.0, excess_bw1, ntaps) self.test.update_taps(taps) self.tb.stop() self.tb.wait() self.assertTrue(True) if __name__ == '__main__': gr_unittest.run(test_pfb_clock_sync, "test_pfb_clock_sync.xml")
31.671171
77
0.548002
874
7,031
4.223112
0.23341
0.022758
0.034679
0.043349
0.75806
0.732593
0.703874
0.678407
0.660526
0.660526
0
0.038791
0.369364
7,031
221
78
31.81448
0.79364
0.182904
0
0.77037
0
0
0.005435
0.004032
0
0
0
0
0.02963
1
0.044444
false
0
0.02963
0
0.081481
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
e18010c558ea4d95b1a3770b4e5a294222e2cd4e
131
py
Python
filters.py
Phrampu/phrampu
1c7ab14b2486a679bb9fffab978a522754d10c1f
[ "MIT" ]
1
2017-03-16T19:24:33.000Z
2017-03-16T19:24:33.000Z
filters.py
Phrampu/phrampu
1c7ab14b2486a679bb9fffab978a522754d10c1f
[ "MIT" ]
2
2016-11-12T22:09:50.000Z
2016-11-18T19:34:05.000Z
filters.py
Phrampu/phrampu
1c7ab14b2486a679bb9fffab978a522754d10c1f
[ "MIT" ]
1
2016-11-10T19:24:23.000Z
2016-11-10T19:24:23.000Z
import logging class MyFilter(logging.Filter): def filter(self, record): return record.name != 'paramiko.transport'
16.375
50
0.694656
15
131
6.066667
0.8
0
0
0
0
0
0
0
0
0
0
0
0.198473
131
7
51
18.714286
0.866667
0
0
0
0
0
0.137405
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
e190763d875917513e2877e63412397bff1e5255
331
py
Python
pynotes/helpers/__init__.py
afonsopacifer/pynotes
442b2a3f802d523f1872ba912af880fdd3849062
[ "MIT" ]
8
2018-07-27T15:06:29.000Z
2019-07-23T04:01:24.000Z
pynotes/helpers/__init__.py
afonsopacifer/pynotes
442b2a3f802d523f1872ba912af880fdd3849062
[ "MIT" ]
null
null
null
pynotes/helpers/__init__.py
afonsopacifer/pynotes
442b2a3f802d523f1872ba912af880fdd3849062
[ "MIT" ]
1
2018-07-31T00:43:58.000Z
2018-07-31T00:43:58.000Z
from .file_exist import file_exist class helpers: def file_exist(file_name): return file_exist(file_name) class colors: def success(text): return '\033[92m' + text def warning(text): return '\033[93m' + text def error(text): return '\033[91m' + text
19.470588
36
0.567976
41
331
4.439024
0.439024
0.197802
0.214286
0.186813
0
0
0
0
0
0
0
0.068182
0.335347
331
17
37
19.470588
0.759091
0
0
0
0
0
0.072289
0
0
0
0
0
0
1
0.363636
false
0
0.090909
0.363636
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
e1cdb170c24eb2d41f98543b5553171526b689e6
198
py
Python
scripts/tor.newnym.py
asvdf/joininbox
0e9c14e4b3ba50eaf35d182a4f48ce36da85be9f
[ "MIT" ]
102
2020-01-20T07:00:28.000Z
2022-03-28T04:13:13.000Z
scripts/tor.newnym.py
asvdf/joininbox
0e9c14e4b3ba50eaf35d182a4f48ce36da85be9f
[ "MIT" ]
66
2020-06-14T15:53:22.000Z
2022-03-12T10:45:01.000Z
scripts/tor.newnym.py
asvdf/joininbox
0e9c14e4b3ba50eaf35d182a4f48ce36da85be9f
[ "MIT" ]
17
2020-06-21T21:22:03.000Z
2022-03-11T13:23:20.000Z
#!/usr/bin/env python3 from stem import Signal from stem.control import Controller with Controller.from_port(port=9051) as controller: controller.authenticate() controller.signal(Signal.NEWNYM)
22
51
0.808081
27
198
5.888889
0.592593
0.100629
0
0
0
0
0
0
0
0
0
0.02809
0.10101
198
8
52
24.75
0.865169
0.106061
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
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
bed460a84a5d20781dbbbbdc09c03ebb9273b977
148
py
Python
app/__init__.py
TranscendComputing/StackStudio
f596d1ff6935d63c8aea740fb100459b368bb5c5
[ "Apache-2.0" ]
null
null
null
app/__init__.py
TranscendComputing/StackStudio
f596d1ff6935d63c8aea740fb100459b368bb5c5
[ "Apache-2.0" ]
null
null
null
app/__init__.py
TranscendComputing/StackStudio
f596d1ff6935d63c8aea740fb100459b368bb5c5
[ "Apache-2.0" ]
null
null
null
#! /usr/bin/env python # # Simple app pieces for running StackPlace on GAE # # Copyright (c) 2013, Transcend Computing, Inc. # All rights reserved.
21.142857
49
0.722973
21
148
5.095238
1
0
0
0
0
0
0
0
0
0
0
0.03252
0.168919
148
6
50
24.666667
0.837398
0.918919
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
bed81d921343887d980e663596e3f8cf473510fc
220
py
Python
pythonProject/005.py
MontanhaRio/python
43ad6173d692ebeb153c23c893e4b8f0bf07afcc
[ "MIT" ]
null
null
null
pythonProject/005.py
MontanhaRio/python
43ad6173d692ebeb153c23c893e4b8f0bf07afcc
[ "MIT" ]
null
null
null
pythonProject/005.py
MontanhaRio/python
43ad6173d692ebeb153c23c893e4b8f0bf07afcc
[ "MIT" ]
null
null
null
N = int(input('Digite um numero:')) a = N - 1 s = N + 1 #print('analisando o valor {} , seu antecessor e {} e o sucessor e {} '.format(N, a, s)) print(f'Analisando o valor {N} , seu antecessor e {a} e o sucessor e {s}')
36.666667
88
0.609091
42
220
3.190476
0.452381
0.029851
0.238806
0.164179
0
0
0
0
0
0
0
0.011494
0.209091
220
5
89
44
0.758621
0.395455
0
0
0
0
0.613636
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
bef4eb3923c67b2d848891c343f3be622cf34ada
16,373
py
Python
main.py
alexnaoki/LHC_Hidroweb_Kivy
089ef1a952843f0f275c53eda179aca7417adb37
[ "MIT" ]
5
2021-01-15T15:26:56.000Z
2022-01-01T16:51:10.000Z
main.py
alexnaoki/LHC_Hidroweb_Kivy
089ef1a952843f0f275c53eda179aca7417adb37
[ "MIT" ]
null
null
null
main.py
alexnaoki/LHC_Hidroweb_Kivy
089ef1a952843f0f275c53eda179aca7417adb37
[ "MIT" ]
null
null
null
from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.network.urlrequest import UrlRequest from kivy.uix.popup import Popup from kivy.properties import ObjectProperty, StringProperty from kivy.lang import Builder from kivy.uix.screenmanager import ScreenManager, Screen from kivy.uix.filechooser import FileChooserListView from kivy.uix.button import Button from kivy.base import ExceptionHandler, ExceptionManager from kivy.clock import mainthread from mapview import MapMarker, MapView from mapview.clustered_marker_layer import ClusteredMarkerLayer from mapview.geojson import GeoJsonMapLayer from shapely.geometry import shape,mapping, Point, Polygon, MultiPolygon import shapefile from json import dumps from requests.models import PreparedRequest import xml.etree.ElementTree as ET import datetime import calendar import threading import csv import time import os class MainScreen(Screen): layer = ClusteredMarkerLayer(cluster_node_size=4,cluster_radius=200) popup = ObjectProperty() mapa = ObjectProperty() bbox = 0 def change_toInventario(self): self.manager.current = 'inventario' def change_toShape(self): self.manager.current = 'shapefilescreen' def change_toBbox(self): self.manager.current = 'bboxscreen' def change_toDownload_shp(self): self.manager.current = 'downloadscreen_shp' # def get_bbox(self): # bbox = self.manager.get_screen('bboxscreen').ids['mapbbox'].bbox # # self.manager.get_screen('bboxscreen').ids.labelbbox.text = str(self.manager.get_screen('main').ids['map'].bbox) # self.manager.get_screen('bboxscreen').ids.labelbbox.text = f'Latitude : [{bbox[2]:.3f} {bbox[0]:.3f}]\nLongitude: [{bbox[3]:.3f} {bbox[1]:.3f}]' # print(self.manager.get_screen('bboxscreen').ids['mapbbox'].bbox) # self.bbox = bbox def _donwload_teste(self, req, result): print('sucesso') print(result) def _download_error(self, *args): print('ERRO download') @mainthread def set_screen(self): self.manager.current = 'main' def show_codes(self): print(self.manager.get_screen('shapefilescreen').codes) class WindowManager(ScreenManager): pass class InventarioScreen(Screen): layer = ClusteredMarkerLayer(cluster_node_size=4,cluster_radius=200) inventario_path = StringProperty('') def teste(self): mark = MapMarker(lat=50, lon=10) self.manager.get_screen('main').ids['map'].add_marker(mark) def show_inventarioCluster(self, selection, *args): # print(selection) # self.manager.current = 'loading' # print(self.popup.inventario_path) # print(filechooserscreen.selection[0]) # self.ids['progressbar'].value = 25 self.inventario_path = selection[0] with open(self.inventario_path, encoding='utf8') as csvfile: data = csv.DictReader(csvfile) for row in data: self.layer.add_marker(lat=float(row['Latitude']), lon=float(row['Longitude'])) print('Added to layer') # self.ids['map'].add_widget(self.layer) self.manager.get_screen('main').ids['map'].add_widget(self.layer) self.layer.reposition() print('Added Layer') self.manager.current = 'main' self.manager.transition.direction = "left" # self.ids['progressbar'].value = 50 class ShapefileScreen(Screen): codes = [] def get_codes(self, selection, *args): print(selection[0]) shp_path = selection[0] shp = shapefile.Reader(shp_path) print(shp) all_shapes = shp.shapes() all_records = shp.records() print(all_shapes) print(all_records) print(self.manager.get_screen('inventario').ids.filechooserscreen.selection[0]) for i in range(len(all_shapes)): boundary = all_shapes[i] boundary = shape(boundary) print(boundary) with open(self.manager.get_screen('inventario').ids.filechooserscreen.selection[0], encoding='utf8') as csvfile: data = csv.DictReader(csvfile) for row in data: if Point((float(row['Longitude']), float(row['Latitude']))).within(boundary): print('Dentro') print(float(row['Latitude']), float(row['Longitude']), int(row['Codigo'])) mark = MapMarker(lat=float(row['Latitude']), lon=float(row['Longitude']), source='marker.png') self.manager.get_screen('main').ids['map'].add_marker(mark) self.codes.append(int(row['Codigo'])) else: pass print(self.codes) self.manager.current = 'main' self.manager.transition.direction = "down" class BBoxScreen(Screen): codes = [] def get_bbox(self): bbox = self.manager.get_screen('bboxscreen').ids['mapbbox'].bbox # self.manager.get_screen('bboxscreen').ids.labelbbox.text = str(self.manager.get_screen('main').ids['map'].bbox) self.manager.get_screen('bboxscreen').ids.labelbbox.text = f'Latitude : [{bbox[2]:.3f} {bbox[0]:.3f}]\nLongitude: [{bbox[3]:.3f} {bbox[1]:.3f}]' print(self.manager.get_screen('bboxscreen').ids['mapbbox'].bbox) self.bbox = bbox def get_codes(self): # bbox = self.manager.get_screen('main').bbox bbox = self.manager.get_screen('bboxscreen').ids['mapbbox'].bbox print(bbox) inventario_path = self.manager.get_screen('inventario').ids.filechooserscreen.selection[0] print(inventario_path) with open(inventario_path, encoding='utf8') as csvfile: data = csv.DictReader(csvfile) for row in data: if (float(row['Longitude'])>bbox[1]) and (float(row['Longitude'])<bbox[3]) and (float(row['Latitude'])>bbox[0]) and (float(row['Latitude'])<bbox[2]): print(row['Longitude'], row['Latitude'], row['Codigo']) mark = MapMarker(lat=float(row['Latitude']), lon=float(row['Longitude']), source='marker.png') self.manager.get_screen('main').ids['map'].add_marker(mark) self.codes.append(int(row['Codigo'])) else: pass print(len(self.codes)) self.manager.current = 'main' self.manager.transition.direction = 'up' class DownloadScreenShp(Screen): def selected(self, directory, filename): self.ids.downloadShpPath.text = os.path.dirname(filename) def teste(self): print(self.manager.get_screen('main').ids.toggle1.state) def download_ANA_station(self): folder_name = 'dados_LHC_hidroweb' b = 2 self.save_folder = os.path.join(self.ids.downloadShpPath.text, folder_name) if not os.path.exists(self.save_folder): print('nao existe, criando pasta') os.mkdir(self.save_folder) elif os.path.exists(self.save_folder): print('existe') print(self.manager.get_screen('main').ids.toggle1.state) print(self.manager.get_screen('main').ids.toggle2.state) if self.manager.get_screen('main').ids.toggle1.state == 'down': list_codes = self.manager.get_screen('shapefilescreen').codes if self.manager.get_screen('main').ids.toggle2.state == 'down': print('toggle2 down') list_codes = self.manager.get_screen('bboxscreen').codes print(list_codes) # if self.manager.get_screen('downloadscreen_shp').ids.togglechuva == 'down': # b = 2 # if self.manager.get_screen('downloadscreen_shp').ids.togglevazao == 'down': # b = 3 # else: # b = 3 # print('erro') # list_codes = [] for station in list_codes: api = 'http://telemetriaws1.ana.gov.br/ServiceANA.asmx/HidroSerieHistorica' self.params = {'codEstacao': station, 'dataInicio': '', 'dataFim': '', 'tipoDados': '{}'.format(b), 'nivelConsistencia': ''} url_req = PreparedRequest() url_req.prepare_url(api, self.params) self.req = UrlRequest( url_req.url, on_success=self._download_sucess, # on_success=self._donwload_teste, on_error=self._download_error, on_failure=self._download_error ) # print(self.req) # self.req.wait() print(station) def _donwload_teste(self, req, result): print('sucesso') print(result) def _download_sucess(self, req, result): try: # print(req) tree = ET.ElementTree(ET.fromstring(result)) root = tree.getroot() list_data = [] list_consistenciaF = [] list_month_dates = [] for i in root.iter('SerieHistorica'): codigo = i.find("EstacaoCodigo").text consistencia = i.find("NivelConsistencia").text date = i.find("DataHora").text date = datetime.datetime.strptime(date, '%Y-%m-%d %H:%M:%S') last_day = calendar.monthrange(date.year, date.month)[1] month_dates = [date + datetime.timedelta(days=i) for i in range(last_day)] data = [] list_consistencia = [] print(self.params['tipoDados']) for day in range(last_day): # if self.params['tipoDados'] == '3': # value = 'Vazao{:02}'.format(day+1) # try: # data.append(float(i.find(value).text)) # list_consistencia.append(int(consistencia)) # except TypeError: # data.append(i.find(value).text) # list_consistencia.append(int(consistencia)) # except AttributeError: # data.append(None) # list_consistencia.append(int(consistencia)) if self.params['tipoDados'] == '2': value = 'Chuva{:02}'.format(day+1) try: data.append(float(i.find(value).text)) list_consistencia.append(consistencia) except TypeError: data.append(i.find(value).text) list_consistencia.append(consistencia) except AttributeError: data.append(None) list_consistencia.append(consistencia) list_data = list_data + data list_consistenciaF = list_consistenciaF + list_consistencia list_month_dates = list_month_dates + month_dates # typeData = 2 print(list_data) # print(list_month_dates) # print(list_consistenciaF) if len(list_data) > 0: # print(typedata) typedata = self.params['tipoDados'] rows = zip(list_month_dates, list_consistenciaF, list_data) with open(os.path.join(self.save_folder,f'{typedata}_{codigo}.csv'), 'w', newline='') as f: writer = csv.writer(f) writer.writerow(('Date', f'Consistence_{typedata}_{codigo}', f'Data_{typedata}_{codigo}')) for row in rows: writer.writerow(row) except: print('ERRO') def _download_error(self, *args): print('ERRO download') def download_ANA_station_vazao(self): folder_name = 'dados_LHC_hidroweb' b = 3 self.save_folder = os.path.join(self.ids.downloadShpPath.text, folder_name) if not os.path.exists(self.save_folder): print('nao existe, criando pasta') os.mkdir(self.save_folder) elif os.path.exists(self.save_folder): print('existe') print(self.manager.get_screen('main').ids.toggle1.state) print(self.manager.get_screen('main').ids.toggle2.state) if self.manager.get_screen('main').ids.toggle1.state == 'down': list_codes = self.manager.get_screen('shapefilescreen').codes if self.manager.get_screen('main').ids.toggle2.state == 'down': print('toggle2 down') list_codes = self.manager.get_screen('bboxscreen').codes print(list_codes) # if self.manager.get_screen('downloadscreen_shp').ids.togglechuva == 'down': # b = 2 # if self.manager.get_screen('downloadscreen_shp').ids.togglevazao == 'down': # b = 3 # else: # b = 3 # print('erro') # list_codes = [] for station in list_codes: api = 'http://telemetriaws1.ana.gov.br/ServiceANA.asmx/HidroSerieHistorica' self.params = {'codEstacao': station, 'dataInicio': '', 'dataFim': '', 'tipoDados': '{}'.format(b), 'nivelConsistencia': ''} url_req = PreparedRequest() url_req.prepare_url(api, self.params) self.req = UrlRequest( url_req.url, on_success=self._download_sucess_vazao, # on_success=self._donwload_teste, on_error=self._download_error, on_failure=self._download_error ) # print(self.req) # self.req.wait() print(station) def _download_sucess_vazao(self, req, result): try: tree = ET.ElementTree(ET.fromstring(result)) root = tree.getroot() list_data = [] list_consistenciaF = [] list_month_dates = [] for i in root.iter('SerieHistorica'): codigo = i.find("EstacaoCodigo").text consistencia = i.find("NivelConsistencia").text date = i.find("DataHora").text date = datetime.datetime.strptime(date, '%Y-%m-%d %H:%M:%S') last_day = calendar.monthrange(date.year, date.month)[1] month_dates = [date + datetime.timedelta(days=i) for i in range(last_day)] data = [] list_consistencia = [] print(self.params['tipoDados']) for day in range(last_day): if self.params['tipoDados'] == '3': value = 'Vazao{:02}'.format(day+1) try: data.append(float(i.find(value).text)) list_consistencia.append(int(consistencia)) except TypeError: data.append(i.find(value).text) list_consistencia.append(int(consistencia)) except AttributeError: data.append(None) list_consistencia.append(int(consistencia)) list_data = list_data + data list_consistenciaF = list_consistenciaF + list_consistencia list_month_dates = list_month_dates + month_dates # typeData = 2 print(list_data) # print(list_month_dates) # print(list_consistenciaF) if len(list_data) > 0: # print(typedata) typedata = self.params['tipoDados'] rows = zip(list_month_dates, list_consistenciaF, list_data) with open(os.path.join(self.save_folder,f'{typedata}_{codigo}.csv'), 'w', newline='') as f: writer = csv.writer(f) writer.writerow(('Date', f'Consistence_{typedata}_{codigo}', f'Data_{typedata}_{codigo}')) for row in rows: writer.writerow(row) except: print('ERRO') class RootApp(App): def build(self): return Builder.load_file('main.kv') RootApp().run()
42.527273
165
0.570329
1,749
16,373
5.202973
0.152087
0.059231
0.056923
0.081319
0.742527
0.72967
0.720769
0.709231
0.687802
0.65044
0
0.007584
0.307457
16,373
384
166
42.638021
0.794955
0.121419
0
0.608541
0
0.003559
0.09947
0.012704
0
0
0
0
0
1
0.078292
false
0.010676
0.088968
0.003559
0.224199
0.156584
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
bef80c9cea9ac3e26d2e15014d8f66cb78145cf2
99
py
Python
apptSchedule/apps.py
MyMedicalAssistant/MyMedicalAssistant
e03758109167cef13efed7ee1d450dbd18a1fed7
[ "MIT" ]
null
null
null
apptSchedule/apps.py
MyMedicalAssistant/MyMedicalAssistant
e03758109167cef13efed7ee1d450dbd18a1fed7
[ "MIT" ]
1
2020-08-05T22:58:28.000Z
2020-08-05T22:58:28.000Z
apptSchedule/apps.py
MyMedicalAssistant/MyMedicalAssistant
e03758109167cef13efed7ee1d450dbd18a1fed7
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ApptscheduleConfig(AppConfig): name = 'apptSchedule'
16.5
36
0.777778
10
99
7.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.151515
99
5
37
19.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
83457f0b99a40bb668109631db69f0000aa2bba6
1,623
py
Python
tests/test_alphabet.py
bluesheeptoken/CPT
a63db544fdc306515e02245bcd7bc068048da04c
[ "MIT" ]
38
2019-03-25T13:15:03.000Z
2022-03-28T12:32:45.000Z
tests/test_alphabet.py
bluesheeptoken/CPT
a63db544fdc306515e02245bcd7bc068048da04c
[ "MIT" ]
20
2019-03-25T13:09:04.000Z
2022-03-29T16:54:27.000Z
tests/test_alphabet.py
bluesheeptoken/CPT
a63db544fdc306515e02245bcd7bc068048da04c
[ "MIT" ]
3
2020-07-03T16:12:07.000Z
2021-12-28T20:57:24.000Z
import unittest import pickle from cpt.alphabet import Alphabet class AlphabetTest(unittest.TestCase): def setUp(self): self.alphabet = Alphabet() self.alphabet.add_symbol('C') self.alphabet.add_symbol('P') self.alphabet.add_symbol('T') def test_setup(self): self.assertEqual(self.alphabet.length, 3) self.assertEqual(self.alphabet.indexes, {'C': 0, 'P': 1, 'T': 2}) self.assertEqual(self.alphabet.symbols, ['C', 'P', 'T']) def test_get_known_symbol(self): self.assertEqual(self.alphabet.get_symbol(0), 'C') def test_get_unknown_symbol(self): self.assertIsNone(self.alphabet.get_symbol(42)) def test_get_known_index(self): self.assertEqual(self.alphabet.get_index('P'), 1) def test_get_unknown_index(self): self.assertEqual(self.alphabet.get_index('X'), -1) def test_add_known_symbol(self): self.assertEqual(self.alphabet.add_symbol('P'), 1) self.assertEqual(self.alphabet.length, 3) def test_add_unknown_symbol(self): self.assertEqual(self.alphabet.add_symbol('X'), 3) self.assertEqual(self.alphabet.length, 4) def test_richcmp(self): self.assertNotEqual(self.alphabet, Alphabet()) alphabet = Alphabet() alphabet.add_symbol('C') alphabet.add_symbol('P') alphabet.add_symbol('T') self.assertEqual(self.alphabet, alphabet) def test_pickle(self): pickled = pickle.dumps(self.alphabet) unpickled_alphabet = pickle.loads(pickled) self.assertEqual(self.alphabet, unpickled_alphabet)
31.211538
73
0.667899
206
1,623
5.092233
0.194175
0.21735
0.21735
0.308866
0.367969
0.28408
0.216397
0.171592
0
0
0
0.010031
0.201479
1,623
51
74
31.823529
0.799383
0
0
0.052632
0
0
0.010474
0
0
0
0
0
0.368421
1
0.263158
false
0
0.078947
0
0.368421
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
8348d6a83d08cf786a1da36c935a946e54c3db77
20,841
py
Python
moose/ida/mips_identify_syscalls.py
H1d3r/malware-research
b2dad2a7d2e6fd3d469002a864ad5714906ea8e7
[ "BSD-2-Clause" ]
322
2015-02-28T10:22:31.000Z
2022-03-08T16:29:55.000Z
moose/ida/mips_identify_syscalls.py
XXXHakuna-MatataXXX/malware-research
8d0005fc4d29d08063e6c5b0c433c6faa0536659
[ "BSD-2-Clause" ]
4
2015-05-26T21:06:53.000Z
2021-03-04T20:56:15.000Z
moose/ida/mips_identify_syscalls.py
XXXHakuna-MatataXXX/malware-research
8d0005fc4d29d08063e6c5b0c433c6faa0536659
[ "BSD-2-Clause" ]
85
2015-01-09T12:10:25.000Z
2022-03-05T18:23:25.000Z
#!/usr/bin/env python # # Code related to ESET's Linux/Moose research # For feedback or questions contact us at: github@eset.com # https://github.com/eset/malware-research/ # # This code is provided to the community under the two-clause BSD license as # follows: # # Copyright (C) 2015 ESET # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Olivier Bilodeau <bilodeau@eset.com> # # Place a comment in IDA describing the syscall for MIPS with o32 ABI # # example syscall: # move $a0, $s0 # li $a1, 9 # li $v0, 4037 # syscall 0 # kill # 4037 is the syscall number which is kill # DEBUG = False # syscalls taken from: # http://git.linux-mips.org/cgit/ralf/linux.git/plain/arch/mips/include/uapi/asm/unistd.h # and processed with syscalls-to-dict.sh and then inlined here __NR_Linux = 4000 syscall_table = dict() syscall_table[(__NR_Linux+0)] = "__NR_syscall" syscall_table[(__NR_Linux+1)] = "__NR_exit" syscall_table[(__NR_Linux+2)] = "__NR_fork" syscall_table[(__NR_Linux+3)] = "__NR_read" syscall_table[(__NR_Linux+4)] = "__NR_write" syscall_table[(__NR_Linux+5)] = "__NR_open" syscall_table[(__NR_Linux+6)] = "__NR_close" syscall_table[(__NR_Linux+7)] = "__NR_waitpid" syscall_table[(__NR_Linux+8)] = "__NR_creat" syscall_table[(__NR_Linux+9)] = "__NR_link" syscall_table[(__NR_Linux+10)] = "__NR_unlink" syscall_table[(__NR_Linux+11)] = "__NR_execve" syscall_table[(__NR_Linux+12)] = "__NR_chdir" syscall_table[(__NR_Linux+13)] = "__NR_time" syscall_table[(__NR_Linux+14)] = "__NR_mknod" syscall_table[(__NR_Linux+15)] = "__NR_chmod" syscall_table[(__NR_Linux+16)] = "__NR_lchown" syscall_table[(__NR_Linux+17)] = "__NR_break" syscall_table[(__NR_Linux+18)] = "__NR_unused18" syscall_table[(__NR_Linux+19)] = "__NR_lseek" syscall_table[(__NR_Linux+20)] = "__NR_getpid" syscall_table[(__NR_Linux+21)] = "__NR_mount" syscall_table[(__NR_Linux+22)] = "__NR_umount" syscall_table[(__NR_Linux+23)] = "__NR_setuid" syscall_table[(__NR_Linux+24)] = "__NR_getuid" syscall_table[(__NR_Linux+25)] = "__NR_stime" syscall_table[(__NR_Linux+26)] = "__NR_ptrace" syscall_table[(__NR_Linux+27)] = "__NR_alarm" syscall_table[(__NR_Linux+28)] = "__NR_unused28" syscall_table[(__NR_Linux+29)] = "__NR_pause" syscall_table[(__NR_Linux+30)] = "__NR_utime" syscall_table[(__NR_Linux+31)] = "__NR_stty" syscall_table[(__NR_Linux+32)] = "__NR_gtty" syscall_table[(__NR_Linux+33)] = "__NR_access" syscall_table[(__NR_Linux+34)] = "__NR_nice" syscall_table[(__NR_Linux+35)] = "__NR_ftime" syscall_table[(__NR_Linux+36)] = "__NR_sync" syscall_table[(__NR_Linux+37)] = "__NR_kill" syscall_table[(__NR_Linux+38)] = "__NR_rename" syscall_table[(__NR_Linux+39)] = "__NR_mkdir" syscall_table[(__NR_Linux+40)] = "__NR_rmdir" syscall_table[(__NR_Linux+41)] = "__NR_dup" syscall_table[(__NR_Linux+42)] = "__NR_pipe" syscall_table[(__NR_Linux+43)] = "__NR_times" syscall_table[(__NR_Linux+44)] = "__NR_prof" syscall_table[(__NR_Linux+45)] = "__NR_brk" syscall_table[(__NR_Linux+46)] = "__NR_setgid" syscall_table[(__NR_Linux+47)] = "__NR_getgid" syscall_table[(__NR_Linux+48)] = "__NR_signal" syscall_table[(__NR_Linux+49)] = "__NR_geteuid" syscall_table[(__NR_Linux+50)] = "__NR_getegid" syscall_table[(__NR_Linux+51)] = "__NR_acct" syscall_table[(__NR_Linux+52)] = "__NR_umount2" syscall_table[(__NR_Linux+53)] = "__NR_lock" syscall_table[(__NR_Linux+54)] = "__NR_ioctl" syscall_table[(__NR_Linux+55)] = "__NR_fcntl" syscall_table[(__NR_Linux+56)] = "__NR_mpx" syscall_table[(__NR_Linux+57)] = "__NR_setpgid" syscall_table[(__NR_Linux+58)] = "__NR_ulimit" syscall_table[(__NR_Linux+59)] = "__NR_unused59" syscall_table[(__NR_Linux+60)] = "__NR_umask" syscall_table[(__NR_Linux+61)] = "__NR_chroot" syscall_table[(__NR_Linux+62)] = "__NR_ustat" syscall_table[(__NR_Linux+63)] = "__NR_dup2" syscall_table[(__NR_Linux+64)] = "__NR_getppid" syscall_table[(__NR_Linux+65)] = "__NR_getpgrp" syscall_table[(__NR_Linux+66)] = "__NR_setsid" syscall_table[(__NR_Linux+67)] = "__NR_sigaction" syscall_table[(__NR_Linux+68)] = "__NR_sgetmask" syscall_table[(__NR_Linux+69)] = "__NR_ssetmask" syscall_table[(__NR_Linux+70)] = "__NR_setreuid" syscall_table[(__NR_Linux+71)] = "__NR_setregid" syscall_table[(__NR_Linux+72)] = "__NR_sigsuspend" syscall_table[(__NR_Linux+73)] = "__NR_sigpending" syscall_table[(__NR_Linux+74)] = "__NR_sethostname" syscall_table[(__NR_Linux+75)] = "__NR_setrlimit" syscall_table[(__NR_Linux+76)] = "__NR_getrlimit" syscall_table[(__NR_Linux+77)] = "__NR_getrusage" syscall_table[(__NR_Linux+78)] = "__NR_gettimeofday" syscall_table[(__NR_Linux+79)] = "__NR_settimeofday" syscall_table[(__NR_Linux+80)] = "__NR_getgroups" syscall_table[(__NR_Linux+81)] = "__NR_setgroups" syscall_table[(__NR_Linux+82)] = "__NR_reserved82" syscall_table[(__NR_Linux+83)] = "__NR_symlink" syscall_table[(__NR_Linux+84)] = "__NR_unused84" syscall_table[(__NR_Linux+85)] = "__NR_readlink" syscall_table[(__NR_Linux+86)] = "__NR_uselib" syscall_table[(__NR_Linux+87)] = "__NR_swapon" syscall_table[(__NR_Linux+88)] = "__NR_reboot" syscall_table[(__NR_Linux+89)] = "__NR_readdir" syscall_table[(__NR_Linux+90)] = "__NR_mmap" syscall_table[(__NR_Linux+91)] = "__NR_munmap" syscall_table[(__NR_Linux+92)] = "__NR_truncate" syscall_table[(__NR_Linux+93)] = "__NR_ftruncate" syscall_table[(__NR_Linux+94)] = "__NR_fchmod" syscall_table[(__NR_Linux+95)] = "__NR_fchown" syscall_table[(__NR_Linux+96)] = "__NR_getpriority" syscall_table[(__NR_Linux+97)] = "__NR_setpriority" syscall_table[(__NR_Linux+98)] = "__NR_profil" syscall_table[(__NR_Linux+99)] = "__NR_statfs" syscall_table[(__NR_Linux+100)] = "__NR_fstatfs" syscall_table[(__NR_Linux+101)] = "__NR_ioperm" syscall_table[(__NR_Linux+102)] = "__NR_socketcall" syscall_table[(__NR_Linux+103)] = "__NR_syslog" syscall_table[(__NR_Linux+104)] = "__NR_setitimer" syscall_table[(__NR_Linux+105)] = "__NR_getitimer" syscall_table[(__NR_Linux+106)] = "__NR_stat" syscall_table[(__NR_Linux+107)] = "__NR_lstat" syscall_table[(__NR_Linux+108)] = "__NR_fstat" syscall_table[(__NR_Linux+109)] = "__NR_unused109" syscall_table[(__NR_Linux+110)] = "__NR_iopl" syscall_table[(__NR_Linux+111)] = "__NR_vhangup" syscall_table[(__NR_Linux+112)] = "__NR_idle" syscall_table[(__NR_Linux+113)] = "__NR_vm86" syscall_table[(__NR_Linux+114)] = "__NR_wait4" syscall_table[(__NR_Linux+115)] = "__NR_swapoff" syscall_table[(__NR_Linux+116)] = "__NR_sysinfo" syscall_table[(__NR_Linux+117)] = "__NR_ipc" syscall_table[(__NR_Linux+118)] = "__NR_fsync" syscall_table[(__NR_Linux+119)] = "__NR_sigreturn" syscall_table[(__NR_Linux+120)] = "__NR_clone" syscall_table[(__NR_Linux+121)] = "__NR_setdomainname" syscall_table[(__NR_Linux+122)] = "__NR_uname" syscall_table[(__NR_Linux+123)] = "__NR_modify_ldt" syscall_table[(__NR_Linux+124)] = "__NR_adjtimex" syscall_table[(__NR_Linux+125)] = "__NR_mprotect" syscall_table[(__NR_Linux+126)] = "__NR_sigprocmask" syscall_table[(__NR_Linux+127)] = "__NR_create_module" syscall_table[(__NR_Linux+128)] = "__NR_init_module" syscall_table[(__NR_Linux+129)] = "__NR_delete_module" syscall_table[(__NR_Linux+130)] = "__NR_get_kernel_syms" syscall_table[(__NR_Linux+131)] = "__NR_quotactl" syscall_table[(__NR_Linux+132)] = "__NR_getpgid" syscall_table[(__NR_Linux+133)] = "__NR_fchdir" syscall_table[(__NR_Linux+134)] = "__NR_bdflush" syscall_table[(__NR_Linux+135)] = "__NR_sysfs" syscall_table[(__NR_Linux+136)] = "__NR_personality" syscall_table[(__NR_Linux+137)] = "__NR_afs_syscall" syscall_table[(__NR_Linux+138)] = "__NR_setfsuid" syscall_table[(__NR_Linux+139)] = "__NR_setfsgid" syscall_table[(__NR_Linux+140)] = "__NR__llseek" syscall_table[(__NR_Linux+141)] = "__NR_getdents" syscall_table[(__NR_Linux+142)] = "__NR__newselect" syscall_table[(__NR_Linux+143)] = "__NR_flock" syscall_table[(__NR_Linux+144)] = "__NR_msync" syscall_table[(__NR_Linux+145)] = "__NR_readv" syscall_table[(__NR_Linux+146)] = "__NR_writev" syscall_table[(__NR_Linux+147)] = "__NR_cacheflush" syscall_table[(__NR_Linux+148)] = "__NR_cachectl" syscall_table[(__NR_Linux+149)] = "__NR_sysmips" syscall_table[(__NR_Linux+150)] = "__NR_unused150" syscall_table[(__NR_Linux+151)] = "__NR_getsid" syscall_table[(__NR_Linux+152)] = "__NR_fdatasync" syscall_table[(__NR_Linux+153)] = "__NR__sysctl" syscall_table[(__NR_Linux+154)] = "__NR_mlock" syscall_table[(__NR_Linux+155)] = "__NR_munlock" syscall_table[(__NR_Linux+156)] = "__NR_mlockall" syscall_table[(__NR_Linux+157)] = "__NR_munlockall" syscall_table[(__NR_Linux+158)] = "__NR_sched_setparam" syscall_table[(__NR_Linux+159)] = "__NR_sched_getparam" syscall_table[(__NR_Linux+160)] = "__NR_sched_setscheduler" syscall_table[(__NR_Linux+161)] = "__NR_sched_getscheduler" syscall_table[(__NR_Linux+162)] = "__NR_sched_yield" syscall_table[(__NR_Linux+163)] = "__NR_sched_get_priority_max" syscall_table[(__NR_Linux+164)] = "__NR_sched_get_priority_min" syscall_table[(__NR_Linux+165)] = "__NR_sched_rr_get_interval" syscall_table[(__NR_Linux+166)] = "__NR_nanosleep" syscall_table[(__NR_Linux+167)] = "__NR_mremap" syscall_table[(__NR_Linux+168)] = "__NR_accept" syscall_table[(__NR_Linux+169)] = "__NR_bind" syscall_table[(__NR_Linux+170)] = "__NR_connect" syscall_table[(__NR_Linux+171)] = "__NR_getpeername" syscall_table[(__NR_Linux+172)] = "__NR_getsockname" syscall_table[(__NR_Linux+173)] = "__NR_getsockopt" syscall_table[(__NR_Linux+174)] = "__NR_listen" syscall_table[(__NR_Linux+175)] = "__NR_recv" syscall_table[(__NR_Linux+176)] = "__NR_recvfrom" syscall_table[(__NR_Linux+177)] = "__NR_recvmsg" syscall_table[(__NR_Linux+178)] = "__NR_send" syscall_table[(__NR_Linux+179)] = "__NR_sendmsg" syscall_table[(__NR_Linux+180)] = "__NR_sendto" syscall_table[(__NR_Linux+181)] = "__NR_setsockopt" syscall_table[(__NR_Linux+182)] = "__NR_shutdown" syscall_table[(__NR_Linux+183)] = "__NR_socket" syscall_table[(__NR_Linux+184)] = "__NR_socketpair" syscall_table[(__NR_Linux+185)] = "__NR_setresuid" syscall_table[(__NR_Linux+186)] = "__NR_getresuid" syscall_table[(__NR_Linux+187)] = "__NR_query_module" syscall_table[(__NR_Linux+188)] = "__NR_poll" syscall_table[(__NR_Linux+189)] = "__NR_nfsservctl" syscall_table[(__NR_Linux+190)] = "__NR_setresgid" syscall_table[(__NR_Linux+191)] = "__NR_getresgid" syscall_table[(__NR_Linux+192)] = "__NR_prctl" syscall_table[(__NR_Linux+193)] = "__NR_rt_sigreturn" syscall_table[(__NR_Linux+194)] = "__NR_rt_sigaction" syscall_table[(__NR_Linux+195)] = "__NR_rt_sigprocmask" syscall_table[(__NR_Linux+196)] = "__NR_rt_sigpending" syscall_table[(__NR_Linux+197)] = "__NR_rt_sigtimedwait" syscall_table[(__NR_Linux+198)] = "__NR_rt_sigqueueinfo" syscall_table[(__NR_Linux+199)] = "__NR_rt_sigsuspend" syscall_table[(__NR_Linux+200)] = "__NR_pread64" syscall_table[(__NR_Linux+201)] = "__NR_pwrite64" syscall_table[(__NR_Linux+202)] = "__NR_chown" syscall_table[(__NR_Linux+203)] = "__NR_getcwd" syscall_table[(__NR_Linux+204)] = "__NR_capget" syscall_table[(__NR_Linux+205)] = "__NR_capset" syscall_table[(__NR_Linux+206)] = "__NR_sigaltstack" syscall_table[(__NR_Linux+207)] = "__NR_sendfile" syscall_table[(__NR_Linux+208)] = "__NR_getpmsg" syscall_table[(__NR_Linux+209)] = "__NR_putpmsg" syscall_table[(__NR_Linux+210)] = "__NR_mmap2" syscall_table[(__NR_Linux+211)] = "__NR_truncate64" syscall_table[(__NR_Linux+212)] = "__NR_ftruncate64" syscall_table[(__NR_Linux+213)] = "__NR_stat64" syscall_table[(__NR_Linux+214)] = "__NR_lstat64" syscall_table[(__NR_Linux+215)] = "__NR_fstat64" syscall_table[(__NR_Linux+216)] = "__NR_pivot_root" syscall_table[(__NR_Linux+217)] = "__NR_mincore" syscall_table[(__NR_Linux+218)] = "__NR_madvise" syscall_table[(__NR_Linux+219)] = "__NR_getdents64" syscall_table[(__NR_Linux+220)] = "__NR_fcntl64" syscall_table[(__NR_Linux+221)] = "__NR_reserved221" syscall_table[(__NR_Linux+222)] = "__NR_gettid" syscall_table[(__NR_Linux+223)] = "__NR_readahead" syscall_table[(__NR_Linux+224)] = "__NR_setxattr" syscall_table[(__NR_Linux+225)] = "__NR_lsetxattr" syscall_table[(__NR_Linux+226)] = "__NR_fsetxattr" syscall_table[(__NR_Linux+227)] = "__NR_getxattr" syscall_table[(__NR_Linux+228)] = "__NR_lgetxattr" syscall_table[(__NR_Linux+229)] = "__NR_fgetxattr" syscall_table[(__NR_Linux+230)] = "__NR_listxattr" syscall_table[(__NR_Linux+231)] = "__NR_llistxattr" syscall_table[(__NR_Linux+232)] = "__NR_flistxattr" syscall_table[(__NR_Linux+233)] = "__NR_removexattr" syscall_table[(__NR_Linux+234)] = "__NR_lremovexattr" syscall_table[(__NR_Linux+235)] = "__NR_fremovexattr" syscall_table[(__NR_Linux+236)] = "__NR_tkill" syscall_table[(__NR_Linux+237)] = "__NR_sendfile64" syscall_table[(__NR_Linux+238)] = "__NR_futex" syscall_table[(__NR_Linux+239)] = "__NR_sched_setaffinity" syscall_table[(__NR_Linux+240)] = "__NR_sched_getaffinity" syscall_table[(__NR_Linux+241)] = "__NR_io_setup" syscall_table[(__NR_Linux+242)] = "__NR_io_destroy" syscall_table[(__NR_Linux+243)] = "__NR_io_getevents" syscall_table[(__NR_Linux+244)] = "__NR_io_submit" syscall_table[(__NR_Linux+245)] = "__NR_io_cancel" syscall_table[(__NR_Linux+246)] = "__NR_exit_group" syscall_table[(__NR_Linux+247)] = "__NR_lookup_dcookie" syscall_table[(__NR_Linux+248)] = "__NR_epoll_create" syscall_table[(__NR_Linux+249)] = "__NR_epoll_ctl" syscall_table[(__NR_Linux+250)] = "__NR_epoll_wait" syscall_table[(__NR_Linux+251)] = "__NR_remap_file_pages" syscall_table[(__NR_Linux+252)] = "__NR_set_tid_address" syscall_table[(__NR_Linux+253)] = "__NR_restart_syscall" syscall_table[(__NR_Linux+254)] = "__NR_fadvise64" syscall_table[(__NR_Linux+255)] = "__NR_statfs64" syscall_table[(__NR_Linux+256)] = "__NR_fstatfs64" syscall_table[(__NR_Linux+257)] = "__NR_timer_create" syscall_table[(__NR_Linux+258)] = "__NR_timer_settime" syscall_table[(__NR_Linux+259)] = "__NR_timer_gettime" syscall_table[(__NR_Linux+260)] = "__NR_timer_getoverrun" syscall_table[(__NR_Linux+261)] = "__NR_timer_delete" syscall_table[(__NR_Linux+262)] = "__NR_clock_settime" syscall_table[(__NR_Linux+263)] = "__NR_clock_gettime" syscall_table[(__NR_Linux+264)] = "__NR_clock_getres" syscall_table[(__NR_Linux+265)] = "__NR_clock_nanosleep" syscall_table[(__NR_Linux+266)] = "__NR_tgkill" syscall_table[(__NR_Linux+267)] = "__NR_utimes" syscall_table[(__NR_Linux+268)] = "__NR_mbind" syscall_table[(__NR_Linux+269)] = "__NR_get_mempolicy" syscall_table[(__NR_Linux+270)] = "__NR_set_mempolicy" syscall_table[(__NR_Linux+271)] = "__NR_mq_open" syscall_table[(__NR_Linux+272)] = "__NR_mq_unlink" syscall_table[(__NR_Linux+273)] = "__NR_mq_timedsend" syscall_table[(__NR_Linux+274)] = "__NR_mq_timedreceive" syscall_table[(__NR_Linux+275)] = "__NR_mq_notify" syscall_table[(__NR_Linux+276)] = "__NR_mq_getsetattr" syscall_table[(__NR_Linux+277)] = "__NR_vserver" syscall_table[(__NR_Linux+278)] = "__NR_waitid" syscall_table[(__NR_Linux+280)] = "__NR_add_key" syscall_table[(__NR_Linux+281)] = "__NR_request_key" syscall_table[(__NR_Linux+282)] = "__NR_keyctl" syscall_table[(__NR_Linux+283)] = "__NR_set_thread_area" syscall_table[(__NR_Linux+284)] = "__NR_inotify_init" syscall_table[(__NR_Linux+285)] = "__NR_inotify_add_watch" syscall_table[(__NR_Linux+286)] = "__NR_inotify_rm_watch" syscall_table[(__NR_Linux+287)] = "__NR_migrate_pages" syscall_table[(__NR_Linux+288)] = "__NR_openat" syscall_table[(__NR_Linux+289)] = "__NR_mkdirat" syscall_table[(__NR_Linux+290)] = "__NR_mknodat" syscall_table[(__NR_Linux+291)] = "__NR_fchownat" syscall_table[(__NR_Linux+292)] = "__NR_futimesat" syscall_table[(__NR_Linux+293)] = "__NR_fstatat64" syscall_table[(__NR_Linux+294)] = "__NR_unlinkat" syscall_table[(__NR_Linux+295)] = "__NR_renameat" syscall_table[(__NR_Linux+296)] = "__NR_linkat" syscall_table[(__NR_Linux+297)] = "__NR_symlinkat" syscall_table[(__NR_Linux+298)] = "__NR_readlinkat" syscall_table[(__NR_Linux+299)] = "__NR_fchmodat" syscall_table[(__NR_Linux+300)] = "__NR_faccessat" syscall_table[(__NR_Linux+301)] = "__NR_pselect6" syscall_table[(__NR_Linux+302)] = "__NR_ppoll" syscall_table[(__NR_Linux+303)] = "__NR_unshare" syscall_table[(__NR_Linux+304)] = "__NR_splice" syscall_table[(__NR_Linux+305)] = "__NR_sync_file_range" syscall_table[(__NR_Linux+306)] = "__NR_tee" syscall_table[(__NR_Linux+307)] = "__NR_vmsplice" syscall_table[(__NR_Linux+308)] = "__NR_move_pages" syscall_table[(__NR_Linux+309)] = "__NR_set_robust_list" syscall_table[(__NR_Linux+310)] = "__NR_get_robust_list" syscall_table[(__NR_Linux+311)] = "__NR_kexec_load" syscall_table[(__NR_Linux+312)] = "__NR_getcpu" syscall_table[(__NR_Linux+313)] = "__NR_epoll_pwait" syscall_table[(__NR_Linux+314)] = "__NR_ioprio_set" syscall_table[(__NR_Linux+315)] = "__NR_ioprio_get" syscall_table[(__NR_Linux+316)] = "__NR_utimensat" syscall_table[(__NR_Linux+317)] = "__NR_signalfd" syscall_table[(__NR_Linux+318)] = "__NR_timerfd" syscall_table[(__NR_Linux+319)] = "__NR_eventfd" syscall_table[(__NR_Linux+320)] = "__NR_fallocate" syscall_table[(__NR_Linux+321)] = "__NR_timerfd_create" syscall_table[(__NR_Linux+322)] = "__NR_timerfd_gettime" syscall_table[(__NR_Linux+323)] = "__NR_timerfd_settime" syscall_table[(__NR_Linux+324)] = "__NR_signalfd4" syscall_table[(__NR_Linux+325)] = "__NR_eventfd2" syscall_table[(__NR_Linux+326)] = "__NR_epoll_create1" syscall_table[(__NR_Linux+327)] = "__NR_dup3" syscall_table[(__NR_Linux+328)] = "__NR_pipe2" syscall_table[(__NR_Linux+329)] = "__NR_inotify_init1" syscall_table[(__NR_Linux+330)] = "__NR_preadv" syscall_table[(__NR_Linux+331)] = "__NR_pwritev" syscall_table[(__NR_Linux+332)] = "__NR_rt_tgsigqueueinfo" syscall_table[(__NR_Linux+333)] = "__NR_perf_event_open" syscall_table[(__NR_Linux+334)] = "__NR_accept4" syscall_table[(__NR_Linux+335)] = "__NR_recvmmsg" syscall_table[(__NR_Linux+336)] = "__NR_fanotify_init" syscall_table[(__NR_Linux+337)] = "__NR_fanotify_mark" syscall_table[(__NR_Linux+338)] = "__NR_prlimit64" syscall_table[(__NR_Linux+339)] = "__NR_name_to_handle_at" syscall_table[(__NR_Linux+340)] = "__NR_open_by_handle_at" syscall_table[(__NR_Linux+341)] = "__NR_clock_adjtime" syscall_table[(__NR_Linux+342)] = "__NR_syncfs" syscall_table[(__NR_Linux+343)] = "__NR_sendmmsg" syscall_table[(__NR_Linux+344)] = "__NR_setns" syscall_table[(__NR_Linux+345)] = "__NR_process_vm_readv" syscall_table[(__NR_Linux+346)] = "__NR_process_vm_writev" syscall_table[(__NR_Linux+347)] = "__NR_kcmp" syscall_table[(__NR_Linux+348)] = "__NR_finit_module" syscall_table[(__NR_Linux+349)] = "__NR_sched_setattr" syscall_table[(__NR_Linux+350)] = "__NR_sched_getattr" syscall_table[(__NR_Linux+351)] = "__NR_renameat2" syscall_table[(__NR_Linux+352)] = "__NR_seccomp" syscall_table[(__NR_Linux+353)] = "__NR_getrandom" syscall_table[(__NR_Linux+354)] = "__NR_memfd_create" syscall_table[(__NR_Linux+355)] = "__NR_bpf" def debug(text): if DEBUG: print text ea = ScreenEA() seg_ea = SegStart(ea) for addr in Heads(seg_ea, SegEnd(seg_ea)): if isCode(GetFlags(addr)): mne = GetMnem(addr) if mne == "syscall": prev_head = PrevHead(addr, seg_ea) if GetOpnd(prev_head, 0) == "$v0": # second operand is our syscall number syscall_id = GetOperandValue(prev_head, 1) if syscall_id == -1: raise Exception("Invalid operand value") syscall = syscall_table[syscall_id] debug("syscall: {}/{} at {}".format(syscall_id, syscall, hex(addr))) # identify syscall in comments MakeRptCmt(addr, syscall) else: print("previous instruction is not about $v0, " \ "investigate: {}").format(hex(addr))
47.582192
89
0.767046
3,008
20,841
4.445479
0.307513
0.320371
0.371672
0.504412
0.118307
0.018546
0.010171
0.010171
0.010171
0.010171
0
0.05506
0.084977
20,841
437
90
47.691076
0.646146
0.095917
0
0
0
0
0.261228
0.01937
0
0
0
0
0
0
null
null
0
0
null
null
0.005277
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
55cfd558772756bca9854a49d7750d4639610350
133
py
Python
2dlist.py
litesh1998/Python3-programs
ab2dd9900bdf686f650024e2c224b568a70477b6
[ "MIT" ]
null
null
null
2dlist.py
litesh1998/Python3-programs
ab2dd9900bdf686f650024e2c224b568a70477b6
[ "MIT" ]
null
null
null
2dlist.py
litesh1998/Python3-programs
ab2dd9900bdf686f650024e2c224b568a70477b6
[ "MIT" ]
null
null
null
lf=[] for i in range(2): l=[int(i) for i in input().strip().split()] lf.append(l) print(lf) for i in lf: print(i)
16.625
48
0.526316
26
133
2.692308
0.5
0.171429
0.257143
0.228571
0
0
0
0
0
0
0
0.010309
0.270677
133
7
49
19
0.71134
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.285714
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
55f136bc3b81b04c130766f018259a9f1324c326
84
py
Python
src/waldur_openstack/openstack_tenant/__init__.py
geant-multicloud/MCMS-mastermind
81333180f5e56a0bc88d7dad448505448e01f24e
[ "MIT" ]
26
2017-10-18T13:49:58.000Z
2021-09-19T04:44:09.000Z
src/waldur_openstack/openstack_tenant/__init__.py
geant-multicloud/MCMS-mastermind
81333180f5e56a0bc88d7dad448505448e01f24e
[ "MIT" ]
14
2018-12-10T14:14:51.000Z
2021-06-07T10:33:39.000Z
src/waldur_openstack/openstack_tenant/__init__.py
geant-multicloud/MCMS-mastermind
81333180f5e56a0bc88d7dad448505448e01f24e
[ "MIT" ]
32
2017-09-24T03:10:45.000Z
2021-10-16T16:41:09.000Z
default_app_config = 'waldur_openstack.openstack_tenant.apps.OpenStackTenantConfig'
42
83
0.892857
9
84
7.888889
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.035714
84
1
84
84
0.876543
0
0
0
0
0
0.714286
0.714286
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
55f610986bda865aaa74036a78dfc7ac9f37ed93
255
py
Python
python_basic_part_1/8.py
EmilianStoyanov/python_exercises_practice_solution
ed0c4a638d0e3510d61344d1ff6d8a47891253b6
[ "MIT" ]
null
null
null
python_basic_part_1/8.py
EmilianStoyanov/python_exercises_practice_solution
ed0c4a638d0e3510d61344d1ff6d8a47891253b6
[ "MIT" ]
null
null
null
python_basic_part_1/8.py
EmilianStoyanov/python_exercises_practice_solution
ed0c4a638d0e3510d61344d1ff6d8a47891253b6
[ "MIT" ]
null
null
null
color_list = ["Red", "Green", "White", "Black"] print("%s %s" % (color_list[0], color_list[-1])) """ Write a Python program to display the first and last colors from the following list. Go to the editor color_list = ["Red","Green","White" ,"Black"] """
28.333333
69
0.654902
40
255
4.075
0.625
0.220859
0.147239
0.208589
0.331288
0.331288
0
0
0
0
0
0.009217
0.14902
255
8
70
31.875
0.741935
0
0
0
0
0
0.232323
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
360222d382a7db34e93416f7fd0de5c4f39b0697
5,550
py
Python
lorikeet/migrations/0001_initial.py
excitedleigh/lorikeet
fe99cf4557736891f2a0e951f0f748074d5e02d4
[ "MIT" ]
6
2020-02-15T19:22:30.000Z
2020-12-27T10:58:58.000Z
lorikeet/migrations/0001_initial.py
excitedleigh/lorikeet
fe99cf4557736891f2a0e951f0f748074d5e02d4
[ "MIT" ]
79
2019-12-29T22:13:51.000Z
2022-03-30T23:12:37.000Z
lorikeet/migrations/0001_initial.py
excitedleigh/lorikeet
fe99cf4557736891f2a0e951f0f748074d5e02d4
[ "MIT" ]
2
2019-12-29T22:06:19.000Z
2020-08-27T20:30:47.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-12-13 01:24 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="Cart", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "user", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], ), migrations.CreateModel( name="DeliveryAddress", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "user", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], ), migrations.CreateModel( name="LineItem", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "cart", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="items", to="lorikeet.Cart", ), ), ], ), migrations.CreateModel( name="Order", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("custom_invoice_id", models.CharField(max_length=255)), ("guest_email", models.EmailField(blank=True, max_length=254)), ( "delivery_address", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="lorikeet.DeliveryAddress", ), ), ], ), migrations.CreateModel( name="Payment", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ], ), migrations.CreateModel( name="PaymentMethod", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "user", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], ), migrations.AddField( model_name="payment", name="method", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="lorikeet.PaymentMethod" ), ), migrations.AddField( model_name="order", name="payment", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="lorikeet.Payment" ), ), migrations.AddField( model_name="order", name="user", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="lineitem", name="order", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="items", to="lorikeet.Order", ), ), ]
30.662983
88
0.375856
358
5,550
5.673184
0.217877
0.043328
0.068932
0.108321
0.687346
0.687346
0.651896
0.651896
0.651896
0.651896
0
0.008567
0.537297
5,550
180
89
30.833333
0.782321
0.012072
0
0.75
1
0
0.05146
0.008394
0
0
0
0
0
1
0
false
0
0.023256
0
0.046512
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
3616f709b22d4e0ad00f5394ba17efd2c32c5375
366
py
Python
ProjectSystem/admin_resign/form.py
matthew9602/Project-Management-System
ba74de0bfd4785a46fbe8b332d8bff1e4eb980a9
[ "MIT" ]
1
2021-04-01T17:30:58.000Z
2021-04-01T17:30:58.000Z
ProjectSystem/admin_resign/form.py
MatthewTsan/Project-Management-System
ba74de0bfd4785a46fbe8b332d8bff1e4eb980a9
[ "MIT" ]
null
null
null
ProjectSystem/admin_resign/form.py
MatthewTsan/Project-Management-System
ba74de0bfd4785a46fbe8b332d8bff1e4eb980a9
[ "MIT" ]
null
null
null
from django import forms class resign_form(forms.Form): username = forms.CharField(max_length=30) sex = forms.CharField(max_length=30) birthday = forms.CharField(max_length=30) phone = forms.CharField(max_length=30) mobile = forms.CharField(max_length=30) cardname = forms.CharField(max_length=30) level = forms.CharField(max_length=30)
33.272727
45
0.740437
51
366
5.156863
0.352941
0.372624
0.452471
0.612167
0.665399
0
0
0
0
0
0
0.045161
0.153005
366
10
46
36.6
0.803226
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.111111
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
36351c5a32e68eb0164ebde680d6471c6f55238d
177
py
Python
proc_scrapy.py
kyle-yu/scrape_on_lianjia
c811eb2ff27374fdfc9ba1823c5253eb1cba4223
[ "MIT" ]
null
null
null
proc_scrapy.py
kyle-yu/scrape_on_lianjia
c811eb2ff27374fdfc9ba1823c5253eb1cba4223
[ "MIT" ]
null
null
null
proc_scrapy.py
kyle-yu/scrape_on_lianjia
c811eb2ff27374fdfc9ba1823c5253eb1cba4223
[ "MIT" ]
null
null
null
import os import sys import subprocess file_object = open('list.txt') for line in file_object: print line p=subprocess.Popen('scrapy crawl -a dt=20150327 dmoz',shell=True)
19.666667
65
0.762712
29
177
4.586207
0.793103
0.150376
0
0
0
0
0
0
0
0
0
0.052632
0.141243
177
8
66
22.125
0.822368
0
0
0
0
0
0.225989
0
0
0
0
0
0
0
null
null
0
0.428571
null
null
0.142857
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
3675f653a73588e2b1e69f224113af5e4bb320ef
92
py
Python
sqds_seed/apps.py
abey79/sqds
acab1d9c6d4a010fff9d8e89a5fdd9d94def7c89
[ "MIT" ]
null
null
null
sqds_seed/apps.py
abey79/sqds
acab1d9c6d4a010fff9d8e89a5fdd9d94def7c89
[ "MIT" ]
null
null
null
sqds_seed/apps.py
abey79/sqds
acab1d9c6d4a010fff9d8e89a5fdd9d94def7c89
[ "MIT" ]
null
null
null
from django.apps import AppConfig class SqdsSeedConfig(AppConfig): name = 'sqds_seed'
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
36863c23f4ae7c5a5de8f903204ae4fca2e480d7
2,380
py
Python
DailyProgrammer/DP20130416W.py
DayGitH/Python-Challenges
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
[ "MIT" ]
2
2020-12-23T18:59:22.000Z
2021-04-14T13:16:09.000Z
DailyProgrammer/DP20130416W.py
DayGitH/Python-Challenges
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
[ "MIT" ]
null
null
null
DailyProgrammer/DP20130416W.py
DayGitH/Python-Challenges
bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf
[ "MIT" ]
null
null
null
""" [04/16/13] Week-Long Challenge #1: Make a (tiny) video game! https://www.reddit.com/r/dailyprogrammer/comments/1ch463/041613_weeklong_challenge_1_make_a_tiny_video_game/ # [](#EasyIcon) *(Easy)*: Make a tiny video game! **Please note this is an official week-long challenge; all submissions are due by Monday night, midnight, GMT - 7:00 (American pacific time). Winners announced the following Tuesday evening.** The TI-83+ graphing calculator series is the "ultimate" gaming platform: it has a 96 by 64 glorious pixel screen, four brilliant colors (white, light-grey, dark-grey, and black) per pixel, full keyboard input, and it all fits in the palm of your hand! Best of all, it is a *programmable* calculator, allowing you to make awesome games while sitting in class not listening to your teacher or professor... All jokes aside, this calculator-platform is great for the fact that it's a very simple platform to program and has had a [ton of games](http://www.ticalc.org/pub/83plus/basic/games/) developed for it already. Many young programmers today attribute their passion for programming to how fun the TI-83+ was to develop on! **Your goal is to write a game on whatever hardware and software platform you like, but you must stick with the "look & feel" of the TI-83+**: you can make any game you want using any tools you have, but you may _only_ output to a 96 x 64 pixel screen and _only_ use four grayscale colors. This screen may scale for easier viewing, but the pixel-count should never change. If you do not want to make an interactive game, you are welcomed to make a [demo](http://en.wikipedia.org/wiki/Demo_(computer_programming\)). **We will award the most unique game, most impressive game, and best demo with +1 gold ribbons to your flair. Winners get Reddit Gold.** Since this challenge is very open-ended and may not be clear, I've written a [demo for users to play](http://htmlpreview.github.io/?https://github.com/nint22/JSPhoenix/blob/master/index.htm) and [develop off of](https://github.com/nint22/JSPhoenix). You are welcomed to use this code as a starting point, or just simply start fresh. If you actually end up writing something functional on an actual calculator, try to post a video or pictures! We will roll out silver medals for you if it's a functioning game or demo. """ def main(): pass if __name__ == "__main__": main()
62.631579
119
0.765966
414
2,380
4.350242
0.55314
0.011105
0.014992
0.02332
0.073293
0.031094
0.031094
0
0
0
0
0.020875
0.154622
2,380
37
120
64.324324
0.874254
0.969748
0
0
0
0
0.125
0
0
0
0
0
0
1
0.25
true
0.25
0
0
0.25
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
1
1
0
0
0
0
0
4
3689488664cc0c3933a6d5b6b7e7ea42f374d6b2
28
py
Python
porespy/__version__.py
xu-kai-xu/porespy
9df231bfd4010e3a13efc66585474e148cd08d6c
[ "MIT" ]
null
null
null
porespy/__version__.py
xu-kai-xu/porespy
9df231bfd4010e3a13efc66585474e148cd08d6c
[ "MIT" ]
null
null
null
porespy/__version__.py
xu-kai-xu/porespy
9df231bfd4010e3a13efc66585474e148cd08d6c
[ "MIT" ]
null
null
null
__version__ = '2.0.2.dev16'
14
27
0.678571
5
28
3
0.8
0
0
0
0
0
0
0
0
0
0
0.2
0.107143
28
1
28
28
0.4
0
0
0
0
0
0.392857
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
36a4b223a307cd9878e2ca0dd153a9619d8580e1
1,907
py
Python
06_Transformacoes_do_Conjunto_de_Dados/6.4_Imputacao_de_Valores_Ausentes/6.4.5_Atribuicao_de_Vizinhos_mais_Proximos.py
BrunoBertti/Scikit_Learning
4b9e10ff7909f3728ac1e8bba19f5fd779340bc4
[ "MIT" ]
null
null
null
06_Transformacoes_do_Conjunto_de_Dados/6.4_Imputacao_de_Valores_Ausentes/6.4.5_Atribuicao_de_Vizinhos_mais_Proximos.py
BrunoBertti/Scikit_Learning
4b9e10ff7909f3728ac1e8bba19f5fd779340bc4
[ "MIT" ]
null
null
null
06_Transformacoes_do_Conjunto_de_Dados/6.4_Imputacao_de_Valores_Ausentes/6.4.5_Atribuicao_de_Vizinhos_mais_Proximos.py
BrunoBertti/Scikit_Learning
4b9e10ff7909f3728ac1e8bba19f5fd779340bc4
[ "MIT" ]
null
null
null
########## 6.4.5. Atribuição de vizinhos mais próximos ########## # A classe KNNImputer fornece imputação para preencher valores ausentes usando a abordagem k-Nearest Neighbors. Por padrão, uma métrica de distância euclidiana que suporta valores ausentes, nan_euclidean_distances, é usada para localizar os vizinhos mais próximos. Cada recurso ausente é imputado usando valores de n_vizinhos vizinhos mais próximos que possuem um valor para o recurso. As características dos vizinhos são calculadas em média uniformemente ou ponderadas pela distância de cada vizinho. Se uma amostra tiver mais de um recurso ausente, os vizinhos dessa amostra podem ser diferentes dependendo do recurso específico que está sendo imputado. Quando o número de vizinhos disponíveis é menor que n_vizinhos e não há distâncias definidas para o conjunto de treinamento, a média do conjunto de treinamento para esse recurso é usada durante a imputação. Se houver pelo menos um vizinho com uma distância definida, a média ponderada ou não ponderada dos vizinhos restantes será utilizada durante a imputação. Se um recurso estiver sempre ausente no treinamento, ele será removido durante a transformação. Para mais informações sobre a metodologia, ver ref. [OL2001]. # O snippet a seguir demonstra como substituir valores ausentes, codificados como np.nan, usando o valor de recurso médio dos dois vizinhos mais próximos de amostras com valores ausentes: import numpy as np from sklearn.impute import KNNImputer nan = np.nan X = [[1, 2, nan], [3, 4, 3], [nan, 6, 5], [8, 8, 7]] imputer = KNNImputer(n_neighbors=2, weights="uniform") imputer.fit_transform(X) ## Referêcias: ## Olga Troyanskaya, Michael Cantor, Gavin Sherlock, Pat Brown, Trevor Hastie, Robert Tibshirani, David Botstein and Russ B. Altman, Missing value estimation methods for DNA microarrays, BIOINFORMATICS Vol. 17 no. 6, 2001 Pages 520-
86.681818
1,178
0.785527
286
1,907
5.216783
0.566434
0.032172
0.053619
0.025469
0
0
0
0
0
0
0
0.017478
0.159937
1,907
22
1,179
86.681818
0.913858
0.863136
0
0
0
0
0.029787
0
0
0
0
0.045455
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
4
7fc6c4463695b7c526608877f4d2440e4c081573
1,220
gyp
Python
binding.gyp
SalvatorePreviti/roaring-node
6ab16a27d76c0eef9a016c52d72bcb59812a5b50
[ "Apache-2.0" ]
58
2018-06-09T05:46:06.000Z
2022-01-10T11:41:45.000Z
binding.gyp
SalvatorePreviti/roaring-node
6ab16a27d76c0eef9a016c52d72bcb59812a5b50
[ "Apache-2.0" ]
24
2018-06-14T00:28:38.000Z
2022-01-07T22:37:39.000Z
binding.gyp
SalvatorePreviti/roaring-node
6ab16a27d76c0eef9a016c52d72bcb59812a5b50
[ "Apache-2.0" ]
5
2020-04-24T20:06:00.000Z
2022-01-31T07:31:52.000Z
{ "targets": [ { "target_name": "roaring", "default_configuration": "Release", "cflags_cc": ["-O3", "-std=c++14"], "sources": [ "src/cpp/v8utils/v8utils.cpp", "src/cpp/RoaringBitmap32.cpp" ], "conditions": [ [ "OS=='win'", { "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "AdditionalOptions": ["/std:c++latest", "/Zc:__cplusplus"] } } }, "Debug": { "msvs_settings": { "VCCLCompilerTool": { "AdditionalOptions": ["/std:c++latest", "/Zc:__cplusplus"] } } } } } ] ] } ] }
33.888889
98
0.248361
47
1,220
6.255319
0.638298
0.040816
0.190476
0.306122
0.44898
0.44898
0.44898
0.44898
0.44898
0
0
0.015837
0.637705
1,220
35
99
34.857143
0.649321
0
0
0.171429
0
0
0.271311
0.061475
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
1
0
0
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
3d0714d90d06760f393370c26f985db039d8cfa8
1,074
py
Python
aoc2019/python/day04.py
austinsalonen/advent_of_code
c085a813511ace023620739f367948c58e7ca5e7
[ "MIT" ]
null
null
null
aoc2019/python/day04.py
austinsalonen/advent_of_code
c085a813511ace023620739f367948c58e7ca5e7
[ "MIT" ]
null
null
null
aoc2019/python/day04.py
austinsalonen/advent_of_code
c085a813511ace023620739f367948c58e7ca5e7
[ "MIT" ]
null
null
null
from functools import reduce def run_length_encode(num): def rle(acc, c): if acc and acc[-1][0] == c: c,n = acc[-1] acc[-1] = (c, n+1) else: acc.append((c,1)) return acc return reduce(rle, str(num), []) assert [('1', 6)] == run_length_encode(111111) def never_decrease(x): return all(a[0] <= b[0] for a,b in zip(x, x[1:])) def is_valid(encoded): def has_pair(ns): return any(n >= 2 for c,n in ns) return has_pair(encoded) and never_decrease(encoded) def not_including_triples(encoded): def has_pair(ns): return any(n == 2 for c,n in ns) return has_pair(encoded) and never_decrease(encoded) assert is_valid(run_length_encode(111111)) assert not is_valid(run_length_encode(223450)) assert not is_valid(run_length_encode(123789)) assert not not_including_triples(run_length_encode(111111)) assert not_including_triples(run_length_encode(111122)) print('part 1 =', sum(1 for n in range(353096, 843212) if is_valid(run_length_encode(n)))) print('part 2 =', sum(1 for n in range(353096, 843212) if not_including_triples(run_length_encode(n))))
27.538462
103
0.719739
194
1,074
3.78866
0.273196
0.110204
0.183673
0.087075
0.609524
0.570068
0.386395
0.302041
0.302041
0.223129
0
0.083243
0.138734
1,074
39
103
27.538462
0.711351
0
0
0.142857
0
0
0.015814
0
0
0
0
0
0.214286
1
0.25
false
0
0.035714
0.107143
0.535714
0.071429
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
3d0f5da8f484cd974ba36992cf63e79671b8bf2d
118
py
Python
app/services/iex/rest_api_to_db/__init__.py
Tinitto/crypto-exchange
cb61664ff0119d8120315b8c6feb77aeba0ec050
[ "MIT" ]
null
null
null
app/services/iex/rest_api_to_db/__init__.py
Tinitto/crypto-exchange
cb61664ff0119d8120315b8c6feb77aeba0ec050
[ "MIT" ]
null
null
null
app/services/iex/rest_api_to_db/__init__.py
Tinitto/crypto-exchange
cb61664ff0119d8120315b8c6feb77aeba0ec050
[ "MIT" ]
null
null
null
"""Module containing all the controllers for the rest_api_to_db IEX service""" IEX_REST_API_TO_DB_CONTROLLERS = [ ]
19.666667
78
0.788136
19
118
4.473684
0.631579
0.164706
0.211765
0.258824
0
0
0
0
0
0
0
0
0.135593
118
5
79
23.6
0.833333
0.610169
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
3d118bac865f69734c091263f8416200b6d8b2f5
115
py
Python
guppe/atividades/secao_4/ex009.py
WesleyLucas97/cursos_python
b2cbd393e8fed6e36b84253f7934766f2b4f1de8
[ "MIT" ]
null
null
null
guppe/atividades/secao_4/ex009.py
WesleyLucas97/cursos_python
b2cbd393e8fed6e36b84253f7934766f2b4f1de8
[ "MIT" ]
null
null
null
guppe/atividades/secao_4/ex009.py
WesleyLucas97/cursos_python
b2cbd393e8fed6e36b84253f7934766f2b4f1de8
[ "MIT" ]
null
null
null
c = float(input('Informe a temperatura em Celsius: ')) k = c + 273.15 print(f'A temperatura em Kelvin é de {k}°')
23
54
0.66087
22
115
3.5
0.772727
0.311688
0.363636
0
0
0
0
0
0
0
0
0.053191
0.182609
115
5
55
23
0.755319
0
0
0
0
0
0.577586
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
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
3d211e570e3b09bff347c2495216c04333e4385c
285
py
Python
terrascript/resource/alxrem/hdns.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
terrascript/resource/alxrem/hdns.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
terrascript/resource/alxrem/hdns.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# terrascript/resource/alxrem/hdns.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:18:18 UTC) import terrascript class hdns_record(terrascript.Resource): pass class hdns_zone(terrascript.Resource): pass __all__ = [ "hdns_record", "hdns_zone", ]
15.833333
73
0.729825
37
285
5.405405
0.594595
0.285
0.23
0
0
0
0
0
0
0
0
0.050209
0.161404
285
17
74
16.764706
0.786611
0.375439
0
0.222222
1
0
0.114286
0
0
0
0
0
0
1
0
false
0.222222
0.111111
0
0.333333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
3d5486ea8e773196ccfb791035021df33f8e0d17
122
py
Python
scphylo/external/gpps/__init__.py
faridrashidi/scphylo-tools
4574e2c015da58e59caa38e3b3e49b398c1379c1
[ "BSD-3-Clause" ]
null
null
null
scphylo/external/gpps/__init__.py
faridrashidi/scphylo-tools
4574e2c015da58e59caa38e3b3e49b398c1379c1
[ "BSD-3-Clause" ]
null
null
null
scphylo/external/gpps/__init__.py
faridrashidi/scphylo-tools
4574e2c015da58e59caa38e3b3e49b398c1379c1
[ "BSD-3-Clause" ]
null
null
null
"""External gpps Module.""" from ._gpps_hc import gpps_hc from ._gpps_ilp import gpps_ilp __all__ = (gpps_hc, gpps_ilp)
17.428571
31
0.754098
20
122
4
0.4
0.225
0
0
0
0
0
0
0
0
0
0
0.139344
122
6
32
20.333333
0.761905
0.172131
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
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
e9eeb93c02beb2c401d0d4fd5981249340cb916d
103
py
Python
regtests/list/simple.py
bpmbank/PythonJS
591a80afd8233fb715493591db2b68f1748558d9
[ "BSD-3-Clause" ]
319
2015-01-02T11:34:16.000Z
2022-03-25T00:43:33.000Z
regtests/list/simple.py
AlexRacoon/PythonJS
0bde55dccf3dd5dfe70f31822bcf6257abd33d2a
[ "BSD-3-Clause" ]
10
2015-02-03T02:33:09.000Z
2021-11-09T21:41:00.000Z
regtests/list/simple.py
AlexRacoon/PythonJS
0bde55dccf3dd5dfe70f31822bcf6257abd33d2a
[ "BSD-3-Clause" ]
61
2015-01-02T12:01:56.000Z
2021-12-08T07:16:16.000Z
"""basics""" def main(): a = [1,2,3,4] TestError( len(a)==4 ) #b = list() #TestError( len(b)==0 )
12.875
24
0.495146
18
103
2.833333
0.722222
0.470588
0
0
0
0
0
0
0
0
0
0.072289
0.194175
103
7
25
14.714286
0.542169
0.378641
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
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
1
0
0
0
0
0
0
0
4
a159873c7885437fa9fea9a328c23ca33bfa6935
1,688
py
Python
credentials.py
Ruweydha/Password-Locker
e514945078719e2bee0b720364ae3a569fe1c5ea
[ "MIT" ]
null
null
null
credentials.py
Ruweydha/Password-Locker
e514945078719e2bee0b720364ae3a569fe1c5ea
[ "MIT" ]
null
null
null
credentials.py
Ruweydha/Password-Locker
e514945078719e2bee0b720364ae3a569fe1c5ea
[ "MIT" ]
null
null
null
from keyring import delete_password class Credentials: ''' Class that generates instances of credentials ''' passwords = [] def __init__(self, account, password): ''' __init__ method that helps us define properties for our objects Args: account = New credentials account password = New credentials password ''' self.account = account self.password = password def save_password(self): ''' save_password method that saves credential objects into passwords ''' Credentials.passwords.append(self) def delete_password(self): ''' delete_password method to delete a saved password from the passwords list ''' Credentials.passwords.remove(self) @classmethod def find_by_account(cls, accountName) : ''' Method that takes in account and returns the password that matches the account Args: account: Account to search for Returns: Password of the mentioned account ''' for password in cls.passwords: if password.account == accountName: return password @classmethod def password_exist(cls, accountName) : ''' Method that checks if a password exists from the password list ''' for password in cls.passwords: if password.account == accountName: return True return False @classmethod def display_passwords(cls): ''' Method that displays the passwords list ''' return cls.passwords
28.133333
86
0.591825
168
1,688
5.845238
0.345238
0.050917
0.032587
0.04888
0.120163
0.120163
0.120163
0.120163
0.120163
0.120163
0
0
0.347749
1,688
60
87
28.133333
0.891916
0.353673
0
0.291667
1
0
0
0
0
0
0
0
0
1
0.25
false
0.666667
0.041667
0
0.541667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
a1743cb4543619ffeadbd792f54cf02778642608
574
py
Python
commands/command_config.py
iTechnious/QueueBot
9348eba96f7d2563d212469c04c5adb4f58d6fb0
[ "MIT" ]
1
2020-01-01T19:21:23.000Z
2020-01-01T19:21:23.000Z
commands/command_config.py
AuxiliumCDNG/QueueBot
9348eba96f7d2563d212469c04c5adb4f58d6fb0
[ "MIT" ]
2
2020-01-12T19:17:27.000Z
2020-01-25T21:18:02.000Z
commands/command_config.py
iTechnious/QueueBot
9348eba96f7d2563d212469c04c5adb4f58d6fb0
[ "MIT" ]
1
2020-01-04T23:13:14.000Z
2020-01-04T23:13:14.000Z
import discord from funcs import change_prefix, change_queue, change_role, change_text, change_video async def execute(client, message, args): if args[0] == "prefix": await change_prefix.execute(client, message, args) elif args[0] == "queue": await change_queue.execute(client, message, args) elif args[0] == "role": await change_role.execute(client, message, args) elif args[0] == "video": await change_video.execute(client, message, args) elif args[0] == "text": await change_text.execute(client, message, args)
41
85
0.679443
76
574
5
0.263158
0.205263
0.315789
0.378947
0.347368
0.347368
0.347368
0
0
0
0
0.010893
0.200348
574
14
86
41
0.816993
0
0
0
0
0
0.041739
0
0
0
0
0
0
1
0
true
0
0.153846
0
0.153846
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
1
0
0
0
0
0
0
4
a1d23f857b3e0d965776fc9a092a3b01479cc36a
139
py
Python
reddit2telegram/channels/r_polhumor/app.py
mainyordle/reddit2telegram
1163e15aed3b6ff0fba65b222d3d9798f644c386
[ "MIT" ]
187
2016-09-20T09:15:54.000Z
2022-03-29T12:22:33.000Z
reddit2telegram/channels/r_polhumor/app.py
mainyordle/reddit2telegram
1163e15aed3b6ff0fba65b222d3d9798f644c386
[ "MIT" ]
84
2016-09-22T14:25:07.000Z
2022-03-19T01:26:17.000Z
reddit2telegram/channels/r_polhumor/app.py
mainyordle/reddit2telegram
1163e15aed3b6ff0fba65b222d3d9798f644c386
[ "MIT" ]
172
2016-09-21T15:39:39.000Z
2022-03-16T15:15:58.000Z
#encoding:utf-8 subreddit = 'PolHumor' t_channel = '@r_PolHumor' def send_post(submission, r2t): return r2t.send_simple(submission)
15.444444
38
0.741007
19
139
5.210526
0.789474
0
0
0
0
0
0
0
0
0
0
0.025
0.136691
139
8
39
17.375
0.8
0.100719
0
0
0
0
0.153226
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
a1d2ed2286aaf0397c93a3316fddcf1b9e6e8329
113
py
Python
metadata.py
GuillaumeRochette/Human36MProcessing
6decb8cbfaaae674fdc59cabf084146b3e8ee892
[ "Apache-2.0" ]
null
null
null
metadata.py
GuillaumeRochette/Human36MProcessing
6decb8cbfaaae674fdc59cabf084146b3e8ee892
[ "Apache-2.0" ]
null
null
null
metadata.py
GuillaumeRochette/Human36MProcessing
6decb8cbfaaae674fdc59cabf084146b3e8ee892
[ "Apache-2.0" ]
null
null
null
SUBJECTS = ["S1", "S5", "S6", "S7", "S8", "S9", "S11"] VIEWS = ["54138969", "55011271", "58860488", "60457274"]
28.25
56
0.530973
13
113
4.615385
1
0
0
0
0
0
0
0
0
0
0
0.412371
0.141593
113
3
57
37.666667
0.206186
0
0
0
0
0
0.415929
0
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a1e169b6d92e4a9370b1ba1a559061a06271c8a1
118
py
Python
external/renderWinFix.py
aaronfang/small-Scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
1
2018-03-08T16:34:00.000Z
2018-03-08T16:34:00.000Z
external/renderWinFix.py
aaronfang/personal_scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
null
null
null
external/renderWinFix.py
aaronfang/personal_scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
null
null
null
from pymel.core import * import maya.mel as mel deleteUI('unifiedRenderGlobalsWindow') mel.eval('buildNewSceneUI;')
19.666667
38
0.788136
14
118
6.642857
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.101695
118
5
39
23.6
0.877358
0
0
0
0
0
0.355932
0.220339
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
b807278e60b50c5e79811efda7e30019317f2133
48
py
Python
cfdata/tabular/processors/one_hot/__init__.py
carefree0910/carefree-data
ae0f4ea5724b4efd5d76f2a9d420acf3322c1d19
[ "MIT" ]
9
2020-10-25T11:52:34.000Z
2022-01-23T02:45:41.000Z
cfdata/tabular/processors/one_hot/__init__.py
carefree0910/carefree-data
ae0f4ea5724b4efd5d76f2a9d420acf3322c1d19
[ "MIT" ]
2
2020-08-02T01:58:48.000Z
2021-02-26T11:24:19.000Z
cfdata/tabular/processors/one_hot/__init__.py
carefree0910/carefree-data
ae0f4ea5724b4efd5d76f2a9d420acf3322c1d19
[ "MIT" ]
1
2021-11-04T14:34:13.000Z
2021-11-04T14:34:13.000Z
from .core import OneHot __all__ = ["OneHot"]
9.6
24
0.6875
6
48
4.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.1875
48
4
25
12
0.74359
0
0
0
0
0
0.125
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
62a620928fe4636dba68c4a158736c66ea6ade66
67
py
Python
junn/predict/__init__.py
modsim/junn
a40423b98c6a3739dd0b2ba02d546a5db91f9215
[ "BSD-2-Clause" ]
null
null
null
junn/predict/__init__.py
modsim/junn
a40423b98c6a3739dd0b2ba02d546a5db91f9215
[ "BSD-2-Clause" ]
null
null
null
junn/predict/__init__.py
modsim/junn
a40423b98c6a3739dd0b2ba02d546a5db91f9215
[ "BSD-2-Clause" ]
null
null
null
"""Dummy to redirect run-as-module to the junn_predict package."""
33.5
66
0.746269
11
67
4.454545
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.119403
67
1
67
67
0.830508
0.895522
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
62a684c948a09d5f9177ddec73c24fd219c6e2db
1,450
py
Python
typedb/api/query/future.py
rpatil524/client-python
e8daba79842a81669f4f4c2799bcc8610e610551
[ "Apache-2.0" ]
47
2019-01-22T19:17:13.000Z
2021-02-06T15:39:59.000Z
typedb/api/query/future.py
rpatil524/client-python
e8daba79842a81669f4f4c2799bcc8610e610551
[ "Apache-2.0" ]
85
2019-01-22T14:51:34.000Z
2021-04-08T15:41:43.000Z
typedb/api/query/future.py
rpatil524/client-python
e8daba79842a81669f4f4c2799bcc8610e610551
[ "Apache-2.0" ]
24
2019-01-22T13:21:42.000Z
2021-03-02T18:06:03.000Z
# # Copyright (C) 2021 Vaticle # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from abc import ABC, abstractmethod from typing import TypeVar, Generic, Callable T = TypeVar('T') U = TypeVar('U') class QueryFuture(Generic[T], ABC): @abstractmethod def get(self) -> T: pass def map(self, function: Callable[[T], U]) -> "QueryFuture[U]": return _MappedQueryFuture(self, function) class _MappedQueryFuture(Generic[T, U], QueryFuture[U]): def __init__(self, query_future: QueryFuture[T], function: Callable[[T], U]): self._query_future = query_future self._function = function def get(self) -> U: return self._function(self._query_future.get())
31.521739
81
0.722069
202
1,450
5.113861
0.485149
0.058083
0.043562
0.030978
0
0
0
0
0
0
0
0.00678
0.186207
1,450
45
82
32.222222
0.868644
0.537241
0
0
0
0
0.024615
0
0
0
0
0
0
1
0.25
false
0.0625
0.125
0.125
0.625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
62a95faa0facd9ac90aa25b393fd7c3589c12db8
848
py
Python
base_map/admin.py
ishuah91/MtaaSafi-Web-App
b3ed936c13d090388986b278d611387c1651b823
[ "MIT" ]
null
null
null
base_map/admin.py
ishuah91/MtaaSafi-Web-App
b3ed936c13d090388986b278d611387c1651b823
[ "MIT" ]
null
null
null
base_map/admin.py
ishuah91/MtaaSafi-Web-App
b3ed936c13d090388986b278d611387c1651b823
[ "MIT" ]
null
null
null
from django.contrib import admin from django.contrib.contenttypes import generic from base_map.models import BaseSite, Shape, Point, Polygon, MultiPolygon, Line, MultiLine class PointInline(generic.GenericTabularInline): max_num = 1 model = Point class PolygonInline(generic.GenericTabularInline): max_num = 1 model = Polygon class MultiPolygonInline(generic.GenericTabularInline): max_num = 1 model = MultiPolygon class LineInline(generic.GenericTabularInline): max_num = 1 model = Line class MultiLineInline(generic.GenericTabularInline): max_num = 1 model = MultiLine class BaseSiteAdmin(admin.ModelAdmin): inlines = [ PointInline, PolygonInline, MultiPolygonInline, LineInline, MultiLineInline ] admin.site.register(BaseSite, BaseSiteAdmin)
24.228571
90
0.728774
83
848
7.373494
0.39759
0.220588
0.245098
0.269608
0.318627
0.318627
0
0
0
0
0
0.007418
0.205189
848
34
91
24.941176
0.900593
0
0
0.185185
0
0
0
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.740741
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
62b2fbe40a0675188db493d55122a3023cde4a5e
115
py
Python
python/while_lopp.py
sivasant/python_project
d148a1be177a634b25e571b1fc1b710276f3ef3b
[ "Apache-2.0" ]
null
null
null
python/while_lopp.py
sivasant/python_project
d148a1be177a634b25e571b1fc1b710276f3ef3b
[ "Apache-2.0" ]
null
null
null
python/while_lopp.py
sivasant/python_project
d148a1be177a634b25e571b1fc1b710276f3ef3b
[ "Apache-2.0" ]
null
null
null
condition = 1 while condition < 10: print(condition) condition += 1 while True: print('santhosh')
14.375
22
0.626087
13
115
5.538462
0.538462
0.277778
0.416667
0
0
0
0
0
0
0
0
0.047619
0.269565
115
7
23
16.428571
0.809524
0
0
0
0
0
0.069565
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
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
62b6b637e035cb4f04a05d125e387bd90a4a6055
104
py
Python
cybox/bindings/extensions/location/__init__.py
siemens/python-cybox
b692a98c8a62bd696e2a0dda802ada7359853482
[ "BSD-3-Clause" ]
null
null
null
cybox/bindings/extensions/location/__init__.py
siemens/python-cybox
b692a98c8a62bd696e2a0dda802ada7359853482
[ "BSD-3-Clause" ]
null
null
null
cybox/bindings/extensions/location/__init__.py
siemens/python-cybox
b692a98c8a62bd696e2a0dda802ada7359853482
[ "BSD-3-Clause" ]
1
2019-04-16T18:37:32.000Z
2019-04-16T18:37:32.000Z
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms.
34.666667
65
0.759615
15
104
5.266667
1
0
0
0
0
0
0
0
0
0
0
0.045455
0.153846
104
2
66
52
0.852273
0.951923
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
1a1f3a12b311a67478020822c4ae2b8cdb67f86c
144
py
Python
utility/__init__.py
thitta/Python-Automation-Script
7ffae3350a13201e2070843acb11bc73aa815ce3
[ "MIT" ]
null
null
null
utility/__init__.py
thitta/Python-Automation-Script
7ffae3350a13201e2070843acb11bc73aa815ce3
[ "MIT" ]
null
null
null
utility/__init__.py
thitta/Python-Automation-Script
7ffae3350a13201e2070843acb11bc73aa815ce3
[ "MIT" ]
null
null
null
from .file_utility import * from .template import procedure, NextStep, teardown __all__ = ["procedure", "NextStep", "FileUtility", "teardown"]
28.8
62
0.75
15
144
6.866667
0.666667
0.330097
0
0
0
0
0
0
0
0
0
0
0.118056
144
4
63
36
0.811024
0
0
0
0
0
0.25
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
a7e5d1e8bab69e0a54ddf7ec07ed5fb93b818ed5
162
py
Python
test2/login.py
hungry-Tt/test
fe32f8f3e6ae02213894d8f51cb0d464a7255fcc
[ "Apache-2.0" ]
null
null
null
test2/login.py
hungry-Tt/test
fe32f8f3e6ae02213894d8f51cb0d464a7255fcc
[ "Apache-2.0" ]
null
null
null
test2/login.py
hungry-Tt/test
fe32f8f3e6ae02213894d8f51cb0d464a7255fcc
[ "Apache-2.0" ]
null
null
null
我是经理鸭 我是你三爹 你明天可以不用来上班了 你爹就是不想上了 CNM NMSL <<<<<<< HEAD 11 33 999999999999999 0000000000000000000000 ======= 222 >>>>>>> 8c0c2ceb0ca1300b4d93211d74be91e43833d532
10.125
48
0.765432
13
162
9.538462
1
0
0
0
0
0
0
0
0
0
0
0.482759
0.104938
162
15
49
10.8
0.372414
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
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
c5022ccfc8bcdb4572727a9eda6febde7d3d2f83
218
py
Python
backend/messages/admin.py
HillalRoy/Studenthut
6aba8208e8f6d2650196c5a0220b62fee2eae108
[ "Apache-2.0" ]
1
2021-05-01T16:52:30.000Z
2021-05-01T16:52:30.000Z
backend/messages/admin.py
HillalRoy/Studenthut
6aba8208e8f6d2650196c5a0220b62fee2eae108
[ "Apache-2.0" ]
null
null
null
backend/messages/admin.py
HillalRoy/Studenthut
6aba8208e8f6d2650196c5a0220b62fee2eae108
[ "Apache-2.0" ]
1
2021-04-29T15:11:47.000Z
2021-04-29T15:11:47.000Z
from django.contrib import admin from . import models @admin.register(models.Message) class MsgAdmin(admin.ModelAdmin): pass @admin.register(models.ClassMessage) class ClassMsgAdmin(admin.ModelAdmin): pass
16.769231
38
0.779817
26
218
6.538462
0.538462
0.152941
0.223529
0
0
0
0
0
0
0
0
0
0.12844
218
12
39
18.166667
0.894737
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.25
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
c525a1b69e396884bafe9bd58f424d1e9bacdeab
413
py
Python
pycsca/__init__.py
prithagupta/ml-sca
7158d8013cea02c316ce86c802b9651b97c6fe36
[ "Apache-2.0" ]
null
null
null
pycsca/__init__.py
prithagupta/ml-sca
7158d8013cea02c316ce86c802b9651b97c6fe36
[ "Apache-2.0" ]
1
2022-02-17T17:21:26.000Z
2022-02-17T17:21:26.000Z
pycsca/__init__.py
prithagupta/ml-sca
7158d8013cea02c316ce86c802b9651b97c6fe36
[ "Apache-2.0" ]
null
null
null
from .baseline import RandomClassifier, MajorityVoting, PriorClassifier from .csv_reader import CSVReader from .synthetic_dataset_reader import SyntheticDatasetGenerator from .real_dataset_generator import RealDatasetGenerator from .classification_test import optimize_search_cv from .classifiers import classifiers_space, custom_dict from .constants import * from .statistical_tests import * from .utils import *
45.888889
71
0.871671
47
413
7.425532
0.595745
0.068768
0
0
0
0
0
0
0
0
0
0
0.09201
413
9
72
45.888889
0.930667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
c54efb0abf61d28303d4290e7360ec51d6b7f181
121
py
Python
dsfp/tests/test_data.py
adamamiller/DSFP-demo
136daa7fd3684c7c8d469b4bd9b4214118d88529
[ "MIT" ]
null
null
null
dsfp/tests/test_data.py
adamamiller/DSFP-demo
136daa7fd3684c7c8d469b4bd9b4214118d88529
[ "MIT" ]
null
null
null
dsfp/tests/test_data.py
adamamiller/DSFP-demo
136daa7fd3684c7c8d469b4bd9b4214118d88529
[ "MIT" ]
null
null
null
from dsfp.data import get_photometry def test_get_photometry(): data = get_photometry(10) assert len(data) == 10
24.2
36
0.735537
18
121
4.722222
0.611111
0.458824
0
0
0
0
0
0
0
0
0
0.04
0.173554
121
5
37
24.2
0.81
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
false
0
0.25
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
c5591302e0e195db119d2d71fb4cfdf055fa46b4
276
py
Python
Challenges/Google/problem_58.py
JeremySomsouk/DailyCodingProblem
ca4e19571b175d92a913b5b373a6f17fccd87731
[ "Unlicense" ]
54
2019-03-14T21:27:13.000Z
2021-12-08T12:58:08.000Z
Challenges/Google/problem_58.py
JeremySomsouk/DailyCodingProblem
ca4e19571b175d92a913b5b373a6f17fccd87731
[ "Unlicense" ]
null
null
null
Challenges/Google/problem_58.py
JeremySomsouk/DailyCodingProblem
ca4e19571b175d92a913b5b373a6f17fccd87731
[ "Unlicense" ]
8
2020-02-06T23:28:01.000Z
2021-08-05T20:33:16.000Z
""" Asked by: Google [Hard]. Given a string, split it into as few strings as possible such that each string is a palindrome. For example, given the input string racecarannakayak, return ["racecar", "anna", "kayak"]. Given the input string abc, return ["a", "b", "c"]. """
27.6
95
0.692029
42
276
4.547619
0.738095
0.08377
0.136126
0.198953
0
0
0
0
0
0
0
0
0.173913
276
9
96
30.666667
0.837719
0.963768
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
1
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
c55b696476c7f3f9706708cb56e62bc5186815e1
207
py
Python
vent/helpers/errors.py
edgardmota/vent
67b01abc059a3e9e8d16670c7058f0a9e267d8f1
[ "Apache-2.0" ]
null
null
null
vent/helpers/errors.py
edgardmota/vent
67b01abc059a3e9e8d16670c7058f0a9e267d8f1
[ "Apache-2.0" ]
null
null
null
vent/helpers/errors.py
edgardmota/vent
67b01abc059a3e9e8d16670c7058f0a9e267d8f1
[ "Apache-2.0" ]
null
null
null
def ErrorHandler(function): def wrapper(*args, **kwargs): try: return function(*args, **kwargs) except Exception as e: # pragma: no cover pass return wrapper
25.875
50
0.570048
22
207
5.363636
0.727273
0.169492
0
0
0
0
0
0
0
0
0
0
0.333333
207
7
51
29.571429
0.855072
0.077295
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0.142857
0
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
c561a4b73276386325c25a14084dc06e12823791
87
py
Python
bgport/apps.py
shotastage/neco-sys
60816ceee3eaf36d8d278db72e741d45c3f4af41
[ "MIT" ]
null
null
null
bgport/apps.py
shotastage/neco-sys
60816ceee3eaf36d8d278db72e741d45c3f4af41
[ "MIT" ]
10
2020-02-12T00:37:45.000Z
2022-03-03T21:58:40.000Z
bgport/apps.py
shotastage/neco-sys
60816ceee3eaf36d8d278db72e741d45c3f4af41
[ "MIT" ]
null
null
null
from django.apps import AppConfig class BgportConfig(AppConfig): name = 'bgport'
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
c575e41a43c3c3975029340793ce4e0ad061493b
75
py
Python
lgp/abcd/task.py
dingmyu/hlsm
628702789d910f745c74e738efbdd65f0fdb654b
[ "BSD-3-Clause" ]
null
null
null
lgp/abcd/task.py
dingmyu/hlsm
628702789d910f745c74e738efbdd65f0fdb654b
[ "BSD-3-Clause" ]
null
null
null
lgp/abcd/task.py
dingmyu/hlsm
628702789d910f745c74e738efbdd65f0fdb654b
[ "BSD-3-Clause" ]
null
null
null
from abc import ABC class Task(ABC): def __init__(self): ...
10.714286
23
0.573333
10
75
3.9
0.8
0
0
0
0
0
0
0
0
0
0
0
0.306667
75
6
24
12.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
3d836a57fc3ce550b7c2663e3f433fa1afe1e670
716
py
Python
playmobile/config.py
rajab-murod/playmobile
c00e067a92c71c001c4085cfbd65f04a9f411a37
[ "MIT" ]
null
null
null
playmobile/config.py
rajab-murod/playmobile
c00e067a92c71c001c4085cfbd65f04a9f411a37
[ "MIT" ]
null
null
null
playmobile/config.py
rajab-murod/playmobile
c00e067a92c71c001c4085cfbd65f04a9f411a37
[ "MIT" ]
null
null
null
import base64 from django.conf import settings class Config: URL = settings.PLAY_MOBILE_SETTINGS['API_URL'] PREFIX = settings.PLAY_MOBILE_SETTINGS['PREFIX'] DEFAULT_ORIGINATOR = settings.PLAY_MOBILE_SETTINGS['ORIGINATOR'] ORIGINATOR = '3700' if DEFAULT_ORIGINATOR == '' else DEFAULT_ORIGINATOR LOGIN = settings.PLAY_MOBILE_SETTINGS['LOGIN'] PASSWORD = settings.PLAY_MOBILE_SETTINGS['PASSWORD'] def __init__(self): self.HEADER = self.header() def header(self): data = '{}:{}'.format(self.LOGIN, self.PASSWORD) encoded = base64.b64encode(data.encode('utf-8')) header = {'Authorization': 'Basic {}'.format(str(encoded, 'utf-8'))} return header
35.8
76
0.689944
82
716
5.804878
0.426829
0.12605
0.189076
0.273109
0
0
0
0
0
0
0
0.020443
0.180168
716
20
77
35.8
0.79046
0
0
0
0
0
0.105997
0
0
0
0
0
0
1
0.125
false
0.125
0.125
0
0.75
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
3d8805332ffb39c7d58eba2ac173b5e909178677
1,191
py
Python
tests/approximate_als_test.py
yurijmikhalevich/implicit
be5ba9b312a408453701b216dd99093a4986129f
[ "MIT" ]
1
2019-01-16T23:35:24.000Z
2019-01-16T23:35:24.000Z
tests/approximate_als_test.py
yurijmikhalevich/implicit
be5ba9b312a408453701b216dd99093a4986129f
[ "MIT" ]
null
null
null
tests/approximate_als_test.py
yurijmikhalevich/implicit
be5ba9b312a408453701b216dd99093a4986129f
[ "MIT" ]
null
null
null
from __future__ import print_function import unittest from implicit.approximate_als import (AnnoyAlternatingLeastSquares, FaissAlternatingLeastSquares, NMSLibAlternatingLeastSquares) from .recommender_base_test import TestRecommenderBaseMixin # don't require annoy/faiss/nmslib to be installed try: import annoy # noqa class AnnoyALSTest(unittest.TestCase, TestRecommenderBaseMixin): def _get_model(self): return AnnoyAlternatingLeastSquares(factors=2, regularization=0) except ImportError: pass try: import nmslib # noqa class NMSLibALSTest(unittest.TestCase, TestRecommenderBaseMixin): def _get_model(self): return NMSLibAlternatingLeastSquares(factors=2, regularization=0, index_params={'post': 2}) except ImportError: pass try: import faiss # noqa class FaissALSTest(unittest.TestCase, TestRecommenderBaseMixin): def _get_model(self): return FaissAlternatingLeastSquares(nlist=1, nprobe=1, factors=2, regularization=0) except ImportError: pass if __name__ == "__main__": unittest.main()
29.04878
97
0.700252
109
1,191
7.440367
0.486239
0.033292
0.147965
0.159063
0.382244
0.334155
0.334155
0.225647
0
0
0
0.009879
0.235097
1,191
40
98
29.775
0.880351
0.052897
0
0.413793
0
0
0.010686
0
0
0
0
0
0
1
0.103448
false
0.103448
0.344828
0.103448
0.655172
0.034483
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
0
0
1
1
1
1
0
0
4
3d948c300f0a6fa60842a9be91f7e887ec6bd691
149
py
Python
code/1115.py
minssoj/Learning_Algorithm_Up
45ec4e2eb4c07c9ec907a74dbd31370e1645c50b
[ "MIT" ]
null
null
null
code/1115.py
minssoj/Learning_Algorithm_Up
45ec4e2eb4c07c9ec907a74dbd31370e1645c50b
[ "MIT" ]
null
null
null
code/1115.py
minssoj/Learning_Algorithm_Up
45ec4e2eb4c07c9ec907a74dbd31370e1645c50b
[ "MIT" ]
null
null
null
# 두 정수의 덧셈 (64비트) # minso.jeong@daum.net ''' 문제링크 : https://www.codeup.kr/problem.php?id=1115 ''' a, b = list(map(int, input().split())) print(a + b)
21.285714
48
0.61745
27
149
3.407407
0.925926
0.043478
0
0
0
0
0
0
0
0
0
0.046154
0.127517
149
7
49
21.285714
0.661538
0.577181
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
3dd40141f80e114d5c1ca4f717d1ca111dc4d96e
201
py
Python
lang/Python/catamorphism-1.py
ethansaxenian/RosettaDecode
8ea1a42a5f792280b50193ad47545d14ee371fb7
[ "MIT" ]
null
null
null
lang/Python/catamorphism-1.py
ethansaxenian/RosettaDecode
8ea1a42a5f792280b50193ad47545d14ee371fb7
[ "MIT" ]
null
null
null
lang/Python/catamorphism-1.py
ethansaxenian/RosettaDecode
8ea1a42a5f792280b50193ad47545d14ee371fb7
[ "MIT" ]
null
null
null
# Python 2.X from operator import add listoflists = [['the', 'cat'], ['sat', 'on'], ['the', 'mat']] help(reduce) reduce(...) reduce(add, listoflists, []) ['the', 'cat', 'sat', 'on', 'the', 'mat']
15.461538
61
0.547264
26
201
4.230769
0.576923
0.254545
0.309091
0.363636
0.563636
0.563636
0.563636
0.563636
0
0
0
0.005882
0.154229
201
12
62
16.75
0.641176
0.049751
0
0
0
0
0.180851
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
3dd4a94e679b747a2cfbdb99a9cff63b9bf0630c
23
py
Python
pymattype/version.py
yasirroni/PyMatType
e35d3e7e216473fa4c9d05c4ed31c2f5f86450e3
[ "MIT" ]
null
null
null
pymattype/version.py
yasirroni/PyMatType
e35d3e7e216473fa4c9d05c4ed31c2f5f86450e3
[ "MIT" ]
null
null
null
pymattype/version.py
yasirroni/PyMatType
e35d3e7e216473fa4c9d05c4ed31c2f5f86450e3
[ "MIT" ]
null
null
null
__version__ = "0.0.1a0"
23
23
0.695652
4
23
3
0.75
0
0
0
0
0
0
0
0
0
0
0.190476
0.086957
23
1
23
23
0.380952
0
0
0
0
0
0.291667
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