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
ff795d3d5f71f38158882f6a10ae2d230ce09c3e
226
py
Python
src/my_code.py
Athenian-Computer-Science/print-input-assignment-template
ef9f6add483636402e3326bd150be928de5c82b4
[ "Apache-2.0" ]
null
null
null
src/my_code.py
Athenian-Computer-Science/print-input-assignment-template
ef9f6add483636402e3326bd150be928de5c82b4
[ "Apache-2.0" ]
null
null
null
src/my_code.py
Athenian-Computer-Science/print-input-assignment-template
ef9f6add483636402e3326bd150be928de5c82b4
[ "Apache-2.0" ]
null
null
null
################################################## # Collaborators (including friends, parents, web sites where you got help, etc): # Enter none if you didn't need help! # ##################################################
28.25
81
0.393805
19
226
4.684211
0.894737
0
0
0
0
0
0
0
0
0
0
0
0.115044
226
7
82
32.285714
0.445
0.50885
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
ff7f8cc020c13b11f04e65784379dca68e2bf4bb
172
py
Python
HackerRank/Python_Learn/03_Strings/03_Whats_Your_Name.py
Zubieta/CPP
fb4a3cbf2e4edcc590df15663cd28fb9ecab679c
[ "MIT" ]
8
2017-03-02T07:56:45.000Z
2021-08-07T20:20:19.000Z
HackerRank/Python_Learn/03_Strings/03_Whats_Your_Name.py
zubie7a/Algorithms
fb4a3cbf2e4edcc590df15663cd28fb9ecab679c
[ "MIT" ]
null
null
null
HackerRank/Python_Learn/03_Strings/03_Whats_Your_Name.py
zubie7a/Algorithms
fb4a3cbf2e4edcc590df15663cd28fb9ecab679c
[ "MIT" ]
1
2021-08-07T20:20:20.000Z
2021-08-07T20:20:20.000Z
# https://www.hackerrank.com/challenges/whats-your-name def print_full_name(a, b): # Formatting strings. print "Hello %s %s! You just delved into python." % (a, b)
34.4
62
0.686047
27
172
4.296296
0.814815
0.034483
0
0
0
0
0
0
0
0
0
0
0.162791
172
4
63
43
0.805556
0.424419
0
0
0
0
0.427083
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
ff93e8208f8d48305cd3220942122dbeda9646de
27
py
Python
pineboolib/plugins/sql/__init__.py
juanjosepablos/pineboo
f6ce515aec6e0139821bb9c1d62536d9fb50dae4
[ "MIT" ]
2
2017-12-10T23:06:16.000Z
2017-12-10T23:06:23.000Z
pineboolib/plugins/sql/__init__.py
Aulla/pineboo
3ad6412d365a6ad65c3bb2bdc03f5798d7c37004
[ "MIT" ]
36
2017-11-05T21:13:47.000Z
2020-08-26T15:56:15.000Z
pineboolib/plugins/sql/__init__.py
Aulla/pineboo
3ad6412d365a6ad65c3bb2bdc03f5798d7c37004
[ "MIT" ]
8
2017-11-05T15:56:31.000Z
2019-04-25T16:32:28.000Z
"""Sql drivers package."""
13.5
26
0.62963
3
27
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
27
1
27
27
0.708333
0.740741
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
ff9e61a6e89f6e2bd8465c1127793f661a7c622e
53
py
Python
quara/protocol/qtomography/__init__.py
tknrsgym/quara
8f3337af83cdd02bb85632bb1e297902b1fff8fb
[ "Apache-2.0" ]
3
2021-05-19T11:44:30.000Z
2022-03-30T07:13:49.000Z
quara/protocol/qtomography/__init__.py
tknrsgym/quara
8f3337af83cdd02bb85632bb1e297902b1fff8fb
[ "Apache-2.0" ]
2
2021-06-02T01:24:59.000Z
2021-06-02T12:20:31.000Z
quara/protocol/qtomography/__init__.py
tknrsgym/quara
8f3337af83cdd02bb85632bb1e297902b1fff8fb
[ "Apache-2.0" ]
1
2021-10-14T13:21:27.000Z
2021-10-14T13:21:27.000Z
"""Main logics for Quantum Tomography protocols."""
26.5
52
0.735849
6
53
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.132075
53
1
53
53
0.847826
0.849057
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
ff9efa8d199512372b8f73be9b38d5de225e070c
2,982
py
Python
main.py
c-smith7/Feedback_GUI
141d082b03fe40651e0d9d02546de73b4b72e558
[ "MIT" ]
null
null
null
main.py
c-smith7/Feedback_GUI
141d082b03fe40651e0d9d02546de73b4b72e558
[ "MIT" ]
null
null
null
main.py
c-smith7/Feedback_GUI
141d082b03fe40651e0d9d02546de73b4b72e558
[ "MIT" ]
null
null
null
import sys from PyQt5 import QtCore, Qt from PyQt5.QtWidgets import QMessageBox, QApplication from selenium.common.exceptions import SessionNotCreatedException from app.main_widget import Splashscreen from app.main_window import MainWindow import resources def main(): try: app = QApplication(sys.argv) splash = Splashscreen() window = MainWindow() window.show() splash.stop(window) app.exec() except SessionNotCreatedException as e: msgBox = QMessageBox() msgBox.setWindowModality(QtCore.Qt.WindowModal) msgBox.setWindowFlags(QtCore.Qt.ToolTip | QtCore.Qt.WindowStaysOnTopHint) msgBox.setIcon(QMessageBox.Information) msgBox.setTextFormat(QtCore.Qt.RichText) msgBox.setText("You need to update Chromedriver!<br><a href='https://chromedriver.chromium.org/downloads'>UPDATE HERE</a>") msgBox.setDetailedText(str(e)) msgBox.setStandardButtons(QMessageBox.Cancel) msgBox.setStyleSheet( 'QMessageBox {background-color: rgb(53, 53, 53); border-top: 1px solid rgb(115, 115, 115);' 'border-left: 1px solid rgb(115, 115, 115); border-right: 1px solid rgb(115, 115, 115);' 'border-bottom: 1px solid rgb(115, 115, 115); font-family: "Segoe UI";}' 'QLabel {color: rgb(235, 235, 235); padding-top: 10px; font-family: "Segoe UI";}' 'QPushButton {background-color: rgb(115, 115, 115); color: rgb(235, 235, 235);' 'border-radius: 11px; padding: 5px; min-width: 5em; font-family: "Segoe UI"; font-size: 12px;}' 'QPushButton:pressed {background-color: rgb(53, 53, 53)}' 'QPushButton:hover {border: 0.5px solid white}') msgBox.exec() except Exception as e: msgBox = QMessageBox() msgBox.setWindowModality(QtCore.Qt.WindowModal) msgBox.setWindowFlags(QtCore.Qt.ToolTip | QtCore.Qt.WindowStaysOnTopHint) msgBox.setIcon(QMessageBox.Information) msgBox.setText('Unknown error..') msgBox.setDetailedText(str(e)) msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setDefaultButton(QMessageBox.Ok) msgBox.setStyleSheet( 'QMessageBox {background-color: rgb(53, 53, 53); border-top: 1px solid rgb(115, 115, 115);' 'border-left: 1px solid rgb(115, 115, 115); border-right: 1px solid rgb(115, 115, 115);' 'border-bottom: 1px solid rgb(115, 115, 115); font-family: "Segoe UI";}' 'QLabel {color: rgb(235, 235, 235); padding-top: 10px; font-family: "Segoe UI";}' 'QPushButton {background-color: rgb(115, 115, 115); color: rgb(235, 235, 235);' 'border-radius: 11px; padding: 5px; min-width: 5em; font-family: "Segoe UI"; font-size: 12px;}' 'QPushButton:pressed {background-color: rgb(53, 53, 53)}' 'QPushButton:hover {border: 0.5px solid white}') msgBox.exec() if __name__ == "__main__": main()
48.096774
131
0.651241
352
2,982
5.488636
0.28125
0.062112
0.046584
0.062112
0.706004
0.706004
0.706004
0.643892
0.643892
0.643892
0
0.077353
0.219651
2,982
61
132
48.885246
0.752901
0
0
0.545455
0
0.236364
0.441315
0
0
0
0
0
0
1
0.018182
false
0
0.127273
0
0.145455
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
4452815dd4a7c17fbb7a784c30b9d2d5f2d74d41
109
py
Python
Vamei/std06/sp2.py
YangPhy/learnPython
5507fa1a0d2878fc663d62509af8ff959955f822
[ "MIT" ]
5
2020-05-18T06:54:52.000Z
2021-05-29T23:17:41.000Z
Vamei/std06/sp2.py
YangPhy/learnPython
5507fa1a0d2878fc663d62509af8ff959955f822
[ "MIT" ]
null
null
null
Vamei/std06/sp2.py
YangPhy/learnPython
5507fa1a0d2878fc663d62509af8ff959955f822
[ "MIT" ]
1
2020-05-17T22:47:49.000Z
2020-05-17T22:47:49.000Z
import subprocess out1=subprocess.call("ls -l",shell=True) out2=subprocess.call("cd /home && ls",shell=True)
27.25
49
0.743119
17
109
4.764706
0.647059
0.345679
0
0
0
0
0
0
0
0
0
0.019802
0.073395
109
3
50
36.333333
0.782178
0
0
0
0
0
0.174312
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
4452e03ecdc5eae363cc91f7e655d0b4f12ebfeb
266
py
Python
mysite/services/plot_cutter_service.py
mscibxablach/PhotoApp2
84cf70bd5f6442ed325f1082a6e0087883e06d37
[ "MIT" ]
null
null
null
mysite/services/plot_cutter_service.py
mscibxablach/PhotoApp2
84cf70bd5f6442ed325f1082a6e0087883e06d37
[ "MIT" ]
null
null
null
mysite/services/plot_cutter_service.py
mscibxablach/PhotoApp2
84cf70bd5f6442ed325f1082a6e0087883e06d37
[ "MIT" ]
null
null
null
from mysite.plot_cutter.plot_cutter import PlotCutter class PlotCutterService: def __init__(self, plot_cutter): self.plot_cutter = plot_cutter def get_plot(self, image_path): image = PlotCutter.cut_plot(image_path) return image
19
53
0.718045
34
266
5.235294
0.470588
0.280899
0.157303
0.224719
0
0
0
0
0
0
0
0
0.218045
266
13
54
20.461538
0.855769
0
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.714286
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
922f74375a57400b7e0b9149fd360529eebdd5eb
349
py
Python
wencai/__init__.py
bruce2792/wencai
1b4e8bdcb02e594e575601c0893c1b356cc2256b
[ "MIT" ]
113
2019-11-02T07:30:09.000Z
2022-03-29T08:00:51.000Z
wencai/__init__.py
bruce2792/wencai
1b4e8bdcb02e594e575601c0893c1b356cc2256b
[ "MIT" ]
18
2019-10-19T16:51:46.000Z
2022-03-09T13:22:39.000Z
wencai/__init__.py
bruce2792/wencai
1b4e8bdcb02e594e575601c0893c1b356cc2256b
[ "MIT" ]
47
2019-12-02T07:11:47.000Z
2022-03-24T13:09:13.000Z
# -*- coding:utf-8 -*- import sys import os from wencai.core.event import (get_scrape_report, set_variable, get_strategy, get_event_evaluate, get_lastjs, search )
31.727273
50
0.363897
25
349
4.8
0.76
0
0
0
0
0
0
0
0
0
0
0.006897
0.584527
349
10
51
34.9
0.82069
0.057307
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
9239554782b02d4f5581764394f6700379c004ab
460
py
Python
CoverLetterBuilder.py
joetannn/cs-321-project
38b3c3939f0d631dbffce36043c8f43e32d8ecb6
[ "MIT" ]
null
null
null
CoverLetterBuilder.py
joetannn/cs-321-project
38b3c3939f0d631dbffce36043c8f43e32d8ecb6
[ "MIT" ]
4
2021-03-10T11:08:26.000Z
2022-03-02T06:22:24.000Z
CoverLetterBuilder.py
joetannn/cs-321-project
38b3c3939f0d631dbffce36043c8f43e32d8ecb6
[ "MIT" ]
null
null
null
import json class CoverLetterBuilder: jsonInfo = "" jsonInfoIndicators = "" def __init__(self, info, infoIndicators): self.jsonInfo = info self.jsonInfoIndicators = infoIndicators # param infile; file pointer with cover letter with indicators to be filled in with info # param outfile; file pointer where finished cover letter will be put def build(self, infile, outfile): #TODO complete method pass
27.058824
92
0.691304
52
460
6.038462
0.634615
0.070064
0
0
0
0
0
0
0
0
0
0
0.252174
460
16
93
28.75
0.912791
0.378261
0
0
0
0
0
0
0
0
0
0.0625
0
1
0.222222
false
0.111111
0.111111
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
1
0
0
1
0
0
4
92400e4b46cc5d5435a047d06b28525e1878aa7b
960
py
Python
ports/k210-standalone/builtin-py/platform.py
alangman/MaixPy
d58620dd153fa0830436ec0df4ad704fbb94ee14
[ "MIT" ]
1
2020-04-08T07:25:24.000Z
2020-04-08T07:25:24.000Z
ports/k210-standalone/builtin-py/common.py
trouble3/MaixPy
368b2c3f55ca6969542f6eed459a06d53ba6d531
[ "MIT" ]
null
null
null
ports/k210-standalone/builtin-py/common.py
trouble3/MaixPy
368b2c3f55ca6969542f6eed459a06d53ba6d531
[ "MIT" ]
1
2019-09-09T08:06:33.000Z
2019-09-09T08:06:33.000Z
import machine class pin_init: fpioa=machine.fpioa() def init(self): self.fpioa.set_function(47,137)#FUNC_CMOS_PCLK self.fpioa.set_function(46,132)#FUNC_CMOS_XCLK self.fpioa.set_function(45,136)#FUNC_CMOS_HREF self.fpioa.set_function(44,134)#FUNC_CMOS_PWDN self.fpioa.set_function(43,135)#FUNC_CMOS_VSYN self.fpioa.set_function(42,133)#FUNC_CMOS_RST self.fpioa.set_function(41,146)#FUNC_SCCB_SCLK self.fpioa.set_function(40,147)#FUNC_SCCB_SDA self.fpioa.set_function(37, 25)#FUNC_GPIOHS1 init_rst self.fpioa.set_function(38, 26)#FUNC_GPIOHS2 tft_hard_init self.fpioa.set_function(36, 15)#FUNC_SPI0_SS3 tft_hard_init self.fpioa.set_function(39, 17)#FUNC_SPI0_SCLK tft_hard_init self.fpioa.set_function(12, 190)#FUNC_TIMER0_TOGGLE1 self.fpioa.set_function(13, 191)#FUNC_TIMER0_TOGGLE2 self.fpioa.set_function(14, 192)#FUNC_TIMER0_TOGGLE3
48
77
0.734375
155
960
4.219355
0.393548
0.206422
0.275229
0.458716
0.212538
0.142202
0.142202
0
0
0
0
0.102117
0.163542
960
19
78
50.526316
0.712329
0.369792
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.052632
null
null
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
9255ee06015b4da1e8a5e92854d796b2df9226bb
47
py
Python
workflows/__init__.py
ChrisHad/algorithm-reference-library
bded1b62ea801ea4f4f5bd0794c18cd81d4b2810
[ "Apache-2.0" ]
null
null
null
workflows/__init__.py
ChrisHad/algorithm-reference-library
bded1b62ea801ea4f4f5bd0794c18cd81d4b2810
[ "Apache-2.0" ]
null
null
null
workflows/__init__.py
ChrisHad/algorithm-reference-library
bded1b62ea801ea4f4f5bd0794c18cd81d4b2810
[ "Apache-2.0" ]
null
null
null
""" Algorithm Reference Library workflows """
11.75
41
0.723404
4
47
8.5
1
0
0
0
0
0
0
0
0
0
0
0
0.148936
47
3
42
15.666667
0.85
0.787234
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
92676087b72621392ed82045ec290ae24c16e28c
127
py
Python
bin/pnr_compiler.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
null
null
null
bin/pnr_compiler.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
null
null
null
bin/pnr_compiler.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python from align.pnr.pnr_compiler import cmdline import sys if __name__ == '__main__': cmdline( sys.argv)
18.142857
42
0.732283
19
127
4.421053
0.789474
0
0
0
0
0
0
0
0
0
0
0
0.149606
127
6
43
21.166667
0.777778
0.15748
0
0
0
0
0.075472
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
9270515e5cbd59e1466345439279555411a7a1a8
60
py
Python
de0nano-interface/firmware/src/fx2lib/examples/bulkloop/load.py
mfkiwl/myriadrf-boards
70e0b59f5fd1aea4f37bf5474537016fa778eed5
[ "CC-BY-3.0" ]
30
2015-01-05T12:52:22.000Z
2022-01-31T12:32:28.000Z
de0nano-interface/firmware/src/fx2lib/examples/bulkloop/load.py
mfkiwl/myriadrf-boards
70e0b59f5fd1aea4f37bf5474537016fa778eed5
[ "CC-BY-3.0" ]
2
2016-05-03T07:39:46.000Z
2016-05-07T10:04:36.000Z
de0nano-interface/firmware/src/fx2lib/examples/bulkloop/load.py
mfkiwl/myriadrf-boards
70e0b59f5fd1aea4f37bf5474537016fa778eed5
[ "CC-BY-3.0" ]
26
2015-01-15T04:04:19.000Z
2021-11-10T22:37:11.000Z
from fx2load import * openfx2() reset_bix('bulkloop.bix')
10
25
0.733333
8
60
5.375
0.875
0
0
0
0
0
0
0
0
0
0
0.038462
0.133333
60
5
26
12
0.788462
0
0
0
0
0
0.20339
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
92aa9962b410a67ab502e900d9bf57e1f1dd6fee
97
py
Python
src/survey_stats/etl/metadata.py
semanticbits/survey_stats
10d74ea6f25f98e55aefc89cb612e1e668ab236e
[ "BSD-2-Clause" ]
2
2017-06-05T14:39:13.000Z
2017-06-16T15:42:21.000Z
src/survey_stats/etl/metadata.py
HHS/survey_stats
db09f0b506154e154db5b3506825c8d989b99f58
[ "BSD-2-Clause" ]
50
2018-07-05T21:05:19.000Z
2021-07-29T06:14:19.000Z
src/survey_stats/etl/metadata.py
HHS/survey_stats
db09f0b506154e154db5b3506825c8d989b99f58
[ "BSD-2-Clause" ]
3
2017-06-16T16:10:01.000Z
2018-10-05T21:54:30.000Z
import yaml import pandas as pd from survey_stats import log logger = log.getLogger(__name__)
12.125
32
0.793814
15
97
4.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.164948
97
7
33
13.857143
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
2b99abf9300e83266387360d244f2c2f51ac9b4a
34,053
py
Python
optimization/first_sdEta_mjj_optimization/sdEta_mistake_analyses/sdEta_mmjj_gridsearch/analysis_deltaeta6.1_mmjj_750/Output/Histos/MadAnalysis5job_0/selection_9.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
optimization/first_sdEta_mjj_optimization/sdEta_mistake_analyses/sdEta_mmjj_gridsearch/analysis_deltaeta6.1_mmjj_750/Output/Histos/MadAnalysis5job_0/selection_9.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
optimization/first_sdEta_mjj_optimization/sdEta_mistake_analyses/sdEta_mmjj_gridsearch/analysis_deltaeta6.1_mmjj_750/Output/Histos/MadAnalysis5job_0/selection_9.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
def selection_9(): # Library import import numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # Library version matplotlib_version = matplotlib.__version__ numpy_version = numpy.__version__ # Histo binning xBinning = numpy.linspace(-8.0,8.0,101,endpoint=True) # Creating data sequence: middle of each bin xData = numpy.array([-7.92,-7.76,-7.6,-7.44,-7.28,-7.12,-6.96,-6.8,-6.64,-6.48,-6.32,-6.16,-6.0,-5.84,-5.68,-5.52,-5.36,-5.2,-5.04,-4.88,-4.72,-4.56,-4.4,-4.24,-4.08,-3.92,-3.76,-3.6,-3.44,-3.28,-3.12,-2.96,-2.8,-2.64,-2.48,-2.32,-2.16,-2.0,-1.84,-1.68,-1.52,-1.36,-1.2,-1.04,-0.88,-0.72,-0.56,-0.4,-0.24,-0.08,0.08,0.24,0.4,0.56,0.72,0.88,1.04,1.2,1.36,1.52,1.68,1.84,2.0,2.16,2.32,2.48,2.64,2.8,2.96,3.12,3.28,3.44,3.6,3.76,3.92,4.08,4.24,4.4,4.56,4.72,4.88,5.04,5.2,5.36,5.52,5.68,5.84,6.0,6.16,6.32,6.48,6.64,6.8,6.96,7.12,7.28,7.44,7.6,7.76,7.92]) # Creating weights for histo: y10_sdETA_0 y10_sdETA_0_weights = numpy.array([2.23536966165,2.83310594334,3.33667830668,4.10227244281,4.7327598961,5.23223946299,6.53825033051,7.23834172344,8.38877672587,9.3918278561,10.9393905142,12.2167454065,13.731556093,15.324154712,18.0671923335,19.9668466862,22.4232965562,25.9564934924,28.9410789044,32.6421316952,37.5591274315,42.2878033311,47.9130784533,54.3203128974,63.2740651334,72.543057096,83.99012717,97.1976357174,112.423542515,130.576726773,151.255948842,177.331166231,204.626422563,239.074032693,273.030363248,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,272.887083372,236.695354755,206.57930087,175.91460746,152.001068196,131.407806053,112.538182415,96.3092364877,83.5234075747,72.6208570286,63.1103052754,54.3121129045,48.5148779315,41.0554843997,37.235691712,32.3227919721,29.3586745423,25.0762622557,22.2841006769,19.7212028992,17.2975050009,15.4592625949,13.8257200114,11.9055976763,10.6405227733,9.48599177445,8.34783676137,7.00906992225,6.33764250446,5.21176748074,4.5362440665,3.77883952327,3.25479677768,2.86995271139,2.30906319775]) # Creating weights for histo: y10_sdETA_1 y10_sdETA_1_weights = numpy.array([7.98413833173,9.21144124671,12.0425488453,14.1560907706,18.3854137719,21.1174740027,24.6903853795,28.9186749267,32.3327107526,36.3286533687,41.3993322261,44.0453353677,47.8834959717,51.870626188,55.0762567709,58.4059819649,63.3520615009,64.0586557365,68.2224345117,67.2626039521,68.9537835793,71.2977216908,72.8528298544,74.4760738907,77.3477145226,77.1101402362,76.2289002599,74.0691413035,76.1195864465,75.2677878967,71.2127220894,66.6811057368,62.4016842429,54.7854475787,48.4650342433,40.1430445272,32.9764205046,23.740244454,17.1318218662,9.86581400237,4.84612288889,1.00821303771,0.0121584158796,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0242708390437,1.15384435281,4.37472759739,9.7565162115,16.4144003958,24.2642337495,32.7927300371,40.0727055546,47.3745798854,56.1937491735,62.367556222,68.099501535,72.3160345398,73.703947446,75.135241393,74.5912759894,76.4026247043,77.9563709516,76.5615282946,73.8034073943,74.2171495632,74.0821596213,70.7615672779,67.7230117833,67.640335451,64.2992743064,61.651749023,59.0122750686,55.8553530226,51.9448906842,47.2757207826,43.4489762419,40.6080988965,36.4749111654,31.3637152972,27.7540642247,24.2890927281,21.7753957521,17.9708464419,13.9976237947,11.9563315305,9.19780606089,7.57015983032]) # Creating weights for histo: y10_sdETA_2 y10_sdETA_2_weights = numpy.array([4.31710037745,6.47571667987,8.63389497906,11.5658431821,15.5424786864,20.1207942762,26.1656562643,32.99067226,40.7228094842,48.1818021059,56.2752754707,62.6103311305,72.5183775207,82.2986591936,89.3462552107,98.5323813629,106.295947385,110.785273941,116.846577578,123.625462743,128.671342654,135.523820626,138.552695639,144.569207248,145.571490878,149.026757908,150.479812981,149.508354862,150.412005121,148.382190695,147.257803333,146.084037305,139.797781817,136.771633994,131.423242603,125.934979424,117.66845346,113.180283895,103.582558664,95.9517985287,88.0517490454,79.1259868917,70.22642229,56.5570024573,51.7178104877,43.8054473286,38.8339453251,34.7492883061,31.76771351,31.7385738986,31.4767801913,32.6815246181,34.8368434999,39.5174039205,44.0953145639,50.2112446429,57.549121106,69.2650465099,77.7192114067,88.9327966851,95.3897907927,103.288228755,111.394057116,121.284789982,126.889289303,130.730825602,134.939375555,144.073189245,145.433271932,150.21118477,149.480297862,150.580223156,151.514037789,150.634477708,148.230294478,148.570780012,142.536004495,142.188783628,134.949044683,130.031962515,123.782317486,119.525050004,111.706733577,103.804783325,98.6944012389,90.8350529997,83.4724665428,72.5084191452,64.0268997067,56.8679434332,48.5026188152,41.4760138965,31.5666906856,26.9170921353,20.5416162147,15.2096003597,11.2955579971,8.47412296877,6.38577726085,4.66905250534]) # Creating weights for histo: y10_sdETA_3 y10_sdETA_3_weights = numpy.array([0.247539775289,0.423522827337,0.79737429512,1.13864602136,1.75459509273,2.78327559952,4.20239462151,6.13289309938,9.26289238762,12.2771938818,16.2811971948,20.5371770512,25.603853979,31.1325664458,36.0560704511,41.9296947026,47.9921388591,54.9147093176,60.6628328052,65.5425423578,71.344047952,77.0177046197,83.0214040835,87.9061512169,91.4470830367,95.7236235355,98.5048556647,100.711681702,102.046925003,103.715989286,103.056756832,101.748732718,102.576114744,98.7755443834,95.598455902,90.0996520401,87.2825880859,81.4045843891,75.719186908,68.6220073976,64.3822331138,58.5673616801,52.0782263017,46.6491766841,42.3412731821,37.3578300899,33.7656083846,30.2076666043,28.2397194005,27.5895017793,27.926097493,28.502607994,30.6590663478,33.4915721122,36.8795442901,40.911493989,47.0006291987,52.2579541858,58.1276702495,64.3000067944,70.3609478016,76.1032618211,81.344377173,86.4149054126,92.8306302379,96.5910624549,98.6610612963,102.273453638,102.481822606,103.977496607,102.884057186,102.516435662,100.581151482,97.8359949318,94.3657111207,91.8219765525,87.8522003512,82.7269087329,77.8185580957,70.5723230685,66.5514804228,60.1739030846,54.794213634,49.2238273734,42.1099507201,36.5894608852,31.0946545875,25.53863762,20.1651882695,16.4517396189,12.2381526303,8.6966642391,5.79754865575,4.13090972442,2.85469955813,1.94142962203,1.16046849654,0.885416989153,0.467635785199,0.225504056066]) # Creating weights for histo: y10_sdETA_4 y10_sdETA_4_weights = numpy.array([0.0,0.000988581115557,0.0,0.00296498056281,0.0118498092523,0.0197359843115,0.0325711796451,0.0749997313942,0.152933434965,0.248711751554,0.411526103512,0.690830859176,1.07859722735,1.5020276493,2.26281216207,3.02859184693,3.96817842897,5.19875482983,6.71166026605,8.17812126384,9.56847623308,11.0568026328,12.5272358786,13.917679031,15.320752409,16.7794132103,18.2016022807,19.057723954,19.7036050784,20.9313824673,21.3800781507,21.6520829486,21.6544759174,21.7193385999,21.3198490895,20.7143077277,20.1246593665,19.087557902,17.9604976447,16.5826726932,15.0730861484,13.7368635811,12.3504407767,11.0033436291,10.0341631976,8.9439033537,7.72026656242,7.0923387167,6.63770670696,6.3591763593,6.2950752581,6.6887366669,7.12495844916,7.74681769388,8.74946762228,9.98384271084,11.0655768518,12.6621319804,13.9804213107,15.1215267317,16.8096840655,17.8826439874,19.2171429758,20.0074479857,20.6054096088,21.1658653537,21.4865231759,22.0287330346,21.8152016525,21.3622491301,20.5886067188,20.1347002156,18.7938881184,17.8410856947,16.818117577,15.5142181263,14.0687046244,12.5489168976,11.0856264833,9.33659875665,7.99251987628,6.63461228161,5.23732692193,4.07170258923,3.02468814118,2.21948098809,1.61353278146,1.0105030348,0.690824846691,0.447997433531,0.243756141596,0.157865235484,0.0829027013267,0.0503379229734,0.0128240882706,0.00789523386909,0.00394717281236,0.00197024065898,0.0,0.0]) # Creating weights for histo: y10_sdETA_5 y10_sdETA_5_weights = numpy.array([0.0,0.0,0.000251541979785,0.0,0.0,0.000252557070872,0.0,0.00126038416041,0.0022683310796,0.00302565880725,0.00957685286794,0.0216792464372,0.0438664505194,0.0746118555025,0.128320820602,0.221580328667,0.360236145666,0.558130055415,0.751677129958,1.02248331481,1.34737527797,1.74138633798,2.16103293903,2.60264137241,3.13711557647,3.57471421802,4.05314255894,4.50533841116,4.80456442576,5.15760775225,5.50266510339,5.71666203628,5.93071498302,6.04178645694,6.05007250652,6.07222598626,5.89838298559,5.64549643322,5.42791061261,5.15343472004,4.85447677175,4.32970296712,3.97025845727,3.62766611586,3.20384968339,2.89968444705,2.57141964961,2.35942681245,2.15244921582,2.11240571092,2.11688321844,2.14414876267,2.34937912712,2.64478219609,2.84994534391,3.20410974771,3.63504554118,4.00070718887,4.40304910954,4.80059544401,5.08188102098,5.53682155211,5.77558861197,5.96333105072,5.97087691722,6.04880019181,6.03389650533,5.89844700142,5.75327509265,5.52067355785,5.261393424,4.86663577932,4.46334002271,4.01386084247,3.54721061491,3.10811680352,2.61077418409,2.19707865506,1.75191934336,1.37509773522,1.03652718861,0.745143913944,0.519016380511,0.346860517158,0.227362238842,0.130339199855,0.0710894642268,0.0390703521878,0.0199094366686,0.0115970445694,0.00630154270855,0.00226916888683,0.00126036055458,0.000504371157964,0.000755980194336,0.000252122443365,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_6 y10_sdETA_6_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000861379320879,0.0005702465913,0.00114715814661,0.0051543378013,0.00658693718689,0.0177515846245,0.0283631346175,0.0501079095899,0.0959164415529,0.149411074951,0.228116270604,0.326652513255,0.484072301409,0.659628705016,0.850692306204,1.05752421737,1.33504411384,1.59936243923,1.76938939788,2.02519957761,2.29935760194,2.49706527415,2.72632636068,2.85533807929,3.02201616144,3.00250170823,3.03699613589,2.97907756666,2.92946521082,2.77653751564,2.67545942573,2.4956167601,2.28028600016,2.08744469536,1.91166566644,1.69734456778,1.52683077246,1.4061432612,1.31731806065,1.23893735614,1.25310060459,1.28659036931,1.37587441592,1.58001992834,1.67905070508,1.86844716557,2.12329766726,2.30735891762,2.4598487597,2.66247578154,2.80581069495,2.88160226807,2.99877895715,3.02718242824,2.97614754963,2.92353020192,2.86613245795,2.69255369088,2.47648317911,2.3001303427,2.04310057211,1.83722863889,1.57599327921,1.32290718559,1.0583939256,0.843738139216,0.649053752745,0.485542508178,0.345919849369,0.225024207942,0.14975815851,0.0979012056959,0.0512256945907,0.0271876889609,0.0145912448684,0.00859082791329,0.00515476865675,0.00171882136265,0.000569217736464,0.000569994875746,0.0,0.000286302050196,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_7 y10_sdETA_7_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,4.31711093386e-05,6.48231534415e-05,6.48004384885e-05,0.000129703890546,0.000324078342017,0.000496927735193,0.000691242842802,0.00142578323593,0.00261422580662,0.00457674033243,0.00835766941006,0.0153956461495,0.0270981552576,0.0445756226613,0.0706571245147,0.101604697367,0.143095193548,0.188913265467,0.243864927798,0.297804559344,0.35356494944,0.409783997186,0.470925819494,0.511119970791,0.545510912594,0.582286924464,0.5994794617,0.610973144114,0.613092507905,0.595019871013,0.561579855935,0.536036430247,0.49465288713,0.452592924562,0.418379259976,0.387206758797,0.355824626262,0.3251340006,0.318874270841,0.319684004434,0.330099648589,0.355593662967,0.389015028314,0.418692575453,0.455056784504,0.496097926946,0.53441788507,0.567323973024,0.59241142327,0.608158082499,0.607959012339,0.602572802443,0.584523634876,0.55138201549,0.514938765109,0.465326709301,0.409469214876,0.354302179586,0.299633574067,0.242602320068,0.187461562039,0.142005127259,0.0984704529438,0.0672233947514,0.0435288908036,0.0284644219638,0.0167320146131,0.0086777532731,0.00472947534133,0.00192263721039,0.00112161367014,0.000604826695753,0.000431919383638,0.000151244497269,0.000172777434552,8.64043285673e-05,8.63467868136e-05,2.16179758643e-05,0.0,2.1598345451e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_8 y10_sdETA_8_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.84511118256e-05,0.0,2.84511118256e-05,5.69022236512e-05,0.000113584152636,0.000170334627639,0.000198904625821,0.000340724792997,0.000480659053694,0.00104655855577,0.00212604474166,0.00431035211378,0.00856352710705,0.0147970806136,0.0237645451288,0.0368803861508,0.0534755612793,0.0706344590985,0.0948114237598,0.11754112597,0.144805289837,0.166166180336,0.197444310522,0.215931985376,0.234024362353,0.243651543684,0.252705379746,0.254327556311,0.241596499609,0.243395684089,0.232302396092,0.215987077605,0.201930243498,0.19172273756,0.183670956373,0.177398164132,0.175927899562,0.183165177045,0.190317662985,0.200727866746,0.216599774465,0.2287660987,0.241194667882,0.251176904519,0.251167400738,0.248866891828,0.247010239174,0.236296805411,0.217124709851,0.197138259084,0.168081637632,0.143924601211,0.117823180361,0.0992874520152,0.0694147230967,0.0522623591267,0.035889706113,0.0259310061828,0.0157443343135,0.0082962926741,0.00510570569918,0.00220545625406,0.00130428415916,0.000567896780985,0.000423770759022,5.67516629757e-05,0.000113506266184,5.68217979072e-05,2.82185958914e-05,2.81447485456e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_9 y10_sdETA_9_weights = numpy.array([7.80655268045,10.4202328142,28.693480025,31.285004038,46.8976095211,54.755688064,88.6123325153,164.237763664,211.166404059,320.586379459,456.117700884,675.133377946,852.335048599,1180.79088843,1451.86383645,2056.65326106,2377.18450015,3065.31931437,3849.97014388,4902.92036884,5888.13331075,7149.36337636,8750.26423182,10329.6395815,12537.6342981,14544.3743793,17213.6409211,20156.4598046,22920.1532572,25114.3052047,26535.4961567,26894.7313934,26813.8550155,24493.7992385,22598.7164703,19002.153594,16074.4002574,11906.6462795,8512.97225445,5267.93496163,2551.93676973,526.525484774,5.21692435782,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.60565363489,591.691857987,2531.01496246,5299.11579884,8237.0512611,11883.2942973,15486.040277,19382.202972,21973.7192945,24820.3616952,26196.0599249,26396.5147558,26978.607038,24694.965434,23112.9753391,20294.9951607,17699.1568181,14732.0169585,12530.2514879,10327.3824411,8958.9747364,7053.64062863,5898.77686204,4942.09540514,4040.11980234,3078.31959708,2432.03262715,1840.20118791,1514.49506033,1128.57980893,935.804254097,581.247104246,456.164227968,310.094406495,231.997079774,143.358292189,112.04591023,78.1945337213,80.7620213039,26.0492535143,36.4653334978,13.0401575749,2.60389444966]) # Creating weights for histo: y10_sdETA_10 y10_sdETA_10_weights = numpy.array([0.0,0.0,2.10384203821,4.21061287723,8.43034843801,10.5359492188,11.5835264785,18.9648432602,42.1498376231,63.1851452886,81.1058895286,140.068013397,141.139919096,255.935213346,311.776078948,424.432178933,591.92249429,828.933352777,1031.14334741,1293.32450167,1635.7337132,1983.32604031,2648.90641287,3086.0203147,3908.55624616,4710.02882088,5526.3570182,6476.19728606,7615.93250291,9117.68550666,10239.4177558,11945.7443411,13696.2876617,15410.7557899,17375.1569752,19210.7940408,20831.711377,22496.0066695,24048.2133845,24692.3225537,25121.7466219,24752.4145282,23374.4545319,21439.4760211,19662.6996949,18023.9871619,16709.7743698,15892.5112032,15217.2210018,15002.0164735,15160.2109629,15235.9511678,15923.7845781,16827.8036573,18103.9135666,19559.683782,21371.938921,23158.4150723,24731.1372444,25377.7396649,24878.3775878,24142.1181567,22491.8281649,20797.4561042,19355.1794574,17276.0656246,15682.5278819,13470.8677286,12007.1021794,10527.1189536,9016.72806519,7707.50562334,6574.19976298,5603.31306785,4708.91686156,3813.86656155,3139.68331756,2634.07156736,2067.48327703,1664.07905682,1342.97213862,1013.15807875,784.656210004,630.883778945,479.251388625,338.0807656,247.525414994,164.316691116,111.659992206,95.8559721879,60.0355686112,32.6524584087,16.8596272404,15.8024386507,8.42446544217,6.31913399409,2.10401633495,0.0,3.15992674859,3.16181130802]) # Creating weights for histo: y10_sdETA_11 y10_sdETA_11_weights = numpy.array([0.0,0.0,0.0,0.23040468042,0.0,0.460830800907,0.46115163345,0.690658328558,0.921058744018,4.14687396614,5.29568500839,5.30155989412,14.0477086081,21.8795460516,31.3233576178,41.9158687994,57.3550992292,78.7815644109,114.715846648,158.695879025,220.415991454,283.754329437,377.731675775,457.673193915,604.639473592,761.000191204,911.665074544,1114.34094752,1355.31039383,1617.87475202,1893.32044074,2295.54301278,2609.97427413,3047.5514397,3468.60400028,3920.99248665,4377.33547426,4880.28563249,5328.56362001,5747.5401827,6233.76862564,6566.45468234,6879.49502895,7143.12332164,7238.98116934,7403.57402735,7377.72299322,7422.75866073,7494.52909271,7597.66426778,7496.29655342,7550.73818578,7552.43264268,7432.01861795,7418.81645487,7244.74462819,7144.07621351,6900.9389382,6568.0530816,6169.13719803,5769.48743403,5328.04106641,4891.36684272,4414.82869528,3917.91095732,3510.75870681,3069.64354596,2656.04044807,2291.60695461,1961.54404015,1607.27306157,1356.40814063,1113.67315476,899.431172546,733.393607514,582.031345653,480.496490985,369.681353291,285.622689106,208.217092862,155.924654315,115.176615972,84.7646878955,66.1086021167,37.0842574981,28.7891839703,14.5132846568,13.1217858891,7.37180199983,3.68720046777,2.99218573278,2.76526490954,0.921422226157,1.15178306587,0.0,0.0,0.230090571913,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_12 y10_sdETA_12_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.027723381669,0.0,0.110815875834,0.221555539661,0.332185405875,0.553826621529,0.720152307768,1.38473948314,2.32609858657,3.21246616742,5.34428915061,8.69579395077,13.3196391798,17.63967126,22.8167979696,34.501949262,44.7747277744,58.9308100915,76.981552995,98.8003853057,121.427426532,149.866046931,187.331269869,234.134098816,274.856779167,325.531493581,377.150375133,440.230334671,512.093910862,567.696360598,627.365246091,699.058393612,766.735503017,826.287050488,879.855897629,915.910217398,965.417245359,990.854974666,1011.12213665,1015.74179234,1035.73042078,1019.00301995,1011.54416882,1010.55737528,1009.48209733,1003.98375297,991.625558472,961.144602452,923.879200397,873.436545968,820.739462632,768.845663862,705.504290597,632.003368088,567.005797477,504.39384353,436.964490475,381.638804589,325.923556465,279.981065294,225.378066217,186.641206878,153.965414279,124.023135965,97.4466507602,77.2296940607,56.7113517629,43.3622472743,32.9240413848,23.9557770024,17.9180393699,11.8791668286,7.55865000767,5.4544984081,3.59986976986,2.13251431573,1.32892967211,0.913609237997,0.553590791338,0.276954590666,0.0276982020833,0.110835342405,0.0,0.0553504230501,0.0,0.0276409757523,0.0276859450688,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_13 y10_sdETA_13_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0201690914978,0.0100703186038,0.0100786018424,0.0403410350997,0.0403439903651,0.121019330812,0.211593541993,0.282220136667,0.59489813641,0.746214823584,1.30072576935,1.79482308067,2.60110867938,4.42654879481,5.87767815322,8.75156632244,12.187811758,16.4333993984,22.260903578,28.7540888688,37.2923360049,45.558710863,57.6089480392,68.4548083793,81.714058578,96.3000226764,112.989625985,129.312339469,145.150680709,164.009703673,182.692867107,197.364515697,209.560052409,224.090127402,235.565780888,243.238062449,248.056904821,253.066109975,249.618340825,250.654746931,249.219713756,252.625308174,251.871563796,247.391211573,242.795743572,233.659725745,221.851286319,208.370907023,194.957703882,177.353910166,163.900656201,146.120942272,130.110139754,111.800784014,96.602770499,79.6882150602,67.1460566675,57.1639469703,45.4510226918,35.4783067334,28.6524325946,21.9289611317,15.5967680183,12.3917129324,9.24693433719,6.27148577292,4.58777278159,2.85296889544,2.02624159869,1.30068207754,0.695826031845,0.413414986249,0.221812327789,0.241917052758,0.09072039669,0.0705779268539,0.0100441035187,0.0201727506867,0.0301974295556,0.0100796455912,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_14 y10_sdETA_14_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00283195818167,0.0,0.00566026593663,0.00566395175955,0.00282345693498,0.0254666933163,0.0226321877617,0.0169804169159,0.0452615976902,0.0452813349257,0.138593674846,0.155576546412,0.376243109714,0.560181986563,0.959054587002,1.46829950111,2.36234509777,3.21400796298,4.84067819515,7.03032632988,9.70152068877,12.349392022,16.4037048984,20.9753180202,26.3049217802,32.7164877015,39.4186065051,47.6059041859,53.9923041701,64.0525231436,71.7026448366,80.2072003025,88.1361441115,95.7421744363,101.998416394,106.696994188,111.195698809,115.622610678,117.816675644,117.614801815,118.709160345,118.80142134,117.622612066,116.699232628,114.737166745,111.982033348,106.903407967,102.170434288,95.0968476318,87.8641319188,80.2542926538,72.4576998976,63.8625378243,55.0801220959,46.8341898208,39.8356277436,32.5980065774,26.6367958924,20.8000529081,16.3946480851,12.6411837718,9.61644281583,6.89164628058,4.7390525932,3.14605916335,2.24632285616,1.4402176087,0.995922050017,0.577192174771,0.345178316982,0.223515188867,0.104694030292,0.0594191974961,0.0537843514259,0.0197980669484,0.00283439090174,0.00849920371262,0.00565636081109,0.00282583771496,0.0,0.00282706119272,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_15 y10_sdETA_15_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00153120651016,0.0,0.00609276333059,0.00454663030191,0.00458881024214,0.019815284191,0.0258736522476,0.062446505823,0.136964041795,0.248381781994,0.362515647546,0.655061230752,0.949065670811,1.30674154362,1.96043372241,2.77224632147,3.66639110103,4.72763206358,5.98598294963,7.3766069898,8.89082028727,10.6818418058,12.4923687107,14.2313813798,15.7678249332,17.3492063823,18.2851387965,19.8205543202,21.1613886371,21.5705326394,22.0746689487,22.7262861618,22.0066181095,22.3094496615,22.2297478191,21.8310140945,21.8442248669,20.6916263321,19.9728563287,18.7211770009,17.3221349337,15.8766661001,14.1950694803,12.1877056115,10.5382154226,8.65790420764,7.31518871455,5.86633447284,4.61254827495,3.58868032758,2.6402035878,1.91943188058,1.35003104693,0.895565941995,0.667301164999,0.386776557531,0.210356263377,0.144586113917,0.0716369376843,0.0381345606632,0.010654909791,0.0106677058066,0.00762348654863,0.0015169523467,0.00305851596063,0.0,0.00152228392139,0.0,0.00152612071728,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_sdETA_16 y10_sdETA_16_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180374730004,0.000180468893555,0.0,0.000180833955436,0.000901643536641,0.0,0.000361602631847,0.00072276128929,0.00126370681889,0.00252892526124,0.00704427703695,0.0193227072631,0.0371938785747,0.0729535288051,0.13399346204,0.23273286087,0.370697290357,0.567899797909,0.842112145855,1.17998483113,1.64058593674,2.18988602629,2.77831463368,3.50417812094,4.23496815275,5.05608972185,5.79621138082,6.52760221074,7.19046354271,7.74986435804,8.32879111214,8.62302813833,8.86301617563,8.9699620916,9.01222207705,9.11442707968,8.9907936109,8.89587521107,8.63787863536,8.24500288254,7.78960946419,7.13701561798,6.55126826475,5.79008015901,4.97952262346,4.2569357967,3.42801116949,2.75833655581,2.18371937281,1.62865701311,1.19010250248,0.829485372111,0.57003032046,0.379525864626,0.226054989807,0.125124757539,0.071868472002,0.0355712961697,0.0169732477166,0.00668035898308,0.00307042614397,0.00090298917037,0.000902695318471,0.000541100735779,0.000722828686515,0.000180822016499,0.00018018393809,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating a new Canvas fig = plt.figure(figsize=(12,6),dpi=80) frame = gridspec.GridSpec(1,1,right=0.7) pad = fig.add_subplot(frame[0]) # Creating a new Stack pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights+y10_sdETA_13_weights+y10_sdETA_14_weights+y10_sdETA_15_weights+y10_sdETA_16_weights,\ label="$bg\_dip\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#e5e5e5", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights+y10_sdETA_13_weights+y10_sdETA_14_weights+y10_sdETA_15_weights,\ label="$bg\_dip\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#f2f2f2", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights+y10_sdETA_13_weights+y10_sdETA_14_weights,\ label="$bg\_dip\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights+y10_sdETA_13_weights,\ label="$bg\_dip\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights,\ label="$bg\_dip\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#c1bfa8", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights,\ label="$bg\_dip\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#bab5a3", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights,\ label="$bg\_dip\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b2a596", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights,\ label="$bg\_dip\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b7a39b", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights,\ label="$bg\_vbf\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ad998c", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights,\ label="$bg\_vbf\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#9b8e82", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights,\ label="$bg\_vbf\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#876656", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights,\ label="$bg\_vbf\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#afcec6", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights,\ label="$bg\_vbf\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#84c1a3", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights,\ label="$bg\_vbf\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#89a8a0", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights,\ label="$bg\_vbf\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#829e8c", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights+y10_sdETA_1_weights,\ label="$bg\_vbf\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#adbcc6", linewidth=4, linestyle="dashdot",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_sdETA_0_weights,\ label="$signal$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#7a8e99", linewidth=3, linestyle="dashed",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") # Axis plt.rc('text',usetex=False) plt.xlabel(r"\Delta\eta ( j_{1} , j_{2} ) ",\ fontsize=16,color="black") plt.ylabel(r"$\mathrm{Events}$ $(\mathcal{L}_{\mathrm{int}} = 40.0\ \mathrm{fb}^{-1})$ ",\ fontsize=16,color="black") # Boundary of y-axis ymax=(y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights+y10_sdETA_13_weights+y10_sdETA_14_weights+y10_sdETA_15_weights+y10_sdETA_16_weights).max()*1.1 ymin=0 # linear scale #ymin=min([x for x in (y10_sdETA_0_weights+y10_sdETA_1_weights+y10_sdETA_2_weights+y10_sdETA_3_weights+y10_sdETA_4_weights+y10_sdETA_5_weights+y10_sdETA_6_weights+y10_sdETA_7_weights+y10_sdETA_8_weights+y10_sdETA_9_weights+y10_sdETA_10_weights+y10_sdETA_11_weights+y10_sdETA_12_weights+y10_sdETA_13_weights+y10_sdETA_14_weights+y10_sdETA_15_weights+y10_sdETA_16_weights) if x])/100. # log scale plt.gca().set_ylim(ymin,ymax) # Log/Linear scale for X-axis plt.gca().set_xscale("linear") #plt.gca().set_xscale("log",nonposx="clip") # Log/Linear scale for Y-axis plt.gca().set_yscale("linear") #plt.gca().set_yscale("log",nonposy="clip") # Legend plt.legend(bbox_to_anchor=(1.05,1), loc=2, borderaxespad=0.) # Saving the image plt.savefig('../../HTML/MadAnalysis5job_0/selection_9.png') plt.savefig('../../PDF/MadAnalysis5job_0/selection_9.png') plt.savefig('../../DVI/MadAnalysis5job_0/selection_9.eps') # Running! if __name__ == '__main__': selection_9()
175.530928
1,433
0.800722
5,404
34,053
4.910437
0.3651
0.040775
0.056075
0.068435
0.271932
0.27035
0.261418
0.257688
0.255427
0.255427
0
0.598377
0.048513
34,053
193
1,434
176.440415
0.22061
0.04167
0
0.185841
0
0.00885
0.032977
0.006135
0
0
0
0
0
1
0.00885
false
0
0.035398
0
0.044248
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2b9e9af7471081699466351e4f3d3c8733fa60bb
74
py
Python
python_docs/23Erros_excecoes/tempCodeRunnerFile.py
Matheus-IT/lang-python-related
dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9
[ "MIT" ]
null
null
null
python_docs/23Erros_excecoes/tempCodeRunnerFile.py
Matheus-IT/lang-python-related
dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9
[ "MIT" ]
null
null
null
python_docs/23Erros_excecoes/tempCodeRunnerFile.py
Matheus-IT/lang-python-related
dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9
[ "MIT" ]
null
null
null
a = float(input('Numerador: ')) b = float(input('Denominador: '))
37
37
0.567568
8
74
5.25
0.75
0.47619
0
0
0
0
0
0
0
0
0
0
0.216216
74
2
37
37
0.724138
0
0
0
0
0
0.324324
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
2ba0673d40d215ccfbade8f9abe9392441b46289
572
py
Python
tests/algorithm_t/test_a_594.py
firstprojectfor/FPF_python
2321aff0d5b56f787befec55917d731c8c776558
[ "MIT" ]
1
2019-05-04T01:32:06.000Z
2019-05-04T01:32:06.000Z
tests/algorithm_t/test_a_594.py
firstprojectfor/FPF_python
2321aff0d5b56f787befec55917d731c8c776558
[ "MIT" ]
null
null
null
tests/algorithm_t/test_a_594.py
firstprojectfor/FPF_python
2321aff0d5b56f787befec55917d731c8c776558
[ "MIT" ]
null
null
null
from unittest import TestCase from algorithm.a_594_longest_harmonious_subsequence import Algorithm class A_594_Test(TestCase): def setUp(self): self.algorithm = Algorithm() super().setUp() def testLongestPalindromeSubSeq(self): self.assertEqual(0, self.algorithm.findLHS(None)) self.assertEqual(0, self.algorithm.findLHS([])) self.assertEqual(0, self.algorithm.findLHS([1])) self.assertEqual(0, self.algorithm.findLHS([1, 1, 1])) self.assertEqual(2, self.algorithm.findLHS([1, 2, 3, 4, 5, 6, 7, 8, 9]))
31.777778
80
0.678322
73
572
5.232877
0.410959
0.204188
0.26178
0.209424
0.382199
0.382199
0.193717
0
0
0
0
0.051613
0.187063
572
17
81
33.647059
0.769892
0
0
0
0
0
0
0
0
0
0
0
0.416667
1
0.166667
false
0
0.166667
0
0.416667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
2bb892e48b8da9bf5c4d537efb0e726951e7b58d
23,015
py
Python
pairs/core/backtest/fb_amzn.py
GenusGeoff/pairs
11e2a23a663beadd25bca6be932c1522f6ff0102
[ "MIT" ]
3
2021-06-22T21:19:52.000Z
2021-11-09T19:12:59.000Z
pairs/core/backtest/fb_amzn.py
GenusGeoff/pairs
11e2a23a663beadd25bca6be932c1522f6ff0102
[ "MIT" ]
15
2021-03-13T21:58:20.000Z
2021-03-26T21:07:23.000Z
pairs/core/backtest/fb_amzn.py
GenusGeoff/pairs
11e2a23a663beadd25bca6be932c1522f6ff0102
[ "MIT" ]
1
2021-03-13T23:09:43.000Z
2021-03-13T23:09:43.000Z
"""Data for FB-AMZN Spread""" data = """ date,price_l,price_r 2019-03-14,170.1699981689453,1686.219970703125 2019-03-15,165.97999572753906,1712.3599853515625 2019-03-18,160.47000122070312,1742.1500244140625 2019-03-19,161.57000732421875,1761.8499755859375 2019-03-20,165.44000244140625,1797.27001953125 2019-03-21,166.0800018310547,1819.260009765625 2019-03-22,164.33999633789062,1764.77001953125 2019-03-25,166.2899932861328,1774.260009765625 2019-03-26,167.67999267578125,1783.760009765625 2019-03-27,165.8699951171875,1765.699951171875 2019-03-28,165.5500030517578,1773.4200439453125 2019-03-29,166.69000244140625,1780.75 2019-04-01,168.6999969482422,1814.18994140625 2019-04-02,174.1999969482422,1813.97998046875 2019-04-03,173.5399932861328,1820.699951171875 2019-04-04,176.02000427246094,1818.8599853515625 2019-04-05,175.72000122070312,1837.280029296875 2019-04-08,174.92999267578125,1849.8599853515625 2019-04-09,177.5800018310547,1835.8399658203125 2019-04-10,177.82000732421875,1847.3299560546875 2019-04-11,177.50999450683594,1844.0699462890625 2019-04-12,179.10000610351562,1843.06005859375 2019-04-15,179.64999389648438,1844.8699951171875 2019-04-16,178.8699951171875,1863.0400390625 2019-04-17,178.77999877929688,1864.8199462890625 2019-04-18,178.27999877929688,1861.68994140625 2019-04-22,181.44000244140625,1887.31005859375 2019-04-23,183.77999877929688,1923.77001953125 2019-04-24,182.5800018310547,1901.75 2019-04-25,193.25999450683594,1902.25 2019-04-26,191.49000549316406,1950.6300048828125 2019-04-29,194.77999877929688,1938.4300537109375 2019-04-30,193.39999389648438,1926.52001953125 2019-05-01,193.02999877929688,1911.52001953125 2019-05-02,192.52999877929688,1900.8199462890625 2019-05-03,195.47000122070312,1962.4599609375 2019-05-06,193.8800048828125,1950.550048828125 2019-05-07,189.77000427246094,1921.0 2019-05-08,189.5399932861328,1917.77001953125 2019-05-09,188.64999389648438,1899.8699951171875 2019-05-10,188.33999633789062,1889.97998046875 2019-05-13,181.5399932861328,1822.6800537109375 2019-05-14,180.72999572753906,1840.1199951171875 2019-05-15,186.27000427246094,1871.1500244140625 2019-05-16,186.99000549316406,1907.5699462890625 2019-05-17,185.3000030517578,1869.0 2019-05-20,182.72000122070312,1858.969970703125 2019-05-21,184.82000732421875,1857.52001953125 2019-05-22,185.32000732421875,1859.6800537109375 2019-05-23,180.8699951171875,1815.47998046875 2019-05-24,181.05999755859375,1823.280029296875 2019-05-28,184.30999755859375,1836.4300537109375 2019-05-29,182.19000244140625,1819.18994140625 2019-05-30,183.00999450683594,1816.3199462890625 2019-05-31,177.47000122070312,1775.0699462890625 2019-06-03,164.14999389648438,1692.68994140625 2019-06-04,167.5,1729.56005859375 2019-06-05,168.1699981689453,1738.5 2019-06-06,168.3300018310547,1754.3599853515625 2019-06-07,173.35000610351562,1804.030029296875 2019-06-10,174.82000732421875,1860.6300048828125 2019-06-11,178.10000610351562,1863.699951171875 2019-06-12,175.0399932861328,1855.3199462890625 2019-06-13,177.47000122070312,1870.300048828125 2019-06-14,181.3300018310547,1869.6700439453125 2019-06-17,189.00999450683594,1886.030029296875 2019-06-18,188.47000122070312,1901.3699951171875 2019-06-19,187.47999572753906,1908.7900390625 2019-06-20,189.52999877929688,1918.18994140625 2019-06-21,191.13999938964844,1911.300048828125 2019-06-24,192.60000610351562,1913.9000244140625 2019-06-25,188.83999633789062,1878.27001953125 2019-06-26,187.66000366210938,1897.8299560546875 2019-06-27,189.5,1904.280029296875 2019-06-28,193.0,1893.6300048828125 2019-07-01,193.0,1922.18994140625 2019-07-02,195.0,1934.31005859375 2019-07-03,197.1999969482422,1939.0 2019-07-05,196.39999389648438,1942.9100341796875 2019-07-08,195.75999450683594,1952.3199462890625 2019-07-09,199.2100067138672,1988.300048828125 2019-07-10,202.72999572753906,2017.4100341796875 2019-07-11,201.22999572753906,2001.0699462890625 2019-07-12,204.8699951171875,2011.0 2019-07-15,203.91000366210938,2020.989990234375 2019-07-16,203.83999633789062,2009.9000244140625 2019-07-17,201.8000030517578,1992.030029296875 2019-07-18,200.77999877929688,1977.9000244140625 2019-07-19,198.36000061035156,1964.52001953125 2019-07-22,202.32000732421875,1985.6300048828125 2019-07-23,202.36000061035156,1994.489990234375 2019-07-24,204.66000366210938,2000.81005859375 2019-07-25,200.7100067138672,1973.8199462890625 2019-07-26,199.75,1943.050048828125 2019-07-29,195.94000244140625,1912.449951171875 2019-07-30,197.0399932861328,1898.530029296875 2019-07-31,194.22999572753906,1866.780029296875 2019-08-01,192.72999572753906,1855.3199462890625 2019-08-02,189.02000427246094,1823.239990234375 2019-08-05,181.72999572753906,1765.1300048828125 2019-08-06,184.50999450683594,1787.8299560546875 2019-08-07,185.14999389648438,1793.4000244140625 2019-08-08,190.16000366210938,1832.8900146484375 2019-08-09,187.85000610351562,1807.5799560546875 2019-08-12,185.3699951171875,1784.9200439453125 2019-08-13,188.4499969482422,1824.3399658203125 2019-08-14,179.7100067138672,1762.9599609375 2019-08-15,182.58999633789062,1776.1199951171875 2019-08-16,183.6999969482422,1792.5699462890625 2019-08-19,186.1699981689453,1816.1199951171875 2019-08-20,183.80999755859375,1801.3800048828125 2019-08-21,183.5500030517578,1823.5400390625 2019-08-22,182.0399932861328,1804.6600341796875 2019-08-23,177.75,1749.6199951171875 2019-08-26,180.36000061035156,1768.8699951171875 2019-08-27,181.3000030517578,1761.8299560546875 2019-08-28,181.75999450683594,1764.25 2019-08-29,185.57000732421875,1786.4000244140625 2019-08-30,185.6699981689453,1776.2900390625 2019-09-03,182.38999938964844,1789.8399658203125 2019-09-04,187.13999938964844,1800.6199951171875 2019-09-05,190.89999389648438,1840.719970703125 2019-09-06,187.49000549316406,1833.510009765625 2019-09-09,188.75999450683594,1831.3499755859375 2019-09-10,186.1699981689453,1820.550048828125 2019-09-11,188.49000549316406,1822.989990234375 2019-09-12,187.47000122070312,1843.550048828125 2019-09-13,187.19000244140625,1839.3399658203125 2019-09-16,186.22000122070312,1807.8399658203125 2019-09-17,188.0800018310547,1822.550048828125 2019-09-18,188.13999938964844,1817.4599609375 2019-09-19,190.13999938964844,1821.5 2019-09-20,189.92999267578125,1794.1600341796875 2019-09-23,186.82000732421875,1785.300048828125 2019-09-24,181.27999877929688,1741.6099853515625 2019-09-25,182.8000030517578,1768.3299560546875 2019-09-26,180.11000061035156,1739.8399658203125 2019-09-27,177.10000610351562,1725.449951171875 2019-09-30,178.0800018310547,1735.9100341796875 2019-10-01,175.80999755859375,1735.6500244140625 2019-10-02,174.60000610351562,1713.22998046875 2019-10-03,179.3800048828125,1724.4200439453125 2019-10-04,180.4499969482422,1739.6500244140625 2019-10-07,179.67999267578125,1732.6600341796875 2019-10-08,177.75,1705.510009765625 2019-10-09,179.85000610351562,1721.989990234375 2019-10-10,180.02999877929688,1720.260009765625 2019-10-11,184.19000244140625,1731.9200439453125 2019-10-14,183.27999877929688,1736.4300537109375 2019-10-15,188.88999938964844,1767.3800048828125 2019-10-16,189.5500030517578,1777.4300537109375 2019-10-17,190.38999938964844,1787.47998046875 2019-10-18,185.85000610351562,1757.510009765625 2019-10-21,189.75999450683594,1785.6600341796875 2019-10-22,182.33999633789062,1765.72998046875 2019-10-23,186.14999389648438,1762.1700439453125 2019-10-24,186.3800048828125,1780.780029296875 2019-10-25,187.88999938964844,1761.3299560546875 2019-10-28,189.39999389648438,1777.0799560546875 2019-10-29,189.30999755859375,1762.7099609375 2019-10-30,188.25,1779.989990234375 2019-10-31,191.64999389648438,1776.6600341796875 2019-11-01,193.6199951171875,1791.43994140625 2019-11-04,194.72000122070312,1804.6600341796875 2019-11-05,194.32000732421875,1801.7099609375 2019-11-06,191.5500030517578,1795.77001953125 2019-11-07,190.4199981689453,1788.199951171875 2019-11-08,190.83999633789062,1785.8800048828125 2019-11-11,189.61000061035156,1771.6500244140625 2019-11-12,194.47000122070312,1778.0 2019-11-13,193.19000244140625,1753.1099853515625 2019-11-14,193.14999389648438,1754.5999755859375 2019-11-15,195.10000610351562,1739.489990234375 2019-11-18,197.39999389648438,1752.530029296875 2019-11-19,199.32000732421875,1752.7900390625 2019-11-20,197.50999450683594,1745.530029296875 2019-11-21,197.92999267578125,1734.7099609375 2019-11-22,198.82000732421875,1745.719970703125 2019-11-25,199.7899932861328,1773.8399658203125 2019-11-26,198.97000122070312,1796.93994140625 2019-11-27,202.0,1818.510009765625 2019-11-29,201.63999938964844,1800.800048828125 2019-12-02,199.6999969482422,1781.5999755859375 2019-12-03,198.82000732421875,1769.9599609375 2019-12-04,198.7100067138672,1760.68994140625 2019-12-05,199.36000061035156,1740.47998046875 2019-12-06,201.0500030517578,1751.5999755859375 2019-12-09,201.33999633789062,1749.510009765625 2019-12-10,200.8699951171875,1739.2099609375 2019-12-11,202.25999450683594,1748.719970703125 2019-12-12,196.75,1760.3299560546875 2019-12-13,194.11000061035156,1760.93994140625 2019-12-16,197.9199981689453,1769.2099609375 2019-12-17,198.38999938964844,1790.6600341796875 2019-12-18,202.5,1784.030029296875 2019-12-19,206.05999755859375,1792.280029296875 2019-12-20,206.3000030517578,1786.5 2019-12-23,206.17999267578125,1793.0 2019-12-24,205.1199951171875,1789.2099609375 2019-12-26,207.7899932861328,1868.77001953125 2019-12-27,208.10000610351562,1869.800048828125 2019-12-30,204.41000366210938,1846.8900146484375 2019-12-31,205.25,1847.8399658203125 2020-01-02,209.77999877929688,1898.010009765625 2020-01-03,208.6699981689453,1874.969970703125 2020-01-06,212.60000610351562,1902.8800048828125 2020-01-07,213.05999755859375,1906.8599853515625 2020-01-08,215.22000122070312,1891.969970703125 2020-01-09,218.3000030517578,1901.050048828125 2020-01-10,218.05999755859375,1883.1600341796875 2020-01-13,221.91000366210938,1891.300048828125 2020-01-14,219.05999755859375,1869.43994140625 2020-01-15,221.14999389648438,1862.02001953125 2020-01-16,221.77000427246094,1877.93994140625 2020-01-17,222.13999938964844,1864.719970703125 2020-01-21,221.44000244140625,1892.0 2020-01-22,221.32000732421875,1887.4599609375 2020-01-23,219.75999450683594,1884.5799560546875 2020-01-24,217.94000244140625,1861.6400146484375 2020-01-27,214.8699951171875,1828.3399658203125 2020-01-28,217.7899932861328,1853.25 2020-01-29,223.22999572753906,1858.0 2020-01-30,209.52999877929688,1870.6800537109375 2020-01-31,201.91000366210938,2008.719970703125 2020-02-03,204.19000244140625,2004.199951171875 2020-02-04,209.8300018310547,2049.669921875 2020-02-05,210.11000061035156,2039.8699951171875 2020-02-06,210.85000610351562,2050.22998046875 2020-02-07,212.3300018310547,2079.280029296875 2020-02-10,213.05999755859375,2133.909912109375 2020-02-11,207.19000244140625,2150.800048828125 2020-02-12,210.75999450683594,2160.0 2020-02-13,213.13999938964844,2149.8701171875 2020-02-14,214.17999267578125,2134.8701171875 2020-02-18,217.8000030517578,2155.669921875 2020-02-19,217.49000549316406,2170.219970703125 2020-02-20,214.5800018310547,2153.10009765625 2020-02-21,210.17999267578125,2095.969970703125 2020-02-24,200.72000122070312,2009.2900390625 2020-02-25,196.77000427246094,1972.739990234375 2020-02-26,197.1999969482422,1979.5899658203125 2020-02-27,189.75,1884.300048828125 2020-02-28,192.47000122070312,1883.75 2020-03-02,196.44000244140625,1953.949951171875 2020-03-03,185.88999938964844,1908.989990234375 2020-03-04,191.75999450683594,1975.8299560546875 2020-03-05,185.1699981689453,1924.030029296875 2020-03-06,181.08999633789062,1901.0899658203125 2020-03-09,169.5,1800.6099853515625 2020-03-10,178.19000244140625,1891.8199462890625 2020-03-11,170.24000549316406,1820.8599853515625 2020-03-12,154.47000122070312,1676.6099853515625 2020-03-13,170.27999877929688,1785.0 2020-03-16,146.00999450683594,1689.1500244140625 2020-03-17,149.4199981689453,1807.8399658203125 2020-03-18,146.9600067138672,1830.0 2020-03-19,153.1300048828125,1880.9300537109375 2020-03-20,149.72999572753906,1846.0899658203125 2020-03-23,148.10000610351562,1902.8299560546875 2020-03-24,160.97999572753906,1940.0999755859375 2020-03-25,156.2100067138672,1885.8399658203125 2020-03-26,163.33999633789062,1955.489990234375 2020-03-27,156.7899932861328,1900.0999755859375 2020-03-30,165.9499969482422,1963.949951171875 2020-03-31,166.8000030517578,1949.719970703125 2020-04-01,159.60000610351562,1907.699951171875 2020-04-02,158.19000244140625,1918.8299560546875 2020-04-03,154.17999267578125,1906.5899658203125 2020-04-06,165.5500030517578,1997.5899658203125 2020-04-07,168.8300018310547,2011.5999755859375 2020-04-08,174.27999877929688,2043.0 2020-04-09,175.19000244140625,2042.760009765625 2020-04-13,174.7899932861328,2168.8701171875 2020-04-14,178.1699981689453,2283.320068359375 2020-04-15,176.97000122070312,2307.679931640625 2020-04-16,176.25,2408.18994140625 2020-04-17,179.24000549316406,2375.0 2020-04-20,178.24000549316406,2393.610107421875 2020-04-21,170.8000030517578,2328.1201171875 2020-04-22,182.27999877929688,2363.489990234375 2020-04-23,185.1300048828125,2399.449951171875 2020-04-24,190.07000732421875,2410.219970703125 2020-04-27,187.5,2376.0 2020-04-28,182.91000366210938,2314.080078125 2020-04-29,194.19000244140625,2372.7099609375 2020-04-30,204.7100067138672,2474.0 2020-05-01,202.27000427246094,2286.0400390625 2020-05-04,205.25999450683594,2315.989990234375 2020-05-05,207.07000732421875,2317.800048828125 2020-05-06,208.47000122070312,2351.260009765625 2020-05-07,211.25999450683594,2367.610107421875 2020-05-08,212.35000610351562,2379.610107421875 2020-05-11,213.17999267578125,2409.0 2020-05-12,210.10000610351562,2356.949951171875 2020-05-13,205.10000610351562,2367.919921875 2020-05-14,206.80999755859375,2388.85009765625 2020-05-15,210.8800048828125,2409.780029296875 2020-05-18,213.19000244140625,2426.260009765625 2020-05-19,216.8800048828125,2449.330078125 2020-05-20,229.97000122070312,2497.93994140625 2020-05-21,231.38999938964844,2446.739990234375 2020-05-22,234.91000366210938,2436.8798828125 2020-05-26,232.1999969482422,2421.860107421875 2020-05-27,229.13999938964844,2410.389892578125 2020-05-28,225.4600067138672,2401.10009765625 2020-05-29,225.08999633789062,2442.3701171875 2020-06-01,231.91000366210938,2471.0400390625 2020-06-02,232.72000122070312,2472.409912109375 2020-06-03,230.16000366210938,2478.39990234375 2020-06-04,226.2899932861328,2460.60009765625 2020-06-05,230.77000427246094,2483.0 2020-06-08,231.39999389648438,2524.06005859375 2020-06-09,238.6699981689453,2600.860107421875 2020-06-10,236.72999572753906,2647.449951171875 2020-06-11,224.42999267578125,2557.9599609375 2020-06-12,228.5800018310547,2545.02001953125 2020-06-15,232.5,2572.679931640625 2020-06-16,235.64999389648438,2615.27001953125 2020-06-17,235.52999877929688,2640.97998046875 2020-06-18,235.94000244140625,2653.97998046875 2020-06-19,238.7899932861328,2675.010009765625 2020-06-22,239.22000122070312,2713.820068359375 2020-06-23,242.24000549316406,2764.409912109375 2020-06-24,234.02000427246094,2734.39990234375 2020-06-25,235.67999267578125,2754.580078125 2020-06-26,216.0800018310547,2692.8701171875 2020-06-29,220.63999938964844,2680.3798828125 2020-06-30,227.07000732421875,2758.820068359375 2020-07-01,237.5500030517578,2878.699951171875 2020-07-02,233.4199981689453,2890.300048828125 2020-07-06,240.27999877929688,3057.0400390625 2020-07-07,240.86000061035156,3000.1201171875 2020-07-08,243.5800018310547,3081.110107421875 2020-07-09,244.5,3182.6298828125 2020-07-10,245.07000732421875,3200.0 2020-07-13,239.0,3104.0 2020-07-14,239.72999572753906,3084.0 2020-07-15,240.27999877929688,3008.8701171875 2020-07-16,240.92999267578125,2999.89990234375 2020-07-17,242.02999877929688,2961.969970703125 2020-07-20,245.4199981689453,3196.840087890625 2020-07-21,241.75,3138.2900390625 2020-07-22,239.8699951171875,3099.909912109375 2020-07-23,232.60000610351562,2986.550048828125 2020-07-24,230.7100067138672,3008.909912109375 2020-07-27,233.5,3055.2099609375 2020-07-28,230.1199951171875,3000.330078125 2020-07-29,233.2899932861328,3033.530029296875 2020-07-30,234.5,3051.8798828125 2020-07-31,253.6699981689453,3164.679931640625 2020-08-03,251.9600067138672,3111.889892578125 2020-08-04,249.8300018310547,3138.830078125 2020-08-05,249.1199951171875,3205.030029296875 2020-08-06,265.2799987792969,3225.0 2020-08-07,268.44000244140625,3167.4599609375 2020-08-10,263.0,3148.159912109375 2020-08-11,256.1300048828125,3080.669921875 2020-08-12,259.8900146484375,3162.239990234375 2020-08-13,261.29998779296875,3161.02001953125 2020-08-14,261.239990234375,3148.02001953125 2020-08-17,261.1600036621094,3182.409912109375 2020-08-18,262.3399963378906,3312.489990234375 2020-08-19,262.5899963378906,3260.47998046875 2020-08-20,269.010009765625,3297.3701171875 2020-08-21,267.010009765625,3284.719970703125 2020-08-24,271.3900146484375,3307.4599609375 2020-08-25,280.82000732421875,3346.489990234375 2020-08-26,303.9100036621094,3441.85009765625 2020-08-27,293.2200012207031,3400.0 2020-08-28,293.6600036621094,3401.800048828125 2020-08-31,293.20001220703125,3450.9599609375 2020-09-01,295.44000244140625,3499.1201171875 2020-09-02,302.5,3531.449951171875 2020-09-03,291.1199951171875,3368.0 2020-09-04,282.7300109863281,3294.6201171875 2020-09-08,271.1600036621094,3149.840087890625 2020-09-09,273.7200012207031,3268.610107421875 2020-09-10,268.0899963378906,3175.110107421875 2020-09-11,266.6099853515625,3116.219970703125 2020-09-14,266.1499938964844,3102.969970703125 2020-09-15,272.4200134277344,3156.1298828125 2020-09-16,263.5199890136719,3078.10009765625 2020-09-17,254.82000732421875,3008.72998046875 2020-09-18,252.52999877929688,2954.909912109375 2020-09-21,248.14999389648438,2960.469970703125 2020-09-22,254.75,3128.989990234375 2020-09-23,249.02000427246094,2999.860107421875 2020-09-24,249.52999877929688,3019.7900390625 2020-09-25,254.82000732421875,3095.1298828125 2020-09-28,256.82000732421875,3174.050048828125 2020-09-29,261.7900085449219,3144.8798828125 2020-09-30,261.8999938964844,3148.72998046875 2020-10-01,266.6300048828125,3221.260009765625 2020-10-02,259.94000244140625,3125.0 2020-10-05,264.6499938964844,3199.199951171875 2020-10-06,258.6600036621094,3099.9599609375 2020-10-07,258.1199951171875,3195.68994140625 2020-10-08,263.760009765625,3190.550048828125 2020-10-09,264.45001220703125,3286.64990234375 2020-10-12,275.75,3442.929931640625 2020-10-13,276.1400146484375,3443.6298828125 2020-10-14,271.82000732421875,3363.7099609375 2020-10-15,266.7200012207031,3338.64990234375 2020-10-16,265.92999267578125,3272.7099609375 2020-10-19,261.3999938964844,3207.2099609375 2020-10-20,267.55999755859375,3217.010009765625 2020-10-21,278.7300109863281,3184.93994140625 2020-10-22,278.1199951171875,3176.39990234375 2020-10-23,284.7900085449219,3204.39990234375 2020-10-26,277.1099853515625,3207.0400390625 2020-10-27,283.2900085449219,3286.330078125 2020-10-28,267.6700134277344,3162.780029296875 2020-10-29,280.8299865722656,3211.010009765625 2020-10-30,263.1099853515625,3036.14990234375 2020-11-02,261.3599853515625,3004.47998046875 2020-11-03,265.29998779296875,3048.409912109375 2020-11-04,287.3800048828125,3241.159912109375 2020-11-05,294.67999267578125,3322.0 2020-11-06,293.4100036621094,3311.3701171875 2020-11-09,278.7699890136719,3143.739990234375 2020-11-10,272.42999267578125,3035.02001953125 2020-11-11,276.4800109863281,3137.389892578125 2020-11-12,275.0799865722656,3110.280029296875 2020-11-13,276.95001220703125,3128.81005859375 2020-11-16,278.9599914550781,3131.06005859375 2020-11-17,275.0,3135.659912109375 2020-11-18,271.9700012207031,3105.4599609375 2020-11-19,272.94000244140625,3117.02001953125 2020-11-20,269.70001220703125,3099.39990234375 2020-11-23,268.42999267578125,3098.389892578125 2020-11-24,276.9200134277344,3118.06005859375 2020-11-25,275.5899963378906,3185.070068359375 2020-11-27,277.80999755859375,3195.340087890625 2020-11-30,276.9700012207031,3168.0400390625 2020-12-01,286.54998779296875,3220.080078125 2020-12-02,287.5199890136719,3203.530029296875 2020-12-03,281.8500061035156,3186.72998046875 2020-12-04,279.70001220703125,3162.580078125 2020-12-07,285.5799865722656,3158.0 2020-12-08,283.3999938964844,3177.2900390625 2020-12-09,277.9200134277344,3104.199951171875 2020-12-10,277.1199951171875,3101.489990234375 2020-12-11,273.54998779296875,3116.419921875 2020-12-14,274.19000244140625,3156.969970703125 2020-12-15,275.54998779296875,3165.1201171875 2020-12-16,275.6700134277344,3240.9599609375 2020-12-17,274.4800109863281,3236.080078125 2020-12-18,276.3999938964844,3201.64990234375 2020-12-21,272.7900085449219,3206.179931640625 2020-12-22,267.0899963378906,3206.52001953125 2020-12-23,268.1099853515625,3185.27001953125 2020-12-24,267.3999938964844,3172.68994140625 2020-12-28,277.0,3283.9599609375 2020-12-29,276.7799987792969,3322.0 2020-12-30,271.8699951171875,3285.85009765625 2020-12-31,273.1600036621094,3256.929931640625 2021-01-04,268.94000244140625,3186.6298828125 2021-01-05,270.9700012207031,3218.510009765625 2021-01-06,263.30999755859375,3138.3798828125 2021-01-07,268.739990234375,3162.159912109375 2021-01-08,267.57000732421875,3182.699951171875 2021-01-11,256.8399963378906,3114.2099609375 2021-01-12,251.08999633789062,3120.830078125 2021-01-13,251.63999938964844,3165.889892578125 2021-01-14,245.63999938964844,3127.469970703125 2021-01-15,251.36000061035156,3104.25 2021-01-19,261.1000061035156,3120.760009765625 2021-01-20,267.4800109863281,3263.3798828125 2021-01-21,272.8699951171875,3306.989990234375 2021-01-22,274.5,3292.22998046875 2021-01-25,278.010009765625,3294.0 2021-01-26,282.04998779296875,3326.1298828125 2021-01-27,272.1400146484375,3232.580078125 2021-01-28,265.0,3237.6201171875 2021-01-29,258.3299865722656,3206.199951171875 2021-02-01,262.010009765625,3342.8798828125 2021-02-02,267.0799865722656,3380.0 2021-02-03,266.6499938964844,3312.530029296875 2021-02-04,266.489990234375,3331.0 2021-02-05,268.1000061035156,3352.14990234375 2021-02-08,266.5799865722656,3322.93994140625 2021-02-09,269.45001220703125,3305.0 2021-02-10,271.8699951171875,3286.580078125 2021-02-11,270.3900146484375,3262.1298828125 2021-02-12,270.5,3277.7099609375 2021-02-16,273.9700012207031,3268.949951171875 2021-02-17,273.57000732421875,3308.639892578125 2021-02-18,269.3900146484375,3328.22998046875 2021-02-19,261.55999755859375,3249.89990234375 2021-02-22,260.3299865722656,3180.739990234375 2021-02-23,265.8599853515625,3194.5 2021-02-24,264.30999755859375,3159.530029296875 2021-02-25,254.69000244140625,3057.159912109375 2021-02-26,257.6199951171875,3092.929931640625 2021-03-01,264.9100036621094,3146.139892578125 2021-03-02,259.0,3094.530029296875 2021-03-03,255.41000366210938,3005.0 2021-03-04,257.6400146484375,2977.570068359375 2021-03-05,264.2799987792969,3000.4599609375 2021-03-08,255.30999755859375,2951.949951171875 2021-03-09,265.739990234375,3062.85009765625 2021-03-10,264.8999938964844,3057.639892578125 2021-03-11,273.8800048828125,3113.590087890625 2021-03-12,268.3999938964844,3089.489990234375 """
45.127451
48
0.845579
3,539
23,015
5.498446
0.233117
0.007092
0.002621
0
0
0
0
0
0
0
0
0.863073
0.022333
23,015
509
49
45.21611
0.001733
0.000999
0
0
0
0
0.999304
0.97642
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2bc836c501da68562b53375a7ae4faac1f7f286b
866
py
Python
2020_10_14/dojo_test.py
devppjr/dojo
de0bf116153bd1251dd948c18fc73ac41def0fa5
[ "MIT" ]
114
2015-03-10T22:17:42.000Z
2022-03-09T17:49:48.000Z
2020_10_14/dojo_test.py
devppjr/dojo
de0bf116153bd1251dd948c18fc73ac41def0fa5
[ "MIT" ]
9
2018-09-04T12:49:59.000Z
2019-11-17T21:29:51.000Z
2020_10_14/dojo_test.py
devppjr/dojo
de0bf116153bd1251dd948c18fc73ac41def0fa5
[ "MIT" ]
39
2015-01-29T01:20:56.000Z
2022-02-17T16:26:25.000Z
import unittest from dojo import is_substring_valid, main class DojoTest(unittest.TestCase): def test_is_substring_valid_1(self): self.assertTrue(is_substring_valid("LR")) def test_is_substring_valid_2(self): self.assertFalse(is_substring_valid("LRR")) def test_is_substring_valid_3(self): self.assertTrue(is_substring_valid("LLRR")) def test_main(self): self.assertEqual(main("LLRR"), 1) def test_main_2(self): self.assertEqual(main("LLRRLR"), 2) def test_main_3(self): self.assertEqual(main("LLRRLRLR"), 3) def test_main_4(self): self.assertEqual(main("LRLRLRLRLLRR"), 5) if __name__ == '__main__': unittest.main() # Sami - Juan - Lucas - Elen – Pri – Thiago – Vierno – Santana – Ingrid - Natalia # RLRRLLRLRL # RL LLLRRR LR # LLLLRRRR # RLRRRLLRLL
24.742857
81
0.670901
117
866
4.709402
0.393162
0.139746
0.203267
0.166969
0.248639
0.123412
0
0
0
0
0
0.014663
0.212471
866
35
82
24.742857
0.785924
0.143187
0
0
0
0
0.064828
0
0
0
0
0
0.368421
1
0.368421
false
0
0.105263
0
0.526316
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
9200c58c15fb82e4fda656ef1deca64c342ff9f3
108
py
Python
py_tdlib/constructors/authentication_code_type_flash_call.py
Mr-TelegramBot/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
24
2018-10-05T13:04:30.000Z
2020-05-12T08:45:34.000Z
py_tdlib/constructors/authentication_code_type_flash_call.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
3
2019-06-26T07:20:20.000Z
2021-05-24T13:06:56.000Z
py_tdlib/constructors/authentication_code_type_flash_call.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
5
2018-10-05T14:29:28.000Z
2020-08-11T15:04:10.000Z
from ..factory import Type class authenticationCodeTypeFlashCall(Type): pattern = None # type: "string"
18
44
0.759259
11
108
7.454545
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.148148
108
5
45
21.6
0.891304
0.12963
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a6115b59f0892168ff10e5f4aecf7b20c58f79ee
167
py
Python
blackmamba/lib/future/moves/html/parser.py
oz90210/blackmamba
65c82c8e99028d6fbb57098ce82d0a394df215a0
[ "MIT" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
blackmamba/lib/future/moves/html/parser.py
oz90210/blackmamba
65c82c8e99028d6fbb57098ce82d0a394df215a0
[ "MIT" ]
4,640
2015-07-08T16:19:08.000Z
2019-12-02T15:01:27.000Z
blackmamba/lib/future/moves/html/parser.py
oz90210/blackmamba
65c82c8e99028d6fbb57098ce82d0a394df215a0
[ "MIT" ]
698
2015-06-02T19:18:35.000Z
2022-03-29T16:57:15.000Z
from __future__ import absolute_import from future.utils import PY3 __future_module__ = True if PY3: from html.parser import * else: from HTMLParser import *
18.555556
38
0.772455
23
167
5.173913
0.565217
0.168067
0
0
0
0
0
0
0
0
0
0.014706
0.185629
167
8
39
20.875
0.860294
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a612433fc0a0fc997203246665402269c2609cd9
749
py
Python
tests/integration/resources/token_test.py
tong181567/magic-admin
76d3af5838ae9f6a4d756ddf8157695a4573dc65
[ "MIT" ]
19
2020-07-29T21:15:44.000Z
2022-03-04T07:30:51.000Z
tests/integration/resources/token_test.py
tong181567/magic-admin
76d3af5838ae9f6a4d756ddf8157695a4573dc65
[ "MIT" ]
8
2020-07-15T04:58:25.000Z
2022-02-24T02:00:37.000Z
tests/integration/resources/token_test.py
tong181567/magic-admin
76d3af5838ae9f6a4d756ddf8157695a4573dc65
[ "MIT" ]
10
2020-07-29T21:15:46.000Z
2022-02-05T12:23:36.000Z
from magic_admin.resources.token import Token from testing.data.did_token import claim from testing.data.did_token import future_did_token from testing.data.did_token import issuer from testing.data.did_token import proof from testing.data.did_token import public_address class TestToken: def test_check_required_fields(self): Token._check_required_fields(claim) def test_decode(self): assert Token.decode(future_did_token) == (proof, claim) def test_get_issuer(self): assert Token.get_issuer(future_did_token) == issuer def test_get_public_address(self): assert Token.get_public_address(future_did_token) == public_address def test_validate(self): Token.validate(future_did_token)
29.96
75
0.773031
108
749
5.046296
0.25
0.146789
0.137615
0.165138
0.284404
0.284404
0.124771
0
0
0
0
0
0.157543
749
24
76
31.208333
0.863708
0
0
0
0
0
0
0
0
0
0
0
0.176471
1
0.294118
false
0
0.352941
0
0.705882
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
4
a6270026d37a254a1ba1348773f5dbc083b04cfa
3,008
py
Python
ApiTest/MyApp/migrations/0001_initial.py
archerckk/TestDir
6cce4bf70b2758c49ade435f51bb4392433f04fb
[ "MIT" ]
null
null
null
ApiTest/MyApp/migrations/0001_initial.py
archerckk/TestDir
6cce4bf70b2758c49ade435f51bb4392433f04fb
[ "MIT" ]
null
null
null
ApiTest/MyApp/migrations/0001_initial.py
archerckk/TestDir
6cce4bf70b2758c49ade435f51bb4392433f04fb
[ "MIT" ]
null
null
null
# Generated by Django 2.2 on 2021-03-01 08:30 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='DB_apis', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('project_id', models.CharField(max_length=10, null=True)), ('name', models.CharField(max_length=100, null=True)), ('api_method', models.CharField(max_length=10, null=True)), ('api_url', models.CharField(max_length=1000, null=True)), ('api_header', models.CharField(max_length=1000, null=True)), ('api_login', models.CharField(max_length=10, null=True)), ('api_host', models.CharField(max_length=100, null=True)), ('des', models.CharField(max_length=100, null=True)), ('body_method', models.CharField(max_length=20, null=True)), ('api_body', models.CharField(max_length=1000, null=True)), ('result', models.TextField(null=True)), ('sign', models.CharField(max_length=10, null=True)), ('file_key', models.CharField(max_length=50, null=True)), ('file_name', models.CharField(max_length=50, null=True)), ('public_header', models.CharField(max_length=1000, null=True)), ('last_body_method', models.CharField(max_length=20, null=True)), ('last_api_body', models.CharField(max_length=1000, null=True)), ], ), migrations.CreateModel( name='DB_diss', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('user', models.CharField(max_length=30, null=True)), ('text', models.CharField(max_length=1000, null=True)), ('ctime', models.DateTimeField(auto_now=True)), ], ), migrations.CreateModel( name='DB_home_href', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=30, null=True)), ('href', models.CharField(max_length=2000, null=True)), ], ), migrations.CreateModel( name='DB_project', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100, null=True)), ('remark', models.CharField(max_length=1000, null=True)), ('user', models.CharField(max_length=15, null=True)), ('other_user', models.CharField(max_length=200, null=True)), ], ), ]
46.276923
114
0.567154
325
3,008
5.070769
0.218462
0.121359
0.262136
0.349515
0.777306
0.716019
0.678398
0.48301
0.331311
0.225728
0
0.038569
0.284574
3,008
64
115
47
0.72723
0.014295
0
0.385965
1
0
0.083024
0
0
0
0
0
0
1
0
false
0
0.017544
0
0.087719
0
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a66bd635a65f5b38ac680e1cd85e386ecea0ff42
202
py
Python
celery_with_django/mainapp/views.py
viresh18/celery_with_django
6921cce90e6379eb9637dc663941fe531e43ff51
[ "MIT" ]
null
null
null
celery_with_django/mainapp/views.py
viresh18/celery_with_django
6921cce90e6379eb9637dc663941fe531e43ff51
[ "MIT" ]
null
null
null
celery_with_django/mainapp/views.py
viresh18/celery_with_django
6921cce90e6379eb9637dc663941fe531e43ff51
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.http import HttpResponse from .tasks import test_func # Create your views here. def test(request): test_func.delay() return HttpResponse("Done")
22.444444
36
0.772277
28
202
5.5
0.678571
0.12987
0
0
0
0
0
0
0
0
0
0
0.153465
202
9
37
22.444444
0.900585
0.113861
0
0
0
0
0.022472
0
0
0
0
0
0
1
0.166667
false
0
0.5
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a698f8f569a374580614041319640a1f71f48003
435
py
Python
build/piman.app/pysmi/reader/__init__.py
jackgisel/team-athens
91e2aa810c0064f8b6b39ee53c3b05f037e0aeb0
[ "Apache-2.0" ]
null
null
null
build/piman.app/pysmi/reader/__init__.py
jackgisel/team-athens
91e2aa810c0064f8b6b39ee53c3b05f037e0aeb0
[ "Apache-2.0" ]
null
null
null
build/piman.app/pysmi/reader/__init__.py
jackgisel/team-athens
91e2aa810c0064f8b6b39ee53c3b05f037e0aeb0
[ "Apache-2.0" ]
null
null
null
# # This file is part of pysmi software. # # Copyright (c) 2015-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pysmi/license.html # from pysmi.reader.callback import CallbackReader from pysmi.reader.ftpclient import FtpReader from pysmi.reader.httpclient import HttpReader from pysmi.reader.zipreader import ZipReader from pysmi.reader.localfile import FileReader from pysmi.reader.url import getReadersFromUrls
33.461538
59
0.816092
59
435
6.016949
0.559322
0.152113
0.253521
0
0
0
0
0
0
0
0
0.020513
0.103448
435
12
60
36.25
0.889744
0.326437
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
a6bf4c8fd90b7925df0437f34a2d8b3487014418
373
py
Python
Day 14: Scope/scope.py
Pritam055/python-ProblemSolving
402cabb9047f68e330c1c064f0c46a5535775f44
[ "MIT" ]
1
2021-11-02T04:08:31.000Z
2021-11-02T04:08:31.000Z
Day 14: Scope/scope.py
Pritam055/python-ProblemSolving
402cabb9047f68e330c1c064f0c46a5535775f44
[ "MIT" ]
null
null
null
Day 14: Scope/scope.py
Pritam055/python-ProblemSolving
402cabb9047f68e330c1c064f0c46a5535775f44
[ "MIT" ]
1
2021-12-01T14:43:21.000Z
2021-12-01T14:43:21.000Z
# Add your code here def computeDifference(self): difference = [] for j in range(len(self.__elements)-1): for i in range(j,len(self.__elements)-1): diff = abs(self.__elements[j] - self.__elements[i+1]) difference.append(diff) self.maximumDifference = max(difference)
23.3125
69
0.536193
41
373
4.682927
0.512195
0.25
0.15625
0.166667
0
0
0
0
0
0
0
0.0125
0.356568
373
15
70
24.866667
0.7875
0.048257
0
0
0
0
0
0
0
0
0
0.066667
0
0
null
null
0
0
null
null
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
1
0
1
0
0
0
0
0
0
0
0
4
a6cf4ba8cbb3dbd6381b4605c0d1c0107656b952
2,295
py
Python
tests/cosrlibtests/test_urlclient.py
commonsearch/cosr-back
28ca0c1b938dde52bf4f59a835c98dd5ab22cad6
[ "Apache-2.0" ]
141
2016-02-17T14:27:57.000Z
2021-12-27T02:56:48.000Z
tests/cosrlibtests/test_urlclient.py
commonsearch/cosr-back
28ca0c1b938dde52bf4f59a835c98dd5ab22cad6
[ "Apache-2.0" ]
69
2016-02-20T02:06:59.000Z
2017-01-29T22:23:46.000Z
tests/cosrlibtests/test_urlclient.py
commonsearch/cosr-back
28ca0c1b938dde52bf4f59a835c98dd5ab22cad6
[ "Apache-2.0" ]
38
2016-02-25T04:40:07.000Z
2020-06-11T07:22:44.000Z
def test_urlclient_getids(urlclient): # TODO proper fixture with reset at each test for local dev! client = urlclient.client # Test basic hashes being different wp_homepage = client.get_id("http://www.wordpress.org") wp_com_homepage = client.get_id("http://www.wordpress.com") assert wp_homepage != wp_com_homepage # Test all variations of the same URL assert wp_homepage == client.get_id("http://www.wordpress.org") assert wp_homepage == client.get_id("http://www.wordpress.org/") assert wp_homepage == client.get_id("https://www.wordpress.org/") assert wp_homepage == client.get_id("http://wordpress.org") assert wp_homepage == client.get_id("http://wordpress.org/") assert wp_homepage == client.get_id("https://wordpress.org/") assert wp_homepage == client.get_id("https://wordpress.org/#") assert wp_homepage == client.get_id("https://wordpress.org/#hello") assert wp_homepage == client.get_id("https://wordpress.org/?") # Different pages wp_new_page = client.get_id("http://www.wordpress.org/new_unknown_url.html") wp_new_page2 = client.get_id("http://www.wordpress.org/new_unknown_url2.html") wp_new_page3 = client.get_id("http://en.wordpress.org/new_unknown_url2.html") wp_new_page4 = client.get_id("http://en.wordpress.org/new_unknown_url2.html?a=a") # Must all be different assert len(set([ wp_new_page, wp_new_page2, wp_new_page3, wp_new_page4, wp_homepage, wp_com_homepage ])) == 6 # Test multiple urls at once res = list(client.get_ids([ "http://www.wordpress.org", "http://www.wordpress.org/new_unknown_url.html" ])) assert res == [wp_homepage, wp_new_page] assert wp_homepage == client.get_domain_id("http://www.wordpress.org") assert wp_homepage == client.get_domain_id("http://wordpress.org") assert wp_homepage == client.get_domain_id("https://wordpress.org/?") assert wp_homepage == client.get_domain_id("https://wordpress.org/page") assert wp_homepage != client.get_domain_id("https://en.wordpress.org/page") def test_urlclient_getmetadata(urlclient): client = urlclient.client meta = client.get_metadata(["http://www.wordpress.org/index.html"]) print meta
39.568966
85
0.694989
329
2,295
4.595745
0.197568
0.130952
0.179894
0.188492
0.664021
0.633598
0.633598
0.61045
0.51918
0.399471
0
0.005206
0.162963
2,295
57
86
40.263158
0.781884
0.084096
0
0.05
0
0
0.320286
0
0
0
0
0.017544
0.425
0
null
null
0
0
null
null
0.025
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
1
1
1
0
0
0
0
0
0
0
0
4
a6cfa12f70ddcba8c324be6359bd2ab77467a850
18
py
Python
mapillary_tools/__init__.py
mxa/mapillary_tools
4bfebf8705d06d8568619cc0c6b83fd3d4fad95e
[ "BSD-2-Clause" ]
null
null
null
mapillary_tools/__init__.py
mxa/mapillary_tools
4bfebf8705d06d8568619cc0c6b83fd3d4fad95e
[ "BSD-2-Clause" ]
null
null
null
mapillary_tools/__init__.py
mxa/mapillary_tools
4bfebf8705d06d8568619cc0c6b83fd3d4fad95e
[ "BSD-2-Clause" ]
null
null
null
VERSION = "0.8.2"
9
17
0.555556
4
18
2.5
1
0
0
0
0
0
0
0
0
0
0
0.2
0.166667
18
1
18
18
0.466667
0
0
0
0
0
0.277778
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a6f70e22248345957384770b9ccecfcb89b6487d
174
py
Python
plugins/python/container/util/iterator.py
proglang/servercodetest
f0acd5940a22be9a72a95494afb308bb3017ea64
[ "MIT" ]
null
null
null
plugins/python/container/util/iterator.py
proglang/servercodetest
f0acd5940a22be9a72a95494afb308bb3017ea64
[ "MIT" ]
2
2020-06-05T16:24:37.000Z
2020-11-15T09:02:48.000Z
plugins/python/container/util/iterator.py
proglang/servercodetest
f0acd5940a22be9a72a95494afb308bb3017ea64
[ "MIT" ]
1
2020-10-22T05:46:52.000Z
2020-10-22T05:46:52.000Z
import re def lines(data: str): return iterate(data, r"[^\n]+") def iterate(data: str, regex: str): return (x.group(0).strip() for x in re.finditer(regex, data))
17.4
65
0.632184
29
174
3.793103
0.62069
0.127273
0
0
0
0
0
0
0
0
0
0.007042
0.183908
174
9
66
19.333333
0.767606
0
0
0
0
0
0.034483
0
0
0
0
0
0
1
0.4
false
0
0.2
0.4
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
47077ff459634eb84a4ae0a45bb6e1ba58bcb75e
615
py
Python
blog_pro/wp-content/themes/ngi/iearn_tech_new-prod/iearn_tech_new/forums.py
TheSilentNoise/NexGenSetup
972a29dc7dfb54d59a1d458387c6804b27435097
[ "Apache-2.0" ]
null
null
null
blog_pro/wp-content/themes/ngi/iearn_tech_new-prod/iearn_tech_new/forums.py
TheSilentNoise/NexGenSetup
972a29dc7dfb54d59a1d458387c6804b27435097
[ "Apache-2.0" ]
null
null
null
blog_pro/wp-content/themes/ngi/iearn_tech_new-prod/iearn_tech_new/forums.py
TheSilentNoise/NexGenSetup
972a29dc7dfb54d59a1d458387c6804b27435097
[ "Apache-2.0" ]
null
null
null
from flask import render_template,redirect,url_for,request,json,flash from app import app import datetime from flask_mail import Message from app import db,mail from forms import * from werkzeug.security import generate_password_hash,check_password_hash from flask_login import LoginManager,login_user,login_required,logout_user,current_user from sqlalchemy import desc from models import db @app.route('/forums') def forums(): #form = ContactUsForm() if current_user.is_authenticated: return render_template('forums.html',name=current_user.user_fname) return render_template('forums.html')
26.73913
87
0.811382
88
615
5.465909
0.5
0.056133
0.054054
0.108108
0.12474
0
0
0
0
0
0
0
0.120325
615
22
88
27.954545
0.889094
0.035772
0
0
0
0
0.049236
0
0
0
0
0
0
1
0.066667
true
0.066667
0.666667
0
0.866667
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
1
1
0
1
0
0
4
4724dd447afde3887aaa0a1ebe1e819a459ac85b
1,837
py
Python
rover_source/scripts/rover_joint_state_publisher.py
yavuzterzioglu/Rover_19
d500ef3208312280935e0c15c9648270d29ee317
[ "BSD-2-Clause" ]
4
2019-02-15T12:54:17.000Z
2021-03-07T14:30:47.000Z
rover_source/scripts/rover_joint_state_publisher.py
yavuzterzioglu/Rover_19
d500ef3208312280935e0c15c9648270d29ee317
[ "BSD-2-Clause" ]
1
2019-02-05T19:57:24.000Z
2019-02-05T19:57:51.000Z
rover_source/scripts/rover_joint_state_publisher.py
yavuzterzioglu/Rover_19
d500ef3208312280935e0c15c9648270d29ee317
[ "BSD-2-Clause" ]
2
2019-01-22T15:06:43.000Z
2019-01-25T11:38:08.000Z
#!/usr/bin/env python import rospy from sensor_msgs.msg import JointState from std_msgs.msg import String from rover_source.msg import * joints =Joint_msgs() joint_state_vector=[joints.joint1, joints.joint2, joints.joint3, joints.joint4, joints.joint5, joints.joint6] def callback(data,self): self.splitted=data.data.split(',') if (self.splitted[0]=='S'): if(float(self.splitted[1])>=1000): joints.joint1=(float(self.splitted[1])-1000) if(float(self.splitted[1])<1000): joints.joint1=(-float(self.splitted[1])) if(float(self.splitted[2])>=1000): joints.joint2=(float(self.splitted[2])-1000) if(float(self.splitted[2])<1000): joints.joint2=(-float(self.splitted[2])) if(float(self.splitted[3])>=1000): joints.joint3=(float(self.splitted[3])-1000) if(float(self.splitted[3])<1000): joints.joint3=(-float(self.splitted[3]) ) if(float(self.splitted[4])>=1000): joints.joint4=(float(self.splitted[4])-1000) if(float(self.splitted[4])<1000): joints.joint4=(-float(self.splitted[4]) ) if(float(self.splitted[5])>=1000): joints.joint5=(float(self.splitted[4])-1000) if(float(self.splitted[5])<1000): joints.joint5=(-float(self.splitted[4]) ) if(float(self.splitted[6])>=1000): joints.joint6=(float(self.splitted[4])-1000) if(float(self.splitted[6])<1000): joints.joint6=(-float(self.splitted[4]) ) def publisher(): while not rospy.is_shutdown(): pub.publish(joint_state_vector) def main(): rospy.init_node('rover_joint_state_publisher') pub = rospy.Publisher('/rover_joint_state_publisher', Joint_msgs, queue_size = 50) rospy.Subscriber('/rover_serial_encoder', String, callback) publisher()
31.135593
109
0.645618
246
1,837
4.739837
0.235772
0.267581
0.349914
0.19554
0.576329
0.566038
0.566038
0.566038
0.566038
0.555746
0
0.077638
0.179641
1,837
58
110
31.672414
0.696085
0
0
0
0
0
0.042952
0.04185
0
0
0
0
0
0
null
null
0
0.097561
null
null
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
5b534460e437722b85365f871ab4099b815edcd6
53
py
Python
setup.py
ocean779/venv
2b0a063fca28aedd67d0a4b5a360bfee570b43b4
[ "bzip2-1.0.6" ]
null
null
null
setup.py
ocean779/venv
2b0a063fca28aedd67d0a4b5a360bfee570b43b4
[ "bzip2-1.0.6" ]
null
null
null
setup.py
ocean779/venv
2b0a063fca28aedd67d0a4b5a360bfee570b43b4
[ "bzip2-1.0.6" ]
null
null
null
from setuptools import setup setup(name='guestbook')
17.666667
28
0.811321
7
53
6.142857
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.09434
53
2
29
26.5
0.895833
0
0
0
0
0
0.169811
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5b5ef0d847741ba7e1f5fa3e0832aef27249419d
215
py
Python
kabzimal/rest/serializers/payments.py
arasumran/kabzimal
dbae35fdb940bdf0338bd43983b1894c87a35961
[ "MIT" ]
null
null
null
kabzimal/rest/serializers/payments.py
arasumran/kabzimal
dbae35fdb940bdf0338bd43983b1894c87a35961
[ "MIT" ]
12
2020-06-05T23:02:28.000Z
2022-03-11T23:59:56.000Z
kabzimal/rest/serializers/payments.py
arasumran/kabzimal
dbae35fdb940bdf0338bd43983b1894c87a35961
[ "MIT" ]
null
null
null
from rest_framework import serializers from kabzimal.models import PaymentsModels class PaymentsSerializers(serializers.ModelSerializer): class Meta: model = PaymentsModels fields = '__all__'
21.5
55
0.762791
20
215
7.95
0.75
0
0
0
0
0
0
0
0
0
0
0
0.190698
215
9
56
23.888889
0.913793
0
0
0
0
0
0.032558
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5b738f5cfef942bcffa98358bce6bd63f75a65d8
220
py
Python
dbaas/flipperfox_migration/service/databaseflipperfoxmigration.py
jaeko44/python_dbaas
4fafa4ad70200fec1436c326c751761922ec9fa8
[ "BSD-3-Clause" ]
null
null
null
dbaas/flipperfox_migration/service/databaseflipperfoxmigration.py
jaeko44/python_dbaas
4fafa4ad70200fec1436c326c751761922ec9fa8
[ "BSD-3-Clause" ]
null
null
null
dbaas/flipperfox_migration/service/databaseflipperfoxmigration.py
jaeko44/python_dbaas
4fafa4ad70200fec1436c326c751761922ec9fa8
[ "BSD-3-Clause" ]
1
2017-07-02T08:46:17.000Z
2017-07-02T08:46:17.000Z
# -*- coding: utf-8 -*- from django_services import service from ..models import DatabaseFlipperFoxMigration class DatabaseFlipperFoxMigrationService(service.CRUDService): model_class = DatabaseFlipperFoxMigration
27.5
62
0.818182
19
220
9.368421
0.736842
0
0
0
0
0
0
0
0
0
0
0.005102
0.109091
220
7
63
31.428571
0.903061
0.095455
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5b87dbe851a23fccfbc2f2b658f9446896d6b4af
87
py
Python
scripts/nltk_downloads.py
NatalieThurlby/nlp-islamist-discourse
588b70624918c5690662294e162c7319a651bb50
[ "MIT" ]
2
2021-07-05T09:17:46.000Z
2021-09-14T10:06:26.000Z
scripts/nltk_downloads.py
NatalieThurlby/nlp-islamist-discourse
588b70624918c5690662294e162c7319a651bb50
[ "MIT" ]
6
2021-07-05T08:28:05.000Z
2021-07-22T08:37:05.000Z
scripts/nltk_downloads.py
NatalieThurlby/nlp-islamist-discourse
588b70624918c5690662294e162c7319a651bb50
[ "MIT" ]
3
2021-07-07T13:12:46.000Z
2022-02-08T12:51:17.000Z
"""Must be run before using NLTK downloads""" import nltk nltk.download("stopwords")
14.5
45
0.735632
12
87
5.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.137931
87
5
46
17.4
0.853333
0.448276
0
0
0
0
0.214286
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5ba0d566868db7bcaa115eb28ee7a43713d627e4
85
py
Python
tests/IT/fixtures/test_module_setup_fail.py
testandconquer/pytest-conquer
da600c7f5bcd06aa62c5cca9b75370bf1a6ebf05
[ "MIT" ]
null
null
null
tests/IT/fixtures/test_module_setup_fail.py
testandconquer/pytest-conquer
da600c7f5bcd06aa62c5cca9b75370bf1a6ebf05
[ "MIT" ]
5
2018-12-27T02:52:01.000Z
2019-01-02T01:52:55.000Z
tests/IT/fixtures/test_module_setup_fail.py
testandconquer/pytest-conquer
da600c7f5bcd06aa62c5cca9b75370bf1a6ebf05
[ "MIT" ]
null
null
null
def setup_module(module): raise Exception('setup failed') def test(): pass
12.142857
35
0.670588
11
85
5.090909
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.211765
85
6
36
14.166667
0.835821
0
0
0
0
0
0.141176
0
0
0
0
0
0
1
0.5
false
0.25
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
5bbce23accbed6efb0ce6d3ae1b16f3ef82f7f78
98
py
Python
examples/linux/print-minute-fill.py
Gustra/tiny-dash
a6eb226432f7207b40adc0b1bf763c6c929b4ce4
[ "MIT" ]
null
null
null
examples/linux/print-minute-fill.py
Gustra/tiny-dash
a6eb226432f7207b40adc0b1bf763c6c929b4ce4
[ "MIT" ]
33
2017-06-03T08:58:07.000Z
2017-10-12T19:09:55.000Z
examples/linux/print-minute-fill.py
Gustra/tiny-dash
a6eb226432f7207b40adc0b1bf763c6c929b4ce4
[ "MIT" ]
null
null
null
#!/usr/bin/env python import time import sys print float(int(time.time())%60)/60.0 sys.exit(0)
10.888889
37
0.693878
19
98
3.578947
0.684211
0
0
0
0
0
0
0
0
0
0
0.069767
0.122449
98
8
38
12.25
0.72093
0.204082
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
null
null
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
1
0
0
0
1
0
0
0
0
4
5be03286c3a9225c623eae0fd85a3bb0cca145a7
183
py
Python
speech_synthesizer/config.py
naderabdalghani/project-rev
3205d42a2220372783ab49ce8c3c70a4c4b9ad7e
[ "Apache-2.0" ]
2
2021-12-13T04:19:30.000Z
2022-02-16T16:27:20.000Z
speech_synthesizer/config.py
MuhanadAtef/project-rev
3205d42a2220372783ab49ce8c3c70a4c4b9ad7e
[ "Apache-2.0" ]
null
null
null
speech_synthesizer/config.py
MuhanadAtef/project-rev
3205d42a2220372783ab49ce8c3c70a4c4b9ad7e
[ "Apache-2.0" ]
2
2021-08-17T06:25:36.000Z
2021-08-17T12:45:33.000Z
import os from app_config import MODELS_DIR TED_VOICE_SAMPLE_PATH = os.path.join(MODELS_DIR, 'speech-synthesizer', "TED_VOICE_SAMPLE.wav") SAVED_INSTANCE_DIR = "speech-synthesizer"
26.142857
94
0.819672
28
183
5
0.607143
0.128571
0.2
0
0
0
0
0
0
0
0
0
0.087432
183
6
95
30.5
0.838323
0
0
0
0
0
0.306011
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
5bef2604744d99408a1160159a3a5650331ba469
6,570
py
Python
tests/functional/auth/test_id_token.py
sirosen/globus-sdk-python
0d4e420f52329ab8f993bfe6f86729fb1ef07570
[ "ECL-2.0", "Apache-2.0" ]
47
2016-04-13T21:28:19.000Z
2022-02-28T18:28:18.000Z
tests/functional/auth/test_id_token.py
sirosen/globus-sdk-python
0d4e420f52329ab8f993bfe6f86729fb1ef07570
[ "ECL-2.0", "Apache-2.0" ]
314
2016-04-12T15:07:32.000Z
2022-03-14T21:00:50.000Z
tests/functional/auth/test_id_token.py
sirosen/globus-sdk-python
0d4e420f52329ab8f993bfe6f86729fb1ef07570
[ "ECL-2.0", "Apache-2.0" ]
36
2016-06-14T14:05:13.000Z
2022-02-18T17:20:51.000Z
import json import jwt import pytest import globus_sdk from tests.common import register_api_route OIDC_CONFIG = { "issuer": "https://auth.globus.org", "authorization_endpoint": "https://auth.globus.org/v2/oauth2/authorize", "userinfo_endpoint": "https://auth.globus.org/v2/oauth2/userinfo", "token_endpoint": "https://auth.globus.org/v2/oauth2/token", "revocation_endpoint": "https://auth.globus.org/v2/oauth2/token/revoke", "jwks_uri": "https://auth.globus.org/jwk.json", "response_types_supported": ["code", "token", "token id_token", "id_token"], "id_token_signing_alg_values_supported": ["RS512"], "scopes_supported": ["openid", "email", "profile"], "token_endpoint_auth_methods_supported": ["client_secret_basic"], "claims_supported": [ "at_hash", "aud", "email", "exp", "name", "nonce", "preferred_username", "iat", "iss", "sub", ], "subject_types_supported": ["public"], } JWK = { "keys": [ { "alg": "RS512", "e": "AQAB", "kty": "RSA", "n": "73l27Yp7WT2c0Ve7EoGJ13AuKzg-GHU7Mpgx0JKa_hO04gAXSVXRadQy7gmdLLtAK8uBVcV0fHGgsBl4J92t-I7hayiJSLbgbX-sZhI_OfegeOLcSNB9poPS9w60XGqR9buYOW2x-KXXitsmyHXNmg_-1u0uqfKHu9pmST8dcjUYXTM5F3oJpQKeJlSH8daMlDks4xb9Y83EEFRv-ppY965-WTm2NW4pwLlbgGTWFvZ6YS6GTb-mfGwGuzStI0lKZ7dOFx9ryYQ4wSoUVHtIrypT-gbuaT90Z2SkwOH-GaEZJkudctBeGpieOsyC7P40UXpwgGNFy3xoWL4vHpnHmQ", # noqa: E501 "use": "sig", } ] } JWK_PEM = jwt.algorithms.RSAAlgorithm.from_jwk(json.dumps(JWK["keys"][0])) TOKEN_PAYLOAD = { "access_token": "auth_access_token", "scope": "profile email openid", "expires_in": 172800, "token_type": "Bearer", "resource_server": "auth.globus.org", "state": "_default", "refresh_token": "auth_refresh_token", "other_tokens": [ { "access_token": "transfer_access_token", "scope": "urn:globus:auth:scope:transfer.api.globus.org:all", "expires_in": 172800, "token_type": "Bearer", "resource_server": "transfer.api.globus.org", "state": "_default", "refresh_token": "transfer_refresh", } ], # this is a real ID token # and since the JWK is real as well, it should decode correctly "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJjOGFhZDQzZS1kMjc0LTExZTUtYmY5OC04YjAyODk2Y2Y3ODIiLCJvcmdhbml6YXRpb24iOiJHbG9idXMiLCJuYW1lIjoiU3RlcGhlbiBSb3NlbiIsInByZWZlcnJlZF91c2VybmFtZSI6InNpcm9zZW4yQGdsb2J1c2lkLm9yZyIsImlkZW50aXR5X3Byb3ZpZGVyIjoiNDExNDM3NDMtZjNjOC00ZDYwLWJiZGItZWVlY2FiYTg1YmQ5IiwiaWRlbnRpdHlfcHJvdmlkZXJfZGlzcGxheV9uYW1lIjoiR2xvYnVzIElEIiwiZW1haWwiOiJzaXJvc2VuQHVjaGljYWdvLmVkdSIsImxhc3RfYXV0aGVudGljYXRpb24iOjE2MjE0ODEwMDYsImlkZW50aXR5X3NldCI6W3sic3ViIjoiYzhhYWQ0M2UtZDI3NC0xMWU1LWJmOTgtOGIwMjg5NmNmNzgyIiwib3JnYW5pemF0aW9uIjoiR2xvYnVzIiwibmFtZSI6IlN0ZXBoZW4gUm9zZW4iLCJ1c2VybmFtZSI6InNpcm9zZW4yQGdsb2J1c2lkLm9yZyIsImlkZW50aXR5X3Byb3ZpZGVyIjoiNDExNDM3NDMtZjNjOC00ZDYwLWJiZGItZWVlY2FiYTg1YmQ5IiwiaWRlbnRpdHlfcHJvdmlkZXJfZGlzcGxheV9uYW1lIjoiR2xvYnVzIElEIiwiZW1haWwiOiJzaXJvc2VuQHVjaGljYWdvLmVkdSIsImxhc3RfYXV0aGVudGljYXRpb24iOjE2MjE0ODEwMDZ9LHsic3ViIjoiYjZlMjI3ZTgtZGI1Mi0xMWU1LWI2ZmYtYzNiMWNjMjU5ZTBkIiwibmFtZSI6bnVsbCwidXNlcm5hbWUiOiJzaXJvc2VuK2JhZGVtYWlsQGdsb2J1cy5vcmciLCJpZGVudGl0eV9wcm92aWRlciI6IjkyN2Q3MjM4LWY5MTctNGViMi05YWNlLWM1MjNmYTliYTM0ZSIsImlkZW50aXR5X3Byb3ZpZGVyX2Rpc3BsYXlfbmFtZSI6Ikdsb2J1cyBTdGFmZiIsImVtYWlsIjoic2lyb3NlbitiYWRlbWFpbEBnbG9idXMub3JnIiwibGFzdF9hdXRoZW50aWNhdGlvbiI6bnVsbH0seyJzdWIiOiJmN2Y4OWQwYS1kYzllLTExZTUtYWRkMC1hM2NiZDFhNTU5YjMiLCJuYW1lIjpudWxsLCJ1c2VybmFtZSI6InNpcm9zZW4rYmFkZW1haWwyQGdsb2J1cy5vcmciLCJpZGVudGl0eV9wcm92aWRlciI6IjkyN2Q3MjM4LWY5MTctNGViMi05YWNlLWM1MjNmYTliYTM0ZSIsImlkZW50aXR5X3Byb3ZpZGVyX2Rpc3BsYXlfbmFtZSI6Ikdsb2J1cyBTdGFmZiIsImVtYWlsIjoic2lyb3NlbitiYWRlbWFpbDJAZ2xvYnVzLm9yZyIsImxhc3RfYXV0aGVudGljYXRpb24iOm51bGx9XSwiaXNzIjoiaHR0cHM6Ly9hdXRoLmdsb2J1cy5vcmciLCJhdWQiOiI3ZmI1OGUwMC04MzlkLTQ0ZTMtODA0Ny0xMGE1MDI2MTJkY2EiLCJleHAiOjE2MjE2NTM4MTEsImlhdCI6MTYyMTQ4MTAxMSwiYXRfaGFzaCI6IjFQdlVhbmNFdUxfc2cxV1BsNWx1TUVGR2tjTDZQaDh1cWdpVUZzejhkZUEifQ.CtfnFtfM32ICo0euHv9GnpVHFL1jWz0NriPTXAv6w08Ylk9JBJtmB3oMKNSO-1TGoWUPFDp9TFFk6N32VyF0hsVDtT5DT3t5oq0qfqbPrZA3R04HARW0xtcK_ejNDHBmj6wysey3EzjT764XTvcGOe63CKQ_RJm97ulVaseIT0Aet7AYo5tQuOiSOQ70xzL7Oax3W6TrWi3FIAA-PIMSrAJKbsG7imGOVkaIObG9a-X5yTOcrB4IG4Wat-pN_QiCiiOw_LDCF-r455PwalmnSGUugMYfsdL2k3UxqwOMLIppHnx5-UVAzj3mygj8eZTp6imjqxNMdakS3vhG8dtxbw", # noqa: E501 } @pytest.fixture def client(): # this client ID is the audience for the above id_token # the client_id must match the audience in order for the decode to work (we pass it # as the audience during decoding) return globus_sdk.AuthClient(client_id="7fb58e00-839d-44e3-8047-10a502612dca") @pytest.fixture(autouse=True) def register_token_response(): register_api_route( "auth", "/v2/oauth2/token", method="POST", body=json.dumps(TOKEN_PAYLOAD) ) @pytest.fixture def token_response(register_token_response, client): return client.oauth2_token( { "grant_type": "authorization_code", "code": "foo", "redirect_uri": "https://bar.example.org/", } ) def test_decode_id_token(token_response): register_api_route( "auth", "/.well-known/openid-configuration", method="GET", body=json.dumps(OIDC_CONFIG), ) register_api_route("auth", "/jwk.json", method="GET", body=json.dumps(JWK)) decoded = token_response.decode_id_token(jwt_params={"verify_exp": False}) assert decoded["preferred_username"] == "sirosen2@globusid.org" def test_decode_id_token_with_saved_oidc_config(token_response): register_api_route("auth", "/jwk.json", method="GET", body=json.dumps(JWK)) decoded = token_response.decode_id_token( openid_configuration=OIDC_CONFIG, jwt_params={"verify_exp": False} ) assert decoded["preferred_username"] == "sirosen2@globusid.org" def test_decode_id_token_with_saved_oidc_config_and_jwk(token_response): decoded = token_response.decode_id_token( openid_configuration=OIDC_CONFIG, jwk=JWK_PEM, jwt_params={"verify_exp": False}, ) assert decoded["preferred_username"] == "sirosen2@globusid.org" def test_invalid_decode_id_token_usage(token_response): with pytest.raises(globus_sdk.exc.GlobusSDKUsageError): token_response.decode_id_token(jwk=JWK_PEM, jwt_params={"verify_exp": False})
49.398496
2,191
0.775951
512
6,570
9.679688
0.355469
0.019774
0.020985
0.021792
0.217716
0.202785
0.168886
0.155165
0.113398
0.113398
0
0.071228
0.13242
6,570
132
2,192
49.772727
0.798246
0.042009
0
0.179245
0
0.009434
0.613745
0.456252
0
1
0
0
0.028302
1
0.066038
false
0
0.04717
0.018868
0.132075
0
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
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
4
f34c3c848bdd3cc564182310a761b4fce9c8255c
256
py
Python
Examples/VAE.py
ngroebner/Autoencoders
49105c4aba2959c6973aeba41b9df4eb012f44ac
[ "MIT" ]
1
2021-07-23T13:07:11.000Z
2021-07-23T13:07:11.000Z
Examples/VAE.py
ngroebner/Autoencoders
49105c4aba2959c6973aeba41b9df4eb012f44ac
[ "MIT" ]
null
null
null
Examples/VAE.py
ngroebner/Autoencoders
49105c4aba2959c6973aeba41b9df4eb012f44ac
[ "MIT" ]
null
null
null
# Example training a variational autoencoder from torch import nn, optim from Autoencoders.encoders import VAEEncoder2DConv from Autoencoders.decoders import Decoder2DConv from Autoencoders.autoencoders import VAE from Autoencoders.losses import vae_loss
32
50
0.867188
31
256
7.129032
0.580645
0.289593
0
0
0
0
0
0
0
0
0
0.008772
0.109375
256
7
51
36.571429
0.960526
0.164063
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f352d65589549d6515055665c0c90018adaf9e44
210
py
Python
src/events/admin.py
lgandersen/bornhack-website
fbda2b4b53dc2cb266d1d7c13ba0aad59d9079df
[ "BSD-3-Clause" ]
7
2017-04-14T15:28:29.000Z
2021-09-10T09:45:38.000Z
src/events/admin.py
lgandersen/bornhack-website
fbda2b4b53dc2cb266d1d7c13ba0aad59d9079df
[ "BSD-3-Clause" ]
799
2016-04-28T09:31:50.000Z
2022-03-29T09:05:02.000Z
src/events/admin.py
lgandersen/bornhack-website
fbda2b4b53dc2cb266d1d7c13ba0aad59d9079df
[ "BSD-3-Clause" ]
35
2016-04-28T09:23:53.000Z
2021-05-02T12:36:01.000Z
from django.contrib import admin from .models import Routing, Type @admin.register(Type) class TypeAdmin(admin.ModelAdmin): pass @admin.register(Routing) class RoutingAdmin(admin.ModelAdmin): pass
15
37
0.766667
26
210
6.192308
0.538462
0.161491
0.236025
0
0
0
0
0
0
0
0
0
0.142857
210
13
38
16.153846
0.894444
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.25
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
f355e68febde3f9099d0e3874d9ef59aa88db7ac
89
py
Python
uitests/apps.py
wichmannpas/todoscheduler-webclient
ee8256b9bc8cba475f18721c92550b3dd9023ca4
[ "Apache-2.0" ]
null
null
null
uitests/apps.py
wichmannpas/todoscheduler-webclient
ee8256b9bc8cba475f18721c92550b3dd9023ca4
[ "Apache-2.0" ]
75
2018-08-20T11:45:14.000Z
2021-03-03T04:16:00.000Z
uitests/apps.py
wichmannpas/todoscheduler-webclient
ee8256b9bc8cba475f18721c92550b3dd9023ca4
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class UiTestsConfig(AppConfig): name = 'uitests'
14.833333
33
0.752809
10
89
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.905405
0
0
0
0
0
0.078652
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
f36f5ab0b5ccdd9f41f2bf5c834616fd658d27b1
197
py
Python
network-automation-fundamentals/unreadable-script.py
omhmichaels/python-network-automation
fd1cfea4b4009b9514668ac53a3e3551669e23f1
[ "BSD-2-Clause" ]
null
null
null
network-automation-fundamentals/unreadable-script.py
omhmichaels/python-network-automation
fd1cfea4b4009b9514668ac53a3e3551669e23f1
[ "BSD-2-Clause" ]
null
null
null
network-automation-fundamentals/unreadable-script.py
omhmichaels/python-network-automation
fd1cfea4b4009b9514668ac53a3e3551669e23f1
[ "BSD-2-Clause" ]
null
null
null
x=input("What is your name:") print ("how are you"+x) y="how are you"+x if ("test1" in y) and ("test2" in y): print ("cool") x=y.split(" ") x=x[2]+"awesome" if ("are" in x): print ("not cool")
32.833333
63
0.573604
40
197
2.825
0.525
0.106195
0.159292
0.176991
0
0
0
0
0
0
0
0.018519
0.177665
197
6
64
32.833333
0.679012
0
0
0
0
0
0.368687
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
f389eb5a2029b39db6c69f210ae655d15b708bc1
1,492
py
Python
storage/memcached/memcached_type.py
DS3Lab/LambdaML
0afca7819e08632ba116fec8e102084e4040a47a
[ "Apache-2.0" ]
23
2021-05-17T09:24:24.000Z
2022-01-29T18:40:44.000Z
storage/memcached/memcached_type.py
DS3Lab/LambdaML
0afca7819e08632ba116fec8e102084e4040a47a
[ "Apache-2.0" ]
2
2021-05-17T16:15:12.000Z
2021-07-20T09:11:22.000Z
storage/memcached/memcached_type.py
DS3Lab/LambdaML
0afca7819e08632ba116fec8e102084e4040a47a
[ "Apache-2.0" ]
3
2021-05-17T09:31:53.000Z
2021-12-02T16:29:59.000Z
from storage.base import BaseStorage from storage.memcached import memcached_operator class MemcachedStorage(BaseStorage): def __init__(self, ip, port=11211): super(MemcachedStorage, self).__init__() self.client = memcached_operator.get_client(ip, port) def save(self, src_data, key, **kwargs): return memcached_operator.set_object(self.client, key, src_data) def save_v2(self, src_data, key, field): return memcached_operator.set_object_v2(self.client, key, field, src_data) def load(self, key, **kwargs): return memcached_operator.get_object(self.client, key) def load_v2(self, key, field): return memcached_operator.get_object_v2(self.client, key, field) def load_or_wait(self, key, sleep_time=0.1, time_out=60): return memcached_operator.get_object_or_wait(self.client, key, sleep_time, time_out) def load_or_wait_v2(self, key, field, sleep_time=0.1, time_out=60): return memcached_operator.get_object_or_wait_v2(self.client, key, field, sleep_time, time_out) def delete(self, key, **kwargs): if isinstance(key, str): return memcached_operator.delete_key(self.client, key) elif isinstance(key, list): return memcached_operator.delete_keys(self.client, key) def clear(self, **kwargs): return memcached_operator.clear_all(self.client) def list(self, keys=[""]): return memcached_operator.list_keys(self.client, keys)
36.390244
102
0.710456
208
1,492
4.822115
0.221154
0.20339
0.229312
0.103689
0.374875
0.167498
0.115653
0.115653
0.115653
0.115653
0
0.015625
0.184987
1,492
40
103
37.3
0.809211
0
0
0
0
0
0
0
0
0
0
0
0
1
0.37037
false
0
0.074074
0.296296
0.851852
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
f3c1fe8ccf238e09fd3e947be49d8f9380494183
28
py
Python
data/studio21_generated/introductory/3109/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/3109/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/3109/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
def scramble_words(words):
14
26
0.785714
4
28
5.25
0.75
0
0
0
0
0
0
0
0
0
0
0
0.107143
28
2
27
14
0.84
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
34116683a42d63256107c74ec42c9adc0be3dedc
131
py
Python
Jasmijn/lists/room_file.py
ArtezGDA/text-IO
b9ed7f2433c0eda08fb45d125ea22a5fdeaef667
[ "MIT" ]
null
null
null
Jasmijn/lists/room_file.py
ArtezGDA/text-IO
b9ed7f2433c0eda08fb45d125ea22a5fdeaef667
[ "MIT" ]
null
null
null
Jasmijn/lists/room_file.py
ArtezGDA/text-IO
b9ed7f2433c0eda08fb45d125ea22a5fdeaef667
[ "MIT" ]
null
null
null
room_jasmijn = {'adress': "Johan de Wittlaan 41", 'postcode':"6828XC", 'city':"Arnhem", 'surface':"30m2" 'doors': 1, 'windows': 2,}
131
131
0.641221
17
131
4.882353
1
0
0
0
0
0
0
0
0
0
0
0.09322
0.099237
131
1
131
131
0.610169
0
0
0
0
0
0.55303
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
343480a25e5d288cf216d07f3b542b7145749386
14,271
py
Python
alntools/cli.py
churchill-lab/alntools
dd9668284a7d924d881e4d39d1841242ef883d9c
[ "MIT" ]
1
2018-03-22T21:52:27.000Z
2018-03-22T21:52:27.000Z
alntools/cli.py
churchill-lab/alntools
dd9668284a7d924d881e4d39d1841242ef883d9c
[ "MIT" ]
8
2018-08-22T16:09:16.000Z
2021-11-15T17:46:56.000Z
alntools/cli.py
churchill-lab/alntools
dd9668284a7d924d881e4d39d1841242ef883d9c
[ "MIT" ]
2
2019-03-10T04:34:16.000Z
2020-06-03T21:30:27.000Z
# -*- coding: utf-8 -*- from __future__ import print_function import glob import os import click from . import bin_utils from . import methods from . import utils from . import viewer from . import __logo_text__, __version__ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @click.group(context_settings=CONTEXT_SETTINGS) @click.version_option(version=__version__, message=__logo_text__) def cli(): """ alntools Utilities for processing and analyzing read alignment profile """ @cli.command('split', options_metavar='<options>', short_help='split a BAM file into smaller bam files') @click.argument('bam_file', metavar='bam_file', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.argument('number', metavar='number', type=int) @click.option('-d', '--directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True, writable=True), help="output directory") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def split(bam_file, number, directory, verbose): """ Split a BAM file into smaller bam files. """ utils.configure_logging(verbose) methods.split_bam(bam_file, number, directory) @cli.command('bam2ec', options_metavar='<options>', short_help='convert a BAM file to EC') @click.argument('bam_file', metavar='bam_file', type=click.Path(exists=True, resolve_path=True, dir_okay=True)) @click.argument('ec_file', metavar='ec_file', type=click.Path(resolve_path=True, dir_okay=False, writable=True)) @click.option('-c', '--chunks', default=0, help="number of chunks to process") @click.option('-d', '--directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True, writable=True), help="temp directory") @click.option('-m', '--mincount', default=1000, help="minimum count") @click.option('--multisample', is_flag=True) @click.option('-p', '--number-processes', default=-1, help="number of processes") @click.option('--rangefile', type=click.Path(exists=False, resolve_path=True, file_okay=True, dir_okay=False, writable=True), help="range file") @click.option('-s', '--sample', help="sample identifier") @click.option('-t', '--targets', metavar='FILE', type=click.Path(exists=True, resolve_path=True, file_okay=True, dir_okay=False), help="target file") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def bam2ec(bam_file, ec_file, chunks, directory, mincount, multisample, number_processes, rangefile, sample, targets, verbose): """ Convert a BAM file (bam_file) to a binary EC file (ec_file) """ utils.configure_logging(verbose) if multisample: if sample: print('-s, --sample should NOT be specified with --multisample') return methods.bam2ec_multisample(bam_file, ec_file, chunks, mincount, directory, number_processes, rangefile, targets) else: methods.bam2ec(bam_file, ec_file, chunks, directory, number_processes, rangefile, sample, targets) @cli.command('bam2emase', options_metavar='<options>', short_help='convert a BAM file to EMASE format') @click.argument('bam_file', metavar='bam_file', type=click.Path(exists=True, resolve_path=True, dir_okay=True)) @click.argument('emase_file', metavar='emase_file', type=click.Path(resolve_path=True, dir_okay=False, writable=True)) @click.option('-c', '--chunks', default=0, help="number of chunks to process") @click.option('-d', '--directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True, writable=True), help="temp directory") @click.option('-m', '--mincount', default=2000, help="minimum count") @click.option('--multisample', is_flag=True) @click.option('-p', '--number-processes', default=-1, help="number of processes") @click.option('--rangefile', type=click.Path(exists=False, resolve_path=True, file_okay=True, dir_okay=False, writable=True), help="range file") @click.option('-t', '--targets', metavar='FILE', type=click.Path(exists=True, resolve_path=True, file_okay=True, dir_okay=False), help="target file") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def bam2emase(bam_file, emase_file, chunks, directory, mincount, multisample, number_processes, rangefile, targets, verbose): """ Convert a BAM file (bam_file) to an EMASE file (emase_file) """ utils.configure_logging(verbose) if multisample: methods.bam2emase_multisample(bam_file, emase_file, chunks, mincount, directory, number_processes, rangefile, targets) else: methods.bam2emase(bam_file, emase_file, chunks, directory, number_processes, rangefile, targets) @cli.command('ec2emase', options_metavar='<options>', short_help='convert a binary EC file to EMASE format') @click.argument('ec_file', metavar='ec_file', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.argument('emase_file', metavar='emase_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.option('-v', '--verbose', count=True, help='enables verbose mode') def ec2emase(ec_file, emase_file, verbose): """ Convert a binary EC format file (ec_file) to EMASE format (emase_file) """ utils.configure_logging(verbose) methods.ec2emase(ec_file, emase_file) @cli.command('emase2ec', options_metavar='<options>', short_help='convert EMASE file to a binary EC format') @click.argument('emase_file', metavar='emase_file', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.argument('ec_file', metavar='ec_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.option('-v', '--verbose', count=True, help='enables verbose mode') def emase2ec(emase_file, ec_file, verbose): """ Convert an EMASE format file (emase_file) to a binary EC format (ec_file) """ utils.configure_logging(verbose) methods.emase2ec(emase_file, ec_file) # @cli.command('bam2both', options_metavar='<options>', short_help='convert a BAM file to EC and Emase') # @click.argument('bam_file', metavar='bam_file', type=click.Path(exists=True, resolve_path=True, dir_okay=True)) # @click.argument('ec_file', metavar='ec_file', type=click.Path(resolve_path=True, dir_okay=False, writable=True)) # @click.argument('emase_file', metavar='emase_file', type=click.Path(resolve_path=True, dir_okay=False, writable=True)) # @click.option('-c', '--chunks', default=0, help="number of chunks to process") # @click.option('-d', '--directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True, writable=True), help="temp directory") # @click.option('-m', '--mincount', default=2000, help="minimum count") # @click.option('--multisample', is_flag=True) # @click.option('-p', '--number-processes', default=-1, help="number of processes") # @click.option('--rangefile', type=click.Path(exists=False, resolve_path=True, file_okay=True, dir_okay=False, writable=True), help="range file") # @click.option('-s', '--sample', help="sample identifier") # @click.option('-t', '--targets', metavar='FILE', type=click.Path(exists=True, resolve_path=True, file_okay=True, dir_okay=False), help="target file") # @click.option('-v', '--verbose', count=True, help='enables verbose mode') # def bam2both(bam_file, ec_file, emase_file, chunks, directory, mincount, multisample, number_processes, rangefile, sample, verbose, targets): # """ # Convert a BAM file (bam_file) to a binary EC file (ec_file) and an EMASE file (emase_file) # """ # utils.configure_logging(verbose) # if multisample: # if sample: # print('-s, --sample should NOT be specified with --multisample') # return # methods.bam2both_multisample(bam_file, ec_file, emase_file, chunks, mincount, directory, number_processes, rangefile, targets) # else: # methods.bam2both(bam_file, ec_file, emase_file, chunks, directory, number_processes, rangefile, sample, targets) @cli.command('salmon2ec', options_metavar='<options>', short_help='convert a salmon eq_classes file to EC') @click.argument('salmon_dir', metavar='salmon_dir', type=click.Path(exists=True, resolve_path=True, dir_okay=True)) @click.argument('ec_file', metavar='ec_file', type=click.Path(resolve_path=True, dir_okay=False, writable=True)) @click.option('-s', '--sample', metavar='sample', default='NA', help="sample identifier") @click.option('-t', '--targets', metavar='FILE', type=click.Path(exists=True, resolve_path=True, file_okay=True, dir_okay=False), help="target file") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def salmon2ec(salmon_dir, ec_file, sample, targets, verbose): """ Convert a salmon eq_classes file to a binary EC file (ec_file) """ utils.configure_logging(verbose) methods.salmon2ec(salmon_dir, ec_file, sample, targets) @cli.command('range', options_metavar='<options>', short_help='get the range of reads aligned to the targets') @click.argument('input', nargs=-1, type=click.Path(resolve_path=True, dir_okay=True)) @click.argument('range_file', metavar='range_file', type=click.Path(exists=False, resolve_path=True, file_okay=True, dir_okay=False, writable=True)) @click.option('-d', '--directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True, writable=True), help="temp directory") @click.option('-t', '--targets', metavar='FILE', type=click.Path(exists=True, resolve_path=True, file_okay=True, dir_okay=False), help="target file") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def range(input, range_file, targets, directory, verbose): """ Create range file for BAM files """ utils.configure_logging(verbose) files = utils.get_bam_files(input) methods.generate_bam_ranges(files, range_file, targets, directory) @cli.command('emase2db_configure', options_metavar='<options>', short_help='configure the multi-read viewer') @click.argument('sample_file', metavar='sample_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.option('-d', '--directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True, writable=False), help="top level input directory") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def emase2db_config(sample_file, directory, verbose): """ Generate config file for the multiread viewer """ utils.configure_logging(verbose) methods.emase2db_config(sample_file, directory) @cli.command('emase2db', options_metavar='<options>', short_help='generate database file for the multi-read viewer') @click.argument('sample_file', metavar='sample_file', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.argument('gene_file', metavar='gene_file', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.argument('db_file', metavar='db_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.option('-v', '--verbose', count=True, help='enables verbose mode') def emase2db(sample_file, gene_file, db_file, verbose): """ Generate database file for the multi-read viewer """ utils.configure_logging(verbose) methods.emase2db(sample_file, gene_file, db_file) @cli.command('view', options_metavar='<options>', short_help='launch the multi-read viewer') @click.argument('db_file', metavar='db_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.option('-p', '--port', default=8888, help="port number") @click.option('-v', '--verbose', count=True, help='enables verbose mode') def v(db_file, port, verbose): """ Launch the multi-read viewer """ utils.configure_logging(verbose) viewer.start(db_file, port) @cli.command('ecdump', options_metavar='<options>', short_help='dump file information') @click.argument('ec_file', metavar='ecfile', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.option('-v', '--verbose', count=True, help='enables verbose mode') def ecdump(ec_file, verbose): """ Print out information about a binary EC file (ec_file) """ utils.configure_logging(verbose) methods.ecdump(ec_file) # @cli.command('ecmerge', options_metavar='<options>', short_help='merge multiple ec files') # @click.option('-i', '--input', metavar='input', type=click.Path(exists=True, resolve_path=True, dir_okay=False), multiple=True, help="input file, can specify multiple") # @click.option('-d', '--directory', metavar='directory', type=click.Path(exists=True, resolve_path=True, file_okay=False, dir_okay=True), help="input directory") # @click.option('-o', '--output', metavar='output', type=click.Path(resolve_path=True, dir_okay=False), help="output file") # @click.option('-v', '--verbose', count=True, help='the more times listed, the more output') # def merge(input, directory, output, verbose): # """ # Combine binary EC files # """ # utils.configure_logging(verbose) # input_files = list(input) # if directory: # bin_files = glob.glob(os.path.join(directory, "*.*")) # if len(bin_files) == 0: # print('No bin files found in directory: {}'.format(directory)) # return None # if input_files is None: # input_files = bin_files # else: # input_files.extend(bin_files) # methods.merge(input_files, output) @cli.command('apply-genotypes', options_metavar='<options>', short_help='remove alignments inconsistent to the genotypes') @click.argument('ec_file', metavar='ec_file', type=click.Path(exists=True, resolve_path=True, dir_okay=False)) @click.argument('gt_file', metavar='gt_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.argument('grp_file', metavar='grp_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.argument('out_file', metavar='out_file', type=click.Path(resolve_path=True, dir_okay=False)) @click.option('-v', '--verbose', count=True, help='enables verbose mode') def apply_genotypes(ec_file, gt_file, grp_file, out_file, verbose): """ Apply genotypes (gt_file) to an alignment profile in a binary EC format (ec_file) """ utils.configure_logging(verbose) methods.apply_genotypes(ec_file, gt_file, grp_file, out_file) if __name__ == '__main__': cli()
54.888462
170
0.722514
1,992
14,271
5.006024
0.089859
0.051845
0.056057
0.049739
0.801344
0.745989
0.726835
0.686121
0.651825
0.630866
0
0.004114
0.114358
14,271
259
171
55.100386
0.784872
0.274473
0
0.389313
0
0
0.205225
0
0
0
0
0
0
1
0.099237
false
0
0.068702
0
0.175573
0.015267
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
34698adc5e916b45087ea8ae56171439a99b1d3a
156
py
Python
app/linear_equations/factorization/__init__.py
sgg10/arsp_solver_api
ad1d2f52eea58338d4f26128d5130eb326d529fb
[ "MIT" ]
null
null
null
app/linear_equations/factorization/__init__.py
sgg10/arsp_solver_api
ad1d2f52eea58338d4f26128d5130eb326d529fb
[ "MIT" ]
null
null
null
app/linear_equations/factorization/__init__.py
sgg10/arsp_solver_api
ad1d2f52eea58338d4f26128d5130eb326d529fb
[ "MIT" ]
null
null
null
from .simple_lu import SimpleLU from .partial_lu import PartialLU from .crout import Croult from .doolittle import Doolittle from .cholesky import Cholesky
26
33
0.839744
22
156
5.863636
0.5
0.124031
0
0
0
0
0
0
0
0
0
0
0.128205
156
5
34
31.2
0.948529
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
cabf3c589066f3600e914199f966db2d8eb5cf10
213
py
Python
day-of-the-week.py
11aparna91/LeetCodesPython
317ddd963122e082ced8a6510bd04255d59b6c35
[ "MIT" ]
1
2021-10-06T00:07:30.000Z
2021-10-06T00:07:30.000Z
day-of-the-week.py
11aparna91/LeetCodesPython
317ddd963122e082ced8a6510bd04255d59b6c35
[ "MIT" ]
null
null
null
day-of-the-week.py
11aparna91/LeetCodesPython
317ddd963122e082ced8a6510bd04255d59b6c35
[ "MIT" ]
null
null
null
########################Problem 1185################################ class Solution: def dayOfTheWeek(self, day: int, month: int, year: int) -> str: return date(year,month,day).strftime("%A")
35.5
68
0.460094
21
213
4.666667
0.761905
0
0
0
0
0
0
0
0
0
0
0.022727
0.173709
213
5
69
42.6
0.534091
0.056338
0
0
0
0
0.013793
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
cae888a4ea86ae9a51120da15e1ffc81f97c6a71
9,310
py
Python
python/sea-level-predictor/test_module.py
dbgeek/freeCodeCamp
39a78ef914c17b751cebf46f0c28e3f75aaef2cb
[ "MIT" ]
null
null
null
python/sea-level-predictor/test_module.py
dbgeek/freeCodeCamp
39a78ef914c17b751cebf46f0c28e3f75aaef2cb
[ "MIT" ]
12
2021-03-06T18:28:14.000Z
2022-02-27T07:23:02.000Z
python/sea-level-predictor/test_module.py
dbgeek/freeCodeCamp
39a78ef914c17b751cebf46f0c28e3f75aaef2cb
[ "MIT" ]
null
null
null
import unittest import sea_level_predictor import matplotlib as mpl # the test case class LinePlotTestCase(unittest.TestCase): def setUp(self): self.ax = sea_level_predictor.draw_plot() def test_plot_title(self): actual = self.ax.get_title() expected = "Rise in Sea Level" self.assertEqual(actual, expected, "Expected line plot title to be 'Rise in Sea Level'") def test_plot_labels(self): actual = self.ax.get_xlabel() expected = "Year" self.assertEqual(actual, expected, "Expected line plot xlabel to be 'Year'") actual = self.ax.get_ylabel() expected = "Sea Level (inches)" self.assertEqual(actual, expected, "Expected line plot ylabel to be 'Sea Level (inches)'") actual = self.ax.get_xticks().tolist() expected = [1850.0, 1875.0, 1900.0, 1925.0, 1950.0, 1975.0, 2000.0, 2025.0, 2050.0, 2075.0] self.assertEqual(actual, expected, "Expected x tick labels to be '1850.0, 1875.0, 1900.0, 1925.0, 1950.0, 1975.0, 2000.0, 2025.0, 2050.0, 2075.0'") def test_plot_data_points(self): actual = self.ax.get_children()[0].get_offsets().data.tolist() expected = [[1880.0, 0.0], [1881.0, 0.22047244100000002], [1882.0, -0.440944881], [1883.0, -0.232283464], [1884.0, 0.590551181], [1885.0, 0.531496062], [1886.0, 0.43700787399999996], [1887.0, 0.216535433], [1888.0, 0.299212598], [1889.0, 0.362204724], [1890.0, 0.440944881], [1891.0, 0.374015748], [1892.0, 0.499999999], [1893.0, 0.6850393690000001], [1894.0, 0.303149606], [1895.0, 0.767716535], [1896.0, 0.46850393700000004], [1897.0, 0.6732283459999999], [1898.0, 1.043307086], [1899.0, 1.338582676], [1900.0, 1.125984251], [1901.0, 1.1102362190000001], [1902.0, 1.291338581], [1903.0, 1.6062992109999998], [1904.0, 1.2007874], [1905.0, 0.9842519679999999], [1906.0, 1.251968503], [1907.0, 1.196850392], [1908.0, 1.098425196], [1909.0, 1.27559055], [1910.0, 1.2716535420000001], [1911.0, 1.598425195], [1912.0, 1.476377951], [1913.0, 1.5472440930000002], [1914.0, 1.795275589], [1915.0, 2.10629921], [1916.0, 2.031496061], [1917.0, 1.854330707], [1918.0, 1.791338581], [1919.0, 1.854330707], [1920.0, 1.905511809], [1921.0, 1.988188974], [1922.0, 1.952755904], [1923.0, 1.999999998], [1924.0, 1.7125984230000002], [1925.0, 1.791338581], [1926.0, 2.0472440919999997], [1927.0, 2.003937006], [1928.0, 1.850393699], [1929.0, 1.905511809], [1930.0, 2.062992124], [1931.0, 2.0472440919999997], [1932.0, 2.271653541], [1933.0, 2.440944879], [1934.0, 2.228346454], [1935.0, 2.448818895], [1936.0, 2.295275588], [1937.0, 2.519685037], [1938.0, 2.6220472409999998], [1939.0, 2.826771651], [1940.0, 2.618110234], [1941.0, 3.098425194], [1942.0, 3.098425194], [1943.0, 3.098425194], [1944.0, 2.84645669], [1945.0, 2.95669291], [1946.0, 3.2519685010000003], [1947.0, 3.374015745], [1948.0, 3.562992122], [1949.0, 3.51181102], [1950.0, 3.598425193], [1951.0, 3.9724409410000003], [1952.0, 3.8700787360000004], [1953.0, 4.043307082], [1954.0, 3.929133854], [1955.0, 3.964566925], [1956.0, 3.763779524], [1957.0, 4.291338578], [1958.0, 4.346456688], [1959.0, 4.358267712], [1960.0, 4.503937003], [1961.0, 4.748031491], [1962.0, 4.543307082], [1963.0, 4.480314956], [1964.0, 4.1692913339999995], [1965.0, 4.6102362160000006], [1966.0, 4.397637791], [1967.0, 4.452755901000001], [1968.0, 4.484251963999999], [1969.0, 4.751968499], [1970.0, 4.67716535], [1971.0, 4.881889759], [1972.0, 5.240157475], [1973.0, 5.003937003], [1974.0, 5.472440939], [1975.0, 5.409448812999999], [1976.0, 5.370078735], [1977.0, 5.303149601], [1978.0, 5.555118105], [1979.0, 5.362204719], [1980.0, 5.5984251910000005], [1981.0, 6.0866141670000005], [1982.0, 5.858267711], [1983.0, 6.188976372000001], [1984.0, 6.153543301], [1985.0, 5.74803149], [1986.0, 5.771653537000001], [1987.0, 5.795275585], [1988.0, 5.980314955], [1989.0, 6.157480308999999], [1990.0, 6.2322834579999995], [1991.0, 6.334645663], [1992.0, 6.35826771], [1993.0, 6.291338576], [1994.0, 6.499999992999999], [1995.0, 6.618110229], [1996.0, 6.787401568], [1997.0, 7.066929127000001], [1998.0, 6.665354324], [1999.0, 7.011811016], [2000.0, 7.062992119], [2001.0, 7.287401567000001], [2002.0, 7.3818897560000005], [2003.0, 7.7598425120000005], [2004.0, 7.740157472000001], [2005.0, 7.74409448], [2006.0, 7.9173228270000005], [2007.0, 7.996062984], [2008.0, 8.350393692], [2009.0, 8.586614164], [2010.0, 8.901574794], [2011.0, 8.96456692], [2012.0, 9.326771643999999], [2013.0, 8.980314951]] self.assertEqual(actual, expected, "Expected different data points in scatter plot.") def test_plot_lines(self): actual = self.ax.get_lines()[0].get_ydata().tolist() expected = [-0.5421240249263661, -0.4790794409142336, -0.41603485690208686, -0.3529902728899543, -0.2899456888778218, -0.22690110486568926, -0.16385652085355673, -0.1008119368414242, -0.037767352829277456, 0.025277231182855076, 0.08832181519498761, 0.15136639920712014, 0.21441098321925267, 0.2774555672313852, 0.34050015124351773, 0.4035447352556645, 0.466589319267797, 0.5296339032799295, 0.5926784872920621, 0.6557230713041946, 0.7187676553163271, 0.7818122393284739, 0.8448568233406064, 0.9079014073527389, 0.9709459913648715, 1.033990575377004, 1.0970351593891365, 1.1600797434012833, 1.2231243274134158, 1.2861689114255483, 1.3492134954376809, 1.4122580794498134, 1.475302663461946, 1.5383472474740927, 1.6013918314862252, 1.6644364154983577, 1.7274809995104903, 1.7905255835226228, 1.8535701675347553, 1.9166147515468879, 1.9796593355590346, 2.042703919571167, 2.1057485035832997, 2.168793087595432, 2.2318376716075647, 2.2948822556196973, 2.357926839631844, 2.4209714236439766, 2.484016007656109, 2.5470605916682416, 2.610105175680374, 2.6731497596925067, 2.7361943437046534, 2.799238927716786, 2.8622835117289185, 2.925328095741051, 2.9883726797531835, 3.051417263765316, 3.1144618477774486, 3.1775064317895954, 3.240551015801728, 3.3035955998138604, 3.366640183825993, 3.4296847678381255, 3.492729351850258, 3.5557739358624048, 3.6188185198745373, 3.68186310388667, 3.7449076878988024, 3.807952271910935, 3.8709968559230674, 3.934041439935214, 3.9970860239473467, 4.060130607959479, 4.123175191971612, 4.186219775983744, 4.249264359995877, 4.312308944008024, 4.375353528020156, 4.438398112032289, 4.501442696044421, 4.564487280056554, 4.627531864068686, 4.690576448080819, 4.7536210320929655, 4.816665616105098, 4.879710200117231, 4.942754784129363, 5.005799368141496, 5.068843952153628, 5.131888536165775, 5.194933120177907, 5.25797770419004, 5.3210222882021725, 5.384066872214305, 5.4471114562264376, 5.510156040238584, 5.573200624250717, 5.636245208262849, 5.699289792274982, 5.762334376287114, 5.825378960299247, 5.8884235443113795, 5.951468128323526, 6.014512712335659, 6.077557296347791, 6.140601880359924, 6.203646464372056, 6.266691048384189, 6.329735632396336, 6.392780216408468, 6.455824800420601, 6.518869384432733, 6.581913968444866, 6.644958552456998, 6.708003136469145, 6.771047720481278, 6.83409230449341, 6.897136888505543, 6.960181472517675, 7.023226056529808, 7.086270640541954, 7.149315224554087, 7.2123598085662195, 7.275404392578352, 7.338448976590485, 7.401493560602617, 7.46453814461475, 7.527582728626896, 7.590627312639029, 7.653671896651161, 7.716716480663294, 7.7797610646754265, 7.842805648687559, 7.905850232699706, 7.968894816711838, 8.03193940072397, 8.094983984736103, 8.158028568748236, 8.221073152760368, 8.284117736772515, 8.347162320784648, 8.41020690479678, 8.473251488808913, 8.536296072821045, 8.599340656833178, 8.66238524084531, 8.725429824857457, 8.78847440886959, 8.851518992881722, 8.914563576893855, 8.977608160905987, 9.040652744918134, 9.103697328930252, 9.166741912942399, 9.229786496954517, 9.292831080966664, 9.35587566497881, 9.41892024899093, 9.481964833003076, 9.545009417015194, 9.608054001027341, 9.671098585039488, 9.734143169051606, 9.797187753063753, 9.860232337075871, 9.923276921088018, 9.986321505100136, 10.049366089112283, 10.11241067312443] self.assertEqual(actual, expected, "Expected different line for first line of best fit.") actual = self.ax.get_lines()[1].get_ydata().tolist() expected = [7.06107985777146, 7.227507131103323, 7.393934404435242, 7.560361677767105, 7.726788951098968, 7.89321622443083, 8.059643497762693, 8.226070771094555, 8.392498044426418, 8.55892531775828, 8.725352591090143, 8.891779864422006, 9.058207137753925, 9.224634411085788, 9.39106168441765, 9.557488957749513, 9.723916231081375, 9.890343504413238, 10.0567707777451, 10.223198051076963, 10.389625324408826, 10.556052597740688, 10.72247987107255, 10.88890714440447, 11.055334417736333, 11.221761691068195, 11.388188964400058, 11.55461623773192, 11.721043511063783, 11.887470784395646, 12.053898057727508, 12.220325331059371, 12.386752604391233, 12.553179877723153, 12.719607151055015, 12.886034424386878, 13.05246169771874, 13.218888971050603, 13.385316244382466, 13.551743517714328, 13.718170791046191, 13.884598064378054, 14.051025337709916, 14.217452611041836, 14.383879884373698, 14.55030715770556, 14.716734431037423, 14.883161704369286, 15.049588977701148, 15.216016251033011] self.assertEqual(actual, expected, "Expected different line for second line of best fit.") if __name__ == "__main__": unittest.main()
227.073171
3,327
0.749624
1,218
9,310
5.703612
0.457307
0.007773
0.012092
0.015114
0.075572
0.055708
0.049086
0.029653
0.014395
0.014395
0
0.703195
0.092374
9,310
40
3,328
232.75
0.118935
0.001396
0
0
0
0.030303
0.047983
0
0
0
0
0
0.212121
1
0.151515
false
0
0.090909
0
0.272727
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
1b1928bd7f08291bf7402da0273dd64cefd5766e
6,236
py
Python
code/python/FactSetSearchAnswers/v1/fds/sdk/FactSetSearchAnswers/models/__init__.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
6
2022-02-07T16:34:18.000Z
2022-03-30T08:04:57.000Z
code/python/FactSetSearchAnswers/v1/fds/sdk/FactSetSearchAnswers/models/__init__.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
2
2022-02-07T05:25:57.000Z
2022-03-07T14:18:04.000Z
code/python/FactSetSearchAnswers/v1/fds/sdk/FactSetSearchAnswers/models/__init__.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
null
null
null
# flake8: noqa # import all models into this package # if you have many models here with many references from one model to another this may # raise a RecursionError # to avoid this, import only the models that you directly need like: # from from fds.sdk.FactSetSearchAnswers.model.pet import Pet # or import this package, but before doing it, use: # import sys # sys.setrecursionlimit(n) from fds.sdk.FactSetSearchAnswers.model.adaptive_card_answer_success_response import AdaptiveCardAnswerSuccessResponse from fds.sdk.FactSetSearchAnswers.model.adaptive_card_data_item import AdaptiveCardDataItem from fds.sdk.FactSetSearchAnswers.model.adaptive_card_with_thumbnail import AdaptiveCardWithThumbnail from fds.sdk.FactSetSearchAnswers.model.answer import Answer from fds.sdk.FactSetSearchAnswers.model.answer_all_of import AnswerAllOf from fds.sdk.FactSetSearchAnswers.model.answer_failure_response import AnswerFailureResponse from fds.sdk.FactSetSearchAnswers.model.answer_without_data import AnswerWithoutData from fds.sdk.FactSetSearchAnswers.model.answer_without_data_all_of import AnswerWithoutDataAllOf from fds.sdk.FactSetSearchAnswers.model.answer_without_data_all_of_template_data import AnswerWithoutDataAllOfTemplateData from fds.sdk.FactSetSearchAnswers.model.application_link import ApplicationLink from fds.sdk.FactSetSearchAnswers.model.change_color import ChangeColor from fds.sdk.FactSetSearchAnswers.model.colored_value import ColoredValue from fds.sdk.FactSetSearchAnswers.model.colored_value_label_date_template import ColoredValueLabelDateTemplate from fds.sdk.FactSetSearchAnswers.model.colored_value_label_date_template_all_of import ColoredValueLabelDateTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.country_id import CountryID from fds.sdk.FactSetSearchAnswers.model.data_answer import DataAnswer from fds.sdk.FactSetSearchAnswers.model.data_answer_data import DataAnswerData from fds.sdk.FactSetSearchAnswers.model.data_answer_success_response import DataAnswerSuccessResponse from fds.sdk.FactSetSearchAnswers.model.data_pair import DataPair from fds.sdk.FactSetSearchAnswers.model.error import Error from fds.sdk.FactSetSearchAnswers.model.error_link import ErrorLink from fds.sdk.FactSetSearchAnswers.model.error_source import ErrorSource from fds.sdk.FactSetSearchAnswers.model.fdc3_context import Fdc3Context from fds.sdk.FactSetSearchAnswers.model.fdc3_country import Fdc3Country from fds.sdk.FactSetSearchAnswers.model.fdc3_instrument import Fdc3Instrument from fds.sdk.FactSetSearchAnswers.model.instrument_id import InstrumentID from fds.sdk.FactSetSearchAnswers.model.label_value_change_label_value_change_template import LabelValueChangeLabelValueChangeTemplate from fds.sdk.FactSetSearchAnswers.model.label_value_change_label_value_change_template_all_of import LabelValueChangeLabelValueChangeTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.link_text_block_template import LinkTextBlockTemplate from fds.sdk.FactSetSearchAnswers.model.link_text_block_template_all_of import LinkTextBlockTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.no_answers_found import NoAnswersFound from fds.sdk.FactSetSearchAnswers.model.no_answers_found_all_of import NoAnswersFoundAllOf from fds.sdk.FactSetSearchAnswers.model.percent_change import PercentChange from fds.sdk.FactSetSearchAnswers.model.percent_change_label_template import PercentChangeLabelTemplate from fds.sdk.FactSetSearchAnswers.model.percent_change_label_template_all_of import PercentChangeLabelTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.ranked_table import RankedTable from fds.sdk.FactSetSearchAnswers.model.ranked_table_entity import RankedTableEntity from fds.sdk.FactSetSearchAnswers.model.ranked_table_row import RankedTableRow from fds.sdk.FactSetSearchAnswers.model.ranked_table_template import RankedTableTemplate from fds.sdk.FactSetSearchAnswers.model.ranked_table_template_all_of import RankedTableTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.table import Table from fds.sdk.FactSetSearchAnswers.model.table_table_template import TableTableTemplate from fds.sdk.FactSetSearchAnswers.model.table_table_template_all_of import TableTableTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.table_template import TableTemplate from fds.sdk.FactSetSearchAnswers.model.table_template_all_of import TableTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.template import Template from fds.sdk.FactSetSearchAnswers.model.template_data import TemplateData from fds.sdk.FactSetSearchAnswers.model.template_with_links import TemplateWithLinks from fds.sdk.FactSetSearchAnswers.model.template_with_links_all_of import TemplateWithLinksAllOf from fds.sdk.FactSetSearchAnswers.model.text_block_footing_template import TextBlockFootingTemplate from fds.sdk.FactSetSearchAnswers.model.text_block_footing_template_all_of import TextBlockFootingTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.titled_text_block import TitledTextBlock from fds.sdk.FactSetSearchAnswers.model.value_change import ValueChange from fds.sdk.FactSetSearchAnswers.model.value_change_date_label_template import ValueChangeDateLabelTemplate from fds.sdk.FactSetSearchAnswers.model.value_change_date_label_template_all_of import ValueChangeDateLabelTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.value_color import ValueColor from fds.sdk.FactSetSearchAnswers.model.value_label_date_data_pair_list_template import ValueLabelDateDataPairListTemplate from fds.sdk.FactSetSearchAnswers.model.value_label_date_data_pair_list_template_all_of import ValueLabelDateDataPairListTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.value_label_date_template import ValueLabelDateTemplate from fds.sdk.FactSetSearchAnswers.model.value_label_date_template_all_of import ValueLabelDateTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.value_label_date_text_block_template import ValueLabelDateTextBlockTemplate from fds.sdk.FactSetSearchAnswers.model.value_label_date_text_block_template_all_of import ValueLabelDateTextBlockTemplateAllOf from fds.sdk.FactSetSearchAnswers.model.value_label_template import ValueLabelTemplate from fds.sdk.FactSetSearchAnswers.model.value_label_template_all_of import ValueLabelTemplateAllOf
82.052632
146
0.903624
754
6,236
7.234748
0.193634
0.08341
0.119157
0.35747
0.618882
0.566086
0.458478
0.335105
0.229881
0.144455
0
0.001184
0.051796
6,236
75
147
83.146667
0.92136
0.059173
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
1b2ea6102d1b33a9916185b30ded6ec372bb42f9
224
py
Python
WMIAdventure/backend/WMIAdventure_backend/battle/businesslogic/recorder/SimplifiedDeck.py
emkarcinos/WMIAdventure
7ca057bb4e4d462b8626d53b66bed86e0125059a
[ "Apache-2.0" ]
2
2021-05-26T15:12:33.000Z
2021-12-09T17:17:19.000Z
WMIAdventure/backend/WMIAdventure_backend/battle/businesslogic/recorder/SimplifiedDeck.py
emkarcinos/WMIAdventure
7ca057bb4e4d462b8626d53b66bed86e0125059a
[ "Apache-2.0" ]
558
2021-05-27T05:41:23.000Z
2022-02-27T21:50:54.000Z
WMIAdventure/backend/WMIAdventure_backend/battle/businesslogic/recorder/SimplifiedDeck.py
emkarcinos/WMIAdventure
7ca057bb4e4d462b8626d53b66bed86e0125059a
[ "Apache-2.0" ]
4
2021-05-26T15:09:29.000Z
2022-03-13T15:28:07.000Z
from battle.businesslogic.recorder.SimplifiedCard import SimplifiedCard class SimplifiedDeck: def __init__(self, deck): self.cards = tuple(list(SimplifiedCard(battle_card) for battle_card in deck.cards_queue))
32
97
0.790179
27
224
6.296296
0.703704
0.117647
0
0
0
0
0
0
0
0
0
0
0.133929
224
6
98
37.333333
0.876289
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
1b33f51cec798ea383ae1418c920a6ce200e793d
64
py
Python
src/fiesta/apps/registry/__init__.py
lerooze/django-fiesta
d521f50bcdd3d40e91f0474ec2fa7e256758e0a5
[ "BSD-3-Clause" ]
null
null
null
src/fiesta/apps/registry/__init__.py
lerooze/django-fiesta
d521f50bcdd3d40e91f0474ec2fa7e256758e0a5
[ "BSD-3-Clause" ]
3
2019-10-29T23:31:01.000Z
2020-03-31T03:08:28.000Z
src/fiesta/apps/registry/__init__.py
lerooze/django-fiesta
d521f50bcdd3d40e91f0474ec2fa7e256758e0a5
[ "BSD-3-Clause" ]
null
null
null
default_app_config = 'fiesta.apps.registry.apps.RegistryConfig'
32
63
0.84375
8
64
6.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0.046875
64
1
64
64
0.852459
0
0
0
0
0
0.625
0.625
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
1b63f93e5702c15732a49a224def488354b18404
83
py
Python
tests/__init__.py
Samantha-uk/cookiecutter-homeassistant-custom-component-instance
808bd30c3095609d9e906f6903deb41f24e8acef
[ "MIT" ]
null
null
null
tests/__init__.py
Samantha-uk/cookiecutter-homeassistant-custom-component-instance
808bd30c3095609d9e906f6903deb41f24e8acef
[ "MIT" ]
131
2020-12-04T06:57:42.000Z
2022-03-30T22:07:29.000Z
tests/__init__.py
Samantha-uk/cookiecutter-homeassistant-custom-component-instance
808bd30c3095609d9e906f6903deb41f24e8acef
[ "MIT" ]
5
2021-01-21T19:27:14.000Z
2022-03-02T15:17:32.000Z
"""Tests for Cookiecutter Home Assistant Custom Component Instance integration."""
41.5
82
0.807229
9
83
7.444444
1
0
0
0
0
0
0
0
0
0
0
0
0.108434
83
1
83
83
0.905405
0.915663
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
1b8aed9b29c570755a838b2807483cd53a500aa4
288,352
py
Python
orca_share_media1528408472708.py
syahraqagr/cobaajacuy
5905d72cefb6a3b19f19a8af95a84669f0750710
[ "BSD-3-Clause" ]
null
null
null
orca_share_media1528408472708.py
syahraqagr/cobaajacuy
5905d72cefb6a3b19f19a8af95a84669f0750710
[ "BSD-3-Clause" ]
null
null
null
orca_share_media1528408472708.py
syahraqagr/cobaajacuy
5905d72cefb6a3b19f19a8af95a84669f0750710
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- import CHROME from CHROME.lib.curve.ttypes import * from datetime import datetime #from Helper.main import qr from time import time from bs4 import BeautifulSoup from threading import Thread from googletrans import Translator from urllib3 import HTTPConnectionPool import time,random,sys,json,codecs,threading,glob,re,subprocess,os,requests,goslate,ctypes import ast import subprocess import urllib import urllib2 import urllib3 import cookielib import wikipedia import shutil cl.loginResult() botStart = time.time() print "login success" reload(sys) sys.setdefaultencoding('utf-8') keyMessage = """╔═══════════════ ║┏━━ೋ• ❄ •ೋ━━━┓ ║ ❁ 🛡 кєи кαиєкι! BOT 🛡 ❁ ║┗━━ೋ• ❄ •ೋ━━━┛ ╠═══════════════ ║「ĸeyword」 ╠═══════════════ ║╔❂͜͡➣「/ѕιderѕ」 ║╠❂͜͡➣「/pυвlιc」 ║╠❂͜͡➣「/ѕearcнιng」 ║╠❂͜͡➣「/newғιтυre」 ║╠❂͜͡➣「/cancel」 ║╠❂͜͡➣「/aвoυт」 ║╚❂͜͡➣「/ĸelυar」 ╚═══════════════ """ newMessage ="""⚘ 🐯 new fiture area 🐯 ⚚ ❂͜͡☆➣ https://tinyurl.com/newfiture (cek disini) ❂͜͡☆➣ https://tinyurl.com/newfiture2 (cek disini) ❂͜͡☆➣ cυaca「naмa ĸoтa」= cek cuaca kota ❂͜͡☆➣ ѕнolaт「naмa ĸoтa」= cek jadwal sholat di kota ❂͜͡☆➣ cpoѕт 「υѕernaмe ιg ĸaмυ」= untuk cek post terakhir mu yang berupa foto ❂͜͡☆➣ cvιd「υѕernaмe ιg ĸaмυ」= untuk cek post terakhir mu yang berupa video ❂͜͡☆➣ ѕcreen 「υѕernaмe ιg ĸaмυ」= untuk screenshoot ig kamu ❂͜͡☆➣ loĸaѕι「yang ιngιn ĸaмυ carι」= υnтυĸ мencarι loĸaѕι ❂͜͡☆➣ /lιrιĸ「jυdυl lagυ」= υnтυĸ мencarι lιrιĸ lagυ ❂͜͡☆➣ /lagυ「jυdυl lagυ」= untuk mencari lagu joox ❂͜͡☆➣ ιnғo ѕaya = вυaт lυcυ lυcυ an ada ιngιn мenyaranĸan ғιтυre? cнaт ĸe http://line.me/ti/p/%40ish7215m""" sidersMessage =""" 🛡 кєи кαиєкι v2! BOT 🛡 ⚘ 🐯 cнecĸ ѕιderѕ area 🐯 ⚚ ❂͜͡☆➣ ѕeтlaѕтpoιnт = cнecĸ ѕιderѕ ❂͜͡☆➣ vιewlaѕтѕeen = cнecĸ ѕιderѕ ❂͜͡☆➣ ѕeтpoιnт = cнecĸ ѕιderѕ ❂͜͡☆➣ read = cнecĸ ѕιderѕ""" publicMessage =""" ⚘ 🐯 pυвlιc area 🐯 ⚚ ❂͜͡☆➣ creaтor = conтacт peмвυaт вoт ❂͜͡☆➣ apaĸaн 「тeхт yang ιngιn ĸaмυ тanyaĸan」 (ѕeperтι ĸerang ajaιв) ❂͜͡☆➣ ĸedapĸedιp「тeхт yang ιngιn dιĸedap ĸedιpĸan」 = coвa aja ❂͜͡☆➣ doѕa @「naмe」 = вυaт lυcυ2an ❂͜͡☆➣ paнala @「naмe」 = вυaт lυcυ2an ❂͜͡☆➣ gcreaтor = мenυnjυĸĸan peмвυaт grυp ❂͜͡☆➣ gιnғo = ιnғo grυp ❂͜͡☆➣ ѕpaмтag @ 「naмe」= ѕpaм yang dιтag ❂͜͡☆➣ /ѕpaм: on/oғғ + jυмlaн + ĸaтa = ѕpaм dengan jυмlaн ĸaтa ❂͜͡☆➣ мenтιon all = мenтιon ѕeмυa ❂͜͡☆➣ мenтιon = мenтιon ѕeмυa ❂͜͡☆➣ тag all = мenтιon ѕeмυa ❂͜͡☆➣ тagall = мenтιon ѕeмυa ❂͜͡☆➣ ѕay = coвa aja ĸeтιĸ ѕay""" searchingMessage =""" ⚘ 🐯 ѕearcнιng area 🐯 ⚚ ❂͜͡☆➣ proғιleιg 「υѕernaмe」 ❂͜͡☆➣ ιnѕтagraм 「υѕernaмe」 ❂͜͡☆➣ .ιnѕтagraм 「υѕernaмe」 ❂͜͡☆➣ wιĸιpedιa 「тeхт」 ❂͜͡☆➣ gιмage「тeхт」 ❂͜͡☆➣ тr-en 「тeхт」 ❂͜͡☆➣ тr-ιd 「тeхт」 ❂͜͡☆➣ ιd@en ❂͜͡☆➣ en@ιd ❂͜͡☆➣ ιd@jp ❂͜͡☆➣ jp@ιd ❂͜͡☆➣ ιd@тн ❂͜͡☆➣ тн@ιd ❂͜͡☆➣ ιd@jp ❂͜͡☆➣ ιd@ar ❂͜͡☆➣ ar@ιd ❂͜͡☆➣ ιd@ĸo ❂͜͡☆➣ ĸo@ιd ❂͜͡☆➣ yт: [jυdυl] ❂͜͡☆➣ ceĸ (тanggal)-(вυlan)-(тaнυn) ❂͜͡☆➣ /ιg 「υѕernaмe」 ❂͜͡☆➣ ѕearcнιd: 「ιd lιne」""" cancelMessage ="""ғιтυr вerѕтaтυѕ oғғlιne!""" welcomeMessage="""тerιмa ĸaѕιн тelaн мengυndang вoт ιnι! ιnvιтe aĸυ ĸe grυp ĸalιan ya :) ⭐ υnтυĸ мengeтaнυι adмιn ĸeтιĸ "creaтor"! ⭐ υnтυĸ мengeтaнυι ғιтυre apa ѕaja darι вoт ιnι ĸeтιĸ "нelp" ⭐ υnтυĸ вoт вeĸerja ѕecara мaхιмal ѕιlaнĸan ιnvιтe creaтor вoт! тнanĸyoυ!❤ """ meMessage="""⭐ нow тo υѕe ιт:: - !say 「тeхт」 - @say 「тeхт」 - #say 「тeхт」 - $say 「тeхт」 - %say 「тeхт」 - ^say 「тeхт」 - &say 「тeхт」 - *say 「тeхт」 - (say 「тeхт」 - )say 「тeхт」 """ sayMessage ="""⭐ Kode Baнaѕa ⭐ aғ : Aғrιĸaanѕ ѕq : Alвanιan ar : Araвιc нy : Arмenιan zн : Cнιneѕe nl : Dυтcн ғr : Frencн de : Gerмan en : Englιѕн ιd : Indoneѕιan ja : Japaneѕe ĸo : Korean ιт : Iтalιan la : Laтιn pт : Porтυgυeѕe ro : Roмanιan rυ : Rυѕѕιan eѕ : Spanιѕн тн : Tнaι vι : Vιeтnaмeѕe ѕυ : ѕυи∂α נω : נαωα ⭐ Tнanĸ Yoυ ⭐ """ mulai = time.time() KAC=[cl] mid = cl.getProfile().mid Bots=[mid] admin=["ub8530f15ff4020c3cc2d1ad2f066aa4b","u5601bdfbc2c67e7adcb95f790127b193"] owner=["ub8530f15ff4020c3cc2d1ad2f066aa4b","u5601bdfbc2c67e7adcb95f790127b193"] protectname=[] wait = { 'contact':False, 'autoJoin':True, 'sticker':False, 'autoCancel':{"on":True,"members":10}, "spam":{}, "detectMention":False, "Members":1, "wordban":{}, 'leaveRoom':True, 'likeOn':True, 'comment1':"Auto Like By http://line.me/ti/p/%40ish7215m", 'timeline':True, 'autoAdd':True, 'atjointicket':True, "alwaysRead":True, "linkticket":False, "cpp":False, "cpg":False, 'message':"тнαикѕ fσя α∂∂ мє! му ¢яєαтσя ιѕ http://line.me/ti/p/%40ish7215m", "lang":"JP", "comment":"тнαикѕ fσя α∂∂ мє! му ¢яєαтσя ιѕ http://line.me/ti/p/%40ish7215m", "commenty":"Auto Like by кєи кαиєкι\n\nhttp://line.me/ti/p/%40ish7215m", "commentOn":True, "commentBlack":{}, "wblack":False, "dblack":False, "clock":False, "cName":" ", "blacklist":{}, "whitelist":{}, "wblacklist":False, "dblacklist":False, "teman":{}, "winvite":False, "likeOn":True, "protection":False, "welcomemsg":True, "welmsg":" welcome to ", "pname":{}, "pro_name":{}, "Pap":{} } wait2 = { 'readPoint':{}, 'readMember':{}, 'setTime':{}, 'ROM':{} } settings = { "userAgent": [ "Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (X11; U; Linux amd64; rv:5.0) Gecko/20100101 Firefox/5.0 (Debian)", "Mozilla/5.0 (X11; U; Linux amd64; en-US; rv:5.0) Gecko/20110619 Firefox/5.0", "Mozilla/5.0 (X11; Linux) Gecko Firefox/5.0", "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 FirePHP/0.5", "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 Firefox/5.0", "Mozilla/5.0 (X11; Linux x86_64) Gecko Firefox/5.0", "Mozilla/5.0 (X11; Linux ppc; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (X11; Linux AMD64) Gecko Firefox/5.0", "Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:5.0) Gecko/20110619 Firefox/5.0", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 6.1.1; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 5.1; U; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 5.0; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0", "Mozilla/5.0 (Windows NT 5.0; rv:5.0) Gecko/20100101 Firefox/5.0" ], "timeRestart": "18000", "simiSimi":{}, "mimic": { "copy": False, "status": False, "target": {} } } cctv = { "cyduk":{}, "point":{}, "sidermem":{} } hasil = { "result":False, "posts":False, "postInfo":False, "liked":{} } wordban = { "kontol":{}, "kontl":{}, "kntl":{}, "memek":{}, "anjing":{}, "njing":{}, "anjeng":{} } setTime = {} setTime = wait2['setTime'] contact = cl.getProfile() backup = cl.getProfile() profile = cl.getProfile() backup.displayName = contact.displayName backup.statusMessage = contact.statusMessage backup.pictureStatus = contact.pictureStatus def sendKontok(self, HelloWorld, midUrang): msg = Message() msg.contentMetadata = {'mid': midUrang} msg.to = HelloWorld msg.contentType = 13 return self.Talk.client.sendMessage(0, msg) def autoRestart(): if time.time() - botStart > int(settings["timeRestart"]): time.sleep(5) restartBot() def sendMentionV2(to, text="", mids=[]): arrData = "" arr = [] mention = "@zeroxyuuki " if mids == []: raise Exception("Invalid mids") if "@!" in text: if text.count("@!") != len(mids): raise Exception("Invalid mids") texts = text.split("@!") textx = "" for mid in mids: textx += str(texts[mids.index(mid)]) slen = len(textx) elen = len(textx) + 15 arrData = {'S':str(slen), 'E':str(elen - 4), 'M':mid} arr.append(arrData) textx += mention textx += str(texts[len(mids)]) else: textx = "" slen = len(textx) elen = len(textx) + 15 arrData = {'S':str(slen), 'E':str(elen - 4), 'M':mids[0]} arr.append(arrData) textx += mention + str(text) cl.sendMessage(to, textx, {'MENTION': str('{"MENTIONEES":' + json.dumps(arr) + '}')}, 0) def restart_program(): python = sys.executable os.execl(python, python, * sys.argv) def download_page(url): version = (3,0) cur_version = sys.version_info if cur_version >= version: #If the Current Version of Python is 3.0 or above import urllib.request #urllib library for Extracting web pages try: headers = {} headers['User-Agent'] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" req = urllib.request.Request(url, headers = headers) resp = urllib.request.urlopen(req) respData = str(resp.read()) return respData except Exception as e: print(str(e)) else: #If the Current Version of Python is 2.x import urllib2 try: headers = {} headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17" req = urllib2.Request(url, headers = headers) response = urllib2.urlopen(req) page = response.read() return page except: return"Page Not found" def _images_get_next_item(s): start_line = s.find('rg_di') if start_line == -1: end_quote = 0 link = "no_links" return link, end_quote else: start_line = s.find('"class="rg_meta"') start_content = s.find('"ou"',start_line+1) end_content = s.find(',"ow"',start_content+1) content_raw = str(s[start_content+6:end_content-1]) return content_raw, end_content def _images_get_all_items(page): items = [] while True: item, end_content = _images_get_next_item(page) if item == "no_links": break else: items.append(item) #Append all the links in the list named 'Links' time.sleep(0.1) #Timer could be used to slow down the request for image downloads page = page[end_content:] return items def sendMessage(to, text, contentMetadata={}, contentType=0): mes = Message() mes.to, mes.from_ = to, profile.mid mes.text = text mes.contentType, mes.contentMetadata = contentType, contentMetadata if to not in messageReq: messageReq[to] = -1 messageReq[to] += 1 def NOTIFIED_READ_MESSAGE(op): print op try: if op.param1 in wait2['readPoint']: Name = cl.getContact(op.param2).displayName if Name in wait2['readMember'][op.param1]: pass else: wait2['readMember'][op.param1] += "\n・" + Name + datetime.now().strftime(' [%d - %H:%M:%S]') wait2['ROM'][op.param1][op.param2] = "・" + Name + " ツ" else: pass except: pass def RECEIVE_MESSAGE(op): msg = op.message try: if msg.contentType == 0: try: if msg.to in wait2['readPoint']: if msg.from_ in wait2["ROM"][msg.to]: del wait2["ROM"][msg.to][msg.from_] else: pass except: pass else: pass except KeyboardInterrupt: sys.exit(0) except Exception as error: print error print ("\n\nRECEIVE_MESSAGE\n\n") return def waktu(secs): mins, secs = divmod(secs,60) hours, mins = divmod(mins,60) return '%02d Jam %02d Menit %02d Detik' % (hours, mins, secs) def upload_tempimage(client): ''' Upload a picture of a kitten. We don't ship one, so get creative! ''' config = { 'album': album, 'name': 'bot auto upload', 'title': 'bot auto upload', 'description': 'bot auto upload' } print("Uploading image... ") image = client.upload_from_path(image_path, config=config, anon=False) print("Done") print() return image def summon(to, nama): aa = "" bb = "" strt = int(14) akh = int(14) nm = nama for mm in nm: akh = akh + 2 aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},""" strt = strt + 6 akh = akh + 4 bb += "\xe2\x95\xa0 @x \n" aa = (aa[:int(len(aa)-1)]) msg = Message() msg.to = to msg.text = "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n"+bb+"\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90" msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+aa+']}','EMTVER':'4'} print "[Command] Tag All" try: cl.sendMessage(msg) except Exception as error: print error def sendMessageWithMention(to, mid): try: aa = '{"S":"0","E":"3","M":'+json.dumps(mid)+'}' text_ = '@x ' msg = Message() msg.contentType = 0 msg.text = text_ msg.contentMetada = {'MENTION':'{"MENTIONEES":['+aa+']}'} cl.sendMessage(msg) except Exception as error: print error def mention(to, nama): aa = "" bb = "" strt = int(14) akh = int(14) nm = nama for mm in nm: akh = akh + 2 aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},""" strt = strt + 6 akh = akh + 4 bb += "\xe2\x95\xa0 @x \n" aa = (aa[:int(len(aa)-1)]) msg = Message() msg.to = to msg.text = "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n"+bb+"\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90" msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+aa+']}','EMTVER':'4'} print "[Command] Tag All" try: cl.sendMessage(msg) except Exception as error: print error def mention(to,nama): aa = "" bb = "" strt = int(12) akh = int(12) nm = nama #print nm for mm in nm: akh = akh + 2 aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},""" strt = strt + 6 akh = akh + 4 bb += "• @c \n" aa = (aa[:int(len(aa)-1)]) msg = Message() msg.to = to msg.text = "「Mention」\n"+bb msg.contentMetadata = {'MENTION':'{"MENTIONEES":['+aa+']}','EMTVER':'4'} #print msg try: cl.sendMessage(msg) except Exception as error: print error def cms(string, commands): #/XXX, >XXX, ;XXX, ^XXX, %XXX, $XXX... tex = ["+","@","/",">",";","^","%","$","^","サテラ:","サテラ:","サテラ:","サテラ:"] for texX in tex: for command in commands: if string ==command: return True return False def yt(query): with requests.session() as s: isi = [] if query == "": query = "S1B nrik" s.headers['user-agent'] = 'Mozilla/5.0' url = 'http://www.youtube.com/results' params = {'search_query': query} r = s.get(url, params=params) soup = BeautifulSoup(r.content, 'html5lib') for a in soup.select('.yt-lockup-title > a[title]'): if '&List' not in a['href']: if 'watch?v' in a['href']: b = a['href'].replace('watch?v=','') isi += ['youtu.be' + b] return isi def bot(op): try: if op.type == 0: return if op.type == 5: if wait["autoAdd"] == True: cl.findAndAddContactsByMid(op.param1) if (wait["message"] in [""," ","\n",None]): pass else: cl.sendText(op.param1,str(wait["message"])) #------------------------------------------- if op.type == 55: try: if cctv['cyduk'][op.param1]==True: if op.param1 in cctv['point']: Name = cl.getContact(op.param2).displayName if Name in cctv['sidermem'][op.param1]: pass else: cctv['sidermem'][op.param1] += "\n• " + Name if " " in Name: nick = Name.split(' ') if len(nick) == 2: cl.sendText(op.param1, "Haii " + "☞ " + nick[0] + " ☜" + "\nNgintip Aja Niih. . .\nChat Kek Idiih (-__-) ") else: cl.sendText(op.param1, "Haii " + "☞ " + nick[1] + " ☜" + "\nBetah Banget Jadi Penonton. . .\nChat Napa (-__-) ") else: cl.sendText(op.param1, "Haii " + "☞ " + Name + " ☜" + "\nNgapain Kak Ngintip Aja?\nSini Gabung Chat... ") else: pass else: pass except: pass if op.type == 55: try: if op.param1 in wait2['readPoint']: Name = cl.getContact(op.param2).displayName if Name in wait2['readMember'][op.param1]: pass else: wait2['readMember'][op.param1] += "\n・ " + Name + datetime.today().strftime(' [%d - %H:%M:%S]') wait2['ROM'][op.param1][op.param2] = "・ " + Name wait2['setTime'][msg.to] = datetime.today().strftime('%Y-%m-%d %H:%M:%S') else: pass except: pass #-------------------NOTIFIED_READ_MESSAGE---------------- if op.type == 55: try: group_id = op.param1 user_id=op.param2 subprocess.Popen('echo "'+ user_id+'|'+str(op.createdTime)+'" >> dataSeen/%s.txt' % group_id, shell=True, stdout=subprocess.PIPE, ) except Exception as e: print e #------------------------------------------ if op.type == 13: print op.param1 print op.param2 print op.param3 if mid in op.param3: G = cl.getGroup(op.param1) if wait["autoJoin"] == True: if wait["autoCancel"]["on"] == True: if len(G.members) <= wait["autoCancel"]["members"]: cl.acceptGroupInvitation(op.param1) c = Message(to=op.param1, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) cl.sendText(op.param1,"мaaғ! мeмвer anda вelυм мencυĸυpι😊 ѕιlaнĸan нυвυngι oa dιaтaѕ!") cl.leaveGroup(op.param1) else: cl.acceptGroupInvitation(op.param1) xname = cl.getContact(op.param2).displayName c = Message(to=op.param1, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) cl.sendText(op.param1, "тerιмa ĸaѕιн "+"@"+xname+" тelaн мengυndang вoт ιnι!\n\nwajιв add oa dιaтaѕ! \nĸeтιĸ нelp υnтυĸ мelιнaт ғιтυre вoт ιnι!") # cl.acceptGroupInvitation(op.param1) # c = Message(to=op.param1, from_=None, text=None, contentType=13) # c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} # cl.sendMessage(c) # cmem = cl.getContacts(op.param2) # mid = cmem.mid # zx = "" # zxc = "тerιмa ĸaѕιн " # zx2 = [] # pesan2 = "@a"" " # xlen = str(len(zxc)) # xlen2 = str(len(zxc)+len(pesan2)-1) # zx = {'S':xlen, 'E':xlen2, 'M':'ub8530f15ff4020c3cc2d1ad2f066aa4b'} # zx2.append(zx) # zxc += pesan2 # msg = Message() # msg.contentType = 0 # msg.text = zxc+" тelaн мengυndang вoт ιnι!\n\nwajιв add oa dιaтaѕ! \nĸeтιĸ нelp υnтυĸ мelιнaт ғιтυre вoт ιnι!" # msg.contentMetadata = {'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')+'}')} # cl.sendMessage(msg) else: cl.acceptGroupInvitation(op.param1) c = Message(to=op.param1, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) cl.sendText(op.param1, "wajιв add oa dιaтaѕ! \nĸeтιĸ нelp υnтυĸ мelιнaт ғιтυre вoт ιnι!") elif wait["autoCancel"]["on"] == True: if len(G.members) <= wait["autoCancel"]["members"]: cl.acceptGroupInvitation(op.param1) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) cl.sendText(op.param1,"мaaғ! мeмвer anda вelυм мencυĸυpι😊 ѕιlaнĸan нυвυngι oa dιaтaѕ!") cl.leaveGroup(op.param1) else: Inviter = op.param3.replace("",',') InviterX = Inviter.split(",") matched_list = [] for tag in wait["blacklist"]: matched_list+=filter(lambda str: str == tag, InviterX) if matched_list == []: pass else: cl.cancelGroupInvitation(op.param1, matched_list) # if op.type == 17: # if wait["welcomemsg"] == True: # if op.param2 not in Bots: # ginfo = cl.getGroup(op.param1) # xcont = cl.getContact(op.param2) # xname = cl.getContact(op.param2).displayName # xlen = str(len(xname)+1) # c = Message(to=op.param1, from_=None, text=None, contentType=13) # c.contentMetadata={'mid':op.param2} # cl.sendMessage(c) # msg = Message(to=op.param1, from_=None, contentType=0) # msg.text = "Hallo @"+xname+ "\nWelcome To ☞ " + str(ginfo.name) + " ☜" + "\nBudayakan Cek Note\nDan Semoga Betah Disini (ノ*>∀<)ノ♡" # msg.contentMetadata ={'MENTION':'{"MENTIONEES":[{"S":"0","E":'+json.dumps(xlen)+',"M":'+json.dumps(xcont.mid)+'}]}','EMTVER':'4'} # cl.sendMessage(msg) # zx = "" # zxc = "Hallo " # zx2 = [] # pesan2 = "@a " # xlen = str(len(zxc)) # xlen2 = str(len(zxc)+len(pesan2)-1) # zx = {'S':xlen, 'E':xlen2, 'M':op.param2} # zx2.append(zx) # zxc += pesan2 + "\nWelcome To ☞ " + str(ginfo.name) + " ☜" + "\nBudayakan Cek Note\nDan Semoga Betah Disini (ノ*>∀<)ノ♡" # msg.text = pesan2+ zxc + "\n🔔 %"%(wait2['setTime'][msg.to],datetime.now().strftime('%H:%M:%S')) # lol ={'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')+'}')} # print lol # msg.contentMetadata = lol # try: # cl.sendMessage(msg) # except Exception as error: # print error # pass # msg.contentMetadata = {'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')+'}')} # cl.sendMessage(msg) if op.type == 17: if wait["welcomemsg"] == True: if op.param2 not in Bots: ginfo = cl.getGroup(op.param1) contact = cl.getContact(op.param2) c = Message(to=op.param1, from_=None, text=None, contentType=13) c.contentMetadata={'mid':op.param2} cl.sendMessage(c) cl.sendText(op.param1,"Hallo " + cl.getContact(op.param2).displayName + "\nWelcome To ☞ " + str(ginfo.name) + " ☜" + "\nBudayakan Cek Note\nDan Semoga Betah Disini (ノ*>∀<)ノ♡") if op.type == 24: if wait["leaveRoom"] == True: cl.leaveRoom(op.param1) if msg.toType == 0: msg.to = msg.from_ if msg.from_ == profile.mid: if "join:" in msg.text: list_ = msg.text.split(":") try: cl.acceptGroupInvitationByTicket(list_[1],list_[2]) X = cl.getGroup(list_[1]) X.preventJoinByTicket = True cl.updateGroup(X) except: cl.sendText(msg.to,"error") # if msg.contentType == 16: # if wait['likeOn'] == True: # url = msg.contentMetadata["postEndUrl"] # cl.like(url[25:58], url[66:], likeType=1005) # cl.comment(url[25:58], url[66:], wait["comment1"]) cl.sendText(msg.to,"Like Success") # wait['likeOn'] = False if op.type == 26: msg = op.message msg.text = str(msg.text) text = msg.text to = msg.to if 'MENTION' in msg.contentMetadata.keys() != None: if wait["detectMention"] == True: cl.sendText(msg.from_, "kenapa tag aku digrup kak?\n\nhttp://line.me/ti/p/%40ish7215m (add)") # xname = cl.getContact(msg.from_).displayName # xlen = str(len(xname)+1) # balas = "@"+xname+" ngapain ya kak? " # msg.to = op.param1 # msg.contentType = 0 # balas = "@"+xname+ " \n Kenapa tag saya di grup? \n", "@"+xname+ " \n jangan tag kalo gamau tanggung jawab :v \n","@"+xname+ " \nada perlu apa yah? \n","@"+xname+ " \n anda siapa ea? \n","@"+xname+ " \n kebiasaan niih suka tag ga jelas \n","@"+xname+ " \n chat disini aja kuy. dari pada tag di gc \n" # msg.contentMetadata ={'MENTION':'{"MENTIONEES":[{"S":"0","E":'+json.dumps(xlen)+',"M":'+json.dumps(msg.from_)+'}]}','EMTVER':'4'} # cl.sendMessage(msg) # c = Message(to=msg.to, from_=None, text=None, contentType=13) # c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} # cl.sendMessage(c) # balas = ["Dont Tag Me!! Im Busy",cName + " Ngapain Ngetag?",cName + " Nggak Usah Tag-Tag! Kalo Penting Langsung Pc Aja","-_-","Alin lagi off", cName + " Kenapa Tag saya?","SPAM PC aja " + cName, "Jangan Suka Tag gua " + cName, "Kamu siapa " + cName + "?", "Ada Perlu apa " + cName + "?","Tenggelamkan tuh yang suka tag pake BOT","Tersummon -_-"] # ret_ = "[Auto Respond] " + random.choice(balas) # name = re.findall(r'@(\w+)', msg.text) # mention = ast.literal_eval(msg.contentMetadata['MENTION']) # mentionees = mention['MENTIONEES'] # for mention in mentionees: # if mention['M'] in Bots: # cl.sendText(msg.to,ret_) # break if msg.toType == 1: if wait["leaveRoom"] == True: cl.leaveRoom(msg.to) if msg.contentType == 16: url = msg.contentMetadata("line://home/post?userMid="+mid+"&postId="+"new_post") cl.like(url[25:58], url[66:], likeType=1001) if op.type == 26: msg = op.message msg.text = str(msg.text) to = msg.to if msg.to in settings["simiSimi"]: if settings["simiSimi"][msg.to] == True: if msg.text is not None: text = msg.text r = requests.get("http://api.ntcorp.us/chatbot/v1/?text=" + text.replace(" ","+") + "&key=beta1.nt") data = r.text data = json.loads(data) if data['status'] == 200: if data['result']['result'] == 100: cl.sendText(msg.to, "[ChatBOT] " + data['result']['response'].encode('utf-8')) if op.type == 26: msg = op.message msg.text = str(msg.text) to = msg.to if msg.contentType == 13: if wait["wblack"] == True: if msg.contentMetadata["mid"] in wait["commentBlack"]: cl.sendText(msg.to,"already") wait["wblack"] = False else: wait["commentBlack"][msg.contentMetadata["mid"]] = True wait["wblack"] = False cl.sendText(msg.to,"decided not to comment") elif wait["dblack"] == True: if msg.contentMetadata["mid"] in wait["commentBlack"]: del wait["commentBlack"][msg.contentMetadata["mid"]] cl.sendText(msg.to,"deleted") wait["dblack"] = False else: wait["dblack"] = False cl.sendText(msg.to,"It is not in the black list") elif wait["wblacklist"] == True: if msg.contentMetadata["mid"] in wait["blacklist"]: cl.sendText(msg.to,"already") cl.sendText(msg.to,"already") wait["wblacklist"] = False else: wait["blacklist"][msg.contentMetadata["mid"]] = True wait["wblacklist"] = False cl.sendText(msg.to,"aded") elif wait["dblacklist"] == True: if msg.contentMetadata["mid"] in wait["blacklist"]: del wait["blacklist"][msg.contentMetadata["mid"]] cl.sendText(msg.to,"deleted") wait["dblacklist"] = False else: wait["dblacklist"] = False cl.sendText(msg.to,"It is not in the black list") elif wait["contact"] == True: msg.contentType = 0 cl.sendText(msg.to,msg.contentMetadata["mid"]) if 'displayName' in msg.contentMetadata: contact = cl.getContact(msg.contentMetadata["mid"]) try: cu = cl.channel.getCover(msg.contentMetadata["mid"]) except: cu = "" cl.sendText(msg.to,"⎈ Profile Name :\n" + msg.contentMetadata["displayName"] + "\n\n⎈ Mid :\n" + msg.contentMetadata["mid"] + "\n\n⎈ Status Message :\n" + contact.statusMessage + "\n\n⎈ Pict Status :\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n\n⎈ Cover Status :\n" + str(cu)) else: contact = cl.getContact(msg.contentMetadata["mid"]) try: cu = cl.channel.getCover(msg.contentMetadata["mid"]) except: cu = "" cl.sendText(msg.to,"⎈ Profile Name :\n" + msg.contentMetadata["displayName"] + "\n\n⎈ Mid :\n" + msg.contentMetadata["mid"] + "\n\n⎈ Status Message :\n" + contact.statusMessage + "\n\n⎈ Pict Status :\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n\n⎈ Cover Status :\n" + str(cu)) elif msg.contentType == 7: if wait['sticker'] == True: stk_id = msg.contentMetadata['STKID'] stk_ver = msg.contentMetadata['STKVER'] pkg_id = msg.contentMetadata['STKPKGID'] filler = "『 Sticker Check 』\nSTKID : %s\nSTKPKGID : %s\nSTKVER : %s\n『 Link 』\nline://shop/detail/%s" % (stk_id,pkg_id,stk_ver,pkg_id) cl.sendText(msg.to, filler) else: pass elif msg.contentType == 1: if msg.from_ in admin: if msg.toType == 2: if wait["cpg"] == True: path = cl.downloadObjectMsgId(msg.id) wait["cpg"] = False cl.updateGroupPicture(msg.to, path) cl.sendText(msg.to,"Foto grup telah di perbaharui !") if wait["cpp"] == True: path = cl.downloadObjectMsgId(msg.id) wait["cpp"] = False cl.updateProfilePicture(path) cl.sendText(msg.to, "success change profile picture") elif msg.contentType == 16: if wait["Timeline"] == True: msg.contentType = 0 msg.text = "post URL\n" + msg.contentMetadata["postEndUrl"] cl.sendText(msg.to,msg.text) #-----------INFO GROUP CREATOR---------------# elif msg.text in ["Accept invite"]: if msg.from_ in admin: gid = cl.getGroupIdsInvited() _list = "" for i in gid: if i is not None: gids = cl.getGroup(i) _list += gids.name cl.acceptGroupInvitation(i) else: break if gid is not None: cl.sendText(msg.to,"Berhasil terima semua undangan dari grup :\n" + _list) else: cl.sendText(msg.to,"Tidak ada grup yang tertunda saat ini") elif "Oa" in msg.text: if msg.from_ in admin: Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) elif "Ayat:" in msg.text: try: sep = text.split(" ") ayat = text.replace(sep[0] + " ","") path = "http://islamcdn.com/quran/media/audio/ayah/ar.alafasy/" + ayat cl.sendAudioWithURL(msg.to, path) except Exception as error: cl.sendText(msg.to, str(error)) elif "Jadwal: " in msg.text: try: txt = msg.text.split(" ") teks = msg.text.replace("Jadwal: "+txt[1]+" ","") response = requests.get("https://farzain.xyz/api/premium/acaratv.php?apikey=kanekipubot&id="+txt[1]+"") data = response.json() pictig = str(data['status']) hasil = str(data['url']) text = "Status : "+pictig+"\n"+hasil+"" cl.sendText(msg.to, text) except Exception as e: cl.sendText(msg.to, str(e)) elif "Call: " in msg.text: no = msg.text.replace("Call: ","") r = requests.get("http://apisora.herokuapp.com/prank/call/?no="+str(no)) data = r.json() result = data["result"].replace('</br>', '\n') tgb = "[ Prank Call ]\n\n" tgb += "Status: "+str(data["status"])+"\n" tgb += "Result "+str(result)+"\n\n[ Finish ]" cl.sendText(msg.to,str(tgb)) Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) #elif '/login chrome ' in msg.text.lower: # user = msg.text.replace('/login chrome ',' ') # data = { # 'nama' : '{}'.format(user), # 'sumbit1' : ' ' # } # link = 'https://lazybot.us/snip/' # r = requests.post(url = link, data = data) #qr = r.text #cl.sendMessage(msg.to, "{}".format(qr)) # elif '/done ' in msg.text.lower: # user = msg.text.replace('/done ',' ') # r = requests.get('https://206.189.95.201/token-{}.text' .format(user)) # token = r.text #cl.sendMessage(msg.from_, "{}".format(token)) elif "Sms: " in msg.text: try: txt = msg.text.split(" ") teks = msg.text.replace("Sms: "+txt[1]+" ","") response = requests.get("http://corrykalam.gq/sms.php?no="+txt[1]+"&text="+teks+"") data = response.json() pictig = str(data['status']) hasil = str(data['detail']) text = "Status : "+pictig+"\n\n"+hasil+"" cl.sendText(msg.to, text) Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) except Exception as e: cl.sendText(msg.to, str(e)) elif "detectout" in msg.text: if msg.from_ in admin: groups = cl.getGroupIdsJoined() for group in groups: G = cl.getGroup(group) if len(G.members) <= wait["autoCancel"]["members"]: c = Message(to=group, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) cl.sendText(group,"мaaғ! мeмвer anda вelυм мencυĸυpι😊 ѕιlaнĸan нυвυngι oa dιaтaѕ!") cl.leaveGroup(group) elif "meme: " in msg.text.lower(): try: txt = msg.text.split(" ") teks = msg.text.lower().replace("meme: "+txt[1]+" ","") data = [] r = requests.get("http://captaintools.tk/bot.php") r = eval(r.text) for a in r: data.append(a) c = random.choice(data) foto = "https://memegen.link/"+c+"/"+txt[1]+"/"+teks+".jpg" cl.sendImageWithURL(msg.to, foto) except Exception as e: cl.sendText(msg.to, str(e)) elif "Short: " in msg.text: no = msg.text.replace("Short: ","") r = requests.get("https://short.helloworld404.me/api/?key=Y2hXOO8wTHGJ&url="+str(no)) data = r.json() result = data["short"] tgb = "[ Shorten URL ]\n\n" tgb += "Result: "+str(result)+"\n\n[ Finish ]" cl.sendText(msg.to,str(tgb)) Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) elif "Playstore " in msg.text.lower(): tob = msg.text.lower().replace("Playstore ","") cl.sendText(msg.to,"Loading") cl.sendText(msg.to,"Title : "+tob+"\nSource : Google Play\nLinknya : https://play.google.com/store/search?q=" + tob) cl.sendText(msg.to,"Done") elif "Retro: " in msg.text: try: txt = msg.text.split(" ") teks = msg.text.replace("Retro: "+txt[1]+" ","") satu = ["1","2","3","4","5"] dua = ["1","2","3","4"] k = random.choice(satu) w = random.choice(dua) response = requests.get("http://corrykalam.gq/retrowave.php?text1="+txt[1]+"&text2="+teks+"&text3=&btype="+k+"&ttype="+w+"") data = response.json() hasil = str(data['image']) download = str(data['image']) cl.sendText(msg.to, download) cl.sendImageWithURL(msg.to, hasil) Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) except Exception as e: cl.sendText(msg.to, str(e)) elif "Pcid: " in msg.text: txt = msg.text.split(" ") teks = msg.text.replace("Pcid: "+txt[1]+" ","") x = cl.findContactsByUserid(txt[1]) a = cl.getContact(msg.from_) cl.sendText(x.mid,"Anda mendapatkan pesan dari "+a.displayName+"\n\n"+teks) cl.sendText(msg.to,"Sukses mengirim pesan ke "+x.displayName+"\nDari: "+a.displayName+"\nPesan: "+teks) Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) elif "Gbcon: " in msg.text: if msg.from_ in admin: print "[Group Broadcast Execute]" n = cl.getGroupIdsJoined() y = msg.text.split(" ") k = msg.text.replace("Gbcon: "+y[1]+" ","") Oa = y[1] for people in n: cl.sendKontok(people, Oa) elif "Fs: " in msg.text: try: txt = msg.text.split(" ") teks = msg.text.replace("Fs: "+txt[1]+" ","") response = requests.get("https://farzain.xyz/api/premium/fs.php?apikey=kanekipubot&id="+txt[1]+"") data = response.json() pictig = str(data['status']) hasil = str(data['url']) text = "Status : "+pictig+"" cl.sendText(msg.to, text) cl.sendImageWithURL(msg.to, hasil) Oa = 'ud4082219b6754e7b610f84d07d3b436b' cl.sendKontok(msg.to, Oa) except Exception as e: cl.sendText(msg.to, str(e)) elif "/apakah " in msg.text: if msg.from_ in admin: apk = msg.text.replace("/apakah ","") rnd = ["Ya","Tidak","Bisa Jadi","Mungkin"] p = random.choice(rnd) lang = 'id' tts = gTTS(text=p, lang=lang) tts.save("hasil.mp3") cl.sendAudio(msg.to,"hasil.mp3") elif "/hari " in msg.text: if msg.from_ in admin: apk = msg.text.replace("/hari ","") rnd = ["Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"] p = random.choice(rnd) lang = 'id' tts = gTTS(text=p, lang=lang) tts.save("hasil.mp3") cl.sendAudio(msg.to,"hasil.mp3") elif "/berapa " in msg.text: if msg.from_ in admin: apk = msg.text.replace("/berapa ","") rnd = ['10%','20%','30%','40%','50%','60%','70%','80%','90%','100%','0%'] p = random.choice(rnd) lang = 'id' tts = gTTS(text=p, lang=lang) tts.save("hasil.mp3") cl.sendAudio(msg.to,"hasil.mp3") elif "/berapakah " in msg.text: apk = msg.text.replace("/berapakah ","") rnd = ['1','2','3','4','5','6','7','8','9','10','Tidak Ada'] p = random.choice(rnd) lang = 'id' tts = gTTS(text=p, lang=lang) tts.save("hasil.mp3") cl.sendAudio(msg.to,"hasil.mp3") elif "/kapan " in msg.text: apk = msg.text.replace("/kapan ","") rnd = ["kapan kapan","besok","satu abad lagi","Hari ini","Tahun depan","Minggu depan","Bulan depan","Sebentar lagi","Tidak Akan Pernah"] p = random.choice(rnd) lang = 'id' tts = gTTS(text=p, lang=lang) tts.save("hasil.mp3") cl.sendAudio(msg.to,"hasil.mp3") elif msg.text in ["Gcreator"]: if msg.toType == 2: msg.contentType = 13 ginfo = cl.getGroup(msg.to) gCreator = ginfo.creator.mid try: msg.contentMetadata = {'mid': gCreator} gCreator1 = ginfo.creator.displayName except: gCreator = "Error" cl.sendText(msg.to, "Group Creator : " + gCreator1) cl.sendMessage(msg) #-----------INFO GROUP CREATOR---------------# elif msg.text in ["Blocklist"]: blockedlist = cl.getBlockedContactIds() kontak = cl.getContacts(blockedlist) num=1 msgs="═════════List Blocked═════════" for ids in kontak: msgs+="\n[%i] %s" % (num, ids.displayName) num=(num+1) msgs+="\n═════════List Blocked═════════\n\nTotal Blocked : %i" % len(kontak) cl.sendText(msg.to, msgs) elif msg.text in ["Gruplist"]: gruplist = cl.getGroupIdsJoined() kontak = cl.getGroups(gruplist) num=1 msgs="═════════List Grup═════════" for ids in kontak: msgs+="\n[%i] %s" % (num, ids.name) num=(num+1) msgs+="\n═════════List Grup═════════\n\nTotal Grup : %i" % len(kontak) cl.sendText(msg.to, msgs) elif msg.text in ["Gruplistmid"]: gruplist = cl.getGroupIdsJoined() kontak = cl.getGroups(gruplist) num=1 msgs="═════════List GrupMid═════════" for ids in kontak: msgs+="\n[%i] %s" % (num, ids.id) num=(num+1) msgs+="\n═════════List GrupMid═════════\n\nTotal Grup : %i" % len(kontak) cl.sendText(msg.to, msgs) elif msg.text in ["Up","up","Up Chat","Up chat","up chat","Upchat","upchat"]: if msg.from_ in admin: cl.sendText(msg.to,"Aku belum mandi") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Tapi masih cantik juga") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"apalagi kalau sudah mandi") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Pasti cantik sekali") cl.sendText(msg.to,"yiha") cl.sendText(msg.to,"Kalau orang lain melihatku") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Badak aku taba bana") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Tak tuntuang") cl.sendText(msg.to,"Tapi kalau langsuang diidu") cl.sendText(msg.to,"Tak tun tuang") cl.sendText(msg.to,"Atagfirullah baunya") cl.sendText(msg.to,"Males lanjutin ah") cl.sendText(msg.to,"Sepi bat") cl.sendText(msg.to,"Iya sepi udah udah") cl.sendText(msg.to,"Gaada yang denger juga kita nyanyi") cl.sendText(msg.to,"Nah") cl.sendText(msg.to,"Mending gua makan dulu") cl.sendText(msg.to,"Siyap") cl.sendText(msg.to,"Okeh") cl.sendText(msg.to,"Katanya owner kita Jomblo ya") cl.sendText(msg.to,"Iya emang") cl.sendText(msg.to,"Denger denger si lagi nyari pacar doi") cl.sendText(msg.to,"Udah ah gosip mulu doain aja biar dapet") #-------------Fungsi Spam Finish---------------------# elif "Info saya" in msg.text: kelamin = ("Waria","Laki-laki","Perempuan","Tidak Diketahui","Bencong") wajah = ("Standar","Ganteng","Cantik","Beruk","Hancur") status = ("Menikah","Pacaran","Jones") k = random.choice(kelamin) w = random.choice(wajah) s = random.choice(status) cl.sendText(msg.to,"• Nama : "+cl.getContact(msg.from_).displayName+"\n• Kelamin : "+k+"\n• Wajah : "+w+"\n• Status Kehidupan : "+s) #-------------Fungsi Pap-----------------------------# elif "Blacklist all" in msg.text: if msg.from_ in admin: if msg.toType == 2: print "ok" _name = msg.text.replace("Blacklist all","") gs = cl.getGroup(msg.to) cl.sendText(msg.to,"Semua Telah Di Hapus") targets = [] for g in gs.members: if _name in g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Maaf") else: for target in targets: if not target in Bots: try: wait["blacklist"][target] = True f=codecs.open('st2__b.json','w','utf-8') json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) cl.sendText(msg.to,"Success Boss") except: cl.sentText(msg.to,"Berhasil Dihapus") elif "Unban all" in msg.text: if msg.from_ in admin: if msg.toType == 2: print "[Unban]ok" _name = msg.text.replace("Unban all","") gs = cl.getGroup(msg.to) cl.sendText(msg.to,"Semua Telah Di Hapus") targets = [] for g in gs.members: if _name in g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Tidak Ada Boss Syahraqa") else: for target in targets: try: del wait["blacklist"][target] f=codecs.open('st2__b.json','w','utf-8') json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) except: cl.sendText(msg.to,"Done Boss Syahraqa") elif "Gimage " in msg.text: googl = msg.text.replace("Gimage ","") url = 'https://www.google.com/search?hl=en&biw=1366&bih=659&tbm=isch&sa=1&ei=vSD9WYimHMWHvQTg_53IDw&q=' + googl raw_html = (download_page(url)) items = [] items = items + (_images_get_all_items(raw_html)) path = random.choice(items) try: start = time.time() cl.sendImageWithURL(msg.to,random.choice(items)) cl.sendImageWithURL(msg.to,random.choice(items)) cl.sendImageWithURL(msg.to,random.choice(items)) cl.sendText(msg.to,"Total Image Links ="+str(len(items))) except Exception as njer: cl.sendText(msg.to, str(njer)) elif "Pap set:" in msg.text: wait["Pap"] = msg.text.replace("Pap set:","") cl.sendText(msg.to,"Pap Has Ben Set To") elif msg.text in [".Pap","Pap"]: cl.sendImageWithURL(msg.to,wait["Pap"]) #-------------Fungsi Pap-----------------------------# #---------------Mention Tag--------------------------# elif "!say " in msg.text.lower(): query = msg.text.replace("!say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'af', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Surat:" in msg.text.lower(): try: sep = msg.text.split(" ") surah = int(text.lower().replace(sep[0] + " ","")) if 0 < surah < 115: if surah not in [2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 16, 17, 18, 20, 21, 23, 26, 37]: if len(str(surah)) == 1: audionya = "https://audio5.qurancentral.com/mishary-rashid-alafasy/mishary-rashid-alafasy-00" + str(surah) + "-muslimcentral.com.mp3" cl.sendAudioWithURL(msg.to, audionya) elif len(str(surah)) == 2: audionya = "https://audio5.qurancentral.com/mishary-rashid-alafasy/mishary-rashid-alafasy-0" + str(surah) + "-muslimcentral.com.mp3" cl.sendAudioWithURL(msg.to, audionya) else: audionya = "https://audio5.qurancentral.com/mishary-rashid-alafasy/mishary-rashid-alafasy-" + str(surah) + "-muslimcentral.com.mp3" cl.sendAudioWithURL(msg.to, audionya) else: cl.sendText(msg.to, "Surah terlalu panjang") else: cl.sendText(msg.to, "Quran hanya 114 surah") except Exception as error: cl.sendText(msg.to, "error\n"+str(error)) elif "neon: " in msg.text.lower(): try: txt = msg.text.split(" ") teks = msg.text.lower().replace("neon: ","") color = ["red","yellow","green","purple","violet","blue"] k = random.choice(color) foto = "https://ari-api.herokuapp.com/neon?text="+teks+"&color="+k+"" cl.sendImageWithURL(msg.to, foto) except Exception as e: cl.sendText(msg.to, str(e)) elif "@say " in msg.text.lower(): query = msg.text.replace("@say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'sq', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "#say " in msg.text.lower(): query = msg.text.replace("#say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'ar', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "$say " in msg.text.lower(): query = msg.text.replace("$say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'hy', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "%say " in msg.text.lower(): query = msg.text.replace("%say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'zh', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "^say " in msg.text.lower(): query = msg.text.replace("^say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'nl', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "&say " in msg.text.lower(): query = msg.text.replace("&say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'fr', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "*say " in msg.text.lower(): query = msg.text.replace("*say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'de', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "(say " in msg.text.lower(): query = msg.text.replace("(say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'en', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif ")say " in msg.text.lower(): query = msg.text.replace(")say ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'id', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-ja " in msg.text.lower(): query = msg.text.replace("Say-ja ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'ja', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-ko " in msg.text.lower(): query = msg.text.replace("Say-ko ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'ko', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-it " in msg.text.lower(): query = msg.text.replace("Say-it ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'it', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-la " in msg.text.lower(): query = msg.text.replace("Say-la ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'la', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Halo" in msg.text: if msg.from_ in admin: sendMentionV2(op.param1, "Halo @! juga", [op.param2]) elif "Say-pt " in msg.text.lower(): query = msg.text.replace("Say-pt ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'pt', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-ro " in msg.text.lower(): query = msg.text.replace("Say-ro ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'ro', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-ru " in msg.text.lower(): query = msg.text.replace("Say-ru ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'ru', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-es " in msg.text.lower(): query = msg.text.replace("Say-es ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'es', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-th " in msg.text.lower(): query = msg.text.replace("Say-th ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'th', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-vi " in msg.text.lower(): query = msg.text.replace("Say-vi ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'vi', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-jw " in msg.text.lower(): query = msg.text.replace("Say-jw ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'jw', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "Say-su " in msg.text.lower(): query = msg.text.replace("Say-su ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0' url = 'https://google-translate-proxy.herokuapp.com/api/tts' params = {'language': 'su', 'speed': '1', 'query': query} r = s.get(url, params=params) mp3 = r.url cl.sendAudioWithURL(msg.to, mp3) elif "@🎋Syahraqaa🐾" in msg.text: tanya = msg.text.replace("@🎋Syahraqaa🐾 ","") jawab = ("Jangan Tag Si 🎋Syahraqaa🐾!!","Berisik jangan tag si 🎋Syahraqaa🐾 dia masih tidur") jawaban = random.choice(jawab) cl.sendText(msg.to,jawaban) #---------------Mention Tag--------------------------# #---------------STALK--------------------------------# # elif "Stalk " in msg.text: # print "[Command]Stalk executing" # stalkID = msg.text.replace("Stalk ","") # subprocess.call(["instaLooter",stalkID,"tmp/","-n","1"]) # files = glob.glob("tmp/*.jpg") # for file in files: # os.rename(file,"tmp/tmp.jpg") # fileTmp = glob.glob("tmp/tmp.jpg") # if not fileTmp: # cl.sendText(msg.to, "Image not found, maybe the account haven't post a single picture or the account is private") # print "[Command]Stalk executed - no image found" # else: # image = upload_tempimage(client) # cl.sendText(msg.to, format(image['link'])) # subprocess.call(["sudo","rm","-rf","tmp/tmp.jpg"]) # print "[Command]Stalk executed - succes" #---------------STALK--------------------------------# #-------------------FUNGSI RESTART---------------------# elif msg.text in ["restart"]: if msg.from_ in admin: cl.sendText(msg.to, "Tunggu Sebentar..") cl.sendText(msg.to, "Bot has been restarted") restart_program() print "@Restart" else: cl.sendText(msg.to, "No Access") #-------------------FUNGSI RESTART---------------------# elif msg.text in ["Kreator"]: msg.contentType = 13 msg.contentMetadata = {'mid': mid} cl.sendMessage(msg) jawab = ("This is my Creator","My creator is handsome","My creator is cool") jawaban = random.choice(jawab) tts = gTTS(text=jawaban, lang='en') tts.save('tts.mp3') cl.sendAudio(msg.to,'tts.mp3') #----------------------------------------------- elif "Cek " in msg.text: tanggal = msg.text.replace("Cek ","") r=requests.get('http://script.google.com/macros/exec?service=AKfycbw7gKzP-WYV2F5mc9RaR7yE3Ve1yN91Tjs91hp_jHSE02dSv9w&nama=ervan&tanggal='+tanggal) data=r.text data=json.loads(data) lahir = data["data"]["lahir"] usia = data["data"]["usia"] ultah = data["data"]["ultah"] zodiak = data["data"]["zodiak"] cl.sendText(msg.to,"Tanggal Lahir: "+lahir+"\n\nUsia: "+usia+"\n\nUltah: "+ultah+"\n\nZodiak: "+zodiak) elif "Pict group " in msg.text: saya = msg.text.replace('Pict group ','') gid = cl.getGroupIdsJoined() for i in gid: h = cl.getGroup(i).name gna = cl.getGroup(i) if h == saya: cl.sendImageWithURL(msg.to,"http://dl.profile.line.naver.jp/"+ gna.pictureStatus) #------------------------CHECK SYSTEM------------------------# elif msg.text.lower().startswith("story "): sep = msg.text.replace("story ","") url = "http://rahandiapi.herokuapp.com/instastory/"+sep+"?key=betakey" with requests.session() as web: web.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" r = web.get(url) data = r.text data = json.loads(data) if data["url"] != []: items = data["url"]["link"] cl.sendImageWithURL(msg.to, items) elif msg.text.lower().startswith("sholat "): location = msg.text.replace("sholat ","") params = {'lokasi':location} with requests.session() as web: r = requests.get("http://api.corrykalam.net/apisholat.php?" + urllib.urlencode(params)) data = r.text data = json.loads(data) if data[1] != "Subuh : " and data[2] != "Dzuhur : " and data[3] != "Ashr : " and data[4] != "Maghrib : " and data[5] != "Isha : ": ret_ = "[ Prayer Schedule ]" ret_ += "\n\nLocation : " + data[0] ret_ += "\n" + data[1] ret_ += "\n" + data[2] ret_ += "\n" + data[3] ret_ += "\n" + data[4] ret_ += "\n" + data[5] else: ret_ = "[ Prayer Schedule ] Error : Location not found" cl.sendText(msg.to, str(ret_)) elif msg.text.lower().startswith("lokasi "): location = msg.text.lower().replace("lokasi ","") params = {'lokasi':location} with requests.session() as web: web.headers["user-agent"] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" r = requests.get("http://api.corrykalam.net/apiloc.php?"+ urllib.urlencode(params)) data = r.text data = json.loads(data) if data[0] != "" and data[1] != "" and data[2] != "": link = "https://www.google.co.id/maps/@{},{},15z".format(str(data[1]), str(data[2])) ret_ = "[ Details Location ]" ret_ += "\n\nLocation : " + data[0] ret_ += "\nGoogle Maps : " + link else: ret_ = "[ Details Location ] Error : Location not found" cl.sendText(msg.to, str(ret_)) elif msg.text.lower().startswith("twitter "): user = msg.text.lower().replace("twitter ","") with requests.session() as s: s.headers['user-agent'] = 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0' url = 'https://twitter.com/'+user r = s.get(url) soup = BeautifulSoup(r.content, 'html5lib') hasil = soup.select_one('.ProfileHeaderCard') hasil = hasil.findAll(msg.text) tweet = soup.find('span', class_ = 'ProfileNav-value').get_text() fllwng = soup.find('li', class_ = 'ProfileNav-item ProfileNav-item--following').get_text() fllwr = soup.find('li', class_ = 'ProfileNav-item ProfileNav-item--followers').get_text() fav = soup.find('li', class_ = 'ProfileNav-item ProfileNav-item--favorites').get_text() img = soup.find('img', class_ = 'ProfileAvatar-image') cl.sendImageWithURL(msg.to,img['src']) cl.sendMessage(msg.to,'Name: '+hasil[2]+'\nUsername: '+hasil[7]+hasil[8]+'\nBio: '+hasil[12]+hasil[13]+' '+hasil[15]+hasil[16]+'\nLoc: '+hasil[20]+'\nWeb: '+hasil[26]+'\nJoined: '+hasil[32]+'\nBorn: '+hasil[37]) cl.sendMessage(msg.to,'Tweets: '+tweet+'\nFollowing: '+fllwng.replace('Following','')+'\nFollowers: '+fllwr.replace('Followers','')+'\nLikes:'+fav.replace('Likes','')) elif msg.text.lower().startswith("image "): sep = msg.text.replace("image ","") url = "http://rahandiapi.herokuapp.com/imageapi?key=betakey&q="+sep+"" with requests.session() as web: web.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" r = web.get(url) data = r.text data = json.loads(data) if data["result"] != []: items = data["result"] path = random.choice(items) a = items.index(path) b = len(items) cl.sendImageWithURL(msg.to, str(path)) elif msg.text.lower().startswith("cuaca "): location = msg.text.lower().replace("cuaca ","") with requests.session() as web: web.headers["user-agent"] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" r = web.get("http://api.corrykalam.net/apicuaca.php?kota={}".format(urllib2.quote(location))) data = r.text data = json.loads(data) if "result" not in data: ret_ = "╔══『 Status Cuaca 』" ret_ += "\n╠ ⌬.「 Lokasi 」 : " + data[0].replace("Temperatur di kota ","") ret_ += "\n╠ ⌬.「 Suhu 」 : " + data[1].replace("Suhu : ","") ret_ += "\n╠ ⌬.「 Kelembaban 」: " + data[2].replace("Kelembaban : ","") ret_ += "\n╠ ⌬.「 Tekanan Udara 」 : " + data[3].replace("Tekanan udara : ","") ret_ += "\n╠ ⌬.「 Kecepatan Angin」 : " + data[4].replace("Kecepatan angin : ","") ret_ += "\n╚══『 Status Cuaca 』" else: ret_ = "[ Weather Status ] Error : Lokasi tidak ditemukan" cl.sendText(msg.to, str(ret_)) elif msg.text.lower() == 'ifconfig': if msg.from_ in admin: botKernel = subprocess.Popen(["ifconfig"], stdout=subprocess.PIPE).communicate()[0] cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO NetStat===") elif msg.text.lower() == 'system': if msg.from_ in admin: botKernel = subprocess.Popen(["df","-h"], stdout=subprocess.PIPE).communicate()[0] cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO SYSTEM===") elif msg.text.lower() == 'kernel': if msg.from_ in admin: botKernel = subprocess.Popen(["uname","-srvmpio"], stdout=subprocess.PIPE).communicate()[0] cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO KERNEL===") elif msg.text.lower() == "cfotogroup": if msg.from_ in admin: wait["cpg"] = True cl.sendText(msg.to,"please send an image for group profile.") else: cl.sendText(msg.to,"command denied") cl.sendText(msg.to,"creator permission recuired") elif msg.text.lower() == "changepict": if msg.from_ in admin: wait["cpp"] = True cl.sendText(msg.to,"please send an image") else: cl.sendText(msg.to,"command denied") cl.sendText(msg.to,"creator permission recuired") #============================================================================================================ elif msg.text.lower() == "join url": if msg.from_ in admin: wait["linkticket"] = True cl.sendText(msg.to,"please send a link URL to me") elif msg.text.lower() == 'cpu': if msg.from_ in admin: botKernel = subprocess.Popen(["cat","/proc/cpuinfo"], stdout=subprocess.PIPE).communicate()[0] cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO CPU===") #--------------------------------- INSTAGRAM -------------------------------- # elif "http://line.me/R/ti/g/" in msg.text.lower(): # if wait["linkticket"] == True: # tiket = msg.text.replace("http://line.me/R/ti/g/","") # bahan = "http://line.me/R/ti/g/" + tiket # group = cl.findGroupByTicket(bahan) # cl.acceptGroupInvitationByTicket(group.id,bahan) # wait["linkticket"] = False # cl.sendText(msg.to, "succes joined to group %s" % str(group.name)) elif 'ytmp3: ' in text: url_= text.replace('ytmp3: ','') params = {'key':'betakey','q':url_} path = 'http://rahandiapi.herokuapp.com/youtubeapi?' r = requests.get(path,params=params).json() cl.sendText(msg.to, r['result']['audiolist'][4]['url']) elif "/lirik " in msg.text: try: instagram = msg.text.replace("/lirik ","") response = requests.get("http://rahandiapi.herokuapp.com/lyricapi?key=betakey&q="+instagram+"") data = response.json() pictig = str(data['title']) hasil = str(data['lyric']) text = "Judul : "+pictig+"\n\n"+hasil+"" cl.sendText(msg.to, text) except Exception as e: cl.sendText(msg.to, str(e)) elif "Screen " in msg.text: try: print "[SCREEN]" instagram = msg.text.replace("Screen ","") response = requests.get("http://rahandiapi.herokuapp.com/sswebAPI?key=betakey&link=www.instagram.com/"+instagram+"") data = response.json() pictig = data['result'] cl.sendImageWithURL(msg.to, pictig) except Exception as e: cl.sendText(msg.to, str(e)) elif "Cvid " in msg.text: try: print "[CVID]" instagram = msg.text.replace("Cvid ","") cl.sendText(msg.to, "Tunggu video sedang di proses!") response = requests.get("http://rahandiapi.herokuapp.com/instapost/"+instagram+"/1?key=betakey") data = response.json() post = str(data['media']['mediatype']) caption = str(data['media']['caption']) comment = str(data['media']['comment_count']) likec = str(data['media']['like_count']) profiley = data['media']['url'] textnya = "Post Ke : "+post+"\nCaption : "+caption+"\nJumlah Comment : "+comment+"\nJumlah Like : "+likec+"" cl.sendVideoWithURL(msg.to, profiley) cl.sendText(msg.to, str(textnya)) except Exception as e: cl.sendText(msg.to, "Akunmu private/tidak ditemukan!") elif "Cpost " in msg.text: try: print "[CPOST]" instagram = msg.text.replace("Cpost ","") cl.sendText(msg.to, "Tunggu foto sedang di proses!") response = requests.get("http://rahandiapi.herokuapp.com/instapost/"+instagram+"/1?key=betakey") data = response.json() post = str(data['media']['mediatype']) caption = str(data['media']['caption']) comment = str(data['media']['comment_count']) likec = str(data['media']['like_count']) profiley = data['media']['url'] textnya = "Post Ke : "+post+"\nCaption : "+caption+"\nJumlah Comment : "+comment+"\nJumlah Like : "+likec+"" cl.sendImageWithURL(msg.to, profiley) cl.sendText(msg.to, str(textnya)) except Exception as e: cl.sendText(msg.to, "Akunmu private/tidak ditemukan!") elif "Profileig " in msg.text: try: instagram = msg.text.replace("Profileig ","") response = requests.get("https://www.instagram.com/"+instagram+"?__a=1") data = response.json() namaIG = str(data['user']['full_name']) bioIG = str(data['user']['biography']) mediaIG = str(data['user']['media']['count']) verifIG = str(data['user']['is_verified']) usernameIG = str(data['user']['username']) followerIG = str(data['user']['followed_by']['count']) profileIG = data['user']['profile_pic_url_hd'] privateIG = str(data['user']['is_private']) followIG = str(data['user']['follows']['count']) link = "Link: " + "https://www.instagram.com/" + instagram text = "Name : "+namaIG+"\nUsername : "+usernameIG+"\nBiography : "+bioIG+"\nFollower : "+followerIG+"\nFollowing : "+followIG+"\nPost : "+mediaIG+"\nVerified : "+verifIG+"\nPrivate : "+privateIG+"" "\n" + link cl.sendImageWithURL(msg.to, profileIG) cl.sendText(msg.to, str(text)) except Exception as e: cl.sendText(msg.to, str(e)) elif "/ti/g/" in msg.text: if msg.from_ in admin: if wait["atjointicket"] == True: tiket = msg.text.replace("/ti/g/","") group = cl.findGroupByTicket(tiket) cl.sendText(msg.to, "I've found group name 「%s」 Trying to join" % str(group.name)) cl.acceptGroupInvitationByTicket(group.mid,tiket) cl.sendText(msg.to, "Succes to join group 「%s」" % str(group.name)) # link_re = re.compile('(?:line\:\/|line\.me\/R)\/ti\/g\/([a-zA-Z0-9_-]+)?') # links = link_re.findall(text) # n_links = [] # for l in links: # if l not in n_links: # n_links.append(l) # for ticket_id in n_links: # group = cl.findGroupByTicket(ticket_id) # cl.sendText(msg.to, "I've found group name 「%s」 Trying to join" % str(group.name)) # cl.acceptGroupInvitationByTicket(group.mid,ticket_id) # cl.sendText(msg.to, "Succes to join group 「%s」" % str(group.name)) elif 'instagram ' in msg.text.lower(): try: instagram = msg.text.lower().replace("instagram ","") html = requests.get('https://www.instagram.com/' + instagram + '/?') soup = BeautifulSoup(html.text, 'html5lib') data = soup.find_all('meta', attrs={'property':'og:description'}) text = data[0].get('content').split() data1 = soup.find_all('meta', attrs={'property':'og:image'}) text1 = data1[0].get('content').split() user = "Name: " + text[-2] + "\n" user1 = "Username: " + text[-1] + "\n" followers = "Followers: " + text[0] + "\n" following = "Following: " + text[2] + "\n" post = "Post: " + text[4] + "\n" link = "Link: " + "https://www.instagram.com/" + instagram detail = "======INSTAGRAM INFO USER======\n" details = "\n======INSTAGRAM INFO USER======" cl.sendText(msg.to, detail + user + user1 + followers + following + post + link + details) cl.sendImageWithURL(msg.to, text1[0]) except Exception as njer: cl.sendText(msg.to, str(njer)) elif "/postig" in msg.text: if msg.from_ in admin: separate = msg.text.split(" ") user = msg.text.replace(separate[0] + " ","") if user.startswith("@"): user = user.replace("@","") profile = "https://www.instagram.com/" + user with requests.session() as x: x.headers['user-agent'] = 'Mozilla/5.0' end_cursor = '' for count in range(1, 2): print('PAGE: ', count) r = x.get(profile, params={'max_id': end_cursor}) data = re.search(r'window._sharedData = (\{.+?});</script>', r.text).group(1) j = json.loads(data) for node in j['entry_data']['ProfilePage'][0]['user']['media']['nodes']: if node['is_video']: page = 'https://www.instagram.com/p/' + node['code'] r = x.get(page) url = re.search(r'"video_url": "([^"]+)"', r.text).group(1) print(url) cl.sendVideoWithURL(msg.to,url) else: print (node['display_src']) cl.sendImageWithURL(msg.to,node['display_src']) end_cursor = re.search(r'"end_cursor": "([^"]+)"', r.text).group(1) elif "yt: " in msg.text.lower(): query = msg.text.split(":") try: if len(query) == 3: isi = yt(query[2]) hasil = isi[int(query[1])-1] cl.sendText(msg.to, 'Hasil Pencarian = ' + str(len(isi)) + " ini adalah hasil pencarian ke [" + str(query[1]) + "]") cl.sendText(msg.to, hasil) else: isi = yt(query[1]) cl.sendText(msg.to, "Hasil Pencarian = " + str(len(isi))) cl.sendText(msg.to, isi[0]) except Exception as e: print(e) elif "/ig " in msg.text.lower(): arg = msg.text.split(' '); nk0 = msg.text.replace("/ig ","") nk1 = nk0.rstrip(' ') if len(arg) > 1: proc = subprocess.Popen('curl -s http://www.instagram.com/'+nk1+'/?__a=1',shell=True, stdout=subprocess.PIPE) x = proc.communicate()[0] parsed_json = json.loads(x) if(len(x) > 10): username = (parsed_json['user']['username']) fullname = (parsed_json['user']['full_name']) followers = (parsed_json['user']['followed_by']['count']) following = (parsed_json['user']['follows']['count']) media = (parsed_json['user']['media']['count']) bio = (parsed_json['user']['biography']) url = (parsed_json['user']['external_url']) cl.sendText(msg.to,"Tunggu Sebentar...") cl.sendText(msg.to,"Profile "+username+"\n\nUrl : https://www.instagram.com/"+username+"\n\nUsername : "+username+"\nLink : "+url+"\nFull Name : "+fullname+"\nFollowers : "+str(followers)+"\nFollowing : "+str(following)) print '[Command] Instagram' else: cl.sendText(msg.to,"Not Found... Contoh /ig boomsyah") else: cl.sendText(msg.to,"Contoh /ig boomsyah") #---------------------------------------------------------------------------- elif 'wikipedia ' in msg.text.lower(): try: wiki = msg.text.lower().replace("wikipedia ","") wikipedia.set_lang("id") pesan="Title (" pesan+=wikipedia.page(wiki).title pesan+=")\n\n" pesan+=wikipedia.summary(wiki, sentences=1) pesan+="\n" pesan+=wikipedia.page(wiki).url cl.sendText(msg.to, pesan) except: try: pesan="Over Text Limit! Please Click link\n" pesan+=wikipedia.page(wiki).url cl.sendText(msg.to, pesan) except Exception as e: cl.sendText(msg.to, str(e)) elif '.instagram ' in msg.text.lower(): try: instagram = msg.text.lower().replace(".instagram ","") html = requests.get('https://www.instagram.com/' + instagram + '/?') soup = BeautifulSoup(html.text, 'html5lib') data = soup.find_all('meta', attrs={'property':'og:description'}) text = data[0].get('content').split() data1 = soup.find_all('meta', attrs={'property':'og:image'}) text1 = data1[0].get('content').split() user = "Name: " + text[-2] + "\n" user1 = "Username: " + text[-1] + "\n" followers = "Followers: " + text[0] + "\n" following = "Following: " + text[2] + "\n" post = "Post: " + text[4] + "\n" link = "Link: " + "http://www.instagram.com/" + instagram detail = "========INSTAGRAM INFO USER========\n" details = "\n========INSTAGRAM INFO USER========" cl.sendText(msg.to, detail + user + user1 + followers + following + post + link + details) cl.sendImageWithURL(msg.to, text1[0]) except Exception as njer: cl.sendText(msg.to, str(njer)) elif "Steal group pict" in msg.text: group = cl.getGroup(msg.to) path = "http://dl.profile.line-cdn.net/" + group.pictureStatus cl.sendImageWithURL(msg.to,path) elif "Turn off bots" in msg.text: if msg.from_ in owner: try: import sys sys.exit() except: pass elif "Bot1 rename:" in msg.text: if msg.from_ in owner: string = msg.text.replace("Bot1 rename:","") if len(string.decode('utf-8')) <= 500: profile = cl.getProfile() profile.displayName = string cl.updateProfile(profile) cl.sendText(msg.to,"change name: "+string+"\nsucces") elif "Steal bio" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] contact = cl.getContact(key1) cu = cl.channel.getCover(key1) try: cl.sendText(msg.to,contact.statusMessage) except: cl.sendText(msg.to,contact.statusMessage) elif "Message:" in msg.text: if msg.from_ in admin: wait["message"] = msg.text.replace("Message:","") cl.sendText(msg.to,"bot message\n\n"+ datetime.today().strftime('%H:%M:%S')) elif "Add message:" in msg.text: if msg.from_ in admin: wait["message"] = msg.text.replace("Add message:","") if wait["lang"] == "JP": cl.sendText(msg.to,"message changed\n\n"+ datetime.today().strftime('%H:%M:%S')) else: cl.sendText(msg.to,"done。\n\n"+ datetime.today().strftime('%H:%M:%S')) elif "Update welcome:" in msg.text: if msg.from_ in admin: wait["welmsg"] = msg.text.replace("Update welcome:","") cl.sendText(msg.to,"update welcome message succes"+ datetime.today().strftime('%H:%M:%S')) elif "Sider on" in msg.text: ginfo = cl.getGroup(msg.to) gCreator = ginfo.creator.mid if msg.from_ in gCreator: try: del cctv['point'][msg.to] del cctv['sidermem'][msg.to] del cctv['cyduk'][msg.to] except: pass cctv['point'][msg.to] = msg.id cctv['sidermem'][msg.to] = "" cctv['cyduk'][msg.to]=True wait["Sider"] = True cl.sendText(msg.to,"Siap On Cek Sider") elif "Sider off" in msg.text: ginfo = cl.getGroup(msg.to) gCreator = ginfo.creator.mid if msg.from_ in gCreator: if msg.to in cctv['point']: cctv['cyduk'][msg.to]=False wait["Sider"] = False cl.sendText(msg.to, "Cek Sider Off") else: cl.sendText(msg.to, "Heh Belom Di Set") elif "Sider on" in msg.text: if msg.from_ in admin: try: del cctv['point'][msg.to] del cctv['sidermem'][msg.to] del cctv['cyduk'][msg.to] except: pass cctv['point'][msg.to] = msg.id cctv['sidermem'][msg.to] = "" cctv['cyduk'][msg.to]=True wait["Sider"] = True cl.sendText(msg.to,"Siap On Cek Sider") elif "Sider off" in msg.text: if msg.from_ in admin: if msg.to in cctv['point']: cctv['cyduk'][msg.to]=False wait["Sider"] = False cl.sendText(msg.to, "Cek Sider Off") else: cl.sendText(msg.to, "Heh Belom Di Set") elif msg.text in ["Check welcome message"]: if msg.from_ in admin: if wait["lang"] == "JP": cl.sendText(msg.to,"yor bot message\n\n" + wait["welmsg"]) else: cl.sendText(msg.to,"The automatic appending information is set as follows。\n\n" + wait["welmsg"]) elif msg.text in ["Check message"]: if msg.from_ in admin: if wait["lang"] == "JP": cl.sendText(msg.to,"yor bot message\n\n" + wait["message"]) else: cl.sendText(msg.to,"The automatic appending information is set as follows。\n\n" + wait["message"]) elif msg.text in ["sticker on"]: if wait['sticker'] == True: stk_id = msg.contentMetadata['STKID'] stk_ver = msg.contentMetadata['STKVER'] pkg_id = msg.contentMetadata['STKPKGID'] filler = "『 Sticker Check 』\nSTKID : %s\nSTKPKGID : %s\nSTKVER : %s\n『 Link 』\nline://shop/detail/%s" % (stk_id,pkg_id,stk_ver,pkg_id) cl.sendText(msg.to, filler) else: pass elif msg.text in ["Welcome message:on"]: if msg.from_ in admin: if wait["welcomemsg"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"welcome message on\n\n"+ datetime.today().strftime('%H:%M:%S')) else: cl.sendText(msg.to,"welcome message on\n\n"+ datetime.today().strftime('%H:%M:%S')) else: wait["welcomemsg"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"welcome message on\n\n"+ datetime.today().strftime('%H:%M:%S')) else: cl.sendText(msg.to,"welcome message on") elif msg.text in ["Welcome message:off"]: if msg.from_ in admin: if wait["welcomemsg"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S')) else: cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S')) else: wait["welcomemsg"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S')) else: cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S')) #=========================================== elif msg.text.lower() == 'responsename': profile = cl.getProfile() text = profile.displayName + "" cl.sendText(msg.to, text) #=============================================== elif msg.text in ["debug speed","Debug speed"]: cl.sendText(msg.to, "Measuring...") start = time.time() time.sleep(0.0001) elapsed_time = time.time() - start cl.sendText(msg.to, "%sseconds" % (elapsed_time)) print "[Command]Speed palsu executed" #======================================== elif 'group list' in msg.text.lower(): gs = cl.getGroupIdsJoined() L = "『 Groups List 』\n" for i in gs: L += "[≫] %s \n" % (cl.getGroup(i).name + " | [ " + str(len (cl.getGroup(i).members)) + " ]") cl.sendText(msg.to, L + "\nTotal Group : [ " + str(len(gs)) +" ]") elif "Autolike" in msg.text: if msg.from_ in admin: autoLike() time.sleep(500) #---------------------------------- SONG ------------------------------------ elif "yt:" in msg.text.lower(): sep = text.split(" ") search = text.replace(sep[0] + " ","") params = {"search_query": search} with requests.session() as web: web.headers["User-Agent"] = random.choice(settings["userAgent"]) r = web.get("https://www.youtube.com/results", params = params) soup = BeautifulSoup(r.content, "html5lib") ret_ = "╔══[ Youtube Result ]" datas = [] for data in soup.select(".yt-lockup-title > a[title]"): if "&lists" not in data["href"]: datas.append(data) for data in datas: ret_ += "\n╠══[ {} ]".format(str(data["title"])) ret_ += "\n╠ https://www.youtube.com{}".format(str(data["href"])) ret_ += "\n╚══[ Total {} ]".format(len(datas)) cl.sendText(msg.to, str(ret_)) elif "/lirik" in msg.text.lower(): sep = text.split(" ") search = text.replace(sep[0] + " ","") params = {'songname': search} with requests.session() as web: web.headers["User-Agent"] = random.choice(settings["userAgent"]) r = web.get("https://ide.fdlrcn.com/workspace/yumi-apis/joox?" + urllib.urlencode(params)) try: data = json.loads(r.text) for song in data: songs = song[5] lyric = songs.replace('ti:','Title - ') lyric = lyric.replace('ar:','Artist - ') lyric = lyric.replace('al:','Album - ') removeString = "[1234567890.:]" for char in removeString: lyric = lyric.replace(char,'') ret_ = "╔══[ Lyric ]" ret_ += "\n╠ Nama lagu : {}".format(str(song[0])) ret_ += "\n╠ Durasi : {}".format(str(song[1])) ret_ += "\n╠ Link : {}".format(str(song[4])) ret_ += "\n╚══[ Finish ]\n{}".format(str(lyric)) cl.sendText(msg.to, str(ret_)) except: cl.sendText(msg.to, "Lirik tidak ditemukan") elif "/lagu" in msg.text.lower(): sep = text.split(" ") search = text.replace(sep[0] + " ","") params = {'songname': search} with requests.session() as web: web.headers["User-Agent"] = random.choice(settings["userAgent"]) r = web.get("https://ide.fdlrcn.com/workspace/yumi-apis/joox?" + urllib.urlencode(params)) try: data = json.loads(r.text) for song in data: ret_ = "╔══[ Music ]" ret_ += "\n╠ Nama lagu : {}".format(str(song[0])) ret_ += "\n╠ Durasi : {}".format(str(song[1])) ret_ += "\n╠ Link : {}".format(str(song[4])) ret_ += "\n╚══[ reading Audio ]" cl.sendText(msg.to, str(ret_)) cl.sendAudioWithURL(msg.to, song[3]) except: cl.sendText(msg.to, "Musik tidak ditemukan") #---------------------------------------------------------------------------- #--------------------------------- YOUTUBE ---------------------------------- # elif "/youtube " in msg.text: # query = msg.text.replace("/youtube ","") # with requests.session() as s: # s.headers['user-agent'] = 'Mozilla/5.0' # url = 'http://www.youtube.com/results' # params = {'search_query':query} # r = s.get(url, params=params) # soup = BeautifulSoup(r.content, 'html5lib') # hasil = "" # for a in soup.select('.yt-lockup-title > a[title]'): # if '&list=' not in a['href']: # hasil += ''.join((a['title'],'\nhttp://www.youtube.com' + a['href'],'\n\n')) # cl.sendText(msg.to,hasil) # print '[Command] Youtube Search' #---------------------------------------------------------------------------- #-------------------------------- PP BY TAG --------------------------------- elif "pp @" in msg.text: if msg.toType == 2: cover = msg.text.replace("pp @","") _nametarget = cover.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found") else: for target in targets: try: h = cl.getContact(target) cl.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/" + h.pictureStatus) except Exception as error: print error cl.sendText(msg.to,"Upload image failed.") elif "Pp @" in msg.text: if msg.toType == 2: cover = msg.text.replace("Pp @","") _nametarget = cover.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found") else: for target in targets: try: h = cl.getContact(target) cl.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/" + h.pictureStatus) except Exception as error: print error cl.sendText(msg.to,"Upload image failed.") #--------------------------------- TRANSLATE ------------------------------- elif "Id@en" in msg.text: bahasa_awal = 'id' bahasa_tujuan = 'en' kata = msg.text.replace("Id@en ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM ID----\n" + "" + kata + "\n----TO ENGLISH----\n" + "" + result + "\n------SUKSES-----") elif "En@id" in msg.text: bahasa_awal = 'en' bahasa_tujuan = 'id' kata = msg.text.replace("En@id ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM EN----\n" + "" + kata + "\n----TO ID----\n" + "" + result + "\n------SUKSES-----") elif "Id@jp" in msg.text: bahasa_awal = 'id' bahasa_tujuan = 'ja' kata = msg.text.replace("Id@jp ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM ID----\n" + "" + kata + "\n----TO JP----\n" + "" + result + "\n------SUKSES-----") elif "Jp@id" in msg.text: bahasa_awal = 'ja' bahasa_tujuan = 'id' kata = msg.text.replace("Jp@id ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM JP----\n" + "" + kata + "\n----TO ID----\n" + "" + result + "\n------SUKSES-----") elif "Id@th" in msg.text: bahasa_awal = 'id' bahasa_tujuan = 'th' kata = msg.text.replace("Id@th ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM ID----\n" + "" + kata + "\n----TO TH----\n" + "" + result + "\n------SUKSES-----") elif "Th@id" in msg.text: bahasa_awal = 'th' bahasa_tujuan = 'id' kata = msg.text.replace("Th@id ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM TH----\n" + "" + kata + "\n----TO ID----\n" + "" + result + "\n------SUKSES-----") elif "Id@jp" in msg.text: bahasa_awal = 'id' bahasa_tujuan = 'ja' kata = msg.text.replace("Id@jp ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM ID----\n" + "" + kata + "\n----TO JP----\n" + "" + result + "\n------SUKSES-----") elif "Id@ar" in msg.text: bahasa_awal = 'id' bahasa_tujuan = 'ar' kata = msg.text.replace("Id@ar ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM ID----\n" + "" + kata + "\n----TO AR----\n" + "" + result + "\n------SUKSES-----") elif "Ar@id" in msg.text: bahasa_awal = 'ar' bahasa_tujuan = 'id' kata = msg.text.replace("Ar@id ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM AR----\n" + "" + kata + "\n----TO ID----\n" + "" + result + "\n------SUKSES-----") elif "Id@ko" in msg.text: bahasa_awal = 'id' bahasa_tujuan = 'ko' kata = msg.text.replace("Id@ko ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM ID----\n" + "" + kata + "\n----TO KO----\n" + "" + result + "\n------SUKSES-----") elif "Ko@id" in msg.text: bahasa_awal = 'ko' bahasa_tujuan = 'id' kata = msg.text.replace("Ko@id ","") url = 'https://translate.google.com/m?sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s' % (bahasa_awal, bahasa_tujuan, kata.replace(" ", "+")) agent = {'User-Agent':'Mozilla/5.0'} cari_hasil = 'class="t0">' request = urllib2.Request(url, headers=agent) page = urllib2.urlopen(request).read() result = page[page.find(cari_hasil)+len(cari_hasil):] result = result.split("<")[0] cl.sendText(msg.to,"----FROM KO----\n" + "" + kata + "\n----TO ID----\n" + "" + result + "\n------SUKSES-----") elif "/id " in msg.text: if msg.from_ in admin: txt = msg.text.replace("/id ","") try: translator = Translator() trs = translator.translate(txt,'id') A = trs.text A = A.encode('utf-8') cl.sendText(msg.to,A) print '[Command] Translate ID' except: cl.sendText(msg.to,'Failed.') elif "/eng " in msg.text: if msg.from_ in admin: txt = msg.text.replace("/eng ","") try: translator = Translator() trs = translator.translate(txt,'en') A = trs.text A = A.encode('utf-8') cl.sendText(msg.to,A) print '[Command] Translate EN' except: cl.sendText(msg.to,'Failed.') elif "tr-en " in msg.text: txt = msg.text.replace("tr-en ","") try: gs = goslate.Goslate() trs = gs.translate(txt,'en') cl.sendText(msg.to,trs) print '[Command] Translate EN' except: cl.sendText(msg.to,'Error.') elif "tr-id " in msg.text: txt = msg.text.replace("tr-id ","") try: gs = goslate.Goslate() trs = gs.translate(txt,'id') cl.sendText(msg.to,trs) print '[Command] Translate ID' except: cl.sendText(msg.to,'Error.') #---------------------------------------------------------------------------- elif text.lower() == '/about': try: arr = [] owner = "ud4082219b6754e7b610f84d07d3b436b" creator = cl.getContact(owner) contact = cl.getContact(owner) grouplist = cl.getGroupIdsJoined() contactlist = cl.getAllContactIds() blockedlist = cl.getBlockedContactIds() ret_ = "╔══[ About Public Bot ]" ret_ += "\n╠ Line : {}".format(contact.displayName) ret_ += "\n╠ Group : {}".format(str(len(grouplist))) ret_ += "\n╠ Friend : {}".format(str(len(contactlist))) ret_ += "\n╠ Blocked : {}".format(str(len(blockedlist))) ret_ += "\n╠═══════" ret_ += "\n╠ Version : Public Bot 1" ret_ += "\n╠ Creator : {}".format(creator.displayName) ret_ += "\n╚═══════" cl.sendText(msg.to, str(ret_)) except Exception as e: cl.sendText(msg.to, str(e)) elif text.lower() == 'groupinfo': group = cl.getGroup(msg.to) try: gCreator = group.creator.displayName except: gCreator = "Tidak ditemukan" if group.invitee is None: gPending = "0" else: gPending = str(len(group.invitee)) if group.preventedJoinByTicket == True: gQr = "Tertutup" gTicket = "Tidak ada" else: gQr = "Terbuka" gTicket = "https://line.me/R/ti/g/{}".format(str(line.reissueGroupTicket(group.id))) path = "http://dl.profile.line-cdn.net/" + group.pictureStatus ret_ = "╔══[ Group Info ]" ret_ += "\n╠ Nama Group : {}".format(str(group.name)) ret_ += "\n╠ ID Group : {}".format(group.id) ret_ += "\n╠ Pembuat : {}".format(str(gCreator)) ret_ += "\n╠ Jumlah Member : {}".format(str(len(group.members))) ret_ += "\n╠ Jumlah Pending : {}".format(gPending) ret_ += "\n╠ Group Qr : {}".format(gQr) ret_ += "\n╠ Group Ticket : {}".format(gTicket) ret_ += "\n╚══[ Finish ]" cl.sendText(msg.to, str(ret_)) cl.sendImageWithURL(msg.to, path) elif text.lower() == 'groupmemberlist': if msg.toType == 2: group = cl.getGroup(msg.to) ret_ = "╔══[ Member List ]" no = 0 + 1 for mem in group.members: ret_ += "\n╠ {}. {}".format(str(no), str(mem.displayName)) no += 1 ret_ += "\n╚══[ Total {} ]".format(str(len(group.members))) cl.sendText(msg.to, str(ret_)) elif "Searchid: " in msg.text: msgg = msg.text.replace('Searchid: ','') conn = cl.findContactsByUserid(msgg) if True: msg.contentType = 13 msg.contentMetadata = {'mid': conn.mid} cl.sendText(msg.to,"http://line.me/ti/p/~" + msgg) cl.sendMessage(msg) #--------------------------------- HI / HAI --------------------------------- elif msg.text.lower() == 'runtime': eltime = time.time() - mulai van = "Bot sudah berjalan selama "+waktu(eltime) cl.sendText(msg.to,van) #================================================= elif "lurk on" == msg.text.lower(): if msg.to in wait2['readPoint']: try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] del wait2['setTime'][msg.to] except: pass wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.now().strftime('%H:%M:%S') wait2['ROM'][msg.to] = {} with open('sider.json', 'w') as fp: json.dump(wait2, fp, sort_keys=True, indent=4) cl.sendText(msg.to,"Lurking already on") else: try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] del wait2['setTime'][msg.to] except: pass wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.now().strftime('%H:%M:%S') wait2['ROM'][msg.to] = {} with open('sider.json', 'w') as fp: json.dump(wait2, fp, sort_keys=True, indent=4) cl.sendText(msg.to, "Set reading point:\n" + datetime.now().strftime('%H:%M:%S')) print wait2 elif "lurk off" == msg.text.lower(): if msg.to not in wait2['readPoint']: cl.sendText(msg.to,"Lurking already off") else: try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] del wait2['setTime'][msg.to] except: pass cl.sendText(msg.to, "Delete reading point:\n" + datetime.now().strftime('%H:%M:%S')) elif "lurkers" == msg.text.lower(): if msg.to in wait2['readPoint']: if wait2["ROM"][msg.to].items() == []: cl.sendText(msg.to, "Lurkers:\nNone") else: chiya = [] for rom in wait2["ROM"][msg.to].items(): chiya.append(rom[1]) cmem = cl.getContacts(chiya) zx = "" zxc = "" zx2 = [] xpesan = 'Lurkers:\n' for x in range(len(cmem)): xname = str(cmem[x].displayName) pesan = '' pesan2 = pesan+"@a\n" xlen = str(len(zxc)+len(xpesan)) xlen2 = str(len(zxc)+len(pesan2)+len(xpesan)-1) zx = {'S':xlen, 'E':xlen2, 'M':cmem[x].mid} zx2.append(zx) zxc += pesan2 msg.contentType = 0 print zxc msg.text = xpesan+ zxc + "\nLurking time: %s\nCurrent time: %s"%(wait2['setTime'][msg.to],datetime.now().strftime('%H:%M:%S')) lol ={'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')+'}')} print lol msg.contentMetadata = lol try: cl.sendMessage(msg) except Exception as error: print error pass else: cl.sendText(msg.to, "Lurking has not been set.") elif msg.text == "Lurking": cl.sendText(msg.to, "Set point.") try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] except: pass now2 = datetime.now() wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.now().strftime('%Y-%m-%d %H:%M') wait2['ROM'][msg.to] = {} print wait2 elif msg.text == "Lurking Result": if msg.to in wait2['readPoint']: if wait2["ROM"][msg.to].items() == []: chiya = "" else: chiya = "" for rom in wait2["ROM"][msg.to].items(): print rom chiya += rom[1] + "\n" cl.sendText(msg.to, "╔═══════════════%s\n╠════════════════\n%s╠═══════════════\n║Readig point creation:\n║ [%s]\n╚════════════════" % (wait2['readMember'][msg.to],chiya,setTime[msg.to])) else: cl.sendText(msg.to, "ᴘʟᴇᴀsᴇ ᴄʜᴇᴄᴋ ʙᴇғᴏʀᴇ ʀᴇᴀᴅ ᴛʜᴇ sɪᴅᴇʀs") #======================================== elif msg.text.lower() in ["hi","hai","apa"]: if msg.from_ in admin: beb = "Hi sayang " + cl.getContact(msg.from_).displayName #+ " 􀸂􀆇starry heart􏿿" cl.sendText(msg.to,beb) else: hi = "Hi " + cl.getContact(msg.from_).displayName cl.sendText(msg.to,hi) #---------------------------------------------------------------------------- #--------------------------------- DUGEM ------------------------------------ elif 'crash' in msg.text: if msg.from_ in admin: msg.contentType = 13 msg.contentMetadata = {'mid': "ub8530f15ff4020c3cc2d1ad2f066aa4b',"} cl.sendMessage(msg) elif "kedapkedip " in msg.text.lower(): txt = msg.text.replace("kedapkedip ", "") cl.kedapkedip(msg.to,txt) print "[Command] Kedapkedip" #---------------------------------------------------------------------------- #--------------------------------- Remove Chat ------------------------------ elif "/removechat" in msg.text.lower(): if msg.from_ in admin: try: cl.removeAllMessages(op.param2) print "[Command] Remove Chat" cl.sendText(msg.to,"Done") except Exception as error: print error cl.sendText(msg.to,"Error") #---------------------------------------------------------------------------- #------------------------------------------------ elif msg.text in ["Gcreator"]: if msg.toType == 2: msg.contentType = 13 ginfo = cl.getGroup(msg.to) gCreator = ginfo.creator.mid try: msg.contentMetadata = {'mid': gCreator} gCreator1 = ginfo.creator.displayName except: gCreator = "Error" cl.sendText(msg.to, "Group Creator : " + gCreator1) cl.sendMessage(msg) #----------------------------------------------- elif "Gift @" in msg.text: _name = msg.text.replace("Gift @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) for g in gs.members: if _nametarget == g.displayName: msg.contentType = 9 msg.contentMetadata={'PRDID': '89131c1a-e549-4bd5-9e60-e24de0d2e252', 'PRDTYPE': 'THEME', 'MSGTPL': '10'} msg.text = None cl.sendMessage(msg,g) elif "Rename:" in msg.text: if msg.from_ in owner: string = msg.text.replace("Rename:","") if len(string.decode('utf-8')) <= 999999999: profile = cl.getProfile() profile.displayName = string cl.updateProfile(profile) elif "Sampul @" in msg.text: print "[Command]dp executing" _name = msg.text.replace("Sampul @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) cu = cl.channel.getCover(target) path = str(cu) cl.sendImageWithURL(msg.to, path) except: pass print "[Command]dp executed" elif "Midpict " in msg.text: umid = msg.text.replace("Midpict ","") contact = cl.getContact(umid) try: image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus except: image = "https://www.1and1.co.uk/digitalguide/fileadmin/DigitalGuide/Teaser/not-found-t.jpg" try: cl.sendImageWithURL(msg.to,image) except Exception as error: cl.sendText(msg.to,(error)) pass elif "Ambilkan " in msg.text: if msg.toType == 2: msg.contentType = 0 steal0 = msg.text.replace("Ambilkan ","") steal1 = steal0.lstrip() steal2 = steal1.replace("@","") steal3 = steal2.rstrip() _name = steal3 group = cl.getGroup(msg.to) targets = [] for g in group.members: if _name == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Gak da orange") else: for target in targets: try: contact = cl.getContact(target) try: image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus except: image = "https://www.1and1.co.uk/digitalguide/fileadmin/DigitalGuide/Teaser/not-found-t.jpg" try: cl.sendImageWithURL(msg.to,image) except Exception as error: cl.sendText(msg.to,(error)) pass except: cl.sendText(msg.to,"Error!") break else: cl.sendText(msg.to,"Tidak bisa dilakukan di luar grup") elif "Setpoint" in msg.text: subprocess.Popen("echo '' > dataSeen/"+msg.to+".txt", shell=True, stdout=subprocess.PIPE) cl.sendText(msg.to, "Checkpoint checked!") print "@setview" elif "Read" in msg.text: lurkGroup = "" dataResult, timeSeen, contacts, userList, timelist, recheckData = [], [], [], [], [], [] with open('dataSeen/'+msg.to+'.txt','r') as rr: contactArr = rr.readlines() for v in xrange(len(contactArr) -1,0,-1): num = re.sub(r'\n', "", contactArr[v]) contacts.append(num) pass contacts = list(set(contacts)) for z in range(len(contacts)): arg = contacts[z].split('|') userList.append(arg[0]) timelist.append(arg[1]) uL = list(set(userList)) for ll in range(len(uL)): try: getIndexUser = userList.index(uL[ll]) timeSeen.append(time.strftime("%H:%M:%S", time.localtime(int(timelist[getIndexUser]) / 1000))) recheckData.append(userList[getIndexUser]) except IndexError: conName.append('nones') pass contactId = cl.getContacts(recheckData) for v in range(len(recheckData)): dataResult.append(contactId[v].displayName + ' ('+timeSeen[v]+')') pass if len(dataResult) > 0: tukang = "++++TERCIDUK++++\n*" grp = '\n* '.join(str(f) for f in dataResult) total = '\n\nTotal %i viewers (%s)' % (len(dataResult), datetime.now().strftime('%H:%M:%S') ) cl.sendText(msg.to, "%s %s %s" % (tukang, grp, total)) else: cl.sendText(msg.to, "Belum ada viewers") print "@viewseen" elif msg.text in ["Kalender","Time","Waktu"]: timeNow = datetime.now() timeHours = datetime.strftime(timeNow,"(%H:%M)") day = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday","Friday", "Saturday"] hari = ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] bulan = ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"] inihari = datetime.today() hr = inihari.strftime('%A') bln = inihari.strftime('%m') for i in range(len(day)): if hr == day[i]: hasil = hari[i] for k in range(0, len(bulan)): if bln == str(k): blan = bulan[k-1] rst = hasil + ", " + inihari.strftime('%d') + " - " + blan + " - " + inihari.strftime('%Y') + "\nJam : [ " + inihari.strftime('%H:%M:%S') + " ]" cl.sendText(msg.to, rst) elif msg.text in ["welcome","Welcome","Wc","wc","kam","Kam"]: cl.sendText(msg.to,"ѕєℓαмαт ∂αтαиg вσѕкυ! ѕємσgα вєтαн ∂ιѕιиι уα!") elif msg.text in ["Say-","say","Say","say-"]: if wait["lang"] == "JP": cl.sendText(msg.to,meMessage) else: cl.sendText(msg.to, "error") elif "Apakah " in msg.text: tanya = msg.text.replace("Apakah ","") jawab = ("Ya","Tidak") jawaban = random.choice(jawab) cl.sendText(msg.to,jawaban) #---------------------- elif "Dosa @" in msg.text: tanya = msg.text.replace("Dosa @","") jawab = ("60%","70%","80%","90%","100%","Tak terhingga") jawaban = random.choice(jawab) cl.sendText(msg.to,"Dosanya " + tanya + "adalah " + jawaban + " Banyak banyak tobat Nak ") #---------------------- elif "Pahala @" in msg.text: tanya = msg.text.replace("Pahala @","") jawab = ("0%","20%","40%","50%","60%","Tak ada") jawaban = random.choice(jawab) cl.sendText(msg.to,"Pahalanya " + tanya + "adalah " + jawaban + "\nTobatlah nak") elif "/InviteMeTo: " in msg.text: if msg.from_ in owner: gid = msg.text.replace("/InviteMeTo: ","") if gid == "": cl.sendText(msg.to,"Invalid group id") else: try: cl.sendText(msg.to,"Tunggu sebentar..") cl.findAndAddContactsByMid(msg.from_) cl.inviteIntoGroup(gid,[msg.from_]) except: cl.sendText(msg.to,"Mungkin pasukan tidak di dalam grup itu!") elif "Saan copy @" in msg.text: if msg.from_ in owner: print "[COPY] Ok" _name = msg.text.replace("Saan copy @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to, "Not Found...") else: for target in targets: try: cl.cloneContactProfile(target) cl.sendText(msg.to, "Succes Copy profile ~") except Exception as e: print e elif "pp @" in msg.text: if msg.toType == 2: cover = msg.text.replace("pp @","") _nametarget = cover.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found") else: for target in targets: try: h = cl.getContact(target) cl.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/" + h.pictureStatus) except Exception as error: print error cl.sendText(msg.to,"Upload image failed.") elif "Pp @" in msg.text: if msg.toType == 2: cover = msg.text.replace("Pp @","") _nametarget = cover.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found") else: for target in targets: try: h = cl.getContact(target) cl.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/" + h.pictureStatus) except Exception as error: print error cl.sendText(msg.to,"Upload image failed.") elif "Steal mid" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] cl.sendText(msg.to,"Mc: " + key1) elif "Steal contact" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] mmid = cl.getContact(key1) msg.contentType = 13 msg.contentMetadata = {"mid": key1} cl.sendMessage(msg) elif "Steal home @" in msg.text: print "[Command]dp executing" _name = msg.text.replace("Steal home @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) cu = cl.channel.getCover(target) path = str(cu) cl.sendImageWithURL(msg.to, path) except: pass print "[Command]dp executed" elif "stealgroupimage" in msg.text: group = cl.getGroup(msg.to) cl.sendText(msg.to,"Gambar Grup :\n=> http://dl.profile.line-cdn.net/" + group.pictureStatus) elif msg.text in ["Backup","backup"]: if msg.from_ in owner: try: cl.updateDisplayPicture(mybackup.pictureStatus) cl.updateProfile(mybackup) cl.sendText(msg.to, "Telah kembali semula") except Exception as e: cl.sendText(msg.to, str(e)) elif "Mid @" in msg.text: _name = msg.text.replace("Mid @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) for g in gs.members: if _nametarget == g.displayName: cl.sendText(msg.to, g.mid) else: pass elif "Spamtag @" in msg.text: _name = msg.text.replace("Spamtag @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) for g in gs.members: if _nametarget == g.displayName: xname = g.displayName xlen = str(len(xname)+1) msg.contentType = 0 msg.text = "@"+xname+" " msg.contentMetadata ={'MENTION':'{"MENTIONEES":[{"S":"0","E":'+json.dumps(xlen)+',"M":'+json.dumps(g.mid)+'}]}','EMTVER':'4'} cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) else: pass elif "Spam @" in msg.text: if msg.from_ in admin: _name = msg.text.replace("Spam @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) for g in gs.members: if _nametarget == g.displayName: cl.sendText(msg.to,"ƠƬƜ ƧƤƛM ƬƛƦƓЄƬ 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM ��") cl.sendText(g.mid,"Spam ����") cl.sendText(g.mid,"Spam ??") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam ??") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam ��") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam ??") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam ��") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"Spam 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM ��") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(g.mid,"HƛHƛHƛ ƊƖ ƧƤƛM 😂") cl.sendText(msg.to, "ƊƠƝЄ ƧƤƛM 😂") print "Done spam" #----------------------------- TAG ALL MEMBER ------------------------------- elif msg.text in ["tagall"]: group = cl.getGroup(msg.to) nama = [contact.mid for contact in group.members] nm1, nm2, nm3, nm4, nm5, jml = [], [], [], [], [], len(nama) if jml <= 100: mention(msg.to, nama) if jml > 100 and jml < 200: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, len(nama)): nm2 += [nama[j]] mention(msg.to, nm2) if jml > 200 and jml < 300: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, 200): nm2 += [nama[j]] mention(msg.to, nm2) for k in range(201, len(nama)): nm3 += [nama[k]] mention(msg.to, nm3) if jml > 300 and jml < 400: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, 200): nm2 += [nama[j]] mention(msg.to, nm2) for k in range(201, 300): nm3 += [nama[k]] mention(msg.to, nm3) for l in range(301, len(nama)): nm4 += [nama[l]] mention(msg.to, nm4) if jml > 400 and jml < 500: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, 200): nm2 += [nama[j]] mention(msg.to, nm2) for k in range(201, 300): nm3 += [nama[k]] mention(msg.to, nm3) for l in range(301, 400): nm4 += [nama[l]] mention(msg.to, nm4) for h in range(401, len(nama)): nm5 += [nama[h]] mention(msg.to, nm5) if jml > 500: cl.sendText(msg.to,'Member melebihi batas.') cnt = Message() cnt.text = "Done : " + str(jml) + " Members" cnt.to = msg.to cl.sendMessage(cnt) elif msg.text in ["Panggil semua"]: group = cl.getGroup(msg.to) nama = [contact.mid for contact in group.members] nm1, nm2, nm3, nm4, jml = [], [], [], [], len(nama) if jml <= 100: mention(msg.to, nama) if jml > 100 and jml < 200: for i in range (0, 99): nm1 += [nama[i]] mention(msg.to, nm1) for j in range (100, len(nama)-1): nm2 += [nama[j]] mention(msg.to, nm2) if jml > 200 and jml < 300: for i in range (0, 99): nm1 += [nama[i]] mention(msg.to, nm1) for j in range (100, 199): nm2 += [nama[j]] mention(msg.to, nm2) for k in range (200, len(nama)-1): nm3 += [nama[k]] mention(msg.to, nm3) if jml > 300 and jml < 400: for i in range (0, 99): nm1 += [nama[i]] mention(msg.to, nm1) for j in range (100, 199): nm2 += [nama[j]] mention(msg.to, nm2) for k in range (200, 299): nm3 += [nama[k]] mention(msg.to, nm3) for l in range (300, len(nama)-1): nm4 += [nama[l]] mention(msg.to, nm4) cnt = Message() cnt.text = "Done:"+str(jml) cnt.to = msg.to cl.sendMessage(cnt) #---------------------------------------------------------------------------- elif "Check:" in msg.text: midd = msg.text.replace("Check:","") msg.contentType = 13 msg.contentMetadata = {"mid":midd} cl.sendMessage(msg) elif "Myname:" in msg.text: if msg.from_ in owner: string = msg.text.replace("Myname:","") if len(string.decode('utf-8')) <= 10000000000: profile = cl.getProfile() profile.displayName = string cl.updateProfile(profile) cl.sendText(msg.to,"()Update Names👉 " + string + "👈 ") elif "Spam " in msg.text: if msg.from_ in admin: txt = msg.text.split(" ") jmlh = int(txt[2]) teks = msg.text.replace("Spam ")+str(txt[1])+" "+str(jmlh + " ","") tulisan = jmlh * (teks+"\n") #Keke cantik <3 if txt[1] == "on": if jmlh <= 60: for x in range(jmlh): cl.sendText(msg.to, teks) else: cl.sendText(msg.to, "Kelebihan batas:v") elif txt[1] == "off": if jmlh <= 100: cl.sendText(msg.to, tulisan) else: cl.sendText(msg.to, "Kelebihan batas :v") elif msg.text in ["Lang-list"]: if wait["lang"] == "JP": cl.sendText(msg.to,sayMessage) else: cl.sendText(msg.to, "error") elif msg.text in ["Saan Key","help","Help"]: if wait["lang"] == "JP": cl.sendText(msg.to, keyMessage) c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) else: cl.sendText(msg.to, "error") elif msg.text in ["/public","/Public","/publik"]: if wait["lang"] == "JP": cl.sendText(msg.to, publicMessage) c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) else: cl.sendText(msg.to, "error") elif msg.text in ["/siders","/Siders","/sider"]: if wait["lang"] == "JP": cl.sendText(msg.to, sidersMessage) c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) else: cl.sendText(msg.to, "error") elif msg.text in ["/newfiture","/Newfiture","/new fiture"]: if wait["lang"] == "JP": cl.sendText(msg.to, newMessage) c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) else: cl.sendText(msg.to, "error") elif msg.text in ["/searching","/Searching","/search"]: if wait["lang"] == "JP": cl.sendText(msg.to, searchingMessage) c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) else: cl.sendText(msg.to, "error") elif msg.text in ["/cancel","/Cancel","/cncel"]: if wait["lang"] == "JP": cl.sendText(msg.to, cancelMessage) c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) else: cl.sendText(msg.to, "error") elif "Saan copy @" in msg.text: if msg.from_ in owner: print "[COPY] Ok" _name = msg.text.replace("Saan copy @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to, "Not Found...") else: for target in targets: try: cl.CloneContactProfile(target) cl.sendText(msg.to, "Succes Copy profile ~") except Exception as e: print e elif msg.text in ["Gcreator:inv"]: if msg.from_ in admin: if msg.toType == 2: ginfo = cl.getGroup(msg.to) gCreator = ginfo.creator.mid try: cl.findAndAddContactsByMid(gCreator) cl.inviteIntoGroup(msg.to,[gCreator]) print "success inv gCreator" except: pass elif msg.text in ["Gcreator:kick"]: if msg.from_ in admin: if msg.toType == 2: ginfo = cl.getGroup(msg.to) gCreator = ginfo.creator.mid try: cl.kickoutFromGroup(msg.to,[gCreator]) print "success inv gCreator" except: pass elif msg.text in ["Gas unicode"]: if msg.from_ in admin: cl.sendText(msg.to,"Hello!3xploi7 BuG.1.2.3.4.5.6.7.8.9.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.9.K.0.A.1.B.2.D.3.E.4.F.5.G.6.H.7.I.8.J.") elif msg.text in ["Creator","creator"]: msg.contentType = 13 msg.contentMetadata = {'mid': 'ub8530f15ff4020c3cc2d1ad2f066aa4b'} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': 'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(msg) cl.sendText(msg.to,"Ini contact bos aku!↖") # elif msg.text in ["Reject invite"]: # if msg.from_ in admin: # gid = cl.getGroupIdsInvited() # for i in gid: # cl.rejectGroupInvitation(i) # if wait["lang"] == "JP": # cl.sendText(msg.to,"All invitations have been rejected") # else: # cl.sendText(msg.to,"Done") elif ("Saan Haey " in msg.text): if msg.from_ in admin: targets = [] key = eval(msg.contentMetadata["MENTION"]) key["MENTIONEES"] [0] ["M"] for x in key["MENTIONEES"]: targets.append(x["M"]) for target in targets: try: random.choice(KAC).kickoutFromGroup(msg.to,[target]) except: cl.sendText(msg.to,"Error") #-------------Fungsi Tagall User Start---------------# elif msg.text in ["Tag all"]: group = cl.getGroup(msg.to) nama = [contact.mid for contact in group.members] cb = "" cb2 = "" strt = int(0) akh = int(0) for md in nama: akh = akh + int(6) cb += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(md)+"},""" strt = strt + int(7) akh = akh + 1 cb2 += "@nrik \n" cb = (cb[:int(len(cb)-1)]) msg.contentType = 0 msg.text = cb2 msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+cb+']}','EMTVER':'4'} try: cl.sendMessage(msg) except Exception as error: print error #-------------Fungsi Tagall User Finish By :ᴋᴀʀɪᴀ -------------# #-------REMOTE MODE-----------# elif msg.text in ["Simisimi on","Simisimi:on"]: if msg.from_ in admin: settings["simiSimi"][msg.to] = True cl.sendText(msg.to,"Success activated simisimi") elif msg.text in ["Simisimi off","Simisimi:off"]: if msg.from_ in admin: settings["simiSimi"][msg.to] = False cl.sendText(msg.to,"Success deactive simisimi") #-------REMOTE MODE-----------# elif "/Spam: " in msg.text: cond = msg.text.split(" ") value = int(cond[2]) text = msg.text.replace("/Spam: " + str(cond[1]) + " " + str(value) + " ","") ballon1 = value * (text + "\n") if cond[1] == "on": if value <= 10: for x in range(value): cl.sendText(msg.to, text) else: cl.sendText(msg.to,"Jumlah spamming melebihi batas. Max 10") elif cond[1] == "off": if value <= 100: cl.sendText(msg.to,ballon1) else: cl.sendText(msg.to,"Jumlah spamming melebihi batas") else: cl.sendText(msg.to,"Error condition") elif "Admin add @" in msg.text: if msg.from_ in owner: print "[Command]Staff add executing" _name = msg.text.replace("Admin add @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: admin.append(target) cl.sendText(msg.to,"Admin Ditambahkan") except: pass print "[Command]Staff add executed" else: cl.sendText(msg.to,"Command denied.") cl.sendText(msg.to,"Admin permission required.") elif "Admin remove @" in msg.text: if msg.from_ in owner: print "[Command]Staff remove executing" _name = msg.text.replace("Admin remove @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: admin.remove(target) cl.sendText(msg.to,"Admin Dihapus") except: pass print "[Command]Staff remove executed" else: cl.sendText(msg.to,"Command denied.") cl.sendText(msg.to,"Admin permission required.") elif msg.text in ["Adminlist","adminlist"]: if admin == []: cl.sendText(msg.to,"The stafflist is empty") else: cl.sendText(msg.to,"Tunggu...") mc = "" for mi_d in admin: mc += "->" +cl.getContact(mi_d).displayName + "\n" cl.sendText(msg.to,mc) print "[Command]Stafflist executed" elif ("Saan Gn " in msg.text): if msg.toType == 2: X = cl.getGroup(msg.to) X.name = msg.text.replace("Saan Gn ","") cl.updateGroup(X) else: cl.sendText(msg.to,"It can't be used besides the group.") elif ("Cv1 gn " in msg.text): if msg.from_ in admin: if msg.toType == 2: X = cl.getGroup(msg.to) X.name = msg.text.replace("Cv1 gn ","") cl.updateGroup(X) else: cl.sendText(msg.to,"It can't be used besides the group.") #================================================================ elif msg.text in ["Invite user"]: if msg.from_ in admin: wait["winvite"] = True cl.sendText(msg.to,"send contact") #============================================================ elif "Invite " in msg.text: if msg.from_ in admin: midd = msg.text.replace("Invite ","") cl.findAndAddContactsByMid(midd) cl.inviteIntoGroup(msg.to,[midd]) elif "Leave all" in msg.text: if msg.from_ in owner: gid = cl.getGroupIdsJoined() for a in gid: cl.leaveGroup(a) elif "Cv1 Invite " in msg.text: if msg.from_ in admin: midd = msg.text.replace("Invite ","") cl.findAndAddContactsByMid(midd) cl.inviteIntoGroup(msg.to,[midd]) #----------------------------------------------- elif "Getmid @" in msg.text: _name = msg.text.replace("Getmid @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) for g in gs.members: if _nametarget == g.displayName: cl.sendText(msg.to, g.mid) else: pass elif "Getinfo" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] contact = cl.getContact(key1) cu = cl.channel.getCover(key1) try: cl.sendText(msg.to,"Nama :\n" + contact.displayName + "\n\nMid :\n" + contact.mid + "\n\nBio :\n" + contact.statusMessage + "\n\nProfile Picture :\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n\nHeader :\n" + str(cu)) except: cl.sendText(msg.to,"Nama :\n" + contact.displayName + "\n\nMid :\n" + contact.mid + "\n\nBio :\n" + contact.statusMessage + "\n\nProfile Picture :\n" + str(cu)) elif "Getbio" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] contact = cl.getContact(key1) cu = cl.channel.getCover(key1) try: cl.sendText(msg.to, "===[StatusMessage]===\n" + contact.statusMessage) except: cl.sendText(msg.to, "===[StatusMessage]===\n" + contact.statusMessage) elif "Getname" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] contact = cl.getContact(key1) cu = cl.channel.getCover(key1) try: cl.sendText(msg.to, "===[DisplayName]===\n" + contact.displayName) except: cl.sendText(msg.to, "===[DisplayName]===\n" + contact.displayName) elif "Getprofile" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] contact = cl.getContact(key1) cu = cl.channel.getCover(key1) path = str(cu) image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus try: cl.sendText(msg.to,"Nama :\n" + contact.displayName + "\n\nBio :\n" + contact.statusMessage) cl.sendText(msg.to,"Profile Picture " + contact.displayName) cl.sendImageWithURL(msg.to,image) cl.sendText(msg.to,"Cover " + contact.displayName) cl.sendImageWithURL(msg.to,path) except: pass elif "Getcontact" in msg.text: key = eval(msg.contentMetadata["MENTION"]) key1 = key["MENTIONEES"][0]["M"] mmid = cl.getContact(key1) msg.contentType = 13 msg.contentMetadata = {"mid": key1} cl.sendMessage(msg) elif "Getpict @" in msg.text: print "[Command]dp executing" _name = msg.text.replace("Getpict @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) path = "http://dl.profile.line-cdn.net/" + contact.pictureStatus cl.sendImageWithURL(msg.to, path) except Exception as e: raise e print "[Command]dp executed" elif "Getvid @" in msg.text: print "[Command]dp executing" _name = msg.text.replace("Getvid @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) path = "http://dl.profile.line-cdn.net/" + contact.pictureStatus cl.sendVideoWithURL(msg.to, path) except Exception as e: raise e print "[Command]dp executed" elif "Picturl @" in msg.text: print "[Command]dp executing" _name = msg.text.replace("Picturl @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) path = "http://dl.profile.line-cdn.net/" + contact.pictureStatus cl.sendText(msg.to, path) except Exception as e: raise e print "[Command]dp executed" elif "Getcover @" in msg.text: print "[Command]cover executing" _name = msg.text.replace("Getcover @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) cu = cl.channel.getCover(target) path = str(cu) cl.sendImageWithURL(msg.to, path) except Exception as e: raise e print "[Command]cover executed" elif "Coverurl @" in msg.text: print "[Command]cover executing" _name = msg.text.replace("Coverurl @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Contact not found") else: for target in targets: try: contact = cl.getContact(target) cu = cl.channel.getCover(target) path = str(cu) cl.sendText(msg.to, path) except Exception as e: raise e print "[Command]cover executed" elif "Getgrup image" in msg.text: group = cl.getGroup(msg.to) path = "http://dl.profile.line-cdn.net/" + group.pictureStatus cl.sendImageWithURL(msg.to,path) elif "Urlgrup image" in msg.text: group = cl.getGroup(msg.to) path = "http://dl.profile.line-cdn.net/" + group.pictureStatus cl.sendText(msg.to,path) elif "Steal " in msg.text: if msg.from_ in admin: salsa = msg.text.replace("Steal ","") Manis = cl.getContact(salsa) Imoet = "http://dl.profile.line-cdn.net/" + contact.pictureStatus try: cover = cl.channel.getCover(Manis) except: cover = "" cl.sendText(msg.to,"Gambar Foto Profilenya") cl.sendImageWithURL(msg.to,Imoet) if cover == "": cl.sendText(msg.to,"User tidak memiliki cover atau sejenisnya") else: cl.sendText(msg.to,"Gambar Covernya") cl.sendImageWithURL(msg.to,cover) #----------------------------------------------- elif "Steal @" in msg.text: if msg.toType == 2: steal = msg.text.replace("Steal @","") stealname = steal.rstrip(" ") group = cl.getGroup(msg.to) targets = [] if steal == "": cl.sendText(msg.to,"Invalid user") else: for i in group.members: if stealname == i.displayName: targets.append(i.mid) if targets == []: cl.sendText(msg.to,"User tidak ditemukan") else: for target in targets: try: contact = cl.getContact(target) image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus try: cover = cl.channel.getCover(contact) except: cover = "" try: cl.sendText(msg.to,"Gambar Foto Profilenya") cl.sendImageWithURL(msg.to,image) if cover == "": cl.sendText(msg.to,"User tidak memiliki cover atau sejenisnya") else: cl.sendText(msg.to,"Gambar Covernya") cl.sendImageWithURL(msg.to,cover) except Exception as error: cl.sendText(msg.to,(error)) break except: cl.sendText(msg.to,"Error!") break else: cl.sendText(msg.to,"Tidak bisa dilakukan di luar wilayah") #----------------------------------------------- elif msg.text in ["Me"]: msg.contentType = 13 msg.contentMetadata = {'mid': msg.from_} cl.sendMessage(msg) elif msg.text in ["Bot Started"]: if msg.from_ in admin: msg.contentType = 13 msg.contentMetadata = {'mid': mid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Amid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Bmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Cmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Dmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Emid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Fmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Gmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Hmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Jmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Kmid} cl.sendMessage(msg) msg.contentType = 13 msg.contentMetadata = {'mid': Lmid} cl.sendMessage(msg) elif msg.text in ["Cv1"]: if msg.from_ in admin: msg.contentType = 13 msg.contentMetadata = {'mid': Amid} cl.sendMessage(msg) elif msg.text in ["Cv2"]: if msg.from_ in admin: msg.contentType = 13 msg.contentMetadata = {'mid': Bmid} cl.sendMessage(msg) elif msg.text.lower() == 'spam gift': if msg.from_ in admin: msg.contentType = 9 msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE': 'THEME', 'MSGTPL': '12'} msg.text = None cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["愛のプレゼント","Gift"]: msg.contentType = 9 msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE': 'THEME', 'MSGTPL': '5'} msg.text = None cl.sendMessage(msg) elif msg.text in ["愛のプレゼント","Cv1 gift"]: msg.contentType = 9 msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE': 'THEME', 'MSGTPL': '6'} msg.text = None cl.sendMessage(msg) elif msg.text in ["愛のプレゼント","Cv2 gift"]: msg.contentType = 9 msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE': 'THEME', 'MSGTPL': '8'} msg.text = None cl.sendMessage(msg) elif msg.text in ["愛のプレゼント","Cv3 gift"]: msg.contentType = 9 msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE': 'THEME', 'MSGTPL': '10'} msg.text = None cl.sendMessage(msg) elif msg.text in ["愛のプレゼント","All gift"]: msg.contentType = 9 msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE': 'THEME', 'MSGTPL': '12'} msg.text = None cl.sendMessage(msg) cl.sendMessage(msg) cl.sendMessage(msg) # elif msg.text in ["Saan cancel","Saan Cancel"]: # if msg.toType == 2: # X = cl.getGroup(msg.to) # if X.invitee is not None: # gInviMids = [contact.mid for contact in X.invitee] # cl.cancelGroupInvitation(msg.to, gInviMids) # else: # if wait["lang"] == "JP": # cl.sendText(msg.to,"No one is inviting") # else: # cl.sendText(msg.to,"Sorry, nobody absent") # else: # if wait["lang"] == "JP": # cl.sendText(msg.to,"Can not be used outside the group") # else: # cl.sendText(msg.to,"Not for use less than group") # elif msg.text in ["Cv cancel","Bot cancel"]: # if msg.toType == 2: # G = cl.getGroup(msg.to) # if G.invitee is not None: # gInviMids = [contact.mid for contact in G.invitee] # cl.cancelGroupInvitation(msg.to, gInviMids) # else: # if wait["lang"] == "JP": # cl.sendText(msg.to,"No one is inviting") # else: # cl.sendText(msg.to,"Sorry, nobody absent") # else: # if wait["lang"] == "JP": # k3.sendText(msg.to,"Can not be used outside the group") # else: # k3.sendText(msg.to,"Not for use less than group") #elif "gurl" == msg.text: #print cl.getGroup(msg.to) ##cl.sendMessage(msg) elif msg.text == "Ginfo": if msg.toType == 2: ginfo = cl.getGroup(msg.to) try: gCreator = ginfo.creator.displayName except: gCreator = "Error" if wait["lang"] == "JP": if ginfo.invitee is None: sinvitee = "0" else: sinvitee = str(len(ginfo.invitee)) if ginfo.preventJoinByTicket == True: u = "close" else: u = "open" cl.sendText(msg.to,"[group name]\n" + str(ginfo.name) + "\n[gid]\n" + msg.to + "\n[group creator]\n" + gCreator + "\n[profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus + "\nmembers:" + str(len(ginfo.members)) + "members\npending:" + sinvitee + "people\nURL:" + u + "it is inside") else: cl.sendText(msg.to,"[group name]\n" + str(ginfo.name) + "\n[gid]\n" + msg.to + "\n[group creator]\n" + gCreator + "\n[profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus) else: if wait["lang"] == "JP": cl.sendText(msg.to,"Can not be used outside the group") else: cl.sendText(msg.to,"Not for use less than group") elif "Id" == msg.text: cl.sendText(msg.to,msg.to) elif "All mid" == msg.text: cl.sendText(msg.to,mid) elif "Mid" == msg.text: cl.sendText(msg.to,mid) #----------------------------------------------- elif "Steal " in msg.text: salsa = msg.text.replace("Steal ","") Manis = cl.getContact(salsa) Imoet = "http://dl.profile.line-cdn.net/" + contact.pictureStatus try: cover = cl.channel.getCover(Manis) except: cover = "" cl.sendText(msg.to,"Gambar Foto Profilenya") cl.sendImageWithURL(msg.to,Imoet) if cover == "": cl.sendText(msg.to,"User tidak memiliki cover atau sejenisnya") else: cl.sendText(msg.to,"Gambar Covernya") cl.sendImageWithURL(msg.to,cover) #----------------------------------------------- elif "Steal @" in msg.text: if msg.toType == 2: steal = msg.text.replace("Steal @","") stealname = steal.rstrip(" ") group = cl.getGroup(msg.to) targets = [] if steal == "": cl.sendText(msg.to,"Invalid user") else: for i in group.members: if stealname == i.displayName: targets.append(i.mid) if targets == []: cl.sendText(msg.to,"User tidak ditemukan") else: for target in targets: try: contact = cl.getContact(target) image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus try: cover = cl.channel.getCover(contact) except: cover = "" try: cl.sendText(msg.to,"Gambar Foto Profilenya") cl.sendImageWithURL(msg.to,image) if cover == "": cl.sendText(msg.to,"User tidak memiliki cover atau sejenisnya") else: cl.sendText(msg.to,"Gambar Covernya") cl.sendImageWithURL(msg.to,cover) except Exception as error: cl.sendText(msg.to,(error)) break except: cl.sendText(msg.to,"Error!") break else: cl.sendText(msg.to,"Tidak bisa dilakukan di luar wilayah") #----------------------------------------------- elif msg.text in ["Wkwk"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "100", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Hehehe"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "10", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Galon"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "9", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["You"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "7", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Hadeuh"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "6", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Please"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "4", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Haaa"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "3", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Lol"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "110", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["Hmmm"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "101", "STKPKGID": "1", "STKVER": "100" } cl.sendMessage(msg) elif msg.text in ["Welcome"]: msg.contentType = 7 msg.text = None msg.contentMetadata = { "STKID": "247", "STKPKGID": "3", "STKVER": "100" } cl.sendMessage(msg) cl.sendMessage(msg) elif msg.text in ["TL:"]: if msg.from_ in admin: tl_text = msg.text.replace("TL:","") cl.sendText(msg.to,"line://home/post?userMid="+mid+"&postId="+cl.new_post(tl_text)["result"]["post"]["postInfo"]["postId"]) elif msg.text in ["Cn "]: if msg.from_ in owner: string = msg.text.replace("Cn ","") if len(string.decode('utf-8')) <= 500: profile = cl.getProfile() profile.displayName = string cl.updateProfile(profile) cl.sendText(msg.to,"name " + string + " done") elif msg.text in ["Cv1 rename "]: if msg.from_ in owner: string = msg.text.replace("Cv1 rename ","") if len(string.decode('utf-8')) <= 500: profile_B = cl.getProfile() profile_B.displayName = string cl.updateProfile(profile_B) cl.sendText(msg.to,"name " + string + " done") elif msg.text in ["Cv2 rename "]: if msg.from_ in owner: string = msg.text.replace("Cv2 rename ","") if len(string.decode('utf-8')) <= 500: profile_B = cl.getProfile() profile_B.displayName = string cl.updateProfile(profile_B) cl.sendText(msg.to,"name " + string + " done") elif msg.text in ["Mc "]: if msg.from_ in admin: mmid = msg.text.replace("Mc ","") msg.contentType = 13 msg.contentMetadata = {"mid":mmid} cl.sendMessage(msg) elif msg.text in ["連絡先:オン","K on","Contact on","顯示:開"]: if msg.from_ in admin: if wait["contact"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") else: wait["contact"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") elif msg.text in ["連絡先:オフ","K off","Contact off","顯示:關"]: if msg.from_ in admin: if wait["contact"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done ") else: wait["contact"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done") elif msg.text in ["è‡ªå‹•å‚åŠ :オン","Join on","Auto join:on","è‡ªå‹•åƒåŠ ï¼šé–‹"]: if msg.from_ in admin: if wait["autoJoin"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") else: wait["autoJoin"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") elif msg.text in ["è‡ªå‹•å‚åŠ :オフ","Join off","Auto join:off","è‡ªå‹•åƒåŠ ï¼šé—œ"]: if msg.from_ in admin: if wait["autoJoin"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done") else: wait["autoJoin"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done") elif msg.text in ["Gcancel:"]: if msg.from_ in admin: try: strnum = msg.text.replace("Gcancel:","") if strnum == "off": wait["autoCancel"]["on"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"Invitation refused turned off\nTo turn on please specify the number of people and send") else: cl.sendText(msg.to,"关了邀请拒绝。要时开请指定人数发送") else: num = int(strnum) wait["autoCancel"]["on"] = True if wait["lang"] == "JP": cl.sendText(msg.to,strnum + "The group of people and below decided to automatically refuse invitation") else: cl.sendText(msg.to,strnum + "使人以下的小组用自动邀请拒绝") except: if wait["lang"] == "JP": cl.sendText(msg.to,"Value is wrong") else: cl.sendText(msg.to,"Bizarre ratings") elif msg.text in ["強制自動退出:オン","Leave on","Auto leave:on","強制自動退出:開"]: if msg.from_ in admin: if wait["leaveRoom"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") else: wait["leaveRoom"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了开。") elif msg.text in ["強制自動退出:オフ","Leave off","Auto leave:off","強制自動退出:關"]: if msg.from_ in admin: if wait["leaveRoom"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done") else: wait["leaveRoom"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"already") elif msg.text in ["共有:オン","Share on","Share on"]: if msg.from_ in admin: if wait["timeline"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") else: wait["timeline"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了开。") elif msg.text in ["共有:オフ","Share off","Share off"]: if msg.from_ in admin: if wait["timeline"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done") else: wait["timeline"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了关断。") elif "album merit " in msg.text: gid = msg.text.replace("album merit ","") album = cl.getAlbum(gid) if album["result"]["items"] == []: if wait["lang"] == "JP": cl.sendText(msg.to,"There is no album") else: cl.sendText(msg.to,"相册没在。") else: if wait["lang"] == "JP": mg = "The following is the target album" else: mg = "以下是对象的相册" for y in album["result"]["items"]: if "photoCount" in y: mg += str(y["title"]) + ":" + str(y["photoCount"]) + "sheet\n" else: mg += str(y["title"]) + ":0sheet\n" cl.sendText(msg.to,mg) elif "album " in msg.text: gid = msg.text.replace("album ","") album = cl.getAlbum(gid) if album["result"]["items"] == []: if wait["lang"] == "JP": cl.sendText(msg.to,"There is no album") else: cl.sendText(msg.to,"相册没在。") else: if wait["lang"] == "JP": mg = "The following is the target album" else: mg = "以下是对象的相册" for y in album["result"]["items"]: if "photoCount" in y: mg += str(y["title"]) + ":" + str(y["photoCount"]) + "sheet\n" else: mg += str(y["title"]) + ":0sheet\n" elif "album remove " in msg.text: gid = msg.text.replace("album remove ","") albums = cl.getAlbum(gid)["result"]["items"] i = 0 if albums != []: for album in albums: cl.deleteAlbum(gid,album["id"]) i += 1 if wait["lang"] == "JP": cl.sendText(msg.to,str(i) + "Deleted albums") else: cl.sendText(msg.to,str(i) + "åˆ é™¤äº†äº‹çš„ç›¸å†Œã€‚") elif msg.text in ["Group id","群組全id"]: gid = cl.getGroupIdsJoined() h = "" for i in gid: h += "[%s]:%s\n" % (cl.getGroup(i).name,i) cl.sendText(msg.to,h) # elif msg.text in ["Saan Cancelall","Cancelall"]: # gid = cl.getGroupIdsInvited() # for i in gid: # cl.rejectGroupInvitation(i) # if wait["lang"] == "JP": # cl.sendText(msg.to,"All invitations have been refused") # else: # cl.sendText(msg.to,"拒绝了全部的邀请。") elif "album remove→" in msg.text: gid = msg.text.replace("album remove→","") albums = cl.getAlbum(gid)["result"]["items"] i = 0 if albums != []: for album in albums: cl.deleteAlbum(gid,album["id"]) i += 1 if wait["lang"] == "JP": cl.sendText(msg.to,str(i) + "Albums deleted") else: cl.sendText(msg.to,str(i) + "åˆ é™¤äº†äº‹çš„ç›¸å†Œã€‚") elif msg.text in ["è‡ªå‹•è¿½åŠ :オン","Add on","Auto add:on","è‡ªå‹•è¿½åŠ ï¼šé–‹"]: if msg.from_ in admin: if wait["autoAdd"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"already on") else: cl.sendText(msg.to,"done") else: wait["autoAdd"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了开。") elif msg.text in ["è‡ªå‹•è¿½åŠ :オフ","Add off","Auto add:off","è‡ªå‹•è¿½åŠ ï¼šé—œ"]: if msg.from_ in admin: if wait["autoAdd"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"already off") else: cl.sendText(msg.to,"done") else: wait["autoAdd"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了关断。") elif "Message change: " in msg.text: if msg.from_ in admin: wait["message"] = msg.text.replace("Message change: ","") cl.sendText(msg.to,"message changed") elif "Message add: " in msg.text: if msg.from_ in admin: wait["message"] = msg.text.replace("Message add: ","") if wait["lang"] == "JP": cl.sendText(msg.to,"message changed") else: cl.sendText(msg.to,"done。") elif msg.text in ["Message","è‡ªå‹•è¿½åŠ å•å€™èªžç¢ºèª"]: if msg.from_ in admin: if wait["lang"] == "JP": cl.sendText(msg.to,"message change to\n\n" + wait["message"]) else: cl.sendText(msg.to,"The automatic appending information is set as followsã���‚\n\n" + wait["message"]) elif "Comment:" in msg.text: if msg.from_ in admin: c = msg.text.replace("Comment:","") if c in [""," ","\n",None]: cl.sendText(msg.to,"message changed") else: wait["comment"] = c cl.sendText(msg.to,"changed\n\n" + c) elif "Add comment:" in msg.text: if msg.from_ in admin: c = msg.text.replace("Add comment:","") if c in [""," ","\n",None]: cl.sendText(msg.to,"String that can not be changed") else: wait["comment"] = c cl.sendText(msg.to,"changed\n\n" + c) elif msg.text in ["コメント:オン","Comment on","Comment:on","è‡ªå‹•é¦–é ç•™è¨€ï¼šé–‹"]: if msg.from_ in admin: if wait["commentOn"] == True: if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"already on") else: wait["commentOn"] = True if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了开。") elif msg.text in ["コメント:オフ","Comment on","Comment off","è‡ªå‹•é¦–é ç•™è¨€ï¼šé—œ"]: if msg.from_ in admin: if wait["commentOn"] == False: if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"already off") else: wait["commentOn"] = False if wait["lang"] == "JP": cl.sendText(msg.to,"done") else: cl.sendText(msg.to,"要了关断。") elif msg.text in ["Comment","留言ç¢��認"]: cl.sendText(msg.to,"message changed to\n\n" + str(wait["comment"])) elif msg.text in ["Gurl"]: if msg.from_ in admin: if msg.toType == 2: x = cl.getGroup(msg.to) if x.preventJoinByTicket == True: x.preventJoinByTicket = False cl.updateGroup(x) gurl = cl.reissueGroupTicket(msg.to) cl.sendText(msg.to,"line://ti/g/" + gurl) else: if wait["lang"] == "JP": cl.sendText(msg.to,"Can't be used outside the group") else: cl.sendText(msg.to,"Not for use less than group") elif msg.text in ["Cv1 gurl"]: if msg.from_ in admin: if msg.toType == 2: x = cl.getGroup(msg.to) if x.preventJoinByTicket == True: x.preventJoinByTicket = False cl.updateGroup(x) gurl = cl.reissueGroupTicket(msg.to) cl.sendText(msg.to,"line://ti/g/" + gurl) else: if wait["lang"] == "JP": cl.sendText(msg.to,"Can't be used outside the group") else: cl.sendText(msg.to,"Not for use less than group") elif msg.text in ["Cv2 gurl"]: if msg.from_ in admin: if msg.toType == 2: x = cl.getGroup(msg.to) if x.preventJoinByTicket == True: x.preventJoinByTicket = False cl.updateGroup(x) gurl = cl.reissueGroupTicket(msg.to) cl.sendText(msg.to,"line://ti/g/" + gurl) else: if wait["lang"] == "JP": cl.sendText(msg.to,"Can't be used outside the group") else: cl.sendText(msg.to,"Not for use less than group") elif msg.text in ["Cv3 gurl"]: if msg.from_ in admin: if msg.toType == 2: x = cl.getGroup(msg.to) if x.preventJoinByTicket == True: x.preventJoinByTicket = False cl.updateGroup(x) gurl = cl.reissueGroupTicket(msg.to) cl.sendText(msg.to,"line://ti/g/" + gurl) else: if wait["lang"] == "JP": cl.sendText(msg.to,"Can't be used outside the group") else: cl.sendText(msg.to,"Not for use less than group") elif msg.text in ["Comment bl "]: wait["wblack"] = True cl.sendText(msg.to,"add to comment bl") elif msg.text in ["Comment wl "]: wait["dblack"] = True cl.sendText(msg.to,"wl to comment bl") elif msg.text in ["Comment bl confirm"]: if wait["commentBlack"] == {}: cl.sendText(msg.to,"confirmed") else: cl.sendText(msg.to,"Blacklist") mc = "" for mi_d in wait["commentBlack"]: mc += "" +cl.getContact(mi_d).displayName + "\n" cl.sendText(msg.to,mc) elif msg.text in ["Jam on"]: if msg.from_ in owner: if wait["clock"] == True: cl.sendText(msg.to,"already on") else: wait["clock"] = True now2 = datetime.now() nowT = datetime.strftime(now2,"(%H:%M)") profile = cl.getProfile() profile.displayName = wait["cName"] + nowT cl.updateProfile(profile) cl.sendText(msg.to,"done") elif msg.text in ["Jam off"]: if msg.from_ in owner: if wait["clock"] == False: cl.sendText(msg.to,"already off") else: wait["clock"] = False cl.sendText(msg.to,"done") elif msg.text in ["Change clock "]: if msg.from_ in owner: n = msg.text.replace("Change clock ","") if len(n.decode("utf-8")) > 13: cl.sendText(msg.to,"changed") else: wait["cName"] = n cl.sendText(msg.to,"changed to\n\n" + n) elif "Upname:" in msg.text: if msg.from_ in owner: string = msg.text.replace("Upname:","") if len(string.decode('utf-8')) <= 500: profile = cl.getProfile() profile.displayName = string cl.updateProfile(profile) cl.sendText(msg.to,"The name " + string + " I did NI change。") elif msg.text in ["Up"]: if msg.from_ in owner: if wait["cName"] == True: profile = cl.getProfile() profile.displayName = wait["cName"] cl.updateProfile(profile) cl.sendText(msg.to,"Name Update!") else: cl.sendText(msg.to,"Please turn on the name clock") elif msg.text == "$set": cl.sendText(msg.to, "Check sider") try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] except: pass wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['ROM'][msg.to] = {} print wait2 elif msg.text == "$read": if msg.to in wait2['readPoint']: if wait2["ROM"][msg.to].items() == []: chiya = "" else: chiya = "" for rom in wait2["ROM"][msg.to].items(): print rom chiya += rom[1] + "\n" cl.sendText(msg.to, "People who readed %s\nthat's it\n\nPeople who have ignored reads\n%sIt is abnormal ♪\n\nReading point creation date n time:\n[%s]" % (wait2['readMember'][msg.to],chiya,setTime[msg.to])) else: cl.sendText(msg.to, "An already read point has not been set.\n「set」you can send ♪ read point will be created ♪") elif msg.text == "Cctv": cl.sendText(msg.to, "Cek CCTV") try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] except: pass now2 = datetime.now() wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.strftime(now2,"%H:%M") wait2['ROM'][msg.to] = {} print wait2 elif msg.text == "Ciduk": if msg.to in wait2['readPoint']: if wait2["ROM"][msg.to].items() == []: chiya = "" else: chiya = "" for rom in wait2["ROM"][msg.to].items(): print rom chiya += rom[1] + "\n" cl.sendText(msg.to, "||Di Read Oleh||%s\n||By : Saan BOT||\n\n>Pelaku CCTV<\n%s-=CCTV=-\n•Bintitan\n•Panuan\n•Kurapan\n•Kudisan\n\nAmiin Ya Allah\n[%s]" % (wait2['readMember'][msg.to],chiya,setTime[msg.to])) else: cl.sendText(msg.to, "Ketik Cctv dulu Koplak\nBaru Ketil Ciduk\nDASAR PIKUN ♪") elif "Set member: " in msg.text: if msg.from_ in admin: jml = msg.text.replace("Set member: ","") wait["Members"] = int(jml) cl.sendText(msg.to, "Jumlah minimal member telah di set : "+jml) #-------Cek sider biar mirip kek siri----------------------------- elif "Setlastpoint" in msg.text: if msg.to in wait2['readPoint']: try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] del wait2['setTime'][msg.to] except: pass wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.now().strftime('%H:%M:%S') wait2['ROM'][msg.to] = {} with open('sider.json', 'w') as fp: json.dump(wait2, fp, sort_keys=True, indent=4) cl.sendText(msg.to,"Set the lastseens' point(`・ω・´)\n\n" + datetime.now().strftime('%H:%M:%S')) else: try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] del wait2['setTime'][msg.to] except: pass wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.now().strftime('%H:%M:%S') wait2['ROM'][msg.to] = {} with open('sider.json', 'w') as fp: json.dump(wait2, fp, sort_keys=True, indent=4) cl.sendText(msg.to, "Set reading point:\n" + datetime.now().strftime('%H:%M:%S')) print wait2 elif "csider off" == msg.text.lower(): if msg.to not in wait2['readPoint']: cl.sendText(msg.to,"Cek Sider already off") else: try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] del wait2['setTime'][msg.to] except: pass cl.sendText(msg.to, "Delete reading point:\n" + datetime.now().strftime('%H:%M:%S')) elif "Viewlastseen" in msg.text: if msg.to in wait2['readPoint']: if wait2["ROM"][msg.to].items() == []: cl.sendText(msg.to, "Sider:\nNone") else: chiya = [] for rom in wait2["ROM"][msg.to].items(): chiya.append(rom[1]) cmem = cl.getContacts(chiya) zx = "" zxc = "" zx2 = [] xpesan = 'Lurkers:\n' for x in range(len(cmem)): xname = str(cmem[x].displayName) pesan = '' pesan2 = pesan+"@a\n" xlen = str(len(zxc)+len(xpesan)) xlen2 = str(len(zxc)+len(pesan2)+len(xpesan)-1) zx = {'S':xlen, 'E':xlen2, 'M':cmem[x].mid} zx2.append(zx) zxc += pesan2 msg.contentType = 0 print zxc msg.text = xpesan+ zxc + "\nLurking time: %s\nCurrent time: %s"%(wait2['setTime'][msg.to],datetime.now().strftime('%H:%M:%S')) lol ={'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')+'}')} print lol msg.contentMetadata = lol try: cl.sendMessage(msg) except Exception as error: print error pass else: cl.sendText(msg.to, "Lurking has not been set.") elif msg.text == "check": cl.sendText(msg.to, "I have set a read point ♪\n「lihat」I will show you who I have read ♪") try: del wait2['readPoint'][msg.to] del wait2['readMember'][msg.to] except: pass wait2['readPoint'][msg.to] = msg.id wait2['readMember'][msg.to] = "" wait2['setTime'][msg.to] = datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S') wait2['ROM'][msg.to] = {} print wait if msg.text == "lihat": if msg.to in wait2['readPoint']: if wait2["ROM"][msg.to].items() == []: chiya = "" else: chiya = "" for rom in wait2["ROM"][msg.to].items(): print rom chiya += rom[1] + "\n" cl.sendText(msg.to, "People who readed %s\nthat's it\n\nPeople who have ignored reads\n%sIt is abnormal ♪\n\nReading point creation date n time:\n[%s]" % (wait2['readMember'][msg.to],chiya,setTime[msg.to])) else: cl.sendText(msg.to, "An already read point has not been set.\n「check」you can send ♪ read point will be created ♪") #----------------------------------------------- #----------------------------------------------- elif "Contact bc " in msg.text: if msg.from_ in admin: print "BroadCast Done" bctxt = msg.text.replace("Contact bc ", "") n = cl.getAllContactIds() for people in n: cl.sendText(people, (bctxt)) elif "Spamcontact @" in msg.text: _name = msg.text.replace("Spamcontact @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) for g in gs.members: if _nametarget == g.displayName: cl.sendText(g.mid,"Spammed !") cl.sendText(g.mid,"Spammed !") cl.sendText(g.mid,"Spammed !") cl.sendText(g.mid,"Spammed !") cl.sendText(msg.to, "Done") print " Spammed !" #----------------------------------------------- elif msg.text in ["/out"]: if msg.toType == 2: ginfo = cl.getGroup(msg.to) try: cl.LeaveGroup(msg.to) except: pass elif "/keluar" in msg.text: if msg.toType == 2: ginfo = cl.getGroup(msg.to) try: c = Message(to=msg.to, from_=None, text=None, contentType=13) c.contentMetadata={'mid':'ud4082219b6754e7b610f84d07d3b436b'} cl.sendMessage(c) cl.leaveGroup(msg.to) except: pass #----------------------------------------------- elif msg.text in ["Kill"]: if msg.from_ in admin: if msg.toType == 2: group = cl.getGroup(msg.to) gMembMids = [contact.mid for contact in group.members] matched_list = [] for tag in wait["blacklist"]: matched_list+=filter(lambda str: str == tag, gMembMids) if matched_list == []: cl.sendText(msg.to,"Fuck You") cl.sendText(msg.to,"Fuck You") return for jj in matched_list: try: klist=[cl] kicker=random.choice(klist) kicker.kickoutFromGroup(msg.to,[jj]) print (msg.to,[jj]) except: pass elif msg.text in ["Woy","woy","Woi","woi","bot","Bot"]: quote = ['Istri yang baik itu Istri yang Mengizinkan Suaminya untuk Poligami 😂😂😂.','Kunci Untuk Bikin Suami Bahagia itu cuma satu..\nIzinkan Suamimu Untuk Selingkuh Coyyy ','Ah Kupret Lu','Muka Lu Kaya Jamban','Ada Orang kah disini?','Sange Euy','Ada Perawan Nganggur ga Coy?'] psn = random.choice(quote) cl.sendText(msg.to,psn) elif "haiii.." in msg.text: if msg.from_ in owner: if msg.toType == 2: print "ok" _name = msg.text.replace("haiii..","") gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) cl.sendText(msg.to,"「 Mayhem\nMayhem is STARTING♪\n' abort' to abort♪") cl.sendText(msg.to,"「 Mayhem 」\n46 victims shall yell hul·la·ba·loo♪\n/ˌhələbəˈlo͞o,ˈhələbəˌlo͞o/") targets = [] for g in gs.members: if _name in g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Tidak ditemukan") else: for target in targets: if not target in admin: try: klist=[cl,ki,kk,kc,k1,ks,ka,kb,ko,ke] kicker=random.choice(klist) kicker.kickoutFromGroup(msg.to,[target]) print (msg.to,[g.mid]) except: cl.sendText(msg.to,"Mayhem done") elif "Mayhem" in msg.text: if msg.from_ in owner: if msg.toType == 2: print "ok" _name = msg.text.replace("Mayhem","") gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) cl.sendText(msg.to,"「 Mayhem\nMayhem is STARTING♪\n' abort' to abort♪") cl.sendText(msg.to,"「 Mayhem 」\n46 victims shall yell hul·la·ba·loo♪\n/ˌhələbəˈlo͞o,ˈhələbəˌlo͞o/") targets = [] for g in gs.members: if _name in g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Tidak ditemukan") else: for target in targets: if not target in admin: try: klist=[cl,ki,kk,kc,k1,ks,ka,kb,ko,ke] kicker=random.choice(klist) kicker.kickoutFromGroup(msg.to,[target]) print (msg.to,[g.mid]) except: cl.sendText(msg.to,"Mayhem done") #----->Total Friend and Group<-----# elif msg.text in ["Result"]: mE = cl.getProfile() gT = cl.getGroupIdsJoined() fT = cl.getAllContactIds() ginv = cl.getGroupIdsInvited() cl.sendText(msg.to,"「"+mE.displayName+"」 \n\nGroup total : " + str(len(gT))+ "\nFriend total: " +str(len(fT))+ "\nPending Group: " + str(len(ginv))) elif msg.text in ["/ListGroup"]: if msg.from_ in admin: gid = cl.getGroupIdsJoined() h = "===[List Groups]===" total = str(len(gid)) for i in gid: if i is not None: try: groups = cl.getGroup(i) if groups.members is not None: members = str(len(groups.members)) else: members = "0" if groups.invitee is not None: pendings = str(len(groups.invitee)) else: pendings = "0" h += "\n[" + groups.name + "] ->(" + members +")\n -+GroupID : " + i except: break else: break if gid is not None: cl.sendText(msg.to,h + "\n|[Total Groups]| : " + str(total)) else: cl.sendText(msg.to,"Tidak ada grup saat ini") ginv = cl.getGroupIdsInvited() j = "===[List Groups Invited]===" totals = str(len(ginv)) for z in ginv: if z is not None: try: groups = cl.getGroup(z) if groups.members is not None: members = str(len(groups.members)) else: members = "0" if groups.invitee is not None: pendings = str(len(groups.invitee)) else: pendings = "0" j += "\n[" + groups.name + "] ->(" + members + ")\n -+GroupID : " + i except: break else: break if ginv is not None: cl.sendText(msg.to,j + "\n|[Total Groups Invited]| : " + str(totals)) else: cl.sendText(msg.to,"Tidak ada grup tertunda saat ini") #List details group *Termasuk yang tertunda + gid + jmlh member + jmlh pendingan + creator elif msg.text in ["List group"]: if msg.from_ in admin: gid = cl.getGroupIdsJoined() h = "" for i in gid: h += "║❂͜͡➣【%s】\n" % (cl.getGroup(i).name +"→["+str(len(cl.getGroup(i).members))+"]") cl.sendText(msg.to,"▒▒▓█[List Group]█▓▒▒\n"+ h +"Total Group =" +"["+str(len(gid))+"]") elif msg.text in ["/ListDetailsGroup"]: if msg.from_ in admin: gid = cl.getGroupIdsJoined() cl.sendText(msg.to,"===[List Details Group]===") total = str(len(gid)) for i in gid: if i is not None: try: groups = cl.getGroup(i) if groups.members is not None: members = str(len(groups.members)) else: members = "0" if groups.invitee is not None: pendings = str(len(groups.invitee)) else: pendings = "0" h = "[" + groups.name + "]\n -+GroupID : " + i + "\n -+Members : " + members + "\n -+MembersPending : " + pendings + "\n -+Creator : " + groups.creator.displayName except: break else: break if gid is not None: cl.sendText(msg.to,h) cl.sendText(msg.to,"|[Total Groups]| : " + str(total)) else: cl.sendText(msg.to,"Tidak ada grup saat ini") ginv = cl.getGroupIdsInvited() cl.sendText(msg.to,"===[List Details Groups Invited]===") totals = str(len(ginv)) for z in ginv: if z is not None: try: groups = cl.getGroup(z) if groups.members is not None: members = str(len(groups.members)) else: members = "0" if groups.invitee is not None: pendings = str(len(groups.invitee)) else: pendings = "0" j = "[" + groups.name + "]\n -+GroupID : " + i + "\n -+Members : " + members + "\n -+MembersPending : " + pendings + "\n -+Creator : " + groups.creator.displayName except: break else: break if ginv is not None: cl.sendText(msg.to,j) cl.sendText(msg.to,"|[Total Groups Invited]| : " + str(totals)) else: cl.sendText(msg.to,"Tidak ada grup tertunda saat ini") #Details grup lewat gid + gid + jmlh member + jmlh pendingan + creator + picture elif "/DetailsGroup: " in msg.text: if msg.from_ in admin: gid = msg.text.replace("/DetailsGroup: ","") if gid in [""," "]: cl.sendText(msg.to,"Grup id tidak valid") else: try: groups = cl.getGroup(gid) if groups.members is not None: members = str(len(groups.members)) else: members = "0" if groups.invitee is not None: pendings = str(len(groups.invitee)) else: pendings = "0" h = "[" + groups.name + "]\n -+GroupID : " + gid + "\n -+Members : " + members + "\n -+MembersPending : " + pendings + "\n -+Creator : " + groups.creator.displayName + "\n -+GroupPicture : http://dl.profile.line.naver.jp/" + groups.pictureStatus cl.sendText(msg.to,h) except Exception as error: cl.sendText(msg.to,(error)) elif "Gbcont" in msg.text: if msg.from_ in admin: print "[Group Broadcast Execute]" n = cl.getGroupIdsJoined() Oa = 'ud4082219b6754e7b610f84d07d3b436b' for people in n: cl.sendKontok(people, Oa) elif "Gbc " in msg.text: if msg.from_ in admin: print "[Group Broadcast Execute]" bctxt = msg.text.replace("Gbc ","") n = cl.getGroupIdsJoined() Oa = 'ud4082219b6754e7b610f84d07d3b436b' for people in n: cl.sendText(people, bctxt) cl.sendKontok(people, Oa) elif "Allbc " in msg.text: if msg.from_ in owner: print "[All Bot Broadcast to Group Execute]" bctxt = msg.text.replace("Allbc ","") a = cl.getGroupIdsJoined() for taf in a: cl.sendText(taf,"[Broadcast]"+ (bctxt)) elif "Nk " in msg.text: if msg.from_ in admin: nk0 = msg.text.replace("Nk ","") nk1 = nk0.lstrip() nk2 = ncl.replace("@","") nk3 = nk2.rstrip() _name = nk3 gs = cl.getGroup(msg.to) targets = [] for s in gs.members: if _name in s.displayName: targets.append(s.mid) if targets == []: sendMessage(msg.to,"user does not exist") pass else: for target in targets: try: klist=[cl,ki,kk,kc,k1,ks,ka,kb,ko,ke] kicker=random.choice(klist) kicker.kickoutFromGroup(msg.to,[target]) print (msg.to,[g.mid]) except: cl.sendText(msg.to,"Succes Cv") cl.sendText(msg.to,"Fuck You") elif "Blacklist @ " in msg.text: if msg.from_ in admin: _name = msg.text.replace("Blacklist @ ","") _kicktarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _kicktarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found") else: for target in targets: try: wait["blacklist"][target] = True f=codecs.open('st2__b.json','w','utf-8') json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) cl.sendText(msg.to,"Succes Cv") except: cl.sendText(msg.to,"error") elif "Ban @" in msg.text: if msg.from_ in admin: if msg.toType == 2: print "[Ban]ok" _name = msg.text.replace("Ban @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found Cv") else: for target in targets: try: wait["blacklist"][target] = True f=codecs.open('st2__b.json','w','utf-8') json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) cl.sendText(msg.to,"Succes Cv") except: cl.sendText(msg.to,"Error") elif "Unban @" in msg.text: if msg.from_ in admin: if msg.toType == 2: print "[Unban]ok" _name = msg.text.replace("Unban @","") _nametarget = _name.rstrip(' ') gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) gs = cl.getGroup(msg.to) targets = [] for g in gs.members: if _nametarget == g.displayName: targets.append(g.mid) if targets == []: cl.sendText(msg.to,"Not found Cv") else: for target in targets: try: del wait["blacklist"][target] f=codecs.open('st2__b.json','w','utf-8') json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) cl.sendText(msg.to,"Succes Cv") except: cl.sendText(msg.to,"Succes Cv") #----------------------------------------------- elif msg.text in ["Test"]: cl.sendText(msg.to,"Ok Cv 􀨁􀄻double thumbs up􏿿") cl.sendText(msg.to,"Ok Cv 􀨁􀄻double thumbs up􏿿") cl.sendText(msg.to,"Ok Cv 􀨁􀄻double thumbs up􏿿") #----------------------------------------------- elif "Bc " in msg.text: bctxt = msg.text.replace("Bc ","") cl.sendText(msg.to,(bctxt)) cl.sendText(msg.to,(bctxt)) cl.sendText(msg.to,(bctxt)) #----------------------------------------------- elif msg.text in ["Cv say hi"]: cl.sendText(msg.to,"Hi buddy 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Hi buddy 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Hi buddy 􀜁􀅔Har Har􏿿") #----------------------------------------------- elif msg.text in ["Cv say hinata pekok"]: cl.sendText(msg.to,"Hinata pekok 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Hinata pekok 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Hinata pekok 􀜁􀅔Har Har􏿿") elif msg.text in ["Cv say didik pekok"]: cl.sendText(msg.to,"Didik pekok 􀜁􀅔Har Har����") cl.sendText(msg.to,"Didik pekok 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Didik pekok 􀜁􀅔Har Har􏿿") elif msg.text in ["Cv say bobo ah","Bobo dulu ah"]: cl.sendText(msg.to,"Have a nice dream Cv 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Have a nice dream Cv 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Have a nice dream Cv 􀜁􀅔Har Har��") elif msg.text in ["Cv say chomel pekok"]: cl.sendText(msg.to,"Chomel pekok 􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"Chomel pekok 􀜁􀅔Har Har����") cl.sendText(msg.to,"Chomel pekok 􀜁􀅔Har Har􏿿") elif msg.text in ["#welcome"]: cl.sendText(msg.to,"Selamat datang di Saan Bot Family Room") cl.sendText(msg.to,"Jangan nakal ok!") #----------------------------------------------- elif msg.text in ["PING","Ping","ping"]: cl.sendText(msg.to,"PONG 􀨁􀄻double thumbs up􏿿􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"PONG 􀨁􀄻double thumbs up􏿿􀜁􀅔Har Har􏿿") cl.sendText(msg.to,"PONG ��􀄻double thumbs up􏿿􀜁􀅔Har Har􏿿") #----------------------------------------------- elif msg.text in ["Respon","respon"]: cl.sendText(msg.to,"hadir!") #----------------------------------------------- elif msg.text in ["Sp","Speed","speed"]: start = time.time() cl.sendText(msg.to, "Progress...") elapsed_time = time.time() - start cl.sendText(msg.to, "%sseconds" % (elapsed_time)) #------------------------------------------------------------------ # ----------------- BAN MEMBER BY TAG 2TAG ATAU 10TAG MEMBER elif "mention" == msg.text.lower(): group = cl.getGroup(msg.to) nama = [contact.mid for contact in group.members] nm1, nm2, nm3, nm4, nm5, jml = [], [], [], [], [], len(nama) if jml <= 100: summon(msg.to, nama) if jml > 100 and jml < 200: for i in range(0, 99): nm1 += [nama[i]] summon(msg.to, nm1) for j in range(100, len(nama)-1): nm2 += [nama[j]] summon(msg.to, nm2) if jml > 200 and jml < 500: for i in range(0, 99): nm1 += [nama[i]] summon(msg.to, nm1) for j in range(100, 199): nm2 += [nama[j]] summon(msg.to, nm2) for k in range(200, 299): nm3 += [nama[k]] summon(msg.to, nm3) for l in range(300, 399): nm4 += [nama[l]] summon(msg.to, nm4) for m in range(400, len(nama)-1): nm5 += [nama[m]] summon(msg.to, nm5) if jml > 500: print "Terlalu Banyak Men 500+" cnt = Message() cnt.text = "Jumlah:\n" + str(jml) + " Members" cnt.to = msg.to cl.sendMessage(cnt) elif msg.text.lower() in ["tmention"]: sendMessageWithMention(msg.to, msg.from_) elif msg.text.lower() in ["mention all"]: group = cl.getGroup(msg.to) nama = [contact.mid for contact in group.members] nm1, nm2, nm3, nm4, nm5, jml = [], [], [], [], [], len(nama) if jml <= 100: mention(msg.to, nama) if jml > 100 and jml < 200: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, len(nama)): nm2 += [nama[j]] mention(msg.to, nm2) if jml > 200 and jml < 300: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, 200): nm2 += [nama[j]] mention(msg.to, nm2) for k in range(201, len(nama)): nm3 += [nama[k]] mention(msg.to, nm3) if jml > 300 and jml < 400: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, 200): nm2 += [nama[j]] mention(msg.to, nm2) for k in range(201, 300): nm3 += [nama[k]] mention(msg.to, nm3) for l in range(301, len(nama)): nm4 += [nama[l]] mention(msg.to, nm4) if jml > 400 and jml < 500: for i in range(0, 100): nm1 += [nama[i]] mention(msg.to, nm1) for j in range(101, 200): nm2 += [nama[j]] mention(msg.to, nm2) for k in range(201, 300): nm3 += [nama[k]] mention(msg.to, nm3) for l in range(301, 400): nm4 += [nama[l]] mention(msg.to, nm4) for h in range(401, len(nama)): nm5 += [nama[h]] mention(msg.to, nm5) if jml > 500: cl.sendText(msg.to,'Member melebihi batas.') cnt = Message() cnt.text = "Done : " + str(jml) + " Members" cnt.to = msg.to cl.sendMessage(cnt) elif ("Ban repeat " in msg.text): if msg.from_ in admin: key = eval(msg.contentMetadata["MENTION"]) key["MENTIONEES"][0]["M"] targets = [] for x in key["MENTIONEES"]: targets.append(x["M"]) for target in targets: try: wait["blacklist"][target] = True f=codecs.open('st2__b.json','w','utf-8') json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False) cl.sendText(msg.to,"Succes Banned ") except: pass elif msg.text in ["Ban"]: if msg.from_ in admin: wait["wblacklist"] = True cl.sendText(msg.to,"send contact") elif msg.text in ["Unban"]: if msg.from_ in admin: wait["dblacklist"] = True cl.sendText(msg.to,"send contact") elif "Clear banlist" in msg.text: if msg.from_ in admin: wait["blacklist"] = {} cl.sendText(msg.to,"Done") elif msg.text in ["Banlist"]: if msg.from_ in admin: if wait["blacklist"] == {}: cl.sendText(msg.to,"nothing") else: cl.sendText(msg.to,"Blacklist user") mc = "" for mi_d in wait["blacklist"]: mc += "☠。" +cl.getContact(mi_d).displayName + "\n" cl.sendText(msg.to,mc) elif msg.text in ["Conban","Contactban","Contact ban"]: if wait["blacklist"] == {}: cl.sendText(msg.to,"Tidak Ada Blacklist") else: cl.sendText(msg.to,"Daftar Blacklist") h = "" for i in wait["blacklist"]: h = cl.getContact(i) M = Message() M.to = msg.to M.contentType = 13 M.contentMetadata = {'mid': i} cl.sendMessage(M) elif msg.text in ["Cek ban"]: if msg.from_ in admin: if msg.toType == 2: group = cl.getGroup(msg.to) gMembMids = [contact.mid for contact in group.members] matched_list = [] for tag in wait["blacklist"]: matched_list+=filter(lambda str: str == tag, gMembMids) cocoa = "" for mm in matched_list: cocoa += mm + "\n" cl.sendText(msg.to,cocoa + "") elif msg.text in ["Kill ban"]: if msg.from_ in admin: if msg.toType == 2: group = cl.getGroup(msg.to) gMembMids = [contact.mid for contact in group.members] matched_list = [] for tag in wait["blacklist"]: matched_list+=filter(lambda str: str == tag, gMembMids) if matched_list == []: cl.sendText(msg.to,"There was no blacklist user") return for jj in matched_list: cl.kickoutFromGroup(msg.to,[jj]) cl.kickoutFromGroup(msg.to,[jj]) cl.kickoutFromGroup(msg.to,[jj]) cl.kickoutFromGroup(msg.to,[jj]) cl.sendText(msg.to,"Blacklist emang pantas tuk di usir") # elif msg.text in ["Clear"]: # if msg.from_ in admin: # if msg.toType == 2: # group = cl.getGroup(msg.to) # gMembMids = [contact.mid for contact in group.invitee] # for _mid in gMembMids: # cl.cancelGroupInvitation(msg.to,[_mid]) # cl.sendText(msg.to,"I pretended to cancel and canceled.") elif "random:" in msg.text: if msg.from_ in admin: if msg.toType == 2: strnum = msg.text.replace("random:","") source_str = 'abcdefghijklmnopqrstuvwxyz1234567890@:;./_][!&%$#)(=~^|' try: num = int(strnum) group = cl.getGroup(msg.to) for var in range(0,num): name = "".join([random.choice(source_str) for x in xrange(10)]) time.sleep(0.01) group.name = name cl.updateGroup(group) except: cl.sendText(msg.to,"Error") elif "album→" in msg.text: try: albumtags = msg.text.replace("album→","") gid = albumtags[:6] name = albumtags.replace(albumtags[:34],"") cl.createAlbum(gid,name) cl.sendText(msg.to,name + "created an album") except: cl.sendText(msg.to,"Error") elif "fakec→" in msg.text: try: source_str = 'abcdefghijklmnopqrstuvwxyz1234567890@:;./_][!&%$#)(=~^|' name = "".join([random.choice(source_str) for x in xrange(10)]) anu = msg.text.replace("fakec→","") cl.sendText(msg.to,str(cl.channel.createAlbum(msg.to,name,anu))) except Exception as e: try: cl.sendText(msg.to,str(e)) except: pass if op.type == 55: try: if op.param1 in wait2['readPoint']: if op.param2 in wait2['readMember'][op.param1]: pass else: wait2['readMember'][op.param1] += op.param2 wait2['ROM'][op.param1][op.param2] = op.param2 with open('sider.json', 'w') as fp: json.dump(wait2, fp, sort_keys=True, indent=4) else: pass except: pass if op.type == 55: try: if op.param1 in wait2['readPoint']: Name = cl.getContact(op.param2).displayName if Name in wait2['readMember'][op.param1]: pass else: wait2['readMember'][op.param1] += "\n☀。" + Name wait2['ROM'][op.param1][op.param2] = "☠。" + Name else: cl.sendText except: pass if op.type == 26: msg = op.message msg.text = str(msg.text) text = msg.text try: if msg.contentType == 0: try: if msg.to in wait2['readPoint']: if msg.from_ in wait2["ROM"][msg.to]: del wait2["ROM"][msg.to][msg.from_] else: pass except: pass else: pass except KeyboardInterrupt: sys.exit(0) except Exception as error: print error print ("\n\nRECEIVE_MESSAGE\n\n") return if op.type == 59: print op except Exception as error: print error def autolike(): count = 1 while True: try: for posts in cl.activity(1)["result"]["posts"]: if posts["postInfo"]["liked"] is False: if wait["likeOn"] == True: cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) print "Like" if wait["commentOn"] == True: if posts["userInfo"]["writerMid"] in wait["commentBlack"]: pass else: cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) except: count += 1 if(count == 50): sys.exit(0) else: pass def autoSta(): count = 1 while True: try: for posts in cl.activity(1)["result"]["posts"]: if posts["postInfo"]["liked"] is False: if wait["likeOn"] == True: cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001) if wait["commentOn"] == True: if posts["userInfo"]["writerMid"] in wait["commentBlack"]: pass else: cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["commenty"]) except: count += 1 if(count == 50): sys.exit(0) else: pass thread1 = threading.Thread(target=autoSta) thread1.daemon = True thread1.start() def a2(): now2 = datetime.now() nowT = datetime.strftime(now2,"%M") if nowT[14:] in ["10","20","30","40","50","00"]: return False else: return True def nameUpdate(): while True: try: #while a2(): #pass if wait["clock"] == True: now2 = datetime.now() nowT = datetime.strftime(now2,"(%H:%M)") profile = cl.getProfile() profile.displayName = wait["cName"] + nowT cl.updateProfile(profile) time.sleep(600) except: pass thread2 = threading.Thread(target=nameUpdate) thread2.daemon = True thread2.start() while True: try: Ops = cl.fetchOps(cl.Poll.rev, 5) except EOFError: raise Exception("It might be wrong revision\n" + str(cl.Poll.rev)) for Op in Ops: if (Op.type != OpType.END_OF_OPERATION): cl.Poll.rev = max(cl.Poll.rev, Op.revision) bot(Op)
50.420003
4,030
0.414785
29,915
288,352
4.026843
0.072205
0.040012
0.060865
0.06998
0.758972
0.722678
0.697227
0.673742
0.646921
0.615027
0.000101
0.028364
0.433904
288,352
5,718
4,031
50.428821
0.700162
0
0
0.650411
0
0.012534
0.184475
0.025638
0.000979
0
0
0
0
0
null
null
0.012926
0.003917
null
null
0.02076
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
1b92eceb9ba869f38b20eb34bce82ed5f6e6bbd4
357
py
Python
fabobjects/__init__.py
abiolarasheed/fabobjects
f11f4670cc5744f08d90ec3d8212e184921e45f2
[ "MIT" ]
null
null
null
fabobjects/__init__.py
abiolarasheed/fabobjects
f11f4670cc5744f08d90ec3d8212e184921e45f2
[ "MIT" ]
null
null
null
fabobjects/__init__.py
abiolarasheed/fabobjects
f11f4670cc5744f08d90ec3d8212e184921e45f2
[ "MIT" ]
1
2018-12-17T16:32:14.000Z
2018-12-17T16:32:14.000Z
# coding: utf-8 from __future__ import unicode_literals from apps.django import DjangoApp from apps.git import GitRepo from apps.nginx import NginxServer from apps.postgres import PGBouncer, PostgresServer, PostgresServerReplica from apps.redis import RedisServer, RedisSslClient from fabobjects.distros import BSD, CentOS, Debian, FreeBsd, RedHat, Ubuntu
35.7
75
0.840336
46
357
6.413043
0.652174
0.135593
0
0
0
0
0
0
0
0
0
0.003155
0.112045
357
9
76
39.666667
0.927445
0.036415
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
1bbaf0ccb44f82ef72ce92b347ee15806ffe5be4
99
py
Python
angr/procedures/testing/manyargs.py
Kyle-Kyle/angr
345b2131a7a67e3a6ffc7d9fd475146a3e12f837
[ "BSD-2-Clause" ]
6,132
2015-08-06T23:24:47.000Z
2022-03-31T21:49:34.000Z
angr/procedures/testing/manyargs.py
Kyle-Kyle/angr
345b2131a7a67e3a6ffc7d9fd475146a3e12f837
[ "BSD-2-Clause" ]
2,272
2015-08-10T08:40:07.000Z
2022-03-31T23:46:44.000Z
angr/procedures/testing/manyargs.py
Kyle-Kyle/angr
345b2131a7a67e3a6ffc7d9fd475146a3e12f837
[ "BSD-2-Clause" ]
1,155
2015-08-06T23:37:39.000Z
2022-03-31T05:54:11.000Z
import angr class manyargs(angr.SimProcedure): NO_RET = True def run(self): pass
12.375
34
0.636364
13
99
4.769231
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.282828
99
7
35
14.142857
0.873239
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0.2
0.2
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
1bc4b0b4f2755ca4ed8a7c00e1c80f181ef4867a
82
py
Python
example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/F/Faraday constant for conventional electric current.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
null
null
null
example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/F/Faraday constant for conventional electric current.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
null
null
null
example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/F/Faraday constant for conventional electric current.py
kuanpern/jupyterlab-snippets-multimenus
477f51cfdbad7409eab45abe53cf774cd70f380c
[ "BSD-3-Clause" ]
1
2021-02-04T04:51:48.000Z
2021-02-04T04:51:48.000Z
constants.physical_constants["Faraday constant for conventional electric current"]
82
82
0.878049
9
82
7.888889
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.060976
82
1
82
82
0.922078
0
0
0
0
0
0.60241
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
59fd94b12ec0eec6f022d5e1d82149a660214e5d
95
py
Python
server_py/flatgov/uscongress/app.py
aih/BillMap
d130b1396cb25b415cd7d9ea7389ad558a34eec1
[ "CC0-1.0" ]
2
2022-01-18T14:55:52.000Z
2022-01-31T03:38:39.000Z
server_py/flatgov/uscongress/app.py
aih/FlatGov
8201ef1813bbc062841421017f492e877f75a5f8
[ "CC0-1.0" ]
321
2020-09-01T16:20:35.000Z
2021-07-03T06:42:34.000Z
server_py/flatgov/uscongress/app.py
aih/FlatGov
8201ef1813bbc062841421017f492e877f75a5f8
[ "CC0-1.0" ]
1
2022-03-31T15:02:49.000Z
2022-03-31T15:02:49.000Z
from django.apps import AppConfig class UscongressConfig(AppConfig): name = 'uscongress'
15.833333
34
0.768421
10
95
7.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.157895
95
5
35
19
0.9125
0
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
941f6baef73a331b206f2bf57464e8de27e2e245
35
py
Python
tests/__init__.py
MUONetwork/uocli
2d88eb5f7df13ab10e285493bcc0c371c55965c9
[ "MIT" ]
null
null
null
tests/__init__.py
MUONetwork/uocli
2d88eb5f7df13ab10e285493bcc0c371c55965c9
[ "MIT" ]
null
null
null
tests/__init__.py
MUONetwork/uocli
2d88eb5f7df13ab10e285493bcc0c371c55965c9
[ "MIT" ]
null
null
null
"""Unit test package for uocli."""
17.5
34
0.657143
5
35
4.6
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
35
1
35
35
0.766667
0.8
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
94212196f61439f96872d1caf7ee94b6a39abcc8
115
py
Python
logic/const.py
nafuka11/dena-review
ce10f16f37d5f0d2d888c77bf252d718534ef401
[ "MIT" ]
null
null
null
logic/const.py
nafuka11/dena-review
ce10f16f37d5f0d2d888c77bf252d718534ef401
[ "MIT" ]
9
2021-12-13T13:58:59.000Z
2021-12-16T13:56:50.000Z
logic/const.py
nafuka11/dena-review
ce10f16f37d5f0d2d888c77bf252d718534ef401
[ "MIT" ]
null
null
null
from typing import Final from logic.point import Point BOARD_SIZE: Final = Point(7, 6) CONNECT_LENGTH: Final = 4
16.428571
31
0.765217
19
115
4.526316
0.684211
0
0
0
0
0
0
0
0
0
0
0.03125
0.165217
115
6
32
19.166667
0.864583
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
947c0d9bd2253c701d17ff1d3ed7101988338e0a
256
py
Python
server/__init__.py
CostaDiego/charging-distributed-system
2e5d20a063c2c2df25af7ca8640077647f981037
[ "MIT" ]
null
null
null
server/__init__.py
CostaDiego/charging-distributed-system
2e5d20a063c2c2df25af7ca8640077647f981037
[ "MIT" ]
null
null
null
server/__init__.py
CostaDiego/charging-distributed-system
2e5d20a063c2c2df25af7ca8640077647f981037
[ "MIT" ]
null
null
null
__all__ = ['transaction_server'] from os import path import sys root = path.abspath('..') if root not in sys.path: sys.path.append(root) from server.transaction_server import run as run_server from server.transaction_server import TransactionServer
21.333333
55
0.78125
37
256
5.189189
0.459459
0.265625
0.21875
0.28125
0.34375
0
0
0
0
0
0
0
0.136719
256
12
56
21.333333
0.868778
0
0
0
0
0
0.077821
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
94818c5afb4a2c9aa8459cb96453c3d7512e228f
554
py
Python
profit/dataset/splitters/__init__.py
ayushkarnawat/profit
f3c4d601078b52513af6832c3faf75ddafc59ac5
[ "MIT" ]
null
null
null
profit/dataset/splitters/__init__.py
ayushkarnawat/profit
f3c4d601078b52513af6832c3faf75ddafc59ac5
[ "MIT" ]
1
2021-09-15T13:13:12.000Z
2021-09-15T13:13:12.000Z
profit/dataset/splitters/__init__.py
ayushkarnawat/profit
f3c4d601078b52513af6832c3faf75ddafc59ac5
[ "MIT" ]
null
null
null
"""Split datasets into train, val, and test sets using different splitting techniques. """ from profit.dataset.splitters import base_splitter from profit.dataset.splitters import random_splitter from profit.dataset.splitters import stratified_splitter from profit.dataset.splitters.base_splitter import BaseSplitter from profit.dataset.splitters.random_splitter import RandomSplitter from profit.dataset.splitters.stratified_splitter import StratifiedSplitter split_method_dict = { 'random': RandomSplitter, 'stratified': StratifiedSplitter }
32.588235
75
0.837545
64
554
7.125
0.40625
0.131579
0.223684
0.342105
0.320175
0.175439
0
0
0
0
0
0
0.101083
554
16
76
34.625
0.915663
0.149819
0
0
0
0
0.034483
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
8467cda0731c2689e29cf387eb6300a78789fe2e
32
py
Python
PageObjectLibrary/version.py
rama-bornfree/simple-pageobject
6a66a256867f7b1604005818b12e7c9f8dc6c027
[ "Apache-2.0" ]
null
null
null
PageObjectLibrary/version.py
rama-bornfree/simple-pageobject
6a66a256867f7b1604005818b12e7c9f8dc6c027
[ "Apache-2.0" ]
null
null
null
PageObjectLibrary/version.py
rama-bornfree/simple-pageobject
6a66a256867f7b1604005818b12e7c9f8dc6c027
[ "Apache-2.0" ]
null
null
null
__version__ = "0.1.0.0-beta.1"
10.666667
30
0.625
7
32
2.285714
0.571429
0
0
0
0
0
0
0
0
0
0
0.178571
0.125
32
2
31
16
0.392857
0
0
0
0
0
0.451613
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
84681ef782fdda607e61d5ae1db63b722671bf0f
76
py
Python
fedrec/modules/transforms.py
ayush268/RecoEdge
b6554c646bae602704f44ae80571a4c319f90fd2
[ "Apache-2.0" ]
5
2022-02-27T17:01:17.000Z
2022-03-29T10:06:18.000Z
fedrec/modules/transforms.py
ayush268/RecoEdge
b6554c646bae602704f44ae80571a4c319f90fd2
[ "Apache-2.0" ]
16
2022-02-26T13:29:04.000Z
2022-03-29T08:20:01.000Z
fedrec/modules/transforms.py
ayush268/RecoEdge
b6554c646bae602704f44ae80571a4c319f90fd2
[ "Apache-2.0" ]
6
2022-03-04T14:53:11.000Z
2022-03-23T12:33:14.000Z
from torchvision import transforms transforms.ToTensor transforms.Normalize
19
34
0.894737
8
76
8.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.078947
76
4
35
19
0.971429
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
847284b8431162e0c72bc0da115b3c18938fdafb
98
py
Python
creel_portal/apps.py
AdamCottrill/CreelPortal
5ec867c4f11b4231c112e8209116b6b96c2830ec
[ "MIT" ]
null
null
null
creel_portal/apps.py
AdamCottrill/CreelPortal
5ec867c4f11b4231c112e8209116b6b96c2830ec
[ "MIT" ]
null
null
null
creel_portal/apps.py
AdamCottrill/CreelPortal
5ec867c4f11b4231c112e8209116b6b96c2830ec
[ "MIT" ]
null
null
null
from django.apps import AppConfig class CreelPortalConfig(AppConfig): name = 'creel_portal'
16.333333
35
0.77551
11
98
6.818182
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.153061
98
5
36
19.6
0.903614
0
0
0
0
0
0.122449
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
84ae2f52c360133d1eb38eae5429cbc5ce784223
432
py
Python
algorithms/medium/1410. HTML Entity Parser.py
MultivacX/letcode2020
f86289f8718237303918a7705ae31625a12b68f6
[ "MIT" ]
null
null
null
algorithms/medium/1410. HTML Entity Parser.py
MultivacX/letcode2020
f86289f8718237303918a7705ae31625a12b68f6
[ "MIT" ]
null
null
null
algorithms/medium/1410. HTML Entity Parser.py
MultivacX/letcode2020
f86289f8718237303918a7705ae31625a12b68f6
[ "MIT" ]
null
null
null
# 1410. HTML Entity Parser # Runtime: 52 ms, faster than 91.08% of Python3 online submissions for HTML Entity Parser. # Memory Usage: 14.4 MB, less than 100.00% of Python3 online submissions for HTML Entity Parser. class Solution: def entityParser(self, text: str) -> str: return text.replace('&quot;', '"').replace('&apos;', "'").replace('&gt;', '>').replace('&lt;', '<').replace('&frasl;', '/').replace('&amp;', '&')
54
153
0.643519
58
432
4.793103
0.672414
0.107914
0.172662
0.18705
0.323741
0.323741
0.323741
0.323741
0
0
0
0.054496
0.150463
432
8
153
54
0.702997
0.481481
0
0
0
0
0.171946
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
84bf5ef09b467516295fd2b669794bb8cc00f304
85
py
Python
UI/flask_ownstorj/ownstorj/__init__.py
lakewik/storj-gui-client
9eef7717a72cce8b46f971d8cf1dbe4561d6cb2c
[ "MIT" ]
40
2017-03-23T19:42:32.000Z
2017-07-13T23:43:00.000Z
UI/flask_ownstorj/ownstorj/__init__.py
Abd-Elrazek/EasyStorj
9eef7717a72cce8b46f971d8cf1dbe4561d6cb2c
[ "MIT" ]
80
2017-04-10T19:47:23.000Z
2017-06-29T17:38:12.000Z
UI/flask_ownstorj/ownstorj/__init__.py
Abd-Elrazek/EasyStorj
9eef7717a72cce8b46f971d8cf1dbe4561d6cb2c
[ "MIT" ]
9
2017-04-13T08:06:14.000Z
2017-06-27T23:57:55.000Z
from flask import Flask app = Flask('ownstorj') import models import controller
8.5
23
0.752941
11
85
5.818182
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.188235
85
9
24
9.444444
0.927536
0
0
0
0
0
0.096386
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
84c9def3a7937d6b6f33517d8408a78459c12e11
257
py
Python
composer/trainer/__init__.py
moinnadeem/composer
bc3f41b766bd4450f05a99f44db4a6b3901ea1c8
[ "Apache-2.0" ]
null
null
null
composer/trainer/__init__.py
moinnadeem/composer
bc3f41b766bd4450f05a99f44db4a6b3901ea1c8
[ "Apache-2.0" ]
null
null
null
composer/trainer/__init__.py
moinnadeem/composer
bc3f41b766bd4450f05a99f44db4a6b3901ea1c8
[ "Apache-2.0" ]
null
null
null
# Copyright 2022 MosaicML Composer authors # SPDX-License-Identifier: Apache-2.0 """Train models with flexible insertion of algorithms.""" from composer.trainer import devices as devices from composer.trainer.trainer import Trainer __all__ = ['Trainer']
25.7
57
0.789883
33
257
6.030303
0.727273
0.120603
0.190955
0
0
0
0
0
0
0
0
0.026667
0.124514
257
9
58
28.555556
0.857778
0.501946
0
0
0
0
0.057851
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
84f15def0b431021036e2e33b50f20fc5f3c20fe
127
py
Python
spiking_neural_network/training/method.py
londoed/SpikingNeuralModels
b549927a125d54ff5c8c495686aca08e59501d0d
[ "MIT" ]
null
null
null
spiking_neural_network/training/method.py
londoed/SpikingNeuralModels
b549927a125d54ff5c8c495686aca08e59501d0d
[ "MIT" ]
1
2019-08-27T15:23:57.000Z
2019-08-27T15:23:57.000Z
spiking_neural_network/training/method.py
londoed/SpikingNeuralModels
b549927a125d54ff5c8c495686aca08e59501d0d
[ "MIT" ]
1
2019-07-07T14:07:27.000Z
2019-07-07T14:07:27.000Z
class TrainingMethod(): def update(self): raise NotImplementedError("A training method needs an update function.")
31.75
80
0.724409
14
127
6.571429
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.188976
127
3
81
42.333333
0.893204
0
0
0
0
0
0.338583
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
1704cc1ce77bb2f55414d820ae672d3f61539661
3,423
py
Python
excercise2.py
karthi12ck/caiaptyhon
3ab42a5ddb3f6814274b1f7a473b35254783ff4c
[ "Apache-2.0" ]
null
null
null
excercise2.py
karthi12ck/caiaptyhon
3ab42a5ddb3f6814274b1f7a473b35254783ff4c
[ "Apache-2.0" ]
null
null
null
excercise2.py
karthi12ck/caiaptyhon
3ab42a5ddb3f6814274b1f7a473b35254783ff4c
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Tue May 21 09:07:52 2019 @author: Training23 """ #arithmetic function class Arithmetic(): def __init__(self,a,b): self.a=a self.b=b def add(self): return self.a + self.b def sub(self): return self.a - self.b def mul(self): return self.a * self.b def div(self): return self.a / self.b def mod(self): return self.a % self.b def exp(self): return self.a ** self.b def floor(self): return self.a // self.b #assignment operator class assignment(): def __init__(self,a): self.a=a def eql(self): self.a=5 return self.a def ast2(self): self.a+=3 return self.a def ast3(self): self.a-=3 return self.a def ast4(self): self.a*=3 return self.a def ast5(self): self.a/=3 return self.a def ast6(self): self.a%=3 return self.a class compare(): def __init__(self,x,y): self.x=x self.y=y def eql(self): return (self.x == self.y ) def noteql(self): return (self.x != self.y) def grt(self): return (self.x > self.y) def les(self): return (self.x < self.y) def grte(self): return (self.x >= self.y) def lese(self): return (self.x <= self.y) class logical(): def __init__(self,x): self.x=x def and1(self): return self.x < 5 and self.x < 10 def or1(self): return self.x < 5 or self.x < 33 def note(self): return not(self.x <5 and self.x >10) class identity(): def __init__(self,a,b): self.b=b self.a=a def iss(self): return self.a is self.b def isnot(self): return self.a is not self.b class membership(): def __init__(self,a,b): self.a=a self.b=b def ins(self): self.a = [x*2 for x in range(self.a)] self.b = [x*3 for x in range(self.b)] print(2 in self.a) print(3 not in self.a) class bitwise(): def __init__(self,a,b): self.a=a self.b=b def and1(self): return self.a & self.b def or1(self): return self.a | self.b def xor(self): return self.a ^ self.b def note(self): return ~ self.a #string literals print(s) print(r) s="kar" "thick" print(s) #numeric literals n1=3243 n2=32.34 n3=(343+3j) print(n1,n2,n3) #boolean literals flag=True flag1=False print(flag1) print(flag) #special literals val1=0 val1=None print(val1) #literal collections lists =[343,343,34,'karthick'] lists1=['343',343,'ere',3] print(lists1+lists) print(lists1*3) from time import sleep def gener(n): for i in range(n): yield i def rang(): nonlocal n for item in gener(): print(item) return rang() for item in gener(): sleep(3) print(item)
18.111111
46
0.471224
471
3,423
3.36518
0.235669
0.123028
0.185489
0.123028
0.455521
0.38612
0.350158
0.113565
0.052997
0.052997
0
0.043198
0.411627
3,423
189
47
18.111111
0.743793
0.058136
0
0.282258
0
0
0.00728
0
0
0
0
0
0
1
0.306452
false
0
0.008065
0.177419
0.604839
0.104839
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
ca1bd592d94d7c2fa77f2e7492d4a31a609b9448
33
py
Python
custom_components/attributes/__init__.py
martinweu/homeassistant-attributes
71818a88313fb765b2e2e001be4404e894120b85
[ "Apache-2.0" ]
136
2019-06-27T08:11:47.000Z
2022-03-11T12:26:53.000Z
custom_components/attributes/__init__.py
martinweu/homeassistant-attributes
71818a88313fb765b2e2e001be4404e894120b85
[ "Apache-2.0" ]
27
2019-07-30T20:09:18.000Z
2022-02-08T08:07:54.000Z
custom_components/attributes/__init__.py
martinweu/homeassistant-attributes
71818a88313fb765b2e2e001be4404e894120b85
[ "Apache-2.0" ]
63
2019-07-15T21:11:58.000Z
2022-03-13T09:43:24.000Z
"""Attributes breakout sensor"""
16.5
32
0.727273
3
33
8
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
33
1
33
33
0.8
0.787879
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
ca239050c5cd7072e96fdb683b97351fa4de262b
52
py
Python
manifest.py
moritzwietersheim/specter-diy
f82ee0281cfd706c63877463e7cd10283c28fe46
[ "MIT" ]
null
null
null
manifest.py
moritzwietersheim/specter-diy
f82ee0281cfd706c63877463e7cd10283c28fe46
[ "MIT" ]
null
null
null
manifest.py
moritzwietersheim/specter-diy
f82ee0281cfd706c63877463e7cd10283c28fe46
[ "MIT" ]
null
null
null
include('f469-disco/manifest_f469.py') freeze('src')
26
38
0.769231
8
52
4.875
0.875
0
0
0
0
0
0
0
0
0
0
0.117647
0.019231
52
2
39
26
0.647059
0
0
0
0
0
0.566038
0.509434
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
ca2f3944a5351ecdea1fbf3ebca04844bf90e646
2,086
py
Python
utils/boilerplate/test_badger.py
cfginn/sap-simulation-package
73314e5380cec5c61a9fe5ff5fbafa25b9e2beac
[ "MIT" ]
null
null
null
utils/boilerplate/test_badger.py
cfginn/sap-simulation-package
73314e5380cec5c61a9fe5ff5fbafa25b9e2beac
[ "MIT" ]
null
null
null
utils/boilerplate/test_badger.py
cfginn/sap-simulation-package
73314e5380cec5c61a9fe5ff5fbafa25b9e2beac
[ "MIT" ]
null
null
null
import unittest from pysapets.badger import Badger from pysapets.animal import Animal import pysapets.constants as constants from unittest.mock import patch from io import StringIO from copy import deepcopy class BadgerTest(unittest.TestCase): def setUp(self): self.badger = Badger() self.friends = [self.badger, Animal(2, 2), Animal(2, 2), Animal(2, 2), Animal(2, 2)] # test that get_type returns the correct type def test_get_type(self): self.assertEqual(self.badger.get_type(), constants.BADGER) # test that badger starts with base health of 4 def test_get_health(self): self.assertEqual(self.badger.get_health(), 4) # test that badger starts with base attack of 5 def test_get_attack(self): self.assertEqual(self.badger.get_attack(), 5) # test that initializing badger with additional health increases health def test_init_add_health(self): newBadger = Badger(addHealth = 3) self.assertEqual(newBadger.get_health(), 4 + 3) # test that initializing an badger with additional attack increases attack def test_init_add_attack(self): newBadger = Badger(addAttack = 3) self.assertEqual(newBadger.get_attack(), 5 + 3) # test that initializing badger with additional health and attack increases health and attack def test_init_add_health_attack(self): newBadger = Badger(addHealth = 3, addAttack = 3) self.assertEqual(newBadger.get_health(), 4 + 3) self.assertEqual(newBadger.get_attack(), 5 + 3) # test that badger ability has correct trigger def test_get_ability_trigger(self): self.assertEqual(self.badger.get_ability_trigger(), constants.EATS_SHOP_FOOD) # test that badger ability has correct triggeredBy def test_get_ability_triggeredBy(self): self.assertEqual(self.badger.get_ability_triggeredBy(), constants.SELF) # TODO add relevant tests for badger ability def test_run_ability(self): pass def test_run_ability_level_1(self): pass def test_run_ability_level_2(self): pass def test_run_ability_level_3(self): pass
31.134328
95
0.741131
295
2,086
5.071186
0.216949
0.05615
0.033422
0.076872
0.528075
0.445856
0.296123
0.127674
0.080214
0.058824
0
0.015734
0.177373
2,086
67
96
31.134328
0.856061
0.243528
0
0.205128
0
0
0
0
0
0
0
0.014925
0.230769
1
0.333333
false
0.102564
0.179487
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
1
0
0
1
0
0
4
ca9d269c02cb46cd8927b144864c839e0ae39318
75
py
Python
examples/D_class_inherit/__init__.py
David-Lor/pytest-talk-examples
332162b0feada2c9b24b586edbcd3a8b2e9aac4e
[ "Apache-2.0" ]
null
null
null
examples/D_class_inherit/__init__.py
David-Lor/pytest-talk-examples
332162b0feada2c9b24b586edbcd3a8b2e9aac4e
[ "Apache-2.0" ]
1
2020-02-27T08:24:25.000Z
2020-02-28T18:37:49.000Z
examples/D_class_inherit/__init__.py
David-Lor/pytest-talk-examples
332162b0feada2c9b24b586edbcd3a8b2e9aac4e
[ "Apache-2.0" ]
null
null
null
"""Init is required to do relative import of BaseTest from test modules"""
37.5
74
0.76
12
75
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.16
75
1
75
75
0.904762
0.906667
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
04701d6bbaff64002d5e987f581253c35ba29eaa
197
py
Python
tensorhive/__main__.py
martyole/TensorHive
9ba4349777f9601fd82643b3ba083d82a29c3fad
[ "Apache-2.0" ]
129
2017-08-25T11:45:15.000Z
2022-03-29T05:11:25.000Z
tensorhive/__main__.py
martyole/TensorHive
9ba4349777f9601fd82643b3ba083d82a29c3fad
[ "Apache-2.0" ]
251
2017-07-27T10:05:58.000Z
2022-03-02T12:46:13.000Z
tensorhive/__main__.py
martyole/TensorHive
9ba4349777f9601fd82643b3ba083d82a29c3fad
[ "Apache-2.0" ]
20
2017-08-13T13:05:14.000Z
2022-03-19T02:21:37.000Z
import tensorhive.cli as cli import logging # GLOBAL TODOS # TODO Capture tracebacks from all exceptions with e.g. log.error() def main(): cli.main() if __name__ == "__main__": main()
14.071429
67
0.690355
28
197
4.571429
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.203046
197
13
68
15.153846
0.815287
0.395939
0
0
0
0
0.068966
0
0
0
0
0.076923
0
1
0.166667
true
0
0.333333
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
1
0
0
0
1
0
1
0
0
0
0
4
0480db537e81dd6a89f81ff5d1e801ac8cc7bd40
26
py
Python
whendo/_version.py
electronhead/whendo
27112834be0935b5b0f7ade4316e35532532e047
[ "MIT" ]
1
2022-03-04T09:25:13.000Z
2022-03-04T09:25:13.000Z
whendo/_version.py
electronhead/whendo
27112834be0935b5b0f7ade4316e35532532e047
[ "MIT" ]
null
null
null
whendo/_version.py
electronhead/whendo
27112834be0935b5b0f7ade4316e35532532e047
[ "MIT" ]
null
null
null
version = "0.0.3.alpha18"
13
25
0.653846
5
26
3.4
0.8
0
0
0
0
0
0
0
0
0
0
0.217391
0.115385
26
1
26
26
0.521739
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
048bb08704081c04e2d434e78f2294e639da4e18
149
py
Python
app/profile/__init__.py
DCGM/pero_ocr_web
e901027712827278f9ace914f6ccba16d3ac280f
[ "BSD-2-Clause" ]
2
2020-05-07T13:58:31.000Z
2021-01-27T09:33:07.000Z
app/profile/__init__.py
DCGM/pero_ocr_web
e901027712827278f9ace914f6ccba16d3ac280f
[ "BSD-2-Clause" ]
47
2019-09-17T19:20:07.000Z
2022-03-20T12:33:28.000Z
app/profile/__init__.py
DCGM/pero_ocr_web
e901027712827278f9ace914f6ccba16d3ac280f
[ "BSD-2-Clause" ]
1
2019-10-02T10:42:35.000Z
2019-10-02T10:42:35.000Z
from flask import Blueprint bp = Blueprint('profile', __name__, template_folder='templates', static_folder='static') from app.profile import routes
29.8
88
0.798658
19
149
5.947368
0.684211
0
0
0
0
0
0
0
0
0
0
0
0.100671
149
5
89
29.8
0.843284
0
0
0
0
0
0.146667
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
1
0
4
04a1bb9573885661e7b2a765593261214027aab3
18
py
Python
embyupdater/version.py
shokinn/emby-updater
c4dfde580d90abc25ce7b1efb9646104147f014a
[ "MIT" ]
7
2018-11-15T21:34:44.000Z
2021-06-03T12:20:38.000Z
embyupdater/version.py
shokinn/emby-updater
c4dfde580d90abc25ce7b1efb9646104147f014a
[ "MIT" ]
4
2019-02-25T15:00:21.000Z
2020-08-27T13:24:09.000Z
embyupdater/version.py
shokinn/emby-updater
c4dfde580d90abc25ce7b1efb9646104147f014a
[ "MIT" ]
null
null
null
version = "0.8.3"
9
17
0.555556
4
18
2.5
1
0
0
0
0
0
0
0
0
0
0
0.2
0.166667
18
1
18
18
0.466667
0
0
0
0
0
0.277778
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
04a93bc7d25e31d6be71a42439bdb168c39a17c6
64
py
Python
fairseq/models/wav2vec/eteh_model/conformer/__init__.py
gaochangfeng/fairseq
70a468230b8fb558caa394322b02fface663e17a
[ "MIT" ]
null
null
null
fairseq/models/wav2vec/eteh_model/conformer/__init__.py
gaochangfeng/fairseq
70a468230b8fb558caa394322b02fface663e17a
[ "MIT" ]
null
null
null
fairseq/models/wav2vec/eteh_model/conformer/__init__.py
gaochangfeng/fairseq
70a468230b8fb558caa394322b02fface663e17a
[ "MIT" ]
null
null
null
import sys sys.path.append("..") from .encoder import Encoder
16
28
0.71875
9
64
5.111111
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.140625
64
3
29
21.333333
0.836364
0
0
0
0
0
0.03125
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
04b15b47c7c01f75040577e9b78b7f99859ce1ab
103
py
Python
rhonda.py
nitesh-jaswal/cloudmesh-pi-cluster
804a7f0f93fb06161bccb4c9ff0fcecc93854747
[ "Apache-2.0" ]
null
null
null
rhonda.py
nitesh-jaswal/cloudmesh-pi-cluster
804a7f0f93fb06161bccb4c9ff0fcecc93854747
[ "Apache-2.0" ]
1
2020-07-15T15:05:11.000Z
2020-07-15T16:53:21.000Z
rhonda.py
nitesh-jaswal/cloudmesh-pi-cluster
804a7f0f93fb06161bccb4c9ff0fcecc93854747
[ "Apache-2.0" ]
null
null
null
from cloudmesh.pi.cluster.spark.spark import Spark spark = Spark() spark.scripts() print(spark.script)
20.6
50
0.786408
15
103
5.4
0.6
0.493827
0.37037
0
0
0
0
0
0
0
0
0
0.087379
103
5
51
20.6
0.861702
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.25
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
04b176527c73eca8361499a531cb8b0ec92fbad9
3,194
py
Python
generator/fourier.py
yuchenxi2000/diana-curve
a6b07b7f8e2aa94191806e679bd9701f056f5948
[ "MIT" ]
1
2021-10-31T03:56:00.000Z
2021-10-31T03:56:00.000Z
generator/fourier.py
yuchenxi2000/diana-curve
a6b07b7f8e2aa94191806e679bd9701f056f5948
[ "MIT" ]
null
null
null
generator/fourier.py
yuchenxi2000/diana-curve
a6b07b7f8e2aa94191806e679bd9701f056f5948
[ "MIT" ]
null
null
null
import numpy as np from fractions import Fraction def to_frac(a): return str(Fraction(a).limit_denominator(1000)) def to_frac_tex(a): frac = Fraction(a).limit_denominator(1000) if frac.numerator < 0: return '-\\frac{' + str(-frac.numerator) + '}{' + str(frac.denominator) + '}' else: return '\\frac{' + str(frac.numerator) + '}{' + str(frac.denominator) + '}' class FourierInterp: def __init__(self, point_array, nk): self.k_points = np.fft.fft(point_array) self.nk = nk self.N = self.k_points.shape[0] def eval(self, t): # $ t \in [0, 1) $ s = np.zeros_like(t, dtype=np.complex128) for i in range(0, self.nk + 1): s += np.exp(1j * 2 * np.pi * t * i) * self.k_points[i] for i in range(-self.nk, 0): s += np.exp(1j * 2 * np.pi * t * i) * self.k_points[i + self.N] return s / self.N def gen_equation(self, t_begin): # 这里的t乘了2pi sx = '' sy = '' for i in range(1, self.nk + 1): Ap = self.k_points[i] An = self.k_points[self.N-i] Zr = An.imag - Ap.imag + 1j * (Ap.real + An.real) Zi = Ap.real - An.real + 1j * (Ap.imag + An.imag) phase_r = np.angle(Zr) - i * t_begin phase_i = np.angle(Zi) - i * t_begin sx += f'{to_frac(abs(Zr)/self.N)}*sin({i}*t+{to_frac(phase_r)})+' sy += f'{to_frac(abs(Zi)/self.N)}*sin({i}*t+{to_frac(phase_i)})+' sx += f'{to_frac(self.k_points[0].real / self.N)}' sy += f'{to_frac(self.k_points[0].imag / self.N)}' return sx, sy def gen_equation_tex(self, t_begin): # 这里的t乘了2pi sx = '' sy = '' for i in range(1, self.nk + 1): Ap = self.k_points[i] An = self.k_points[self.N-i] Zr = An.imag - Ap.imag + 1j * (Ap.real + An.real) Zi = Ap.real - An.real + 1j * (Ap.imag + An.imag) phase_r = np.angle(Zr) - i * t_begin phase_i = np.angle(Zi) - i * t_begin sx += f'{to_frac_tex(abs(Zr)/self.N)}\\sin({i if i != 1 else ""}t+{to_frac_tex(phase_r)})+' sy += f'{to_frac_tex(abs(Zi)/self.N)}\\sin({i if i != 1 else ""}t+{to_frac_tex(phase_i)})+' sx += f'{to_frac_tex(self.k_points[0].real / self.N)}' sy += f'{to_frac_tex(self.k_points[0].imag / self.N)}' return sx, sy def gen_equation_mma(self, t_begin): # 这里的t乘了2pi sx = '' sy = '' for i in range(1, self.nk + 1): Ap = self.k_points[i] An = self.k_points[self.N-i] Zr = An.imag - Ap.imag + 1j * (Ap.real + An.real) Zi = Ap.real - An.real + 1j * (Ap.imag + An.imag) phase_r = np.angle(Zr) - i * t_begin phase_i = np.angle(Zi) - i * t_begin sx += f'{to_frac(abs(Zr)/self.N)}*Sin[{i if i != 1 else ""}t+{to_frac(phase_r)}]+' sy += f'{to_frac(abs(Zi)/self.N)}*Sin[{i if i != 1 else ""}t+{to_frac(phase_i)}]+' sx += f'{to_frac(self.k_points[0].real / self.N)}' sy += f'{to_frac(self.k_points[0].imag / self.N)}' return sx, sy
39.432099
103
0.50908
524
3,194
2.954198
0.129771
0.077519
0.113695
0.046512
0.793928
0.752584
0.744186
0.744186
0.678941
0.678941
0
0.021315
0.309643
3,194
80
104
39.925
0.680726
0.014402
0
0.507463
0
0.089552
0.221763
0.173719
0
0
0
0
0
1
0.104478
false
0
0.029851
0.014925
0.253731
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
04b524a3b655d3774f0efc91701893e8fbeefc2b
238
py
Python
djangobench/benchmarks/query_delete_related/models.py
smithdc1/djangobench
912dc536db706fb73d24a53d10d1739a0824d2c1
[ "BSD-3-Clause" ]
92
2015-02-07T11:03:45.000Z
2022-03-23T10:51:06.000Z
djangobench/benchmarks/query_delete_related/models.py
smithdc1/djangobench
912dc536db706fb73d24a53d10d1739a0824d2c1
[ "BSD-3-Clause" ]
19
2015-03-22T14:30:03.000Z
2022-03-24T22:43:24.000Z
djangobench/benchmarks/query_delete_related/models.py
smithdc1/djangobench
912dc536db706fb73d24a53d10d1739a0824d2c1
[ "BSD-3-Clause" ]
25
2015-01-22T19:53:25.000Z
2022-03-20T11:15:54.000Z
from django.db import models class Book(models.Model): title = models.CharField(max_length=100) class Chapter(models.Model): book = models.ForeignKey(Book, on_delete=models.CASCADE) title = models.CharField(max_length=100)
23.8
60
0.752101
33
238
5.333333
0.545455
0.113636
0.227273
0.261364
0.363636
0.363636
0
0
0
0
0
0.029268
0.138655
238
9
61
26.444444
0.829268
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
b6d9ca1fad2de88fb6e27e96f51e25e7c575d565
87
py
Python
forms/admin.py
asommer70/formation
88281c935d242cc9b77882c71fedd604948ee6f9
[ "MIT" ]
null
null
null
forms/admin.py
asommer70/formation
88281c935d242cc9b77882c71fedd604948ee6f9
[ "MIT" ]
null
null
null
forms/admin.py
asommer70/formation
88281c935d242cc9b77882c71fedd604948ee6f9
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Form admin.site.register(Form)
12.428571
32
0.793103
13
87
5.307692
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.137931
87
6
33
14.5
0.92
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
b6f3ca3a8f8df0b75a5c2c503d1c2633044214a5
102
py
Python
cargan/data/__init__.py
mdc202002/cargan
5bfb44a1d8c2de8126e8053bed6078ad2e20819c
[ "MIT" ]
72
2021-10-20T01:17:54.000Z
2022-02-22T07:40:35.000Z
cargan/data/__init__.py
mdc202002/cargan
5bfb44a1d8c2de8126e8053bed6078ad2e20819c
[ "MIT" ]
7
2021-10-21T21:44:00.000Z
2022-03-17T18:24:42.000Z
cargan/data/__init__.py
mdc202002/cargan
5bfb44a1d8c2de8126e8053bed6078ad2e20819c
[ "MIT" ]
16
2021-10-20T02:07:46.000Z
2022-03-16T08:18:37.000Z
from .dataset import Dataset from .loader import loaders from .util import chdir from . import collate
25.5
28
0.813725
15
102
5.533333
0.533333
0
0
0
0
0
0
0
0
0
0
0
0.147059
102
4
29
25.5
0.954023
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
b6f9d705ba9cc13d160d25947157ba9b432e3e32
288
py
Python
CybORG/CybORG/Shared/Actions/GameActions/__init__.py
rafvasq/cage-challenge-1
95affdfa38afc1124f1a1a09c92fbc0ed5b96318
[ "MIT" ]
18
2021-08-20T15:07:55.000Z
2022-03-11T12:05:15.000Z
CybORG/CybORG/Shared/Actions/GameActions/__init__.py
rafvasq/cage-challenge-1
95affdfa38afc1124f1a1a09c92fbc0ed5b96318
[ "MIT" ]
7
2021-11-09T06:46:58.000Z
2022-03-31T12:35:06.000Z
CybORG/CybORG/Shared/Actions/GameActions/__init__.py
rafvasq/cage-challenge-1
95affdfa38afc1124f1a1a09c92fbc0ed5b96318
[ "MIT" ]
13
2021-08-17T00:26:31.000Z
2022-03-29T20:06:45.000Z
from .GameAction import GameAction from .CreateAgent import CreateAgent from .ListAgents import ListAgents from .GameEcho import GameEcho from .GameSleep import GameSleep from .GetTrueState import GetTrueState from .ListAllSessions import ListAllSessions from .ResetGame import ResetGame
32
44
0.861111
32
288
7.75
0.3125
0
0
0
0
0
0
0
0
0
0
0
0.111111
288
8
45
36
0.96875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
8e07356d37eb0071da88237326c1d5d6dbb3a0f9
262
py
Python
strawman/utilities/elements.py
SimonBoothroyd/strawman
41cbee89b41b33afa49cbaec9ba28ca4ee5d729b
[ "MIT" ]
2
2021-02-17T20:49:26.000Z
2021-02-17T21:49:03.000Z
strawman/utilities/elements.py
SimonBoothroyd/strawman
41cbee89b41b33afa49cbaec9ba28ca4ee5d729b
[ "MIT" ]
null
null
null
strawman/utilities/elements.py
SimonBoothroyd/strawman
41cbee89b41b33afa49cbaec9ba28ca4ee5d729b
[ "MIT" ]
1
2021-04-12T20:40:20.000Z
2021-04-12T20:40:20.000Z
from typing import Literal from pydantic import conint AtomicNumber = conint(ge=1, le=118) AtomicSymbol = Literal["H", "C", "O", "N"] def atomic_number_to_symbol(atomic_number: int) -> AtomicSymbol: return {1: "H", 6: "C", 7: "N", 8: "O"}[atomic_number]
23.818182
64
0.675573
40
262
4.3
0.65
0.209302
0
0
0
0
0
0
0
0
0
0.036036
0.152672
262
10
65
26.2
0.738739
0
0
0
0
0
0.030534
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.166667
0.666667
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
8e1134a4b8b5d1d6467c5a8794b4122da9b9fd3b
30
py
Python
ctrl-hyper/hyper-b.py
MTfirst/cmd-ctrl_onLinux
38a6db67796bdc8d438ca63171d9fea03e84f5f7
[ "MIT" ]
1
2020-05-02T03:46:10.000Z
2020-05-02T03:46:10.000Z
ctrl-hyper/hyper-b.py
MTfirst/cmd-ctrl_onLinux
38a6db67796bdc8d438ca63171d9fea03e84f5f7
[ "MIT" ]
null
null
null
ctrl-hyper/hyper-b.py
MTfirst/cmd-ctrl_onLinux
38a6db67796bdc8d438ca63171d9fea03e84f5f7
[ "MIT" ]
null
null
null
keyboard.send_keys("<ctrl>+b")
30
30
0.733333
5
30
4.2
1
0
0
0
0
0
0
0
0
0
0
0
0
30
1
30
30
0.7
0
0
0
0
0
0.258065
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
8e3ec5c82f37a173d375991b7cf31e53f655a8e8
320
py
Python
modes/BaseMode.py
Invalid-Entry/BigScreenFramework
a7d01f3eb968c86039d09a6846e0f95ced62ba9c
[ "MIT" ]
1
2020-12-21T11:22:56.000Z
2020-12-21T11:22:56.000Z
modes/BaseMode.py
Invalid-Entry/BigScreenFramework
a7d01f3eb968c86039d09a6846e0f95ced62ba9c
[ "MIT" ]
null
null
null
modes/BaseMode.py
Invalid-Entry/BigScreenFramework
a7d01f3eb968c86039d09a6846e0f95ced62ba9c
[ "MIT" ]
null
null
null
class BaseMode: clacks = None size = None def __init__(self, clacks, size): self.clacks = clacks self.size = size def enter_screen(self): pass def exit_screen(self): pass def handle_event(self, event): pass def render(self, event): pass
14.545455
37
0.559375
38
320
4.526316
0.394737
0.122093
0.162791
0.197674
0
0
0
0
0
0
0
0
0.359375
320
22
38
14.545455
0.839024
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0.357143
false
0.285714
0
0
0.571429
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
f3d2a0f2534e685114a7c78ae4829d1f9ccccaa6
6,227
py
Python
countess/tests/test_module_wildtype.py
VariantEffect/Enrich2-py3
5f8534c8c9259d90d99d70e5bd9140fd0fdc8ea4
[ "BSD-3-Clause" ]
4
2020-01-14T19:24:07.000Z
2020-01-16T18:11:35.000Z
countess/tests/test_module_wildtype.py
VariantEffect/CountESS
5f8534c8c9259d90d99d70e5bd9140fd0fdc8ea4
[ "BSD-3-Clause" ]
3
2020-01-01T10:38:15.000Z
2020-01-03T09:45:41.000Z
countess/tests/test_module_wildtype.py
VariantEffect/CountESS
5f8534c8c9259d90d99d70e5bd9140fd0fdc8ea4
[ "BSD-3-Clause" ]
1
2022-02-20T00:35:24.000Z
2022-02-20T00:35:24.000Z
import unittest from ..sequence.wildtype import WildTypeSequence def make_cfg(sequence, offset=0, coding=False): cfg = dict() cfg["sequence"] = sequence cfg["reference offset"] = offset cfg["coding"] = coding return cfg class TestWildTypeModule(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_keyerror_when_cfg_incomplete(self): cfg = {} wt = WildTypeSequence("Test") with self.assertRaises(KeyError): wt.configure(cfg) def test_sequence_loads_correctly(self): cfg = make_cfg("GATTACA") wt = WildTypeSequence("Test") wt.configure(cfg) self.assertTrue(wt.dna_seq == "GATTACA") cfg = make_cfg("gattaca") wt = WildTypeSequence("Test") wt.configure(cfg) self.assertTrue(wt.dna_seq == "GATTACA") def test_protein_sequence_loads_correctly(self): cfg = make_cfg("AAAAAA", coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertTrue(wt.protein_seq == "KK") def test_protein_sequence_loads_correctly_noncoding(self): cfg = make_cfg("AAAAAA", coding=False) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertEquals(wt.protein_seq, None) def test_is_coding(self): cfg = make_cfg("AAAAAA", coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertTrue(wt.is_coding()) def test_is_not_coding(self): cfg = make_cfg("AAAAAA", coding=False) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertFalse(wt.is_coding()) def test_should_not_be_equal(self): cfg = make_cfg("GATTACA", 0, False) wt_a = WildTypeSequence("Test") wt_a.configure(cfg) cfg = make_cfg("GATTACA", 3, False) wt_b = WildTypeSequence("Test") wt_b.configure(cfg) self.assertFalse(wt_a == wt_b) def test_should_be_equal(self): cfg = make_cfg("GATTACA", 0, False) wt_a = WildTypeSequence("Test") wt_a.configure(cfg) cfg = make_cfg("GATTACA", 0, False) wt_b = WildTypeSequence("Test") wt_b.configure(cfg) self.assertTrue(wt_a == wt_b) def test_error_when_incorrect_seq_characters(self): cfg = make_cfg("1234ACa") wt = WildTypeSequence("Test") with self.assertRaises(ValueError): wt.configure(cfg) cfg = make_cfg("GATTAC^&") wt = WildTypeSequence("Test") with self.assertRaises(ValueError): wt.configure(cfg) def test_error_when_coding_but_seqlen_not_multiple_of_three(self): cfg = make_cfg("GATTACA", coding=True) wt = WildTypeSequence("Test") with self.assertRaises(ValueError): wt.configure(cfg) def test_error_protein_offset_when_coding_but_not_multiple_of_three(self): cfg = make_cfg("AAAAAA", offset=1, coding=True) wt = WildTypeSequence("Test") with self.assertRaises(ValueError): wt.configure(cfg) def test_error_invalid_offset_not_a_number(self): cfg = make_cfg("AAAAAA", offset="a") wt = WildTypeSequence("Test") with self.assertRaises(TypeError): wt.configure(cfg) cfg = make_cfg("AAAAAA", offset=None) wt = WildTypeSequence("Test") with self.assertRaises(TypeError): wt.configure(cfg) def test_error_invalid_offset_negative(self): cfg = make_cfg("AAAAAA", offset=-1) wt = WildTypeSequence("Test") with self.assertRaises(ValueError): wt.configure(cfg) def test_correct_dna_offset_loads_when_coding(self): cfg = make_cfg("AAAAAA", offset=3, coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertEquals(wt.dna_offset, 3) def test_correct_protein_offset_loads_when_coding(self): cfg = make_cfg("AAAAAA", offset=6, coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertEquals(wt.protein_offset, 2) def test_correct_dna_offset_loads_when_noncoding(self): cfg = make_cfg("AAAAAA", offset=3, coding=False) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertEquals(wt.dna_offset, 3) def test_correct_protein_offset_loads_when_noncoding(self): cfg = make_cfg("AAAAAA", offset=3, coding=False) wt = WildTypeSequence("Test") wt.configure(cfg) self.assertEquals(wt.protein_offset, None) def test_serialize_is_matches_input_cfg(self): cfg = make_cfg("AAAAAA", offset=0, coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) result_cfg = wt.serialize() self.assertEquals(cfg, result_cfg) cfg = make_cfg("AAAAAA", offset=0, coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) result_cfg = wt.serialize() self.assertEquals(cfg, result_cfg) def test_duplicate_is_correct(self): cfg = make_cfg("AAAAAA", offset=0, coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) new_wt = wt.duplicate("New") self.assertEquals(wt, new_wt) def test_position_tuples_has_correct_offset_coding(self): cfg = make_cfg("AAAAAA", offset=6, coding=True) wt = WildTypeSequence("Test") wt.configure(cfg) tuples = wt.position_tuples(protein=True) self.assertEquals(tuples, [(3, "K"), (4, "K")]) def test_position_tuples_has_correct_offset_noncoding(self): cfg = make_cfg("AAA", offset=6, coding=False) wt = WildTypeSequence("Test") wt.configure(cfg) tuples = wt.position_tuples(protein=False) self.assertEquals(tuples, [(7, "A"), (8, "A"), (9, "A")]) def test_throw_error_position_tuples_protein_but_seq_not_coding(self): cfg = make_cfg("AAAAAA", offset=6, coding=False) wt = WildTypeSequence("Test") wt.configure(cfg) with self.assertRaises(AttributeError): wt.position_tuples(protein=True) if __name__ == "__main__": unittest.main()
32.602094
78
0.636101
747
6,227
5.058902
0.123159
0.051866
0.071447
0.077798
0.807886
0.769251
0.720296
0.665255
0.637999
0.631119
0
0.006177
0.246025
6,227
190
79
32.773684
0.798722
0
0
0.568627
0
0
0.055243
0
0
0
0
0
0.169935
1
0.163399
false
0.013072
0.013072
0
0.189542
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f3f24eb0fee3f750126d685552d98061591a5ca8
1,809
py
Python
complaints/migrations/0003_auto_20210224_0122.py
Three-Dev-Musketeers/Mumbai_Police
293fbc1d81db459c23649c9c6b1eef8c38da1939
[ "MIT" ]
5
2021-02-19T20:37:35.000Z
2021-12-19T06:41:50.000Z
complaints/migrations/0003_auto_20210224_0122.py
Divesh2201/Mumbai_Police
dfabf8494de2c790178541ee20d37d3002ca12af
[ "MIT" ]
1
2021-10-04T17:37:51.000Z
2021-10-05T10:50:36.000Z
complaints/migrations/0003_auto_20210224_0122.py
Divesh2201/Mumbai_Police
dfabf8494de2c790178541ee20d37d3002ca12af
[ "MIT" ]
4
2021-03-05T05:44:20.000Z
2021-04-25T17:23:16.000Z
# Generated by Django 3.1.6 on 2021-02-23 19:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('complaints', '0002_complaintsinfo_admin_message'), ] operations = [ migrations.AlterField( model_name='complaintsinfo', name='address', field=models.CharField(blank=True, max_length=50), ), migrations.AlterField( model_name='complaintsinfo', name='city', field=models.CharField(blank=True, max_length=50), ), migrations.AlterField( model_name='complaintsinfo', name='contact', field=models.CharField(blank=True, max_length=30), ), migrations.AlterField( model_name='complaintsinfo', name='country', field=models.CharField(blank=True, max_length=50), ), migrations.AlterField( model_name='complaintsinfo', name='crime', field=models.CharField(default='others', max_length=50), ), migrations.AlterField( model_name='complaintsinfo', name='desc', field=models.CharField(blank=True, max_length=250), ), migrations.AlterField( model_name='complaintsinfo', name='flatno', field=models.CharField(blank=True, max_length=50), ), migrations.AlterField( model_name='complaintsinfo', name='fullName', field=models.CharField(blank=True, max_length=50), ), migrations.AlterField( model_name='complaintsinfo', name='state', field=models.CharField(blank=True, max_length=50), ), ]
30.661017
68
0.566611
164
1,809
6.121951
0.29878
0.179283
0.224104
0.25996
0.747012
0.747012
0.606574
0.530876
0.491036
0.433267
0
0.030819
0.318408
1,809
58
69
31.189655
0.783455
0.024876
0
0.634615
1
0
0.129398
0.018729
0
0
0
0
0
1
0
false
0
0.019231
0
0.076923
0
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6d00d6f821110d078e99fd685cc93f26094ac348
18
py
Python
sale.py
Rosheen-2000/second_hand_trading_platform
1df9dfedb1e16ae9136dc9e09c52ef11592a55a8
[ "MIT" ]
null
null
null
sale.py
Rosheen-2000/second_hand_trading_platform
1df9dfedb1e16ae9136dc9e09c52ef11592a55a8
[ "MIT" ]
null
null
null
sale.py
Rosheen-2000/second_hand_trading_platform
1df9dfedb1e16ae9136dc9e09c52ef11592a55a8
[ "MIT" ]
null
null
null
I'm another file.
9
17
0.722222
4
18
3.25
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
18
1
18
18
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
6d14716e2c59d8f131680496ce44e49f61a5d1d6
21
py
Python
deuceclient/common/__init__.py
TheSriram/deuce-client
87efbbd912fd603bc70a5fea199ba26f75d34235
[ "Apache-2.0" ]
null
null
null
deuceclient/common/__init__.py
TheSriram/deuce-client
87efbbd912fd603bc70a5fea199ba26f75d34235
[ "Apache-2.0" ]
16
2015-01-02T19:46:21.000Z
2016-09-07T04:57:40.000Z
deuceclient/common/__init__.py
TheSriram/deuce-client
87efbbd912fd603bc70a5fea199ba26f75d34235
[ "Apache-2.0" ]
null
null
null
""" Deuce Common """
5.25
12
0.52381
2
21
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.190476
21
3
13
7
0.647059
0.571429
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
6d53fdc3cdd225c6866e1cd6e3d6941e603b6299
92
py
Python
src/screen.py
stepan-antonyuk/pixelpunk
240659ac961fbbec457290446c2e966cc226ed53
[ "MIT" ]
null
null
null
src/screen.py
stepan-antonyuk/pixelpunk
240659ac961fbbec457290446c2e966cc226ed53
[ "MIT" ]
6
2019-08-22T00:08:41.000Z
2020-03-05T04:33:37.000Z
src/screen.py
stepan-antonyuk/pixelpunk
240659ac961fbbec457290446c2e966cc226ed53
[ "MIT" ]
1
2019-08-12T21:48:49.000Z
2019-08-12T21:48:49.000Z
import pygame class Screen: screen = pygame.display.set_mode(flags=pygame.FULLSCREEN)
15.333333
61
0.771739
12
92
5.833333
0.75
0
0
0
0
0
0
0
0
0
0
0
0.141304
92
5
62
18.4
0.886076
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
ed9ad63c94cf4522301072d570a84297e6e0a9c7
565
py
Python
keyring/demo/simplekeyring.py
robinson96/GRAPE
f6404ae6ee2933647e515a9480077ab01fb2c430
[ "BSD-3-Clause" ]
4
2017-04-30T17:08:42.000Z
2019-11-15T04:44:09.000Z
installed/keyring/demo/simplekeyring.py
jscherer26/Icarra
5bc8b298ae21dcde7e8e2253b9ed9db95fd0d164
[ "BSD-3-Clause" ]
1
2016-02-12T07:51:30.000Z
2016-02-12T07:51:30.000Z
keyring/demo/simplekeyring.py
robinson96/GRAPE
f6404ae6ee2933647e515a9480077ab01fb2c430
[ "BSD-3-Clause" ]
2
2020-03-28T02:55:19.000Z
2021-11-09T04:37:08.000Z
""" simplekeyring.py A simple keyring class for the keyring_demo.py Created by Kang Zhang on 2009-07-12 """ from keyring.backend import KeyringBackend class SimpleKeyring(KeyringBackend): """Simple Keyring is a keyring which can store only one password in memory. """ def __init__(self): self.password = '' def supported(self): return 0 def get_password(self, service, username): return self.password def set_password(self, service, username, password): self.password = password return 0
20.925926
59
0.676106
71
565
5.28169
0.56338
0.096
0.08
0.144
0
0
0
0
0
0
0
0.023419
0.244248
565
26
60
21.730769
0.854801
0.307965
0
0.181818
0
0
0
0
0
0
0
0
0
1
0.363636
false
0.454545
0.090909
0.181818
0.818182
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
edac80fbf7875ec9af092d32a2fd92c677b3f64d
152
py
Python
Chap.17/17.3.py
joonion/daily-coding-problems
8e313d28c3a989a41d87024588d38bd60a98b2c6
[ "MIT" ]
null
null
null
Chap.17/17.3.py
joonion/daily-coding-problems
8e313d28c3a989a41d87024588d38bd60a98b2c6
[ "MIT" ]
null
null
null
Chap.17/17.3.py
joonion/daily-coding-problems
8e313d28c3a989a41d87024588d38bd60a98b2c6
[ "MIT" ]
null
null
null
def find_length(n): maxlength = 0 while n > 0: maxlength += 1 n &= (n << 1) return maxlength n = 156 print(find_length(n))
15.2
22
0.532895
22
152
3.590909
0.5
0.253165
0.278481
0
0
0
0
0
0
0
0
0.07
0.342105
152
9
23
16.888889
0.72
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0
0
0.25
0.125
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
edc2c0da5b7fb7d1c6d623e952a8a87f953af9b8
9,367
py
Python
minaCAT.py
inilorente/minaCAT
241c4b4606f7858d7d9c626052dd6e8709d0a354
[ "Apache-2.0" ]
null
null
null
minaCAT.py
inilorente/minaCAT
241c4b4606f7858d7d9c626052dd6e8709d0a354
[ "Apache-2.0" ]
null
null
null
minaCAT.py
inilorente/minaCAT
241c4b4606f7858d7d9c626052dd6e8709d0a354
[ "Apache-2.0" ]
null
null
null
import pandas as pd ########################################################################################################## #Introducir aquí la ruta del archivo cat entre comillas. NOTA: Las barras de la ruta deben ir duplicadas. # Ejemplo: C:\\Users\\fulanito\\Escritorio\\archivo.cat archivocat= "C:\Users\inilo\Desktop\\28_106_U_2016-09-24.CAT" ########################################################################################################## #Separación de registros################################################################################## print 'Leyendo CAT original...' df0 = pd.read_csv(archivocat, delimiter="··", header=None, encoding = 'cp1252') # df0 = pd.read_table(archivocat, delimiter=None, header=None) #Solución posible al error de los delimitadores regex. Menor velocidad df0['reg'] = df0[0].str.slice(0,2) df11 = df0[df0['reg']=='11'] df13 = df0[df0['reg']=='13'] df14 = df0[df0['reg']=='14'] df15 = df0[df0['reg']=='15'] df16 = df0[df0['reg']=='16'] df17 = df0[df0['reg']=='17'] ######################################################################################################### #Generación de atributos según esquema de Catastro ###################################################### #Registro 11 Registro de Finca. Existe uno por cada parcela catastral#################################### print 'Procesando Registro 11...' df11.is_copy = False df11['1_tipo_reg'] = 11 df11['24_cd'] = df11[0].str.slice(24,26) df11['26_cmc'] = df11[0].str.slice(26,29) df11['29_cn'] = df11[0].str.slice(29,31) df11['31_pc'] = df11[0].str.slice(31,45) df11['51_cp'] = df11[0].str.slice(51,53) df11['53_np'] = df11[0].str.slice(53,78) df11['78_cmc'] = df11[0].str.slice(78,81) df11['81_cm'] = df11[0].str.slice(81,84) df11['84_nm'] = df11[0].str.slice(84,124) df11['124_nem'] = df11[0].str.slice(124,154) df11['154_cv'] = df11[0].str.slice(154,159) df11['159_tv'] = df11[0].str.slice(159,164) df11['164_nv'] = df11[0].str.slice(164,25) df11['189_pnp'] = df11[0].str.slice(189,193) df11['198_slp'] = df11[0].str.slice(198,199) df11['199_km'] = df11[0].str.slice(199,204) df11['216_td'] = df11[0].str.slice(216,241) df11['241_dp'] = df11[0].str.slice(241,246) df11['246_dm'] = df11[0].str.slice(246,248) df11['248_cma'] = df11[0].str.slice(248,251) df11['251_czc'] = df11[0].str.slice(251,253) df11['253_cpo'] = df11[0].str.slice(253,256) df11['256_cpa'] = df11[0].str.slice(256,261) df11['261_cpaj'] = df11[0].str.slice(261,266) df11['266_npa'] = df11[0].str.slice(266,296) df11['296_sup'] = df11[0].str.slice(296,306) df11['306_sct'] = df11[0].str.slice(306,313) df11['313_ssr'] = df11[0].str.slice(313,320) df11['320_sbr'] = df11[0].str.slice(320,327) df11['327_sc'] = df11[0].str.slice(327,334) df11['334_xcen'] = df11[0].str.slice(334,343) df11['343_ycen'] = df11[0].str.slice(343,353) df11['582_rc_bice'] = df11[0].str.slice(582,602) df11['602_n_bice'] = df11[0].str.slice(602,667) df11['667_srs'] = df11[0].str.slice(667,677) #Registro 13 Registro de Unidad Constructiva. Existe uno por cada unidad constructiva en cada parcela catastral######## print 'Procesando Registro 13...' df13.is_copy = False df13['1_tipo_reg'] = 13 df13['24_cd'] = df13[0].str.slice(24,26) df13['26_cmc'] = df13[0].str.slice(26,29) df13['26_cmc'] = df13[0].str.slice(31,45) df13['26_cmc'] = df13[0].str.slice(45,49) df13['26_cmc'] = df13[0].str.slice(51,53) df13['26_cmc'] = df13[0].str.slice(53,78) df13['26_cmc'] = df13[0].str.slice(78,81) df13['26_cmc'] = df13[0].str.slice(84,124) df13['26_cmc'] = df13[0].str.slice(124,154) df13['26_cmc'] = df13[0].str.slice(154,159) df13['26_cmc'] = df13[0].str.slice(159,164) df13['26_cmc'] = df13[0].str.slice(164,189) df13['26_cmc'] = df13[0].str.slice(189,193) df13['26_cmc'] = df13[0].str.slice(193,194) df13['26_cmc'] = df13[0].str.slice(194,198) df13['26_cmc'] = df13[0].str.slice(198,199) df13['26_cmc'] = df13[0].str.slice(199,204) df13['26_cmc'] = df13[0].str.slice(216,241) df13['26_cmc'] = df13[0].str.slice(296,300) df13['26_cmc'] = df13[0].str.slice(300,301) df13['26_cmc'] = df13[0].str.slice(308,313) df13['26_cmc'] = df13[0].str.slice(410,414) #Registro 14 Registro de Construcción. Existe uno por cada construcción de cada unidad constructiva en cada parcela catastral print 'Procesando Registro 14...' df14.is_copy = False df14['1_tipo_reg'] = 14 df14['24_cd'] = df14[0].str.slice(24,26) df14['26_cmc'] = df14[0].str.slice(26,29) df14['31_pc'] = df14[0].str.slice(31,45) df14['45_noec'] = df14[0].str.slice(45,49) df14['51_nobf'] = df14[0].str.slice(51,55) df14['55_cuc'] = df14[0].str.slice(55,59) df14['59_bl'] = df14[0].str.slice(59,63) df14['63_es'] = df14[0].str.slice(63,65) df14['65_pt'] = df14[0].str.slice(65,68) df14['68_pu'] = df14[0].str.slice(68,71) df14['71_cd'] = df14[0].str.slice(71,74) df14['74_tr'] = df14[0].str.slice(74,75) df14['75_ar'] = df14[0].str.slice(75,79) df14['79_aec'] = df14[0].str.slice(79,83) df14['83_ili'] = df14[0].str.slice(83,84) df14['84_stl'] = df14[0].str.slice(84,91) df14['91_spt'] = df14[0].str.slice(91,98) df14['98_sil'] = df14[0].str.slice(98,105) df14['105_tip'] = df14[0].str.slice(105,110) df14['112_modl'] = df14[0].str.slice(112,115) #Registro 15 Registro de Bien Inmueble. Existirá uno por cada bien inmueble en cada parcela catastral. print 'Procesando Registro 15...' df15.is_copy = False df15['1_tipo_reg'] = 15 df15['24_cd'] = df15[0].str.slice(24,26) df15['26_cmc'] = df15[0].str.slice(26,29) df15['29_cn'] = df15[0].str.slice(29,31) df15['31_pc'] = df15[0].str.slice(31,45) df15['45_car'] = df15[0].str.slice(45,49) df15['49_cc1'] = df15[0].str.slice(49,50) df15['50_cc2'] = df15[0].str.slice(50,51) df15['51_nfbi'] = df15[0].str.slice(51,59) df15['59_iia'] = df15[0].str.slice(59,74) df15['74_nfv'] = df15[0].str.slice(74,93) df15['93_cp'] = df15[0].str.slice(93,95) df15['95_np'] = df15[0].str.slice(95,120) df15['120_cmc'] = df15[0].str.slice(120,123) df15['123_cm'] = df15[0].str.slice(123,126) df15['126_nm'] = df15[0].str.slice(126,166) df15['166_nem'] = df15[0].str.slice(166,196) df15['196_cv'] = df15[0].str.slice(196,201) df15['201_tv'] = df15[0].str.slice(201,206) df15['206_nv'] = df15[0].str.slice(206,231) df15['231_pnp'] = df15[0].str.slice(231,235) df15['235_plp'] = df15[0].str.slice(235,236) df15['236_snp'] = df15[0].str.slice(236,240) df15['240_slp'] = df15[0].str.slice(240,241) df15['241_km'] = df15[0].str.slice(241,246) df15['246_bl'] = df15[0].str.slice(246,250) df15['250_es'] = df15[0].str.slice(250,252) df15['252_pt'] = df15[0].str.slice(252,255) df15['255_pu'] = df15[0].str.slice(255,258) df15['258_td'] = df15[0].str.slice(258,283) df15['283_dp'] = df15[0].str.slice(283,288) df15['288_dm'] = df15[0].str.slice(288,290) df15['290_cma'] = df15[0].str.slice(290,293) df15['293_czc'] = df15[0].str.slice(293,295) df15['295_cpo'] = df15[0].str.slice(295,298) df15['298_cpa'] = df15[0].str.slice(298,303) df15['303_cpaj'] = df15[0].str.slice(303,308) df15['308_npa'] = df15[0].str.slice(308,338) df15['368_noe'] = df15[0].str.slice(368,372) df15['372_ant'] = df15[0].str.slice(372,376) df15['428_grbice'] = df15[0].str.slice(428,429) df15['442_sfc'] = df15[0].str.slice(442,452) df15['452_sfs'] = df15[0].str.slice(452,462) df15['462_cpt'] = df15[0].str.slice(462,471) #Registro 16 Registro de reparto de elementos comunes print 'Procesando Registro 16...' df16.is_copy = False df16['1_tipo_reg'] = 16 df16['24_cd'] = df16[0].str.slice(24,26) df16['26_cmc'] = df16[0].str.slice(26,29) df16['31_pc'] = df16[0].str.slice(31,45) df16['45_no'] = df16[0].str.slice(45,49) df16['49_ccs'] = df16[0].str.slice(49,51) df16['51_cc2'] = df16[0].str.slice(51,110) #NO SE CÓMO PARSEAR ESTE BLOQUE #Registro 17 Registro de cultivos agrarios print 'Procesando Registro 17...' df17.is_copy = False df17['1_tipo_reg'] = 17 df17['24_cd'] = df17[0].str.slice(23,25) df17['26_cmc'] = df17[0].str.slice(25,28) df17['29_cn'] = df17[0].str.slice(28,30) df17['31_pc'] = df17[0].str.slice(30,44) df17['45_cspr'] = df17[0].str.slice(44,49) df17['51_nobf'] = df17[0].str.slice(50,54) df17['55_tspr'] = df17[0].str.slice(54,55) df17['56_ssp'] = df17[0].str.slice(55,65) df17['66_ccc'] = df17[0].str.slice(65,66) df17['68_dcc'] = df17[0].str.slice(67,107) df17['108_ip'] = df17[0].str.slice(107,109) df17['127_modl'] = df17[0].str.slice(109,127) # Generación de IDs ################################################################################## df11 = df11.reset_index() df13 = df13.reset_index() df14 = df14.reset_index() df15 = df15.reset_index() # Archivos de salida ################################################################################## rutar11 = "F:\ACTUAL\\LUrB\\CATASTRO\\SEGOVIA_RG11.csv" #Ruta del registro 11 entre comillas. NOTA: Introducir la extensión .csv# rutar13 = "F:\ACTUAL\\LUrB\\CATASTRO\\SEGOVIA_RG13.csv" #Ruta del registro 13 entre comillas. NOTA: Introducir la extensión .csv# rutar14 = "F:\ACTUAL\\LUrB\\CATASTRO\\SEGOVIA_RG14.csv" #Ruta del registro 14 entre comillas. NOTA: Introducir la extensión .csv# rutar15 = "F:\ACTUAL\\LUrB\\CATASTRO\\SEGOVIA_RG15.csv" #Ruta del registro 15 entre comillas. NOTA: Introducir la extensión .csv# # Comandos de salida. NO TOCAR ######################################################################## del df11[0] df11.to_csv(rutar11) del df13[0] df13.to_csv(rutar13) del df14[0] df14.to_csv(rutar14) del df15[0] df15.to_csv(rutar15)
41.631111
133
0.627522
1,657
9,367
3.442969
0.189499
0.097458
0.219281
0.097984
0.269413
0.148642
0.141104
0.023488
0.023488
0.023488
0
0.224561
0.08199
9,367
224
134
41.816964
0.438656
0.132593
0
0
0
0
0.183843
0.029735
0
0
0
0
0
0
null
null
0
0.005464
null
null
0.038251
0
0
0
null
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
edd23a59ffc2a3b8102da15d13ecc2ba196c9eaf
375
py
Python
megaman/geometry/__init__.py
jakevdp/Mmani
681b6cdbd358b207e8b6c4a482262c84bea15bd7
[ "BSD-2-Clause" ]
303
2016-03-03T00:44:37.000Z
2022-03-14T03:43:38.000Z
megaman/geometry/__init__.py
jakevdp/Mmani
681b6cdbd358b207e8b6c4a482262c84bea15bd7
[ "BSD-2-Clause" ]
52
2016-02-26T21:41:31.000Z
2021-06-27T08:33:51.000Z
megaman/geometry/__init__.py
jakevdp/Mmani
681b6cdbd358b207e8b6c4a482262c84bea15bd7
[ "BSD-2-Clause" ]
67
2016-03-03T22:38:35.000Z
2022-01-12T08:03:47.000Z
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE from .rmetric import RiemannMetric from .geometry import Geometry from .adjacency import Adjacency, compute_adjacency_matrix, adjacency_methods from .affinity import Affinity, compute_affinity_matrix, affinity_methods from .laplacian import Laplacian, compute_laplacian_matrix, laplacian_methods
46.875
77
0.856
46
375
6.782609
0.456522
0.070513
0
0
0
0
0
0
0
0
0
0.002915
0.085333
375
7
78
53.571429
0.906706
0.2
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
610dff97b88b68867d80e942acc96994ef01795f
147
py
Python
11_Day_Functions/12.py
diegofregolente/30-Days-Of-Python
e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267
[ "Apache-2.0" ]
null
null
null
11_Day_Functions/12.py
diegofregolente/30-Days-Of-Python
e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267
[ "Apache-2.0" ]
null
null
null
11_Day_Functions/12.py
diegofregolente/30-Days-Of-Python
e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267
[ "Apache-2.0" ]
null
null
null
def remove_item(lst: list, item): lst.remove(item) return lst print(remove_item([1, 2, 3, 4], 4)) print(remove_item(['a', 'b', 'c'], 'c'))
24.5
40
0.598639
26
147
3.269231
0.538462
0.470588
0.352941
0
0
0
0
0
0
0
0
0.04065
0.163265
147
6
40
24.5
0.650407
0
0
0
0
0
0.027027
0
0
0
0
0
0
1
0.2
false
0
0
0
0.4
0.4
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b62c93679ec0d15fd044ea010fec8c1e5a35eb4c
5,965
py
Python
python/test/datetime/test_time_calc.py
takashiharano/util
0f730475386a77415545de3f9763e5bdeaab0e94
[ "MIT" ]
null
null
null
python/test/datetime/test_time_calc.py
takashiharano/util
0f730475386a77415545de3f9763e5bdeaab0e94
[ "MIT" ]
null
null
null
python/test/datetime/test_time_calc.py
takashiharano/util
0f730475386a77415545de3f9763e5bdeaab0e94
[ "MIT" ]
null
null
null
#!python import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) import util def test_time_add(): s = '' s += '\n--------------------\n' s += _test_calc_time('add', '00:05:30.700', '00:01:20.123000', False, '00:06:50.823') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '16:00', True, '02:00:00.000000 (+1 Day)') s += _test_calc_time('add', '10:00', '16:00', False, '26:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '14:00', True, '00:00:00.000000 (+1 Day)') s += _test_calc_time('add', '10:00', '14:00', False, '24:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '14:00:00.000001', True, '00:00:00.000000 (+1 Day)') s += _test_calc_time('add', '10:00', '14:00:00.000001', False, '24:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '37:59', True, '23:59:00.000000 (+1 Day)') s += _test_calc_time('add', '10:00', '37:59', False, '47:59:00.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '38:00', True, '00:00:00.000000 (+2 Days)') s += _test_calc_time('add', '10:00', '38:00', False, '48:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '38:01', True, '00:01:00.000000 (+2 Days)') s += _test_calc_time('add', '10:00', '38:01', False, '48:01:00.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '00:00:01', True, '10:00:01.000000') s += _test_calc_time('add', '10:00', '00:00:01', False, '10:00:01.000000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '00:00:00.1', True, '10:00:00.100000') s += _test_calc_time('add', '10:00', '00:00:00.1', False, '10:00:00.100000') s += '\n--------------------\n' s += _test_calc_time('add', '10:00', '00:00:00.000001', True, '10:00:00.000001') s += _test_calc_time('add', '10:00', '00:00:00.000001', False, '10:00:00.000001') s += '\n--------------------\n' s += _test_calc_time('add', '000530.700', '000120.123000', False, '00:06:50.823000') s += _test_calc_time('add', '1000', '0900', False, '19:00:00.000000') return s def test_time_sub(): s = '' s += _test_calc_time('sub', '00:05:30.700', '00:05:20.400000', False, '00:00:10.300') s += '\n--------------------\n' s += _test_calc_time('sub', '10:00', '16:00', True, '18:00:00.000000 (-1 Day)') s += _test_calc_time('sub', '10:00', '16:00', False, '-06:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:00', '23:59', True, '00:01:00.000000 (-1 Day)') s += _test_calc_time('sub', '00:00', '23:59', False, '-23:59:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:00', '24:00', True, '00:00:00.000000 (-1 Day)') s += _test_calc_time('sub', '00:00', '24:00', False, '-24:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:00', '24:01', True, '23:59:00.000000 (-2 Days)') s += _test_calc_time('sub', '00:00', '24:01', False, '-24:01:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:00', '24:02', True, '23:58:00.000000 (-2 Days)') s += _test_calc_time('sub', '00:00', '24:02', False, '-24:02:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:01', '24:00', True, '00:01:00.000000 (-1 Day)') s += _test_calc_time('sub', '00:01', '24:00', False, '-23:59:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:01', '24:01', True, '00:00:00.000000 (-1 Day)') s += _test_calc_time('sub', '00:01', '24:01', False, '-24:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '00:01', '24:02', True, '23:59:00.000000 (-2 Days)') s += _test_calc_time('sub', '00:01', '24:02', False, '-24:01:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '10:00', '10:00', True, '00:00:00.000000') s += _test_calc_time('sub', '10:00', '10:00', False, '00:00:00.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '10:00', '10:00:01', True, '23:59:59.000000 (-1 Day)') s += _test_calc_time('sub', '10:00', '10:00:01', False, '-00:00:01.000000') s += '\n--------------------\n' s += _test_calc_time('sub', '10:00', '10:00:00.10000', True, '23:59:59.000000 (-1 Day)') s += _test_calc_time('sub', '10:00', '10:00:00.10000', False, '-00:00:00.100000') s += '\n--------------------\n' s += _test_calc_time('sub', '10:00', '10:00:00.000001', True, '23:59:59.999999 (-1 Day)') s += _test_calc_time('sub', '10:00', '10:00:00.000001', False, '-00:00:00.000001') s += '\n--------------------\n' s += _test_calc_time('sub', '000530.700000', '000520.400000', False, '00:00:10.300000') s += _test_calc_time('sub', '1500', '1200', False, '03:00:00.000000') return s def _test_calc_time(type, t1, t2, by_the_day, expected): op = '+' if type == 'add' else '-' s = '' s += '----------\n' s += t1 + ' ' + op + ' ' + t2 + '\n' s += 't1 = ' + t1 + '\n' s += 't2 = ' + t2 + '\n' s += 'by_the_day = ' + str(by_the_day) + '\n' if type == 'add': ret = util.time_add(t1, t2) else: ret = util.time_sub(t1, t2) s += str(ret) + '\n' s += 'exp = ' + expected + '\n' s += 'got = ' + ret.to_str(by_the_day=by_the_day) + '\n' s += 'got(HM ) = ' + ret.to_str(fmt='HM', by_the_day=by_the_day) + '\n' s += 'got(HMS ) = ' + ret.to_str(fmt='HMS', by_the_day=by_the_day) + '\n' s += 'got(HMSs ) = ' + ret.to_str(fmt='HMSs', by_the_day=by_the_day) + '\n' s += 'got(HMSsD) = ' + ret.to_str(fmt='HMSsD', by_the_day=by_the_day) + '\n' s += 'got = ' + str(ret.secs) + '\n' return s def main(): ret = '' ret += test_time_add() ret += '\n============================================================\n' ret += test_time_sub() print('Content-Type: text/plain') print() print(ret) main()
39.766667
91
0.500587
1,005
5,965
2.7801
0.092537
0.094488
0.210451
0.223336
0.768074
0.697208
0.682176
0.664996
0.656049
0.586256
0
0.220245
0.152054
5,965
149
92
40.033557
0.332147
0.001174
0
0.267857
0
0
0.421185
0.107437
0
0
0
0
0
1
0.035714
false
0
0.026786
0
0.089286
0.026786
0
0
0
null
0
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4