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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
79a1048e696bcf2331711d32b09d8dd009c014f7 | Python | jasonwyse2/marketmaker | /marketmaker/Sqlite3.py | UTF-8 | 7,760 | 2.671875 | 3 | [] | no_license | import sqlite3
from marketmaker.tool import get_local_datetime
import pandas as pd
class Sqlite3:
tableName = 'bitasset_order'
def __init__(self, dataFile=None):
if dataFile is None:
self.conn = sqlite3.connect(":memory:")
else:
try:
self.conn = ... | true |
0aee5db8462a9f50bb266c894f0028cc3e72e015 | Python | JohanCamiloL/general-algorithms | /linear-search/python/linear-search.py | UTF-8 | 507 | 4.53125 | 5 | [] | no_license | def linearSearch(array, value):
"""
Linear search algorithm implementation.
Parameters
----------
array: list
List of elements where search will be made.
value: int
Value to be searched.
Return
------
int
Element index on array, if not found returns -1.
... | true |
2c020bac5633736175928bfe17fed75cb945abf6 | Python | esuteau/car_behavioral_cloning | /model.py | UTF-8 | 6,803 | 2.859375 | 3 | [] | no_license | import csv
import os
import cv2
import numpy as np
import sklearn
import random
from keras.models import Sequential
from keras.layers import Flatten, Dense, Activation, Dropout
from keras.layers import Convolution2D, Cropping2D
from keras.layers.pooling import MaxPooling2D
from keras.layers.core import Lambda
from ker... | true |
cc901426651f5ae9f0e55986ee168e6593dcf900 | Python | MrDetectiv/fb-labs-2020 | /cp_4/cp-4_Litvinchuk_FB-81/main.py | UTF-8 | 4,924 | 3.203125 | 3 | [] | no_license | import random
def gen_random(a,b):
return random.randint(a,b)
def euclid_NSD(a,b):
if a == 0:
x, y = (0, 1)
return b, x, y
d, x1, y1 = euclid_NSD(b % a, a)
x = y1 - (b // a) * x1
y = x1
return d, x, y
def NSD(a,b):
r = euclid_NSD(a,b)
return r[0]
def mod_pow(x, a, m):... | true |
6ddf77a12196ce4589777bb113385173f2c982a5 | Python | adm1n123/FoodOn_LOVE_model | /word2vec.py | UTF-8 | 5,802 | 2.734375 | 3 | [] | no_license | """
Download glove word embeddings and convert then to get word2vec embeddings.
"""
import io
import requests
import zipfile
import numpy as np
import pandas as pd
from gensim.models import Word2Vec, KeyedVectors
from gensim.models.word2vec_inner import REAL
from gensim.scripts.glove2word2vec import glove2word2vec
from... | true |
efcec9948b66df86eb3c892a3c53c1208ccd3d1c | Python | sumonkhan79/DataScience-Random | /assignment1.py | UTF-8 | 134 | 3.265625 | 3 | [] | no_license | def profit(revenue, expense):
profit_made= revenue-expense
return profit_made
profit_2018 = profit(100, 90)
print(profit_2018) | true |
0b6e59dc34a33b978dbcf8b8704dd35cdf33c4d7 | Python | nch101/thesis-traffic-signal-control | /projectTS/modeControl/automaticFlexibleTime.py | UTF-8 | 1,093 | 2.53125 | 3 | [] | no_license | # ** automatic control mode **
# * Author: Nguyen Cong Huy *
# ****************************
# - *- coding: utf- 8 - *-
import projectTS.vals as vals
def automaticFlexibleTime():
for index in range(0, vals.nTrafficLights):
if index%2:
setTimeLight(vals.timeGreenFlexibleNS, vals.timeGreenFlexi... | true |
edb490956711249067a6d71d5e5d45e3477d4596 | Python | evyadai/GSR | /InstancePieceWiseLinear.py | UTF-8 | 14,028 | 2.765625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 26 19:11:00 2016
@author: Evyatar
"""
from math import *
import numpy as np
np.random.seed(1)
import scipy
from Instance import *
from Linear import *
from PieceWiseLinear import *
import matplotlib
import matplotlib.mlab as mlab
# insert "%matplotl... | true |
22421d0a55124e1ffe0095490d42f73d826ef6ff | Python | ShivamRohilllaa/python-basics | /20) List and functions.py | UTF-8 | 236 | 4.09375 | 4 | [] | no_license | # Its starts with 0
grocery = ["Shivam", "rohilla", "text1", "text2" ]
#print(grocery[1])
#print(grocery[1] + grocery[2])
#Sort the list means arrange the list in ascending order
list = [1, 2, 88, 23, 56 ]
list.sort()
print(list)
| true |
02475b83a369c1a8eb50cc392360cbf585d401fb | Python | FHArchive/StegStash | /stegstash/lsb.py | UTF-8 | 3,338 | 2.984375 | 3 | [
"MIT"
] | permissive | """ common lsb functions """
from random import SystemRandom
from stegstash.utils import toBin, toFile, getMap, otp
class LSB:
"""Perform lsb encoding and decoding on an array
"""
def __init__(self, array, pointer=0, data=None):
self.array = array
self.arrayLen = len(array)
self.pointer = pointer
self.data ... | true |
9ba4a88d011864adb52140144afc41bc18aebc1d | Python | beeware/toga | /gtk/tests/widgets/utils.py | UTF-8 | 1,014 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | class TreeModelListener:
"""useful to access paths and iterators from signals."""
def __init__(self, store=None):
self.changed_path = None
self.changed_it = None
self.inserted_path = None
self.inserted_it = None
self.deleted_path = None
if store is not None:
... | true |
98d5caf14526d3ce3dde7f979a9170cea12aac6b | Python | hemae/neural_networks | /add_ex1_grad_des.py | UTF-8 | 1,431 | 3.140625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import time
def f(x):
return x * x - 5 * x + 5
def df(x):
return 2 * x - 5
N = 100 # число итераций
xn = 0 # начальное значение x
lmd = 0.8 # шаг сходимости (коэффициент)
x_plt = np.arange(0, 5.0, 0.1)
f_plt = [f(x) for x in x_plt]
plt.ion() # вклю... | true |
da0c4a75a88d1030e14d01006201711eaf476552 | Python | VimalanKM/Tic-Tac_Toe-GAME | /playing_tictactoe.py | UTF-8 | 1,989 | 3.53125 | 4 | [
"Apache-2.0"
] | permissive | import random
import numpy as np
#random.seed(1)
def create_board():
return np.zeros((3,3),dtype=int)
def place(board,player,position):
board[position]=player
def possibilities(board):
indi=np.where(board==0)
return (list(zip(indi[0],indi[1])))
def random_place(board,player):
av... | true |
aabffba1d6138ad6cac53beaa334e752ddf0294b | Python | VishnuK11/Computer_Vision | /16 Face Train.py | UTF-8 | 1,497 | 3.078125 | 3 | [
"MIT"
] | permissive | '''
Face Recogition Training
Create a list of images to train
Detect a R.O.I - Region of Interest
Train it
Save classififier, features and labels
'''
import os
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
dir_path = os.getcwd()+'/data/images/'
dir_face = os.getcwd()+'/data/face_recognition/'
... | true |
db7d8834d7518aa59f52f7e83e90c8212717722a | Python | ppershing/skripta-fmfi | /krypto2/utility/13_kryptoanalyza/linear.py | UTF-8 | 6,516 | 3.125 | 3 | [] | no_license | #!/usr/bin/python
# coding=utf-8
from cipher import *;
def LAT(inputs, outputs):
return int(round(sum(map(lambda x:
(-1)**(parityOf(x & inputs) ^
parityOf(Sbox(x) & outputs)),
range(16)
))))
def get_LAT_color(value):
value = ma... | true |
7afda2050a995a0990b4b756c81a06bfb8976577 | Python | sonkarsr/IPNV | /circles.py | UTF-8 | 159 | 2.609375 | 3 | [] | no_license | image = np.zeros((512,512,3), np.uint8)
cv2.circle(image, (350, 350), 100, (15,75,50), -1)
cv2.imshow("Circle", image)
cv2.waitKey(0)
cv2.destroyAllWindows() | true |
b98ea54e836635b150df9e96322b4be1bdfba2bf | Python | deepset-ai/haystack | /haystack/utils/preprocessing.py | UTF-8 | 8,303 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | from typing import Callable, Dict, List, Optional
import re
import logging
from pathlib import Path
from haystack.schema import Document
logger = logging.getLogger(__name__)
def convert_files_to_docs(
dir_path: str,
clean_func: Optional[Callable] = None,
split_paragraphs: bool = False,
encoding: O... | true |
7d99f880d77a194488849bc0735d34e33d53e5a8 | Python | shg9411/algo | /algo_py/boj/bj1275.py | UTF-8 | 1,226 | 2.875 | 3 | [] | no_license | import math
import sys
input = sys.stdin.readline
def init(arr, tree, node, s, e):
#print(node, s, e)
if s == e:
tree[node] = arr[s]
return tree[node]
m = (s+e)//2
tree[node] = init(arr, tree, node*2, s, m) + \
init(arr, tree, node*2+1, m+1, e)
return tree[node]
def upda... | true |
d38ac3d576b17ea97f435453bb296a2897c34490 | Python | VladyslavHnatchenko/python_magic_methods | /next_methods.py | UTF-8 | 4,032 | 4.03125 | 4 | [] | no_license | from os.path import join
class FileObject:
""" The wrapper for the file object to ensure that the file will be closed upon deletion."""
def __init__(self, filepath='~', filename='sample.txt'):
# Open file filename in read and write mode
self.file = open(join(filepath, filename), 'r+')
de... | true |
620040475e190de356d58aee06a85a60cdca0160 | Python | n-simplex/Personal | /Image Processing/CircleMap.py | UTF-8 | 2,642 | 2.921875 | 3 | [] | no_license | import random
import math
import turtle
import winsound
import smtplib
import os
import time
import colorsys
global password
password = input('Enter password: ')
os.system('cls')
for i in range(0,100):
print('\n')
def email():
addr = 'iskym9@gmail.com'
msg = "\r\n".join([
"From: isky... | true |
1373c94e96ebe2eaa9e386857230558ba703098d | Python | arushibutan11/ASA | /ASA/loki.py | UTF-8 | 2,230 | 2.578125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import serial
import time
from pynmea import nmea
from django.shortcuts import render
import string
import math
def loki(bound_lat, bound_lon, bound_radius):
#Calculate Current Coordinates
port = serial.Serial("/dev/ttyAMA0",9600, timeout=3.0)
gpgga ... | true |
9d471e893b97b10e565de25ab89d6f8bf64b76e7 | Python | jlopez1328/Python | /Ejercicios_conceptos_basicos/cambio_moneda.py | UTF-8 | 147 | 3.25 | 3 | [] | no_license | dolares = float(input ("Digite la cantidad dolares \n"))
vdolares = 3981
cop = dolares * vdolares
print("Total de cantidad de dolares a COP", cop)
| true |
0a1d027425c6d39ee76e58c1e067b814b8ef418f | Python | Hsuxu/vision | /torchvision/prototype/transforms/_presets.py | UTF-8 | 2,764 | 2.765625 | 3 | [
"BSD-3-Clause",
"CC-BY-NC-4.0"
] | permissive | """
This file is part of the private API. Please do not use directly these classes as they will be modified on
future versions without warning. The classes should be accessed only via the transforms argument of Weights.
"""
from typing import List, Optional, Tuple, Union
import PIL.Image
import torch
from torch impor... | true |
6cc32fa383273440fa56b4a4af0190bcccc47240 | Python | dgoyard/caps-clindmri | /clindmri/plot/polar.py | UTF-8 | 3,771 | 2.75 | 3 | [] | no_license | ##########################################################################
# NSAp - Copyright (C) CEA, 2013 - 2016
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
###... | true |
f89a1f3985043c1aeb2490457ab83c9567c88801 | Python | cloud76508/Group_Learning | /single_digit/DeepLearning/show_images.py | UTF-8 | 371 | 2.625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 26 13:02:36 2021
@author: ASUS
"""
import matplotlib.pyplot as plt
import load_mat_single_digit as load_data
[x_train, y_train, x_val, y_val, x_test, y_test] = load_data.load_data(2)
# pick a sample to plot
sample = 5
image = x_train[sample]
# plot the sample
#fig = pl... | true |
f6f891f0ff70200667c4c1613e1ba2789aa32b45 | Python | LiXin-Ren/Algorithm_Examination | /8.25头条笔试/5yueshuChaxun.py | UTF-8 | 827 | 3.234375 | 3 | [] | no_license | """
已知一些形如"y = 4 - x"的约束条件,查询形如y-x的值
输入:
第一行为两个整数n,m,表示有n个已知的约束条件,有m个查询
接下来n行,形如"y = k - x",表示约束条件y = k - x,其中等号和剑豪前后一定有空格。y和x是变量名,由英文小写字母组成,长度不超过4
k是一个偶数(注意可能为负,负数的负号后没有空格)
接下来m行,形如"y-x",表示查询y-x的值。其中减号前后一定有空格。y与x是变量名,规则同上。输入数据保证不会产生冲突,不会无解。
输出:
对于每个查询,输出一个整数,表示y-x的值
若输入数据不足以推导出结果,则输出"cannot_answer"
示例:
input:
3 2
... | true |
cf50a7876274ab66ed66d22a5ef821383aeb04e9 | Python | adafruit/circuitpython | /tests/micropython/viper_types.py | UTF-8 | 412 | 3.765625 | 4 | [
"MIT",
"GPL-1.0-or-later"
] | permissive | # test various type conversions
import micropython
# converting incoming arg to bool
@micropython.viper
def f1(x: bool):
print(x)
f1(0)
f1(1)
f1([])
f1([1])
# taking and returning a bool
@micropython.viper
def f2(x: bool) -> bool:
return x
print(f2([]))
print(f2([1]))
# converting to bool within func... | true |
31ebd5a93b402261842eb0ba828c6a4be8f116e0 | Python | meshidenn/nlp100 | /chap_3/23.py | UTF-8 | 402 | 3.046875 | 3 | [] | no_license | import re
f = open('jawiki-england.txt','r')
g = open('jawiki-england-level-name.txt','w')
section = re.compile(r"=(=+)(.+)=\1")
for line in f:
m = re.match(section, line)
if m:
level = int(line.count('=')/2 - 1)
# name = re.sub("=",'', m.group(1))
print('%s,level:%d' % (m.group(2),lev... | true |
a552f1c68ee863da2db2b1cb17b5da54662f433e | Python | SuguruChhaya/SA-Volume-calculator | /final akashi project.py | UTF-8 | 7,440 | 3.0625 | 3 | [] | no_license | import math
from tkinter import *
from PIL import Image, ImageTk
root = Tk()
class Sphere():
def framework(self, root):
root.title("SA/V calculator")
# * Images
self.sphere_image = ImageTk.PhotoImage(Image.open('Sphere.png'))
self.pyramid_image = ImageTk.PhotoImage(I... | true |
b3a493071051fedc8352267aabb6455096ba77d6 | Python | chopper6/MPRI_community_detection | /page_rank.py | UTF-8 | 1,435 | 2.59375 | 3 | [] | no_license | import random as rd
from util import *
import numpy as np
def surf(G,params):
# where G should be a networkx DiGraph
# initialized with: node['rank'] = 0 for all nodes
# and seed should be a set of nodes
damping = params['damping']
seeds = G.graph['seeds']
node = rd.choice(seeds) #start_node
num_dead_ends = 0... | true |
b70599474775b42171be1f6ddc2e109f1f78fc14 | Python | PBDCA/changaizakhtar | /testListCalculater.py | UTF-8 | 1,915 | 2.78125 | 3 | [] | no_license | import unittest
from ListCalculater import (addMap,addReduce,addfilter,SubtractMap,SubtractReduce,MultiplyMap,MultiplyReduce,divideMap,divideReduce
,ExponentMap,ExponentReduce,MaxMap,MinReduce,SquareMap)
class TestCalculator(unittest.TestCase):
def testAddMap(self):
self.assertEqual([8,0],addMap([4,0],[4... | true |
23fd4ab94deed973cc038549505f525d6ab9cec5 | Python | sergeyerr/DCHelper_1.0 | /DCPlatform/ActiveHelper/MethodsSuggester.py | UTF-8 | 6,993 | 2.640625 | 3 | [] | no_license | from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import NearestNeighbors
from pymfe.mfe import MFE
from openml.tasks import TaskType
import pandas as pd
def get_features(task: TaskType, cached_metafeatures: pd.DataFrame, target: str = None):
"""
Возвращает метапризнаки данного датасета
... | true |
f7720ada6d8384b5dfa20c205c6dfbd4b809f7d3 | Python | tanhaipeng/XAPM | /ext-src/local_debug.py | UTF-8 | 2,149 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on 2017-12-27 12:46
@summary: XAPM Extension Log Parse Agent
@author: tanhp@outlook.com
"""
import json
LOG_FILE = "/tmp/trace.log"
def parse_log(path):
"""
parse trace log
:param path:
:return:
"""
trace_list = []
trace_one = []
with open(path) a... | true |
5d7bf10b0521a99a96f2082d6886bef153a1a1ab | Python | burtr/reu-cfs | /reu-cfs-2018/svn/simple/separated-int.py | UTF-8 | 1,235 | 3.6875 | 4 | [] | no_license | import numpy as np
# a program to find two integers with a given difference, given
# a set of integers
# hint: first sort the set of integers. then maintain two indices, i <= j,
# as j moves forward the gap between l[i] and l[j] increases, and as
# i moves forward the gap between l[i] and l[j] decreases.
# now search... | true |
9a76fbe3e67feb68bc1d0636c32c6effb901374c | Python | 8140171224/python3-learning | /ex4.1.py | UTF-8 | 388 | 4.15625 | 4 | [] | no_license | # The range() Function Few example.
for i in range(6):
print(i)
# below line '\n' means new lines
print('\n')
#range(5, 10)
for i in range(5, 10):
print(i)
# below line '\n' means new lines
print('\n')
#range(0, 20, 2)
for i in range(0, 22, 2):
print(i)
# below line '\n' means new lines
print('\n')
... | true |
8476664887edd2bb96d287263c5555b7c439f733 | Python | ryfeus/lambda-packs | /LightGBM_sklearn_scipy_numpy/source/sklearn/utils/tests/test_fixes.py | UTF-8 | 695 | 2.671875 | 3 | [
"MIT"
] | permissive | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import pickle
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.fixes import divide
from sklearn.utils.fixes import... | true |
70a004ef6282c6cdd923e7897660d142e1eb5324 | Python | Ouack23/FdL_Karna | /games/simon.py | UTF-8 | 3,886 | 3.078125 | 3 | [] | no_license | import logging, DMX, random, time, sys
from collections import OrderedDict
from array import array
from game import Game
def get_mode_list():
return ["RPI", "PC"]
class Simon(Game):
def __init__(self, mode="PC"):
Game.__init__(self, "Simon")
if mode in get_mode_list():
self.mode... | true |
1c2896e74136b561bb786f0bc67da46dcea77b44 | Python | wieczorekm/xml2json | /src/lexer.py | UTF-8 | 4,993 | 3.09375 | 3 | [] | no_license | from src.tokens import *
WHITESPACES = (' ', '\t', '\n')
class Lexer:
def __init__(self, source):
self.source = source
self.cursor = 0
def get_next_token(self):
self._shift_cursor_igonoring_whitespaces()
if self.cursor == len(self.source):
return EndOfTextToken()
... | true |
bac13d240d03a8d6fec788b95c8e2df3f785ce7a | Python | whitedevil369/Wautomsg-b0t | /Wautomsg-b0t.py | UTF-8 | 6,318 | 3.015625 | 3 | [] | no_license | import pyautogui
import time
import sys
from pyfiglet import Figlet
import argparse
#from positionfinder import positions
#from pynput.mouse import Listener
parser = argparse.ArgumentParser()
parser.add_argument("-s","--senderNumber", help="Enter your whatsapp number in the format <country_code><your_numbe... | true |
afe44b29090b5738ab4e21893297b6663b95e6f4 | Python | Quantumgame/dronestorm | /dronestorm/data_util.py | UTF-8 | 12,631 | 2.859375 | 3 | [] | no_license | """Defines utilities for processing data"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy.signal import convolve
from scipy.io.wavfile import read as wav_read
from scipy.io.wavfile import write as wav_write
AUDIO_SAMPLE_RATE = 44100 # standard 44.1kHz recording ... | true |
0ae04e76f4e09aaae0fc631dfadfdeb6bbc5266a | Python | mdaif/rock-paper-scissors | /rock_paper_scissors.py | UTF-8 | 1,965 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import argparse
import logging.config
from components import ConsoleUserChoice, ConsoleResultHandler
from constants import SUPPORTED_GAME_FLAVORS
from engine import Engine
def get_game_rules(flavor):
return SUPPORTED_GAME_FLAVORS[flavor][0]()
def get_game_description(flavor):
return SUPPORTED_GAME_FLAVORS[... | true |
5209b6201b59d86ec998a28a58184183ad14c925 | Python | yiming1012/MyLeetCode | /LeetCode/双指针(two points)/面试题 16.06. 最小差.py | UTF-8 | 1,585 | 3.953125 | 4 | [] | no_license | """
面试题 16.06. 最小差
给定两个整数数组a和b,计算具有最小差绝对值的一对数值(每个数组中取一个值),并返回该对数值的差
示例:
输入:{1, 3, 15, 11, 2}, {23, 127, 235, 19, 8}
输出:3,即数值对(11, 8)
提示:
1 <= a.length, b.length <= 100000
-2147483648 <= a[i], b[i] <= 2147483647
正确结果在区间 [0, 2147483647] 内
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/smallest-difference-l... | true |
62df48bd12e12aab9c901efcf91fcd0b5b237356 | Python | nicovandenhooff/project-euler | /solutions/p17.py | UTF-8 | 4,278 | 4.4375 | 4 | [] | no_license | # Project Euler: Problem 17
# Large sum
# Author: Nico Van den Hooff
# Github: https://github.com/nicovandenhooff/project-euler
# Problem: https://projecteuler.net/problem=17
# Note: This could likely be done with a combinatorics solution,
# but I decided to brute force it for fun so that I could
# practic... | true |
88527352a81581adb60af798afdc751adda3caaa | Python | khammernik/medutils | /medutils/optimization/base_optimizer.py | UTF-8 | 992 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | """
This file is part of medutils.
Copyright (C) 2023 Kerstin Hammernik <k dot hammernik at tum dot de>
I31 - Technical University of Munich
https://www.kiinformatik.mri.tum.de/de/hammernik-kerstin
"""
import numpy as np
class BaseOptimizer(object):
def __init__(self, mode, lambd, beta=None, tau=None):
s... | true |
ce6d068438d20162b81b7de12f78acae1fdc521b | Python | Drymander/Halo-5-Visualizaing-Skill-and-Predicting-Match-Outcomes | /unused files/get_player_list.py | UTF-8 | 520 | 3.4375 | 3 | [] | no_license |
# Function to combine all gamertags from the match and prepare them in string
# format for the next API call
def get_player_list(df):
# Create list from our df['Gamertag'] column and remove the brackets
player_list = str(list(df['Gamertag']))[1:-1]
# Format string for API
player_list = player... | true |
a23f6d1656ceab873cc19921fd9e82ba44339a20 | Python | Aasthaengg/IBMdataset | /Python_codes/p02844/s351087158.py | UTF-8 | 525 | 2.5625 | 3 | [] | no_license | N=int(input())
S=input()
code=list(set(list(S)))
ans=0
for i in code:
for j in code:
for k in code:
count=0
for s in S:
if count==0:
if s==i:
count+=1
elif count==1:
if s==j:
... | true |
9a5c641985c8fd840d5c600c2185b7984dd7a60e | Python | yejiin/Python-Study | /algorithm/Programmers/Lv1/체육복.py | UTF-8 | 403 | 2.65625 | 3 | [] | no_license | def solution(n, lost, reserve):
answer = 0
data = [1] * (n + 2)
for i in lost:
if i in reserve:
reserve.remove(i)
else:
data[i] = 0
reserve.sort()
for i in reserve:
if data[i - 1] == 0:
data[i - 1] = 1
elif data[i + 1] ==... | true |
efea7190b02bc29602a44598b380a25cd9817d22 | Python | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_135/3229.py | UTF-8 | 536 | 3.15625 | 3 | [] | no_license | def solve(ix):
R0 = int(raw_input().strip())
M0 = [map(int, raw_input().strip().split()) for _ in range(4)]
R1 = int(raw_input().strip())
M1 = [map(int, raw_input().strip().split()) for _ in range(4)]
intersect = list(set(M0[R0-1]) & set(M1[R1-1]))
if len(intersect) == 1:
ans = inter... | true |
b1cc81a37c30396f46397a7b505c9e34a9d568f0 | Python | EoinDavey/Competitive | /AdventOfCode2020/d11.py | UTF-8 | 1,702 | 3.28125 | 3 | [] | no_license | import sys
from collections import defaultdict
def lines():
return [line.strip() for line in sys.stdin]
mvs = [(0, 1), (1, 0), (0, -1), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
ogboard = [list(x) for x in lines()]
H = len(ogboard)
W = len(ogboard[0])
def valid(x, y):
return 0 <= x < H and 0 <= y < W
def new... | true |
d96d1f1113343f658eb39be0d5db2c59bd0f2072 | Python | ahmed3moustafa/COVID-19-CNN | /audio_convolutional.py | UTF-8 | 4,399 | 3.015625 | 3 | [] | no_license | import json
import numpy as np
from sklearn.model_selection import train_test_split
import tensorflow.keras as keras
import matplotlib.pyplot as plt
DATASET_PATH = "data.json"
def load_data(dataset_path):
with open(dataset_path, "r") as fp:
data = json.load(fp)
# convert json to numpy a... | true |
7ac1c19b8a2fba92213269cd683e407fa69924a4 | Python | BastianRamos/proyectoGrupo3 | /webprocess/core/models.py | UTF-8 | 2,967 | 2.625 | 3 | [] | no_license | from django.db import models
# Create your models here.
#Declaramos una clase por cada tabla de nuestro modelo de datos.
#Django genera una ID automatica y autoincrementable para cada tabla.
#python manage.py makemigrations <--- Lee el archivo models y crea una migración.
#python manage.py migrate <--- Toma las migrac... | true |
fa4253ee4c4ce5dc9a005f6da1ddd6ee81141a8c | Python | paulywog13/web-scraping-challenge | /Mission_to_Mars/app.py | UTF-8 | 1,441 | 2.625 | 3 | [] | no_license | from flask import Flask, render_template, redirect
from flask_pymongo import PyMongo
import mars_facts
import mars_news
import mars_space_images
import mars_hemispheres
# Create an instance of Flask
app = Flask(__name__)
# Use PyMongo to establish Mongo connection
mongo = PyMongo(app, uri="mongodb://localhost:27017/m... | true |
d5b98c2eb6e28755c8cfc6903ec1f269fbe93002 | Python | thdk0302/Python-Libraries | /lib/log.py | UTF-8 | 1,162 | 2.875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
def write(text=' '):
import datetime, os
time = datetime.datetime.today()
path = "./log/new/" + time.strftime("%Y//%m//%d")
if not os.path.exists(path):
os.makedirs(path)
f = open(time.strftime("./log/new/%Y/%m/%d/%H:%M.log"), 'a')
f.write(text)
f.close()
def ... | true |
e044f3ddb82eda1edfeb7984f1ebc514cc38e0d1 | Python | roblevy/async-and-sync | /test.py | UTF-8 | 1,981 | 3.359375 | 3 | [] | no_license | """ See https://stackoverflow.com/questions/58564687/test-if-coroutine-was-awaited-or-not/58567980#58567980 """
import asyncio
import pytest
from functools import wraps
class Wrapper:
def __init__(self, _func, *args, **kwargs):
self._conn = None
self._func = _func
self.args = args
... | true |
bc2dd63977be08619068c82a91ed65db0463b8dd | Python | gupy-io/mentoria-python | /palestras-conversas/testador_de_codigo/testa_v1.py | UTF-8 | 1,899 | 2.8125 | 3 | [
"MIT"
] | permissive | import importlib
import inspect
import sys
import os
import re
from collections import defaultdict
from pathlib import Path
from pprint import pprint
def testa_v1_coletador(pasta):
testes = []
lista_nome_dos_testes = []
for arquivo_de_teste in Path(pasta).glob("teste_*.py"):
modulo_de_testes = imp... | true |
8e2edca4c167da0f3bc013f0d25653c32f4141e2 | Python | Rallkus/DjangoRestFrameworkReactMobX | /backend/conduit/apps/contact/serializers.py | UTF-8 | 1,454 | 2.78125 | 3 | [] | no_license | from rest_framework import serializers
class ContactSerializer(serializers.Serializer):
email = serializers.CharField(max_length=255)
subject = serializers.CharField(max_length=255)
message = serializers.CharField(max_length=255)
def validate(self, data):
print "*************"
print da... | true |
f67614a4024c7dc5698881c7b2332ea05ffeea08 | Python | JasonYG/capital-one-technical-assessment | /main.py | UTF-8 | 2,577 | 3.375 | 3 | [] | no_license | # Capital One Technical Assessment
# Created by Jason Guo
#
# This program, alongside the AnalyzeCode class, was my interpretation of
# the Capital One technical assessment.
#
# In the context of automation and continuous deployment, this program
# was written to take in the source code files as command-line arguments... | true |
4ab3521ac08a91d547c109b962b0fde47bb84762 | Python | cosmos454b/notebooks | /DataPreprocessing.py | UTF-8 | 1,733 | 3.359375 | 3 | [] | no_license | ### Common Steps to preprocess data for machine learning
### Import Libraries
import numpy as np
import pandas as pd
from sklearn.preprocessing import Imputer
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import OneHotEncoder,LabelEncoder
from sklearn.model_selection import train_test_s... | true |
84199e8ae8b5f443ea8980ae788a5804502095c3 | Python | johSchm/bayesLearner | /src/fileParser.py | UTF-8 | 712 | 3.375 | 3 | [] | no_license |
# parser for any file
# read file and save output in 2D array
# @return: 2D array
def readFile(filePath):
with open(filePath, 'r') as file:
line_array = file.read().splitlines()
cell_array = [line.split() for line in line_array]
file.close()
return cell_array
# store d... | true |
83633a9b08c6289af0f0436bdedc7cb63ec982d6 | Python | Wizmann/ACM-ICPC | /Leetcode/Algorithm/python/3000/02278-Percentage of Letter in String.py | UTF-8 | 150 | 3.109375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | class Solution(object):
def percentageLetter(self, s, letter):
n = len(s)
c = s.count(letter)
return 100 * c / n
| true |
4d8e9110fb18849031778092648c6bf9634df4bf | Python | jlongtine/cfn-python-lint | /test/module/conditions/test_condition.py | UTF-8 | 11,902 | 2.5625 | 3 | [
"MIT-0"
] | permissive | """
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... | true |
dca4c5d9009525d9c67d864514a7d16a16e20db4 | Python | sstuteja/UDACITY_CARND | /Term1/Project5/lesson_functions.py | UTF-8 | 11,751 | 2.71875 | 3 | [] | no_license | import matplotlib.image as mpimg
import numpy as np
import cv2
from skimage.feature import hog
###############################################################################
# Define a function to return HOG features and visualization
def get_hog_features(img, orient, pix_per_cell, cell_per_block,
... | true |
e1272331e5405e263242cf3240f971ed4e08f8c5 | Python | arifikhsan/python-dicoding | /conditional/else.py | UTF-8 | 346 | 3.703125 | 4 | [] | no_license | amount = int(input("Enter amount: "))
if amount < 1000:
discount = amount * 0.05
print("Discount", discount)
else:
discount = amount * 0.10
print("Discount", discount)
print ("Net payable:",amount-discount)
a = 8
if a % 2 == 0:
print('bilangan {} adalah genap'.format(a))
else:
print('bilangan {} ... | true |
be94469be48faa8f5c0d91484d8bd7da17757bf7 | Python | MehdiJenab/first_spark_code | /q5_b.py | UTF-8 | 1,384 | 2.734375 | 3 | [
"MIT"
] | permissive |
from pyspark.sql import SparkSession
from pyspark.sql.functions import *
from pyspark.sql.types import *
spark = SparkSession.builder.master("local[1]") \
.appName("Q5_a") \
.getOrCreate()
spark.sparkContext.setLogLevel("WARN") # to turn off annoying INFO log printed out on terminal
schema_user = St... | true |
324d30f70d167c4246d31e8ea65f64b0c7fa7800 | Python | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/abc041/D/4201470.py | UTF-8 | 940 | 2.6875 | 3 | [] | no_license | # coding:utf-8
import sys
from collections import deque, defaultdict
INF = float('inf')
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(... | true |
00598b57b0319a972a8fe8b6a7fa4342c5351b5e | Python | Minta-Ra/wk02_d2_Pet_Shop_Classes_Lab | /classes/customer.py | UTF-8 | 703 | 4 | 4 | [] | no_license | class Customer:
def __init__(self, name, cash):
# Instance variables / properties
self.name = name
self.cash = cash
# Add list of pets to the customer
self.pets = []
def reduce_cash(self, amount):
self.cash -= amount
def pet_count(self):
# Return the... | true |
0ed33339265c6172eca4fc241f204de42ef655dd | Python | bertdecoensel/noysim | /noysim/emission.py | UTF-8 | 42,011 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | # Noysim -- Noise simulation tools for Aimsun.
# Copyright (c) 2010-2011 by Bert De Coensel, Ghent University & Griffith University.
#
# Noise emission model functions and classes
import warnings
import random
import numpy
import pylab
from geo import Point, Direction, asPoint, asDirection
from acoustics... | true |
cb085cce2d89348e57220c30a0f9afa88fa52f3e | Python | lpenzey/gilded_rose | /test_gilded_rose.py | UTF-8 | 3,558 | 2.953125 | 3 | [] | no_license | import unittest
from gilded_rose import Item, GildedRose, ItemType
class GildedRoseTest(unittest.TestCase):
def test_quality_decreases_by_1(self):
items = [Item("foo", 2, 10)]
gilded_rose = GildedRose(items)
gilded_rose.update_quality()
self.assertEquals(9, items[0].quality)
d... | true |
c461975f6f755f2e1d3b496ba7a9b172899b543c | Python | csjxsw/MyPythonProject | /leetcode/1_twosum/twosum.py | UTF-8 | 653 | 3.40625 | 3 | [] | no_license | #!/usr/bin/env python
# coding=utf-8
class Solution:
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
dict = {}
numslen = len(nums)
for index in range(numslen):
num = nums[index]
... | true |
be13f080f60a978d901545289a1caaac6de9f9be | Python | ATNF/yandasoft | /tests/data/simulation/synthregression/facetingtest.py | UTF-8 | 3,316 | 2.625 | 3 | [
"MIT"
] | permissive | # regression tests of faceting
# some fixed parameters are given in wtermtest_template.in
from synthprogrunner import *
def analyseResult(spr):
'''
spr - synthesis program runner (to run imageStats)
throws exceptions if something is wrong, otherwise just
returns
'''
src_offset = 0.006/math... | true |
571a6bd975a54dc8fabeb8e4fc54d254544b6d7e | Python | AdamantLife/aldb2 | /aldb2/SeasonCharts/sql.py | UTF-8 | 2,930 | 2.828125 | 3 | [] | no_license | ## This Module
from aldb2.Core.sql import util
from aldb2 import SeasonCharts
from aldb2.SeasonCharts import gammut
def gammut_main(connection, season = None, year = None, output = gammut.DEFAULTOUTPUT):
""" Runs gammut's main function and then imports the results into the database. """
gammut.main(season = s... | true |
792b0dff03d4e404dd1dbf6d541b01dd74f46ed3 | Python | omkarmoghe/Scurvy | /MainMenu.py | UTF-8 | 4,924 | 3.1875 | 3 | [] | no_license | from Globals import *
# This represents a selectable item in the menu.
class MenuItem(pygame.font.Font):
def __init__(self, text, index, count, func):
pygame.font.Font.__init__(self, menu_font, menu_item_font_size)
self.text = text
self.font_size = menu_item_font_size
self.font_... | true |
ca0f3a35fcd4fdc3ecbaa05a9af4e96cd2d38fe4 | Python | Jacobo-Arias/Sistemas-Distribuidos | /servidores/socket_server1.py | UTF-8 | 588 | 3.0625 | 3 | [] | no_license | import socket
import time
mi_socket = socket.socket()
mi_socket.bind(('localhost',8000))
mi_socket.listen(1)
conexion, addr = mi_socket.accept()
print('Nueva conexion establecida')
print (addr)
solinombre = "Digame su nombre"
conexion.send(solinombre.encode("ascii"))
peticion = conexion.recv(1024)
... | true |
722e465c200d8ca25e8a379f97408eb1ae04f839 | Python | natdjaja/qbb2019-answers | /day4-homework/timecourse.py | UTF-8 | 2,217 | 2.84375 | 3 | [] | no_license | #!/usr/bin/env python3
"""
Usage ./02-timecourse.py <t_name> <samples.csv>, <FPKMs>
Create a timecourse of a given transcript for females
./timecourse.py FBtr0331261 ~/qbb2019/data/samples.csv all.csv
"""
import sys
import pandas as pd
import matplotlib.pyplot as plt
import os
def get_fpkm_data(fpkms,columns):
... | true |
3fc51c0ec0b7f745d73fc906984bb7390db97e68 | Python | anuchakradhar/python_starter | /variables.py | UTF-8 | 614 | 4.40625 | 4 | [] | no_license | # A variable is a container for a value, which can be of various types
'''
This is a
multiline comment
or docstring (used to define a functions purpose)
can be single or double quotes
'''
"""
VARIABLE RULES:
- Variable names are case sensitive (name and NAME are different variables)
- Must start with... | true |
0c602cc27ac7276daef098d7813e9e7a108557d8 | Python | chongminggao/WeChat_Big_Data_Challenge_DeepCTR-Torch_baseline_zsx | /mmoe1.py | UTF-8 | 5,498 | 2.640625 | 3 | [] | no_license | import torch
import torch.nn as nn
from deepctr_torch.models.basemodel import BaseModel
from deepctr_torch.inputs import combined_dnn_input
from deepctr_torch.layers import DNN, PredictionLayer
class MMOELayer(nn.Module):
def __init__(self, input_dim, num_tasks, num_experts, output_dim, device, seed=6666):
... | true |
aae019536a269639765ec5d75a9f2bd1555bafa8 | Python | FaustinCarter/Labber_Drivers | /MagCycle_Relay/MagCycle_Relay.py | UTF-8 | 2,559 | 2.796875 | 3 | [] | no_license | import numpy as np
import PyDAQmx as mx
import InstrumentDriver
class Driver(InstrumentDriver.InstrumentWorker):
def performSetValue(self, quant, value, sweepRate=0.0, options={}):
"""Create task, set value, close task."""
if quant.name == 'Relay Position':
if value == 'Mag Cycle':
... | true |
696bffa941af936e86c3115b1495c4ef30fdf6f6 | Python | Harrisonyong/ChartRoom-For-Python | /chartroom_service.py | UTF-8 | 1,938 | 2.96875 | 3 | [] | no_license | """
author:harrisonyong
email:122023352@qq.com
time:2020-08-20
env:python3.6
socket and epoll
"""
from socket import *
from select import *
HOST = "0.0.0.0"
POST = 8000
ADDR = (HOST, POST)
# 服务端套接字启动,采用epoll方法进行监听
sockfd = socket()
sockfd.setblocking(False)
sockfd.bind(ADDR)
sockfd.listen(5)
# epo... | true |
53266a4b26a11989a673f1af69e628616d3fe09d | Python | Ampersandnz/UnifyIdCodingChallenge | /GenerateImage.py | UTF-8 | 3,518 | 3.03125 | 3 | [] | no_license | from urllib import request, parse
from urllib.error import HTTPError, URLError
from socket import timeout
from PIL import Image
# HTTP request timeout, in seconds.
TIMEOUT = 300
# Can request a maximum of 10,000 numbers at a time via the API, so loop and split the request until we have enough
MAX_NUMBERS_IN_REQUEST ... | true |
f07cd2a623d18d6fdeedb91c03cc832d928d7483 | Python | anshajk/covid-vaccinations | /vaccinations.py | UTF-8 | 1,940 | 2.890625 | 3 | [
"MIT"
] | permissive | import streamlit as st
import urllib
import pandas as pd
import altair as alt
def get_vaccination_data():
DATA_URL = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv"
df = pd.read_csv(DATA_URL)
df["date"] = pd.to_datetime(df["date"])
df["date"] = d... | true |
30e3ba6f1dc61c7816386bd7d896ec5ad5cac528 | Python | Sorade/Forest_level_Potion | /classes.py | UTF-8 | 79,910 | 2.953125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 23 10:35:10 2016
@author: Julien
"""
import pygame, sys, random
import functions as fn
import variables as var
from pygame.locals import *
import itertools
import numpy as np
from operator import attrgetter
'''shadow casting imports'''
import PAdLib.shadow as shadow
impor... | true |
0b84b7629762e05900e859f4543d9030adbdc17e | Python | ryan0583/AOC-2019 | /Day 19/day19.py | UTF-8 | 2,936 | 3.578125 | 4 | [] | no_license | from Utils.graphics_panel import GraphicsPanel
from Utils.intcode_computer import IntcodeComputer
from Utils.point import Point
def part1():
panel = GraphicsPanel.create_empty_panel(50, 50)
panel.init_canvas()
count = 0
computer = IntcodeComputer([], None, False)
filename = "input.txt"
ints... | true |
4941a40661163242b46b72a90281b5561626b062 | Python | dalaAM/month-01 | /day08_all/day08/demo03.py | UTF-8 | 451 | 4.4375 | 4 | [] | no_license | """
将下列代码,定义为函数.
for r in range(2): # 行数 0 1
for c in range(5): # 列数 01234 01234
print("老王", end=" ")
print() # 换行
"""
def print_table(data, r_count, c_count):
for r in range(r_count): # 行数
for c in range(c_count): # 列数
print(data, end=" ... | true |
69d7097a364b14a4a72eb9c5f70b5a2579c12d4f | Python | arnoldvc/Leccion1 | /Leccion05/Set.py | UTF-8 | 565 | 3.546875 | 4 | [] | no_license | # set
planetas = {'Marte', 'Júpiter', 'Venus'}
print(planetas)
#largo
print(len(planetas))
# revisar si un elemento está presente
print('Marte' in planetas)
# agregar un elemento
planetas.add('Tierra')
print( planetas)
#no se pueden duplicar elementos
planetas.add('Tierra')
print(planetas)
# eliminar elemento posibleme... | true |
a83fef96227c6603600885b11a88c2834283c00f | Python | SHDeseo/SHDeseo.github.io | /python/dss.py | UTF-8 | 169 | 3.53125 | 4 | [
"MIT"
] | permissive | for i in range (1, 30+1):
if i % 15 == 0 :
print("Fizzbuzz")
elif i % 3 == 0 :
print("Fizz")
elif i % 5 --0 :
print("Buzz")
else:
print(i)
print("Done!")
| true |
16ed911423db22c35eaa0e2fdbf82b2c8972395b | Python | timparkin/timparkingallery | /share/pollen/pyport/relation.py | UTF-8 | 659 | 2.8125 | 3 | [] | no_license | '''
Relation types
'''
class Relation(object):
def __init__(self, entity_class_name, join_attrs):
self.entity_class_name = entity_class_name
if not isinstance(join_attrs, (list, tuple)):
join_attrs = (join_attrs,)
self.join_attrs = join_attrs
class ToOneRelation(Relation):
... | true |
a2c0f85b06650894db8bf75b1b2a64ed08f3f813 | Python | hhaggan/python-azure-datalake-gen2-api | /pyadlgen2/azuredatalakegen2.py | UTF-8 | 9,126 | 3.171875 | 3 | [
"MIT"
] | permissive | """TODO Fill in the module description
"""
# ---------------------------------------------------------------------
# LIBRARIES
# External Libraries
import pathlib
from requests.exceptions import HTTPError
# Internal Libraries
from pyadlgen2.helpers.adlgen2restapiwrapper import ADLGen2RestApiWrapper
# ------------... | true |
c1c75ec7c540c414aa3f0bdce45a3365f62e8719 | Python | alabiansolution/python1901 | /day3/class/constructor.py | UTF-8 | 168 | 3.359375 | 3 | [] | no_license | class Fish:
def __init__(self):
print("This is a constructor")
def swiming(self):
print("This fish can swim")
shark = Fish()
shark.swiming()
| true |
b56a48ee23445b3204aebac6e958ae9ab1e53c4a | Python | yuyaxiong/interveiw_algorithm | /LeetCode/二叉堆/703.py | UTF-8 | 886 | 3.859375 | 4 | [] | no_license | # 703. 数据流中的第 K 大元素
from typing import List
import heapq
class KthLargest:
def __init__(self, k: int, nums: List[int]):
class SmallHeap:
def __init__(self, k):
self.k = k
self.small_heap = []
def add(self, val):
if len(self.small_hea... | true |
7c282ff812a40ea9ca89b1d484965d62ec380ed1 | Python | erigler-usgs/pyLTR | /pyLTR/math/integrate_test.py | UTF-8 | 1,517 | 2.671875 | 3 | [] | no_license | from . import integrate
import pyLTR.Models.MIX
import datetime
import numpy
import unittest
class TestIntegrate(unittest.TestCase):
def setUp(self):
# Test runner (nosetests) may fail without this silly try/except block:
try:
data = pyLTR.Models.MIX('examples/data/models', 'LMs_UTIO')... | true |
a66cf8964e5a94decbaa8704a09a2970f4a6e35f | Python | TheSiggs/Automation-Scripts | /starbound auto clicker.py | UTF-8 | 621 | 3.234375 | 3 | [] | no_license | import pyautogui as gui
import time
from random import randint
# Basic Commands
def click(x, y): gui.click(x, y)
def wait(t): time.sleep(t)
def find_location():
while True:
time.sleep(1)
x, y = gui.position()
print("X:", x, "Y:", y, "RGB:", gui.screenshot().getpixel(gui.position()))
... | true |
68e5be4e83ddf4e9fac588c320be4f34cbf03dc9 | Python | chirag-parmar/Cryptopals | /Set 1/hex2base64.py | UTF-8 | 147 | 2.671875 | 3 | [] | no_license | import sys
argv = sys.argv[1:]
for hexStrings in argv:
print(hexStrings.decode("hex") + '\n' + hexStrings.decode("hex").encode("base64") + '\n') | true |
3332e1aa34530af16fb3e93e4f18e1d7557eb589 | Python | ZoltanSzeman/jumpup | /settings.py | UTF-8 | 661 | 2.8125 | 3 | [] | no_license | # Created by Zoltan Szeman
# 2020-05-28
import pygame
class Settings():
"""An object for the basic game settings."""
def __init__(self):
# screen settings
self.size = (700, 600)
self.color = 0, 0, 0
# ball movement settings
self.jump_speed = 1200.0
... | true |
86083e9f48b3e38cd54efffa124d7e17bfe17cb3 | Python | Yavor16/Space-Shooter-Game | /src/Enemy.py | UTF-8 | 3,669 | 3.359375 | 3 | [] | no_license | import math
import pygame
import random
from EnemyBullet import EnemyBullet as EnemyBull
class EnemyShip(pygame.sprite.Sprite):
def __init__(self, screen, player, damage):
super().__init__()
self.screen = screen
self.x = random.randint(1, 765)
self.y = -30
self.player = play... | true |
f4ec6b9da608e8b895c94d4ed35747fab7397a6e | Python | padelstein/ZolaPOM | /UnitTesting/zola_testing/homepage_links/bottom_twitter.py | UTF-8 | 917 | 2.5625 | 3 | [] | no_license | '''
Created on Jul 16, 2013
@author: emma
'''
import unittest #imports unit test/ability to run as pyunit test
from UnitTesting.page_objects.webdriver_wrapper import webdriver_wrapper
from UnitTesting.page_objects.homepage import homepage
class bottom_twitter_icon(unittest.TestCase):
def bottom_twitter... | true |
dc934fb4f9f7664c06b73ab49ac842697f0316a8 | Python | ealgera/challenges | /06/usertweet.py | UTF-8 | 307 | 3.046875 | 3 | [] | no_license | class UserTweet:
def __init__(self, n, sn, t):
self.name = n
self.screenname = sn
self.tweet = t
#self.tweet_parsed = []
def print_Tweet(self):
print(f"Naam : {self.name}")
print(f"Screen: {self.screenname}")
print(f"Tweet : {self.tweet}")
| true |
2a816e766c0a8694856407ff9d675585c134b6e3 | Python | mehanig/can-scrapers | /can_tools/scrapers/official/NM/nm_vaccine.py | UTF-8 | 3,977 | 2.765625 | 3 | [
"MIT"
] | permissive | import pandas as pd
import requests
import us
from can_tools.scrapers import variables
from can_tools.scrapers.base import CMU
from can_tools.scrapers.official.base import StateDashboard
from can_tools.scrapers.util import requests_retry_session
class NewMexicoBase(StateDashboard):
state_fips = int(us.states.loo... | true |
e7661bb06e8c128503c9539442a6541d5b4616b1 | Python | GreatTwang/lccc_solution | /Python/Array(value)/Single Number.py | UTF-8 | 357 | 3.265625 | 3 | [] | no_license | #Given a non-empty array of integers, every element appears twice except for one. Find that single one.
class Solution:
def singleNumber(self, nums: List[int]) -> int:
a=0
for each in nums:
a^=each
return a
class Solution:
def singleNumber(self, nums: List[int]) -> int:
... | true |
5cb25eb90d21b5703b843116087acf1d3af36951 | Python | canwhite/QCPySignInTest | /guest/sign/models.py | UTF-8 | 1,278 | 2.875 | 3 | [] | no_license | from django.db import models
# Create your models here.
#发布会表
class Event(models.Model):
"""docstring for Event"""
#发布会标题
name = models.CharField(max_length = 100)
#参加人数
limit = models.IntegerField()
#状态
status = models.BooleanField()
#地址
address = models.CharField(max_length = 200)
#发布会时间
start_time = mo... | true |
607173b874cbab75cfee259b202ceec5b0d2571b | Python | kenie/myTest | /100/example_089.py | UTF-8 | 706 | 3.78125 | 4 | [] | no_license | #!/usr/bin/env python
#-*- coding:UTF-8 -*-
'''题目:某个公司采用公用电话传递数据,数据是四位的整数,在传递过程中是加密的,加密规则如下:
每位数字都加上5,然后用和除以10的余数代替该数字,再将第一位和第四位交换,第二位和第三位交换。'''
from sys import stdout
if __name__ == "__main__":
s = int(raw_input("Enter a 4 digit number:"))
a = []
a.append(s%10)
a.append(s%100/10)
a.append(s%1000... | true |