blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
1bc3dc0f345df16baf94a40c43b5e1843555e357 | Python | a01747686/TC2008-I21-Eq2 | /hamburguesas.py | UTF-8 | 1,394 | 2.96875 | 3 | [] | no_license | import threading
import time
#creacion de los semaforos
MG = threading.Semaphore(1)
MH = threading.Semaphore(1)
MP = threading.Semaphore(1)
DMG = threading.Semaphore()
DMH = threading.Semaphore()
DMP = threading.Semaphore()
OMG = threading.Semaphore(0)
OMH = threading.Semaphore(0)
OMP = threading.Semaphore(0)
def des... | true |
d0cbca3c7dc1d0c134b21dab20d923623d448012 | Python | MorisMa18/Arcade_Sapce_Invader | /Space_Invader.py | UTF-8 | 7,617 | 3.21875 | 3 | [] | no_license | import pygame
import random
import math
# Initialize Pygame
pygame.init()
# player class
class player:
image = pygame.image.load('player.png')
x_coord = 370
y_coord = 480
delta_x = 0
# enemy class
class enemy:
image = pygame.image.load('ufo.png')
x_coord = 0
y_... | true |
f39ab35ce9b8e5191aef0a39383912dbad549d80 | Python | pombredanne/genutility | /genutility/win/file.py | UTF-8 | 2,926 | 2.65625 | 3 | [
"ISC"
] | permissive | from __future__ import generator_stop
from ctypes import FormatError, GetLastError, WinError, byref, sizeof
from errno import EACCES
from cwinsdk.um.handleapi import INVALID_HANDLE_VALUE
from cwinsdk.um.winnt import FILE_SHARE_READ, FILE_SHARE_WRITE
from cwinsdk.windows import ERROR_SHARING_VIOLATION # structs; enum... | true |
f3b3e02f4fee7b239a2016dbbce8f245bcb6a45f | Python | dmdekf/algo | /Algorithem_my/05_01list2/4843_special_sort.py | UTF-8 | 464 | 2.765625 | 3 | [] | no_license | import sys
sys.stdin = open('input.txt')
T = int(input())
for tc in range(1, T+1):
N = int(input())
d = list(map(int, input().split()))
for i in range(N-1):
for j in range(i, N):
if d[i]>d[j]:
d[i] , d[j] = d[j] ,d[i]
result = []
for i in range(N//2):
re... | true |
eea007b2fb90200b44dee5ebd5b06ea310c1bd15 | Python | webdev2145/web-scraping | /main.py | UTF-8 | 492 | 3.046875 | 3 | [] | no_license | from bs4 import BeautifulSoup
import lxml
import requests
url = 'https://www.empireonline.com/movies/features/best-movies-2/'
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
movies = soup.find_all(name='h3', class_='title')
output = ''
my_movies = movies
# for movie in movies:
my_... | true |
544e4a80e8f3f2b61c9683a0d21c684f387d552e | Python | SmartTeleMax/iktomi | /tests/web/url_template.py | UTF-8 | 4,456 | 2.703125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
__all__ = ['UrlTemplateTests']
import unittest
from iktomi.web.url_templates import UrlTemplate, construct_re
from iktomi.web.url_converters import Converter
class UrlTemplateTests(unittest.TestCase):
def test_empty_match(self):
'UrlTemplate match method with empty template'
... | true |
26eee6fde2e9207dcecfaf99de295d2d7e4058b2 | Python | myf-algorithm/Leetcode | /PAT_B/1024.科学计数法.py | UTF-8 | 1,459 | 2.734375 | 3 | [] | no_license | a, b = input().split('E')
fu = a[0]
zheng, xiao = a[1:].split('.')
zhi_fu, zhi_shu = b[0], b[1:]
res = ""
if zhi_fu == '-':
if len(zheng) > int(zhi_shu):
zheng_lt = [i for i in zheng]
zheng_lt.insert(len(zheng) - int(zhi_shu), '.')
zheng = ''.join(zheng_lt)
if fu == '-':
... | true |
3a7c5fa60dfffe8aacc8aabf631a3ffbb6e96022 | Python | anastasiev/Arc2 | /services/matchesService.py | UTF-8 | 1,784 | 3.1875 | 3 | [] | no_license | from models.model import Match
from views.view import ConsoleView
class MatchesService(object):
"""
Class implements actions with matches
"""
def getMatchByCountry(self, matches, countryName):
"""
Find all matches in selected country
:param matches:
:param countryName... | true |
80418917954021802747bfb4793e83ffa93ddb7d | Python | Krisz-tina/MouseDynamics | /table_generation/measure_time.py | UTF-8 | 2,692 | 2.890625 | 3 | [] | no_license | import csv
from utils import settings
def main(file_name):
with open(file_name, 'r') as csv_file:
data_reader = csv.reader(csv_file, delimiter=',')
user_ids = ['7', '9', '12', '15', '16', '20', '21', '23', '29', '35']
row = next(data_reader)
row = next(data_reader)
data = []... | true |
e26adeef007d3f7c873484ebaee55341bde180f9 | Python | arman2766/Stackoverflow-Survey-2019 | /job_satisfaction.py | UTF-8 | 3,323 | 3 | 3 | [] | no_license | import csv
from collections import defaultdict, Counter
with open('developer_survey_2019/survey_results_public.csv') as f:
csv_reader = csv.DictReader(f)
total = 0
satisfaction_info = {}
sat_mapper= {
'Very dissatisfied' : 0,
'Slightly dissatisfied' : 0.25,
'Neither satisfied nor dissatisf... | true |
9330ae16039857ea32213ec0fa77691b8c65120b | Python | CurtisJohansen/time-series-exercises | /acquire.py | UTF-8 | 3,226 | 3.1875 | 3 | [] | no_license | #################### IMPORTS ####################
import pandas as pd
import numpy as np
import requests
import os
######################## ACQUIRE FUNCTIONS #################################
def get_items():
'''
returns dataframe of all items either through system cache or via an api
'''
if os.p... | true |
117085f3cea213a6349a50bd6f617d8191a4276e | Python | goddessofpom/ife | /practice/BinTree.py | UTF-8 | 811 | 3.46875 | 3 | [] | no_license | class BinTNode:
def __init__(self, dat, left=None, right=None):
self.data = dat
self.left = left
self.right = right
def count_BinTNodes(t):
if t is None:
return 0
else:
return 1 + count_BinTNodes(t.left) + count_BinTNodes(t.right)
def sum_BinTNodes(t):
if t is None:
return 0
else:
return t.data + s... | true |
5730e706415e336a99f953bc43478f4a9367a0cd | Python | bineeshpc/data_science | /tutorials/lstm/summarize.py | UTF-8 | 496 | 2.71875 | 3 | [] | no_license | from pandas import DataFrame
from pandas import read_csv
from matplotlib import pyplot
# load results into a dataframe
filenames = ['experiment_timesteps_1.csv', 'experiment_timesteps_2.csv',
'experiment_timesteps_3.csv', 'experiment_timesteps_4.csv', 'experiment_timesteps_5.csv']
results = DataFrame()
for... | true |
6cdb03626102efa1e76057d89cd19dce3bcbefda | Python | nirkog/AI-ML-Stuff | /Insertion Sort/main.py | UTF-8 | 639 | 3.921875 | 4 | [] | no_license | def Swap(items, i, j):
temp = items[i]
items[i] = items[j]
items[j] = temp
def InsertionSort(items):
sortedItems = []
i = 0
for item in items:
sortedItems.append(item)
j = len(sortedItems) - 2
itemIndex = i
while j >= 0:
if sortedItems[j] > item:
... | true |
4c9eb037c2027cda98e45aa44aa2c4426ba79ce9 | Python | Costadoat/Informatique | /TP/TP06 Algorithmes dichotomiques/TP06.py | UTF-8 | 1,620 | 3.40625 | 3 | [] | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 18 15:19:30 2021
@author: jg
"""
from math import atan,exp
import matplotlib.pyplot as plt
L=[1,7.6,8,10.1]
a=7
def recherche_naive(L,a):
i=0
while L[i]<a:
i=i+1
if L[i]==a:
return(i)
else:
return(False)
#print(recherch... | true |
4d9d7c2fdf11367ba45eff32d6134e6ceabbd064 | Python | zauberzeug/nicegui | /nicegui/elements/splitter.py | UTF-8 | 1,818 | 2.984375 | 3 | [
"MIT"
] | permissive | from typing import Any, Callable, Optional, Tuple
from .mixins.disableable_element import DisableableElement
from .mixins.value_element import ValueElement
class Splitter(ValueElement, DisableableElement):
def __init__(self, *,
horizontal: Optional[bool] = False,
reverse: Optio... | true |
46735b85ae9d85d92aafff1e09b0facc48b358ef | Python | Hassibayub/Apache-Spark | /fakeFrindsSpark.py | UTF-8 | 817 | 2.9375 | 3 | [] | no_license | from pyspark import SparkConf, SparkContext
from time import perf_counter
start = perf_counter()
conf = SparkConf().setMaster("local").setAppName("FakeFriends")
sc = SparkContext(conf= conf)
raw = sc.textFile(r"G:\Shared drives\Unlimited\Python Scripts\Apache Spark\fakefriends.csv")
datapair = raw.map(lambda x: ( i... | true |
ea7425df8a9e3ed3158c3810bda1cf58be89b8ac | Python | goodmorningdata/nps | /nps_viz_size.py | UTF-8 | 11,721 | 3.375 | 3 | [] | no_license | '''
This script creates a map of the United States with NPS sites marked
with a circle corresponding to the site's size. The command line
argument, "designation", set by the flag, "-d", allows the user to
specify the set of park sites to add to the map. If no parameter is
specified, all NPS site locations are added to ... | true |
97891da749a30918c00af86d0b7025a0bccd6016 | Python | hurtb777/pyBrainNetSim | /examples/Simulate_Sensor-Movers.py | UTF-8 | 1,773 | 2.5625 | 3 | [] | no_license | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import pyBrainNetSim.generators.network as rnd
import pyBrainNetSim.models.world as world
import pyBrainNetSim.drawing.viewers as vis
import pyBrainNetSim.simulation.evolution as evo
mpl.rcParams['figure.figsize'] = (15, 5... | true |
2fa58c8c867b98382dd21d2886b39ec55cc9fc13 | Python | AxelPuig/facerecognition | /utils_cv/__init__.py | UTF-8 | 865 | 2.828125 | 3 | [] | no_license | import cv2
import numpy as np
def load_and_display_image(filename):
img = cv2.imread(filename, cv2.IMREAD_COLOR)
cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
def process_image(filename):
img = cv2.imread(filename, cv2.IMREAD_COLOR)
print(img.shape)
longueur, largeur, _... | true |
34173df587d389e2bdd3c41be785ff6568493bbf | Python | cosmos-sajal/ds_algo | /strings/anagram.py | UTF-8 | 497 | 3.890625 | 4 | [
"MIT"
] | permissive | # https://leetcode.com/problems/valid-anagram/
def get_initialised_freq_list():
return [0] * 26
def populate_freq_list(str):
freq_list = get_initialised_freq_list()
for i in range(len(str)):
freq_list[ord(str[i]) - ord('a')] += 1
return freq_list
def is_anagram(str1, str2):
freq_list... | true |
a8aedb9f2b5463d43fd9ed49c4f142cdae4d2c7e | Python | lovetyagi-17/Hacktoberfest_2021-1 | /rock_paper_scissor.py | UTF-8 | 2,660 | 4.125 | 4 | [] | no_license | """
Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino.
Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determine to which one of them the package has been sent.
A photographic rifle is o... | true |
d80a1746932c739aaf97a8c8b1141e226dfec04d | Python | jngmk/Training | /Python/BAEKJOON/14503 로봇청소기/14503.py | UTF-8 | 824 | 2.546875 | 3 | [] | no_license | def cleaning():
global cleaned_space, d
a, b = X, Y
arr[a][b] = 2
while True:
flag = False
for di in range(3, -1, -1):
vd = (d+di) % 4
va, vb = a+da[vd], b+db[vd]
if not arr[va][vb]:
arr[va][vb] = 2
a, b = va, vb
... | true |
ca1fa0a55101b3a6524d6fc6ea3da86c2a96ed2a | Python | Aasthaengg/IBMdataset | /Python_codes/p02757/s740152883.py | UTF-8 | 533 | 3.140625 | 3 | [] | no_license | #!/usr/bin/python3
import sys
from collections import Counter
input = lambda: sys.stdin.readline().strip()
n, p = [int(x) for x in input().split()]
s = input()
ans = 0
if p == 2 or p == 5:
allowed_digits = '24680' if p == 2 else '50'
for i, c in enumerate(s, start=1):
if c in allowed_digits:
... | true |
34a50dc9f0a26c3d1b4941587caba49c79f42185 | Python | TheTimmoth/wireui | /wireui/library/typedefs/tables.py | UTF-8 | 10,264 | 2.640625 | 3 | [
"MIT"
] | permissive | # tables.py
# Table for wireguard
# Author: Tim Schlottmann
from typing import Union
from .exceptions import PeerDoesNotExistError
from .result import MESSAGE_LEVEL
from .result import Message
from .result import MessageContent
from .result import Result
class Table():
""" n x m table """
def __init__(self,
... | true |
a3b9de1389f1f52afe0f5ceeb29878cb35d2d7c9 | Python | stemaan/pyr1-code | /day13/proerty.py | UTF-8 | 766 | 2.84375 | 3 | [] | no_license | class Human:
def __init__(self, name):
self.__name = name
@property
def name(self):
return self.__name
@name.setter
def name(self, value):
self.__name = value.lower()
class Jira:
def __init__(self, *args, **kwargs):
self.field123123123123 = 'something'
de... | true |
fe110281794c06ce60e40bcb8051d98e0eed37a4 | Python | BIAOXYZ/variousCodes | /_CodeTopics/LeetCode_contest/biweekly/biweekly2022/71-[大年初五]/71_2.py | UTF-8 | 615 | 2.953125 | 3 | [] | no_license | class Solution(object):
def pivotArray(self, nums, pivot):
"""
:type nums: List[int]
:type pivot: int
:rtype: List[int]
"""
small, equal, large = [], [], []
for num in nums:
if num < pivot:
small.append(num)
eli... | true |
9ff16482c5666b73f7da76d002e50d1659d0b8e7 | Python | venkatajagadeesh123/python_snippets | /strings.py | UTF-8 | 1,973 | 3.734375 | 4 | [] | no_license | # name = "Srini"
# age = 23
print ("Hello world")
print("My name is " + name + "my age " + str(age))
print("My name is %s and my age %d" % (name,age))
print("My name is {name} and my age {age}".format(age=age,name=name))
# this syntc work only python 3.6
print(f'My name is {name} my age next year {age+1}')
... | true |
3e5d028e5653e3626bef32018a9b9d38d4f5c264 | Python | Phaiax/sudoku | /cheatsheet.py | UTF-8 | 12,922 | 2.546875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive |
# LOAD AND DISPLAY
# ==============================================
# imread -> numpy ndarray
img = cv2.imread(filename, cv2.IMREAD_COLOR|IMREAD_GRAYSCALE|IMREAD_UNCHANGED) # UNCHANGED includes alpha
# show with matplotlib
from matplotlib import pyplot as plt
plt.imshow(img, cmap = 'gray', interpolation = 'bicubic')... | true |
0c80e3f5d468d2b479db63b58422a8bfd757d2ac | Python | stefanDeveloper/bomberman | /agent_code/nikolaj_boyle/callbacks.py | UTF-8 | 2,105 | 3.265625 | 3 | [
"MIT"
] | permissive | import os
import pickle
import random
import torch as T
from .model import DQN
import numpy as np
from .StateToFeat import state_to_features
ACTIONS = ['UP', 'RIGHT', 'DOWN', 'LEFT', 'WAIT', 'BOMB']
def setup(self):
"""
Setup your code. This is called once when loading each agent.
Make sure that you pre... | true |
f75071e7b11208cd3a45626e1254d68dc6179499 | Python | noval102200/NovalIDE | /noval/python/interpreter/pythonpathmixin.py | UTF-8 | 5,744 | 2.5625 | 3 | [
"MulanPSL-1.0"
] | permissive | # -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog,messagebox
from noval import NewId,_
import noval.util.fileutils as fileutils
import noval.util.apputils as sysutils
import noval.python.parser.utils as parserutils
import locale
import noval.imageutils as imageutils
imp... | true |
b7a5d614eea1a16eb1a164ee3c07ecbda71f7224 | Python | robee/velocity-boilerplate-public | /models.py | UTF-8 | 1,806 | 2.6875 | 3 | [
"MIT"
] | permissive | """DOCUMENTATION TODO"""
from settings import settings
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, DateTime, Boolean
engine = create_engine(settings['database_cred'], echo=False)
from sqlalchemy.ext.declarative import declarative_base
from utils.hasher import *
Base = declarati... | true |
d80dfd23c1bf39a7a1187323e3cf2bd024bf51d5 | Python | nischalshrestha/automatic_wat_discovery | /Notebooks/py/prabhatkumarsahu/titanic-data-survival-prediction/titanic-data-survival-prediction.py | UTF-8 | 7,946 | 3.3125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np
import matplotlib.... | true |
f5d2ff674d4008b56fbd4592a19b047c4bb82f5a | Python | CheolYongLee/jump_to_python | /Chapter_4/vartest_error.py | UTF-8 | 281 | 3.140625 | 3 | [] | no_license | # vartest_error.py
def vartest(a):
a = a + 1
vartest(3)
print(a)
# 함수 안에서 선언한 매개변수는 함수 안에서만 사용 될 뿐 함수 밖에서는 사용되지 않는다.
# 그렇기에 함수 밖의 a에 대한 값이 없으므로 에러가 발생한다.
| true |
b779d810e04a05d7a4a95614f6085a8c99a1a209 | Python | sky-dream/LeetCodeProblemsStudy | /[1187][Hard][Make_Array_Strictly_Increasing]/Make_Array_Strictly_Increasing.py | UTF-8 | 1,680 | 3.484375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# leetcode time cost : 668 ms
# leetcode memory cost : 13.8 MB
# Time Complexity: O(M*N)
# Space Complexity: O(M*N)
# solution 1, DP
from functools import bisect
class Solution:
def makeArrayIncreasing(self, arr1: [int], arr2: [int]) -> int:
# use dict solution to maintain t... | true |
52291885fb56eb334b6616c30fc352ab1d6f235a | Python | rssalessio/PrivacyStochasticSystems | /limited_information.py | UTF-8 | 16,748 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Alessio Russo [alessior@kth.se]. All rights reserved.
#
# This file is part of PrivacyStochasticSystems.
#
# PrivacyStochasticSystems is free software: you can redistribute it and/or modify
# it under the terms of the MIT License. You should ... | true |
32bce72358b0def0665d5eb7df59dd1b0ccedf54 | Python | mansi-958/python-twoc | /Task1/Common divisor.py | UTF-8 | 162 | 3.8125 | 4 | [] | no_license | a=int(input("Enter the number: "))
b=int(input("Enter the other number: "))
if a<b:
num=a
else:
num=b
for i in range(1,num+1):
if a%i==b%i==0:
print(i)
| true |
9e85b78630ba8f507ada6cb400b403a1a5c95897 | Python | prkapadnis/Python | /Programs/sixth.py | UTF-8 | 230 | 3.796875 | 4 | [] | no_license | """
Finding the third largest element in the list
"""
def finding_largest_third(myList):
myList = list(set(myList))
myList.sort()
return myList[-3]
myList = [2,2,3,1]
print(finding_largest_third(myList)) | true |
a0149f5b670f740da178fbe440aeeeb029526ae4 | Python | erezrubinstein/aa | /tests/integration_tests/core_tests/service_entity_logic_tests/implementation/white_space_helper_test_collection.py | UTF-8 | 2,880 | 2.546875 | 3 | [] | no_license | from core.common.business_logic.service_entity_logic.white_space_grid_helper import select_grid_cell_by_lat_long
from core.common.utilities.helpers import ensure_id
from tests.integration_tests.framework.svc_test_collection import ServiceTestCollection
from tests.integration_tests.utilities.data_access_misc_queries imp... | true |
15521def17128cd2244c648925d0bef69780c683 | Python | WOC-BUG/machine-learning | /代码实例/KNN/sklearn实现KNN交叉验证.py | UTF-8 | 911 | 3.28125 | 3 | [] | no_license | # sklearn实现KNN交叉验证
from sklearn import datasets
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import GridSearchCV # 通过网格方式来搜索参数
# 导入iris数据集
iris=datasets.load_iris()
x=iris.data
y=iris.target
# 设定想要搜索的K值,'n_neighbors'是sklearn中KNN的参数
parameters={'n_neighbors':[1,3,5,7,9,11,13,15]}
knn... | true |
9de03140a29d2813149639d3c1c554067e96ca70 | Python | sug5806/TIL | /Python/algorithm/find_max_value/find_max_value_recur.py | UTF-8 | 297 | 3.09375 | 3 | [
"MIT"
] | permissive | import random as rd
def re(li, leng):
if leng == 1:
return li[leng-1]
max_val = re(li, leng-1)
if max_val >= li[leng-1]:
return max_val
else:
return li[leng]
li = []
for _ in range(10):
li.append(rd.randint(0,100))
print(li)
print(re(li, len(li)))
| true |
f4d2c8c4efedd15502bef6275dd8c870f88dd00b | Python | jdswinbank/taenaris | /pysrc/example2/exercise_iter_svc.py | UTF-8 | 1,316 | 2.546875 | 3 | [
"CC0-1.0"
] | permissive | #! /usr/bin/ python
# -*- coding=utf-8 -*-
import pyvo
import warnings
import sys
def main():
# Keep the output of this example "sane".
if not sys.warnoptions:
warnings.simplefilter("ignore")
# Query the registry to obtain obscore services which offer data in
# the radio realm
servic... | true |
38a319b63f8d30fa8ae57b94d1f3a64fd4c16d65 | Python | BartoszPiotrowski/deep-equivalence | /utils/predict.py | UTF-8 | 3,348 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python3
import tensorflow as tf
import sys
from dataset import Dataset
class NetworkPredict:
def __init__(self, threads=1, seed=42):
# Create an empty graph and a session
graph = tf.Graph()
graph.seed = seed
self.session = tf.Session(
graph=graph,
... | true |
efbfc83fe1b3b0c8985e73d4336ce14c0fb67725 | Python | DavidToca/programming-challanges | /leetcode/1539. Kth Missing Positive Number/solve2.py | UTF-8 | 322 | 2.828125 | 3 | [] | no_license | class Solution:
def findKthPositive(self, arr: List[int], k: int) -> int:
response = 0
j = 0
i=1
while k!=0:
if(j >= len(arr) or i != arr[j]):
response = i
k-=1
else:
j+=1
i+=1
return respons... | true |
171f90b57be50bd0b2c2b420daaa553185acf0f9 | Python | TangYaoHan/openCV | /04 SVM身高体重分类.py | UTF-8 | 1,500 | 3.9375 | 4 | [] | no_license | """
身高体重 预测 男女
SVM:
1. SVM_create()
2. svm.train()
3. svm.predict()
"""
import cv2
import numpy as np
from matplotlib import pyplot as plt
def main():
# 1. 准备数据
rand_girl = np.array([[155, 48], [159, 50], [164, 53], [168, 56], [172, 60]])
rand_boy = ... | true |
6f86e466dbd624773ada4819cb376ea28b81688e | Python | SavonEvgeniy/Skill_Factory_19.2.3 | /first_test.py | UTF-8 | 1,085 | 3.203125 | 3 | [] | no_license | from app.calculator import Calculator
class TestCalc:
def setup(self):
self.calc = Calculator
def test_multiply_calculate_correctly(self): #тестируем умножение
assert self.calc.multiply(self, 2, 2) == 4
def test_multiply_calculate_failed(self):
assert self.calc.multiply(self, 2,... | true |
99a980bcf823f16c8f94ef85d0b532b8a08c466e | Python | MostafaNabieh/Computer-Vision-Object-Detection-with-OpenCV-and-Python | /face detection.py | UTF-8 | 598 | 2.6875 | 3 | [] | no_license | import cv2
import numpy as np
import matplotlib.pyplot as plt
face_cascade=cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
image = cv2.imread("google.jpg")
fix_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
plt.imshow(fix_image)
faces= face_cascade.detectMultiScale(fix... | true |
1ab49f6c1e7c1ad57bf66fdc3963287a4cd167d8 | Python | takavarasha/cerf-projects-scraper | /utils.py | UTF-8 | 2,467 | 3.171875 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
""" Utility functions """
import hashlib
import requests
import datetime
import sys
import sqlite3 as lite
def date_from_iso_date(s):
"""Construct a date from an iso date string.
Supports iso date of the form YYYY-MM-DD.
Ignores any chars after t... | true |
d9ab6be2e567054833fbcd1904cbd899f73a0553 | Python | krisbb/NetworkProgramming | /lab2/stmp/smtpClient.py | UTF-8 | 3,658 | 2.859375 | 3 | [] | no_license | import socket
import json
import base64
LENGTHOFMESSAGE = 512
class ClientSocket:
def __init__(self, host, port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.address = host
self.port = port
def close(self):
self.sock.close()
def ehlo(self, host):
... | true |
52db3a55e587d61c0ec6608142a46c23d236313a | Python | sudo-slatin01/Python-sudo | /Python3.py | UTF-8 | 1,073 | 4.34375 | 4 | [] | no_license | import random
"""
Необходимо определить индексы элементов списка, значение которых не меньше заданного минимума и не больше заданного максимума.
Пусть исследуемый массив (список в Python) заполняется случайными числами в диапазоне от 0 до 99 (включительно) и состоит из 100 элементов.
Далее минимум и максимум для... | true |
6c4bc5f696ac00c6c37d018231f58505f6396e15 | Python | hiracse091/BanglaWordCloud | /main.py | UTF-8 | 2,705 | 2.71875 | 3 | [] | no_license | import codecs
from os import path
from tokenizer import tokenize
from word_tokenize_bn import *
from stemmer import *
import numpy as np
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from quadtree import *
from utils import *
lan_bn = [ '০১২৩৪৫৬৭৮৯', ',.;:!?-', 'অআইঈউঊএঐওঔকখগঘ... | true |
f4e89743fc8cb1dbf6e8155c04afdacd0fb54dfc | Python | cormie45/NHL_League_Simulator | /tests/goal_test.py | UTF-8 | 733 | 2.96875 | 3 | [] | no_license | import unittest
from models.goal import Goal
from models.match import Match
from models.player import Player
class TestGoal(unittest.TestCase):
def setUp(self):
self.match = Match('team_a', 1, 2, 3, 6, 'team_b', 2, 0, 1, 3, 'team_a')
self.player = Player('steven', 'cormack', 37, 'team_a', 'center',... | true |
f436a18a824d409ce788de99b5a9964bc62c848f | Python | tratatapewpew/Queue | /Tests/test_queue_constructor.py | UTF-8 | 414 | 2.84375 | 3 | [] | no_license | __author__ = 'Igor Barulin'
import unittest
from queue import Queue
class TestQueueConstructor(unittest.TestCase):
def testQueueConstructorZero(self):
with self.assertRaises(BaseException):
queue = Queue(0)
def testQueueConstructorStr(self):
with self.assertRaises(BaseException):
queue = Queue("1")
... | true |
3940fb025457aad3b61ce00a9d9a49f846efc344 | Python | CarlosValadez/AVANCE-PIA | /PrincipalPya.py | UTF-8 | 4,010 | 3.609375 | 4 | [] | no_license | PrinciplaPIA.py
import csv
import datetime
# Se usa para poder usar expresiones regulares.
import re
# Libreria necesaria para usar el sistema operativo.
import os
# Se importan las clases de clasePIA.
from clasePIA import Contacto
# Se importa una clase que permite extraer elementos de un objeto
from operat... | true |
addaba862c07702a6bf0993e2d3db1acb2f05d7e | Python | scikit-rf/scikit-rf | /skrf/media/freespace.py | UTF-8 | 9,445 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | """
freespace (:mod:`skrf.media.freespace`)
========================================
A plane-wave (TEM Mode) in Freespace.
Represents a plane-wave in a homogeneous freespace, defined by
the space's relative permittivity and relative permeability.
.. autosummary::
:toctree: generated/
Freespace
"""
from sc... | true |
f78441ad843f1e3b196dd32381d21ca1bb9a5c69 | Python | natp75/homework_5 | /homework_5/homework_5_6.py | UTF-8 | 1,188 | 3.4375 | 3 | [] | no_license |
#Необходимо создать (не программно) текстовый файл, где каждая строка описывает учебный предмет
# и наличие лекционных, практических и лабораторных занятий по этому предмету и их количество.
# Важно, чтобы для каждого предмета не обязательно были все типы занятий. Сформировать словарь,
# содержащий название предмета и... | true |
8dbeda7f6e0d192eccf6b8186c89a7aa9a3ec088 | Python | harleenkbhatia/Python | /pandas_task.py | UTF-8 | 1,693 | 3.34375 | 3 | [] | no_license | import pandas as pd
#series dataframe
data=pd.read_csv('C:/Users/Jagdeep/Downloads/datasets_527325_1205308_Time.csv')
print(data.tail())
data['negative']=data['nagative'].apply(lambda x:0 if x=='' else x)
data['negative']=data['confirmed'].apply(lambda x:1 if x=='' else x)
'''
series=pd.Series([1,24,32,2,13,1,... | true |
73ad6a87ef791dd67704b2d161e002b6bfb0348c | Python | C-is-for-Cicero/learning-Python-for-the-memez | /Section5/CodingExcercise24.py | UTF-8 | 89 | 2.984375 | 3 | [] | no_license | def converter(fluid_ounces):
mililiters=fluid_ounces*29.57353
return mililiters | true |
b3d0530e4d79670d2c5ab8d12cee5ab9676aec65 | Python | EshginGuluzade/shapesOnCanvas | /shapes.py | UTF-8 | 824 | 3.3125 | 3 | [] | no_license | class Rectangle:
def __init__(self, x, y, width, height, color):
self.x = x
self.y = y
self.width = width
self.height = height
self.color = color
def draw(self, canvas):
canvas.image_data[self.x:self.x + self.height, self.y:self.y + self.width] = [self.color[0], ... | true |
987784d0db790fa8efabd1b3dd1505dec52498d5 | Python | alviandk/python-sunmorn | /week 11/game-suit.py | UTF-8 | 948 | 3.984375 | 4 | [] | no_license | from random import randint
#create a random suit for computer answer
def enemy():
rand=randint(1,3)
if rand==1:
return "rock"
elif rand==2:
return "scissor"
elif rand==3:
return "paper"
#function result of suite with 2 parameters "player" and "enemy" and give a return value
de... | true |
cc581ba773daf4995249e5956c8a4003cf20b51f | Python | farnaztavakool/social_media | /functions/sum.py | UTF-8 | 355 | 3.359375 | 3 | [] | no_license | # given a list find the pairs that add up to the sum
'''
q1: valid sum
q2: repeated values
'''
def find_sum(sumn,li):
sum_dict = {}
result = []
for i in li:
if sumn-i in sum_dict:
result.append([i, sumn-i])
continue
sum_dict[i] = sumn-i
return result
print ... | true |
6f1e2c428973a93bff60de09ca62cc28bebadfc4 | Python | dmunkvold/cryptocurrency_twitter_analysis | /crypto_compare_api/crypto_compare_api.py | UTF-8 | 1,022 | 2.640625 | 3 | [] | no_license | # this import code is only necessary because I am struggling to set the
# path for python to look for modules in my 3.6 environment. this code
# can be commented out in the case that cryptocompare imports correctly
import sys
sys.path.append('/Users/David/anaconda/envs/environment_for_py3/lib/python3.6/site-packages')... | true |
d0108c94e475f5c5652f5cf9dcd8cf5da44bbdfb | Python | talrus/Dz | /Exeption_CW.py | UTF-8 | 3,194 | 4.34375 | 4 | [] | no_license | '''
Напишіть програму, яка пропонує користувачу ввести ціле число і визначає чи це число парне чи непарне, чи введені дані коректні.
'''
'''
Напишіть програму, яка пропонує користувачу ввести свій вік, після чого виводить повідомлення про те чи вік є парним чи непарним числом.
Необхідно передбачити можливість введення... | true |
37eb017ead042dd6fe3800a88a95c0f725a1bd9c | Python | NicholasTing/Competitive_Programming | /CodeForces_635-640/CodeForces_638/b.py | UTF-8 | 504 | 3.09375 | 3 | [] | no_license | T = int(input())
while T != 0:
n, k = map(int,input().split())
numbers = list(map(int,input().split()))
# distinct numbers
dn = set(numbers)
dn_num = len(dn)
if dn_num > k:
print('-1')
T -= 1
continue
else:
fa = []
for i in dn:
fa.ap... | true |
30bd313009f6a29ba2a3727316ed3d75c57692ec | Python | minssoj/Learning_OpenCV-Python | /Code/30.TemplateMatch.py | UTF-8 | 1,333 | 2.828125 | 3 | [
"MIT"
] | permissive | # =================================================
# minso.jeong@daum.net
# 30. 템플릿 매칭
# Reference : samsjang@naver.com
# =================================================
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
def templateMatching():
img1 = cv.imread('../Images/11.Ji.Jpg', cv.IMREAD_GRA... | true |
36e9a07347ce75d44c900191d66a9fa37a539747 | Python | Mark0042/Sorting-Visualizer | /main.py | UTF-8 | 1,153 | 3.1875 | 3 | [] | no_license | import pygame
import math
import random
import time
from pygame import mixer
pygame.init()
pygame.mixer.init()
clock = pygame.time.Clock()
screen = pygame.display.set_mode((800, 600))
a=[5,3,7,9,8,4,14,7,12,20,24,21,6,19,8,23,22,12,11,10]
mx=0
for i in a:
if i>mx:
mx=i
n=len(a)
wid=800/n
ht=600/mx-1
pygam... | true |
20caa14ce23c5fef3772fef528948bde9a1e0e75 | Python | Fallgregg/theory-of-algorithms | /Lab06/Lab06.py | UTF-8 | 4,563 | 3.484375 | 3 | [] | no_license | from pip._vendor.distlib.compat import raw_input
class Heap:
def __init__(self, arr, is_max):
"""конструктор класу Heap,
що ініціалізує масив як піраміду,
та встановлює фложок для перевірки
максимального розміру піраміди"""
self.heap = arr
self.is_max = is_max
... | true |
c453b5b286f7aeff8142c28d84e449499839d746 | Python | hillaryellis37/NoteFinderProject | /NoteFinder/audio/freq_to_note_converter.py | UTF-8 | 2,125 | 2.90625 | 3 | [] | no_license | from math import log2, pow
import numpy as np
from music21 import chord as ch
A4 = 440
C0 = A4 * pow(2, -4.75)
name = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
class Note:
def __init__(self, name=name, A4=440, C0=C0):
self.name = name
self.A4 = A4
self.C0 = C0
... | true |
16a1a88fe054606caeb4abd24cfeab0ea147d568 | Python | kain-01/kyoupro | /kyoupro/AtCoder Beginner Contest 143/143a.py | UTF-8 | 84 | 3.140625 | 3 | [] | no_license | a,b = map(int,input().split())
if a > b*2:
print(a-b*2)
else:
print(0)
| true |
e0c384a951c194fe13fa6ab68ba0f373fab77cc2 | Python | vinitha33/training | /Hands-on/Python/Ques_8.py | UTF-8 | 426 | 3.75 | 4 | [] | no_license | #Diplay all the numbers which are greater than that number and are to the right side to it.
num1 = [10,4,2,5,3,6]
num2 = []
for i in range(len(num1)):
for j in range((i + 1),len(num1)):
if num1[i] < num1[j]:
# num2.append(num1[i])
num2.append(num1[j])
if len(num2) == 0:... | true |
bf65ec187f5bcebf01a77ef17f13f2337978815f | Python | Ahmad-Mahmoud/USafeB | /src/crypt.py | UTF-8 | 2,654 | 3.03125 | 3 | [] | no_license | import string
import random
import os
import re
from Crypto.PublicKey import RSA
from Crypto.Random import *
from Crypto.Cipher import AES
# This class is created to tie the object with its key throughout the encryption and decryption process
class Device:
def __init__(self, i: int):
self.key = get_random... | true |
fe1a6d9998d1cfbcd040b65f885fc851baba1e08 | Python | sanathks1998/sanathks | /noofmeeting.py | UTF-8 | 285 | 2.765625 | 3 | [] | no_license | r=int(input())
s=list(map(int,input().split()))
f=list(map(int,input().split()))
ct=[]
t=0
for i in range(r):
ctrl=0
t=0
for j in range(i,r):
if(s[j]>=t):
t=f[j]
ctrl=ctrl+1
ct.append(ctrl)
print(int(max(ct)),end="")
| true |
c6129f5ffdbe45912545d955e39e560999b19e02 | Python | GrandyLee/rayfire | /hik/demo.py | UTF-8 | 519 | 2.984375 | 3 | [] | no_license | # -*-coding:UTF:8-*-
import unittest
class TestMethod(unittest.TestCase):
# 每次执行用例前执行setUp(),可以在这里做一些初始化工作
@classmethod
def setUp(cls):
print('setUp')
# 每次执行用例后执行teardown
@classmethod
def tearDown(cls):
print('tearDown')
def test001(self): # unittest中的用例必须以test开头
... | true |
b36a66ef8ba8cfc3c871953de7bac89d3f8dbc4a | Python | Candy-Capilla/sqlalchemy-challenge | /app.py | UTF-8 | 4,687 | 2.796875 | 3 | [] | no_license | import numpy as np
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import datetime as dt
from flask import Flask, jsonify
#################################################
# Database Setup
##################################... | true |
60005d91da181f229aa22d3e84cba6797e33e994 | Python | TayExp/pythonDemo | /05DataStructure/数字在排序数组中出现的次数.py | UTF-8 | 1,203 | 3.375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
class Solution:
def GetNumberOfK(self, data, k):
# write code here
first = self.GetFirst(data, k, 0, len(data) - 1)
if first == -1:
return 0
last = self.GetLast(data, k, 0, len(data) - 1)
return last - first + 1
def GetFirst(self, data,... | true |
fef4b27033495cda8ae040e9a3edf07f1284496b | Python | rolquitel/py-grafos | /layout.py | UTF-8 | 14,239 | 2.890625 | 3 | [] | no_license | import abc
import math
import random
import numpy
from abc import ABC
import node
import graph
from quadtree import QuadTree, Rectangle, Point
stop_layinout = False
def fr(k, x):
"""
Fuerza de repulsion
:param k:
:param x:
:return:
"""
return (k ** 2) / x
def fa(k, x):
"""
Fuer... | true |
5982de8a3e63ccfb060f1d4cf93f932d279e6441 | Python | NickSto/python-single | /youtube.py | UTF-8 | 19,653 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python3
import argparse
import collections
import logging
import os
import re
import shutil
import sys
import time
import requests
from oyaml import oyaml as yaml
try:
import youtube_dl
except ImportError:
youtube_dl = None
assert sys.version_info.major >= 3, 'Python 3 required'
API_URL = 'https://w... | true |
12820f6a00d5be3cc5a6ef3dc99a2eec89f87af4 | Python | j5s/getdomain | /lib/log.py | UTF-8 | 649 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | import logging # 引入logging模块
logging.basicConfig(level=logging.INFO,
format='[-]%(asctime)s-[%(levelname)s]: %(message)s') # logging.basicConfig函数对日志的输出格式及方式做相关配置
if __name__ == '__main__':
# 由于日志基本配置中级别设置为DEBUG,所以一下打印信息将会全部显示在控制台上
logging.info('this is a loggging info message')
loggi... | true |
d6d1bf14c30e03422362c59e411627a1b782f036 | Python | pbourachot/cours | /cours4/mymorpion.py | UTF-8 | 3,652 | 3.53125 | 4 | [] | no_license |
import turtle as tu
# TODO:
# **** Clear Button
# **** Controler si croix presente
# **** Gagner ???
# Settings
height = 400
width = 400
speed = 0
epaisseur = 5
nbEssai = 0
tableau = [['','',''], # ligne du base
['','',''], # ligne du milieu
['','','']] # ligne du haut
def printTablea... | true |
efa7ae2becbaf4d8a46bb5dbb342593c3c582d0c | Python | OseungKwon/Beakjoon-Algorithms | /브루트 포스/2798 블랙잭.py | UTF-8 | 280 | 2.796875 | 3 | [] | no_license | n, m = map(int, input().split())
arr = list(map(int, input().split()))
max_m = 0
for i in range(0, n-2):
for j in range(i+1, n-1):
for k in range(j+1, n):
if arr[i]+arr[j]+arr[k] <= m:
max_m = max(max_m, arr[i]+arr[j]+arr[k])
print(max_m)
| true |
bcac17eb3962e0daa95066e977da95d3dbb44c15 | Python | heeya15/PythonCodingTest | /09_최단 경로/최단경로-실전문제/전보.py | UTF-8 | 5,343 | 3.59375 | 4 | [] | no_license | """
(실전 문제) 전보 p, 262
- 어떤 나라에는 N개의 도시가 있다.
그리고 각 도시는 보내고자 하는 메시지가 있는 경우, 다른 도시로 전보를 보내서
다른 도시로 해당 메시지를 전송할 수 있다
- 하지만 ' X라는 도시 '에서 ' Y라는 도시 '로 [ 전보를 보내고자 한다면 ],
도시 [ X에서 Y로 향하는 " 통로 " ]가 ' 설치되어 있어야 한다. '
- 예를 들어 X에서 Y로 향하는 통로는 있지만, [ Y에서 X로 향하는 ] ' 통로가 없다면 '
[ [ Y는 ] --> [ X로 ] 메시지를 보낼 수 없다. ]
또한 [ 통로를 거쳐... | true |
051e20546935a5e3af7125c712e7d3bed00ca1ff | Python | cyber-chuvash/redir-balancer | /tests/test_cdn_url_builder.py | UTF-8 | 1,298 | 2.59375 | 3 | [
"MIT"
] | permissive | import pytest
from balancer.cdn_url_builder import CDNURLBuilder
@pytest.mark.parametrize(
['origin_url', 'exp_cdn_url'],
(
('http://s1.origin-cluster/video/1488/xcg2djHckad.m3u8',
'http://cdn.test/s1/video/1488/xcg2djHckad.m3u8'),
('http://s2.origin-cluster/video/5423/test34289laala... | true |
17c330412172503086a7fff5b8503daba28bf2df | Python | wangyendt/LeetCode | /Contests/201-300/week 279/2164. Sort Even and Odd Indices Independently/Sort Even and Odd Indices Independently.py | UTF-8 | 702 | 3.3125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: wangye(Wayne)
@license: Apache Licence
@file: Sort Even and Odd Indices Independently.py
@time: 2022/02/15
@contact: wang121ye@hotmail.com
@site:
@software: PyCharm
# code is far away from bugs.
"""
from typing import *
class Solution:
def sortE... | true |
3530379fda44847319ecd859cd566a5c8ec6c4a9 | Python | ikechuku/practice-python | /practice/5.py | UTF-8 | 143 | 3.703125 | 4 | [] | no_license | print("what is your name")
fName = input("first name: \n")
lName = input("last name: \n")
print("Your full name is \n" + lName + " " + fName)
| true |
962a05c83bf1c8871a0c041e583d7155446d88c9 | Python | Hilary02/atcoder | /ABC/159/c.py | UTF-8 | 34 | 3.03125 | 3 | [] | no_license | n = int(input())
print((n/3)**3)
| true |
7efefd5e622ee4d5a60bf0affef9e8c14959c876 | Python | boosker/Cybersecurity-Final-Project | /test/analysis.py | UTF-8 | 11,305 | 3.078125 | 3 | [] | no_license | """
CSCI 5742 Final Project
Vedant Singhania & Jacob Jolly
PROJECT NAME: Honeypot Analysis Tool
PROJECT DDESCRIPTION: The H.AT. takes data from the modified Adminer Log file
and parses it into IP Addresses, Usernames, and Passwords
if they were an Invalid Login. It th... | true |
ae5e2a15862c974b61734bb09c646ee498d518cc | Python | OSGeoLabBp/tutorials | /english/data_processing/lessons/code/gpx2kml.py | UTF-8 | 849 | 2.875 | 3 | [
"CC0-1.0"
] | permissive | import sys
from os import path
from osgeo import ogr
"""
convert gpx files into kml
usage: python gpx2kml input.gpx input1.gpx ...
python gpx2kml *.gpx
"""
inDriver = ogr.GetDriverByName('GPX') # get ogr driver for gpx files
if inDriver is None:
print('GPX drive not found')
sys.exit()
outD... | true |
f65c3e6d4b6240c49574add16d75768943861445 | Python | sarihuminer/project-python-bchirot | /create_buttons.py | UTF-8 | 1,850 | 2.765625 | 3 | [] | no_license | import sys
import party
import random
import db
from PySide2 import QtCore, QtWidgets, QtGui
class MyWidget(QtWidgets.QWidget):
def __init__(self):
QtWidgets.QWidget.__init__(self)
self.allParty_list=[]
self.allParty = db.cursor.execute('select * from party ')
for p in self.allP... | true |
1ecf12de6b88ce90e6a9d71041ab045bf857753d | Python | atena-data/Python-Bootcamp-Codes | /Day 46 - Web Scraping - Top 100 movies/main.py | UTF-8 | 707 | 3.421875 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
URL = "https://www.timeout.com/newyork/movies/best-movies-of-all-time"
response = requests.get(URL)
# loading the website's content
website = response.text
# using BeautifulSoup to scrape the website
soup = BeautifulSoup(website, "html.parser")
website_headings = soup.fi... | true |
1f1f82386a22339d7ac79cef661e46fa0949eb71 | Python | Cunillet/Project-Week-5-Your-Own-Project | /market_scrapper/search_corrupted_Data.py | UTF-8 | 149 | 2.71875 | 3 | [] | no_license | import pandas as pd
if __name__ == '__main__':
df = pd.read_csv('data/csv/S&P_500.csv')
for index, row in df.iterrows():
print(row)
| true |
82d167530d91cf90e1fb0cbf3a392d1977e0ae4d | Python | K1ngDedede/Mogolla-Gaming | /Mogolla Analytics/Jueguelo/firebase_connection.py | UTF-8 | 1,526 | 2.859375 | 3 | [] | no_license | import pyrebase
FIREBASE_KEY = ""
firebaseConfig = {
"apiKey": FIREBASE_KEY,
"authDomain": "proyecto-de-grado-7e7d3.firebaseapp.com",
"databaseURL": "https://proyecto-de-grado-7e7d3-default-rtdb.firebaseio.com",
"projectId": "proyecto-de-grado-7e7d3",
"storageBucket": "proyecto-de-grado-7e7d3.apps... | true |
cd61f068baa6fb39c49987664cd35216af72fedf | Python | Aasthaengg/IBMdataset | /Python_codes/p03186/s343869969.py | UTF-8 | 113 | 2.8125 | 3 | [] | no_license | a,b,c = map(int,input().split())
if c < a+b:
print(b+c)
elif c > a+b:
print(a+b+b+1)
else:
print(c+b) | true |
3f2c5f870645de80639b617176b53b20beda4776 | Python | ahedayat/Brent-Kung-Adder | /adders/brentkung/sum_logic.py | UTF-8 | 1,769 | 3.046875 | 3 | [] | no_license | import verilog as verilog
class SumLogic:
module_name = 'SumLogic'
def __init__(self, bitwidth):
self.bitwidth = bitwidth
def inputs(self):
Ps = ['P_{}'.format(ix) for ix in range(self.bitwidth+1)]
Gs = ['G_{}_0'.format(ix) for ix in range(self.bitwidth+1)]
return Ps, Gs
... | true |
22b95fd2d009ad2cef6cc8852fc0d522ab62ccc9 | Python | yaglm/yaglm | /yaglm/metrics/clf.py | UTF-8 | 1,736 | 3.296875 | 3 | [
"MIT"
] | permissive | from sklearn.metrics import accuracy_score, roc_auc_score, \
balanced_accuracy_score, f1_score, precision_score, recall_score, \
log_loss
def get_binary_clf_scores(y_true, y_pred, y_score=None,
sample_weight=None, level=1):
"""
Scores a binary classifiers.
Parameters
... | true |
b1a46dc1fee08da68fcb9a91c7589d431b405ab1 | Python | hyc12345hyc/hyc | /xiaojiayu3.7.1/xiaojiayu_exercise_py/index.py | UTF-8 | 4,056 | 3.4375 | 3 | [] | no_license | # 000愉快的开始
# 001我和Python的第一次亲密接触
# 002用Python设计第一个游戏
# 003小插曲之变量和字符串
# 004改进我们的小游戏 猜数字 4_0改进猜数字
# 005闲聊之Python的数据类型
# 006Python之常用操作符
# 007了不起的分支和循环1
# 008了不起的分支和循环2
# 009了不起的分支和循环3
# 010列表:一个打了激素的数组1
# 011列表:一个打了激素的数组2
# 012列表:一个打了激素的数组3
# 013元组:戴上了枷锁的列表
# 014字符串:各种奇葩的内置方法
# ... | true |
8594fa63c4516f544814273981a08da3f9bac06d | Python | skoter87/testanketapython3 | /anketa.py | UTF-8 | 753 | 4.21875 | 4 | [] | no_license | name = input('Введите ваше имя: ')
surname = input('Введите вашу фамилию: ')
age = int(input('Введите ваш возраст: '))
weight = int(input('Введите ваш вес: '))
if age < 30 and (weight > 50 or weight < 120):
print('Вы в отличном состоянии!')
elif age >= 40 and (weight <= 50 or weight >= 120):
print('Вам стоит пойти к... | true |
951628b64ab17c7c8ec297aeea5a5545ec049760 | Python | tnightengale/string_matching | /pyqt_implementation/pyqt_examples/view_frames_example/view_frames_example.py | UTF-8 | 1,956 | 3.28125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 31 09:37:38 2019
@author: TeghanN
"""
'''
First of all the classes that Qt Designer offers are not widgets,
and it is recommended that if you modify the .ui when recompiling
you will lose the modifications of the logic. So for the 2 previous
arguments I recommend you re... | true |
f621625aff0a95c43b934331a2dd7307196da494 | Python | karstenes/Nondisjunction | /bot.py | UTF-8 | 4,751 | 2.53125 | 3 | [] | no_license | import discord
import isodate
import re
import logging
from googleapiclient.discovery import build
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='/logs/discord.log', encoding='utf-8', mode='w')
handler.setFormatter(l... | true |
178de38ce11261e3e7121a6be10316f15d5958f2 | Python | HIT-GH/EPN-CEC-Python | /test16-FunctionIsPrime-20210629.py | UTF-8 | 1,013 | 3.921875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 29 18:14:28 2021
@author: HendersonIturralde
"""
print("")
print("≡-≡-≡-≡ Generador de Números Primos ≡-≡-≡-≡")
#--- fun: GENERADOR DE NÚMEROS PRIMOS -------------------
def generador_primos(x):
y = 2
while y < x:
is_prime... | true |
64d15982c00b93c5bfd39a9e68d129222991e090 | Python | chenyangbin/pywork | /day06函数/15迭代器.py | UTF-8 | 2,967 | 3.890625 | 4 | [] | no_license |
# 工程目录:c:\Users\bin\OneDrive\share\pywork\day06函数\15迭代器.py
# 创建日期: 2019.03.17
# 工程目标:生成器的使用
# 创建作者:binyang
# -*- coding:utf-8 -*-
# 生成器 遍历数据 惰性迭代 节省内层空间 字典记录遍历状态 next直接按顺序下一个访问
# 特点:
# 1惰性计算数据 节省内存
# 2记录 状态,通过next访问下一个状态
# 3具备可迭代特性 生成器具有迭代器特性,但迭代器不是生成器
# 创建方式:
# 1把列表的表达:{} 修改 为[] 即可 表达式,非元素
#示例:
l = [i f... | true |