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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bfc9e074c0972cbde593666e2d08a3a0d32ede2e | Python | luizfirmino/python-labs | /Python II/Assignment 4/210426_Filho_Luiz_q6.py | UTF-8 | 2,303 | 3.78125 | 4 | [] | no_license | #!/usr/bin/env python3
# Assignment 4 - Q6
# Author: Luiz Firmino
# Scope
# In the accounts.txt file:
# update the name 'Zoltar' to 'Robert'
# create a tempfile with the new data
# remove accounts.txt file from the directory
# rename the tempfile to a new file called myaccounts.txt
import os
from os import path
#... | true |
00a858882440a44a7e5ffaace7db2e414ad7020b | Python | zachwill/cookiecutter-scrapy | /{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/pipelines.py | UTF-8 | 840 | 2.78125 | 3 | [] | no_license | """
Save ModelItem's to a local SQLite database.
"""
from collections import defaultdict
from peewee import chunked
from {{cookiecutter.repo_name}}.items import ModelItem
class ModelPipeline(object):
"The pipeline stores scraped data in a database."
def open_spider(self, spider):
self.models = def... | true |
955c1ef179e3b8ab274f94fc55e3cca2d281eba2 | Python | bianchimro/genepi | /genepi/tests/unit_tests/ga_test.py | UTF-8 | 4,563 | 2.640625 | 3 | [] | no_license | import os
import unittest
from genepi.core.ga import GeneticAlgorithm
from genepi.core.gene import IntGene
from genepi.core.protogene import ProtoGene
from genepi.core.protogenome import ProtoGenome
from genepi.core.population import POPULATION_DEFAULT_SIZE
from genepi.core.stopcriteria import convergence_stop, raw_sco... | true |
7fe18b72b214b314ef9865d166236751a3d901e1 | Python | suchita-25/ameritradestockdata | /streamingdatatodb.py | UTF-8 | 2,475 | 2.84375 | 3 | [] | no_license | """
This program gets the streaming Data from TD Ameritrade and store in Timescale DB
"""
import asyncio
import psycopg2
from tda.auth import easy_client
from tda.streaming import StreamClient
import pandas as pd
import config
CONN = psycopg2.connect(host=config.DB_HOST,
database=config.DB_NAM... | true |
4f6f43c5d2160af6aaa98cfe9a42ccbe0990aa9b | Python | ucfilho/Metodos_Numericos_2021 | /GaussSeidel.py | UTF-8 | 1,356 | 3.046875 | 3 | [] | no_license | import numpy as np
############################################################
## Implementation of the Gauss Seidel algorithm
## A matrix of the linear system
## f right hand side
## x0 initial guess of the solution
############################################################
def gauss_seidel(A,f,x0,ITER_MAX = 100,... | true |
c7f0e21f583b94220ac49a3392e331392e45ed3e | Python | Premnath08/GUVI-Python-Class | /Problems/Hangman Game.py | UTF-8 | 644 | 3.640625 | 4 | [] | no_license | import random
country=["india","australia","america","brazil","england"]
place=random.choice(country)
a=input("Play Game!!! Press Enter ")
count=0
i=''
letter=''
length=len(place)
while(count<5):
chance=0
char=input("\nEnter letter : ")
letter=char+letter
for i in place:
if i in let... | true |
a19b4d0aa690fb5dfe0c6e3d0241d3bbf2783c1c | Python | vshmyhlo/similarity-learning | /transforms.py | UTF-8 | 192 | 2.875 | 3 | [] | no_license | class CheckSize(object):
def __init__(self, size):
self.size = size
def __call__(self, input):
assert input.size == (self.size[1], self.size[0])
return input
| true |
93f85345856800abd360daf4a6237a8e01d9abc8 | Python | jcass8695/Interview-Prep | /middle_elem_ll.py | UTF-8 | 1,113 | 4.03125 | 4 | [] | no_license | class Node:
def __init__(self, val):
self.val = val
self.next = None
class LL:
def __init__(self):
self.head = None
self.tail = None
def insert_node(self, val):
new_node = Node(val)
if self.head is None:
self.head = new_node
if self.tai... | true |
c6d3a2c9f4d525bd2f3fab16cea0eb7bc78f4850 | Python | hakbailey/advent-of-code-2020 | /05/05a.py | UTF-8 | 564 | 2.96875 | 3 | [] | no_license | import math
file = "day-5-input.txt"
ids = []
def pick_half(half, r):
dist = (r[1] - r[0])/2
if half == "F" or half == "L":
r[1] = r[1] - math.floor(dist)
else:
r[0] = r[0] + math.ceil(dist)
return r
with open(file, "r") as f:
passes = f.readlines()
for p in passes:
p = p.... | true |
7d16d3875ff5144360ab6c4f66a9385802862152 | Python | rjairath/python-algos | /graphs/graphRepresentUsingLL.py | UTF-8 | 2,199 | 3.96875 | 4 | [] | no_license | class Node:
def __init__(self, value):
self.value = value
self.next = None
class Graph:
def __init__(self, vertexCount):
self.vertexCount = vertexCount
self.adjList = [None] * self.vertexCount
self.visitedArray = [False] * self.vertexCount
def addEdge(self, from_va... | true |
fd6e860e285e45d7d414f84cec5c685d1cabdf5f | Python | yuceltoluyag/pythondersnotlarim | /lessons3/ders5.py | UTF-8 | 162 | 2.625 | 3 | [] | no_license | import requests
import json
result = requests.get("https://jsonplaceholder.typicode.com/todos")
result = json.loads(result.text)
for i in result:
print(i)
| true |
87c046f5d40eb789739a416830da332c3931736e | Python | sourcery-ai-bot/library-python | /concepts/strings/multi_line_string.py | UTF-8 | 278 | 4.25 | 4 | [] | no_license | text_str = "multi-line text string"
str_method = "Python's f strings"
my_string = (
f"This is an example of a {text_str} with interpolated variables " +
f"displayed within placeholders using {str_method} method."
)
# Prints entire string on one line.
print(my_string)
| true |
7f827eb4bcfcb878d5ae5fe5dbae08868a36609a | Python | nasigh/assignment-2 | /rock, paper,scissor.py | UTF-8 | 1,218 | 3.515625 | 4 | [] | no_license | import random
user=0
computer=0
print ("*lets play game*","\U0001F60E")
print ("you have 5 set to play whith computer")
print ("if you are ready choose 1 and if you are not choose 2")
print ("1-yes","2-no")
agreement = input("tel me:")
if agreement == '1':
for i in range(1,6):
print("round:" ,+i )
... | true |
e5fc2c080258694dba1686fe9a6cff537793068e | Python | Tech4AfricaRHoK/Education | /backend/learnervoice/teacherfeedback/serializers.py | UTF-8 | 2,333 | 2.734375 | 3 | [
"MIT"
] | permissive | """
Serializers for the teacher feedback API.
"""
from teacherfeedback.models import Profile
from rest_framework import serializers
class TeacherSubjectSerializer(serializers.Serializer):
"""
Allows us to serialize/deserialize the grades/subjects that a teacher teaches.
"""
grade = serializers.Intege... | true |
59e25c37fca73f8aa794124e6ea43010ff5d860c | Python | HenryPaik1/WalmartDemandForecast | /utils.py | UTF-8 | 9,092 | 2.796875 | 3 | [] | no_license | import warnings
import pandas as pd
import numpy as np
import pickle
import statsmodels.api as sm
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
from sklearn.decomposition import PCA
from pmdarima.arima import auto_arima
from dateut... | true |
d01b339c724d084d417837fe3de6a41269cc98f5 | Python | tylerharter/caraza-harter-com | /tyler/cs301/fall18/materials3/code/lec-08-loops/code06_simple_loop.py | UTF-8 | 165 | 4.0625 | 4 | [] | no_license | num = input('Enter a number: ')
num = int(num)
counter = 1
while counter <= num:
print(counter)
counter += 1
print('counter =', counter)
print('Goodbye!') | true |
236d584a47acc264236ef5c2573449ceab09956b | Python | Rayan-arch/flask_api | /api/repositories.py | UTF-8 | 3,074 | 2.609375 | 3 | [] | no_license | from db import get_connection
from psycopg2 import extras
from auth import User
class AuthorsRepository:
def __init__(self):
self.connection = get_connection()
self.cursor = self.connection.cursor(cursor_factory=extras.RealDictCursor)
def check_exists(self, author_id):
self.cursor.ex... | true |
dc4898d454a7f19d817c95cc0f578e385c97c4f0 | Python | ademmy/Academic-Performance-in-Maths | /math_students.py | UTF-8 | 6,764 | 2.796875 | 3 | [] | no_license | import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.tree import DecisionTreeClassif... | true |
4fe959e6fe0d46326bce7ab9fce381fba5a763bd | Python | bozege/Functions.py | /karatsuba.py | UTF-8 | 982 | 3.125 | 3 | [] | no_license | #This function returns the product of given parameters using karatsuba algorithm.
def karatsuba(n,m):
strn = str(n)
strm = str(m)
if len(strn)%2 != 0:
strn = "0" + strn
if len(strm)%2 != 0:
strm = "0" + strm
nhalf1 = ""
nhalf2 = ""
mhalf1 = ""
mhalf2 = ""... | true |
f125902465661669acaa2b8a303a9d86cc95946a | Python | timkl/alexa-runlog | /alexa-runlog.py | UTF-8 | 2,386 | 2.53125 | 3 | [] | no_license | import logging
import csv
from datetime import datetime, timedelta
from flask import Flask, render_template
from flask_ask import Ask, question, statement
app = Flask(__name__)
ask = Ask(app, "/")
log = logging.getLogger()
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)
logging.getLogger('flask... | true |
28b4fcc999f1c39a48845e8d62848ccce787fb6b | Python | Evgeny-Ivanov/mathcup_server | /answers/services.py | UTF-8 | 461 | 3.015625 | 3 | [] | no_license | class СheckAnswersService(object):
@staticmethod
def normalize_answer(answer):
answer = answer.strip()
answer = answer.lower()
answer = answer.replace(',', '.')
return answer
@staticmethod
def check_answer(user_answer):
answer1 = СheckAnswersService.normalize_ans... | true |
aade309916bde2e10cf786c0267fcb981891531b | Python | pooja1909/ai-ml-projects-data-science | /project-iris-dataset/final/q4/node.py | UTF-8 | 448 | 2.703125 | 3 | [] | no_license | #The class is just used to simply store each node.
class decisionnode:
def __init__(self,col=-1,value=None,results=None,tb=None,fb=None):
self.col=col # column index of criteria being tested
self.value=value # vlaue necessary to get a true result
self.results=results # dict of results for a ... | true |
50fdcb058fe2c5ff11277ac97b4fda2f8bb2c72a | Python | fenrrir/pug-pb-17032018 | /descriptors/descr1.py | UTF-8 | 715 | 3.484375 | 3 | [] | no_license | class selfclsmethod(object): # um novo tipo de método pro python
# o método irá receber automaticamente a instância e a classe atual
def __init__(self, method):
self.method = method
def __get__(self, obj, type):
def new_method( *args, **kwargs ... | true |
c6e88925309196a3436ad6121900e3c70fc23b99 | Python | FerCremonez/College-1st-semester- | /lista3e6.py | UTF-8 | 552 | 3.765625 | 4 | [] | no_license | import math
print('informe os coeficientes de uma equação de 2º grau:')
a=float(input('a='))
b=float(input('b='))
c=float(input('c='))
if a==0:
print('não é uma equação de 2º grau ')
else:
delta=b**2 -4*a*c
if delta<0:
print('Não existe raiz real')
else:
if delta==0:
... | true |
aa4d2632eb4dda1dc7a0d7be9665bc99fb0927a2 | Python | sungminoh/algorithms | /leetcode/solved/2432_Number_of_Zero-Filled_Subarrays/solution.py | UTF-8 | 1,749 | 3.671875 | 4 | [] | no_license | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 sungminoh <smoh2044@gmail.com>
#
# Distributed under terms of the MIT license.
"""
Given an integer array nums, return the number of subarrays filled with 0.
A subarray is a contiguous non-empty sequence of elements within an array.
... | true |
fb7c5588b97591642ee14751e6e81ae880c33195 | Python | wanghongjuan/intel-iot-refkit | /meta-iotqa/lib/oeqa/runtime/nodejs/ocfdemoapp/led.py | UTF-8 | 3,238 | 2.640625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import os
import sys
import time
import subprocess
from uiautomator import device as d
from oeqa.oetest import oeRuntimeTest
sys.path.append(os.path.dirname(__file__))
from appmgr import AppMgr
import data_settings
class CordovaPluginOCFDemoAppLedTest(oeRuntimeTest):
'''Automatize the C... | true |
ea8ecf1081db1f353e4e19aea0daa212b9dd77c0 | Python | mateusgruener/cursopython | /Aulas/1/funcoes.py | UTF-8 | 176 | 3.0625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 15 17:20:09 2021
@author: Usuario
"""
def importada(x):
importada=x**2
return importada
print(importada(8)) | true |
31627118778e05e3ecf828ec2fe7b939a0b91eb7 | Python | junbinding/algorithm-notes | /recs.construct-binary-tree-from-preorder-and-inorder-traversal.py | UTF-8 | 980 | 4.15625 | 4 | [] | no_license | from typing import List
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
"""
105. 从前序与中序遍历序列构造二叉树
https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
根据一棵树的前序遍历与中序遍历构造二叉树。
前序遍历 ... | true |
ce237ad7a825624bb9184006e2d229269e8c80f2 | Python | sqlconsult/byte | /Python/binaryTree.py | UTF-8 | 1,998 | 3.4375 | 3 | [] | no_license | import math
import sys
#import pyodbc
import datetime
class Node:
def __init__(self, data):
self.left = None
self.right = None
self.data = data
class Tree:
def __init__(self):
self.root = None
def insert(self, root, data):
#print('data=', data)
... | true |
13996dc2d1c7c901a0b084c59c60e1c4a4a0c211 | Python | muralidhar8190/Royal | /if.py | UTF-8 | 102 | 2.984375 | 3 | [] | no_license | inp=[]
if len(inp)==0:
inp.append(10)
print("i am inside if condition")
print(inp)
| true |
52779a40c092d18ee9d80296d1a87d88b2339bfe | Python | GLAMOS/dataflow | /dataflow/DataReaders/DatabaseReaders/VolumeChangeReader.py | UTF-8 | 3,656 | 2.96875 | 3 | [
"MIT"
] | permissive | '''
Created on 12.07.2018
@author: yvo
'''
from dataflow.DataReaders.DatabaseReaders.GlamosDatabaseReader import GlamosDatabaseReader
from dataflow.DataObjects.VolumeChange import VolumeChange
from dataflow.DataObjects.Enumerations.HeightCaptureMethodEnumeration import HeightCaptureMethodEnum
from dataflow.DataObject... | true |
49cfc313ff708e8f868ade60e91b20cccece3200 | Python | karishmachawla4/PersonalDevelopment | /WordCounter.py | UTF-8 | 406 | 4.0625 | 4 | [] | no_license | # Count words in sentence
def wordCounter(string):
print("Enter string: ")
counts = {}
words = string.split()
# print(string)
for word in words:
if str.capitalize(word) in counts:
counts[str.capitalize(word)] += 1
else:
counts[str.capitalize(word)] = 1
... | true |
d90cf9e2a902c2799e38c256fbbb3555f203044b | Python | khushigupta515/contentaggregator | /webscrapingfinal.py | UTF-8 | 3,525 | 2.984375 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
import sqlite3
import schedule
import time
import smtplib, ssl
conn = sqlite3.connect('scraping.db')
global finalstr=""
def scrapequotes():
conn.execute('''CREATE TABLE if not exists tablenew
(counter int,date text)''')
count=0
... | true |
a9ad3e6e260d1689cf6378c257606a1fd67a85fe | Python | financo/learn-ml | /04-kNN/02-kNN-in-scikit-learn/kNN_function/kNN.py | UTF-8 | 1,293 | 2.890625 | 3 | [] | no_license | import numpy as np
from math import sqrt
from collections import Counter
def kNN_classify(k, X_train, y_train, x):
assert 1 <= k <= X_train.shape[0], "k must be valid"
assert X_train.shape[0] == y_train.shape[0], "the size of X_train must equal to the size of y_train"
assert X_train.shape[1] == x.shape[0... | true |
19edfbb154a0a62b5aefc94544372ec3a9a2472b | Python | cyy-hub/InterviewCoding | /cyy_xiecheng_1.py | UTF-8 | 863 | 2.9375 | 3 | [] | no_license | import sys
str1 = sys.stdin.readline().strip()
str2 = sys.stdin.readline().strip()
def find_b(string):
char_dict = {}
for char in string:
if not char_dict.get(char):
char_dict[char] = 1
else:
char_dict[char] += 1
small_num = len(string)+1
for key in char_dict:
... | true |
0f436a7c18600670ab489534e16fa7d7fa09b349 | Python | wkwkgg/atcoder | /abc/problems150/142/c.py | UTF-8 | 184 | 2.828125 | 3 | [] | no_license | N = int(input())
A = list(map(int, input().split()))
xs = []
for i in range(N):
xs.append((i+1, A[i]))
xs = sorted(xs, key=lambda x: x[1])
print(" ".join(str(x[0]) for x in xs))
| true |
95a2b5ab5823c267a7e9e41600da87c8eaffdf62 | Python | 1horstmann/Calculo-Numerico | /main.py | UTF-8 | 1,013 | 3.15625 | 3 | [] | no_license | import classes
# Definição de dados
x = [2.5 ,3.9 ,2.9, 2.4, 2.9, 0.8, 9.1, 0.8, 0.7, 7.9, 1.8, 1.9, 0.8, 6.5, 1.6, 5.8, 1.3, 1.2, 2.7] #Definindo os dados da variável independente
y = [211, 167, 131, 191, 220, 297, 7, 211, 300, 107, 167, 266, 227, 86, 207, 115, 285, 199, 172] #Definindo os dados da variável depende... | true |
9c7891985ca22558d166c96bdbe9884b36ddd039 | Python | hunseok329/programmers | /소수 찾기.py | UTF-8 | 468 | 3 | 3 | [] | no_license | from itertools import permutations
def solution(numbers):
sumP = []
count = 0
for s in range(1, len(numbers)+1):
p = list(permutations(numbers, s))
for num in set(p):
sumP.append(int(''.join(num)))
sumP = set(sumP)
for w in sumP:
if w == 1 or w == 0:
... | true |
8b6f6a40755e49c97a993cd35334d7072a139024 | Python | liyi0206/leetcode-python | /170 two sum III - data structure design.py | UTF-8 | 954 | 4.09375 | 4 | [] | no_license | class TwoSum(object):
# Trade off in this problem should be considered
# if need to add fast, use array to hold numbers
# if need to find fast,use hashmap to hold numbers
def __init__(self):
"""
initialize your data structure here
"""
self.mp={}
def add(self, number)... | true |
70d117ddf2073c55e469ab7eed808662db6e5ad1 | Python | nashtash/python_covid19_nrw | /get_data_rki_ndr_districts.py | UTF-8 | 2,554 | 2.609375 | 3 | [] | no_license | from functools import lru_cache
from io import BytesIO
import requests
import pandas as pd
from utils.storage import upload_dataframe
url = 'https://ndrdata-corona-datastore.storage.googleapis.com/rki_api/current_cases_regions.csv'
@lru_cache
def get_data():
# Download website
response = requests.get(url)
... | true |
10ccb3f85e2814f6f6c75376b259ec518bac1daa | Python | ppitu/Python | /Studia/Cwiczenia/Zestaw4/zadanie2.py | UTF-8 | 756 | 4.15625 | 4 | [] | no_license | #Zadanie 3.5
def rysuj(n):
string = '|' + '....|' * n + '\n'
string += str(0)
for x in range(n):
string += str(x + 1).rjust(5)
return string
print("Zadanie 3.5:")
dlugosc = input('Podaj dlugosc: ')
dlugosc = int(dlugosc)
print(rysuj(dlugosc))
#Zadanie 3.6
def pobierz_liczbe(string):
number = input(string)... | true |
8639ffb6f43df4d6c8a92fb805982a3b1d92fe16 | Python | kelvin926/korea_univ_python_1 | /210516과제/210516_과제.py | UTF-8 | 12,088 | 3.84375 | 4 | [] | no_license | # 2021271424 장현서 - 파이썬 과제 210516 제출. github: @kelvin926
##########################################################################################################
'''
<2번> - 양의 정수 중에서 자신과 1로만 나누어지는 수를 소수라고 한다. N이 주어지면 N보다 작은 소수를 찾는 프로그램을 작성하시오
'''
'''
# 2번 코드
N = int(input("양의 정수 값 N을 입력 : "))
sosu = []
for i in ra... | true |
0b772bee8c68261a45a16c1e6345d0719d474f7f | Python | UsacDmitriy/first | /base_types/useful_operator.py | UTF-8 | 229 | 3.703125 | 4 | [] | no_license | # print(list(range(1,123,3)))
# for i in range(1,123,3):
# print(i)
my_string = 'abfgsde'
for key, letter in enumerate(my_string):
print(str(letter) + " " + str(key))
from random import randint
print(randint(12,123)) | true |
0bd2f22cf2bb0ff3d804c4bb44d2a3be029e6b52 | Python | amey-joshi/am | /optim/or-tools/cp/cryptarithmetic.py | UTF-8 | 1,711 | 3.203125 | 3 | [] | no_license | #!/bin/python
from ortools.sat.python import cp_model
# Is there an assignment of digits to the letter such that the equation
# CP + IS + FUN = TRUE is true?
line = 'CP + IS + FUN = TRUE'
chars = set(c for c in line if c.isalpha())
base = 10 # We are looking at decimals
if len(chars) > base:
print('No assignmen... | true |
93bf07247949ba45904ecc8bd455dc3316f98cd7 | Python | zhongh/ampo-ink | /scripts/read_inks.py | UTF-8 | 3,803 | 2.84375 | 3 | [
"MIT"
] | permissive | __author__ = 'Hao'
import openpyxl
import json
from string import Template
# Initialize the inks list
inks = {
"DI_Water": {
"filepath": "../data/Inkjet Printing Process File Repository/Droplet Ejection/DI Water Ink-A/Fluid Properties-DI Water.xlsx"
},
"Fifty_Glycerol": {
"filepath": "../d... | true |
dc9d0274ab7646eccc4b3ee613918f1d96f4eb0f | Python | bk-anupam/PatientClinicProximityFinderPublic | /src/PatientClinicProximityFinder.py | UTF-8 | 21,299 | 2.734375 | 3 | [] | no_license | import pandas as pd
from geopy.extra.rate_limiter import RateLimiter
from geopy.geocoders import Nominatim
import os.path
from functools import partial
import json
import logging.config
import yaml
import pygtrie
import requests
from retry import retry
from geolib import geohash
from geopy.exc import GeocoderServiceErr... | true |
5cc858373c9fd680456327f7344f6c132c979c3f | Python | langtodu/learn | /algorithm/prime.py | UTF-8 | 1,533 | 2.890625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import numpy as np
class Prim(object):
def __init__(self, graph=None, outset=0):
self.graph = np.array(graph)
self.outset = outset
self.selectd_point = [self.outset]
self.selectd_edge = [[self.outset, self.outset]]
self.all_points = self.graph.shape... | true |
8c4ed9f5961ae0333decc36d25e9d10e11d241ee | Python | MauricioD13/Proyecto1_Codigos | /Python/grafica_procesamiento.py | UTF-8 | 4,459 | 2.828125 | 3 | [] | no_license | import matplotlib.pyplot as plt
import numpy as np
import sys
import math
import statistics
import mplcursors
def graphics(nombres_archivo,separator,number_separator,organization,name,x_label,y_label,samples,axis):
files=[]
legend_names=[]
temp=[]
colors=["g","r","b","c","m"... | true |
ca0f2214145296312a8098fe371e38202bd03ac0 | Python | KujouNozom/LeetCode | /python/2021_01/Question0239.py | UTF-8 | 1,622 | 3.796875 | 4 | [] | no_license | # 239. 滑动窗口最大值
#
# 给你一个整数数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位。
# 返回滑动窗口中的最大值。
#
# 示例 1:
# 输入:nums = [1,3,-1,-3,5,3,6,7], k = 3
# 输出:[3,3,5,5,6,7]
# 解释:
# 滑动窗口的位置 最大值
# --------------- -----
# [1 3 -1] -3 5 3 6 7 3
# 1 [3 -1 -3] 5 3 6 7 ... | true |
7f1552e819abc71af3f1c2b7f923d5f7ea458942 | Python | olisim/eks | /eks/eks.py | UTF-8 | 3,277 | 2.890625 | 3 | [] | no_license | import socket, threading, time
class EKSResponse:
def __init__(self, command, status, payload):
self.command = command
self.status = status
self.payload = payload
def __eq__(self, other):
if other == None:
return False
return self.command == other.command \... | true |
cc8a0817d942735491475dea340e9148e7a55d99 | Python | preintercede/ds-a | /ch1/is_Unique.py | UTF-8 | 542 | 3.390625 | 3 | [] | no_license | # def isUnique(string):
# letters = {}
# for letter in string:
# if letter in letters:
# return False
# letters[letter] = True
# return True
def isUnique(string):
letters = {}
for letter in string:
if letter in letters:
return False
letters[l... | true |
1dfb960ce024c875fb45d3596a3c5df12850b5ab | Python | yo-han/HandleBar | /lib/guessit/language.py | UTF-8 | 13,698 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | true |
42f8b8f56618f8f70dd04ab2b4e822a904acf812 | Python | ashwins-code/neural-network-library | /framework/tensor.py | UTF-8 | 5,661 | 3.0625 | 3 | [] | no_license | import numpy as np
class Tensor(object):
"""Tensor class"""
def __init__(self, value):
self.value = np.array(value)
if self.value.ndim < 2:
while self.value.ndim < 2:
self.value = np.expand_dims(self.value, axis=0)
self.parents = []
self.backward =... | true |
dfac8853b44f5073a714f67b0931627b13570974 | Python | verzep/MLDS | /tools.py | UTF-8 | 1,653 | 3.421875 | 3 | [] | no_license | import numpy as np
def _MFNN_t(X, Y, n):
'''
Compute the Mutual False Nearest Neighbors for time intex n.
The data should be given as matrices where the first dimension is time s.t X[t] is a point in space.
:param X: A matrix with dimension (time_steps, X_space_dimension)
:param Y: A matrix with... | true |
bab4728695e18fb72cb3e9006dcad6dd210be7db | Python | maizijun/study | /leetcode/#461 hanming-dis.py | UTF-8 | 319 | 3.265625 | 3 | [] | no_license | class Solution:
def hammingDistance(self, x, y):
## &是按位且逻辑运算符
## |是按位或逻辑运算符
## ^是按位异或逻辑运算符
return bin(x^y)[2:].count('1')
# print(list(bin(11))[2:],list(bin(31))[2:])
a = Solution()
print(a.hammingDistance(11,14)) | true |
14b51fc25473660a4799ee07e23f31594db29358 | Python | Divisekara/Python-Codes-First-sem | /Project Euler Problems/03/project euler 3(This is my method).py | ISO-8859-3 | 5,661 | 4 | 4 | [] | no_license | # -*- coding: cp1252 -*-
"""
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
"""
x=600851475143
i=2
while x!=1:
while x%i==0:
x=x/i
print i,' and ' , x
i=i+1
print 'The biggest prime factor is' ,i-1
"""
The answer is 6857
"""
... | true |
6ae18b6337ef835d0e12be8aed60c28ca20ce9f6 | Python | eryilmazysf/assignments- | /odev.py | UTF-8 | 223 | 2.71875 | 3 | [] | no_license | x="ProgramlamaÖdeviİleriSeviyeVeriYapılarıveObjeleripynb"
f=dict()
for karakter in x:
if (karakter in f):
f[karakter]+=1
else:
f[karakter]=1
for i,j in f.items():
print (i,":",j )
| true |
3df815dd1ce62f4dec3d91101fcce3f5925bb3d3 | Python | OmarMWarraich/Assignments | /05-Days_Between_Date.py | UTF-8 | 416 | 4.0625 | 4 | [] | no_license | # Ai Assignment 05 - calculate number of days between two dates
import datetime
date1 = input("Enter First Date [DD/MM/YYYY] : ")
date2 = input("Enter Second Date [DD/MM/YYYY] : ")
d1, m1, y1 = map(int, date1.split('/'))
d2, m2, y2 = map(int, date2.split('/'))
date1 = datetime.date(y1, m1, d1)
date2 = datetime.... | true |
453f3ce9dfa7aa5cdb50893082c007684ad768ec | Python | TPiazza21/Thesis | /linreg.py | UTF-8 | 687 | 3.078125 | 3 | [] | no_license | # for vanilla linear regression. This is the nonprivate version
import numpy as np
def linreg(X,y,epsilon,delta):
[n,d] = X.shape
XTy = X.T.dot(y)
# identity matrix added for numerical stability --> WHICH CHANGES IT TO RIDGE WITH LAMBDA=1
XTX = (X.T).dot(X) + np.eye(d)
theta_hat = np.linalg.inv(XT... | true |
6845144bc64a215fb56d00d1634f521636ba3a90 | Python | macabeus/IA | /MINIMAX/TicTacToe.py | UTF-8 | 6,562 | 3.390625 | 3 | [] | no_license | import numpy as np
import copy
class AIplayer:
def __init__(self, board, my_mark, opponent_mark):
self.board = board
class MinMaxPlay(AIplayer):
def __init__(self, board, my_mark, opponent_mark):
super(MinMaxPlay, self).__init__(board, my_mark, opponent_mark)
self.my_mark = my_mark
... | true |
3e5b9ff16ca688047db0973d5022bf5f56b3c9bb | Python | Guiller1999/CursoPython | /BBDD/Prueba.py | UTF-8 | 1,813 | 3.578125 | 4 | [] | no_license | import sqlite3
def create_connection():
try:
connection = sqlite3.connect("Test.db")
return connection
except Exception as e:
print(e.__str__())
def create_table(connection, cursor):
cursor = connection.cursor()
cursor.execute(
"CREATE TABLE IF NOT EXISTS USUARIOS" +... | true |
56531a6da673657546d71bd35c0c91c9a7cc6a39 | Python | deadiladefiatri/Deadila-Defiatri_I0320023_Aditya-Mahendra_Tugas5 | /I0320023_Deadila Defiatri_Soal2.py | UTF-8 | 664 | 3.6875 | 4 | [] | no_license | #Grading Nilai
Nama = str(input('Nama Lengkap : '))
Nilai = int(input('Nilai Anda skala 1-100: '))
info = 'Halo ' + Nama + '!' + ' Nilai anda setelah dikonversi adalah '
#memeriksa nilai
if Nilai <= 100 and Nilai >= 85:
print(info + 'A')
elif Nilai <= 84 and Nilai >= 80:
print(info + 'A-')
elif Nilai <=79 an... | true |
031478efa49a6b7e2311da9f24d23bcbb3f0bdf7 | Python | reon/SmartCardDecoder | /t1ApduDecoder.py | UTF-8 | 5,278 | 2.625 | 3 | [] | no_license | ##########################################################
# t1ApduDecoder.py
# Author : Bondhan Novandy
# Date : 15-16 May 2011
#
# License : Creative Commons Attribution-ShareAlike 3.0 Unported License.
# http://creativecommons.org/licenses/by-sa/3.0/
# Publish : http://bondhan.web.id (For education purpos... | true |
4f9510c7c5d00bd358bf0080f0675ba0f88658fc | Python | lazaropd/ai-residency | /Módulo 2 - Data Analysis/Curso 5 - Classificação/analise_residuos.py | UTF-8 | 2,642 | 3.140625 | 3 | [] | no_license | import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
from sklearn.metrics import r2_score
def calc_rss(residuo):
return float(((residuo) ** 2).sum())
def calc_r2(y, y_hat):
return r2_score(y_hat, y)
def analise_residuos(y, y_hat, graph=False):
"""sendo conh... | true |
081b1cd807565906c2400487a95edec7a15225dc | Python | YoungBear/LearningNotesYsx | /python/code/collections_learn.py | UTF-8 | 844 | 3.578125 | 4 | [] | no_license | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
from collections import namedtuple
# namedtuple
Point = namedtuple('Poine', ['x', 'y'])
p = Point(1, 2)
print(p.x)
print(p.y)
print(isinstance(p, Point))
print(isinstance(p, tuple))
# deque 双向列表
from collections import deque
q = deque(['a', 'b', 'c'])
q.append('x')
q.a... | true |
d76a972aa48d071093e9efc1b8f35951b98d3864 | Python | vipinvkmenon/canddatastructures_python | /chapter11/example3.py | UTF-8 | 167 | 3.671875 | 4 | [] | no_license | #Chapter 11.3
#Register Variables
def main():
i = 0
for i in range(2):
print("Value of i is " + str(i))
main() # Main function entry
| true |
b0bae682bdda8b4bbbdf052d0f0542eaaf2da794 | Python | apatel16/Deep_Learning_Projects | /Neural_Style_Transfer.py | UTF-8 | 6,267 | 2.65625 | 3 | [] | no_license |
import numpy as np
from keras.preprocessing.image import load_img, img_to_array
from keras.applications import vgg19
from keras.preprocessing import image
#from google.colab import files
#uploaded = files.upload()
target_image_path = 'portrait.jpg'
style_reference_image_path = 'transfer_style_reference.jpg'
width,... | true |
24e040f1ff8a9db830ed8f00f2615fba21dae4e3 | Python | Stark101001/Snake-Game | /game_py.py | UTF-8 | 4,319 | 3.421875 | 3 | [] | no_license | import pygame
import random
pygame.init()
# =======Color Codes======
black = (0, 0, 0)
white = (255, 255, 255)
red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
# ========Title==========
title = "Snake Game"
pygame.display.set_caption(title)
#============Adding Game Icon=========
gameIcon = pygame.image.load... | true |
721ae487dc8476085bde8a3bd5c8fe5bfc170cfd | Python | vbloise3/cleanJson | /KinesisClient.py | UTF-8 | 1,612 | 2.671875 | 3 | [] | no_license | import boto3
import json
import time
# define your stream name
kpl_stream = 'kinesis-kpl-demo2'
# create the Kinesis service reference for your region
kinesis_client = boto3.client('kinesis', region_name='us-west-2')
# get the description of your Kinesis Data Stream
response = kinesis_client.describe_stream(StreamNa... | true |
5ef286e16d65714f66510eacc7bed4253c55381e | Python | pmackenz/PyPCFD | /src/Main.py | UTF-8 | 3,068 | 2.515625 | 3 | [] | no_license | '''
Created on Nov 21, 2015
@author: pmackenz
'''
from Domain import *
import subprocess
import ButcherTableau as integrator
from math import floor
from Mappings import *
def Main():
# defne the Reynolds number
Re = 1000
Re = 1
# set sliding velocity
velocity = 1.0
# mass density of... | true |
7eae5de424681c8c4b850d7e0701f5978ca3a2b4 | Python | komalupatil/Leetcode_Solutions | /Easy/Average Salary Excluding the Minimum and Maximum Salary.py | UTF-8 | 640 | 4.46875 | 4 | [] | no_license | #Leetcode 1491. Average Salary Excluding the Minimum and Maximum Salary
class Solution1:
def average(self, salary: List[int]) -> float:
salary.sort()
total = 0
for i in range(1, len(salary)-1):
total += salary[i]
return total/(len(salary)-2)
class Solution2:
... | true |
ddacfab2e966ad2ef562f9aeb783192c145f3e44 | Python | goohooh/fastcampus_wps1 | /KimHanwool/5th_week_Algorithm/1373.py | UTF-8 | 524 | 3.71875 | 4 | [] | no_license | """
2진수 8진수
문제집
시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 2448 742 569 36.662%
문제
2진수가 주어졌을 때, 8진수로 변환하는 프로그램을 작성하시오.
입력
첫째 줄에 2진수가 주어진다. 주어지는 수의 길이는 1,000,000을 넘지 않는다.
출력
첫째 줄에 주어진 수를 8진수로 변환하여 출력한다.
예제 입력 복사
11001100
예제 출력 복사
314
"""
n = input()
n1 = int(n, 2)
print(oct(n1)[2:]) | true |
fc784517da0e3d8e19e53cc7c19890c52a0765f8 | Python | Anirud2002/flappybird | /game.py | UTF-8 | 4,225 | 2.84375 | 3 | [] | no_license | import pygame, random
pygame.init()
pygame.display.set_caption("Flappy Bird - Anirud")
pygame.display.set_icon(pygame.image.load("assets/bluebird-midflap.png"))
game_font = pygame.font.Font("04B_19.TTF", 30)
score = 0
high_score = 0
screen = pygame.display.set_mode((376, 624))
clock = pygame.time.Clock()
... | true |
68e08f904a2de45b90dab3de7f13d65a64f9708b | Python | AakashOfficial/ChallengeTests | /challenge_23/python/slandau3/BTtoLLs.py | UTF-8 | 2,462 | 4.125 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import random
from collections import deque
"""
Given a binary tree, design an algorithm which creates a linked list of all the nodes at
each depth (e.g., if you have a tree with depth D,you'll have D linked lists).
"""
class Node:
def __init__(self, data, left=None, right=None):
se... | true |
03a0633453d3d803ab304b9c5ede2046edafa661 | Python | jwyx3/practices | /leetcode/binary-search/bs-answer/arranging-coins.py | UTF-8 | 553 | 3.25 | 3 | [] | no_license | # 二分答案看是否能找到总数<n的最大答案
class Solution(object):
def arrangeCoins(self, n):
"""
:type n: int
:rtype: int
"""
start, end = 0, n
while start + 1 < end:
mid = (start + end) / 2
total = self.get_total(mid)
if total <= n:
st... | true |
52ebd873eb6120b7d2bc5a1050d94b4343524353 | Python | keltecc/ructf-2019-olymp-quals | /tasks/forensics-300/decoder.py | UTF-8 | 819 | 3.28125 | 3 | [] | no_license | #!/usr/bin/python3
import sys
from PIL import Image
def sum_pixels(img, x, y, area):
result = 0
for dx in range(area):
for dy in range(area):
result += img.getpixel((x + dx, y + dy))
return result // 255
def decode_image(img):
area = 2
correct = [0, area ** 2]
result = ... | true |
09a82fb190ee3bdcfeb9d2ee3a43273f50e0e60b | Python | BoobooWei/python-cx_Oracle | /samples/tutorial/solutions/soda.py | UTF-8 | 1,538 | 2.65625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | #------------------------------------------------------------------------------
# soda.py (Section 11.2)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Copyright (c) 2019, Oracle and/or its affiliates. Al... | true |
b9f6ca8c3db77fd61971d2aec34f78f8ae200818 | Python | franklingg/LittleGames | /JotunsPath/Content/Assets.py | UTF-8 | 1,407 | 2.546875 | 3 | [] | no_license | import pygame.font
import pygame.image
from Content import Path
class Color(object):
black = (0, 0, 0)
light_black = (50, 51, 51)
light_grey = (153, 150, 165)
pearl = (208, 240, 192)
sky_blue = (93, 142, 193)
dark_blue = (24, 48, 100)
light_green = (140, 204, 76)
jade = (0, 168, 107)
... | true |
23a966f9a2beb45c9c296f71a391110f8b9e1140 | Python | anthonyozerov/log | /code.py | UTF-8 | 9,897 | 2.515625 | 3 | [] | no_license | #imports
from datetime import date, timedelta, datetime
from dateutil.parser import parse
import sys
from netCDF4 import Dataset
from ftplib import FTP
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches #used to create legends in plots
from mpl_toolkits.basem... | true |
ee77e0d077296be4710a32a4558f8e4d87991f23 | Python | tlcs11/Gold_Challenge | /ch4/komodo_insurance.py | UTF-8 | 786 | 3.28125 | 3 | [] | no_license | badges = {} #string for a key and empty list for input
while True:
print("1 to make badge",
"3 to print all badges", "2 to edit a badge")
op = input("> ")
if op == "1":
b_id = int(input("enter en id:"))
add_door = input("Add a door to badge Y ... | true |
4c75e8100a6ecc25dd3acfb6ecb6c9d429bcf011 | Python | rjmarshall17/trees | /hacker_rank_height_of_a_binary_tree.py | UTF-8 | 3,919 | 4.0625 | 4 | [] | no_license | #!/usr/bin/env python3
import os
"""
The height of a binary tree is the number of edges between the tree's root and its furthest leaf.
For example, the following binary tree is of height 2:
4
/ \
/ \
2 6
/ \ / \
1 3 5 ... | true |
211db5bf8a870187431457805d2d7be898a47a5f | Python | jiyatu/dropoutconnect | /utils.py | UTF-8 | 12,042 | 3.296875 | 3 | [] | no_license | """
Source Code for Homework 3 of ECBM E6040, Spring 2016, Columbia University
This code contains implementation of several utility funtions for the homework.
Instructor: Prof. Aurel A. Lazar
This code is based on
[1] http://deeplearning.net/tutorial/logreg.html
"""
import os
import sys
import numpy
import scipy.io
... | true |
a36eb95ef4dc832403fc94c9aad907b04bbc2721 | Python | fmidev/stac-builder | /stac_builder/catalog_builder.py | UTF-8 | 13,541 | 2.875 | 3 | [] | no_license | import json
import os
from dateutil import rrule
from datetime import datetime, timedelta
from calendar import monthrange
from dateutil.relativedelta import relativedelta
import copy
import helpers as h # import help functions from helpers.py
def dataset_collection_builder(conf):
'''
Function reads items of... | true |
1c98bfe8a8634a3f40d67dda486ed1628373065b | Python | andrejmoltok/13d_rendszeruz_2020 | /szotarak.py | UTF-8 | 1,540 | 3.625 | 4 | [] | no_license | import random as rnd
#Szótár adatszerkezet
# A szótár adatszerkezet kulcs-érték párokat tárol. A kulcs csak egyszer szerepelhet a szótárban.
magassagok={}
# Értékek megadása
magassagok['Zoltán']=175
magassagok['Imre']=188
magassagok['Ágnes']=171
magassagok['Jolán']=166
#Hozzáférés egy értékhez
print(magassagok['Zoltá... | true |
88e9c9243dc3a940bcd183e7e07b9986e9d999af | Python | sinnuswong/learnpy | /su.py | UTF-8 | 268 | 3.515625 | 4 | [] | no_license | from math import sqrt
def f(a):
n=int(a**0.5)
for i in range(2,n+1):
if a%i==0:return False
else:return True
a=int(input("please input a:"))
for i in range(2,a):
if f(i):
print(i,end=' ')
| true |
61c25c44871a6bf8599ec788d2480f8eb54ab293 | Python | net-lisias-ksph/KerbinSideGAP | /geometry.py | UTF-8 | 4,978 | 3.3125 | 3 | [] | no_license | from math import sqrt, sin, cos, tan, asin, acos, pi
KERBIN_RADIUS = 600.0
MAX_ROUTE_STEP = 25.0
class Vector(object):
DIMENSION_ERROR = 'Can not combine Vectors with different dimensions'
@classmethod
def cross(cls, fst, sec):
assert len(fst) == len(sec), Vector.DIMENSION_ERROR
if len(f... | true |
fbed05440f6898ee3ce6d121bda76df0a3644d45 | Python | RsTaK/password-manager | /python/interaction.py | UTF-8 | 1,424 | 2.84375 | 3 | [
"MIT"
] | permissive | import backend_logic
print('='*30)
print('Welcome to this Password Manager')
if input('Type 1 to continue'):
pass_manager_obj = backend_logic.pass_manager('pass_manager.db')
print('='*30)
print('These are the options available')
print('st -> Store Password')
print('ge -> Get Password')
print('vw -> View Re... | true |
37ab6a660b6870ac76437d36aab77ea98e7982d7 | Python | zanghu/gitbook_notebook | /assets/code/python_code/python_md5/cal_md5.py | UTF-8 | 853 | 3.109375 | 3 | [
"MIT"
] | permissive | import hashlib
def md5_by_line(pth):
""""""
m = hashlib.md5()
with open(file_path,'rb') as f: #以二进制读的方式打开文件
for line in f: #每次传入一"行"
m.update(line) #md5值更新
md5_value = m.hexdigest() #进制转化
print(md5_value)
def md5_by_chunk(fi... | true |
16f0d3815bfeba90a3c9b16750c6669d07cc3b63 | Python | nanthony21/PWSCalibrationSuite | /src/pws_calibration_suite/application/_ui/scorevisualizer.py | UTF-8 | 4,122 | 2.53125 | 3 | [] | no_license | from PyQt5 import QtCore
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QWidget, QGridLayout, QFormLayout, QDoubleSpinBox, QSlider
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib.backends.backend_qt5 import NavigationToolbar2QT
from matplotlib.backends.backend_qt5agg ... | true |
1bf8cc44e7f21e7a35602d49821e479de982099c | Python | jumbokh/MCSH-Class | /Python-src/connect.py | UTF-8 | 394 | 2.546875 | 3 | [] | no_license | import network
import time
import ubinascii
SSID='CHT-10-5'
KEY='0953313123'
sta = network.WLAN(network.STA_IF)
print(sta.active(True))
print(sta.active())
sta.connect(SSID,KEY)
mac = ubinascii.hexlify(sta.config('mac'),':').decode()
print(mac)
print(sta.ifconfig())
print(sta.isconnected())
for i in range(20):
tim... | true |
48279d1deed992e09e67174f7130470009d821db | Python | shredderzwj/NLP-work-commit | /lesson01/waduanzi/waduanzi/spiders/duanzi.py | UTF-8 | 2,285 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import scrapy
from waduanzi.items import WaduanziItem
from urllib.parse import urlparse
class DuanziSpider(scrapy.Spider):
name = 'duanzi'
allowed_domains = ['www.waduanzi.com']
start_urls = [
'http://www.waduanzi.com/joke/page/1',
'http://www.waduanzi.co... | true |
3d56e16b2b949c62182caa88e1a47645b8c89714 | Python | andreydymko/Yandex-song-title-to-file | /sources/nativeApp/Get_Song_Title_To_File.py | UTF-8 | 3,772 | 2.515625 | 3 | [] | no_license | #!/usr/bin/env python
import sys
import json
import struct
import os
import sys
import logging
import unicodedata
logging.basicConfig(filename=os.path.dirname(os.path.realpath(sys.argv[0])) + "\latest_error.txt",
level=logging.DEBUG,
format='%(asctime)s, %(levelname)-8s [%(file... | true |
599f8e86baf4334711acf7498ed693bc0da8932d | Python | kalkidan999/AirBnB_clone | /tests/test_models/test_user.py | UTF-8 | 837 | 2.53125 | 3 | [] | no_license | #!/usr/bin/python3
"""Test User"""
import unittest
from models.base_model import BaseModel
from models.city import City
from models.place import Place
from models.amenity import Amenity
from models.state import State
from models.review import Review
from models.user import User
class Testuser(unittest.TestCase):
... | true |
52a13fc816e63739dc3be544d7f04f321ba72191 | Python | LvXueshuai/Python1 | /1.py | UTF-8 | 103 | 3 | 3 | [] | no_license | import hashlib
obj = hashlib.md5()
obj.update("hello".encode("utf8"))
print(obj.hexdigest())
| true |
47ef1b2789a22ae49370aeaadae20dd24f8ae11e | Python | iisdd/Courses | /python_fishc/35.0.py | UTF-8 | 834 | 3.09375 | 3 | [
"MIT"
] | permissive | import easygui as g
import sys
while 1:
g.msgbox("嗨,欢迎进入第一个界面小游戏^_^")
msg ="请问你希望在鱼C工作室学习到什么知识呢?"
title = "小游戏互动"
choices = ["谈恋爱", "编程", "OOXX", "琴棋书画"]
choice = g.choicebox(msg, title, choices)
# 注意,msgbox的参数是一个字符串
# 如果用户选择Cancel,该函数返回No... | true |
4298c8440889801d92b55a59bdf9b3fc9fe5a34b | Python | rajatmann100/rosalind-bioinformatics-stronghold | /p9-long.py | UTF-8 | 360 | 2.953125 | 3 | [] | no_license | ########## BASE FASTA CODE - START ##########
from lib.FastaReader import FASTA
file = open("./data/data.txt", "r")
input_str = file.read()
gene_arr = input_str.split(">")
gene_arr = gene_arr[1:]
########## BASE FASTA CODE - END ##########
def processDNA(c, dna):
print(c, dna)
for g in gene_arr:
fs = FASTA... | true |
4f519d52864a0277db94c8743ddcd63e17cc0d27 | Python | arnoldliaoILMN/LaunchSpace | /bin/Tracker.py | UTF-8 | 4,070 | 2.609375 | 3 | [] | no_license | """
Tracks the status of apps. Designed to be run on a cron, but can be run manually for debugging purposes.
"""
import os
import sys
import logging
from collections import defaultdict
# Add relative path libraries
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.abspath(os.path.sep.joi... | true |
ce1a80431fdddd39527aeb86b43117bd894135aa | Python | fsoubelet/PyhDToolkit | /pyhdtoolkit/cpymadtools/coupling.py | UTF-8 | 14,126 | 2.53125 | 3 | [
"MIT"
] | permissive | """
.. _cpymadtools-coupling:
Betatron Coupling Utilities
---------------------------
Module with functions to perform ``MAD-X`` actions through a `~cpymad.madx.Madx` object, that
retate to betatron coupling in the machine.
"""
from typing import Dict, Sequence, Tuple
import numpy as np
import tfs
from cpymad.madx... | true |
0d42135d9faa594df5a3ce416cac23db310555ac | Python | des-learning/struktur-data | /src/06/test_slice.py | UTF-8 | 1,591 | 3.65625 | 4 | [] | no_license | import unittest
from doublylinkedlist import DoublyLinkedList
def reduce(function, iterable, start):
result = start
for i in iterable:
result = function(result, i)
return result
def equalList(list1, list2):
pairs = zip(list1, list2)
sameItem = lambda x, y: x and (y[0] == y[1])
return (... | true |
cc2a5515dc53319c287948841ed71a96fa07b353 | Python | Johnny-kiv/Python | /напоминальщик/time 3.py | UTF-8 | 1,467 | 3.34375 | 3 | [] | no_license | #Это напоминальщик
#версия 2
#Автор: johnny-kiv
#Подключаем модули tkinter, time и дополнительный модуль messagebox
from tkinter import*
from tkinter import messagebox
import time
root=Tk()
#Подключаем виджет Canvas
c=Canvas(root,bg="grey",width=800,height=600)
c.pack()
a2=IntVar()
b2=IntVar()
c2=IntVar()
def beg... | true |