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 |
|---|---|---|---|---|---|---|---|---|---|---|
b9ec95472fa4e3375fc575032aba9ffa7906dfb7 | OpenSourceBrain/osb-model-validation | /omv/validation/rx_validator.py | UTF-8 | 916 | 2.671875 | 3 | [] | no_license | import pyrx
import yaml
class RXSchemaValidator(object):
def __init__(self):
self.rx = pyrx.Factory({"register_core_types": True})
def generate_schema(self, schema_src):
schema = self.parse_yaml_file(schema_src)
print("generating schema from %s" % schema)
return self.rx.make_s... | true |
03330bd22aaec9aa06194d5cdbfda7980d7c0b56 | StevenLarge/StochasticControl | /InfiniteTest/InfiniteDriver.py | UTF-8 | 708 | 2.640625 | 3 | [] | no_license | #This module is the driving routine for the Stochastic Control of a nested OU process, where the time scale
#separation is taken to be infinite, so the system remains at equilibrium through the entire protocol.
#
#Steven Large
#December 16th 2016
from math import *
from Potential import *
from Parameters import *
fro... | true |
200092ffb8ac9366b472a5bde279aa3e801906d0 | Pbyrne95/interview_qs | /linked_list/is_bst.py | UTF-8 | 2,187 | 3.640625 | 4 | [] | no_license | class Node:
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.right = right
def __str__(self):
return str(self.value)
def is_bst(node, lower_lim=None, upper_lim=None):
head_node = node.value
search_node = node
search_left = ... | true |
9eceadf4fa9a4e463ec8a7f84b17242ced77850f | ikajic/remote_associates_test | /rat/model/tests/test_CompareAlgoNetworkBowdenDataSet.py | UTF-8 | 2,184 | 2.8125 | 3 | [] | no_license | import unittest
import numpy as np
from algorithm.sa import spread_activity
from model.network import Network
import pdb
class CompareAlgoNetworkBowdenDataSet(unittest.TestCase):
"""
Compares the algorithm and the network performance for the Bowden et al.
(2003) dataset.
Maximal number of searched i... | true |
479e3c58646d6c0c8ee0363b23db14341c32d3b8 | cagriyalniz/python_ikinci_kurs | /machine_learning_regression/tahmin.py | UTF-8 | 320 | 3.078125 | 3 | [] | no_license | import pandas as pd
import matplotlib.pyplot
from sklearn.linear_model import LinearRegression
veri = pd.read_csv("hw_25000.csv")
print(veri.columns)
boy = veri.Height.values.reshape(-1,1)
kilo = veri.Weight.values.reshape(-1,1)
regression = LinearRegression()
regression.fit(boy, kilo)
print(regression.predict(71))
| true |
0daf1b6813319f3e6d94f67fc33fee525fdc43d7 | bharatij/STRetch | /scripts/MultipleTestCorrection.py | UTF-8 | 2,509 | 2.546875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 23 10:16:21 2020
@author: jadhab01
"""
import warnings
import datetime
from datetime import datetime
with warnings.catch_warnings():
warnings.simplefilter("ignore", FutureWarning)
import argparse
import sys
import glob
import o... | true |
c6d1dfc4d08c167c35eddefacbfd55925e0ed9e5 | lukmccall/online-chess | /tests/test_logicboard.py | UTF-8 | 1,953 | 2.828125 | 3 | [] | no_license | from unittest import TestCase, mock
import chess
from game import PythonChessLogicBoard
class TestPythonChessLogicBoard(TestCase):
@mock.patch("chess.Board.result", return_value="1/2-1/2")
@mock.patch("chess.Board.is_game_over", return_value=True)
def test_winner_draw(self, mocked_chess_board_is_game_ove... | true |
95281f31a20ce091ebafdc240ac05e5b495e6de1 | rajaupadhyay/FreezeTagProblem | /readfromfile_transit.py | UTF-8 | 13,113 | 2.703125 | 3 | [] | no_license | import math
from math import sqrt
from queue import *
import sys
from shapely.geometry import Polygon, LinearRing, LineString
import logging
import matplotlib.pyplot as plt
import numpy as np
from descartes import PolygonPatch
import pprint
import multiprocessing
from decimal import *
from functools import partial
cla... | true |
e24a7c8972fee3625cf5f95b9d34fd64f57bdb13 | usnistgov/SDNist | /sdnist/report/plots/grid.py | UTF-8 | 4,404 | 2.875 | 3 | [
"NIST-Software"
] | permissive | import os
import math
from typing import List, Dict, Tuple
from pathlib import Path
import matplotlib.cm
import matplotlib.pyplot as plt
from matplotlib import colors
import pandas as pd
import numpy as np
plt.style.use('seaborn-deep')
class GridPlot:
def __init__(self,
scores: pd.DataFrame,
... | true |
fc0781ea02e09ffabbe5e41c2f20c55f9aa31f9f | justanalytics/Artificial-Intelligence-for-Insurance | /01_Code/feature_engineering.py | UTF-8 | 6,216 | 2.765625 | 3 | [] | no_license | ## Description: This code is used to derive all the features required by the machine learning model. These features are extracted directly from the data. Readme.md file has the list of all the features that are to be used as part of this model.
## Created By: Aditya Mohan Arasanipalai (aditya.am@justanalytics.com)
## C... | true |
4d12a4cfc58bf05df51b6ad43e552f5e19b45fd4 | wltu/TournamentBot | /rulesets/match.py | UTF-8 | 3,409 | 3.375 | 3 | [] | no_license | from .enums import Bracket
class Match:
def __init__(self, match_id, level=0, player_one=None, player_two=None):
self.player_one = player_one
self.player_two = player_two
self.left_match = None
self.right_match = None
self.next_match = None
self.level = level
... | true |
db1adf5c212b6d21047e300099281a37f91cdb89 | ubi-agni/sr_interface | /sr_example/scripts/sr_example/hand_examples/sr_right_hand_follow_finger_trajectory.py | UTF-8 | 1,933 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python
# An example of how to follow a trajectory defined using a set of waypoints for the first finger.
import rospy
from sr_robot_commander.sr_hand_commander import SrHandCommander
from sr_utilities.hand_finder import HandFinder
import geometry_msgs.msg
import copy
rospy.init_node("hand_example_foll... | true |
1ecd1c0fa70970834c69f3686389edb9260948a1 | creachadair/classifier | /Classifier/textparsers.py | UTF-8 | 8,936 | 3.28125 | 3 | [
"MIT"
] | permissive | ##
## Name: textparsers.py
## Purpose: Composeable text parsers for classification.
##
## Copyright (C) 2008 Michael J. Fromberger, All Rights Reserved.
##
import htmlentitydefs, re
split_re = re.compile(
r'(<?https?://\S+|[#$]\d+(?:\.\d*)?|'
r'\d+%|'
r'[a-z0-9]+'
r'(?:[-\'./][a-z0-9]+|'
r'-\... | true |
341f71932e0c6625d4ad7ca9591385658ae3a789 | armandli/rlgames | /python/unit_test/test_unzip.py | UTF-8 | 543 | 2.9375 | 3 | [] | no_license | import os.path
import tarfile
import glob
import gzip
import shutil
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--file', '-f', type=str)
args = parser.parse_args()
return args
def unzip_data(zipfile):
this_gz = gzip.open(zipfile)
tar_file = zipfile[0:-3]
thi... | true |
d000a3cc7d3b573c265c1c7d507a4606758023bb | priyankaauti123/Python | /string/pal.py | UTF-8 | 309 | 3.921875 | 4 | [] | no_license | str=input("Enter string:=")
def check_pal(str):
n=len(str)
n-=1
j=0
for i in range(n,0,-1):
if str[i]!=str[j]:
j+=1
return False
else:
j+=1
return True
if(check_pal(str)==True):
print "palindrome"
else:
print "not palindrome"
| true |
29f66a3df65a41c25957de41a503157b2372aa2b | shane-gooch/home-be | /scripts/selenium/get_pge.py | UTF-8 | 671 | 2.640625 | 3 | [] | no_license | from base_selenium_class import GetWebElement
from decouple import config
class GetPge(GetWebElement):
def getTotal(self, numToSplitBy):
super().start_headless('https://pge.com/')
super().get_element("id", "username").send_keys(config('PGE_USER'))
super().get_element("id", "password").se... | true |
f6768bd6162dc5d2113879e1395600da3476f675 | nouhadziri/THRED | /thred/util/kv.py | UTF-8 | 6,457 | 2.640625 | 3 | [
"MIT"
] | permissive | """ Key-Value store (i.e., Redis) utilities
"""
import os
import subprocess
import redis
class TinyRedis:
""" TinyRedis is a wrapper on Redis functions and supports a subset of Redis functions.
Upon construction, it pings the server, meaning that an execption would be thrown in case of failure.
"""
... | true |
3a4786904bd39cec423fd9b1f95ae67985294036 | andrasnagy-data/programming_basics_practice | /api, sqlite, re practice/request from API.py | UTF-8 | 727 | 2.96875 | 3 | [] | no_license | from imdb import IMDb, IMDbError
import re
try:
# instance of IMDb
im = IMDb()
# getting top 250 movies
movies = im.get_top250_movies()
except IMDbError as e:
print(e)
else:
# top 250 movie id
pattern = re.compile(r'\d\d\d\d\d\d\d')
matches = pattern.finditer(str... | true |
dc0fcf19db801cd97de9f0ae2ee0072a0f90cdc9 | kruschev/Scrape-data-for-IPO-from-googlefinance-and-NASDAQ | /main.py | UTF-8 | 1,799 | 3 | 3 | [] | no_license | import pandas as pd
from pandas_datareader.google.daily import GoogleDailyReader
class FixedGoogleDailyReader(GoogleDailyReader):
@property
def url(self):
return 'http://finance.google.com/finance/historical'
import datetime
from pandas.tseries.offsets import BDay
from bs4 import Beautiful... | true |
8ad0e332ac58df54f9a0e024f2a73ef155e14cb6 | miteshnath/backend_trip_gallery | /app/api/v1/trip_views.py | UTF-8 | 4,991 | 2.53125 | 3 | [] | no_license | import jwt
import time
import json
from datetime import datetime
from flask import Blueprint, jsonify, g
from flask import request
from flask_cors import cross_origin
from flask import current_app as _app
from sqlalchemy.exc import IntegrityError, OperationalError
from werkzeug.security import generate_password_hash, ... | true |
62bbeae6035c0c7df662354a571ec44e46dd852a | JingkaiTang/github-play | /young_day/woman_and_big_company/try_week_into_number.py | UTF-8 | 226 | 2.640625 | 3 | [] | no_license |
#! /usr/bin/env python
def look_day_under_place(str_arg):
long_day(str_arg)
print('way_or_few_group')
def long_day(str_arg):
print(str_arg)
if __name__ == '__main__':
look_day_under_place('take_few_point')
| true |
03fe20f81b9bfdeed9e9fc153355cb797be86835 | chrisrcoles/normalize_csv | /test_normalize_csv.py | UTF-8 | 428 | 2.78125 | 3 | [] | no_license | from normalize_csv import convert_timestamp, parse_duration
def test_convert_timestamp():
assert (convert_timestamp("11/01/03 07:34:25 PM")
== "2003-11-01T22:34:25-05:00")
assert (convert_timestamp("11/01/03 11:34:25 PM")
== "2003-11-02T02:34:25-05:00")
def test_parse_duration():
... | true |
da31a9226a5bdbaa9e50c9a9b8699db58ead359c | yaso111/CFD-Python | /exo1d_conserv.py | UTF-8 | 8,095 | 2.5625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 12 19:20:42 2014
exercice - chapter 7 - section 7.5
subsonic isentropic nozzle flow - conservation form
Anderson, John. Computational Fluid Dynamics. 1 edition.
New York: McGraw-Hill Science/Engineering/Math, 1995.
@author: ml971 hotmail.com
"""
import numpy a... | true |
7a5f45f3650228083fb8033eef476e390f77d9ac | afcarl/theanets | /theanets/recurrent.py | UTF-8 | 15,019 | 3.390625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
'''This module contains recurrent network models and utilities.'''
import collections
import numpy as np
import re
from . import feedforward
def batches(arrays, steps=100, batch_size=64, rng=None):
'''Create a callable that generates samples from a dataset.
Parameters
---------... | true |
6c0e284c1c312ebd7998b5b5b8c1f16f03444eeb | YunzengLee/AlgorithmQue | /LeetcodeCollection/exam9_12.py | UTF-8 | 1,243 | 2.890625 | 3 | [] | no_license | def ifPut(x,y):
"""
:param x:(1,2,3)
:param y: (3,4,5)
:return:
"""
# print('compare')
if min(y[0],y[1])>min(x[0],x[1]) and max(y[0],y[1])>max(x[0],x[1]):
return True
# print(x,y)
return False
res = []
while True:
num = input()
if not num:
break
num = i... | true |
4b62b6e770712ceb2e596aab4a2bb7de472ca625 | eshwarne/OpenCV-Tutorial | /capturingVideoWebCam.py | UTF-8 | 406 | 3.015625 | 3 | [] | no_license | #USE A LIBRARY CALLED Cv2 -- to do image processing
#pip install cv2, pip install numpy
#BGR -- RGB
import cv2
cap = cv2.VideoCapture(0) #0 first web came, 1 second, 2 third
while True:
ret, frame = cap.read()
bw = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
cv2.imshow("GRAY",bw)
cv2.imshow("NAME OF THE WINDOW",frame)... | true |
e812a3fcc37d69bb3370c1c2157ca32db6cec905 | mkarier/RaspberryPiLights | /randomColor.py | UTF-8 | 461 | 2.96875 | 3 | [] | no_license | import time
import board
import neopixel
import random
pixel_pin = board.D18
num_pixels = 300
ORDER = neopixel.RGB
wait = 1.0
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.2, auto_write=False, pixel_order=ORDER)
def randomColorForPosition(pos):
pixels[pos] = (random.randrange(255), random.randran... | true |
c77c94d0b7a7a722e30f97fdcfe60003937253da | 9998546789/firstpart | /python/lesson3/Task6.py | UTF-8 | 1,101 | 4.625 | 5 | [] | no_license | # 6. Реализовать функцию int_func(),
# принимающую слово из маленьких латинских букв и возвращающую его же,
# но с прописной первой буквой.
# Например, print(int_func(‘text’)) -> Text.
# Продолжить работу над заданием.
# В программу должна попадать строка из слов,
# разделенных пробелом. Каждое слово состоит из латинск... | true |
9582dd51a56718ec6db91c2d732036e5743b0333 | Ablay09/BFDjango | /Week 1/Codingbat/List - 1/1.py | UTF-8 | 133 | 3.09375 | 3 | [] | no_license | def first_last6(nums):
l = len(nums)
for i in range(0, l):
if(nums[0] == 6 or nums[l-1]==6):
return True
return False | true |
10ee0bab24b22c99acbc9b832f66088c6291a2f7 | silverlyjoo/TIL | /django/190213_django_intro/home/views.py | UTF-8 | 1,075 | 2.703125 | 3 | [] | no_license | from django.shortcuts import render, HttpResponse
from pprint import pprint
import random
# Create your views here.
def index(request):
return HttpResponse('Welcome to Django !')
def dinner(request):
menus = ['참치회', '방어회', '연어회', '광어회']
pick = random.choice(menus)
pick2 = random.choice(menus)
... | true |
7917fbff0cbf203e082ae6652475e875eeab12b8 | ai-mosaic/course | /practicum/RulsOfLifeNN.py | UTF-8 | 963 | 2.953125 | 3 | [] | no_license | from itertools import permutations
from random import shuffle
import numpy as np
from sklearn.neural_network import MLPRegressor
# creating all possible inputs
all_boards = []
for i in range(10):
x = [0]*i + [1]*(9-i)
all_boards += list(set(permutations(x,9)))
shuffle(all_boards)
def new_state(L):
# numb... | true |
b3e8069f5badc1bcdfc7c7cc5466fe39aea9e208 | taniyanagda/project_python | /python/while2.py | UTF-8 | 91 | 3.5 | 4 | [] | no_license | my_list = [1, 2, 3, 4, 5]
a = 4
while a >= 0:
print(my_list[a])
a -= 1 #a=a-1 | true |
5e40be16dfe8eb68763d9d092e95da0c7eb1db4a | matthieumeeus/IndependentStudySpring2020 | /Helmholtz_heterogen.py | UTF-8 | 5,410 | 2.546875 | 3 | [] | no_license | from neurodiffeq.pde_polar import DirichletBVPPolar, solve_polar
import torch
from neurodiffeq.networks import FCNN
import numpy as np
from neurodiffeq import diff
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import torch.optim as optim
import torch.nn as nn
from scipy.special import j0, y0, ... | true |
8df2c663b7bfbb208990864a87224eaadec02a71 | ricardoy/chesstakov | /generate_autoencoder_dataset.py | UTF-8 | 1,961 | 2.875 | 3 | [] | no_license | import numpy as np
import h5py
import sys
from tqdm import tqdm
from aux import load_chess_dataset_into_memory
def generate(input_file, training_file, testing_file, training_size, testing_size):
total_positions = training_size + testing_size
white, white_size, black, black_size = load_chess_dataset_into_memor... | true |
660bdb84eaa6d3898d00551bada9d24fe32a383c | IlliaOvcharenko/reface-fake-detection | /scripts/crop_frames.py | UTF-8 | 1,347 | 2.71875 | 3 | [] | no_license | """
TODO crop faces only
"""
import sys,os
sys.path.append(os.getcwd())
import matplotlib
matplotlib.use('Agg')
import cv2
import numpy as np
from fire import Fire
from pathlib import Path
from tqdm.cli import tqdm
def crop_frames(video_folder, frame_folder, n_crops):
for video_fn in tqdm(list(video_folder.gl... | true |
eaf62dd7147f90c7782fc700b5af47ec9f2d0556 | jstacoder/basecamp-next | /bcnxt/new_basecamp.py | UTF-8 | 1,466 | 2.546875 | 3 | [
"MIT"
] | permissive | import requests
from auth import get_auth
MY_URL_NUM = '2361076'
AUTH = get_auth()
BASE_URL = 'https://basecamp.com/{}/api/v1/'
MY_URL = BASE_URL.format(MY_URL_NUM)
class BCError(Exception):
pass
class BaseCampConnectionError(BCError):
pass
class BaseCampConnectionAuthError(BCError):
pass
class BaseCam... | true |
7914508cf53ae48cc4330220d0d5c729a0f4c36c | Akiravictor/MC886 | /T1/Regression.py | UTF-8 | 2,755 | 2.796875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 28 21:46:05 2017
@author: Akira
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
dataset= pd.read_csv('year-prediction-msd-train.csv')
X = dataset.iloc[:,1:13].values
Y = dataset.iloc[:,0].values
#Spliting into training set and validation set
... | true |
96db37ad2720102c71925735280155d06506eb42 | junaidpy/mini-project | /database_miniproject.py | UTF-8 | 24,573 | 3.03125 | 3 | [] | no_license | import pymysql
import os
from dotenv import load_dotenv
def load_database():
load_dotenv()
host = os.environ.get("mysql_host")
user = os.environ.get("mysql_user")
password = os.environ.get("mysql_pass")
database = os.environ.get("mysql_db")
connection = pymysql.connect(
host,
user,... | true |
39a0572ebf49dbfcd21f42a6e99840b419c2b389 | 2371406255/PythonLearn | /02_编码和字符串.py | UTF-8 | 2,409 | 4.125 | 4 | [] | no_license | #!/usr/bin/env python3
#coding:utf-8
#Unicode编码:把所有语言统一到一套编码里
#UTF-8编码:可变长的Unicode编码,合理利用空间
#ASCII编码实际上是UTF-8编码的一部分
#计算机内存中,统一使用Unicode编码,保存到硬盘或需要传输时,转成UTF-8编码。
#所以,从文件中读取UTF-8字符会被转成Unicode字符到内存中,编辑完成后,又转成UTF-8保存到文件。
#浏览网页时,服务器会把动态生成的Unicode内容转换为UTF-8再传输到浏览器。
#字符串,Python3中,字符串是用的Unicode编码,所以Python字符串是支持多语言的。
print('包... | true |
931ffacf1a8ddc2eeec8e6d931ba11cad6d051a5 | nbvc1003/python | /ch03/fahrenheit1.py | UTF-8 | 309 | 3.890625 | 4 | [] | no_license |
def fahrenheit_to_celsius(fahrenheit):
print('화씨온도 :', fahrenheit)
cel = fahrenheit
for i in range(len(fahrenheit)):
cel[i] = (fahrenheit[i]-32)*5/9
print('썹씨온도 :', cel)
sample_temperature_list = [40,15,32,64, -4, 11]
fahrenheit_to_celsius(sample_temperature_list)
| true |
87f8843c4fe4d408f0902017ebf8f5ea22ecc6ff | pavelbrnv/Coursera | /PythonBasis/week04/task07.py | UTF-8 | 1,121 | 3.71875 | 4 | [] | no_license | epsilon = 10 ** -6
def distance(x1, y1, x2, y2):
return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
def isPointInCircle(x, y, xc, yc, r):
return distance(x, y, xc, yc) < r
def isPointOnCircle(x, y, xc, yc, r):
return abs(distance(x, y, xc, yc) - r) < epsilon
def isPointUnderLine(x, y, b, c):
return... | true |
da53436c7bb295e496605932114c04ce2282833d | contd/mkname | /mkmap.py | UTF-8 | 814 | 2.625 | 3 | [] | no_license | from sys import argv
inf = open(argv[1], 'r')
d = {}
for line in inf.readlines():
s = line[0].upper()
if s in d:
if not line.strip() in d[s]:
d[s].append(line.strip())
else:
d[s] = [line.strip()]
print('std::map<char, std::vector<std::string> > ', argv[2],' = { ',sep='')
lke... | true |
47cc536c626d287ffae209d58cfc1eef1a57e89f | kingsman142/advertisement-effectiveness-cv | /action_reason_statistics.py | UTF-8 | 3,208 | 2.765625 | 3 | [] | no_license | import json
import numpy as np
from scipy.stats import pearsonr
import scipy.stats
import matplotlib.pyplot as plt
VIDEO_EFFECTIVE_RAW_FILE = "./annotations_videos/video/raw_result/video_Effective_raw.json"
action_RAW_FILE = "./annotations_videos/video/raw_result/video_QA_Action_raw.json"
reason_RAW_FILE = "./annotati... | true |
857a772ea82cba2ad72a2e14e776db78ecceecc4 | QubeHeadedT/latticeqcd | /leastsqfit.py | UTF-8 | 5,016 | 3.390625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 3 14:02:46 2017
@author: jamesleech
"""
#Performs a 3D fit of (A, sigY, C) using a function other than curve_fit
#It uses leastsq from scipy library.
from scipy.optimize import leastsq
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d imp... | true |
cd9e919358bbf2c8e1f6a31cb45ad7ef356210da | haondt/Rubiks-Cube-Solver | /code/python/cube.py | UTF-8 | 5,714 | 3.203125 | 3 | [] | no_license | class Cube():
sides = {i:[None] for i in "FRULBD"}
# holds an array of ixi values representing the color of each square,
# left to right top to bottom when looking at each face
# each side is regarded with the front as the bottom
# the back is regarded the same way as the front
sidenums = {"FRULBD"[i]:i for i i... | true |
02078692973692842ff9bb8de7f685f29447cf48 | bricaud/OCR-classif | /csv2folders.py | UTF-8 | 1,746 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
""" Create a series of folders and store a copy of the classified files in them.
The folders are created from the csv file.
"""
import argparse
import os
import shutil
import csv
parser = argparse.ArgumentParser(description='From the csv file, create a series of folders and store a copy of the cl... | true |
a64e8f9e2b3d3e91e8ab69b8fa28f3bd258e6c57 | Netmistro/Py-Practical-Problems | /Chapter 2/2.5.10.py | UTF-8 | 420 | 4.625 | 5 | [
"MIT"
] | permissive | # Use a for loop to print a box like the one below
# Allow the user to specify how wide and how high the box should be
# [Hint: print('*'*10) prints ten asterisks.]
# *******************
# *******************
# *******************
# *******************
widthOfBox = eval(input('Enter width of box: '))
heightOfB... | true |
5fa73d0fe736414dbbb4b25c621df110bfb02ab7 | teng-lin/teng-lin.github.io | /scripts/scrape_linkedin.py | UTF-8 | 4,044 | 2.65625 | 3 | [
"MIT"
] | permissive | import sys
import subprocess
import json
import re
import pandas as pd
from pandas import ExcelWriter
_id_offset_pattern = re.compile(u'id=(\d+)&offset=(\d+)')
def _decode_list(data):
rv = []
for item in data:
if isinstance(item, unicode):
item = item.encode('utf-8')
elif isinsta... | true |
93558c60bb8e478e628bcf75b3258c550951d08e | CodingBuye/PythonForNowcoder | /python程序员面试算法宝典/第八章 排序/8.4 归并排序.py | UTF-8 | 744 | 3.578125 | 4 | [] | no_license | class Solution:
def merge_sort(self, lists):
if len(lists) <= 1:
return lists
num = len(lists) // 2
left = self.merge_sort(lists[:num])
right = self.merge_sort(lists[num:])
return self.merge(left, right)
def merge(self, left, right):
i, j = 0, 0
... | true |
89d06e972e03e11aaa0e5730882a76c128d45b3d | i3ef0xh4ck/mylearn | /Python进阶/day036/homework1.py | UTF-8 | 7,355 | 2.953125 | 3 | [] | no_license | # mysql> desc class;
# +---------+-------------+------+-----+---------+----------------+
# | Field | Type | Null | Key | Default | Extra |
# +---------+-------------+------+-----+---------+----------------+
# | cid | int(11) | NO | PRI | NULL | auto_increment |
# | caption | varchar(32) |... | true |
8aba46e81386032ecf90de1023685cc6648a029e | vuquocm/VuQuocMinh-c4t7 | /p5/gmae.py | UTF-8 | 473 | 3.390625 | 3 | [] | no_license | from random import randint
loop = True
while loop:
a = randint(0, 20)
b = randint(0,20)
c = randint(0, 40)
print(a, "+", b, "=", c)
x = str(input())
if x == "true" and a + b == c:
x = input()
elif x == "false" and a + b != c:
x = input()
elif x == "tr... | true |
08b46f85a4363ebbc1635219819e004edee2a8a8 | xiaoy/Exercise | /Python/chapter15/11.py | UTF-8 | 398 | 3.09375 | 3 | [] | no_license | # this program is used to math email address
import re
restr = r"(\w)+@(\w)+\.[com|cn|net|edu|org]"
def main():
input_str = raw_input("input email address:")
reojb = re.match(restr, input_str)
if reojb is None:
print("you input email:%s is illegal" % (input_str))
else:
print("you in... | true |
a7daeaabe52f3d253b8bb4cbe169e3968a71cc43 | nthistle/advent-of-code | /2018/day-07/day_7.py | UTF-8 | 1,785 | 2.984375 | 3 | [] | no_license | with open("input.txt") as file:
inp = file.read().strip()
# both of these solutions are poor, but were fast to write
# and are good enough for the given test case
steps = [(line[5],line[36]) for line in inp.split("\n")]
step_dict = {}
for step in steps:
if step[1] in step_dict:
step_dict[step[1]].appen... | true |
235b69770e68fcec5cf6750f5bd0569863c71a73 | christianledgard/proyecto-DB2 | /Testing/HASH_modified/Results/procesarResultados.py | UTF-8 | 1,033 | 2.921875 | 3 | [
"MIT"
] | permissive | import pandas as pd
def generarSecuenciaCSV(nombreArchivoSource, nombreArchivoDesnation, delete = False):
df = pd.read_csv(nombreArchivoSource, header=None)
lista = []
lista.append(0)
temporal = 1
flag = False
for i in range(9999):
lista.append(temporal)
if(flag):
flag = False
temporal... | true |
f9a9d580fa9978aac4df387c6fe165444de30f0e | booler/UNet-PS-4D | /models/pxnet.py | UTF-8 | 2,863 | 2.78125 | 3 | [
"MIT"
] | permissive | """
PX-NET code based on the pre-print article https://arxiv.org/abs/2008.04933 (v1 and v2)
"""
from tensorflow.keras import backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Dropout, Flatten, Lambda, Input, Concatenate, Conv2D, MaxPool2D, AvgPool2D
def denseblock(x, c... | true |
0541e73d276539e91d0e4d882322bbe06d265a53 | u1718/checkio | /fizz_buzz.py | UTF-8 | 1,525 | 4.40625 | 4 | [] | no_license | """ "Fizz buzz" is a word game we will use to teach the robots about division. Let's learn computers.
You should write a function that will receive a positive integer and return:
"Fizz Buzz" if the number is divisible by 3 and by 5;
"Fizz" if the number is divisible by 3;
"Buzz" if the number is divisible by 5;
The nu... | true |
ceaff4813f547d1a64b974c9907ed9e5284973a3 | silvewheat/biocal-cli | /cal_fasta_length.py | UTF-8 | 688 | 2.96875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 20:23:43 2018
@author: YudongCai
@Email: yudongcai216@gmail.com
"""
import click
@click.command()
@click.argument('fafile')
def main(fafile):
"""
"""
with open(fafile) as f:
length = 0
lastname = None
fo... | true |
ce5bb1598c909fa0b150b8593fc86012506b9eb5 | varshith-k/Hacktoberfest | /PositionalIndex.py | UTF-8 | 3,422 | 3.3125 | 3 | [] | no_license | # importing libraries
import numpy as np
import os
import nltk
from nltk.stem import PorterStemmer
from nltk.tokenize import TweetTokenizer
from natsort import natsorted
import string
def read_file(filename):
with open(filename, 'r', encoding ="ascii", errors ="surrogateescape") as f:
stuff = f.read()
f.close()
... | true |
954be3d3051f5010f076cee9f122e60be80b4c46 | beichen-xing/DataMining_Course_Projects | /DataPrepocessing/Standardization_scaling_normalization.py | UTF-8 | 1,585 | 2.765625 | 3 | [] | no_license | import numpy as np
import pandas as pd
from sklearn import preprocessing
import matplotlib.pyplot as plt
raw_data = pd.read_csv('flag_data/flag.data')
areadata = raw_data['4']
areadata = np.array(areadata).reshape(-1,1)
## standarization
areadata_scaled = preprocessing.scale(areadata)
plt.hist(areadata_scaled,100)
pl... | true |
840927eab8097c30354d41fd149b3f6d45cb316a | kondrashev-y/change_xls | /gui.py | UTF-8 | 2,365 | 2.90625 | 3 | [] | no_license | import tkinter as tk
import os
from tkinter import ttk
from change_cell_in_xl import ChangeCell
window = tk.Tk()
window.title('Cell changer App')
window.geometry('400x300')
window.resizable(width=False, height=False)
frame_info = tk.Frame(window, width=200, height=200, bg='red')
frame_add_form = tk.Frame(window, wid... | true |
f483c16c17951c26d66954d6fa8ad8871a915935 | ZitingShen/Euler-Project | /21. Amicable numbers.py | UTF-8 | 563 | 3.34375 | 3 | [] | no_license | import time
import math
start = time.time()
def proper_divisor(num):
pd=1
for x in range(2,math.ceil(num**0.5)):
if num%x==0:
pd+=x
pd+=num//x
if num%(num**0.5)==0:
pd+=int(num**0.5)
return pd
S=0
l=[1]*2+[0]*9997
for x in range(1,10000):
if not l[x-1]:
... | true |
d16abdcf6db7850f652943eeb57a3d3061640807 | marlonjames71/Intro-Python-I | /src/env python3.py | UTF-8 | 1,552 | 4.15625 | 4 | [] | no_license | #!/usr/bin/env python3
import random
# Create Rock Paper Scissors Game in Python
# Player should be able to type r, p, or s
# Computer will pick r, p, or s
# Game will print out the results and keep track of wins, losses, and ties
# Type q to quit
# Build REPL
wins = 0
losses = 0
ties = 0
choices = ["r", "p", "... | true |
28f298d467ad6a99893b89e06a3e383356827667 | saransappa/My-leetcode-solutions | /445. Add Two Numbers II/445.py | UTF-8 | 661 | 3.15625 | 3 | [] | no_license | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
k = ''
l = ''
while l1!=None:
k+=str(l... | true |
7abfc529e5a2a98a62afbf2525746a60b4866521 | spyysalo/finnish-registers | /scripts/gettexts.py | UTF-8 | 896 | 2.609375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import os
import sys
import json
from logging import warning
def argparser():
from argparse import ArgumentParser
ap = ArgumentParser()
ap.add_argument('dir', help='output directory')
ap.add_argument('file', metavar='JSON', nargs='+', help='annotations')
return ap
def ma... | true |
e26b220d61b8de10761f5fda54da64b7bf5c6633 | lludu/100DaysOfCode-Python | /Day 25 - US States Quiz Game/Exercise 1/main.py | UTF-8 | 3,699 | 4.21875 | 4 | [] | no_license | from statistics import mean
# # # --------------------------------CONVERTING DATA INTO TEMPERATURE LIST------------------ # # #
# ---- Normal Python Method--- #
# open weather_data.csv and store each line in a list
# weather_days_list = []
# with open("weather_data.csv") as weather_data_file:
# weather_data = weat... | true |
65792c39f6124f86f67a33044626c4613ee9c51d | jason3189/Mr.zuo | /Mr.左/month01/代码/day04/exercise.py | UTF-8 | 2,608 | 3.796875 | 4 | [] | no_license | # 1.输入一个字符串,输出每个字符的编码值
# int_char=str(input("请输入一个字符:"))
# print(ord(int_char))
# 2.循环输入编码值,显示字符,直到输入负数时退出
# while True:
# int_char = int(input("请输入一个编码值:"))
# if int_char < 0:
# break
# print(chr(int_char))
#
# 3.显示120秒倒计时
# num = 120
# while True:
# if num >=+- 0:
# fz = num.- // 60
# miao = n... | true |
3d5209c537332794c3dc079be8c81ed9deb9d0c5 | m-rios/msc-machine-learning | /cleaning/unique.py | UTF-8 | 275 | 2.8125 | 3 | [] | no_license | import sys
inn = sys.argv[1]
out = inn + '-unique'
lines_seen = set() # holds lines already seen
outfile = open(out, "w")
for line in open(inn, "r"):
if line not in lines_seen: # not a duplicate
outfile.write(line)
lines_seen.add(line)
outfile.close()
| true |
980bfe0b0452034497b2c2e936e252493e3abe5a | YG-07/PyTkVideo | /1-tkinter部件详解/allTkinter08.py | UTF-8 | 758 | 3 | 3 | [] | no_license | #-*- coding:utf-8 -*-
import tkinter as tk
import tkinter.ttk as ttk
# 定义画笔事件函数
def paint(event):
x1,y1 = (event.x, event.y)
x2,y2 = (event.x, event.y)
canvas.create_rectangle(x1, y1, x2, y2)
root = tk.Tk(className='Tk的所有控件测试')
root.geometry('400x600+100+100')
# 20.Notebook记事本
frame_nb1,frame_nb2 = ttk.... | true |
32da901e5c258d3e9f7c3415b0aa439ed67d291b | duncwinn/sensu-client-boshrelease | /src/sensu_client/testSensuOutputBuilder.py | UTF-8 | 2,618 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | import json
import unittest
from SensuOutputBuilder import SensuOutputBuilder
class TestSequenceFunctions(unittest.TestCase):
"""
Test the SensuOutputBuilder
"""
def setUp(self):
self.sensu_healthy_job_output = {'status' : 'running'}
self.sensu_healthy_json_output='{"status": 0, "nam... | true |
80866c745d7a70e9e0601393428bd61b7f2a965a | gabriellaec/desoft-analise-exercicios | /backup/user_005/ch22_2020_03_11_17_48_05_497365.py | UTF-8 | 96 | 2.9375 | 3 | [] | no_license | cigarros = int(input('cigarros'))
anos = int(input('anos'))
print (cigarros*anos*10*365/(60*24)) | true |
d378f23778365fb083f0240f1a8ec35b3e232a4f | AlinGeorgescu/Problem-Solving | /Python/832_flipping_an_image.py | UTF-8 | 438 | 3.28125 | 3 | [] | no_license | #!/usr/bin/env python3
import ast
def main() -> None:
image = ast.literal_eval(input("Enter indices: "))
img_size = len(image)
for row in image:
for i in range(img_size // 2):
tmp = row[img_size - i - 1]
row[img_size - i - 1] = row[i] ^ 1
row[i] = tmp ^ 1
... | true |
d7ed7d1a10ff070c0ddbe01e5a26c2c64eaf4179 | Logicless-Coder/Project-Euler-Solutions | /Problems 21-30/Problem 25.py | UTF-8 | 180 | 3.484375 | 3 | [] | no_license | def findNumberOfDigits(n):
return len(str(n))
a = 0
b = 1
c = a + b
index = 2
while findNumberOfDigits(c) < 1000:
a, b = b, c
c = a + b
index += 1
print(index)
| true |
a097fc634eae7ec1ba20e93550900ef23d2c39fc | AlexanderSilvaB/cmake-tools | /cmake-create | UTF-8 | 11,191 | 2.59375 | 3 | [
"MIT"
] | permissive | #! /usr/bin/python
import json
import os
import argparse
import subprocess
import sys
_vmajor = 0
_vminor = 1
print('CMake Project Creator v%d.%d' % (_vmajor, _vminor))
def is_python3():
return sys.version_info > (3, 0)
if is_python3():
raw_input = input
def isCmakeToolsProject():
if(os.path.exists('... | true |
4622cde5d034acadd9f443ab9daa4965ecd4d6a8 | volume-em/bootstrap2.5d | /vol2images.py | UTF-8 | 5,192 | 2.84375 | 3 | [
"BSD-3-Clause"
] | permissive | import os
import argparse
import numpy as np
import SimpleITK as sitk
from glob import glob
def parse_args():
#setup the argument parser
parser = argparse.ArgumentParser(description='Creates images from orthogonal 2d cross sections of image and mask volumes in imdir and mskdir.')
parser.add_argument('imdir... | true |
6653c55700103306a9ccd31523de0cb5301968a4 | WeatherGod/ScanRadSim | /lib/ScanRadSim/NDIter.py | UTF-8 | 10,778 | 3.265625 | 3 | [] | no_license | from itertools import cycle
import numpy as np
class BaseNDIter(object) :
def __init__(self, chunkIters, chunkCnts, cycleList=None, doCycle=False,
posOffsets=None) :
if cycleList is None :
cycleList = range(len(chunkIters))
if posOffsets is None :
po... | true |
239f41301fbea06f420385bec372885ef060555a | rcornacchia/tutoring | /charlie/blackjack.py | UTF-8 | 2,120 | 4.03125 | 4 | [] | no_license | import random
# print name + " is a programmer"
print "\n\nThis is the deck of cards:\n"
# Create an empty list of cards
deck = [2, 2, 2, 2,
3, 3, 3, 3,
4, 4, 4, 4,
5, 5, 5, 5,
6, 6, 6, 6,
7, 7, 7, 7,
8, 8, 8, 8,
9, 9, 9, 9,
10, 10, 10, 10]
print deck
p... | true |
a770e8dd2e31b83d43b106b98b01c687aaf99477 | atanx/web_crawler | /BaiduSpider/process_csv.py | UTF-8 | 1,525 | 3.03125 | 3 | [] | no_license | # !/usr/bin/env python
# coding=utf-8
from operator import itemgetter
from itertools import groupby
class DupRemover():
def __init__(self, csv_file, has_headers=True):
self.csv_file = csv_file
self.data = None
self.result = None
self.has_headers = has_headers
def read_csv(self):
f = open(self.csv_file)
... | true |
9053b77183b94db8aa8b0e4a1c1824ae621f42fa | taanh99ams/taanh-fundamental-c4e15 | /SS02/SS2_Homework/ex2.py | UTF-8 | 140 | 4.03125 | 4 | [] | no_license | x = int(input("Enter a number "))
product = 1
for i in range(1, x + 1):
product *= i
print(i)
print("Factorial of x =", product)
| true |
f68fd70f5abd9b7fe49f600f0d6f716ffac8c37e | joydas65/GeeksforGeeks | /Sorting_Elements_of_an_Array_by_Frequency.py | UTF-8 | 492 | 3.140625 | 3 | [] | no_license | def sortByFreq(a,n):
#code here
d = dict()
for i in a:
if i in d:
d[i] += 1
else:
d[i] = 1
arr = []
for i in d:
arr.append((i,d[i]))
arr = sorted(arr, key = lambd... | true |
44df843004da6b3d201be0592143acf7051db554 | isgandarisgandarov/ezzBuy | /ezzBuy/BusinessLayer/aliexpress_scraper.py | UTF-8 | 1,650 | 2.609375 | 3 | [] | no_license | import requests, json
from ezzBuy.BusinessLayer.scraper import Scraper
from ezzBuy.BusinessLayer.config_parser import config
class AliexpressScraper(Scraper):
@staticmethod
def scrape_item(item):
title = item['product_title']
price = item['app_sale_price']
link = item['product_detail_u... | true |
cdfeb77f1fe07eeeacd0b708f15d1b9fc8185620 | lbt/boss-standard-workflow | /participants/get_userdata.py | UTF-8 | 2,622 | 2.96875 | 3 | [] | no_license | #!/usr/bin/python
""" Participant to get a person's userdata from an OBS instance.
The user data is placed into a specified field.
example::
get_userdata :user => "lbt", :field => "role.author"
Will result in the two fields ${role.author.email} and
${role.author.realname} being populated.
... | true |
512a839a048e45de77daa7d4b0abe43d6aea7e6a | SanjirSalsabil/ML-Practice-Project_Hear-Failure-Prediction | /test_pipeline.py | UTF-8 | 2,974 | 2.984375 | 3 | [] | no_license |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
test_data= pd.read_csv("heart_test.csv")
print(test_data.head())
print("===============describe================")
print(test_data.describe())
print("================info===================")
print(test_data.info())
# null... | true |
2b32b3dae3f202276c013defc2ac5cda7d79437e | purum01/django3.2 | /Chapter03/blog/views.py | UTF-8 | 875 | 2.703125 | 3 | [] | no_license | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404
from .models import Post
def test1(request):
return HttpResponse("blog/test1 응답!")
def test2(request, no):
print("no 타입 :", type(no))
return HttpResponse(f"no : {no}")
def test3(request, year, month, day)... | true |
8c19e67afd4661a744457a75643f580439065f7e | Mary91gr/big-data- | /q1_rdd.py | UTF-8 | 3,250 | 2.90625 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
from pyspark.sql import SparkSession
from datetime import datetime
from pyspark.sql.types import DateType
import time
t1 = time.time()
spark = SparkSession.builder.appName("Q1").getOrCreate()
sc = spark.sparkContext
path_trip = "hdfs://master:9000/yellow_tripdata_... | true |
c47bf67c7b8cad2d9b613104e983c5d9fed46732 | Sadoski/Help-Desk | /view/main.py | UTF-8 | 5,152 | 2.90625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Modulo do controle de ações e visualizações da corpo principal do sistema
"""
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from form.form_main import FormMain
from functions.functions import clear_layout, resource_path
from view.content_profile imp... | true |
2966fe03aeb6b5194ba3bbaffc5ae9f3d8311a04 | KFranciszek/pylove-training | /1.0/list_reduce.py | UTF-8 | 427 | 3.515625 | 4 | [] | no_license | a = [[[[[[[[[['a'], 'b']]], 'c']]], 'd']], 'e']
b= [[[['s','t'],[['u']], 'v']],['w','x'],[[['y']],'z']]
def flatten(lista):
flattened = []
for element in lista:
if type(element) == list:
flattened.extend(flatten(element))
else:
flattened.append(element)
return flatte... | true |
120e176df06576e2692a8cacaa419e50cbc679b2 | alfredodeza/pecan-admin | /pecan_admin/models/users.py | UTF-8 | 2,551 | 2.9375 | 3 | [] | no_license | import os
from hashlib import sha1
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, String, Unicode
from sqlalchemy.orm import synonym
from sqlalchemy.orm.exc import DetachedInstanceError
from pecan_admin.models import Base
class AdminUser(Base):
__tablename__ = 'admin_users'
i... | true |
48a207db3ee4e2d3dcd34b3db071b91e1df1a856 | xcsp3team/pycsp3 | /problems/cop/single/Witch.py | UTF-8 | 357 | 3.390625 | 3 | [
"MIT"
] | permissive | """
A toy problem from my course about CP.
Execution:
python3 Witch.py
"""
from pycsp3 import *
# x is the number of magic potions for love
x = Var(range(400))
# y is the number of magic potions for youth
y = Var(range(400))
satisfy(
[x, y] * [3, 2] <= 800,
[x, y] * [1, 3] <= 700,
[x, y] * [1, 2] <= ... | true |
f748a44097a869371f5d02121c5bb7f6a6827e9b | kamleshbiloniya/demo | /cpsir/part5.py | UTF-8 | 78 | 3.40625 | 3 | [] | no_license | ans=0
for r in range(1,244):
ans += 1/(r**(4/5))
print(r)
print("ans =",ans) | true |
aa65297fd3bb305467ee404e433ee1057924208a | baileymichele/linear-algebra | /svd_image_compression.py | UTF-8 | 5,426 | 3.265625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# svd_image_compression.py
"""SVD and Image Compression.
Bailey Smith
15 November 2016
"""
import numpy as np
from scipy import linalg as la
from matplotlib import pyplot as plt
def truncated_svd(A,k=None):
"""Computes the truncated SVD of A. If r is None or equals the number
of no... | true |
22f2ecf7732245d277d331fe0844f300083578f2 | TetianaHrunyk/DailyCodingProblems | /challenge132.py | UTF-8 | 1,594 | 4.03125 | 4 | [] | no_license | """Design and implement a HitCounter class that keeps track of requests (or hits).
It should support the following operations:
record(timestamp): records a hit that happened at timestamp
total(): returns the total number of hits recorded
range(lower, upper): returns the number of hits that occurred between... | true |
628e2ae101a7344f3647f8df2963eb0c59e15a8b | jpieschacon/2020_ORTA_AntennaLocation | /mainIterRatio.py | UTF-8 | 1,950 | 2.515625 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import logging
import numpy as np
from simulator.instance import Instance
from solver.antennaLocation import AntennaLocation
from tqdm import tqdm
if __name__ == '__main__':
# Parameters
time_limit = 2 * 60 * 60 # maximum execution time in seconds
out... | true |
3961eafde7de5e8b89aee271c864280a7313c24c | Gummy27/Forritunarkeppnir | /2020/nullOgTveir.py | UTF-8 | 688 | 3.484375 | 3 | [] | no_license | def binaryToDecimal(binary):
decimal = 0
for index, value in enumerate(binary[::-1]):
if(int(value)):
decimal += 2**index
return int(decimal+1)
def binaryDecrement(binary):
binary = int(''.join(binary)) // 2
print(binary)
print(int(binary, 2))
# return str(bin... | true |
5562e9981d22d8dfe91d379621fcc7abd15e3b74 | NguyenDytrich/BiblioTech | /management/tests/test_checkout_manager.py | UTF-8 | 3,525 | 2.671875 | 3 | [] | no_license | from datetime import timedelta
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.test import TestCase
from library.models import Checkout, Item
import library.checkout_manager as manager
class CheckoutManager_Returns_TestCase(... | true |
9eee21d0ea5a529731670f25ec5832449dbaf756 | aaron-alphonsus/rename-utility | /touch.py | UTF-8 | 235 | 3.09375 | 3 | [] | no_license | import os
def Touch (names, ctlFunc = lambda s, d: True):
""" Takes in list of files.
Changes timestamp of each file to current date/time. """
for n in names:
if ctlFunc(n, "*TOUCH*"):
os.utime(n)
| true |
f1984849b7b687e1cf9afda93cc2f169f65c7d49 | tikz/icb-flash-0 | /fun.py | UTF-8 | 2,114 | 3.53125 | 4 | [] | no_license | from main import generarMazo, jugar, jugarMiedo, jugarBorracho
from opcionales import jugarSmart, jugarSmartSugerido
def quienGano(lista):
# quienGano recibe una lista con las sumas de cada jugador y devuelve el index del jugador que ganó.
# Si no ganó nadie, devuelve None.
# Si hay empate entre dos o más... | true |
54321021a6180a4ded97b3ff08f29ce821bbd76f | neriyarden/crescendo-server-flask | /mongodb/models/tags.py | UTF-8 | 605 | 2.5625 | 3 | [] | no_license | import mongoengine as me
import json
class Tag(me.Document):
name = me.StringField(max_length=20, required=True, unique=True)
@classmethod
def create_tag(cls, name):
""""""
tag = cls()
tag.name = name
tag.save()
return tag
@classmethod
def get_tags(cls):
... | true |
84eacc7c3a037e3ba49b9117d714e1d5ffd9fe31 | CaMeLCa5e/BokehTest | /bokehTestPlot.py | UTF-8 | 807 | 3.46875 | 3 | [] | no_license | # from bokeh.plotting import figure, output_file, show
# #prepare some data
# x = [1,2,3,4,5]
# y = [6,5,2,7,8]
# #output to static HTML file
#
output_file("lines.html", title="line plot example")
# #plot a 'line' renderer setting the color, line thickness, title, and legend value
# p = figure(title="simple l... | true |
263115b3e0b50788f5f00927ccd457a1514451a0 | Estinox/coding-practices | /hacker_rank/mapAndLambdaFunction.py | UTF-8 | 223 | 3.265625 | 3 | [] | no_license |
def fib(n):
l = []
if (n > 0):
l = [0]
if (n > 1):
l = [0, 1]
for i in range(2, n):
l.append(l[i-1] + l[i-2])
return l
print(list(map(lambda a : a**3, fib(int(input())))))
| true |
2e793ccc4b84a69eaccc52c132b678a66eee4bed | bluehackrafestefano/clarusway_assignments | /teamwork_CT&python.py | UTF-8 | 664 | 4.09375 | 4 | [] | no_license | list=[1,2,3,4,5,6,7,8,9,0]
# print(len(list))
s = int(input("Please write starting index: "))
while
if s < 0 or s > (len(list)-1):
print("Out of range!")
else:
print(list[s])
e = int(input("Please write ending index: "))
if e < 1 or e > len(list):
print("Out of range!")
else:
print(list[e])
... | true |