blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
b0c67545534ada2a8b61a4d8ea293f071d0be045 | Python | jkmrto/EulerProject | /script2.py | UTF-8 | 275 | 3.625 | 4 | [] | no_license | def fib(fib1, fib2, acc, limit):
next_fib = fib1 + fib2
if next_fib >= limit:
return acc
else:
new_acc = acc + next_fib if is_even(next_fib) else acc
return fib(fib2, next_fib, new_acc, limit)
def is_even(num):
return num % 2 == 0
| true |
ccf04002a49e76f0b5b69fab577e18339c6cd280 | Python | kunal9168397624/shopifydemo | /app.py | UTF-8 | 974 | 2.59375 | 3 | [] | no_license | from types import MethodType
from flask import Flask,render_template,request
from flask_mail import Mail,Message
app = Flask(__name__)
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = "Enter your gmail id "
app.config['MAIL_PASSWORD'] = " Password of your gmail ... | true |
32f3fd0bf64361b95c4510b2a453fbf3d22d3331 | Python | Jon-Ting/UH-DA-with-PY-summer-2019 | /part04-e05_swedish_and_foreigners/ans.py | UTF-8 | 689 | 3.359375 | 3 | [] | no_license | #!/usr/bin/env python3
import pandas as pd
def swedish_and_foreigners():
df = pd.read_csv("src/municipal.tsv", index_col=0, sep="\t")
df = df["Akaa":"Äänekoski"]
m = ((df["Share of Swedish-speakers of the population, %"] > 5.0) &
(df["Share of foreign citizens of the population, %"] > 5.0))
... | true |
a4b8468934d1823d38835ea4e6dfaea65b4bd85d | Python | Divya5504/abstract-classes-of-python | /abstractClassConstructor.py | UTF-8 | 720 | 4.15625 | 4 | [] | no_license | from abc import ABC,abstractmethod
class Main(ABC):
def __init__(self,val1,val2): #local var val1 ,val2
self.val1 = val1 # making class variable
self.val2 = val2 # making class variable
def display(self):
pass
class Add(Main):
def display(self):
print("First number : ", ... | true |
948a60d7ba23124d6c39b370c2a2277c257ed291 | Python | Fergomez7700/Ciencia-de-datos | /regresión_sklearn_alimentosv1.py | UTF-8 | 5,319 | 3.046875 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split #to split data
from sklearn.linear_model import LinearRegression #to create the model
from sklearn.metrics import mean_squared_error, r2_score #to obtain some numbers
#this is the ramdom see... | true |
ae7e19ae7d8223de298e82e33fdfb9ffe61ef6aa | Python | Rupam-Shil/Python-Beginners-to-Pro | /Projectflow/blocks.py | UTF-8 | 286 | 4.03125 | 4 | [] | no_license | name= input("Please Enter Your Name: ")
age = int(input("How old are you,{0}?".format(name)))
print(age)
if age<=18 :
print("Please come back after {0} years".format(18 - age))
elif age==100:
print("Maybe you should have died")
else:
print("Your are eligible")
| true |
a83a707e18063b4c986457b741df866f8bdaac19 | Python | FunFighter/Mars | /mars_dict_scrape.py | UTF-8 | 3,464 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
from lxml import html
from bs4 import BeautifulSoup
from splinter import Browser
import requests as req
import shutil
# In[2]:
def init_browser():
executable_path = {'executable_path': '/usr/local/bin/chromedriver'}
return Browser('chrome',... | true |
2b67abb73be8a582558d198cc9cd315fa7117cf6 | Python | marnyg/Math3-Rocket-Project | /oppg3.py | UTF-8 | 3,363 | 2.609375 | 3 | [] | no_license | import numpy as np
import RungeKuttaFehlberg as RKF
import numpy as np
import math as m
import sys
import matplotlib.pyplot as plt
from matplotlib import animation, rc
import time
from numpy import sqrt
#Jorda
diameter_ekvator = 12756.28 #km
poldiameter = 12713.56 #km
masse_Jorda = 5.9736*10**24 #kg
rotasjonsperio... | true |
e77a3b1d7732a3ae7fdb2a14f20e227805b9a451 | Python | pitasato/crypto_python | /c.py | UTF-8 | 710 | 2.765625 | 3 | [] | no_license | import zlib
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
def string_encoded(plaintext):
public_key = """-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC9RfZE+sbdF3dqV2+wbrX9zYWF69kZZpxparcgfl4l0m0zT/V/
iRZg/DgpkjR50liDdorTZDfiUSVx4qFtQ7Gbzati7D0CkWW0VJMbyeK3Y+V6vTs3
N4oEBEqsWKtrVn0NMfVScfjnara... | true |
46d830a766b0dcfe61fc93e2a86108e777b72217 | Python | gsaurabh98/python_coding_ques | /odd_even.py | UTF-8 | 347 | 4.09375 | 4 | [] | no_license | # number = raw_input('Enter a number of your choice: ')
#
# if int(number) % 2 == 0:
# print number, 'is even number'
# else:
# print number, 'is odd number'
#print even number between given range
lower = int(input('Enter the lower number:'))
upper = int(input('Enter the upper number:'))
for i in range(lower... | true |
fd8c75c4f478f39c280b613f13d48083e6eb8d1c | Python | cifpfbmoll/ollivanders-in-a-docker-pau13-loop | /resources/resources_mongo/stock.py | UTF-8 | 823 | 2.6875 | 3 | [
"MIT"
] | permissive | from flask_restful import Resource
from service.service_mongo.service import Service
from flask import make_response, jsonify
class Stock(Resource):
# http://localhost:5000/stock
# curl http://localhost:5000/stock
def get(self):
"""Get all the items from the data base
Returns:
... | true |
5ac0efcc9dcc3ede80066b6d78bfc629ee0749f0 | Python | xiaodeng-1/tfGMN | /models.py | UTF-8 | 7,905 | 2.703125 | 3 | [] | no_license | import sonnet as snt
import tensorflow as tf
from layers import *
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
class GraphEmbeddingNet(snt.AbstractModule):
"""A graph to embedding mapping network."""
def __init__(
self,
encoder,
aggregator,
node_state_dim,
edge_h... | true |
90e2ea84a0b1d10771fc6ddd8dd94de2f4833812 | Python | juliocmalvares/URIOnlineJudge | /1018.py | UTF-8 | 610 | 4.03125 | 4 | [] | no_license |
valor = int(input())
valor_inicial = valor
nota100 = int(valor/100)
valor = valor - nota100*100
nota50 = int(valor/50)
valor -= nota50*50
nota20 = int(valor/20)
valor -= nota20*20
nota10 = int(valor/10)
valor -= nota10*10
nota5 = int(valor/5)
valor -= nota5*5
nota2 = int(valor/2)
valor-= nota2*2
nota1 = valor
print(v... | true |
05aafc25c6c87e3d8f74658704da185804ef04a8 | Python | kelvinblaser/EulerProject | /Euler256.py | UTF-8 | 2,976 | 3.796875 | 4 | [] | no_license | # Euler 256 - Tatami-free Rooms
# Kelvin Blaser 2019.02.06
#
# See "Counting Fixed-Height Tatami Tilings" - F Ruskey & J Woodcock
# www.kurims.kyoto-u.ac.jp/EMIS/journals/EJC/Volume_16/PDF/v16i1r126.pdf
#
# Consider rooms of with m and length n with m <= n. It is proved in the above
# paper that if m >= 3 i... | true |
ca39ed89ee9167006fa1bbffd59fcbaf16b1344b | Python | Milan-Adhikari/Ursina-3D-games | /Trapped - 3D Maze/make_button_maze.py | UTF-8 | 697 | 3.328125 | 3 | [] | no_license | import turtle
from turtle import *
def make_button(font_size,text,x,y,length,width):
button = Turtle()
button.speed(0)
button.shape('square')
button.width(10)
button.penup()
button.color('#990066')
button.pencolor('#2ee3da') # color of text
button.goto(x,y)
button.shapesize(stretch_... | true |
a9e1d756ea25e41290835bc117e11f3834d23978 | Python | c4p-n1ck/pythonScripts | /loXract.py | UTF-8 | 3,266 | 2.859375 | 3 | [] | no_license | #!/usr/bin/env python3
"""
\ /
| _ X __ _ _ _|_
| (_)/ \ | (_|(_ |_
Usage:
loXract.py
loXract.py <pcapFile>...
loXract.py -h | -H | --help
loXract.py -V | --version
Options:
-h -H --help Displays this help.
-V --version Ouputs the version of the script.
<pcapFile> Filena... | true |
293b80c0c2156c142a12d65a7b3edb58f8e699d2 | Python | skyclub3/scct | /simulation_scripts/scct/NumOfSigInWindowAll.py | UTF-8 | 3,606 | 3.40625 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | #!/usr/bin/env python
'''
Counting the number of significant sites in each window.
@author: wavefancy@gmail.com
@version: 1.0
@since: 2013-3-19
'''
import sys
class Parameters:
transform = True # whether transfrom to absolute value.
bigger = True # bigger than the threshold. (>= or <=)
threshold = 2.0 # >... | true |
3cb3c54e08500a22c97e55087de125cea3088bbd | Python | JaiRaga/Python-DS-Algorithms | /APA's/TwoNums.py | UTF-8 | 356 | 3.125 | 3 | [] | no_license | def twonums(lis, target):
v = 0
arr = []
for i in lis:
v = target - i
if lis.count(v) > 0:
arr.append(lis.index(i))
arr.append(lis.index(v))
return arr
if __name__ == "__main__":
arr = list(map(int, input().strip().split(' ')))
t = int(input().... | true |
c43847e45bc6e8d1ee309034ffe7da342779cab1 | Python | cklll/competitive-programming | /uva/11498_division_of_nlogonia/main.py | UTF-8 | 611 | 3.171875 | 3 | [] | no_license | def solve(dx, dy, x, y):
if x == dx or y == dy:
return 'divisa'
if x > dx and y > dy:
return 'NE'
if x > dx:
return 'SE'
if x < dx and y > dy:
return 'NO'
if x < dx:
return 'SO'
def run():
while True:
n = int(input())
if n == 0:
... | true |
fe67313558e7553cc4e9dbb105992df0ddb3137e | Python | Laziz412/flask_app | /first_flask.py | UTF-8 | 414 | 2.640625 | 3 | [] | no_license | #!flask/bin/python
from flask import Flask, request
app = Flask(__name__)
@app.route("/ziyotek", methods=['GET'])
def index():
return "Hello World"
@app.route("/starwars", methods=['POST'])
def postmethod():
data = request.get_json()
print("This is JSON")
print(data)
return "THIS IS DATA!!!" + da... | true |
53effb78d1b63488182dd2bbb410e67c4d4e6fc1 | Python | gitjayzhen/AppiumTestProject | /framework/utils/formatutils/DateTimeUtil.py | UTF-8 | 5,434 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
"""
@version: python2.7
@author: ‘jayzhen‘
@contact: jayzhen_testing@163.com
@site: https://github.com/gitjayzhen
@software: PyCharm Community Edition
@time: 2017/3/29 13:12
"""
import time
import datetime
import calendar
class DateTimeManager(object):
'''
* 获取... | true |
cd6a174321f792c8e493d021df8fa6bfe488fb65 | Python | Maxrovr/concepts | /python/array_and_strings/1.1_Is_Unique.py | UTF-8 | 1,892 | 4.25 | 4 | [] | no_license | # Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?
# Approach 1: Use a map/dict to store the counts of each character. Use this approach if the chars in the str are wildly varying, .i.e string contains all chars in the unicode spectrum
# Appr... | true |
5a80cae96e35aefc63fcb3cc740ce05d8ed04440 | Python | zyli93/UMLS-explorer | /explore/MRHIER/hierarchy_check.py | UTF-8 | 2,032 | 3.078125 | 3 | [] | no_license | """
hierarchy_check.py
1. checks if each context of each source vocabulary is a tree structure
2. dumps MRHIER metadata in this format: SAB, # of AUIs, # of contexts, # of trees
Author: Louis Qin <louisqin@ucla.edu> or <qyl0509@icloud.com>
"""
import argparse
import pandas as pd
import networkx as... | true |
fc05db3f71731790faa59c4af49adb2b96990acf | Python | kkapuria3/genome-apps-for-genome-ai | /hair-color/tools/run_genome_app.py | UTF-8 | 486 | 2.71875 | 3 | [] | no_license | """
Genome App entry point.
File for running Genome App from 1) Genome AI & 2) command line.
"""
def run_genome_app():
"""
Required function for Guardiome to run this Genome App.
:return: None
"""
# Import any function from any file
from detect_hair_color import detect_hair_color
# Run a... | true |
e59774ae2811572d35e9df057ad58387460a3224 | Python | AiZhanghan/compound-fault-diagnosis-based-on-machine-learning | /code/DataLoader.py | UTF-8 | 5,446 | 2.765625 | 3 | [] | no_license | import os
import time
import numpy as np
import pandas as pd
class DataLoader:
'''数据加载器
get_time_data: 获取时域数据
get_frequency_data: 获取频域数据
load_data: csv to npz, 加载原始时域数据
'''
def __init__(self, N=5120,
path="D:/Workspace/Data/20191113_compound_fault"):
"""
Args:
... | true |
def6364ae4850246feff67a7606190394fb8aabc | Python | GuodongQi/LeetCode | /codes_1-50/23_Merge_k_Sorted_Lists.py | UTF-8 | 1,240 | 3.484375 | 3 | [] | no_license | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def mergeKLists(self, lists):
"""
:type lists: List[ListNode]
:rtype: ListNode
"""
lens = len(lists)
if not lens:
... | true |
57eb34cdf56a57f9c1ce9490ef7d1df3942167bc | Python | Aasthaengg/IBMdataset | /Python_codes/p03673/s693701777.py | UTF-8 | 277 | 3.46875 | 3 | [] | no_license | n = int(input())
a = input().split()
a_odd = []
a_even = []
for i in range(n):
if (i+1)%2 == 0:
a_even.append(a[i])
else:
a_odd.append(a[i])
if n%2 == 0:
print(" ".join(a_even[::-1] + a_odd))
else:
print(" ".join(a_odd[::-1] + a_even)) | true |
c9621dd597b1bc85c7d03baadb0f019635f992cd | Python | AREKKUSU-hyper/Python-Libraries | /numpy/nptest4.py | UTF-8 | 793 | 3.703125 | 4 | [] | no_license | import numpy as np
A=np.arange(2,14).reshape((3,4))
print(np.argmin(A)) # 索引最小值
print(np.argmax(A))
print(np.mean(A)) # 求平均值
print(A.mean()) # 亦可
print(np.average(A))
print(np.median(A)) # 求中位數
print("-------")
print(A)
print(np.cumsum(A)) # 逐步累加
print(np.diff(A)) # 每兩數之間的差
print(np.nonzero(A))
print("-------")
B=n... | true |
3327d9c7254bc85ccebaf1c84de4cc685a02e7ff | Python | rjquillen/senior-seminar-project | /bobby_final_programs/Home Computer/process_image_function2.py | UTF-8 | 4,233 | 2.78125 | 3 | [] | no_license | import cv2
import urllib
import numpy as np
def average_white(yval, xval, width):
global im_bw
mysum = 0
length = int(width * .05)
for z in range(length):
if (xval + z) < width:
mysum = mysum + im_bw[yval, xval + z]
else:
length = z
break
myav =... | true |
8164b1c5a8fc05140ee5f1d9cbaeaf47606652f3 | Python | Alvin-gys/bilibili_notes | /尚学堂_百战程序员/04_逻辑回归详解和应用/代码/insurance.py | UTF-8 | 1,216 | 3.15625 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# 文件名: insurance.py
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
__author__ = 'yasaka'
data = pd.read_csv('./insurance.csv')
print(type(data))
print(data.head())
pri... | true |
6745d14fd0a06e8123c9ffa46061e8bd77f018a6 | Python | Aasthaengg/IBMdataset | /Python_codes/p02695/s720796720.py | UTF-8 | 1,119 | 2.5625 | 3 | [] | no_license | from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator impor... | true |
1af9a899d00ac5fcb5d27ed31d72065864efb4f7 | Python | Omkar-M/Hangman | /Hangman/Hangman/task/hangman/hangman.py | UTF-8 | 1,651 | 4.09375 | 4 | [] | no_license | import random
def answer(letters, used_letters, hidden):
if letters == used_letters:
print(*hidden, sep='')
print('''You guessed the word!
You survived!''')
exit()
def play():
words = ['python', 'java', 'kotlin', 'javascript']
tries = 8
choice = random.choice(words)
#... | true |
16282c651151608448ab4cea89754ab79a31f66f | Python | ei-grad/rnk-neuro-hackathon | /utils.py | UTF-8 | 2,432 | 2.609375 | 3 | [] | no_license | from glob import glob
import os
import pickle
import re
from sklearn.model_selection import KFold, cross_val_score
from sklearn.metrics import f1_score
from sklearn.metrics.scorer import make_scorer
import numpy as np
CLASSES = ['FNSZ', 'GNSZ', 'SPSZ', 'CPSZ', 'ABSZ', 'TNSZ', 'TCSZ']
def evaluate(model, X, y, fil... | true |
95ff5361f5470cee8122c1ba4042edb01e53955b | Python | chotu07/test1 | /test2.py | UTF-8 | 146 | 3.59375 | 4 | [] | no_license | a=1
even=[]
odd=[]
while a<=10:
if a%2==0:
even.append(a)
else:
odd.append(a)
a=a+1
print(even)
print(odd)
| true |
971474b9ac1d690dadbdfaa2a708cc3b9b955f88 | Python | gc-ss/hy-lisp-python | /examples_translated_to_python/datastores/sqlite_example.py | UTF-8 | 739 | 2.78125 | 3 | [] | no_license | from sqlite_lib import create_db, connection, query
def test_sqlite_lib():
dbpath = ':memory:'
create_db(dbpath)
conn = connection(':memory:')
query(conn, 'CREATE TABLE people (name TEXT, email TEXT);')
print(query(conn,
"INSERT INTO people VALUES ('Mark', 'mark@markwatson.com')"))
pri... | true |
c45ad3a0034baedec1d27eedec7cd109ef26cec4 | Python | jacekslaby/raas-client-python | /tests/test_client.py | UTF-8 | 2,428 | 2.609375 | 3 | [] | no_license |
# Note: In order to avoid ERROR "ImportError: No module named 'raas'" please read:
# https://stackoverflow.com/questions/10253826/path-issue-with-pytest-importerror-no-module-named-yadayadayada#34140498
# i.e.: "The least invasive solution is adding an empty file named conftest.py [...]"
#
from raas import api
... | true |
a474b8cbeca174918fec10e1596f150631e01d6b | Python | lingng/Leetcode | /python/028_implement_strstr.py | UTF-8 | 919 | 3.953125 | 4 | [] | no_license | # https://leetcode.com/problems/implement-strstr/
# Implement strStr().
# Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
# Update (2014-11-02):
# The signature of the function had been updated to return the index instead of the pointer. If you still see your f... | true |
386e586359180228b75fa4f9d7f490bf344701d3 | Python | WJtomcat/MySloth | /sloth/gui/controlbuttons.py | UTF-8 | 712 | 2.625 | 3 | [] | no_license | from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class ControlButtonWidget(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
layout = QHBoxLayout()
layout.setSpacing(0)
layout.setAlignment(Qt.AlignTop)
self.back_butto... | true |
6975fd3b096d8116c0d354e10ff82eebd1422206 | Python | alanjia163/BH | /92. 反转链表 II.py | UTF-8 | 850 | 3.703125 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Jia ShiLin
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def reverseBetween(self, head, m, n):
"""
首先把所有链表压入一个列表里,然后反转相应的位置。创建新的链表。
:type head: ListNode
:rty... | true |
26ef33aa19bbf7e7bb25a25c7b0a4f435c4d3ad6 | Python | kevnh/AI_Number-Recognition-Neural-Network | /main.py | UTF-8 | 1,908 | 2.859375 | 3 | [] | no_license |
import mnist_loader
import neural_net
import argparse
import numpy as np
from imageio import imread
layer_nodes = [784, 30, 10] # Number of nodes per layer
# Main function
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--user', action='store_true', default=False,
... | true |
5b1919fb4988548038061c080abb4e38e63ca66d | Python | GeriantHartman/S01 | /suanfan.py | UTF-8 | 1,230 | 3.71875 | 4 | [] | no_license | def max_prime(a):#做出质数表的函数
global prime_list#全局变量
for i in range(2,a):
flag=False
for j in prime_list:
if i % j == 0:
flag=True
break;
if flag==True:
continue
else:
prime_list.append(i)
return
def sum_factor... | true |
743aaff5866ed7bdb68badf324623efbf3395541 | Python | LogicJake/code-for-interview | /written-exam/7.5-360-回文串.py | UTF-8 | 444 | 2.9375 | 3 | [] | no_license | s = input()
n = 4
m = len(s)
cost = [0] * 5
cost[1] = min(100, 120)
cost[2] = min(200, 350)
cost[3] = min(360, 200)
cost[4] = min(220, 320)
dp = [[0] * m for _ in range(m)]
for i in range(1, m):
for j in range(i - 1, -1, -1):
dp[j][i] = min(dp[j + 1][i] + cost[int(s[j])],
dp[j][i -... | true |
bdaf266ddb87035172c6d30eb693a8b08b084b68 | Python | JuanPardos/lol | /models/rework.py | UTF-8 | 1,722 | 2.578125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from datetime import timedelta
from odoo import models, fields, api, exceptions
import time
class rework(models.Model):
_name = 'lol.rework'
name = fields.Text()
idcampeon = fields.Many2one('lol.campeones', String='Campeón')
fecha = fields.Date(String='Fecha Rework')
descr... | true |
4f2366209e0040815698ec2ac6b05c21ff657053 | Python | czamoral2021/CEBD-1100-CODE-WINTER-2021 | /CZ_Exercises_class04/draw_triangle2.py | UTF-8 | 441 | 3.46875 | 3 | [] | no_license | # Isosceles triangle. Iso symmetrical triangle 3 lines only
# Triangle base size 5 starting with 1.
# initialize variables
v_triangle = 9
v_count = 1
v_string = ""
# v_triangle even => please enter an ODD base triangle and greater than 1
for y in range(1, int(v_triangle) + 1):
if v_count % 2 != 0:
v_str... | true |
5f04f4dd5dd7deca20c60347a7879ae83a3607f1 | Python | RajeshDM/mcs_eval3 | /MCS_exploration/cover_floor.py | UTF-8 | 29,117 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | import constants
import networkx as nx
import math
import time
from shapely.geometry import Point, Polygon
from navigation.fov import FieldOfView
import numpy as np
import matplotlib.pyplot as plt
import quaternion
testing = 0
#max_abs = 5/constants.AGENT_STEP_SIZE
if testing != 1 :
#AGENT_STEP_SIZE = 0
m... | true |
e274b20338629d3d040ac869c19ede0fd9ae80b0 | Python | lodow/trade | /trade.py | UTF-8 | 2,361 | 3.265625 | 3 | [] | no_license | #!/usr/bin/python2.7 -u
import pprint
import sys
capital = 0
nbDays = 0
capitalization = []
stock = 0
slice = []
state = {"min" : False, "max" : False}
def buy(n, day):
global capitalization, capital, stock
if capital - (0.15 / 100 * capital) >= n * capitalization[day] and n > 0:
print("buy " + str(... | true |
0dc2e0789b28bbf5854fbfad9743a9288fe7efdc | Python | BayMinimum/YeT | /yet/loader.py | UTF-8 | 872 | 2.640625 | 3 | [
"MIT"
] | permissive | import yaml
from yet.structures import *
# Handle YAML loading
class YeTLoader(yaml.SafeLoader):
"""
Customized YAML loader to accommodate YeT style.
Use 'list of singleton dict-like container'
instead of returning single dict for everything.
Advantages: handle duplicate keys, preserve order.
... | true |
fd3eaeaa89e4d4671fed2ef9f49d54ecddfe86bd | Python | HarikaThupkar/Pythonlearning_Projects_Datasets | /Container/TinyMath/Basic_Math2.py | UTF-8 | 84 | 3.109375 | 3 | [
"MIT"
] | permissive | def add(a,b):
return a+b
if __name__ == "__main__":
c=add(5,4)
print(c) | true |
79edc6ed80ad0a920b1af3135b3c411906a414ab | Python | UBC-MDS/simpl_eeg_capstone | /simpl_eeg/eeg_objects.py | UTF-8 | 30,445 | 2.625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Module for creating custom epoch objects
"""
import mne
import scipy.io
import warnings
from os import listdir, walk
from os.path import isfile, join
import numpy as np
import re
import numbers
def load_montage(raw, montage='auto'):
"""
Helper function for __init__ in EEG_File cl... | true |
e87632fa87dcc518410acca01d4e354154794f14 | Python | lucaslopilato/Client-Server | /server_python_tcp.py | UTF-8 | 2,220 | 3.640625 | 4 | [] | no_license | # Lucas Lopilato
# CS176A HW2 Programming Assignment
# Socket connection taken from Computer Networking (Kurose, Ross)
# code includes opening a connection, encoding a message,
# and listening on a port.
from socket import *
import sys
# function to send a message back from a given socket
# destination address and me... | true |
4cd6ac54231087660ddec6c4a6063c837bdf9a4e | Python | sashilda/lesson2 | /task2.py | UTF-8 | 547 | 3.9375 | 4 | [] | no_license | def str_compare(str1, str2):
both_are_strings = (type(str1) == str and type(str2) == str)
if not both_are_strings:
result = 0
elif str1 == str2:
result = 1
elif len(str1) > len(str2):
result = 2
elif str2 == 'learn':
result = 3
return result
# should print 0... | true |
b5e12644cfe9394014d830e5fa2117b87b8b58da | Python | pbielak/aoc2020 | /day08/main.py | UTF-8 | 3,123 | 3.71875 | 4 | [] | no_license | """Day 8 - Advent of Code"""
from dataclasses import dataclass
from copy import deepcopy
from typing import List
@dataclass
class Instruction:
opcode: str
argument: int
def parse_file(path: str) -> List[Instruction]:
instructions = []
with open(path, 'r') as fin:
for line in fin.readlines()... | true |
99ddd673d02eb902d808f5623a58f658ad80788f | Python | mkyle1121/electropi | /buttonled.py | UTF-8 | 726 | 2.96875 | 3 | [] | no_license | import RPi.GPIO as GPIO
ledPin = 11
buttonPin = 12
def setup():
GPIO.setmode(GPIO.BOARD)
GPIO.setup(ledPin, GPIO.OUT)
GPIO.setup(buttonPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) #button normal is UP or 3.3v
def loop():
while True:
if GPIO.input(buttonPin) == GPIO.LOW: # button pressed, less volt... | true |
cb127d0fbb1638b4082e346bed077a4e18258140 | Python | mystuart/CatStone-MyCRT | /mycrt-backend/src/metrics/metrics.py | UTF-8 | 4,058 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | import boto3
import os.path
from operator import itemgetter
from flask import g
from datetime import date, datetime, timedelta
from botocore.exceptions import ClientError
def save_metrics(alias, start_time, end_time, bucket_name, db_identifier, metric_type, region_name, user):
s3 = boto3.client('s3', aws_access_ke... | true |
c6bc1f5bf367e64672947990e62b16628ce150eb | Python | shriharshs/AlgoDaily | /leetcode/1026-maximum-difference-between-node-and-ancestor/main.py | UTF-8 | 1,397 | 3.8125 | 4 | [] | no_license | # Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
"""
1st approach: recursion
- in each recursive function
1. return the min and max node.val from the subtree
2. compare the current no... | true |
c8a17a2196a7426ef71f5a854ce644d779749c4f | Python | rahularoradfs/euler | /solved/067.py | UTF-8 | 1,704 | 4 | 4 | [] | no_license | # for this, you should work row-by-row
# there will be several possible ways to get to a number
# of these, only one way will have the maximum total
# store only that maximum total associated with it
# take the example four-row triangle provided
"""
3
7 4
2 4 6
8 5 9 3
"""
# go row by row:
# row 1: only one way ... | true |
382a9cb5ea202804c2e5c97a43e3d0aa575d9a93 | Python | checkouttech/pythonProjectExample | /tests/project_helloworld/test_fixtures.py | UTF-8 | 872 | 3.25 | 3 | [] | no_license | import pytest
@pytest.fixture
def input_value_from_local_fixture():
input = 39
return input
def test_divisible_by_3(input_value_from_local_fixture):
assert input_value_from_local_fixture % 3 == 0
def test_divisible_by_6(input_value_from_local_fixture):
assert input_value_from_local_fixture % 6 == 0
def ... | true |
d4af3953b5137bdd0e5990588aceb7fcaa05f70a | Python | 824zzy/Leetcode | /S_Math/Probability/L2_470_Implement_Rand10()_Using_Rand7().py | UTF-8 | 395 | 2.6875 | 3 | [] | no_license | """ https://leetcode.com/problems/implement-rand10-using-rand7/
rejection sampling
learn from lee: https://leetcode.com/problems/implement-rand10-using-rand7/discuss/151567/C%2B%2BJavaPython-1.183-Call-of-rand7-Per-rand10
"""
class Solution:
def rand10(self):
rand40 = 40
while rand40 >= 40:
... | true |
43336d63596ff94a77b2020c6619a8d2e3545bd5 | Python | kuqadk3/CTF-and-Learning | /atcoder/abc_137/C/green_bin_sort_map.py | UTF-8 | 471 | 3.125 | 3 | [] | no_license | import math
def calc_comb(n):
k = 2
if n <= 1 :
return 0
elif n ==2 :
return 1
return math.factorial(n)/(math.factorial(n-k) * math.factorial(k))
n = int(raw_input(""))
smap = {}
tmp = ""
for i in range(0, n):
tmp = ''.join(sorted(raw_input("")))
if smap.get(tmp, None) == None... | true |
233ef4d3c3db37f0169990507587f2a496df667a | Python | JJHzs/tedu | /2019/PycharmProjects/untitled/game.py | UTF-8 | 398 | 3.546875 | 4 | [] | no_license | #!/usr/bin/env python3
import random
player = int(input("请输入 0剪刀 1石头 2布"))
computer = random.randint(0,2)
if (player==0 and computer==2) or (player==1 and computer==0) or (player==2 and computer==1):
print("赢了,,,可以去买奶粉了...")
elif player==computer:
print("平局了,,,洗洗手决战到天亮...")
else:
print("输了,,,回家拿钱再... | true |
933bc38a4ebf2f39a16a6b875a42e4f599235ae0 | Python | JuanchoVoltio/python-2021-II | /Taller_Final_2/TallerFinal/nomina.py | UTF-8 | 2,654 | 3.359375 | 3 | [] | no_license | # Importo la librería random para utilizarlo en el cálculo del tiempo hecho por el piloto
import random
# Variable global
undefined = "Unknown"
# Calcular la nómina
def calcular_nomina(self):
# Director equipo: 10% bono por pole position
# Lista ordenada
pole_position = ejecutar.calcular_... | true |
4147cdbf99f5a72bcb5e4cd9c347a824a9087079 | Python | ai-distill/TensorFlowNotes | /TensorFlowbiji/3TensorFlow框架/前向传播/两层简单神经网络-一组数据.py | UTF-8 | 502 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | # 定义只有一组数据的两层简单神经网络
import tensorflow as tf
# 定义输入和参数
x = tf.constant([[0.7, 0.5]]) # 分别对应物体的重量和体积
w1 = tf.random_normal(shape=(2,3), stddev=1, seed=1)
w2 = tf.random_normal(shape=(3,1), stddev=1, seed=1)
# 定义前向传播过程
a = tf.matmul(x, w1)
y = tf.matmul(a, w2)
# 用会话计算结果
with tf.Session() as sess:
init_op = tf.glob... | true |
13b3800f6f6aac8adecf378fce6cabc8586b8597 | Python | VPanjeta/Data-Analytics-Lab | /Outcomes.py | UTF-8 | 4,403 | 2.90625 | 3 | [] | no_license | import os
def getPOs():
return [
"Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems.",
"Problem analysis: Identify, formulate, review research literature, and analyze... | true |
693640071e1218ae7fa8682dacb17745bbaf89dc | Python | panditdandgule/Pythonpractice | /OOPS/P08_MultipleInheritence.py | UTF-8 | 601 | 4.25 | 4 | [] | no_license | #Author: PANDIT DANDGULE
#This program shows the order in which the classes are accessed in case of multiple inheritance
#Python uses DEPTH FIRST SEARCH algorithm for lookups
class A(object):
def doThis(self):
print('Doing this in A')
class B(A):
pass
#If class C was also eing derived from A then the... | true |
c0bc59f144405c18ad938bd5e04d23368be401a0 | Python | tomshen/ClassyStache | /settingsloader.py | UTF-8 | 632 | 2.609375 | 3 | [] | no_license | # constants gathered in one place
import pygame, os
# window
scaling = 1.5
windowWidth = int(scaling * 650)
windowHeight = int(scaling * 400)
fps = 30
# stache
stacheMaxAcceleration = 2
stacheDeceleration = -0.2
stacheMaxSpeed = 20
stacheDirectionChange = 10 # in degrees
stacheStartingLives = 3
stacheF... | true |
ef02114a1ecac5c967421b6f217a7b03d7edd338 | Python | bksaini078/DynamicProgramming | /HackerRank/problem solving intermediate/BItwiseAND.py | UTF-8 | 980 | 3.671875 | 4 | [] | no_license | # bitwise and operation
'''Given an array [10,7,4,3,2,1] find the number of pairs whos AND result is power of 2 '''
import math
import time
from itertools import combinations,combinations_with_replacement
if __name__=='__main__':
arr=[3 for i in range(10000)]
#0.36679816246032715
count=0
time1=time.tim... | true |
7eafd3b1bb791558960b6aff1264938b4e5943c7 | Python | c6401/snippets | /snippets/python/templates/recurse_tree.py | UTF-8 | 552 | 3.5 | 4 | [
"MIT"
] | permissive | def recurse_tree(tree):
if isinstance(tree, dict):
result = {}
for key, value in tree.items():
result[key] = recurse_tree(value)
return result
elif isinstance(tree, list):
result = []
for item in tree:
result.append(recurse_tree(item))
ret... | true |
65178e4d56184859ca32f92b2d666cca1ec777a1 | Python | JasonMohabir/super-primes | /prime_factor.py | UTF-8 | 728 | 3.71875 | 4 | [] | no_license | # Jason Mohabir
# Run-time efficieny: O(n^2)
# Trial Division
def prime_factor_div_0(n):
retList = []
factor = 2
while n > 1:
if n % factor == 0:
retList.append(factor)
n /= factor
else:
factor += 1
return retList
# More efficient trial division
de... | true |
88ebcf6c54a791020d5525734ef57226bc5831d8 | Python | krdipen/COL774-Assignment1 | /2018CS50098/q1/q1c.py | UTF-8 | 2,065 | 2.59375 | 3 | [] | no_license | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from time import sleep
import sys
data=np.loadtxt(sys.argv[1]+'/linearX.csv',delimiter=",")
data=np.outer(data,np.ones(1))
data=data-np.outer(np.ones(data.shape[0]),np.mean(data,axis=0))
data=da... | true |
73d4196b228985a941d541d9fb5317577d8d40dc | Python | lucasmsa/python-learning | /modules/osTest.py | UTF-8 | 741 | 2.9375 | 3 | [] | no_license | import os
from datetime import datetime
# Get current working directory
print(os.getcwd())
# Change directory
os.chdir('e:\Lavid')
print(os.getcwd())
# List files and folders on the desktop
print(os.listdir())
# Create new directory
#os.makedirs('OS-demo')
# Remove directory
#os.removedirs('OS-demo')
# Renamin... | true |
692e9ea7584eca5de934c0b9d189983f277509e1 | Python | IamWilliamWang/Leetcode-practice | /2020.5/ValidPalindrome.py | UTF-8 | 1,183 | 3.3125 | 3 | [] | no_license | class Solution:
def validPalindrome(self, s: str) -> bool:
i, j = 0, len(s) - 1
editTimes = 0
while i < j:
if s[i] != s[j]:
if s[i] == s[j - 1]:
editTimes += 1
j -= 1
elif s[i + 1] == s[j]:
... | true |
e2db97c269b9784cf41ca778056d7544027260dc | Python | jiangchuan617/PythonLearning | /python基础/对象/11多继承.py | UTF-8 | 229 | 3.078125 | 3 | [] | no_license | class A:
def test(self):
print('test方法')
class B:
def demo(self):
print('demo方法')
class C(A,B):
'''多继承,子类拥有多个父类的属性和方法'''
pass
c = C()
c.test()
c.demo()
| true |
17ef9c19ba2fdaaeae0e8b180b2334e79cc0a1f3 | Python | victoRLin6/Modelo | /problema 06P2.py | UTF-8 | 87 | 3.265625 | 3 | [] | no_license | n=int(input())
i=2
while True:
if n/i==n//i :
print(i)
break
i+=1
| true |
c66e7f57109d19c77ac2e128c45ef411c7027d7e | Python | INI-MED/crypto-bot | /tests/unit/fapper.spec.py | UTF-8 | 891 | 3.046875 | 3 | [] | no_license | import unittest
from utils.fapper import Map
data = {
"kurwa": [0, 1, 2, 3, 4, 5],
"oh_kurwa": {
"kek": "suka",
"c_kaifom": {
"ahahahah": True,
"meh": {
"loop": {},
"poop": {
"heh": [3, 5]
}
... | true |
3f9b974d8bc97aed68375591f71e57b600ffaa51 | Python | kinjaljain/16720-ComputerVision | /hw1/code/visual_recog.py | UTF-8 | 3,590 | 2.78125 | 3 | [] | no_license | import os, math, multiprocessing
from os.path import join
from copy import copy
import numpy as np
from PIL import Image
import visual_words
def get_feature_from_wordmap(opts, wordmap):
'''
Compute histogram of visual words.
[input]
* opts : options
* wordmap : numpy.ndar... | true |
7bddf32348451a7a3a1f205b3f4734270916fba0 | Python | postmates/triton-python | /triton/nonblocking_stream.py | UTF-8 | 4,459 | 2.53125 | 3 | [
"ISC"
] | permissive | # -*- coding: utf-8 -*-
"""
triton.nonblocking_stream
~~~~~~~~
This module provides for a way to write to a Triton Stream without
blocking to wait for a successful write to the stream.
It does this by sending the messageover ZeroMQ to tritond.
Adapted from https://github.com/rhettg/BlueOx/blob/master/blueox/network.p... | true |
6ad12eabff0405f4b264a549fbeee49f77aff852 | Python | falyse/advent-of-code | /2019/08/main.py | UTF-8 | 1,827 | 3.796875 | 4 | [] | no_license | def process_data(input, width, height):
layers = []
while len(input) > 0:
layer = []
for h in range(height):
row = input[0:width]
input = input[width:]
layer.append(row)
layers.append(layer)
return layers
def count_digits(layers):
min = None
... | true |
b46199db606c7c8fc1c3cb51443c53dc791f5143 | Python | joohongkim1/TIL | /startCamp/02_day/flie_handling/handle.py | UTF-8 | 962 | 3.28125 | 3 | [] | no_license | import os # 윈도우 컴퓨터가 할 수 있는 작업들을 가지고 오는 모듈
os.chdir(r"C:\Users\student\TIL\startCamp\02_day") # chdir(path) -> 체인지 디렉토리
# 500개의 지원서가 있는 곳으로 이동
filenames = os.listdir('.') # listdir() -> 특정 경로에 있는 모든 파일 이름 가져오는 함수 , . -> 현재 디렉토리 ... | true |
6f08e0daac0d98f10bcb8ef0b51168d7a5419774 | Python | gbourdin/charlas | /ml-notebook-to-prod/examples/housingExample/xgbpricepredictor/xgbpricepredictor/management/train.py | UTF-8 | 1,285 | 3.0625 | 3 | [
"MIT"
] | permissive | import click
import pandas as pd
from sklearn.metrics import (
explained_variance_score, r2_score, mean_absolute_error)
from sklearn.model_selection import train_test_split
from xgbpricepredictor.models import HousePricePredictor
@click.command(name='train')
@click.argument('dataset-path',
type=click.Path(e... | true |
c59b7f326e137fb7ab6fea43a9420573fd0688b0 | Python | yves-monier/hans | /abbrev2js.py | UTF-8 | 1,160 | 2.796875 | 3 | [
"MIT"
] | permissive | import urllib3
from bs4 import BeautifulSoup
import codecs
filename = "abbreviations.html"
html = ""
try:
f=open(filename, mode="r", encoding="ISO-8859-1")
html=f.read()
f.close()
except IOError:
print(filename + " not found or path is incorrect")
http = urllib3.PoolManager()
r = http.request(... | true |
01bb71a63b2c7b5cffa7e47d052e1dd11d8a202d | Python | wuchangbai2015/python-opencv | /opencvlearningdemo/demo2.2.py | UTF-8 | 404 | 2.6875 | 3 | [] | no_license | import numpy as np
import cv2
cap=cv2.VideoCapture('demo2.2.avi')
while(True):
#capture frame-by-frame
ret , frame = cap.read()
#our operation on the frame come here
gray = cv2.cvtColor(frame , cv2.COLOR_BGR2GRAY)
#display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) &0xFF ==ord('q'):
break... | true |
14d2f04a504a1a4bbcf80029f60bfb1106fa7803 | Python | Chocobo1/hinet-radio-url | /station_id.py | UTF-8 | 1,016 | 2.859375 | 3 | [] | no_license | #!/bin/python2
"""
Chocobo1 (Mike Tzou), 2015
"""
import urllib , json , itertools
def hinet_radio_station_id():
"""
return a dictionary{ (int) station_id : (utf8 string) "station_name" }
"""
base_url = "https://hichannel.hinet.net/radio/channelList.do?pN="
id = []
name = []
current_page = 1
total_pages = 2... | true |
ab33b35c9e1c4207bf2a9a6b7080f42e92ef72fb | Python | uchicago-cmsc12100-aut-21/pa1 | /sir.py | UTF-8 | 9,766 | 3.515625 | 4 | [] | no_license | '''
Epidemic modelling
YOUR NAME
Functions for running a simple epidemiological simulation
'''
import random
import sys
import click
# This seed should be used for debugging purposes only! Do not refer
# to this variable in your code.
TEST_SEED = 20170217
def has_an_infected_neighbor(city, location):
'''
... | true |
609ff04ce86d602a19aee7229202078a66cfdd38 | Python | tyler1zhang/Advanture_of_Code | /Tyler/2015_q14.py | UTF-8 | 2,220 | 3.671875 | 4 | [] | no_license | #import
racing_time = 2503
def individual_distance(name, lst, race_time):
# Calculate one Reindeer flying distance after race_time.
speed = lst[0]
duration = lst[1]
rest_time = lst[2]
cycles = race_time // (duration + rest_time)
remainder = race_time % (duration + rest_time)
if remainder... | true |
f0793ef0b1d97bbef1b46da2f38c6caf7a397d22 | Python | Nicolas1936/bstorm_ai | /08_web_scraping/api/wiki_tennis.py | UTF-8 | 254 | 2.546875 | 3 | [] | no_license | import requests as rq
from pprint import pprint
import time
time.sleep(0.5)
r = rq.get('https://en.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&search=roger%20federer')
print(r.status_code)
dict_ = r.json()
pprint(dict_[3][0]) | true |
759a903d7afce319b0111440dc64283b9e2306c8 | Python | kiwiPhrases/multiple-regressions | /multipleRegressions.py | UTF-8 | 2,701 | 3.078125 | 3 | [] | no_license | import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
def runRegression(y,x,data, cov_type='HC0'):
print("Covariance type: %s" %cov_type )
form = '{0} ~ {1}'.format(y,x)
mod = smf.ols(formula=form, data=data)
res = mod.fit(cov_type=cov_type)
return(res)
def runQuan... | true |
b3db9668acd269e9ed081dafb51c4c9c65b990cf | Python | MaxRais/pokemonai | /battle.py | UTF-8 | 20,159 | 2.9375 | 3 | [] | no_license | import player
import status
import debug
import moves
import fakerandom
import pokemon
import typechart
import sys
import log
import copy
import json
import team
dbflag = False
class Battle:
def __init__(self, team1, team2, player1, player2, turnlimit = 1000):
self.team1 = team1
self.team2 = team2
self.player1... | true |
0387196289ff5b1a82b502f01b1c37b48c66faa0 | Python | joljak/Site_Crawling | /Fm_Ilbe_Dogdrip/downloader/s3_downloader.py | UTF-8 | 950 | 2.640625 | 3 | [] | no_license | import os
import boto3
BUCKET_NAME = 'dankook-hunminjeongeum-data-bucket'
s3 = boto3.resource('s3')
def simple_s3_downloader():
# S3에서 contents 안에 있는 CSV만 전체 일괄 다운로드
bucket = s3.Bucket(BUCKET_NAME)
for s3_object in bucket.objects.all():
# Need to split s3_object.key into path and file name, els... | true |
1765b5d7711665b5b4b323ba85277844a1f3c65f | Python | twosixlabs/armory | /armory/utils/json_utils.py | UTF-8 | 2,080 | 3.25 | 3 | [
"MIT"
] | permissive | import json
import numpy as np
class NumpyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.ndarray) or isinstance(obj, np.generic):
return obj.tolist()
return json.JSONEncoder.default(self, obj)
def dumps(obj, *, sort_keys=True, indent=4, cls=NumpyEncoder, **... | true |
f8a5e0e2b5c7c4ef3ecf3bada7991f428df71821 | Python | jihazard/python | /workspace/day02/주말과제/과제1_두개리스트체크_윤지환.py | UTF-8 | 1,069 | 4.5625 | 5 | [] | no_license | '''
과제1]
-첫번째 list 와 두번째 list 의 length 는 동일
-두번째 list 의 각 element 는 첫번째 list element 의 제곱이어야 한다.
-서로 match 되는 element 가 위 조건과 같은지 비교하여
참이면 "Two lists are matched",
거짓이면 "Two lists are unmatched" 출력
예)
frequency_check([1,2,3,2,5,6], [1,4,9,4,25,36]) --> lists are matched
'''
def frequency_check(list_a,list_b):... | true |
f57ec047545da56e73463ee508df65dee50386f2 | Python | johnaparker/Qbox | /tests/drude/create.py | UTF-8 | 548 | 2.65625 | 3 | [
"MIT"
] | permissive | import numpy as np
import matplotlib.pyplot as plt
filename = "eps.txt"
freq = np.linspace(1/30, 3/30, 200)
omega = 2*np.pi*freq
wav = 1/freq
eps_inf = 2
omega_0 = 5/30*2*np.pi
gamma = 0.1*2*np.pi
omega_0 = 5/30.0
gamma = .1
eps = eps_inf - omega_0**2/(omega**2 - 1j*omega*gamma)
# eps = eps_inf - omega_0**2/(omega**... | true |
c9c6addd6a3c323e9fbc26fb355c5be556fff491 | Python | EliEhrman/movielens | /testtf.py | UTF-8 | 1,148 | 2.515625 | 3 | [] | no_license | import numpy as np
import tensorflow as tf
num_dims = 2
num_samples = 10
wtarget = np.random.random((num_dims, num_dims)).astype(np.float32)
winit = np.random.random((num_dims, num_dims)).astype(np.float32)
x = np.random.random((num_samples, num_dims)).astype(np.float32)
wx = np.dot(x, wtarget).astype(np.float32)
#pri... | true |
51d4ea87c5377fd3269c61e054cccdfaef2c3cfa | Python | leejseo/PS | /Google Code Jam/Kickstart/2018/H/C_large.py | UTF-8 | 803 | 2.8125 | 3 | [] | no_license | import sys
raw_input = sys.stdin.readline
mod = 1000000007
F = [1]*200005
rev = [1]*200005
facrev = [1]*200005
pow2 = [1]*200005
for i in xrange(1, 200005):
F[i] = (F[i-1]*i)%mod
rev[i] = pow(i, mod-2, mod)
facrev[i] = (facrev[i-1] * rev[i])%mod
pow2[i] = (pow2[i-1]*2)%mod
T = int(raw_input())
... | true |
9cc9f495ba010ff5f12dc0bebdad5bf85ac71a51 | Python | 23380809/stock-price-prediction | /main.py | UTF-8 | 3,655 | 2.625 | 3 | [] | no_license | from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM
from pytrends import dailydata
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader as web
import datetime as dt
import os
o... | true |
52a23395073f2ff31ede811c22cd7f4367b129cb | Python | IBST-yoonSangHyeon/01_python_basic_YouTub | /0001_Part/01_variables.py | UTF-8 | 55 | 3.21875 | 3 | [] | no_license | x = 1
y = 2
print(x)
print(y)
x = "안녕"
print(x) | true |
34b1b0da9aec8ecdbf51abb4e78981eede4a46a6 | Python | GeniusAlg0s/mycode | /pyapi/mygame02.py | UTF-8 | 5,341 | 3.671875 | 4 | [] | no_license | #!/usr/bin/python3
# Replace RPG starter project with this code when new instructions are live
#riddle
def riddle():
print("answer correctly only one try and recieve a game changing prize")
print("what is always coming but never arrives")
answer = input("? :")
if answer.lower() == "tomorrow":
... | true |
d363a8cfcf02293827c8efeb50c34ae1ba111235 | Python | or0986113303/LeetCodeLearn | /python/141 - Linked List Cycle/main.py | UTF-8 | 616 | 3.46875 | 3 | [] | no_license | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def iscyclelinkedlist(self, slower, faster):
while slower is not None and faster is not None and faster.next is not None:
faster ... | true |
e7afaa30e8529703fc628b61f4eed0fcb8133399 | Python | aleecy/zipfile_password_finder | /zip_pass_finder.py | UTF-8 | 3,214 | 3.28125 | 3 | [] | no_license | import zipfile ,itertools ,os ,time
def main():
all_char = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_@.'
num = '1234567890'
alph = 'abcdefghijklmnopqrstuvwxyz'
cap_alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
password_type = input (
"Choose your password t... | true |
480fd65df487e6ea9ad33439cf10ee2929398a5c | Python | gevmart/Quasicryatal | /plotting.py | UTF-8 | 1,158 | 2.84375 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
def annotate(fig, ax, title, xlabel, ylabel, fontsize=16):
ax.set_title(title, fontsize=fontsize)
ax.set_xlabel(xlabel, fontsize=fontsize)
ax.set_ylabel(ylabel, fontsize=fontsize)
ax.tick_params(la... | true |
1f1860c926adbe5b3d7dae4e9c2b581167da9381 | Python | gnulug/pulse3d | /processor/pulse3d_processor.py | UTF-8 | 7,059 | 2.796875 | 3 | [
"MIT"
] | permissive | """
A program that renders mono input as 3D, stereo output
:-a --azimuth evaluator 40*seconds
Horizontal angle in degrees (0 = center). Can be expression like "90 * seconds"
:-e --elevation evaluator 0
Vertical angle in degrees (0 = center). Can be expression like "30 * sin(0.1 * seconds))"')
:-d --distance ... | true |