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 |
|---|---|---|---|---|---|---|---|---|---|---|
3c7df7764e4e8e58a310e2e01c9289c4d43c559b | tystowell/RP2040_Board_Design | /2ndOrderFilterModel.py | UTF-8 | 651 | 2.953125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
dt = 0.000001
time = .1
samples = int(time//dt)
period = 0.0005
result = np.zeros(samples)
samplesPerPeriod = int(period//dt)
v = 0
r = 2200
c = .000002
c1 = 0
c2 = 0
n = 0
while n < len(result):
if n % samplesPerPeriod == 0:
if v == 0:
v = 3... | true |
c09e3f9b5e18411089bcd9d1df7995249b560fb6 | QiangZhurock/qiangzhuleetcode | /043_multiplystring/learn2.py | UTF-8 | 978 | 3.390625 | 3 | [] | no_license | class Solution(object):
def multiply(self, num1, num2):
"""
:type num1: str
:type num2: str
:rtype: str
"""
# write your code here
num1 = list(num1)[::-1]
num2 = list(num2)[::-1]
num3 = [0 for _ in range(len(num1) + len(num2))]
# need ... | true |
ebdbe60e9ad8b6ba51dd593e35113a5c70cda17e | dongqing7/trichoCODE | /scripts/filter_with_rules.py | UTF-8 | 2,693 | 2.765625 | 3 | [] | no_license | #!/usr/bin/python
import sys
class Gene(object):
def __init__(self):
self.gid = 0
self.start = 0
self.stop = 0
self.exons = list()
self.introns = list()
class Exon(object):
def __init__(self):
self.start = 0
self.stop = 0
class Intron(object):
def _... | true |
d3b6a5d5602e35cddee1c35ab3212780ca5289e5 | watinya/zerojudge | /python/d460.py | UTF-8 | 356 | 3.0625 | 3 | [] | no_license | import sys
s = eval( sys.stdin.readline() )
while(s != ""):
if (s >= 0 and s <= 5):
print("0")
elif (s >= 6 and s <= 11):
print("590")
elif (s >= 12 and s <= 17):
print("790")
elif (s >= 18 and s <= 59):
print("890")
elif (s >= 60):
print("399")
... | true |
36d32c03025c952ec41605cf7bdeddcc812f8d94 | ami-GS/hyper | /hyper/http20/huffman.py | UTF-8 | 4,379 | 3.28125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
hyper/http20/huffman_decoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of a bitwise prefix tree specially built for decoding
Huffman-coded content where we already know the Huffman table.
"""
from .exceptions import HPACKDecodingError
def _pad_binary(bin_str, req_len=8):
"""
G... | true |
f795a805f04847a818eab38df733e9a5c781445c | arora123/Data-Structure-and-Algorithms-in-Python- | /linked list_part1.py | UTF-8 | 1,120 | 4.25 | 4 | [] | no_license | '''
Creating a singly linked list of
muliple data points such as employee name, age, etc.
'''
class Employee:
def __init__(self, name, age, next):
self.name = name
self.age = age
self.next = next
class LinkedList:
def __init__(self):
self.head = Non... | true |
6df0b60c9fdf5b7b0e69513a0e5ed01d2267b7c7 | marcos-mpc/CursoEmVideo-Mundo-3 | /ex112/utilitarioscev/moeda/__init__.py | UTF-8 | 933 | 3.71875 | 4 | [] | no_license | def formatacao(n=0):
return f'R${n:.2f}'.replace('.', ',')
def aumentar(n=0, p=0, f=False):
res = n + (n * (p / 100))
return res if not f else formatacao(res)
def diminuir(n=0, p=0, f=False):
res = n - (n * (p / 100))
return res if not f else formatacao(res)
def dobro(n=0, f=False):
res = ... | true |
6449614ce2f3565bb1725e86d40aefa91c925a94 | amr8808/Project_1_new | /.ipynb_checkpoints/NBA-checkpoint.py | UTF-8 | 4,434 | 3.015625 | 3 | [] | no_license | import panel as pn
import hvplot.pandas
import pandas as pd
from panel.interact import interact
from panel import widgets
class nba:
"""Analyze NBA TopShot output csv from otmnft.com
Keyword arguments:
collection -- set transaction details, 10s of thousands of rows
total -- set totals details
sum... | true |
2ca9c375886be67278c55bf9651d369632f5e515 | kolaisaac/Data2Bots_Intern_Challenge | /challenge.py | UTF-8 | 980 | 3.421875 | 3 | [
"MIT"
] | permissive |
import pandas as pd
import json
import numpy as np
# Read the data, ensuring python file and the .csv file are in the same directory
data = pd.read_csv("dataset.csv")
def check_expiration(data):
# declaration of variables
item_date = data['date']
# Adds a new column named [obsolete]. The column should flag TR... | true |
97ed5307fceaf63c3aa6ea62bcd98432bfdcd73a | gpwltl/Algorithm_Study | /week3/계단오르기_2579/hyeyoon0808.py | UTF-8 | 182 | 2.6875 | 3 | [] | no_license | import sys
n = int(sys.stdin.readline())
nlist =[]
total = 0
for i in range(n):
nlist.append(int(sys.stdin.readline()))
total = nlist[0]+nlist[-1]
for i in
1 2 34 5 6
1234567 | true |
ab1076df2bac81033b2ae5e3c7e3e9f5ddd99ae7 | AwesomeCoder30/Python_Pratice | /Functions.py | UTF-8 | 473 | 3.484375 | 3 | [] | no_license | def hello_function():
print("Hello Function")
hello_function()
def hello_function():
return "Hello Function return"
print(hello_function())
def hello_function2(value1):
return "Hello Function return " + value1
print(hello_function2("Parth"))
print(hello_function2("Neeraj"))
def hello_function2(value... | true |
2bea1db6a533fc0bbb9677e30327b9d6bd7b1d09 | CmWork/STAKCommands | /testmethodology/stakunittest/test_BenchmarkStabilityIteratorCommand.py | UTF-8 | 18,122 | 2.59375 | 3 | [] | no_license | from StcIntPythonPL import *
from spirent.methodology.BenchmarkStabilityIteratorCommand import \
validate
def test_validate():
# Function prototype:
# validate(BreakOnFail, MinVal, MaxVal, PrevIterVerdict,
# IterMode, StepVal, ValueType, ValueList,
# RepeatCount, SuccessPercent, ... | true |
4887bacf537c2a5a883fc1266cf361e754a89819 | Huaguiyuan/quantum-honeycomp | /development/compile_fortran.py | UTF-8 | 2,065 | 2.5625 | 3 | [] | no_license | import os
# names is a lists with pairs of name of folder, f90 file and .so file
names = [("first_neigh","first_neighborsf90.f90","first_neighborsf90")]
names += [("kpm","kpm.f90","kpmf90")]
names += [("dos","dos.f90","dosf90")]
names += [("berry","berry_curvature.f90","berry_curvaturef90")]
names += [("gauss_inv... | true |
1128934fb038875320892bb905f36fc5eb07cf27 | minushuang/Mask-Propagation | /model/modules.py | UTF-8 | 4,061 | 2.515625 | 3 | [] | no_license | """
modules.py - This file stores the rathering boring network blocks.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from model import mod_resnet
class ResBlock(nn.Module):
def __init__(self, indim, outdim=None):
super(ResBlock, self).__init__()
... | true |
eff92a57d4358b43536f504fccfb06e2a0d1aabe | RafaelGoulartB/learning-machine-learning | /ML/Hello-World-ML.py | UTF-8 | 559 | 3.953125 | 4 | [] | no_license | from sklearn import tree
features = [[140, 1],[130, 1],[150, 0],[170, 0]] #0- bumpy, 1- smooth
labels = [0, 0, 1, 1] #0 - apple, 1- oranges
clf = tree.DecisionTreeClassifier()
clf = clf.fit(features, labels)
try:
surface = int(input("\nThe fruit surface is bumpy or smooth?[1-Smooth 0-Bumpy] "))
weight = int(input(... | true |
4daeb6ec3cc3a4f446ff770b144f2250d1166931 | WendellTeam/AICoreEngine | /AIEngine/extraction/crypto/crypto.py | UTF-8 | 1,220 | 2.953125 | 3 | [] | no_license | from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
import base64
import unicodedata
def string_to_base64(s):
return base64.b64encode(s.encode('utf-8')).decode('utf-8')
def base64_to_string(b):
return base64.b64decode(b).decode('utf-8')
def remove_control_characters(s):
return "".join(ch for ch... | true |
addc2fdf0f156dbf64007e3757fa47fe3207c9e8 | daverayment/aoc | /2015/Helpers/day_17.py | UTF-8 | 820 | 3.375 | 3 | [] | no_license | #!/usr/bin/env python3
import itertools
from collections import defaultdict
def get_desc():
return 17, 'Day 17: No Such Thing as Too Much'
def calc(log, values, target):
values = [int(x) for x in values]
ret = 0
used = defaultdict(int)
for i in range(1, len(values)+1):
for test in iterto... | true |
fb3fe37fc285253b118c939bd62da48ab0486fb6 | Rohitkumar3796/Hospital_Services | /covidApp/models.py | UTF-8 | 1,798 | 2.75 | 3 | [] | no_license | from django.db import models
# Both classes will create his own primary key automatically but we have to give foreign key as state to city table
# Create your models here.
class State(models.Model):
name = models.CharField(max_length = 50, null = False, blank = False)
# this dunder method is used for object ... | true |
ad34297665811e1dac1116c0984165a56f4f7ed4 | ifiddes/pycbio | /pycbio/exrun/sched.py | UTF-8 | 7,521 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | # Copyright 2006-2012 Mark Diekhans
"""
Scheduling of threads to run tasks (normally rules). A Task object is a
thread, the number running concurrently is controlled by the Sched object.
Since tasks usually run one external pipeline at a time, the number of
concurrent tasks controls the number of process executing on ... | true |
b6122aa601198893373fcee06807727b7bff611d | IsamAljawarneh/MobilityDB-python | /mobilitydb/examples/time.py | UTF-8 | 7,312 | 2.625 | 3 | [] | no_license | ###############################################################################
#
# This MobilityDB code is provided under The PostgreSQL License.
#
# Copyright (c) 2019-2021, Université libre de Bruxelles and MobilityDB
# contributors
#
# Permission to use, copy, modify, and distribute this software and its
# document... | true |
640bb74abb73acf8d487ff52a60751714b58a244 | will-jac/sskm | /sskm.py | UTF-8 | 5,767 | 2.53125 | 3 | [] | no_license | import numpy as np
import pickle as pkl
import argparse
# ML methods
import models
import tests
def create_parser():
# Parse the command-line arguments
parser = argparse.ArgumentParser(description='SS KM', fromfile_prefix_chars='@')
parser.add_argument('-method', type=str, default='coreg', help='kernel me... | true |
9d1f08889f89fe36c50505e2f4a865dc1ed0815e | DenishAhuja/HacktoberFest2021 | /Python/Tasks/fibonacci.py | UTF-8 | 391 | 4.125 | 4 | [] | no_license | # program for fibonacci series
# This is a extremely fast algorithm for fibonacci numbers. Even 100000th fibonacci number will be printed instantly.
def fibonacci(n):
last_two = [1, 1]
if n == 1 or n == 2:
return 1
for i in range(0, n-2):
num = last_two[0] + last_two[1]
last_t... | true |
11ff76e8d6bad980eb3e0b533afc3bc6000d5c30 | jithendra1798/CN-Lab | /Lab-1/Q2/tcp_server.py | UTF-8 | 750 | 3.265625 | 3 | [] | no_license | import socket
from datetime import date
port = 6789
# Create IPv4 TCP server socket
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# Bound the socket
s.bind(("localhost",port))
# Listening to clients
s.listen(1)
print("Waiting for connections....")
# Server connecting with clients
while True:
#Accept co... | true |
24cbcd8da3288dd80fcb51fa25718f40debf5094 | f4pga/f4pga | /f4pga/utils/quicklogic/convert_compile_opts.py | UTF-8 | 6,197 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022 F4PGA Authors
#
# 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/LICENSE-2.0
#
# Unle... | true |
e18cfc4f8a0d918125c79277d0e14559afa7f377 | Lvyou0034/image_classification | /0_baidu_image.py | UTF-8 | 3,877 | 2.765625 | 3 | [
"MIT"
] | permissive | # coding=utf-8
"""根据搜索词下载百度图片"""
import re
import sys
import urllib
import requests
import pandas as pd
import os
from concurrent.futures import ThreadPoolExecutor
base_file_path = os.path.join(os.getcwd(), 'test')
def getPage(keyword, page, n):
page = page * n
keyword = urllib.parse.quote(ke... | true |
a6bf04038680741df85c992cae13f8a2e1658d36 | cfudala82/DC-Class-Sept-17 | /projects/week1/coins.py | UTF-8 | 241 | 3.78125 | 4 | [] | no_license | count = 0
print('You have ', count, ' coins.', sep='')
prompt = input('Do you want another? ')
while prompt == 'yes':
count += 1
print('You have ', count, ' coins.', sep='')
prompt = input('Do you want another? ')
print('Bye')
| true |
c1d0b9f901c908bf73f7883414792ac0cc46e5df | vemodalen/chessailib | /chessPlayer_tree.py | UTF-8 | 20,688 | 3.390625 | 3 | [] | no_license | class queue:
def __init__(self):
self.list = []
def enqueue (self,val):
self.list = self.list + [val]
#print "enqueue" + str(self.list)
def dequeue(self):
if len(self.list) > 0:
tmp = self.list[0]
self.list = self.list[1:len(self.list)]
#... | true |
e3a954e13bc9b4c3ecbb990f31ec7ed0495928e2 | robinstauntoncollins/fbi | /fbi/accessory.py | UTF-8 | 2,345 | 2.765625 | 3 | [
"Unlicense"
] | permissive | # -*- coding: utf-8 -*-
from errno import EACCES, ENOTDIR
from os import getcwd, makedirs, remove, strerror
from os.path import dirname, expanduser, isfile, join
import settings
def create_directory(dir_abs_path, mode=None):
"""Recursive directory creation function
os.chmod work only for last directory
... | true |
cc9a1a73375c59dd77d832df2fa27b54ee0d8ef7 | SergioVenicio/URI | /1090/main.py | UTF-8 | 697 | 3.46875 | 3 | [] | no_license | import re
TRIANGULO_REX = re.compile(r'triangulo?s*')
CIRCULO_REX = re.compile(r'circulo?s*')
QUADRADO_REX = re.compile(r'quadrado?s*')
COUNTER = {
1: 1,
2: 0,
3: 1,
}
def value_mapper(card):
if TRIANGULO_REX.search(card):
return 0
if CIRCULO_REX.search(card):
return 1
if QUA... | true |
fae8aebea878dbb2b50848c114063c2346cca43b | sanjuroj/bioscripts | /fastaTools.py | UTF-8 | 3,416 | 2.953125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python2.7
import sys
import os
import argparse
import re
from operator import itemgetter
#God this is dumb. This needs to be done so python doesn't throw an error when you pipe it to head
import signal
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
#argParser = argparse.ArgumentParser()
#argParser.add_... | true |
c36db640854a1d3c43d2ae47270460b19fb3dfa7 | lyndsiWilliams/code-challenge-solutions | /CodeSignal/firstNotRepeatingCharacter.py | UTF-8 | 316 | 3.46875 | 3 | [
"MIT"
] | permissive | def firstNotRepeatingCharacter(s):
count = {}
for i in s:
if i in count:
count[i] += 1
else:
count[i] = 1
for i in count:
if count[i] == 1:
return i
return '_'
# Example
firstNotRepeatingCharacter('abbacaba') | true |
7162b51a6e505cea70b6c78d23a8b59faec449b0 | ismip/ismip6-antarctic-ocean-forcing | /preprocess/csiro_mk3_6_0/process_csiro_mk3_6_0_historical.py | UTF-8 | 3,187 | 2.625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import argparse
import xarray
import numpy
import os
import warnings
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('-o', dest='out_dir', metavar='DIR',
type=str, help='output directory')
args = p... | true |
e93f15fdbabcfa21bd83c7d12f5e0807253f64be | Macleans-Coding-Club/Programing-Contest | /ICPC2019/Problem B - Charles.py | UTF-8 | 1,416 | 3.0625 | 3 | [] | no_license | import math
import itertools
def archheight(x1,x2):
r = (x2 - x1) / 2
center_x = (x2 + x1) / 2
center_y = h - r
for x in range(x1,x2+1):
y = math.sqrt(r**2-(x-center_x)**2)+center_y
arch_h[x] = y
groundheight = {}
detail = input().split()
h = int(detail[1])
alpha = int(detail[2])
beta = int(detail[3])... | true |
cc513bcc3509e52440a984ab7078738692715f59 | kaustubh-pandey/JEE-MAIN-registration | /encrypt.py | UTF-8 | 317 | 2.609375 | 3 | [] | no_license | #encrypt
#import rand in registration
def encrypt(string,j):
s=[]
for i in range(len(string)):
s.append(str(ord(string[i])-j))
s=str("".join(s))
return s
def regencrypt(string,rand):
x=[]
for i in range(len(string)):
x.append(str(ord(string[i])-rand))
x=str("".join(x))
return x
| true |
587223275aac81b88208e94a3eb433dd320d41ce | reichlj/PythonDataStructure | /chapter7/modVertex.py | UTF-8 | 1,271 | 2.96875 | 3 | [] | no_license | class Vertex:
def __init__(self, key):
self.id= key
self.connectedTo = {}
self.distance = -1
self.predecessor = None
self.discovery_time = -1
self.finish_time = -1
self.color = "white"
def __str__(self):
return str(str.id) + ' connectedTo ' +\
... | true |
4b69c463281415beead5e52031a729b701d0ab18 | khannasarthak/codingPrep | /LeetCodeArchive/771.py | UTF-8 | 135 | 2.65625 | 3 | [] | no_license | class Solution:
def numJewelsInStones(self, J, S):
op=0
for i in J:
op+=S.count(i)
return (op) | true |
07a2eefc9d38df83e068b0b484d18b2474ed4353 | pkaran57/FED-NLP-Project | /fed-communications-gatherer/src/fomc/FOMCFeatureGenerator.py | UTF-8 | 4,716 | 2.640625 | 3 | [] | no_license | import logging
import os
import nltk
import requests
from typing import Tuple, List, Dict
from google.cloud.language_v1 import Entity
from src.definitions import FEATURES_OUTPUT_DIR, POLYGON_API_KEY
from src.fomc.FOMCDoc import FOMCDoc
from src.fomc.FOMCDocSample import FOMCDocSample
class FOMCFeatureGenerator:
... | true |
c14efb1c667f384d07a1acc21d689be375a1b3c2 | williamszk/kaggle-learn | /machine learning micro course.py | UTF-8 | 2,328 | 2.953125 | 3 | [] | no_license | # machine learning micro course
# https://www.kaggle.com/dansbecker/underfitting-and-overfitting
# path for the modules directory
# to install modules in Python3
# pip3 install -U scikit-learn scipy matplotlib
# <editor-fold> Underfitting and Overfitting **********************************
from learntools... | true |
e090584d7ee13362d1ae71d620db30640897c25d | jikebin/PythonStudy | /05网络编程整理/ThreadTest.py | UTF-8 | 599 | 3.6875 | 4 | [] | no_license | '''
多线程创建练习:
多线程操作:是为了增加程序的执行效率,python操作,只能增加IO密集型操作
'''
#面向过程操作
import threading,time
def thread1(name):
print("看电影:",name)
time.sleep(5)
def thread2(name):
print("听音乐:",name)
time.sleep(3)
#开启两个线程,分别用于听歌和看电影
start = time.time()
t1 = threading.Thread(target=thread1,args=("流浪地球",))
t1.sta... | true |
01a8cbe068253d61657da4f525f263aca16dc306 | huangjie716/action | /action2.py | UTF-8 | 645 | 3.328125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 23:39:38 2021
@author: hj
"""
import pandas as pd
data = {'语文':[68, 95, 98, 90,80], '数学':[65, 76, 86, 88, 90], '英语':[30, 98, 88, 77, 90]}
a = list(data.keys())
df = pd.DataFrame(data,index=['张飞','关羽','刘备','典韦','许褚'], columns=a)
for i in a:
print(i+'最... | true |
b80b0b0d5fb012012a1a2ce4032f64793c62d53d | Ricardo0327/PythonCrashBook | /ch9/my_cars.py | UTF-8 | 389 | 2.890625 | 3 | [] | no_license | from car import Car,ElectricCar
my_bettle = Car('volkswagen','bettle',2016)
print(my_bettle.get_descriptive_name())
my_tesla= ElectricCar('tesla','roadster',2016)
print(my_tesla.get_descriptive_name())
import car
my_bettle=car.Car('volkswagen','bettle',2016)
print(my_bettle.get_descriptive_name())
my_tesla=car.Electr... | true |
c7508ceb803ca61940682a428afcee8847db8141 | BuglessCoder/ChallengePythonTip | /三角形形状.py | UTF-8 | 202 | 3.734375 | 4 | [] | no_license | a=3
b=4
c=5
a,b,c = sorted([a,b,c])
if (a+b)>c:
if a*a+b*b>c*c:
print("R")
elif a*a+b*b<c*c:
print("D")
elif a*a+b*b==c*c:
print("Z")
else:print("W")
| true |
472ab4ae2f94b0f455561c50770e00dbb760f315 | dojorio/dojo_niteroi | /2011/20111103_python_collatz/test_collatz.py | UTF-8 | 705 | 3.109375 | 3 | [] | no_license | import unittest
from collatz import collatz
class TestCollatz(unittest.TestCase):
def test_1_retorna_1(self):
self.assertEqual(collatz(1), [1])
def test_2_retorna_2_1(self):
self.assertEqual(collatz(2), [2, 1])
def test_4_retorna_4_2_1(self):
self.assertEqual(collatz(4), [4, ... | true |
b634f5af354790e71cb34696f7aba380cc279526 | jessereitz/listle | /listle/utils.py | UTF-8 | 544 | 2.71875 | 3 | [] | no_license | import logging
from flask import request
logger = logging.getLogger(__name__)
def log_request():
logger.info(f'============================== REQUEST {request.method} {request.path} ==============================')
logger.info(f'Request Headers: {dict(request.headers)}')
logger.info(f'Request JSON: {req... | true |
6c88a1a1768578ce3e46cd83043bdfb048f48439 | peterkingalex/binstar_client | /binstar_client/commands/register.py | UTF-8 | 3,913 | 2.515625 | 3 | [] | no_license | '''
Register a package in binstar.
This command must be run before 'binstar upload' if the package namespace does
not exist.
eg:
binstar register CONDA_PACKAGE_1.bz2
binstar upload CONDA_PACKAGE_1.bz2
'''
from __future__ import unicode_literals
from binstar_client import BinstarError, NotFound
from binstar_cl... | true |
42de6e7f6c9a80ddda3fcdd8eb92302dcbc2ded3 | wesfox/gotCrawler | /src/notification_manager/NotificationManager.py | UTF-8 | 2,433 | 2.875 | 3 | [
"MIT"
] | permissive | from threading import Thread
import datetime
import time
import random
from src.db.MyDBConnection import MyDBConnection
from src.controllers.ShowController import ShowController
from src.config import CONFIG
class NotificationManager(Thread):
notif_step = 3600 # check for update every hours
max_request_pe... | true |
879075e0f297d8eadc82439420522c8f9476dbc0 | theishansri/Python_Codes | /Python/Trie.py | UTF-8 | 438 | 3.140625 | 3 | [] | no_license | class Node(object):
def __init__(self,root,data):
self.data=[data]
val=True
next=None
def insert(r,i):
k=0
if(r is None):
Node(r,k)
else:
if(i in r):
insert(r.next,k+1)
else:
if(r is None):
Node(i)
else:
... | true |
fcd6af97522055d1397deedfa45eb8a8b0d17142 | LindongLi/Leetcode | /39 Combination Sum/39 LL.py | UTF-8 | 546 | 3.21875 | 3 | [] | no_license | class Solution(object):
@staticmethod
def search(result, trace, candidates, target):
if target == 0:
result.append(list(trace))
return
for i in xrange(len(candidates)):
if candidates[i] > target:
return
trace.append(candidates[i])
Solution.search(result, trace, candidates[i:], target - candidat... | true |
e6e5b39bfc379c11ed6358052afcf6e958b0e84d | curest0x1021/Python-Django-Web | /Velez_Felipe/Asignments/average_list.py | UTF-8 | 135 | 3.25 | 3 | [
"MIT"
] | permissive | a = [1,2,5,10,255,3]
sum_of_a = 0
for index in range(len(a)):
sum_of_a = sum_of_a + a[index]
average = sum_of_a/(len(a))
print average | true |
3c9b6626d6b108495c5e2e241c4685f68c5524b1 | AzzyOxx/pec-atividades | /passo2-auto-repetiçãoEx3.py | UTF-8 | 225 | 3.140625 | 3 | [] | no_license | from turtle import *
def main():
speed(11)
shape("turtle")
for cont in range(30):
forward(5)
penup()
forward(5)
pendown()
done()
if __name__ == '__main__':
main()
| true |
f5de16b766a4e3732078a3f474a6f6f99129e457 | intel/test-framework-and-suites-for-android | /acs/acs/UtilitiesFWK/Parsers/Parser.py | UTF-8 | 2,640 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018 Intel Corporation
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/LICENSE-2.0
Unless required b... | true |
476fc77cd41f710d58f0f9a18feee10c0b742308 | GT-IEEE-Robotics/2018 | /Distance Sensing/DistanceSensor_VL6180/python_wrapper/test2.py | UTF-8 | 1,116 | 2.71875 | 3 | [] | no_license | import subprocess
command1 = 'rm build/lib.linux-armv7l-2.7/RangeFinder_C.so'
command2 = 'python setup.py build'
command3 = 'cp build/lib.linux-armv7l-2.7/RangeFinder_C.so RangeFinder_C.so'
subprocess.call(command1, shell=True)
subprocess.call(command2, shell=True)
subprocess.call(command3, shell=True)
print ""
... | true |
868d6f9fda2b6b92085becaf195ee47347b29f33 | ducthanhtran/sockeye_document_context | /sockeye/vocab.py | UTF-8 | 15,375 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | true |
35f47c5f58143e414b04451645e5740f080efa94 | Dr-Syn/cw-keyboard | /main.py | UTF-8 | 2,169 | 2.71875 | 3 | [] | no_license | import pyb
from pyb import Pin
from pyb import LED
import lookups
p_in = Pin('X2', Pin.IN, Pin.PULL_UP)
led = LED(2)
kb = pyb.USB_HID()
kbuf = bytearray(8)
# Pin X2 bridged to ground via key
# 10hz sample rate - 1 tick = .1 sec
state = 0 #initialize state to 0
shift = 0 #initialize shift to 0
charbuf = '0'
#charbuf ... | true |
641dab2a9f639f56a66d22adf6cfa40fe91a0b86 | dimmy2000/tinkoff-contest | /test_contest/H/solution.py | UTF-8 | 1,735 | 3.09375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""Wrong solution."""
import math
def function():
# input
x, y = [float(coord) for coord in input().split()][:2]
floats = [float(x) for x in input().split()]
# coords
room_coords = [
(0, 0),
(x, 0),
(x, y),
(0, y),
]
corner_coords = [... | true |
bb81a4da97c85ea3be10d74f4eb7cccc6fcb1dd4 | ahood528/teabot | /main.py | UTF-8 | 1,264 | 2.828125 | 3 | [
"MIT"
] | permissive | print('Welcome to CS 528 Teabot')
# import modules
import maps
import enviro
import teabot
import humans
# hard-coded values for testing
maps_to_parse = ['map1.svg']
simulation_loops = 10
# variables
# parse command line arguments and
# override hard-coded values
# initialize task environment
# load maps
parsed_ma... | true |
ac4d6dbf8eb93c1d279100dcf011381c32ce69dd | uzair-suria/py-word-counter | /word-counting-with-punctuations.py | UTF-8 | 498 | 3.234375 | 3 | [] | no_license | import string
f_dir = '..\\data\\'
fname = input("Enter the file name: ")
fname = f_dir + fname
count = {}
try:
f = open(fname)
except:
print("The file cannot be opened:", fname)
for line in f:
line = line.rstrip()
line = line.lower()
line = line.translate(line.maketrans('', '', stri... | true |
99403dddf7471f4964663d5ca8ba0b11cc755472 | rwsargent/adventofcode | /2016/day1.py | UTF-8 | 3,695 | 3.578125 | 4 | [] | no_license | def read_input(filename):
'''
Each line is parsed to be a tuple (D, A), where D is the direction I turn (right or left)
and A is the amount I walk in that direction.
'''
print(filename)
with open(filename) as file:
data = file.read().split(", ")
return [(datum[0], int(datum[1:])) for datum in data]... | true |
107f93642579000df9ffd0c3fe3cf404c4e60a62 | Dotown/py_practice | /6-10/day7_9.py | UTF-8 | 527 | 4.53125 | 5 | [] | no_license | # 通过yield关键字将一个普通函数改造成生成器函数
# a = 0, b = 1报错
def fib(n):
a,b = 0,1
for i in range(n):
a,b = b,a+b
yield a
def main():
for val in fib(20):
print(val)
# 生成器函数:常规函数定义,但是使用yield语句而不是return 语句返回结果,yield语句一次返回一个结果,可以使用多次,在每
# 个结果中间,挂起函数的状态,以便下次从它离开的地方继续执行。
if __name__ == '__main__':
m... | true |
643b0aca31903f3d0223491fb9174b828391853a | diyarkudrat/superhero_team_dueler | /superheroes.py | UTF-8 | 9,761 | 3.5625 | 4 | [] | no_license | from random import choice, randint
class Ability:
def __init__(self, name, max_damage):
self.name = name
self.max_damage = max_damage
def attack(self):
attack_damage = randint(0, self.max_damage)
return attack_damage
class Weapon(Ability):
def attack(self):
retur... | true |
7fd0c2c9f43fb275115012d986e8741db4f2cf00 | dariosalvi78/MobiEEG | /VAS.py | UTF-8 | 2,485 | 2.703125 | 3 | [] | no_license | '''
The Visual Scale Analogue VAS lets the user to choose a level of pain.
The painlevel is then send to the MobiClient for to be send to the server
@uthor Rohan
'''
import Settings
from tkinter import *
user = ''
def setUserName(userName):
# Recieves a string and sets the username to it
global user
u... | true |
dedd132db7045952511c8788899577c0c3df74cf | XiancaiTian/Leetcode | /q17.py | UTF-8 | 876 | 3.5625 | 4 | [] | no_license | class Solution:
"""
和經典的combination不同,這裡每一層的candidate都不一樣
"""
def letterCombinations(self, digits: str) -> List[str]:
d = len(digits)
k = len(digits)
mapping = ['abc','def','ghi','jkl','mno','pqrs','tuv','wzyx']
"""
和經典的combination dfs()不同,這裡省略了nums, s
... | true |
fdd604eff53a87e0bdd93715e0c989b49f5948af | weinbrek8115/CTI110 | /P4T2_WeinbrennerKarla.py | UTF-8 | 392 | 3.75 | 4 | [] | no_license | #P4T2 Bugs
#Karla Weinbrenner
#22 March 2018
#running total of bugs collected everyday for seven days
#Input number of bugs collected each day
#Display total amount of bugs collected
total=0
for day in range (1,8):
print ("Enter the number of bugs collected on day ", day)
bugs=int(input())
t... | true |
3fd8f13f658d0b79504686ed0b6d76e1afd9e984 | JuhiSrivastava/Algorithmic-Toolbox | /C1 - Week4/sorting.py | UTF-8 | 1,014 | 3.640625 | 4 | [] | no_license | #Python3
#week -4 - assign3
def Partition3(array,pivot,low,high):
index1 = low
index2 = low
for i in range(low+1,high +1):
if array[i] < pivot:
temp = array[i]
array[i]= array[index2+1]
array[index2+1] = array[index1]
array[index1] = temp
i... | true |
2c497019130cf8ddb414096ba19b876f8d52cf7e | katchengli/tech-interview-prep | /data_structures/structures/avl_tree.py | UTF-8 | 7,079 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | from structures.avl_node import AVLNode
class AVLTree(object):
def __init__(self):
self.root = None
def insert(self, value):
if self.root == None:
self.root = AVLNode(None, value)
return self.root
currentNode = self.root
while True:
if value... | true |
0e7563adf496400cd6717ca48f5fc9a648fec98f | MatteoBavecchi/Confronto-tra-algoritmi | /kfold.py | UTF-8 | 1,515 | 2.734375 | 3 | [
"MIT"
] | permissive | import numpy as np
import pandas as pd
from numpy import mean
from sklearn.preprocessing import LabelEncoder, StandardScaler
from config import execute_test
lb_en = LabelEncoder()
sc = StandardScaler()
df = pd.read_csv('datasets/wine_quality.csv')
X = df.drop('Class', axis=1)
y = lb_en.fit_transform(df['Class'])
pri... | true |
600bcf71f4c14c46be4a6a1e671138ad09b0224e | SureshUthirapathy/Intelij_game | /playerfile.py | UTF-8 | 1,036 | 3.90625 | 4 | [] | no_license | class Player:
# checkout the string function that retunrs a string
# prefixing a variable with underscore(_) means its supposed to be hidden
def __init__(self, name):
self.name = name
self._lives = 3
self._level = 2
self._score = 2000
def _get_lives(self):
retur... | true |
db33a7a9616fbcb1693cae2b7e74428d443a7afe | rickchen147258/Raptor | /src/BufferOverDNS.py | UTF-8 | 734 | 2.515625 | 3 | [] | no_license | from src.Base import BaseClass
from utils.Utility import logger
class BufferOverDNS(BaseClass):
def __init__(self):
super().__init__()
self.URL="https://dns.bufferover.run/dns?q=.{domain}"
self.SECTION="FDNS_A"
@logger("BufferOverDNS")
def start(self,domain):
... | true |
652de036cd714d3e526c93347d3eb8b1d1e2256e | dispe1/Problem-Solving | /Number theory/factor.py | UTF-8 | 920 | 3.671875 | 4 | [] | no_license | import math
def factor(n): # 소인수 분해
if n == 1: return [1]
ret = []
div = 2
while n > 1:
while n % div == 0:
n /= div
ret.append(div)
div += 1
return ret
print(factor(n))
#에라토스테네스의 체를 수행하면서 소인수분해를 위한 정보도 저장한다.
def eratosthenes2(n, minFactor):
minFactor[... | true |
cf015faa78dc41b88a040a437d8aaa6d952e563a | dbowmans46/PracticalProgramming | /Session 7 - Python/WarCardGameCompleteExample/War.py | UTF-8 | 2,642 | 2.875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 27 20:00:33 2018
@author: Douglas Bowman
LICENSE (MIT License):
Copyright 2018 Douglas Bowman
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 wi... | true |
1032d51132996437285059c571c6512c77f78bf5 | ben444422/Recommendit | /Back End/Data Scraping/Utils.py | UTF-8 | 3,719 | 3.03125 | 3 | [] | no_license | import sys
from pprint import pprint
from cluster import *
from pymongo import MongoClient
#governs whether a subreddit should be added to a cluster or not
threshold = 15
class Cluster:
initID = 10
clusters = []
def __init__(self):
initID = 10
#fills the clusters list with the cl... | true |
18282bdfb7ca0e8010194240df2e408a16a4905a | IamBirender/Dynamic-Programming | /Knapsack/knapsack01/video_5.py | UTF-8 | 986 | 3.375 | 3 | [] | no_license | class video_5(object):
def __init__(self, weight, capacity, value):
self.weight = weight
self.capacity = capacity
self.value = value
self.N = len(weight)
self.dp = [[-1 for i in range(capacity+1)] for j in range(self.N+1)]
def _get_highest_profit(self):
self.... | true |
ff3c3dc09381b2ae08b6f7b683d055181cb0a057 | DeanDupalov/git_repo_test | /workshop_hash_table/test_hash_table.py | UTF-8 | 756 | 2.90625 | 3 | [] | no_license | import unittest
from OOP.workshop_hash_table.hash_table import HashTable
class TestHashTable(unittest.TestCase):
def test_HashTable_add(self):
test_table = HashTable()
test_table.add('tim', 'TestValue')
def test_HashTableGet_whenKeyIsIn(self):
expected = 'TestValue'
test_tab... | true |
8fcbe64602f17789f6046afe2be6c293dc0209ab | jefflee168/python3.5 | /re/re_test07.py | UTF-8 | 311 | 3.234375 | 3 | [] | no_license | #-*- coding: utf-8 -*-
import re
# 以下演示全局匹配函数
string = """dsafdfgadhellosxxcvxcv.xvxcvxwerewrhellotewte
02840hello0808024324dsfahello4234324"""
# 预编译
pattern1 = ".hello."
# 找出所有结果
result1 = re.compile(pattern1).findall(string)
# 打印结果
print(result1) | true |
eead11ddc1e62cbe71d480c0503e5e805525a0e4 | Samrany/practice_problems | /testing.py | UTF-8 | 297 | 3.546875 | 4 | [] | no_license | def find_max_string(list_of_strings):
max_length = 0
output = None
for each in list_of_strings:
length = len(each)
if length > max_length:
output = each
max_length = length
print(output)
return output
find_max_string(["hi","bye","nowaynohow"])
find_max_string([]) | true |
3dfc1eda42e076dde35a6cd73fb95e628118d2d8 | dydrb141/python-study | /condition_quiz.py | UTF-8 | 2,889 | 4.09375 | 4 | [] | no_license | # Section05-3
# 파이썬 흐름제어(제어문)
# 제어문 관련 퀴즈(정답은 영상)
# 1 ~ 5 문제 if 구문 사용
# 1. 아래 딕셔너리에서 '가을'에 해당하는 과일을 출력하세요.
q1 = {"봄": "딸기", "여름": "토마토", "가을": "사과"}
for q in q1:
if q == "가을":
print(q1[q])
for k, v in q1.items():
if k == "가을":
print(v);
# 2. 아래 딕셔너리에서 '사과'가 포함되었는지 확인하세요.
q2 = {"봄": "딸기", "여름... | true |
852d2b70091faa2670eb63101e2205d3f3ef395e | badgeek/python_ml | /linear_regression.py | UTF-8 | 788 | 3.046875 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
def file2matrix(filename):
txt = np.loadtxt(fname=filename, delimiter=",")
data = txt[:,0]
label = txt[:,1]
return data, label
def hypothesis(feature, weight):
m = feature.shape[0]
w = np.matrix(weight).transpose()
x = np.matrix(np.ones(shape=[m,2]))
for i... | true |
56aeaa6dd14e720f29fd036c2c669991c508e995 | mariyathomas-2000/Image-Processing | /Image processing/Color_Detection.py | UTF-8 | 747 | 3.671875 | 4 | [] | no_license | #color detection
#program to detect green color from image
#import the modules cv2 for image and numpy for image array
import cv2
import numpy as np
#read the image and convert it into HSV using cvtColor()
img = cv2.imread("color.png")
hsv_img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# create a NumPy array for t... | true |
a4f463c6c741b91083c48aa5ed09d7ad58c6abfd | new202004/PO_UI_Test_Framework | /common/base_page.py | UTF-8 | 2,289 | 2.78125 | 3 | [] | no_license | import os
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from common.log_utills import logger
class BasePage:
def __init__(self, driver):
self.driver = driver
# 浏览器操作封装 --> 二次封装
def open_url(self, url):
self.driver.get... | true |
8504206d3479e5747d2f7f1cb5e0707441683316 | Diego-Lander/python | /program4_final.py | UTF-8 | 7,528 | 3.078125 | 3 | [] | no_license | # Progrsm: Porgram 4
# Programmer: Diego Lander
# Date : May 15, 2020
# Version 1.0
#CONSTANTS
IN_STATE_CREDIT_HOUR = 166.00
IN_STATE_FLAT_RATE = 1992.00
IN_STATE_PT_SERVICE_FEE = 160.00
IN_STATE_FT_SERVICE_FEE = 246.00
OUT_STATE_CREDIT_HOUR = 498.00
OUT_STATE_FLAT_RATE = 5976.00
OUT_STATE_PT_SERVICE_FEE = 480.00
OUT... | true |
e984c1298375ceaee16111bab0523eaea9f7b09d | deokgonkim/python-example | /bs_dgkim.py | UTF-8 | 474 | 2.703125 | 3 | [] | no_license | from urllib import urlopen
from BeautifulSoup import BeautifulSoup
text = urlopen("https://www.dgkim.net/wordpress/").read()
soup = BeautifulSoup(text)
jobs = set()
for header in soup("div", "post"):
#print "-" * 80
#print header
links = header('a')
#print(" Links : %s " % links)
if not links: c... | true |
1985974501f5daf02fe504fb5298b1108a68ec23 | sujitkc/evaluate | /demo/submissions/rn006/Q2.py | UTF-8 | 791 | 3.75 | 4 | [] | no_license | def increment(a):
return a+1
def decrement (a):
return a-1
def add(a,b):
for i in range(b):
a=increment(a)
return a
def subtract(a,b):
for i in range(b):
a=decrement(a)
return a
def multiply(a,b):
n=a
for i in range(b-1):
a=add(a,n)
return a
def divide(a,b):
n=0
while(1):
if(a... | true |
f7b22f137b6c187f44ab08a62a013b7b87998e09 | einsteinpy/einsteinpy | /src/einsteinpy/symbolic/helpers.py | UTF-8 | 5,831 | 3.21875 | 3 | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | import warnings
import numpy as np
import sympy
from sympy import ImmutableDenseNDimArray, derive_by_array
def raise_warning(WarningType, message):
warnings.warn(message, WarningType)
def _flatten_list(seq):
# flatten an arbitarily nested list
if not seq:
return []
if not isinstance(seq[0],... | true |
ee4bc78d7bce5a274163711c39acfafcd4d240d6 | Leo-Rain/swirlygig | /process_lluv_for_js.py | UTF-8 | 2,711 | 2.859375 | 3 | [] | no_license | import os
import sys
import simplejson
outfilename = 'import/2013-10.dump'
outfiledir = 'json'
dbname = 'baycurrents';
tablename = 'currents';
fout = open(outfilename, 'w')
sql_insert_tmpl = "INSERT INTO "+tablename+" VALUES ('{date}', '{time1}', '{time2}', {observed}, {lat}, {lon}, {ew}, {ns});\n"
def write_sql(... | true |
d5d6a8f099ff5d019f7f6cb34b1dcbdf6873a311 | AdamLubin96/Programming-Algorithms | /Question1.py | UTF-8 | 924 | 4.375 | 4 | [] | no_license | import random #Imports the random module
def List_Random(List):
#Creates a function which takes 1 parameter in the form of a list
New_List = []
#An empty class variable is created here, this while contain the new random lsit O(n)
while len(List) > 0:
#Conditional checks le... | true |
3c8f5c0a93fe63e2a00b0d2001ecd02c6144e0d1 | asmuelle/UdemyTF | /Chapter5_DNN/Chapter5_1_2_BostonRegression/bostonVisualization.py | UTF-8 | 345 | 2.984375 | 3 | [
"MIT"
] | permissive | import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_boston
dataset = load_boston()
x = dataset.data
y = dataset.target
df = pd.DataFrame(x, columns=dataset.feature_names)
df["y"] = y
print(df.head(n=10))
print(df.info())
print(df.describe())
df.hist(bins=30, figsiz... | true |
19c37470560ad3c700a6a355dd6346aaf9fde48a | nichenxingmeng/PythonCode | /王道机试/放苹果.py | UTF-8 | 371 | 2.734375 | 3 | [] | no_license | n, m = map(int, input().strip().split())
dp = [[1 for _ in range(m + 1)] for _ in range(n + 1)]
for i in range(2, n + 1):
for j in range(2, m + 1):
if j <= i:
dp[i][j] = dp[i - j][j] + dp[i][j - 1]
else:
dp[i][j] = dp[i][i]
print(dp[n][m])
... | true |
567bc459de50f63d46bded6c89e023ca5f568ca1 | akarnoski/data-structures | /python/sorting_algorithms/test_sorts.py | UTF-8 | 3,815 | 3.34375 | 3 | [
"MIT"
] | permissive | """Test sorting alorithms for correct outputs."""
import pytest
"""
Basic Tests
Checking to make sure each sort can be imported without errors.
"""
def test_bubble_sort_can_be_imported():
"""Test import works okay."""
from bubble_sort import bubble_sort
assert bubble_sort
def test_quick_sort_can_be_... | true |
ede5ae5c4350bca10d91812e801b9fbc9e21046b | JasonAHeron/Advent_of_code | /Day_1.py | UTF-8 | 296 | 3.828125 | 4 | [] | no_license | floor = 0
basement = False
for index, instruction in enumerate(open('Day_1.txt').readline()):
floor += 1 if instruction == "(" else -1
if floor < 0 and not basement:
print "Basement on floor: {}".format(index+1)
basement = True
print "Ended on floor: {}".format(floor+1)
| true |
c6a952a6c10cf143416d8977178363e4c6dd9f4d | KuanHaoHuang/nand2tetris | /track_progress.py | UTF-8 | 1,074 | 2.828125 | 3 | [] | no_license | import os, time, pandas
# python3 /Users/WilsonHuang/Downloads/nand2tetris/track_progress.py /Users/WilsonHuang/Downloads/nand2tetris/projects/
if (len(os.sys.argv) < 2):
raise TypeError("no input?")
else:
if not os.sys.argv[1].endswith("/"):
os.sys.argv[1] = os.sys.argv[1] + "/"
if "." in os.sys... | true |
536412b55892609249b42a032731065ab93b643a | miaoliu/mdgo | /mdgo/volume.py | UTF-8 | 10,352 | 2.890625 | 3 | [
"MIT"
] | permissive | """
Computes the volume for each ligand or active site in a file.
In ligand mode, the volume of the entire structure is calculated. The -x, -y,
-z, -xsize, -ysize and -zsize options are ignored.
In active site mode, the unoccupied volume within a cube is calculated. The
center of the cube is defined by the -x, -y a... | true |
6cc6d2a43df925f40da4c4f58285d8a028c45ae2 | ShayK2/9357 | /backend/utils/dietary_restriction_parser_min.py | UTF-8 | 3,858 | 2.640625 | 3 | [] | no_license | import csv
import mongoengine as me
from mongoengine.errors import DoesNotExist, FieldDoesNotExist, NotUniqueError
import sys
sys.path.append('../')
from models.dietary_restriction import DietaryRestriction, Restriction
nutrients = "GT Nutrients.csv"
nutrientRows = []
numRows = 0
with open(nutrients, 'r') as csvfil... | true |
b56592de01c37970508249c56155bf0e2c5fd719 | PratikshaBKamble/Learing | /Linear regression.py | UTF-8 | 916 | 3.40625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
#import some packages(numpy,pandas,sklearn,matplotlib)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#Read the dataset
dataset=pd.read_csv('Salary_Data.csv')
#Divide dataset into x and y
x=dataset... | true |
d282879345a44ca66768689893348e9cb191ab94 | xiaojianliu/resolution | /resolution_new.py | UTF-8 | 3,642 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 25 12:52:48 2018
@author: xiaojian
"""
from math import radians, cos, sin, atan, sqrt
import numpy as np
import matplotlib.pyplot as plt
from netCDF4 import Dataset
#from scipy import interpolate
#from datetime import datetime, timedelta
from matplotlib.path... | true |
846de7f5f461158fe25704978c342c72feee0a30 | Hlev1/WildfireSimulator | /data/src/fuel_model/app.py | UTF-8 | 4,874 | 2.578125 | 3 | [] | no_license | import data.src.common.Converters as Converters
import os.path
import pathlib
import pandas as pd
import rasterio as rio
from data.src.common.constants import *
from flask import Flask, Response
from flask import jsonify, request
from shapely.geometry import *
app = Flask(__name__)
app.url_map.converters['float'] = Co... | true |
8dcc323b81aa7f1612a953abf92527e0b70098b6 | NatholBMX/ScaleDigitizer | /analyzeScale.py | UTF-8 | 16,828 | 2.796875 | 3 | [] | no_license | """
For videos: the glare should be NOT on the digits but above/below it
"""
import cv2
import numpy
import urllib.request, urllib.error, urllib.parse
import imutils
import imutils.perspective
from operator import itemgetter
from skimage import img_as_ubyte
from skimage.filters import threshold_local
import os
import ... | true |
e8d6af7de6617589e839f19d1282dcedbacac26a | AlexanderStarr/HW_cityNetwork | /hw5SolutionTest.py | UTF-8 | 2,823 | 2.53125 | 3 | [] | no_license | '''
>>> [cityList, distances] = createDistanceMatrix()
>>> cityNetwork = createCityNetwork(cityList, distances, 400)
>>> sorted(cityNetwork["Wilmington NC"])
['Richmond VA', 'Roanoke VA', 'Rocky Mount NC', 'Salisbury MD', 'Savannah GA', 'Staunton VA', 'Sumter SC', 'Swainsboro GA', 'Washington DC', 'Waycross GA', 'Wilmi... | true |
866fed89edf935855bfd679a21788f804ed7e072 | srid/boalisp | /tests/test.py | UTF-8 | 1,148 | 2.796875 | 3 | [] | no_license | from __future__ import with_statement
from os import system
from StringIO import StringIO
from contextlib import contextmanager
import sys
class _boa:
__slots__ = ('stdout', '_old_stdout', 'mod')
def check_stdout(self, s):
actual_output = self.stdout.getvalue()
assert actual_output ... | true |
60f708dafca0e27c16627c45367eca15940ebd07 | Ziya-Meiramova/python69 | /1.py | UTF-8 | 1,055 | 3.828125 | 4 | [] | no_license | # a = "Hi"
# a = 6
# print(a)
# a = True
# print(a)
# print(type(a))
# name = "Ziya"
# surname = "Meiramova"
# print(surname, name)
# a = 5
# n = "Decode"
# print(a + n)
# print(True) #True
# a = True
# print(a) #True
# print(int(a)) #1
# print(bool(1)) #True
# print(int(False)) # 0
# a = 5
# b = 5.5
# c = "jdfb... | true |
3483dab049fcceb3e30c3f95820d05271a99521f | Aasthaengg/IBMdataset | /Python_codes/p02622/s261643728.py | UTF-8 | 127 | 2.609375 | 3 | [] | no_license | N=list(input())
M=list(input())
ans=0
number=len(N)
for i in range(number):
if N[i]==M[i]:
ans+=1
print(number-ans) | true |