blob_id 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 |
|---|---|---|---|---|---|---|---|---|---|---|
1287f4755d6f4ce5e47de93093295928c6f03bf6 | mukundajmera/competitiveprogramming | /Recursion/Print Array Elements Using Recursion.py | UTF-8 | 510 | 3.609375 | 4 | [] | no_license | # User function Template for python3
def printArrayRecursively(arr, n):
# code here
if n <= 0:
return 0
printArrayRecursively(arr, n - 1)
print(arr[(n - 1)], end=" ")
# {
# Driver Code Starts
# Initial Template for Python 3
# contributed by RavinderSinghPB
if __name__ == '__main__':
tcs... | true |
f1cc64fe7b8658024a56e408c69779d00b0ed8a6 | bunchoftrees/cwlwerx | /sgdp/preprocess/src/gvcf_regions.py | UTF-8 | 10,425 | 2.796875 | 3 | [] | no_license | #!/usr/bin/env python
import gzip
def is_header(line):
"""Check if a line is header."""
return line.startswith('#')
def has_END(line):
"""Check if a line has the 'END=' tag."""
return 'END=' in line
# FIELD index
# CHROM 0, POS 1, REF 3, QUAL 5, INFO 7, FORMAT 8, sample 9
def get_END(line):
"... | true |
6f2d92f8fe0226c9826c362f4b3a05259557e073 | rockdam/deep-learning- | /classification.py | UTF-8 | 1,757 | 2.859375 | 3 | [] | no_license | #coding:utf-8
"""
tensorflow 1.1
python 3
matplotlib 2.02
"""
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(100) #้ๆบ็งๅญ
tf.set_random_seed(100) #่ฎพ็ฝฎ้ๆบ็งๅญ
a = np.ones((500,2))
noise = np.random.normal(4,1,(500,2))
x0 = np.random.normal(2*a,1)+noise #ๆญฃๆๅๅธ,ๆ ็ ๅทฎไธบ1
... | true |
635bbeb0eb4d47230df5a3a7af83bee26d369d00 | poetzu/Study.I_ver.2 | /2แแ
กแแ
ตแแ
ฅแซแแ
กแ
แ
ญแแ
งแผ/3แ
แ
ตแแ
ณแแ
ณ_แแ
กแ
แ
ญแแ
งแผ_แแ
ตแฏแแ
ณแธ.py | UTF-8 | 6,681 | 4.53125 | 5 | [] | no_license |
#๋ฆฌ์คํธ ์๋ฃํ ์ด๋?
#๋ฆฌ์คํธ๋ ๊ฐ๋จํ ์์๋๋ก ๋์ด์ ๋ฐ์ค๋ก ์ดํดํ ์ ์์ต๋๋ค.
#๊ฐ ๋ฐ์ค์๋ ๋ค์ํ ํ์
์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ์ ์์ผ๋ฉฐ
#์ด ๋ฐ์ค๋ค์ ํต๋ค์ด์ ๋ฆฌ์คํธ๋ผ๊ณ ๋ถ๋ฅด๊ฒ ๋ฉ๋๋ค.
#ํ์ด์ฌ์์ ๋ฆฌ์คํธ์ ํน์ง
#1. ๋ฆฌ์คํธ์ ์ ์ฅ๋ ์์๊ฐ ๋ชจ๋ ๊ฐ์ ํ์
์ผ ํ์๋ ์์ต๋๋ค.
#2. ๋ฆฌ์คํธ์๋ ์์๋ค์ด ์์๋๋ก ์ ์ฅ๋๋ฉฐ,
# ๊ฐ์์๋ 0๋ถํฐ ์์ํ๋ ์ธ๋ฑ์ค ์์น๋ฅผ ์ฌ์ฉํ์ฌ ์ ๊ทผํ ์ ์์ต๋๋ค.
#3. ๋ฆฌ์คํธ๋ ๊ทธ ๊ฐ์ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.
#์ฐธ๊ณ 1 : ์ด์ ๊ฐ์ ๋ฐ์ดํฐ ํ์
... | true |
50b1266295f519dbbbe2bbb269615a094702aa64 | Daegonny/decaptcha2 | /slide_window_func/sliding_window.py | UTF-8 | 2,245 | 2.53125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from slide_window_func.pyimagesearch.helpers import sliding_window
import argparse
import time
import cv2
import torch
from slide_window.net import Net
from slide_window.slide_window import predict_label
def pos(vet, cp):
j=1
vet.sort(key=lambda y: y[1])
for i in vet... | true |
2e9da4c945030b931d5dae9023e1fc6094f45caf | anestisdalgkitsis/LSTM-RNN-for-Traffic-Prediction-in-Cellular-Networks | /datasetinfo.py | UTF-8 | 1,897 | 2.90625 | 3 | [
"MIT"
] | permissive | #
# datasetinfo.py
# Dataset Information | Version 1.8.2
#
# Created by Anestis Dalgkitsis in 19/01/2018.
# Copyright 2017 Anestis Dalgkitsis. All rights reserved.
#
# Contact: anestisdalgkitsis@gmail.com
#
# Depentencies
import math
import numpy
from scipy.signal import find_peaks_cwt
import datetime as datetime
# ... | true |
d2fce282972cb4719f4afefe06779d85b201dfda | sunyzm/ZGeometry | /ZGeometry/python/sp2ln.py | UTF-8 | 291 | 2.890625 | 3 | [] | no_license | import sys
def main():
if len(sys.argv) != 2:
return
else:
filename = sys.argv[1]
file = open(filename, 'r')
strold = file.read()
file.close()
open(filename,'w').write(strold.replace(' ','\n'))
if __name__ == '__main__':
main()
| true |
2c93c9e00748333c18d35f93b039738976e12790 | godatadriven/bandit-friday | /banditfriday/strategies/baseline_strategy.py | UTF-8 | 995 | 2.90625 | 3 | [] | no_license | import operator
from typing import Dict
from pandas import DataFrame
from banditfriday.strategies.base_strategy import BaseStrategy
from banditfriday.products import Product
class BaselineStrategy(BaseStrategy):
def __init__(self, products: Dict[str, Product], **kwargs):
self.products_popularity = {key:... | true |
838c7b63bfa1da9251bf6b4d6d576383a959757c | poetchess/pythonrunner | /object_oriented_idioms/tombola.py | UTF-8 | 1,364 | 3.578125 | 4 | [] | no_license | import abc
class Tombola(abc.ABC):
@abc.abstractmethod
def load(self, iterable):
"""Add items from an iterable."""
@abc.abstractmethod
def pick(self):
"""Remove item at random, returning it.
This method should raise `LookupError` when the instance is empty.
... | true |
cdd6209ed8784b47b5709e0dc6d6801731fd1dfe | co360/study_python | /property1.py | UTF-8 | 526 | 2.828125 | 3 | [] | no_license | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright ยฉ 2020 ubuntu <ubuntu@VM-0-13-ubuntu>
#
# Distributed under terms of the MIT license.
"""
"""
class Area:
def __init__(self, area):
self.__area = area
@property
def area(self):
return self.__area
@area.set... | true |
0812a99f95f48368eee7d9610c7f3616d1012d1c | MaPing01/Python100 | /23.py | UTF-8 | 209 | 3.25 | 3 | [] | no_license | #!usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Ma Ping
for i in range(1,5):
print(' '*(4-i),end='')
print('*'*(2*i - 1))
for j in range(3,0,-1):
print(' '*(4-j),end='')
print('*'*(2*j-1)) | true |
a5e392a5498d4a42e07121c61b142aa52f42be09 | shamoilarsi/Notes-Management-System-Server | /server_old/application.py | UTF-8 | 7,570 | 2.578125 | 3 | [] | no_license | from flask import Flask, render_template, request, redirect, jsonify
import sqlite3
import datetime
import time
import random
uname = ""
dpass1 = ""
alerttext = ""
color = ""
app = Flask(__name__)
dbusers = sqlite3.connect("users.db")
cu = dbusers.cursor()
dbnotes = sqlite3.connect("notes.db")
cn = d... | true |
328522e3b3ba6952ed1f90a9f3d114ede7cad61b | kiwisherk/pwp | /pyp | UTF-8 | 5,334 | 2.890625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
#!/usr/bin/python3
#
# Make 'ip a' a little briefer
#
# I never liked the command 'ip'. I can never remember the command line arguments and the help message is too obtuse.
# Also, it is too verbose, with on interface printing five lines. This program runs the command 'ip a' and presents some
# o... | true |
0dd77ad2f04b5ab06939ddc80c64e8a5cde69635 | xpwu95/Image_Similarity | /getsimilar/image_similarity_function.py | UTF-8 | 2,929 | 3.09375 | 3 | [] | no_license | # -*- encoding=utf-8 -*-
# ๅฏผๅ
ฅๅ
import cv2
from functools import reduce
from PIL import Image
# ่ฎก็ฎไธคไธชๅพ็็ธไผผๅบฆๅฝๆฐORB็ฎๆณ
def ORB_img_similarity(img1_path,img2_path):
"""
:param img1_path: ๅพ็1่ทฏๅพ
:param img2_path: ๅพ็2่ทฏๅพ
:return: ๅพ็็ธไผผๅบฆ
"""
try:
# ่ฏปๅๅพ็
img1 = cv2.imread(im... | true |
15e6ac9e87e65cbbe8dd25fa4835297046661561 | sigmahax/mysql_fin | /create_db.py | UTF-8 | 825 | 2.625 | 3 | [] | no_license | from sqlalchemy import create_engine
from sqlalchemy import Table, Column, Integer, String, MetaData
from sqlalchemy_utils import create_database, database_exists
DATABASE = f'mysql+pymysql://base:base@localhost/stocks'
if not database_exists(DATABASE):
print('Creating database')
create_database(DATABASE)
en... | true |
fd62e26520284fc87cf5d60db858414b151172ae | RobbeBryssinck/Smartlock | /server.py | UTF-8 | 7,159 | 2.65625 | 3 | [
"MIT"
] | permissive | '''
Main script: server handling client/lock connection
Usage: Set the IP-address to the server's IP-address.
Launch the lock before logging in with the client.
'''
import socket
import sys
import os
from threading import *
import mysql.connector
from configparser import ConfigParser
config = ConfigParser()
config.re... | true |
28ab63cb3fec89da159a0484bfd2fa9962c125c9 | sparsh0008/PythonPrograms | /venv/breakContinue.py | UTF-8 | 285 | 3.84375 | 4 | [] | no_license | i = -1
a = "Hello world"
while(i < len(a)-1):
i = i + 1
if(a[i] == "o"):
continue
print(a[i])
print("Out of the while loop")
'''
i = 0
a = "Hello world"
while(TRUE):
if(a[i] == "o"):
break
print(a[i])
i = i + 1
print("Out of the while loop")
''' | true |
067cb6fecd223bb9d9e9f89af36b82645e544612 | takimble/Capstone_project | /Services/bill_service.py | UTF-8 | 1,032 | 2.515625 | 3 | [] | no_license | from Models.bill_models import BillSchema , Bills
import datetime
bill_schema = BillSchema()
def new_bill(data,user):
post_bill = Bills(
title=data['title'],
due=data['due'],
paid=data['paid'],
amount=data['amount'],
date_created=datetime.datetime.utcnow(),
user_id=... | true |
ff925f2a69f6bb478078fa871730980cc9125be9 | OscarFlores-IFi/CDINP19 | /code/p13.py | UTF-8 | 1,039 | 2.984375 | 3 | [
"MIT"
] | permissive | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
#%% Importar los datos (leer la imagen)
img = mpimg.imread('../Data/indice.png')
plt.imshow(img)
#%% reordenar la imagen en una sola tabla
d = img.shape
img_col = np.reshape(img,(d[0]*d[1],d[2]))
#%% Convertir los datos a media cero... | true |
07f793fbee2a553089603b86b4dee896b69b332a | Wattyyy/LeetCode | /submissions/swim-in-rising-water/solution.py | UTF-8 | 924 | 3.25 | 3 | [
"MIT"
] | permissive | # https://leetcode.com/problems/swim-in-rising-water
from collections import deque
from typing import List
class Solution:
def swimInWater(self, grid: List[List[int]]) -> int:
N = len(grid)
min_val = max(grid[0][0], grid[-1][-1])
for v in range(min_val, N * N):
visited = {(0, ... | true |
960ab62a8516427523031da8743f5839c1582d45 | Mayokun25/Movie-Trailer-Website- | /media.py | UTF-8 | 623 | 3.203125 | 3 | [
"MIT"
] | permissive | #importing webbrowser module so i can open links to the web for pictures and videos
import webbrowser
#Creating class Movie
class Movie():
#constructor __init__ to pass to define what the instance variables are
def __init__ (self, movie_title, movie_storyline, poster_image, trailer_youtube):
self.ti... | true |
290d83ccd29385bbfb3ad78d7b517cfe763d291e | vishnukhokhar/Marsquake-Rover | /src/modes/nonCheckpointMode.py | UTF-8 | 6,331 | 3.046875 | 3 | [] | no_license | import time
from agent import Agent
from environment.env import Environment
from environment.utils import Location
def nonCheckpointMode(config):
"""
Simulates path-finding in multistart and multidestination mode.
Args:
config: Dictionary with all the configuration settings.
Returns:
... | true |
537f1a68e7760bed1fd225f0ba7cfcdc0a5b669f | sushanted/pydemos | /sr/demos/OO/L_08_GeneratorsDemo.py | UTF-8 | 8,103 | 4.4375 | 4 | [] | no_license | from datetime import datetime
print("\nGenerator:\n")
def single_value_generator():
hour_of_the_day = datetime.now().hour;
if hour_of_the_day < 12:
yield "Good morning!"
elif hour_of_the_day >= 12 and hour_of_the_day < 17:
yield "Good afternoon!"
elif hour_of_the_day >= 17 and hour_of... | true |
2369c8c319ba9c2c7995d9d71e4df57b24f1a659 | lot9s/mit-ocw | /6.00SC/psets/1/ps1b.py | UTF-8 | 1,645 | 4.15625 | 4 | [] | no_license | # ------------------------------------------------------------------------------------------------------------
#
# Write a program that calculates the minimum fixed monthly payment need in order to pay off a credit card
# balance within 12 months. (will not be dealing with a minimum monthly payment rate)
#
# ----------... | true |
a277a2b0dfdd2764a564244e6a0e2431c167acd4 | mwesigwapita/AIMB | /server/modules/air_quality_provider.py | UTF-8 | 3,249 | 3.078125 | 3 | [] | no_license | # Import libraries
import requests
# Import handcrafted modules
from modules.database_worker import DatabaseWorker
from data_containers.sector import Sector
from configuration.iqair_api import IQAirConfiguration
from configuration.database import DatabaseConfiguration
# Class that models the air quality provider
clas... | true |
5389309a40679275354e2623dad905cb8d307635 | Sulochanaakki/ciscoexcercises | /pcap/module3_exercises/lab3.4.1.6.py | UTF-8 | 494 | 4.34375 | 4 | [] | no_license | # This is an existing list of numbers hidden in the hat.
hatList = [1, 2, 3, 4, 5]
# Step 1: write a line of code that prompts the user
# to replace the middle number with an integer number entered by the user.
num = int(input("Enter a number: "))
hatList[len(hatList) // 2] = num
# Step 2: write a line of code here th... | true |
20428a3ac97772baf11e4928e12cc0177aa1b60d | beatgerm/keras | /keras12_append.py | UTF-8 | 3,604 | 2.96875 | 3 | [] | no_license | # 1. ๋ฐ์ดํฐ
import numpy as np
x = np.array([range(100), range(311,411), range(100), range(100,200), range(311,411), range(100,200)])
y = np.array([range(501,601), range(711,811), range(100), range(501,601), range(711,811), range(100)])
# x2 = np.array([range(100,200), range(311,411), range(100,200)])
# y2 = np... | true |
8df3dc69f4c1ba1e2126f6e1b1073d8839fddb4d | lishulincug/Jobs-search | /scrapy-51job/analysis.py | UTF-8 | 2,410 | 2.90625 | 3 | [] | no_license | # -*- conding:utf-8 -*-
import pymongo
import pandas as pd
import jieba
import jieba.analyse
from wordcloud import WordCloud
import matplotlib.pyplot as plt
from scipy.misc import imread
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
# ๅฎไนไธไธช่ฏ่ฏญ้ๅ
set = set()
def get_infos():
'''้พๆฅๆฐๆฎๅบ๏ผๆๅ้่ฆ็ไฟกๆฏ๏ผ่ฟๅไธไธชๅ่กจ'''
... | true |
e1c64cd999b7df6961d2c24c6a921fec216ec969 | k4t0mono/tp-compiladores | /AnalisadorSintatico/ArvoreSintatica.py | UTF-8 | 2,065 | 3.1875 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Noh:
nome = None
filhos = None
pai = None
nivel = None
idArvore = None
def __init__(self, nome):
self.nome = nome
self.filhos = []
self.nivel = -1
class ArvoreSintatica:
raiz = None
nextId = None
def __i... | true |
4f5ad30ff60da6d7074227aabd7a5d08da919ed7 | FelixMo42/LiarsDice | /players/Papa4.py | UTF-8 | 2,859 | 3.671875 | 4 | [] | no_license | from game.player import Player
from util.probability import atleast
import numpy as numpy
class Papa4(Player):
"""
I'm a Liar's Dice player
"""
safeOddsToBet = .8 # Probability above which I will place a bet
oddsToAcceptBet = .3 # Probability above which I will accept others' bets
name = "P... | true |
104ce9978a6c13258649ee59be7a26375ec4de9f | Yukikazari/kyoupuro | /.ๆๅบไธ่ฆง/AtCoder/ABC108/abc108_B.py | UTF-8 | 140 | 3.5 | 4 | [] | no_license | x1, y1, x2, y2 = map(int, input().split())
x = x1 - x2
y = y1 - y2
x3 = x2 + y
y3 = y2 - x
x4 = x1 + y
y4 = y1 - x
print(x3, y3, x4, y4)
| true |
ce68ada5141a485529d33aaad70a4bdce5f6cd3e | Lawriegan/leetcode | /19 Remove Nth Node From End of List.py | UTF-8 | 581 | 3.40625 | 3 | [] | no_license | # Definition for singly-linked list.
import copy
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def removeNthFromEnd(self, head, n):
"""
:type head: ListNode
:type n: int
:rtype: ListNode
"""
pre = ListNode(0.... | true |
e02d931029cb6720faf7662fecd6908f3ff9f970 | done109598087/lab4_test_for_keystone | /keywords/on_sign_in_page.py | UTF-8 | 542 | 2.546875 | 3 | [] | no_license | # on sign_in_page
def input_email(self):
self.driver.find_element_by_name('email').send_keys('demo@keystonejs.com')
# on sign_in_page
def input_password(self):
self.driver.find_element_by_name('password').send_keys('demo')
# on sign_in_page -> admin_ui_page
def submit_email_and_password(self):
self.driv... | true |
f5ea30998ffd2b74d5d7edcd9f49fedef9142ed3 | christianinov/ML-Algorithms | /linear.py | UTF-8 | 1,094 | 2.875 | 3 | [] | no_license | import numpy as np
from matplotlib import pyplot as plt
from scipy import optimize as opt
def LinearRegression(X, Y):
n, m = X.shape
X = np.concatenate((np.ones((n, 1)), X), axis=1)
try:
A = np.linalg.inv(X.T.dot(X)).dot(X.T).dot(Y)
except:
def cost(b):
return n... | true |
36e5f62101ae2fb43e3ed0773b16371e50a815c5 | CARV-ICS-FORTH/frisbee | /examples/apps/h5py/scripts/concatenation/concatenate.py | UTF-8 | 1,549 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | import sys
from os import walk
import h5py
import numpy as np
def concatenate(shared_dir, file_names_to_concatenate):
entry_key = 'data' # where the data is inside the source files.
ref_file = shared_dir + "/" + file_names_to_concatenate[0]
print("Use as reference file ", ref_file)
sh = h5py.File(... | true |
f5f4adb63b9f7ecb564f41d46900dbcacc753b2b | coding-blocks-archives/Perceptron2017Spring | /class_01/pack.py | UTF-8 | 289 | 3.140625 | 3 | [] | no_license | import math
def add(*args):
return sum(args)
class A:
def __init__(self, x=1, y=2):
self.x = x
self.y = y
def fname(a, l=None):
l = list(l)
l.append(a)
return l
if __name__ == '__main__':
v1 = fname(1)
v2 = fname('a', ['b'])
v3 = fname(100)
print v1
print v2
print v3 | true |
999c1f160b1124c518a1ed9a859533dc22abb5eb | noatre/pyneng | /07_files/task_7_1_script.py | UTF-8 | 571 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python3
template = ('''
Protocol: {}
Prefix: {}
AD/Metric: {}
Next-Hop: {}
Last update: {}
Outbound Interface: {}
''')
f = open('ospf.txt', 'r')
for str in f:
str_list_clean = []
str = str.rstrip('\n')
str = str.split()
f... | true |
b334d643566b60e5991a7100bac770948be0070f | collabsoft/nicke_first_dash_app | /dash_cb_router.py | UTF-8 | 3,064 | 2.6875 | 3 | [] | no_license | # this doesn't work because you can't have inputs in the outputs, you'd have to
# put them in state.
# the way you can make this work is by having only one input and having this
# input also be the context that triggered the callbacks, but this isn't written yet
import dash
import pdb
class DashCallbackRouter:
de... | true |
c9539df51a9bc192e8a5029d8d3695df8ecc4a81 | alexeyZay/Python | /generator/generator_expressions.py | UTF-8 | 329 | 3.234375 | 3 | [] | no_license | # simple generator
# def get_number_from_list():
# for number in range(10):
# yield number
#
# list=get_number_from_list()
# print(list.__next__())
# print(next(list))
# print(next(list))
list=(number for number in range(10))
# it is good idea to use generator when working with the big data it takes less ... | true |
fb64876959ca7d1a0e015447723741d7ffd78521 | grazielags/cp12 | /Reginei/Mรณdulo 3/Aula 8 Python/aula 5 matriz exercicios/exercicio3.py | UTF-8 | 796 | 4.3125 | 4 | [] | no_license | '''
3. Faรงa um programa que leia uma matriz 3x3 de inteiros e
multiplique os elementos da diagonal principal (No qual os
รญndices sรฃo iguais, linha e coluna possuem o mesmo valor) da
matriz por um nรบmero k (obter do usuรกrio). Imprima a matriz na
tela antes e depois da multiplicaรงรฃo.
'''
matriz = []
... | true |
996b90f5163c6e841673e4544a3fb2d537681628 | parkermac/ptools | /tests_examples/test_streamplot.py | UTF-8 | 535 | 3.25 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 26 16:56:31 2018
@author: pm7
Code to test the streamplot function.
"""
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-10, 10, num=100)
y = x
X, Y = np.meshgrid(x, y)
u = X**2 + np.sin(Y)
v = -X + Y/2
z = np.sqrt(u**2 + ... | true |
b7b0f290581ab221a1c9002dff6d9ef0451d6451 | Kantarian/GITHUB | /HT_3/HT_3_2.py | UTF-8 | 935 | 4.03125 | 4 | [] | no_license | #2. ะะฐะฟะธัะฐัะธ ััะฝะบััั < bank > , ัะบะฐ ะฟัะฐััั ะทะฐ ะฝะฐัััะฟะฝะพั ะปะพะณัะบะพั: ะบะพัะธัััะฒะฐั ัะพะฑะธัั ะฒะบะปะฐะด ั ัะพะทะผััั < a > ะพะดะธะฝะธัั ัััะพะบะพะผ ะฝะฐ < years > ัะพะบัะฒ ะฟัะด < percents > ะฒัะดัะพัะบัะฒ
# (ะบะพะถะตะฝ ััะบ ััะผะฐ ะฒะบะปะฐะดั ะทะฑัะปัััััััั ะฝะฐ ัะตะน ะฒัะดัะพัะพะบ, ัั ะณัะพัั ะดะพะดะฐััััั ะดะพ ััะผะธ ะฒะบะปะฐะดั ั ะฒ ะฝะฐัััะฟะฝะพะผั ัะพัั ะฝะฐ ะฝะธั
ัะฐะบะพะถ ะฝะฐัะฐั
ะพะฒัััััั ะฒัะดัะพัะบะธ). ะะฐัะฐ... | true |
0cbe9d15c75ff5f2ce7b92e19edd0f15fcb8f59a | pkulwj1994/SelfNormalizingFlows | /snf/layers/distributions/uniform.py | UTF-8 | 945 | 2.875 | 3 | [
"MIT"
] | permissive | import torch
import torch.nn as nn
import numpy as np
class UniformDistribution(nn.Module):
"""
Standard Normal Likelihood
"""
def __init__(self, size):
super().__init__()
self.size = size
self.dim = int(np.prod(size))
self.register_buffer('empty', torch.zeros(1))
... | true |
6e6378e72d70254e52f287620500599d3da23818 | yindan01/yindan | /test_requests2/api/department.py | UTF-8 | 1,536 | 2.578125 | 3 | [] | no_license | import requests
class Department:
def create_department(self,token,department_id):
create_url = f"https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token={token}"
# post ็่ฏทๆฑไฝ
data = {
"name": "่่ฑ่ฌๅค",
"name_en": "RDGZ",
"parentid": 1,
... | true |
9c92cdbdbb1946c4a6ccd1a786c0e1ed329dc88c | souza10v/Exercicios-em-Python | /activities1/codes/49.py | UTF-8 | 543 | 3.28125 | 3 | [] | no_license | // -------------------------------------------------------------------------
// github.com/souza10v
// souza10vv@gmail.com
// -------------------------------------------------------------------------
from datetime import date
maiori=0
menori=0
ano=date.today().year
for c in range(0,8):
anol=int(input((... | true |
4f6f929a91d4606fc2b9cbae1ad3f6c7fd3c04b9 | ez3r0sec/JamfProThreatHunting | /Persistence/detectOpenBSMPersistence.py | UTF-8 | 2,159 | 2.6875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
# -----------------------------------------------------------------------------
# detectOpenBSMPersistence.py
# detect any changes to the audit_control and audit_warn files in /etc/security
# Last Edited: 7/25/18
# -----------------------------------------------------------------------------
### IMPO... | true |
a3e10fa214fed2018d7b695994f95316d56c3295 | samaypritam/EE610_GUI | /scripts/test.py | UTF-8 | 2,042 | 2.578125 | 3 | [] | no_license | #!/usr/bin/python
def gausskernel(size, sig):
# size should be odd
size = size + (size+1.)%2
xmin = -(size - 1)/2
xmax = (size - 1)/2
x = np.arange(xmin, xmax + 1.)
G = np.zeros((size,size),dtype='float')
sum = 0
for i in np.arange(size):
for j in np.arange(size):
ar... | true |
2bd53ebd11aa11d7666fefffeb410b4c36d64c7a | gbzarelli/hangman-python | /app/hangman_display.py | UTF-8 | 2,465 | 4.09375 | 4 | [] | no_license | from abc import ABC, abstractmethod
class HangmanDisplay(ABC):
@abstractmethod
def status(self, input_words: list, hits: int, life: int):
pass
@abstractmethod
def welcome(self, secret_word_length):
pass
@abstractmethod
def result(self, win: bool, word: str):
pass
c... | true |
53a10023cd2f528947ff8ca350b0a185b40c017b | tawanchaiii/01204111_63 | /ELAB04/04-04.py | UTF-8 | 885 | 2.875 | 3 | [
"WTFPL"
] | permissive | n = int(input("n: "))
for i in range(n) :
for j in range(i) :
print(" ",end='')
for j in range(9 + (n-3)*2 - 2*i) :
print("=",end='')
print("\n",end='')
for j in range(i) :
print(" ",end='')
for j in range(9 + (n-3)*2 - 2*i) :
x = 9 + (n-3)*2 - 2*i
if (j == 0 or j == x-1) :
... | true |
eb068e3887381a0879fc7a0d8e734ad107e568f2 | b1quint/btfi | /Data Acquisition/FP_sami6.2.py | UTF-8 | 24,522 | 2.65625 | 3 | [] | no_license | #!/bin/env python
import time
import datetime
import sys
import os
"""
THIS PROGRAM COMPUTE A SCANNING SEQUENCE FOR PF/SAM/SOAR
Philippe Amram
last update: 2016-04-02 By B. Quint
NOTATIONS:
epais = distance between the two plates
gap = the maximum tuning gap
QGC = Queensgate ... | true |
968b3911b3430ca03e3861743f67a9c5c97794e4 | aristyogresearch/wildfire | /python/fully_stratify_sample.py | UTF-8 | 11,431 | 2.78125 | 3 | [] | no_license | import time
import random
from random import randint
from time import sleep
import pandas as pd
import numpy as np
from mpi4py import MPI
from scipy.stats import ks_2samp
from sklearn.preprocessing import StandardScaler
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
def k_random_sample... | true |
6839defa71b454af29ca8ebd3421c1b55ec7a1a5 | tryea/test | /main.py | UTF-8 | 30,913 | 2.734375 | 3 | [] | no_license | from dateutil import parser
from datetime import datetime
from requests import Session, get
from bs4 import BeautifulSoup as bs
from bs4.element import Tag
import requests
title = 'Kuromon Ichiba โ\xa0Is This Famous Seafood Market In Osaka A Tourist Trap Or Worth The Hype?'
print(title.find('\u2013'))
# def scrap():... | true |
cf2d2c47c40972b4e3b2bf522d9ba964fe6e6630 | cicorias/cvpr_clvision_challenge | /continuum/baseline.py | UTF-8 | 2,832 | 2.5625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | import os
from typing import Iterable, Set, Tuple, Union
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import torchvision.models as models
from continuum import ClassIncremental
from continuum.datasets import Core50
from continuum.tasks impo... | true |
cde6eeae17792d944b7a004c5b097c48c5e20962 | martinkarlik/herbivores-evolution | /genetic_algorithm.py | UTF-8 | 1,060 | 3.109375 | 3 | [] | no_license | import random
from environment_objects import *
def get_most_fit(population):
most_fit = population[0]
for herbivore in population:
if herbivore.score > most_fit.score:
most_fit = herbivore
return most_fit
def fitness_proportionate_selection(population):
total_fitness = sum(he... | true |
c2710076bc281c16020b7131543186a08335948f | tcherne/Education | /division.py | UTF-8 | 1,524 | 2.78125 | 3 | [] | no_license | import datetime
import os
import random
import sys
import writelog
import videoprompt
sys.path.append(os.path.abspath('/home/timcherne/PythonProjects/Education_Program/'))
def division_problem(results_directory, numerator_max_value, denominator_max_value, videos, show_hints):
videoprompt.print_video_message(videos... | true |
64792d892448ff122c629691403f6fe326cce163 | Wentinggg/CIT-582-PROJECT2 | /order_book.py | UTF-8 | 4,933 | 3.109375 | 3 | [] | no_license | import sqlalchemy
from sqlalchemy import create_engine, insert, select, and_
from sqlalchemy.orm import sessionmaker
from datetime import datetime
from models import Base, Order
# interact with the database
engine = create_engine('sqlite:///orders.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)... | true |
ef1b1b2467a94197cbff0e9d7cb2c3f5ee1a149a | ttaerrim/BertSum | /txt_to_csv.py | UTF-8 | 1,017 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | import csv
import glob
import os
# ํํ์ ๋ถ์ํ ๊ฒ csv๋ก ๋ง๋๋ ์ฝ๋
input_path = './news_dir'
#๊ฒ์ํ ๋๋ ํ ๋ฆฌ, ํด๋๋ช
์ง์ (ํ์ฌ์์น)
output_file = 'csv/result_art.csv'
#๊ฒฐ๊ณผ๋ฌผ ํ์ผ๋ช
is_first_file = True
for i in range(0, 5074):
for input_file in glob.glob(os.path.join(input_path, 'output'+str(i))): #๊ฒ์ํ ํ์ผ๋ช
print(os.path.basename... | true |
ee520d3b373023e103626d4857266d8e7a297e71 | viniciuspolux/UFPB | /IP/Lista-5/Comando Condicional - Lista 3/1b.py | UTF-8 | 452 | 4.0625 | 4 | [] | no_license | #O programa deve receber como entrada a altura de uma pessoa e exibir uma
#mensagem informando se ela รฉ de estatura baixa, mediana ou alta.
#O cรณdigo possui um erro no qual o if e o else estรฃo dentro de um else
#quando na verdade era necessaลio apenas colocar um elif.
altura=float(input("Digite sua Altura = "))
if(a... | true |
34828266aa8fb442678ed87e244c4af6b69e3904 | RadoslavGYordanov/hackerschool | /PracticePython/exercise2.py | UTF-8 | 534 | 3.640625 | 4 | [
"MIT"
] | permissive | import sys
if sys.version_info[0] >= 3:
num=int(input("Please enter a number: "))
check=int(input("Please enter another number: "))
else:
num=int(raw_input("Please enter a number: "))
check=int(raw_input("Please enter another number: "))
if num % 4 == 0:
print("\n"+str(num)+"is a multiple of 4")
else:
if num%2 ... | true |
6517e7b586edca190788ebfe3ed5d8dbc23c6658 | ibigio/deep-learning-final | /project/liars_dice_gym.py | UTF-8 | 3,916 | 2.625 | 3 | [] | no_license | import pyspiel
import numpy as np
from open_spiel.python import rl_environment
from itertools import permutations
import operator as op
from functools import reduce
game = 'liars_dice'
num_players = 2
num_dice = 5
num_faces = 6
dice_space = num_dice * num_faces
env = rl_environment.Environment(game)
num_actions = env... | true |
44cb1c69b83048bb7beb92a36736fda73fb8e28c | aldamatrack/testing | /Python/Cows/main.py | UTF-8 | 1,039 | 4.09375 | 4 | [] | no_license | from funtion import *
print("Lets play Cows or bulls :D ")
loop= True
while loop:
diff= input("please choose the dificulty:\n\n hard, medium or easy: ")
Computer = NumberCreation(diff)
loop2=True
counter = 0
while loop2:
counter +=1
if diff == "hard" :
user = input("Try ... | true |
2255038b85a5550574bbe1027588069bd89ba71f | abhigandhi29/Software_Lab | /datascience_assignment/my_package/data/dataset.py | UTF-8 | 5,144 | 3.296875 | 3 | [
"MIT"
] | permissive | #19CS10031
#Abhishek Gandhi
#Data Science Assignment QS2
#Imports
from PIL import Image, ImageFilter
import numpy as np
from .transforms import BlurImage,RescaleImage,RotateImage,FlipImage,CropImage
import json
class Dataset(object):
'''
A class for the dataset that will return data items as per the gi... | true |
422201f0b19676bcd841cfe83b333cb20330b2b5 | mrtsif/Py1 | /7/lesson 7 task 2.py | UTF-8 | 870 | 4.03125 | 4 | [] | no_license | class Clothes:
def __init__(self, name):
self.n = name
class Coat(Clothes):
def __init__(self, name, v):
super().__init__(name)
self.v = v
@property
def func(self):
return f'{self.n} requires {round(self.v / 6.5 + 0.5, 2)} m2 of textile'
class Suit(Clothes):
def ... | true |
2eabe333c72f1fcd7e5fb415c5f76986b6a857ed | alex-dukhno/python-tdd-katas | /b_tree_list_kata/day_3.py | UTF-8 | 3,834 | 3.34375 | 3 | [
"MIT"
] | permissive | import unittest
PAGE_SIZE = 16
class BtreeList(object):
def __init__(self):
self._root = Page(True)
def __iadd__(self, item):
right = self._root.add(item)
if right is not self._root:
left = self._root
self._root = Page(False)
self._root.put(left)
... | true |
c7d392486908255a9a2407d2d938fa7177348659 | bleehouse/daily-code | /python/spam.py | UTF-8 | 204 | 3.6875 | 4 | [] | no_license | # spam.py
a = 37
def foo():
print("I'm foo and a is %s" % a)
def bar():
print("I'm bar and I'm calling foo")
foo()
class Spam(object):
def grok(self):
print("I'm Spam.grok")
| true |
601b39c9b87c79f9c7be9d505c14b5feac6b808e | ravijo/ros_openpose | /scripts/visualizer.py | UTF-8 | 8,839 | 2.6875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# visualizer.py: rviz visualizer
# Author: Ravi Joshi
# Date: 2019/10/01
# import modules
import math
import rospy
from ros_openpose.msg import Frame
from std_msgs.msg import ColorRGBA
from geometry_msgs.msg import Vector3, Point
from visualization_msgs.msg import Marker,... | true |
d257f657918b8610f3b697809568da8dd55c3083 | aubique/daily | /python/p3-180415-2359.py | UTF-8 | 295 | 3.390625 | 3 | [
"Unlicense"
] | permissive | #!/usr/bin/env python3
countryList = ["Unites States", "Russian Federation", "Germany", "Ireland"]
capitalLetters = [ country[0] for country in countryList ]
for i in range(len(capitalLetters)):
lineToPrint = str.join(" stands for ", [capitalLetters[i], countryList[i]])
print(lineToPrint)
| true |
b0248a9275536e80824f9ef413f958f450c2647a | Kwpolska/adventofcode | /2015/05b-nicer-strings.py | UTF-8 | 958 | 3.375 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/python
import string
import re
NICE = 0
R = []
for l in string.ascii_lowercase:
R.append(re.compile("{0}\w{0}".format(l)))
def test(s):
print(s)
# 1. Contains a pair that appears at least twice, but cannot overlap
f1 = False
# "borrowed" from /u/C0urante: https://www.reddit.com/r/advento... | true |
efc53e71a89103e7ce2ca74ba4e947c03e82702b | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/arc032/A/4581971.py | UTF-8 | 181 | 3.1875 | 3 | [] | no_license | n = int(input())
if n == 1:
print("BOWWOW")
exit()
s = n*(n+1)//2
for i in range(2,int(s**0.5)+1):
if s%i == 0:
print("BOWWOW")
break
else:
print("WANWAN") | true |
d1d312dc34751afd9fc5c47daeb7344376af6812 | ZhiyuSun/leetcode-practice | /501-800/729_ๆ็ๆฅ็จๅฎๆI.py | UTF-8 | 2,600 | 4.09375 | 4 | [] | no_license | """
ๅฎ็ฐไธไธช MyCalendar ็ฑปๆฅๅญๆพไฝ ็ๆฅ็จๅฎๆใๅฆๆ่ฆๆทปๅ ็ๆถ้ดๅ
ๆฒกๆๅ
ถไปๅฎๆ๏ผๅๅฏไปฅๅญๅจ่ฟไธชๆฐ็ๆฅ็จๅฎๆใ
MyCalendar ๆไธไธช book(int start, int end)ๆนๆณใๅฎๆๅณ็ๅจ start ๅฐ end ๆถ้ดๅ
ๅขๅ ไธไธชๆฅ็จๅฎๆ๏ผๆณจๆ๏ผ่ฟ้็ๆถ้ดๆฏๅๅผๅบ้ด๏ผๅณ [start, end), ๅฎๆฐ x ็่ๅดไธบ๏ผ start <= x < endใ
ๅฝไธคไธชๆฅ็จๅฎๆๆไธไบๆถ้ดไธ็ไบคๅๆถ๏ผไพๅฆไธคไธชๆฅ็จๅฎๆ้ฝๅจๅไธๆถ้ดๅ
๏ผ๏ผๅฐฑไผไบง็้ๅค้ข่ฎขใ
ๆฏๆฌก่ฐ็จ MyCalendar.bookๆนๆณๆถ๏ผๅฆๆๅฏไปฅๅฐๆฅ็จๅฎๆๆๅๆทปๅ ๅฐๆฅๅไธญ่ไธไผๅฏผ่ด้ๅค้ข่ฎข๏ผ่ฟๅ trueใๅฆๅ๏ผ่ฟๅ false ๅนถไธไธ่ฆๅฐ่ฏฅ... | true |
06ce107064864a35a4c6358737a49903e374ee7e | Lesuz/Python-Application-Course | /Different Chart types/Week 11-12 Topic - Chart - WordCloud.py | UTF-8 | 460 | 3.609375 | 4 | [] | no_license | # Week 11-12 Topic - Chart - WordCloud
from wordcloud import WordCloud
import matplotlib.pyplot as plt
words = ("This course was Fun I learned so much and these python are now just random words Fun so I am saying Good day to every one two three four five six seven eight nine ten")
wordcloud = WordCloud(width = 480, ... | true |
5d1c5170634ca27c425be10e5926239f6a0167ad | arthurlockman/CS4341-Group-Work | /A2/algorithm.py | UTF-8 | 7,703 | 3.03125 | 3 | [] | no_license | import itertools
import sys
import time
from random import shuffle
from genome import *
# Function for current time in millis
def current_milli_time():
return int(round(time.time() * 1000))
spinner = itertools.cycle(['\\', '|', '/', '-'])
def spin():
if current_milli_time() - spin.last_spin > 100:
... | true |
b7b69243a465ddfdc1d11d2708a6d285cba65a51 | gungne/qbb2016-answers | /day2-lunch/day2_lunch_adv3.py | UTF-8 | 225 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
import sys
import re
sam = sys.stdin
count=0
for line in sam:
if line.startswith("@"):
continue
item = line.rstrip("\r\n").split("\t")
if int(item[1])&int(16):
count=count+1
print(count)
| true |
5185edf3095c66dd5c6bd31f125dfde73bffb39c | c00kie17/pixilate | /pixilate/__main__.py | UTF-8 | 1,580 | 2.78125 | 3 | [
"MIT"
] | permissive | import sys
import urllib.request
from PIL import Image
import platform
import subprocess
import os
import ntpath
def load_image(image_path):
try:
image = Image.open(image_path)
except Exception:
print("cant find image in: "+image_path)
sys.exit(1)
return image
def resize_image(image,new_width=100):
old_wid... | true |
c3be8a92dac430dc9a2841e3233cc06d636ee1a8 | neonjoker/Math | /QU.py | UTF-8 | 3,048 | 2.796875 | 3 | [] | no_license | import numpy as np
sgn = lambda x: 1 if x > 0 else -1 if x < 0 else 0
def CGS(A):
n = A.shape[1]
Q = A.copy()
R = np.zeros((n,n))
R[0,0] = np.linalg.norm(Q[:,0],ord = 2)
Q[:,0] = Q[:,0] / R[0,0]
for j in range(1,n):
for i in range(0,j):
R[i,j] = np.dot(Q[:,i].T,A[:,j])
... | true |
737347423fe9e4cbc1cd74d4abdd8d50e5523e3a | ZachAnders/ProjectEuler | /problems/3.py | UTF-8 | 416 | 3 | 3 | [] | no_license | #!/usr/bin/env pypy
import math
composite = 600851475143
def get_factors(val):
factors = []
for i in xrange(3, int(math.ceil(math.sqrt(val))), 2):
if val % i == 0:
factors.append(i)
factors.append(val/i)
return factors
all_factors = get_factors(composite)
print all_factors
prime_factors = [factor for facto... | true |
52e0d76b37b14db783d664eca6dbeb3306c4163a | lixiang2017/leetcode | /lintcode/000650_ยท_Median_of_two_Sorted_Arrays.py | UTF-8 | 1,828 | 3.578125 | 4 | [] | no_license | '''
binary search
ไบๅrange, ไบๅๆฐ็ปไธญ็ๆๅคงๅผๆๅฐๅผๅบ้ด๏ผๅ
ถๅฎๅฐฑๆฏไบๅ็ญๆก
T: O(log(range) * (logM + logN)), range is 2 * 10^6
S: O(1)
101 ms ๆถ้ดๆถ่ ยท
6.11 MB ็ฉบ้ดๆถ่ ยท
ๆจ็ๆไบคๆ่ดฅไบ 74.60 % ็ๆไบค
'''
from typing import (
List,
)
class Solution:
"""
@param a: An integer array
@param b: An integer array
@return: a double whose format... | true |
8b7bdc4329dd21b3b9c2c547499dae877ba1ecf0 | tranquilshore/Daily-Coding-Problems | /DCP_160_longest_path_in_tree.py | UTF-8 | 1,624 | 3.9375 | 4 | [] | no_license | '''
a
/|\
b c d
/ \
e f
/ \
g h
and the weights: a-b: 3, a-c: 5, a-d: 8, d-e: 2, d-f: 4, e-g: 1, e-h: 1, the longest path would be c -> a -> d -> f, with a length of 17.
Solution:
The gist is similar to what i explained in the max path sum in binary tree video. Path with maximum sum will either go ... | true |
55323f1a1cc4197318d02c9ed541b090ccd883e6 | anpvikas/sudoku_solver | /sudoku_solver.py | UTF-8 | 23,186 | 3.171875 | 3 | [] | no_license | import numpy as np
def sudoku_solver(sudoku):
"""
Solves a Sudoku puzzle and returns its unique solution.
Input
sudoku : 9x9 numpy array
Empty cells are designated by 0.
Output
9x9 numpy array of integers
It contains the solution, if there is one.... | true |
d9752c81cb3f8bfb13fa5c86c45d2e4e637e68fe | adcGG/Lianxi | /Process_pool.py | UTF-8 | 406 | 2.96875 | 3 | [] | no_license | import multiprocessing
from datetime import datetime
def do1(j):
print("็ฌฌ%d่ฟ็จ๏ผ"%(j))
if __name__=="__main__":
print("ๅผๅงๆถ้ด๏ผ",datetime.now())
pool = multiprocessing.Pool()
for i in range(10): # ๅพช็ฏๆไบค10ไธช่ฟ็จ
pool.apply_async(do1(i,)) # ๆไบค่ชๅฎไนๅฝๆฐ็่ฟ็จไปปๅกๅฐ่ฟ็จๆฑ
pool.close()
pool.join()
print("็ปๆๆถ้ด๏ผ",dat... | true |
53e5c57a71d57fbd9d2644cab58e278261c7fa20 | cadiem/CLMS572 | /Assignments/hw8/svm_classify.py | UTF-8 | 4,765 | 2.609375 | 3 | [
"MIT"
] | permissive | import sys
import numpy as np
from math import exp
from math import tanh
def readModel(filename):
#Read model in from trained model file.
weights, supportVectors, svmType, kernelType, gamma, coef, degree, nrClass, totalSV, rho, labels, nrSV, allFeatures = [],[], '','','','','','','','','','',set()
with ope... | true |
1f6d73de7930fd2e1fdb5978e1f131b45a480db5 | nagasaichandra/hackerRank | /Python/medium/Sherlock and the Valid String/Sherlock and the Valid String.py | UTF-8 | 830 | 3.265625 | 3 | [] | no_license | # https://www.hackerrank.com/challenges/sherlock-and-valid-string/problem
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import Counter
def check_valid(c):
# given a counter c, goes through the values, and sees if all of them are equal.
k = set(c.values())
if 0 in... | true |
7c3d7c5f73f4ff25a09631ceabf6bedcecaf86d0 | jreinaro/Practica-tipologia-i-cicle-de-vida-de-les-dades | /PRA1_Criptomonedes_NA_JAR_Web_Scraping.py | UTF-8 | 2,866 | 2.984375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# -------- Importaciรณ de llibreries --------------------
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import pandas as pd
import json
import time
import os
from datetime import datetime
# --------- WEB SCRAPING --------------------------... | true |
be0b6fd4633c89c7c15f86dc849b47cfecaf6f75 | nihil-momenti/Raytracer | /python/transforms.py | UTF-8 | 3,660 | 2.890625 | 3 | [] | no_license | from geom3 import Ray3, Point3, Vector3
from shapes import Shape
import math
from random import random
from material import Material
from colour import Colour
class MaterialTransform(Material):
def __init__(self, material, transform):
self.base = material
self.transform = transform
self.casts_shadow = ma... | true |
b18f5f3309aeecda4d573a29938b355650ea8800 | zesk06/scores | /test_selenium.py | UTF-8 | 2,670 | 2.78125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# encoding: utf-8
"""
test the score game using selenium
"""
import pytest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
@pytest.fixture(scope="module")
def firefox(request):
"""
return a new instance of firefox webdriver
:param request: see pytest ... | true |
61ba9831889c59c6165e272282c840af9c60a35d | GunterOdimm/python | /test/python test13.py | UTF-8 | 317 | 3.25 | 3 | [] | no_license | #-*-coding: utf-8 -*-
times = [7,5,5,5,5,10,7]
total = 0
size = len(times)
half=(size//2) + 1
for i in range(0, half):
p = size -i
print(p)
total += p * 5200
print(total)
for i in range(half,7):
p = half + i
total += p * 5200
tpl = "์ผ์ฃผ์ผ๊ฐ์ ์ด ๊ธ์ฌ๋ {0}์์
๋๋ค."
print(tpl.format(total)) | true |
3df09a3e5bd187231627f73288f3c4f9b70299ca | zachsaeed/python_notes | /099 Notes Under preparation/old/etc note files. Need to move to main files and delete/42-OOP/00- done/57.14-StaticMethods.py | UTF-8 | 2,724 | 4.4375 | 4 | [] | no_license | # We saw how to create class attributes in the previous section. To access and change a class attribute we could use
# instance methods for this purpose:
class Robot:
__counter = 0
def __init__(self):
type(self).__counter += 1
def RobotInstances(self):
return Robot.__counter
x = Robot()
p... | true |
2ad05e9430ac90d15a9fd2e864344835820ed6fa | Prashant-Mohania/PracticePython | /before/fabonacci.py | UTF-8 | 315 | 3.6875 | 4 | [] | no_license | def fabonacci(n):
a = 0
b = 1
if n ==1:
print(a)
elif n ==2:
print(a,b, end=" ")
else :
print(a,b, end=" ")
for i in range(n-2):
c = a + b
a=b
b=c
print(b, end=" ")
user=int(input("enter:- "))
print(fabonacci(user)) | true |
f4aff727d025550ac7da763a8584ad102acb9bf6 | afenkart/find_dup_files | /observable.py | UTF-8 | 1,267 | 3.09375 | 3 | [] | no_license | #!/usr/bin/env python
import weakref
class ObservableProperty(object):
def __init__(self, init = None):
self.value = init
self.observers = []
def __get__(self, instance, cls):
if instance:
return self.value
else:
return self
def __set__(self, instan... | true |
c7f67abe6373c7e60da9fc3b4fe39fba0d26f670 | Federyco/UMET | /Unidad2/Ejercicio8.py | UTF-8 | 323 | 4.28125 | 4 | [] | no_license | #Palabras plurales
# variables
cadena=0
# declaraciรณn de la funciรณn con parametro
def plural_singular(cadena):
if(cadena[-1] == str("s")):
print("Es plural")
else:
print("Es singular")
# ingreso
cadena = input("Ingrese una palabra: ")
#llamada a la funciรณn con parametro
plural_singular(cadena) | true |
011f28e927de75a2651f9f38202143da51af81c0 | guo0109rachel/-Learning-applied-data-science-in-Python | /Applied Plotting, Charting & Data Representation in python/Assignment/week3/course2_Assignment3.py | UTF-8 | 3,411 | 2.765625 | 3 | [] | no_license | # Use the following data for this assignment:
%matplotlib notebook
import pandas as pd
import numpy as np
np.random.seed(12345)
df = pd.DataFrame([np.random.normal(32000,200000,3650),
np.random.normal(43000,100000,3650),
np.random.normal(43500,140000,3650),
... | true |
50c5d83741ea184f5a1ab900b733b090494dc66e | mohtasimtamjeed/numerical_methods | /secant.py | UTF-8 | 586 | 4.3125 | 4 | [] | no_license | import math
def secant(function, x1, x2, tolerance=0.001, maxIterations=1000):
for i in range(maxIterations):
xNew = x2 - function(x2) * (x2 - x1)/(function(x2) - function(x1))
if abs(xNew - x2) < tolerance:
break
else:
x1 = x2
x2 = xNew
else:
print("maximum iterations completed, ... | true |
14fc18e535a60c9cdbdd742eb1ac7494e0e00125 | SmileAnage/Thread | /thread01.py | UTF-8 | 374 | 3.65625 | 4 | [] | no_license | """
็บฟ็จๅบ็กไฝฟ็จ
"""
from threading import Thread
import time
import os
# ็บฟ็จๅฝๆฐ
def music():
for i in range(3):
time.sleep(2)
print("ๆญๆพ๏ผ่ตท้ฃไบ", os.getpid())
# ๅๅปบ็บฟ็จ
t = Thread(target=music)
# ๅฏๅจ็บฟ็จ
t.start()
for i in range(4):
time.sleep(1)
print("ๆญๆพ๏ผไฝ้ข", os.getppid())
# ๅๆถ็บฟ็จ
t.join()
| true |
d40410250222d866b3982db5f8ab6699ce41c370 | yaoyaoding/lecture | /2017-08-15-summer/day2/problem/data/sumit/sumit.py | UTF-8 | 766 | 2.59375 | 3 | [] | no_license | #!/usr/bin/python
from random import *
prob = "sumit"
cases = [ #(n,m,t)
(100,100,0),
(100,100,0),
(100,100,0),
(10000,10000,1),
(10000,10000,1),
(10000,10000,1),
(10000000,10000000,0),
(10000000,10000000,0),
(10000000,10000000,0),
(10... | true |
2bb7afc467a08986e5123bca20452e8c9b37f9fa | athed03/vietnamese-text-classification | /src/vectorizer.py | UTF-8 | 1,634 | 2.71875 | 3 | [] | no_license | from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.metrics import accuracy_score, confusion_matrix
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfTransformer
from tqdm import tqdm
from .helper i... | true |
c431a25cb7d5fcbeb3495ef90b311af24c576d0d | mckim27/polyaxon | /core/tests/test_utils/test_memoize.py | UTF-8 | 4,675 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, Inc.
#
# 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 ... | true |
fde01211e246f6277d785564b6c046ed3eb98df3 | sarine5456/IoP | /pandas/spatial_temporal_aggregation_sarine.py | UTF-8 | 6,672 | 2.59375 | 3 | [] | no_license |
# license: Creative Commons License
# Title: Data management with pandas www.iaac.net
# Created by: Diego Pajarito & Sarine Bekarian
#
# is licensed under a license Creative Commons Attribution 4.0 International License.
# http://creativecommons.org/licenses/by/4.0/
# This script uses pandas for data management for mo... | true |
bfe795ccc136f57b26ecbec938388587871d4c4d | marcioaug/aop-python | /aop/main.py | UTF-8 | 2,047 | 2.578125 | 3 | [] | no_license | from springpython.config import PythonConfig, Object
from springpython.context import ApplicationContext, scope
from springpython.aop import ProxyFactoryObject, RegexpMethodPointcutAdvisor
from weather_service import WeatherService
from weather_service_aop import WeatherServiceAOP
from interceptors import CacheInterce... | true |
c046c7bd1dee58d6d08ae10f91191c6893a9ac13 | kellisfm/30_days_of_code_challange | /Scientific_computing_python_FCC/code_camp_lesson_files/Week_1/Week1_review_pt6_dic.py | UTF-8 | 1,249 | 3.421875 | 3 | [] | no_license | #write a program to read through the mail-log file, build a histogram using a dict to count how many messages came from each email caccount and print
#also print the person with the highest number of emails
#steps:
#1) open the mail file, create an empty dictionary, and set up a loop to read each line in the mail ... | true |
1bf32e3a9d068a45f79795870d2bda6e97500f0e | Saij84/AlgorithmicToolbox | /toolbox/week2_algorithmic_warmup/4_least_common_multiple/lcm_test.py | UTF-8 | 681 | 3.578125 | 4 | [] | no_license | # Uses python3
import time
def lcm_fast(a, b):
upperLim = a*b
maxVal = max(a, b)
minVal = min(a, b)
i = maxVal
while i != upperLim:
if i % maxVal == 0 and i % minVal == 0:
return i
else:
i += maxVal
return upperLim
def lcm_naive(a, b):
for l in... | true |