blob_id large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|
3a879d5482094587df2b983f89b7014aff425214 | gr2y/leetcode | /youtube/26_merge_binary_trees.py | UTF-8 | 578 | 3.5625 | 4 | [] | no_license | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def mergeTrees(self, node1: Optional[TreeNode], node2: Optional[TreeNode]) -> Optional[TreeNode]:
if... | true |
2dd93e3402118f5d1ff8fa691016a3de01e80db1 | Standing93/STD | /get_1.py | UTF-8 | 1,445 | 2.578125 | 3 | [] | no_license | import os
from locust import TaskSet,HttpUser,task,between
# 任务类-继承任务类
class MyGetTask(TaskSet):
def on_start(self):
print('start in task============')
def on_stop(self):
print('stop in task=============')
# 类属性
url = '/pinter/com/getSku'
# 具体的任务,需要加装饰器
@task
def get_test... | true |
4ca06623ad35b1bc3d96be27df1f094b067e40eb | jopaul23/WeatherData | /MaxFinder.py | UTF-8 | 2,271 | 3.390625 | 3 | [] | no_license |
import os
import pandas as pd
def list_to_date(date_list):
date_name = "{}/{}".format(date_list[0],date_list[1])
return date_name
if __name__ =="__main__":
starting_year = 1990
ending_year = 2021
filename = "./Weather.csv"
df = pd.read_csv (filename)
final_list = [{"Date":[1,1990],... | true |
fcd325a6a1eaec28697e98e892b3ba837ec70609 | ymihaylov/python-tasks | /tasks/01_2015_astrological_fun/solution.py | UTF-8 | 888 | 2.765625 | 3 | [] | no_license | WESTERN_SIGNS = [
('aquarius', 21, 1),
('pisces', 19, 2),
('aries', 21, 3),
('taurus', 21, 4),
('gemini', 21, 5),
('cancer', 21, 6),
('leo', 23, 7),
('virgo', 23, 8),
('libra', 23, 9),
('scorpio', 23, 10),
('sagittarius', 22, 11),
('capricorn', 22, 12),
]
CHINESE_SIGNS =... | true |
b897a8bcc1218f031e69928b535272fdf9bee57c | purusoth-lw/my-work | /2.input function.py | UTF-8 | 765 | 4.25 | 4 | [] | no_license | '''
ex1:
===
a=10
b=10
c=a+b
print(c)
ex2:
===
v1=input()
print("v1 : ",v1)
ex3:string
=======
n1="Elakkiya "
n2="N"
n=n1+n2
print(n)
ex4:
====
v1=input("Enter value 1 : ")
v2=input("Enter value 2 : ")
#c=v1+v2
print("type v1 : ",type(v1))
print("type v2 : ",type(v2))
a=int(v1)
b=int(v2)
... | true |
1400c61055ff90c833ed869f24d8c5a80d1d5f51 | lildauni/python_labs | /lab4/z12.py | UTF-8 | 387 | 3.46875 | 3 | [] | no_license | l = []
def prompt(i = 1):
number = int(input('Введите число, которое нужно вывести, если хотите прекратить, то введите ноль '))
if(number == 0):
return
if(i % 2 != 0):
l.append(number)
return prompt(i + 1)
def print_sequence():
prompt()
for num in l:
print(num, end=" ")
l.clear()
print_sequenc... | true |
acd31712fff41260cd1a525d19b88e3cda63f641 | manan45/leadmart_api | /app/api/resources/users.py | UTF-8 | 651 | 2.515625 | 3 | [] | no_license | from flask_login import login_required, current_user
from app.api.repositories import AdminRepository
from flask_restful import Resource
from werkzeug.exceptions import BadRequest
from app.api.adapters.OutputAdapters import UserOutputAdapter
class Users(Resource):
@login_required
def get(self, type):
... | true |
2a594bbf6326254b82b56cf7b78bb7597a29b94f | flixx/openapi-core | /openapi_core/schema/parameters/generators.py | UTF-8 | 997 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | """OpenAPI core parameters generators module"""
from six import iteritems
from openapi_core.compat import lru_cache
from openapi_core.schema.parameters.factories import ParameterFactory
class ParametersGenerator(object):
def __init__(self, dereferencer, schemas_registry):
self.dereferencer = dereference... | true |
2b83b98b7901b5a8039444f3cf5c149fc8bc66c4 | MPIfR-BDG/katcp-monitor | /katcp_monitor/test_exporter.py | UTF-8 | 2,514 | 2.578125 | 3 | [
"MIT"
] | permissive | import signal
import logging
import tornado
from tornado.gen import coroutine
from argparse import ArgumentParser
from sidecar import KatcpSidecar
log = logging.getLogger("test-exporter")
class TestExporter(object):
"""
An exporter for converting KATCP sensor updates to
"""
def __init__(self, valid_... | true |
c028a18853d1e91a094fc76f3afdc42d0a31eedc | MiroK/lega | /sandbox/bendpy/sine_ddu/biharmonic_1d.py | UTF-8 | 3,309 | 2.984375 | 3 | [
"MIT"
] | permissive | #
# Solve u```` = f in (0, pi)
# with u(0) = u(pi) = 0 [1]
# u``(0) = u``(pi) = 0
#
from __future__ import division
from sympy import Symbol, integrate
from lega.sine_basis import bending_matrix, load_vector
from lega.sine_basis import sine_eval, sine_fft
import scipy.sparse.linalg as la
from math import pi a... | true |
6d4ce6410aed24c2c30089a392be9085cdd0c714 | Scherflinge/TuneFinder_PythonFiles | /ConvertMidiToFeatures.py | UTF-8 | 5,951 | 2.6875 | 3 | [] | no_license | import time
from sklearn import preprocessing
import numpy as np
import math
import os
import json
from .FileManagement import listAllFiles
import shutil
from itertools import product
import progressbar
from .utils import (MidiEvent, convertMidiToEvents, convertEventsToMidi)
from .miditoimage import cleanMidi
def tim... | true |
06a900e0dd3cab495e064f53a319d2dc87b76ce6 | munichpavel/fake-data-for-learning | /tests/test_bayesian_node_rv.py | UTF-8 | 5,218 | 2.84375 | 3 | [
"MIT"
] | permissive | """Tests for `fake_data_for_learning` package."""
import pytest
import numpy as np
from sklearn.preprocessing import LabelEncoder
from fake_data_for_learning.fake_data_for_learning import (
BayesianNodeRV, SampleValue
)
# (Conditional) probability distributions
@pytest.fixture
def binary_pt():
return np.arr... | true |
d5640bbd58a16215e58cff8ce9507011b6adc991 | miannelli/RTTProbe | /server.py | UTF-8 | 1,472 | 3.0625 | 3 | [] | no_license | import socket
import pickle
# import random # used to simulate packet loss and transmission delay
# import time # used to simulate transmission delay
address = "127.0.0.1"
port = 31337
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def send_acknowledgement(client, sequence_number):
""" Sends ... | true |
076bbcf40cb4e92ad1b3882e760b21c5e05a44dc | orangeZC/Count_words | /docx_read.py | UTF-8 | 1,476 | 2.8125 | 3 | [] | no_license | import docx
import os
def read_docx(path, goal_path):
file = docx.Document(path) # Document对象
paragraphs = file.paragraphs # 段落对象
with open('%s' % goal_path, 'a', encoding='utf-8') as f:
for para in paragraphs:
para_text = para.text
f.write(para_text)
if __name__ == '... | true |
1a1aa69ecf5942798a809ed06955c3846e4dcdc3 | zainllw0w/skillbox | /lessons17/HomeWork/task4.py | UTF-8 | 239 | 3.359375 | 3 | [
"MIT"
] | permissive | alphabet = 'abcdefg'
print(alphabet[:])
print(alphabet[::-1])
print(alphabet[0::2])
print(alphabet[1::2])
print(alphabet[:1])
print(alphabet[-1:-2:-1])
print(alphabet[3:4])
print(alphabet[-3:])
print(alphabet[3:5])
print(alphabet[4:2:-1]) | true |
f1329d5fcd23d5426b74b882ef6f03e2be8f10d0 | luigi-borriello00/Metodi_SIUMerici | /interpolazione_polinomiale/Ess/ese8.py | UTF-8 | 956 | 2.921875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
ese9
"""
import numpy as np
import interpolL as fz
import math
def zeri_Cheb(a,b,n):
t1=(a+b)/2
t2=(b-a)/2
x=np.zeros((n+1,))
for k in range(n+1):
x[k]=t1+t2*np.cos(((2*k+1)/(2*(n+1))*math.pi))
return x
#calcolo della costante di lebesgue in ... | true |
2e5d789469638acc6276823b5ee2cdc4edb4dffc | crizzy9/Algos | /interview_qs/candy_crush_1d.py | UTF-8 | 1,562 | 3.859375 | 4 | [] | no_license | # Bloomberg interview qs
# ccaabbbacd -> d
class Solution:
def candy_crush(self, line):
stack = []
i = 0
while i < len(line):
print("i={}, stack={}, line[i]={}".format(i, stack, line[i]))
if len(stack)!=0:
if line[i] == stack[-1]:
... | true |
3ff6cc5f908bcfa359569ff56d63e575739262c1 | BbekShr/tax-calculator | /tax_calculator.py | UTF-8 | 218 | 3.796875 | 4 | [] | no_license | income = float(input("Enter the annual income: "))
if income <= 85528:
tax = (income * 0.18) - 556.02
else:
tax = ((income-85528) * 0.32) + 14839.02
tax = round(tax, 0)
print("The tax is:", tax, "thalers")
| true |
9858fd445c85567ecf847d7f0e371d163c40dbe0 | LenKIM/Show-me-the-data-science | /00.Python/[udemy]numpy/basic.py | UTF-8 | 74 | 2.6875 | 3 | [
"MIT"
] | permissive | import numpy as np
a = np.arange(15).reshape(3,5)
print(a)
print(a.shape) | true |
454ffb9ee460b62c5aa6a53327ee9e2ac9b1f340 | kali666-6/holbertonschool-higher_level_programming | /0x07-python-test_driven_development/4-print_square.py | UTF-8 | 565 | 4.21875 | 4 | [] | no_license | #!/usr/bin/python3
'''
The 4-print_square module
This module has a funciton that prints a square
'''
def print_square(size):
'''
The function that prints a square with the character #
'''
if isinstance(size, float) is True and size < 0:
raise TypeError('size must be an integer')
if isinst... | true |
aa1829a8a10e7d3680e60c5474b1e1efaeb76b83 | rasoolims/mmid_explore | /download_html_from_wiki_list.py | UTF-8 | 2,455 | 2.65625 | 3 | [] | no_license | import datetime
import errno
import os
import signal
import sys
import time
import urllib.parse as urlparse
import urllib.request
from functools import wraps
class TimeoutError(Exception):
pass
def timeout(seconds=10, error_message=os.strerror(errno.ETIME)):
def decorator(func):
def _handle_timeout(... | true |
e192dfbcaa250e2778e6b3b2efa5b646be058799 | Srinidi-V/Bioinformatics---Basic-Algos | /greedy-motif-search/gmf.py | UTF-8 | 2,403 | 2.796875 | 3 | [] | no_license | def Count(Motifs):
count = {} # initializing the count dictionary
k = len(Motifs[0])
for symbol in "ACGT":
count[symbol] = []
for j in range(k):
count[symbol].append(0)
t = len(Motifs)
for i in range(t):
for j in range(k):
symbol = Motifs[i][j]
... | true |
98e592aeb82aaa225ff2ee6881a2d7f5ee02246d | abhisek08/Python-data-types-String- | /round to 2.py | UTF-8 | 221 | 4.09375 | 4 | [] | no_license | '''
Write a Python program to print the following floating numbers upto 2 decimal places.
'''
def float_num(a,b,c):
print(round(a,2))
print(round(b,2))
print(round(c,2))
float_num(4.2341334,3.231313,3.993123) | true |
5f51d654657335e40646304b585ce348164da11f | lixinqi/code_film | /dgl_graph.py | UTF-8 | 434 | 3.265625 | 3 | [] | no_license | # 图卷积dgl库api之dgl.graph
import dgl
import torch
u = torch.tensor([0, 0, 0, 1]) # 每条边起点列表
v = torch.tensor([1, 2, 3, 3]) # 每条边终点列表
g = dgl.graph((u, v)) # 构建一个图,dgl.graph接受一个tuple,里边放起点列表张量和终点列表张量
g # 查看图概况
g.adjacency_matrix() # 查看图的邻接关系
# 可以看到有如下几条边:
# 0 -> 1
# 0 -> 2
# 0 -> 3
# 1 -> 3
| true |
7587aeb5631d0f8744985297437020419569e7d6 | gfy0921/leetcode | /src/20190423.py | UTF-8 | 1,399 | 3.125 | 3 | [] | no_license | import sys
if __name__ == '__main__':
n = int(sys.stdin.readline().strip())
a_x = []
a_y = []
res = 0
for line in range(n):
x1, y1, x2, y2 = sys.stdin.readline().strip().split(' ')
x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
if x1> x2:
x1, x2 = x2, x1
... | true |
ed4a3facfeefd935816ce5de1ac4906abbb83180 | flight-viz/flight-viz | /parser/parser.py | UTF-8 | 20,247 | 3 | 3 | [
"MIT"
] | permissive | ## Parser for csv data in http://stat-computing.org/dataexpo/2009/
##
import csv
from collections import defaultdict
import numpy as np
import sys
import json
import os
import datetime
import pprint
import operator
import copy
###############################################################################
##########... | true |
32c0a27fdc1e6ba472b46f26a6d88baf42cc280a | professor-l/classic-tetris-project | /classic_tetris_project/countries.py | UTF-8 | 1,011 | 3.25 | 3 | [
"MIT"
] | permissive | import csv
from pathlib import Path
COUNTRIES_CSV_PATH = Path(__file__).parent.resolve() / "data" / "countries.csv"
class Country:
ACCEPTED_MAPPINGS = {}
ALL = []
def __init__(self, two_letter, full_name):
self.abbreviation = two_letter
self.full_name = full_name
def get_flag(self):
... | true |
5d68005d1cbc3bd8384c5eb07c1b281c33530427 | NickAnderegg/mazesentences | /mazesentences/process_practices.py | UTF-8 | 1,506 | 2.671875 | 3 | [
"MIT"
] | permissive | import csv
import pathlib
import json
import sys
import random
from .sentenceselector import Selector
def read_list(loc):
sentence_file = pathlib.Path(loc)
sentences = []
with sentence_file.open('r', encoding='utf-8') as f:
for line in f:
sentences.append(line.strip())
# random.sh... | true |
fb2c0836c1035d078eeccee2c313d864c0031ce4 | sreejithmm/AlgorithmDS | /AlgorithmandDatastructureStudy/codechef/HS08TEST.py | UTF-8 | 331 | 3.53125 | 4 | [] | no_license | def calculate_balance(wd,balance):
if(wd > balance-0.5):
print '%.2f'%balance
elif(wd%5 !=0):
print '%.2f'%balance
else:
balance = balance - wd - 0.5
print '%.2f'%balance
return
string = raw_input()
x,y = string.split()
x=int(x)
y=float(y)
calculate_bal... | true |
ee422518fbcc01fedf7e4f0569a6f63084f02326 | ryo8674/Training | /Check_Digit_paiza.py | UTF-8 | 472 | 3.078125 | 3 | [] | no_license | #coding: utf-8
def validation(s):
even = 0
odd = 0
for i in range(15):
if i % 2 == 0:
tmp = 2 * int(s[i])
if (tmp % 10 != tmp):
even += (tmp % 10 + tmp / 10)
else:
even += tmp
elif i % 2 == 1:
odd += int(s[i])
result = 10 - (even + odd) %10
if result == 10:
result = 0
return res... | true |
0f08c3036b12e7a659a443edc0a6fe6bf73bf42a | jainil27/Assignment-1 | /4.py | UTF-8 | 55 | 2.765625 | 3 | [] | no_license | n=int(input())
print(n*(10**3)+n*2*(10**2)+n*3*10+n*4)
| true |
7cf62e408fce56f7b1483c0d3feba00726f2f0ee | VictorCallejas/FB-Similarity-Challenge | /src/utils/losses/contrastive.py | UTF-8 | 2,003 | 3.4375 | 3 | [
"MIT"
] | permissive | import torch
import torch.nn as nn
class ContrastiveLoss(torch.nn.Module):
"""
Contrastive loss function.
Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
"""
def __init__(self, margin=2.0):
super(ContrastiveLoss, self).__init__()
self.margin = margin
... | true |
9847701f0a3b9f48a7a2fb58ad6c4b85e615cba6 | samuelkolb/pysnake | /draw.py | UTF-8 | 1,749 | 3.40625 | 3 | [] | no_license | from __future__ import print_function
from time import sleep
import os
import numpy as np
class Game(object):
def __init__(self, start_pos_snake, width, height, initial_direction):
self.busy = True
self.snake = [start_pos_snake, start_pos_snake - initial_direction, start_pos_snake - 2 * initial_d... | true |
f8af19fe57b1e8c3f401e845d7dbac9e481bf9bf | SilkeDH/neural_transfer | /neural_transfer/models/image_utils.py | UTF-8 | 1,032 | 2.578125 | 3 | [
"MIT"
] | permissive | # Image utils
import torch
import os
from PIL import Image
import torchvision.transforms as transforms
import neural_transfer.config as cfg
style_paths = {'The Starry Night - Van Gogh':os.path.join(cfg.IMG_STYLE_DIR, 'vangogh.jpg'),
'Mosaic Lady':os.path.join(cfg.IMG_STYLE_DIR, 'mosaic.jpg'),
... | true |
5b491a49d7030a550548d973a0d0c0310a48090c | Samsuper12/tf-character-recognition | /data.py | UTF-8 | 6,610 | 2.796875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import tensorflow as tf
import log
import database.loaders
def _on_first(func):
"""Wraps function 'func' so that it is applied only to the first argument."""
def on_all(first, *args):
return (func(first), *args)
return... | true |
2a0dbbd8511350d61c3e31dbeb449eabdaf6534c | mahdirezaie336/python-tutorial | /OOP/school.py | UTF-8 | 327 | 2.796875 | 3 | [] | no_license | from work_place import *
class School(WorkPlace):
def __init__(self, name):
super(School, self).__init__(name)
self.expertise = 'school'
def calc_capacity(self):
self.capacity = int(self.level ** 0.5)
def calc_costs(self):
return Consts.BASE_PLACE_COST * int(self.level *... | true |
8ae9d280e0e8a289522801e2cfa1905a9cf3d62d | jiangyunwei2015/2018SummerProject_FarmNet | /Projects/Bluetooth/BluetoothNode2/main.py | UTF-8 | 6,153 | 2.921875 | 3 | [] | no_license | #File Description:This is for LoPy BLE and LoRa communication test
from network import LoRa
import socket
import machine
from network import Bluetooth
import time
import pycom
import _thread
################ BLE Part ################
# This node will act as both BLE server #
# and client itself #... | true |
992ac98663a191b252511fdad57d17227eda301b | owenchang715/python_scripts | /random_name.py | UTF-8 | 303 | 3.765625 | 4 | [] | no_license | import random
name = ['123', '456', '789']
while name:
press = input('Input enter: ')
winner = random.choice(name)
print('winner is: ', winner)
print('-------------------------------------')
name.remove(winner)
print('Maybe you are winner: ', name)
print('/////////////////////////////////////') | true |
7f4488061edd6fcff1e3556951badaf7a1091956 | abuvanth/watchdog | /run.py | UTF-8 | 1,686 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | import os
import sys
import argparse
from fillInventory import fill_Inventory
from start_scans import start_scan
from configdb import config_db
from run_tools import run_tool
def main(argv):
os.environ["LC_ALL"] = "en_US.UTF-8";
parser = argparse.ArgumentParser()
parser.add_argument("-c","--config",help="t... | true |
a4363ce74c546c57ba30bba5c86735edef52e0e6 | msonsona/learn-python | /ex19.py | UTF-8 | 1,211 | 4.875 | 5 | [] | no_license | # Defining the cheese_and_crackers function, which receives two parameters
def cheese_and_crackers(cheese_count, boxes_of_crackers):
# Print the value of first parameter formatted within a string
print "You have %d cheeses!" % cheese_count
# Print the value of the second parameter formatted within a string
... | true |
92485c0bf957fde627ebead83007c3e31f9b6922 | IsmailKent/VideoAnalyticsSubmissions | /Sheet5/model.py | UTF-8 | 10,190 | 3.171875 | 3 | [] | no_license | import numpy as np
import torch
import torch.nn as nn
import sys
'''
classes to implement:
- HMM
- GMM
- simple MLP
- RNN
Note: OUTPUTS OF GMM, MLP, RNN: P(S|X_t)
We use to calc P(X_t|s) using Bayes: P(X_t|s) = P(s|X_t) . const / P(s)
(Observation model for HMM)
'''
#Initialized for each act... | true |
0ae8c3c569f2362e4e47ed75a87b05481bbc8df9 | WellWang/time_estimation | /models/deeptravel/DeepTravel_Preprocessing/script.py | UTF-8 | 2,878 | 2.609375 | 3 | [] | no_license | import collections
from models.deeptravel.DeepTravel_Preprocessing import helpers
import argparse
from models.deeptravel.DeepTravel_Preprocessing import logger
import numpy as np
import os
parser = argparse.ArgumentParser()
parser.add_argument('--grid_size', type=int, default=128)
parser.add_argument('--ttf_destinatio... | true |
c534c6675914a84de8e77f4fcc38ab36b8ac97d9 | BaronKhan/VoiceRecognitionRPG | /generators/table-generator/generateTable.py | UTF-8 | 2,453 | 2.703125 | 3 | [] | no_license | import sys
import os.path
import csv
def renderBeginningFile(outputFile, outputName):
outputFile.write("\
import com.khan.baron.vcw.ContextActionMap;\n\
import com.khan.baron.vcw.GlobalState;\n\
/* TODO: insert action imports */\n\
\n\
public class "+outputName+" extends ContextActionMap {\n\
public "+outputNa... | true |
df9b81fba38b8ccca58c232736c3d49ea14686e8 | JasonZhou404/dgpmp2 | /diff_gpmp2/ompl_rrtstar.py | UTF-8 | 1,606 | 2.53125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/usr/bin/env python
import numpy as np
import torch
from ompl import base as ob
from ompl import geometric as og
from diff_gpmp2.env.env_2d import Env2D
from diff_gpmp2.robot_models import PointRobot2D
class RRTStar(object):
def __init__(self, space, bounds, env, robot, planner_params, epsilon_dist):
self.s... | true |
0dd18b5e1e93a44e248b527aa6aa7020d7691f8a | zkatemor/thesaurus | /rewiew_base_rating.py | UTF-8 | 1,546 | 2.84375 | 3 | [] | no_license | import requests
from pandas import DataFrame
import json
url = "https://market-scanner.ru/api/reviews"
key = "9d5d736adf18d96386df47deaf23fde6"
text_list_plus = []
text_list_minus = []
# метод удаления из строки HTML-тегов
def remove_html_tags(inp):
tag = False
quote = False
out = ""
for symbol in i... | true |
4d477389f3d278b59c06e4c464a1c85e59eb7f31 | johnbmerry/dominion_project | /dominion_curses.py | UTF-8 | 4,667 | 3.171875 | 3 | [] | no_license | from player import *
from itertools import cycle
from curses import *
from start_board import *
'''
DONE
Fairly rotates between players with randomized 'start' player
Accurately calculates score for multiple players
Keeps track of which player purchased provinces on which turn and who won the game in external .txt fil... | true |
0d29c4512d96736fea2405d76409a9db4f8f3f55 | Jovin247/Face-detection-using-MTCNN | /mtcnn_live_cam.py | UTF-8 | 666 | 2.75 | 3 | [] | no_license | import cv2
from mtcnn.mtcnn import MTCNN
detector = MTCNN()
video = cv2.VideoCapture(0)
if (video.isOpened() == False):
print("Web Camera not detected")
while (True):
ret, frame = video.read()
if ret == True:
location = detector.detect_faces(frame)
if len(location) > 0:
for fac... | true |
ac152507216a5c02f28cfc0be604077652a782d4 | Michaelnstrauss/Byte | /udemy/capitalize.py | UTF-8 | 286 | 3.9375 | 4 | [] | no_license |
string1 = 'michael'
def capitalize(string1):
up = string1.replace(string1[0], string1[0].upper())
return up
'''string2 = ''
for letter in string1:
string2 = string1.append(string1[0].upper())
print(string2)'''
print(capitalize(string1))
| true |
9002880909c97e64ac627da777f9a1dce93c3804 | cs-richardson/novel-console-application-albs1010 | /novel.py | UTF-8 | 3,248 | 3.375 | 3 | [] | no_license | #Albert
import sqlite3 as sq
from datetime import datetime, date
con = sq.connect("novel.db")
c = con.cursor()
#Function gets author's data from the table
def get_author():
res = c.execute("SELECT AuthorID, AuthorDOB, AuthorName from Author")
data = c.fetchall()
return data
#Function gets novel's data f... | true |
b7060e2ba0961427bf5ee01ad1683a60ccc52310 | Anikatabassum123/etl-challenge | /src/main.py | UTF-8 | 1,250 | 2.953125 | 3 | [] | no_license | import logging
import csv
import os
from database import Database
logging.basicConfig(level="DEBUG")
logger = logging.getLogger(__name__)
class EtlScript:
def __init__(self):
self.database_conn = Database("acme")
self.header_file = "headers.txt"
self.data_file = "data.csv"
self.o... | true |
c44fa4005a33a0e4346a793a7d4bde8e4a7af175 | sbremer/adventofcode2018 | /day_8.py | UTF-8 | 1,314 | 2.59375 | 3 | [] | no_license | from aocd import get_data
from aocd import submit
import re
day = re.findall("day_(.*?).py", __file__)[0]
data_raw = get_data(day=day)
data = list(map(lambda x: int(x), data_raw.split(' ')))
sum_meta = 0
def process_node(at):
global sum_meta
children = data[at]
metadata = data[at+1]
at += 2
... | true |
79b1ed6af8e15e2e54aabc9da4e45a6050088540 | Urvashi-91/Urvashi_Git_Repo | /Interview/Facebook/stringToInteger.py | UTF-8 | 1,956 | 3.984375 | 4 | [] | no_license | '''
Method1:
Time Complexity:
'''
import re
def myAtoi(s: str) -> int:
# I am looking for something that starts with +-(optional) and digits. Basically searching for an int
numString = re.findall('^[\+\-]?\d+',s.strip())
print(numString)
# If no integer is found, return 0
if len(numString) == 0:
... | true |
07c73dcf89265b3678f0b26a8fa4febf48dd868d | wennroy/leetcode2020 | /20210928/foursum.py | UTF-8 | 1,473 | 2.859375 | 3 | [] | no_license | class Solution:
def fourSum(self, nums, target):
nums.sort()
dict1 = {}
for index,x in enumerate(nums):
dict1[x]=index
# 解法一
# from itertools import combinations as com
# dic, l = collections.defaultdict(list), [*com(range(len(nums)), 2)]
# for a... | true |
7b55458539f769ace1dc807a647c393499999e82 | OmotosoYusuf/python_exercise2 | /exercise1/lowerUpper.py | UTF-8 | 229 | 3.265625 | 3 | [] | no_license | while True:
print('Kindly input your name')
name = input()
if name.lower() == 'yusuf':
print('Welcome ' + name)
break
else:
print('Enter a valid name please')
continue
| true |
d7a7e4b86c400a9d7676de7c59766b2a6a59ea39 | oopsip/snippets-app | /snippet_read.py | UTF-8 | 87 | 2.671875 | 3 | [] | no_license | import csv
f = open('snippets.csv')
csv_f = csv.reader(f)
for row in csv_f:
print row | true |
d04d8302fc1c23c4af9c537c555a284232febe6d | SND96/TSP-Project | /QRTD.py | UTF-8 | 4,569 | 2.75 | 3 | [] | no_license | from os import listdir
from os.path import isfile, join
import pandas as pd
import numpy as np
from Plotter import Plotter
class QRTD(Plotter):
def __init__(self, outdir, target_loc, algo, solpath="DATA/solutions.csv",
line_alpha=0.7, line_width=1.2, tick_color='0.25', bgc='0.90',
... | true |
5ed350458cc2f00a10e7d6f1820989f29c031197 | agervail/wroom_32 | /micropython/thread_test.py | UTF-8 | 613 | 2.640625 | 3 | [] | no_license | import machine, ssd1306
import _thread, time
def thread_entry(n):
global n_finished, oled
for i in range(0,123,3):
oled.fill_rect(5, 5 + n * 10, i, 8, 0xffff)
oled.show()
time.sleep(0.1)
with lock:
n_finished += 1
i2c = machine.I2C(scl=machine.Pin(4), sda=machine.Pin(5))
oled = ssd1306.SSD1306_... | true |
b204077b61085d20fd256097c9c3c172a02ca41c | mmou/python-class-2014 | /class4/grades_loops_functions.py | UTF-8 | 753 | 3.75 | 4 | [] | no_license | # define a function that takes in a dictionary representing
# someone's grade breakdown.
# output their overall grade
# EXAMPLE OF SOMEONE'S BREAKDOWN
# keys = grade categories
# values = alice's grade in each category
alice_breakdown = {
"homework": 90,
"quizzes": 78,
"tests": 80,
"participation": 80
}
def over... | true |
75be4ad29a4a8e48d9c211875873682aeea2c813 | Shantanu2508/Matrix_Theory | /skew_shortest_distance_2.py | UTF-8 | 1,416 | 3.1875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 4 15:10:04 2020
@author: shantanu
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 3 23:21:59 2020
@author: shantanu
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig = ... | true |
71360dac66f213bf393ed3b56546cab638342a2b | cordunandreea/OPERATORI-MATEMATICI | /cazul_c.py | UTF-8 | 87 | 2.875 | 3 | [] | no_license | x=5**103/(5**17*5**8)**4
y=(324/9**2+5*2**3)
z=10**0
rezultat=x+y+z
print(rezultat) | true |
5968dc992a79ce2a2028282f8349842539c0c0a8 | rdashr/jhu-bfx | /605.620_bfx algo/project 3/getInput.py | UTF-8 | 3,308 | 3.546875 | 4 | [] | no_license | #!/usr/bin/env python3
# Programming Assignment 3: Longest Common Subsequence
# Richard Ren - December 8, 2020
'''
This module hands input interface and input checking. The user gives:
one or two input text files with input sequences, and a computation mode.
The module parses from the input text file each sequence... | true |
91630952c7f4d4997cde8ec7acdb10428659b5ed | kampfschlaefer/nix-topartists | /scripts/topartists.py | UTF-8 | 558 | 2.9375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import sys
import collections
import json
counter = collections.Counter()
for filename in sys.argv[1:]:
print("Reading from %s" % filename)
with open(filename, 'r') as handle:
for line in handle:
if line.strip() == "":
continue
# print("Pa... | true |
d0199bda242ecf540194fab18b9956decaa7d866 | sejin423/Library | /탐색/순차 탐색 소스코드.py | UTF-8 | 703 | 4.09375 | 4 | [] | no_license | # 순차 탐색 소스코드
def sequential_search(n, target, array):
# 각 원소를 한개씩 확인
for i in range(n):
# 현재의 원소가 찾고자 하는 원소와 일치할 경우
if array[i] == target:
return i + 1 # 현재 위치를 반환
print("생성할 원소 개수를 입력한 다음 한 칸을 띄고 찾을 문자열을 입력하세요")
input_data = input().split()
# 원소의 개수
n = int(input_data[0])
# 찾고자 하는 ... | true |
0b925e00a7649c0346dca9c4ec964cb2a1f70a06 | iancmason/Arrest-Map | /arrestinfo.py | UTF-8 | 3,153 | 2.984375 | 3 | [] | no_license | import urllib.request
# Charge 94000 = OWI
# Study the Iowa City Arrest Blotter page's html source to discover what
# numbers correspond to other charges ...
def getArrestInfo(chargenum):
global Arrestlist
global locs
baseurl = "http://www.iowa-city.org/icgov/apps/police/blotter.asp?charge="
url = baseurl... | true |
d9f0bc2f15f422a15c3bc314891f48ad62c6a350 | Oltda/dictionary-api | /documentation.py | UTF-8 | 636 | 2.796875 | 3 | [] | no_license | import justpy as jp
class Doc:
def serve(self):
wp = jp.WebPage()
div = jp.Div(a=wp, classes="bg-gray-200 h-screen")
jp.Div(a=div, text="Instant Dictionary API", classes="text-4xl m-2")
jp.Div(a=div, text="Get definitions of words: ", classes="text-lg")
jp.Hr(a=div)
... | true |
509c091322a39395a5de38afe6b3a49ff7776b74 | charlottehill/KelpPlugin | /kelp/predatorPrey.py | UTF-8 | 37,879 | 2.53125 | 3 | [] | no_license | """This plugin is for the Predator Prey Project & Sequence Lesson.
Run via:
kelp <project file> sequential predator
"""
from __future__ import print_function
from collections import Counter, namedtuple
from itertools import chain
from kelpplugin import KelpPlugin
import kurt
import math
import sys
Point = nam... | true |
3fcb629fc616302970b641e13ba97c3ffb19db4a | 26prajval98/image-processing | /4/2_wiener_filter.py | UTF-8 | 417 | 3.015625 | 3 | [
"MIT"
] | permissive | import numpy as np
import cv2
kernel = [[1, 2, 1], [2, 4, 2], [1, 2, 1]]
def wiener(image, k=None):
image = np.array(image[:, :])
g = np.fft.fft2(image)
h = np.fft.fft2(kernel)
f = np.fft.ifft2(g/h)
return f
def main():
image = cv2.imread("image_2.png", cv2.IMREAD_GRAYSCALE)
f = wiener... | true |
f90104ccfe0092ea31a84c7433b264b6c69a62a9 | SimonZoo/LeetCode | /problem0167/test_167.py | UTF-8 | 677 | 3.234375 | 3 | [
"Unlicense"
] | permissive | import unittest
from .two_sum_ii_input_array_is_sorted import Solution
class TestTwoSum(unittest.TestCase):
def test_1(self):
s = Solution()
input_list = [2,7,11,15]
target = 9
output = [1,2]
self.assertEqual(s.twoSum(input_list, target), output)
def test_2(self):
... | true |
f0e2ab746ef06b012b0dd5bbc1d7e065c5b23f38 | sondongmin0419/study | /python/b_9461 파도반 수열.py | UTF-8 | 304 | 2.8125 | 3 | [] | no_license | import sys
T = int(input())
tc = [0] * T
for i in range(T):
tc[i] = int(sys.stdin.readline())
max_tc = max(tc)
li = max_tc
tr_r = [0] * (1 + max_tc)
tr_r[:10] = [1, 1, 1, 2, 2, 3, 4, 5, 7, 9]
for i in range(10, max_tc + 1):
tr_r[i] = tr_r[i-1] + tr_r[i-5]
for i in tc:
print(tr_r[i-1]) | true |
75a2b4fddf95d80fbf63d6861a31f3d9779c39ba | rlatmdwn01/Python | /output.py | UTF-8 | 489 | 4.25 | 4 | [] | no_license | # 하나만 출력합니다.
print("#하나만 출력합니다.")
print("Hello Python Programming...!")
print()
# 여러 개를 출력합니다.
print(10,20,30,40,50)
print("안녕하세요","저의","이름은","김승주입니다!")
print()
# 아무것도 입력하지 않으면 단순하게 줄바꿈합니다.
print("#아무것도 입력하지 않으면 단순하게 줄바꿈합니다.")
print("---확인 적용선---")
print()
print()
print("---확인 적용선---") | true |
25710c319ebb37b8584b6f173c7e6ddb52272b2a | ramlingamahesh/python_programs | /Searching and Sorting/Binary Search.py | UTF-8 | 1,656 | 4.15625 | 4 | [] | no_license | def Binary_search(arr, start_index, last_index, element):
while (start_index <= last_index):
mid = (int)(start_index + last_index) / 2
if (element > arr[mid]):
start_index = mid + 1
elif (element < arr[mid]):
last_index = mid - 1
elif (element == arr[mid]):
... | true |
2198b26dca87b36c736ee267766e9b9adf1154ad | veleritas/grader | /grader/preprocess/convert.py | UTF-8 | 1,678 | 2.625 | 3 | [] | no_license | # last updated 2014-12-15 toby
import re
import urllib2
def query(url):
# TODO: add error checking
BASE = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/"
response = urllib2.urlopen(BASE + url)
html = response.read()
return html
def uid_to_cui(uid):
req = "esummary.fcgi?db=medgen&id=" + uid
xml = query(req)
if... | true |
fc255416aacc5a8c5f5b60931cb677ada2884368 | mengshanli/financial_data_scraper | /financialdata_scraper.py | UTF-8 | 16,132 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
'''
==============================================================================
爬蟲
'''
def value(url, n1):
resp = requests.get(url)
soup = BeautifulSoup(resp.text, 'h... | true |
42236d887d8c01c7f2585e638445e624f528c8ea | garthvh/vendpi | /vend.py | UTF-8 | 12,651 | 2.8125 | 3 | [
"MIT"
] | permissive | # VendPi Raspberry Pi Vending Machine
# Authors: Garth Vander Houwen (@garthvh), Jason Widrig (@jasonwidrig)
#
# Hardware: Venduino Laser Cut Case http://www.retrobuiltgames.com/diy-kits-shop/venduino/
# Raspberry Pi B+,
# 12 TM1803 RGB LEDs
# Nokia 5110 Screen 84x48
# 4 16mm Re... | true |
1822dd4730a62a4f62fe4f5c407f29b85ba16a25 | perez28/Iniciando-Python | /blucles.py | UTF-8 | 923 | 3.65625 | 4 | [] | no_license |
""" while True:
linea = input ('>')
if linea == 'terminado' :
break
print (linea)
print ('terminado por break')
while True:
linea = input ('>')
if linea == 'terminado' :
break
print (linea)
print ('terminado por break')
"""
"""
n = 0
b = 0
while True:
n = n + 1
pri... | true |
1ae8eddbd844dfaff811a922e66a120228c8cf01 | IINemo/isanlp | /src/isanlp/processor_syntaxnet_remote.py | UTF-8 | 4,205 | 2.6875 | 3 | [
"MIT",
"Python-2.0"
] | permissive | from .annotation import WordSynt
from .annotation_repr import CSentence
from .conll_format_parser import ConllFormatStreamParser
import sys
import socket
import logging
logger = logging.getLogger('isanlp')
class ProcessorSyntaxNetRemote:
"""Processor for calling SyntaxNet remotely.
It is intended to w... | true |
f8e3966b4311352398d9863cf1fad611aabe3fa5 | thomasrnp/Lernen | /openCV27_tracking_using_colors.py | UTF-8 | 2,076 | 2.578125 | 3 | [] | no_license | import cv2
print(cv2.__version__)
import numpy as np
def nothing(x):
pass
cv2.namedWindow('Trackbars')
cv2.moveWindow('Trackbars',1320,0)
# Setting to easily show a red object
cv2.createTrackbar('hueLower', 'Trackbars',152,179,nothing)
cv2.createTrackbar('hueUpper', 'Trackbars',179,179,nothing)
cv2.createT... | true |
d606a6376156cbe2247418edefa3c694e6f65d84 | luojaye/pythonjob | /pythonjob11/getpicture.py | UTF-8 | 5,925 | 2.765625 | 3 | [] | no_license | from pyecharts.faker import Faker
from pyecharts import options as opts
from pyecharts.charts import Map
from pyecharts.globals import ChartType, SymbolType
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib.animation as animation
from IPyt... | true |
88e34913abd3cc602b606c685247b26858c4eba3 | lewis-cs346-fall19/demo-01-lectura-hates-me | /net_server.py | UTF-8 | 422 | 2.703125 | 3 | [] | no_license | import sys
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
addr = ("0.0.0.0", 17000)
sock.bind(addr)
sock.listen(5)
(connectedSock, clientAddress)=sock.accept()
while True:
msg=connectedSock.recv(1024).decode()
if msg!='':
print("Here's the data: " +msg)
connectedSock.send... | true |
87aec57c3bce8d6be30c4ed4fb9ed534cd53fa3f | DsLiner/Muthon | /UVM/UcodeVirtualMachine.py | UTF-8 | 14,106 | 3.421875 | 3 | [] | no_license | import sys
# sys는 Python의 기본 라이브러리로써 에러 메시지 출력과 프로그램 강제 종료 기능을 제공한다.
def func(operator):
# 함수가 호출되면 countline을 1 증가시킨 후 각각의 명령어에 따라 하위함수를 호출하는 함수이다.
# 하위함수에 할당되지 않는 명령어가 전달되면 에러메시지를 출력하고 프로그램을 종료시킨다.
global countline
countline += 1
if(operator=='notop' or operator=='neg' or operator=='inc' or opera... | true |
6668af8a98c40a9f062ef506df9c179a94c399ff | bushig/sandbox | /multithread_test.py | UTF-8 | 907 | 3.265625 | 3 | [] | no_license | import time
import threading
from random import random
loops=[1,4,5,2,3,4,5, 2, 5,2,1,0,2,5,2,4,5,3,5,2,1]
result=[]
class ThreadFunc(object):
def __init__(self, func, args, name=''):
self.func=func
self.args=args
self.name=name
def __call__(self):
self.func(*self.args)
def l... | true |
aae8b5a6c10be8ae1611f973ea29d3de4bbbc456 | namuan/dev-rider-codesnippets | /py-snippets/json_simple_tools.py | UTF-8 | 385 | 3.09375 | 3 | [] | no_license | import json
def format_json(json_obj):
return json.dumps(json_obj, indent=4)
def minify_json(json_obj):
return json.dumps(json_obj, separators=(",", ":"))
def load_json(raw_json):
return json.loads(raw_json)
def test_load_json():
raw_json = """
{
"name": "john doe"
}
"""
json_obj... | true |
979d5f22c1775a3600f1de86d60fad518660cfca | anmol27katyani/Python-codes-practice | /venv/Must Do/Leetcode/Linkedlist Pldrome.py | UTF-8 | 574 | 3.34375 | 3 | [] | no_license |
class Solution:
def deleteDuplicates(self, head: ListNode) -> ListNode:
if (not head or head.next is None):
return head
else:
curr = head
last=head
while(curr.next is not None):
if(curr.val == curr.next.val):
curr =... | true |
ddf41826927cb757043ee59a3fbf6d892f104c50 | albertzang/leetcode | /0463.py | UTF-8 | 495 | 2.96875 | 3 | [] | no_license | class Solution(object):
def islandPerimeter(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
count = 0
adj = 0
for i, row in enumerate(grid):
for j, cell in enumerate(row):
count += cell
if cell:
... | true |
b40b7677e8d038237569b5e2ae835c6e708a021e | suomichain/suomi-core | /validator/suomi_validator/state/merkle.py | UTF-8 | 9,567 | 2.59375 | 3 | [
"Apache-2.0",
"Zlib",
"MIT"
] | permissive | # Copyright 2016 Suomi Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | true |
393f29d9d6758995b9297f675622dabcbcc9329b | pussbb/pymaillib | /pymaillib/imap/exceptions/base.py | UTF-8 | 2,640 | 2.515625 | 3 | [
"WTFPL"
] | permissive | # -*- coding: utf-8 -*-
"""
Imap4 exceptions
~~~~~~~~~~~~~~~~
Imap4 exceptions
:copyright: (c) 2017 WTFPL.
:license: WTFPL, see LICENSE for more details.
"""
class ImapClientException(Exception):
"""Base exception for the imap folder. All new Exception for pyimaplib
module should subclas... | true |
ca2bf652a25a51b037936120548f994dc30750d7 | skyepurchase/swearbot | /UserHandler.py | UTF-8 | 3,801 | 2.921875 | 3 | [] | no_license | import discord
import wave
import time
import os
import speech_recognition as sr
from Swears import Swears
from NaughtyList import NaughtyList
from Constants import Constants
class UserHandler:
def __init__(self, user: discord.Member, base_dir: str):
"""Define the user, their discord guild, path and setu... | true |
75a3a0ab6dea5fdc6f646ad273bdb4b4331ecb0a | simonpintarelli/sirius-python-examples | /stiefel_manifold.py | UTF-8 | 1,465 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
import matplotlib.pyplot as plt
from sirius import DFT_ground_state_find
import sirius.baarman as st
import sirius.ot as ot
from numpy import linspace
def geodesic(X, Y, tau):
"""
Keyword Arguments:
X --
Y --
tau --
"""
U, _ = st.stiefel_transpor... | true |
67e6c6785ba5ab89fa23113f6be58482dda218b9 | b-vennes/html_builder | /examples/basic_template.py | UTF-8 | 354 | 2.59375 | 3 | [] | no_license | import sys
import os
# need to add html_builder to python path
html_builder_path = os.path.join(os.getcwd(), '..')
sys.path.append(html_builder_path)
from html_builder.html_builder.html import Html
container = Html('div', 'container')
title = Html('h1')
title.children += ['Test Application']
container.children += ... | true |
cfb2b3c7cb53b62a67f2141f231b0c7c0aadaa5a | rajasree-r/Hashing-1 | /groupAnagrams_PrimeProduct.py | UTF-8 | 668 | 3.9375 | 4 | [] | no_license | def groupAnagrams(strs):
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101]
map = {}
result = []
count = 0
for str in strs:
key = 1
for ch in str:
key *= primes[ord(ch) - ord('a')] # ord() gives the integer repr... | true |
e966bfbc550e2da00bcaf42fe1d7f2d27b8359a6 | dpdulac/pyScript | /testQTable.py | UTF-8 | 1,871 | 2.96875 | 3 | [] | no_license | #!/usr/bin/env python
# coding:utf-8
""":mod: testQTable.py
===================================
.. module:: moduleName
:platform: Unix
:synopsis: module idea
:author: duda
:date: 2020.12
"""
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
class TableModel(QtCore.QAbst... | true |
36c0d21a1133ca0a4e2fc766436e591d4b4eb97c | byohay/LearningModels | /evolvability/run_perf_main.py | UTF-8 | 1,894 | 2.84375 | 3 | [] | no_license | from random import choice
from evolvability.monotone_conjunction.one_sided_performance_oracle import OneSidedPerformanceOracle
from evolvability.monotone_conjunction.one_sided_performance_oracle_with_tolerance import \
OneSidedPerformanceOracleWithTolerance
from evolvability.monotone_conjunction.performance_oracle... | true |
62fb600732ea8822d08b8d4d4c6bcb67f5d8e6c6 | emeidi/strip-images-from-apple-vcard | /strip-images-from-apple-vcard.py | UTF-8 | 2,072 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import re
import argparse
def d(msg):
if verbose == False:
return
print(msg)
parser = argparse.ArgumentParser(description='Strips images from an Apple AddressBook.app VCF export for easier uploading to contact directories (e.g. Goog... | true |
4b752c62406258dd1caae2719f8caab7f10352f5 | Williano/Bona-Blog | /blog/tests/views/test_author_views.py | UTF-8 | 7,408 | 2.625 | 3 | [
"MIT"
] | permissive | # Core Django imports.
from django.contrib.auth.models import User
from django.test import Client
from django.test import TestCase
from django.urls import reverse
# Third-party Django app imports.
from model_mommy import mommy
# Blog application imports.
from blog.models.article_models import Article
from blog.models... | true |
8f5d5db015dc1946bb497a4d93b3ea29e8a1c520 | silverbass/LeapCAD | /command.py | UTF-8 | 1,093 | 2.625 | 3 | [] | no_license | c_type = 1
pVec = [0,1,0]
# ^ you replace these two lines with your vector and type of transformation
import maya.cmds as cmds
import maya.mel as mel
import time
def scalarMaker(c_type):
if (c_type == 1):
# TRANSLATE SCALAR
return 1
elif (c_type == 2):
# ROTATE SCALAR
return 1
... | true |
3448a451d0d6e210c992886b504cb07c9c490036 | ETERNASMI/CursoPython | /exercicio40aula12python.py | UTF-8 | 495 | 3.90625 | 4 | [
"MIT"
] | permissive | nt = float(input('Digite sua primeira nota:'))
nt2 = float(input('Digite sua outra nota:'))
m = (nt + nt2) / 2
if m < 5.0:
print('Sua media esta abaixo da media, sua media é {:.2f}'.format(m))
print('Você foi Reprovado!')
elif m == 5.0 or m <= 6.9:
print('Você esta na media, sua media é de {:.2f}'.format(m)... | true |
bd43b7648d4a5f87b8aabfd14a952bb64a7aa44b | Shion-VUTD/shion_semi_at_VUT | /semi_1.py | UTF-8 | 2,756 | 4.15625 | 4 | [] | no_license | #皆さんが教えてくれた補足事項をここにまとめておきます
#これ言ったはずなのに記録されてない・・・(泣)と思った方はこのソースコードを再編集してpushするか直接コメントしてください
#Pythonでは、コメントアウトは#で行ってください
#文字列
#言うのを忘れていましたが、Pythonでは文字列の表記は'hoge'でも"hoge"でも構いません。
print("Hello")
print('Hello')
#演算
#これも言うのを忘れてたんですが、bool型の1,0への型変換は演算の時にも使えます
print(2+True)
print(True*3)
#整数から浮動小数点数への型変換(下の式の出力は浮動小数点数であることに... | true |
6e5825b54b7d7a4cb130f8e7b55e386d75b422c7 | PrathameshSonar/PersonalAssistant | /PersonalAssistant/finan.py | UTF-8 | 1,626 | 2.84375 | 3 | [] | no_license | from pandas_datareader import data
from pandas_datareader._utils import RemoteDataError
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from datetime import datetime
START_DATE='28-01-2015'
END_DATE=str(datetime.now().strftime('%d-%m-%y'))
UK_STOCK = 'UU.L'
USA_STOCK='AMZN'
... | true |
b99a4c902bc89d35e38de777f36feec50372b022 | azdrachak/CS212 | /212/Unit1/1-25.py | UTF-8 | 611 | 3.921875 | 4 | [] | no_license | __author__ = 'Aliaksandr Zdrachak'
# -----------
# User Instructions
#
# Write a function, deal(numhands, n=5, deck), that
# deals numhands hands with n cards each.
#
import random # this will be a useful library for shuffling
# This builds a deck of 52 cards. If you are unfamiliar
# with this notation, check out And... | true |
51f7126ab11383903e6cb0b7eaeeb95afb154130 | VinothRajasekar/practice | /DynamicProgramming/PalindromeSubstringCount.py | UTF-8 | 492 | 3.25 | 3 | [] | no_license | def countPalindromes(s):
# Write your code here
n = len(s)
count = 0
dp = [[0 for _ in range(n)] for _ in range (n)]
for i in range(n):
dp[i][i] = True
count += 1
for i in range (n-1,-1,-1):
for j in range (i+1, n):
if s[i] == s[j]:
print(s[i... | true |