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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
90b24fb150c4112ffdef860249128d14dec490d2
| 15,800
|
py
|
Python
|
abacus/basis_set.py
|
Matgen-project/ABACUSflow
|
6d210be17aa14e42e531671f15771ca4de0edbbc
|
[
"MIT"
] | null | null | null |
abacus/basis_set.py
|
Matgen-project/ABACUSflow
|
6d210be17aa14e42e531671f15771ca4de0edbbc
|
[
"MIT"
] | null | null | null |
abacus/basis_set.py
|
Matgen-project/ABACUSflow
|
6d210be17aa14e42e531671f15771ca4de0edbbc
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 23 20:07:08 2018
@author: Shen Zhen-Xiong
"""
basis_dic={ 'basis_lda minimal':
{'H':'H_lda_5.0au_50Ry_2s1p',
'Li':'Li_lda_8.0au_50Ry_2s2p1d',
'Be':'Be_lda_8.0au_50Ry_2s2p1d',
'B':'B_lda_7.0au_50Ry_2s2p1d',
'C':'C_pz-vbc_6.0au_50Ry_2s2d1p',
'N':'N_lda_5.0au_50Ry_2s2p1d',
'O':'O_lda_5.0au_50Ry_2s2p1d',
'F':'F_lda_5.0au_50Ry_2s2p1d',
'Na':'Na_lda_9.0au_50Ry_2s2p1d',
'Mg':'Mg_lda_8.0au_50Ry_2s2p1d',
'Al':'Al_pz-vbc_9.0au_50Ry_2s2d1p',
'Si':'Si_lda_8.0au_50Ry_2s2p1d',
'P':'P_lda_7.0au_50Ry_2s2p1d',
'S':'S_lda_6.0au_50Ry_2s2p1d',
'Cl':'Cl_pz-bhs_6.0au_50Ry_2s2d1p',
'K':'K_lda_10.0au_50Ry_2s2p1d',
'Ca':'Ca_pz-n-vbc_10.0au_50Ry_2s2p1d',
'Ti':'Ti_lda_8.0au_100Ry_2s2p2d',
'Mn':'Mn_lda_7.0au_100Ry_2s2p2d',
'Fe':'Fe_lda_7.0au_100Ry_2s2p2d',
'Cu':'Cu_lda_6.0au_100Ry_2s2p2d',
'Zn':'Zn_lda_6.0au_120Ry_2s2p2d',
'Ga':'Ga_lda_7.0au_100Ry_2s2p2d',
'Ge':'Ge_pz-bhs_8.0au_50Ry_2s2d1p',
'As':'As_pz-bhs_7.0au_50Ry_2s2p1d',
'Se':'Se_pz-bhs_7.0au_50Ry_2s2p1d',
'Br':'Br_lda_6.0au_50Ry_2s2p1d',
'In':'In_pz-bhs_8.0au_50Ry_2s2p1d',
'Sn':'Sn_pz-bhs_8.0au_16Ry_2s2p1d',
'I':'I_lda_6.0au_50Ry_2s2p2d'
},
#
'basis_lda medium':
{'H':'H_lda_6.0au_50Ry_2s1p',
'Li':'Li_lda_10.0au_50Ry_2s2p1d',
'Be':'Be_lda_9.0au_50Ry_2s2p1d',
'B':'B_lda_8.0au_50Ry_2s2p1d',
'C':'C_pz-vbc_7.0au_50Ry_2s2d1p',
'N':'N_lda_6.0au_50Ry_2s2p1d',
'O':'O_lda_6.0au_50Ry_2s2p1d',
'F':'F_lda_6.0au_50Ry_2s2p1d',
'Na':'Na_lda_10.0au_50Ry_2s2p1d',
'Mg':'Mg_lda_10.0au_50Ry_2s2p1d',
'Al':'Al_pz-vbc_10.0au_50Ry_2s2d1p',
'Si':'Si_lda_9.0au_50Ry_2s2p1d',
'P':'P_lda_8.0au_50Ry_2s2p1d',
'S':'S_lda_7.0au_50Ry_2s2p1d',
'Cl':'Cl_pz-bhs_7.0au_50Ry_2s2d1p',
'K':'K_lda_11.0au_50Ry_2s2p1d',
'Ca':'Ca_pz-n-vbc_11.0au_50Ry_2s2p1d',
'Ti':'Ti_lda_10.0au_100Ry_2s2p2d',
'Mn':'Mn_lda_9.0au_100Ry_2s2p2d',
'Fe':'Fe_lda_8.0au_100Ry_2s2p2d',
'Cu':'Cu_lda_7.0au_100Ry_2s2p2d',
'Zn':'Zn_lda_8.0au_120Ry_2s2p2d',
'Ga':'Ga_lda_8.0au_100Ry_2s2p2d',
'Ge':'Ge_pz-bhs_9.0au_50Ry_2s2d1p',
'As':'As_pz-bhs_8.0au_50Ry_2s2p1d',
'Se':'Se_pz-bhs_8.0au_50Ry_2s2p1d',
'Br':'Br_lda_7.0au_50Ry_2s2p1d',
'In':'In_pz-bhs_10.0au_50Ry_2s2p1d',
'Sn':'Sn_pz-bhs_9.0au_16Ry_2s2p1d',
'I':'I_lda_7.0au_50Ry_2s2p2d'
},
#
'basis_lda accurate':
{'H':'H_lda_8.0au_50Ry_2s1p',
'Li':'Li_lda_12.0au_50Ry_2s2p1d',
'Be':'Be_lda_10.0au_50Ry_2s2p1d',
'B':'B_lda_9.0au_50Ry_2s2p1d',
'C':'C_pz-vbc_8.0au_50Ry_2s2d1p',
'N':'N_lda_7.0au_50Ry_2s2p1d',
'O':'O_lda_7.0au_50Ry_2s2p1d',
'F':'F_lda_7.0au_50Ry_2s2p1d',
'Na':'Na_lda_12.0au_50Ry_2s2p1d',
'Mg':'Mg_lda_12.0au_50Ry_2s2p1d',
'Al':'Al_pz-vbc_11.0au_50Ry_2s2d1p',
'Si':'Si_lda_10.0au_50Ry_2s2p1d',
'P':'P_lda_9.0au_50Ry_2s2p1d',
'S':'S_lda_8.0au_50Ry_2s2p1d',
'Cl':'Cl_pz-bhs_8.0au_50Ry_2s2d1p',
'K':'K_lda_12.0au_50Ry_2s2p1d',
'Ca':'Ca_pz-n-vbc_12.0au_50Ry_2s2p1d',
'Ti':'Ti_lda_11.0au_100Ry_2s2p2d',
'Mn':'Mn_lda_10.0au_100Ry_2s2p2d',
'Fe':'Fe_lda_9.0au_100Ry_2s2p2d',
'Cu':'Cu_lda_8.0au_100Ry_2s2p2d',
'Zn':'Zn_lda_9.0au_120Ry_2s2p2d',
'Ga':'Ga_lda_9.0au_100Ry_2s2p2d',
'Ge':'Ge_pz-bhs_10.0au_50Ry_2s2d1p',
'As':'As_pz-bhs_9.0au_50Ry_2s2p1d',
'Se':'Se_pz-bhs_9.0au_50Ry_2s2p1d',
'Br':'Br_lda_8.0au_50Ry_2s2p1d',
'In':'In_pz-bhs_11.0au_50Ry_2s2p1d',
'Sn':'Sn_pz-bhs_10.0au_16Ry_2s2p1d',
'I':'I_lda_8.0au_50Ry_2s2p2d'
}
,
'basis_pbe minimal':
{'H':'H_pbe_5.0au_50Ry_2s1p',
'Li':'Li_pbe_8.0au_50Ry_2s2p1d',
'Be':'Be_pbe_8.0au_50Ry_2s2p1d',
'B':'B_pbe_7.0au_50Ry_2s2p1d',
'C':'C_pbe_6.0au_50Ry_2s2d1p',
'N':'N_pbe_5.0au_50Ry_2s2p1d',
'O':'O_pbe_5.0au_50Ry_2s2p1d',
'F':'F_pbe_5.0au_50Ry_2s2p1d',
'Na':'Na_pbe_9.0au_50Ry_2s2p1d',
'Mg':'Mg_pbe_8.0au_50Ry_2s2p1d',
'Al':'Al_pbe_9.0au_50Ry_2s2d1p',
'Si':'Si_pbe_8.0au_50Ry_2s2p1d',
'P':'P_pbe_7.0au_50Ry_2s2p1d',
'S':'S_pbe_6.0au_50Ry_2s2p1d',
'Cl':'Cl_pbe_6.0au_50Ry_2s2d1p',
'K':'K_pbe_10.0au_50Ry_2s2p1d',
'Ti':'Ti_pbe_8.0au_100Ry_2s2p2d',
'Mn':'Mn_pbe_7.0au_100Ry_2s2p2d',
'Fe':'Fe_pbe_7.0au_100Ry_2s2p2d',
'Cu':'Cu_pbe_6.0au_100Ry_2s2p2d',
'Zn':'Zn_pbe_6.0au_120Ry_2s2p2d',
'Ga':'Ga_pbe_7.0au_100Ry_2s2p2d',
'Br':'Br_pbe_6.0au_50Ry_2s2p1d',
'I':'I_pbe_6.0au_50Ry_2s2p2d'
},
#
'basis_pbe medium':
{'H':'H_pbe_6.0au_50Ry_2s1p',
'Li':'Li_pbe_10.0au_50Ry_2s2p1d',
'Be':'Be_pbe_9.0au_50Ry_2s2p1d',
'B':'B_pbe_8.0au_50Ry_2s2p1d',
'C':'C_pbe_7.0au_50Ry_2s2d1p',
'N':'N_pbe_6.0au_50Ry_2s2p1d',
'O':'O_6.0au_50Ry_2s2p1d',
'F':'F_pbe_6.0au_50Ry_2s2p1d',
'Na':'Na_pbe_10.0au_50Ry_2s2p1d',
'Mg':'Mg_pbe_10.0au_50Ry_2s2p1d',
'Al':'Al_pbe_10.0au_50Ry_2s2d1p',
'Si':'Si_pbe_9.0au_50Ry_2s2p1d',
'P':'P_8.0au_50Ry_2s2p1d',
'S':'S_pbe_7.0au_50Ry_2s2p1d',
'Cl':'Cl_pbe_7.0au_50Ry_2s2d1p',
'K':'K_pbe_11.0au_50Ry_2s2p1d',
'Ti':'Ti_pbe_10.0au_100Ry_2s2p2d',
'Mn':'Mn_pbe_9.0au_100Ry_2s2p2d',
'Fe':'Fe_pbe_8.0au_100Ry_2s2p2d',
'Cu':'Cu_pbe_7.0au_100Ry_2s2p2d',
'Zn':'Zn_pbe_8.0au_120Ry_2s2p2d',
'Ga':'Ga_pbe_8.0au_100Ry_2s2p2d',
'Br':'Br_pbe_7.0au_50Ry_2s2p1d',
'I':'I_pbe_7.0au_50Ry_2s2p2d'
},
#
'basis_pbe accurate':
{'H':'H_pbe_8.0au_50Ry_2s1p',
'Li':'Li_pbe_12.0au_50Ry_2s2p1d',
'Be':'Be_pbe_10.0au_50Ry_2s2p1d',
'B':'B_pbe_9.0au_50Ry_2s2p1d',
'C':'C_pbe_8.0au_50Ry_2s2d1p',
'N':'N_pbe_7.0au_50Ry_2s2p1d',
'O':'O_pbe_7.0au_50Ry_2s2p1d',
'F':'F_pbe_7.0au_50Ry_2s2p1d',
'Na':'Na_pbe_12.0au_50Ry_2s2p1d',
'Mg':'Mg_pbe_12.0au_50Ry_2s2p1d',
'Al':'Al_pbe_11.0au_50Ry_2s2d1p',
'Si':'Si_pbe_10.0au_50Ry_2s2p1d',
'P':'P_pbe_9.0au_50Ry_2s2p1d',
'S':'S_pbe_8.0au_50Ry_2s2p1d',
'Cl':'Cl_pbe_8.0au_50Ry_2s2d1p',
'K':'K_pbe_12.0au_50Ry_2s2p1d',
'Ti':'Ti_pbe_11.0au_100Ry_2s2p2d',
'Mn':'Mn_pbe_10.0au_100Ry_2s2p2d',
'Fe':'Fe_pbe_9.0au_100Ry_2s2p2d',
'Cu':'Cu_pbe_8.0au_100Ry_2s2p2d',
'Zn':'Zn_pbe_9.0au_120Ry_2s2p2d',
'Ga':'Ga_pbe_9.0au_100Ry_2s2p2d',
'Br':'Br_pbe_8.0au_50Ry_2s2p1d',
'I':'I_pbe_8.0au_50Ry_2s2p2d'
}
,
'basis_pbe_sg15 accurate':
{'Ag':'Ag_gga_9au_100Ry_4s2p2d1f.orb',
'Al':'Al_gga_9au_100Ry_4s4p1d.orb',
'Ar':'Ar_gga_7au_100Ry_2s2p1d.orb',
'As':'As_gga_8au_100Ry_2s2p1d.orb',
'Au':'Au_gga_9au_100Ry_4s2p2d1f.orb',
'B':'B_gga_8au_100Ry_2s2p1d.orb',
'Ba':'Ba_gga_11au_100Ry_4s2p2d.orb',
'Be':'Be_gga_8au_100Ry_4s1p.orb',
'Bi':'Bi_gga_9au_100Ry_2s2p2d.orb',
'Br':'Br_gga_8au_100Ry_2s2p1d.orb',
'C':'C_gga_8au_100Ry_2s2p1d.orb',
'Ca':'Ca_gga_9au_100Ry_4s2p1d.orb',
'Cd':'Cd_gga_9au_100Ry_4s2p2d1f.orb',
'Cl':'Cl_gga_8au_100Ry_2s2p1d.orb',
'Co':'Co_gga_9au_100Ry_4s2p2d1f.orb',
'Cr':'Cr_gga_9au_100Ry_4s2p2d1f.orb',
'Cs':'Cs_gga_11au_100Ry_4s2p1d.orb',
'Cu':'Cu_gga_9au_100Ry_4s2p2d1f.orb',
'F':'F_gga_7au_100Ry_2s2p1d.orb',
'Fe':'Fe_gga_9au_100Ry_4s2p2d1f.orb',
'Ga':'Ga_gga_9au_100Ry_2s2p2d.orb',
'Ge':'Ge_gga_8au_100Ry_2s2p2d.orb',
'H':'H_gga_8au_100Ry_2s1p.orb',
'He':'He_gga_6au_100Ry_2s1p.orb',
'Hf':'Hf_gga_10au_100Ry_4s2p2d2f.orb',
'Hg':'Hg_gga_9au_100Ry_4s2p2d1f.orb',
'I':'I_gga_8au_100Ry_2s2p2d.orb',
'In':'In_gga_9au_100Ry_2s2p2d.orb',
'Ir':'Ir_gga_9au_100Ry_4s2p2d1f.orb',
'K':'K_gga_9au_100Ry_4s2p1d.orb',
'Kr':'Kr_gga_7au_100Ry_2s2p1d.orb',
'Li':'Li_gga_9au_100Ry_4s1p.orb',
'Mg':'Mg_gga_9au_100Ry_4s2p1d.orb',
'Mn':'Mn_gga_9au_100Ry_4s2p2d1f.orb',
'Mo':'Mo_gga_9au_100Ry_4s2p2d1f.orb',
'N':'N_gga_8au_100Ry_2s2p1d.orb',
'Na':'Na_gga_9au_100Ry_4s2p1d.orb',
'Nb':'Nb_gga_9au_100Ry_4s2p2d1f.orb',
'Ne':'Ne_gga_6au_100Ry_2s2p1d.orb',
'Ni':'Ni_gga_9au_100Ry_4s2p2d1f.orb',
'O':'O_gga_7au_100Ry_2s2p1d.orb',
'Os':'Os_gga_9au_100Ry_4s2p2d1f.orb',
'P':'P_gga_8au_100Ry_2s2p1d.orb',
'Pb':'Pb_gga_9au_100Ry_2s2p2d.orb',
'Pd':'Pd_gga_9au_100Ry_4s2p2d1f.orb',
'Pt':'Pt_gga_9au_100Ry_4s2p2d1f.orb',
'Rb':'Rb_gga_10au_100Ry_4s2p1d.orb',
'Re':'Re_gga_10au_100Ry_4s2p2d1f.orb',
'Rh':'Rh_gga_9au_100Ry_4s2p2d1f.orb',
'Ru':'Ru_gga_9au_100Ry_4s2p2d1f.orb',
'S':'S_gga_8au_100Ry_2s2p1d.orb',
'Sb':'Sb_gga_9au_100Ry_2s2p2d.orb',
'Sc':'Sc_gga_9au_100Ry_4s2p2d1f.orb',
'Se':'Se_gga_8au_100Ry_2s2p1d.orb',
'Si':'Si_gga_8au_100Ry_2s2p1d.orb',
'Sn':'Sn_gga_9au_100Ry_2s2p2d.orb',
'Sr':'Sr_gga_10au_100Ry_4s2p1d.orb',
'Ta':'Ta_gga_10au_100Ry_4s2p2d2f.orb',
'Tc':'Tc_gga_9au_100Ry_4s2p2d1f.orb',
'Te':'Te_gga_9au_100Ry_2s2p2d.orb',
'Ti':'Ti_gga_9au_100Ry_4s2p2d1f.orb',
'Tl':'Tl_gga_9au_100Ry_2s2p2d.orb',
'V':'V_gga_9au_100Ry_4s2p2d1f.orb',
'W':'W_gga_10au_100Ry_4s2p2d2f.orb',
'Xe':'Xe_gga_7au_100Ry_2s2p2d.orb',
'Y':'Y_gga_9au_100Ry_4s2p2d1f.orb',
'Zn':'Zn_gga_9au_100Ry_4s2p2d1f.orb',
'Zr':'Zr_gga_9au_100Ry_4s2p2d1f.orb'}
,
'basis_pbe_sg15 standard':
{'Ag':'Ag_gga_9au_60Ry_4s2p2d1f.orb',
'Al':'Al_gga_9au_60Ry_4s4p1d.orb',
'Ar':'Ar_gga_7au_60Ry_2s2p1d.orb',
'As':'As_gga_8au_60Ry_2s2p1d.orb',
'Au':'Au_gga_9au_60Ry_4s2p2d1f.orb',
'B':'B_gga_8au_60Ry_2s2p1d.orb',
'Ba':'Ba_gga_11au_60Ry_4s2p2d.orb',
'Be':'Be_gga_8au_60Ry_4s1p.orb',
'Bi':'Bi_gga_9au_60Ry_2s2p2d.orb',
'Br':'Br_gga_8au_60Ry_2s2p1d.orb',
'C':'C_gga_8au_60Ry_2s2p1d.orb',
'Ca':'Ca_gga_9au_60Ry_4s2p1d.orb',
'Cd':'Cd_gga_9au_60Ry_4s2p2d1f.orb',
'Cl':'Cl_gga_8au_60Ry_2s2p1d.orb',
'Co':'Co_gga_9au_60Ry_4s2p2d1f.orb',
'Cr':'Cr_gga_9au_60Ry_4s2p2d1f.orb',
'Cs':'Cs_gga_11au_60Ry_4s2p1d.orb',
'Cu':'Cu_gga_9au_60Ry_4s2p2d1f.orb',
'F':'F_gga_7au_60Ry_2s2p1d.orb',
'Fe':'Fe_gga_9au_60Ry_4s2p2d1f.orb',
'Ga':'Ga_gga_9au_60Ry_2s2p2d.orb',
'Ge':'Ge_gga_8au_60Ry_2s2p2d.orb',
'H':'H_gga_8au_60Ry_2s1p.orb',
'He':'He_gga_6au_60Ry_2s1p.orb',
'Hf':'Hf_gga_10au_60Ry_4s2p2d2f.orb',
'Hg':'Hg_gga_9au_60Ry_4s2p2d1f.orb',
'I':'I_gga_8au_60Ry_2s2p2d.orb',
'In':'In_gga_9au_60Ry_2s2p2d.orb',
'Ir':'Ir_gga_9au_60Ry_4s2p2d1f.orb',
'K':'K_gga_9au_60Ry_4s2p1d.orb',
'Kr':'Kr_gga_7au_60Ry_2s2p1d.orb',
'Li':'Li_gga_9au_60Ry_4s1p.orb',
'Mg':'Mg_gga_9au_60Ry_4s2p1d.orb',
'Mn':'Mn_gga_9au_60Ry_4s2p2d1f.orb',
'Mo':'Mo_gga_9au_60Ry_4s2p2d1f.orb',
'N':'N_gga_8au_60Ry_2s2p1d.orb',
'Na':'Na_gga_10au_60Ry_4s2p1d.orb',
'Nb':'Nb_gga_9au_60Ry_4s2p2d1f.orb',
'Ne':'Ne_gga_6au_60Ry_2s2p1d.orb',
'Ni':'Ni_gga_9au_60Ry_4s2p2d1f.orb',
'O':'O_gga_7au_60Ry_2s2p1d.orb',
'Os':'Os_gga_9au_60Ry_4s2p2d1f.orb',
'P':'P_gga_8au_60Ry_2s2p1d.orb',
'Pb':'Pb_gga_9au_60Ry_2s2p2d.orb',
'Pd':'Pd_gga_9au_60Ry_4s2p2d1f.orb',
'Pt':'Pt_gga_9au_60Ry_4s2p2d1f.orb',
'Rb':'Rb_gga_10au_60Ry_4s2p1d.orb',
'Re':'Re_gga_10au_60Ry_4s2p2d1f.orb',
'Rh':'Rh_gga_9au_60Ry_4s2p2d1f.orb',
'Ru':'Ru_gga_9au_60Ry_4s2p2d1f.orb',
'S':'S_gga_8au_60Ry_2s2p1d.orb',
'Sb':'Sb_gga_9au_60Ry_2s2p2d.orb',
'Sc':'Sc_gga_9au_60Ry_4s2p2d1f.orb',
'Se':'Se_gga_8au_60Ry_2s2p1d.orb',
'Si':'Si_gga_8au_60Ry_2s2p1d.orb',
'Sn':'Sn_gga_9au_60Ry_2s2p2d.orb',
'Sr':'Sr_gga_10au_60Ry_4s2p1d.orb',
'Ta':'Ta_gga_10au_60Ry_4s2p2d2f.orb',
'Tc':'Tc_gga_9au_60Ry_4s2p2d1f.orb',
'Te':'Te_gga_9au_60Ry_2s2p2d.orb',
'Ti':'Ti_gga_9au_60Ry_4s2p2d1f.orb',
'Tl':'Tl_gga_9au_60Ry_2s2p2d.orb',
'V':'V_gga_9au_60Ry_4s2p2d1f.orb',
'W':'W_gga_10au_60Ry_4s2p2d2f.orb',
'Xe':'Xe_gga_8au_60Ry_2s2p2d.orb',
'Y':'Y_gga_9au_60Ry_4s2p2d1f.orb',
'Zn':'Zn_gga_9au_60Ry_4s2p2d1f.orb',
'Zr':'Zr_gga_9au_60Ry_4s2p2d1f.orb'}
}
| 47.878788
| 55
| 0.50962
| 2,158
| 15,800
| 3.174699
| 0.058851
| 0.125675
| 0.170778
| 0.069333
| 0.958984
| 0.849949
| 0.086703
| 0.010072
| 0
| 0
| 0
| 0.212136
| 0.352278
| 15,800
| 329
| 56
| 48.024316
| 0.457299
| 0.005316
| 0
| 0
| 0
| 0
| 0.541333
| 0.496065
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
29033347d693005bd2285b5866c15746c662278c
| 9
|
py
|
Python
|
training/__init__.py
|
icon-lab/FedGIMP
|
c110c4c12d56bb8fa53546e22330797212e7b197
|
[
"MIT"
] | 45
|
2020-11-06T02:04:43.000Z
|
2022-01-12T02:59:26.000Z
|
training/__init__.py
|
icon-lab/FedGIMP
|
c110c4c12d56bb8fa53546e22330797212e7b197
|
[
"MIT"
] | 7
|
2022-03-13T15:13:18.000Z
|
2022-03-31T16:57:38.000Z
|
training/__init__.py
|
icon-lab/FedGIMP
|
c110c4c12d56bb8fa53546e22330797212e7b197
|
[
"MIT"
] | 8
|
2022-03-10T23:49:29.000Z
|
2022-03-31T18:20:17.000Z
|
# empty
| 3
| 7
| 0.555556
| 1
| 9
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 9
| 2
| 8
| 4.5
| 0.833333
| 0.555556
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
292d384bdb17eed8803e4448d3dc34fba10fc39d
| 1,154
|
py
|
Python
|
setup.py
|
velvetropes/cfn-lambda-handler
|
0797288fc1d03178bfbeb78b500f3112ff6d8317
|
[
"ISC"
] | null | null | null |
setup.py
|
velvetropes/cfn-lambda-handler
|
0797288fc1d03178bfbeb78b500f3112ff6d8317
|
[
"ISC"
] | null | null | null |
setup.py
|
velvetropes/cfn-lambda-handler
|
0797288fc1d03178bfbeb78b500f3112ff6d8317
|
[
"ISC"
] | null | null | null |
#!/usr/bin/env python
# coding: utf-8
from setuptools import setup
setup(
name='cfn_lambda_handler',
version='1.4.0',
packages=[ 'cfn_lambda_handler' ],
install_requires=[ 'requests' ],
provides=[ 'cfn_lambda_handler' ],
author='Justin Menga',
author_email='justin.menga@gmail.com',
url='https://github.com/mixja/cfn-lambda-handler',
description='This package provides a decorator for Python Lambda functions handling AWS CloudFormation custom resources.',
keywords='lambda aws cloudformation',
license='ISC',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: ISC License (ISCL)',
],
)
| 36.0625
| 126
| 0.627383
| 124
| 1,154
| 5.774194
| 0.524194
| 0.238827
| 0.314246
| 0.181564
| 0.075419
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021372
| 0.229636
| 1,154
| 32
| 127
| 36.0625
| 0.784027
| 0.029463
| 0
| 0
| 0
| 0
| 0.631814
| 0.01966
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.035714
| 0
| 0.035714
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
293b22e09927f73898f705a7c7b272b3e65fbff3
| 182
|
py
|
Python
|
functions/anti_curse.py
|
SpikeVN/tro-li
|
9746846af2de4973d555e154427e902bc65f8c23
|
[
"MIT"
] | 2
|
2022-03-30T05:57:23.000Z
|
2022-03-30T05:57:25.000Z
|
functions/anti_curse.py
|
SpikeVN/tro-li
|
9746846af2de4973d555e154427e902bc65f8c23
|
[
"MIT"
] | null | null | null |
functions/anti_curse.py
|
SpikeVN/tro-li
|
9746846af2de4973d555e154427e902bc65f8c23
|
[
"MIT"
] | 1
|
2022-03-30T05:57:45.000Z
|
2022-03-30T05:57:45.000Z
|
# Có vẻ có vài ông thích lách luật để chửi bậy trong server.
# Với trí thông minh nhân tạo, chúc may mắn.
'''Tubication:
Ừ
Nhưng nếu nó cũng dùng trí thông minh nhân tạo thì sao
'''
| 26
| 60
| 0.71978
| 36
| 182
| 3.638889
| 0.833333
| 0.122137
| 0.183206
| 0.244275
| 0.290076
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.214286
| 182
| 6
| 61
| 30.333333
| 0.916084
| 0.93956
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 0
| 1
| 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
| 5
|
2953ad5114e0af2cbf85beaa0db5a73305a67266
| 79
|
py
|
Python
|
or_testbed/solvers/simanneal/__init__.py
|
Fynardo/or-testbed
|
9cc58edd71f400da7a933f166cd325e43562cfb6
|
[
"MIT"
] | 1
|
2020-07-23T14:59:03.000Z
|
2020-07-23T14:59:03.000Z
|
or_testbed/solvers/simanneal/__init__.py
|
Fynardo/or-testbed
|
9cc58edd71f400da7a933f166cd325e43562cfb6
|
[
"MIT"
] | null | null | null |
or_testbed/solvers/simanneal/__init__.py
|
Fynardo/or-testbed
|
9cc58edd71f400da7a933f166cd325e43562cfb6
|
[
"MIT"
] | null | null | null |
from .simanneal import SimAnneal
from .multistart import MultiStartSimAnneal
| 26.333333
| 44
| 0.848101
| 8
| 79
| 8.375
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126582
| 79
| 2
| 45
| 39.5
| 0.971014
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4620a3a6e5529b3e1846fcdab0f0efd72b05b36e
| 190
|
py
|
Python
|
NodeDefender/mqtt/command/icpe/zwave/node.py
|
CTSNE/NodeDefender
|
24e19f53a27d3b53e599cba8b1448f8f16c0bd5e
|
[
"MIT"
] | 4
|
2016-09-23T17:51:05.000Z
|
2017-03-14T02:52:26.000Z
|
NodeDefender/mqtt/command/icpe/zwave/node.py
|
CTSNE/NodeDefender
|
24e19f53a27d3b53e599cba8b1448f8f16c0bd5e
|
[
"MIT"
] | 1
|
2016-09-22T11:32:33.000Z
|
2017-11-14T10:00:24.000Z
|
NodeDefender/mqtt/command/icpe/zwave/node.py
|
CTSNE/NodeDefender
|
24e19f53a27d3b53e599cba8b1448f8f16c0bd5e
|
[
"MIT"
] | 4
|
2016-10-09T19:05:16.000Z
|
2020-05-14T04:00:30.000Z
|
from NodeDefender.mqtt.command import fire, topic_format
def list(mac_address):
topic = topic_format.format(mac_address, "0", "node", "list")
return fire(topic, icpe = mac_address)
| 31.666667
| 65
| 0.736842
| 27
| 190
| 5
| 0.592593
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006135
| 0.142105
| 190
| 5
| 66
| 38
| 0.822086
| 0
| 0
| 0
| 0
| 0
| 0.047368
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
462ea4579856269edd92e0e6a0e2d99be067263b
| 46
|
py
|
Python
|
api/providers/reporting/mocks/reporting_provider.py
|
djzelenak/espa-api
|
ebf347a4dd58008e3e9c368cf6086925e3bf12b7
|
[
"Unlicense"
] | null | null | null |
api/providers/reporting/mocks/reporting_provider.py
|
djzelenak/espa-api
|
ebf347a4dd58008e3e9c368cf6086925e3bf12b7
|
[
"Unlicense"
] | null | null | null |
api/providers/reporting/mocks/reporting_provider.py
|
djzelenak/espa-api
|
ebf347a4dd58008e3e9c368cf6086925e3bf12b7
|
[
"Unlicense"
] | null | null | null |
class MockReportingProvider(object):
pass
| 15.333333
| 36
| 0.782609
| 4
| 46
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152174
| 46
| 2
| 37
| 23
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
4643c3e9a5ded435cfa726d6a04df9bcb11491f8
| 137
|
py
|
Python
|
usmui/redfish/test.py
|
emahear/openusm
|
96bb62b91f4b5520e14d86ae86e1b320404134e6
|
[
"MIT"
] | 4
|
2019-08-04T05:50:46.000Z
|
2020-04-16T19:24:11.000Z
|
usmui/redfish/test.py
|
emahear/openusm
|
96bb62b91f4b5520e14d86ae86e1b320404134e6
|
[
"MIT"
] | null | null | null |
usmui/redfish/test.py
|
emahear/openusm
|
96bb62b91f4b5520e14d86ae86e1b320404134e6
|
[
"MIT"
] | 6
|
2019-08-03T12:57:47.000Z
|
2020-06-08T01:50:43.000Z
|
'''
Created on Jun 22, 2017
@author: Avinash_Bendigeri
'''
import operations
from redfish.operations import generateXML
generateXML()
| 12.454545
| 42
| 0.773723
| 16
| 137
| 6.5625
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.050847
| 0.138686
| 137
| 11
| 43
| 12.454545
| 0.838983
| 0.372263
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
46a41eaaa5be8ee18ad567a118a02a5b23bbf476
| 76
|
py
|
Python
|
paginator/__init__.py
|
SergSm/ptb-menu-pagination
|
8fa605ac38aa62d4a81e06660cebe5db8ad0bef2
|
[
"MIT"
] | 11
|
2021-12-10T06:50:28.000Z
|
2022-02-13T16:17:49.000Z
|
paginator/__init__.py
|
SergSm/ptb-menu-pagination
|
8fa605ac38aa62d4a81e06660cebe5db8ad0bef2
|
[
"MIT"
] | null | null | null |
paginator/__init__.py
|
SergSm/ptb-menu-pagination
|
8fa605ac38aa62d4a81e06660cebe5db8ad0bef2
|
[
"MIT"
] | null | null | null |
from paginator.main import get_menu # noqa
__all__ = ('get_menu') # noqa
| 19
| 43
| 0.710526
| 11
| 76
| 4.363636
| 0.727273
| 0.291667
| 0.458333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184211
| 76
| 3
| 44
| 25.333333
| 0.774194
| 0.118421
| 0
| 0
| 0
| 0
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d3bf330deeb108e9ee7f37c5f5677c0e1f6623f7
| 19
|
py
|
Python
|
common/__init__.py
|
PriateXYF/HabiCat-Backend
|
46f80f2630ac54249dfb635e114d7f92f88da62a
|
[
"MIT"
] | 1
|
2021-12-23T11:49:58.000Z
|
2021-12-23T11:49:58.000Z
|
common/__init__.py
|
PriateXYF/HabiCat-Backend
|
46f80f2630ac54249dfb635e114d7f92f88da62a
|
[
"MIT"
] | null | null | null |
common/__init__.py
|
PriateXYF/HabiCat-Backend
|
46f80f2630ac54249dfb635e114d7f92f88da62a
|
[
"MIT"
] | null | null | null |
from .tool import *
| 19
| 19
| 0.736842
| 3
| 19
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 19
| 1
| 19
| 19
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d3c8101d83a6cff3cb3ee7a577cccbe67cc1b67f
| 126
|
py
|
Python
|
elderwords/t2.py
|
bipt-urt/wechat_spider_3
|
9521d6042f23813b487913f1f8acf85e80439404
|
[
"Apache-2.0"
] | null | null | null |
elderwords/t2.py
|
bipt-urt/wechat_spider_3
|
9521d6042f23813b487913f1f8acf85e80439404
|
[
"Apache-2.0"
] | null | null | null |
elderwords/t2.py
|
bipt-urt/wechat_spider_3
|
9521d6042f23813b487913f1f8acf85e80439404
|
[
"Apache-2.0"
] | null | null | null |
# test 0
# for testing QRcode generation fuctionality
import qrGena
import uuidGet
import time
print(int(time.time()))
| 18
| 45
| 0.746032
| 17
| 126
| 5.529412
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009709
| 0.18254
| 126
| 6
| 46
| 21
| 0.902913
| 0.396825
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0.25
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
311862962f292b260b49413c71bfcee5979eed16
| 154
|
py
|
Python
|
apps/playexo/exception.py
|
PremierLangage/premierlangage
|
7134a2aadffee2bf264abee6c4b23ea33f1b390b
|
[
"CECILL-B"
] | 8
|
2019-01-30T13:51:59.000Z
|
2022-01-08T03:26:53.000Z
|
apps/playexo/exception.py
|
PremierLangage/premierlangage
|
7134a2aadffee2bf264abee6c4b23ea33f1b390b
|
[
"CECILL-B"
] | 286
|
2019-01-18T21:35:51.000Z
|
2022-03-24T18:53:59.000Z
|
apps/playexo/exception.py
|
PremierLangage/premierlangage
|
7134a2aadffee2bf264abee6c4b23ea33f1b390b
|
[
"CECILL-B"
] | 4
|
2019-02-11T13:38:30.000Z
|
2021-03-02T20:59:00.000Z
|
# coding: UTF-8
class SandboxUnavailable(Exception):
pass
class SandboxError(Exception):
pass
class BuildScriptError(Exception):
pass
| 9.625
| 36
| 0.714286
| 15
| 154
| 7.333333
| 0.6
| 0.354545
| 0.327273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008197
| 0.207792
| 154
| 15
| 37
| 10.266667
| 0.893443
| 0.084416
| 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 | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
3146cd21c8a670a38f1246cb45342db9331b5574
| 330
|
py
|
Python
|
Miner/__init__.py
|
AshwiniJogbhat/DependencyMiner
|
cb897db13344350261339cea1072a77551607dd5
|
[
"MIT"
] | null | null | null |
Miner/__init__.py
|
AshwiniJogbhat/DependencyMiner
|
cb897db13344350261339cea1072a77551607dd5
|
[
"MIT"
] | null | null | null |
Miner/__init__.py
|
AshwiniJogbhat/DependencyMiner
|
cb897db13344350261339cea1072a77551607dd5
|
[
"MIT"
] | null | null | null |
# import pandas as pd
# import os
# import pathlib
# from pm4py.objects.log.importer.xes import importer as xes_importer
# from pm4py.objects.process_tree import pt_operator as pt_op
# from pm4py.objects.process_tree import util
# from pm4py.objects.petri.petrinet import PetriNet, Marking
# from pm4py.objects.petri import utils
| 36.666667
| 69
| 0.809091
| 51
| 330
| 5.137255
| 0.431373
| 0.171756
| 0.305344
| 0.175573
| 0.251908
| 0.251908
| 0
| 0
| 0
| 0
| 0
| 0.017301
| 0.124242
| 330
| 9
| 70
| 36.666667
| 0.889273
| 0.948485
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 0
| 1
| 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
| 5
|
319328bef7ffeccf40f6eb3f2799867e3c048918
| 268
|
py
|
Python
|
nz_django/day6/form_demo2/front/models.py
|
gaohj/nzflask_bbs
|
36a94c380b78241ed5d1e07edab9618c3e8d477b
|
[
"Apache-2.0"
] | null | null | null |
nz_django/day6/form_demo2/front/models.py
|
gaohj/nzflask_bbs
|
36a94c380b78241ed5d1e07edab9618c3e8d477b
|
[
"Apache-2.0"
] | 27
|
2020-02-12T07:55:58.000Z
|
2022-03-12T00:19:09.000Z
|
nz_django/day6/form_demo2/front/models.py
|
gaohj/nzflask_bbs
|
36a94c380b78241ed5d1e07edab9618c3e8d477b
|
[
"Apache-2.0"
] | 2
|
2020-02-18T01:54:55.000Z
|
2020-02-21T11:36:28.000Z
|
from django.db import models
class User(models.Model):
username = models.CharField(max_length=100)
password = models.CharField(max_length=100)
telephone = models.CharField(max_length=11)
create_time = models.DateTimeField(auto_now_add=True,null=True)
| 33.5
| 67
| 0.768657
| 37
| 268
| 5.405405
| 0.648649
| 0.225
| 0.27
| 0.36
| 0.27
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034335
| 0.130597
| 268
| 7
| 68
| 38.285714
| 0.824034
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.166667
| 0.166667
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
31a55d412c246b781deef76e65b63011de3cd4f7
| 23,505
|
py
|
Python
|
neutron/tests/unit/services/vpn/test_vpnaas_extension.py
|
ksshanam/neutron-dvr
|
c0854ea0d1023ab42e1ef861f9b6ff480e985ac5
|
[
"Apache-2.0"
] | 3
|
2015-02-02T02:51:39.000Z
|
2015-02-23T10:20:23.000Z
|
neutron/tests/unit/services/vpn/test_vpnaas_extension.py
|
ksshanam/neutron-dvr
|
c0854ea0d1023ab42e1ef861f9b6ff480e985ac5
|
[
"Apache-2.0"
] | 4
|
2015-02-23T10:21:11.000Z
|
2015-03-04T09:28:20.000Z
|
neutron/tests/unit/services/vpn/test_vpnaas_extension.py
|
ksshanam/neutron-dvr
|
c0854ea0d1023ab42e1ef861f9b6ff480e985ac5
|
[
"Apache-2.0"
] | null | null | null |
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# @author: Swaminathan Vasudevan, Hewlett-Packard.
import copy
import mock
from webob import exc
from neutron.extensions import vpnaas
from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants
from neutron.tests.unit import test_api_v2
from neutron.tests.unit import test_api_v2_extension
_uuid = uuidutils.generate_uuid
_get_path = test_api_v2._get_path
class VpnaasExtensionTestCase(test_api_v2_extension.ExtensionTestCase):
fmt = 'json'
def setUp(self):
super(VpnaasExtensionTestCase, self).setUp()
plural_mappings = {'ipsecpolicy': 'ipsecpolicies',
'ikepolicy': 'ikepolicies',
'ipsec_site_connection': 'ipsec-site-connections'}
self._setUpExtension(
'neutron.extensions.vpnaas.VPNPluginBase', constants.VPN,
vpnaas.RESOURCE_ATTRIBUTE_MAP, vpnaas.Vpnaas,
'vpn', plural_mappings=plural_mappings,
use_quota=True)
def test_ikepolicy_create(self):
"""Test case to create an ikepolicy."""
ikepolicy_id = _uuid()
data = {'ikepolicy': {'name': 'ikepolicy1',
'description': 'myikepolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'phase1_negotiation_mode': 'main',
'lifetime': {
'units': 'seconds',
'value': 3600},
'ike_version': 'v1',
'pfs': 'group5',
'tenant_id': _uuid()}}
return_value = copy.copy(data['ikepolicy'])
return_value.update({'id': ikepolicy_id})
instance = self.plugin.return_value
instance.create_ikepolicy.return_value = return_value
res = self.api.post(_get_path('vpn/ikepolicies', fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_ikepolicy.assert_called_with(mock.ANY,
ikepolicy=data)
self.assertEqual(res.status_int, exc.HTTPCreated.code)
res = self.deserialize(res)
self.assertIn('ikepolicy', res)
self.assertEqual(res['ikepolicy'], return_value)
def test_ikepolicy_list(self):
"""Test case to list all ikepolicies."""
ikepolicy_id = _uuid()
return_value = [{'name': 'ikepolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'pfs': 'group5',
'ike_version': 'v1',
'id': ikepolicy_id}]
instance = self.plugin.return_value
instance.get_ikepolicies.return_value = return_value
res = self.api.get(_get_path('vpn/ikepolicies', fmt=self.fmt))
instance.get_ikepolicies.assert_called_with(mock.ANY,
fields=mock.ANY,
filters=mock.ANY)
self.assertEqual(res.status_int, exc.HTTPOk.code)
def test_ikepolicy_update(self):
"""Test case to update an ikepolicy."""
ikepolicy_id = _uuid()
update_data = {'ikepolicy': {'name': 'ikepolicy1',
'encryption_algorithm': 'aes-256'}}
return_value = {'name': 'ikepolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-256',
'phase1_negotiation_mode': 'main',
'lifetime': {
'units': 'seconds',
'value': 3600},
'ike_version': 'v1',
'pfs': 'group5',
'tenant_id': _uuid(),
'id': ikepolicy_id}
instance = self.plugin.return_value
instance.update_ikepolicy.return_value = return_value
res = self.api.put(_get_path('vpn/ikepolicies', id=ikepolicy_id,
fmt=self.fmt),
self.serialize(update_data))
instance.update_ikepolicy.assert_called_with(mock.ANY, ikepolicy_id,
ikepolicy=update_data)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('ikepolicy', res)
self.assertEqual(res['ikepolicy'], return_value)
def test_ikepolicy_get(self):
"""Test case to get or show an ikepolicy."""
ikepolicy_id = _uuid()
return_value = {'name': 'ikepolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'phase1_negotiation_mode': 'main',
'lifetime': {
'units': 'seconds',
'value': 3600},
'ike_version': 'v1',
'pfs': 'group5',
'tenant_id': _uuid(),
'id': ikepolicy_id}
instance = self.plugin.return_value
instance.get_ikepolicy.return_value = return_value
res = self.api.get(_get_path('vpn/ikepolicies', id=ikepolicy_id,
fmt=self.fmt))
instance.get_ikepolicy.assert_called_with(mock.ANY,
ikepolicy_id,
fields=mock.ANY)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('ikepolicy', res)
self.assertEqual(res['ikepolicy'], return_value)
def test_ikepolicy_delete(self):
"""Test case to delete an ikepolicy."""
self._test_entity_delete('ikepolicy')
def test_ipsecpolicy_create(self):
"""Test case to create an ipsecpolicy."""
ipsecpolicy_id = _uuid()
data = {'ipsecpolicy': {'name': 'ipsecpolicy1',
'description': 'myipsecpolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'encapsulation_mode': 'tunnel',
'lifetime': {
'units': 'seconds',
'value': 3600},
'transform_protocol': 'esp',
'pfs': 'group5',
'tenant_id': _uuid()}}
return_value = copy.copy(data['ipsecpolicy'])
return_value.update({'id': ipsecpolicy_id})
instance = self.plugin.return_value
instance.create_ipsecpolicy.return_value = return_value
res = self.api.post(_get_path('vpn/ipsecpolicies', fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_ipsecpolicy.assert_called_with(mock.ANY,
ipsecpolicy=data)
self.assertEqual(res.status_int, exc.HTTPCreated.code)
res = self.deserialize(res)
self.assertIn('ipsecpolicy', res)
self.assertEqual(res['ipsecpolicy'], return_value)
def test_ipsecpolicy_list(self):
"""Test case to list an ipsecpolicy."""
ipsecpolicy_id = _uuid()
return_value = [{'name': 'ipsecpolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'pfs': 'group5',
'id': ipsecpolicy_id}]
instance = self.plugin.return_value
instance.get_ipsecpolicies.return_value = return_value
res = self.api.get(_get_path('vpn/ipsecpolicies', fmt=self.fmt))
instance.get_ipsecpolicies.assert_called_with(mock.ANY,
fields=mock.ANY,
filters=mock.ANY)
self.assertEqual(res.status_int, exc.HTTPOk.code)
def test_ipsecpolicy_update(self):
"""Test case to update an ipsecpolicy."""
ipsecpolicy_id = _uuid()
update_data = {'ipsecpolicy': {'name': 'ipsecpolicy1',
'encryption_algorithm': 'aes-256'}}
return_value = {'name': 'ipsecpolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'encapsulation_mode': 'tunnel',
'lifetime': {
'units': 'seconds',
'value': 3600},
'transform_protocol': 'esp',
'pfs': 'group5',
'tenant_id': _uuid(),
'id': ipsecpolicy_id}
instance = self.plugin.return_value
instance.update_ipsecpolicy.return_value = return_value
res = self.api.put(_get_path('vpn/ipsecpolicies',
id=ipsecpolicy_id,
fmt=self.fmt),
self.serialize(update_data))
instance.update_ipsecpolicy.assert_called_with(mock.ANY,
ipsecpolicy_id,
ipsecpolicy=update_data)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('ipsecpolicy', res)
self.assertEqual(res['ipsecpolicy'], return_value)
def test_ipsecpolicy_get(self):
"""Test case to get or show an ipsecpolicy."""
ipsecpolicy_id = _uuid()
return_value = {'name': 'ipsecpolicy1',
'auth_algorithm': 'sha1',
'encryption_algorithm': 'aes-128',
'encapsulation_mode': 'tunnel',
'lifetime': {
'units': 'seconds',
'value': 3600},
'transform_protocol': 'esp',
'pfs': 'group5',
'tenant_id': _uuid(),
'id': ipsecpolicy_id}
instance = self.plugin.return_value
instance.get_ipsecpolicy.return_value = return_value
res = self.api.get(_get_path('vpn/ipsecpolicies',
id=ipsecpolicy_id,
fmt=self.fmt))
instance.get_ipsecpolicy.assert_called_with(mock.ANY,
ipsecpolicy_id,
fields=mock.ANY)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('ipsecpolicy', res)
self.assertEqual(res['ipsecpolicy'], return_value)
def test_ipsecpolicy_delete(self):
"""Test case to delete an ipsecpolicy."""
self._test_entity_delete('ipsecpolicy')
def test_vpnservice_create(self):
"""Test case to create a vpnservice."""
vpnservice_id = _uuid()
data = {'vpnservice': {'name': 'vpnservice1',
'description': 'descr_vpn1',
'subnet_id': _uuid(),
'router_id': _uuid(),
'admin_state_up': True,
'tenant_id': _uuid()}}
return_value = copy.copy(data['vpnservice'])
return_value.update({'status': "ACTIVE", 'id': vpnservice_id})
instance = self.plugin.return_value
instance.create_vpnservice.return_value = return_value
res = self.api.post(_get_path('vpn/vpnservices', fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_vpnservice.assert_called_with(mock.ANY,
vpnservice=data)
self.assertEqual(res.status_int, exc.HTTPCreated.code)
res = self.deserialize(res)
self.assertIn('vpnservice', res)
self.assertEqual(res['vpnservice'], return_value)
def test_vpnservice_list(self):
"""Test case to list all vpnservices."""
vpnservice_id = _uuid()
return_value = [{'name': 'vpnservice1',
'tenant_id': _uuid(),
'status': 'ACTIVE',
'id': vpnservice_id}]
instance = self.plugin.return_value
instance.get_vpnservice.return_value = return_value
res = self.api.get(_get_path('vpn/vpnservices', fmt=self.fmt))
instance.get_vpnservices.assert_called_with(mock.ANY,
fields=mock.ANY,
filters=mock.ANY)
self.assertEqual(res.status_int, exc.HTTPOk.code)
def test_vpnservice_update(self):
"""Test case to update a vpnservice."""
vpnservice_id = _uuid()
update_data = {'vpnservice': {'admin_state_up': False}}
return_value = {'name': 'vpnservice1',
'admin_state_up': False,
'subnet_id': _uuid(),
'router_id': _uuid(),
'tenant_id': _uuid(),
'status': "ACTIVE",
'id': vpnservice_id}
instance = self.plugin.return_value
instance.update_vpnservice.return_value = return_value
res = self.api.put(_get_path('vpn/vpnservices',
id=vpnservice_id,
fmt=self.fmt),
self.serialize(update_data))
instance.update_vpnservice.assert_called_with(mock.ANY,
vpnservice_id,
vpnservice=update_data)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('vpnservice', res)
self.assertEqual(res['vpnservice'], return_value)
def test_vpnservice_get(self):
"""Test case to get or show a vpnservice."""
vpnservice_id = _uuid()
return_value = {'name': 'vpnservice1',
'admin_state_up': True,
'subnet_id': _uuid(),
'router_id': _uuid(),
'tenant_id': _uuid(),
'status': "ACTIVE",
'id': vpnservice_id}
instance = self.plugin.return_value
instance.get_vpnservice.return_value = return_value
res = self.api.get(_get_path('vpn/vpnservices',
id=vpnservice_id,
fmt=self.fmt))
instance.get_vpnservice.assert_called_with(mock.ANY,
vpnservice_id,
fields=mock.ANY)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('vpnservice', res)
self.assertEqual(res['vpnservice'], return_value)
def test_vpnservice_delete(self):
"""Test case to delete a vpnservice."""
self._test_entity_delete('vpnservice')
def test_ipsec_site_connection_create(self):
"""Test case to create a ipsec_site_connection."""
ipsecsite_con_id = _uuid()
ikepolicy_id = _uuid()
ipsecpolicy_id = _uuid()
data = {
'ipsec_site_connection': {'name': 'connection1',
'description': 'Remote-connection1',
'peer_address': '192.168.1.10',
'peer_id': '192.168.1.10',
'peer_cidrs': ['192.168.2.0/24',
'192.168.3.0/24'],
'mtu': 1500,
'psk': 'abcd',
'initiator': 'bi-directional',
'dpd': {
'action': 'hold',
'interval': 30,
'timeout': 120},
'ikepolicy_id': ikepolicy_id,
'ipsecpolicy_id': ipsecpolicy_id,
'vpnservice_id': _uuid(),
'admin_state_up': True,
'tenant_id': _uuid()}
}
return_value = copy.copy(data['ipsec_site_connection'])
return_value.update({'status': "ACTIVE", 'id': ipsecsite_con_id})
instance = self.plugin.return_value
instance.create_ipsec_site_connection.return_value = return_value
res = self.api.post(_get_path('vpn/ipsec-site-connections',
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_ipsec_site_connection.assert_called_with(
mock.ANY, ipsec_site_connection=data
)
self.assertEqual(res.status_int, exc.HTTPCreated.code)
res = self.deserialize(res)
self.assertIn('ipsec_site_connection', res)
self.assertEqual(res['ipsec_site_connection'], return_value)
def test_ipsec_site_connection_list(self):
"""Test case to list all ipsec_site_connections."""
ipsecsite_con_id = _uuid()
return_value = [{'name': 'connection1',
'peer_address': '192.168.1.10',
'peer_cidrs': ['192.168.2.0/24', '192.168.3.0/24'],
'route_mode': 'static',
'auth_mode': 'psk',
'tenant_id': _uuid(),
'status': 'ACTIVE',
'id': ipsecsite_con_id}]
instance = self.plugin.return_value
instance.get_ipsec_site_connections.return_value = return_value
res = self.api.get(
_get_path('vpn/ipsec-site-connections', fmt=self.fmt))
instance.get_ipsec_site_connections.assert_called_with(
mock.ANY, fields=mock.ANY, filters=mock.ANY
)
self.assertEqual(res.status_int, exc.HTTPOk.code)
def test_ipsec_site_connection_update(self):
"""Test case to update a ipsec_site_connection."""
ipsecsite_con_id = _uuid()
update_data = {'ipsec_site_connection': {'admin_state_up': False}}
return_value = {'name': 'connection1',
'description': 'Remote-connection1',
'peer_address': '192.168.1.10',
'peer_id': '192.168.1.10',
'peer_cidrs': ['192.168.2.0/24', '192.168.3.0/24'],
'mtu': 1500,
'psk': 'abcd',
'initiator': 'bi-directional',
'dpd': {
'action': 'hold',
'interval': 30,
'timeout': 120},
'ikepolicy_id': _uuid(),
'ipsecpolicy_id': _uuid(),
'vpnservice_id': _uuid(),
'admin_state_up': False,
'tenant_id': _uuid(),
'status': 'ACTIVE',
'id': ipsecsite_con_id}
instance = self.plugin.return_value
instance.update_ipsec_site_connection.return_value = return_value
res = self.api.put(_get_path('vpn/ipsec-site-connections',
id=ipsecsite_con_id,
fmt=self.fmt),
self.serialize(update_data))
instance.update_ipsec_site_connection.assert_called_with(
mock.ANY, ipsecsite_con_id, ipsec_site_connection=update_data
)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('ipsec_site_connection', res)
self.assertEqual(res['ipsec_site_connection'], return_value)
def test_ipsec_site_connection_get(self):
"""Test case to get or show a ipsec_site_connection."""
ipsecsite_con_id = _uuid()
return_value = {'name': 'connection1',
'description': 'Remote-connection1',
'peer_address': '192.168.1.10',
'peer_id': '192.168.1.10',
'peer_cidrs': ['192.168.2.0/24',
'192.168.3.0/24'],
'mtu': 1500,
'psk': 'abcd',
'initiator': 'bi-directional',
'dpd': {
'action': 'hold',
'interval': 30,
'timeout': 120},
'ikepolicy_id': _uuid(),
'ipsecpolicy_id': _uuid(),
'vpnservice_id': _uuid(),
'admin_state_up': True,
'tenant_id': _uuid(),
'status': 'ACTIVE',
'id': ipsecsite_con_id}
instance = self.plugin.return_value
instance.get_ipsec_site_connection.return_value = return_value
res = self.api.get(_get_path('vpn/ipsec-site-connections',
id=ipsecsite_con_id,
fmt=self.fmt))
instance.get_ipsec_site_connection.assert_called_with(
mock.ANY, ipsecsite_con_id, fields=mock.ANY
)
self.assertEqual(res.status_int, exc.HTTPOk.code)
res = self.deserialize(res)
self.assertIn('ipsec_site_connection', res)
self.assertEqual(res['ipsec_site_connection'], return_value)
def test_ipsec_site_connection_delete(self):
"""Test case to delete a ipsec_site_connection."""
self._test_entity_delete('ipsec_site_connection')
class VpnaasExtensionTestCaseXML(VpnaasExtensionTestCase):
fmt = 'xml'
| 44.432892
| 79
| 0.501383
| 2,140
| 23,505
| 5.251402
| 0.107944
| 0.078306
| 0.047339
| 0.024915
| 0.819096
| 0.792935
| 0.780566
| 0.705286
| 0.645489
| 0.622531
| 0
| 0.019875
| 0.394214
| 23,505
| 528
| 80
| 44.517045
| 0.769366
| 0.061817
| 0
| 0.654762
| 0
| 0
| 0.153948
| 0.021198
| 0
| 0
| 0
| 0
| 0.133333
| 1
| 0.05
| false
| 0
| 0.019048
| 0
| 0.078571
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
31a92f1176ab8436fc3fb1b3662faa8033f32520
| 95
|
py
|
Python
|
microlibs/libA/allLibsNamespace/libAsrc/__init__.py
|
piqueen314/pythonNamespaceExample
|
cd6cd47a1ae1d4343d1f58c454afbdf7a08dbeca
|
[
"MIT"
] | null | null | null |
microlibs/libA/allLibsNamespace/libAsrc/__init__.py
|
piqueen314/pythonNamespaceExample
|
cd6cd47a1ae1d4343d1f58c454afbdf7a08dbeca
|
[
"MIT"
] | null | null | null |
microlibs/libA/allLibsNamespace/libAsrc/__init__.py
|
piqueen314/pythonNamespaceExample
|
cd6cd47a1ae1d4343d1f58c454afbdf7a08dbeca
|
[
"MIT"
] | null | null | null |
from .libAsrc import print_package_name
__import__('pkg_resources').declare_namespace(__name__)
| 47.5
| 55
| 0.873684
| 12
| 95
| 5.916667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042105
| 95
| 2
| 55
| 47.5
| 0.78022
| 0
| 0
| 0
| 0
| 0
| 0.135417
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 1
|
0
| 5
|
31b55a5b66cad0a779b40f9bcd3be164df5ece47
| 156
|
py
|
Python
|
mayan/apps/mailer/managers.py
|
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
|
0e4e919fd2e1ded6711354a0330135283e87f8c7
|
[
"Apache-2.0"
] | 2
|
2021-09-12T19:41:19.000Z
|
2021-09-12T19:41:20.000Z
|
mayan/apps/mailer/managers.py
|
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
|
0e4e919fd2e1ded6711354a0330135283e87f8c7
|
[
"Apache-2.0"
] | 37
|
2021-09-13T01:00:12.000Z
|
2021-10-02T03:54:30.000Z
|
mayan/apps/mailer/managers.py
|
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
|
0e4e919fd2e1ded6711354a0330135283e87f8c7
|
[
"Apache-2.0"
] | 1
|
2021-09-22T13:17:30.000Z
|
2021-09-22T13:17:30.000Z
|
from django.db import models
class UserMailerManager(models.Manager):
def get_by_natural_key(self, label):
return self.get(label=label)
| 22.285714
| 41
| 0.717949
| 21
| 156
| 5.190476
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.198718
| 156
| 6
| 42
| 26
| 0.872
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
31dbc4a1fd95edf46522af6a83727965257dca6f
| 15,973
|
py
|
Python
|
tests/asp/AllAnswerSets/tight/graph.colouring.3.30.5_0.asp.test.py
|
bernardocuteri/wasp
|
05c8f961776dbdbf7afbf905ee00fc262eba51ad
|
[
"Apache-2.0"
] | 19
|
2015-12-03T08:53:45.000Z
|
2022-03-31T02:09:43.000Z
|
tests/asp/AllAnswerSets/tight/graph.colouring.3.30.5_0.asp.test.py
|
bernardocuteri/wasp
|
05c8f961776dbdbf7afbf905ee00fc262eba51ad
|
[
"Apache-2.0"
] | 80
|
2017-11-25T07:57:32.000Z
|
2018-06-10T19:03:30.000Z
|
tests/asp/AllAnswerSets/tight/graph.colouring.3.30.5_0.asp.test.py
|
bernardocuteri/wasp
|
05c8f961776dbdbf7afbf905ee00fc262eba51ad
|
[
"Apache-2.0"
] | 6
|
2015-01-15T07:51:48.000Z
|
2020-06-18T14:47:48.000Z
|
input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1 37 0 0
1 38 0 0
1 39 0 0
1 40 0 0
1 41 0 0
1 42 0 0
1 43 0 0
1 44 0 0
1 45 0 0
1 46 0 0
1 47 0 0
1 48 0 0
1 49 0 0
1 50 0 0
1 51 0 0
1 52 0 0
1 53 0 0
1 54 0 0
1 55 0 0
1 56 0 0
1 57 0 0
1 58 0 0
1 59 0 0
1 60 0 0
1 61 0 0
1 62 0 0
1 63 0 0
1 64 0 0
1 65 0 0
1 66 0 0
1 67 0 0
1 68 0 0
1 69 0 0
1 70 0 0
1 71 0 0
1 72 0 0
1 73 0 0
1 74 0 0
1 75 0 0
1 76 0 0
1 77 0 0
1 78 0 0
1 79 0 0
1 80 0 0
1 81 0 0
1 82 0 0
1 83 0 0
1 84 0 0
1 85 0 0
1 86 0 0
1 87 0 0
1 88 0 0
1 89 0 0
1 90 0 0
1 91 0 0
1 92 0 0
1 93 0 0
1 94 0 0
1 95 0 0
1 96 0 0
1 97 0 0
1 98 0 0
1 99 0 0
1 100 0 0
1 101 0 0
1 102 0 0
1 103 0 0
1 104 0 0
1 105 0 0
1 106 0 0
1 107 0 0
1 108 0 0
1 109 0 0
1 110 0 0
1 111 0 0
1 112 0 0
1 113 0 0
1 114 0 0
1 115 0 0
1 116 0 0
1 117 0 0
1 118 0 0
1 119 0 0
1 120 0 0
1 121 0 0
1 122 0 0
1 123 0 0
1 124 0 0
1 125 0 0
1 126 0 0
1 127 0 0
1 128 0 0
1 129 0 0
1 130 0 0
1 131 0 0
1 132 0 0
1 133 0 0
1 134 0 0
1 135 0 0
1 136 0 0
1 137 0 0
1 138 0 0
1 139 0 0
1 140 0 0
1 141 0 0
1 142 0 0
1 143 0 0
1 144 0 0
1 145 0 0
1 146 0 0
1 147 0 0
1 148 0 0
1 149 0 0
1 150 0 0
1 151 0 0
1 152 0 0
1 153 0 0
1 154 0 0
1 155 0 0
1 156 0 0
1 157 0 0
1 158 0 0
1 159 0 0
1 160 0 0
1 161 0 0
1 162 0 0
1 163 0 0
1 164 0 0
1 165 0 0
1 166 0 0
1 167 0 0
1 168 0 0
1 169 0 0
1 170 0 0
1 171 0 0
1 172 0 0
1 173 0 0
1 174 0 0
1 175 0 0
1 176 0 0
1 177 0 0
1 178 0 0
1 179 0 0
1 180 0 0
1 181 0 0
1 182 0 0
1 183 0 0
1 184 0 0
1 185 0 0
1 186 0 0
1 187 0 0
1 188 0 0
1 189 0 0
1 190 0 0
1 191 0 0
1 192 0 0
1 193 0 0
1 194 0 0
1 195 0 0
1 196 0 0
1 197 0 0
1 198 0 0
1 199 0 0
1 200 0 0
1 201 0 0
1 202 0 0
1 203 0 0
1 204 0 0
1 205 2 1 206 207
1 206 2 1 205 207
1 207 0 0
1 208 2 1 209 210
1 209 2 1 208 210
1 210 0 0
1 211 2 1 212 213
1 212 2 1 211 213
1 213 0 0
1 214 2 1 215 216
1 215 2 1 214 216
1 216 0 0
1 217 2 1 218 219
1 218 2 1 217 219
1 219 0 0
1 220 2 1 221 222
1 221 2 1 220 222
1 222 0 0
1 223 2 1 224 225
1 224 2 1 223 225
1 225 0 0
1 226 2 1 227 228
1 227 2 1 226 228
1 228 0 0
1 229 2 1 230 231
1 230 2 1 229 231
1 231 0 0
1 232 2 1 233 234
1 233 2 1 232 234
1 234 0 0
1 235 2 1 236 237
1 236 2 1 235 237
1 237 0 0
1 238 2 1 239 240
1 239 2 1 238 240
1 240 0 0
1 241 2 1 242 243
1 242 2 1 241 243
1 243 0 0
1 244 2 1 245 246
1 245 2 1 244 246
1 246 0 0
1 247 2 1 248 249
1 248 2 1 247 249
1 249 0 0
1 250 2 1 251 252
1 251 2 1 250 252
1 252 0 0
1 253 2 1 254 255
1 254 2 1 253 255
1 255 0 0
1 256 2 1 257 258
1 257 2 1 256 258
1 258 0 0
1 259 2 1 260 261
1 260 2 1 259 261
1 261 0 0
1 262 2 1 263 264
1 263 2 1 262 264
1 264 0 0
1 265 2 1 266 267
1 266 2 1 265 267
1 267 0 0
1 268 2 1 269 270
1 269 2 1 268 270
1 270 0 0
1 271 2 1 272 273
1 272 2 1 271 273
1 273 0 0
1 274 2 1 275 276
1 275 2 1 274 276
1 276 0 0
1 277 2 1 278 279
1 278 2 1 277 279
1 279 0 0
1 280 2 1 281 282
1 281 2 1 280 282
1 282 0 0
1 283 2 1 284 285
1 284 2 1 283 285
1 285 0 0
1 286 2 1 287 288
1 287 2 1 286 288
1 288 0 0
1 289 2 1 290 291
1 290 2 1 289 291
1 291 0 0
1 292 2 1 293 294
1 293 2 1 292 294
1 294 0 0
1 295 2 1 296 297
1 296 2 1 295 297
1 297 0 0
1 298 2 1 299 300
1 299 2 1 298 300
1 300 0 0
1 301 2 1 302 303
1 302 2 1 301 303
1 303 0 0
1 304 2 1 305 306
1 305 2 1 304 306
1 306 0 0
1 307 2 1 308 309
1 308 2 1 307 309
1 309 0 0
1 310 2 1 311 312
1 311 2 1 310 312
1 312 0 0
1 313 2 1 314 315
1 314 2 1 313 315
1 315 0 0
1 316 2 1 317 318
1 317 2 1 316 318
1 318 0 0
1 319 2 1 320 321
1 320 2 1 319 321
1 321 0 0
1 322 2 1 323 324
1 323 2 1 322 324
1 324 0 0
1 325 2 1 326 327
1 326 2 1 325 327
1 327 0 0
1 328 2 1 329 330
1 329 2 1 328 330
1 330 0 0
1 331 2 1 332 333
1 332 2 1 331 333
1 333 0 0
1 334 2 1 335 336
1 335 2 1 334 336
1 336 0 0
1 337 2 1 338 339
1 338 2 1 337 339
1 339 0 0
1 340 2 1 341 342
1 341 2 1 340 342
1 342 0 0
1 343 2 1 344 345
1 344 2 1 343 345
1 345 0 0
1 346 2 1 347 348
1 347 2 1 346 348
1 348 0 0
1 349 2 1 350 351
1 350 2 1 349 351
1 351 0 0
1 352 2 1 353 354
1 353 2 1 352 354
1 354 0 0
1 355 2 1 356 357
1 356 2 1 355 357
1 357 0 0
1 358 2 1 359 360
1 359 2 1 358 360
1 360 0 0
1 361 2 1 362 363
1 362 2 1 361 363
1 363 0 0
1 364 2 1 365 366
1 365 2 1 364 366
1 366 0 0
1 367 2 1 368 369
1 368 2 1 367 369
1 369 0 0
1 370 2 1 371 372
1 371 2 1 370 372
1 372 0 0
1 373 2 1 374 375
1 374 2 1 373 375
1 375 0 0
1 376 2 1 377 378
1 377 2 1 376 378
1 378 0 0
1 379 2 1 380 381
1 380 2 1 379 381
1 381 0 0
1 382 2 1 383 384
1 383 2 1 382 384
1 384 0 0
1 385 2 1 386 387
1 386 2 1 385 387
1 387 0 0
1 388 2 1 389 390
1 389 2 1 388 390
1 390 0 0
1 391 2 1 392 393
1 392 2 1 391 393
1 393 0 0
1 394 2 1 395 396
1 395 2 1 394 396
1 396 0 0
1 397 2 1 398 399
1 398 2 1 397 399
1 399 0 0
1 400 2 1 401 402
1 401 2 1 400 402
1 402 0 0
1 403 2 1 404 405
1 404 2 1 403 405
1 405 0 0
1 406 2 1 407 408
1 407 2 1 406 408
1 408 0 0
1 409 2 1 410 411
1 410 2 1 409 411
1 411 0 0
1 412 2 1 413 414
1 413 2 1 412 414
1 414 0 0
1 415 2 1 416 417
1 416 2 1 415 417
1 417 0 0
1 418 2 1 419 420
1 419 2 1 418 420
1 420 0 0
1 421 2 1 422 423
1 422 2 1 421 423
1 423 0 0
1 424 2 1 425 426
1 425 2 1 424 426
1 426 0 0
1 427 2 1 428 429
1 428 2 1 427 429
1 429 0 0
1 430 2 1 431 432
1 431 2 1 430 432
1 432 0 0
1 433 2 1 434 435
1 434 2 1 433 435
1 435 0 0
1 436 2 1 437 438
1 437 2 1 436 438
1 438 0 0
1 439 2 1 440 441
1 440 2 1 439 441
1 441 0 0
1 442 2 1 443 444
1 443 2 1 442 444
1 444 0 0
1 445 2 1 446 447
1 446 2 1 445 447
1 447 0 0
1 448 2 1 449 450
1 449 2 1 448 450
1 450 0 0
1 451 2 1 452 453
1 452 2 1 451 453
1 453 0 0
1 454 2 1 455 456
1 455 2 1 454 456
1 456 0 0
1 457 2 1 458 459
1 458 2 1 457 459
1 459 0 0
1 460 2 1 461 462
1 461 2 1 460 462
1 462 0 0
1 463 2 1 464 465
1 464 2 1 463 465
1 465 0 0
1 466 2 1 467 468
1 467 2 1 466 468
1 468 0 0
1 469 2 1 470 471
1 470 2 1 469 471
1 471 0 0
1 472 2 1 473 474
1 473 2 1 472 474
1 474 0 0
1 475 1 0 472
1 476 1 0 469
1 477 1 0 466
1 478 1 0 463
1 479 1 0 460
1 480 1 0 457
1 481 1 0 454
1 482 1 0 451
1 483 1 0 448
1 484 1 0 445
1 485 1 0 442
1 486 1 0 439
1 487 1 0 436
1 488 1 0 433
1 489 1 0 430
1 490 1 0 427
1 491 1 0 424
1 492 1 0 421
1 493 1 0 418
1 494 1 0 415
1 495 1 0 412
1 496 1 0 409
1 497 1 0 406
1 498 1 0 403
1 499 1 0 400
1 500 1 0 397
1 501 1 0 394
1 502 1 0 391
1 503 1 0 388
1 504 1 0 385
1 475 1 0 382
1 476 1 0 379
1 477 1 0 376
1 478 1 0 373
1 479 1 0 370
1 480 1 0 367
1 481 1 0 364
1 482 1 0 361
1 483 1 0 358
1 484 1 0 355
1 485 1 0 352
1 486 1 0 349
1 487 1 0 346
1 488 1 0 343
1 489 1 0 340
1 490 1 0 337
1 491 1 0 334
1 492 1 0 331
1 493 1 0 328
1 494 1 0 325
1 495 1 0 322
1 496 1 0 319
1 497 1 0 316
1 498 1 0 313
1 499 1 0 310
1 500 1 0 307
1 501 1 0 304
1 502 1 0 301
1 503 1 0 298
1 504 1 0 295
1 475 1 0 292
1 476 1 0 289
1 477 1 0 286
1 478 1 0 283
1 479 1 0 280
1 480 1 0 277
1 481 1 0 274
1 482 1 0 271
1 483 1 0 268
1 484 1 0 265
1 485 1 0 262
1 486 1 0 259
1 487 1 0 256
1 488 1 0 253
1 489 1 0 250
1 490 1 0 247
1 491 1 0 244
1 492 1 0 241
1 493 1 0 238
1 494 1 0 235
1 495 1 0 232
1 496 1 0 229
1 497 1 0 226
1 498 1 0 223
1 499 1 0 220
1 500 1 0 217
1 501 1 0 214
1 502 1 0 211
1 503 1 0 208
1 504 1 0 205
1 1 1 1 504
1 1 1 1 503
1 1 1 1 502
1 1 1 1 501
1 1 1 1 500
1 1 1 1 499
1 1 1 1 498
1 1 1 1 497
1 1 1 1 496
1 1 1 1 495
1 1 1 1 494
1 1 1 1 493
1 1 1 1 492
1 1 1 1 491
1 1 1 1 490
1 1 1 1 489
1 1 1 1 488
1 1 1 1 487
1 1 1 1 486
1 1 1 1 485
1 1 1 1 484
1 1 1 1 483
1 1 1 1 482
1 1 1 1 481
1 1 1 1 480
1 1 1 1 479
1 1 1 1 478
1 1 1 1 477
1 1 1 1 476
1 1 1 1 475
1 1 2 0 472 382
1 1 2 0 472 292
1 1 2 0 469 379
1 1 2 0 469 289
1 1 2 0 466 376
1 1 2 0 466 286
1 1 2 0 463 373
1 1 2 0 463 283
1 1 2 0 460 370
1 1 2 0 460 280
1 1 2 0 457 367
1 1 2 0 457 277
1 1 2 0 454 364
1 1 2 0 454 274
1 1 2 0 451 361
1 1 2 0 451 271
1 1 2 0 448 358
1 1 2 0 448 268
1 1 2 0 445 355
1 1 2 0 445 265
1 1 2 0 442 352
1 1 2 0 442 262
1 1 2 0 439 349
1 1 2 0 439 259
1 1 2 0 436 346
1 1 2 0 436 256
1 1 2 0 433 343
1 1 2 0 433 253
1 1 2 0 430 340
1 1 2 0 430 250
1 1 2 0 427 337
1 1 2 0 427 247
1 1 2 0 424 334
1 1 2 0 424 244
1 1 2 0 421 331
1 1 2 0 421 241
1 1 2 0 418 328
1 1 2 0 418 238
1 1 2 0 415 325
1 1 2 0 415 235
1 1 2 0 412 322
1 1 2 0 412 232
1 1 2 0 409 319
1 1 2 0 409 229
1 1 2 0 406 316
1 1 2 0 406 226
1 1 2 0 403 313
1 1 2 0 403 223
1 1 2 0 400 310
1 1 2 0 400 220
1 1 2 0 397 307
1 1 2 0 397 217
1 1 2 0 394 304
1 1 2 0 394 214
1 1 2 0 391 301
1 1 2 0 391 211
1 1 2 0 388 298
1 1 2 0 388 208
1 1 2 0 385 295
1 1 2 0 385 205
1 1 2 0 382 472
1 1 2 0 382 292
1 1 2 0 379 469
1 1 2 0 379 289
1 1 2 0 376 466
1 1 2 0 376 286
1 1 2 0 373 463
1 1 2 0 373 283
1 1 2 0 370 460
1 1 2 0 370 280
1 1 2 0 367 457
1 1 2 0 367 277
1 1 2 0 364 454
1 1 2 0 364 274
1 1 2 0 361 451
1 1 2 0 361 271
1 1 2 0 358 448
1 1 2 0 358 268
1 1 2 0 355 445
1 1 2 0 355 265
1 1 2 0 352 442
1 1 2 0 352 262
1 1 2 0 349 439
1 1 2 0 349 259
1 1 2 0 346 436
1 1 2 0 346 256
1 1 2 0 343 433
1 1 2 0 343 253
1 1 2 0 340 430
1 1 2 0 340 250
1 1 2 0 337 427
1 1 2 0 337 247
1 1 2 0 334 424
1 1 2 0 334 244
1 1 2 0 331 421
1 1 2 0 331 241
1 1 2 0 328 418
1 1 2 0 328 238
1 1 2 0 325 415
1 1 2 0 325 235
1 1 2 0 322 412
1 1 2 0 322 232
1 1 2 0 319 409
1 1 2 0 319 229
1 1 2 0 316 406
1 1 2 0 316 226
1 1 2 0 313 403
1 1 2 0 313 223
1 1 2 0 310 400
1 1 2 0 310 220
1 1 2 0 307 397
1 1 2 0 307 217
1 1 2 0 304 394
1 1 2 0 304 214
1 1 2 0 301 391
1 1 2 0 301 211
1 1 2 0 298 388
1 1 2 0 298 208
1 1 2 0 295 385
1 1 2 0 295 205
1 1 2 0 292 472
1 1 2 0 292 382
1 1 2 0 289 469
1 1 2 0 289 379
1 1 2 0 286 466
1 1 2 0 286 376
1 1 2 0 283 463
1 1 2 0 283 373
1 1 2 0 280 460
1 1 2 0 280 370
1 1 2 0 277 457
1 1 2 0 277 367
1 1 2 0 274 454
1 1 2 0 274 364
1 1 2 0 271 451
1 1 2 0 271 361
1 1 2 0 268 448
1 1 2 0 268 358
1 1 2 0 265 445
1 1 2 0 265 355
1 1 2 0 262 442
1 1 2 0 262 352
1 1 2 0 259 439
1 1 2 0 259 349
1 1 2 0 256 436
1 1 2 0 256 346
1 1 2 0 253 433
1 1 2 0 253 343
1 1 2 0 250 430
1 1 2 0 250 340
1 1 2 0 247 427
1 1 2 0 247 337
1 1 2 0 244 424
1 1 2 0 244 334
1 1 2 0 241 421
1 1 2 0 241 331
1 1 2 0 238 418
1 1 2 0 238 328
1 1 2 0 235 415
1 1 2 0 235 325
1 1 2 0 232 412
1 1 2 0 232 322
1 1 2 0 229 409
1 1 2 0 229 319
1 1 2 0 226 406
1 1 2 0 226 316
1 1 2 0 223 403
1 1 2 0 223 313
1 1 2 0 220 400
1 1 2 0 220 310
1 1 2 0 217 397
1 1 2 0 217 307
1 1 2 0 214 394
1 1 2 0 214 304
1 1 2 0 211 391
1 1 2 0 211 301
1 1 2 0 208 388
1 1 2 0 208 298
1 1 2 0 205 385
1 1 2 0 205 295
1 1 2 0 472 457
1 1 2 0 472 439
1 1 2 0 472 433
1 1 2 0 472 430
1 1 2 0 472 412
1 1 2 0 472 406
1 1 2 0 469 457
1 1 2 0 469 454
1 1 2 0 469 445
1 1 2 0 469 403
1 1 2 0 469 397
1 1 2 0 466 457
1 1 2 0 466 445
1 1 2 0 466 433
1 1 2 0 466 424
1 1 2 0 466 397
1 1 2 0 466 394
1 1 2 0 463 445
1 1 2 0 463 439
1 1 2 0 463 433
1 1 2 0 463 424
1 1 2 0 463 409
1 1 2 0 460 442
1 1 2 0 460 436
1 1 2 0 460 433
1 1 2 0 460 391
1 1 2 0 460 388
1 1 2 0 457 436
1 1 2 0 457 430
1 1 2 0 457 415
1 1 2 0 457 409
1 1 2 0 454 451
1 1 2 0 454 448
1 1 2 0 454 421
1 1 2 0 454 415
1 1 2 0 454 406
1 1 2 0 454 403
1 1 2 0 451 448
1 1 2 0 451 445
1 1 2 0 451 436
1 1 2 0 451 427
1 1 2 0 451 409
1 1 2 0 451 385
1 1 2 0 448 439
1 1 2 0 448 436
1 1 2 0 448 433
1 1 2 0 448 427
1 1 2 0 445 433
1 1 2 0 445 415
1 1 2 0 445 406
1 1 2 0 445 385
1 1 2 0 442 430
1 1 2 0 442 400
1 1 2 0 439 427
1 1 2 0 439 418
1 1 2 0 439 388
1 1 2 0 436 406
1 1 2 0 436 403
1 1 2 0 436 391
1 1 2 0 433 418
1 1 2 0 433 406
1 1 2 0 430 421
1 1 2 0 430 409
1 1 2 0 430 397
1 1 2 0 430 394
1 1 2 0 427 409
1 1 2 0 427 400
1 1 2 0 427 388
1 1 2 0 424 403
1 1 2 0 424 388
1 1 2 0 421 409
1 1 2 0 421 391
1 1 2 0 418 385
1 1 2 0 415 412
1 1 2 0 412 409
1 1 2 0 412 406
1 1 2 0 412 403
1 1 2 0 412 391
1 1 2 0 409 400
1 1 2 0 406 388
1 1 2 0 403 397
1 1 2 0 403 394
1 1 2 0 397 394
1 1 2 0 397 391
1 1 2 0 397 388
1 1 2 0 394 388
1 1 2 0 382 367
1 1 2 0 382 349
1 1 2 0 382 343
1 1 2 0 382 340
1 1 2 0 382 322
1 1 2 0 382 316
1 1 2 0 379 367
1 1 2 0 379 364
1 1 2 0 379 355
1 1 2 0 379 313
1 1 2 0 379 307
1 1 2 0 376 367
1 1 2 0 376 355
1 1 2 0 376 343
1 1 2 0 376 334
1 1 2 0 376 307
1 1 2 0 376 304
1 1 2 0 373 355
1 1 2 0 373 349
1 1 2 0 373 343
1 1 2 0 373 334
1 1 2 0 373 319
1 1 2 0 370 352
1 1 2 0 370 346
1 1 2 0 370 343
1 1 2 0 370 301
1 1 2 0 370 298
1 1 2 0 367 346
1 1 2 0 367 340
1 1 2 0 367 325
1 1 2 0 367 319
1 1 2 0 364 361
1 1 2 0 364 358
1 1 2 0 364 331
1 1 2 0 364 325
1 1 2 0 364 316
1 1 2 0 364 313
1 1 2 0 361 358
1 1 2 0 361 355
1 1 2 0 361 346
1 1 2 0 361 337
1 1 2 0 361 319
1 1 2 0 361 295
1 1 2 0 358 349
1 1 2 0 358 346
1 1 2 0 358 343
1 1 2 0 358 337
1 1 2 0 355 343
1 1 2 0 355 325
1 1 2 0 355 316
1 1 2 0 355 295
1 1 2 0 352 340
1 1 2 0 352 310
1 1 2 0 349 337
1 1 2 0 349 328
1 1 2 0 349 298
1 1 2 0 346 316
1 1 2 0 346 313
1 1 2 0 346 301
1 1 2 0 343 328
1 1 2 0 343 316
1 1 2 0 340 331
1 1 2 0 340 319
1 1 2 0 340 307
1 1 2 0 340 304
1 1 2 0 337 319
1 1 2 0 337 310
1 1 2 0 337 298
1 1 2 0 334 313
1 1 2 0 334 298
1 1 2 0 331 319
1 1 2 0 331 301
1 1 2 0 328 295
1 1 2 0 325 322
1 1 2 0 322 319
1 1 2 0 322 316
1 1 2 0 322 313
1 1 2 0 322 301
1 1 2 0 319 310
1 1 2 0 316 298
1 1 2 0 313 307
1 1 2 0 313 304
1 1 2 0 307 304
1 1 2 0 307 301
1 1 2 0 307 298
1 1 2 0 304 298
1 1 2 0 292 277
1 1 2 0 292 259
1 1 2 0 292 253
1 1 2 0 292 250
1 1 2 0 292 232
1 1 2 0 292 226
1 1 2 0 289 277
1 1 2 0 289 274
1 1 2 0 289 265
1 1 2 0 289 223
1 1 2 0 289 217
1 1 2 0 286 277
1 1 2 0 286 265
1 1 2 0 286 253
1 1 2 0 286 244
1 1 2 0 286 217
1 1 2 0 286 214
1 1 2 0 283 265
1 1 2 0 283 259
1 1 2 0 283 253
1 1 2 0 283 244
1 1 2 0 283 229
1 1 2 0 280 262
1 1 2 0 280 256
1 1 2 0 280 253
1 1 2 0 280 211
1 1 2 0 280 208
1 1 2 0 277 256
1 1 2 0 277 250
1 1 2 0 277 235
1 1 2 0 277 229
1 1 2 0 274 271
1 1 2 0 274 268
1 1 2 0 274 241
1 1 2 0 274 235
1 1 2 0 274 226
1 1 2 0 274 223
1 1 2 0 271 268
1 1 2 0 271 265
1 1 2 0 271 256
1 1 2 0 271 247
1 1 2 0 271 229
1 1 2 0 271 205
1 1 2 0 268 259
1 1 2 0 268 256
1 1 2 0 268 253
1 1 2 0 268 247
1 1 2 0 265 253
1 1 2 0 265 235
1 1 2 0 265 226
1 1 2 0 265 205
1 1 2 0 262 250
1 1 2 0 262 220
1 1 2 0 259 247
1 1 2 0 259 238
1 1 2 0 259 208
1 1 2 0 256 226
1 1 2 0 256 223
1 1 2 0 256 211
1 1 2 0 253 238
1 1 2 0 253 226
1 1 2 0 250 241
1 1 2 0 250 229
1 1 2 0 250 217
1 1 2 0 250 214
1 1 2 0 247 229
1 1 2 0 247 220
1 1 2 0 247 208
1 1 2 0 244 223
1 1 2 0 244 208
1 1 2 0 241 229
1 1 2 0 241 211
1 1 2 0 238 205
1 1 2 0 235 232
1 1 2 0 232 229
1 1 2 0 232 226
1 1 2 0 232 223
1 1 2 0 232 211
1 1 2 0 229 220
1 1 2 0 226 208
1 1 2 0 223 217
1 1 2 0 223 214
1 1 2 0 217 214
1 1 2 0 217 211
1 1 2 0 217 208
1 1 2 0 214 208
0
205 col(29,3)
208 col(28,3)
211 col(27,3)
214 col(26,3)
217 col(25,3)
220 col(24,3)
223 col(23,3)
226 col(22,3)
229 col(21,3)
232 col(20,3)
235 col(19,3)
238 col(18,3)
241 col(17,3)
244 col(16,3)
247 col(15,3)
250 col(14,3)
253 col(13,3)
256 col(12,3)
259 col(11,3)
262 col(10,3)
265 col(9,3)
268 col(8,3)
271 col(7,3)
274 col(6,3)
277 col(5,3)
280 col(4,3)
283 col(3,3)
286 col(2,3)
289 col(1,3)
292 col(0,3)
295 col(29,2)
298 col(28,2)
301 col(27,2)
304 col(26,2)
307 col(25,2)
310 col(24,2)
313 col(23,2)
316 col(22,2)
319 col(21,2)
322 col(20,2)
325 col(19,2)
328 col(18,2)
331 col(17,2)
334 col(16,2)
337 col(15,2)
340 col(14,2)
343 col(13,2)
346 col(12,2)
349 col(11,2)
352 col(10,2)
355 col(9,2)
358 col(8,2)
361 col(7,2)
364 col(6,2)
367 col(5,2)
370 col(4,2)
373 col(3,2)
376 col(2,2)
379 col(1,2)
382 col(0,2)
385 col(29,1)
388 col(28,1)
391 col(27,1)
394 col(26,1)
397 col(25,1)
400 col(24,1)
403 col(23,1)
406 col(22,1)
409 col(21,1)
412 col(20,1)
415 col(19,1)
418 col(18,1)
421 col(17,1)
424 col(16,1)
427 col(15,1)
430 col(14,1)
433 col(13,1)
436 col(12,1)
439 col(11,1)
442 col(10,1)
445 col(9,1)
448 col(8,1)
451 col(7,1)
454 col(6,1)
457 col(5,1)
460 col(4,1)
463 col(3,1)
466 col(2,1)
469 col(1,1)
472 col(0,1)
0
B+
0
B-
1
0
1
"""
output = """
"""
| 14.085538
| 17
| 0.626745
| 5,850
| 15,973
| 1.711282
| 0.087009
| 0.105684
| 0.131555
| 0.175007
| 0.437219
| 0.011987
| 0
| 0
| 0
| 0
| 0
| 0.944741
| 0.35535
| 15,973
| 1,133
| 18
| 14.09797
| 0.027484
| 0
| 0
| 0.001765
| 0
| 0
| 0.998059
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9ec3f4681a99ade33ad1a8d04c503c5115d9cc4d
| 374
|
py
|
Python
|
python_modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/launcher_tests/test_utils.py
|
kstennettlull/dagster
|
dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6
|
[
"Apache-2.0"
] | null | null | null |
python_modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/launcher_tests/test_utils.py
|
kstennettlull/dagster
|
dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6
|
[
"Apache-2.0"
] | null | null | null |
python_modules/libraries/dagster-aws/dagster_aws_tests/ecs_tests/launcher_tests/test_utils.py
|
kstennettlull/dagster
|
dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6
|
[
"Apache-2.0"
] | null | null | null |
from dagster_aws.ecs.utils import sanitize_family
def test_sanitize_family():
assert sanitize_family("abc") == "abc"
assert sanitize_family("abc123") == "abc123"
assert sanitize_family("abc-123") == "abc-123"
assert sanitize_family("abc_123") == "abc_123"
assert sanitize_family("abc 123") == "abc123"
assert sanitize_family("abc~123") == "abc123"
| 34
| 50
| 0.697861
| 48
| 374
| 5.1875
| 0.291667
| 0.449799
| 0.481928
| 0.461847
| 0.538153
| 0.538153
| 0.361446
| 0.361446
| 0.361446
| 0.361446
| 0
| 0.094637
| 0.152406
| 374
| 10
| 51
| 37.4
| 0.690852
| 0
| 0
| 0.25
| 0
| 0
| 0.192513
| 0
| 0
| 0
| 0
| 0
| 0.75
| 1
| 0.125
| true
| 0
| 0.125
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9eeabd8e5086bf3db235708a0de193449edde905
| 112
|
py
|
Python
|
python-algorithm/leetcode/problem_149.py
|
isudox/nerd-algorithm
|
c1fbe153953cf3fc24395f75d102016fdf9ea0fa
|
[
"MIT"
] | 5
|
2017-06-11T09:19:34.000Z
|
2019-01-16T16:58:31.000Z
|
python-algorithm/leetcode/problem_149.py
|
isudox/leetcode-solution
|
60085e64deaf396a171367affc94b18114565c43
|
[
"MIT"
] | 5
|
2020-03-22T13:53:54.000Z
|
2020-03-23T08:49:35.000Z
|
python-algorithm/leetcode/problem_149.py
|
isudox/nerd-algorithm
|
c1fbe153953cf3fc24395f75d102016fdf9ea0fa
|
[
"MIT"
] | 1
|
2019-03-02T15:50:43.000Z
|
2019-03-02T15:50:43.000Z
|
from typing import List
class Solution:
def max_points(points: List[List[int]]) -> int:
return 0
| 14
| 51
| 0.651786
| 16
| 112
| 4.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011905
| 0.25
| 112
| 7
| 52
| 16
| 0.845238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
73167393cf35dd0ae5edabe4961b58ef76d04759
| 102
|
py
|
Python
|
pandas/tests/indexing/common.py
|
tacaswell/pandas
|
81c57e20da278494dfebc2f1043f5ff361a234f3
|
[
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null |
pandas/tests/indexing/common.py
|
tacaswell/pandas
|
81c57e20da278494dfebc2f1043f5ff361a234f3
|
[
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null |
pandas/tests/indexing/common.py
|
tacaswell/pandas
|
81c57e20da278494dfebc2f1043f5ff361a234f3
|
[
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1
|
2019-02-20T18:01:08.000Z
|
2019-02-20T18:01:08.000Z
|
""" common utilities """
def _mklbl(prefix, n):
return ["%s%s" % (prefix, i) for i in range(n)]
| 17
| 51
| 0.568627
| 16
| 102
| 3.5625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.215686
| 102
| 5
| 52
| 20.4
| 0.7125
| 0.156863
| 0
| 0
| 0
| 0
| 0.051282
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
736105a2a5d6a8a93afe10d0c8f62d125397b1c8
| 428
|
py
|
Python
|
rabbit_force/salesforce/__init__.py
|
elaredo/rabbit-force-wefox
|
ec5108f9341ace8a6d44d424c8174bba41558ba3
|
[
"MIT"
] | 19
|
2018-10-25T15:31:14.000Z
|
2022-01-18T17:47:39.000Z
|
rabbit_force/salesforce/__init__.py
|
elaredo/rabbit-force-wefox
|
ec5108f9341ace8a6d44d424c8174bba41558ba3
|
[
"MIT"
] | 1
|
2021-01-13T13:28:35.000Z
|
2021-01-13T13:28:35.000Z
|
rabbit_force/salesforce/__init__.py
|
elaredo/rabbit-force-wefox
|
ec5108f9341ace8a6d44d424c8174bba41558ba3
|
[
"MIT"
] | 1
|
2019-05-10T10:44:48.000Z
|
2019-05-10T10:44:48.000Z
|
"""Classes for managing Salesforce organizations and resources"""
from .rest_client import SalesforceRestClient # noqa: F401
from .org import SalesforceOrg # noqa: F401
from .resources import StreamingResourceType, StreamingResource # noqa: F401
from .resources import StreamingResourceFactory # noqa: F401
from .resources import PushTopicResource # noqa: F401
from .resources import StreamingChannelResource # noqa: F401
| 53.5
| 77
| 0.810748
| 45
| 428
| 7.688889
| 0.466667
| 0.138728
| 0.17341
| 0.242775
| 0.312139
| 0
| 0
| 0
| 0
| 0
| 0
| 0.048387
| 0.130841
| 428
| 7
| 78
| 61.142857
| 0.88172
| 0.294393
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b40d722b8dd6902e644be575309b58d2ece3393f
| 33
|
py
|
Python
|
mo/__main__.py
|
thomasleese/mo
|
b757f52b42e51ad19c14724ceb7c5db5d52abaea
|
[
"MIT"
] | 9
|
2016-02-17T14:32:24.000Z
|
2021-12-28T16:35:23.000Z
|
mo/__main__.py
|
thomasleese/mo
|
b757f52b42e51ad19c14724ceb7c5db5d52abaea
|
[
"MIT"
] | 12
|
2016-02-17T14:46:44.000Z
|
2021-06-01T21:24:02.000Z
|
mo/__main__.py
|
thomasleese/mo
|
b757f52b42e51ad19c14724ceb7c5db5d52abaea
|
[
"MIT"
] | 2
|
2016-02-17T14:33:40.000Z
|
2017-05-28T05:31:22.000Z
|
from mo.cli import main
main()
| 6.6
| 23
| 0.69697
| 6
| 33
| 3.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.212121
| 33
| 4
| 24
| 8.25
| 0.884615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
b4114a937c263ae4f521909f3073b31a9c02d060
| 704
|
py
|
Python
|
tests/test_utils.py
|
ivanzugnoni/python-hacker-news
|
63c496192509cec8cdcf4abb604d5079a414f014
|
[
"MIT"
] | 28
|
2019-02-25T18:10:26.000Z
|
2021-12-18T18:12:03.000Z
|
tests/test_utils.py
|
karlicoss/python-hacker-news
|
03e0fd55bbcd5d72c82d8240edace361aea373e6
|
[
"MIT"
] | 7
|
2018-11-19T21:35:20.000Z
|
2019-03-26T18:09:50.000Z
|
tests/test_utils.py
|
karlicoss/python-hacker-news
|
03e0fd55bbcd5d72c82d8240edace361aea373e6
|
[
"MIT"
] | 2
|
2018-12-05T18:55:53.000Z
|
2019-12-02T09:52:52.000Z
|
import pytest
from datetime import datetime
from hn import utils
def test_parse_date():
assert utils.parse_date(datetime(2018, 1, 1)) == datetime(2018, 1, 1)
assert utils.parse_date('2018-07-01') == datetime(2018, 7, 1)
assert utils.parse_date('2018-09-03 18:45:11') == datetime(2018, 9, 3, 18, 45, 11)
assert utils.parse_date('2018-09-03 18:45:11') == datetime(2018, 9, 3, 18, 45, 11)
assert utils.parse_date('2018-11-03T14:53:42.000Z') == datetime(
2018, 11, 3, 14, 53, 42)
assert utils.parse_date('2018') == datetime(2018, 1, 1)
assert utils.parse_date('2018-09') == datetime(2018, 9, 1)
with pytest.raises(ValueError):
utils.parse_date('2018-13')
| 35.2
| 86
| 0.65767
| 116
| 704
| 3.905172
| 0.275862
| 0.178808
| 0.247241
| 0.309051
| 0.518764
| 0.465784
| 0.465784
| 0.459161
| 0.459161
| 0.291391
| 0
| 0.234483
| 0.176136
| 704
| 19
| 87
| 37.052632
| 0.546552
| 0
| 0
| 0.142857
| 0
| 0
| 0.127841
| 0.034091
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.071429
| true
| 0
| 0.214286
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b422affa21c8dacb874e879e423334b277c6cefc
| 191
|
py
|
Python
|
wava/checker/exceptions.py
|
xrmx/website-availability
|
6eacb1de50cbccf395b01b1d92aaef91a6447728
|
[
"MIT"
] | null | null | null |
wava/checker/exceptions.py
|
xrmx/website-availability
|
6eacb1de50cbccf395b01b1d92aaef91a6447728
|
[
"MIT"
] | 7
|
2021-02-28T09:56:17.000Z
|
2021-03-06T09:10:30.000Z
|
wava/checker/exceptions.py
|
xrmx/website-availability
|
6eacb1de50cbccf395b01b1d92aaef91a6447728
|
[
"MIT"
] | null | null | null |
class CheckerNetworkError(Exception):
"""Generic exception for network errors"""
def __init__(self, original_exception):
self.checker_original_exception = original_exception
| 31.833333
| 60
| 0.764398
| 19
| 191
| 7.263158
| 0.631579
| 0.369565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157068
| 191
| 5
| 61
| 38.2
| 0.857143
| 0.188482
| 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 | 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
| 1
| 0
|
0
| 5
|
b436033fde46a277c6ee6152242bc6d03a76ca61
| 213
|
py
|
Python
|
074_Maior_e_menor_valores_em_tuplas.py
|
fabioeomedeiros/Python-Base
|
ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1
|
[
"MIT"
] | null | null | null |
074_Maior_e_menor_valores_em_tuplas.py
|
fabioeomedeiros/Python-Base
|
ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1
|
[
"MIT"
] | null | null | null |
074_Maior_e_menor_valores_em_tuplas.py
|
fabioeomedeiros/Python-Base
|
ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1
|
[
"MIT"
] | null | null | null |
#074_Maior_e_menor_valores_em_tuplas.py
from random import randint
num = (randint(0,5), randint(0,5), randint(0,5), randint(0,5), randint(0,5),)
print(num)
print(f"Maior: {max(num)}")
print(f"Menor: {min(num)}")
| 26.625
| 77
| 0.704225
| 40
| 213
| 3.6
| 0.475
| 0.277778
| 0.3125
| 0.444444
| 0.3125
| 0.3125
| 0.3125
| 0.3125
| 0.3125
| 0.3125
| 0
| 0.066667
| 0.084507
| 213
| 8
| 78
| 26.625
| 0.671795
| 0.178404
| 0
| 0
| 0
| 0
| 0.194286
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0.6
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
b44777cf40344d91a356a5ca6469fcbc871c3059
| 4,392
|
py
|
Python
|
ContinuumBenchmarks/CIFAR100/Continual-Learning-Benchmark/EvalPlot.py
|
hikmatkhan/Continuum
|
83302753648e0d521d8b5f57edae5df4307c0a5c
|
[
"MIT"
] | null | null | null |
ContinuumBenchmarks/CIFAR100/Continual-Learning-Benchmark/EvalPlot.py
|
hikmatkhan/Continuum
|
83302753648e0d521d8b5f57edae5df4307c0a5c
|
[
"MIT"
] | null | null | null |
ContinuumBenchmarks/CIFAR100/Continual-Learning-Benchmark/EvalPlot.py
|
hikmatkhan/Continuum
|
83302753648e0d521d8b5f57edae5df4307c0a5c
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 15 09:00:10 2019
@author: mengmi
"""
import torch
import os
import os.path
import scipy.io
import numpy as np
# rows: task trials
# cols: performance in task numbers
def convertToMat(prec,n_task):
mat = np.empty((n_task,n_task))
mat[:] = np.nan
for i, key in enumerate(prec):
taskprec = prec[key]
counter = 0
for tkey in taskprec:
mat[i+counter][i] = prec[key][tkey]
counter = counter + 1
return mat
namebase = 'scripts/outputs/split_CIFAR100_incremental_class/'
# namebase = 'outputs/permuted_MNIST_incre_domain/'
n_task = 26
n_repeats = 5
#
# ## EWC
# loadfilenameprefix = 'EWC_'
# loadfilenamepostfix = '-precision_record.pt'
#
# for i in range(n_repeats):
# loadfilename = loadfilenameprefix + str(i+1) + loadfilenamepostfix
# savefilename = loadfilename[:-3] + '.mat'
# savefilename = os.path.join(namebase, savefilename)
# loadfilename = os.path.join(namebase, loadfilename)
# prec = torch.load(loadfilename)
# prec = convertToMat(prec, n_task)
# #print(prec)
# print('load from ...')
# print(loadfilename)
# print('save to ...')
# print(savefilename)
# scipy.io.savemat(savefilename, {'prec':prec})
#
# ## online EWC
# loadfilenameprefix = 'EWC_online_'
# loadfilenamepostfix = '-precision_record.pt'
#
# for i in range(n_repeats):
# loadfilename = loadfilenameprefix + str(i+1) + loadfilenamepostfix
# savefilename = loadfilename[:-3] + '.mat'
# savefilename = os.path.join(namebase, savefilename)
# loadfilename = os.path.join(namebase, loadfilename)
# prec = torch.load(loadfilename)
# prec = convertToMat(prec, n_task)
# #print(prec)
# print('load from ...')
# print(loadfilename)
# print('save to ...')
# print(savefilename)
# scipy.io.savemat(savefilename, {'prec':prec})
#
# ## NormalNN: chance baseline
# loadfilenameprefix = 'NormalNN_'
# loadfilenamepostfix = '-precision_record.pt'
#
# for i in range(n_repeats):
# loadfilename = loadfilenameprefix + str(i+1) + loadfilenamepostfix
# savefilename = loadfilename[:-3] + '.mat'
# savefilename = os.path.join(namebase, savefilename)
# loadfilename = os.path.join(namebase, loadfilename)
# prec = torch.load(loadfilename)
# prec = convertToMat(prec, n_task)
# #print(prec)
# print('load from ...')
# print(loadfilename)
# print('save to ...')
# print(savefilename)
# scipy.io.savemat(savefilename, {'prec':prec})
#
# ## L2
# loadfilenameprefix = 'L2_'
# loadfilenamepostfix = '-precision_record.pt'
#
# for i in range(n_repeats):
# loadfilename = loadfilenameprefix + str(i+1) + loadfilenamepostfix
# savefilename = loadfilename[:-3] + '.mat'
# savefilename = os.path.join(namebase, savefilename)
# loadfilename = os.path.join(namebase, loadfilename)
# prec = torch.load(loadfilename)
# prec = convertToMat(prec, n_task)
# #print(prec)
# print('load from ...')
# print(loadfilename)
# print('save to ...')
# print(savefilename)
# scipy.io.savemat(savefilename, {'prec':prec})
#
# ## MAS
# loadfilenameprefix = 'MAS_'
# loadfilenamepostfix = '-precision_record.pt'
#
# for i in range(n_repeats):
# loadfilename = loadfilenameprefix + str(i+1) + loadfilenamepostfix
# savefilename = loadfilename[:-3] + '.mat'
# savefilename = os.path.join(namebase, savefilename)
# loadfilename = os.path.join(namebase, loadfilename)
# prec = torch.load(loadfilename)
# prec = convertToMat(prec, n_task)
# #print(prec)
# print('load from ...')
# print(loadfilename)
# print('save to ...')
# print(savefilename)
# scipy.io.savemat(savefilename, {'prec':prec})
## SI
loadfilenameprefix = 'SI_'
loadfilenamepostfix = '-precision_record.pt'
for i in range(n_repeats):
loadfilename = loadfilenameprefix + str(i+1) + loadfilenamepostfix
savefilename = loadfilename[:-3] + '.mat'
savefilename = os.path.join(namebase, savefilename)
loadfilename = os.path.join(namebase, loadfilename)
prec = torch.load(loadfilename)
prec = convertToMat(prec, n_task)
#print(prec)
print('load from ...')
print(loadfilename)
print('save to ...')
print(savefilename)
scipy.io.savemat(savefilename, {'prec':prec})
| 27.797468
| 72
| 0.655055
| 477
| 4,392
| 5.955975
| 0.188679
| 0.027455
| 0.042239
| 0.07603
| 0.785639
| 0.785639
| 0.785639
| 0.785639
| 0.785639
| 0.785639
| 0
| 0.010219
| 0.19786
| 4,392
| 157
| 73
| 27.974522
| 0.796196
| 0.71061
| 0
| 0
| 0
| 0
| 0.09163
| 0.043172
| 0
| 0
| 0
| 0
| 0
| 1
| 0.03125
| false
| 0
| 0.15625
| 0
| 0.21875
| 0.125
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b45a6b034a06b71362673c6445e07b6bd3369fad
| 22
|
py
|
Python
|
Python/Tests/TestData/AddImport/ImportWithError.py
|
nanshuiyu/pytools
|
9f9271fe8cf564b4f94e9456d400f4306ea77c23
|
[
"Apache-2.0"
] | null | null | null |
Python/Tests/TestData/AddImport/ImportWithError.py
|
nanshuiyu/pytools
|
9f9271fe8cf564b4f94e9456d400f4306ea77c23
|
[
"Apache-2.0"
] | null | null | null |
Python/Tests/TestData/AddImport/ImportWithError.py
|
nanshuiyu/pytools
|
9f9271fe8cf564b4f94e9456d400f4306ea77c23
|
[
"Apache-2.0"
] | null | null | null |
import sys
sys
x = {
| 7.333333
| 11
| 0.590909
| 4
| 22
| 3.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.318182
| 22
| 3
| 12
| 7.333333
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
b462e68fcb83b39c83857065bd4c42892ce4ddcc
| 32
|
py
|
Python
|
tests/script_long.py
|
mgely/scriptq
|
7339abfdefac8a1df6f3c0928e6f22bae9620e05
|
[
"MIT"
] | null | null | null |
tests/script_long.py
|
mgely/scriptq
|
7339abfdefac8a1df6f3c0928e6f22bae9620e05
|
[
"MIT"
] | 1
|
2020-06-10T08:08:24.000Z
|
2020-06-10T08:08:24.000Z
|
tests/script_long.py
|
mgely/scriptq
|
7339abfdefac8a1df6f3c0928e6f22bae9620e05
|
[
"MIT"
] | null | null | null |
from time import sleep
sleep(10)
| 16
| 22
| 0.8125
| 6
| 32
| 4.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0.125
| 32
| 2
| 23
| 16
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
b4767debae6a830a8ca082712563ac77c85c04c9
| 55
|
py
|
Python
|
sphinxsimulink/diagram/__init__.py
|
dekalinowski/sphinx-simulink
|
f86daf2efdd7b0c84307bfb17c23efff0c72a8a9
|
[
"MIT"
] | 2
|
2017-12-06T00:58:05.000Z
|
2020-05-27T21:00:59.000Z
|
sphinxsimulink/diagram/__init__.py
|
dekalinowski/sphinx-simulink
|
f86daf2efdd7b0c84307bfb17c23efff0c72a8a9
|
[
"MIT"
] | null | null | null |
sphinxsimulink/diagram/__init__.py
|
dekalinowski/sphinx-simulink
|
f86daf2efdd7b0c84307bfb17c23efff0c72a8a9
|
[
"MIT"
] | 2
|
2020-01-24T09:17:11.000Z
|
2020-04-02T10:15:02.000Z
|
from sphinxsimulink.diagram.application import setup
| 13.75
| 52
| 0.854545
| 6
| 55
| 7.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109091
| 55
| 3
| 53
| 18.333333
| 0.959184
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b477e5c0a7703457805b927252f1158761e7296f
| 115
|
py
|
Python
|
jwt_user/User.py
|
ilyashusterman/jwt_user
|
6c381821487de78cdae17b9374a10d186ebcf389
|
[
"MIT"
] | 2
|
2018-10-01T19:48:46.000Z
|
2020-07-15T07:06:17.000Z
|
jwt_user/User.py
|
ilyashusterman/jwt_user
|
6c381821487de78cdae17b9374a10d186ebcf389
|
[
"MIT"
] | null | null | null |
jwt_user/User.py
|
ilyashusterman/jwt_user
|
6c381821487de78cdae17b9374a10d186ebcf389
|
[
"MIT"
] | null | null | null |
import json
from bunch import Bunch
class User(Bunch):
def __repr__(self):
return json.dumps(self.__dict__)
| 11.5
| 34
| 0.747826
| 17
| 115
| 4.588235
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.165217
| 115
| 9
| 35
| 12.777778
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0.2
| 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
| 1
| 1
| 0
|
0
| 5
|
c316cca214816db459750f370643bdc814651fec
| 909
|
py
|
Python
|
scipy_data_fitting/figure/__init__.py
|
razor-x/scipy-data_fitting
|
c756a645da8629699b3f22244bfb7d5d4d88b179
|
[
"MIT"
] | 2
|
2016-09-19T05:58:37.000Z
|
2020-10-21T01:17:29.000Z
|
scipy_data_fitting/figure/__init__.py
|
razor-x/scipy-data_fitting
|
c756a645da8629699b3f22244bfb7d5d4d88b179
|
[
"MIT"
] | null | null | null |
scipy_data_fitting/figure/__init__.py
|
razor-x/scipy-data_fitting
|
c756a645da8629699b3f22244bfb7d5d4d88b179
|
[
"MIT"
] | 3
|
2020-10-20T13:55:21.000Z
|
2021-05-23T19:04:21.000Z
|
"""
**Figure creation subpackage.**
_This subpackage is in beta._
Use this subpackage to create publication quality figures
with [matplotlib][1] from fits generated with [`scipy_data_fitting`][2].
This subpackage works independently from [`scipy_data_fitting`][2]:
it only assumes json fit files formatted according to
[`scipy_data_fitting.Fit.to_json`][3] with [`meta=fit.metadata`][4].
Use `figure.Fit` to load fits saved as json files into a `figure.Fit` object.
Create a [`matplotlib.figure`][5] and manage subplots with `figure.Plot`.
[1]: http://matplotlib.org/
[2]: https://pythonhosted.org/scipy-data_fitting/
[3]: https://pythonhosted.org/scipy-data_fitting/#scipy_data_fitting.Fit.to_json
[4]: https://pythonhosted.org/scipy-data_fitting/#scipy_data_fitting.Fit.metadata
[5]: http://matplotlib.org/api/figure_api.html
"""
from .fit import Fit
from .plot import Plot
__all__ = ['Fit', 'Plot']
| 33.666667
| 81
| 0.755776
| 138
| 909
| 4.818841
| 0.405797
| 0.108271
| 0.192481
| 0.085714
| 0.266165
| 0.266165
| 0.165414
| 0.165414
| 0.165414
| 0.165414
| 0
| 0.01348
| 0.10231
| 909
| 26
| 82
| 34.961538
| 0.801471
| 0.910891
| 0
| 0
| 1
| 0
| 0.09589
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c3437485075a204d75e9b336eb4d7c4ab0ed009a
| 67
|
py
|
Python
|
pyxb/bundles/reqif/ReqIF.py
|
eLBati/pyxb
|
14737c23a125fd12c954823ad64fc4497816fae3
|
[
"Apache-2.0"
] | 123
|
2015-01-12T06:43:22.000Z
|
2022-03-20T18:06:46.000Z
|
pyxb/bundles/reqif/ReqIF.py
|
eLBati/pyxb
|
14737c23a125fd12c954823ad64fc4497816fae3
|
[
"Apache-2.0"
] | 103
|
2015-01-08T18:35:57.000Z
|
2022-01-18T01:44:14.000Z
|
pyxb/bundles/reqif/ReqIF.py
|
eLBati/pyxb
|
14737c23a125fd12c954823ad64fc4497816fae3
|
[
"Apache-2.0"
] | 54
|
2015-02-15T17:12:00.000Z
|
2022-03-07T23:02:32.000Z
|
# -*- coding: utf-8 -*-
from pyxb.bundles.reqif.raw.ReqIF import *
| 22.333333
| 42
| 0.656716
| 10
| 67
| 4.4
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0.134328
| 67
| 2
| 43
| 33.5
| 0.741379
| 0.313433
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c36a62170ac38b21985754b1c5879cdc8a5719dc
| 122
|
py
|
Python
|
src/colleges/admin.py
|
Busaka/excellence
|
1cd19770285584d61aeddd77d6c1dd83e2fd04ba
|
[
"MIT"
] | null | null | null |
src/colleges/admin.py
|
Busaka/excellence
|
1cd19770285584d61aeddd77d6c1dd83e2fd04ba
|
[
"MIT"
] | null | null | null |
src/colleges/admin.py
|
Busaka/excellence
|
1cd19770285584d61aeddd77d6c1dd83e2fd04ba
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import College
# Register your models here.
admin.site.register(College)
| 15.25
| 32
| 0.795082
| 17
| 122
| 5.705882
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139344
| 122
| 7
| 33
| 17.428571
| 0.92381
| 0.213115
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c378aa1ae1243e4699bd5a54db2dbf19aff1cd8e
| 117
|
py
|
Python
|
enthought/developer/features/drag_drop_feature.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/developer/features/drag_drop_feature.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/developer/features/drag_drop_feature.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from __future__ import absolute_import
from etsdevtools.developer.features.drag_drop_feature import *
| 29.25
| 62
| 0.863248
| 15
| 117
| 6.266667
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094017
| 117
| 3
| 63
| 39
| 0.886792
| 0.102564
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
6f1636fff4abfdfd953c32d3ee2924b86d831e62
| 129
|
py
|
Python
|
freq.py
|
rayjustinhuang/BitesofPy
|
03b694c5259ff607621419d9677c5caff90a6057
|
[
"MIT"
] | null | null | null |
freq.py
|
rayjustinhuang/BitesofPy
|
03b694c5259ff607621419d9677c5caff90a6057
|
[
"MIT"
] | null | null | null |
freq.py
|
rayjustinhuang/BitesofPy
|
03b694c5259ff607621419d9677c5caff90a6057
|
[
"MIT"
] | null | null | null |
from collections import Counter
def freq_digit(num: int) -> int:
return int(Counter(str(num)).most_common(1)[0][0])
pass
| 25.8
| 54
| 0.697674
| 21
| 129
| 4.190476
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027523
| 0.155039
| 129
| 5
| 55
| 25.8
| 0.779817
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
6f79dfd0a1efe0193b495ee1ed3751334ef60ffe
| 11,571
|
py
|
Python
|
migration/test/test_handle_migration.py
|
brandonmreid/Submitty
|
8fdf6c6201ca6b7eaed2b138949b40a98785a05f
|
[
"BSD-3-Clause"
] | null | null | null |
migration/test/test_handle_migration.py
|
brandonmreid/Submitty
|
8fdf6c6201ca6b7eaed2b138949b40a98785a05f
|
[
"BSD-3-Clause"
] | null | null | null |
migration/test/test_handle_migration.py
|
brandonmreid/Submitty
|
8fdf6c6201ca6b7eaed2b138949b40a98785a05f
|
[
"BSD-3-Clause"
] | null | null | null |
from argparse import Namespace
from copy import deepcopy
from io import StringIO
from pathlib import Path
import shutil
from sqlalchemy.exc import OperationalError
import sys
import tempfile
from types import SimpleNamespace
import unittest
from unittest.mock import patch
import migrator
from migrator import main
class TestHandleMigration(unittest.TestCase):
def setUp(self):
self.stdout = sys.stdout
sys.stdout = StringIO()
self.dir = tempfile.mkdtemp()
self.old_migrations_path = migrator.MIGRATIONS_PATH
migrator.MIGRATIONS_PATH = Path(self.dir)
def tearDown(self):
sys.stdout = self.stdout
shutil.rmtree(self.dir)
migrator.MIGRATIONS_PATH = self.old_migrations_path
def setup_test(self, environment, create=True):
Path(self.dir, environment).mkdir()
def create_database(self, environment, create=True):
database = migrator.db.Database({'database_driver': 'sqlite'}, environment)
if create is True:
database.DynamicBase.metadata.create_all(database.engine)
return database
def test_no_course_dir(self):
args = Namespace()
args.environments = ['course']
args.config = SimpleNamespace()
args.config.database = dict()
args.config.submitty = {
'submitty_data_dir': self.dir
}
main.handle_migration(args)
self.assertEqual(
"Could not find courses directory: {}\n".format(
str(Path(self.dir, 'courses'))
),
sys.stdout.getvalue()
)
def test_migration_no_db_master(self):
args = Namespace()
args.environments = ['master']
args.config = SimpleNamespace()
args.config.database = dict()
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = OperationalError('test', None, None)
main.handle_migration(args)
self.assertEqual(
"Database does not exist for master\n",
sys.stdout.getvalue()
)
def test_migration_no_db_system(self):
args = Namespace()
args.environments = ['system']
args.config = SimpleNamespace()
args.config.database = dict()
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = OperationalError('test', None, None)
main.handle_migration(args)
self.assertEqual(
"Database does not exist for system\n",
sys.stdout.getvalue()
)
def test_migration_no_db_course(self):
args = Namespace()
args.environments = ['course']
args.choose_course = None
args.config = SimpleNamespace()
args.config.database = dict()
args.config.submitty = dict()
args.config.submitty['submitty_data_dir'] = Path(self.dir)
Path(self.dir, 'courses', 'f19', 'csci1100').mkdir(parents=True)
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = OperationalError('test', None, None)
main.handle_migration(args)
self.assertEqual(
"Submitty Database Migration Warning: Database does not exist for semester=f19 course=csci1100\n",
sys.stdout.getvalue()
)
def test_migration_no_db_all(self):
args = Namespace()
args.environments = ['course', 'master', 'system']
args.choose_course = None
args.config = SimpleNamespace()
args.config.database = dict()
args.config.submitty = dict()
args.config.submitty['submitty_data_dir'] = Path(self.dir)
Path(self.dir, 'courses', 'f19', 'csci1100').mkdir(parents=True)
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = OperationalError('test', None, None)
main.handle_migration(args)
expected = """Database does not exist for master
Database does not exist for system
Submitty Database Migration Warning: Database does not exist for semester=f19 course=csci1100
"""
self.assertEqual(expected, sys.stdout.getvalue())
@patch('migrator.main.migrate_environment')
def test_migration_master(self, mock_method):
args = Namespace()
self.setup_test('master')
database = self.create_database('master')
args.environments = ['master']
args.config = SimpleNamespace()
args.config.database = dict()
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = [database]
main.handle_migration(args)
self.assertTrue(mock_class.called)
self.assertEqual(1, mock_class.call_count)
self.assertTrue(({'dbname': 'submitty'}, 'master'), mock_class.call_args[0])
self.assertTrue(mock_method.called)
self.assertEqual(1, mock_method.call_count)
self.assertEqual(database, mock_method.call_args[0][0])
self.assertEqual('master', mock_method.call_args[0][1])
self.assertEqual(args, mock_method.call_args[0][2])
self.assertFalse(database.open)
@patch('migrator.main.migrate_environment')
def test_migration_system(self, mock_method):
args = Namespace()
self.setup_test('system')
database = self.create_database('system')
args.environments = ['system']
args.config = SimpleNamespace()
args.config.database = dict()
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = [database]
main.handle_migration(args)
self.assertTrue(mock_class.called)
self.assertEqual(1, mock_class.call_count)
self.assertTrue(({'dbname': 'submitty'}, 'system'), mock_class.call_args[0])
self.assertTrue(mock_method.called)
self.assertEqual(1, mock_method.call_count)
self.assertEqual(database, mock_method.call_args[0][0])
self.assertEqual('system', mock_method.call_args[0][1])
self.assertEqual(args, mock_method.call_args[0][2])
self.assertFalse(database.open)
@patch('migrator.main.migrate_environment')
def test_migration_course(self, mock_method):
args = Namespace()
self.setup_test('course')
database = self.create_database('course')
args.environments = ['course']
args.choose_course = None
args.config = SimpleNamespace()
args.config.database = dict()
args.config.submitty = dict()
args.config.submitty['submitty_data_dir'] = Path(self.dir)
Path(self.dir, 'courses', 'f19', 'csci1100').mkdir(parents=True)
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = [database]
main.handle_migration(args)
self.assertTrue(mock_class.called)
self.assertEqual(1, mock_class.call_count)
self.assertTrue(
({'dbname': 'submitty_f19_csci1100'}, 'course'),
mock_class.call_args[0]
)
self.assertTrue(mock_method.called)
self.assertEqual(1, mock_method.call_count)
self.assertEqual(database, mock_method.call_args[0][0])
self.assertEqual('course', mock_method.call_args[0][1])
# Test that mutation did not happen
self.assertEqual(args.config.database, dict())
self.assertNotIn('semester', args)
self.assertNotIn('course', args)
args.config.database = {'dbname': 'submitty_f19_csci1100'}
args.semester = 'f19'
args.course = 'csci1100'
self.assertEqual(args, mock_method.call_args[0][2])
self.assertEqual(args.semester, 'f19')
self.assertEqual(args.course, 'csci1100')
self.assertFalse(database.open)
@patch('migrator.main.migrate_environment')
def test_migration_multiple_courses(self, mock_method):
args = Namespace()
self.setup_test('course')
database_1 = self.create_database('course')
database_2 = self.create_database('course')
database_3 = self.create_database('course')
args.environments = ['course']
args.choose_course = None
args.config = SimpleNamespace()
args.config.database = dict()
args.config.submitty = dict()
args.config.submitty['submitty_data_dir'] = Path(self.dir)
Path(self.dir, 'courses', 'f18', 'csci1100').mkdir(parents=True)
Path(self.dir, 'courses', 'f19', 'csci1100').mkdir(parents=True)
Path(self.dir, 'courses', 'f19', 'csci1200').mkdir(parents=True)
with patch.object(migrator.db, 'Database') as mock_class:
mock_class.side_effect = [database_1, database_2, database_3]
main.handle_migration(args)
self.assertTrue(mock_class.called)
self.assertEqual(3, mock_class.call_count)
self.assertTrue(
({'dbname': 'submitty_f18_csci1100'}, 'course'),
mock_class.call_args_list[0][0]
)
self.assertTrue(
({'dbname': 'submitty_f19_csci1100'}, 'course'),
mock_class.call_args_list[1][0]
)
self.assertTrue(
({'dbname': 'submitty_f19_csci1200'}, 'course'),
mock_class.call_args_list[2][0]
)
self.assertTrue(mock_method.called)
self.assertEqual(3, mock_method.call_count)
mock_args = mock_method.call_args_list[0][0]
expected_args = deepcopy(args)
self.assertEqual(database_1, mock_args[0])
self.assertEqual('course', mock_args[1])
self.assertEqual(args.config.database, dict())
self.assertNotIn('semester', expected_args)
self.assertNotIn('course', expected_args)
expected_args.config.database = {'dbname': 'submitty_f18_csci1100'}
expected_args.semester = 'f18'
expected_args.course = 'csci1100'
self.assertEqual(expected_args, mock_args[2])
self.assertEqual(expected_args.semester, 'f18')
self.assertEqual(expected_args.course, 'csci1100')
self.assertFalse(database_1.open)
mock_args = mock_method.call_args_list[1][0]
expected_args = deepcopy(args)
self.assertEqual(database_2, mock_args[0])
self.assertEqual('course', mock_args[1])
self.assertEqual(expected_args.config.database, dict())
self.assertNotIn('semester', expected_args)
self.assertNotIn('course', expected_args)
expected_args.config.database = {'dbname': 'submitty_f19_csci1100'}
expected_args.semester = 'f19'
expected_args.course = 'csci1100'
self.assertEqual(expected_args, mock_args[2])
self.assertEqual(expected_args.semester, 'f19')
self.assertEqual(expected_args.course, 'csci1100')
self.assertFalse(database_2.open)
mock_args = mock_method.call_args_list[2][0]
expected_args = deepcopy(args)
self.assertEqual(database_3, mock_args[0])
self.assertEqual('course', mock_args[1])
self.assertEqual(args.config.database, dict())
self.assertNotIn('semester', expected_args)
self.assertNotIn('course', expected_args)
expected_args.config.database = {'dbname': 'submitty_f19_csci1200'}
expected_args.semester = 'f19'
expected_args.course = 'csci1200'
self.assertEqual(expected_args, mock_args[2])
self.assertEqual(expected_args.semester, 'f19')
self.assertEqual(expected_args.course, 'csci1200')
self.assertFalse(database_3.open)
| 41.031915
| 111
| 0.650073
| 1,315
| 11,571
| 5.539164
| 0.085171
| 0.08855
| 0.04201
| 0.039264
| 0.830862
| 0.794481
| 0.760846
| 0.725837
| 0.661038
| 0.611752
| 0
| 0.023203
| 0.232737
| 11,571
| 281
| 112
| 41.177936
| 0.797252
| 0.002852
| 0
| 0.564706
| 0
| 0
| 0.120492
| 0.026006
| 0
| 0
| 0
| 0
| 0.278431
| 1
| 0.05098
| false
| 0
| 0.05098
| 0
| 0.109804
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
48a3544b31e455986bfc8e868fd2f4a544da1740
| 92
|
py
|
Python
|
jupyterhub/gpaw/rc.py
|
surf-sci-bc/deployment
|
2ba95751301c392a3ef81596f851aad2b1df5165
|
[
"MIT"
] | null | null | null |
jupyterhub/gpaw/rc.py
|
surf-sci-bc/deployment
|
2ba95751301c392a3ef81596f851aad2b1df5165
|
[
"MIT"
] | null | null | null |
jupyterhub/gpaw/rc.py
|
surf-sci-bc/deployment
|
2ba95751301c392a3ef81596f851aad2b1df5165
|
[
"MIT"
] | null | null | null |
setup_paths.insert(0, 'surfer-analysis/jupyter-data/gpaw_potentials/gpaw-setups-0.9.20000')
| 46
| 91
| 0.815217
| 15
| 92
| 4.866667
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088889
| 0.021739
| 92
| 1
| 92
| 92
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0.717391
| 0.717391
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
48c7674ad2772fd50927841e6903d8d1a609fc96
| 636
|
py
|
Python
|
script/test_checker.py
|
joint-song/incubator-gcm
|
6073194d54e7a89140598ec0f757e8742930a0c9
|
[
"Apache-2.0"
] | 14
|
2021-01-13T12:48:30.000Z
|
2021-09-18T00:43:14.000Z
|
script/test_checker.py
|
joint-song/incubator-gcm
|
6073194d54e7a89140598ec0f757e8742930a0c9
|
[
"Apache-2.0"
] | 32
|
2021-01-08T13:18:37.000Z
|
2021-09-24T10:46:55.000Z
|
script/test_checker.py
|
joint-song/incubator-gcm
|
6073194d54e7a89140598ec0f757e8742930a0c9
|
[
"Apache-2.0"
] | 5
|
2021-01-20T06:49:14.000Z
|
2021-09-24T06:25:26.000Z
|
#!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author: shicheng
@License: Apache Licence
@File: test_checker.py
@Time: 2021-01-29 12:28
@Contact: shicheng
@Site: ${SITE}
@Software: incubator-gcm
"""
from unittest import TestCase
import checker
class TestChecker(TestCase):
def test_checker_command(self):
self.assertTrue(checker.checker_command(command="pwd") == 0)
self.assertTrue(checker.checker_command(command="pwd1") == 1)
def test_checker_fd(self):
self.assertTrue(checker.checker_fd(source="checker.py") == 0)
self.assertTrue(checker.checker_fd(source="checker1.py") == 1)
| 24.461538
| 70
| 0.690252
| 82
| 636
| 5.231707
| 0.536585
| 0.130536
| 0.195804
| 0.261072
| 0.386946
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0.035514
| 0.158805
| 636
| 25
| 71
| 25.44
| 0.766355
| 0.309748
| 0
| 0
| 0
| 0
| 0.065268
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 1
| 0.222222
| false
| 0
| 0.222222
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
5b0ebd98378db5dfe730e715363075cc4ea47112
| 127
|
py
|
Python
|
apps/budget/admin.py
|
GuillaumeM92/La-Bouygue
|
a402efbc9746acb51cd7fc66ccdac4a45b854a22
|
[
"MIT"
] | null | null | null |
apps/budget/admin.py
|
GuillaumeM92/La-Bouygue
|
a402efbc9746acb51cd7fc66ccdac4a45b854a22
|
[
"MIT"
] | null | null | null |
apps/budget/admin.py
|
GuillaumeM92/La-Bouygue
|
a402efbc9746acb51cd7fc66ccdac4a45b854a22
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Budget, Funding
admin.site.register(Budget)
admin.site.register(Funding)
| 21.166667
| 35
| 0.818898
| 18
| 127
| 5.777778
| 0.555556
| 0.173077
| 0.326923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094488
| 127
| 5
| 36
| 25.4
| 0.904348
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d293ea3242ea41e46fe9ca7072a1ca9efae9d745
| 4,148
|
py
|
Python
|
tests/integration/test_cloudwatch_alarm_scheduler.py
|
mixe3y/terraform-aws-lambda-scheduler-stop-start
|
16b39f8dbf340d7f5d697edb81ae32eadb211304
|
[
"Apache-2.0"
] | null | null | null |
tests/integration/test_cloudwatch_alarm_scheduler.py
|
mixe3y/terraform-aws-lambda-scheduler-stop-start
|
16b39f8dbf340d7f5d697edb81ae32eadb211304
|
[
"Apache-2.0"
] | null | null | null |
tests/integration/test_cloudwatch_alarm_scheduler.py
|
mixe3y/terraform-aws-lambda-scheduler-stop-start
|
16b39f8dbf340d7f5d697edb81ae32eadb211304
|
[
"Apache-2.0"
] | null | null | null |
"""Tests for the cloudwatch alarm scheduler."""
import boto3
from package.scheduler.cloudwatch_handler import CloudWatchAlarmScheduler
from .fixture import create_cloudwatch_alarm
import pytest
@pytest.mark.parametrize(
"aws_region, cloudwatch_tag, scheduler_tag, result_count",
[
(
"eu-west-1",
[{"Key": "cloudwatch-scheduler-test-5", "Values": ["true"]}],
[{"Key": "cloudwatch-scheduler-test-5", "Values": ["true"]}],
False,
),
(
"eu-west-1",
[{"Key": "badtagkey", "Values": ["badtagvalue"]}],
[{"Key": "cloudwatch-scheduler-test-6", "Values": ["true"]}],
True,
),
(
"eu-west-2",
[{"Key": "cloudwatch-scheduler-test-7", "Values": ["true"]}],
[{"Key": "cloudwatch-scheduler-test-7", "Values": ["true"]}],
False,
),
(
"eu-west-2",
[{"Key": "badtagkey", "Values": ["badtagvalue"]}],
[{"Key": "cloudwatch-scheduler-test-8", "Values": ["true"]}],
True,
),
],
)
def test_stop_cloudwatch_alarms(
aws_region, cloudwatch_tag, scheduler_tag, result_count
):
"""Verify cloudwatch stop scheduler class method."""
client = boto3.client("cloudwatch", region_name=aws_region)
fake_tag = {"Key": "faketag", "Value": "true"}
alarm_tag = {
"Key": cloudwatch_tag[0]["Key"],
"Value": "".join(cloudwatch_tag[0]["Values"]),
}
try:
alarm1 = create_cloudwatch_alarm(aws_region, fake_tag)
alarm2 = create_cloudwatch_alarm(aws_region, alarm_tag)
cloudwatch_scheduler = CloudWatchAlarmScheduler(aws_region)
cloudwatch_scheduler.stop(scheduler_tag)
alarm1_status = client.describe_alarms(AlarmNames=[alarm1])
alarm2_status = client.describe_alarms(AlarmNames=[alarm2])
assert alarm1_status["MetricAlarms"][0]["ActionsEnabled"] == True
assert alarm2_status["MetricAlarms"][0]["ActionsEnabled"] == result_count
finally:
client.delete_alarms(AlarmNames=[alarm1, alarm2])
@pytest.mark.parametrize(
"aws_region, cloudwatch_tag, scheduler_tag, result_count",
[
(
"eu-west-1",
[{"Key": "cloudwatch-scheduler-test-9", "Values": ["true"]}],
[{"Key": "cloudwatch-scheduler-test-9", "Values": ["true"]}],
True,
),
(
"eu-west-1",
[{"Key": "badtagkey", "Values": ["badtagvalue"]}],
[{"Key": "cloudwatch-scheduler-test-10", "Values": ["true"]}],
False,
),
(
"eu-west-2",
[{"Key": "cloudwatch-scheduler-test-11", "Values": ["true"]}],
[{"Key": "cloudwatch-scheduler-test-11", "Values": ["true"]}],
True,
),
(
"eu-west-2",
[{"Key": "badtagkey", "Values": ["badtagvalue"]}],
[{"Key": "cloudwatch-scheduler-test-12", "Values": ["true"]}],
False,
),
],
)
def test_start_cloudwatch_alarms(
aws_region, cloudwatch_tag, scheduler_tag, result_count
):
"""Verify cloudwatch start scheduler class method."""
client = boto3.client("cloudwatch", region_name=aws_region)
fake_tag = {"Key": "faketag", "Value": "true"}
alarm_tag = {
"Key": cloudwatch_tag[0]["Key"],
"Value": "".join(cloudwatch_tag[0]["Values"]),
}
try:
alarm1 = create_cloudwatch_alarm(aws_region, fake_tag)
alarm2 = create_cloudwatch_alarm(aws_region, alarm_tag)
client.disable_alarm_actions(AlarmNames=[alarm1, alarm2])
cloudwatch_scheduler = CloudWatchAlarmScheduler(aws_region)
cloudwatch_scheduler.start(scheduler_tag)
alarm1_status = client.describe_alarms(AlarmNames=[alarm1])
alarm2_status = client.describe_alarms(AlarmNames=[alarm2])
assert alarm1_status["MetricAlarms"][0]["ActionsEnabled"] == False
assert alarm2_status["MetricAlarms"][0]["ActionsEnabled"] == result_count
finally:
client.delete_alarms(AlarmNames=[alarm1, alarm2])
| 36.069565
| 81
| 0.581726
| 402
| 4,148
| 5.80597
| 0.169154
| 0.130249
| 0.113111
| 0.133676
| 0.873608
| 0.869752
| 0.869752
| 0.681234
| 0.681234
| 0.681234
| 0
| 0.018375
| 0.25217
| 4,148
| 114
| 82
| 36.385965
| 0.734043
| 0.032787
| 0
| 0.718447
| 0
| 0
| 0.244745
| 0.082082
| 0
| 0
| 0
| 0
| 0.038835
| 1
| 0.019417
| false
| 0
| 0.038835
| 0
| 0.058252
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 5
|
d295880a3f3f7787536b747c2d896debf88f67c6
| 54
|
py
|
Python
|
nflows/nn/nde/__init__.py
|
Tennessee-Wallaceh/nflows
|
ac0bf432fc7904458a933ed14180f0ac26e3f93d
|
[
"MIT"
] | 522
|
2020-02-26T16:51:51.000Z
|
2022-03-31T15:38:48.000Z
|
nflows/nn/nde/__init__.py
|
Tennessee-Wallaceh/nflows
|
ac0bf432fc7904458a933ed14180f0ac26e3f93d
|
[
"MIT"
] | 47
|
2020-03-24T18:36:59.000Z
|
2022-03-25T09:47:18.000Z
|
nflows/nn/nde/__init__.py
|
Tennessee-Wallaceh/nflows
|
ac0bf432fc7904458a933ed14180f0ac26e3f93d
|
[
"MIT"
] | 77
|
2020-03-21T21:00:44.000Z
|
2022-03-31T00:41:51.000Z
|
from nflows.nn.nde.made import MixtureOfGaussiansMADE
| 27
| 53
| 0.87037
| 7
| 54
| 6.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074074
| 54
| 1
| 54
| 54
| 0.94
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d2e5334094048665315b057aa63e00fea30851a9
| 41
|
py
|
Python
|
ica/paraphraseator/measures/__init__.py
|
pedrorio/image_caption_augmentation
|
683ed90cecd4bc12f65dc238f1ff2dedbbc1b666
|
[
"MIT"
] | null | null | null |
ica/paraphraseator/measures/__init__.py
|
pedrorio/image_caption_augmentation
|
683ed90cecd4bc12f65dc238f1ff2dedbbc1b666
|
[
"MIT"
] | null | null | null |
ica/paraphraseator/measures/__init__.py
|
pedrorio/image_caption_augmentation
|
683ed90cecd4bc12f65dc238f1ff2dedbbc1b666
|
[
"MIT"
] | null | null | null |
from . import Jaccard, GLEAU, BLEAU, CHRF
| 41
| 41
| 0.756098
| 6
| 41
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 41
| 1
| 41
| 41
| 0.885714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
96082e272ed04633512bff5ad5bdfacc95861144
| 2,875
|
py
|
Python
|
tests/common/helpers/platform_api/chassis.py
|
arlakshm/sonic-mgmt
|
815511c030a14c3ed26924c44d27f596e4f4a2ae
|
[
"Apache-2.0"
] | 1
|
2021-09-15T17:09:13.000Z
|
2021-09-15T17:09:13.000Z
|
tests/common/helpers/platform_api/chassis.py
|
arlakshm/sonic-mgmt
|
815511c030a14c3ed26924c44d27f596e4f4a2ae
|
[
"Apache-2.0"
] | null | null | null |
tests/common/helpers/platform_api/chassis.py
|
arlakshm/sonic-mgmt
|
815511c030a14c3ed26924c44d27f596e4f4a2ae
|
[
"Apache-2.0"
] | null | null | null |
""" This module provides interface to interact with the chassis of the DUT
via platform API remotely """
import json
import logging
logger = logging.getLogger(__name__)
def chassis_api(conn, name, args=None):
if args is None:
args = []
conn.request('POST', '/platform/chassis/{}'.format(name), json.dumps({'args': args}))
resp = conn.getresponse()
res = json.loads(resp.read())['res']
logger.info('Executing chassis API: "{}", arguments: "{}", result: "{}"'.format(name, args, res))
return res
# NOTE: The get_change_event() method is not represented here because there is no reliable way
# to test this method in an automated fashion.
def get_base_mac(conn):
return chassis_api(conn, 'get_base_mac')
def get_serial_number(conn):
return chassis_api(conn, 'get_serial_number')
def get_system_eeprom_info(conn):
return chassis_api(conn, 'get_system_eeprom_info')
def get_reboot_cause(conn):
return chassis_api(conn, 'get_reboot_cause')
def get_num_components(conn):
return chassis_api(conn, 'get_num_components')
def get_all_components(conn):
return chassis_api(conn, 'get_all_components')
def get_component(conn, index):
return chassis_api(conn, 'get_component', [index])
def get_num_modules(conn):
return chassis_api(conn, 'get_num_modules')
def get_all_modules(conn):
return chassis_api(conn, 'get_all_modules')
def get_module(conn, index):
return chassis_api(conn, 'get_module', [index])
def get_num_fans(conn):
return chassis_api(conn, 'get_num_fans')
def get_all_fans(conn):
return chassis_api(conn, 'get_all_fans')
def get_fan(conn, index):
return chassis_api(conn, 'get_fan', [index])
def get_num_fan_drawers(conn):
return chassis_api(conn, 'get_num_fan_drawers')
def get_all_fan_drawers(conn):
return chassis_api(conn, 'get_all_fan_drawers')
def get_fan_drawer(conn, index):
return chassis_api(conn, 'get_fan_drawer', [index])
def get_num_psus(conn):
return chassis_api(conn, 'get_num_psus')
def get_all_psus(conn):
return chassis_api(conn, 'get_all_psus')
def get_psu(conn, index):
return chassis_api(conn, 'get_psu', [index])
def get_num_thermals(conn):
return chassis_api(conn, 'get_num_thermals')
def get_all_thermals(conn):
return chassis_api(conn, 'get_all_thermals')
def get_thermal(conn, index):
return chassis_api(conn, 'get_thermal', [index])
def get_thermal_manager(conn):
return chassis_api(conn, 'get_thermal_manager')
def get_num_sfps(conn):
return chassis_api(conn, 'get_num_sfps')
def get_all_sfps(conn):
return chassis_api(conn, 'get_all_sfps')
def get_sfp(conn, index):
return chassis_api(conn, 'get_sfp', [index])
def get_watchdog(conn):
return chassis_api(conn, 'get_watchdog')
def get_eeprom(conn):
return chassis_api(conn, 'get_eeprom')
| 21.616541
| 101
| 0.725217
| 433
| 2,875
| 4.498845
| 0.196305
| 0.154004
| 0.208419
| 0.287474
| 0.48614
| 0.48614
| 0.38193
| 0.073922
| 0
| 0
| 0
| 0
| 0.154783
| 2,875
| 132
| 102
| 21.780303
| 0.801646
| 0.082087
| 0
| 0
| 0
| 0
| 0.180434
| 0.008375
| 0
| 0
| 0
| 0
| 0
| 1
| 0.432836
| false
| 0
| 0.029851
| 0.41791
| 0.895522
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
8284c2b8b903787d60dbb94dd3550dd86c0e00c9
| 20
|
py
|
Python
|
JS_Udemy/ex10/doc.py
|
gabrielbatts/JavaScript
|
c58155224147d3bd08704c02b200ca1b3d8bbece
|
[
"MIT"
] | null | null | null |
JS_Udemy/ex10/doc.py
|
gabrielbatts/JavaScript
|
c58155224147d3bd08704c02b200ca1b3d8bbece
|
[
"MIT"
] | null | null | null |
JS_Udemy/ex10/doc.py
|
gabrielbatts/JavaScript
|
c58155224147d3bd08704c02b200ca1b3d8bbece
|
[
"MIT"
] | null | null | null |
print ('olá mundo');
| 20
| 20
| 0.65
| 3
| 20
| 4.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 20
| 1
| 20
| 20
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0.428571
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
82858f19301898ad9c2dc33d264b84b7ef480091
| 45
|
py
|
Python
|
Topics/List comprehension/Even numbers/main.py
|
valenciarichards/hypernews-portal
|
0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3
|
[
"MIT"
] | 1
|
2021-07-26T03:06:14.000Z
|
2021-07-26T03:06:14.000Z
|
Topics/List comprehension/Even numbers/main.py
|
valenciarichards/hypernews-portal
|
0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3
|
[
"MIT"
] | null | null | null |
Topics/List comprehension/Even numbers/main.py
|
valenciarichards/hypernews-portal
|
0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3
|
[
"MIT"
] | null | null | null |
print([x for x in my_numbers if x % 2 == 0])
| 22.5
| 44
| 0.6
| 11
| 45
| 2.363636
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.244444
| 45
| 1
| 45
| 45
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
82a5bacccb0af36940adf1a9e08fd9fdde40fcc2
| 67
|
py
|
Python
|
python/testData/breadcrumbs/functionNewLineCaretSpaceFunction.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/breadcrumbs/functionNewLineCaretSpaceFunction.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/breadcrumbs/functionNewLineCaretSpaceFunction.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
class A:
def foo(self):
pass
<caret> def abc(self):
pass
| 13.4
| 23
| 0.58209
| 11
| 67
| 3.545455
| 0.727273
| 0.410256
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.283582
| 67
| 5
| 24
| 13.4
| 0.8125
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.4
| 0
| null | null | 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
82d63f68b02aff61989cbe65362871af832b434b
| 4,757
|
bzl
|
Python
|
third_party/org_eclipse_jetty.bzl
|
wix/exodus
|
dfb0c9713b07a8b6a49b548b7b543021e748d80b
|
[
"MIT"
] | 186
|
2019-06-05T01:02:53.000Z
|
2022-03-31T10:44:19.000Z
|
third_party/org_eclipse_jetty.bzl
|
wix/exodus
|
dfb0c9713b07a8b6a49b548b7b543021e748d80b
|
[
"MIT"
] | 25
|
2019-06-04T23:18:55.000Z
|
2021-09-22T03:44:25.000Z
|
third_party/org_eclipse_jetty.bzl
|
wix/exodus
|
dfb0c9713b07a8b6a49b548b7b543021e748d80b
|
[
"MIT"
] | 17
|
2019-06-04T18:45:19.000Z
|
2022-01-20T09:40:04.000Z
|
load("//:import_external.bzl", import_external = "safe_wix_scala_maven_import_external")
def dependencies():
import_external(
name = "org_eclipse_jetty_jetty_annotations",
artifact = "org.eclipse.jetty:jetty-annotations:9.4.11.v20180605",
artifact_sha256 = "8f8ff86c70d77ea68306e4025c006a10e99b6753de6652f6fba455dc32a87c76",
srcjar_sha256 = "fbe8fa2e8217aaa7dfd6ce6728ad7470001dcbbe590278b02e5914f9ccca18f5",
deps = [
"@javax_annotation_javax_annotation_api",
"@org_eclipse_jetty_jetty_plus",
"@org_eclipse_jetty_jetty_webapp",
"@org_ow2_asm_asm",
"@org_ow2_asm_asm_commons"
],
)
import_external(
name = "org_eclipse_jetty_jetty_http",
artifact = "org.eclipse.jetty:jetty-http:9.4.11.v20180605",
artifact_sha256 = "963b75730aa92b0dfbe65fe8a2e413edc88aeb53e8686ba6b1617d7caeb14067",
srcjar_sha256 = "edd879e21254731a368ee518fa24784cb1fea64c2e7a5e860d131699e025725e",
deps = [
"@org_eclipse_jetty_jetty_io",
"@org_eclipse_jetty_jetty_util"
],
)
import_external(
name = "org_eclipse_jetty_jetty_io",
artifact = "org.eclipse.jetty:jetty-io:9.4.11.v20180605",
artifact_sha256 = "75c82d6e542a3518e2517c4084c83d8216ec2d2458f8747b8b5c944355ebd732",
srcjar_sha256 = "b896eeb9fd7c25aa1d0fa55218fb8309a9479bf06ab856d3f0799074cf20a48b",
deps = [
"@org_eclipse_jetty_jetty_util"
],
)
import_external(
name = "org_eclipse_jetty_jetty_server",
artifact = "org.eclipse.jetty:jetty-server:9.4.11.v20180605",
artifact_sha256 = "b74af5ac482b05c242ed231e00b7c08a0b6649f76f2e039a0885de0cf1376ef8",
srcjar_sha256 = "c1e41052cc549b4d19f40ff2a0204a6f5167843df2e4c3ece0e4c0ca56e17cd3",
deps = [
"@javax_servlet_javax_servlet_api//:linkable",
"@org_eclipse_jetty_jetty_http",
"@org_eclipse_jetty_jetty_io"
],
)
import_external(
name = "org_eclipse_jetty_jetty_util",
artifact = "org.eclipse.jetty:jetty-util:9.4.11.v20180605",
artifact_sha256 = "936e5ed74275c16164cc1eccaeae55900eb00edd9f1b1d3b83d70782dd25f505",
srcjar_sha256 = "0c9d8b1aa7cf2e14343ab5e5fdd88e9fb9677de918ddd0584032512e5e1d68b0",
)
import_external(
name = "org_eclipse_jetty_jetty_continuation",
artifact = "org.eclipse.jetty:jetty-continuation:9.4.11.v20180605",
artifact_sha256 = "0af8353dbe4ab06fb0020a380be60b2c2a63cd9430f5f199509ecd51dc3dd7cd",
srcjar_sha256 = "8972d2d1f70fc430082e18431005f2ac83dcb12468ef27fd346d38315632758d",
)
import_external(
name = "org_eclipse_jetty_jetty_security",
artifact = "org.eclipse.jetty:jetty-security:9.4.11.v20180605",
artifact_sha256 = "5a12b1c69264466004baff33b14fc1555007c86fb2fece2a420c480aa7f8ef56",
srcjar_sha256 = "88c2b9b92a8bc42dd2b1e1d590aba712434bcea46a98fafd94b0220403e911eb",
deps = [
"@org_eclipse_jetty_jetty_server"
],
)
import_external(
name = "org_eclipse_jetty_jetty_servlet",
artifact = "org.eclipse.jetty:jetty-servlet:9.4.11.v20180605",
artifact_sha256 = "e24f145a6d95c7653ad2fe0c34cf8ce7311effb7eb8ed9399fae63d8af63eaf4",
srcjar_sha256 = "d81f920493757237c30243dda04c7335043d017bc65893013391010e6df7eaa1",
deps = [
"@org_eclipse_jetty_jetty_security"
],
)
import_external(
name = "org_eclipse_jetty_jetty_servlets",
artifact = "org.eclipse.jetty:jetty-servlets:9.4.11.v20180605",
artifact_sha256 = "4bb0020bdf1e2cf644704f1aa3f652cfa4abca14b557d7714781eb059f5fff16",
srcjar_sha256 = "b4ce997fcd306d3ef46ee9066d491c2e5727febb9e4ad44222a7ae002bf61cc3",
deps = [
"@org_eclipse_jetty_jetty_continuation",
"@org_eclipse_jetty_jetty_http",
"@org_eclipse_jetty_jetty_io",
"@org_eclipse_jetty_jetty_util"
],
)
import_external(
name = "org_eclipse_jetty_jetty_webapp",
artifact = "org.eclipse.jetty:jetty-webapp:9.4.11.v20180605",
artifact_sha256 = "858f3f16cecb0891f07a4e8d82554201c513bf058c0f65969b366936155b6a36",
srcjar_sha256 = "5a5773df696f6e2b3b390a1f92478b9643cbaff5be70fca7b76760886a7edc71",
deps = [
"@org_eclipse_jetty_jetty_servlet",
"@org_eclipse_jetty_jetty_xml"
],
)
import_external(
name = "org_eclipse_jetty_jetty_xml",
artifact = "org.eclipse.jetty:jetty-xml:9.4.11.v20180605",
artifact_sha256 = "1780bdaee2b1908e032fbc286bb856d730c4d0c9de39d5e14a1b9c48028c295e",
srcjar_sha256 = "b9dc45359fb6a75b17802791bfba428d276da8f1dced56c1915746887c807a0f",
deps = [
"@org_eclipse_jetty_jetty_util"
],
)
| 33.737589
| 91
| 0.731554
| 387
| 4,757
| 8.571059
| 0.162791
| 0.114561
| 0.171842
| 0.229123
| 0.471812
| 0.281278
| 0.182092
| 0.090443
| 0.090443
| 0.090443
| 0
| 0.276022
| 0.182048
| 4,757
| 140
| 92
| 33.978571
| 0.576458
| 0
| 0
| 0.349057
| 0
| 0
| 0.613832
| 0.610469
| 0
| 0
| 0
| 0
| 0
| 1
| 0.009434
| true
| 0
| 0.113208
| 0
| 0.122642
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
82e2fca22975477ae8fbc90fe31a8c94a920336a
| 171
|
py
|
Python
|
apps/drl/chpZ01/loss_cross_entropy.py
|
yt7589/iching
|
6673da38f4c80e7fd297c86fedc5616aee8ac09b
|
[
"Apache-2.0"
] | 32
|
2020-04-14T08:32:18.000Z
|
2022-02-09T07:05:08.000Z
|
apps/drl/chpZ01/loss_cross_entropy.py
|
trinh-hoang-hiep/iching
|
e1feae5741c3cbde535d7a275b01d4f0cf9e21ed
|
[
"Apache-2.0"
] | 1
|
2020-04-08T10:42:15.000Z
|
2020-04-15T01:38:03.000Z
|
apps/drl/chpZ01/loss_cross_entropy.py
|
trinh-hoang-hiep/iching
|
e1feae5741c3cbde535d7a275b01d4f0cf9e21ed
|
[
"Apache-2.0"
] | 4
|
2020-08-25T03:56:46.000Z
|
2021-05-11T05:55:51.000Z
|
#
class LossCrossEntropy(object):
def __init__(self):
super().__init__()
def forward(self, input, target):
return input.cross_entropy(target)
| 21.375
| 42
| 0.643275
| 18
| 171
| 5.611111
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.239766
| 171
| 8
| 42
| 21.375
| 0.776923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
7d6b320920018b20d77667bb6b9006672090a368
| 441
|
py
|
Python
|
Latest/venv/Lib/site-packages/apptools/type_manager/__init__.py
|
adamcvj/SatelliteTracker
|
49a8f26804422fdad6f330a5548e9f283d84a55d
|
[
"Apache-2.0"
] | 1
|
2022-01-09T20:04:31.000Z
|
2022-01-09T20:04:31.000Z
|
Latest/venv/Lib/site-packages/apptools/type_manager/__init__.py
|
adamcvj/SatelliteTracker
|
49a8f26804422fdad6f330a5548e9f283d84a55d
|
[
"Apache-2.0"
] | 1
|
2022-02-15T12:01:57.000Z
|
2022-03-24T19:48:47.000Z
|
Latest/venv/Lib/site-packages/apptools/type_manager/__init__.py
|
adamcvj/SatelliteTracker
|
49a8f26804422fdad6f330a5548e9f283d84a55d
|
[
"Apache-2.0"
] | null | null | null |
#------------------------------------------------------------------------------
# Copyright (c) 2006 by Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
""" Manages type extensions, including factories to generate adapters, and
hooks for methods and functions. Part of the AppTools project of the
Enthought Tool Suite.
"""
from apptools.type_manager.api import *
| 44.1
| 79
| 0.480726
| 39
| 441
| 5.410256
| 0.846154
| 0.047393
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010256
| 0.115646
| 441
| 9
| 80
| 49
| 0.530769
| 0.854875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7d96b19079a89cd2badb19d66091bea24933ce02
| 299
|
py
|
Python
|
authentek/entrypoints/api/auth/serializers.py
|
eshta/authentek
|
c81e5e6bd3f0cc68f224fb92b663445f8d1ee4d4
|
[
"MIT"
] | null | null | null |
authentek/entrypoints/api/auth/serializers.py
|
eshta/authentek
|
c81e5e6bd3f0cc68f224fb92b663445f8d1ee4d4
|
[
"MIT"
] | null | null | null |
authentek/entrypoints/api/auth/serializers.py
|
eshta/authentek
|
c81e5e6bd3f0cc68f224fb92b663445f8d1ee4d4
|
[
"MIT"
] | null | null | null |
from authentek.entrypoints.api import api
from authentek.ext.restplus import custom_fields as fields
login_request = api.model('Login Request', {
'email': fields.Email(required=True, description="account email"),
'password': fields.String(required=True, description="account password")
})
| 33.222222
| 76
| 0.765886
| 37
| 299
| 6.135135
| 0.540541
| 0.114537
| 0.202643
| 0.264317
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113712
| 299
| 8
| 77
| 37.375
| 0.856604
| 0
| 0
| 0
| 0
| 0
| 0.183946
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.166667
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
7da39238c297872a2856060c542cb4009062b503
| 177
|
py
|
Python
|
Python/py-set-symmetric-difference-operation.py
|
DacioRomero/HackerRank
|
d1d43bd23e319bf8015a741eca70ba471a13c045
|
[
"MIT"
] | 1
|
2020-07-28T00:08:38.000Z
|
2020-07-28T00:08:38.000Z
|
Python/py-set-symmetric-difference-operation.py
|
DacioRomero/HackerRank
|
d1d43bd23e319bf8015a741eca70ba471a13c045
|
[
"MIT"
] | null | null | null |
Python/py-set-symmetric-difference-operation.py
|
DacioRomero/HackerRank
|
d1d43bd23e319bf8015a741eca70ba471a13c045
|
[
"MIT"
] | null | null | null |
def main():
_, english = input(), set(input().split())
_, french = input(), set(input().split())
print(len(english ^ french))
if __name__ == '__main__':
main()
| 22.125
| 46
| 0.570621
| 20
| 177
| 4.55
| 0.55
| 0.175824
| 0.285714
| 0.395604
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20904
| 177
| 7
| 47
| 25.285714
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0.045198
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0
| 0
| 0
| 0.166667
| 0.166667
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
7dd4f3531056e3cabcaae4f53c999681b8d51f15
| 1,170
|
py
|
Python
|
tests/test_global_cluster_roles.py
|
syamasakigoodrx/astronomer
|
0f1ca98bc04c46abe750bd9668aa75330601d300
|
[
"Apache-2.0"
] | 314
|
2018-11-21T13:20:57.000Z
|
2022-03-28T23:43:22.000Z
|
tests/test_global_cluster_roles.py
|
syamasakigoodrx/astronomer
|
0f1ca98bc04c46abe750bd9668aa75330601d300
|
[
"Apache-2.0"
] | 735
|
2018-11-22T04:32:03.000Z
|
2022-03-31T17:55:58.000Z
|
tests/test_global_cluster_roles.py
|
syamasakigoodrx/astronomer
|
0f1ca98bc04c46abe750bd9668aa75330601d300
|
[
"Apache-2.0"
] | 72
|
2018-11-22T17:05:10.000Z
|
2022-02-25T17:07:32.000Z
|
import pytest
from tests.helm_template_generator import render_chart
@pytest.mark.parametrize(
"cluster_roles,expected_kind",
[(True, "ClusterRole"), (False, "Role")],
)
def test_global_cluster_roles_commander_role(cluster_roles, expected_kind):
"""
Test global clusterRoles feature of commander role/rolebinding template
"""
docs = render_chart(
values={"global": {"clusterRoles": cluster_roles}},
show_only=["charts/astronomer/templates/commander/commander-role.yaml"],
)
assert len(docs) == 1
doc = docs[0]
assert doc["kind"] == expected_kind
@pytest.mark.parametrize(
"cluster_roles,expected_kind",
[(True, "ClusterRoleBinding"), (False, "RoleBinding")],
)
def test_global_cluster_roles_commander_rolebinding(cluster_roles, expected_kind):
"""
Test global clusterRoles feature of commander role/rolebinding template
"""
docs = render_chart(
values={"global": {"clusterRoles": cluster_roles}},
show_only=["charts/astronomer/templates/commander/commander-rolebinding.yaml"],
)
assert len(docs) == 1
doc = docs[0]
assert doc["kind"] == expected_kind
| 29.25
| 87
| 0.699145
| 130
| 1,170
| 6.069231
| 0.315385
| 0.121673
| 0.101394
| 0.121673
| 0.818758
| 0.818758
| 0.732573
| 0.732573
| 0.608365
| 0.608365
| 0
| 0.004137
| 0.173504
| 1,170
| 39
| 88
| 30
| 0.811789
| 0.122222
| 0
| 0.538462
| 0
| 0
| 0.264056
| 0.175703
| 0
| 0
| 0
| 0
| 0.153846
| 1
| 0.076923
| false
| 0
| 0.076923
| 0
| 0.153846
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
816fea86526daf322eb89f5f81f17bd82a931e22
| 13
|
py
|
Python
|
tests/snippets/print_const.py
|
gabhijit/RustPython
|
3eafcbec3d687a81606556b4f6815cc6825b7ef3
|
[
"MIT"
] | 112
|
2017-01-19T07:58:19.000Z
|
2022-02-10T12:58:01.000Z
|
tests/snippets/print_const.py
|
gabhijit/RustPython
|
3eafcbec3d687a81606556b4f6815cc6825b7ef3
|
[
"MIT"
] | 20
|
2016-10-29T16:01:31.000Z
|
2018-05-28T20:10:46.000Z
|
tests/snippets/print_const.py
|
gabhijit/RustPython
|
3eafcbec3d687a81606556b4f6815cc6825b7ef3
|
[
"MIT"
] | 7
|
2017-05-10T19:31:08.000Z
|
2018-12-24T03:05:48.000Z
|
print(2 + 3)
| 6.5
| 12
| 0.538462
| 3
| 13
| 2.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0.230769
| 13
| 1
| 13
| 13
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
817324220e02d1d21efbd1758d7c9f088a0397e4
| 1,126
|
py
|
Python
|
cowsay/lib/cows/turtle.py
|
Ovlic/cowsay_py
|
1ee8d11d6d895d7695d57e26003d71ce18379d3b
|
[
"MIT"
] | null | null | null |
cowsay/lib/cows/turtle.py
|
Ovlic/cowsay_py
|
1ee8d11d6d895d7695d57e26003d71ce18379d3b
|
[
"MIT"
] | null | null | null |
cowsay/lib/cows/turtle.py
|
Ovlic/cowsay_py
|
1ee8d11d6d895d7695d57e26003d71ce18379d3b
|
[
"MIT"
] | null | null | null |
def Turtle(thoughts, eyes, eye, tongue):
return f"""
{thoughts} ___-------___
{thoughts} _-~~ ~~-_
{thoughts} _-~ /~-_
/^\\__/^\\ /~ \\ / \\
/| {eye}|| {eye}| / \\_______________/ \\
| |___||__| / / \\ \\
| \\ / / \\ \\
| (_______) /______/ \\_________ \\
| {tongue} / / \\ / \\
\\ \\^\\\\ \\ / \\ /
\\ || \\______________/ _-_ //\\__//
\\ ||------_-~~-_ ------------- \\ --/~ ~\\ || __/
~-----||====/~ |==================| |/~~~~~
(_(__/ ./ / \\_\\ \\.
(_(___/ \\_____)_)
"""
| 62.555556
| 82
| 0.14476
| 14
| 1,126
| 5.214286
| 0.571429
| 0.246575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.647425
| 1,126
| 18
| 83
| 62.555556
| 0.183879
| 0
| 0
| 0
| 0
| 0
| 0.948536
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.055556
| false
| 0
| 0
| 0.055556
| 0.111111
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
81806a279cc0f41096648675bb9ea9e50c9dd81c
| 198
|
py
|
Python
|
ch1/1-2.hello_error.py
|
AngangGuo/pycrash
|
de48aa4198022c301f5cd3ce388c195a177be1b5
|
[
"MIT"
] | null | null | null |
ch1/1-2.hello_error.py
|
AngangGuo/pycrash
|
de48aa4198022c301f5cd3ce388c195a177be1b5
|
[
"MIT"
] | null | null | null |
ch1/1-2.hello_error.py
|
AngangGuo/pycrash
|
de48aa4198022c301f5cd3ce388c195a177be1b5
|
[
"MIT"
] | null | null | null |
print("Hello, World!")
# Typo
print(Hello)
# Hello, World!
# Traceback (most recent call last):
# File "hello.py", line 3, in <module>
# print(Hello)
# NameError: name 'Hello' is not defined
| 19.8
| 40
| 0.656566
| 28
| 198
| 4.642857
| 0.714286
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006211
| 0.186869
| 198
| 9
| 41
| 22
| 0.801242
| 0.747475
| 0
| 0
| 0
| 0
| 0.302326
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
81938a03f4ab32a73f0cf57047afdd21ac656225
| 55
|
py
|
Python
|
knight.py
|
smabe777/chess_master
|
a3d67da86ec0849f4c720ea85a9b9c70049edff7
|
[
"Apache-2.0"
] | null | null | null |
knight.py
|
smabe777/chess_master
|
a3d67da86ec0849f4c720ea85a9b9c70049edff7
|
[
"Apache-2.0"
] | null | null | null |
knight.py
|
smabe777/chess_master
|
a3d67da86ec0849f4c720ea85a9b9c70049edff7
|
[
"Apache-2.0"
] | null | null | null |
from piece import Piece
class Knight(Piece):
pass
| 11
| 23
| 0.727273
| 8
| 55
| 5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.218182
| 55
| 5
| 24
| 11
| 0.930233
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
81b015f5eff9762ac8b14c9cda1348cdac3f0b8a
| 1,242
|
py
|
Python
|
demos/wireworld/wireworld_diodes_demo.py
|
lantunes/netomaton
|
fef60a787d031c9c7b1eb4ff990f7c12145579ef
|
[
"Apache-2.0"
] | 35
|
2018-12-07T14:11:29.000Z
|
2022-03-17T23:47:21.000Z
|
demos/wireworld/wireworld_diodes_demo.py
|
lantunes/netomaton
|
fef60a787d031c9c7b1eb4ff990f7c12145579ef
|
[
"Apache-2.0"
] | 2
|
2020-03-15T06:45:39.000Z
|
2020-04-15T23:50:13.000Z
|
demos/wireworld/wireworld_diodes_demo.py
|
lantunes/netomaton
|
fef60a787d031c9c7b1eb4ff990f7c12145579ef
|
[
"Apache-2.0"
] | 6
|
2019-10-18T08:47:32.000Z
|
2022-03-02T10:17:12.000Z
|
import netomaton as ntm
from matplotlib.colors import ListedColormap
if __name__ == "__main__":
network = ntm.topology.cellular_automaton2d(rows=13, cols=14, neighbourhood="Moore")
initial_conditions = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
2, 1, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
2, 1, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 3,
0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
trajectory = ntm.evolve(initial_conditions=initial_conditions, network=network, timesteps=15,
activity_rule=ntm.rules.wireworld_rule)
ntm.animate_activities(trajectory, shape=(13, 14), interval=120, show_grid=True, show_margin=False, scale=0.3,
colormap=ListedColormap(["black", "blue", "red", "yellow"]))
| 41.4
| 114
| 0.47343
| 248
| 1,242
| 2.302419
| 0.205645
| 0.486865
| 0.69352
| 0.875657
| 0.318739
| 0.318739
| 0.318739
| 0.318739
| 0.318739
| 0.318739
| 0
| 0.236559
| 0.326087
| 1,242
| 29
| 115
| 42.827586
| 0.445639
| 0
| 0
| 0.434783
| 0
| 0
| 0.02496
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.086957
| 0
| 0.086957
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c4cd69db5107434ad8184c1d09d2709662d90c32
| 409
|
py
|
Python
|
scripts/patches/redshift.py
|
compose-x/troposphere
|
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
|
[
"BSD-2-Clause"
] | null | null | null |
scripts/patches/redshift.py
|
compose-x/troposphere
|
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
|
[
"BSD-2-Clause"
] | null | null | null |
scripts/patches/redshift.py
|
compose-x/troposphere
|
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
|
[
"BSD-2-Clause"
] | null | null | null |
patches = [
{
"op": "move",
"from": "/PropertyTypes/AWS::Redshift::ClusterParameterGroup.Parameter",
"path": "/PropertyTypes/AWS::Redshift::ClusterParameterGroup.AmazonRedshiftParameter",
},
{
"op": "replace",
"path": "/ResourceTypes/AWS::Redshift::ClusterParameterGroup/Properties/Parameters/ItemType",
"value": "AmazonRedshiftParameter",
},
]
| 31.461538
| 101
| 0.628362
| 27
| 409
| 9.518519
| 0.62963
| 0.128405
| 0.373541
| 0.350195
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.205379
| 409
| 12
| 102
| 34.083333
| 0.790769
| 0
| 0
| 0
| 0
| 0
| 0.667482
| 0.589242
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c4d4726d2fc69aedb02c5b90a70c34f0ec890a60
| 928
|
py
|
Python
|
bitfinexpy/bitfinex.py
|
Vanclief/bitfinex-python
|
45d4a27ae2cf734ebc669b5235c7b646d24de998
|
[
"MIT"
] | null | null | null |
bitfinexpy/bitfinex.py
|
Vanclief/bitfinex-python
|
45d4a27ae2cf734ebc669b5235c7b646d24de998
|
[
"MIT"
] | null | null | null |
bitfinexpy/bitfinex.py
|
Vanclief/bitfinex-python
|
45d4a27ae2cf734ebc669b5235c7b646d24de998
|
[
"MIT"
] | 1
|
2018-06-02T12:54:09.000Z
|
2018-06-02T12:54:09.000Z
|
from bitfinexpy.markets import Market
class Bitfinex(object):
def __init__(self, key=None, secret=None):
self.api_key = key
self.api_secret = secret
self.api_base = 'https://api.bitfinex.com/v1/'
self.name = 'Bitfinex'
self.market = Market(self.api_base)
def ticker(self, symbol):
return self.market.get_ticker(symbol)
def stats(self, symbol):
return self.market.get_stats(symbol)
def fundingbook(self, currency):
return self.market.get_fundingbook(currency)
def orderbook(self, symbol):
return self.market.get_orderbook(symbol)
def trades(self, symbol):
return self.market.get_trades(symbol)
def lends(self, currency):
return self.market.get_lends(currency)
def symbols(self):
return self.market.get_symbols()
def symbol_details(self):
return self.market.get_symbol_details()
| 25.777778
| 54
| 0.664871
| 118
| 928
| 5.076271
| 0.271186
| 0.15025
| 0.213689
| 0.253756
| 0.373957
| 0.297162
| 0
| 0
| 0
| 0
| 0
| 0.001401
| 0.230603
| 928
| 35
| 55
| 26.514286
| 0.837535
| 0
| 0
| 0
| 0
| 0
| 0.038793
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| false
| 0
| 0.041667
| 0.333333
| 0.791667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
c4daba3ed318654e76d52ef68535d1e2f05e9856
| 811
|
py
|
Python
|
tests/test_num.py
|
kosyachniy/lib
|
4174eb7b91b2c5908b47b353cc55cc617b74799f
|
[
"MIT"
] | null | null | null |
tests/test_num.py
|
kosyachniy/lib
|
4174eb7b91b2c5908b47b353cc55cc617b74799f
|
[
"MIT"
] | null | null | null |
tests/test_num.py
|
kosyachniy/lib
|
4174eb7b91b2c5908b47b353cc55cc617b74799f
|
[
"MIT"
] | null | null | null |
from libdev.num import is_float, to_num
def test_float():
assert is_float('0') == True
assert is_float('-0.') == True
assert is_float('-.0') == True
assert is_float('.1') == True
assert is_float('-.2') == True
assert is_float('-3.') == True
assert is_float('4.0') == True
assert is_float('-5.678') == True
assert is_float('6.7x') == False
assert is_float('-7..8') == False
assert is_float('') == False
assert is_float('.') == False
assert is_float(1) == True
assert is_float(-2.) == True
assert is_float(None) == False
def test_num():
assert to_num('0') == 0
assert to_num('1.') == 1
assert to_num('-2.0') == -2
assert to_num('3.45') == 3.45
assert to_num('-.0') == 0
assert to_num(-4.5) == -4.5
assert to_num(5.0) == 5
| 27.965517
| 39
| 0.568434
| 132
| 811
| 3.295455
| 0.189394
| 0.257471
| 0.448276
| 0.390805
| 0.595402
| 0.554023
| 0.554023
| 0.554023
| 0.349425
| 0.349425
| 0
| 0.064205
| 0.231813
| 811
| 28
| 40
| 28.964286
| 0.634029
| 0
| 0
| 0
| 0
| 0
| 0.059186
| 0
| 0
| 0
| 0
| 0
| 0.88
| 1
| 0.08
| true
| 0
| 0.04
| 0
| 0.12
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c4e4d166f9b1ff4c002f2d8d1133ee5d420bd2cd
| 253
|
py
|
Python
|
data_resource/generator/api_manager/__init__.py
|
brighthive/data-resource-generator
|
66154c5954ac287f2af25359b2abb0abb417b265
|
[
"MIT"
] | 2
|
2020-06-12T13:43:42.000Z
|
2020-06-28T00:25:40.000Z
|
data_resource/generator/api_manager/__init__.py
|
brighthive/data-resource-generator
|
66154c5954ac287f2af25359b2abb0abb417b265
|
[
"MIT"
] | 3
|
2020-07-01T00:17:48.000Z
|
2020-09-21T21:16:39.000Z
|
data_resource/generator/api_manager/__init__.py
|
brighthive/data-resource-generator
|
66154c5954ac287f2af25359b2abb0abb417b265
|
[
"MIT"
] | null | null | null |
from data_resource.generator.api_manager.core import (
VersionedResource,
VersionedResourceMany,
)
from data_resource.generator.api_manager.v1_0_0 import ResourceHandler
from data_resource.generator.api_manager.api_generator import generate_api
| 36.142857
| 74
| 0.857708
| 32
| 253
| 6.46875
| 0.4375
| 0.115942
| 0.231884
| 0.362319
| 0.507246
| 0.507246
| 0
| 0
| 0
| 0
| 0
| 0.013043
| 0.090909
| 253
| 6
| 75
| 42.166667
| 0.886957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f21ba378262527b62d4cca403f8351f98a97e0a5
| 15,798
|
py
|
Python
|
pybind/nos/v7_1_0/interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/__init__.py
|
shivharis/pybind
|
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
|
[
"Apache-2.0"
] | null | null | null |
pybind/nos/v7_1_0/interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/__init__.py
|
shivharis/pybind
|
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
|
[
"Apache-2.0"
] | null | null | null |
pybind/nos/v7_1_0/interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/__init__.py
|
shivharis/pybind
|
4e1c6d54b9fd722ccec25546ba2413d79ce337e6
|
[
"Apache-2.0"
] | 1
|
2021-11-05T22:15:42.000Z
|
2021-11-05T22:15:42.000Z
|
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
import interface
class servers(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-interface - based on the path /interface/port-channel/ipv6/interface-po-dhcp-conf/dhcp/relay/servers. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__relay_ip_addr','__server_vrf_name','__interface',)
_yang_name = 'servers'
_rest_name = 'servers'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__relay_ip_addr = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="relay-ip-addr", rest_name="address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'IPv6 address of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'address', u'cli-expose-key-name': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='dhcp-ipv6-address', is_config=True)
self.__interface = YANGDynClass(base=interface.interface, is_container='container', presence=False, yang_name="interface", rest_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Interface.', u'cli-compact-syntax': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='container', is_config=True)
self.__server_vrf_name = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..32']}), is_leaf=True, yang_name="server-vrf-name", rest_name="use-vrf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'VRF name of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'use-vrf'}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='common-def:vrf-name', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'interface', u'port-channel', u'ipv6', u'interface-po-dhcp-conf', u'dhcp', u'relay', u'servers']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'interface', u'Port-channel', u'ipv6', u'dhcp', u'relay', u'servers']
def _get_relay_ip_addr(self):
"""
Getter method for relay_ip_addr, mapped from YANG variable /interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/relay_ip_addr (dhcp-ipv6-address)
YANG Description: DHCPv6 server IPv6 address
"""
return self.__relay_ip_addr
def _set_relay_ip_addr(self, v, load=False):
"""
Setter method for relay_ip_addr, mapped from YANG variable /interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/relay_ip_addr (dhcp-ipv6-address)
If this variable is read-only (config: false) in the
source YANG file, then _set_relay_ip_addr is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_relay_ip_addr() directly.
YANG Description: DHCPv6 server IPv6 address
"""
parent = getattr(self, "_parent", None)
if parent is not None and load is False:
raise AttributeError("Cannot set keys directly when" +
" within an instantiated list")
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="relay-ip-addr", rest_name="address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'IPv6 address of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'address', u'cli-expose-key-name': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='dhcp-ipv6-address', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """relay_ip_addr must be of a type compatible with dhcp-ipv6-address""",
'defined-type': "brocade-dhcpv6:dhcp-ipv6-address",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="relay-ip-addr", rest_name="address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'IPv6 address of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'address', u'cli-expose-key-name': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='dhcp-ipv6-address', is_config=True)""",
})
self.__relay_ip_addr = t
if hasattr(self, '_set'):
self._set()
def _unset_relay_ip_addr(self):
self.__relay_ip_addr = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?'}), is_leaf=True, yang_name="relay-ip-addr", rest_name="address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'IPv6 address of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'address', u'cli-expose-key-name': None}}, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='dhcp-ipv6-address', is_config=True)
def _get_server_vrf_name(self):
"""
Getter method for server_vrf_name, mapped from YANG variable /interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/server_vrf_name (common-def:vrf-name)
YANG Description: Name of the VRF that the DHCPv6 server is within
"""
return self.__server_vrf_name
def _set_server_vrf_name(self, v, load=False):
"""
Setter method for server_vrf_name, mapped from YANG variable /interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/server_vrf_name (common-def:vrf-name)
If this variable is read-only (config: false) in the
source YANG file, then _set_server_vrf_name is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_server_vrf_name() directly.
YANG Description: Name of the VRF that the DHCPv6 server is within
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..32']}), is_leaf=True, yang_name="server-vrf-name", rest_name="use-vrf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'VRF name of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'use-vrf'}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='common-def:vrf-name', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """server_vrf_name must be of a type compatible with common-def:vrf-name""",
'defined-type': "common-def:vrf-name",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..32']}), is_leaf=True, yang_name="server-vrf-name", rest_name="use-vrf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'VRF name of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'use-vrf'}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='common-def:vrf-name', is_config=True)""",
})
self.__server_vrf_name = t
if hasattr(self, '_set'):
self._set()
def _unset_server_vrf_name(self):
self.__server_vrf_name = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.', 'length': [u'1..32']}), is_leaf=True, yang_name="server-vrf-name", rest_name="use-vrf", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'VRF name of the DHCPv6 server', u'cli-run-template': u'ipv6 dhcp relay address$(relay-ip-addr) $($(server-vrf-name)==.?: use-vrf $(server-vrf-name))\n', u'alt-name': u'use-vrf'}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='common-def:vrf-name', is_config=True)
def _get_interface(self):
"""
Getter method for interface, mapped from YANG variable /interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/interface (container)
YANG Description: Interface.
"""
return self.__interface
def _set_interface(self, v, load=False):
"""
Setter method for interface, mapped from YANG variable /interface/port_channel/ipv6/interface_po_dhcp_conf/dhcp/relay/servers/interface (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_interface is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_interface() directly.
YANG Description: Interface.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=interface.interface, is_container='container', presence=False, yang_name="interface", rest_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Interface.', u'cli-compact-syntax': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='container', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """interface must be of a type compatible with container""",
'defined-type': "container",
'generated-type': """YANGDynClass(base=interface.interface, is_container='container', presence=False, yang_name="interface", rest_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Interface.', u'cli-compact-syntax': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='container', is_config=True)""",
})
self.__interface = t
if hasattr(self, '_set'):
self._set()
def _unset_interface(self):
self.__interface = YANGDynClass(base=interface.interface, is_container='container', presence=False, yang_name="interface", rest_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Interface.', u'cli-compact-syntax': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dhcpv6', defining_module='brocade-dhcpv6', yang_type='container', is_config=True)
relay_ip_addr = __builtin__.property(_get_relay_ip_addr, _set_relay_ip_addr)
server_vrf_name = __builtin__.property(_get_server_vrf_name, _set_server_vrf_name)
interface = __builtin__.property(_get_interface, _set_interface)
_pyangbind_elements = {'relay_ip_addr': relay_ip_addr, 'server_vrf_name': server_vrf_name, 'interface': interface, }
| 74.872038
| 881
| 0.697557
| 2,406
| 15,798
| 4.387781
| 0.088529
| 0.034479
| 0.049256
| 0.01364
| 0.780904
| 0.753718
| 0.729469
| 0.710429
| 0.710429
| 0.701336
| 0
| 0.025537
| 0.122547
| 15,798
| 210
| 882
| 75.228571
| 0.736041
| 0.14255
| 0
| 0.37594
| 0
| 0.112782
| 0.45162
| 0.241712
| 0
| 0
| 0
| 0
| 0
| 1
| 0.090226
| false
| 0
| 0.067669
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
48139b22d8e652792719d4f363b1f445cff526f4
| 107
|
py
|
Python
|
src/vrp/__init__.py
|
larsupb/pyxfvrp
|
f258ec4d3c1068a8692ce7cb59d86ce6062827c7
|
[
"MIT"
] | 1
|
2020-11-28T16:36:46.000Z
|
2020-11-28T16:36:46.000Z
|
src/vrp/__init__.py
|
larsupb/pyxfvrp
|
f258ec4d3c1068a8692ce7cb59d86ce6062827c7
|
[
"MIT"
] | null | null | null |
src/vrp/__init__.py
|
larsupb/pyxfvrp
|
f258ec4d3c1068a8692ce7cb59d86ce6062827c7
|
[
"MIT"
] | null | null | null |
# Copyright (c) 2020. Lars Hackstein, Holger Schneider
from .vrp import VRP
from .savings import savings
| 21.4
| 55
| 0.766355
| 15
| 107
| 5.466667
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044944
| 0.168224
| 107
| 4
| 56
| 26.75
| 0.876404
| 0.485981
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4837125ac71dea25899f6f2d8e7e8297f19850f1
| 684
|
py
|
Python
|
Robustness/perceptron/utils/criteria/__init__.py
|
csdongxian/PaddleSleeve
|
4322d70ec21460e657a57f2fa9b09e5efc420efb
|
[
"Apache-2.0"
] | 38
|
2019-06-10T04:19:42.000Z
|
2022-02-15T05:21:23.000Z
|
Robustness/perceptron/utils/criteria/__init__.py
|
csdongxian/PaddleSleeve
|
4322d70ec21460e657a57f2fa9b09e5efc420efb
|
[
"Apache-2.0"
] | 4
|
2019-07-30T19:00:23.000Z
|
2019-09-26T01:35:05.000Z
|
Robustness/perceptron/utils/criteria/__init__.py
|
csdongxian/PaddleSleeve
|
4322d70ec21460e657a57f2fa9b09e5efc420efb
|
[
"Apache-2.0"
] | 10
|
2019-06-10T05:45:33.000Z
|
2021-04-22T08:33:28.000Z
|
"""Provides class to wrap all adversarial criterions
so that attacks has uniform API access.
"""
from .base import Criterion
from .base import CombinedCriteria
from .classification import Misclassification
from .classification import ConfidentMisclassification
from .classification import TopKMisclassification
from .classification import TargetClass
from .classification import OriginalClassProbability
from .classification import TargetClassProbability
from .classification import MisclassificationAntiPorn
from .classification import MisclassificationSafeSearch
from .detection import TargetClassMiss
from .detection import TargetClassMissGoogle
from .detection import WeightedAP
| 38
| 55
| 0.871345
| 66
| 684
| 9.030303
| 0.484848
| 0.241611
| 0.322148
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099415
| 684
| 17
| 56
| 40.235294
| 0.967532
| 0.130117
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4843a0b946adb347085185e19b29f8633b8c0435
| 419
|
py
|
Python
|
src/rec_errors.py
|
gmum/cwae
|
50592903c321de25f339f3b00cbd2143741e5037
|
[
"MIT"
] | 8
|
2019-05-13T21:03:53.000Z
|
2022-01-15T21:12:15.000Z
|
src/rec_errors.py
|
gmum/cwae
|
50592903c321de25f339f3b00cbd2143741e5037
|
[
"MIT"
] | null | null | null |
src/rec_errors.py
|
gmum/cwae
|
50592903c321de25f339f3b00cbd2143741e5037
|
[
"MIT"
] | 2
|
2020-05-23T21:46:21.000Z
|
2022-01-15T21:12:16.000Z
|
import tensorflow as tf
def euclidean_norm_squared(X, axis=None):
return tf.reduce_sum(tf.square(X), axis=axis)
def squared_euclidean_norm_reconstruction_error(input, output):
return euclidean_norm_squared(input - output, axis=1)
def mean_squared_euclidean_norm_reconstruction_error(x, y):
return tf.reduce_mean(squared_euclidean_norm_reconstruction_error(tf.layers.flatten(x), tf.layers.flatten(y)))
| 29.928571
| 114
| 0.804296
| 62
| 419
| 5.129032
| 0.387097
| 0.204403
| 0.188679
| 0.320755
| 0.393082
| 0.27044
| 0
| 0
| 0
| 0
| 0
| 0.002653
| 0.100239
| 419
| 13
| 115
| 32.230769
| 0.840849
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0.142857
| 0.428571
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
4848804160aff4508b2a374d3ee254661ce43f64
| 85
|
py
|
Python
|
astroduet/tests/test_import.py
|
bwgref/duet-astro
|
4fe3358bb927c0f03de1b75c01ddf2379b5771b3
|
[
"BSD-3-Clause"
] | 1
|
2019-04-15T21:02:57.000Z
|
2019-04-15T21:02:57.000Z
|
astroduet/tests/test_import.py
|
bwgref/duet-astro
|
4fe3358bb927c0f03de1b75c01ddf2379b5771b3
|
[
"BSD-3-Clause"
] | null | null | null |
astroduet/tests/test_import.py
|
bwgref/duet-astro
|
4fe3358bb927c0f03de1b75c01ddf2379b5771b3
|
[
"BSD-3-Clause"
] | 1
|
2019-04-17T19:46:42.000Z
|
2019-04-17T19:46:42.000Z
|
def test_import():
from astroduet.lightcurve import join_equal_gti_boundaries
| 14.166667
| 62
| 0.8
| 11
| 85
| 5.818182
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152941
| 85
| 5
| 63
| 17
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 1
| 0
| 1.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
4852a487b0d1061c1a0d00f03659bf31fd53bd15
| 367
|
py
|
Python
|
testinginput.py
|
joshuawallace/Fragile-Families-Challenge
|
c017f59085b374af535703ff8cd710eab78746e8
|
[
"MIT"
] | null | null | null |
testinginput.py
|
joshuawallace/Fragile-Families-Challenge
|
c017f59085b374af535703ff8cd710eab78746e8
|
[
"MIT"
] | null | null | null |
testinginput.py
|
joshuawallace/Fragile-Families-Challenge
|
c017f59085b374af535703ff8cd710eab78746e8
|
[
"MIT"
] | null | null | null |
import general_functions as general_f
output = general_f.data_open_and_process()
print output['survey_data_matched_to_outcomes_ids'][0:25]
print output['survey_data_matched_to_outcomes_ids'][-10:]
print output['training_outcomes_matched_to_outcomes_ids'][0:25]
print output['training_outcomes_matched_to_outcomes_ids'][-10:]
general_f.save_data_as_pickle(output)
| 30.583333
| 63
| 0.844687
| 58
| 367
| 4.827586
| 0.37931
| 0.157143
| 0.242857
| 0.285714
| 0.664286
| 0.65
| 0.65
| 0.65
| 0
| 0
| 0
| 0.028818
| 0.054496
| 367
| 12
| 64
| 30.583333
| 0.778098
| 0
| 0
| 0
| 0
| 0
| 0.413043
| 0.413043
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.142857
| null | null | 0.571429
| 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
| 1
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
48543799056b549027d000a4aa83ea50f65e68d2
| 1,520
|
py
|
Python
|
tests/test_misc.py
|
valiant1x/rfc3986
|
fd01b2723048ee8bf975cfe4833b3b88fb863358
|
[
"Apache-2.0"
] | null | null | null |
tests/test_misc.py
|
valiant1x/rfc3986
|
fd01b2723048ee8bf975cfe4833b3b88fb863358
|
[
"Apache-2.0"
] | null | null | null |
tests/test_misc.py
|
valiant1x/rfc3986
|
fd01b2723048ee8bf975cfe4833b3b88fb863358
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
from rfc3986.uri import URIReference
from rfc3986.misc import merge_paths
def test_merge_paths_with_base_path_without_base_authority():
"""Demonstrate merging with a base URI without an authority."""
base = URIReference(
scheme=None,
authority=None,
path="/foo/bar/bogus",
query=None,
fragment=None,
)
expected = "/foo/bar/relative"
assert merge_paths(base, "relative") == expected
def test_merge_paths_with_base_authority_and_path():
"""Demonstrate merging with a base URI with an authority and path."""
base = URIReference(
scheme=None,
authority="authority",
path="/foo/bar/bogus",
query=None,
fragment=None,
)
expected = "/foo/bar/relative"
assert merge_paths(base, "relative") == expected
def test_merge_paths_without_base_authority_or_path():
"""Demonstrate merging with a base URI without an authority or path."""
base = URIReference(
scheme=None, authority=None, path=None, query=None, fragment=None
)
expected = "/relative"
assert merge_paths(base, "relative") == expected
def test_merge_paths_with_base_authority_without_path():
"""Demonstrate merging with a base URI without an authority or path."""
base = URIReference(
scheme=None,
authority="authority",
path=None,
query=None,
fragment=None,
)
expected = "/relative"
assert merge_paths(base, "relative") == expected
| 29.230769
| 75
| 0.663816
| 181
| 1,520
| 5.38674
| 0.187845
| 0.092308
| 0.049231
| 0.069744
| 0.849231
| 0.849231
| 0.82359
| 0.744615
| 0.686154
| 0.636923
| 0
| 0.007673
| 0.228289
| 1,520
| 51
| 76
| 29.803922
| 0.823529
| 0.181579
| 0
| 0.657895
| 0
| 0
| 0.106296
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 1
| 0.105263
| false
| 0
| 0.052632
| 0
| 0.157895
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
485795da4e0eaf948dd1415792a76c2a6114dbf3
| 129
|
py
|
Python
|
cosypose/__init__.py
|
ompugao/cosypose
|
4e471c16f19d5ee632668cd52eaa57b562f287d6
|
[
"MIT"
] | 202
|
2020-08-19T19:28:03.000Z
|
2022-03-29T07:10:47.000Z
|
cosypose/__init__.py
|
ompugao/cosypose
|
4e471c16f19d5ee632668cd52eaa57b562f287d6
|
[
"MIT"
] | 66
|
2020-08-24T09:28:05.000Z
|
2022-03-31T07:11:06.000Z
|
cosypose/__init__.py
|
ompugao/cosypose
|
4e471c16f19d5ee632668cd52eaa57b562f287d6
|
[
"MIT"
] | 66
|
2020-08-19T19:28:05.000Z
|
2022-03-18T20:47:55.000Z
|
import os
os.environ['MKL_NUM_THREADS'] = '1'
os.environ['OMP_NUM_THREADS'] = '1'
print("Setting OMP and MKL num threads to 1.")
| 25.8
| 46
| 0.713178
| 23
| 129
| 3.826087
| 0.521739
| 0.340909
| 0.295455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026549
| 0.124031
| 129
| 4
| 47
| 32.25
| 0.752212
| 0
| 0
| 0
| 0
| 0
| 0.534884
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.25
| 0
| 0.25
| 0.25
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
486f9d945c4aee9b0691e8254563af09cb563538
| 89
|
py
|
Python
|
iqps/report/admin.py
|
thealphadollar/iqps
|
187f6b134d82e2dce951b356cb0c7151994ca3ab
|
[
"MIT"
] | 19
|
2020-05-04T14:29:22.000Z
|
2020-12-19T06:58:49.000Z
|
iqps/report/admin.py
|
thealphadollar/iqps
|
187f6b134d82e2dce951b356cb0c7151994ca3ab
|
[
"MIT"
] | 178
|
2015-06-28T19:42:13.000Z
|
2022-03-23T19:38:12.000Z
|
iqps/report/admin.py
|
thealphadollar/iqps
|
187f6b134d82e2dce951b356cb0c7151994ca3ab
|
[
"MIT"
] | 25
|
2020-07-05T18:29:17.000Z
|
2020-12-20T11:21:22.000Z
|
from django.contrib import admin
from .models import Report
admin.site.register(Report)
| 17.8
| 32
| 0.820225
| 13
| 89
| 5.615385
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11236
| 89
| 4
| 33
| 22.25
| 0.924051
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
6f8c6ad249b85fbbe71f00bf813110c8dca2135c
| 184
|
py
|
Python
|
service/src/scripts/openhouse/__init__.py
|
fjacob21/MAX
|
9cd9766262b49e9b1d425feb63e43b5d58707fd6
|
[
"MIT"
] | null | null | null |
service/src/scripts/openhouse/__init__.py
|
fjacob21/MAX
|
9cd9766262b49e9b1d425feb63e43b5d58707fd6
|
[
"MIT"
] | null | null | null |
service/src/scripts/openhouse/__init__.py
|
fjacob21/MAX
|
9cd9766262b49e9b1d425feb63e43b5d58707fd6
|
[
"MIT"
] | null | null | null |
import MAX
from .openhouse_script import openhouse_script
print('Loading open house script')
MAX.scripts.register('openhouse', 1, 'Script to open my house things', openhouse_script)
| 26.285714
| 88
| 0.798913
| 26
| 184
| 5.538462
| 0.576923
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006135
| 0.11413
| 184
| 6
| 89
| 30.666667
| 0.877301
| 0
| 0
| 0
| 0
| 0
| 0.347826
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.25
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
6f921100a217d272b8bb51530a17f19c71392b81
| 155
|
py
|
Python
|
kamsiyo_oss-rewards_Bash/base/admin.py
|
kamsiyo-laura/Voting
|
3d19f5b709ace356da0217a038fde139982a4569
|
[
"Apache-2.0"
] | null | null | null |
kamsiyo_oss-rewards_Bash/base/admin.py
|
kamsiyo-laura/Voting
|
3d19f5b709ace356da0217a038fde139982a4569
|
[
"Apache-2.0"
] | null | null | null |
kamsiyo_oss-rewards_Bash/base/admin.py
|
kamsiyo-laura/Voting
|
3d19f5b709ace356da0217a038fde139982a4569
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Address)
admin.site.register(Transaction)
| 19.375
| 33
| 0.76129
| 20
| 155
| 5.9
| 0.6
| 0.152542
| 0.288136
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154839
| 155
| 7
| 34
| 22.142857
| 0.900763
| 0.167742
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
6fa86ca012d84a4012028b39a7b9b7a565297fd3
| 5,293
|
py
|
Python
|
Damerau–Levenshtein_distance__misprints__опечатки/use__pyxdameraulevenshtein/example.py
|
gil9red/SimplePyScripts
|
c191ce08fbdeb29377639184579e392057945154
|
[
"CC-BY-4.0"
] | 117
|
2015-12-18T07:18:27.000Z
|
2022-03-28T00:25:54.000Z
|
Damerau–Levenshtein_distance__misprints__опечатки/use__pyxdameraulevenshtein/example.py
|
gil9red/SimplePyScripts
|
c191ce08fbdeb29377639184579e392057945154
|
[
"CC-BY-4.0"
] | 8
|
2018-10-03T09:38:46.000Z
|
2021-12-13T19:51:09.000Z
|
Damerau–Levenshtein_distance__misprints__опечатки/use__pyxdameraulevenshtein/example.py
|
gil9red/SimplePyScripts
|
c191ce08fbdeb29377639184579e392057945154
|
[
"CC-BY-4.0"
] | 28
|
2016-08-02T17:43:47.000Z
|
2022-03-21T08:31:12.000Z
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install pyxDamerauLevenshtein
# https://github.com/gfairchild/pyxDamerauLevenshtein
# SOURCE: https://github.com/gfairchild/pyxDamerauLevenshtein/blob/master/examples/examples.py
from pyxdameraulevenshtein import damerau_levenshtein_distance, normalized_damerau_levenshtein_distance, damerau_levenshtein_distance_ndarray, normalized_damerau_levenshtein_distance_ndarray
import random
import string
import timeit
import numpy as np
print('# edit distances (low edit distance means words are more similar):')
print("damerau_levenshtein_distance('{}', '{}') = {}".format('smtih', 'smith', damerau_levenshtein_distance('smtih', 'smith')))
print("damerau_levenshtein_distance('{}', '{}') = {}".format('snapple', 'apple', damerau_levenshtein_distance('snapple', 'apple')))
print("damerau_levenshtein_distance('{}', '{}') = {}".format('testing', 'testtn', damerau_levenshtein_distance('testing', 'testtn')))
print("damerau_levenshtein_distance('{}', '{}') = {}".format('saturday', 'sunday', damerau_levenshtein_distance('saturday', 'sunday')))
print("damerau_levenshtein_distance('{}', '{}') = {}".format('Saturday', 'saturday', damerau_levenshtein_distance('Saturday', 'saturday')))
print("damerau_levenshtein_distance('{}', '{}') = {}".format('orange', 'pumpkin', damerau_levenshtein_distance('orange', 'pumpkin')))
print("damerau_levenshtein_distance('{}', '{}') = {}".format('gifts', 'profit', damerau_levenshtein_distance('gifts', 'profit')))
print("damerau_levenshtein_distance('{}', '{}') = {} # unicode example\n".format('Sjöstedt', 'Sjostedt', damerau_levenshtein_distance('Sjöstedt', 'Sjostedt'))) # unicode example
print('# normalized edit distances (low ratio means words are similar):')
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('smtih', 'smith', normalized_damerau_levenshtein_distance('smtih', 'smith')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('snapple', 'apple', normalized_damerau_levenshtein_distance('snapple', 'apple')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('testing', 'testtn', normalized_damerau_levenshtein_distance('testing', 'testtn')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('saturday', 'sunday', normalized_damerau_levenshtein_distance('saturday', 'sunday')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('Saturday', 'saturday', normalized_damerau_levenshtein_distance('Saturday', 'saturday')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('orange', 'pumpkin', normalized_damerau_levenshtein_distance('orange', 'pumpkin')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {}".format('gifts', 'profit', normalized_damerau_levenshtein_distance('gifts', 'profit')))
print("normalized_damerau_levenshtein_distance('{}', '{}') = {} # unicode example\n".format('Sjöstedt', 'Sjostedt', normalized_damerau_levenshtein_distance('Sjöstedt', 'Sjostedt'))) # unicode example
print('# edit distances for a single sequence against an array of sequences')
array = np.array(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'])
print("damerau_levenshtein_distance_ndarray('{}', np.array({})) = {}".format('Saturday', array, damerau_levenshtein_distance_ndarray('Saturday', array)))
print("normalized_damerau_levenshtein_distance_ndarray('{}', np.array({})) = {}\n".format('Saturday', array, normalized_damerau_levenshtein_distance_ndarray('Saturday', array)))
print('# normalized edit distances for a single sequence against an array of sequences - unicode')
array = np.array(['Sjöstedt', 'Sjostedt', 'Söstedt', 'Sjöedt'])
print("damerau_levenshtein_distance_ndarray('{}', np.array({})) = {}".format('Sjöstedt', array, damerau_levenshtein_distance_ndarray('Sjöstedt', array)))
print("normalized_damerau_levenshtein_distance_ndarray('{}', np.array({})) = {}\n".format('Sjöstedt', array, normalized_damerau_levenshtein_distance_ndarray('Sjöstedt', array)))
# random words will be comprised of ascii letters, numbers, and spaces
print('# performance testing:')
chars = string.ascii_letters + string.digits + ' '
word1 = ''.join([random.choice(chars) for i in range(30)]) # generate a random string of characters of length 30
word2 = ''.join([random.choice(chars) for i in range(30)]) # and another
print("""\
timeit.timeit("damerau_levenshtein_distance('{}', '{}')",
'from pyxdameraulevenshtein import damerau_levenshtein_distance',
number=500000)
= {} seconds""".format(
word1, word2, timeit.timeit("damerau_levenshtein_distance('{}', '{}')".format(word1, word2),
'from pyxdameraulevenshtein import damerau_levenshtein_distance',
number=500000))
)
print("""\
timeit.timeit("damerau_levenshtein_distance('{}', '{}')",
'from pyxdameraulevenshtein import damerau_levenshtein_distance', number=500000)
= {} seconds # short-circuit makes this faster""".format(
word1, word1, timeit.timeit("damerau_levenshtein_distance('{}', '{}')".format(word1, word1),
'from pyxdameraulevenshtein import damerau_levenshtein_distance',
number=500000))
)
| 74.549296
| 201
| 0.72303
| 533
| 5,293
| 6.915572
| 0.204503
| 0.253934
| 0.366793
| 0.214867
| 0.790288
| 0.739826
| 0.366251
| 0.309821
| 0.183939
| 0.131308
| 0
| 0.008776
| 0.095787
| 5,293
| 70
| 202
| 75.614286
| 0.761387
| 0.073115
| 0
| 0.169811
| 0
| 0
| 0.520629
| 0.242647
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.169811
| 0
| 0.169811
| 0.509434
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
6fc641c019f222af70678e1139524ef37f90cf1d
| 292
|
py
|
Python
|
vermin/printing.py
|
loganswartz/vermin
|
55f159a229adf16690fed1d4f884594471f37abc
|
[
"MIT"
] | 261
|
2018-03-06T20:01:23.000Z
|
2022-03-25T15:37:41.000Z
|
vermin/printing.py
|
loganswartz/vermin
|
55f159a229adf16690fed1d4f884594471f37abc
|
[
"MIT"
] | 78
|
2018-03-07T10:12:29.000Z
|
2022-03-04T14:50:16.000Z
|
vermin/printing.py
|
loganswartz/vermin
|
55f159a229adf16690fed1d4f884594471f37abc
|
[
"MIT"
] | 20
|
2018-03-08T20:47:12.000Z
|
2022-03-08T16:26:30.000Z
|
def nprint(msg, config):
if not config.quiet():
print(msg)
def verbose_print(msg, level, config):
if config.verbose() >= level and not config.quiet():
print(msg)
def vprint(msg, config):
verbose_print(msg, 1, config)
def vvprint(msg, config):
verbose_print(msg, 2, config)
| 20.857143
| 54
| 0.684932
| 44
| 292
| 4.477273
| 0.340909
| 0.203046
| 0.228426
| 0.192893
| 0.497462
| 0.253807
| 0
| 0
| 0
| 0
| 0
| 0.008264
| 0.171233
| 292
| 13
| 55
| 22.461538
| 0.805785
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0
| 0.4
| 0.8
| 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
| 1
|
0
| 5
|
d25f33cceb139f56a2fbf429d0903a0e40e12396
| 39
|
py
|
Python
|
tests/units/models/__init__.py
|
nilin/vmcnet
|
1d04acf6e99a265671bf276a53c111c3e77a7f14
|
[
"MIT"
] | 17
|
2021-12-16T20:50:51.000Z
|
2021-12-20T01:00:32.000Z
|
tests/units/models/__init__.py
|
nilin/vmcnet
|
1d04acf6e99a265671bf276a53c111c3e77a7f14
|
[
"MIT"
] | 6
|
2021-12-16T01:14:20.000Z
|
2022-03-16T01:41:50.000Z
|
tests/units/models/__init__.py
|
nilin/vmcnet
|
1d04acf6e99a265671bf276a53c111c3e77a7f14
|
[
"MIT"
] | 4
|
2021-12-15T18:50:20.000Z
|
2021-12-22T18:42:57.000Z
|
"""Unit tests for model components."""
| 19.5
| 38
| 0.692308
| 5
| 39
| 5.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128205
| 39
| 1
| 39
| 39
| 0.794118
| 0.820513
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
96288d3d5dbd7b97b70946a75b5ae7056205bb62
| 65
|
py
|
Python
|
venv/Lib/site-packages/mpy_cross/__main__.py
|
webdeveloperninja/MicropythonAzureIoTHubMqttConnection
|
98869de4dc59692e4e498069288f69773b697e21
|
[
"Unlicense"
] | 1
|
2022-02-22T11:58:46.000Z
|
2022-02-22T11:58:46.000Z
|
venv/Lib/site-packages/mpy_cross/__main__.py
|
webdeveloperninja/MicropythonAzureIoTHubMqttConnection
|
98869de4dc59692e4e498069288f69773b697e21
|
[
"Unlicense"
] | null | null | null |
venv/Lib/site-packages/mpy_cross/__main__.py
|
webdeveloperninja/MicropythonAzureIoTHubMqttConnection
|
98869de4dc59692e4e498069288f69773b697e21
|
[
"Unlicense"
] | 1
|
2021-09-18T07:06:49.000Z
|
2021-09-18T07:06:49.000Z
|
import sys
from . import run
sys.exit(run(*sys.argv[1:]).wait())
| 16.25
| 35
| 0.676923
| 12
| 65
| 3.666667
| 0.666667
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0.107692
| 65
| 4
| 35
| 16.25
| 0.741379
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
962bc3d424757abc6df882d9d5137426db1757da
| 174
|
py
|
Python
|
koapy/cli/commands/disable/__init__.py
|
webclinic017/koapy
|
0cdbfac6a10c70e83df800a3a4362872b8792aba
|
[
"MIT"
] | null | null | null |
koapy/cli/commands/disable/__init__.py
|
webclinic017/koapy
|
0cdbfac6a10c70e83df800a3a4362872b8792aba
|
[
"MIT"
] | null | null | null |
koapy/cli/commands/disable/__init__.py
|
webclinic017/koapy
|
0cdbfac6a10c70e83df800a3a4362872b8792aba
|
[
"MIT"
] | null | null | null |
import click
from .auto_login import auto_login
@click.group(short_help="Disable things, including auto login.")
def disable():
pass
disable.add_command(auto_login)
| 14.5
| 64
| 0.770115
| 25
| 174
| 5.16
| 0.6
| 0.27907
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 174
| 11
| 65
| 15.818182
| 0.86
| 0
| 0
| 0
| 0
| 0
| 0.212644
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| true
| 0.166667
| 0.333333
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
962d078ee979655cbcc8081acd9fc845beee40d2
| 49
|
py
|
Python
|
crims2s/__init__.py
|
crim-ca/crims2s
|
0392fe320b819cf71b22522ea1d6b6e3cddf5142
|
[
"MIT"
] | 7
|
2021-11-06T03:42:04.000Z
|
2022-03-22T00:48:24.000Z
|
crims2s/__init__.py
|
crim-ca/crims2s
|
0392fe320b819cf71b22522ea1d6b6e3cddf5142
|
[
"MIT"
] | 1
|
2021-12-03T18:54:12.000Z
|
2021-12-03T18:54:12.000Z
|
crims2s/__init__.py
|
crim-ca/crims2s
|
0392fe320b819cf71b22522ea1d6b6e3cddf5142
|
[
"MIT"
] | 5
|
2021-11-06T02:08:19.000Z
|
2022-03-31T02:48:37.000Z
|
from . import dask
dask.load_project_defaults()
| 12.25
| 28
| 0.795918
| 7
| 49
| 5.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122449
| 49
| 3
| 29
| 16.333333
| 0.860465
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
9688d4f1122faf65a43fdf220917c0d895bda285
| 72,638
|
py
|
Python
|
activity/models.py
|
ranadeepmitra21/WeVoteServer_Ranadeep
|
505945209aad5cef21e118b5bfa7f63d0bd462da
|
[
"MIT"
] | 2
|
2021-11-11T11:02:02.000Z
|
2021-11-11T11:02:15.000Z
|
activity/models.py
|
ranadeepmitra21/WeVoteServer_Ranadeep
|
505945209aad5cef21e118b5bfa7f63d0bd462da
|
[
"MIT"
] | null | null | null |
activity/models.py
|
ranadeepmitra21/WeVoteServer_Ranadeep
|
505945209aad5cef21e118b5bfa7f63d0bd462da
|
[
"MIT"
] | null | null | null |
# activity/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.db import models
from django.db.models import Q
from django.utils.timezone import now
from datetime import timedelta
import json
from wevote_functions.functions import positive_value_exists
from wevote_settings.models import fetch_next_we_vote_id_activity_notice_seed_integer, \
fetch_next_we_vote_id_activity_comment_integer, fetch_next_we_vote_id_activity_post_integer, \
fetch_site_unique_id_prefix
# Kind of Seeds
NOTICE_ACTIVITY_POST_SEED = 'NOTICE_ACTIVITY_POST_SEED'
NOTICE_FRIEND_ENDORSEMENTS_SEED = 'NOTICE_FRIEND_ENDORSEMENTS_SEED'
NOTICE_VOTER_DAILY_SUMMARY_SEED = 'NOTICE_VOTER_DAILY_SUMMARY_SEED' # Activity that touches each voter, for each day
# Kind of Notices
NOTICE_FRIEND_ACTIVITY_POSTS = 'NOTICE_FRIEND_ACTIVITY_POSTS' # Notice shown in header menu, no email sent
NOTICE_FRIEND_ENDORSEMENTS = 'NOTICE_FRIEND_ENDORSEMENTS'
NOTICE_VOTER_DAILY_SUMMARY = 'NOTICE_VOTER_DAILY_SUMMARY' # Email sent, not shown in header menu
FRIENDS_ONLY = 'FRIENDS_ONLY'
SHOW_PUBLIC = 'SHOW_PUBLIC'
class ActivityComment(models.Model):
"""
A voter-created comment on another item (like an ActivityPost)
"""
# The ultimate parent of all comments
parent_we_vote_id = models.CharField(max_length=255, default=None, null=True, db_index=True)
# The comment that is the parent of this comment (only used when a comment on a comment)
parent_comment_we_vote_id = models.CharField(max_length=255, default=None, null=True, db_index=True)
commenter_name = models.CharField(max_length=255, default=None, null=True)
commenter_organization_we_vote_id = models.CharField(max_length=255, default=None, null=True)
commenter_twitter_followers_count = models.PositiveIntegerField(default=None, null=True)
commenter_twitter_handle = models.CharField(max_length=255, default=None, null=True)
commenter_voter_we_vote_id = models.CharField(max_length=255, default=None, null=True)
commenter_profile_image_url_medium = models.TextField(blank=True, null=True)
commenter_profile_image_url_tiny = models.TextField(blank=True, null=True)
date_created = models.DateTimeField(null=True)
date_last_changed = models.DateTimeField(verbose_name='date last changed', null=True, auto_now=True)
deleted = models.BooleanField(default=False)
statement_text = models.TextField(null=True, blank=True)
visibility_is_public = models.BooleanField(default=False)
we_vote_id = models.CharField(max_length=255, default=None, null=True, unique=True, db_index=True)
# We override the save function so we can auto-generate we_vote_id
def save(self, *args, **kwargs):
# Even if this data came from another source we still need a unique we_vote_id
if self.we_vote_id:
self.we_vote_id = self.we_vote_id.strip().lower()
if self.we_vote_id == "" or self.we_vote_id is None: # If there isn't a value...
# ...generate a new id
site_unique_id_prefix = fetch_site_unique_id_prefix()
next_local_integer = fetch_next_we_vote_id_activity_comment_integer()
# "wv" = We Vote
# site_unique_id_prefix = a generated (or assigned) unique id for one server running We Vote
# "comment" = tells us this is a unique id for an ActivityPost
# next_integer = a unique, sequential integer for this server - not necessarily tied to database id
self.we_vote_id = "wv{site_unique_id_prefix}comment{next_integer}".format(
site_unique_id_prefix=site_unique_id_prefix,
next_integer=next_local_integer,
)
super(ActivityComment, self).save(*args, **kwargs)
class ActivityManager(models.Manager):
def __unicode__(self):
return "ActivityManager"
def create_activity_notice(
self,
activity_notice_seed_id=0,
activity_tidbit_we_vote_id='',
date_of_notice=None,
kind_of_notice=None,
kind_of_seed=None,
number_of_comments=0,
number_of_likes=0,
position_name_list_serialized=None,
position_we_vote_id_list_serialized=None,
recipient_voter_we_vote_id='',
send_to_email=False,
send_to_sms=False,
speaker_name='',
speaker_organization_we_vote_id='',
speaker_voter_we_vote_id='',
speaker_profile_image_url_medium='',
speaker_profile_image_url_tiny='',
statement_text_preview=''):
status = ''
if not positive_value_exists(speaker_organization_we_vote_id):
activity_notice = None
results = {
'success': False,
'status': "ACTIVITY_NOTICE_MISSING_SPEAKER_ORG_ID ",
'activity_notice_saved': False,
'activity_notice': activity_notice,
}
return results
try:
new_positions_entered_count = 0
if positive_value_exists(position_we_vote_id_list_serialized):
position_we_vote_id_list = json.loads(position_we_vote_id_list_serialized)
new_positions_entered_count += len(position_we_vote_id_list)
activity_notice = ActivityNotice.objects.create(
activity_notice_seed_id=activity_notice_seed_id,
activity_tidbit_we_vote_id=activity_tidbit_we_vote_id,
date_of_notice=date_of_notice,
kind_of_notice=kind_of_notice,
kind_of_seed=kind_of_seed,
new_positions_entered_count=new_positions_entered_count,
number_of_comments=number_of_comments,
number_of_likes=number_of_likes,
position_name_list_serialized=position_name_list_serialized,
position_we_vote_id_list_serialized=position_we_vote_id_list_serialized,
recipient_voter_we_vote_id=recipient_voter_we_vote_id,
send_to_email=send_to_email,
send_to_sms=send_to_sms,
speaker_name=speaker_name,
speaker_organization_we_vote_id=speaker_organization_we_vote_id,
speaker_voter_we_vote_id=speaker_voter_we_vote_id,
speaker_profile_image_url_medium=speaker_profile_image_url_medium,
speaker_profile_image_url_tiny=speaker_profile_image_url_tiny,
statement_text_preview=statement_text_preview
)
activity_notice_saved = True
success = True
status += "ACTIVITY_NOTICE_CREATED "
except Exception as e:
activity_notice_saved = False
activity_notice = None
success = False
status += "ACTIVITY_NOTICE_NOT_CREATED: " + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_saved': activity_notice_saved,
'activity_notice': activity_notice,
}
return results
def create_activity_notice_seed(
self,
activity_notices_created=False,
activity_notices_scheduled=False,
activity_tidbit_we_vote_ids_for_friends_serialized='',
activity_tidbit_we_vote_ids_for_public_serialized='',
date_of_notice=None,
kind_of_seed=None,
position_names_for_friends_serialized='',
position_names_for_public_serialized='',
position_we_vote_ids_for_friends_serialized='',
position_we_vote_ids_for_public_serialized='',
recipient_name='',
recipient_voter_we_vote_id='',
send_to_email=False, # For VOTER_DAILY_SUMMARY
send_to_sms=False, # For VOTER_DAILY_SUMMARY
speaker_name='',
speaker_organization_we_vote_id='',
speaker_organization_we_vote_ids_serialized=None,
speaker_voter_we_vote_id='',
speaker_voter_we_vote_ids_serialized=None,
speaker_profile_image_url_medium='',
speaker_profile_image_url_tiny='',
statement_text_preview=''):
status = ''
if not positive_value_exists(speaker_organization_we_vote_id) \
and not positive_value_exists(recipient_voter_we_vote_id):
activity_notice_seed = None
results = {
'success': False,
'status': "ACTIVITY_NOTICE_SEED_MISSING_SPEAKER_AND_LISTENER ",
'activity_notice_seed_saved': False,
'activity_notice_seed': activity_notice_seed,
}
return results
try:
activity_notice_seed = ActivityNoticeSeed.objects.create(
activity_notices_created=activity_notices_created,
activity_notices_scheduled=activity_notices_scheduled,
activity_tidbit_we_vote_ids_for_friends_serialized=activity_tidbit_we_vote_ids_for_friends_serialized,
activity_tidbit_we_vote_ids_for_public_serialized=activity_tidbit_we_vote_ids_for_public_serialized,
date_of_notice=date_of_notice,
kind_of_seed=kind_of_seed,
position_names_for_friends_serialized=position_names_for_friends_serialized,
position_names_for_public_serialized=position_names_for_public_serialized,
position_we_vote_ids_for_friends_serialized=position_we_vote_ids_for_friends_serialized,
position_we_vote_ids_for_public_serialized=position_we_vote_ids_for_public_serialized,
recipient_name=recipient_name,
recipient_voter_we_vote_id=recipient_voter_we_vote_id,
send_to_email=send_to_email,
send_to_sms=send_to_sms,
speaker_name=speaker_name,
speaker_organization_we_vote_id=speaker_organization_we_vote_id,
speaker_organization_we_vote_ids_serialized=speaker_organization_we_vote_ids_serialized,
speaker_voter_we_vote_id=speaker_voter_we_vote_id,
speaker_voter_we_vote_ids_serialized=speaker_voter_we_vote_ids_serialized,
speaker_profile_image_url_medium=speaker_profile_image_url_medium,
speaker_profile_image_url_tiny=speaker_profile_image_url_tiny,
statement_text_preview=statement_text_preview
)
activity_notice_seed_saved = True
success = True
status += "ACTIVITY_NOTICE_SEED_CREATED "
except Exception as e:
activity_notice_seed_saved = False
activity_notice_seed = None
success = False
status += "ACTIVITY_NOTICE_SEED_NOT_CREATED: " + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_seed_saved': activity_notice_seed_saved,
'activity_notice_seed': activity_notice_seed,
}
return results
def create_activity_post(
self,
sender_voter_we_vote_id,
sender_voter_sms,
recipient_voter_we_vote_id='',
recipient_sms_we_vote_id='',
recipient_voter_sms='',
template_variables_in_json='',
kind_of_sms_template=''):
status = ""
success = True
try:
activity_post = ActivityPost.objects.create(
kind_of_sms_template=kind_of_sms_template,
recipient_voter_we_vote_id=recipient_voter_we_vote_id,
recipient_sms_we_vote_id=recipient_sms_we_vote_id,
recipient_voter_sms=recipient_voter_sms,
sender_voter_we_vote_id=sender_voter_we_vote_id,
sender_voter_sms=sender_voter_sms,
template_variables_in_json=template_variables_in_json,
)
activity_post_saved = True
success = True
status += "SMS_DESCRIPTION_CREATED "
except Exception as e:
activity_post_saved = False
activity_post = ActivityPost()
success = False
status += "SMS_DESCRIPTION_NOT_CREATED " + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_post_saved': activity_post_saved,
'activity_post': activity_post,
}
return results
def fetch_number_of_comments(self, parent_we_vote_id='', parent_comment_we_vote_id=''):
results = self.retrieve_number_of_comments(
parent_we_vote_id=parent_we_vote_id,
parent_comment_we_vote_id=parent_comment_we_vote_id)
return results['number_of_comments']
def retrieve_number_of_comments(self, parent_we_vote_id='', parent_comment_we_vote_id=''):
"""
:param parent_we_vote_id:
:param parent_comment_we_vote_id:
:return:
"""
status = ""
success = True
if not positive_value_exists(parent_we_vote_id) and not positive_value_exists(parent_comment_we_vote_id):
success = False
status += 'VALID_PARENT_OR_PARENT_COMMENT_WE_VOTE_ID_MISSING-NUMBER_OF_COMMENTS '
results = {
'success': success,
'status': status,
'parent_we_vote_id': parent_we_vote_id,
'parent_comment_we_vote_id': parent_comment_we_vote_id,
'number_of_comments': 0,
}
return results
number_of_comments = 0
try:
if positive_value_exists(parent_comment_we_vote_id):
queryset = ActivityComment.objects.all()
queryset = queryset.filter(
parent_comment_we_vote_id__iexact=parent_comment_we_vote_id,
deleted=False
)
else:
queryset = ActivityComment.objects.all()
queryset = queryset.filter(
parent_we_vote_id__iexact=parent_we_vote_id,
deleted=False
)
# Don't retrieve entries where there is a value for parent_comment_we_vote_id
queryset = queryset.filter(
Q(parent_comment_we_vote_id=None) | Q(parent_comment_we_vote_id=""))
queryset = queryset.exclude(
Q(parent_we_vote_id=None) | Q(parent_we_vote_id=""))
number_of_comments = queryset.count()
except Exception as e:
success = False
status += 'FAILED retrieve_number_of_comments ActivityComment: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'parent_we_vote_id': parent_we_vote_id,
'parent_comment_we_vote_id': parent_comment_we_vote_id,
'number_of_comments': number_of_comments,
}
return results
def retrieve_activity_comment_list(self, parent_we_vote_id='', parent_comment_we_vote_id=''):
"""
:param parent_we_vote_id:
:param parent_comment_we_vote_id:
:return:
"""
status = ""
success = True
if not positive_value_exists(parent_we_vote_id) and not positive_value_exists(parent_comment_we_vote_id):
success = False
status += 'VALID_PARENT_OR_PARENT_COMMENT_WE_VOTE_ID_MISSING '
results = {
'success': success,
'status': status,
'parent_we_vote_id': parent_we_vote_id,
'parent_comment_we_vote_id': parent_comment_we_vote_id,
'activity_comment_list_found': False,
'activity_comment_list': [],
}
return results
activity_comment_list = []
try:
if positive_value_exists(parent_comment_we_vote_id):
queryset = ActivityComment.objects.all()
queryset = queryset.filter(
parent_comment_we_vote_id__iexact=parent_comment_we_vote_id,
deleted=False
)
else:
queryset = ActivityComment.objects.all()
queryset = queryset.filter(
parent_we_vote_id__iexact=parent_we_vote_id,
deleted=False
)
# Don't retrieve entries where there is a value for parent_comment_we_vote_id
queryset = queryset.filter(
Q(parent_comment_we_vote_id=None) | Q(parent_comment_we_vote_id=""))
queryset = queryset.exclude(
Q(parent_we_vote_id=None) | Q(parent_we_vote_id=""))
queryset = queryset.order_by('-id') # Put most recent at top of list
activity_comment_list = list(queryset)
if len(activity_comment_list):
activity_comment_list_found = True
status += 'ACTIVITY_COMMENT_LIST_RETRIEVED '
else:
activity_comment_list_found = False
status += 'NO_ACTIVITY_COMMENT_LIST_RETRIEVED '
except ActivityComment.DoesNotExist:
# No data found. Not a problem.
activity_comment_list_found = False
status += 'NO_ACTIVITY_COMMENT_LIST_RETRIEVED_DoesNotExist '
activity_comment_list = []
except Exception as e:
success = False
activity_comment_list_found = False
status += 'FAILED retrieve_activity_comment_list ActivityComment: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'parent_we_vote_id': parent_we_vote_id,
'parent_comment_we_vote_id': parent_comment_we_vote_id,
'activity_comment_list_found': activity_comment_list_found,
'activity_comment_list': activity_comment_list,
}
return results
def retrieve_activity_notice_seed_list(
self,
notices_to_be_created=False):
status = ""
activity_notice_seed_list = []
try:
queryset = ActivityNoticeSeed.objects.all()
queryset = queryset.filter(deleted=False)
if positive_value_exists(notices_to_be_created):
queryset = queryset.filter(activity_notices_created=False)
queryset = queryset.order_by('-id') # Put most recent at top of list
activity_notice_seed_list = list(queryset)
if len(activity_notice_seed_list):
success = True
activity_notice_seed_list_found = True
status += 'ACTIVITY_NOTICE_SEED_LIST_RETRIEVED '
else:
success = True
activity_notice_seed_list_found = False
status += 'NO_ACTIVITY_NOTICE_SEED_LIST_RETRIEVED '
except Exception as e:
success = False
activity_notice_seed_list_found = False
status += 'FAILED retrieve_activity_notice_seed_list ActivityNoticeSeed ' + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_seed_list_found': activity_notice_seed_list_found,
'activity_notice_seed_list': activity_notice_seed_list,
}
return results
def retrieve_activity_notice_list(
self,
activity_notice_seed_id=0,
to_be_sent_to_email=False,
to_be_sent_to_sms=False,
retrieve_count_limit=0,
activity_notice_id_already_reviewed_list=[]):
status = ""
activity_notice_list = []
try:
queryset = ActivityNotice.objects.all()
queryset = queryset.filter(deleted=False)
if positive_value_exists(activity_notice_seed_id):
queryset = queryset.filter(activity_notice_seed_id=activity_notice_seed_id)
if positive_value_exists(to_be_sent_to_email):
queryset = queryset.filter(send_to_email=True)
queryset = queryset.filter(scheduled_to_email=False)
queryset = queryset.filter(sent_to_email=False)
elif positive_value_exists(to_be_sent_to_sms):
queryset = queryset.filter(send_to_sms=True)
queryset = queryset.filter(scheduled_to_sms=False)
queryset = queryset.filter(sent_to_sms=False)
if activity_notice_id_already_reviewed_list and len(activity_notice_id_already_reviewed_list) > 0:
queryset = queryset.exclude(id__in=activity_notice_id_already_reviewed_list)
queryset = queryset.order_by('-id') # Put most recent at top of list
if positive_value_exists(retrieve_count_limit):
activity_notice_list = queryset[:retrieve_count_limit]
else:
activity_notice_list = list(queryset)
if len(activity_notice_list):
success = True
activity_notice_list_found = True
status += 'ACTIVITY_NOTICE_LIST_RETRIEVED '
else:
success = True
activity_notice_list_found = False
status += 'NO_ACTIVITY_NOTICE_LIST_RETRIEVED '
except Exception as e:
success = False
activity_notice_list_found = False
status += 'FAILED retrieve_activity_notice_list: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_list_found': activity_notice_list_found,
'activity_notice_list': activity_notice_list,
}
return results
def retrieve_recent_activity_notice_seed_from_listener(
self,
kind_of_seed='',
recipient_voter_we_vote_id=''):
"""
:param kind_of_seed:
:param recipient_voter_we_vote_id:
:return:
"""
exception_does_not_exist = False
exception_multiple_object_returned = False
activity_notice_seed_found = False
activity_notice_seed = None
activity_notice_seed_id = 0
status = ""
lifespan_of_seed_in_seconds = get_lifespan_of_seed(kind_of_seed) # In seconds
earliest_date_of_notice = now() - timedelta(seconds=lifespan_of_seed_in_seconds)
try:
if positive_value_exists(recipient_voter_we_vote_id):
activity_notice_seed = ActivityNoticeSeed.objects.get(
date_of_notice__gte=earliest_date_of_notice,
deleted=False,
kind_of_seed=kind_of_seed,
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
)
activity_notice_seed_id = activity_notice_seed.id
activity_notice_seed_found = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_FOUND_BY_LISTENER_VOTER_WE_VOTE_ID "
else:
activity_notice_seed_found = False
success = False
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_LISTENER_VOTER_WE_VOTE_ID_MISSING "
except ActivityNoticeSeed.DoesNotExist:
exception_does_not_exist = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_NOT_FOUND "
except Exception as e:
success = False
status += 'FAILED retrieve_recent_activity_notice_seed_from_listener ActivityNoticeSeed: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'DoesNotExist': exception_does_not_exist,
'MultipleObjectsReturned': exception_multiple_object_returned,
'activity_notice_seed_found': activity_notice_seed_found,
'activity_notice_seed_id': activity_notice_seed_id,
'activity_notice_seed': activity_notice_seed,
}
return results
def retrieve_recent_activity_notice_from_speaker_and_recipient(
self,
activity_notice_seed_id=0,
kind_of_notice='',
recipient_voter_we_vote_id='',
speaker_organization_we_vote_id='',
speaker_voter_we_vote_id=''):
exception_does_not_exist = False
exception_multiple_object_returned = False
activity_notice = None
activity_notice_found = False
activity_notice_id = 0
status = ""
try:
if positive_value_exists(speaker_organization_we_vote_id):
activity_notice = ActivityNotice.objects.get(
activity_notice_seed_id=activity_notice_seed_id,
deleted=False,
kind_of_notice=kind_of_notice,
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
speaker_organization_we_vote_id__iexact=speaker_organization_we_vote_id,
)
activity_notice_id = activity_notice.id
activity_notice_found = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_FOUND_BY_ORG_WE_VOTE_ID "
elif positive_value_exists(speaker_voter_we_vote_id):
activity_notice = ActivityNotice.objects.get(
activity_notice_seed_id=activity_notice_seed_id,
deleted=False,
kind_of_notice=kind_of_notice,
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
speaker_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
)
activity_notice_id = activity_notice.id
activity_notice_found = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_FOUND_BY_VOTER_WE_VOTE_ID "
else:
activity_notice_found = False
success = False
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_VARIABLES_MISSING "
except ActivityNotice.DoesNotExist:
exception_does_not_exist = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_NOT_FOUND "
except Exception as e:
success = False
status += 'FAILED retrieve_recent_activity_notice_from_speaker_and_recipient: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'DoesNotExist': exception_does_not_exist,
'MultipleObjectsReturned': exception_multiple_object_returned,
'activity_notice_found': activity_notice_found,
'activity_notice_id': activity_notice_id,
'activity_notice': activity_notice,
}
return results
def retrieve_recent_activity_notice_seed_from_speaker(
self,
kind_of_seed='',
speaker_organization_we_vote_id='',
speaker_voter_we_vote_id=''):
"""
:param kind_of_seed:
:param speaker_organization_we_vote_id:
:param speaker_voter_we_vote_id:
:return:
"""
exception_does_not_exist = False
exception_multiple_object_returned = False
activity_notice_seed_found = False
activity_notice_seed = None
activity_notice_seed_id = 0
status = ""
lifespan_of_seed_in_seconds = get_lifespan_of_seed(kind_of_seed) # In seconds
earliest_date_of_notice = now() - timedelta(seconds=lifespan_of_seed_in_seconds)
try:
if positive_value_exists(speaker_organization_we_vote_id):
activity_notice_seed = ActivityNoticeSeed.objects.get(
date_of_notice__gte=earliest_date_of_notice,
deleted=False,
kind_of_seed=kind_of_seed,
speaker_organization_we_vote_id__iexact=speaker_organization_we_vote_id,
)
activity_notice_seed_id = activity_notice_seed.id
activity_notice_seed_found = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_FOUND_BY_ORG_WE_VOTE_ID "
elif positive_value_exists(speaker_voter_we_vote_id):
activity_notice_seed = ActivityNoticeSeed.objects.get(
date_of_notice__gte=earliest_date_of_notice,
deleted=False,
kind_of_seed=kind_of_seed,
speaker_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
)
activity_notice_seed_id = activity_notice_seed.id
activity_notice_seed_found = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_FOUND_BY_VOTER_WE_VOTE_ID "
else:
activity_notice_seed_found = False
success = False
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_VARIABLES_MISSING "
except ActivityNoticeSeed.DoesNotExist:
exception_does_not_exist = True
success = True
status += "RETRIEVE_RECENT_ACTIVITY_NOTICE_SEED_NOT_FOUND "
except Exception as e:
success = False
status += 'FAILED retrieve_recent_activity_notice_seed_from_speaker ActivityNoticeSeed ' + str(e) + ' '
results = {
'success': success,
'status': status,
'DoesNotExist': exception_does_not_exist,
'MultipleObjectsReturned': exception_multiple_object_returned,
'activity_notice_seed_found': activity_notice_seed_found,
'activity_notice_seed_id': activity_notice_seed_id,
'activity_notice_seed': activity_notice_seed,
}
return results
def retrieve_activity_notice_list_for_recipient(self, recipient_voter_we_vote_id=''):
"""
:param recipient_voter_we_vote_id:
:return:
"""
status = ""
if not positive_value_exists(recipient_voter_we_vote_id):
success = False
status += 'VALID_VOTER_WE_VOTE_ID_MISSING '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_notice_list_found': False,
'activity_notice_list': [],
}
return results
activity_notice_list = []
try:
queryset = ActivityNotice.objects.all()
queryset = queryset.filter(
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
deleted=False
)
queryset = queryset.exclude(
Q(recipient_voter_we_vote_id=None) | Q(recipient_voter_we_vote_id=""))
queryset = queryset.order_by('-id') # Put most recent at top of list
activity_notice_list = queryset[:30]
if len(activity_notice_list):
success = True
activity_notice_list_found = True
status += 'ACTIVITY_NOTICE_LIST_RETRIEVED '
else:
success = True
activity_notice_list_found = False
status += 'NO_ACTIVITY_NOTICE_LIST_RETRIEVED '
except ActivityNotice.DoesNotExist:
# No data found. Not a problem.
success = True
activity_notice_list_found = False
status += 'NO_ACTIVITY_NOTICE_LIST_RETRIEVED_DoesNotExist '
activity_notice_list = []
except Exception as e:
success = False
activity_notice_list_found = False
status += 'FAILED retrieve_voter_activity_notice_list ActivityNotice ' + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_list_found': activity_notice_list_found,
'activity_notice_list': activity_notice_list,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
}
return results
def retrieve_activity_notice_seed_list_for_recipient(
self,
recipient_voter_we_vote_id='',
kind_of_seed_list=None,
limit_to_activity_tidbit_we_vote_id_list=[]):
"""
:param recipient_voter_we_vote_id:
:param kind_of_seed_list:
:param limit_to_activity_tidbit_we_vote_id_list:
:return:
"""
status = ""
if not positive_value_exists(recipient_voter_we_vote_id):
success = False
status += 'VALID_VOTER_WE_VOTE_ID_MISSING '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_notice_seed_list_found': False,
'activity_notice_seed_list': [],
'voter_friend_we_vote_id_list': [],
}
return results
activity_notice_seed_list = []
voter_friend_we_vote_id_list = []
voter_friend_we_vote_id_list.append(recipient_voter_we_vote_id)
from friend.models import FriendManager
friend_manager = FriendManager()
friend_results = friend_manager.retrieve_friends_we_vote_id_list(recipient_voter_we_vote_id)
if friend_results['friends_we_vote_id_list_found']:
friends_we_vote_id_list = friend_results['friends_we_vote_id_list']
voter_friend_we_vote_id_list += friends_we_vote_id_list
try:
queryset = ActivityNoticeSeed.objects.all()
queryset = queryset.filter(deleted=False)
queryset = queryset.filter(speaker_voter_we_vote_id__in=voter_friend_we_vote_id_list)
if limit_to_activity_tidbit_we_vote_id_list and len(limit_to_activity_tidbit_we_vote_id_list) > 0:
queryset = queryset.filter(we_vote_id__in=limit_to_activity_tidbit_we_vote_id_list)
if kind_of_seed_list and len(kind_of_seed_list) > 0:
queryset = queryset.filter(kind_of_seed__in=kind_of_seed_list)
queryset = queryset.exclude(
Q(speaker_voter_we_vote_id=None) | Q(speaker_voter_we_vote_id=""))
queryset = queryset.order_by('-id') # Put most recent at top of list
activity_notice_seed_list = queryset[:200]
if len(activity_notice_seed_list):
success = True
activity_notice_seed_list_found = True
status += 'ACTIVITY_NOTICE_SEED_LIST_RETRIEVED '
else:
success = True
activity_notice_seed_list_found = False
status += 'NO_ACTIVITY_NOTICE_SEED_LIST_RETRIEVED '
except ActivityNoticeSeed.DoesNotExist:
# No data found. Not a problem.
success = True
activity_notice_seed_list_found = False
status += 'NO_ACTIVITY_NOTICE_SEED_LIST_RETRIEVED_DoesNotExist '
activity_notice_seed_list = []
except Exception as e:
success = False
activity_notice_seed_list_found = False
status += 'FAILED retrieve_voter_activity_notice_seed_list: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_notice_seed_list_found': activity_notice_seed_list_found,
'activity_notice_seed_list': activity_notice_seed_list,
'voter_friend_we_vote_id_list': voter_friend_we_vote_id_list,
}
return results
def retrieve_next_activity_notice_seed_to_process(
self,
notices_to_be_created=False,
notices_to_be_scheduled=False,
notices_to_be_updated=False,
to_be_added_to_voter_daily_summary=False,
activity_notice_seed_id_already_reviewed_list=[]):
status = ""
activity_notice_seed = None
try:
queryset = ActivityNoticeSeed.objects.all()
queryset = queryset.filter(deleted=False)
if positive_value_exists(notices_to_be_created):
queryset = queryset.filter(activity_notices_created=False)
queryset = \
queryset.filter(kind_of_seed__in=[NOTICE_ACTIVITY_POST_SEED, NOTICE_FRIEND_ENDORSEMENTS_SEED])
elif positive_value_exists(notices_to_be_scheduled):
queryset = queryset.filter(activity_notices_scheduled=False)
queryset = queryset.filter(
kind_of_seed__in=[NOTICE_FRIEND_ENDORSEMENTS_SEED, NOTICE_VOTER_DAILY_SUMMARY_SEED])
elif positive_value_exists(notices_to_be_updated):
queryset = queryset.filter(activity_notices_created=True)
queryset = queryset.filter(date_of_notice_earlier_than_update_window=False)
queryset = queryset.filter(
kind_of_seed__in=[NOTICE_ACTIVITY_POST_SEED, NOTICE_FRIEND_ENDORSEMENTS_SEED])
elif positive_value_exists(to_be_added_to_voter_daily_summary):
queryset = queryset.filter(added_to_voter_daily_summary=False)
queryset = queryset.filter(
kind_of_seed__in=[NOTICE_ACTIVITY_POST_SEED, NOTICE_FRIEND_ENDORSEMENTS_SEED])
if activity_notice_seed_id_already_reviewed_list and len(activity_notice_seed_id_already_reviewed_list) > 0:
queryset = queryset.exclude(id__in=activity_notice_seed_id_already_reviewed_list)
queryset = queryset.order_by('-id') # Put most recent at top of list
activity_notice_seed_list = queryset[:1]
if len(activity_notice_seed_list):
success = True
activity_notice_seed = activity_notice_seed_list[0]
activity_notice_seed_found = True
status += 'ACTIVITY_NOTICE_SEED_RETRIEVED '
else:
success = True
activity_notice_seed = None
activity_notice_seed_found = False
status += 'NO_ACTIVITY_NOTICE_SEED_RETRIEVED '
except Exception as e:
success = False
activity_notice_seed_found = False
status += 'FAILED retrieve_activity_notice_seed ActivityNoticeSeed ' + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_seed_found': activity_notice_seed_found,
'activity_notice_seed': activity_notice_seed,
}
return results
def retrieve_activity_post_list(
self,
speaker_voter_we_vote_id_list=[],
limit_to_visibility_is_friends_only=False,
limit_to_visibility_is_public=False,
since_date=None):
"""
:param speaker_voter_we_vote_id_list:
:param limit_to_visibility_is_friends_only:
:param limit_to_visibility_is_public:
:param since_date:
:return:
"""
status = ""
if not speaker_voter_we_vote_id_list or len(speaker_voter_we_vote_id_list) == 0:
success = False
status += 'VALID_VOTER_WE_VOTE_IDS_MISSING '
results = {
'success': success,
'status': status,
'activity_post_list_found': False,
'activity_post_list': [],
}
return results
activity_post_list = []
try:
queryset = ActivityPost.objects.all()
queryset = queryset.filter(
speaker_voter_we_vote_id__in=speaker_voter_we_vote_id_list,
deleted=False
)
if positive_value_exists(since_date):
queryset = queryset.filter(date_created__gte=since_date)
if positive_value_exists(limit_to_visibility_is_friends_only):
queryset = queryset.filter(visibility_is_public=False)
elif positive_value_exists(limit_to_visibility_is_public):
queryset = queryset.filter(visibility_is_public=True)
queryset = queryset.exclude(
Q(speaker_voter_we_vote_id=None) | Q(speaker_voter_we_vote_id=""))
queryset = queryset.order_by('-id') # Put most recent ActivityPost at top of list
activity_post_list = queryset[:200]
if len(activity_post_list):
success = True
activity_post_list_found = True
status += 'ACTIVITY_POST_LIST_RETRIEVED '
else:
success = True
activity_post_list_found = False
status += 'NO_ACTIVITY_POST_LIST_RETRIEVED '
except ActivityPost.DoesNotExist:
# No data found. Not a problem.
success = True
activity_post_list_found = False
status += 'NO_ACTIVITY_POST_LIST_RETRIEVED_DoesNotExist '
activity_post_list = []
except Exception as e:
success = False
activity_post_list_found = False
status += 'FAILED retrieve_activity_post_list: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_post_list_found': activity_post_list_found,
'activity_post_list': activity_post_list,
}
return results
def retrieve_activity_post_list_for_recipient(
self,
recipient_voter_we_vote_id='',
limit_to_activity_tidbit_we_vote_id_list=[],
voter_friend_we_vote_id_list=[]):
"""
:param recipient_voter_we_vote_id:
:param limit_to_activity_tidbit_we_vote_id_list:
:param voter_friend_we_vote_id_list:
:return:
"""
status = ""
if not positive_value_exists(recipient_voter_we_vote_id):
success = False
status += 'VALID_VOTER_WE_VOTE_ID_MISSING '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_post_list_found': False,
'activity_post_list': [],
}
return results
activity_post_list = []
if not positive_value_exists(len(voter_friend_we_vote_id_list)):
voter_friend_we_vote_id_list = []
voter_friend_we_vote_id_list.append(recipient_voter_we_vote_id)
from friend.models import FriendManager
friend_manager = FriendManager()
friend_results = friend_manager.retrieve_friends_we_vote_id_list(recipient_voter_we_vote_id)
if friend_results['friends_we_vote_id_list_found']:
friends_we_vote_id_list = friend_results['friends_we_vote_id_list']
voter_friend_we_vote_id_list += friends_we_vote_id_list
try:
queryset = ActivityPost.objects.all()
queryset = queryset.filter(deleted=False)
if limit_to_activity_tidbit_we_vote_id_list and len(limit_to_activity_tidbit_we_vote_id_list) > 0:
queryset = queryset.filter(we_vote_id__in=limit_to_activity_tidbit_we_vote_id_list)
# Allow the public ActivityPosts to be found
queryset = queryset.filter(
Q(speaker_voter_we_vote_id__in=voter_friend_we_vote_id_list) | Q(visibility_is_public=True))
else:
queryset = queryset.filter(speaker_voter_we_vote_id__in=voter_friend_we_vote_id_list)
queryset = queryset.exclude(
Q(speaker_voter_we_vote_id=None) | Q(speaker_voter_we_vote_id=""))
queryset = queryset.order_by('-id') # Put most recent ActivityPost at top of list
activity_post_list = queryset[:200]
if len(activity_post_list):
success = True
activity_post_list_found = True
status += 'ACTIVITY_POST_LIST_FOR_RECIPIENT_RETRIEVED '
else:
success = True
activity_post_list_found = False
status += 'NO_ACTIVITY_POST_LIST_FOR_RECIPIENT_RETRIEVED '
except ActivityPost.DoesNotExist:
# No data found. Not a problem.
success = True
activity_post_list_found = False
status += 'NO_ACTIVITY_POST_LIST_FOR_RECIPIENT_RETRIEVED_DoesNotExist '
activity_post_list = []
except Exception as e:
success = False
activity_post_list_found = False
status += 'FAILED retrieve_activity_post_list_for_recipient: ' + str(e) + ' '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_post_list_found': activity_post_list_found,
'activity_post_list': activity_post_list,
}
return results
def update_activity_notice_list_in_bulk(
self,
recipient_voter_we_vote_id='',
activity_notice_id_list=[],
activity_notice_seen=False,
activity_notice_clicked=False):
status = ""
if not positive_value_exists(recipient_voter_we_vote_id):
success = False
status += 'VALID_VOTER_WE_VOTE_ID_MISSING '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_notice_list_updated': False,
}
return results
try:
if activity_notice_clicked and activity_notice_seen:
ActivityNotice.objects.all().filter(
id__in=activity_notice_id_list,
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
deleted=False
).update(
activity_notice_seen=True,
activity_notice_clicked=True)
elif activity_notice_clicked:
ActivityNotice.objects.all().filter(
id__in=activity_notice_id_list,
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
deleted=False
).update(
activity_notice_clicked=True)
elif activity_notice_seen:
ActivityNotice.objects.all().filter(
id__in=activity_notice_id_list,
recipient_voter_we_vote_id__iexact=recipient_voter_we_vote_id,
deleted=False
).update(
activity_notice_seen=True)
success = True
activity_notice_list_updated = True
status += 'ACTIVITY_NOTICE_LIST_UPDATED '
except ActivityNotice.DoesNotExist:
# No data found. Not a problem.
success = True
activity_notice_list_updated = False
status += 'NO_ACTIVITY_NOTICE_LIST_ENTRIES_FOUND '
except Exception as e:
success = False
activity_notice_list_updated = False
status += 'FAILED update_activity_notice_list_in_bulk ActivityNotice ' + str(e) + ' '
results = {
'success': success,
'status': status,
'recipient_voter_we_vote_id': recipient_voter_we_vote_id,
'activity_notice_list_updated': activity_notice_list_updated,
}
return results
def update_activity_notice_seed(self, activity_notice_seed_id, update_values):
"""
:param activity_notice_seed_id:
:param update_values:
:return:
"""
success = False
status = ""
activity_notice_seed_updated = False
existing_entry = ''
try:
existing_entry = ActivityNoticeSeed.objects.get(id=activity_notice_seed_id)
values_changed = False
if existing_entry:
# found the existing entry, update the values
if 'date_of_notice' in update_values:
existing_entry.date_of_notice = update_values['ballotpedia_activity_notice_seed_id']
values_changed = True
if 'deleted' in update_values:
existing_entry.deleted = update_values['deleted']
values_changed = True
if 'kind_of_seed' in update_values:
existing_entry.kind_of_seed = update_values['kind_of_seed']
values_changed = True
if 'position_names_for_friends_serialized' in update_values:
existing_entry.position_names_for_friends_serialized = \
update_values['position_names_for_friends_serialized']
values_changed = True
if 'position_names_for_public_serialized' in update_values:
existing_entry.position_names_for_public_serialized = \
update_values['position_names_for_public_serialized']
values_changed = True
if 'position_we_vote_ids_for_friends_serialized' in update_values:
existing_entry.position_we_vote_ids_for_friends_serialized = \
update_values['position_we_vote_ids_for_friends_serialized']
values_changed = True
if 'position_we_vote_ids_for_public_serialized' in update_values:
existing_entry.position_we_vote_ids_for_public_serialized = \
update_values['position_we_vote_ids_for_public_serialized']
values_changed = True
if 'speaker_name' in update_values:
existing_entry.speaker_name = update_values['speaker_name']
values_changed = True
if 'speaker_organization_we_vote_id' in update_values:
existing_entry.speaker_organization_we_vote_id = update_values['speaker_organization_we_vote_id']
values_changed = True
if 'speaker_voter_we_vote_id' in update_values:
existing_entry.speaker_voter_we_vote_id = update_values['speaker_voter_we_vote_id']
values_changed = True
# now go ahead and save this entry (update)
if values_changed:
existing_entry.save()
activity_notice_seed_updated = True
success = True
status += "ACTIVITY_NOTICE_SEED_UPDATED "
else:
activity_notice_seed_updated = False
success = True
status += "ACTIVITY_NOTICE_SEED_NOT_UPDATED-NO_CHANGES "
except Exception as e:
success = False
activity_notice_seed_updated = False
status += "ACTIVITY_NOTICE_SEED_RETRIEVE_ERROR " + str(e) + ' '
results = {
'success': success,
'status': status,
'activity_notice_seed_updated': activity_notice_seed_updated,
'updated_activity_notice_seed': existing_entry,
}
return results
def update_or_create_activity_comment(
self,
activity_comment_we_vote_id='',
updated_values={},
commenter_voter_we_vote_id='',
):
"""
Either update or create an ActivityComment.
"""
activity_comment = None
activity_comment_created = False
activity_comment_found = False
missing_variable = False
status = ""
statement_text = updated_values['statement_text'] if 'statement_text' in updated_values else ''
if not commenter_voter_we_vote_id:
missing_variable = True
status += 'MISSING_VOTER_WE_VOTE_ID '
if not positive_value_exists(activity_comment_we_vote_id) and not positive_value_exists(statement_text):
missing_variable = True
status += 'MISSING_BOTH_ID_AND_STATEMENT_TEXT '
if missing_variable:
success = False
results = {
'success': success,
'status': status,
'activity_comment': activity_comment,
'activity_comment_found': activity_comment_found,
'activity_comment_created': activity_comment_created,
}
return results
if positive_value_exists(activity_comment_we_vote_id):
try:
activity_comment = ActivityComment.objects.get(
we_vote_id=activity_comment_we_vote_id,
commenter_voter_we_vote_id=updated_values['commenter_voter_we_vote_id'])
activity_comment_found = True
# Instead of manually mapping them above, we do it this way for flexibility
for key, value in updated_values.items():
setattr(activity_comment, key, value)
activity_comment.save()
success = True
status += 'ACTIVITY_COMMENT_UPDATED '
except Exception as e:
success = False
status += "ACTIVITY_COMMENT_UPDATE_FAILURE: " + str(e) + " "
else:
try:
activity_comment = ActivityComment.objects.create(
date_created=now(),
commenter_voter_we_vote_id=updated_values['commenter_voter_we_vote_id'])
activity_comment_created = True
# Instead of manually mapping them above, we do it this way for flexibility
for key, value in updated_values.items():
setattr(activity_comment, key, value)
activity_comment.save()
activity_comment_found = True
success = True
status += 'ACTIVITY_COMMENT_CREATED '
except Exception as e:
success = False
status += "ACTIVITY_COMMENT_CREATE_FAILURE: " + str(e) + " "
results = {
'success': success,
'status': status,
'activity_comment': activity_comment,
'activity_comment_found': activity_comment_found,
'activity_comment_created': activity_comment_created,
}
return results
def update_or_create_activity_post(
self,
activity_post_we_vote_id='',
updated_values={},
speaker_voter_we_vote_id='',
):
"""
Either update or create an ActivityPost.
"""
activity_post = None
activity_post_created = False
activity_post_found = False
missing_variable = False
status = ""
statement_text = updated_values['statement_text'] if 'statement_text' in updated_values else ''
if not speaker_voter_we_vote_id:
missing_variable = True
status += 'MISSING_VOTER_WE_VOTE_ID '
if not positive_value_exists(activity_post_we_vote_id) and not positive_value_exists(statement_text):
missing_variable = True
status += 'MISSING_BOTH_ID_AND_STATEMENT_TEXT '
if missing_variable:
success = False
results = {
'success': success,
'status': status,
'activity_post': activity_post,
'activity_post_found': activity_post_found,
'activity_post_created': activity_post_created,
}
return results
if positive_value_exists(activity_post_we_vote_id):
try:
activity_post = ActivityPost.objects.get(
we_vote_id=activity_post_we_vote_id,
speaker_voter_we_vote_id=updated_values['speaker_voter_we_vote_id'])
activity_post_found = True
# Instead of manually mapping them above, we do it this way for flexibility
for key, value in updated_values.items():
setattr(activity_post, key, value)
activity_post.save()
success = True
status += 'ACTIVITY_POST_UPDATED '
except Exception as e:
success = False
status += "ACTIVITY_POST_UPDATE_FAILURE: " + str(e) + " "
else:
try:
activity_post = ActivityPost.objects.create(
date_created=now(),
speaker_voter_we_vote_id=updated_values['speaker_voter_we_vote_id'])
activity_post_created = True
# Instead of manually mapping them above, we do it this way for flexibility
for key, value in updated_values.items():
setattr(activity_post, key, value)
activity_post.save()
activity_post_found = True
success = True
status += 'ACTIVITY_POST_CREATED '
except Exception as e:
success = False
status += "ACTIVITY_POST_CREATE_FAILURE: " + str(e) + " "
results = {
'success': success,
'status': status,
'activity_post': activity_post,
'activity_post_found': activity_post_found,
'activity_post_created': activity_post_created,
}
return results
def update_speaker_name_in_bulk(
self,
speaker_voter_we_vote_id='',
speaker_name=''):
status = ""
success = True
if not positive_value_exists(speaker_voter_we_vote_id):
success = False
status += 'VALID_VOTER_WE_VOTE_ID_MISSING '
results = {
'success': success,
'status': status,
}
return results
if not positive_value_exists(speaker_name):
success = False
status += 'SPEAKER_NAME_MUST_EXIST '
results = {
'success': success,
'status': status,
}
return results
try:
updated_count = ActivityComment.objects.all().filter(
commenter_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
deleted=False
).update(
commenter_name=speaker_name)
status += 'ACTIVITY_COMMENTS_UPDATED: (' + str(updated_count) + ') '
except ActivityComment.DoesNotExist:
# No data found. Not a problem.
status += 'NO_ACTIVITY_COMMENTS_FOUND '
except Exception as e:
success = False
status += 'FAILED update_speaker_name_in_bulk ActivityComment ' + str(e) + ' '
try:
updated_count = ActivityNotice.objects.all().filter(
speaker_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
deleted=False
).update(
speaker_name=speaker_name)
status += 'ACTIVITY_NOTICES_UPDATED: (' + str(updated_count) + ') '
except ActivityNotice.DoesNotExist:
# No data found. Not a problem.
status += 'NO_ACTIVITY_NOTICES_FOUND '
except Exception as e:
success = False
status += 'FAILED update_speaker_name_in_bulk ActivityNotice ' + str(e) + ' '
try:
updated_seed_count1 = ActivityNoticeSeed.objects.all().filter(
speaker_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
deleted=False
).update(
speaker_name=speaker_name)
updated_seed_count2 = ActivityNoticeSeed.objects.all().filter(
recipient_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
deleted=False
).update(
recipient_name=speaker_name)
status += 'ACTIVITY_NOTICE_SEEDS_UPDATED: ' \
'(' + str(updated_seed_count1) + '/' + str(updated_seed_count2) + ') '
except ActivityNoticeSeed.DoesNotExist:
# No data found. Not a problem.
status += 'NO_ACTIVITY_NOTICE_SEEDS_FOUND '
except Exception as e:
success = False
status += 'FAILED update_speaker_name_in_bulk ActivityNoticeSeed ' + str(e) + ' '
try:
updated_count = ActivityPost.objects.all().filter(
speaker_voter_we_vote_id__iexact=speaker_voter_we_vote_id,
deleted=False
).update(
speaker_name=speaker_name)
status += 'ACTIVITY_POSTS_UPDATED: (' + str(updated_count) + ') '
except ActivityPost.DoesNotExist:
# No data found. Not a problem.
status += 'NO_ACTIVITY_POSTS_FOUND '
except Exception as e:
success = False
status += 'FAILED update_speaker_name_in_bulk ActivityPost ' + str(e) + ' '
results = {
'success': success,
'status': status,
}
return results
class ActivityNotice(models.Model):
"""
This is a notice for the notification drop-down menu, for one person
"""
activity_notice_seed_id = models.PositiveIntegerField(default=None, null=True)
activity_tidbit_we_vote_id = models.CharField(max_length=255, default=None, null=True) # subject of notice
date_of_notice = models.DateTimeField(null=True)
date_last_changed = models.DateTimeField(null=True, auto_now=True)
activity_notice_clicked = models.BooleanField(default=False)
activity_notice_seen = models.BooleanField(default=False)
deleted = models.BooleanField(default=False)
kind_of_notice = models.CharField(max_length=50, default=None, null=True)
kind_of_seed = models.CharField(max_length=50, default=None, null=True)
new_positions_entered_count = models.PositiveIntegerField(default=None, null=True)
number_of_comments = models.PositiveIntegerField(default=None, null=True)
number_of_likes = models.PositiveIntegerField(default=None, null=True)
position_name_list_serialized = models.TextField(default=None, null=True)
position_we_vote_id_list_serialized = models.TextField(default=None, null=True)
speaker_name = models.CharField(max_length=255, default=None, null=True)
speaker_organization_we_vote_id = models.CharField(max_length=255, default=None, null=True)
speaker_voter_we_vote_id = models.CharField(max_length=255, default=None, null=True)
recipient_voter_we_vote_id = models.CharField(max_length=255, default=None, null=True)
is_in_app = models.BooleanField(default=False)
# Track Email send progress
send_to_email = models.BooleanField(default=False)
scheduled_to_email = models.BooleanField(default=False)
sent_to_email = models.BooleanField(default=False)
# Track SMS send progress
send_to_sms = models.BooleanField(default=False)
scheduled_to_sms = models.BooleanField(default=False)
sent_to_sms = models.BooleanField(default=False)
speaker_profile_image_url_medium = models.TextField(blank=True, null=True)
speaker_profile_image_url_tiny = models.TextField(blank=True, null=True)
statement_text_preview = models.CharField(max_length=255, default=None, null=True)
class ActivityNoticeSeed(models.Model):
"""
This is the "seed" for a notice for the notification drop-down menu, which is used before we "distribute" it
out to an ActivityNotice, which gets shown to an individual voter.
"""
activity_notices_created = models.BooleanField(default=False)
activity_tidbit_we_vote_ids_for_friends_serialized = models.TextField(default=None, null=True)
activity_tidbit_we_vote_ids_for_public_serialized = models.TextField(default=None, null=True)
date_of_notice_earlier_than_update_window = models.BooleanField(default=False)
activity_notices_scheduled = models.BooleanField(default=False)
added_to_voter_daily_summary = models.BooleanField(default=False)
date_of_notice = models.DateTimeField(null=True)
date_last_changed = models.DateTimeField(null=True, auto_now=True)
deleted = models.BooleanField(default=False)
kind_of_seed = models.CharField(max_length=50, default=None, null=True)
# Positions that were changed: NOTICE_FRIEND_ENDORSEMENTS
position_names_for_friends_serialized = models.TextField(default=None, null=True)
position_names_for_public_serialized = models.TextField(default=None, null=True)
position_we_vote_ids_for_friends_serialized = models.TextField(default=None, null=True)
position_we_vote_ids_for_public_serialized = models.TextField(default=None, null=True)
# Voter receiving the daily summary: NOTICE_VOTER_DAILY_SUMMARY
recipient_name = models.CharField(max_length=255, default=None, null=True)
recipient_voter_we_vote_id = models.CharField(max_length=255, default=None, null=True)
speaker_voter_we_vote_ids_serialized = models.TextField(default=None, null=True)
speaker_organization_we_vote_ids_serialized = models.TextField(default=None, null=True)
# Track Email send progress for NOTICE_VOTER_DAILY_SUMMARY_SEED
send_to_email = models.BooleanField(default=False)
scheduled_to_email = models.BooleanField(default=False)
sent_to_email = models.BooleanField(default=False)
# Track SMS send progress for NOTICE_VOTER_DAILY_SUMMARY_SEED
send_to_sms = models.BooleanField(default=False)
scheduled_to_sms = models.BooleanField(default=False)
sent_to_sms = models.BooleanField(default=False)
# Voter who took the action: NOTICE_ACTIVITY_POST_SEED, NOTICE_FRIEND_ENDORSEMENTS_SEED
speaker_name = models.CharField(max_length=255, default=None, null=True)
speaker_organization_we_vote_id = models.CharField(max_length=255, default=None, null=True)
speaker_voter_we_vote_id = models.CharField(max_length=255, default=None, null=True)
speaker_profile_image_url_medium = models.TextField(blank=True, null=True)
speaker_profile_image_url_tiny = models.TextField(blank=True, null=True)
speaker_twitter_handle = models.CharField(max_length=255, null=True, unique=False, default=None)
speaker_twitter_followers_count = models.IntegerField(default=0)
statement_text_preview = models.CharField(max_length=255, default=None, null=True)
# we_vote_id of this SEED
we_vote_id = models.CharField(max_length=255, default=None, null=True, unique=True)
# We override the save function so we can auto-generate we_vote_id
def save(self, *args, **kwargs):
# Even if this data came from another source we still need a unique we_vote_id
if self.we_vote_id:
self.we_vote_id = self.we_vote_id.strip().lower()
if self.we_vote_id == "" or self.we_vote_id is None: # If there isn't a value...
# ...generate a new id
site_unique_id_prefix = fetch_site_unique_id_prefix()
next_local_integer = fetch_next_we_vote_id_activity_notice_seed_integer()
# "wv" = We Vote
# site_unique_id_prefix = a generated (or assigned) unique id for one server running We Vote
# "actseed" = tells us this is a unique id for an ActivityNoticeSeed
# next_integer = a unique, sequential integer for this server - not necessarily tied to database id
self.we_vote_id = "wv{site_unique_id_prefix}actseed{next_integer}".format(
site_unique_id_prefix=site_unique_id_prefix,
next_integer=next_local_integer,
)
super(ActivityNoticeSeed, self).save(*args, **kwargs)
class ActivityPost(models.Model):
"""
A voter-created post for the activity list
"""
date_created = models.DateTimeField(null=True)
date_last_changed = models.DateTimeField(verbose_name='date last changed', null=True, auto_now=True)
deleted = models.BooleanField(default=False)
speaker_name = models.CharField(max_length=255, default=None, null=True)
speaker_organization_we_vote_id = models.CharField(max_length=255, default=None, null=True)
speaker_twitter_followers_count = models.PositiveIntegerField(default=None, null=True)
speaker_twitter_handle = models.CharField(max_length=255, default=None, null=True)
speaker_voter_we_vote_id = models.CharField(max_length=255, default=None, null=True)
speaker_profile_image_url_medium = models.TextField(blank=True, null=True)
speaker_profile_image_url_tiny = models.TextField(blank=True, null=True)
statement_text = models.TextField(null=True, blank=True)
visibility_is_public = models.BooleanField(default=False)
we_vote_id = models.CharField(max_length=255, default=None, null=True, unique=True)
# We override the save function so we can auto-generate we_vote_id
def save(self, *args, **kwargs):
# Even if this data came from another source we still need a unique we_vote_id
if self.we_vote_id:
self.we_vote_id = self.we_vote_id.strip().lower()
if self.we_vote_id == "" or self.we_vote_id is None: # If there isn't a value...
# ...generate a new id
site_unique_id_prefix = fetch_site_unique_id_prefix()
next_local_integer = fetch_next_we_vote_id_activity_post_integer()
# "wv" = We Vote
# site_unique_id_prefix = a generated (or assigned) unique id for one server running We Vote
# "post" = tells us this is a unique id for an ActivityPost
# next_integer = a unique, sequential integer for this server - not necessarily tied to database id
self.we_vote_id = "wv{site_unique_id_prefix}post{next_integer}".format(
site_unique_id_prefix=site_unique_id_prefix,
next_integer=next_local_integer,
)
super(ActivityPost, self).save(*args, **kwargs)
def get_lifespan_of_seed(kind_of_seed):
if kind_of_seed == NOTICE_ACTIVITY_POST_SEED:
return 14400 # 4 hours * 60 minutes * 60 seconds/minute
if kind_of_seed == NOTICE_FRIEND_ENDORSEMENTS_SEED:
return 21600 # 6 hours * 60 minutes * 60 seconds/minute
if kind_of_seed == NOTICE_VOTER_DAILY_SUMMARY_SEED:
return 43200 # 12 hours * 60 minutes * 60 seconds/minute
return 0
| 46.923773
| 120
| 0.620928
| 7,942
| 72,638
| 5.201838
| 0.04067
| 0.051703
| 0.061579
| 0.043425
| 0.893496
| 0.83855
| 0.781643
| 0.737322
| 0.695544
| 0.641687
| 0
| 0.003079
| 0.315868
| 72,638
| 1,547
| 121
| 46.954105
| 0.828269
| 0.065131
| 0
| 0.649311
| 0
| 0
| 0.108274
| 0.083174
| 0
| 0
| 0
| 0
| 0
| 1
| 0.019908
| false
| 0
| 0.006891
| 0.000766
| 0.128637
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9698e5ea7a3da9df09baeb98b58b9661a9de7c1d
| 2,301
|
py
|
Python
|
gta_housing/pipeline.py
|
lyoganathan/Housing_Prices_GTA
|
6af9f4996aa7f6ea15adbd48dc284ee07d852e90
|
[
"MIT"
] | null | null | null |
gta_housing/pipeline.py
|
lyoganathan/Housing_Prices_GTA
|
6af9f4996aa7f6ea15adbd48dc284ee07d852e90
|
[
"MIT"
] | null | null | null |
gta_housing/pipeline.py
|
lyoganathan/Housing_Prices_GTA
|
6af9f4996aa7f6ea15adbd48dc284ee07d852e90
|
[
"MIT"
] | null | null | null |
import scrape_realtor
import join_data
import find_region
import info_from_col
scrape_realtor.scrape_realtor('HamiltonEast','12','43.182935,-79.698982','data')
scrape_realtor.scrape_realtor('HamiltonWest','13','43.269680,-79.911580','data')
scrape_realtor.scrape_realtor('HamiltonSouth','12','43.178655,-80.052600','data')
scrape_realtor.scrape_realtor('Brantford','11','43.178625,-80.583035','data')
scrape_realtor.scrape_realtor('Cambridge','11','43.421220,-80.520550','data')
scrape_realtor.scrape_realtor('Waterdown','12','43.360685,-79.990120','data')
scrape_realtor.scrape_realtor('Milton','12','43.481128,-79.990120','data')
scrape_realtor.scrape_realtor('Burlington','12','43.360900,-79.637533','data')
scrape_realtor.scrape_realtor('Oakville','12','43.481100,-79.636500','data')
scrape_realtor.scrape_realtor('MissisaugaEast', '13', '43.571212,-79.584143','data')
scrape_realtor.scrape_realtor('MissisaugaWest','13','43.571212,-79.760783','data')
scrape_realtor.scrape_realtor('Georgetown','12','43.602077,-79.990120','data')
scrape_realtor.scrape_realtor('MissisaugaNorth', '12','43.661467,-79.642334','data')
scrape_realtor.scrape_realtor('Brampton','12','43.781062,-79.666023','data')
scrape_realtor.scrape_realtor('Toronto', '13', '43.658907,-79.387145','data')
scrape_realtor.scrape_realtor('York', '13', '43.718613,-79.387145','data')
scrape_realtor.scrape_realtor('NorthYork', '13', '43.778507,-79.402251','data')
scrape_realtor.scrape_realtor('Vaughn', '12', '43.844237,-79.666023','data')
scrape_realtor.scrape_realtor('MarkhamWest', '13', '43.838341,-79.402251','data')
scrape_realtor.scrape_realtor('KingCity', '12', '43.962973,-79.666023','data')
scrape_realtor.scrape_realtor('RichmondHill', '13', '43.897745,-79.402251','data')
scrape_realtor.scrape_realtor('Aurora', '12', '43.962973,-79.303817','data')
scrape_realtor.scrape_realtor('Newmarket', '12', '44.065686,-79.460372','data')
scrape_realtor.scrape_realtor('Scarborough', '11', '43.704964,-78.985457','data')
scrape_realtor.scrape_realtor('MarkhamEast', '12', '43.879187,-79.150252','data')
scrape_realtor.scrape_realtor('Oshawa', '12', '43.906155,-78.798003','data')
join_data.join_data(r'data')
find_region.find_region(r"data\all_houses.csv",r"data\fed_ont_WGS84.shp")
info_from_col.new_cols(r"data\all_houses.csv")
| 63.916667
| 84
| 0.757497
| 330
| 2,301
| 5.075758
| 0.293939
| 0.411343
| 0.294925
| 0.403582
| 0.520597
| 0.249552
| 0.249552
| 0
| 0
| 0
| 0
| 0.210291
| 0.028683
| 2,301
| 35
| 85
| 65.742857
| 0.53915
| 0
| 0
| 0
| 0
| 0
| 0.429813
| 0.009561
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.121212
| 0
| 0.121212
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 5
|
73676d38b1cbafbc7f84dab403a7c0aaa9ac0de7
| 12,337
|
py
|
Python
|
scan_service/tests/topology_tests.py
|
kkkkv/tgnms
|
a3b8fd8a69b647a614f9856933f05e50a4affadf
|
[
"MIT"
] | 12
|
2021-04-06T06:27:18.000Z
|
2022-03-18T10:52:29.000Z
|
scan_service/tests/topology_tests.py
|
kkkkv/tgnms
|
a3b8fd8a69b647a614f9856933f05e50a4affadf
|
[
"MIT"
] | 6
|
2022-01-04T13:32:16.000Z
|
2022-03-28T21:13:59.000Z
|
scan_service/tests/topology_tests.py
|
kkkkv/tgnms
|
a3b8fd8a69b647a614f9856933f05e50a4affadf
|
[
"MIT"
] | 7
|
2021-09-27T13:14:42.000Z
|
2022-03-28T16:24:15.000Z
|
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from collections import defaultdict
import asynctest
from scan_service.utils.topology import Topology
from tglib.exceptions import ClientRuntimeError
class TopologyTests(asynctest.TestCase):
def setUp(self) -> None:
self.maxDiff = None
async def test_update_topologies(self) -> None:
# Reset Topology class variables before start of the tests
Topology.topology = {}
Topology.link_name_to_mac = defaultdict(dict)
Topology.mac_to_link_name = defaultdict(dict)
Topology.wlan_mac_to_site_name = defaultdict(dict)
Topology.site_name_to_wlan_macs = defaultdict(dict)
Topology.node_channel = defaultdict(dict)
Topology.node_polarity = defaultdict(dict)
network_A = {
"name": "network_A",
"nodes": [
{
"site_name": "TEST.18-41.s1",
"wlan_mac_addrs": ["00:00:00:2f:e6:ea", "00:00:00:00:00:00"],
},
{
"site_name": "TEST.18-61.P5",
"wlan_mac_addrs": ["00:00:00:2f:e9:43", "00:00:00:00:00:01"],
},
],
"links": [
{
"name": "link-TEST.18-41.s1-TEST.18-61.P5",
"a_node_name": "TEST.18-41.s1",
"z_node_name": "TEST.18-61.P5",
"a_node_mac": "00:00:00:2f:e6:ea",
"z_node_mac": "00:00:00:2f:e9:43",
"link_type": 1,
},
{
"name": "link-TEST.18-41.p1-TEST.18-41.s1",
"a_node_name": "TEST.18-41.p1",
"z_node_name": "TEST.18-41.s1",
"a_node_mac": "00:00:00:2y:e6:rt",
"z_node_mac": "00:00:00:yf:yw:yy",
"link_type": 2,
},
],
}
network_B = {
"name": "network_B",
"nodes": [
{"site_name": "TEST.18-37.S1", "wlan_mac_addrs": ["00:00:00:28:e8:bc"]},
{"site_name": "TEST.18-36.p2", "wlan_mac_addrs": ["00:00:00:ca:1d:e5"]},
],
"links": [
{
"name": "link-TEST.18-36.p2-TEST.18-37.S1",
"a_node_name": "TEST.18-36.p2",
"z_node_name": "TEST.18-37.S1",
"a_node_mac": "00:00:00:ca:1d:e5",
"z_node_mac": "00:00:00:28:e8:bc",
"link_type": 1,
},
{
"name": "link-TEST.18-60.P2-TEST.18-60.S2",
"a_node_name": "TEST.18-60.P2",
"z_node_name": "TEST.18-60.S2",
"a_node_mac": "00:00:00:2f:e6:ea",
"z_node_mac": "",
"link_type": 2,
},
],
}
network_C = {
"name": "network_C",
"nodes": [{"site_name": "dummy_site", "wlan_mac_addrs": []}],
"links": [
{
"name": "link-TEST.18-36.p2-TEST.18-37.S1",
"a_node_name": "TEST.18-36.p2",
"z_node_name": "TEST.18-37.S1",
"a_node_mac": "",
"z_node_mac": "",
"link_type": 1,
},
{
"name": "link-TEST.18-60.P2-TEST.18-60.S2",
"a_node_name": "TEST.18-60.P2",
"z_node_name": "TEST.18-60.S2",
"a_node_mac": "00:00:00:2f:e6:ea",
"z_node_mac": "",
"link_type": 2,
},
],
}
node_overrides_config_A = {
"overrides": "{"
'"TEST.18-41.s1": {'
' "radioParamsOverride": {'
' "00:00:00:2f:e6:ea": {"fwParams": {"channel": 1, "polarity": 2}}'
" }"
" },"
'"TEST.18-61.P5": {'
' "radioParamsOverride": {'
' "00:00:00:2f:e9:43": {"fwParams": {"channel": 0, "polarity": 1}}'
" }"
" }"
"}"
}
node_overrides_config_B = {
"overrides": "{"
'"TEST.18-37.S1": {'
' "radioParamsOverride": {'
' "00:00:00:28:e8:bc": {"fwParams": {"channel": 2, "polarity": 0}}'
" }"
" },"
'"TEST.18-36.p2": {'
' "radioParamsOverride": {'
' "00:00:00:ca:1d:e5": {}'
" }"
" }"
"}"
}
with asynctest.patch(
"tglib.clients.api_service_client.APIServiceClient.request",
return_value=ClientRuntimeError(),
):
await Topology.update_topologies("network_A")
self.assertDictEqual(Topology.topology, defaultdict(dict))
self.assertDictEqual(Topology.link_name_to_mac, defaultdict(dict))
self.assertDictEqual(Topology.mac_to_link_name, defaultdict(dict))
self.assertDictEqual(Topology.wlan_mac_to_site_name, defaultdict(dict))
self.assertDictEqual(Topology.node_channel, defaultdict(dict))
self.assertDictEqual(Topology.node_polarity, defaultdict(dict))
with asynctest.patch(
"tglib.clients.api_service_client.APIServiceClient.request", return_value={}
):
await Topology.update_topologies("network_A")
self.assertDictEqual(Topology.topology, defaultdict(dict))
self.assertDictEqual(Topology.link_name_to_mac, defaultdict(dict))
self.assertDictEqual(Topology.mac_to_link_name, defaultdict(dict))
self.assertDictEqual(Topology.wlan_mac_to_site_name, defaultdict(dict))
self.assertDictEqual(Topology.node_channel, defaultdict(dict))
self.assertDictEqual(Topology.node_polarity, defaultdict(dict))
with asynctest.patch(
"tglib.clients.api_service_client.APIServiceClient.request_all",
return_value={"network_A": {}, "network_B": {}},
):
await Topology.update_topologies()
self.assertDictEqual(Topology.topology, defaultdict(dict))
self.assertDictEqual(Topology.link_name_to_mac, defaultdict(dict))
self.assertDictEqual(Topology.mac_to_link_name, defaultdict(dict))
self.assertDictEqual(Topology.wlan_mac_to_site_name, defaultdict(dict))
self.assertDictEqual(Topology.node_channel, defaultdict(dict))
self.assertDictEqual(Topology.node_polarity, defaultdict(dict))
with asynctest.patch(
"tglib.clients.api_service_client.APIServiceClient.request",
side_effect=[network_A, node_overrides_config_A],
):
await Topology.update_topologies("network_A")
self.assertDictEqual(Topology.topology, {"network_A": network_A})
self.assertDictEqual(
Topology.link_name_to_mac,
{
"network_A": {
"link-TEST.18-41.s1-TEST.18-61.P5": (
"00:00:00:2f:e6:ea",
"00:00:00:2f:e9:43",
)
}
},
)
self.assertDictEqual(
Topology.mac_to_link_name,
{
"network_A": {
(
"00:00:00:2f:e6:ea",
"00:00:00:2f:e9:43",
): "link-TEST.18-41.s1-TEST.18-61.P5",
(
"00:00:00:2f:e9:43",
"00:00:00:2f:e6:ea",
): "link-TEST.18-41.s1-TEST.18-61.P5",
}
},
)
self.assertDictEqual(
Topology.wlan_mac_to_site_name,
{
"network_A": {
"00:00:00:00:00:00": "TEST.18-41.s1",
"00:00:00:2f:e6:ea": "TEST.18-41.s1",
"00:00:00:00:00:01": "TEST.18-61.P5",
"00:00:00:2f:e9:43": "TEST.18-61.P5",
}
},
)
self.assertDictEqual(
Topology.node_channel,
{"network_A": {"00:00:00:2f:e6:ea": 1, "00:00:00:2f:e9:43": 0}},
)
self.assertDictEqual(
Topology.node_polarity,
{"network_A": {"00:00:00:2f:e6:ea": 2, "00:00:00:2f:e9:43": 1}},
)
with asynctest.patch(
"tglib.clients.api_service_client.APIServiceClient.request_all",
return_value={
"network_A": network_A,
"network_B": network_B,
"network_C": network_C,
},
), asynctest.patch(
"tglib.clients.api_service_client.APIServiceClient.request",
side_effect=[node_overrides_config_A, node_overrides_config_B],
):
await Topology.update_topologies()
self.assertDictEqual(
Topology.topology,
{
"network_A": network_A,
"network_B": network_B,
"network_C": network_C,
},
)
self.assertDictEqual(
Topology.link_name_to_mac,
{
"network_A": {
"link-TEST.18-41.s1-TEST.18-61.P5": (
"00:00:00:2f:e6:ea",
"00:00:00:2f:e9:43",
)
},
"network_B": {
"link-TEST.18-36.p2-TEST.18-37.S1": (
"00:00:00:ca:1d:e5",
"00:00:00:28:e8:bc",
)
},
},
)
self.assertDictEqual(
Topology.mac_to_link_name,
{
"network_A": {
(
"00:00:00:2f:e6:ea",
"00:00:00:2f:e9:43",
): "link-TEST.18-41.s1-TEST.18-61.P5",
(
"00:00:00:2f:e9:43",
"00:00:00:2f:e6:ea",
): "link-TEST.18-41.s1-TEST.18-61.P5",
},
"network_B": {
(
"00:00:00:ca:1d:e5",
"00:00:00:28:e8:bc",
): "link-TEST.18-36.p2-TEST.18-37.S1",
(
"00:00:00:28:e8:bc",
"00:00:00:ca:1d:e5",
): "link-TEST.18-36.p2-TEST.18-37.S1",
},
},
)
self.assertDictEqual(
Topology.wlan_mac_to_site_name,
{
"network_A": {
"00:00:00:00:00:00": "TEST.18-41.s1",
"00:00:00:2f:e6:ea": "TEST.18-41.s1",
"00:00:00:00:00:01": "TEST.18-61.P5",
"00:00:00:2f:e9:43": "TEST.18-61.P5",
},
"network_B": {
"00:00:00:28:e8:bc": "TEST.18-37.S1",
"00:00:00:ca:1d:e5": "TEST.18-36.p2",
},
},
)
self.assertDictEqual(
Topology.node_channel,
{
"network_A": {"00:00:00:2f:e6:ea": 1, "00:00:00:2f:e9:43": 0},
"network_B": {"00:00:00:28:e8:bc": 2},
},
)
self.assertDictEqual(
Topology.node_polarity,
{
"network_A": {"00:00:00:2f:e6:ea": 2, "00:00:00:2f:e9:43": 1},
"network_B": {"00:00:00:28:e8:bc": 0},
},
)
| 39.66881
| 88
| 0.427657
| 1,264
| 12,337
| 3.992089
| 0.088608
| 0.100674
| 0.084423
| 0.050733
| 0.837495
| 0.792113
| 0.750892
| 0.713833
| 0.693619
| 0.653785
| 0
| 0.119258
| 0.431791
| 12,337
| 310
| 89
| 39.796774
| 0.600571
| 0.0107
| 0
| 0.535593
| 0
| 0.010169
| 0.270939
| 0.075234
| 0
| 0
| 0
| 0
| 0.101695
| 1
| 0.00339
| false
| 0
| 0.013559
| 0
| 0.020339
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
736bd98522d9adbc48716232b4f6b37edee73f10
| 394
|
py
|
Python
|
blog/urls.py
|
PhanTask/PhanBlog
|
fb8741c293ab5c1569e39ebea4bd567d004720cd
|
[
"MIT"
] | 5
|
2017-03-27T06:38:55.000Z
|
2018-06-28T05:55:01.000Z
|
blog/urls.py
|
PhanTask/PhanBlog
|
fb8741c293ab5c1569e39ebea4bd567d004720cd
|
[
"MIT"
] | null | null | null |
blog/urls.py
|
PhanTask/PhanBlog
|
fb8741c293ab5c1569e39ebea4bd567d004720cd
|
[
"MIT"
] | null | null | null |
from django.conf.urls import *
from blog.views import index
from blog.views import articleView
from blog.views import bloglistView
# from blog.views import searchView
from blog.views import submitComment
from blog.views import asynHandler
# url(r'([\s\S]*)',searchView),
urlpatterns = [url(r'^$',bloglistView),url(r'^(\d+)',articleView),url(r'^comment$',asynHandler,{'action':'submitComment'})]
| 43.777778
| 123
| 0.761421
| 54
| 394
| 5.555556
| 0.37037
| 0.16
| 0.26
| 0.38
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083756
| 394
| 9
| 123
| 43.777778
| 0.831025
| 0.159898
| 0
| 0
| 0
| 0
| 0.109422
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.857143
| 0
| 0.857143
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
73881565cb9fbd2b2766fbde7be7e2ab35951ece
| 184
|
py
|
Python
|
tests/test_texture.py
|
hefangwuwu/relaxrender
|
adcf3fa5dc7d38f0af8308083fadf665dd30bdb2
|
[
"MIT"
] | 4
|
2018-06-08T16:42:30.000Z
|
2018-06-21T19:41:58.000Z
|
tests/test_texture.py
|
hefangwuwu/relaxrender
|
adcf3fa5dc7d38f0af8308083fadf665dd30bdb2
|
[
"MIT"
] | 70
|
2018-06-15T08:46:25.000Z
|
2018-06-25T10:47:16.000Z
|
tests/test_texture.py
|
hefangwuwu/relaxrender
|
adcf3fa5dc7d38f0af8308083fadf665dd30bdb2
|
[
"MIT"
] | 56
|
2018-06-08T11:46:05.000Z
|
2018-06-25T04:15:17.000Z
|
import unittest
import numpy as np
import relaxrender.points as rp
import relaxrender.color as color
class TestTexture(unittest.TestCase):
def test_texture(self):
pass
| 15.333333
| 37
| 0.76087
| 25
| 184
| 5.56
| 0.68
| 0.244604
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190217
| 184
| 11
| 38
| 16.727273
| 0.932886
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0.142857
| 0.571429
| 0
| 0.857143
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
73a77fefc3e8b57c5e3b2ddb3205eeb234e9199f
| 228
|
py
|
Python
|
example.py
|
maciejszewczyk/bramka-play
|
cd21b4059c414611d33ba6006678c1d1b772229f
|
[
"BSD-3-Clause"
] | 1
|
2015-11-24T21:43:01.000Z
|
2015-11-24T21:43:01.000Z
|
example.py
|
maciejszewczyk/bramka-play
|
cd21b4059c414611d33ba6006678c1d1b772229f
|
[
"BSD-3-Clause"
] | null | null | null |
example.py
|
maciejszewczyk/bramka-play
|
cd21b4059c414611d33ba6006678c1d1b772229f
|
[
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bramkaplay import *
Play = BramkaPlay('<login>', '<password>') # login example: 505123456
Play.sendsms('<recipient>', '<text message>') # recipient example: 505123456
| 25.333333
| 78
| 0.653509
| 25
| 228
| 5.96
| 0.76
| 0.214765
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098958
| 0.157895
| 228
| 8
| 79
| 28.5
| 0.677083
| 0.421053
| 0
| 0
| 0
| 0
| 0.328125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.333333
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
73fb9b333d5ce13422882136b87d96cd9302c54c
| 347
|
py
|
Python
|
activecampaign/models/webhook.py
|
pmiguelima/django-activecampaign
|
2a0b7a3f852c84a1cb061d93bb21f4f74ad4a959
|
[
"BSD-3-Clause"
] | 1
|
2021-01-10T21:05:14.000Z
|
2021-01-10T21:05:14.000Z
|
activecampaign/models/webhook.py
|
pmiguelima/django-activecampaign
|
2a0b7a3f852c84a1cb061d93bb21f4f74ad4a959
|
[
"BSD-3-Clause"
] | null | null | null |
activecampaign/models/webhook.py
|
pmiguelima/django-activecampaign
|
2a0b7a3f852c84a1cb061d93bb21f4f74ad4a959
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
import inspect
class Webhook (models.Model):
def add(self):
pass
def delete(self):
pass
def edit(self):
pass
def events(self):
pass
def list(self):
pass
def view(self):
pass
| 13.346154
| 39
| 0.573487
| 43
| 347
| 4.511628
| 0.55814
| 0.247423
| 0.283505
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004329
| 0.334294
| 347
| 26
| 40
| 13.346154
| 0.835498
| 0.060519
| 0
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| false
| 0.375
| 0.1875
| 0
| 0.625
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
fb40659b39dc6b7c5fb902b7be214d1c42e98d5e
| 336
|
py
|
Python
|
03/00/windll.py
|
pylangstudy/201712
|
f18f1251074729c4a3865b113edc89ec06b54130
|
[
"CC0-1.0"
] | null | null | null |
03/00/windll.py
|
pylangstudy/201712
|
f18f1251074729c4a3865b113edc89ec06b54130
|
[
"CC0-1.0"
] | null | null | null |
03/00/windll.py
|
pylangstudy/201712
|
f18f1251074729c4a3865b113edc89ec06b54130
|
[
"CC0-1.0"
] | null | null | null |
import ctypes
#http://www22.atpages.jp/~cncc/download/SofTalk/.NET/stn019329.zip
#Linux上でWindows用の.dllファイルは読み込めない
ctypes.CDLL('./softalk/dll/aqt10/AquesTalk.dll')#OSError: ./softalk/dll/aqt10/AquesTalk.dll: invalid ELF header
ctypes.WinDLL('./softalk/dll/aqt10/AquesTalk.dll')#AttributeError: module 'ctypes' has no attribute 'WinDLL'
| 48
| 111
| 0.791667
| 44
| 336
| 6.045455
| 0.636364
| 0.112782
| 0.169173
| 0.270677
| 0.304511
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043887
| 0.050595
| 336
| 6
| 112
| 56
| 0.789969
| 0.639881
| 0
| 0
| 0
| 0
| 0.568966
| 0.568966
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
fbbc8fa458a20a935fee4c811d4c0ea37238c979
| 96
|
py
|
Python
|
net/model/layer/__init__.py
|
lhq1/legal-predicetion
|
0919732d9aecba17630a3dcaedd3611ca990010c
|
[
"MIT"
] | 87
|
2018-08-27T14:59:11.000Z
|
2022-03-01T07:29:27.000Z
|
net/model/layer/__init__.py
|
lllybi/TopJudge
|
c9186b132e79830fd4e855777b06a601d76bf0a2
|
[
"MIT"
] | 6
|
2018-10-11T09:29:05.000Z
|
2020-12-14T02:29:28.000Z
|
net/model/layer/__init__.py
|
lllybi/TopJudge
|
c9186b132e79830fd4e855777b06a601d76bf0a2
|
[
"MIT"
] | 31
|
2018-08-28T00:44:59.000Z
|
2022-02-18T18:17:01.000Z
|
from .attention import Attention
from .attention_tanh import AttentionTanH
from .svm import svm
| 24
| 41
| 0.84375
| 13
| 96
| 6.153846
| 0.461538
| 0.325
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 96
| 3
| 42
| 32
| 0.952381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
fbcf719ef98f43a688ef86d2aa9f8b9e6244217e
| 209
|
py
|
Python
|
netlists/oceanv4/netlist.py
|
witwiki/tokenspice
|
1c45e504608d9f3f1f029cb9b8e1b90368315da5
|
[
"Apache-2.0"
] | 1
|
2020-11-27T06:29:18.000Z
|
2020-11-27T06:29:18.000Z
|
netlists/oceanv4/netlist.py
|
witwiki/tokenspice
|
1c45e504608d9f3f1f029cb9b8e1b90368315da5
|
[
"Apache-2.0"
] | null | null | null |
netlists/oceanv4/netlist.py
|
witwiki/tokenspice
|
1c45e504608d9f3f1f029cb9b8e1b90368315da5
|
[
"Apache-2.0"
] | null | null | null |
# pylint: disable=unused-import
"""
Netlist to simulate oceanV4
"""
from .SimStrategy import SimStrategy
from .SimState import SimState
from .KPIs import KPIs, netlist_createLogData, netlist_plotInstructions
| 23.222222
| 71
| 0.813397
| 24
| 209
| 7
| 0.583333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005405
| 0.114833
| 209
| 8
| 72
| 26.125
| 0.902703
| 0.277512
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
8397baaa8800507c70324adf9c24d5fa6c7b79d9
| 130
|
py
|
Python
|
hubward/__init__.py
|
daler/hubward
|
533cc9279cfdf6cab3a79c0179a8287e9f8055ed
|
[
"BSD-3-Clause"
] | 10
|
2015-08-06T18:53:28.000Z
|
2017-03-21T17:35:32.000Z
|
hubward/__init__.py
|
daler/hubmasonry
|
533cc9279cfdf6cab3a79c0179a8287e9f8055ed
|
[
"BSD-3-Clause"
] | 2
|
2015-11-03T21:13:43.000Z
|
2020-10-26T18:11:02.000Z
|
hubward/__init__.py
|
daler/hubmasonry
|
533cc9279cfdf6cab3a79c0179a8287e9f8055ed
|
[
"BSD-3-Clause"
] | 4
|
2015-10-27T13:29:29.000Z
|
2018-07-04T17:40:36.000Z
|
import liftover
import utils
from log import log
import models
import generate_config_from_schema
from version import __version__
| 18.571429
| 34
| 0.876923
| 19
| 130
| 5.631579
| 0.526316
| 0.168224
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123077
| 130
| 6
| 35
| 21.666667
| 0.938596
| 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
83b6c30abe5826ccb74e935f244916c92d253501
| 224
|
py
|
Python
|
computer_basics/computer_basics/urls.py
|
jackiehongg/computer-basics
|
d9c1f062286c0ca78ee48aad28e38b607ff87e30
|
[
"MIT"
] | 1
|
2021-03-21T18:38:54.000Z
|
2021-03-21T18:38:54.000Z
|
computer_basics/computer_basics/urls.py
|
jackiehongg/computer-basics
|
d9c1f062286c0ca78ee48aad28e38b607ff87e30
|
[
"MIT"
] | null | null | null |
computer_basics/computer_basics/urls.py
|
jackiehongg/computer-basics
|
d9c1f062286c0ca78ee48aad28e38b607ff87e30
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from django.urls import path, include, re_path
urlpatterns = [
re_path('', include('frontend.urls')),
re_path('', include('lessons.urls')),
re_path('', include('users.urls')),
]
| 24.888889
| 46
| 0.674107
| 29
| 224
| 5.068966
| 0.448276
| 0.29932
| 0.265306
| 0.231293
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147321
| 224
| 8
| 47
| 28
| 0.769634
| 0
| 0
| 0
| 0
| 0
| 0.15625
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.285714
| 0
| 0.285714
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
83cd8f248dcdb8ea0a2cd880fafcfd7c8c9fe7c8
| 256
|
py
|
Python
|
src/api/pdi/domain/base/common/__init__.py
|
ahmetcagriakca/pythondataintegrator
|
079b968d6c893008f02c88dbe34909a228ac1c7b
|
[
"MIT"
] | 1
|
2020-12-18T21:37:28.000Z
|
2020-12-18T21:37:28.000Z
|
src/api/pdi/domain/base/common/__init__.py
|
ahmetcagriakca/pythondataintegrator
|
079b968d6c893008f02c88dbe34909a228ac1c7b
|
[
"MIT"
] | null | null | null |
src/api/pdi/domain/base/common/__init__.py
|
ahmetcagriakca/pythondataintegrator
|
079b968d6c893008f02c88dbe34909a228ac1c7b
|
[
"MIT"
] | 1
|
2020-12-18T21:37:31.000Z
|
2020-12-18T21:37:31.000Z
|
from pdi.domain.base.common.ConfigParameterBase import ConfigParameterBase
from pdi.domain.base.common.LogBase import LogBase
from pdi.domain.base.common.OperationEventBase import OperationEventBase
from pdi.domain.base.common.StatusBase import StatusBase
| 51.2
| 74
| 0.875
| 32
| 256
| 7
| 0.3125
| 0.125
| 0.232143
| 0.303571
| 0.410714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 256
| 4
| 75
| 64
| 0.933333
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
83d562bba7b17c105506342e33d9dd19ed62a897
| 42
|
py
|
Python
|
darkhistory/electrons/ics/__init__.py
|
cgiovanetti/DarkHistory
|
ca1ce2e9478be1023a7b5fee19e7c1b2a21862e8
|
[
"MIT"
] | 8
|
2019-04-23T02:09:40.000Z
|
2022-02-15T21:11:25.000Z
|
darkhistory/electrons/ics/__init__.py
|
cgiovanetti/DarkHistory
|
ca1ce2e9478be1023a7b5fee19e7c1b2a21862e8
|
[
"MIT"
] | 1
|
2017-09-29T17:36:45.000Z
|
2017-09-29T17:36:45.000Z
|
darkhistory/electrons/ics/__init__.py
|
cgiovanetti/DarkHistory
|
ca1ce2e9478be1023a7b5fee19e7c1b2a21862e8
|
[
"MIT"
] | 10
|
2019-04-23T16:29:58.000Z
|
2022-02-05T01:25:31.000Z
|
"""Inverse Compton scattering modules.
"""
| 21
| 38
| 0.738095
| 4
| 42
| 7.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 42
| 2
| 39
| 21
| 0.815789
| 0.833333
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
83e540b9e06d5063fc3119c7094a69f25e09beed
| 510
|
py
|
Python
|
microcosm_pubsub/chain/statements/__init__.py
|
Sinon/microcosm-pubsub
|
c98a188fcd5b3f358c7171dae0c39a33c5774a4e
|
[
"Apache-2.0"
] | 5
|
2016-07-23T21:20:50.000Z
|
2021-07-15T00:27:47.000Z
|
microcosm_pubsub/chain/statements/__init__.py
|
Sinon/microcosm-pubsub
|
c98a188fcd5b3f358c7171dae0c39a33c5774a4e
|
[
"Apache-2.0"
] | 76
|
2016-03-22T23:41:21.000Z
|
2020-07-27T17:35:36.000Z
|
microcosm_pubsub/chain/statements/__init__.py
|
Sinon/microcosm-pubsub
|
c98a188fcd5b3f358c7171dae0c39a33c5774a4e
|
[
"Apache-2.0"
] | 8
|
2016-06-01T18:43:41.000Z
|
2021-04-27T20:22:15.000Z
|
from microcosm_pubsub.chain.statements.assign import ( # noqa: F401
assign,
assign_constant,
assign_function,
extract,
)
from microcosm_pubsub.chain.statements.call import call # noqa: F401
from microcosm_pubsub.chain.statements.for_each import for_each # noqa: F401
from microcosm_pubsub.chain.statements.switch import switch # noqa: F401
from microcosm_pubsub.chain.statements.try_chain import try_chain # noqa: F401
from microcosm_pubsub.chain.statements.when import when # noqa: F401
| 42.5
| 79
| 0.794118
| 69
| 510
| 5.695652
| 0.26087
| 0.198473
| 0.290076
| 0.366412
| 0.600509
| 0.427481
| 0.427481
| 0
| 0
| 0
| 0
| 0.040816
| 0.135294
| 510
| 11
| 80
| 46.363636
| 0.85034
| 0.127451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.545455
| 0
| 0.545455
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f7ac9a5205f56ed19d0fb6dc40ae3bc31e627bf4
| 5,927
|
py
|
Python
|
integration-test/601-cliff-arete-ridge-valley.py
|
roman-ianivskyy/vector-datasource
|
3d59c0d9856d6bc2a78c4a9273b4e850c2e41d92
|
[
"MIT"
] | null | null | null |
integration-test/601-cliff-arete-ridge-valley.py
|
roman-ianivskyy/vector-datasource
|
3d59c0d9856d6bc2a78c4a9273b4e850c2e41d92
|
[
"MIT"
] | null | null | null |
integration-test/601-cliff-arete-ridge-valley.py
|
roman-ianivskyy/vector-datasource
|
3d59c0d9856d6bc2a78c4a9273b4e850c2e41d92
|
[
"MIT"
] | null | null | null |
# -*- encoding: utf-8 -*-
import dsl
from shapely.wkt import loads as wkt_loads
from . import FixtureTest
class CliffAreteRidgeValley(FixtureTest):
def test_cliff(self):
# cliff in Yosemite
self.generate_fixtures(dsl.way(291684864, wkt_loads(
'LINESTRING (-119.606652304275 37.7473184229575, -119.606322712397 37.7475568750731, -119.606028064984 37.74775661453209, -119.605635321542 37.74793959017788, -119.605516025272 37.74811709601069, -119.605516025272 37.74833885339959, -119.605565073286 37.74856082321469, -119.605600197414 37.74867859124949, -119.605674128762 37.74892705419649, -119.605733507402 37.74912650583861, -119.605986023829 37.74944805655269, -119.606518994287 37.74974758685328, -119.606890806983 37.74997502166659, -119.60711107389 37.7502379701017, -119.607071458186 37.7505595159861, -119.60690535969 37.75085186795659, -119.606816067151 37.7509851874586, -119.606729469558 37.75109052177009, -119.606477042963 37.75127348917249, -119.606273574551 37.7513843632206, -119.606168381831 37.75151761073579, -119.606140264563 37.751678416586, -119.60618239555 37.75187246275629, -119.606378767271 37.75198340693389, -119.606448925695 37.75220522376329, -119.606371760412 37.752382719364, -119.606210512818 37.75249359175001, -119.605901761855 37.75257676368719, -119.605396818834 37.75265446650548, -119.605158316126 37.75278195861299, -119.604773388027 37.75315541333809, -119.604356839229 37.75351622364438, -119.604078990312 37.75388477393009, -119.604009640372 37.75404166826239, -119.603989787604 37.7542612771538, -119.604108814379 37.75455148376398, -119.604259821179 37.75478650340779, -119.604280841756 37.75498061245099, -119.604224697051 37.75508040120471, -119.604196669614 37.75521911089999, -119.60423871077 37.75531335947959, -119.604365013898 37.75537990870569, -119.604358007039 37.75552955546618, -119.604343993321 37.75572366255988, -119.60433689663 37.7558789904821, -119.6042305361 37.75628900633419, -119.604175559205 37.75653339543988, -119.604084380204 37.7566554121339, -119.603965173765 37.75676627811728, -119.60392313261 37.7569437627762, -119.603796919313 37.7571544853058, -119.603663609325 37.7574872225572, -119.603492480263 37.75783089559862, -119.603333837784 37.7580818845728, -119.602996610226 37.75840339636969, -119.602842638986 37.75855928683071, -119.602655609744 37.75874855658439, -119.60249786558 37.75893839401598, -119.602033436579 37.75915791735211, -119.601834998732 37.75940101862347, -119.601805174665 37.75969120507241, -119.601785411729 37.75984801607169)'), {u'source': u'openstreetmap.org', u'natural': u'cliff'}))
self.assert_has_feature(
13, 1374, 3166, 'earth',
{'kind': 'cliff', 'id': 291684864,
'sort_rank': 227})
def test_arete(self):
# arete in Yosemite
self.generate_fixtures(dsl.way(375271242, wkt_loads('LINESTRING (-119.401549317931 37.813466961351, -119.401034313778 37.81428067468669, -119.400755386883 37.81480618424528, -119.400674358844 37.81503639954349, -119.400726461131 37.8152319826298, -119.400841175992 37.81546730614998, -119.401034313778 37.8159249642497, -119.401077163417 37.81651816270329, -119.400540779361 37.81697588525279, -119.400197533091 37.81745056537648, -119.399918516364 37.81804382253451, -119.399210374426 37.81853538499098, -119.398630961067 37.81914559345329, -119.398244775327 37.81997620402921, -119.397987318166 37.82160340727599, -119.397601132426 37.8223660821422, -119.397495760043 37.82334091503947, -119.397300376468 37.8234438046436, -119.397128977912 37.82363737862718, -119.397104992894 37.82420525421318, -119.396871520752 37.82470521953029, -119.396549744217 37.8251120153795, -119.396258330739 37.82554300508181, -119.395984703903 37.82622205355572, -119.395724192471 37.8271583780685, -119.395698141328 37.82763178648599)'), {
u'source': u'openstreetmap.org', u'natural': u'arete', u'name': u'Matthes Crest'}))
self.assert_has_feature(
13, 1379, 3164, 'earth',
{'kind': 'arete', 'id': 375271242,
'sort_rank': 228})
def test_ridge(self):
# ridge with name in Santa Cruz Mountains, California
self.generate_fixtures(dsl.way(115675159, wkt_loads('LINESTRING (-122.09598331024 37.2284726083747, -122.095792687737 37.2284379895402, -122.094154699648 37.2278232164737, -122.093631610658 37.22587550791897, -122.093460301933 37.2229029916846)'), {
u'source': u'openstreetmap.org', u'natural': u'ridge', u'name': u'Castle Rock Ridge'}))
self.assert_has_feature(
13, 1317, 3182, 'earth',
{'kind': 'ridge', 'id': 115675159,
'name': 'Castle Rock Ridge', 'label_placement': True})
def test_valley(self):
# valley with name in Yosemite
# https://www.openstreetmap.org/way/407467016
self.generate_fixtures(dsl.way(407467016, wkt_loads('LINESTRING (-119.261659888964 37.79166666637099, -119.261590000034 37.79842208142838, -119.261831377351 37.79973815343202, -119.262295447027 37.8010097686072, -119.263309285657 37.80270737446008, -119.265363822543 37.8076113105389, -119.265846577177 37.80927689826868, -119.267144822425 37.81170956259009, -119.269408576941 37.8157863684461, -119.272680870027 37.81900707465889, -119.27403813459 37.81978680719037, -119.275172706793 37.82158779605946, -119.276454782367 37.8236026801022, -119.281829941701 37.8352523783722, -119.285949795257 37.8456062161387, -119.293384881369 37.85417107584448, -119.305873170617 37.86652107633787, -119.315486311967 37.870061373749)'), {
u'source': u'openstreetmap.org', u'natural': u'valley', u'name': u'Lyell Canyon'}))
self.assert_has_feature(
13, 1381, 3164, 'earth',
{'kind': 'valley', 'id': 407467016,
'name': 'Lyell Canyon', 'label_placement': True})
| 120.959184
| 2,353
| 0.753163
| 659
| 5,927
| 6.735964
| 0.444613
| 0.009011
| 0.018022
| 0.020725
| 0.077495
| 0.045956
| 0.045956
| 0.029736
| 0
| 0
| 0
| 0.679599
| 0.125865
| 5,927
| 48
| 2,354
| 123.479167
| 0.177186
| 0.031044
| 0
| 0.125
| 0
| 0.125
| 0.775453
| 0
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0.125
| false
| 0
| 0.09375
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f7e1c74f2aeb5073cbb8409a8c36adc7e3d2ecca
| 31
|
py
|
Python
|
tests/samples/test-hide-listing/hello/__init__.py
|
vyasr/scikit-build
|
5a821eb137d253e0380b4e76a2a692fba27d16dc
|
[
"MIT"
] | 299
|
2015-10-19T22:45:08.000Z
|
2022-03-30T21:15:55.000Z
|
tests/samples/test-hide-listing/hello/__init__.py
|
vyasr/scikit-build
|
5a821eb137d253e0380b4e76a2a692fba27d16dc
|
[
"MIT"
] | 588
|
2015-09-17T04:26:59.000Z
|
2022-03-29T14:51:54.000Z
|
tests/samples/test-hide-listing/hello/__init__.py
|
vyasr/scikit-build
|
5a821eb137d253e0380b4e76a2a692fba27d16dc
|
[
"MIT"
] | 102
|
2015-10-19T22:45:13.000Z
|
2022-03-20T21:09:08.000Z
|
def hello(msg):
print(msg)
| 10.333333
| 15
| 0.612903
| 5
| 31
| 3.8
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225806
| 31
| 2
| 16
| 15.5
| 0.791667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 0.5
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
f7e277812c3039eb8ff7774d9165cc3f2f9b65c8
| 2,704
|
py
|
Python
|
tests/structures/test_while.py
|
Donyme/voc
|
bf7475a29aa59feb1fb4199eec4b3d0949a7a037
|
[
"BSD-3-Clause"
] | 1
|
2018-10-04T21:46:37.000Z
|
2018-10-04T21:46:37.000Z
|
tests/structures/test_while.py
|
Donyme/voc
|
bf7475a29aa59feb1fb4199eec4b3d0949a7a037
|
[
"BSD-3-Clause"
] | null | null | null |
tests/structures/test_while.py
|
Donyme/voc
|
bf7475a29aa59feb1fb4199eec4b3d0949a7a037
|
[
"BSD-3-Clause"
] | 1
|
2020-06-16T17:07:25.000Z
|
2020-06-16T17:07:25.000Z
|
from ..utils import TranspileTestCase
class WhileLoopTests(TranspileTestCase):
def test_while(self):
self.assertCodeExecution("""
i = 0
total = 0
while i < 10:
i += 1
total += i
print(i, total)
""")
def test_break(self):
self.assertCodeExecution("""
i = 0
while i < 10:
i = i + 1
print(i, i % 5)
if i % 5 == 0:
break
print("after")
""")
def test_continue(self):
self.assertCodeExecution("""
i = 0
while i < 10:
i = i + 1
print(i, i % 5)
if i % 5 == 0:
continue
print("after")
""")
def test_nested(self):
self.assertCodeExecution("""
i = 1
j = 10
while i < j:
k = 0
while k < i:
print(i, j)
k = k + 1
print("While done")
i = i + 1
""")
def test_while_forever(self):
self.assertCodeExecution("""
i = 0
while 1:
print("Loop", i)
i = i + 1
if i == 10:
break
""")
def test_while_forever_with_if_not(self):
self.assertCodeExecution("""
i = 0
while 1:
print("Loop", i)
i = i + 1
if not i < 10:
break
""")
def test_while_not_forever(self):
self.assertCodeExecution("""
while not 0:
print("Loop")
break
""")
def test_while_else(self):
self.assertCodeExecution("""
i = 1
j = 4
while i < j:
print(i)
i = i + 1
else:
print("Else")
""")
def test_while_else_break(self):
self.assertCodeExecution("""
i = 1
j = 4
while i < j:
print(i)
i = i + 1
break
else:
print("Else")
""")
def test_while_forever_inside_try(self):
self.assertCodeExecution("""
i = 0
try:
while 1:
print("Loop", i)
i = i + 1
if i == 10:
break
finally:
print("Done")
""")
| 23.929204
| 45
| 0.341716
| 240
| 2,704
| 3.754167
| 0.145833
| 0.033296
| 0.299667
| 0.279689
| 0.584906
| 0.498335
| 0.374029
| 0.374029
| 0.374029
| 0.374029
| 0
| 0.039696
| 0.56213
| 2,704
| 112
| 46
| 24.142857
| 0.721284
| 0
| 0
| 0.71
| 0
| 0
| 0.689604
| 0
| 0
| 0
| 0
| 0
| 0.1
| 1
| 0.1
| false
| 0
| 0.01
| 0
| 0.12
| 0.16
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
79008666505b0b62a5773e50f987def871a3d604
| 33
|
py
|
Python
|
snowflake/__init__.py
|
ronmorgen1/snowflake
|
f038179c7188021757085938a0de5aadf6dc5e5b
|
[
"MIT"
] | null | null | null |
snowflake/__init__.py
|
ronmorgen1/snowflake
|
f038179c7188021757085938a0de5aadf6dc5e5b
|
[
"MIT"
] | null | null | null |
snowflake/__init__.py
|
ronmorgen1/snowflake
|
f038179c7188021757085938a0de5aadf6dc5e5b
|
[
"MIT"
] | null | null | null |
from .snowflake import Snowflake
| 16.5
| 32
| 0.848485
| 4
| 33
| 7
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 33
| 1
| 33
| 33
| 0.965517
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
79258c62cea03c2fbe8becbb132da1d87abe2763
| 101
|
py
|
Python
|
PySeis/core/__init__.py
|
pandeykiran80/ref
|
0a6ce704cf15729667b13c675f2e037705b67e66
|
[
"MIT"
] | 3
|
2017-05-04T22:32:35.000Z
|
2021-04-12T21:55:51.000Z
|
PySeis/core/__init__.py
|
pandeykiran80/ref
|
0a6ce704cf15729667b13c675f2e037705b67e66
|
[
"MIT"
] | null | null | null |
PySeis/core/__init__.py
|
pandeykiran80/ref
|
0a6ce704cf15729667b13c675f2e037705b67e66
|
[
"MIT"
] | 3
|
2017-12-08T02:41:44.000Z
|
2020-04-16T14:44:17.000Z
|
from __future__ import division, absolute_import, print_function
from . import su
from .su import *
| 20.2
| 64
| 0.80198
| 14
| 101
| 5.357143
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148515
| 101
| 4
| 65
| 25.25
| 0.872093
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f700b4d5e209da6b72ab274298a7377e88be1783
| 427
|
py
|
Python
|
Section1/1.5 Python Console/console.py
|
rneighborsphone/PyCharm-for-Power-Developer-v-
|
2d757c29fd4c8127073800fffc9146ce096c49ec
|
[
"MIT"
] | null | null | null |
Section1/1.5 Python Console/console.py
|
rneighborsphone/PyCharm-for-Power-Developer-v-
|
2d757c29fd4c8127073800fffc9146ce096c49ec
|
[
"MIT"
] | null | null | null |
Section1/1.5 Python Console/console.py
|
rneighborsphone/PyCharm-for-Power-Developer-v-
|
2d757c29fd4c8127073800fffc9146ce096c49ec
|
[
"MIT"
] | null | null | null |
class Calculator:
def __init__(self):
pass
def add(self, a, b):
return a + b
def divide(self, a, b):
return b / a
# Todo: Add subtract option
# def root(a):
# return math.sqrt()
def greetings(name):
print('Hello ' + name + '!')
def goodbye():
print('Goodbye!')
myCalculator = Calculator
myCalculator.subtract()
# execfile('console.py')
# exec('console.py')
| 13.774194
| 32
| 0.571429
| 52
| 427
| 4.615385
| 0.519231
| 0.025
| 0.05
| 0.1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.283372
| 427
| 30
| 33
| 14.233333
| 0.784314
| 0.236534
| 0
| 0
| 0
| 0
| 0.046875
| 0
| 0
| 0
| 0
| 0.033333
| 0
| 1
| 0.384615
| false
| 0.076923
| 0
| 0.153846
| 0.615385
| 0.153846
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.