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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f76b3b840b3db0b3d8c980dc620327745383a006 | Python | 17BTEC005/virat-kohli | /rohit sharma.py | UTF-8 | 135 | 3.03125 | 3 | [] | no_license | #multiply 2 no.s
a=10
b=20
c=a*b
print("multiplication of 10 and 20",a,"*",b,"=", c)
| true |
8b1781f3d1abb887e332ddcd453bef5c9b05fa8d | Python | ravitejavemuri/ML-Algorithms | /K-means/k-means.py | UTF-8 | 2,282 | 3.546875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 18 13:13:09 2019
Psudo :
1.Get a Dataset
2.arbitarily choose K centroids in random
3.Assign the closest data points by distance to a centroid/cluster
4.Compute mean of the datapoints in the clusters excluding the centroids
5.The mean would be... | true |
cb74f99d17f6f3e2d592fe812390f6036acfd879 | Python | Elcoss/Python-Curso-em-Video | /Mundo1/desafio6.py | UTF-8 | 159 | 3.59375 | 4 | [] | no_license | n1=int(input('digite seu numero: '))
n2= n1*2
n3= n1*3
n4= n1**(1/2)
print(f'o dobro do seu numero e {n2} o triplo e {n3} a raiz quadrada dele e {n4}')
| true |
e1c8441b35d68c6c440ce5d1359a7d254a953005 | Python | ursho/Project-Euler | /tests/testFibonacciGenerator.py | UTF-8 | 1,217 | 3.625 | 4 | [] | no_license | import unittest
from problems.FibonacciGenerator import FibonacciGenerator
class TestFibonacciGenerator(unittest.TestCase):
def test_Fibonacci(self):
self.assertEqual(0, fibonacci(1))
self.assertEqual(1, fibonacci(2))
self.assertEqual(1, fibonacci(3))
self.assertEqual(2, fibonacci(... | true |
3707c418d6dce0abd30f17853a48ef57190a93fd | Python | j1fig/euler | /16/main.py | UTF-8 | 230 | 2.609375 | 3 | [] | no_license | import sys
import cProfile
def brute(arg):
return reduce(lambda x, y: x + int(y), str(2**arg), 0)
if __name__ == "__main__":
arg = int(sys.argv[1])
def main():
print brute(arg)
cProfile.run('main()')
| true |
cc6979eb902a306740989885480d0063a98bc1fd | Python | SUREYAPRAGAASH09/ArrayQuestions | /25.2ndSmallestNumber/2ndSmallestNumber.py | UTF-8 | 261 | 3.109375 | 3 | [] | no_license | import find_min
def secondsmallestNumber(array):
v = find_min.findMin(array)
for i in array:
if v == i:
array.remove(i)
maxi = find_min.findMin(array)
return maxi
array = [3,1,6,9,3]
print(secondsmallestNumber(array)) | true |
dddccee9cd8d45f0702060530c95388c1656c218 | Python | Catxiaobai/project | /lxd_Safety(out)/graphTraversal-submit2/mymodules/sclexer.py | UTF-8 | 2,844 | 2.671875 | 3 | [] | no_license | # An lexer for simple C Langrage
import lex
#from ply import *
reserved = (
# 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE',
# 'ELSE', 'ENUM', 'EXTERN', 'FLOAT', 'FOR', 'GOTO', 'IF', 'INT', 'LONG', 'REGISTER',
# 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SW... | true |
cad792f0c8f6a47486fa4d6fe971ec48089dbe00 | Python | syurskyi/Python_Topics | /115_testing/_exercises/_templates/temp/Github/_Level_1/Python_Unittest_Suite-master/Python_Unittest_Patch_Methods.py | UTF-8 | 2,885 | 3.46875 | 3 | [] | no_license | # Python Unittest
# unittest.mock � mock object library
# unittest.mock is a library for testing in Python.
# It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.
# unittest.mock provides a core Mock class removing the need to create a host of stu... | true |
7a6db244d6501882789016473d740863701e660a | Python | jcmarsh/drseus | /scripts/socket_file_server.py | UTF-8 | 2,401 | 2.84375 | 3 | [] | no_license | #!/usr/bin/env python3
from socket import AF_INET, SOCK_STREAM, socket
from threading import Thread
from os import remove
def receive_server():
with socket(AF_INET, SOCK_STREAM) as sock:
sock.bind(('', 60124))
sock.listen(5)
while True:
connection, address = sock.accept()
... | true |
e8669d2f92a66e62d55904b67217aba188e06c20 | Python | kevinqqnj/sudo-dynamic-solve | /sudo_recur.py | UTF-8 | 18,986 | 3 | 3 | [
"Apache-2.0"
] | permissive | # coding:utf-8
# python3
# original: u"杨仕航"
# modified: @kevinqqnj
import logging
import numpy as np
from queue import Queue, LifoQueue
import time
import copy
# DEBUG INFO WARNING ERROR CRITICAL
logging.basicConfig(level=logging.WARN,
format='%(asctime)s %(levelname)s %(message)s')
# format='%(as... | true |
c93277bff968a3ad0d5f66d03d54812ead49a4bf | Python | ajleeson/Self-Driving-Car-Simulation | /Algorithm/track.py | UTF-8 | 1,811 | 3.46875 | 3 | [] | no_license | class Track():
"""creates the tracks for all of the cars"""
# makes sure pixel resolution is high
def __init__(self, rows, cols, width, height, timeStep):
self.rows = rows # number of horizontal lanes
self.cols = cols # number of vertical lanes
self.width = width # pixels wides
... | true |
5a89d53a45a842faa0f9d05d78b2e45f98841e81 | Python | rizwan2000rm/interview-prep | /Python/DS/tuple.py | UTF-8 | 381 | 4.4375 | 4 | [
"MIT"
] | permissive | # Tuples are immutable
print("============ tuples ============")
print()
tuples = (12345, 54321, 'hello!')
print(tuples)
u = tuples, (1, 2, 3, 4, 5)
print(u)
# The statement t = 12345, 54321, 'hello!' is an example of tuple packing:
# the values 12345, 54321 and 'hello!'
# are packed together in a tuple. The revers... | true |
83b08e56b1c76fbe0d232cfd74b5e55a6ba091d2 | Python | CashFu/selenium3Fu | /seleium3/selenium_lfj/find_element.py | UTF-8 | 836 | 2.59375 | 3 | [] | no_license | #coding=utf-8
from util.read_ini import ReadIni
class FindElement():
def __init__(self,driver):
self.driver = driver
def get_element(self,key):
read_ini = ReadIni()
data_ini = read_ini.get_value(key)
by = data_ini.split('>')[0]
value = data_ini.split('>')[1]
... | true |
3291ec6e6d7d563367a61be37d23a743077a9ad7 | Python | poweihuang17/practice_leetcode_and_interview | /Leetcode/Greedy/757_Set_Intersection_Size_At_Least_Two.py | UTF-8 | 1,200 | 3.296875 | 3 | [] | no_license | class Solution(object):
def intersectionSizeTwo(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: int
"""
intervals.sort()
filtered_intervals=[]
#print intervals
for interval in intervals:
while filtered_intervals and filtered_int... | true |
57c24a8a95e689732d67e4281cc5dbcb69a729d3 | Python | git208/AutoFrameRegressionTestF10 | /common/test_cases_select.py | UTF-8 | 3,230 | 2.703125 | 3 | [] | no_license | import json
import os
from common.yaml_RW import YamlRW
from config.logConfig import LogCustom,logging
from common.parse_excel import ParseExcel
def testCaseSelect(file,file_type='excel',
testcase_matching=None,
sheet_names=None,
isFuzzy=False,
... | true |
6b916309205853e112e1ce746da8af660b2ea869 | Python | francosbenitez/unsam | /04-listas-y-listas/01-debugger/debugger.py | UTF-8 | 1,073 | 4.28125 | 4 | [] | no_license | """
Ejercicio 4.1: Debugger
Ingresá y corré el siguiente código en tu IDE:
def invertir_lista(lista):
'''Recibe una lista L y la develve invertida.'''
invertida = []
i=len(lista)
while i > 0: # tomo el último elemento
i=i-1
invertida.append (lista.pop(i)) #
return invertida
l ... | true |
1493757adaaa0918e76b211c85051a989bd94c95 | Python | pdekeulenaer/sennai | /simulation.py | UTF-8 | 1,035 | 3.03125 | 3 | [] | no_license | import game, population
import random
# config parameters
# Population
n_cars = 10
start = (50,50)
# Brain
layers = 10
neurons = 20
# evolution
mutation_rate = 0.10
parents_to_keep = 0.33
# generate the brains
# brains = []
# for i in range(0, n_cars):
# seed = random.random()
# brains += [population.NeuronBr... | true |
59acb29b1e14e36b1c69230bfc320e122295e66f | Python | jeremyperthuis/UVSQ_BioInformatique | /td2/pgm8.py | UTF-8 | 241 | 3.609375 | 4 | [] | no_license | sq1 = raw_input("inserer une sequence ADN :")
i=0
n=len(sq1)-1
x=0
while i<n :
if sq1[i]==sq1[n] :
x=x+1
i=i+1
if x == (len(sq1)-1)/2 :
print "cette sequence est un palindrome"
else :
print"cette sequence n'est pas un palindrome"
| true |
1b276b69af3d8b7c304ffbfee9d891bb2a5fc6c7 | Python | wadimiusz/hseling-repo-diachrony-webvectors | /hseling_lib_diachrony_webvectors/hseling_lib_diachrony_webvectors/algos/global_anchors.py | UTF-8 | 2,582 | 3.140625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import gensim
import numpy as np
import copy
from tqdm.auto import tqdm
from utils import log, intersection_align_gensim
from gensim.matutils import unitvec
class GlobalAnchors(object):
def __init__(self, w2v1, w2v2, assume_vocabs_are_identical=False):
if not assume_vocabs_are_identical:
w2v1,... | true |
7bde88600f52f45f9e8b1f99707aa6a01e719b72 | Python | PAVANANUTHALAPATI/python- | /range.py | UTF-8 | 88 | 3.296875 | 3 | [] | no_license | pav=int(raw_input())
if pav in range (1,10):
print("yes")
else:
print("no")
| true |
97b0a68ee463f34a5ef2d2d429dad41b49121f51 | Python | GPUOpen-Drivers/llpc | /script/gc-amdvlk-docker-images.py | UTF-8 | 4,235 | 2.8125 | 3 | [
"MIT",
"Apache-2.0",
"NCSA"
] | permissive | #! /usr/bin/env python3
"""Script to garbage collect old amdvlk docker images created by the public CI on GitHub.
Requires python 3.8 or later.
"""
import argparse
import json
import logging
import subprocess
import sys
from collections import defaultdict
from typing import Any, Dict, List, Optional, Tuple
def _run... | true |
d710863243bb183e1be2960d5b8fc0b1602a7756 | Python | Dhirajpatel121/IPL-Predictive-Analytics | /IPL/MIvsCSK.py | UTF-8 | 7,233 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings; warnings.simplefilter('ignore')
get_ipython().run_line_magic('matplotlib', 'inline')
# In[2]:
deliveries = pd.read_csv('C:/Users/SONY/Desktop/IPL/deliveries... | true |
3541096c6c8edd5bcc12e74e32dadbffe14fcc02 | Python | helsinkithinkcompany/wide | /FennicaTrends/serious-spin-master/data/python/countRelativeWeights.py | UTF-8 | 1,828 | 2.890625 | 3 | [
"MIT"
] | permissive | import json, sys
from math import pow
# FILE HANDLING #
def writeJsonToFile(json_data, file_path):
try:
with open(file_path, 'w') as outfile:
json.dump(json_data, outfile)
return True
except Exception as e:
print(e)
print('Failed to dump json to file ' + file_path)
return False
def getJsonFromFile(fil... | true |
66f5a6d7bef3707c974e3210da2db94f6e393a4a | Python | schuCS50/CS33a | /finalproject/games/cards/models.py | UTF-8 | 4,162 | 2.703125 | 3 | [] | no_license | from django.contrib.auth.models import AbstractUser
from django.db import models
# Extended user class
class User(AbstractUser):
def __str__(self):
return f"User {self.id}: {self.username}"
# Two Player Game extendable
class TwoPlayerGame(models.Model):
player1 = models.ForeignKey(User,
... | true |
20ed11ef0f52d20c8f5abfc8c2e88cd5aa19a6d4 | Python | alaalial/relancer-artifact | /relancer-exp/original_notebooks/pavansubhasht_ibm-hr-analytics-attrition-dataset/imbalanceddata-predictivemodelling-by-ibm-dataset.py | UTF-8 | 19,857 | 3.390625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
# coding: utf-8
# # IBM HR Employee Attrition & Performance.
# ## [Please star/upvote in case you find it helpful.]
# In[ ]:
from IPython.display import Image
Image("../../../input/pavansubhasht_ibm-hr-analytics-attrition-dataset/imagesibm/image-logo.png")
# ## CONTENTS ::->
# [ **1 ) Expl... | true |
1b75c4e46d9e350474eef9c2c62b0a8be7811c3f | Python | CapAsdour/code-n-stitch | /Password_strength_Checker/output.py | UTF-8 | 384 | 3.5 | 4 | [
"MIT"
] | permissive | import re
v=input("Enter the password to check:")
if(len(v)>=8):
if(bool(re.match('((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{8,30})',v))==True):
print("Good going Password is Strong.")
elif(bool(re.match('((\d*)([a-z]*)([A-Z]*)([!@#$%^&*]*).{8,30})',v))==True):
print("try Something strong... | true |
8c42b2cb1e91f49b57b8b67eda41cea9289907e8 | Python | wmm1996528/movie | /maoyan.py | UTF-8 | 3,578 | 2.734375 | 3 | [] | no_license | import requests
from pyquery import PyQuery as pq
import re
import time
import pymongo
from movie_douban import HotMovie
class mongdbs():
def __init__(self):
self.host = '127.0.0.1'
self.port = 27017
self.dbName = 'maoyan'
self.conn = pymongo.MongoClient(self.host, self.port)
... | true |
72bd060c16cf2e8034334c0643533764f52687d6 | Python | vvilq27/Python_port_OV7675 | /port/busCheck.py | UTF-8 | 1,977 | 2.625 | 3 | [] | no_license | import time
import serial
from serial import Serial
import os
import re
import numpy as np
from matplotlib import pyplot as plt
a = list()
t = []
pic = [ ['00' for i in range(320)] for j in range(240)]
s = serial.Serial('COM8', 2000000)
while b"\r\n" not in s.readline():
pass
c = 0
while True:
l = s.readline()... | true |
0c466cb695f150472a3e3494053fe474d629708b | Python | bluecube/heating | /db_net/registers.py | UTF-8 | 6,678 | 2.796875 | 3 | [] | no_license | import numpy
import re
import itertools
import struct
import db_net
def group(lst, n):
"""group([0,3,4,10,2,3], 2) => iterator
Group an iterable into an n-tuples iterable. Incomplete tuples
are discarded e.g.
>>> list(group(range(10), 3))
[(0, 1, 2), (3, 4, 5), (6, 7, 8)]
from http://code.ac... | true |
4857fe4164e37c4dd73b20c5d7278b92bac48458 | Python | SchoofsEbert/ASTinPython | /AST.py | UTF-8 | 586 | 2.921875 | 3 | [] | no_license | import ast
import astor
class AST:
def __init__(self, filename, transformer):
self.filename = filename
with open(filename, "r") as source:
self.AST = ast.parse(source.read())
self.transformer = transformer
def transform(self):
self.transformer.visit(self.AST)
... | true |
d1a665d626b2aa17707165e080d4fe699022d763 | Python | shlampley/learning | /learn python/fizz_buzz3.py | UTF-8 | 1,604 | 3.9375 | 4 | [] | no_license |
number = 0
variables = ""
def fizz_buzz(num, var):
fizzarray = []
# doneTODO: Create an empty array outside the loop to store data
var = variables
num = number
while num < 100:
# Reset var to prevent issues of adding buzz to buzz or buzz to fizzbuz
var = ""
#print(num)
... | true |
736d96574422b7b00e7b8756628dcf418e473476 | Python | inhyuck222/python-ch2.4 | /for.py | UTF-8 | 990 | 4.375 | 4 | [] | no_license | # 반복문
a = ['cat', 'cow', 'tiger']
for animal in a:
print(animal, end=' ')
else:
print('')
# 복합 자료형을 사용하는 for문
l = [('루피', 10), ('상디', 20), ('조로', 30)]
for data in l:
print('이름: %s, 나이: %d' % data)
for name, age in l:
print('이름: {0}, 나이: {1}'.format(name, age))
l = [{'name': '루피', 'age': 30}, {'name'... | true |
f66dd9735cfdcffa7c2070e219d517ff72496676 | Python | queenie0708/Appium-Python | /alipay.py | UTF-8 | 1,075 | 2.59375 | 3 | [] | no_license | from appium import webdriver
import threading
from appium.webdriver.common.touch_action import TouchAction
from time import sleep
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '9'
desired_caps['deviceName'] = 'PDP'
desired_caps['appPackage'] = 'com.eg.android.AlipayGphone... | true |
99636db6bcf420043a9a2c894ebfd7f9fbbb8042 | Python | YOODS/rovi_utils | /mesh_aid/samples/degraded.py | UTF-8 | 1,987 | 3.265625 | 3 | [] | no_license | import open3d as o3d
import numpy as np
def degraded_copy_point_cloud(cloud, normal_radius, n_newpc):
"""
与えられた点群データからPoisson表面を再構成し、頂点データからランダムに点を取り出して
新たな点群を作成する.
Parameters
----------
cloud : open3d.geometry.PointCloud
入力点群
normal_radius : float
法線ベクトル計算時の近傍半径(Poisson表面... | true |
94946ebf1eada337cbf53b95fa700d32e8c8d9a6 | Python | HesterXu/Home | /Public/api/api_03_天气接口.py | UTF-8 | 437 | 2.53125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 2018/12/3/16:15
# @Author : Hester Xu
# Email : xuruizhu@yeah.net
# @File : api_03_天气接口.py
# @Software : PyCharm
import requests
weather_url_1 = 'http://t.weather.sojson.com/api/weather/city/101030100'
weather_res_1 = requests.get(weather_url_1)
print(weather_res_1)
pr... | true |
e3e53969c31c9d312829564901ad8861c6e11f72 | Python | yhshu/OpenKE-Embedding-Service | /freebase_embedding_server.py | UTF-8 | 6,993 | 2.578125 | 3 | [] | no_license | import numpy as np
import datetime
from flask import Flask, request, jsonify, json
class FreebaseEmbeddingServer:
dir_path: str
entity_to_id: dict # entity mid -> entity id
relation_to_id: dict
entity_vec: np.memmap
relation_vec: np.memmap
dim: int # embedding dimension for each entity or re... | true |
50dcf5643d28de1a3059967341b2a596ed7b40fa | Python | rohanaggarwal7997/Studies | /Python new/inheritance.py | UTF-8 | 318 | 3.578125 | 4 | [] | no_license | class Parent:
def printlastname(self):
print('Aggarwal')
class Child(Parent): #inherited Parent class
def print_name(self):
print('Rohan')
def printlastname(self): #overwriting parent function
print('Aggar')
bucky=Child()
bucky.print_name()
bucky.printlastname() | true |
0a60ed50abd1dcb8af906bf377beeed159d4e47f | Python | thautwarm/gkdtex | /gkdtex/wrap.py | UTF-8 | 859 | 2.5625 | 3 | [
"MIT"
] | permissive | import warnings
warnings.filterwarnings('ignore', category=SyntaxWarning, message='"is" with a literal')
from gkdtex.parse import *
from gkdtex.lex import *
_parse = mk_parser()
def parse(text: str, filename: str = "unknown"):
tokens = lexer(filename, text)
status, res_or_err = _parse(None, Tokens(tokens))
... | true |
13c7664efff8eb0ab25d6dd0f8e73e276b631438 | Python | andreiqv/rotate_network | /make_data_dump.py | UTF-8 | 3,182 | 2.78125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path
import sys
from PIL import Image, ImageDraw
import _pickle as pickle
import gzip
import random
import numpy as np
np.set_printoptions(precision=4, suppress=True)
def load_data(in_dir, shape=(540,540,1)):
img_size = shape[0], shape[1]
data = d... | true |
9594b96038df1f0d2c02de4bbf9ca543ed97ab5c | Python | MiguelAbadia/TIC-Abad-a | /Programms Python/ejercicio8.py | UTF-8 | 198 | 3.40625 | 3 | [] | no_license | def ejercicio8():
n=input("Dime un numero entero positivo")
if n>0:
print "Los cuadrados son",n,n*n,n*n*n,n*n*n*n
else:
print "Eso es negativo"
ejercicio8()
| true |
ad3b213de470c3a58659c325ac83fb9671b5ebf8 | Python | segimanzanares/acs-djangoapi | /src/shows/serializers.py | UTF-8 | 1,764 | 2.546875 | 3 | [] | no_license | from rest_framework import serializers
from shows.models import Show, Episode
from django.utils import timezone
import os
class EpisodeSerializer(serializers.ModelSerializer):
class Meta:
model = Episode
fields = ('id', 'show', 'title', 'description', 'cover')
def create(self, validated_data):... | true |
2792d988960038d69fa8cf4df7c84be7733a9751 | Python | TangleSpace/swole | /swole/core/application.py | UTF-8 | 3,849 | 2.78125 | 3 | [] | no_license | import os
import enum
from typing import Dict
from fastapi import FastAPI
from starlette.responses import FileResponse
import uvicorn
from swole.core.page import Page, HOME_ROUTE
from swole.core.utils import route_to_filename
from swole.widgets import Widget
SWOLE_CACHE = "~/.cache/swole" #: Default directory ... | true |
6adaa62ac1986dcd4d811aeec82cad429178a601 | Python | chen19901225/SimplePyCode | /SimpleCode/PY_CookBook/chapter11/1_http_simple_get.py | UTF-8 | 189 | 2.6875 | 3 | [] | no_license |
import urllib
url='http://www.baidu.com'
params=dict(name1='value1',name2='value2')
querystring=urllib.urlencode(params)
u=urllib.urlopen(url+'?'+querystring)
resp=u.read()
print resp
| true |
02087c6ead589bf24ddcbcd6f0309fa0df9bf0cd | Python | andoniabedul/cmd-cryptocurrency-watcher | /services/Ticket.py | UTF-8 | 2,456 | 2.703125 | 3 | [
"MIT"
] | permissive | import json
#from helpers.format_response import exchanges as format_response
from helpers.messages import messages as messages
from api.call import exchanges as api_call
class Ticket:
def __init__(self, base_pair, pair):
self.base_pair = base_pair
self.pair = pair
self.exchanges = ['coinbase', 'bitfinex... | true |
e3c5999afa33a13d1a3271b55e648f365694c35e | Python | luckydimdim/grokking | /in_place_reversal_of_a_linked_list/reverse_every_k_element_sub_list/main.py | UTF-8 | 3,388 | 4.125 | 4 | [] | no_license | from __future__ import print_function
class Node:
def __init__(self, value, next=None):
self.value = value
self.next = next
def print_list(self):
temp = self
while temp is not None:
print(temp.value, end=" ")
temp = temp.next
print()
def reverse_every_k_elements2(head, k):
'''... | true |
252753f358e2106a377fe0abd8311512c351cc0d | Python | znorm/Euler | /006.py | UTF-8 | 221 | 3.796875 | 4 | [] | no_license | sumofsquares = 0
squareofsum = 0
for x in range(1,101):
sumofsquares = sumofsquares + (x**2)
squareofsum = squareofsum + x
squareofsum = squareofsum ** 2
print( squareofsum - sumofsquares)
#269147
| true |
28ea5a719de789bf35197e427659db6fbe96093a | Python | AndersonHJB/PyCharm_Coder | /Coder_Old/pycharm_daima/爬虫大师班/插件合集/参数转换/headers_app.py | UTF-8 | 468 | 3.203125 | 3 | [] | no_license | import re
def headers_to_dict(data):
global headers
for value in data:
try:
hea_data = re.findall(r'(.*?): (.*?)\n', value)[0]
headers.setdefault(hea_data[0], hea_data[1])
except IndexError:
hea_data = value.split(': ', 1)
headers.setdef... | true |
9d03c8b7f3b90341d68c9b4d8e4a99f9863befb9 | Python | Eric-cv/QF_Python | /day2/input_demo.py | UTF-8 | 638 | 4.125 | 4 | [] | no_license | # 输入:input()
#name = input()
#print(name)
#name = input('请输入你的名字:') #阻塞式
#print(name)
'''
练习:
游戏:捕鱼达人
输入参与游戏者用户名
输入密码:
充值: 500
'''
print('''
*********************
捕鱼达人
*********************
''')
username = input('请输入参与游戏者的用户名:\n')
password = input('输入密码:\n')
print('%s请充值才能进入游戏\n' %username)
coins =... | true |
d41df6088fd195dc8263760aeef440c05b77b30a | Python | AngieGD/MCTS_Juego_uno | /TicTacToe/juegoAlternativa.py | UTF-8 | 3,936 | 3.5625 | 4 | [] | no_license |
import numpy as np
import pandas as pd
from os import system
class Table():
def __init__(self):
self.table = [[' ',' ',' '],
[' ',' ',' '],
[' ',' ',' ']]
def getMoves(self):
moves = []
for x in range(3):
for y in range(3):
... | true |
52de409311d4836172986571fec8825b316f644d | Python | mithem/serverly | /test_utils.py | UTF-8 | 6,154 | 3 | 3 | [
"MIT"
] | permissive | import pytest
import serverly.utils
from serverly.utils import *
def test_parse_role_hierarchy():
e1 = {
"normal": "normal",
"admin": "normal"
}
e2 = {
"normal": "normal",
"admin": "normal",
"staff": "admin",
"root": "staff",
"god": "staff",
}
... | true |
e3c75609405865a1b44c1a4c295c56e6027268a9 | Python | coy0725/leetcode | /python/405_Convert_a_Number_to_Hexadecimal.py | UTF-8 | 848 | 3.03125 | 3 | [
"MIT"
] | permissive |
class Solution(object):
def toHex(self, num):
"""
:type num: int
:rtype: str
"""
if num == 0:
return '0'
# letter map
mp = '0123456789abcdef'
ans = ''
for _ in range(8):
# get last 4 digits
# num & 1111b
... | true |
0c1c2070bd92dca3273bc5db8f336d924f16755a | Python | lollyxsrinand/ChristmasGame | /main.py | UTF-8 | 3,190 | 3.4375 | 3 | [] | no_license | import math
from random import randint
import pygame as pg
from pygame import mixer as mx
""" INITIALISING PYGAME """
pg.init()
""" CREAITNG SCREEN """
screen = pg.display.set_mode((800, 600))
""" BACKGROUND MUSIC """
# mx.music.load('lofi_background.wav')
# mx.music.set_volume(0.8)
# mx.music.play(-1)... | true |
57d5f1d8de021f5a9aee01fb1af5d80bb2bf811d | Python | ddannenb/sentence-transformers | /examples/training_quora_duplicate_questions/application_Information_Retrieval.py | UTF-8 | 3,060 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | """
This is an interactive demonstration for information retrieval. We will encode a large corpus with 500k+ questions.
This is done once and the result is stored on disc.
Then, we can enter new questions. The new question is encoded and we perform a brute force cosine similarity search
and retrieve the top 5 question... | true |
f07a84f01826b5b7d196bcedeaf3f7cfc1802d30 | Python | WolfireGames/overgrowth | /Libraries/freetype-2.12.1/builds/meson/extract_freetype_version.py | UTF-8 | 2,997 | 3 | 3 | [
"FTL",
"GPL-1.0-or-later",
"BSD-3-Clause",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain",
"GPL-3.0-only",
"LicenseRef-scancode-unknown",
"Zlib",
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | #!/usr/bin/env python3
#
# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this fil... | true |
b5043ccef979bc25c293b102dbcd993d3c1b5ef5 | Python | Maxpa1n/modules_pytorch | /models/MAML-wave/learnmodel.py | UTF-8 | 1,275 | 2.796875 | 3 | [] | no_license | import torch
import torch.nn as nn
from torch.nn import functional as F
class Compute(nn.Module):
def __init__(self, hid_dim):
super(Compute, self).__init__()
self.input_layer = nn.Linear(1, hid_dim)
# self.hid_layer = nn.Linear(hid_dim, hid_dim)
self.output_layer = nn.Linear(hi... | true |
8e779cf6391028a37be8cb20c5b01c587ab0362c | Python | MohammadAsif206/BankAPI-Pzero | /ProjectZero/services/account_service.py | UTF-8 | 1,366 | 2.765625 | 3 | [] | no_license |
from abc import ABC, abstractmethod
from entities.account import Account
class AccountService(ABC):
# General CRUD functionality
@abstractmethod
def create_account_by_customer_id(self, account: Account, customer_id: int):
pass
@abstractmethod
def retrieve_all_accounts_by_cid(self, custome... | true |
8def9170ec61069e564024dd50482b1f999e365d | Python | rosechellejoy/cmsc128-ay2015-16-assign001-py | /oraa_pa.py | UTF-8 | 7,813 | 3.484375 | 3 | [] | no_license | """
Rosechelle Joy C. Oraa
2013-11066
CMSC 128 AB-3L
"""
import sys
"""
numToWords() accepts an input number and outputs its equivalent in words
temp_num : input by the user
"""
def numToWords(temp_num):
if len(temp_num)>7: #if number inputed is greater than 7 digits: invalid
print 'Invalid: input can o... | true |
499c8883c63e328da19afada8b240fd244c777d8 | Python | tushargupta14/compositional_semantics | /create_fastText_dict2.py | UTF-8 | 2,091 | 2.78125 | 3 | [] | no_license | import json
from collections import defaultdict
def create_dictionaries(path_to_files):
print "Creating Dictionaries"
count = 0
source_fastText_dict = defaultdict(list)
with open(path_to_files+"source_fastText_output.txt","r") as source_file:
for line in source_file :... | true |
a819b7c9b02372e48784b4ddced181e7c151cb7b | Python | jack-mcivor/afl-predictor | /afl/models.py | UTF-8 | 4,931 | 3.0625 | 3 | [] | no_license | from collections import defaultdict
from math import exp, log
import pandas as pd # optional
class Elo:
"""Base class to generate elo ratings
Includes the ability for some improvements over the original methodology:
* k decay: use a higher update speed early in the season
* crunch/carryover... | true |
48f064838cbf993b4e54813f86f3344080368bf9 | Python | noahwang07/python_start | /fresher_class.py | UTF-8 | 419 | 3.734375 | 4 | [] | no_license | class Human(object):
def __init__(self, name):
self.name = name
def walk(self):
print (self.name + " is walking")
def get_name(self):
return (self. name)
def set_name(self, name):
if len(name) <= 10:
self.name = name
human_a = Human("alan")
print (human_a.name)
human_a.set_name('bob')
prin... | true |
903f20ef4856582979bf4e1ec40019d250d83726 | Python | owns/pycleverclicker | /packages/pymybase/myjson2csv.py | UTF-8 | 26,036 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Elias Wood (owns13927@yahoo.com)
2015-04-13
a class for simplifying flattening json (dict) objects - not just top level!
"""
import os
from csv import writer as csv_writer
from csv import QUOTE_MINIMAL as csv_QUOTE_MINIMAL
from csv import QUOTE_ALL as csv_QUOTE_ALL
from csv import QUOTE_NON... | true |
034d2bdd2f39fec0236727c740ed0d7803a51c86 | Python | silky/bell-ppls | /env/lib/python2.7/site-packages/observations/r/polio_trials.py | UTF-8 | 2,671 | 2.53125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def polio_trials(path):
"""Polio Field Trials Data
The data frame `Pol... | true |
d0cfa366f1a98a1e0298f2242e6532c991c47f08 | Python | wothard/neteasefloat | /music_hot_cato.py | UTF-8 | 2,536 | 2.859375 | 3 | [] | no_license | #!/usr/bin/env python
# encoding: utf-8
import urllib
import re
import threading
import requests
import Queue
import pygal
province = []
injuries = []
class GetAllcolum(threading.Thread):
"""获取分类标签的所有歌单"""
def __init__(self, queue):
threading.Thread.__init__(self)
self.queue = queue
se... | true |
d0798bbdffac2cdadf868d3f9fb3123297fa0889 | Python | v1ztep/pizza_TG_bot | /cache_menu.py | UTF-8 | 2,364 | 2.515625 | 3 | [
"MIT"
] | permissive | import json
import os
from dotenv import load_dotenv
from connect_to_redis_db import get_database_connection
from moltin import get_all_categories
from moltin import get_image
from moltin import get_products_by_category
def get_categories_id(moltin_token, moltin_secret):
categories_id = {}
all_categories = ... | true |
11833cbfcac8db0e35105a4eb15241453f36d8a4 | Python | tianshanghong/huobi-1 | /huobitrade/datatype.py | UTF-8 | 13,344 | 2.515625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/6/13 0013 16:36
# @Author : Hadrianl
# @File : datatype.py
# @Contact : 137150224@qq.com
import pandas as pd
from .service import HBRestAPI
from .utils import PERIOD, DEPTH, logger
from itertools import chain
__all__ = ['HBMarket', 'HBAccount', 'HB... | true |
7ed0f42766d47e5916a002d8ff624bc088c709d7 | Python | cdprf/tools | /web/smallcrawl.py | UTF-8 | 469 | 3.25 | 3 | [] | no_license | #!/usr/bin/python
import urllib2
site = raw_input("site : ") # http://www.google.com/ ---> this must be in this form
list = open((raw_input("list with folders : "))) # a textfile , one folder/line
for folder in list :
try :
url = site+folder
urllib2.urlopen(url).read()
msg = "[-] folder " + ... | true |
32214d2c57ba6633f2285e133c22c295f22e4cf7 | Python | Kwabena-Kobiri/CodingProjects | /coding.py | UTF-8 | 513 | 4.46875 | 4 | [] | no_license | #INPUT
"""Our input is the fahrenheit temperature from the woman"""
fahrenheit_value = float(input("Please Enter the Fahrenheit temperature: \n"))
#PROCESSING
"""The conversion from fahrenheit to celsius"""
celsius_value = (fahrenheit_value - 32) * (5/9)
print(round(celsius_value, 2))
#OUTPUT
"""Output is the ... | true |
c6b0b9f01908ef1e9182c2f8b3c211d7f7e10ea2 | Python | tchamberlin/quantum_bg | /quantum_nologs.py | UTF-8 | 11,799 | 2.90625 | 3 | [] | no_license | """Take interval-based images from a webcam"""
from datetime import datetime, timedelta
from pathlib import Path
from pprint import pprint
import argparse
import logging
import math
import operator
import pickle
import random
import subprocess
# logger = logging.getLogger(__name__)
CARDS = [
"ferocious",
"r... | true |
f3d6403dbb1591cd68e7901c7b267a57ff96579c | Python | rubana13/check | /72.py | UTF-8 | 183 | 3.734375 | 4 | [] | no_license | s=input("Enter string:")
count=0
vowels = set("aeiou")
for letter in s:
if letter in vowels:
count+=1
if(count>0):
print("yes")
else:
print("no")
| true |
5bff558f92e8acfaa3bbf499c6f9247afab256e4 | Python | asihacker/python3_bookmark | /python笔记/aaa基础内置/python内置模块/signal信号模块/接收信号绑定处理对应的事件.py | UTF-8 | 811 | 2.78125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/6/15 19:42
# @Author : AsiHacker
# @File : 接收信号绑定处理对应的事件.py
# @Software: PyCharm
# @notice : True masters always have the heart of an apprentice.
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import signal
import time
def receive_signal(s... | true |
991fa70e6785d2aee9cde8bb69ea17f5eef877cb | Python | swatantragoswami09/Amazon_SDE_Test_Series_solutions | /Find whether path exist.py | UTF-8 | 798 | 3.203125 | 3 | [] | no_license | adj=[]
row, col = key // n, key % n
if (col - 1) >= 0:
adj.append((row*n) + (col - 1))
if (col + 1) < n:
adj.append((row*n) + (col + 1))
if (row - 1) >= 0:
adj.append((row-1)*n + col)
if (row + 1) < n:
adj.append((row + 1)*n + col)
return adj
def find_path(source, a... | true |
a708ef2274312d404d761eba89b4a514502f6863 | Python | bhaktichiplunkar/readingProduct | /project1_TextToSpeech.py | UTF-8 | 5,223 | 2.609375 | 3 | [] | no_license | # Import the required module for text to speech conversion
# This module is imported so that we can play the converted audio
from flask import Flask, render_template, request, redirect, jsonify, make_response, flash
from gtts import gTTS
from pygame import mixer
from flask_sqlalchemy import SQLAlchemy
import os... | true |
5d375f832a7743f98cc465e44117731721c25b1d | Python | tomamic/paradigmi | /python/e4_2013_3_tictactoe.py | UTF-8 | 2,947 | 3.796875 | 4 | [] | no_license | #!/usr/bin/env python3
'''
@author Michele Tomaiuolo - http://www.ce.unipr.it/people/tomamic
@license This software is free - http://www.gnu.org/licenses/gpl.html
'''
import sys
class TicTacToe:
NONE = '.'
PLR1 = 'X'
PLR2 = 'O'
DRAW = 'None'
OUT = '!'
def __init__(self, side=3):
self.... | true |
5663622b172a34ee7b3f85d7e33b03b0cdcbea81 | Python | vpolyakov/stepik_tours | /tours/templatetags/tour_extras.py | UTF-8 | 715 | 3.125 | 3 | [] | no_license | from django import template
register = template.Library()
@register.filter(name='star_multiply')
def star_multiply(value, arg: str = '★', sep: str = ' ') -> str:
"""
Размножитель символов
:param value: количество символов в пакете
:param arg: повторяемый символ
:param sep: разделитель между симво... | true |
9f67f346ff822444f5b993983f02054d48818e36 | Python | krupalvora/DSA | /12merge2sort.py | UTF-8 | 438 | 2.859375 | 3 | [] | no_license | l1=[1,3,5]
l2=[0,2,4]
for i in l2:
l1.append(i)
for i in range(len(l1)):
for j in range(len(l1)):
if l1[i]<l1[j]:
l1[i],l1[j]=l1[j],l1s[i]
print(l1)
#new
def merge(self, nums1, nums2, n, m):
# code here
for i in range(n):
for j in range(m):
if... | true |
b2d586ef92b9b1830a1acc067076aa74a494b49f | Python | chdzq/crawldictwebapp-flask | /webapp/exception/error.py | UTF-8 | 427 | 2.96875 | 3 | [] | no_license | # encoding: utf-8
class CustomError(Exception):
def __init__(self, error_code, message, data=None):
self._error_code = error_code
self._message = message
self._data = data
@property
def error_code(self):
return self._error_code
@property
def message(self):
... | true |
62f5c9824f47aaa427e169319347b165af697910 | Python | gabriellaec/desoft-analise-exercicios | /backup/user_226/ch24_2020_09_09_20_46_41_670214.py | UTF-8 | 165 | 3.09375 | 3 | [] | no_license | def calcula_aumento(salario):
float(salario)
if salario > 1250.00:
return salario * 1.10
elif salario <= 1250.00:
return salario * 1.15
| true |
25e418b61d7101ce16d81f8d1f4df7b409cb7d5a | Python | 4or5trees/azure-iot-starter-kits | /seeed/2-image-classifier/modules/image-classifier-python/main.py | UTF-8 | 1,455 | 2.515625 | 3 | [
"MIT"
] | permissive | import argparse
import imageclassifier
from flask import Flask, request, jsonify
classifier = None
# Start web server
application = Flask(__name__)
@application.route('/classify', methods=['POST'])
def classify_image():
file = request.files['image']
result = classifier.run_inference_on_image(file)
retur... | true |
6de3dc92424c3b7af4f8648ee3182d06b13d002b | Python | guocheng45/Projects | /GTExercises/PyInterface/Regisintfa.py | UTF-8 | 2,291 | 2.859375 | 3 | [] | no_license | #-*- coding: UTF-8 -*-
#————urllib库有一个很智能的毛病。data不给值,访问方式就是GET,data给了值,方式就会变成POST;
#用post方法请求api:这种方式把参数放在请求内容中传递,比较安全
import urllib,urllib2
class RegisIntfa:
def CN_regist_username(self,Uname,gid): #注意方法中要有self才能使方法作为类方法
url = 'http://testapi.ktplay.cn:3011/2/user/account/login_by_nickname' ... | true |
da275343ea5c5fa4f2653ca45a374f1f47988bac | Python | XJDKC/University-Code-Archive | /Course Design/Data Analysis Based on Big Data Platform/PythonMR/HdfsSort/mapper.py | UTF-8 | 179 | 3.015625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import sys
list1=[]
for line in sys.stdin:
line=line.strip()
words=line.split("\n")
list1.append(words[0])
for x in xrange(len(list1)):
print list1[x]
| true |
5d5235d741d8cfac9a4ba49d7cf30f2f8287b452 | Python | Aasthaengg/IBMdataset | /Python_codes/p03140/s889642214.py | UTF-8 | 265 | 3.03125 | 3 | [] | no_license | n = int(input())
s = [input() for _ in range(3)]
ans = 0
for v in zip(*s):
len_ = len(set(v))
ans += len_ - 1
# if len_ == 3:
# ans += 2
# elif len_ == 2:
# ans += 1
# else:
# # len_ == 1
# ans += 0
print(ans)
| true |
323a794b5b61c1a18106f54387cabdf369ee7d36 | Python | ChiPhanThanh/Python-Basic | /Nhap 3 so va in ra thu tu tang dan.py | UTF-8 | 465 | 3.203125 | 3 | [] | no_license | #Nhap vao ba so a, b, c
a = int(input(" Nhap vao gia tri a="));
b = int(input(" nhap vao gia trị b ="));
c = int(input(" nhap vao gia trị c ="));
if a <= b <= c:
print("%d %d %d" % (a, b, c))
elif a <= c <= b:
print("%d %d %d" % (a, c, b))
elif b <= a <= c:
print("%d %d %d" % (b, a, c))
elif b <= c <= a:
... | true |
0c468cdd2fe649b9babff43109aaa01ddff460e4 | Python | greyhill/pfeebles | /bin/mkdb.py | UTF-8 | 3,380 | 2.5625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import sqlite3
import csv
import os
dbconn = sqlite3.connect('pfeebles.sqlite3')
dbconn.text_factory = str
curr = dbconn.cursor()
if not os.path.exists('spells.csv'):
raise ValueError('download spells.csv first!')
spell_col_names = ( \
'name', 'school', 'subschool', 'descriptor',
'spell_level... | true |
ee7a8d5f5b461166fe8751df0efd25c50696ecb6 | Python | francisdmnc/Feb2018-PythonWorkshop | /Exer 1_Yaya, Francis Dominic S..py | UTF-8 | 417 | 4.0625 | 4 | [] | no_license | print "Each game console cost 22000"
money = input("How much money do you have in your account now? Php ")
y=(money)/22000
print "The number of game consoles with a price of Php 22000 you can buy is ", y
n = (money) - y*22000
print "After buying the consoles, you will have", n,"pesos left on your account"
e = 22... | true |
cecce1b055dc9cbe916d84ee791fe17c194b13af | Python | alluri1/algos_epi | /10_heaps/01_merge_sorted_arrays.py | UTF-8 | 705 | 3.90625 | 4 | [] | no_license | """
Merge k sorted arrays
<3,5,7> <0,6> <0,6,28>
Approach 1 : merge sort
Approach 2 : use a min heap(size<=k) to keep current min elements from each array
Each node in the heap is a tuple (value, array_index, element_index)
: pop min element from min heap to add to output array
: push... | true |
041020d5afd55d7ba7229ab5b4b32cac146d297a | Python | jsoma/openrecipes | /scrapy_proj/openrecipes/pipelines.py | UTF-8 | 2,697 | 2.953125 | 3 | [] | no_license | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/0.16/topics/item-pipeline.html
from scrapy.exceptions import DropItem
import hashlib
import bleach
class MakestringsPipeline(object):
"""
This processes all the properties of t... | true |
806b84ab640f6253a1169df07b85b74fc5514387 | Python | yashagrawal5757/FraudDetection | /fraud.py | UTF-8 | 18,966 | 2.984375 | 3 | [
"MIT"
] | permissive | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation,Dropout
from tensorflow.keras.callbacks import EarlyStopping
from imblearn.under_samplin... | true |
0d9cfa84b034fbb1ad6d97c6d80dba987e082fb1 | Python | daejong123/wb-py-sdk | /wonderbits/WBHall.py | UTF-8 | 1,162 | 2.921875 | 3 | [
"MIT"
] | permissive | from .wbits import Wonderbits
def _format_str_type(x):
if isinstance(x, str):
x = str(x).replace('"', '\\"')
x = "\"" + x + "\""
return x
class Hall(Wonderbits):
def __init__(self, index = 1):
Wonderbits.__init__(self)
self.index = index
def register_magnetic(self, ... | true |
434879ed30780b0a41706c65901e81ad8618fab7 | Python | JonasPapmeier/Masterarbeit | /statistics.py | UTF-8 | 3,856 | 3.046875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue May 30 17:49:57 2017
@author: brummli
"""
import matplotlib as mpl
mpl.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
from dataLoader import dataPrep
"""
Calculates standard statistics
:params:
data: numpy array containing the data of form (examples,times... | true |
a3d2feaa05f81889538470b940fcbe565f133cb2 | Python | callmekungfu/daily | /interviewcake/hashing-and-hashtables/practices/in_flight_entertainment.py | UTF-8 | 1,942 | 4.15625 | 4 | [
"MIT"
] | permissive | '''
You've built an inflight entertainment system with on-demand movie streaming.
Users on longer flights like to start a second movie right when their first one ends,
but they complain that the plane usually lands before they can see the ending.
So you're building a feature for choosing two movies whose total runti... | true |
0a4367ccd5ad9353f2652b56b73a5ee1a51b4568 | Python | anhbh/cousera | /py4e/py_test_time.py | UTF-8 | 913 | 3.265625 | 3 | [] | no_license |
import time
stat1=dict()
stat2=dict()
#numbers_sizes = (i*10**exp for exp in range(4, 8, 1) for i in range(1, 11, 5))
numbers_sizes = [10**exp for exp in range(4, 10, 1)]
print(str(numbers_sizes))
for input in numbers_sizes:
# prog 1
start_time=time.time()
cube_numbers=[]
for n in range(0,input):
... | true |
85df58ca59424c34c2ffa3747bb0e986112a376f | Python | VNG-Realisatie/gemma-zaken-demo | /src/zac/demo/mijngemeente/management/commands/debug_runconsumer.py | UTF-8 | 2,777 | 2.53125 | 3 | [] | no_license | import datetime
from django.core.management.base import BaseCommand
import pika
from zac.demo.models import SiteConfiguration
class Command(BaseCommand):
"""
Example:
$ ./manage.py runconsumer foo.bar.*'
"""
help = 'Start consumer that connects to an AMQP server to listen for notifications... | true |
ea81dcc5c1d17c05380454bca11d66efcff2c3c2 | Python | shravan002/SIH-2019 | /sih_fnode_Desktop/SIH_Edge_Node/Weather_download.py | UTF-8 | 463 | 2.578125 | 3 | [] | no_license | #import configparser
import requests
import sys
import json
#def get_weather():
#if(r.json() == null ):
#print("Error Occured")
#return r.json()
url = "https://api.openweathermap.org/data/2.5/forecast?id=3369157&appid=e141245f76fbb881dfba64a59a75ac71"
r = requests.get(url)
#print(r.json())
#wea... | true |
e399d913af98718223c1081fbc9a6c570023a8d8 | Python | Aasthaengg/IBMdataset | /Python_codes/p02629/s262585495.py | UTF-8 | 223 | 2.625 | 3 | [] | no_license | N=int(input())
c=0;
while N-26**c>=0:
N-=26**c
c+=1
d=[0]*(c-1)
i=0
for i in range(c):
d.insert(c-1,N%26)
N=(N-d[i])//26
i+=1
e=[]
s=''
for i in range(2*c-1):
e.append(chr(97+d[i]))
s+=e[i]
print(s[c-1:2*c-1]) | true |
4fadf6dfbd50a12290937a0b8b7c4e65bf0962da | Python | paul-mcnamee/ClipConcatenator | /DownloadTwitchClips.py | UTF-8 | 17,807 | 2.640625 | 3 | [] | no_license | import shutil
import glob
import base64
import json
import os
import datetime
import requests as re
import re as regex
import logging
import time
output_directory = 'C:/temp/'
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# create a file handler
handler = logging.FileHandler(datetime.d... | true |
afee02d6be8dc4d6f871ed615fac59c3c4b3f0f0 | Python | zdravkob98/Fundamentals-with-Python-May-2020 | /Dictionaries - Exercise/demo.py | UTF-8 | 74 | 2.8125 | 3 | [] | no_license | d = {'a': [10, 14, 16], 'b': [15]}
k = 14
if k in d['a']:
print('yes') | true |
c78b11ce80d2dc615cc631c72fa39b00cd94ff04 | Python | dingzishidtc/dzPython | /调用浏览器.py | UTF-8 | 590 | 2.578125 | 3 | [] | no_license | #encoding=utf8
#!/usr/bin/python3
from selenium import webdriver
import time
driver=webdriver.Chrome()
driver.get(r'https://wenku.baidu.com/view/c5d88d850408763231126edb6f1aff00bed570ea.html')
time.sleep(1)
js = "window.scrollTo(0,3500)"
driver.execute_script(js)
time.sleep(1)
ele=driver.find_element_by_xpath("//p[@cla... | true |
2b3bcaedc3a4613a9f9d82b43f77619389ac608b | Python | PyPhy/Python | /AI/Simple_Perceptron.py | UTF-8 | 2,137 | 3.84375 | 4 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from numpy import random, exp, dot, array
#%% Neural Network
class Neural_Network():
#%% Sigmoid function
def φ(self, x):
return 1/(1 + exp(-x))
# Sigmoid function's derivative
def dφ(self, x):
return exp(x)/ (1 + ... | true |
7392d7185d47b8e03cd6f6703a70cd2886411a83 | Python | mikeludemann/helperFunctions_Python | /src/Set/maxSet.py | UTF-8 | 46 | 2.625 | 3 | [
"MIT"
] | permissive | x = set([71, 12, 3, 18, 2, 21])
print(max(x)) | true |
2ffe545e06630f9a96ba023367bc13c66eb5fdc3 | Python | id774/sandbox | /python/numpy/anova.py | UTF-8 | 1,128 | 3.25 | 3 | [] | no_license | #! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
data = np.array([[5., 7., 12.],
[6., 5., 10.],
[3., 4., 8.],
[2., 4., 6.]])
s_mean = np.zeros(data.shape)
for i in range(data.shape[1]):
s_mean[:, i] = data[:, i].mean()
print("水準平均 " + str(s_mean))... | true |