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 |
|---|---|---|---|---|---|---|---|---|---|---|
68716b14b4a5db51a7b19a9858b2befdcba62156 | alishabelle/holbertonschool-higher_level_programming | /0x11-python-network_1/2-post_email.py | UTF-8 | 414 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python3
""" sends post request to url """
import urllib.request
import sys
if __name__ == "__main__":
url = sys.argv[1]
email = {'email': sys.argv[2]}
data = urllib.parse.urlencode(email)
data = data.encode('utf-8')
aye = urllib.request.Request(url, data)
with urllib.request.urlopen... | true |
b4a8977fa9153501b065d39558b3004c5210273e | geronm/ABB-IRB140 | /robotsuite-lcm-util/IRB140LCM_monitor.py | UTF-8 | 6,096 | 2.59375 | 3 | [
"MIT"
] | permissive | '''
Author: alexc89@mit.edu
IRB140LCMWrapper
This is a script connecting OPEN ABB Driver with LCM. It publishes IRB140's joint position in IRB140Pos LCM Channel and listens IRB140Input to control IRB140's joint.
Please note that the unit of the joint state and command is dependent on the setting on the IRB140, this sc... | true |
ccc624540e69072115fbccac7534efacdf2eba10 | fervargas94/AIChallenges | /other.py | UTF-8 | 3,673 | 2.890625 | 3 | [] | no_license | import requests
import json
import operator
import sys
import twitter
import pickle
import matplotlib
import numpy
matplotlib.use('Agg')
import matplotlib.pyplot as plt # Do not do this prior to calling use()
from watson_developer_cloud import PersonalityInsightsV2 as PersonalityInsights
twitter_consumer_key = "hovM... | true |
d616f4f0dabc9d79cb72ec3ac1ac97c802123137 | sylvainhalle/MetaConfig | /PYTHON/Device/DeviceParameter.py | UTF-8 | 810 | 2.71875 | 3 | [] | no_license | class DeviceParameter:
def __init__(self, xmlNode, ref_param=None, name=None):
if xmlNode==None:
self.name = name
self.ref_param = ref_param
self.values = []
else:
self.ref_param = xmlNode.attributes['ref_param'].value
self.name = xmlNode.a... | true |
1d3dfd111ce8234829a673c959fcb985be28f720 | alphasixteam/Butterfly | /Butterfly/producer/server.py | UTF-8 | 2,485 | 2.890625 | 3 | [] | no_license | """
File: server.py
Data creazione: 2019-02-20
<descrizione>
Licenza: Apache 2.0
Copyright 2019 AlphaSix
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENS... | true |
2046e25aa3bec79aa990f5179a2501d4165f14bc | bennymac360/ISING-Spin-Dwave | /blockave.py | UTF-8 | 1,407 | 2.734375 | 3 | [] | no_license | import numpy as np
#input text file
filein = open('3.0_lattice_2d_ising_avg_energy_MCMC+NADE.txt')
#list of rows read from file
rows=[]
for line in filein:
rows.append(line)
#rows = np.loadtxt('energy_outputs.txt')
#number of rows read
Ndata = len(rows)
#index of the column where the relevant data is, starting fr... | true |
b4ef044f347420298e17b74d9eff303c9d4d1ec5 | PROlodki/Clicker | /Main/JoJo's Game Cliker.py | UTF-8 | 1,998 | 3.078125 | 3 | [] | no_license | import pygame
pygame.init()
size = [1920, 980]
WHITE = [255, 255, 255]
screen = pygame.display.set_mode(size)
clock = pygame.time.Clock()
fone = pygame.image.load("Back.png").convert_alpha()
Jonatan = pygame.image.load("Jonatan.jpg").convert_alpha()
sound = pygame.mixer.Sound('Main Theme.wav')
pygame.display.set_capti... | true |
d6fec46660f26ef2ff1aeb72fa8c6c4384371604 | pansuo/crashkit | /server/wtforms/form.py | UTF-8 | 5,949 | 3.15625 | 3 | [] | no_license | __all__ = (
'Form',
)
class FormMeta(type):
"""
The metaclass for `Form` and any subclasses of `Form`.
`FormMeta`'s responsibility is to create the `_unbound_fields` list, which
is a list of `UnboundField` instances sorted by their order of
instantiation. The list is created at the first ins... | true |
8d759396d27437ceb1573f3a0758b096a7016394 | caktus/tracerlib | /testmod.py | UTF-8 | 335 | 2.75 | 3 | [
"BSD-2-Clause"
] | permissive | import sys
def l(c):
if c:
pass # LINE 5
else:
pass # LINE 7
def v():
a = 1 # LINE 10
a = 2 # LINE 11
a = 3 # LINE 12
def f():
return sys._getframe()
class A(object):
def m1(self):
return sys._getframe()
def m2(self, x, y):
pass
def a():
b()
def ... | true |
1e845c137b11973177f232a390d8db761adecb4e | StefanKaeser/pybites | /92/humanize_date.py | UTF-8 | 1,167 | 3.34375 | 3 | [] | no_license | from collections import namedtuple
from datetime import datetime
TimeOffset = namedtuple("TimeOffset", "offset date_str divider")
NOW = datetime.now()
MINUTE, HOUR, DAY = 60, 60 * 60, 24 * 60 * 60
TIME_OFFSETS = (
TimeOffset(10, "just now", None),
TimeOffset(MINUTE, "{} seconds ago", None),
TimeOffset(2 *... | true |
2eff844d0c33ec21f15977f141eda1d1786e2010 | aya-taka/2016Introduction | /11FindingMissingCards.py | UTF-8 | 808 | 3.65625 | 4 | [] | no_license | have_trumps = [[0 for i in range(13)] for j in range(4)]
all_cards = int(input())
for i in range(0, all_cards):
card_type, card_num = input().split()
if card_type == "S":
have_trumps[0][int(card_num) - 1] = 1
elif card_type == "H":
have_trumps[1][int(card_num) - 1] = 1
elif card_type == ... | true |
a10d7e719b0374e1890493d6be93690aff171b5c | asdadas22/AWAKELAB-evaluaciones | /Evaluacion-02/abaco.py | UTF-8 | 345 | 2.625 | 3 | [] | no_license | import time
import paquete_cientifico as pc
# diccionario del abaco
abaco_dict = {
}
if __name__ == "__main__":
turno = 0
while True:
turno += 1
lista_columnas = pc.imprimir_abaco(abaco_dict, turno)
fila_lista = pc.ordenar_abaco(lista_columnas)
for fila in fila_lista... | true |
08f319097220dbc553b8ecac8b22f2d5732a0e1a | niksterino123/Java | /amocana1may.py | UTF-8 | 907 | 2.796875 | 3 | [] | no_license | import random,time
class Xili:
res = time.localtime(random.randrange(1, 99999999))
fasebi = {1: "1 GEL", 2: "1 GEL", 3: "1 GEL", 4: "90 Tetri", 5: "50 Tetri", 6: "20 Tetri", 7: "20 Tetri", 8: "30 Tetri", 9: "40 Tetri", 10: "50 Tetri", 11: "70 Tetri", 12: "80 Tetri"}
sezonebi = {1: "January", 2: "Februar... | true |
4a6dd39ea59beedf6a95a54bf94b6d8879910bd8 | abhaykr201/BuildingaStylometricAnalyser | /main_StudentID.py | UTF-8 | 1,134 | 3.015625 | 3 | [] | no_license | import visualiser_StudentID as vs
def main():
f1, f2, f3, f4, f5, f6 = read_input()
ob = vs.AnalysisVisualiser(f1, f2, f3, f4, f5, f6)
flow = 1
ch = 0
while(flow == 1):
ch = input('Enter One Choice of your analysis \n1. character frequency\n2. punctuation frequency\n3. stopword freq... | true |
c9b6f70fc11bd8a97367da81a573e06e6a5cb109 | valentina-zhekova/Hack-Bulgaria-Programming-101 | /week0/part 1/sumOfDigits.py | UTF-8 | 390 | 3.8125 | 4 | [] | no_license | def sum_of_digits(n):
num = abs(n)
s = 0
while num != 0:
s += num % 10
num = num // 10
return s
def main():
print("should be 43: %s" % sum_of_digits(1325132435356))
print("should be 6: %s" % sum_of_digits(123))
print("should be 6: %s" % sum_of_digits(6))
print("should b... | true |
1a44c4fec11c0f860b1cf6352dd50d1323a6ee8c | vidg3t/passwordmanager | /main.py | UTF-8 | 5,492 | 2.921875 | 3 | [] | no_license | from __future__ import print_function#for search engine(7)
import pyAesCrypt#thats for crypting/hashing(2,5)
import smtplib#thats for email sending(3)
from email.message import EmailMessage#thats for email sending(3)
import time#just for user-friendly interface
import os#for database using
import getpass#for good passw... | true |
8a994dd994ac458ac61ca759546e6ea4cbf5f74a | dpvdberg/pyfloorplanner | /test/algorithm/test_SimulatedAnnealing.py | UTF-8 | 1,814 | 2.84375 | 3 | [] | no_license | from random import random
from unittest import TestCase
from algorithm.SimulatedAnnealing import SimulatedAnnealing
from data.Floorplan import Floorplan
from data.Module import Module, ModuleType, Dimensions, Vector2
from data.TreeBuilder import TreeBuilder
class TestSimulatedAnnealing(TestCase):
def test_sa(sel... | true |
1d87c73d381a9483442250a74328ab8f69cf8f42 | NicolasBOINAY/Malis-StockIndicator-Project | /MALIS-project/Code_python/first_part/RSI-FirstPart.py | UTF-8 | 10,551 | 2.96875 | 3 | [] | no_license | # This script is supposed to create a set of data in order to train a neural network
############################################################################################################################
# I) Declaration of the importations, variables and main function
#Importation of ... | true |
8ee152e47b77631808670c21536a315c50da2e9a | pramodrao/PyLabs | /BinarySearch.py | UTF-8 | 1,646 | 3.953125 | 4 | [] | no_license | class BinarySearch:
def __init__(self, lst):
self.lst = lst
def add_to_list(self, element):
self.lst.append(element)
def search_normal(self, element):
lst_len = len(self.lst)
if lst_len == 0:
raise ValueError
for i in range(lst_len):
if self... | true |
2bbf8f4a3ee35945fba8d82b1a939d7453de4bbb | neithere/tool | /examples/blog_example/blog/commands.py | UTF-8 | 2,787 | 3.625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Commands
========
This module provides the blog's command-line interface. It is implemented by
functions :func:`list` and :func:`add`. They are available as ``blog list`` and
``blog add`` respectively provided that you prepare the application as
follows::
>>> from tool import Applicati... | true |
cc704fc13fa2de5c18c2a72fa8095db4fbf340fe | Bryce505/python_practice_learning-by-doing | /批量转换图片格式.py | UTF-8 | 394 | 3.015625 | 3 | [] | no_license | import os
import os.path
ext_from = ".gif"
ext_to = '.png'
read_file_dir =input('请输入要修改文件扩展名得路径: ')
files = os.listdir(read_file_dir)
for filename in files:
portion = os.path.splitext(filename)
if portion[1]==ext_from:
newname = portion[0]+ext_to
os.chdir(read_file_dir)
os.ren... | true |
cff76e9048cfca433ae716b1cea95fd51b6d4da7 | akusaini/apihandler | /apihandler/builder/common/error_handler/exceptions.py | UTF-8 | 2,863 | 3.0625 | 3 | [] | no_license | from .error import Error
class BaseException(Exception):
"""
Base class for custom exceptions.
Subclasses should provide `status_code`, `message` and `errors` properties.
"""
status_code = 500
message = 'A server error occurred.'
errors = []
def __init__(self, message=None, status_code... | true |
0dac13fb33994ec019757cca70e11371e755369e | AOE-khkhan/GAGPU | /loadresults2.py | UTF-8 | 743 | 3.171875 | 3 | [] | no_license | #Loading data and plotting routines
import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import numpy as np
# Try loading data
data = np.loadtxt("TestHist.txt", delimiter="\t")
#Specific Info about the test case
no_gen = 30
no_tests = 1000
solution = 0.0 # Ackley Function Global Minimum
#Setu... | true |
45616c33a2475e5e2a39fc7e12b64fb56d527e86 | stfc-aeg/timeslice-camera | /control_server/app/control_tcp_server.py | UTF-8 | 2,419 | 2.515625 | 3 | [] | no_license | import socket
import os
import logging
import struct
import tornado.gen
import tornado.iostream
import tornado.tcpserver
class CameraTcpConnection(object):
client_id = 0
def __init__(self, stream, camera_controller):
self.stream = stream
self.camera_controller = camera_controller
Ca... | true |
09c853c5733211b12d64b0731d807ec682a20c68 | sarikapinu/Python | /data_generator.py | UTF-8 | 595 | 2.71875 | 3 | [] | no_license | @@ -0,0 +1,20 @@
# Step 1) Use testdat library to create a model
# Step 2) Create list of first and last names to choose from and generate piple delimited file
import tesdat
colors_light = ['pink','skyblue']
colors_dark = ['brown','purple']
model = tesdat.getmodel([
tesdat.CyclePattern(colors_light,repeat=2),
tesdat... | true |
00c5005bd995fcff78ebfba07d6ea18d5a14a723 | SebastianHaben/icc-pyir | /src/errors.py | UTF-8 | 4,244 | 2.96875 | 3 | [
"MIT"
] | permissive | """Exceptions"""
# Copyright (c) 2020
# Authors: Sebastian Haben
# License: MIT
from matplotlib import pyplot as plt
class NotReadableError(Exception):
"""Exception raised for errors in the input.
Parameters:
-----------
message : String
Explanation of the error.
At... | true |
c84f1ed3d90ddff79415b25e9201b6c3386da7fd | DoAnhTuan98/doanhtuan-fundamental-c4e | /session2/tamgiac.py | UTF-8 | 126 | 3.140625 | 3 | [] | no_license | from turtle import *
color("orange")
begin_fill()
for i in range(3):
forward(300)
left(120)
end_fill()
mainloop() | true |
110eacdbff1190281c9d275558cf55aea9365dac | fanghuicocacola/Fanghui-Lang | /python/PythonApplication6/PythonApplication6.py | UTF-8 | 280 | 3.09375 | 3 | [] | no_license | list1={"123","789"}
print(list1)
list2=["wua"]
list2=list("wow")
print(list2)
list3={"口号一":"just do it","口号二":" to be NO.1","口号四":"一切皆有可能"}
print(list3)
print(8*(8,))
temp=('OK','YES','NO','OF COURSE')
temp=temp[:2]+('OPS',)+temp[2:]
print(temp[2])
| true |
9ad51f5a2bbec67b82b497ba3ef0c0634dc55682 | mrugacz95/advent-of-code-2019 | /day_25/draw_labirynth.py | UTF-8 | 7,742 | 3.078125 | 3 | [] | no_license | import copy
import random
def opposite(directory):
return {
'north': 'south',
'east': 'west',
'south': 'north',
'west': 'east'
}.get(directory)
def move_position(position, direction):
pass
dy, dx = {
'north': (-1, 0),
'south': (1, 0),
'west': (... | true |
0f15b57e0da54e9d63f0babc62e1b05d347bf450 | hectormikel/Mean_Variance_StDev_Calculator | /Mean_Variance_StDev_Calculator.py | UTF-8 | 665 | 3.453125 | 3 | [] | no_license | # Mean-Variance-Standard Deviation Calculator
import numpy as np
def calculate(list):
try:
methods = {'mean': 'np.mean', 'variance': 'np.var', 'standard deviation': 'np.std', 'max': 'np.max',
'min': 'np.min', 'sum': 'np.sum'}
x = np.array(list).reshape((3, 3))
calculatio... | true |
cca5d7df636ad2d7c08813b73b17754b0c004d25 | gui2one/python_playground | /pi_python/wheels/wheels_V2.py | UTF-8 | 3,016 | 2.859375 | 3 | [] | no_license | import pygame
import math
from myWheel import *
from gui2oneUI import *
pygame.init()
pygame.key.set_repeat(300,50)
screen = pygame.display.set_mode((600, 500))
def callbackFunction1():
print "callBack Function 1 !!!!!!!!!!!"
def callbackFunction2():
print "callBack Function 2 !!!!!!!!!!!"
... | true |
2a9caf84064153c169b5e4e50ed00d5c4a64c217 | marcelo-santos-12/IJCNN | /extract_features.py | UTF-8 | 2,915 | 2.71875 | 3 | [
"MIT"
] | permissive | import numpy as np
import pandas as pd
import time
import os
from tqdm import tqdm
import cv2
from glob import iglob
from lbp_module.texture import base_lbp, improved_lbp, hamming_lbp, completed_lbp, extended_lbp
from lbp_module.classifiers import Classifier
def main():
DATASET = 'DATASET/Breast Cancer/BreakHist... | true |
18f47f4c165c9659336750220f340fa3e373bf2f | DarkmatterVale/hurricane | /hurricane/utils/socketWrappers.py | UTF-8 | 1,117 | 3.015625 | 3 | [
"MIT"
] | permissive | import socket
def create_active_socket(host, port):
"""
Connect to a host on a specific port.
@returns the new active socket
"""
active_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
active_socket.settimeout(5)
active_socket.connect((host, port))
return active_socket
def ... | true |
ae60993b4eaa4e7476903822efaae4faec89fa5c | colinhenryfraser/strava2hipchat | /strava2hipchat.py | UTF-8 | 2,782 | 3.140625 | 3 | [] | no_license | #!/usr/bin/env python
#
# Script to pull activities from Stava and send to Hipchat
#####
import json
from stravalib import Client, unithelper
import datetime
import urllib2
#
# Strava Parent Class
####
class Strava:
#
# Set the Strava key
def __init__(self, strava_key):
self.strava_key = strava_key
#
# En... | true |
8f61922eb8029f053b9674c5da3ff8be4e6231ad | jeanjuachon/foundationOfAppliedMathematics | /StandardLibrary/standard_library.py | UTF-8 | 3,912 | 3.84375 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# standard_library.py
"""Python Essentials: The Standard Library.
<Name> Jean Philip L Juachon
<Class> BUDS 2019
<Date> July 17, 2019
"""
import box
import time
import random
import sys
#PROBLEM 1
def prob1(L): #function that accepts an input list
return min(L), max(L), sum(L)/len(L) #minim... | true |
de3d7fc51eedc4075195c63ba40eb88a5dbd94f2 | warikoone/LpGBoost | /ICONRepClassification_Py/src/com/prj/bundle/modelling/SequentialConvolution.py | UTF-8 | 1,685 | 2.515625 | 3 | [] | no_license | '''
Created on Dec 20, 2018
@author: iasl
'''
import sys
import numpy as np
from keras.models import Model, Sequential
from keras.layers import Dense, LSTM, Input, Flatten
from keras.optimizers import Adam
from keras.layers.embeddings import Embedding
from keras.layers.advanced_activations import LeakyReLU, PReLU
fro... | true |
9e5c6ccb651c8d63125e5d648d50282b90b24eb9 | mcewenar/PYTHON_INFO_I_BASIC | /euclides_algoritmo.py | UTF-8 | 428 | 4.25 | 4 | [] | no_license | # Python program to demonstrate Basic Euclidean Algorithm
# Function to return gcd of a and b
def gcd(a, b):
if a == 0 :
return b
return gcd(b%a, a)
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
print("gcd(", a ,"," , b,") = ", gcd(a, b))
#a = 35
#b = 10
#p... | true |
79b9ab82b3b3fd00f771b8c0fbe01a52ac3f11d0 | dlwns147/practice | /pythonproject/10-10.py | UTF-8 | 252 | 3.5 | 4 | [] | no_license | def vol_chg(c_vol) :
vol = int(input("증가시킬 만큼의 음량을 입력 : "))
print("증가 후의 음량은", c_vol + vol, "입니다.")
cur_vol = 3
print("현재 음량은", cur_vol, "입니다.")
vol_chg(cur_vol)
| true |
52051e1ab4571ce7da4c651a4c7f17628b043faf | marho13/IKT715 | /fileReader.py | UTF-8 | 532 | 2.65625 | 3 | [] | no_license | def fileRead(filey):
data = open(filey, mode="r").read()
data = data.split("\n")
files = [d.split(",") for d in data]
# files = [f[1:] for f in files]
del files[-1]
fuckmeList = [0, 1, 2, 6]
dataSet = [[], [], [], [], [], [], []]
for x in files:
num = int(x[-1])-1
dataS... | true |
0be0d9fd7de3019b0cc6a48c94f42d5b4419dc12 | mattj1/lobby | /test.py | UTF-8 | 4,984 | 2.578125 | 3 | [] | no_license | import datetime
import getopt
import struct
import sys
import threading
import time
from bitstring import ConstBitStream
from util import log
def timer_sec():
return int(round(time.time()))
def timer_ms():
return int(round(time.time() * 1000))
class int32(object):
def __init__(self):
self.nu... | true |
af4a1c077ce67394980253fbe3464dcfde196378 | dsandadi/CP | /CodeForces/Contests/1343/A.py | UTF-8 | 382 | 3.53125 | 4 | [] | no_license | '''
Online Python Interpreter.
Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.
'''
import math
T = int(input())
while T > 0:
n = int(input())
k = 2
while n % (math.pow(2, k) - 1):
... | true |
b6c60b11067ae70289221f310af0b927ef71499f | SteveSatterfield/HEVf | /idea/src/netx-utilities/netx-bfsEdges | UTF-8 | 804 | 3.484375 | 3 | [] | no_license | #!/usr/bin/env python3
#Arg 1: edge-list graph file
#Arg 2: 'u' for undirected, 'd' for directed
#Arg 3: source node
#Does not have to be connected
import networkx as nx
import sys
if(len(sys.argv)==4):
myFile = open(sys.argv[1], 'r')
else:
print("Error: wrong number of arguments.")
sys.exit()
if(sys.arg... | true |
996c4b68f7feb471a678e6bf09b105be25e1ab51 | indraujo/catatan-python | /Catatan Beginner/catatan_14_write file.py | UTF-8 | 120 | 2.9375 | 3 | [] | no_license | # Writing file txt
file = open("Hello.txt","w")
file.write("")
file.write("Hi, \nI'm learing python now")
file.close() | true |
640845695be0b08ca71b78e54f64087e2c2d3075 | shihyu/MyTool | /terminatorlib/signalman.py | UTF-8 | 2,226 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env python2
# Terminator by Chris Jones <cmsj@tenshu.net>
# GPL v2 only
"""Simple management of Gtk Widget signal handlers"""
from .util import dbg, err
class Signalman(object):
"""Class providing glib signal tracking and management"""
cnxids = None
def __init__(self):
"""Class initia... | true |
078ca702fb6407708b9fdb3e387c048f4a33ca1c | aTeK7/deep-stereo1.4 | /old/camera_plot.py | UTF-8 | 1,723 | 3.140625 | 3 | [
"MIT"
] | permissive | import matplotlib.pyplot as plt
import numpy as np
import math
def plot_camera(figure, camera, depth=1.0, rotate=True):
points = np.array([
(-1, 1, depth),
(1, 1, depth),
(1, -1, depth),
(-1, -1, depth),
])
#print points
zDepth = 1
p = zDepth * np.vs... | true |
997e6fe75751bc7e67c780bd4271d5e3318db97b | gabriellaec/desoft-analise-exercicios | /backup/user_347/ch4_2020_03_04_17_42_28_872257.py | UTF-8 | 187 | 3.09375 | 3 | [] | no_license | i = input("qual a sua idade?")
def classifica_idade (i):
if i <12:
print("crianca")
if 12<i<17:
print("adolescente")
if i>18:
print("adulto")
| true |
6b9183e67ac061a1beea91cd609d42e978914916 | Pratikdomadiya/codechef_code | /feb21-long/highest_divisor.py | UTF-8 | 159 | 3.21875 | 3 | [] | no_license | # cook your dish here
n=int(input())
if n>=2:
for i in range(10,0,-1):
if int(n%i)==0:
print(i)
break
else:
print('-1') | true |
01c3edf038287c4621e2362e8910b8b07a5b0695 | kabengka/DepAudioNet_reproduction-EUSIPCO-2021- | /unit_test/unit_test_organiser.py | UTF-8 | 6,448 | 2.734375 | 3 | [] | no_license | import logging
import os
import pickle
import utilities
from data_loader import organiser
from unit_test import config_test
import numpy as np
def determine_fold_test():
gt_dev = [1, 2]
gt_train = [[2, 3, 4], [1, 3, 4, 5]]
total_folds = [4, 5]
current_fold = [1, 2]
output_dev = []
output_train... | true |
98f0fe8888baef376f90b674bc7aea1e8123e407 | sbrocks/classification | /wine_classifier.py | UTF-8 | 1,091 | 3.328125 | 3 | [] | no_license | # Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset=pd.read_csv('winequality-red.csv',delimiter=';')
#print(dataset.head())
#print(dataset.shape)
X=dataset.iloc[:,:-1].values
y=dataset.iloc[:,11].values
#Splitting the dataset into Traini... | true |
cc41822ad4cc9f827dedf6f42988fa10c304483a | aht9887/20181217_20181221_python_tenserflow_runnig_with_python_winnter_program | /EX117_mnist_1.0_MSE_tensorboard.py | UTF-8 | 3,862 | 2.8125 | 3 | [] | no_license | # encoding: UTF-8
# original source : https://github.com/GoogleCloudPlatform/tensorflow-without-a-phd/tree/master/tensorflow-mnist-tutorial
# 2018.12 : modified by Seungkwon Lee(kahnlee@naver.com)
import tensorflow as tf
import mnistdata
import math
print("Tensorflow version " + tf.__version__)
import matplotl... | true |
9443ef9ba3ef8cfac8047dfb991295578bf91905 | optiflow/udacity-ai-programming-with-python-nanodegree | /train.py | UTF-8 | 9,069 | 2.84375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# */aipnd-project/train.py
# PROGRAMMER: LIM TERN POH
# DATE CREATED: 02/16/2018
# PURPOSE: Develop an image classifer using PyTorch and pre-trained CNN.
# Use argparse Expected Call with <> indicating expected use... | true |
b7a2c6d10ea329a9481f7f60ea4d06d8d6a10b12 | scream7/pyTinyPS | /pyTinyPS/consthash.py | UTF-8 | 1,381 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | import traceback
import sys
class ConsistentHashing(object):
def __init__(self,hash_func=hash, num_replicas=1):
self.__hash=hash_func
self.__numReplicas=num_replicas
self.__hashCircle={}
self.__keys=[]
def keys(self):
return self.__keys
def hash_circles(self):
return self.__hashCircle
def node_size(se... | true |
498ded667580e060ffb74b0a847225fd0e421ce3 | esther-j/BuddyChat | /startMode.py | UTF-8 | 809 | 2.859375 | 3 | [] | no_license | ###### start mode
### Methods to be executed during start mode
import cv2
# Respond to button clicks
def startMousePressed(event, data):
if data.startButton.isPressed(event.x, event.y):
data.mode = "modes"
elif data.helpButton.isPressed(event.x, event.y):
data.mode = "help"
def start... | true |
a357cc9bde51d85e62348c4d7b19e3293d482009 | zubair-bakori/Election_Analysis | /code_trial.py | UTF-8 | 291 | 4.15625 | 4 | [] | no_license | x = 0
while x <= 5:
print(x)
x = x + 1
counties = ["Arapahoe", "Denver", "Jefferson"]
for county in counties:
print(county)
numbers = [0, 1, 2, 3, 4]
for num in numbers:
print(num)
for num in range(5):
print(num)
for i in range(len(counties)):
print(counties[i]) | true |
0f09c671c0b30b289ffd2277395b16f69c0912ae | barlvovski/MaxEnvelope | /strategy.py | UTF-8 | 4,955 | 3.671875 | 4 | [] | no_license | from envelope import Envelope
import random
class BaseStrategy:
def __init__(self, envelopes):
'''
constructor of base strategy class
:param envelopes: the list of envelopes
'''
self.envelopes = envelopes
def getEnvelope(self, i):
'''
get specific enve... | true |
2ac60441fb7e9ed0690e368331e534de08e0af35 | WanQingGit/dexfactory | /test_disassemble.py | UTF-8 | 1,056 | 2.796875 | 3 | [] | no_license | # -- coding: utf-8 --
from dex.dexinfo import DexInfo, TYPE_CODE_ITEM, TYPE_CLASS_DEF_ITEM, ClassDefListSection, ClassDefItem
from disassemble.insns import Insns
from odex.section.tool import convertBytesToHexStr
dex_path = './data/classes.dex'
context = DexInfo(dex_path)
class_item_section: ClassDefListSec... | true |
d2f5368abb5d6eee42189f62783fb926951c2dcf | zakuro9715/atcoder | /arc027/b.py | UTF-8 | 661 | 3.15625 | 3 | [] | no_license | def f():
global a, b
for i in range(N):
if a[i] != b[i]:
x, y = a[i], b[i]
if a[i].isdigit():
x, y = y, x
a = a.replace(x, y)
b = b.replace(x, y)
return True
return False
N = int(input())
a, b = input(), input()
m = 0
whil... | true |
0bcf9220af337d9507314dc03ff22c2d0e29ef65 | eiushakov/StepikFinalProject | /pages/login_page.py | UTF-8 | 1,157 | 2.546875 | 3 | [] | no_license | from .base_page import BasePage
from .locators import LoginPageLocators
class LoginPage(BasePage):
def should_be_login_page(self):
self.should_be_login_url()
self.should_be_login_form()
self.should_be_register_form()
def should_be_login_url(self):
current_link = sel... | true |
b157d206a2edd883a4ec44d906edab45e7c825f9 | en0/AoC2018 | /day11/main.py | UTF-8 | 3,089 | 3.484375 | 3 | [
"Unlicense"
] | permissive | from multiprocessing import cpu_count, Pool
from sys import maxsize
def main():
sn = get_serial("input")
t = SummedAreaTable(300, sn)
print("Part 1:", part1(t))
print("Part 2:", part2(t))
def part1(table):
_, _, point = find_max_with_size(table, 3)
return "{},{}".format(*point)
def part2(t... | true |
9cbdbf18d37f42e997d1a1b9a27423c9019072f1 | cn-mehulpiruka/OOPS-assignment-problem-2 | /company/test.py | UTF-8 | 450 | 3.328125 | 3 | [] | no_license | from company import co
def company():
f=co.company()
print("Welcome to our company"+
"Want to know the details,Here are the available options----"+
"1.Name\n2.Description\n3.Banch details\n4.Number of employees\n5.Clients\n6.Average profit")
n=int(input("enter your option: "))
if (n==1):
f.name()
elif(n==2):... | true |
624fff697f21f2aaccdd2e24b028170643132caa | etoFlash/bitesofpy | /279/armstrong.py | UTF-8 | 93 | 3.015625 | 3 | [] | no_license | def is_armstrong(n: int) -> bool:
return n == sum(int(c) ** len(str(n)) for c in str(n))
| true |
50774772be779493ad411fadd87ff6e54afd4832 | mohitraj/mohitcs | /Learntek_code/6_Nov_18/sort3.py | UTF-8 | 161 | 2.8125 | 3 | [] | no_license | list1 = [4,5,0,6,6,13,0,4,0,20, 5,6,2,0,4,5,2]
m = max(list1)
def fun1(a):
if a ==0 :
return m+1
else :
return a
list1.sort(key= fun1)
print (list1) | true |
2128fef54b362375afb85155f3fee193d7c0931c | NeilWangziyu/Leetcode_py | /getMoneyAmount.py | UTF-8 | 1,135 | 3.453125 | 3 | [] | no_license | class Solution:
def getMoneyAmount(self, n):
"""
:type n: int
:rtype: int
dp[i][j]表示从[i,j]中猜出正确数字所需要的最少花费金额.(dp[i][i] = 0)
假设在范围[i,j]中选择x, 则选择x的最少花费金额为: max(dp[i][x-1], dp[x+1][j]) + x
"""
DP = [[0 for _ in range(n + 2)] for _ in range(n + 2)]
for i i... | true |
8f119c802194b972ac6d385f14d837a3d07e01f2 | CarolineXiao/AlgorithmPractice | /LetterCombinationOfPhoneNumber.py | UTF-8 | 1,117 | 3.609375 | 4 | [] | no_license | class Solution:
"""
@param digits: A digital string
@return: all posible letter combinations
"""
def letterCombinations(self, digits):
if digits == "":
return []
dict = {}
dict['2'] = ["a", "b", "c"]
dict['3'] = ["d", "e", "f"]
dict['4... | true |
6d3ef54210012437d143c7cbc8a29e0af730f320 | matt-yuen/OpenCV-Projects | /Chapter_6/crop.py | UTF-8 | 382 | 2.765625 | 3 | [] | no_license | import numpy as np
import cv2
import argparse
# Loading image
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True, help = "Path to the image")
args = vars(ap.parse_args())
image = cv2.imread(args["image"])
cv2.imshow("Original", image)
# Cropping the face of the corgi
cropped = image[20:3... | true |
6b950b8e907ac91a4fc0287fceb65eafaaf85689 | naikiki87/python | /FINANCE/8_get_Ave_VOL.py | UTF-8 | 1,802 | 2.765625 | 3 | [] | no_license | import pandas as pd
import requests
import threading
import time
from bs4 import BeautifulSoup
start = time.time()
tewt = 100
idx = 0
VOL_FIN_PAGE = 3 # 평균 volume을 구할 표본 수 -> 1 당 10일치
VOL_AVERAGE = 1000000 # 평균 volume filtering 하한치
code_df = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?method=... | true |
49680f112045eb8fe1310d919e8efda1a75da41a | rivergt/python-learning | /0-10add_or_subtract.py | UTF-8 | 1,868 | 4.46875 | 4 | [] | no_license | #连续20道10以内加减法
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import random
def add():
counter = 0
right = 0
wrong = 0
print('现在开始练习10以内加法,一共20道')
while counter<20:
counter +=1
x = random.randint(0,6)
y = random.randint(0,6)
print('第%d题,请问%d + %d等于多少?'% (co... | true |
b8eac13f9129a10ebbd9cb34a17e7e14c017c3e3 | DarkmatterVale/iterative-search | /iterativesearch/data_manager/data_store/data_store.py | UTF-8 | 1,359 | 2.96875 | 3 | [] | no_license | from abc import abstractmethod
class DataStore:
@abstractmethod
def initialize(self, **kwargs):
"""
Handles all initialization. Should be used for one-time executions such as DB connections, etc.
"""
raise NotImplementedError("initialize() not implemented")
@abstractmethod... | true |
2ea6b1c3311694c0df3cf41e63e79a59f76df40a | RodrigoSantosRodrigues/api-jogo-da-velha-python | /src/models/VelhaModel.py | UTF-8 | 1,774 | 2.71875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# src/models/VelhaModel.py
"""
Tic-Toc-Toe
------------------------------------------------------------------------
Model
------------------------------------------------------------------------
"""
from flask import session
fro... | true |
c074010ad401e92066638983d401d15178bd19b0 | asxzhy/Leetcode | /leetcode/question_1309/solution_2.py | UTF-8 | 595 | 3.921875 | 4 | [] | no_license | """
modified the if statement. Now the if statement only takes one condition
"""
class Solution:
def freqAlphabets(self, s: str) -> str:
result = ""
i = 0
while i < len(s):
# check if the second index after is a "#". If so, treat the next two numbers as one number
... | true |
f4aa50757c22157f203838ec2ee7303e1d0ecede | AshwinBaraskar/Basic-Python-Projects | /Data_Types/tuple.py | UTF-8 | 559 | 3.703125 | 4 | [] | no_license | # t=10, 20,30, 40 #creation of multivalue tuple, paranthesis are optionl
# print(t, type(t))
# t=(10)
# print(t, type(t))
# t=(10,)
# print(t, type(t))
# t=10,
# print(t, type(t))
#list=[1,2,3,4,5]
# print(tuple(list))
#
# t=tuple(range(10, 20, 2))
# print(t)
# tuple = (10,20,30,40,50,60,"AA", "3283","AA","XYZ", "... | true |
9b37cccd662b3dcc4643dd686c4971f60385748f | ken2057/genetic-algorithm | /findingPath_genetic/func.py | UTF-8 | 1,238 | 3.09375 | 3 | [] | no_license | import math
import numpy as np
from configs import *
from wall import Wall
def createGoodWall(finishPos):
wall = Wall(finishPos[0]-5, finishPos[1]-5, finishPos[2], finishPos[3])
wall.image.fill(pg.Color('red'))
good_wall_list.add(wall)
def randomAngle():
angle = np.random.uniform(0, 2.0*math.pi)
#angle = (np.ran... | true |
0a5c2bd8de5b1c9d4b9a3db1791d05ecfc2f844e | ogulcanozdemir/isolated-slr | /datasets/dataset_lstm.py | UTF-8 | 3,721 | 2.609375 | 3 | [] | no_license | from datasets.dataset import GenericDataset
from utils.constants import SamplingType
from utils.logger import logger
import torch
class DatasetLSTM(GenericDataset):
def __init__(self,
root_dir,
dataset='',
test_mode=False,
split=None,
... | true |
84443f793ed34f1563ead9cf79efeb398f1c3158 | xsank/cabbird | /leetcode/two_sum.py | UTF-8 | 620 | 3.3125 | 3 | [] | no_license | def twoSum(num, target):
dic = {}
res = []
for index, item in enumerate(num):
dic[index + 1] = item
sorted_dict = sorted(dic.iteritems(), key=lambda v: v[1], reverse=False)
head = 0
tail = len(sorted_dict) - 1
while head < tail:
hn = sorted_dict[head][1]
tn = sorted_d... | true |
c150eee5ceec4ace1743873b35ae59f8b3eb3f15 | DyubVlad/ozon-categorys | /Classificator/textsDB.py | UTF-8 | 10,991 | 2.5625 | 3 | [] | no_license | import sqlite3
import traceback
import sys
import os
import re
from collections import namedtuple
import bs4
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Embedding, Conv1D, GlobalMaxPooling1D
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow... | true |
b4eea5d106c2b0c91ac9f423051cf0d345d80723 | sayantanauddy/raspberry_pi | /scripts/socket-remote-pi/robot-remote-control-server.py | UTF-8 | 3,813 | 3.046875 | 3 | [] | no_license | #!/usr/bin/env python
''' Author - Sayantan Auddy'''
''' Server script - Listens for incoming client connections,
receives the command (left, right, forward, back, stop)
and executes the appropriate motor commands. The logic
can be extended to utilize the ultrasonic sensors to
detect obstacles and s... | true |
d613e1e71d12297274a534a06f898d50b27a1ab3 | A-Ryan-Noble/openApp_coding | /part_two/part_two.py | UTF-8 | 1,260 | 3.75 | 4 | [] | no_license | from tests import ALG_ONE_TESTS
def get_total_identical_pairs(list_of_numbers):
"""
Given an array of integers
Return the amount of "GOOD" pairs in the array
Where list_of_numbers[a] == list_of_numbers[b] and a < b
"""
pairs = 0
# Loop through the list of number
for a in range(len(li... | true |
0872190a7dab557940fbf1812cc7a116417b5014 | mpawn/Test | /0308_GamePk/_0308_GamePk.py | UTF-8 | 1,036 | 4.15625 | 4 | [] | no_license | import time
import random
player_victory = 0
enemy_victory = 0
while True:
for i in range(1,4):
time.sleep(1.5)
print(' \n——————现在是第 {} 局——————'.format(i))
player_life = random.randint(100,150)
player_attack = random.randint(30,50)
enemy_life = random.randint(100,150)
... | true |
2c96a6b9d86c767efb9344db631e78e079f8e6eb | minhkstn/pc2vid | /to_json.py | UTF-8 | 1,354 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | """Numpy to Javascript (JSON) conversion
Assumes numpy matrices are nx8 where first 3 columns contain x, y, z
respectively. Checks for `data/*.npy` by default, below. Uses the filename,
stripped, for the data dictionary key.
Remember that classes 1, 2, 3 are colored red, green, blue respectively.
All other classes ar... | true |
1d27b9cc719b028dd9ef1bd3a5b9ba971ef0dd40 | UpSea/PhotoOrganizer | /src/genericdialogs/Progress.py | UTF-8 | 10,184 | 3.125 | 3 | [] | no_license | from PyQt4 import QtCore, QtGui
from threading import Event as thread_Event
import sys
class ProgressDialog(QtGui.QDialog):
"""A generic progress dialog box that can be used to monitor the progress
of an arbitrary number of processes. The processes will be executed in
separate threads and their pr... | true |
a333c367a4158b4c643eff3dc661ad40369af74d | BlackTimber-Labs/DemoPullRequest | /Python/Passwordgen.py | UTF-8 | 1,175 | 3.0625 | 3 | [
"MIT"
] | permissive | import array
import random
MAX_LEN = int(input("Enter the length of req password: "))
DIGITS = ['0','1','2','3','4','5','6','7','8','9']
LOCASE_CHARACTERS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w', 'x', '... | true |
33786208d0100c27bce8db6efb8c374bed7cd671 | joaopver10/Python-EstruturaDeDados | /Filas/Filas.py | UTF-8 | 1,356 | 3.71875 | 4 | [
"MIT"
] | permissive | import numpy as np
class FilaCircular:
def __init__(self, capacidade):
self.capacidade = capacidade
self.inicio = 0
self.final = -1
self.numero_elementos = 0
self.valores = np.empty(self.capacidade, dtype=int)
def __filaVazia(self):
return self.numero_elementos... | true |
55bd236aac8e35a21fc4c4df28c43d83c4d1f91d | satato/old-python-projects | /LoopProj01.py | UTF-8 | 1,640 | 3.890625 | 4 | [] | no_license | __author__ = 'Amber Melton'
for x in range(0,10):
print("Amber")
for num in range(1, 101):
if num != 100:
print(num, end=" ")
else:
print(num)
for num in range(1, 101):
if num % 2 == 0 and num != 100:
print(num, end=" ")
elif num == 100:
print(num)
for num in ... | true |
7a723f1a1a83310925095b30467855095ac83b98 | rishabkatta/Game-AI-Agent | /agent1.py | UTF-8 | 16,212 | 2.875 | 3 | [] | no_license | '''
@author-name: Rishab Katta
@author-name: Akhil Karrothu
Game AI Agent for achieving a high score on Atari Berzerk - Agent 1
'''
import argparse
import sys
# import pdb
import gym
from gym import wrappers, logger
from queue import PriorityQueue
import math
class Agent(object):
"""The world's s... | true |
c0815dad0bb895436ac8dab7b78126e02570308f | natanchagas/HackerRank | /30 Days of Code/Python/Day 10 - Binary Numbers.py | UTF-8 | 325 | 2.75 | 3 | [] | no_license | #!/bin/python3
import math
import os
import random
import re
import sys
if __name__ == '__main__':
n = int(input())
value = bin(n)[2:]
value = value.split('0')
maximum = 1
for item in value:
if len(item) > maximum:
maximum = len(item)
print(max... | true |
cf93740503b85216f37531b559d79153d119e197 | EvgeniyaKomaltilova/task_manager | /tasks/tests.py | UTF-8 | 10,529 | 2.5625 | 3 | [] | no_license | import json
from datetime import date, timedelta
import requests
from django.contrib.auth.models import User
from django.test import TestCase, LiveServerTestCase
from tasks.models import Task, History
class TaskModelTest(TestCase):
"""Task model testing"""
def test_task_object_was_created(self):
"""t... | true |
0215b6ed009b818ddbbf969ea2ca8e5e64db7921 | bunshue/vcs | /_4.python/__code/Python大數據特訓班(第二版)/ch06/dfclean1.py | UTF-8 | 345 | 3.625 | 4 | [] | no_license | import pandas as pd
# 讀取資料
df = pd.read_csv('customer.csv')
# 空值的處理
print('各個欄位有空值的狀況:')
print(df.isnull().sum())
print('有空值的記錄筆數:', df.isnull().any(axis=1).sum())
print('有空值的欄位數:', df.isnull().any(axis=0).sum())
print('age欄有空值的記錄:')
print(df[df['age'].isnull()]) | true |
e825ccd6b595e0ab18741a5c4678ceb436b5e244 | jordanwong1202/180DA-WarmUp | /task4.py | UTF-8 | 2,612 | 2.625 | 3 | [] | no_license | from __future__ import print_function
import cv2
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
#This coding used below link as the reference
#credit to: https://code.likeagirl.io/finding-dominant-colour-on-an-image-b4e075f98097
#credit to: https://www.youtube.com/watch?v=1FJWXOO... | true |
3f0b95ab3dbf30d139671ddf3b4f155774b5d885 | inumoa/AtCoder | /ohter contest/mitsui_B.py | UTF-8 | 244 | 3.375 | 3 | [] | no_license | N = int(input())
if N/1.08 == -(-N//1.08):
print(int(N/1.08))
# もとの数の商より大きく,+1の商より小さい整数
else:
if not -(-N//1.08) == -(-(N+1)//1.08):
print(int((N+1)//1.08))
else:
print(':(') | true |
24808c7a7a4de6ba0f6a76891803f5c342d2bad7 | zhangxieyang2/answer-sentence-selection | /train.py | UTF-8 | 5,765 | 2.546875 | 3 | [] | no_license | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchtext import data
import random
from model import ESIM
from model import FocalLoss
import os
import time
from torchtext import vocab
import re
SEED = 2020
torch.manual_seed(SEED)
torch.cuda.manual_seed(SEED)
torch.b... | true |
d1c1c66059b6b00c1d7e18eae8a26959ae2f1673 | rbharath/switch | /Switch/muller_potential.py | UTF-8 | 3,761 | 2.609375 | 3 | [
"BSD-2-Clause"
] | permissive | """Propagating 2D dynamics on the muller potential using OpenMM.
Currently, we just put a harmonic restraint on the z coordinate,
since OpenMM needs to work in 3D. This isn't really a big deal, except
that it affects the meaning of the temperature and kinetic energy. So
take the meaning of those numbers with a grain o... | true |
d9aad399c5cc163721999681366e2d493a41e723 | corona10/dc_cnu | /dc06/receiver.py | UTF-8 | 2,753 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | import os
import socket
import sys
import time
from struct import *
UDP_IP = ""
UDP_PORT = 5005
BUFFER_SIZE = 1472
class AckFrame(object):
def __init__(self, *args, **kwargs):
if 'ack' in kwargs:
self.ack = kwargs['ack']
if 'buf' in kwargs:
fmt = "!I"
data = unpack(fmt, buf)... | true |
da3c4953f746b3402b551b1658139d824e84e124 | luelhagos/CodeBat_Answers | /String-1/first_two.py | UTF-8 | 82 | 2.8125 | 3 | [] | no_license | def first_two(str):
leng=len(str)
if leng<=2:
return str
return str[:2]
| true |
be010ce01a275011f88a47094e831a3dfc9a66bb | hacg95/uberOOP | /Python/uberBlack.py | UTF-8 | 318 | 2.859375 | 3 | [] | no_license | from car import Car
class UberBlack(Car):
typeCarAccepted = []
seatsMaterial = []
def __init__(self, driver, license, passenger, typeCarAccepted, seatsMaterial):
super().__init__(driver, license, passenger)
self.typeCarAccepted = typeCarAccepted
self.seatsMaterial = seatsMaterial | true |
63d3fd7e3f694157f99e91be4325b6c20e31d65e | kexiaomeng/python | /com/sun/network/simpleModel.py | UTF-8 | 243 | 2.53125 | 3 | [] | no_license | from urllib import request, parse
url = 'http://www.httpbin.org/get'
parms = {
'name1' : 'value1',
'name2' : 'value2'
}
queryString = parse.urlencode(parms)
u = request.urlopen(url+'?'+queryString)
resp = u.read()
print(resp)
| true |
61a8e92e279edc9df71f800c0590cdba106c9058 | rodoufu/challenges | /urionlinejudge/class01/3005.py | UTF-8 | 546 | 2.640625 | 3 | [] | no_license | # solved
n = int(input())
for _ in range(n):
blocks = list(map(int, input().replace('\n', '').split(' ')))
blocks = [list(blocks[:3]), list(blocks[-3:])]
resp = 0
for i in range(len(blocks[0])):
for j in range(len(blocks[0])):
if i == j:
continue
for k in range(len(blocks[1])):
for l in range(len(b... | true |
41156623235d0bd34d4124216bc617cce9a8a690 | ypwalter/poc | /filter.py | UTF-8 | 1,432 | 2.984375 | 3 | [] | no_license | # read manifest - test_name,characterist1,characterist2,...
manifest = []
with open('manifest', 'r') as f:
for line in f:
if not line.startswith("#") and not line.strip() == "":
manifest.append(line.strip())
# extract test characteristics - {"test_name", "characterist1,characterist2,..."}
tests =... | true |
d5c3f4837ceb93c1e70108cba829a5107e5856a7 | maheshdhaka147/Automatic-License-Plate-Recognition | /licenseplaterecognition.py | UTF-8 | 17,493 | 3.0625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 06:33:28 2019
@author: MaheshDhaka
"""
import cv2
import numpy as np
from operator import itemgetter
import statistics
import pickle
import tkinter as tk
from tkinter import filedialog
############################## Begin Load an Image
window ... | true |
92dd60b93316e1f2d3c396183fc8e8a8dfe4dbd5 | IrrigationEngineer/Surveyor | /src/modules/location.py | UTF-8 | 3,972 | 2.765625 | 3 | [] | no_license |
#from database import *
#MY STUFF
from helpers import *
import googlemaps
config = importYaml('configs/config')
gmaps = googlemaps.Client(key=config['keys'][0])
import os
#class Location(Base): as a db class
class Location:
#SETUP TABLE COLUMNS
#SQLALCHEMY
#__tablename__ = 'location'
#id = Co... | true |
b1a50916f371cabc7c8825296a91961b12baa9ae | awforsythe/async-resource-updates | /webapp/views/images.py | UTF-8 | 3,975 | 2.53125 | 3 | [] | no_license | import base64
import hashlib
from io import BytesIO
from flask import request, send_file
from flask_restful import Resource, reqparse
from werkzeug.datastructures import FileStorage
from .. import db, rest
from ..models import Image, Item
from ..util import listing, success, failure, status_204
def read_image(file)... | true |