blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
2
333
src_encoding
stringclasses
30 values
length_bytes
int64
18
5.47M
score
float64
2.52
5.81
int_score
int64
3
5
detected_licenses
listlengths
0
67
license_type
stringclasses
2 values
text
stringlengths
12
5.47M
download_success
bool
1 class
010c0600a789e2140899a93747ded744b90731fe
Python
SilviaC7/NMTF-DrugRepositioning
/load_data_NMTF.py
UTF-8
4,407
3.0625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 28 17:23:26 2019 @author: gaetandissez This file load create a loader class to import the data from txt and csv files and create required matrices for our problem """ #We use networkx as a way to interpret the data and to transform it easily throu...
true
e76e49afacb2e50941acebe6fe64ba4f731ad70d
Python
leminhds/streamlit-goodreads-analysis-
/goodreads_app.py
UTF-8
3,890
3.25
3
[]
no_license
import streamlit as st from streamlit_lottie import st_lottie import requests import pandas as pd import plotly.express as px st.set_page_config(layout='wide') def load_lottieurl(url: str): r = requests.get(url) if r.status_code != 200: return None return r.json() file_url = 'https://assets4.lott...
true
2044b94b4f346553e1aa15d8e84de91528ce57a5
Python
aldemirneto/Exercicios-Uri
/Exercícios/1589.py
UTF-8
121
3.578125
4
[ "MIT" ]
permissive
c = int(input()) for i in range(c): x = input().split() a, b = int(x[0]), int(x[1]) print('{}'.format(a + b))
true
de6124c1ce24d5199fcca1b3cd0ce3aef995cbc8
Python
cchery101/principlescomputing
/user34_B8OE49NgGi_0.py
UTF-8
5,435
3.6875
4
[]
no_license
""" Clone of 2048 game. """ import poc_2048_gui # Directions, DO NOT MODIFY UP = 1 DOWN = 2 LEFT = 3 RIGHT = 4 # Offsets for computing tile indices in each direction. # DO NOT MODIFY this dictionary. OFFSETS = {UP: (1, 0), DOWN: (-1, 0), LEFT: (0, 1), RIGHT: (0, -1)} ...
true
42d4e51ca8b30c65026232a9c4a94b5253ee1234
Python
newmanlucy/uncommon19
/create_db.py
UTF-8
491
2.546875
3
[]
no_license
import sqlite3 def create_db(): conn = sqlite3.connect("weather_betting.db") c = conn.cursor() c.execute(""" CREATE TABLE users (username TEXT PRIMARY KEY) """) c.execute(""" CREATE TABLE bets ( id INTEGER PRIMARY KEY, atleast INTEGER, date DATE, amount INTEGER, creator_id TEXT, taker_id TEX...
true
77acc352e1702d48dfe44c1bde805f0e4ee6217e
Python
nadson-silva/Data-Science
/Data Visualization Course/Bars_comparation.py
UTF-8
354
3.9375
4
[]
no_license
import matplotlib.pyplot as plt x1 = [1, 3, 5, 7, 9] y1 = [5, 6, 4, 8, 1] x2 = [2, 4, 6, 8, 10] y2 = [7, 6, 5, 9, 2] titulo = "Gráfico de barras 2" eixoX = "Eixo X" eixoY = "Eixo Y" plt.title(titulo) plt.xlabel(eixoX) plt.ylabel(eixoY) # Legenda do grafico plt.bar(x1, y1, label="Grupo 1") plt.bar(x2, y2, label="Gr...
true
0af88915ef99436b28a928021c7fa7592c9766cd
Python
djcomidi/projecteuler
/problem173.py
UTF-8
412
3.09375
3
[]
no_license
def find_laminae(tilesleft, outersize=0): if tilesleft < 0: return 0 if outersize == 0: total = 0 for size in range(2, tilesleft // 4 + 1): total += find_laminae(tilesleft - (size * 4), size) return total else: newsize = outersize + 2 return 1 + fi...
true
73ca02358d2f2d76390cd7a4711e6de5ec98e860
Python
theodao/nanodegree-algorithm-datastructures
/Chapter1/Task2.py
UTF-8
618
3.546875
4
[]
no_license
""" Read file into texts and calls. It's ok if you don't understand how to read files """ import csv from collections import defaultdict with open('texts.csv', 'r') as f: reader = csv.reader(f) texts = list(reader) with open('calls.csv', 'r') as f: reader = csv.reader(f) calls = list(reader) spending...
true
9103f3f228d1a61486e4cab8caa829c061fc8454
Python
r3n4t3/python-mini-projects
/virus.py
UTF-8
1,343
2.921875
3
[]
no_license
import os, datetime, inspect DATA_TO_INSERT = "A VIRUS JUST INFECTED YOUR FILE" def search(path): filesToInfect = [] files = os.listdir(path) for file in files: if os.path.isdir(file): filesToInfect.extend( search(os.path.join(path + "/" + file)) ) elif file[-3:] == '.py': ...
true
3e792ae5800546332f7bdf53b383c29bbcbecd2e
Python
pyman01/financial1
/financial1.py
UTF-8
3,140
3.46875
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- """financial1 [Startkapital] [Zinssatz p.a.] [Laufzeit in Jahren] -h help, diesen "Docstring"-Text anzeigen -o output, Werte als Datei (raus)schreiben -p plot, (vorher mit -o generierte) *.dat Dateien zur Darstellung an gnuplot weiterreichen Beispiel d...
true
45272a62e476ccee3e2c1ac3aafc85f151ef87e6
Python
tbgers/rcViewbot
/viewbot.py
UTF-8
5,185
2.578125
3
[]
no_license
import sys, os, time, datetime, asyncio, aiohttp f = open('/dev/null', 'w') sys.stderr = f def moveCursor(x, y): sys.stdout.write("\033[" + str(y) + ";" + str(x) + "H") sys.stdout.flush() # | dark | bright | # --------+------+--------+ # black | 0 | 8 | # red | 1 | 9 | # green ...
true
7f17b523ac8d55c05a00f6b992407bdfc8140b13
Python
Mintic-ProyectoAUBONPAIN/RETO_FINAL_2022_GRUPO4_AU_BON_PAIN
/models.py
UTF-8
1,466
2.640625
3
[ "MIT" ]
permissive
from datetime import datetime from werkzeug.security import generate_password_hash, check_password_hash from app import db, login_manager from flask_login import UserMixin @login_manager.user_loader def load_user(id): return User.query.get(int(id)) # ------- Create the User Model ------- class User(db.Model,...
true
6c08fd006182fdd25d4ff886c891d3c84090b92f
Python
Jeremip11/precog
/href.py
UTF-8
4,825
2.640625
3
[ "ISC" ]
permissive
from urlparse import urlparse, urljoin, urlunparse from re import match def get_redirect(req_part, ref_url, slash_count=3): ''' >>> get_redirect('/style.css?q=Hi', 'http://preview.local/foo/bar/baz/') '/foo/bar/baz/style.css?q=Hi' >>> get_redirect('/style.css?q=Hi', 'http://preview.local/foo/bar/b...
true
d84f7b232027ea9f6f718682be773c0ad4085b49
Python
gladiopeace/csc-manager-ui
/app_tools/os_utils.py
UTF-8
277
2.90625
3
[]
no_license
import os import shutil import sys def restart_program(): python = sys.executable os.execl(python, python, *sys.argv) def copy_tmp_file(old_file): new_file = old_file + "tmp" shutil.copy(old_file, new_file) print("Make copy {}. Done!".format(new_file))
true
fb5febffb56ec5070bc05c82408740eeba40bbb9
Python
janmotl/rf
/rf_test.py
UTF-8
2,721
3.046875
3
[ "BSD-2-Clause" ]
permissive
import unittest from numpy.testing import assert_almost_equal from rf import RF from numpy import * # Data y = array([0, 1, 0, 1, 1]) X0 = array([[0], [1], [0], [1], [1]]) X1 = array([[0, 1], [1, 0], [0, 1], [1, 2], [1, 3]]) X2 = array([[0, 3], [1, 2], [0, 0], [1, 2], [1, 3]]) # Numpy warnings to errors seterr(all=...
true
83c0adea2b0a854b237f166487c355bd0741d4d0
Python
flodesi/NEATris
/main.py
UTF-8
6,101
2.71875
3
[]
no_license
#!/usr/bin/python3 import os import pickle from time import sleep import neat import pygame from Tetris.tetris import Tetris from Tetris.global_variables import ROTATE_KEY, RIGHT_KEY, LEFT_KEY, DOWN_KEY from utils import attempt import argparse pygame.init() pygame.display.set_caption('NEATris') with open("winner_wi...
true
8b0e4e63fec9623369c48c3b6fa1e855008b2ef6
Python
sahands/problem-solving
/misc/acmpacnw2013/janeway.py
UTF-8
4,716
3.359375
3
[]
no_license
from __future__ import division from math import sqrt, atan2, pi from sys import stdin __author__ = "Sahand Saba" EPS = 1e-6 class Point(object): __slots__ = ['x', 'y'] def __init__(self, xx=0.0, yy=0.0): self.x = float(xx) self.y = float(yy) def angle(self): """ Retur...
true
8f9990feb63ebbf56e1b40b234fe05a5111a38fd
Python
Wahe3bru/IoT_temp
/send_email.py
UTF-8
2,747
3.09375
3
[]
no_license
# https://changhsinlee.com/pyderpuffgirls-ep4/ import os import smtplib import ssl from email.mime.text import MIMEText from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from pathlib import Path def send_email(username, password, recipient, subject, body, attachment=None...
true
19c16d22d0223a5d8b94be289c19b3803c383df3
Python
siddharth456/Python_Scripts_1
/for_loop_through_dictionary.py
UTF-8
256
3.203125
3
[]
no_license
test_dict={"Name":"Ankit Kumar","Age":"29","Profession":"IT","Location":"New Delhi"} # for key in test_dict: for key,value in test_dict.items(): # print(key+": "+test_dict[key]) print(key+":"+value) # key for getting key and test_dict[key] for value
true
2e14df6f369217d7cb7ebc09361a0121e330fc7b
Python
linsalrob/Genotype-Phenotype-Modeling
/scripts/gapfill_from_reactions.py
UTF-8
18,180
2.65625
3
[ "MIT" ]
permissive
import argparse import copy import sys import PyFBA __author__ = 'Rob Edwards' """ This code is designed to exemplify some of the gap-filling approaches. If you start with an ungapfilled set of reactions, we iteratively try to build on the model until it is complete, and then we use the bisection code to trim out rea...
true
7a3abbaea203e851049a59d339a48743ae5a1537
Python
RoyRin/Computational_Physics_2016
/proj3_MonteCarlo/IsingModel_Metropolis.py
UTF-8
8,272
2.875
3
[]
no_license
from pylab import * import numpy as np import matplotlib.pyplot as plt import math import matplotlib.mlab as mlab import random spins =100 aveSpinGroup = 10 ising = [] J = -0.20 #alignmentE = -0.20 # energy of alignment mu = 0.33 B = 0. kB = 1.0 temperature = 100. time = 150. timeplots =time/1.0 timeplotsteps = int(...
true
18909f578c7a27e8d600e8a593ad6151a3ee3bc4
Python
dr-dos-ok/Code_Jam_Webscraper
/solutions_python/Problem_76/128.py
UTF-8
689
2.828125
3
[]
no_license
filename = input("Enter file name of test case: ") rfname = input("Enter result file name: ") file = open(filename) ipt = file.readlines() ls = int(ipt[0]) res = [] for n in range(2,ls*2+1,2): print(n) cln = ipt[n] cln = cln.strip() cln = cln.split(" ") for i in range(len(cln)): cln[i] = int(cln[...
true
40cea76e7b4698ac5db4cc7078a5d9c0f5e53f6d
Python
lars76/pysais-utf8
/test_pysais.py
UTF-8
1,965
3.25
3
[ "MIT" ]
permissive
from unittest import TestCase from sais import * import operator def find_all_matches(suffix_arr, text, query): def binary_search(lo, hi, op): m = len(query) while lo < hi: mid = (lo + hi) // 2 suffix = suffix_arr[mid] if op(text[suffix:suffix+m], query): ...
true
6d97a6078e81d6f1bee2fab626fa1abffdefc582
Python
spearfish/python-crash-course
/example/06.3.4_enumerate_values.py
UTF-8
379
3.25
3
[]
no_license
#!/usr/bin/env python3 fav_langs = { 'jen' : 'python', 'sarah' : 'c', 'edward' : 'ruby', 'phil' : 'python' } print("The following langs are mentioned : ") for lang in fav_langs.values() : print("\t" + lang) print("Let's eliminate the dumplicates") print(type(set(fav_langs.values()))) for...
true
e5a5ed5f8fb038975c978e324998e32a3fb118cb
Python
Rafapia/Deep-Reinforcement-Learning-Algorithms-with-PyTorch
/DeepRL/agents/policy_gradient_agents/REINFORCE.py
UTF-8
4,407
3.109375
3
[ "MIT" ]
permissive
import numpy as np import torch import torch.optim as optim from torch.distributions import Categorical from agents.Base_Agent import Base_Agent class REINFORCE(Base_Agent): agent_name = "REINFORCE" def __init__(self, config): Base_Agent.__init__(self, config) self.policy = self.create_NN(input...
true
c2374c893b39197c1b452f162d494a9652ff251d
Python
1802343117/Python-Learn
/Python Basic grammar/Exercise32.py
UTF-8
1,034
3.03125
3
[]
no_license
from threading import Thread import requests # 继承Thread类创建自定义的线程类 class DownloadHandle(Thread): def __init__(self, url, name): super().__init__() self.url = url self.name = name def run(self): filename = self.name print(filename) resp = reques...
true
3859d5c6b46487868abfe99a577a8a7a7fb6d8a8
Python
karthikeyankadirvel/MachineLearning
/Descision_Tree.py
UTF-8
3,608
2.71875
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Nov 16 20:53:27 2019 @author: karth """ import numpy as np import math import pandas as pd from collections import Counter import os os.chdir(r"C:\Users\karth\JupyterProjects\MachineLearning") #%% data=pd.read_excel("data.xlsx") x=data[['Chest_pain', 'Leg_pain', 'Kideney_pain...
true
291757e8260bd50b94ab1329fec46d1a29a15cb5
Python
Winterbl00m/URISE-solarforecasting
/LSTM_model.py
UTF-8
7,376
3.09375
3
[]
no_license
# Importing the libraries import tensorflow as tf from tensorflow import keras import pandas as pd import random import numpy as np import matplotlib.pyplot as plt from tensorflow.keras.models import Model from tensorflow.keras.layers import LSTM, Dense, Input, concatenate import matplotlib.pyplot as plt from tensorfl...
true
9dc8753b1ae2acd4dddd3969000958010c9e3b9c
Python
siolag161/markov_generator
/tests/markogen_tests.py
UTF-8
3,146
2.9375
3
[]
no_license
from nose.tools import * from collections import deque import unittest from markogen.models import * from markogen.tools import * # def setup(): # print "SETUP!" # def teardown(): # print "TEAR DOWN!" # def test_basic(): # print "I RAN!" class testGraphModel(unittest.TestCase): def test_constru...
true
30af63aea12a4a80920278874ad596d824c5fc25
Python
alahoo/BitTornado
/BitTornado/Application/parseargs.py
UTF-8
3,954
3.28125
3
[ "MIT" ]
permissive
def formatDefinitions(options, COLS, presets={}): """Format command-line options and documentation to fit into a given column width Parameters tuple[] - (flag, default, docstring) tuples describing each flag int - Number of columns to write dict - {flag: value} overrides for ...
true
e89df5bd00a860aaad6018eb0f22a2b05e50b231
Python
HantaoShu/OpenDrug
/baseline_methods/run_rf.py
UTF-8
2,394
2.625
3
[ "Apache-2.0" ]
permissive
import argparse import pickle import numpy as np from scipy.stats import pearsonr from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import make_scorer from sklearn.model_selection import KFold, cross_val_score, GridSearchCV def pearson_corr(y, y_pred, **kwargs): if np.isnan(y).any() or np.i...
true
1f129d4e8fabc4492abb6ad9b3b852fd37bd8553
Python
Danny0327/MisionTIC2022
/Modulo1_Python_MisionTIC2022_Main/Semana_3/Retos/P22/Reto_3_P22_Casos_de_prueba.py
UTF-8
2,389
3.6875
4
[]
no_license
def Agendamiento(eventos: list): agenda = {} #Inicializar diccionario for fEvento,hEvento,aEvento in eventos: #Ciclo para agregar un nuevo evento if agenda.get(fEvento) == None: #Fuerza la entrada agenda[fEvento] = [] #Creacion de un nuevo evento ...
true
d7a9e645ee17a1231be7c22e0b1da4cd796e80e3
Python
GassaFM/contests
/facebook/fbhc2016-qual/agen.py
UTF-8
168
2.8125
3
[]
no_license
import random t = 1 n = 2000 print t for k in range (t): print n for i in range (n): print random.randint (-10000, +10000), print random.randint (-10000, +10000)
true
73609ca0cadad2e0c568eacf4c7fa874fdf5e2fb
Python
Bruce-Decker/VRTube
/selenium/test01.py
UTF-8
1,627
2.96875
3
[ "Apache-2.0" ]
permissive
""" Setup 1. Install Python selenium module: $ pip install selenium 2. Download Chrome Webdriver and place in /usr/local/bin """ import time from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.chrome.options import Options def main(): #ip = "local...
true
d9c64cc5482099f10f68ccdcd6d31afac9250c7c
Python
MohamedGhadie/edgotype_fitness_effect
/code_extra/produce_ppi_models_5.py
UTF-8
1,965
2.515625
3
[]
no_license
#---------------------------------------------------------------------------------------- # Produce PPI structural models. # Call script from directory ../data/processed/<interactome_name>/model_based/ppi_models. #---------------------------------------------------------------------------------------- import os from p...
true
b0a8ab20d0002efa3ed0f51238397dca999efc3e
Python
fuktommy/homebin
/mkrss
UTF-8
8,778
2.5625
3
[ "BSD-2-Clause" ]
permissive
#!/usr/bin/python3 """Make RSS for file list. It requires rss.py by Fuktommy. Synopsis: mkrss.py [/path/to/html/dir] > rss.xml mkrss.py -b /path/to/html/dir file_list > rss.xml find /path/to/html/dir -type f | \ mkrss.py -b /path/to/html/dir > rss.xml Options: -h header_file: File includes ti...
true
c24aeb0709fd726b28a252b2d23f6c8b6a3f812d
Python
goiri/greendcsimulator
/timelist.py
UTF-8
2,129
3.515625
4
[]
no_license
#!/usr/bin/env python2.7 from commons import interpolate """ Class to implement a series of values in time """ class TimeList: def __init__(self, continous=True): self.list = [] # [(time, value),...] self.continous = continous def __str__(self): return str(self.list) def __len__(self): return len(self.l...
true
0c6aeed30a4f5f0f861cf70be525731c1a2c5a26
Python
justin8/video_utils
/tests/test_video.py
UTF-8
5,720
2.640625
3
[ "MIT" ]
permissive
import pytest import os from os import path from mock import patch import pickle from video_utils import Video, Codec def test_minimal(): v = Video("foo.mkv", "/not-a-real-path/bar") assert v.name == "foo.mkv" assert v.dir_path == "/not-a-real-path/bar" def test_full_path(): v = Video("foo.mkv", "/...
true
c15b53b5146ea1c3e0216dd8523a23d08b26c0aa
Python
klmitch/bark
/bark/handlers.py
UTF-8
14,448
2.828125
3
[ "Apache-2.0" ]
permissive
# Copyright 2012 Rackspace # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
true
76ba6e2e17b24b716fcd2135205d455b68a17c7e
Python
shuaiweixiaozi/pytorch_example
/ts_example/ts_utils/feature_engineering.py
UTF-8
4,211
2.625
3
[]
no_license
import numpy as np import pandas as pd import warnings from statsmodels.tsa.stattools import acf warnings.filterwarnings('ignore') def sin_transform(values): return np.sin(2*np.pi*values/len(set(values))) def cos_transform(values): return np.cos(2*np.pi*values/len(set(values))) def get_yearly_autocorr(da...
true
85e3c1f5fca1a068f75259f6a29c0934f672de77
Python
Wangjk1997/DT
/d_function.py
UTF-8
2,670
2.90625
3
[]
no_license
from math import log2 def find_max_gain(dataset): #对每个特征找到其分类的类别 num_feature = len(dataset[0]) - 1 feature_set = list() for i in range(0,num_feature): tmp_feature = list() for tmp in dataset: if not tmp[i] in tmp_feature: tmp_feature.append(tmp[i]) ...
true
9f6e71d2b6edee357d69aef795a686b0ce85e1ff
Python
olimpiojunior/Estudos_Python
/Section_10/map.py
UTF-8
1,110
4.15625
4
[]
no_license
""" map - função map realiza mapeamento de valores para função function - f(x) dados - a1, a2, a3 ... an map object: map(f, dados) -> f(a1), f(a2), f(a3), ...f(an) ------------------------------------------------------------------- import math def calc(r): return math.pi * (r**2) raios = [1, 2.2, 3., 4, 5.7, 8] l...
true
2a30c98f77eba33dac02d7c7a22c324255d0dfb9
Python
antondelchev/Python-Basics
/First-Steps-in-Coding---Exercise/04. Vacation books list.py
UTF-8
208
3.15625
3
[]
no_license
total_pages = int(input()) pages_per_hour = int(input()) days_to_read = int(input()) hours_to_read_book = total_pages / pages_per_hour hours_per_day = hours_to_read_book / days_to_read print(hours_per_day)
true
e611d078eb1fc31ea9ddb3e2f5272aabd345bdaf
Python
nanoracket/loan-schedule
/loan.py
UTF-8
6,057
2.984375
3
[]
no_license
from datetime import date, datetime, timedelta from uuid import uuid4 from database import Database db = Database() class Loan(): def __init__(self, data_map): self.id = data_map["id"] self.monthlyPaymentAmount = data_map["monthlyPaymentAmount"] self.paymentDueDay = data_map["payment...
true
00f7d24c71ec408d756581b53364598e824c8214
Python
NandanParamashiva/Artificial-Intelligence
/HW1/Avi/1/homework.py
UTF-8
17,513
3.046875
3
[]
no_license
#!/usr/bin/env python from sys import exit from collections import deque _DEBUG_ENABLE = True OFFSETLIVETRAFFIC = 4 ROOTNODEID = -100 ALGOS = ('BFS', 'DFS', 'UCS', 'A*') def Debug_print(msg): """ Method to print the debug messages """ global _DEBUG_ENABLE if _DEBUG_ENABLE is True: print 'DEBUG:'+ msg cla...
true
0db6a3441a104ec8e2fe4fd20b590b128afdb01e
Python
sstewart0/data_science_projects
/Airbnb/bnb/NER/clean_data.py
UTF-8
5,692
3.25
3
[]
no_license
""" Clean data: 1. Remove special characters: !@£$%^&*() ... 2. Change all "words" to lower case 3. Remove possessive pronouns, e.g. Stephen's ---> Stephen 4. Amend abbreviations e.g. apt ---> apartment; {BR,bdrm,...} ---> bedroom 5. Separate numbers and words e.g. 2bath ---> 2 bath 6. Change nu...
true
fafc3b9aa6b4f98d06cef2821380ce156529461b
Python
clellmann/particle-kriging
/dags/functions/kriging.py
UTF-8
3,302
3
3
[]
no_license
import numpy as np import pandas as pd from haversine import haversine def krige_point(distance_vector, distance_matrix, semivariogram, train_values): """ Kriges a point (kriging based location prediction). Args: distance_vector (np.array): Distance vector from training points to prediction po...
true
c04e61778a7ee950b36d04d473d363dc3aafd7eb
Python
ADanciulescu/Midas
/data_fetchers/candle_fetcher.py
UTF-8
7,090
2.984375
3
[]
no_license
##fetches candle data and completes a large candle table for each currency from poloniex import Poloniex from tools import timestamp_to_date from db_manager import DBManager from candle_table import CandleTable from candle import Candle from tools import date_to_timestamp from candle_parser import CandleParser import...
true
3472112d93db211635af5a5ff1476815755683d9
Python
EhwaZoom/bpgen
/bpgen/commands/create_module.py
UTF-8
545
2.625
3
[ "Apache-2.0" ]
permissive
import os from bpgen.path import get_path_to_templates, get_path_to_module from bpgen.utils import print_and_exit def handle(arguments): path_to_module = get_path_to_module( arguments.output, arguments.module_name ) path_to_module_templates = get_path_to_templates(path_to_module) mod...
true
ae8a51bc000b75bc65d815ca8dd0f28a2d3c9f37
Python
NLeSC/ShiCo
/shico/vocabularyaggregator.py
UTF-8
5,713
3.515625
4
[ "Apache-2.0" ]
permissive
import six from sortedcontainers import SortedDict from collections import defaultdict from utils import weightJSD, weightGauss, weightLinear from format import getRangeMiddle class VocabularyAggregator(): '''A VocabularyAggregator takes a vocabulary produced by a VocabularyMonitor and aggregates them over a ...
true
9ade88cd867f754f173e79398d05afc5dbfda845
Python
Tyrpix/ICUSystem
/ICUSystem.py
UTF-8
1,986
3.46875
3
[]
no_license
# Constructs the object ICU System with all patient objects and their respective data which is stored in a list from HRDayOne import HRDayOne from InitialLR import InitialLR import datetime class ICUSystem: def __init__(self): # Holds diagnosis for each patient (patient + hourly round data) self.d...
true
fb852d8e47ad84686f7530ba443881d5cd9cd212
Python
Aasthaengg/IBMdataset
/Python_codes/p03135/s769595462.py
UTF-8
73
3.234375
3
[]
no_license
str=input() str=str.split(" ") T=float(str[0]) X=float(str[1]) print(T/X)
true
6b02e0ac9b6c207d1b568a68d4bc1e531012d84e
Python
ALMTC/Logica-de-programacao
/Python/16.py
UTF-8
218
3.640625
4
[]
no_license
print 'Digite o salario' a=input() print 'Digite a primeira conta' b=input() print 'Digite a segunda conta' c=input() b=b+(b*2)/100.0 c=c+(c*2)/100.0 r=a-b-c print 'Sobram ' + str(r) + 'R$ do salario minimo'
true
faaee3f4f93d6e096102a64daf8df64ebacf0007
Python
FazeelUsmani/Leetcode
/07 July Leetcode Challenge 2021/02_findKclosestEle.py
UTF-8
474
3.640625
4
[ "MIT" ]
permissive
class Solution: def findClosestElements(self, arr: List[int], k: int, x: int) -> List[int]: # Initialize binary search bounds left = 0 right = len(arr) - k # Binary search against the criteria described while left < right: mid = (left + right) // 2 ...
true
7444fe6cfa924d1ee82ee97531b484dfb4bab49b
Python
vradenbr/cti110
/P5HW1_RandomNumber_VradenburghRyan.py
UTF-8
3,097
4.96875
5
[]
no_license
# A simple program that generates a random number and allows the user to guess the number. # 23APR2021 # CTI-110 P5HW1 - Random Number # Ryan Vradenburgh # ''' BEGIN Menu Function: Option 1: Play Game Option 2: Exit Program Accept User Input Return User Input Game Function: Generate...
true
d9e086a1f6d7f0716f63a5d9e2db329d1c061935
Python
poohcid/class
/PSIT/20.py
UTF-8
448
3.28125
3
[]
no_license
"""Gift I""" def main(): """Function process and print""" result = more(int(input()), more(int(input()), 0)) result = more(int(input()), more(int(input()), result)) result = more(int(input()), more(int(input()), result)) result = more(int(input()), more(int(input()), result)) print(result) def...
true
b1e92d4b88b5e60a3e415fff4415f083b89aa5be
Python
onikazu/ProgramingCompetitionPractice
/Atcoder/abc092/b.py
UTF-8
189
2.703125
3
[]
no_license
n = int(input()) d, x = list(map(int, input().split())) a = [int(input()) for _ in range(n)] ans = 0 for i in range(len(a)): ans += 1 ans += (d - 1) // a[i] ans += x print(ans)
true
42ba89d3685cc3dbd5a30d38a68b8a0ca67b430d
Python
Kninoxx/python-random-quote
/rnd.py
UTF-8
129
2.609375
3
[]
no_license
import random rnd=random.randrange(100000,999999) def function(): print(rnd) if __name__ == "__main__": function()
true
31d7f20c0e9bd0e43bb16774986001f3489f2333
Python
BogdanTodor/Discord-InsultBot
/InsultBot.py
UTF-8
2,252
3.25
3
[]
no_license
from discord.ext import commands import discord from random import * linkInsult = ['Insert insults in the list here. These will be called when someone links anything in the chat'] TOKEN = 'Your token here' client = discord.Client() @client.event async def on_message(message): if message.author == client.user: ...
true
44b29c319f523d32567fd58f81cdeaadcd60a425
Python
ptmcg/plaso
/tests/analysis/tagging.py
UTF-8
4,061
2.515625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the tagging analysis plugin.""" from __future__ import unicode_literals import unittest from plaso.analysis import tagging from plaso.lib import timelib from plaso.containers import events from tests import test_lib as shared_test_lib from tests.analysis i...
true
ace57fb0c473ab3cf50e031c0cdf270a3a3b112d
Python
Yangyu0879/Tongji-SE-2018-OS-Project
/MemoryManagement/MemoryManagement.py
UTF-8
4,029
2.9375
3
[]
no_license
import random class MemoryManagementCore: def __init__(self): self.blockPage=[[-1 for i in range(4)] for i in range(2)]#用于存放当前在物理内存中的页号 self.blockFIFOQueue=[-1]*320#FIFO算法所需要使用的队列 self.queueHead=0#队列头部 self.queueCurrent=0#队列尾部 self.blockLRUSignal=[0]*4#LRU算法所需的列表 sel...
true
4f742afef81edfebf23b97ae8677e47d2224a49c
Python
jeremymaignan/facebook-messenger-analytics
/api/src/apis/message.py
UTF-8
5,056
2.546875
3
[ "MIT" ]
permissive
from collections import defaultdict import emoji import langid import pycountry from flask import request from apis.base import Base from models import db from models.message import Message from schemas.message import MessageSchema from utils import messages from utils.logger import log from utils.registry import reg...
true
067515b9e57fc850a2767340e49e1734f8e63a53
Python
Kvazar78/Skillbox
/16_list2/dz/task_10.py
UTF-8
1,032
3.8125
4
[]
no_license
def comparison(seq, seq_r, i_s): result = False i_sr = 0 for num in range(i_s, len(sequence)): if seq[num] ==seq_r[i_sr]: i_sr += 1 result = True else: result = False break return result count_num = int(input('Кол-во чисел: ')) sequence =...
true
b4e31bad24d8878abc6a237a40d493bf905cf08d
Python
marsella/euler-project
/pe22.py
UTF-8
502
3.46875
3
[]
no_license
# alphebetize a list, calculate scores, sum the scores # project_euler.com/problem=22 def alphabetize(file_name = "names.txt"): f = open(file_name, 'r') names = [] for line in f: names = str.split(str.replace(str.replace(line, '\"', ''), '\r', ''), ',') names.sort() # replace each name with its score ...
true
67f70f8c7aaffee96efae8b1efe4e596cfd1dd88
Python
steven-mathew/contest-problems
/python-solutions/System.py
UTF-8
320
3.265625
3
[]
no_license
n = int(input()) coefficients = [] for i in range(n+1): coefficients.append(float(input())) first = coefficients[0] last = coefficients[-1] ans = (abs(float(last)/first))**(float(1)/n) if n%2: if last * first > 0: ans=-ans else: if coefficients[-2]*last > 0: ans=-ans k='%.6f'%ans print(k)
true
16a5678555056b619918b3b0c57aa679e5961f19
Python
tushar-1996/Anamoly-Detection-with-Continous-Learning-Algorithm
/Models/lowerdim.py
UTF-8
4,507
2.75
3
[]
no_license
import csv import re #import pandas as pd import numpy as np #import tensorflow as tf #from sklearn.metrics import f1_score from sklearn.manifold import TSNE from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt START_CUTOFF = 30.0 train_features = [] train_labels = [] val_features = [] val_labels ...
true
b5a17863a4e0c9072427aab288e8104505d82409
Python
mtlynch/sia_load_tester
/sia_load_tester/upload_queue.py
UTF-8
1,740
2.71875
3
[ "MIT" ]
permissive
import logging import Queue import sia_client as sc logger = logging.getLogger(__name__) def from_upload_jobs(upload_jobs): """Creates a new upload queue from a list of upload jobs. Creates a new queue of files to upload by starting with the full input dataset and removing any files that are uploaded (...
true
4e1adfe79ee2a7dbb0209f1919c40f30476ad436
Python
DaniAkiode/portfollio
/Python Practice/Software Development/Login 6.0.py
UTF-8
1,580
3.390625
3
[]
no_license
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Guest123 # # Created: 20/02/2018 # Copyright: (c) Guest123 2018 # Licence: <your licence> #------------------------------------------------------------------------------- #User...
true
5ae23da5659a3c0fe8a798e4541dc0cf2badfde3
Python
suyash248/ds_algo
/DynamicProgramming/equalSumSubsets.py
UTF-8
2,939
4.125
4
[ "Apache-2.0" ]
permissive
from Array import empty_2d_array # Time complexity: O(2^n) # Space complexity: O(n) def is_subset_sum(arr, n, half_sum): """ Algorithm -> Let is_subset_sum(arr, n, sum/2) be the function that returns true if there is a subset of arr[0..n-1] with sum equal to sum/2(i.e. half_sum). Case 1: If sum o...
true
9c7a8e47fb6691e7d1002f06dffe8bd712dd7043
Python
adishavit/cvxpy
/cvxpy/constraints/power.py
UTF-8
9,243
2.828125
3
[ "Apache-2.0" ]
permissive
""" Copyright 2021 the CVXPY developers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
true
dbf8caee912ccf0d005787363e2a4a45143f1c70
Python
lydialaseur/btree
/createMyIndex.py
UTF-8
1,888
2.96875
3
[]
no_license
from btreeindex import BTreeIndex from btreenode import BTreeNode import os # os.chdir('/usr/share/databases/FanFiction/') table_dir = 'stories' col = 'AUTHOR' p = 3 idx = BTreeIndex(table_dir,col,3) num_insertions, num_levels = idx.create() print(num_insertions) # print the first first 2 levels of the tree print(...
true
8069b6d3f604282d584297dcbe9b0a0a708f4f7c
Python
DaHuO/Supergraph
/codes/CodeJamCrawler/16_0_2_neat/16_0_2_tli_codejam2016QB.py
UTF-8
371
3.453125
3
[]
no_license
t = input() for i in xrange(t): s = raw_input() num_inversions = 0 cur_char = s[0] for j in xrange(1, len(s)): if cur_char != s[j]: num_inversions += 1 cur_char = s[j] parity = 0 if s[0] == '+' else 1 parity += num_inversions c = num_inversions + parity %...
true
c00364957bad4e4dd02c56af233c9997c7dcc0bd
Python
vedaant-varshney/FitnessDetection
/SecondTutSet/histograms.py
UTF-8
863
3.140625
3
[]
no_license
import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread("images/Lionel-Messi.jpg") gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Creating Grayscale Histogram # Note that we can create a histogram based on the mask of an image gray_hist = cv2.calcHist([gray], channels=[0], mask=N...
true
38dbb40ee45e8573f32bd0a83fc103445b86cf99
Python
joepatmckenna/normal_forms
/normal_forms/examples/normal_form/for_plotting.py
UTF-8
663
3
3
[ "MIT" ]
permissive
import matplotlib.pyplot as plt import numpy as np def before_and_after(f, h, x_min=-1, x_max=1, y_min=-1, y_max=1): fig, ax = plt.subplots(1, 2, figsize=(8, 3)) x = np.linspace(x_min, x_max, 500) y = np.linspace(y_min, y_max, 500) X, Y = np.meshgrid(x, y) Z = np.array([[f(xi, yi) for xi in x] fo...
true
c65fc51d04feed5dd3fc33e0d29e37704a902947
Python
ahakingdom/codesters-graphics
/codesters/examples/wip/frogger.py
UTF-8
4,664
3.109375
3
[ "MIT" ]
permissive
## FROGGER BY SHIRLEY ## LOCATED HERE: https://www.codesters.com/preview/86a38f1a916adbfd928e4b4d54c758e2782f115a/ import codesters stage = codesters.Environment() start_ground = codesters.Rectangle(0, -240, 500, 25, "darkgreen") mid_ground = codesters.Rectangle(0, 0, 500, 25, "darkgreen") end_ground = codesters.Re...
true
eb9562021fc4b0f8ac9730bd056e5fde5dccbfd2
Python
sasakishun/atcoder
/ABC/ABC114/D.py
UTF-8
2,349
3.609375
4
[]
no_license
n = int(input()) # 入力 : 自然数 ex) 12 # 出力 : 約数リスト ex) [(2,2),(3,1)] def factorize(n): fct = [] # prime factor b, e = 2, 0 # base, exponent while b * b <= n: while n % b == 0: n = n // b e = e + 1 if e > 0: fct.append((b, e)) b, e = b + 1, 0 ...
true
42a9f4723def5027b4cdc8893aba7c2244842fed
Python
darshandoshi95/PYQT_apps
/UDEMY course codes/Code/Section1/Video4_Layout_of_widgets_1_POSITIONAL.py
UTF-8
16,054
2.5625
3
[]
no_license
''' Created on Aug 25, 2017 @author: Burkhard A. Meier ''' # Using the final GUI created in Video 1.3 # import sys # from PyQt5.QtWidgets import QApplication, QMainWindow, QAction # from PyQt5.QtGui import QIcon # # class GUI(QMainWindow): # def __init__(self): # super(...
true
62bfe22a743b31f9d68266d4e8b23780bf269595
Python
nikkss94/Social-_Pandas_Network
/testpanda.py
UTF-8
1,171
3
3
[]
no_license
from panda import Panda import unittest class TestPanda(unittest.TestCase): def setUp(self): self.vladko = Panda('Vladko', 'vladko@pandamail.com', 'male') def test_is_male(self): self.assertEqual(self.vladko.isMale(), True) def test_is_female(self): self.assertEqual(self.vladko.is...
true
07d7b9afd80da3257fb6959b7935087ea88c6b46
Python
nielsonnp/segundoperiodo
/exercicio2/questao3.py
UTF-8
551
4.15625
4
[]
no_license
notas = [] aprovado = 0 reprovado = 0 print('Digite notas de 0 - 100:') for i in range(0,10): nome = input("Qual o seu Nome? ") n1 = float(input("Digite a primeira nota: ")) n2 = float(input("Digite a segunda nota: ")) n3 = float(input("Digite a terceira nota: ")) media = (n1+n2+n3)/3 notas.a...
true
cb2f295b427d064a63e9f59e465605de0f565e4a
Python
omerk2511/dropbox
/client/controllers/directory.py
UTF-8
1,506
2.671875
3
[ "MIT" ]
permissive
from common import Codes, Message from ..handlers.connection import Connection class DirectoryController(object): @staticmethod def create_directory(name, parent, token, group=None): """ Creates a directory args: name, parent, token, group ret: response """ requ...
true
5a0a5a7f19a659699cce15d83d232a581ec741a8
Python
joobn72/hacker-scripts
/src/hs-work.py
UTF-8
1,258
3.0625
3
[]
no_license
# Author: Areeb Beigh # Created: 10th April 2016 ''' Description: Opens all the project files in config.ini [hs-work] with Microsoft Visual Studio Code (code must be in PATH) ''' import os, configparser, sys # Gets the root directory (Drive letter in case of windows) rootDirectory = os.path.splitdrive(sys.executabl...
true
5d5bac79ca8e1cd34cc520ff6717c58db7ad1d04
Python
6GeniusTurtle9/TIL
/공부/2월 공부/백준_색종이.py
UTF-8
325
3.09375
3
[]
no_license
T = int(input()) arr = [[0]*101 for _ in range(101)] cnt = 0 for tc in range(T): left, bot = map(int, input().split()) for i in range(left, left+10): for j in range(bot, bot+10): arr[i][j] = 1 for i in range(101): for j in range(101): if arr[i][j] == 1: cnt +=1 print...
true
7c9f88df5c21ee3cac58445ae75d1ae9f9eca5d3
Python
DgFutureLab/satoyama-api
/app/tests/test_api_response.py
UTF-8
2,533
2.875
3
[ "MIT" ]
permissive
from app.resources import ApiResponse from satoyama.models import * import unittest from datetime import datetime import json from seeds.nodes import NodeSeeder class Badboy(object): def __init__(self, msg = "I'm a bad object."): self.message = msg def json(self): """ This badboy deliberately returns somethi...
true
595b928039a0296a185988908d454f119fe5063e
Python
RoboticImaging/LearnLFOdo_IROS2021
/multiwarp_dataloader.py
UTF-8
38,870
2.5625
3
[]
no_license
import torch.utils.data as data import numpy as np import random import torch import os from epimodule import load_multiplane_focalstack from epimodule import load_tiled_epi_vertical, load_tiled_epi_horizontal, load_tiled_epi_full from epimodule import load_stacked_epi, load_stacked_epi_no_repeats from epimodule impor...
true
7825d80b911b8ae23aedaf5ed369e7b0322ae7a2
Python
s-light/pocketbeagle_python_tests
/cp_blinka/APDS9960.py
UTF-8
1,241
2.84375
3
[ "MIT" ]
permissive
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ simple test for adafruit-circuitpython-apds9960. based on https://learn.adafruit.com/adafruit-apds9960-breakout/circuitpython """ import time import board import busio import adafruit_apds9960.apds9960 print("apds9960 i2c tests") print("setup i2c") i2c ...
true
c5bef9b92241c51f512bcbedafa4289f3f1619e9
Python
Yuandi888/algorithm014-algorithm014
/Week_03/105_Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal.py
UTF-8
1,163
4.125
4
[]
no_license
# 105. Construct Binary Tree from Preorder and Inorder Traversal # 105. 从前序与中序遍历序列构造二叉树 ''' https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/solution/xiong-mao-shua-ti-python3-xian-xu-zhao-gen-hua-fen/ 通过先序遍历我们可以找到root,知道inorder中,当前root的左侧的所有点就是其左子树,root的右侧的所有点就是当前root的右子树,再递归对...
true
e7e4038017b6f6fdea335244095100e390d4b1c7
Python
cwcurtis/SDSU-REU-PROJECT
/my_fft.py
UTF-8
802
2.796875
3
[]
no_license
import pyfftw class my_fft(): def __init__(self,KT): physv = pyfftw.empty_aligned(KT, dtype = 'complex128') freqv = pyfftw.empty_aligned(KT, dtype = 'complex128') fft_f = pyfftw.FFTW(physv, freqv) fft_in = pyfftw.FFTW(freqv, physv, direction='FFTW_BACKWARD') self.physv = ...
true
38d99d8312ae1c836de455fd60c0a2cde7c68f68
Python
mathiver/scikit-learn
/examples/document_clustering.py
UTF-8
3,152
3.109375
3
[ "BSD-3-Clause" ]
permissive
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
true
b8d834bf3f364c08f535721a9c65e02c9db45981
Python
zedko/NT
/bank_app/tests/test_account.py
UTF-8
1,816
3.0625
3
[]
no_license
import unittest from moneyed import Money from bank_app import Account from bank_app import BalanceException from bank_app import Operation from bank_app import settings class TestAccount(unittest.TestCase): def setUp(self) -> None: self.acc = Account('Joe') self.operations = [ Opera...
true
349d9e89c2ac9017fca6e7f1cfd648ce1ed888a0
Python
pico4girls/pico_native
/msg_app.py
UTF-8
1,966
2.53125
3
[]
no_license
from appJar import gui import requests #from utils import test_action, rfid_thread # create the GUI & set a title app = gui("pico_native") def songChanged(rb): print(app.getRadioButton(rb)) import serial ''' ser = serial.Serial('/dev/cu.usbserial-A6026SIM', 9600) BAUD_RATE = 9600 RFID_BYTES = 12 START_CHAR = '\...
true
2368182d6ade98e0539cdcc877f1d5c33b750748
Python
Kuluso97/Emory_cs534_hw2
/q5_script.py
UTF-8
821
3.03125
3
[]
no_license
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.ensemble import GradientBoostingClassifier ## Load Data df = pd.read_csv('hw2_data_2.txt', sep='\t') X_train, y_train = np.array(df.iloc[:700, :-1]), np.array(df.iloc[:700, -1]) X_test, y_test = np.array(df.iloc[700:, :-1]), np.array(...
true
2732a3b2d11ce122819a003f1ab83035ec7aa178
Python
mHacks2021/pythonbook
/实例学习Numpy与Matplotlib/Nump 矩阵聚合.py
UTF-8
629
3.265625
3
[ "LicenseRef-scancode-mulanpsl-1.0-en", "MulanPSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import numpy as np a1 = np.array([i for i in range(1,5)]) a2 = a1.reshape((2,2)) print(f"a1 = {a1} " f"a2 = {a2} " ) print(f"np.sum(a2) = {np.sum(a2)}\n" f"np.sum(a2,axis = 0) = {np.sum(a2,axis = 0)}\n" f"np.std(a2) = {np.std(a2)}\n" f"np.mean(a2) = {np.mean(a2)}\n" f"np.var(a2) = {np.var(a2)}\n" f"n...
true
3d80dae16736cf371b6b54b6ae2ec2877006a0e0
Python
curiosity29/MyGts
/Python/Python/PTVP/R-K.py
UTF-8
4,683
3.171875
3
[]
no_license
from sympy import * from math import * import sys class rungekutta_oop: #{ def __init__(self, expr, x_0, y_0, h, n, s): #{ x = symbols("x") y = symbols("y") func = sympify(expr) self.y_0 = y_0 # Giá trị ban đầu của x self.x_0 = x_...
true
df0345dd804000b3a625ee977d4739d3b3d4c56a
Python
matthewjblatz/Portfolio
/Assignments/Security - A2 - Math + Python Scripts/AccurateButSlow.py
UTF-8
378
3.0625
3
[]
no_license
import math import time found=0; num=15000088; count=899999; start_time=time.time(); while (found==0): for i in range(2,num): if count%i==0: break; else: if(count==990000): print "The 990000th Prime:",num; found=1; count=count+1; num=num+2; ...
true
bea315e4a6f16f4ef242e9fce1a37c9e48fcad9a
Python
DuongHoangThuy/Python_iris
/irisnew.py
UTF-8
6,713
2.671875
3
[]
no_license
import cv2,os import cv2.cv as cv import numpy as np path = "image" path0 = path+"/iris" path1 = path0+"/test" path2 = path0+"/test_iris_pupil" path3 = path0+"/iris_pupil" path4 = path0+"/normalization_Xp" path41 = path0+"/normalization_p" path5 = path0+"/LBP_Xp" path51 = path0+"/LBP_p" path6 = path0+"/iris_pupil_c" f...
true
a592fa7dcdd25665b5c549027bfacd4db2b0c4ba
Python
YoussefBoubekri/Python_Selenium
/PageObjects/GooglePage.py
UTF-8
726
2.765625
3
[]
no_license
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from BasePageObject.Base_Page_Object import Page class GooglePage(Page): #Elements url = "" # base url + /page.php... for any additional url request.... search_button = (By.CSS_SELECTO...
true
799cc94211b6ee0f09b8390a1b6679f5164b3a6a
Python
desktopgame/python-study
/httpTest2/app/main.py
UTF-8
419
2.84375
3
[]
no_license
import requests import time import json # Unityで起動したサーバから座標データをJsonとして送ってもらう url = 'http://localhost:8080/' msg = '' while True: response = requests.get(url) msg = response.text.strip() try: data = json.loads(msg) print('x=%f y=%f z=%f' % (data["x"], data["y"], data["z"])) time.slee...
true
07172d0285978bfd2d2efa6155153044c22cedee
Python
wabradshaw/aOrAn
/aOrAnScript.py
UTF-8
1,732
3.40625
3
[ "Apache-2.0" ]
permissive
# This is a quick and dirty script that uses a corpus to decide whether or # not a pattern is most often used with 'a' or 'an'. The result is a file # containg the list of patterns that use 'an'. # # The script requires two source files, one containing 'an' data and one # containing 'a' data. Testing was done usin...
true
feeb0a1e75343b2207d9aaabb3d8eb95f9a0927f
Python
xyuae/yelp-data-challenge
/loadTable/jsonToCsv_business_hours.py
UTF-8
487
2.84375
3
[]
no_license
import csv import json with open('user_business_hours.csv', 'wb+') as fout: csv_file = csv.writer(fout) csv_file.writerow(['business_id', 'hours']) count = 0 with open('yelp_academic_dataset_business.json') as fin: for line in fin: line_contents = json.loads(line) business_id = line_contents['business_id']...
true
30f92f9b250f2864a6f48f725c0595f91173b2fe
Python
scurry222/holbertonschool-higher_level_programming
/0x07-python-test_driven_development/2-matrix_divided.py
UTF-8
1,157
3.3125
3
[]
no_license
#!/usr/bin/python3 """ This function containts matrix_divided """ def matrix_divided(matrix, div): """ Args: matrix: to divide div: divisor """ new_matrix = [] j = 0 if type(matrix) is not list or len(matrix) < 2: raise TypeError("matrix must be a matrix (list of lists)"...
true