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 |
|---|---|---|---|---|---|---|---|---|---|---|
98f14d5737619ccf01008cad77d118bd8c2d10b2 | ashok-arjun/Monocular-Depth-Estimation | /utils.py | UTF-8 | 3,257 | 2.9375 | 3 | [
"MIT"
] | permissive | import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import os
import shutil
import torch
def plot_color(ax, color, title="Color"):
ax.axis('off')
ax.imshow(color)
return ax
def plot_depth(ax, depth, title="Depth"):
ax.axis('off')
ax.imshow(depth, cmap = 'jet')
ret... | true |
abba94e9cb45a1a0cbbc7d8fc4b2566696fca46c | romwil22/python-textbook-exercises | /chapter9/exercise4.py | UTF-8 | 1,178 | 4.3125 | 4 | [] | no_license | """Add code to the above program to figure out who has the
most messages in the file. After all the data has been read and
the dictionary has been created, look through the dictionary using
a maximum loop (see Chapter 5: Maximum and minimum loops) to find
who has the most messages and print how many messages the person... | true |
6eca914cb45b4c3e44d45342ea925868afadbd0d | joshcvt/resetter | /test_ncaaf.py | UTF-8 | 1,121 | 2.578125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
#from chalicelib.ncaaf_ncaa import get
from chalicelib.ncaaf_espn import get
from chalicelib.reset_lib import NoGameException, NoTeamException
from argparse import ArgumentParser
args = ArgumentParser()
args.add_argument('--file', type=str, default='', help='Test input file to run against')
the... | true |
0f91cefc4713933e6106aac153096df8af1d0ef7 | vongkhmer/competitive_programming | /AtCoder/Educational DP Contest/P.py | UTF-8 | 1,777 | 3.171875 | 3 | [] | no_license | #
# author: vongkh
# created: Mon Apr 26 2021
#
from sys import stdin, stdout # only need for big input
MOD = int(1e9 + 7)
def add_mod(a, b):
ret = a + b
return ret if ret < MOD else ret % MOD
def dfs(node, parent, adj, dp):
#since stack size is limit in python, we implemented it using stack
stack =... | true |
3fce527c52f97302111ae6f3ea54c61ea2c3fb7f | buchita/Flowerify | /projectApp/MachineLearning/colorThief.py | UTF-8 | 1,589 | 2.75 | 3 | [] | no_license | import cv2
from colorthief import ColorThief
import os
import matplotlib.pyplot as plt
import numpy as np
sourceDir = r"C:\Users\buchi\OneDrive - Technological University Dublin\DT211c4\Dissertation\Dataset-Grabcut\Sunflower"
imageDirs = os.listdir(sourceDir)
domi = []
#
# for image in imageDirs:
# path... | true |
11f465988d29e063690a3a9453f0870a7bd1855e | Tiktakss/SVV_Flight_Dynamics | /eigenvalues.py | UTF-8 | 1,934 | 2.59375 | 3 | [] | no_license | import numpy as np
import Cit_par as p
class EigenV:
def __init__(self):
a=1
def poly(self):
A = 4 * p.muc**2 * p.KY2 * (p.CZadot - 2 * p.muc)
B = p.Cmadot * 2 * p.muc * (p.CZq + 2 * p.muc) - p.Cmq * 2 * p.muc * (p.CZadot - 2 * p.muc) \
- 2 * p.muc * p.KY2 * (p.CXu * (p.CZa... | true |
dd258d1540d0d247c140e6d1f6c37c0e3e66ae2f | VartikaChaudhary/Quora-Question-Pairs | /Docs/data_1.py | UTF-8 | 8,132 | 3.1875 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import joblib
import xgboost as xgb
import lightgbm as lgb
from catboost import CatBoostRegressor
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
impor... | true |
6a7696e9adffa4dbac50e14dfe22aa5251cddbe1 | iSpiEFP/EFP_parameters | /extractMetaModified.py | UTF-8 | 9,045 | 2.9375 | 3 | [] | no_license | from enum import IntEnum
import math
import json
import re
import sys
class CurrentField(IntEnum):
'''
This class only serves the purpose of being used as an enum
for the types of sections in a .efp file.
'''
COORDINATES = 0
MONOPOLES = 1
DIPOLES = 2
QUADRUPOLES = 3
OCTUPOLES = 4
... | true |
6e21fa5d8e73ae9e9b299616f1da6f554369decf | nick-paul/dscheck | /dscheck.py | UTF-8 | 5,034 | 2.796875 | 3 | [] | no_license | #!/usr/bin/env python
import dataset_check as dc
from time import time
import numpy as np
import argparse
import os
import sys
import random
def percentChange(random_guess, classifier):
return (classifier-random_guess)/random_guess*100
def printHeader(out, name, path, crop_size, epochs):
print('# Results f... | true |
ceeffb7dc08bde86879c0e1c957f69a3537d0337 | judebattista/enigma | /enigma/dataStructures.py | UTF-8 | 5,387 | 3.359375 | 3 | [] | no_license | #
#
# title: Enigma Project
# contributors: Asher Mancinelli, Jude Battista, Alyssa La Fleur
# class: MA 362
# professor: Nate Moyer
# last updated: 1/12/18
#
#
# These are the default dictionaries for each rotor, and can be modified
# by shuffling or adding new letters into the subsequent loops.
##################... | true |
1a618c96da63820e7ece37b9d125fa841af6306a | jrayzero/curling | /compute_md5s.py | UTF-8 | 522 | 2.921875 | 3 | [] | no_license | # recursively go thru a directory and compute the md5s of individual files.
import os
import sys
import subprocess
import shutil
from pathlib import Path
base_dir = sys.argv[1]
output_md5_file = sys.argv[2]
output_fd = open(output_md5_file, 'w')
for f in Path(base_dir).rglob('*.*'):
if os.path.isfile(f):
m... | true |
7c7175611cf57f887cfa9f30265b1a4e9f0a422d | alb/pyWhat | /pywhat/magic_numbers.py | UTF-8 | 529 | 2.640625 | 3 | [
"MIT"
] | permissive | import binascii
from pywhat.helper import read_json
def get_magic_nums(file_loc):
with open(file_loc, "rb") as myfile:
header = myfile.read(24)
header = str(binascii.hexlify(header))[2:-1]
return check_magic_nums(header)
def check_magic_nums(text):
for i in read_json("file_... | true |
de06384a8c912e5e0cd7a14e100e60cd06555996 | zickfz/testpy | /array.py | UTF-8 | 220 | 2.921875 | 3 | [] | no_license | __author__ = 'PoM'
arr1 = [1,3,5,7,9]
arr2 = [1,2,3,5,4,1,8,9,7]
arr3 = [1,3,5,7,9,2,1,4,6,5,8]
arr4 = set(arr1)&set(arr2)
xa = list(set(arr3).append(set(arr4)))
"""arr6 = sorted(arr5)"""
print (arr4)
print (arr5)
| true |
cbef58953a7e780bcda2c34e557d4df29aaa97ad | LaNa2485/Progression-outcome-predictor | /part1.py | UTF-8 | 908 | 3.109375 | 3 | [] | no_license | # I declare that my work contains no examples of misconduct, such as plagiarism, or collusion.
# Any code taken from other sources is referenced within my code solution.
# Student ID: w1839526
# Date: April 13, 2021
print("---------------------------------------------------------------")
pass_credits = int... | true |
64b422b14573e66553a372f454c79fec64411d2c | jorul/programmeringsprosjekt | /Oving4/test_container.py | UTF-8 | 833 | 3.265625 | 3 | [] | no_license |
import unittest
from container import Stack, Queue
class TestContainter(unittest.TestCase):
def test_stack(self):
test_stack = Stack()
for i in range(0, 5):
test_stack.push(i)
counter = 4
while test_stack.is_empty() is not True:
self.assertTrue(test_stack.... | true |
c814cb1138cda2c204164d086e522dd5849fdaba | 919954807/learn_git_second | /week01/1b_bs4.py | UTF-8 | 737 | 3.375 | 3 | [] | no_license | # 使用BeautifulSoup解析网页
import requests
from bs4 import BeautifulSoup as bs
user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Safari/535.1"
header = {'user-agent':user_agent}
myurl = 'https://movie.douban.com/top250'
response = requests.get(myu... | true |
aed142ecbd7d49bf92d5002bc7b9ce6433a828ba | anti-copy/gepo-fetch | /tests/test_csv2json.py | UTF-8 | 448 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | from gepofetch.csv2json import csv2json
import os
class TestCsv2JSON:
def test_csv2json(self):
data = """header1;h2;h3
sampV;v002;v003
v221;v222;v223
"""
csvfile = "./data.csv"
with open(csvfile,'w') as f:
f.write(data)
jdata = csv2json(csvfile)
os.remove(csvfile... | true |
dda8d138cdf5eb2a713b44e7d8af4e6aa91bdcaa | melindaeudy/Python-Challenge | /03-Python/Python-Challenge/PyPoll/main.py | UTF-8 | 1,955 | 3.40625 | 3 | [] | no_license | import os
import csv
# Path to collect data from Resources folder
election_csv = os.path.join('Resources','election_data.csv')
# Open File
with open(election_csv, 'r', newline='') as csvfile:
csvreader = csv.reader(csvfile, delimiter =',')
print(csvreader)
header = next(csvreader)
Unique_Person =... | true |
372a3314a6434ce743572c803bbb6a5e3d974ecf | Aronart/connect4 | /AI.py | UTF-8 | 186 | 2.546875 | 3 | [] | no_license | from abc import ABCMeta, abstractmethod
import numpy as np
class AI(metaclass=ABCMeta):
@abstractmethod
def find_move(self, board: np.array, counter: int) -> int:
pass
| true |
baed4e1dfd57008b7d2af3d15766efc313a1d75f | YoungFell/czloed_Dhub | /amongus.py | UTF-8 | 1,293 | 2.78125 | 3 | [] | no_license | from requests import post
from random import choice
from time import sleep
def gen_amongus(color_):
color = f"{color_}_square"
return f"""⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬛⬛⬛⬛⬛⬛⬛⬛⬛⬜⬜⬜
⬜⬜⬛:{color}::{color}::{color}::{color}::{color}::{color}::{color}::{color}::{color}:⬛⬜⬜
⬜⬜⬛:{color}::{color}::{color}::{color}:⬛⬛⬛⬛⬛⬛⬜⬜
⬜... | true |
748960a97e525d21aa9528a7e6e8375293176f05 | jamesfallon99/CA117 | /week01/middle_011.py | UTF-8 | 290 | 3.46875 | 3 | [] | no_license | #!/usr/bin/env python3
import sys
def main():
for line in sys.stdin:
line = line.strip()
if len(line) % 2 != 0:
mid = len(line) // 2
print(line[mid])
else:
print("No middle character!")
if __name__ == '__main__':
main() | true |
aa44e9e9385306d7699de8eb4537e822b9478fb7 | jkpubsrc/python-module-jk-pathpatternmatcher2 | /src/jk_pathpatternmatcher2/Entry.py | UTF-8 | 7,100 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive |
import typing
import os
import collections
import stat
if os.name != "nt":
import pwd
import grp
import jk_prettyprintobj
#
# @field str fullPath The absolute file path to the entry
# @field str absBaseDirPath The absolute directory path the search is based on
# @field str relFilePath The relative path ... | true |
045ce9def5eda02492330bf0054359cd21e92d7a | mdar4/python_blue | /Ex01_aula9.py | UTF-8 | 504 | 4.375 | 4 | [] | no_license | # Crie um programa onde o usuário possa digitar vários valores numéricos e cadastre-os em uma lista.
# Caso o número já esteja lá dentro, ele não será adicionado. No final, serão exibidos todos os valores
# únicos digitados, em ordem crescente.
resp = ' '
lista = list()
while True:
while resp != 'N':
n = int(i... | true |
ce6d61683cbcbcd94cf0be0eeb13dbd153d00e05 | sbitzer/BayEst | /analyse_behaviour.py | UTF-8 | 4,014 | 2.65625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 23 14:44:52 2018
@author: bitzer
"""
import helpers
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats
#%% load data
subjects = helpers.find_available_subjects()
alldata = pd.concat([helpers.load_subject... | true |
57df533145323a9277ec14deae1878a9cf66e3df | kevin810672/AOISys_RL | /RLAIOSys/Py/DDPG_discrete.py | UTF-8 | 12,172 | 2.703125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 4 18:38:31 2019
This method is from "Deep Reinforcement Learning in Large Discrete Action Space"
It combines three important sections which are DDPG, Ornstien-Uhlenbeck process and Wolpertinger.
1. DDPG is modified by the MorvanZhou github https://github.com/MorvanZhou/R... | true |
9fb80f8c18e87d72005827c8cff48be57b06b90a | zzhyzzh/Leetcode | /leetcode-algorithms/760. Find Anagram Mappings/anagramMappings.py | UTF-8 | 755 | 3.3125 | 3 | [] | no_license | class Solution:
# def anagramMappings(self, A, B):
# """
# :type A: List[int]
# :type B: List[int]
# :rtype: List[int]
# """
#
# indices = []
# for element in A:
# ind = B.index(element)
# while ind in indices:
# ind... | true |
47c2139186627982f4bdeced6f1778afd42e31dc | Groensimon/Enrichment | /surfaceQuality.py | UTF-8 | 2,954 | 2.625 | 3 | [] | no_license | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Simon
#
# Created: 20-04-2017
# Copyright: (c) Simon 2017
# Licence: <your licence>
#-------------------------------------------------------------------------------
import arcpy
... | true |
29179fee21ca025a0c00af7c0b0356ac1c9c2838 | LuckyCards/Curso-Python3 | /Desafios/Ex-001.py | UTF-8 | 250 | 3.453125 | 3 | [
"MIT"
] | permissive | print(f'\033[33m{"—"*30:^30}\033[m')
print(f'\033[36m{"EXERCÍCIO Nº 1":^30}\033[m')
print(f'\033[33m{"—"*30:^30}\033[m')
print("Gerador de boas vindas")
nome = input("Digite seu nome de usuário: ")
print (f"Olá {nome}! Bem-vindo ao VS Code")
| true |
906545f6f8a663679b47f3d0b2b5e84478b3214a | rporumalla/Interview_Programming_Practice | /printSpiral.py | UTF-8 | 561 | 3.359375 | 3 | [] | no_license | # O(mXn)
def printSpiral(matrix):
rows=len(matrix)
if rows>0:
k,l=0,0
cols=len(matrix[0])
while k<rows and l<cols:
for i in range(l,cols):
print matrix[k][i],
k+=1
for i in range(k,rows):
print matrix[i][cols-1],
cols-=1
if k<rows:
for i in range(col... | true |
45ff94cd8da435332034ea7c02faa8c4839ee54f | JoaquinGuzmanO/MCOC2021-P0 | /P0E2/timing_matmul.py | UTF-8 | 485 | 3.078125 | 3 | [] | no_license | from numpy import zeros
from time import perf_counter
#Tamaño
for i in range(1,11):
text = open("rendimiento_"+str(i)+".txt","w")
ns= [5,10,20,50,100,200,500,1000,2000,5000]
for N in ns:
A = zeros((N, N))+1
B = zeros((N, N))+2
t1 = perf_counter()
C = A@B
t2 = perf_counter()
dt = t2 - t1
uso_m... | true |
c02a6f0c194c4199f44681c4a4cea2026894b75a | bisget7/Refactoring-Pygame-Weekend-2 | /player.py | UTF-8 | 1,247 | 3.515625 | 4 | [] | no_license | from colours import Colours
import pygame
class Player:
def __init__(self, x, y, size, colour=Colours.player_colour):
self.x=x
self.y=y
self.size=size
self.colour=colour
def draw(self, screen):
pygame.draw.rect(screen, self.colour, (self.x, self.y, self.size, self.siz... | true |
8af668009f9a5495c1315c23ef4660851db76268 | danielsmith1313/nasa-ne-2019 | /NodeMapper.py | UTF-8 | 2,631 | 3.890625 | 4 | [] | no_license | import math
class map():
def __init__(self):
#Holds the converted coordinates of all nodes
self.__node = ()
#Holds the coordinates as keys and each neighbor as subkeys containing the calculated distance
self.__nodeNeighbors = {}
#Array that holds the nodes to be converted int... | true |
5f06d312838eaf5505eeb730911a57c31ece5c4e | clonsberry/PI-Connector-for-UFL-Samples | /COMPLETE_SOLUTIONS/RaspberryPI/SendSenseHatDataToPISystem.py | UTF-8 | 8,709 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | import sense_hat # Used for controlling the Sense Hat
import datetime # Used for getting the timestamp
import time # Used for inserting pauses (sleeps)
import requests # Used to send the data requests
import json # Used to parse geolocation JSON
import sys # Used to parse error messages
im... | true |
a55c3d62652f9361fc5c7cfb5318da5361f70b0f | man-of-the-year/snake-game-python | /snake_game.py | UTF-8 | 3,624 | 3.265625 | 3 | [] | no_license | from tkinter import *
import random
GAME_WIDTH = 750
GAME_HEIGHT = 750
SPEED = 80
SPACE_SIDE = 50
BODY_PARTS = 3
SNAKE_COLOR = '#fc03fc'
FOOD_COLOR = '#6600ff'
BACKGROUND_COLOR = '#111317'
class Snake:
def __init__(self):
self.body_size = BODY_PARTS
self.coordinates = []
self.square... | true |
42472f6787a2824477daa25a8a6cd54e11df1264 | wenkaiqiu/petal | /uniform_model/templates/storage.py | UTF-8 | 513 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | from .base import Template
from ..devices import Device
class StorageTemplate(Template):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def _check_device_info(self, device_info):
lack = super()._check_device_info(device_info)
for item in self.properties:
... | true |
d02f3916609cba8931a2baca93700e0262f77ff9 | VinTurnier/python | /Algorithm/BinarySearch.py | UTF-8 | 390 | 3.9375 | 4 | [] | no_license | class BinarySearch(object):
def __init__(self, item):
self.item = item
def search(self,E: int):
left, right = 0, len(self.item)-1
while(left<=right):
mid = (right+left)//2
if self.item[mid]==E:
return mid
elif self.item[mid]>E:
right = mid-1
else:
left = mid+1
if __name__=="__main__"... | true |
b664397f7b1f895f746ced0d3f5b4358461d0933 | vrnithinkumar/MajorProject | /tests/svr.py | UTF-8 | 877 | 2.8125 | 3 | [] | no_license | '''
Created on 27-Apr-2014
@author: vr
'''
from sklearn.svm import SVR
import numpy as np
import pylab as pl
X = np.sort(5 * np.random.rand(40, 1), axis=0)
y = np.sin(X).ravel()
################################################
# Add noise to targets
y[::5] += 3 * (0.5 - np.random.rand(8))
svr_rbf = SVR(kernel='rbf', ... | true |
e195c935a60b818e97aad56898264f1f303b4e04 | mikoim/procon | /2017/gcj_qualification/oversized-pancake-flipper.py | UTF-8 | 2,612 | 3.71875 | 4 | [] | no_license | """
A. Oversized Pancake Flipper
"""
from functools import lru_cache
def main():
t = int(input())
for i in range(1, t + 1):
cakes, flipper = input().split(" ")
print("Case #{}: {}".format(i, find_min_step(cakes, int(flipper))))
def find_min_step(cakes, flipper):
"""
>>> find_min_ste... | true |
09a692f596838c696fc34f5081a3db7195ac1de3 | Nadeem-Doc/210CT-Labsheet | /LabSheet 0 - Task 2.py | UTF-8 | 535 | 3.78125 | 4 | [] | no_license | p = input ("input point of reference: ")
a = input ("input coordinate 1: ")
b = input ("input coordinate 2: ")
c = input ("input coordinate 3: ")
ax = a[0]
ay = a[1]
by = b[1]
bx = b[0]
cx = c[0]
cy = c[1]
px = [0]
py = [1]
if px > ax and px > bx and px > cx:
print("right")
elif px < ax and... | true |
d1f4744482ccf81830b5a3e401e14239dbbe9361 | k4u5h1k/HackTheBox | /intense/tohashdump.py | UTF-8 | 192 | 2.75 | 3 | [] | no_license | from binascii import hexlify,unhexlify
from hashlib import sha256
from base64 import b64decode
b64 = input("enter second part :")
decoded = b64decode(b64)
hash = hexlify(decoded)
print(hash)
| true |
820c62dab3950512dda3c14386432cff649fec4e | YI-DE-LIU/ycsh_python_course | /exam/equation3.py | UTF-8 | 189 | 3.421875 | 3 | [] | no_license | a=float(input())
b=float(input())
c=float(input())
d=float(input())
e=float(input())
f=float(input())
x=((-e*c)-(-b*f))/(a*e-b*d)
y=((-d*c)-(-a*f))/(b*d-a*e)
print(float(x))
print(float(y)) | true |
60e7f87e941cfdd8a80b621a2a9fd39fa9bd0ff8 | vvhitedog/spectavi | /example/util.py | UTF-8 | 1,900 | 3.375 | 3 | [
"MIT"
] | permissive | import numpy as np
from matplotlib import image as mimage
from time import time
class Timer(object):
"""A simple timer context-manager, taken from
https://blog.usejournal.com/how-to-create-your-own-timing-context-manager-in-python-a0e944b48cf8
"""
def __init__(self, description):
self.descri... | true |
90a5ade949710f53da4f2cb50efcb3ac6a5f9a41 | xdtdaniel/ISE5194_Project | /Project.py | UTF-8 | 4,663 | 2.6875 | 3 | [] | no_license | import numpy as np
import gym
from gym.utils.play import *
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
from matplotlib import pyplot as plt
# hyperparameters
max_iter = 2000
alpha = 0.0001 # learning rate
epsilon = 0.9999
gamma = 0.9
memory_capacity = 2000
batch_s... | true |
9413e6edda7d8f111fdeff7561e418e91e2cb269 | s991116/robot-projects | /Raspberry/Python/Segway/arduinoCom/serialProtocol.py | UTF-8 | 2,914 | 2.84375 | 3 | [] | no_license | import array
class serialProtocol(object):
def __init__(self, serial):
self.serial = serial
return
def sendCharData(self, commandId, data):
request = [0] * (1 + 2*len(data))
request[0] = commandId + 128
for index in range(0, len(data)):
request[... | true |
8a2015633b153e254b8197cda14d8a924748d3f3 | hagino3000/study-programming-contest-challenge-book | /chap2-1/abc007c.py | UTF-8 | 1,765 | 3.53125 | 4 | [] | no_license | # ABC007 C 幅優先探索
# https://atcoder.jp/contests/abc007/tasks/abc007_3
from collections import deque
class GoalFound(Exception):
def __init__(self, distance):
self.distance = distance
class Solver:
def __init__(self, R, C, start, goal, maze) -> None:
self.R = R
self.C = C
self.s... | true |
9d68368a43d6398c22ffa8f0685124ce4798ffeb | mycharlapavankumar/mychu | /basic python/madav12.py | UTF-8 | 510 | 2.90625 | 3 | [] | no_license | n=int(input())
b=[]
for i in range(1,n+1):
b.append(i)
oc1=len(oct(n))
he1=len(hex(n))
bi1=len(bin(n))
for i in b:
print(" "*3,end='')
print(i,end=' ')
oc=oct(i);
print(oc[2:]," "*(oc1-len(oc)),end="")
#print(oc[2:].rjust(len(oc[2:])+1," "),end='')
he=hex(i).upper()
print(he[2:]," "*(he1... | true |
a350317ea5bc3fbf2113b549c9e9a986cc731e70 | CreatorsTF/python-master-server | /master-server.py | UTF-8 | 14,789 | 2.859375 | 3 | [] | no_license | import a2s
import requests
import json
import time
import socket
from colorama import Fore
import sys
import signal
import asyncio
# Creators.TF Master Server
# Written by ZoNiCaL and edited by sapphonie.
# Purpose: Updates the Creators.TF database with the latest website information.
class Provider():
"""Object ... | true |
4e4b462ac926a6492f0bd1a0aae40c146c44f38f | IraGu/Hangman-2P | /htest.py | UTF-8 | 756 | 4.5 | 4 | [] | no_license | def guess_test(user):
while True:
letter = input(">>> ")
if letter.isalpha() and len(letter) == 1:
print(f"{user.title()} has guessed the letter: {letter.lower()}!")
return(letter)
else:
print('Please only enter a single letter!')
conti... | true |
b74ac27af859defd0aa75f000e025eebd6fe8c62 | MaxRieger96/tum-adlr-ss20-05 | /src/elevator_rl/environment/house.py | UTF-8 | 5,744 | 2.890625 | 3 | [] | no_license | from typing import List
from typing import Set
import numpy as np
from elevator_rl.environment.elevator import Elevator
from elevator_rl.environment.passenger import Passenger
from elevator_rl.environment.passenger_generator import PassengerGenerator
class House:
def __init__(
self,
number_of_fl... | true |
355ae414e56807dd42e125462e03d7510d5b4d76 | iOperator/FRAMpen | /software/FRAMpen.py | UTF-8 | 5,731 | 2.65625 | 3 | [] | no_license | #!/usr/bin/env python
"""FRAMpen.py: Reads and converts data from the FRAMpen.
http://processors.wiki.ti.com/index.php/FRAMpen
"""
__author__ = "Max Groening, Thomas Bendel"
#################
# Configuration #
#################
MAX_BYTES = 6666 #7164 # Maximum number of bytes to read
BAUDRATE = 9600
... | true |
372040b9252b7a82e137cf82a15683acdb37f7fa | baluneboy/pims | /sandbox/note_handle_keyboard_ctrl_c.py | UTF-8 | 1,148 | 3.40625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import sys
import time
import signal
# custom signal handler
def signal_handler(signal, frame):
"""custom signal handler"""
print '\nYou pressed Ctrl+C! Exit with status code = 2.'
sys.exit(3)
# artifical, long-running process
def long_running_process():
"""artifical, long-runn... | true |
e40210dc0169ba5816eb5a24cbc85d20359dd603 | bh1995/gcn-prot | /gcn_prot/visualization/plot_model.py | UTF-8 | 649 | 3.453125 | 3 | [
"MIT"
] | permissive | """Visualization about the neural network model."""
import matplotlib.pyplot as plt
def plot_epoch(epochs, train_loss, test_loss, epoch):
"""Loss plot, neon colors."""
# Other Neon colors of the palette -> #13CA91 #3B27BA #E847AE #FF9472
plt.plot(epochs, train_loss, color="#13CA91", marker="o", label="Tr... | true |
b44d9c69e3478b26092d73eef6aaed993ae5b54e | IvanovStepanM/MCD-RM-Stock-Market-Indicators- | /Plotting_Multiple_Stock_Market_Indicators_on_One_Graph.py | UTF-8 | 4,499 | 3.09375 | 3 | [] | no_license | import pandas as pd
from alpha_vantage.techindicators import TechIndicators
import matplotlib.pyplot as plt
import numpy as np
from alpha_vantage.timeseries import TimeSeries
#api_key = 'RNZPXZ6Q9FEFMEHM'
#period = 60
#ti = TechIndicators(key=api_key, output_format ='pandas')
#data_ti, meta_data_ti = ... | true |
278b5a3992f3d7eebff3c0d9e7915150bc61908f | Wintus/MyPythonCodes | /MyExtra01Sec01.py | UTF-8 | 1,231 | 4.03125 | 4 | [] | no_license | # Project: Extra Credit 1 - Triangle (MaemichiYuyaExtra01Sec01.py)
# Name: Yuya Maemichi
# Date: 05/06/14
# Description: This program displays a triange of X's as high as user input.
def triangle(intHeight):
'''display triangle'''
if intHeight > 40:
raise ValueError('It\'s too high!')
int... | true |
3f6b39028e97838b6400c25fe92145c7d9e04f30 | KustomApe/dev | /.history/miko_20210415212102.py | UTF-8 | 82 | 2.734375 | 3 | [] | no_license | print(bin(2))
print(bin(1))
print(bin(0))
print(bin(100))
print(0x12)
print(0o12) | true |
9600172d5aa480d6ffd1c11987b75b628b2d68c6 | squeaky-pl/xpython | /xpython/c.py | UTF-8 | 770 | 2.671875 | 3 | [] | no_license | class CFunction:
def __init__(self, context, ret_type, name, param_types):
self.context = context
self.cfunction = context.imported_function(
ret_type, name, param_types)
def __call__(self, *params):
return self.context.call(self.cfunction, params)
class CFunctions:
de... | true |
22085d27d23dc9474f2f8215f2349993d6d6e120 | PeiwenWu/Adaptation-Interspeech18 | /kaldi-wangke/scripts/rnnlm/get_word_features.py | UTF-8 | 8,362 | 2.828125 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | #!/usr/bin/env python3
# Copyright 2017 Jian Wang
# License: Apache 2.0.
import os
import argparse
import sys
import math
from collections import defaultdict
parser = argparse.ArgumentParser(description="This script turns the words into the sparse feature representation, "
... | true |
01745f437cc8c1035fd027a1732ec0c7224c9b47 | theranbrig/python_tuts | /guessing_game.py | UTF-8 | 617 | 4.0625 | 4 | [] | no_license | import random
random_number = random.randint(1, 10)
guess = None
while(guess != 10):
guess = int(input("Guess a number between 1 and 10. "))
if guess < random_number:
print("Too low. Try again. ")
elif(guess > random_number):
print("Too high. Try again. ")
else:
print(f"That is... | true |
4f7bff8068ec1c03d263183de3eef400c60ecde1 | IanPlu/Terra | /terra/engine/animatedgameobject.py | UTF-8 | 3,737 | 3.234375 | 3 | [] | no_license | from terra.engine.gameobject import GameObject
from terra.constants import TICK_RATE
from terra.util.mathutil import clamp
# Game object class with support for rendering animation.
# Automatically ticks the frame to display over time.
# Size: H&W of each frame of animation. The image passed in is assumed to be a hori... | true |
18da78ea8646fe3ad156fe693f0006d09369069e | YevhenKhomenko/dive_into_python_coursera | /week1/task2/solution.py | UTF-8 | 109 | 3.140625 | 3 | [] | no_license | import sys
lines_num = int(sys.argv[1])
for i in range(lines_num):
print(("#" * (i + 1)).rjust(lines_num)) | true |
83a72fafe9060dfbb8b528552511942d76154338 | itbullet/python_projects | /romanToInt/romanToInt.py | UTF-8 | 1,265 | 3.671875 | 4 | [] | no_license | class Solution:
def romanToInt(self, s):
roman = {"I" : 1, "IV" : 4, "V" : 5, "IX" : 9, "X" : 10, "XL" : 40, "L" : 50, "XC" : 90, "C" : 100, "CD" : 400, "D" : 500, "CM" : 900, "M" : 1000}
num = 0
size = len(s)
i = 0
while i < size:
if i < size-1:
... | true |
9eac5bf65e47ce79c4a88aa1cf9b6606f08dd770 | PascalRoose/bigdatamining | /HW2/src/python/Exercise4.py | UTF-8 | 4,230 | 3.140625 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
from pyspark.sql import SparkSession
from pyspark.sql.types import *
from pyspark.sql.functions import split, explode, monotonically_increasing_id, col, lower, regexp_replace
# Create a spark session/application
spark = SparkSession.builder.appName('Exercise 4').getOrCreate()
# ... | true |
287a7c78b16db5cba222974febd01f03a2562ba2 | WheatonCS/GluGo | /1_Backend_Database/step_1_updateRow/getDataExample.py | UTF-8 | 417 | 2.609375 | 3 | [
"MIT"
] | permissive | from dataAccess import dataAccess as DB
import dateTime as DT
#path to filled out Database that has already been created with patient information from the provided CSVs
dbpath = “lab.db”
#connect to the Database by creating an instance of dataAccess
kateDB = DB(“Kate”, dbpath)
#call the function on the Melissa tab... | true |
47b488b076630cf126f3aeb517ee76098e50afc8 | vikramlance/Python-Programming | /Unisex_names/unisexNamesChallenge.py | UTF-8 | 598 | 3.59375 | 4 | [] | no_license |
f= open("dq_unisex_names.csv", "r")
data = f.read ()
data_list=data.split("\n")
print(data_list[0:5])
string_data=[]
for row1 in data_list:
comma_list=row1.split(",")
string_data.append(comma_list)
print(string_data[0:5])
numerical_data =[]
for row2 in string_data:
new=[row2[0],float(row2[1])]
... | true |
c8c16336739b4c8863f75c6f281291fd020910c4 | ntomita/maf-lib | /tests/maflib/test_validation.py | UTF-8 | 2,628 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
import tempfile
import unittest
from maflib.logger import Logger
from maflib.validation import (
MafFormatException,
MafValidationError,
MafValidationErrorType,
ValidationStringency,
)
class TestMafValidationError(unittest.TestCase):
__errors = (
MafValidationErro... | true |
939fb6cc885a4ea7e70214cefe196c079bab8089 | thembela1999/PythonFundamental-Week1-4 | /PYTHON FUNDAMENTALS -(week5)/WEEK 1/DAY 1/Activity2.py | UTF-8 | 129 | 3.296875 | 3 | [] | no_license | import numpy as np
# ndim represents the number of dimensions (axes) of the ndarray
x = np.array([1, 2, 3])
print (x.ndim) | true |
d42e3f87bcbce8521bbc99ecfcd36b9415fee671 | behzadarbab/Exoplanet_Simulation | /Orbital_Calculations.py | UTF-8 | 1,084 | 3.328125 | 3 | [] | no_license |
#%%
import numpy as np
import math
from numpy import cos as c
from numpy import sin as s
def orbital_cal(a, i, o, f, v1, m1, m2): #we assume that the primary star is at z=0 with the velocity v1
Rot=np.array([[c(f)*c(o)-c(i)*s(f)*s(o), -c(f)*s(o)-c(i)*c(o)*s(f), s(f)*s(i)],
[c(o)*s(f)+c(f)*c... | true |
008b05346c737abbc03cef77989306a4ca4f8561 | PengiunDoomsday/lab5A | /heap_sort.py | UTF-8 | 661 | 3.578125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 27 23:06:22 2018
@author: Javier Soon
ID: 80436654
Professor: Diego Aguirre
T.A.: Manoj Saha
Description: Had to created a insert and extract the min for the heap.
after which had to sort the heap.
"""
from lab5 import Heap
def main():
heap ... | true |
6418af324bb3d022c82e3b20a382b39fc0f0bb4a | darshancool25/IIIT_Codes | /SY Lab Codes/SEM 3/SEM 3 Python/Assignment 1/A1_10.py | UTF-8 | 77 | 3.59375 | 4 | [] | no_license | mystr = input("Enter a string : ")
print(mystr.upper())
print(mystr.lower())
| true |
5fed98069a0aeb29281ec0d198765ea62c63fd45 | comperical/AdventFlow | /src/p24a.py | UTF-8 | 10,005 | 3.03125 | 3 | [] | no_license | import json
import time
import sys
from collections import deque
import utility as U
from finite_state import *
SPECIALS = ['fire', 'radiation', 'cold', 'bludgeoning', 'slashing']
def pointafter(record, tagstr):
idx = record.find(tagstr)
assert idx != -1, "Failed to find tag string {} ".format(tagstr)
r... | true |
00ead3212a7f7c8a310a1b0eb4baa8f958b52452 | Baloo31/Grundlagen-der-Programmierung | /Lab4Prototip/Entities/Hotel.py | UTF-8 | 667 | 2.53125 | 3 | [] | no_license | class Hotel:
def __init__(self):
self.__gaste = []
self.__zimmern = []
self.__reservierungen = []
def __str__(self):
return f'{self.gaste} ||| {self.zimmern} ||| {self.reservierungen}'
@property
def gaste(self): return self.__gaste
@gaste.setter
de... | true |
1f1c9eee6fb70f7186129919878ce961c0147c75 | raochongyang/scrapy | /douban/douban/pipelines.py | UTF-8 | 3,627 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import sqlite3
import json
from scrapy.exporters import JsonItemExporter
# 去除空的数据
class AddPipeline:
def process_item(self... | true |
3c25ffe0dae6c7831663acdb6fda4ac20e684d1a | danielleal89/URI-Desafios | /1930(Tomadas).py | UTF-8 | 108 | 3.1875 | 3 | [] | no_license | a, b, c, d = input().split()
t1 = int(a)
t2 = int(b)
t3 = int(c)
t4 = int(d)
print((t1+t2+t3+t4) - 3)
| true |
376707c86f7032f7a71380e625bc369cd8d406ae | wangxiao4/programming | /Num5/5.8_GreatestCommonDevisor.py | UTF-8 | 289 | 3.421875 | 3 | [] | no_license | num1,num2=eval(input("enter tow number\n"))
num_temp=2
greatestCommonDivisor=1
while num_temp <= (num1 if num1<num2 else num2):
if num1%num_temp == 0 and num2%num_temp==0:
greatestCommonDivisor=num_temp
num_temp+=1
print("Greatest Common Divisor is ",greatestCommonDivisor) | true |
2caf4a6540f44b2b7da00213e67d58b24723ec8c | abhiraj24/Leetcode | /Arrays and Strings/richest-customer-wealth/richest-customer-wealth.py | UTF-8 | 336 | 2.65625 | 3 | [] | no_license | class Solution:
def maximumWealth(self, accounts: List[List[int]]) -> int:
#gl_sum=0
#import numpy as np
#for i in accounts:
# gl_sum=max(gl_sum,np.sum(i))
#
#return gl_sum
res=[]
for i in accounts:
res.append(sum(i))
... | true |
db92f7b4020e1f90ed1e6139cd5ec201cc0f1cc0 | liangxioa/Jtyoui | /jtyoui/data/methods.py | UTF-8 | 9,787 | 3.171875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2019/6/1 22:34
# @Email : jtyoui@qq.com
# @Software: PyCharm
from itertools import combinations_with_replacement, permutations, combinations
from collections.abc import Iterable
import random
import string
import collections
import re
import os
import unicodeda... | true |
18a91babd1f7f1cf92a636c881f12d62f09368d3 | kumawat0008/Data-Structures-Algorithms | /Leetcode-100/kth_smallest_bst.py | UTF-8 | 739 | 3.09375 | 3 | [] | no_license | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution(object):
def kthSmallest(self, root, k):
"""
:type root: TreeNode
:type k: in... | true |
46df3d6351310e3c42deadc2e05cd437d53a9c00 | GaoFuhong/python-code | /study1/guessage.py | UTF-8 | 455 | 3.84375 | 4 | [] | no_license | # Author:Fuhong Gao
age_of_gfh = 21
count = 0
while count < 3:
guess_age = int(input("please guess age:"))
if age_of_gfh == guess_age:
print("Yes,you are right!")
break
elif age_of_gfh > guess_age:
print("Think bigger..")
else:
print("Think smaller..")
count += 1
... | true |
0df2f09755c59342dce7ecf353278175b295b8d3 | Aasthaengg/IBMdataset | /Python_codes/p02954/s573925958.py | UTF-8 | 584 | 2.734375 | 3 | [] | no_license | import sys
from itertools import groupby
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
S = readline().strip()
N = len(S)
s = 0
ans = [0] * N
for k, g in groupby(S):
n = len(lis... | true |
740c4333df6777411f9c43198d5ff783f4eb895f | Tribe216/Project-Euler-Solutions | /P_002 Even Fibonacci Terms.py | UTF-8 | 620 | 3.03125 | 3 | [] | no_license | import sys
from time import clock
start_time = clock()
running_sum = 0
i_front = 1
i_back = 1
while ( i_front <= 4000000 ):
if not (i_front % 2):
running_sum += i_front
i_front = i_front + i_back
i_back = i_front - i_back
print clock() - start_time, "seconds"
print r... | true |
3ff4f254462144ad87a11be91210d14348d087d0 | pzelenin92/learning_programming | /Tasks from programming books/Learning_algorithms_Kulikov_Pevzner_2018/Three_Rocks_Game/table_of_mods.py | UTF-8 | 720 | 3.796875 | 4 | [] | no_license | """There i printed mods of given matrix and trying to find out which mods are leading to
lost combination. The losing mods are (0, 2) (1, 1) (2, 0) (3, 3)"""
n, m = 10, 10 # given matrix
matr = [[[] for j in range(m + 1)] for i in range(n + 1)] # construction empty matrix to print
for i in range(n + 1): # pri... | true |
3b1ea6a0342e0665eb8c41a229926201d167afe6 | syurskyi/Python_Topics | /125_algorithms/_examples/_algorithms_challenges/pybites/intermediate/70_v2/eggs.py | UTF-8 | 496 | 3.546875 | 4 | [] | no_license | from random import choice
COLORS = 'red blue green yellow brown purple'.split()
class EggCreator:
def __init__(self, limit):
self._limit = limit
def __iter__(self):
return self
def __next__(self):
if self._limit > 0:
self._limit -= 1
return choice(CO... | true |
cd25a1318255baaa8d9a9e9271bb6f5051d3f5b1 | honzajavorek/brno | /crawler/tools/downloader.py | UTF-8 | 1,081 | 2.75 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Simple downloader."""
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
from xml.etree import ElementTree
import json
import urllib
import urllib2
class Downloader(object):
def __init__(self, url, *args):
if args:
params = []
... | true |
beba7ef30f661777e32cac42abce3483c3845b01 | Satyam-kumar7079/hello-world | /smile.py | UTF-8 | 4,120 | 2.984375 | 3 | [] | no_license | from tkinter import Tk, HIDDEN, NORMAL, Canvas
def toggle_eyes():
current_color = c.itemcget(eye_left,'fill')
new_color = c.body_color if current_color == 'white' else 'white'
current_state = c.itemcget(pupil_left,'state')
new_state = NORMAL if current_state == HIDDEN else HIDDEN
c.itemconfi... | true |
4cd13182e45b61e4723ad002c3949f239d40b136 | LeoSilvaGomes/pythonPlayground | /exercice/animais.py | UTF-8 | 145 | 3.734375 | 4 | [] | no_license | animais = ['baleia', 'humano', 'vaca']
for animal in animais:
print('A(O) ' + animal + ' é um mamifero')
print('Todos eles são mamiferos') | true |
38637af8788a9c8cd45ffec3ecb552db60a3f360 | DeokO/Data-science-school | /10_sklearn kmeans clustering.py | UTF-8 | 3,341 | 3.265625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
'''------------------------------------------------------------------------
Deokseong Seo
M.S. Student in Industrial Management Engineering
Korea University, Seoul, Republic of Korea
E-mail heyhi16@korea.ac.kr
Data Science and Business Analytics Lab
Lab Homepage http://dsba.korea... | true |
bde9e653d2323eb08879067ea1dadc84a004477b | johnrobertlawson/evac | /evac/plot/figure.py | UTF-8 | 8,906 | 2.53125 | 3 | [] | no_license | import pdb
import os
import numpy as N
import matplotlib as M
# TODO backend should be set in matplotlibrc
# M.use("Agg")
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from cartopy.feature import NaturalEarthFeature
from cartopy.io import shapereader
import cartopy
import evac.utils as util... | true |
6ba41460f72577d2a7ee12ff4ae75edc40e30cb2 | timmyoder/flask-covid-tracker | /get_data.py | UTF-8 | 915 | 2.9375 | 3 | [
"MIT"
] | permissive | import requests
import pandas as pd
penn_cases = 'https://data.pa.gov/resource/j72v-r42c.json'
penn_deaths = 'https://data.pa.gov/resource/fbgu-sqgp.json'
penn_hospital = 'https://data.pa.gov/resource/kayn-sjhx.json'
def pull_penn_data(api, county):
clean_df = pd.DataFrame(requests.get(f'{api}?county={county}').... | true |
4ca478d3d88b13b352fbe9e4b8ddba907eec2c21 | algorithmku/minjun | /039/Minimum Loss.py | UTF-8 | 1,333 | 3.4375 | 3 | [] | no_license | #!/bin/python3
import math
import os
import random
import re
import sys
#https://www.hackerrank.com/challenges/minimum-loss/problem
# Complete the minimumLoss function below.
def minimumLoss(price):
#price 를 reverse sort 함
sorted_price = sorted(price, reverse=True)
print(sorted_price)
# 가장 작은 가격차이를 0번... | true |
19b03e615890cfd5fcb8ee4f455301e4eb54826d | PauloVilarinho/algoritmos | /problemas uri/Problema1192.py | UTF-8 | 342 | 3.65625 | 4 | [] | no_license | quantity = int(input())
for i in range (quantity) :
entrada = list(input())
numero1 = int(entrada[0])
numero2 = int(entrada[2])
operation = entrada[1]
if numero1 == numero2 :
print(numero1**2)
elif operation == operation.lower() :
print(numero2 + numero1)
else :
pri... | true |
979779cc0fc9fc2a614363f4d592b9cf23356962 | alTeska/DAP_analysis | /param_analysis/csv_to_dataframe.py | UTF-8 | 1,120 | 2.640625 | 3 | [] | no_license | import glob
import numpy as np
import pandas as pd
# load the file
directory = './parameters/'
# load the data
dir = glob.glob(directory + '*')
# create variables name based on n_samples
dir_name = []
for n in dir:
x = n.find('dap_')
n = n[x:-4]
dir_name.append(n)
# get parameters label
param_labels = ... | true |
1f2e59580ea68f29dcd2f60e3f333c6467e9b8f4 | bunshue/vcs | /_4.python/__code/Python自學聖經(第二版)/ch09/oswalk/oswalk.py | UTF-8 | 261 | 3.28125 | 3 | [] | no_license | import os
cur_path=os.path.dirname(__file__) # 取得目前路徑
sample_tree=os.walk(cur_path)
for dirname,subdir,files in sample_tree:
print("檔案路徑:",dirname)
print("目錄串列:" , subdir)
print("檔案串列:",files)
print() | true |
e2242b66065e73d12cd4c4e83b0df10bb6542900 | okipriyadi/NewSamplePython | /SamplePython/Basic Source /ListTuppleDirectoryMapLambda/filterMapReduceLambda.py | UTF-8 | 892 | 3.859375 | 4 | [] | no_license | print "--------------Fungsi Filter"
def f(x): return x % 2 != 0
d = range(1,10)
print "data asal : ", d
print "data filter",filter(f, d )
print "--------------Fungsi map"
def kuadrat(x): return x * x
print "data map",map(kuadrat, d)
print "--------------Fungsi reduce"
def jumlah(a,b): return a+b
print "data reduce",re... | true |
8ce9171a121afa452c54da212250d40139aa139a | DaHuO/Supergraph | /codes/CodeJamCrawler/16_0_1/NurAG/bleatrix.py | UTF-8 | 949 | 3.09375 | 3 | [] | no_license | import sys
MAX = 100
def bleatrix(nm):
digits = set()
for i in range(1, MAX+1):
for d in str(i * nm):
digits.add(d)
if len(digits) == 10:
return str(i * nm)
return 'INSOMNIA'
def main():
if len(sys.argv) == 1:
print 'beatrix.p... | true |
090252359bf5a693843971a1d08b9fb9cf025a11 | hieubz/Crack_Coding_Interview | /leetcode/easy/find_second_largest_number.py | UTF-8 | 369 | 3.546875 | 4 | [] | no_license | def find_second_largest_number(arr):
max_1 = max(arr[0], arr[1])
max_2 = min(arr[0], arr[1])
for i in range(2, len(arr)):
if arr[i] > max_1:
max_2 = max_1
max_1 = arr[i]
elif arr[i] > max_2 and arr[i] != max_1:
max_2 = arr[i]
return max_2
a = [10, ... | true |
48fdfec3498a2f3c0240c3a6ac0d60ce2683e752 | Mujju-palaan/Python | /ifstatement.py | UTF-8 | 239 | 3.453125 | 3 | [] | no_license | print("Enter hours worked:")
hoursworked = int(raw_input())
rate = 25.00
if hoursworked > 40: grosspay = (40*rate)+((hoursworked-40)*(rate*1.5))
else:grosspay = hoursworked * rate
# print(str(grosspay))
print("gross pay: " + str(grosspay)) | true |
649b016268bc13a3e2a11c0bd096952308aa0850 | Proga97/ryokou | /Ryokou.py | UTF-8 | 5,404 | 2.765625 | 3 | [] | no_license | import pygame as p
import spritesheet
import math
class Hero(object):
def __init__(self,state):
self.speed=30
self.jumpspeed=35
self.flip=p.transform.flip
self.STATE=state
ss=spritesheet.spritesheet("hero.png")
self.images=ss.images_at([(40,50,179,211),(... | true |
77302395255ea79b969bcaefb73402369bb562e8 | tghack/tg19hack | /pwn/are_you_flippin_kidding_me/src/solve.py | UTF-8 | 3,220 | 2.578125 | 3 | [] | no_license | from pwn import *
flip_count = 0
def find_bit_flips(a, b):
tmp = bytearray(bin(a ^ b)[2:][::-1])
ret = []
#print "a: {}".format(bin(a))
#print "b: {}".format(bin(b))
#print tmp
while True:
try:
i = tmp.index("1")
ret.append(i)
tmp[i] = "0"
e... | true |
81f4b4b97084e7a0258d079dddfe70e710ff2af7 | sxy370921/SemanticMapGeneration | /Code/orig_map.py | UTF-8 | 3,673 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 13 14:58:58 2018
@author: chen
"""
import numpy as np
import cv2
import utils
import trunk
import addObjects
from config import Config
class orig_map(Config):
"""
create the original map without noise and only in the vertical direction
... | true |
2a750306d9a6a487cef2f95ed1c6117726e27560 | ares5221/Data-Structures-and-Algorithms | /03字符串相关/02求解最长回文子串/02EnumCenterPos.py | UTF-8 | 1,130 | 3.640625 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
枚举中心位置
"""
def Longpalindrome2(src, slen):
if slen == 0:
return None
if slen == 1:
return src
max_length = 0
palindromic = ''
for i in range(slen):
x = 1 # 回文串长度为奇数
while (i - x) >= 0 and (i + x) < slen:
i... | true |