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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7ce187387c512063ada37d268226e5e229427071 | Python | akrs3/Python-para-Jornalistas | /ModuloIII/aula3.py | UTF-8 | 893 | 4.46875 | 4 | [] | no_license | #FUNCOES E BIBLIOTECAS PYTHON
#link da documentacao das bibliotecas: https://docs.python.org/3/library/
def hello(nome):
#nome = input('Digite aqui seu nome:')
print('Olá ' + nome)
hello('Kelly')
print(len('Anne'))
hello()
seu_nome = input ('Digite seu nome:')
hello(seu_nome)
def primeiro_nome(nome_compl... | true |
483946d4c5751bbaaec46ed4831b4222b1cfc019 | Python | itsolutionscorp/AutoStyle-Clustering | /all_data/exercism_data/python/kindergarten-garden/5c6888904aa74c448db53b0bc22dbb86.py | UTF-8 | 512 | 3.40625 | 3 | [] | no_license | # garden.py
plantList= { 'G': 'Grass', 'C': 'Clover', 'R': 'Radishes', 'V': 'Violets' }
class Garden:
def __init__(self, gardenDef,
students=['Alice', 'Bob', 'Charlie', 'David', 'Eve', 'Fred',
'Ginny', 'Harriet', 'Ileana', 'Joseph',
'Kincaid', 'Larry']):
self.gardenDef=gardenDef.split()
... | true |
27b4dd35e1ba221e556946bc099c2c5d5a1dde9f | Python | DavidBohorquez/Codificacion | /Recursividad/er1.py | UTF-8 | 184 | 4 | 4 | [] | no_license | def dig(num):
if(num==0):
return 0
else:
return 1 + dig(num//10)
print("El número de dígitos del número es:", dig(int(input('Ingrese un número: ')))) | true |
651dc466e465e9826d71abd6b8cdc90806b301e9 | Python | bushmusi/python-practise | /Collection types/lambda.py | UTF-8 | 128 | 3.359375 | 3 | [] | no_license | # def x(a): return a+5
# print(x(5))
def myfunc(n):
return lambda a: a * n
mydoubler = myfunc(3)
print(mydoubler(11))
| true |
fd20a3cc1904e85d64f8662f63980ac32e3d7f59 | Python | chengchengXCC/interview_questions | /LintCode/1st_round_fail/460.py | UTF-8 | 1,434 | 3.328125 | 3 | [] | no_license | class Solution:
def getDiff(self, a, b):
if a >= b:
return a - b
else:
return b - a
def findClosest(self, nums, x):
start = 0
end = len(nums) - 1
while start + 1 < end:
mid = start + (end - start) / 2
if nums[mid] == x:
... | true |
ac5c41ad8d5896be2e4034dfd542517cf3e2f0d6 | Python | dhavhid/wordpress-starter-kit | /scripts/setup-wordpress.py | UTF-8 | 2,008 | 2.734375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import sys
import os
import optparse
parser = optparse.OptionParser()
parser.add_option('-n', '--sitename', dest='sitename', help='Site name, i.e. site1,...site5')
# constant params.
db_user = "root"
db_pass = "elmismo"
wp_admin_user = "admin"
wp_admin_password = "admin"
wp_admin_email = "david... | true |
0a614bb237c2ef53f6af19ccba43a5fdd4139604 | Python | GerardoTravesedo/fast-rcnn-object-detection | /object_detection/output/result_generator.py | UTF-8 | 2,410 | 2.65625 | 3 | [] | no_license | import result_analysis.classification_analysis as ca
import dataset.roi_tools as rt
import tools.output_analyzer as oa
# TODO: https://towardsdatascience.com/breaking-down-mean-average-precision-map-ae462f623a52#1a59
class ResultGenerator(object):
def __init__(self, output_folder):
self.class_labels = [... | true |
c6a0486d8b27adb55793b1ba2bab05cb5597d0a8 | Python | bhaskarhunt/OpenCv-Projects | /imagerotation.py | UTF-8 | 915 | 2.84375 | 3 | [] | no_license | #Create a Folder named imagerotation which will contain the images if you want to save
import numpy as np
import cv2, os, glob, random, sys
from matplotlib import pyplot as plt
if len(sys.argv) > 1 :
image = cv2.imread(sys.argv[1])
else :
image = cv2.imread('rotate.jpg')
image_center = (100, 100)
sh... | true |
cbf3463ccdadbbde4e7c8f8c535c227cd38d88fe | Python | Pasewark/Practice-problems | /CrackingCode/chap10/10-3.py | UTF-8 | 695 | 3.1875 | 3 | [] | no_license | def search(A,b):
A.extend(A)
lo=0
hi=len(A)-1
lower=True
mid=(lo+hi)/2
if A[mid]<b:
lo=mid+1
lower=False
elif A[mid]>b:
hi=mid-1
lower=True
else: return mid
while lo<=hi:
mid=(lo+hi)/2
if A[mid]<b:
if lower:
... | true |
d13986e888d5e35cb7cc2f10eeef6d359e6f9578 | Python | gen4438/vtk-python-stubs | /typings/vtkmodules/vtkRenderingCore/vtkAbstractMapper3D.pyi | UTF-8 | 6,382 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | """
This type stub file was generated by pyright.
"""
from .vtkAbstractMapper import vtkAbstractMapper
class vtkAbstractMapper3D(vtkAbstractMapper):
"""
vtkAbstractMapper3D - abstract class specifies interface to map 3D
data
Superclass: vtkAbstractMapper
vtkAbstractMapper3D is an abstrac... | true |
b3cd863b4f219fbd40d6bb31b0baea2b0f6812fd | Python | matuxneo/CursoGit | /personagens.py | UTF-8 | 517 | 2.984375 | 3 | [] | no_license | #!/usr/bin/python
import pygame
pygame.init()
largura = (300,200)
janela = pygame.display.set_mode(largura)
while True:
for evento in pygame.event.get():
if evento.type == pygame.QUIT:
pygame.quit()
exit(0)
janela.fill((0,255,0))
pygame.draw.polygon(janela,(255... | true |
0b455fc9ca64e9a7b67de3142546e5ea887e5694 | Python | KeleiAzz/LeetCode | /Facebook/GraphValidTree.py | UTF-8 | 1,015 | 3.109375 | 3 | [] | no_license | from collections import defaultdict
class Solution(object):
def validTree(self, n, edges):
"""
:type n: int
:type edges: List[List[int]]
:rtype: bool
"""
if len(edges) == 0 and n == 1:
return True
elif len(edges) == 0:
return False
... | true |
1d53979b8e1944601d6f1e36e8fa02d610921a87 | Python | Sumeshks29/feature_selection_project | /q03_rf_rfe/build.py | UTF-8 | 521 | 2.765625 | 3 | [] | no_license | # %load q03_rf_rfe/build.py
# Default imports
import pandas as pd
import numpy as np
data = pd.read_csv('data/house_prices_multivariate.csv')
from sklearn.feature_selection import RFE
from sklearn.ensemble import RandomForestClassifier
# Your solution code here
def rf_rfe(df):
model = RandomForestClassifier()
... | true |
010d25f9f81c0aaee20088d7e7b128ae75606f6a | Python | cyogian/ProjectEuler | /p002/test_p002.py | UTF-8 | 304 | 3.046875 | 3 | [] | no_license | import unittest
from p002 import fib
class TestFib(unittest.TestCase):
def test(self):
self.assertEqual(fib(10), 44)
self.assertEqual(fib(18), 3382)
self.assertEqual(fib(23), 60696)
self.assertEqual(fib(43), 350704366)
if __name__ == '__main__':
unittest.main() | true |
91d558579bd5bcba31d51aadb6c5a07d52cdd89a | Python | JustAidanP/AdventCoding-2018 | /day11-boid.py | UTF-8 | 2,871 | 3.671875 | 4 | [] | no_license | import turtle, random, time, math
from Vector import *
#Defines a Boid object
class Boid:
#------Initialiser------
#Initialises Boid, asking for a position, velocity and acceleration
def __init__(self, position=Vector.zero(), velocity=Vector.zero(), acceleration=Vector.zero(), checkDist=1, checkAngle=270):... | true |
808b476416c2cf2120b6425aa7bbf43a618f4bb6 | Python | garnoth/python | /week5/10.3.py | UTF-8 | 233 | 3.28125 | 3 | [] | no_license | #!/usr/bin/python2
t = [[1,2,3], 3, [1,4,3]]
b = []
def cuml_sum(lst):
#this returns a list of the cumulative sum for the given list
res = []
for i in range(len(lst)):
res.append(sum(lst[0:i+1]))
return res
print cuml_sum(b)
| true |
a9475ba91116326b26a9713da883b8ce2bceaf54 | Python | HIvandic/Umjetna-inteligencija | /3.lab/solution.py | UTF-8 | 10,389 | 2.796875 | 3 | [] | no_license | import sys
import math
class Node:
def __init__(self, value, children, most):
self. value = value
self.children = children
self.most = most
class ID3:
def __init__(self, mode, model, max_depth, num_trees, feature_ratio, example_ratio):
self.mode = mode
s... | true |
7b9e3733b267d9ee94f1f7e39df2f16ba14d0891 | Python | veg/hivclustering | /tests/centrality.py | UTF-8 | 2,535 | 2.734375 | 3 | [] | no_license | #!/usr/bin/env python3
from operator import itemgetter
import json
import csv
import os.path
import nose
import functools
from hivclustering import *
#from networkbuild import *
network = transmission_network()
def setup():
''' Creates a Krackhardt kite and ensures betweenness is correct '''
#Create a trans... | true |
ff9bc6594cd04c0a71f2c3a11bf95ba9e9c36f4c | Python | spkelle2/diet | /diet/schemas/input.py | UTF-8 | 1,922 | 2.96875 | 3 | [] | no_license | """
This module describes the constraints placed on data flowing into the diet engine
"""
from ticdat import TicDatFactory
# define table and column names the engine can expect as inputs
input_schema = TicDatFactory(
categories=[["Name"], ["Min Nutrition", "Max Nutrition"]],
foods=[["Name"], ["Cost"]... | true |
53942909b2b06589b06c45399dad81df13d0a90a | Python | ok2qw66/TIL | /swea/d1/1936.py | UTF-8 | 109 | 2.921875 | 3 | [] | no_license | rsp = {'1':'3', '2':'1', '3':'2'}
a, b = input().split()
if rsp[a] == b:
print('A')
else:
print('B') | true |
dbb1574480286d03e846e729b34d079535135b06 | Python | dannyshafer/Dive-Into-Python-Examples | /chapter_5/5.py | UTF-8 | 248 | 3.625 | 4 | [] | no_license | class Spam:
def __repr__(self):
return "This is a Spam instance"
s = Spam()
print str(s) # Calling str which will call repr
print s.__repr__() # Explicitly calling repr
print s # Implicity Python interpreter will call repr for us
| true |
c75d2a07757fa39c77dcfb7e0508ba959e87c91f | Python | billlyzhaoyh/StillGood | /Resbm_server.py | UTF-8 | 2,265 | 3.0625 | 3 | [] | no_license | import tensorflow as tf
from keras.preprocessing.image import img_to_array
from keras.applications import imagenet_utils
from PIL import Image
import numpy as np
import flask
import io
# initialize our Flask application and the Keras model
app = flask.Flask(__name__)
model = None
def load_model_server():
global mode... | true |
1191708ab81c9e178884f9b922cf0898ee716c08 | Python | KSanjayReddy/Self-Driving-Car-ND | /CarND-Behavioral-Cloning/model.py | UTF-8 | 12,477 | 2.734375 | 3 | [] | no_license | # Henry.X Udacity
import pickle
import numpy as np
import pandas as pd
#import matplotlib.pyplot as plt
#import matplotlib.image as pimg
from sklearn.model_selection import train_test_split
from random import random
from PIL import Image
import os.path
import json
from keras.models import Sequential, Model... | true |
5c96dbf64b77478182bd7f2e372760367601e3c7 | Python | zbmott/golf | /courses/first_course/Hole9.py | UTF-8 | 3,639 | 2.5625 | 3 | [] | no_license |
from pygame import Color, font
from pygame.math import Vector2
from pygame.sprite import LayeredDirty
from src.models import Hole as BaseHole
from src.sprites import *
from src.utils import colors, Point
Hole = BaseHole(
'Hole #9',
par=3,
origin=Point(150, 50, 0),
ball=Point(505, 450, 0),
noncol... | true |
6744a21f16244be98c77f07d85c2fbbfc1fdbc33 | Python | whiteforlonely/com.ake.python.learn | /learn/20180817/test6.py | UTF-8 | 312 | 3.296875 | 3 | [] | no_license | while True:
num = int(input("the score os student:"))
result = "A"
if num >= 90:
result = "A"
elif num >= 80:
result = "B"
elif num >= 70:
result = "C"
elif num >= 60:
result = "D"
else:
result = "E"
print("the student result is ", result)
| true |
6626230fb72f33d6b03cf93868e0e84a0acc6863 | Python | manavdahra/interview-prep | /remove_invalid_paranthesis.py | UTF-8 | 2,601 | 4.3125 | 4 | [] | no_license | """
Remove Invalid Parentheses
Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.
Return all the possible results. You may return the answer in any order.
Input: s = "()())()"
Output: ["(())()","()()()"]
Input: s = "(a)())()"
Outp... | true |
3385df3220297b23afe3a7d244df00a00f9357a2 | Python | benmoseley/FBPINNs | /fbpinns/domains.py | UTF-8 | 6,382 | 2.953125 | 3 | [
"MIT"
] | permissive | """
Defines problem domains
Each domain class must inherit from the Domain base class.
Each domain class must define the NotImplemented methods.
This module is used by constants.py (and subsequently trainers.py)
"""
import jax
import jax.numpy as jnp
import numpy as np
import scipy.stats
from fbpinns import network... | true |
a4d864042f879fc034b63fa825a768c010da909b | Python | MarioZ1204/Programacion_1A | /Corte 1/Carrera Númerica - By Mario Zambrano.py | UTF-8 | 36,115 | 3.359375 | 3 | [] | no_license | import os
from random import randint
# funciones
def validplayers():
global player, cont_par1, cont_par2, cont_par3, cont_par4, cont_ret1, cont_ret2, cont_ret3, cont_ret4, ac_d1, ac_d2, ac_d3, ac_d4, listplayers, player1, player2, player3, player4
listplayers=[]
player1=[]
player2=[]
player3=[]
... | true |
38e48dd22ce0a09628dbe2427678ea32efa435d2 | Python | 39Olivier/test | /fractale.py | UTF-8 | 697 | 3.59375 | 4 | [] | no_license | from turtle import *
import math
from random import uniform
def change_color():
e1 = uniform(0,1)
e2 = uniform(0,1)
e3 = uniform(0,1)
return e1,e2,e3
def tree(s,e1,e2,e3):
if s < 5:
return
square(s,e1,e2,e3)
e1,e2,e3 = change_color()
forward(s)
s1 = s / math.sqrt(2)
lef... | true |
4984ab6500a80822341d721d87ee40a9834d8646 | Python | roian1974/tcf | /guide/src/com/sp_commo/transfer/documentDDTO.py | UTF-8 | 821 | 2.6875 | 3 | [] | no_license | class documentDDTO :
articleID = ""
content = ""
registerDate = ""
def __init__(self):
self.articleID = ""
self.content = ""
self.registerDate = "99999999"
print('EArticle 인스턴스 객체가 메모리에서 생성되었습니다.')
def __init__(self,articleID,content,registerDate):
self.regi... | true |
6f451339fe41c518b79f785eca5f7e090f195e18 | Python | Salaton/datamining | /winestuff/randomforest.py | UTF-8 | 2,048 | 2.78125 | 3 | [] | no_license | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
from sklearn.tree import export_graphviz
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split, RandomizedSearchCV
from sklearn.pipeline import make_pipeline # Cross validation
from sklearn ... | true |
b6b8c5e328422726cb822170ac741616b7a4d924 | Python | JerinPaulS/Python-Programs | /ValidWordAbbriviation.py | UTF-8 | 1,653 | 4.40625 | 4 | [] | no_license | '''
408. Valid Word Abbreviation
Description
Given a non-empty string word and an abbreviation abbr, return whether the string matches with the given abbreviation.
A string such as "word" contains only the following valid abbreviations:
["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1", "w1... | true |
a22aa6fc49154cf75e65700b66ba44329d9e88ec | Python | njayinthehouse/jovial | /src/filestate.py | UTF-8 | 1,542 | 2.671875 | 3 | [] | no_license | # pyre-strict
from typing import Callable, List
from gitwrapper import Repo, bash_check, run
from lang import State
class FileState(Repo):
def __init__(self, path: str, init: bool = False) -> None:
self.name: str = path.split('/')[-1]
super().__init__('/'.join(path.split('/')[:-1]), init... | true |
da74d439a8c1a1a555e68489e37a12b5b8b1040a | Python | jannikisakoolprogrammer/JanniksRaspberryPiWeatherStation | /weatherstation/classes/other/Logger.py | UTF-8 | 346 | 2.96875 | 3 | [] | no_license | import abc
import os
class Logger(object):
def __init__(self,
_filepath):
self.filepath = _filepath
self.setup_file()
def setup_file(self):
self.file_handle = open(
self.filepath,
"a")
def log_message(self, _msg):
self.file_handle.write(_msg + '\n')
self.file_handle.flush()
os.fsync(... | true |
42fb39766ea196f075311c2774693659c73c6203 | Python | alexandraback/datacollection | /solutions_2463486_1/Python/Suphan/fairandsquare.py | UTF-8 | 1,369 | 3.25 | 3 | [] | no_license | import sys
if len(sys.argv) < 3:
print 'input/output file name must be defined.'
exit(1)
def palindrome(n, palins):
if n == 1:
palins += ['0', '1', '2']
return palins
elif n == 2:
palins += ['00', '11', '22']
return palins
pal = palindrome(n - 2, palins)
temp = []
for x in ['0', '1',... | true |
ee162cc1126f26ba2cccdd945ebda15995d6df8c | Python | unKNOWN-G/Coding-Practise | /Contests/CodeChef Contests/June CodeChef Starters 2021/Cyclic Quadrilateral.py | UTF-8 | 213 | 3.296875 | 3 | [] | no_license | # Problem: CYCLICQD Contest: START5B
test_cases = int(input())
for i in range(test_cases):
a,b,c,d = map(int,input().split())
if(a+c==180 and b+d==180):
print("YES")
else:
print("NO") | true |
1bcc146d1b45c644800622ce9624c13056d9d5ae | Python | Blankz1035/Python-AI-Semester2 | /AppliedScripting/regression/linear_regression1.py | UTF-8 | 581 | 3.125 | 3 | [] | no_license | from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
x = np.array([0,1,2,3,4,5])
y = np.array([0,0.9,0.8,0.1,-0.4,-0.8])
x = x[:,np.newaxis]
y = y[:,np.newaxis]
plt.scatter(x,y)
plt.show... | true |
d2d6d49e153b80e7135e2999de18554e19f1cc4a | Python | nutpea01/prime24 | /prime24.py | UTF-8 | 214 | 3.515625 | 4 | [] | no_license | num = 0
while True:
num+=1
div = num
c = 0
while (div > 0):
if ((num % div) == 0):
c+=1
div-=1
if (c == 2):
print(str((num*num)%24) + "\t\t\t\t" + str(num))
| true |
4ecdebd7438ca30b7fe544716e06f65ea0702ad3 | Python | bopopescu/Exercise | /Exercise/src/Celery/test_celery/tasks.py | UTF-8 | 477 | 2.765625 | 3 | [] | no_license | from __future__ import absolute_import
from test_celery.celery import app
import time
@app.task
def longtime_add(x,y):
print('Long time task begins')
time.sleep(5)
print('Long time task finished')
return x+y
'''
You can see that we import the app defined in the previous celery module and use it as a decorator f... | true |
3ccbda7a4218bdbdd4bd8c91d236c2598b3788d1 | Python | olber027/AdventOfCode2017 | /2017/Day 25/Day25_Part1.py | UTF-8 | 2,654 | 3.484375 | 3 | [] | no_license | class TuringMachine(object):
def __init__(self):
self.arr = [0]
self.state = "A"
self.index = 0
def __repr__(self):
result = ""
if self.index < 0:
result += "[0] "
for i in range(len(self.arr)):
if i != self.index:
result +... | true |
dc6960eae6347c90e95e3313bcca0f4064e7a078 | Python | tomevans1122/Machine-Learning-Weather-Data | /creating_new_csv.py | UTF-8 | 1,026 | 3.03125 | 3 | [] | no_license | # Script is not operational - only needed to work once to create the desired csv file
import csv
from pandas import read_csv
import numpy as np
import ast
raw_data = 'weather_raw.csv'
data = read_csv(raw_data)
# for temperature
i = 0
all_temps = []
while i < 359448:
main_dict = ast.literal_eval... | true |
d7f9fdae525c5eaaa458d71173a144eb50b6a3d1 | Python | IchiroYoshida/python_public | /astro/moon/dayevent.py | UTF-8 | 445 | 2.65625 | 3 | [] | no_license | class DayEvent(object):
def day(self,event):
self.index = event.index
self.tname = event.tname
self.mage = event.mage
self.moon_rise = event.moon_rise
self.moon_set = event.moon_set
self.sun_rise = event.sun_rise
self.sun_set = event.sun_set
day1= DayEve... | true |
18f6aef54ce4cfe1bf8a1736665759d9063d7691 | Python | aspilotros/YouTube_views_forecasting | /SH-Plotting.py | UTF-8 | 1,721 | 2.71875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 24 14:51:27 2017
@author: Alessandro
"""
import pandas as pd
import numpy as np
import plotly
import plotly.plotly as py
from plotly.graph_objs import *
#%% Importing the data
df = pd.read_csv("C:/Users/Alessandro/windows-share/Portfolio/DATA/df_views_30d.csv"... | true |
979d8e77126b23da17cdbbeff08f5296f1104585 | Python | schavery/goosefield | /fft | UTF-8 | 8,995 | 3.15625 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Usage: fft [count]
# multiply polynomials with various methods.
# steps.
# 1. make sure the polynomials are the same length
# 2. figure out how many points we need to generate (2d+2)
# 3. get the nth roots of unity
# 4. evaluate both p and q at all of the points
# 4a. th... | true |
296230d88cac025b9e3353b76dd03d13c48126dc | Python | stebulus/gmwbot | /tests/obst/basic/script | UTF-8 | 450 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python
import gmwbot
search = gmwbot.obstguesser(
['a','b','c'],
[1,3,2],
[4,5,1,3])
print 'cost'
for j in range(4):
for i in range(j+1):
print '%2d' % search.cost(i,j),
print
print
print 'root'
for j in range(4):
for i in range(j+1):
print '%2s' % search.root(i,j... | true |
5785e23108d16eca37835e242fe458308a5a81a5 | Python | lliicchh/chips | /python/map.py | UTF-8 | 233 | 3.90625 | 4 | [] | no_license | # d = {} dictionary/set
d = {
"name":"licheng",
"age":12,
}
# 遍历键
for k in d:
print(k)
# 遍历字典的值
for k in d.values():
print(k)
# 遍历字典的键和值
for k, v in d.items():
print(k, " ", v) | true |
e998e60364020021658eb25436b3acaaface7fd5 | Python | Jacks0nJ/PyFPT | /tests/test_lognormality_check.py | UTF-8 | 3,572 | 3.15625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | import unittest
import numpy as np
from pyfpt.numerics import lognormality_check
class TestLognormalityCheck(unittest.TestCase):
def test_lognormality_check(self):
# Using mock bin data, to see if lognormality_check correctly
# identifies lognormal and deviating bins, as well as checking it can
... | true |
56c494170faab84b14453e6f4e6e3c88a6f1b88b | Python | karoberts/adventofcode2016 | /05-1.py | UTF-8 | 353 | 3 | 3 | [] | no_license | import hashlib
key = 'cxdnnyjw'
#key = 'abc'
n = 0
c = 8
password = ''
for i in range(0, c):
while True:
input = key + str(n)
n += 1
md5 = hashlib.md5(bytearray(input, 'utf-8')).hexdigest()
if md5.startswith('00000'):
password += md5[5]
print(n, password)
... | true |
a08ae83dd4038dc55d4812fc6db5574bd0fd71be | Python | 13661892653/workspace | /pyCode/dataMining/createDirAndFile.py | UTF-8 | 413 | 3.125 | 3 | [] | no_license | #coding=utf-8
'''判断是否存在文件夹,不存在则创建对应的文件夹!'''
import os
import shutil
path='F:\pythonTest'
for i in range(1,1000000):
print(path+'\\'+str(i))
isExists = os.path.isdir(path+'\\'+str(i))
print(isExists)
if not isExists:
print(isExists,'不存在!')
os.mkdir(path+'\\'+str(i))
else:
prin... | true |
9a387086106ad7e96a6b553734e60ff08c636c55 | Python | jiekeman/ATM | /core/main.py | UTF-8 | 2,163 | 2.796875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 2019-9-30 14:07
# @Author : Jie Ke Man
# @FileName: main.py
# @Software: PyCharm
# 主逻辑交互程序
from core import account
from core import auth
from core import logger
from core import transaction
# transaction logger
trans_logger = logger.logger('transaction')
# access logger
access_log... | true |
f226f0e0ab7134e588df78def6985d35c360246d | Python | sgtFloyd/project-euler | /21-30/26.py | UTF-8 | 1,480 | 3.65625 | 4 | [] | no_license | # A unit fraction contains 1 in the numerator. The decimal representation
# of the unit fractions with denominators 2 to 10 are given:
#
# 1/2 = 0.5
# 1/3 = 0.(3)
# 1/4 = 0.25
# 1/5 = 0.2
# 1/6 = 0.1(6)
# 1/7 = 0.(142857)
# 1/8 = 0.125
# 1/9 = 0.(1)
# ... | true |
38e41f3674b0f68718189323ad0958becca7b96c | Python | emirhannuz/solar-path-api | /daily_sun_path/Solar.py | UTF-8 | 2,191 | 3.640625 | 4 | [] | no_license | from .math_tools import *
from .datetime_tools import day_of_year
"""
Solar Altitude ve Solar Azimuth değerlerini hesaplayan sınıf
Solar Altitude -> sin(α) = sin(L)sin(δ)+cos(L)cos(δ)cos(h)
α -> Solar Altitude
L -> Local Latitude
δ -> Declination
... | true |
ef916cfb48926644431f192bff138c6412b37c2a | Python | NicolasLagaillardie/Python | /qicksort.py | UTF-8 | 177 | 2.875 | 3 | [] | no_license | def quicksort(t):
from partitionne import partitionne
if len(t)<=1:
return t
else:
t1,t2=partitionne(t[0],t)
print(t1)
print(t2)
return quicksort(t1)+quicksort(t2)
| true |
687fcef695f56aedc748f4bd17f2915f67511e4d | Python | BALAJISB97/DS | /Graph Implementations and Traversals/GraphImplementationUsingList.py | UTF-8 | 2,164 | 3.515625 | 4 | [] | no_license | class vertex:
def __init__(self,id):
self.id=id
self.adjacent={}
self.visited=False
#self.distance=sys.maxint
def getConnections(self):
return self.adjacent.keys()
def getCosts(self,key):
return self.adjacent[key]
def addNeighbour(self,cost... | true |
dcbe46cbadd6f86cf3bddf0c692c4f391602a3ca | Python | somnathbanerjee2020/PythonCode | /mod1.py | UTF-8 | 45 | 2.78125 | 3 | [] | no_license | a='Day'
b='Night'
c='Match'
print(a,b,c) | true |
d7c24de23adbb0effc349443d72a055f9944494b | Python | mongolio/PRNE_practice | /section8.py | UTF-8 | 1,019 | 2.625 | 3 | [] | no_license | import re
with open("devices.txt","r") as source_file:
for device_info_list in [line.split(",") for line in source_file if line]:
device_info = {}
device_info['name'] = device_info_list[0]
ip_search_string = re.compile("Mgmt:([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})")
... | true |
bf238453a7017a71b0ee8961b377227ef045087a | Python | Rejoice202/python-code-dump | /src/lyx/path_generate.py | UTF-8 | 2,418 | 3.0625 | 3 | [] | no_license | """
从所有的图片(及label)中选取一定数量的作为测试集,其余的作为训练集
并导出其路径,保存在txt中
"""
import os
# file = open('/home/yuanxue/deeplearning/kuang_code/datasets/test.txt', 'w')
# img_path = '/home/yuanxue/deeplearning/kuang_code/datasets/test'
#
# for item in os.listdir(img_path):
# if item.endswith('.jpg'):
# filename = os... | true |
5b502deea2b11fff4527e1c96a1126646828a17f | Python | aayushkubb/wav2vec2-indonesian | /datasets/anchor_rsstomp3.py | UTF-8 | 936 | 2.796875 | 3 | [] | no_license | import feedparser
import json
import html2text
fout = open("anchor-mp3.jsonl", "a+")
for url in open("anchor-rss.txt"):
try:
feed = feedparser.parse(url.strip())
entries = feed.entries
if feed.feed["language"] != "in": # Indonesian = in
continue
data = {
"ti... | true |
93ac5d693fdcc5cdb889c16b989fb29fe86e2325 | Python | eselyavka/python | /leetcode/solution_49.py | UTF-8 | 1,009 | 3.390625 | 3 | [] | no_license | #!/usr/bin/env python
import unittest
class Solution(object):
def groupAnagrams(self, strs):
"""
:type strs: List[str]
:rtype: List[List[str]]
"""
d = {}
for s in strs:
ss = ''.join(sorted(s))
try:
d[ss].append(s)
... | true |
a93045301a089aa63250296d3a61f76dfdefab10 | Python | alexandraback/datacollection | /solutions_5634697451274240_0/Python/patrickk/revenge.py | UTF-8 | 402 | 3.03125 | 3 | [] | no_license | #!/usr/bin/env python
import sys
with open(sys.argv[1]) as f:
x = 1
f.readline()
for line in f:
stack = map(lambda i: True if i == '+' else False, line.strip().rstrip('+')[::-1])
result = 0
last = True
for i in stack:
if last != i:
last = i
... | true |
d168ac0b622a8252f9a5e3c3ba8a812268408a6a | Python | Erendrgnl/BlazeFace-tensorflow | /myDataLoader.py | UTF-8 | 3,088 | 2.609375 | 3 | [] | no_license | import tensorflow as tf
import tensorflow_datasets as tfds
import numpy as np
def generate_bboxes_from_landmarks(landmarks):
"""Generating bounding boxes from landmarks.
inputs:
landmarks = (M, total_landmarks, [x, y])
outputs:
bboxes = (M, [y1, x1, y2, x2])
"""
padding = 5e-3
... | true |
ca3682534899ed8755ec7dedb71c7eb3fbd2d8b9 | Python | CSCfi/pebbles-deploy | /container-src/k3s-autoscaler/test_main.py | UTF-8 | 1,322 | 2.71875 | 3 | [] | no_license | import unittest
import utils
class TestStringMethods(unittest.TestCase):
def test_parse_memspec_to_bytes(self):
assert utils.parse_memspec_to_bytes('8MiB') == 8 * 1024 * 1024
assert utils.parse_memspec_to_bytes('8Mi') == 8 * 1024 * 1024
assert utils.parse_memspec_to_bytes('8MB') == 8 * 1... | true |
31ff402a87e4a069d4f4c96009bc81900f170811 | Python | marianopettinati/test_py_imports | /sys_path.py | UTF-8 | 84 | 2.5625 | 3 | [] | no_license | import sys
type(sys.path)
for path in sys.path:
print (path)
print ('---')
| true |
77da9386acfcd240d9ea4dcb8bd4a62d7f460650 | Python | SmellCat/AlgorithmDiagram | /04/ListElementCnt.py | UTF-8 | 471 | 3.328125 | 3 | [] | no_license | # -*- coding:utf-8 -*-
__author__ = "Atituset"
import copy
def listElementCnt(ls):
ls = copy.copy(ls)
if len(ls) == 0:
return 0
elif len(ls) == 1:
return 1
else:
ls.pop()
return 1 + listElementCnt(ls)
if __name__ == '__main__':
a = []
print(listElementCnt(a))... | true |
417fb2bf1b1e26cfa691a5a9c70565de63c02d1a | Python | dframe1997/Honours-Project | /Experiments/Periodic Sentence Detection/Flask App/Canary/helperFunctions.py | UTF-8 | 77 | 2.609375 | 3 | [] | no_license | def cls():
n = 0
while n < 100:
print("\n")
n = n + 1 | true |
1197381140df2aea65e9d9efe0d8eb5a80c6f8a8 | Python | guyhoefakker/pythonpy | /Lessen Opdrachten/les6/pe6_3.py | UTF-8 | 321 | 3.625 | 4 | [] | no_license | invoer = "6-8-3-3-5-7-3-1-9-6-4-8"
lst = invoer.split('-')
print('gesorteerde list van ints: ' + str(lst)+'\ngrootste getal: ' + str(max(lst)) + ' kleinste getal: '+ str(min(lst)))
print('aantal getallen: ' + str(len(lst)))
lst2 =[]
for x in lst:
lst2.append(int(x))
print('gemiddelde: ' + str(sum(lst2)/(len(lst2)))... | true |
33822eed7860ec17037d78c446a8c770dfa5d9a0 | Python | litsynp/cau-anseong-21-spring-festival | /apps/festival/views.py | UTF-8 | 3,733 | 2.578125 | 3 | [] | no_license | from django.http import HttpResponse
from django.template import loader
from django.urls import reverse
def index(request):
template = loader.get_template('festival/index.html')
context = {
'contents': [
{
'name': '방탈출',
'popup': False,
'url'... | true |
0f68afcc4dbf75f0ce7a6cb1d0b77487bbf3c56e | Python | jackychang16/sc-projects | /StanCode_Projects/boggle_game_solver/largest_digit.py | UTF-8 | 1,422 | 4.53125 | 5 | [
"MIT"
] | permissive | """
File: largest_digit.py
Name:
----------------------------------
This file recursively prints the biggest digit in
5 different integers, 12345, 281, 6, -111, -9453
If your implementation is correct, you should see
5, 8, 6, 1, 9 on Console.
"""
def main():
print(find_largest_digit(12345)) # 5
print(find_larg... | true |
b6014514091a7241092a989f463342dffa9c0403 | Python | barbara-abreu/Random_things | /timer.py | UTF-8 | 690 | 3.203125 | 3 | [] | no_license | #!/usr/bin/python3
#Make timer fot ST
import time
import sys
#TODO- Add progress bar
def exercise(duration, intv, num_rounds):
print ('{} {:2d} {}\n'.format("Begin exercise with ", num_rounds, "rounds"))
for i in range(0, num_rounds):
print ('{} {:2d}'.format("Round", i+1))
print ("########... | true |
57786c1a9d2103e715494fabe0df6924302a439f | Python | kaist-plrg/jstar | /tests/compile/basic/recent/CharacterSetMatcher.spec | UTF-8 | 1,011 | 3.078125 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | 1. Return a new Matcher with parameters (_x_, _c_) that captures _A_, _invert_, and _direction_ and performs the following steps when called:
1. Assert: _x_ is a State.
1. Assert: _c_ is a Continuation.
1. Let _e_ be _x_'s _endIndex_.
1. Let _f_ be _e_... | true |
31c690dfd364bcd7eb86d285f071ae6cdc4c2eb8 | Python | CharlesBaudinet/TwitterAnalysis | /twitter_collect/tweet_collect_whole.py | UTF-8 | 748 | 3.234375 | 3 | [] | no_license | def get_candidate_queries(num_candidate, file_path,type):
"""
Generate and return a list of string queries for the search Twitter API from the file file_path_num_candidate.txt
:param num_candidate: the number of the candidate
:param file_path: the path to the keyword and hashtag
files
:param typ... | true |
a03d4f74be2ffa3d196b9a9d1c650b5d52b71749 | Python | charlespetchsy/CSCD01 | /Deliverable5/acceptence_tests/test_copy_modify_save_multiple.py | UTF-8 | 1,022 | 2.859375 | 3 | [] | no_license | import matplotlib.pyplot as plt
import copy
import numpy as np
#test should not crash and the console should be empty
#test that copying and modifying only modifies the modified colormap and not the original
#test will create 4 graphs
#test_copy_modify_save_multiple-original.png and test_copy_modify_save_multiple-un... | true |
518f9c88e65efc885379e886732b774a5d0b615d | Python | akrherz/pals | /cgi-bin/admin/severe2/gen_questions/edit.py | UTF-8 | 1,629 | 2.84375 | 3 | [] | no_license | #!/usr/local/bin/python
# This program changes db stuff
# Daryl Herzmann 8-16-99
import cgi, pg, style, time, string
mydb = pg.connect('severe2', 'localhost', 5432)
def get_question(intval):
entry = mydb.query("SELECT * from intquestions WHERE intval = '"+intval+"' ").dictresult()
return entry
def mk_option(lett... | true |
84d233ab0d8c08a584874ff2d48d261d7bc74341 | Python | CrimsonChin92/PythonForBeginners | /chapter09/Explorer.py | UTF-8 | 5,341 | 4.15625 | 4 | [] | no_license | # Explorer
# Players travel around a land from location to location
import games,random
class Explorer_player(object):
""" A player in the explorer game """
def __init__(self, name, location = "Sea"):
self.name = name
self.location = location
print(self.name,"has landed in",self.loca... | true |
ddb22b95bd106549be5f8bb4579996e67430ebcd | Python | nate-io/python-data-processing | /textHandling/AddField.py | UTF-8 | 957 | 3.171875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 20 11:11:41 2020
@author: nate
Manipulate a group of files by adding a column name
"""
import os
import glob
import pandas
def addField(indir='D:\python-course-files\extracted'):
# go to dir
os.chdir(indir)
# grab list of all files
filenames = glob... | true |
e836141f5d0b17eca76554842742dcfce6fac596 | Python | HarrisonMS/JsChallenges | /Python/codesignal/test1.py | UTF-8 | 1,550 | 4.34375 | 4 | [] | no_license | class Node:
# Function to initialise the node object
def __init__(self, value=None):
self.value = value # Assign value
self.next = None # Initialize next as null
class linked_list:
def __init__(self):
self.head = None
# This function prints contents of linked list
# st... | true |
9126e73251c3713f2ecc045019253f630b45b748 | Python | Acosmosss/Curso_em_Video_Python | /Exercicios/Minhas Soluções(Comentado)/Mundo 1/Desafio 033.py | UTF-8 | 566 | 4.0625 | 4 | [
"MIT"
] | permissive | # dá pra fazer isso bem mais facilmente, mas o objetivo da aula era "ifs" :/.
n1 = int(input('Digite o Primeiro Número: '))
n2 = int(input('Digite o Segundo Número: '))
n3 = int(input('Digite o Terçeiro Número: '))
# verificando maior
if n1 >= n2 and n1 >= n3:
big = n1
if n2 >= n3 and n2 >= n1:
big = n2
if n... | true |
f05d8dc8667ea1de9fe548aad1381f63cf9ce79e | Python | TurtleP/Convert3x | /log.py | UTF-8 | 660 | 2.984375 | 3 | [] | no_license | import time
import inspect
class Log(object):
data = []
@staticmethod
def append(msg):
local_time = time.localtime(time.time())
curr_time = str(local_time.tm_hour) + ":" + str(local_time.tm_min)
frame = inspect.stack()[1][0]
info = inspect.getframeinfo(frame)
name = info.filename.split("/")
nice... | true |
d5b7abb541d37b6a0f2c3e2711fa133098fa3d90 | Python | einsfr/mmkit | /efsw/accounts/utils.py | UTF-8 | 1,640 | 3.390625 | 3 | [] | no_license | from django.contrib.auth.models import User, AnonymousUser
def format_username(user: User=None, username: str=None, first_name: str=None, last_name: str=None):
"""
Function for formatting user representation on pages
:param user: Instance of django.contrib.auth.models.User (if given - overrides all other ... | true |
bbca99c9902cf781f2fd5d1d7d55423c6a6e9c37 | Python | bibekdahal/mainbatti-talika | /RoutineWriter.py | UTF-8 | 1,783 | 2.734375 | 3 | [] | no_license | from xml.etree.ElementTree import Element, SubElement, Comment, ElementTree
from ElementTree_Pretty import prettify
import xml.etree.ElementTree as ElemTree
from RoutineInput import *
from collections import deque
def PrintQueue(queue):
for item in queue:
print(item)
def CreateGroupList(schedule):
queue = deque()... | true |
551663c984f75b012a517ef5e38be363ab23f7c6 | Python | xmaska/skilling-2 | /page_objects/cbd_page.py | UTF-8 | 4,359 | 2.59375 | 3 | [] | no_license | import time
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from page_objects.base_page_object import BasePage
class CbdPage(BasePage):
locator_dictionary = {
"site_header": (By.CSS_SELECTOR, 'a.fill'),
"add_model": (By.ID, 'add'),
"mod... | true |
6dfe456e25c788b6d432f98505150958a935fc49 | Python | JeongHyeon-Kim/Web-Test-Automation-using-Python-and-Selenium | /Basic of Python/name_main_test.py | UTF-8 | 231 | 3.421875 | 3 | [] | no_license | import class_exercise
a = class_exercise.Calculator()
b = class_exercise.Calculator()
a.input_num(4, 2)
b.input_num(3, 7)
print(a.sum())
print(a.mul())
print(a.div())
print(b.sum())
print(b.mul())
print(b.sub())
print(b.div())
| true |
d84777b753243e0bfdab780a448ae109cd9772ce | Python | sailfish009/IEConv_proteins | /IEProtLib/py_utils/py_mol/PyMolIO.py | UTF-8 | 13,942 | 2.6875 | 3 | [
"MIT"
] | permissive | '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
\file PyMolIO.py
\brief Functions to load protein files.
\copyright Copyright (c) 2021 Visual Computing group of Ulm University,
Germany. See the LICENSE file at the top-level directory of
this... | true |
170a2dced3498a1fe0c0c95b1fa412a5d9671c12 | Python | justinkim668/Proccess-Automation-Scripts | /duplicates.py | UTF-8 | 491 | 3.125 | 3 | [] | no_license | import pandas as pd
codes = pd.read_csv('<INSERT FILE DIRECTORY HERE>')
code_duplicate = codes['<COLUMN NAME>']
duplicate_data = codes[code_duplicate.duplicated(keep = False)]
duplicate_data_other = codes[code_duplicate.duplicated(keep = 'first')]
useful_data = duplicate_data[['<COLUMN NAME>', '<COLUMN NAME>', '<COLU... | true |
6f3328726fa9fa1c89ed97942d9e291ecb83a9f0 | Python | KaaVii/Inova_Pedidos | /classes/pedidodao.py | UTF-8 | 7,633 | 2.765625 | 3 | [] | no_license |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Exemplo de CRUD com SQLAlchemy e SQLite3"""
from sqlalchemy.sql import func
from sqlalchemy import Column, Integer, String, create_engine, DateTime, event, DDL, Table, MetaData
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionm... | true |
556a3003506da7ea657ea66a5d2540493fce1f91 | Python | bhavinidata/DataStructuresAndAlgorithms | /ProjectEuler/evenFibbonacciNumbers.py | UTF-8 | 779 | 4.28125 | 4 | [] | no_license | # Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
# By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
... | true |
3d59bf6919945d9fd748acdd8ce391c63364d9a1 | Python | NeoMindStd/CodingLife | /baekjoon/1620py/a.py | UTF-8 | 269 | 2.609375 | 3 | [] | no_license | import sys;read=sys.stdin.readline
n,m=map(int,read().split())
d=t=dict()
for i in range(1,n+1):
d[i]=read()
t[d[i]]=str(i)
r=[]
for i in range(m):
s=read()
try:
s=int(s)
r.append(d[s][:-1])
except:r.append(t[s])
print('\n'.join(r))
| true |
cd4ca16abb67e1d9e6a2a2e03d4c52c61b3309fe | Python | lvn/trii | /tests.py | UTF-8 | 887 | 3.390625 | 3 | [
"MIT"
] | permissive | import unittest
from trii import DecisionTree
class TriiTests(unittest.TestCase):
def test_tree_works(self):
tree = DecisionTree(lambda x: x % 2)
tree.add_child(0, 'even')
tree.add_child(1, 'odd')
self.assertEqual(tree.decide({'x': 5}), 'odd')
self.assertEqual(tree.decide(... | true |
71bb4641c0b73f2388a886b12c4058bb73e1723c | Python | love-adela/algorithm-ps | /acmicpc/11403/11403.py | UTF-8 | 848 | 3.28125 | 3 | [
"MIT"
] | permissive | import sys
def bfs(vertex:int, distance:int):
queue = [vertex]
visited = [False] * N
flag = False
while queue:
vertex = queue.pop(0)
if not visited[vertex]:
visited[vertex] = True
for elem in adjacent[vertex]:
if elem == distance:
... | true |
232c3eed18c89d6d90708b6bf2a01bb373ee883f | Python | afranco07/AddressBook | /database_class.py | UTF-8 | 3,143 | 3.28125 | 3 | [] | no_license | """Class where all the database operations are done"""
import mysql.connector
import time
class DataBaseClass(object):
def __init__(self):
counter = 1
while True:
try:
self.cnx = mysql.connector.connect(
user='root',
password='m... | true |
44b8f1f570c759d978237a376ef307ad884ad299 | Python | trankha1655/CS114_ML | /Assignments/Tuần 1.2 - tăng tốc từ từ/Rut_Gon_Phan_So.py | UTF-8 | 232 | 3.28125 | 3 | [] | no_license | from fractions import *
n = int(input())
for i in range(n):
k, t = [int(x) for x in input().split()]
f = Fraction(k,t)
if f.denominator != 1:
print(f.numerator,f.denominator)
else:
print(f.numerator)
| true |
a20b059a61c1024519b3310f71e82801ce9852dc | Python | haibaosjtu/j_build_occup_det18 | /code/SVR/plot_svm_regression.py | UTF-8 | 793 | 3.078125 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | import numpy as np
from sklearn.svm import SVR
import matplotlib.pyplot as plt
X = np.sort(5 * np.random.rand(40, 1), axis=0)
y = np.sin(X).ravel()
y[::5] += 1 * (0.5 - np.random.rand(8))
X2 = [[1],[2],[3],[4],[5],[6]]
y2 = [0,0,0,1,1,1]
svr_rbf = SVR(kernel='rbf', C=1e2, gamma=0.1)
svr_lin = SVR(kernel='linear', ... | true |
a954d42798eaf8fdc338d5cb608b37c672deba1d | Python | A-Yarrow/PDB_tools | /avg_B.py | UTF-8 | 1,934 | 2.90625 | 3 | [] | no_license | #!/usr/bin/python
def pdbstats():
import math
try:
txt = raw_input("please enter filename: ")
handle = open(txt, "r")
except IOError:
print "Cannot find the file '%s'" %(txt)
else:
print "Found file"
LIG = raw_input("please enter ligand name: ")
... | true |
ad0cb3caa584db75d7377df2b9e5161976b64176 | Python | pfreisleben/Blue | /Modulo1/Aula 12 - CodeLab Dicionário/Exercicio 4.py | UTF-8 | 875 | 4.09375 | 4 | [] | no_license | """ Crie um programa em que 4 jogadores, joguem um dado e tenham resultados
aleatórios. Guarde esses resultados em um dicionário. No final coloque esse dicionário
em ordem, sabendo que o vencedor tirou o maior número no dado. Dicas: procure
sobre a função randint(), sleep() e itemgetter da bliblioteca operator. """
imp... | true |
dd4d3b7da7f087edac5e212c7f4dad6440c22d01 | Python | Gabrieleenx/yumi_dlo_thesis | /controller/src/utils.py | UTF-8 | 18,564 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python3
import numpy as np
import rospy
import tf
class JointState(object):
def __init__(self,\
jointPosition=np.array([1.0, -2.0, -1.2, 0.6, -2.0, 1.0, 0.0, -1.0, -2.0, 1.2, 0.6, 2.0, 1.0, 0.0]),\
jointVelocity=np.zeros(14)):
self.jointPosition = jointPosition # onl... | true |
6f11ba88417725e5dd0a5d9c167d7c98b83e9edb | Python | xrick/Lcj-DSP-in-Python | /dsp_python_imp/Ch06/upsampling.py | UTF-8 | 709 | 3.453125 | 3 | [
"MIT"
] | permissive | import numpy as np
import matplotlib.pyplot as plt
def upsampling( x, method = 1 ):
N = len( x ) * 2
y = np.zeros( N )
if method == 1: # Zero-Order Hold
for n in range( N ):
y[n] = x[int( n / 2 )]
else: # Linear Interpolation
for n in range( N ):
if int( n / 2 ) == n / 2:
y[n] = x[int( n ... | true |
7fbbfbe5f6e99d5c17314d7a0110b08d05ea9747 | Python | namratasiv/Python-Assignments | /Sivakumar_HW1_Ques_1E.py | UTF-8 | 820 | 3.75 | 4 | [] | no_license | # Namrata Sivakumar
# North, South, East, West
import turtle
north_x = 0
north_y = 100
south_x = 0
south_y = -100
west_x = -100
west_y = 0
east_x = 100
east_y = 0
origin_x = 0
origin_y = 0
turtle.goto(north_x, north_y )
turtle.goto(north_x-1, north_y+1)
turtle.write("North")
turtle.goto(origin_x, origin_y)
tu... | true |
bf9684e665c11bb5069bff84a2f1b582eb3b17cd | Python | restran/hacker-scripts | /crypto/rsa/rsa_crack2.py | UTF-8 | 2,174 | 2.984375 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# Created by restran on 2016/9/20
from __future__ import unicode_literals, absolute_import
import primefac
from Crypto.Util.number import inverse
from Crypto.PublicKey import RSA
# TODO n 比较大的时候,会找不出p和q
# TODO 可以使用 yafu 这个工具来爆破p和q
def prime_factor(n):
"""
找出两个素因子p和q,p*q=n
:param n... | true |
272894fcfe8ed7dd8d1e150e5ca9be031d9fa4f4 | Python | v0634/coffee_chatbot | /chatBot.py | UTF-8 | 1,699 | 4.03125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 19:36:16 2020
@author: Venkat
"""
# Define your functions
#general message to print
def print_message():
print('I\'m sorry, I did not understand your selection. Please enter the corresponding letter for your response.')
#to get size of drink user wants
def get_siz... | true |
663cdc1f6e61f6984304e875c8007c0ead168e58 | Python | JunHCha/Algorithm-Practice | /algorithms_in_python/02_implements/4-2.py | UTF-8 | 440 | 3.40625 | 3 | [] | no_license | # 정수 N이 입력되면 00시 00분 00초 부터 N시 59분 59초까지의 모든 시각 중에서 3이 하나라도 포함되는 모든 경우의 수를 구하는 프로그램을 작성하시오
n = int(input())
cnt = 0
for h in range(0, n + 1):
for m in range(0, 60):
for s in range(0, 60):
if "3" in str(h) + str(m) + str(s):
cnt += 1
s += 1
m += 1
h += 1
... | true |