repo_name
stringclasses
400 values
branch_name
stringclasses
4 values
file_content
stringlengths
16
72.5k
language
stringclasses
1 value
num_lines
int64
1
1.66k
avg_line_length
float64
6
85
max_line_length
int64
9
949
path
stringlengths
5
103
alphanum_fraction
float64
0.29
0.89
alpha_fraction
float64
0.27
0.89
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-05-04 18:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0008_remove_precificacaomodel_custo'), ] operations = [ migrations.DeleteModel( name='PrecificacaoModel', )...
Python
31
26.032259
61
/projeto/dimensoes/migrations/0009_auto_20200504_1529.py
0.570406
0.538186
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-06-04 18:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0013_remove_dimensaomodel_profundidade_media'), ] operations = [ migrations.AddField( model_name='dimensaomodel', ...
Python
18
23.277779
70
/projeto/dimensoes/migrations/0014_dimensaomodel_profundidade_media.py
0.622426
0.572082
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-05-11 18:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0009_auto_20200504_1529'), ] operations = [ migrations.AlterField( model_name='dimensaomodel', name='co...
Python
48
26.604166
49
/projeto/dimensoes/migrations/0010_auto_20200511_1521.py
0.535849
0.510943
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-06-11 21:59 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0016_auto_20200611_1852'), ] operations = [ migrations.RenameField( model_name='clientemodel', old_name='numero...
Python
18
20.111111
49
/projeto/dimensoes/migrations/0017_auto_20200611_1859.py
0.584211
0.502632
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-06-04 18:33 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0012_auto_20200603_1916'), ] operations = [ migrations.RemoveField( model_name='dimensaomodel', name='profundid...
Python
17
19.529411
49
/projeto/dimensoes/migrations/0013_remove_dimensaomodel_profundidade_media.py
0.601719
0.512894
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-03-16 18:43 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ClienteModel', fields=[ ('id', models.AutoF...
Python
67
55.805969
230
/projeto/dimensoes/migrations/0001_initial.py
0.555439
0.527588
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-03-17 12:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0003_remove_dimensaomodel_data'), ] operations = [ migrations.AlterField( model_name='dimensaomodel', n...
Python
38
28.631578
61
/projeto/dimensoes/migrations/0004_auto_20200317_0933.py
0.568384
0.538188
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-05-16 18:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0010_auto_20200511_1521'), ] operations = [ migrations.AlterField( model_name='clientemodel', name='tel...
Python
18
21.833334
65
/projeto/dimensoes/migrations/0011_auto_20200516_1518.py
0.603406
0.523114
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-03-18 21:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0005_dimensaomodel_data'), ] operations = [ migrations.AlterField( model_name='dimensaomodel', name='pr...
Python
18
22.222221
61
/projeto/dimensoes/migrations/0006_auto_20200318_1831.py
0.610048
0.559809
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-04-29 20:30 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0007_auto_20200408_1540'), ] operations = [ migrations.RemoveField( model_name='precificacaomodel', name='custo...
Python
17
19
49
/projeto/dimensoes/migrations/0008_remove_precificacaomodel_custo.py
0.594118
0.502941
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-03-16 21:38 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0002_auto_20200316_1609'), ] operations = [ migrations.RemoveField( model_name='dimensaomodel', name='data', ...
Python
17
18.705883
49
/projeto/dimensoes/migrations/0003_remove_dimensaomodel_data.py
0.58806
0.495522
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-06-11 21:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0015_auto_20200604_1710'), ] operations = [ migrations.RemoveField( model_name='dimensaomodel', name='s...
Python
22
22.5
61
/projeto/dimensoes/migrations/0016_auto_20200611_1852.py
0.576402
0.514507
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-04-08 18:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0006_auto_20200318_1831'), ] operations = [ migrations.CreateModel( name='PrecificacaoModel', fields=[ ...
Python
157
44.923569
116
/projeto/dimensoes/migrations/0007_auto_20200408_1540.py
0.561165
0.533148
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-06-04 20:10 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0014_dimensaomodel_profundidade_media'), ] operations = [ migrations.RemoveField( model_name='dimensaomodel', n...
Python
53
25.113207
63
/projeto/dimensoes/migrations/0015_auto_20200604_1710.py
0.524566
0.509393
leopesi/pool_budget
refs/heads/master
# Generated by Django 3.0.3 on 2020-06-18 18:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dimensoes', '0018_auto_20200611_1905'), ] operations = [ migrations.AlterField( model_name='clientemodel', name='num...
Python
18
21.833334
62
/projeto/dimensoes/migrations/0019_auto_20200618_1520.py
0.600973
0.520681
huzhaoyangcode/myAllWorkUsefullCode
refs/heads/master
#!/usr/bin/env python3 import xml.etree.ElementTree as ET import os import copy import json #读取序列文件,得到dir处理序列 with open('dirQueue.txt', 'r') as queueFile: handleList = queueFile.readlines() #设置用来做test的图片开始位置和结束位置 testStartId = 1000 testEndId = 6000 strJson = "{\"images\": " strTestJson = "{\"images\": " # prin...
Python
173
37.878613
335
/xmlToJson/xmlToJson_new_12_24.py
0.597532
0.586084
huzhaoyangcode/myAllWorkUsefullCode
refs/heads/master
#!/usr/bin/env python import threading import time import os import sys import signal #Write First thread of creating raw file class ThreadCreateFile (threading.Thread): def __init__(self, threadID, name, counter): threading.Thread.__init__(self) self.threadID = threadID self.name = name ...
Python
171
35.695908
166
/TwoThread/TwoThread.py
0.599841
0.580398
jettaponB/Practice
refs/heads/main
import tkinter as tk def show_output(): number = int(number_input.get()) if number == 0: output_label.configure(text='ผิด') return output = '' for i in range(1, 13): output += str(number) + ' * ' + str(i) output += ' = ' + str(number * i) + '\n' output_label.confi...
Python
38
19.473684
56
/Test07.py
0.633205
0.610039
jettaponB/Practice
refs/heads/main
class Tank: def __init__(self, name, ammo) -> None: self.name = name self.ammo = ammo first_tank = Tank('Serie1', 3) print(first_tank.name) second_tank = Tank('Serie2', 5) print(second_tank.name)
Python
10
20.9
43
/Test13.py
0.614679
0.59633
jettaponB/Practice
refs/heads/main
class Tank: def __init__(self, name, ammo) -> None: self.name = name self.ammo = ammo def add_ammo(self, ammo): if self.ammo + ammo <= 10: self.ammo += ammo def fire_ammo(self): if self.ammo > 0: self.ammo -= 1
Python
10
26.9
43
/class_tank.py
0.492806
0.478417
jettaponB/Practice
refs/heads/main
# message = 'วัชราวลี' # result = len(message) # print(result) # message = 'วัชราวลี' # result = 'วัช' in message # print(result) # message = '0982612325' # result = message.isdigit() # print(result) # message = 'Just Python' # result = message.replace('Python', 'Rabbit') # print(result) message = 'กระต่าย, กระรอก,...
Python
21
19.095238
46
/Test12.py
0.656398
0.632701
jettaponB/Practice
refs/heads/main
# quests = ['ปลูกต้นมะม่วง', 'ล้างปลา', 'เผาถ่าน'] # if 'ล้างปลา' in quests: # print('ทำงานเสร็จ') #---------------------------------------------------- # quests = ['ปลูกต้นมะม่วง', 'ล้างปลา', 'เผาถ่าน'] # max_quests = 5 # if len(quests) < max_quests: # quests.append('จับปลาดุก') # print(quests) #---------...
Python
19
32.210526
53
/Test10.py
0.419304
0.416139
jettaponB/Practice
refs/heads/main
def get_circle_area(radius): return 22 / 7 * (radius ** 2) def get_triangle_area(width, heigth): return 1 / 2 * width * heigth def get_rectangle_area(width, heigth): return width * heigth
Python
8
24.25
38
/shape.py
0.661692
0.631841
jettaponB/Practice
refs/heads/main
import class_tank as CT first_tank = CT.Tank('Serie1', 3) first_tank.fire_ammo() print(first_tank.ammo) first_tank.fire_ammo() first_tank.fire_ammo() print(first_tank.ammo) first_tank.add_ammo(4) print(first_tank.ammo)
Python
12
17.583334
34
/Test14.py
0.730942
0.717489
jettaponB/Practice
refs/heads/main
import tkinter as tk def show_output(): number = int(input_number.get()) output = '' for i in range(1, 13): output += str(number) + ' * ' + str(i) + ' = ' + str(number * i) + '\n' output_label.configure(text=output) window = tk.Tk() window.title('โปรแกรมคำนวนสูตรคูณ') window.minsize(widt...
Python
28
22.428572
79
/test09.py
0.662595
0.648855
jettaponB/Practice
refs/heads/main
score = 55 if score >= 80: print('Grade A') print('dafdaf') elif score >= 70: print('Grade B') elif score >= 60: print('Grade C') else: print('Grade F')
Python
11
14.818182
20
/Test02.py
0.557471
0.511494
jettaponB/Practice
refs/heads/main
# number = 1 # double = number * 2 # print(number) # for i in range(1, 7): # double = i * 2 # print(double) # for i in range(1, 7): # if i % 3 == 0: # continue # print(i) for i in range(1, 7): if i % 3 == 0: break print(i)
Python
17
14.647058
23
/Test03.py
0.467925
0.418868
jettaponB/Practice
refs/heads/main
# x = '4.5' # y = str(12) # z = x + y # print(z) # final_score = 15 # # age = 25 # ตัวเลขจำนวนเต็ม (integer) # weight = 66.6 # ตัวเลขทศนิยม (Float) # first_name = 'ศักรินทร์' # ข้อความ (String) # has_notebook = True # Boolean x = 5 y = 2 a1 = x + y # 7 a2 = x - y # 3 a3 = x *...
Python
27
16.629629
53
/Test01.py
0.395789
0.32
jettaponB/Practice
refs/heads/main
import tkinter as tk def set_message(): text = text_input.get() title_label.configure(text=text) window = tk.Tk() window.title('Desktop Application') window.minsize(width=300, height=400) title_label = tk.Label(master=window, text='กรุณาระบุข้อความ') title_label.pack() text_input = tk.Entry(master=window) t...
Python
20
21.15
68
/Test08.py
0.714286
0.700893
jettaponB/Practice
refs/heads/main
# def get_box_area(width, length, height): # box_area = width * length * height # print(box_area) # # get_box_area(4, 4, 2) # get_box_area(width=1, length=1, height=2) def get_box_area(width, length, height): if width < 0 or length < 0 or height < 0: return 0 box_area = width * length * heig...
Python
20
21.1
48
/Test04.py
0.619048
0.573696
jettaponB/Practice
refs/heads/main
book = { 'name': 'C++', 'price': '299', 'page': '414' } # #ตัวแปลทีละตัว ... ตัวแปรจะเยอะเกิน # book_name = 'C++' # book_price = 299 # book_page = 414 # #เก็บใน List ... ลืมว่าข้อมูลไหนอยู่ที่ index ไหน # book_data = ['C++', 299, 414] #book['place'] = 'MU Salaya' book.pop('price') print(book)
Python
18
16.222221
51
/Test11.py
0.530744
0.472492
jettaponB/Practice
refs/heads/main
import shape as sh circle = sh.get_circle_area(10) print(circle) triangle = sh.get_triangle_area(width=6, heigth=7) print(triangle)
Python
7
18.142857
50
/Test05.py
0.75188
0.721804
gitclub-data/Alarm_clock
refs/heads/master
from tkinter import * import tkinter.filedialog as fd root = Tk() def browsefunc(): filename = fd.askopenfilename() pathlabel.config(text=filename) browsebutton = Button(root, text="Browse", command=browsefunc) browsebutton.pack() pathlabel = Label(root) pathlabel.pack() root.mainloop()
Python
15
19
62
/test.py
0.745819
0.745819
gitclub-data/Alarm_clock
refs/heads/master
import tkinter as tk from tkinter import ttk class Alarm(): def __init__(self): #Setting The Whole Window self.root=tk.Tk() self.root.geometry("852x552+250+80") self.root.minsize("852","552") self.root.maxsize("852","552") self.root.title("Alarm Clock") Icon ...
Python
89
43.033707
130
/Alarm.py
0.604645
0.54441
manatbay/IxNetwork
refs/heads/master
# PLEASE READ DISCLAIMER # # This is a sample script for demo and reference purpose only. # It is subject to change for content updates without warning. # # REQUIREMENTS # - Python2.7 - Python 3.6 # - Python module: requests # # DESCRIPTION # Capturing packets. Make sure traffic is running in continuou...
Python
87
37.827587
119
/RestApi/Python/SampleScripts/packetCapture.py
0.696952
0.682154
martkins/images_exif_viewer
refs/heads/master
from kivy.uix.button import Button from kivy.uix.label import Label from kivy.lang import Builder from kivy.event import EventDispatcher class LabelModel(Label): def __init__(self, **kwargs): super(Label, self).__init__(**kwargs)
Python
9
26.111111
45
/labelmodel.py
0.712551
0.712551
martkins/images_exif_viewer
refs/heads/master
from kivy.uix.image import Image from kivy.properties import NumericProperty class ImageModel(Image): ang = NumericProperty() def __init__(self, **kwargs): super(Image, self).__init__(**kwargs) def rotate_right(self): self.ang += 90 def rotate_left(self): self.ang -= 90 ...
Python
19
18.263159
45
/imagemodel.py
0.60929
0.595628
martkins/images_exif_viewer
refs/heads/master
from kivy.app import App from kivy.uix.image import Image from kivy.properties import ObjectProperty from kivy.uix.listview import ListView, SimpleListAdapter from kivy.uix.label import Label from imagemodel import ImageModel from kivy.uix.button import Button from kivy.factory import Factory from buttonmodel import Bu...
Python
94
32.936169
85
/main.py
0.614734
0.612853
martkins/images_exif_viewer
refs/heads/master
import exifread from kivy.uix.button import Button from kivy.lang import Builder from tkinter.filedialog import askopenfilenames from kivy.properties import DictProperty, ListProperty, NumericProperty import webbrowser from tkinter import Tk root = Tk() root.withdraw() Builder.load_file('./actionbutton.kv') def _con...
Python
103
31.019417
113
/buttonmodel.py
0.552624
0.542918
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
# Copyright (c) 2017 - 2019 Uber Technologies, Inc. # # Licensed under the Uber Non-Commercial License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at the root directory of this project. # # See the License for the specific language governing...
Python
197
40.659897
103
/Regression/src/learn_rewieght/reweight.py
0.575241
0.555136
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from sklearn.preprocessing import LabelEncoder, MinMaxScaler, StandardScaler import pandas as pd import numpy as np from preprocess import plot_tabel def get_dataset_(nor, train_data, test_data, clean_ratio, test_retio, se...
Python
112
44.723213
121
/Regression/src/preprocess/get_dataset.py
0.60738
0.601523
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
# Copyright (c) 2017 - 2019 Uber Technologies, Inc. # # Licensed under the Uber Non-Commercial License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at the root directory of this project. # # See the License for the specific language governing...
Python
441
33.253967
100
/Regression/src/learn_rewieght/mnist_train.py
0.557593
0.53343
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import math plt.rc('font', family='Times New Roman') font_size = 16 def plot_metric_df(history_list, task_name, val_flag='test_'): if 'relapse_risk' in task_name: metric_list = ['loss', 'f1'] else: met...
Python
126
37.317459
112
/Regression/src/model/history_.py
0.583057
0.570215
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
# Copyright (c) 2017 - 2019 Uber Technologies, Inc. # # Licensed under the Uber Non-Commercial License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at the root directory of this project. # # See the License for the specific language governing...
Python
503
37.608349
120
/Regression/src/learn_weight_main.py
0.561586
0.542482
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import numpy as np import pandas as pd from sklearn.metrics import mean_absolute_error, mean_squared_error, \ confusion_matrix, precision_score, recall_score, f1_score, r2_score, accuracy_score from sklearn.preprocessing import MinMaxScaler def evaluate_classification(model, train_sets, train_label, val_sets, val...
Python
83
51.385544
104
/Regression/src/model/evaluate.py
0.633165
0.612925
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import pandas as pd import numpy as np from tqdm import tqdm import six import tensorflow as tf from keras import losses from keras import backend as K from keras import optimizers from keras.models import Sequential from keras.layers import Dense from sklearn.preprocessing import LabelEncoder, MinMaxScaler from sklear...
Python
157
45.305733
143
/Regression/src/useless/ave_logsit_baseline.py
0.605777
0.588996
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import copy import pandas as pd import matplotlib.pyplot as plt from model.history_ import plot_history_df, plot_metric_df import numpy as np from scipy.stats import ttest_ind, levene from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score def mape(y_true, y_pred): return np.mean(np.abs((y_t...
Python
126
46.674603
127
/Regression/src/preprocess/plot_tabel.py
0.554779
0.531136
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
#coding=gb18030 import numpy as np import pandas as pd def load_data_(datasets, task_name='', seed=2020): if datasets == 'winequality_white': data_path = '../DataSet/wine/{}.csv'.format(datasets) data = pd.read_csv(data_path) data.rename(columns={'quality': 'label'}, inplace=True) ...
Python
61
48.360657
120
/Regression/src/preprocess/load_data.py
0.61541
0.582863
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import pandas as pd import numpy as np from tqdm import tqdm import six import tensorflow as tf from keras import losses from keras import backend as K from keras import optimizers from keras.models import Sequential, Model from keras.callbacks import EarlyStopping from keras.layers import Input, Dense, Multiply, Activ...
Python
216
37.666668
118
/Regression/src/useless/keras_att.py
0.617816
0.601173
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import copy import pandas as pd import numpy as np import lightgbm as lgb from sklearn.linear_model import RidgeClassifierCV, LogisticRegressionCV, RidgeCV, LassoCV, LinearRegression from keras.models import load_model from keras import backend as K from keras.optimizers import Adam, RMSprop, SGD from keras.callbacks i...
Python
213
48.685448
119
/Regression/src/model/training_.py
0.534159
0.517245
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
from model.history_ import plot_metric_df import pandas as pd import matplotlib.pyplot as plt import os xx = os.getcwd() path_root = '../report/result/' task_name = 'ablation_time_all' metric_list = [] metric_list_dir = ['metric_ablation_time_enh_10nrun_1Fold.csv', 'metric_ablation_time_vanilla_10nrun_1Fold.csv', 'me...
Python
22
25.681818
63
/Regression/src/eval.py
0.71891
0.698467
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import tensorflow as tf import numpy as np import pandas as pd from keras import backend as K from keras import regularizers, activations from keras.layers import Dense, Input, Add, Concatenate, Dropout, \ BatchNormalization, Activation, Multiply, Embedding, Layer, GlobalAveragePooling1D from keras.models import Mo...
Python
474
38.405064
118
/Regression/src/model/bulid_model.py
0.567864
0.543931
Peroxidess/Ablation-Time-Prediction-Model
refs/heads/main
import numpy as np import pandas as pd import six from tqdm import tqdm from sklearn.model_selection import KFold import matplotlib.pyplot as plt from preprocess.load_data import load_data_ from preprocess.get_dataset import get_dataset_, data_preprocessing, anomaly_dectection from model.training_ import training_model...
Python
103
54.815533
123
/Regression/src/main.py
0.567229
0.558184
deepikaasharma/string-concat-for-numbers
refs/heads/master
first_num = '123' second_num = '456' third_num = '789' # Replace `None` with your code final_num = (first_num+second_num+third_num) print(int(final_num))
Python
7
21.142857
44
/main.py
0.688312
0.62987
islamaf/Software-development-exercise
refs/heads/main
import os from tkinter import Tk, ttk, filedialog import pandas as pd from win32 import win32api root = Tk() root.title('Ahram Exam') root.resizable(True, True) root.frame_header = ttk.Frame() root.geometry("350x250") root.eval('tk::PlaceWindow . center') ttk.Label(root.frame_header, text='Browse file to open:', sty...
Python
62
30.161291
122
/gui_main.py
0.633868
0.610564
CENSOREDd/test_fk
refs/heads/master
#!/usr/bin/python3 from time import sleep print("what the fuck???") if __name__ == "__main__": print("here is python code!!!") print("Executing code...") sleep(2)
Python
10
16.799999
35
/fk.py
0.578652
0.567416
CENSOREDd/test_fk
refs/heads/master
#!/usr/bin/python3 import fk print("here is test")
Python
5
9.6
21
/test.py
0.679245
0.660377
hui98/opencv
refs/heads/master
import cv2 import numpy as np import random from math import * # import an image class image: def __init__(self,na): self.dir='/home/hui/Pictures/' # self.name=raw_input('please input the picture name') self.name=na self.mode=cv2.IMREAD_COLOR self.im=cv2.imread(self.dir+self.n...
Python
173
25.757225
99
/opencvtest.py
0.568932
0.514995
rodelrod/pomodoro-report
refs/heads/master
#!/usr/bin/env python import unittest from notebook_parser import * import os import errno from datetime import datetime def mkdir_p(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST: pass else: raise class TestParser(unittest...
Python
130
33.607693
66
/test_notebook_parser.py
0.498778
0.454545
rodelrod/pomodoro-report
refs/heads/master
#!/usr/bin/env python import re import os NOTEBOOK_PATH = '/home/rrodrigues/.rednotebook/data' class EmptyDayException(Exception): """No info was entered for this date.""" class Parser(object): """Parses RedNotebook monthly files. This is a very basic parser used to extract Pomodoro referen...
Python
94
31.957447
80
/notebook_parser.py
0.525806
0.525484
shashi/phosphene
refs/heads/master
# # This script plays an mp3 file and communicates via serial.Serial # with devices in the Technites psychedelic room to visualize the # music on them. # # It talks to 4 devices # WaterFall -- tubes with LEDs and flying stuff fanned to music # DiscoBall -- 8 60 watt bulbs wrapped in colored paper # LEDWall -- a...
Python
115
23.347826
77
/src/apps/psychroom.py
0.664286
0.646786
shashi/phosphene
refs/heads/master
# Functions to help you lift and fold from .signal import * from dsp import * import numpy import pdb import math def setup(signal, horizon=576): # Note of awesome: this only sets up dependencies, # things absolutely necessary are evaluated. signal.fft = lift(lambda s: \ fft(s.A[-horizon/2:hor...
Python
111
30.972973
74
/src/phosphene/signalutil.py
0.5255
0.506622
shashi/phosphene
refs/heads/master
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "phosphene", version = "0.0.1", author = "Shashi Gowda", author_email = "shashigowda91@gmail.com", description = ("A library for music processing and visuali...
Python
23
28.347826
71
/src/setup.py
0.611852
0.605926
shashi/phosphene
refs/heads/master
import serial import numpy import math from device import Device from cubelib import emulator from cubelib import mywireframe as wireframe from animations import * import time import threading # A class for the cube class Cube(Device): def __init__(self, port, dimension=10, emulator=False): Device.__init__...
Python
113
27.212389
66
/src/apps/devices/cube.py
0.530574
0.500784
shashi/phosphene
refs/heads/master
import scipy import numpy from util import * def fftIdx(Fs, Hz, n): assert(Hz <= Fs / 2); return round(Fs / n * Hz) memFftIdx = memoize(fftIdx) def getNotes(): return [0] \ + [16.35 * pow(2, i/12.0) + 1 for i in range(0, 101)] \ + [11050, 22100] def group(n, fft, grouping=lambda i:...
Python
75
26.146667
81
/src/phosphene/dsp.py
0.556483
0.52554
shashi/phosphene
refs/heads/master
import os from hashlib import sha1 import scipy.io.wavfile as wav import pygame.mixer from pygame.sndarray import make_sound # Set mixer defaults pygame.mixer.pre_init(44100, 16, 2, 4096) __all__ = ["read", "makeSound"] def digest(string): return sha1(string).hexdigest() def read(fname): """ Reads an audio ...
Python
44
26.704546
77
/src/phosphene/audio.py
0.654098
0.633607
shashi/phosphene
refs/heads/master
import numpy import random import time from cubelib import mywireframe from cubelib import emulator # TODO: # shiftPlane(axis, plane, delta) # moves the plane along the axis by delta steps, if it exceeds dimensions, just clear it out, don't rotate. # swapPlanes(axis1, plane1, axis2, plane2) # rain should set random...
Python
992
26.765121
138
/src/apps/devices/animations.py
0.493211
0.440096
shashi/phosphene
refs/heads/master
import os, sys dirname = os.path.dirname here = os.path.abspath(__file__) parentdir = dirname(dirname(here)) sys.path.append(parentdir)
Python
6
21.833334
34
/src/apps/pathsetup.py
0.737226
0.737226
shashi/phosphene
refs/heads/master
import numpy from threading import Thread # this is for the repl __all__ = ['memoize', 'memoizeBy', 'numpymap', 'indexable', 'reverse'] # Helper functions def memoize(f, key=None): mem = {} def g(*args): k = str(args) if mem.has_key(k): return mem[k] else: r = f(...
Python
63
26.206348
79
/src/phosphene/util.py
0.497376
0.493294
shashi/phosphene
refs/heads/master
from devices.cubelib import emulator from devices.cubelib import mywireframe as wireframe from devices.animations import * pv = emulator.ProjectionViewer(640,480) wf = wireframe.Wireframe() def cubeProcess(cube, signal, count): pv.createCube(wf) start = (0, 0, 0) point = (0,0) #planeBounce(cube,(count...
Python
23
27.304348
52
/src/apps/cube.py
0.680492
0.645161
shashi/phosphene
refs/heads/master
import device from phosphene.signal import * from phosphene.signalutil import * from phosphene.graphs import * class LEDWall(device.Device): def __init__(self, port): device.Device.__init__(self, "LEDWall", port) def setupSignal(self, signal): CHANNELS = 6 val = lambda s: [max(0, scip...
Python
24
34.708332
112
/src/apps/devices/ledwall.py
0.614936
0.585764
shashi/phosphene
refs/heads/master
#!/bin/env python #using the wireframe module downloaded from http://www.petercollingridge.co.uk/ import mywireframe as wireframe import pygame from pygame import display from pygame.draw import * import time import numpy key_to_function = { pygame.K_LEFT: (lambda x: x.translateAll('x', -10)), pygame.K_RIGHT...
Python
164
33.298782
254
/src/apps/devices/cubelib/emulator.py
0.594172
0.559879
shashi/phosphene
refs/heads/master
__all__ = ["emulator", "mywireframe"]
Python
1
37
37
/src/apps/devices/cubelib/__init__.py
0.578947
0.578947
shashi/phosphene
refs/heads/master
__all__ = ["discoball", "cube", "waterfall"]
Python
1
44
44
/src/apps/devices/__init__.py
0.555556
0.555556
shashi/phosphene
refs/heads/master
import time import numpy from util import indexable __all__ = [ 'Signal', 'lift', 'foldp', 'perceive' ] class lift: """ Annotate an object as lifted """ def __init__(self, f, t_indexable=None): self.f = f if hasattr(f, '__call__'): self._type = 'lambda' e...
Python
169
26.035503
70
/src/phosphene/signal.py
0.525717
0.521777
shashi/phosphene
refs/heads/master
import pdb import scipy import numpy import pygame from pygame import display from pygame.draw import * from pygame import Color import math def barGraph(data): """ drawing contains (x, y, width, height) """ def f(surface, rectangle): x0, y0, W, H = rectangle try: l = l...
Python
85
24.6
76
/src/phosphene/graphs.py
0.413603
0.377298
shashi/phosphene
refs/heads/master
import device from phosphene.signal import * from phosphene.signalutil import * from phosphene.graphs import * class DiscoBall(device.Device): def __init__(self, port): device.Device.__init__(self, "DiscoBall", port) def setupSignal(self, signal): signal.discoball = lift(lambda s: numpymap(lam...
Python
19
31.947369
120
/src/apps/devices/discoball.py
0.662939
0.638978
shashi/phosphene
refs/heads/master
import device from phosphene.signal import * import scipy, numpy from phosphene.graphs import barGraph class Waterfall(device.Device): def __init__(self, port): device.Device.__init__(self, "Waterfall", port) def setupSignal(self, signal): def waterfall(s): lights = [s.avg8[i] * 15...
Python
26
28.5
65
/src/apps/devices/waterfall.py
0.601043
0.58279
shashi/phosphene
refs/heads/master
import serial import numpy from threading import Thread class Device: def __init__(self, name, port): self.array = [] try: self.port = serial.Serial(port) self.isConnected = True print "Connected to", name except Exception as e: self.port = No...
Python
42
26.285715
63
/src/apps/devices/device.py
0.584132
0.579773
shashi/phosphene
refs/heads/master
__all__ = ["audio", "dsp", "signal", "graphs", "util"]
Python
1
54
54
/src/phosphene/__init__.py
0.490909
0.490909
shashi/phosphene
refs/heads/master
import sys import pdb import pygame from pygame import display from pygame.draw import * import scipy import time from phosphene import audio, util, signalutil, signal from phosphene.graphs import barGraph, boopGraph, graphsGraphs from threading import Thread if len(sys.argv) < 2: print "Usage: %s file.mp3" % sy...
Python
81
26.234568
77
/src/demo.py
0.662738
0.644152
TaegamJung/mannam
refs/heads/master
from django.shortcuts import render # View에 Model(Post 게시글) 가져오기 from .models import Post from django.views.generic.base import TemplateView from django.views.generic.edit import CreateView from django.contrib.auth.forms import UserCreationForm from django.urls import reverse_lazy from django.views.generic.edit imp...
Python
63
29.619047
115
/main/views.py
0.700828
0.700828
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * # Initialize T = 10000 repl_num = 100 service_rate_h = 1./7 service_rate_i = 1./3 Mean1_psc_cap = [] STD1_psc_cap = [] Mean2_psc_cap = [] STD2_psc_cap = [] Mean3_psc_cap = [] STD3_psc_cap = [] Mean4_psc_cap = [] STD4_psc_cap = [] Mean5_psc_cap = [] STD5_psc_cap = [] ...
Python
76
33.039474
90
/stroke_expanded_add_capacity.py
0.596998
0.532458
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_source import * g = r.Random(1234) def next_arrival(arrival_rate): U = g.uniform(0,1) arrival_time = -1./arrival_rate * m.log(U) return arrival_time def next_service(service_rate): U = g.uniform(0,1) service_time = -1./service_rate * m.log(U) return service_time ...
Python
726
33.280991
181
/stroke_functions.py
0.455259
0.423831
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * repl_num = 100 # Base case open_file = open("base_mean.pkl", "rb") loaded_list = pickle.load(open_file) open_file.close() Mean1 = loaded_list[0] Mean2 = loaded_list[1] Mean3 = loaded_list[2] open_file = open("base_std.pkl", "rb") loaded_list = pickle.load(open_file) open_...
Python
102
38.911766
294
/stroke_overall_comparison.py
0.659162
0.591377
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * # Initialize T = 10000 repl_num = 10 service_rate_h = 1./7 service_rate_i = 1./3 Mean1_psc = [] STD1_psc = [] Mean2_psc = [] STD2_psc = [] Mean3_psc = [] STD3_psc = [] Mean4_psc = [] STD4_psc = [] Mean5_psc = [] STD5_psc = [] Mean6_psc = [] STD6_psc = [] cc0 = 15...
Python
93
31.67742
82
/stroke_expanded.py
0.575893
0.505102
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * import stroke_base import stroke_base_add_capacity import stroke_expanded import stroke_expanded_reduced_rate import stroke_expanded_add_capacity import stroke_overall_comparison
Python
7
29
35
/stroke_main.py
0.817352
0.817352
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
import numpy as np import random as r import math as m import matplotlib.pyplot as plt import pickle
Python
5
19.200001
31
/stroke_source.py
0.788462
0.788462
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * # Initialize T = 10000 repl_num = 100 service_rate_h = 1./7 service_rate_i = 1./3 Mean1_cap = [] STD1_cap = [] Mean2_cap = [] STD2_cap = [] Mean3_cap = [] STD3_cap = [] Mean4_cap = [] STD4_cap = [] Mean5_cap = [] STD5_cap = [] Mean6_cap = [] STD6_cap = [] cc0 = 1...
Python
93
31.860214
82
/stroke_base_add_capacity.py
0.577594
0.506823
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * # Initialize T = 10000 repl_num = 100 service_rate_h = 1./7 service_rate_i = 1./3 Mean1_psc_red = [] STD1_psc_red = [] Mean2_psc_red = [] STD2_psc_red = [] Mean3_psc_red = [] STD3_psc_red = [] Mean4_psc_red = [] STD4_psc_red = [] Mean5_psc_red = [] STD5_psc_red = [] ...
Python
80
33.299999
90
/stroke_expanded_reduced_rate.py
0.574664
0.508493
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * # Initialize T = 10000 repl_num = 100 service_rate_h = 1./7 service_rate_i = 1./3 Mean1 = [] STD1 = [] Mean2 = [] STD2 = [] Mean3 = [] STD3 = [] Mean4 = [] STD4 = [] Mean5 = [] STD5 = [] Mean6 = [] STD6 = [] MeanBed1 = [] MeanBed2 = [] MeanBed3 = [] MeanBed4 =...
Python
139
29.093525
82
/stroke_base.py
0.558306
0.490745
hjtree0825/stroke_network_ctmc_simulations
refs/heads/main
from stroke_functions import * ############################################################################ ############################################################################ ############################################################################ # Simply change the numbers in this section. # ...
Python
65
29.169231
76
/stroke_customization.py
0.557692
0.527613
MayankAgarwal/Word-ladder
refs/heads/master
''' Implements various search mechanisms ''' from node import Node import os class Search(object): ''' Contains search methods ''' def __init__(self, start_state, end_state): self.start_state = start_state self.end_state = end_state # Path to absolute english dictionary dir_p...
Python
92
23.293478
79
/search/search.py
0.561074
0.557047
MayankAgarwal/Word-ladder
refs/heads/master
''' Heuristic class holds the heuristic functions used for A* search ''' def levenshtein_distance(word1, word2, i=None, j=None): ''' Returns the levenshtein distance between the two words Args: 1) word1: 1st word 2) word2: 2nd word ''' if i is None: i = len(word1) if j...
Python
30
22.433332
72
/search/heuristic.py
0.584637
0.534851
MayankAgarwal/Word-ladder
refs/heads/master
''' Search specification for Word ladder problem ''' import os import re import heuristic class Node(object): ''' Represents a node in the word ladder graph i.e. a word ''' def __init__(self, state, depth, result_state, parent=None): self.state = state # current state self.depth = depth ...
Python
74
30.472973
87
/search/node.py
0.596228
0.594085
covertspatandemos/git_demo_2
refs/heads/main
#!/usr/bin/env python print('a') print('b') print('c') print('w') print('x') print('1') print('2') print('3') print('4') print('5')
Python
12
10.083333
21
/demo.py
0.56391
0.526316
lukemadera/ml-learning
refs/heads/master
import numpy as np import os import random import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.autograd as autograd # Implementing a function to make sure the models share the same gradient # def ensure_shared_grads(model, shared_model): # for param, shared_p...
Python
273
42.153847
126
/breakout_ai_a2c.py
0.614973
0.598167
lukemadera/ml-learning
refs/heads/master
# Decimal is causing rounding errors? E.g. 1/3 is 3.333333333334 and 1/3 of 30 is 9.9999999999990 # We want to keep precision at a max, but don't increase precision for numbers that start as less. # For example, change 33.33333333333334 to 33.33333333 and keep 1 as 1 (not 1.0000000001) from decimal import * # decimal...
Python
80
31.225
98
/number.py
0.639255
0.592708
lukemadera/ml-learning
refs/heads/master
import gym import logging import numpy as np import torch import time import breakout_ai_a2c as ai_a2c import date_time import number from subproc_vec_env import SubprocVecEnv from atari_wrappers import make_atari, wrap_deepmind, Monitor def updateState(obs, state, nc): # Do frame-stacking here instead of the Fra...
Python
165
35.660606
117
/breakout_run_train.py
0.6082
0.592495
lukemadera/ml-learning
refs/heads/master
import datetime import dateutil.parser import dateparser import math import pytz def now(tz = 'UTC', microseconds = False): # return pytz.utc.localize(datetime.datetime.utcnow()) dt = datetime.datetime.now(pytz.timezone(tz)) if not microseconds: dt = dt.replace(microsecond = 0) return dt def n...
Python
166
37.945782
117
/date_time.py
0.633565
0.607889