blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
2
333
src_encoding
stringclasses
30 values
length_bytes
int64
18
5.47M
score
float64
2.52
5.81
int_score
int64
3
5
detected_licenses
listlengths
0
67
license_type
stringclasses
2 values
text
stringlengths
12
5.47M
download_success
bool
1 class
3af4f5e8d3919f6dbd4cf6b245f151d9ae0f1082
Python
orange-eng/Genetic-Algorithm
/GA_find_toppoint.py
UTF-8
4,760
3.71875
4
[]
no_license
import numpy as np import matplotlib.pyplot as plt DNA_SIZE = 10 # DNA length DNA长度 POP_SIZE = 100 # population size 多少个人 CROSS_RATE = 0.8 # mating probability (DNA crossover) 有80%可以交叉配对 MUTATION_RATE = 0.003 # mutation probability 有3%的概率发生0和1交换 N_GENERATIONS = 2...
true
69b5065f30a11d4ec479a2e460248b78bc976b01
Python
NLPDev/ConnectDBpython
/mysql.py
UTF-8
3,215
2.828125
3
[]
no_license
import pandas import pymysql from openpyxl import Workbook #Create Excel wb=Workbook() ws=wb.active shw = wb.active shw.title = 'Sheet' # Create a connection object databaseServerIP = "127.0.0.1" # IP address of the MySQL database server databaseUserName = "root" # User name of the database server databaseUserPass...
true
1c21df037a7a1640bef3ffba0009b2cf78c4421b
Python
ansushina/sem1-2
/python/ряд1.py
UTF-8
3,262
3.75
4
[]
no_license
# Программа для вычисления суммы элементов заданного ряда с точностью eps, # для построения таблицы с заданным шагом. Если за N итераций ряд не сходится, # программа выводит информацию об этом. # Сушина АД ИУ7-11б # x - переменная # eps - точность # nmax - максимальное количество итераций # step - шаг # t - ...
true
ab1dae2bb4e76217a46ac87fc030752097f93525
Python
WilliamStephenHuang/MyCode
/BuilderPattern.py
UTF-8
767
3.890625
4
[]
no_license
from abc import abstractmethod class Builder(): name = "" def __init__(self, name): self.name = name def setName(self, name): self.name = name def getName(self): return self.name @abstractmethod def Hello(self): pass class Thin(Builder): def Hello(self...
true
eb8755165766b73fe86233181681d9ef9d818f8e
Python
joohyun333/programmers
/LV1/12903.py
UTF-8
292
3.59375
4
[]
no_license
# https://programmers.co.kr/learn/courses/30/lessons/12903 def solution(s): if len(s) % 2 == 0: return s[(len(s)//2)-1:(len(s)//2)+1] # 이건 주석 달것도 없다 ㅇㅈ? else: return s[(len(s)//2)] if __name__ == "__main__": s = "abcd" print(solution(s))
true
59f39e31b00ba5284a25bce5ba086b2b2b1eafcf
Python
theWingThing/codejam
/2016/1B/aDigits.py
UTF-8
1,629
3.171875
3
[]
no_license
def main(): for t in xrange(int(raw_input())): numbers = [0] * 10 text = list(raw_input()) while 'Z' in text: numbers[0] += 1 text.remove('Z') text.remove('E') text.remove('R') text.remove('O') while 'W' in text: numbers[2] += 1 text.remove('T') text.rem...
true
8ba9766116fbb60cce6185d6e820e81830237d80
Python
GSULegalAnalyticsLab/Docket-Sheet-Classification
/Document Classification - Type Doc/Module_Part_I_Legal_Doc_Classification.py
UTF-8
9,691
3.671875
4
[]
no_license
import nltk import os import re import sys import pandas as pd def helloworld(): print('Hello World. Today is a good day to code.') '''Note: These are the cleaning modules that were created to clean the text of obvious errors or words that will likely not be material to our ultimate analysis. ...
true
9798613338f000977a4a1a74b6b006eab4d42f80
Python
ColinFendrick/tensorflow-2
/ArtNNs/basic.py
UTF-8
1,303
2.96875
3
[]
no_license
import numpy as py import datetime import tensorflow as tf from tensorflow.keras.datasets import fashion_mnist (X_train, y_train), (X_test, y_test) = fashion_mnist.load_data() X_train = X_train / 255.0 X_test = X_test / 255.0 # Since each image is 28x28, we simply use reshape the full dataset to [-1 (all elements), h...
true
44dcee906da2ad47394c011b3117eedc64417ed2
Python
huggins9000211/AirBnB_clone
/tests/test_models/test_base_model.py
UTF-8
2,721
3.0625
3
[]
no_license
#!/usr/bin/python3 """Unit tests for BaseModel""" import unittest from models.base_model import BaseModel import uuid from datetime import datetime as dt import os import json class TestBaseModel(unittest.TestCase): """Tests for basemodel class""" @classmethod def setUp(cls): """Sets up testing m...
true
abcde627bdae266a9f56b7f2034a7a6cfe9cba7d
Python
imsurinder90/metaclasses_and_patterns_in_python
/metaclasses/avoid_init_using_metaclass.py
UTF-8
914
3.65625
4
[ "MIT" ]
permissive
""" With the help of metaclass we can make our class look simple. Metaclass creates a class object and assigns _fields to it. """ from inspect import Parameter, Signature def make_signature(args): return Signature( Parameter(name, Parameter.POSITIONAL_OR_KEYWORD) for name in args) class AnimalMeta(type): def...
true
5c5dc67f3fbb0ab6f61227440024f1fe3468ab02
Python
RoSapia/Python-curso-em-video
/curso-python/cursoemvideo/aula07oparitmetico.py
UTF-8
492
4.34375
4
[ "MIT" ]
permissive
n1 = int(input('Digite um número: ')) n2 = int(input('Digite outro número menor que o primeiro: ')) print('Com esses 2 numeros soma é: ', n1 + n2) print('Com esses 2 numeros subtração é: ', n1 - n2) print('Com esses 2 numeros a divisao é: ', n1 / n2) print('Com esses 2 numeros multiplicação é: ', n1 * n2) print('Um nº ...
true
a49428698df2a1fbf37dd556f3a5e063f153174e
Python
FahimSifnatul/online_problem_solving_with_FahimSifnatul_python_version
/cf 626 div 2 C.py
UTF-8
588
2.8125
3
[]
no_license
from sys import stdin, stdout class Solve: def __init__(self): r = stdin.readline w = stdout.write n = int(input()) s = r() if n%2: w('-1') return t = 0 OL, CL, OR, CR = [0 for i in range(n)], [0 for i in range(n)], [0 for i in range(n)], [0 for i in range(n)] ...
true
88b86ffc10377a7886829e0d7d3b0d385ee46205
Python
Dang-h/Python_primer
/python_foundation/Super_use.py
UTF-8
594
3.515625
4
[]
no_license
#!/usr/bin/env python3 #-*- coding=utf-8 -*- """ #Author: Dang_h #Creat Time:2019年02月28日 星期四 16时18分48秒 #File Name:Super_use.py #Description: """ class Animal(object): def __init__(self, name): self.name = name class Dog(Animal): def __init__(self, name, age): #super().__init__(name) #...
true
78e324135489ed1c3d7eb28d73b1cd29006178b6
Python
Fawe0000/Algoritms_for_Python
/lesson_2/les_2_task_2.py
UTF-8
694
4.34375
4
[]
no_license
#2. Посчитать четные и нечетные цифры введенного натурального числа. # Например, если введено число 34560, в нем 3 четные цифры (4, 6 и 0) и 2 нечетные (3 и 5). i = int(input("Введите натуральное число: ")) in_n = i sum_chet = 0 sum_nchet = 0 while in_n > 0: zn_i = in_n % 10 in_n //= 10 if zn_i%2 == 0: ...
true
aeb1f1377b6791c8e831f6d1d5ab154006ce092e
Python
somork/plrna
/plrna1.0/scripts/complexity_numbers.py
UTF-8
391
2.703125
3
[]
no_license
import sys import math lst_in=sys.stdin.read() mode=sys.argv[1] #print lst_in lst=lst_in.split('User time (seconds): ')[1:] list=[] for e in lst: x=e.split('Average resident set size (kbytes): 0')[0].split('\n') z=x[0] y=x[-2].split('Maximum resident set size (kbytes): ')[1] if mo...
true
b7f54951c212f97b7beb6e96992aca979aaa04f5
Python
Wiki-fan/concepts
/task1 assembler/assembler.py
UTF-8
3,240
2.609375
3
[]
no_license
import struct from common import * import re class Assembler: def __init__(self): self.opers = [] # Предопределённые переменные self.label_tbl = {'IP': Reg.IP, 'SP': Reg.SP, 'BP': Reg.BP, 'CFL': Reg.CFL} self.num_registers_reserved = len(self.label_tbl) self.source = [] ...
true
9817c2bea5661a16fa8aea35512c24b83074de27
Python
Hclaire/Projet-ISN
/Version_antérieure_Jeu_numero_deux/ProjetV1_8_24_05_15.py
UTF-8
22,633
3.21875
3
[]
no_license
# -*- coding: utf-8 -*- """ Projet jeu 1 affichage chiffre """ import pygame import random # choix fond de couleur def choix_fond_de_couleur(fenetre, abscisse, ordonnee): # nombre aléatoire entre 1 et 4 inclus numero_fond = random.randint(1, 4) if numero_fond == 1: # Chargement et collage du ...
true
597fd36168dc9d6be8dd930c90428782c4f4ab24
Python
mwoss/bone-detector-app
/app.py
UTF-8
1,896
2.53125
3
[]
no_license
from os import path from zipfile import ZipFile, ZIP_DEFLATED from flask import Flask, render_template, redirect, flash, request, send_file from werkzeug.utils import secure_filename from bone_masker import BoneOpeningModel UPLOAD_FOLDER = "./uploads" ALLOWED_EXTENSIONS = {"png", "jpg", "jpeg"} app = Flask(__name__...
true
8031912d1f9e58fc9886f22bb7216066744484fb
Python
jmctsm/Python_03_Deep_Dive_Part_04_OOP
/Section_08_Descriptors/02 - Getters and Setters.py
UTF-8
3,644
3.359375
3
[]
no_license
def line_break(): x = 0 print("\n\n") while x < 20: print("*", end="") x += 1 print("\n\n") line_break() from datetime import datetime class TimeUTC: def __get__(self, instance, owner_class): print(f'__get__ called, self={self}, instance={instance}, owner_class={owner_clas...
true
ba21e08c7e4af5f9916fd98862873985431ac1d6
Python
BenjaminSchubert/NitPycker
/nitpycker/runner.py
UTF-8
9,911
2.546875
3
[ "MIT" ]
permissive
""" This modules implements a Parallel test runner for unittest """ from pickle import PicklingError import collections import multiprocessing import multiprocessing.managers import queue import sys import threading import time import unittest # noinspection PyProtectedMember from unittest.runner import _WritelnDecora...
true
4c6a336589353b2cd3715877697935c1d7673e66
Python
elven-fire/elvenfire
/elvenfire/utilities.py
UTF-8
522
2.984375
3
[]
no_license
def wrapped(text, length=76, indent=0): lines = text.split('\n') wrapped = [] while lines: line = lines.pop(0) while len(line) > length: i = line.rfind(' ', 0, length) if i < indent: wrapped.append(line[:length-1] + '-') line = ' ' *...
true
5f0d664f87376e789b3ddb1593f5f584a36b2a74
Python
atymx/vk_grabber_likes
/app2.py
UTF-8
2,578
2.734375
3
[]
no_license
# -*- coding: utf-8 -*- import vk_api import config import time import json import webbrowser import os if not os.path.exists('likes'): os.mkdir('likes') if not os.path.exists('posts'): os.mkdir('posts') # -- -- -- получение токена и авторизация -- -- -- print(u'Сейчас сейчас откроется браузер. Дайте приложе...
true
fafcf678d963f3ecc3ed491923f6afe02324b050
Python
abdussametakbas/Donguler
/break-continue.py
UTF-8
404
2.890625
3
[]
no_license
isim='Samet Akbaş' for harf in isim: if harf=='m': #continue o an geleni es geçip devam eder. continue print(harf) for harf in isim: if harf=='m': # m yi gördüğü an bırakır onu da yazmaz break print(harf) # soru = 1-100 arası çift sayıların toplamı? toplam=0 i=0 while i...
true
ff3b50f3fbc7365b2048d2c056d13965b7cff0b8
Python
CoderHuo/learn-python3
/studyLib/socket/threadTCPSocket.py
UTF-8
1,894
2.796875
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import threading import socket,time import socketserver from network_setting import * __author__ = 'Mr.Huo' class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass class ThreadedTCPRequsetHandler(socketserver.BaseRequestHandler): def...
true
a7f232c70f2d9638e3cf08d87c226df9d397a048
Python
nowa360/my_leetcode
/JulyChallenge/ArrangingCoins.py
UTF-8
797
4.03125
4
[]
no_license
# coding=utf-8 """ July 1st Challenge - Arranging Coins You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number of full staircase rows that can be formed. n is a non-negative integer and fits within the range of a 32-bit...
true
f1a0c1c58f7ef01b9a0f6f5e8432c9b21f88d99c
Python
Aasthaengg/IBMdataset
/Python_codes/p02757/s649469867.py
UTF-8
1,058
2.875
3
[]
no_license
# coding: utf-8 import sys import math import collections import itertools INF = 10 ** 13 MOD = 10 ** 9 + 7 def input() : return sys.stdin.readline().strip() def lcm(x, y) : return (x * y) // math.gcd(x, y) def I() : return int(input()) def LI() : return [int(x) for x in input().split()] def RI(N) : return [int(input(...
true
6aeae2589a92efda0a5e6a07aa8dd5542905aa3b
Python
amoazeni75/NST_BS_Project
/style_transfer_backend/StyleTransfer1.py
UTF-8
3,147
2.515625
3
[]
no_license
from __future__ import print_function, division # In this script, we will focus on generating an image # that attempts to match the content of one input image # and the style of another input image. # # We accomplish this by balancing the content loss # and style loss simultaneously. from style_transfer_backend import...
true
a3a49d0846e314f8ce8fb3e4acdcdca6a8b3cfe1
Python
quantile-taps/tap-linkedin
/tap_linkedin/tap.py
UTF-8
906
2.515625
3
[]
no_license
"""Linkedin tap class.""" from typing import List from singer_sdk import Tap, Stream from singer_sdk import typing as th # JSON schema typing helpers from tap_linkedin.streams import ( FollowersStream, PageStream, PostsStream ) STREAM_TYPES = [ FollowersStream, PageStream, PostsStream ] c...
true
811ed84cd9a16a2dbce74115de71b2cb90769a0f
Python
AnikaZN/cs-module-project-algorithms
/single_number/single_number.py
UTF-8
613
4.09375
4
[]
no_license
''' Input: a List of integers where every int except one shows up twice Returns: an integer ''' def single_number(arr): # Your code here first = [] second = [] for item in arr: if item not in first: first.append(item) else: second.append(item) for number in ...
true
c80462896a68b9a0ad40d5e6307c3e26f5c31992
Python
hunkim/DeepLearningZeroToAll
/chainer/chlab-01-1-basics.py
UTF-8
701
4.03125
4
[]
no_license
#!/usr/bin/env python # Lab 1-1 Basics import numpy as np import chainer # Create Variable object. a = chainer.Variable(np.array([1], dtype=np.float32)) b = chainer.Variable(np.array([2], dtype=np.float32)) # Variable object has basic arithmetic operators. y = a * b # Now y is a Variable object, with attribute "da...
true
9691129e3b1090e28cd1a3127be9865e4f1c8d99
Python
weiweiitcast/sz30_meiduo_mall
/jwt_token.py
UTF-8
1,685
3.15625
3
[]
no_license
import json,base64 import hmac,hashlib # 模拟jwt签发流程 # 头信息 header = { 'typ': 'JWT', 'alg': 'HS256' # 哈希运算(散列运算,不可逆) } header = json.dumps(header) # string header = base64.b64encode(header.encode()) print("header: ", header) # 载荷信息 payload = { "sub": "1234567890", "name": "John Doe", "admin": True, "age":...
true
4917af407597bf3cb13033853ec258f7bcc5d531
Python
savethebyte/hangman
/main.py
UTF-8
2,073
4.0625
4
[]
no_license
#!/usr/bin/python3 import itertools import random def main(): #define the work to be guessed lines = open('wordlist.txt').read().splitlines() secretWord = random.choice(lines).upper() #secretWord = "cheese" secretList = list(secretWord) blanks = list(itertools.repeat("_", len(secretWord))) ...
true
c16df96a36d6625f3d9ba2583158c2318771cf9a
Python
ArataKamikaze/EMGE_IC_PDTScraper
/Src/utils/functions.py
UTF-8
372
2.71875
3
[]
no_license
import os as os import Definitions as d def add_to_dataframe(path, date, name): for x in range(1, len(d.definitions(name))): for filename in os.listdir(path, date, ): if filename.endswith(+".csv") and filename.beginswith(date+d.definitions(name)[x]): print(os.path.join(path, fi...
true
4254ea42c2be99e0884cd961380320c17a8f45c7
Python
Cpzty/proy1-compis
/abtreelist.py
UTF-8
1,266
3.578125
4
[]
no_license
class Tree(): def __init__(self): self.nodes = [] self.count = 0 def add_entree(self, left, op, right): if len(self.nodes) == 0: if right == ' ': node = [left, op] elif right == ' ' and left == ' ': #node = [self.count, op] ...
true
2fd3ab78e3a1a71734c4d02c3e184fc849e4cfc4
Python
ShaniGetz/LogoGuide
/logo_guide_server/venv/Lib/site-packages/spruce/lang/_misc.py
UTF-8
1,357
3.5
4
[]
no_license
"""Python language extensions miscellany""" __copyright__ = "Copyright (C) 2014 Ivan D Vasin" __docformat__ = "restructuredtext" import re as _re def safe_name(name, default_str='_'): """Convert a name to a safe object name The object name is "safe" in the sense that it consists only of characters that...
true
2082c9f7e688b0d2edaa7036289fdf58993774a8
Python
dharunvs/Polyplethysmography
/main.py
UTF-8
1,355
3.25
3
[]
no_license
from tkinter import * from tkinter import filedialog # COLORS WHITE = '#FFFFFF' BLACK = '#000000' BLUE = '#0093FF' GREY_0 = '#D6D6D6' GREY_1 = '#C6C6C6' class App: def __init__(self): self.root = None self.width = 500 self.height = 500 self.file_path_element = None self.f...
true
8f23e79134121febdbd8fc33cc7456103a15897f
Python
roddar92/simple-calculator
/operations.py
UTF-8
3,547
3.34375
3
[]
no_license
import math as m class Operation(object): def __init__(self): self.unary = False def eval_unary(self, a): return 0 def eval_binary(self, a, b): return 0 class AdditionOperation(Operation): def __init__(self): super().__init__() def eval_binary(self, a, b): ...
true
c5707370c0b5f4b04f7627328579fe38f7ab0970
Python
Ashley-Soderlund/Python
/ConvertGUI.py
UTF-8
853
4
4
[]
no_license
# convert_gui.py # Author: Ashley Soderlund # Description: Program convert Celsius to Farenheit using a graphical interface from graphics import * def main(): win = GraphWin("Celsius Converter", 400, 300) win.setCoords(0.0,0.0,3.0,4.0) Text(Point(1,3)," Celsius Temperature: ").draw(win) Text(Point...
true
29e1f6d283f6b732b5fa5e7bf9bb4cc7dfbe9894
Python
crystal-mullins/fsw-210
/week4/hasing/hasing.py
UTF-8
337
3.203125
3
[]
no_license
int_val = 4 str_val = 'GeeksforGeeks' flt_val = 24.56 # Printing the hash values. # Notice Integer value doesn't change # You'l have answer later in article. print ("The integer hash value is : " + str(hash(int_val))) print ("The string hash value is : " + str(hash(str_val))) print ("The float hash value is : " + st...
true
7c5e7ad12a26a416a01208733223cc346b93e61a
Python
sethguy/rcluster
/rcluster.py
UTF-8
11,501
2.640625
3
[]
no_license
import os import json from time import sleep, gmtime, strftime from copy import deepcopy from inspect import getargspec from pprint import PrettyPrinter from boto3 import session import paramiko class RCluster: '''RCluster class object Designed to organize the information for a boto3 connection to EC2, ...
true
c131702902517802104c77a9f3f551224d76c82b
Python
KonstantinKlepikov/scikit-fda
/skfda/representation/basis.py
UTF-8
91,737
3.046875
3
[ "BSD-3-Clause" ]
permissive
"""Module for functional data manipulation in a basis system. Defines functional data object in a basis function system representation and the corresponding basis classes. """ from abc import ABC, abstractmethod import copy from numpy import polyder, polyint, polymul, polyval import pandas.api.extensions import scip...
true
246a082ee6c18d5104b1314713afc35fecd72829
Python
vladbegin/Calltouch_request_API
/main.py
UTF-8
4,134
2.71875
3
[]
no_license
print("Импортирую библиотеки") import os from datetime import datetime, timedelta import pandas as pd from pandas.io import gbq import gspread import pytz import requests from google.cloud import bigquery from oauth2client.service_account import ServiceAccountCredentials print("Импортировал библиотеки") print("Задаю ...
true
b4f3bd846053f0e243a7deac1a1417d9a4bb6853
Python
yanaefimova/python
/lesson_2.py
UTF-8
4,447
3.890625
4
[]
no_license
# Задача-1: # Дан список, заполненный произвольными целыми числами, получите новый список, # элементами которого будут квадратные корни элементов исходного списка, # но только если результаты извлечения корня не имеют десятичной части и # если такой корень вообще можно извлечь # Пример: Дано: [2, -5, 8, 9, -25, 25, 4] ...
true
c880bb5e9f80b93be97a5851ff2dde36a5b48941
Python
r50206v/Leetcode-Practice
/2022/*Easy-136-SingleNumber.py
UTF-8
870
3.703125
4
[]
no_license
''' hashtable time: O(N) space: O(N) ''' class Solution: def singleNumber(self, nums: List[int]) -> int: from collections import Counter count = Counter(nums) for k in count.keys(): if count[k] == 1: return k return ''' math 2*(a+b+c) - (a+a+b...
true
19041546f4cf0087dcfef2acf145044894786222
Python
gaokai15/Object_Rearrangement
/experiments/main_genInstances.py
UTF-8
13,408
2.515625
3
[]
no_license
from __future__ import division ### This file is used for generating instances ### save instances and optimal solutions from brute force methods import os import sys import IPython import shutil import math from Experiment_genInstances import Experiment_genInstances ###################################################...
true
16a2aed8322614471a64c1b658b3bfed8772943b
Python
JoseAvanzada2019/IIC2233-2018-1-SantiRepo
/Tareas/T05/eventos.py
UTF-8
2,355
2.8125
3
[]
no_license
# módulo destinado a escribir los eventos que serán entregados a las señales. class PositionMoveEvent: def __init__(self, x, y, release=False): self.x = x self.y = y self.release = release class SideMoveEvent: def __init__(self, side, id_=None): self.side = side self....
true
a185c323ac349144bbc8597031c691a6ef078047
Python
LibrariesHacked/mobiles-librarydata
/scripts/createroute.py
UTF-8
2,307
3.078125
3
[ "MIT" ]
permissive
import csv import collections import urllib.request import pandas as pd import geopandas import json import time from shapely.geometry import Point from shapely.geometry import LineString API_KEY = '' STOP_DATA = '../data/aberdeenshire.csv' OUTPUT_DATA = '../data/aberdeenshire_routes.geojson' def run(): """Runs ...
true
9a5b304c2be63d9f032f23a872b560ec3ad24b83
Python
GavWaite/helloDocker_tutorial
/app/controllers/users.py
UTF-8
2,966
3
3
[ "MIT" ]
permissive
''' controller and routes for users ''' import os from flask import request, jsonify # Remember that 'app' and 'mongo' are objects initialised in app/__init__.py # mongo object will let us query our database from app import app, mongo import logger # This file defines CRUD for the users database # REMINDER: CRUD stan...
true
1d03bd59068ed3f60a9d3b7df8152c9cd08270f7
Python
Zhiyue-Li/Leetcode
/42_trapping_rain_water.py
UTF-8
1,103
3.4375
3
[]
no_license
# Down to up def trap(self, height: list[int]) -> int: if len(height) <= 1: return 0 l = len(height) m = max(height) h = 0 res = 0 idx = [i for i in range(l) if height[i] > 0] if len(idx) == 1: return 0 while h < m: for i in range(1, len(idx)): res += ...
true
6210f52c9f0ce3cb0f9ac4e1a8be1f24667612e4
Python
rafaelribeiroo/scripts_py
/Mundo 01: Fundamentos/11. Condições I/3. Condição composta.py
UTF-8
234
4
4
[]
no_license
n1 = float(input('Digite a 1ª nota: ')) n2 = float(input('2ª: ')) média = (n1 + n2) / 2 print(f'A sua média foi {média:.1f}') # Condição composta encurtada print('Parabéns pela nota!' if média >= 6 else 'Estude mais!')
true
3510f98d397f002b8d51301e9336ee614bb73938
Python
emmas2210/Billiard
/Billiard/torus/figure_mayavi.py
UTF-8
595
2.828125
3
[]
no_license
from mayavi import mlab import numpy as np mlab.init_notebook('x3d',400,200,local=False) mlab.clf() theta=np.linspace(0, 2*np.pi,100) phi= np.linspace(0, 2*np.pi,100) X = np.outer((20+4*np.cos(phi)),np.cos(theta)) Y = np.outer((20+4*np.cos(phi)),np.sin(theta)) Z = np.outer(np.sin(phi), 1.8*np.ones(np.size(theta))) ...
true
4de8d9afb112ccf52e39175089d869676ca52338
Python
navanikris/home-price-prediction
/linear_reg.py
UTF-8
2,560
3.25
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import numpy as np from sklearn import linear_model import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') # In[2]: df = pd.read_csv("C:/Users/user/Desktop/data.csv") df2 = pd.read_csv("C:/Users/user/Desktop/Canada.c...
true
b60d6ef9f7f4a22daf94a219064c142cd876423f
Python
PingPingE/Algorithm
/백준/녹색 옷 입은 애가 젤다지?.py
UTF-8
2,956
3.109375
3
[]
no_license
''' 문제) 젤다의 전설 게임에서 화폐의 단위는 루피(rupee)다. 그런데 간혹 '도둑루피'라 불리는 검정색 루피도 존재하는데, 이걸 획득하면 오히려 소지한 루피가 감소하게 된다! 젤다의 전설 시리즈의 주인공, 링크는 지금 도둑루피만 가득한 N x N 크기의 동굴의 제일 왼쪽 위에 있다. [0][0]번 칸이기도 하다. 왜 이런 곳에 들어왔냐고 묻는다면 밖에서 사람들이 자꾸 "젤다의 전설에 나오는 녹색 애가 젤다지?"라고 물어봤기 때문이다. 링크가 녹색 옷을 입은 주인공이고 젤다는 그냥 잡혀있는 공주인데, 게임 타이틀에 젤다가 나와있다고 자꾸 사람들이 이렇게 착각...
true
5519e9cefe9c27b3a0bbe668ea97dcff885822be
Python
nvw123/htmlEdit
/back/db_query.py
UTF-8
1,733
2.71875
3
[]
no_license
# -*- coding: utf-8 -*- # @Time    : 2019/11/6 16:30 # @Author  : JuanZi # @FileName: dbconfig.py # @Software: PyCharm from log import LzLog import pymysql class DB: def __init__(self, host='localhost', port=3006, db='', user='root', passwd='root', charset='utf8'): # 建立连接 self.conn = pymysql.conn...
true
d88988084794bd0955759f224a34fabc3f74b07b
Python
Xlsean/X-Temporal
/x_temporal/core/calculate_map.py
UTF-8
424
2.5625
3
[ "MIT" ]
permissive
import numpy as np from sklearn.metrics import average_precision_score def calculate_mAP(y_pred, y_true): y_pred = y_pred.detach().cpu().numpy() y_true = y_true.detach().cpu().numpy() values = [] for i in range(len(y_pred)): values.append( average_precision_score( y...
true
a72f45e10dac85d1dd45ef6e1ee524574899311f
Python
zmcgohan/Graph-Search-Pathfinding
/path.py
UTF-8
4,653
3.328125
3
[]
no_license
import time from collections import deque from path_node import PathNode class Path: def __init__(self, grid, init_pos, end_pos, method=0): methods = ["Graph Search", "Bidirectional Graph Search", "Iterative Deepening Search"] self.method = methods[method] start_time = time.clock() if method == 0: # breadth-...
true
efad734aaaa6abc8c496bbf4b93f694dade6e9e2
Python
Aasthaengg/IBMdataset
/Python_codes/p03072/s925784230.py
UTF-8
199
3.078125
3
[]
no_license
N = int(input()) H = list(map(int, input().split())) max_height = 0 count = 0 for i in range(N): if max_height <= H[i]: count += 1 max_height = max(max_height, H[i]) print(count)
true
95294a1f6dc60fd6ce16b18746122c600d9acc24
Python
mayura1996/Computer_Vision_and_Image_Processing_CO4204
/chapter5.py
UTF-8
373
2.6875
3
[]
no_license
import cv2 import numpy as np img = cv2.imread("Resources/cards.jpg") width,height = 250,350 pts1 = np.float32([[140,235],[274,212],[176,449],[321,419]]) pts2 = np.float32([[0,0],[width,0],[0,height],[width,height]]) matrix = cv2.getPerspectiveTransform(pts1,pts2) imgOutput = cv2.warpPerspective(img,matrix,(width,he...
true
f8d13f48a1dc6474cf4a88d1bba6dec34b59f045
Python
kewaltakhe/csa1
/base_conversion_related/setclear.py
UTF-8
1,550
3.609375
4
[]
no_license
from binary import dtb,btd def mask_generator(n): return 1<<n def main(): num=int(input("Enter a number in decimal <= 65535 :")) if num>65535: print("ERROR! Decimal number should be <= 65535.\n\n") return 0 print("The number in 16 bit binary form is:{0}\n".format(dtb(num))) print("\t\...
true
2ab55a3c47ae340005d6f4ffd695ccf2d585e2dd
Python
maximeROUL2/MR_PrevProdMT
/SerieTemporelles/SerieTemporelles.py
UTF-8
2,631
3.265625
3
[]
no_license
import matplotlib import pandas import statsmodels import statsmodels.api as sm matplotlib.use('TkAgg') import matplotlib.pyplot as plt """ Entree : dataframe = la dataframe globale à analyser NomColoneDate = le str de la colone lié à la date analyse = la colone à analyser par les graphiques des séri...
true
2e786ed32bbc3d9929031fc7a25567b8caf19d30
Python
mirfan899/MTTS
/sppas/sppas/src/audiodata/channel.py
UTF-8
9,176
2.9375
3
[ "GPL-3.0-only", "MIT", "GFDL-1.1-or-later", "GPL-3.0-or-later" ]
permissive
""" .. --------------------------------------------------------------------- ___ __ __ __ ___ / | \ | \ | \ / the automatic \__ |__/ |__/ |___| \__ annotation and \ | | | | \ analysis ___/...
true
e24cfa96d0483f6b43fab0c2b4321726143afe3a
Python
hankchen1728/SPML2020SPRING
/HW1/src/models/vgg.py
UTF-8
2,442
2.859375
3
[]
no_license
''' VGG11/13/16/19 in Pytorch. Ref: https://github.com/kuangliu/pytorch-cifar/blob/master/models/vgg.py ''' import torch import torch.nn as nn cfgs = { 'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M']...
true
ac76f8e8e7635eb8da7a1f41e9465096ab59bec2
Python
chamhoo/fiat
/data.py
UTF-8
6,036
2.609375
3
[ "MIT" ]
permissive
""" auther: leechh """ import os import tensorflow as tf from tqdm import trange from math import ceil from fiat.component.chunk import chunk from fiat.component.path import mkdir class TFR(object): def __init__(self, path, count, feature_dict, shards=10, compression=None, c_level=None, seed=18473): """ ...
true
9e4f342f0265c7db5dd21904eb57e744b22c0603
Python
LyunJ/pythonStudy
/16_fileIO/file_readline.py
UTF-8
409
3.625
4
[]
no_license
# utf-8저장된 파일 읽어오기 f = open('file5.txt','r',encoding='utf-8') line = f.readline() print(line) f.close() #여러줄 읽기 f = open('file5.txt','r',encoding='utf-8') while True: line = f.readline() if not line: break print(line,end='') f.close() #파일 전체 읽기 f = open('file5.txt','r',encoding='utf-8') line...
true
6dde3d78a81ffa257629a88ee3ed07790a625ced
Python
nnja/under_construction
/software/python/light.py
UTF-8
388
2.875
3
[]
no_license
import logging as log class Light: address = None light_level = 0 update = True def __init__(self, address): self.address = address def set_level(self, level): if level != self.light_level: self.update = True self.light_level = level def __repr__(self): ...
true
98771b371ca89a68de285199cd9ce46f962ad724
Python
eriac/eriac_repo
/programs/mediapipe_test.py
UTF-8
3,399
2.546875
3
[]
no_license
import cv2 import mediapipe as mp # landmarkの繋がり表示用 landmark_line_ids = [ (0, 1), (1, 5), (5, 9), (9, 13), (13, 17), (17, 0), # 掌 (1, 2), (2, 3), (3, 4), # 親指 (5, 6), (6, 7), (7, 8), # 人差し指 (9, 10), (10, 11), (11, 12), # 中指 (13, 14), (14, 15), (15, 16), # 薬指 (17, 18), (18...
true
b41a35a2f604e343081ae7ab0eb33df101b1a627
Python
Aasthaengg/IBMdataset
/Python_codes/p02266/s668673102.py
UTF-8
719
3.125
3
[]
no_license
x = input() S1 = [] S2 = [] current_position = 0 total_area = 0 for i in x: if i == '\\': S1.append(current_position) elif i == '/': try: start_position = S1.pop() distance = current_position - start_position total_area += distance S2.append([sta...
true
0f783cfb4adddb70d309d7d85d726d368885a0e0
Python
psicho/GeekBrainsPython
/HomeWork1/hw01_normal.py
UTF-8
1,809
4.3125
4
[]
no_license
# Задача-1: Дано произвольное целое число, вывести самую большую цифру этого числа. print('Задача-1:') p = input('Введите произвольное целое число: ') p = str(p) k = len(str(p)) i = 1 m = int(p[0]) while i <= k-1: if int(p[i]) > m: m = int(p[i]) i += 1 print(m) print() # Задача-2: Исходные значения двух...
true
cbae0b0062c8e85efe236c1d542bedd8099cad65
Python
xtudbxk/practice
/python/strings-all_neighboring_chars.py
UTF-8
1,005
3.96875
4
[]
no_license
# 输入一个字符串,输出该字符串中相邻字符的所有组合。 # 举个例子,如果输入abc,它的组合有a、b、c、ab、bc、abc。(注意:输出的组合需要去重) import bisect from functools import reduce def get_substrs(s): all_substrs = [] for substr_len in range(1,len(s)+1): all_substrs.append([]) for start_index in range(len(s)+1-substr_len): if len(all_subst...
true
bd02dea9af0404d835300a24e4e1363c70d8d835
Python
NgendoNgwiri/PYTHON-INTRO
/functions.py
UTF-8
367
4.09375
4
[]
no_license
#functions are routines import car def print_name(my_name): print("my name is" , my_name) def print_age(my_age): my_age =int(my_age) print("my age is",my_age) #calling the function print_name("Christine") print_age(24) def add_num(num_1,num_2): s_num = num_1 + num_2 return s_num ...
true
ac0fc0b3b677bc226f2ac1605a34c42e3cd0f15b
Python
qa-tools-famliy/http-mocker
/backend/utils/etcd_utils.py
UTF-8
1,075
2.53125
3
[ "Apache-2.0" ]
permissive
# -*- coding: UTF-8 -*- """ # www.missshi.cn """ import json import etcd from config import ETCD_ADDRESS, ETCD_PORT etcd_client = etcd.Client(host=ETCD_ADDRESS, port=int(ETCD_PORT)) def create_etcd_dir(): """ # 创建对应的ETCD目录 :return: """ pass # etcd_client.write("/mock_urls", "", dir=True) de...
true
5c9a6270fbb34951a45af17ca7e5bddc98505321
Python
limikis/Python
/9.py
UTF-8
240
3.453125
3
[]
no_license
def fun(x): digit=0 while (x>0): digit+= int(x%10) x=int(x/10) print (digit) return digit num=int(input()) while num>9: num=num*3+1 print (num) num=fun(num) print (num)
true
fd9a6be173618d6b90d63afbcaaef0bd33751dea
Python
kunalkumar37/allpython---Copy
/ordereddict1.py
UTF-8
235
2.953125
3
[]
no_license
from collections import OrderedDict d=OrderedDict() d[1]='e' d[2]='d' d[3]='u' d[4]='r' d[5]='e' d[6]='k' d[7]='a' print (d) d.copy() print(d) d.copy() print(d) d.copy() print(d) d.copy() print(d) print(d.keys()) d[1]='i' print(d)
true
2eac9fd86b81785c8a9cbf6e42cfc41afa795094
Python
suomela/mml
/peruskarttarasteri/set-palette
UTF-8
667
2.546875
3
[]
no_license
#!/usr/bin/python import Image import sys import palette C = 61 dummy, fin, fout = sys.argv im = Image.open(fin) p = im.getpalette() d = im.getdata() assert len(p) == 3*256 assert len(d) == 12000*12000 assert d[0] == d[2*C+2] assert d[2*C-1] == d[2*C] == d[2*C+1] seen = set() for i in range(C): v, v2 = d[2*i +...
true
898f0679c080fcafdd3ca7355614f664f9c54316
Python
bheuer/CategoryProject
/Rule/base.py
UTF-8
2,302
2.671875
3
[]
no_license
from Homomorphism import Homomorphism from Diagram import Diagram,Category,GenericCategory #abstract base class class RuleGenerator: RuleName = None category = GenericCategory generic = True def __init__(self): self.CD = Diagram(self.category) self.Extension = Diagram(self.category) ...
true
54f1a14fc79a4ff7d2e664ba0f98eb3bdba4474f
Python
liuluyang/homework
/homework-05-09/homework_07_import.py
UTF-8
444
3.109375
3
[]
no_license
from homework_07 import * def func_08(): """ 将上述函数放在一个模块中,再写一个源程序文件,并在该源程序中实现对模块中函数的调用 :return: """ print(func_01()) print(func_02(100, 80)) print(func_03()) print(func_04('hello', 'e')) print(func_05(100)) print(func_06(5)) print(func_07([1, 2, 3, 4, 5], 2)) if __name_...
true
6d8d863da9d3fc0ec949fc9a253e7d9ef2d75180
Python
Rerepower/MH8811-G1901927A
/05/05_H1.py
UTF-8
2,038
3.875
4
[]
no_license
# 05_H1 Serialization with types # import json library import json #--------------------------------------- # Define function to open file def my_openfile(fname): fhandle = open(fname) data = json.load(fhandle) fhandle.close() return data #---------------------------------------- # Define serializer fun...
true
bee380452f3de6cf3899f2b1405978808acb369c
Python
paul028/DSS-pytorch
/tools/crf_process.py
UTF-8
1,017
2.515625
3
[ "MIT" ]
permissive
# reference: https://github.com/Andrew-Qibin/dss_crf/blob/master/examples/dense_hsal.py import torch import numpy as np import pydensecrf.densecrf as dcrf def sigmoid(x): return 1 / (1 + np.exp(-x)) # parameter EPSILON = 1e-8 tau = 1.05 # img: PIL # anno: numpy def crf(img, anno, to_tensor=False): img = n...
true
ae0773f38534ae8492e422c43c34cf77a45c1bda
Python
mwojtulewicz/qwop-ai
/tests/start.py
UTF-8
305
2.578125
3
[]
no_license
# script to start the game import os def start(): GAME_PATH = '../game' # starting the game in detached mode on Windows command = f'START /B {GAME_PATH}/flash.exe {GAME_PATH}/athletics.swf' print('starting...') os.system(command) if __name__=='__main__': start()
true
692c736ba7e233a1bca2e20f41f95e6b7605334a
Python
escastroav/ComputationalAstrophysics_MercuryPerihelium
/Geodesics.py
UTF-8
3,053
2.6875
3
[]
no_license
import Metric as mt import Christoffel as ch import Calculus as cl import numpy as np #def f01(C, x0, x1, x2, t): # return x2[0] #def f11(C, x0, x1, x2, t): # return x2[1] #def f21(C, x0, x1, x2, t): # return x2[2] #def f31(C, x0, x1, x2, t): # return x2[3] def f2(C, x0, x1, x2, t): f = np.zeros(4) ...
true
0d9f11db43019c702e5373a599fc974a96ea1568
Python
gustavoddainezi/Exercicios-URI-Online-Judge
/Python/2483.py
UTF-8
79
2.84375
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- i = int(input()) print('Feliz nat' + (i * 'a') + 'l!')
true
403e477b65bf6a1a379aa15ed6f5ab44e9413ac7
Python
whitemike889/best2
/best.py
UTF-8
4,877
2.75
3
[]
no_license
#!/usr/bin/python2.5 import sys import os sys.path.insert(0, os.path.expanduser("~/Projects/albumidentify")) import sqlite3 import tag import time import lastfm class Best: def __init__(self): self.conn = sqlite3.connect("best.db") def best(self): artists = self.conn.cursor() artists.execute("select distinc...
true
6e437a7e423154d3b20d06f007e0e3f3d94062cb
Python
CristianWeiland/floodit-player-ai
/generate_json.py
UTF-8
1,661
2.90625
3
[]
no_license
#!/usr/bin/env python3 # Saida do programa deve ser: # Seed (int) # Njogadas # Jogada 1 # Jogada 2 # ... # Jogada n import sys, subprocess, json from pathlib import Path from random import randint if len(sys.argv) != 6: print('Usage: ' + sys.argv[0] + ' <nlinhas> <ncolunas> <ncores> <ntestes> <arquivo>') pri...
true
5b5df42598afa21101ac83b7831e390773892c05
Python
jeremiah-ang/merge-pdfs-automator
/merge-pdf.py
UTF-8
914
2.984375
3
[]
no_license
#!/usr/bin/env python from PyPDF2 import PdfFileMerger, PdfFileReader import os import argparse def valid_filenames (filenames): for filename in filenames: if not os.path.isfile(filename): print (filename) return False return True def valid_output (output): return True def merge_pdf (filenames, output):...
true
5b09a1f1c5a710a2e435e960cbacf6c5215fce77
Python
kbanshoya/web-intelligence-and-big-data
/mapreduce.py
UTF-8
1,196
2.671875
3
[]
no_license
#!/usr/bin/env python import glob, mincemeat, pickle text_files = glob.glob('hw3data/*') data = [] for file in text_files: for line in open(file).readlines(): data.append(line) def mapfn(k, v): from stopwords import allStopWords as stopwords stopwords = stopwords.keys() publication, author...
true
c54dfad0b0b306d22ca396242689bf52f4a10923
Python
zoskar/Binary_search
/Flip and Invert Matrix.py
UTF-8
219
2.828125
3
[]
no_license
class Solution: def solve(self, matrix): for i, line in enumerate(matrix): line = line[::-1] for j, el in enumerate(line): matrix[i][j] = 1 - el return matrix
true
e373d81c6b3e7ec639e631b5835950eed34ef881
Python
mutabot/magenta
/svc/handlers/user/linkedin.py
UTF-8
559
2.890625
3
[]
no_license
class UserData(object): @staticmethod def populate(raw): if not raw or not 'id' in raw: return None return {'id': raw['id'], 'name': raw['formattedName'], 'url': raw['publicProfileUrl'] if 'publicProfileUrl' in raw else u'', 'picture_u...
true
9a8b1b3736008767c6d2da183b686d7342056f7a
Python
benquick123/code-profiling
/code/batch-2/vse-naloge-brez-testov/DN12-M-147.py
UTF-8
1,453
3.09375
3
[]
no_license
import collections def preberi(imeDatoteke): krizisca = {} datoteka = open(imeDatoteke) for i, line in enumerate(datoteka, 1): krizisca[i] = [int(i) for i in line.split()] najmanjsi = min(krizisca[i]) temp = [] for j in range(len(krizisca[i])): if kri...
true
ddf589bde4016234c667bfd750ffb4eba5025e27
Python
ArifSanaullah/Python_codes
/214.Python Debugger.py
UTF-8
563
3.765625
4
[]
no_license
# 214.Python Debugger import pdb # according to wiipedia "debugging is the process of finding and fixing the error in your code" # why debugging # 1.) our programe is not working # 2.) our programe is working but not the way we want. # steps for debugging # 1.) set trace # 2.) execute code line by line ...
true
f3afd24ed391ac49278441b7f569382d9cb28dbb
Python
mrgioland/RobotSystems
/ultrasonicInterpreterClass.py
UTF-8
679
2.578125
3
[]
no_license
try: from ezblock import * from ezblock.__init__ import __reset_mcu__ __reset_mcu__() time.sleep(0.01) except ImportError: print("This computer does not appear to be a PiCar -X system(/opt/ezblock is not present). Shadowing hardware callswith substitute functions ") from sim_ezblock ...
true
f185c7860b8c184c076d6bb344c97114aaa28fcc
Python
lcqbit11/algorithms
/common/荷兰国旗问题.py
UTF-8
633
3.8125
4
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- def helan_flag(numbers): """ :param numbers: List[int] :return: List[int] """ left, right = 0, len(numbers)-1 i = 0 while i <= right: if numbers[i] < 1: numbers[left], numbers[i] = numbers[i], numbers[left] left +...
true
cea63ce69777e7fba8b23090bf453da8fd80772c
Python
wd5/mazdai
/mazdai_app/models.py
UTF-8
2,614
2.515625
3
[]
no_license
# coding=utf-8 from django.db import models class Position(models.Model): name = models.CharField(max_length=300, verbose_name='Имя') price = models.FloatField(verbose_name='Цена') description = models.TextField(blank=True, verbose_name='Описание') @property def quantities(self): result = ...
true
a37c49aa96d8b689de275ba5609895b51ee61f7f
Python
ChrisRRadford/CodingChallenges
/EXPCounter.py
UTF-8
883
3.796875
4
[]
no_license
# Given a dictionary of how many questions a person # has completed of each difficulty, return how many experience points they'll have. # Create a function that sums a indiividuals exp. # Input(s): Dictionary # return: Count (string+XP) ex. "450XP" def get_xp(d): XPsum = 0 multiplyer = 5 for points in d.values():...
true
ee154840662c8313945d24b6ffa6859fb414c1ba
Python
Damiangiza93/trainingtasks
/simplefunctions.py
UTF-8
2,941
4.125
4
[]
no_license
def factorial(number): # silnia factorial = number number = number - 1 while number > 0: factorial = factorial * number number = number -1 return factorial def string_rev(str1): # odwróć strin r_str1 = '' index = len(str1) while in...
true
b29ae9bbd7f7bcb6f801008963ee615b72c98e4a
Python
El-Dringo-Brannde/OSU-Classes
/CS-325-AnalysisOfAlgorimths/Assignments/Assignment1/Testing/inputgenerator.py
UTF-8
769
3.109375
3
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
import random import sys output_Holder = [] for i in range(int(sys.argv[1])): # run until CLI arg x_Value = random.randrange(0, 10000) # Generate 0-10000 y_Value = random.randrange(0, 10000) output_Holder.append([x_Value, y_Value]) x = 0 # Prune out any doubles that might have occured in the generation...
true
dcfddc63a193a8b69a4e5eb282b816a3abba7494
Python
ShoutingKid/Rotating-Cube
/RotatingCube.py
UTF-8
2,475
3.640625
4
[]
no_license
import turtle import sys from math import sin,cos class Cube: def __init__(self, side) -> None: self.win = turtle.Screen() self.win.setup(900, 600) self.win.tracer(0) self.turtle = turtle.Turtle() self.turtle.ht() self.turtle.color('black') ...
true
3e35852ffc793a0889f4f71311d5af294a525b7d
Python
Educorreia932/FEUP-FPRO
/PE/PE2/exactly.py
UTF-8
1,370
3.53125
4
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 23 16:20:22 2018 @author: exame """ def exactly(s): counter = 0 interrogation = 0 index = 0 result = () numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] numbers_list = [] for character in s: if c...
true
7eb921a8a589f2e661a85380c748c18777e361d5
Python
codpro880/espn-fantasy-baseball-utils
/test/unit_tests/test_player_list.py
UTF-8
1,231
2.625
3
[]
no_license
from unittest.mock import patch import response_data from scraper.player_list import get_player_list """ All text from real requests. Simply mocked here for speed, it's important unit tests run quickly. """ class MockResponse: text = response_data.player_list_request_response @patch('requests.get', autospec=Tr...
true
987d0960a826d02a6b7708541ebe339dbd64ac79
Python
buptdjd/MLLearning
/com/edu/bupt/machinelearningimpl/dr/PCA.py
UTF-8
1,527
3.390625
3
[]
no_license
import numpy as np from sklearn.decomposition import PCA class PCAModel: def __init__(self): pass ''' :param data raw data :param k get k principle components :return new data with dimensional reduction ''' def dimension_reduction(self, data, k): m, n = data.s...
true
abd59c431e58a0a6e22aae5f34044382bdf84a08
Python
madiazl/GLOFRIS
/func_aggregation.py
UTF-8
730
2.515625
3
[]
no_license
import numpy as np def func_aggregation (out_list,geogunit_list,geogunit_idnums): #agregation dependig on th condition of the agregation impact_list_index=np.where(out_list>0); # hacerlo como condicion revisar los tamanyos de los arreglos impact_list_index=np.array(impact_list_index); impact_li...
true