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 |
|---|---|---|---|---|---|---|---|---|---|---|
cd981f5b24b6dbe6c1cb5fb15cac7f5889b9ffe7 | Jokertion/Projects | /countdown.py | UTF-8 | 259 | 2.6875 | 3 | [] | no_license | #! python3
# countdown.py
# 倒计时提醒程序
import time
import subprocess
time_left = 5
while time_left > 0:
print('Time left:%ds' % time_left)
time.sleep(1)
time_left -= 1
subprocess.Popen(['start', 'alarm.wav'], shell=True)
| true |
112773da39c8379cb7c0649947faef318885f126 | Awawdi/pyCampus | /test4.py | UTF-8 | 133 | 3.15625 | 3 | [] | no_license | import functools
def add(x, y):
return x + 1
shopping_list = [200, 120, 330, 50]
print(functools.reduce(add, shopping_list))
| true |
3239c3f2e383d92714b8347666bd319254c571da | akshaynawale/capstone-sve | /MyDpro/buffsnfv/nfv/oldcode.py | UTF-8 | 2,158 | 2.828125 | 3 | [] | no_license | import subprocess
from collections import defaultdict
import re
import sys
def database():
database=defaultdict(list)
ifconfig = subprocess.Popen('ifconfig',stdout=subprocess.PIPE,shell=True)
ifcfg_out= ifconfig.stdout.read().decode()
ifcfg= ifcfg_out.split("\n\n")
ifcfg=list(filter(None,ifcfg))
... | true |
a0d5dddb784dab5f17f686276ec5d5ad796e3e52 | Sanych13/LITS | /HW 15.05.1.py | UTF-8 | 276 | 3.75 | 4 | [] | no_license | def words(w):
l = len(w)
for i in range(l):
for t in range(i + 1, l):
if len(w[i]) > len(w[t]):
temp = w[i]
w[i] = w[t]
w[t] = temp
return w[0]
print(words(['fghjfg', 'hj', 'jjj']))
| true |
4d79cc63ed27a49386948b83c6df44a88a02836c | yuhsinliu1993/Neural-Turing-Machine | /memory.py | UTF-8 | 6,815 | 3.203125 | 3 | [] | no_license | import tensorflow as tf
import numpy as np
import math
class Memory(object):
def __init__(self, word_num=128, word_size=20, read_heads=1, batch_size=1):
"""
Contructure a memory matrix with read heads and a write head
Parameters:
-------------
word_num: the numb... | true |
a492dabbe9473f011a9104da11024f84dd62f986 | tirameshu/CS3245 | /Homework #4/postings.py | UTF-8 | 2,503 | 3.390625 | 3 | [] | no_license | import pickle
class Postings:
def __init__(self, out_file):
self.out_file = out_file
self.postings = [] # [{document_ID: term_frequency}]
def get_length(self):
return len(self.postings)
def add_entry(self, doc_id):
"""
Creates a new entry in postings only when a un... | true |
d7d41053246365e79d64be283087d8affbd68078 | jhey936/JHey_Code | /natural_products_project/natural_products/isomorphism.py | UTF-8 | 3,520 | 2.953125 | 3 | [] | no_license | import networkx as nx
import networkx.algorithms.isomorphism as iso
# from natural_products.io_utils import *
#
# def check_isomorphism(G1, G2):
# """Check if two graphs are isomorphic"""
# em = iso.categorical_edge_match("weight", None)
# nm = iso.categorical_node_match("element", None)
#
# return nx.... | true |
48c4e77fc76e531b7c536632ba8c63ef61876442 | mjlavin80/walker | /walker_scraps.py | UTF-8 | 309 | 2.96875 | 3 | [] | no_license | from nltk import stopwords
filtered_words = [word for word in word_list if word not in stopwords.words('english')]
def comp(list1, list2):
walker_count = 0
nomatches = []
for i in list1:
if i in list2:
walker_count +=1
else:
nomatches.append(i)
return walker_count*1.0/len(list1), nomatches
| true |
bdd8f69782d74cd2d4f00ee094dab8e8a6d4361c | f-sena6/CS350Homework | /Homework/sena_hw7.py | UTF-8 | 3,036 | 3.640625 | 4 | [] | no_license | global responses, respones2
class Talker:
def __init__(self, n, v): #constructor; initialize
self.name = n #self is the object
self.vocab = v #vocab
def getname(self):
return self.name
def getvocab(self, text):
v = []
z = []
for i in text.split(): #Seperates ... | true |
f0eab9d85384aa603b6947bc7de01dacd17ed04d | ShamSinha/flipkart-challenge | /KMEANS anchor box.py | UTF-8 | 2,932 | 3.34375 | 3 | [] | no_license | """
Created on Sun Feb 10 14:29:55 2019
@author: Shubham
"""
import numpy as np
import matplotlib.pyplot as plt
filename = "kmeans_data.csv"
data = np.loadtxt(filename, delimiter=",", skiprows=1, usecols =[0,1])
CLUSTERS = [2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10, 11 , 12 ,13 ,14,15]
Accuracy = []
def a... | true |
0c845527a68c741dcba99912f74c04ba7f9a9668 | ericpulvino/halloween2015 | /pin_finder.py | UTF-8 | 311 | 2.765625 | 3 | [] | no_license | #!/usr/bin/python
import sys
import time
import RPi.GPIO as GPIO
target_pin=int(sys.argv[1])
print "Operating on Pin %s" % target_pin
GPIO.setmode(GPIO.BOARD)
GPIO.setup(target_pin,GPIO.OUT)
while True:
GPIO.output(target_pin,False)
time.sleep(1)
GPIO.output(target_pin,True)
time.sleep(1)
| true |
2f50b51b0ded7706aaa2996b5306c968be78420b | einarf/NHS | /src/game.py | UTF-8 | 9,685 | 2.625 | 3 | [
"MIT"
] | permissive | from typing import Optional, Tuple
import arcade
import arcade.gui
from arcade import MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, color
from misc.item import Item
from world import World
import config
class Game(arcade.View):
"""Base game class"""
def __init__(self) -> None:
"""Initializer"""
su... | true |
15c5f79dc737fd0dd1dcc20966e82dab1ffb9a8a | ricardo-rios/estadistico-R | /codigo0016.py | UTF-8 | 754 | 3.0625 | 3 | [] | no_license | import pandas as pd
import numpy as np
# Create dataframe
raw_data = {'team': ['kiddies', 'kiddies', 'kiddies', 'kiddies', 'FireDogs', 'FireDogs', 'FireDogs', 'FireDogs', 'Mambaas', 'Mambaas', 'Mambaas', 'Mambaas'],
'company': ['1st', '1st', '2nd', '2nd', '1st', '1st', '2nd', '2nd','1st', '1st', '2nd', '2nd']... | true |
109d38e2c665232b93c40bd84caadd2b2cb83eb9 | yeshengwei/PythonLearning | /08面向对象/09-面向对象的应用-烤地瓜.py | UTF-8 | 1,124 | 4.4375 | 4 | [] | no_license | class SweetPotato():
def __init__(self):
self.cookTime = 0
self.cookState = "生的"
self.condiments = []
def cook(self, time):
"""烤地瓜的方法"""
self.cookTime += time
if 0 <= self.cookTime < 3:
self.cookState = "生的"
elif 3 <= self.cookTime < 5:
... | true |
30bae7fa4e0403e355d678c6999e4a863f4b4c46 | AashDhir/mulit-dimensional-arrays | /untitled0.py | UTF-8 | 888 | 3.59375 | 4 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 11 16:49:23 2021
@author: divyeshdhanvijay
"""
from tkinter import *
import random
root=Tk()
root.title("Multi-dimensional arrays")
root.geometry("500x500")
label=Label(root)
array_3d = [[[1,2,3,4,5,6],["Black","White"],["A","B","C","D","E","F"... | true |
839c6e5300fa3cea5c8cced77895c782868280a5 | antondelchev/Python-Basics | /Drawing-Figures-with-Loops---More-Exercises/01. Rectangle of 10 x 10 Stars.py | UTF-8 | 98 | 3.15625 | 3 | [] | no_license | for rows in range(1, 11):
for columns in range(1, 11):
print("*", end="")
print()
| true |
c576c2ee86bebfff943896204ec4fabf2312b7d8 | atulyakumar97/accent-classifier | /feature_extraction.py | UTF-8 | 1,092 | 2.6875 | 3 | [
"MIT"
] | permissive | import os
import pandas as pd
import numpy as np
import librosa
from pyAudioAnalysis import audioFeatureExtraction
print("Start")
directory = 'C:/Users/Atulya/Documents/GitHub/accent-classifier/' #change path to project folder
def main(directory):
df=pd.DataFrame()
for wav_file in os.listdir(directory+'/raw')... | true |
64349fdff7a5e8ec6068fde92d47d78217fae86c | Nirmalselva/nirmal | /count no of digit.py | UTF-8 | 109 | 3.375 | 3 | [] | no_license | a = 0
b = int(input("Enter a number "))
while (b > 0):
b = b//10
a = a + 1
print ("total no of digit:"a)
| true |
29f61ab670523ed803fd0a9ac944972bac0e5e1b | funny2code/unified_api | /unified/modules/main/categories/file_management_storage/onedrive/util.py | UTF-8 | 1,374 | 2.546875 | 3 | [] | no_license | from unified.core.auth import Auth
import json
import requests
from datetime import datetime, timezone
def get_access_token(headers):
""" Returns new access token """
auth_info = {
"client_id": headers["client_id"],
"client_secret": headers["client_secret"],
"token": headers["token"],... | true |
ed15aca1ffb13e6714e176d75f729d97c74fa20e | aliasgenesis/Seminario-IA-1 | /Actividad 6 - Continuous Genetic Algorithm/quartic.py | UTF-8 | 347 | 2.84375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 29 21:10:54 2019
@author: qpqpq
"""
class Quartic:
MIN_VALUE = -1.28
MAX_VALUE = 1.28
def __init__(self):
pass
def fitness(self, cromosoma):
z = 0
for i in range(len(cromosoma)):
z += i * (cromosoma[i]**4)
... | true |
722ca4e4451c9bc2e1316fc207143bc04b92bc2f | dpezzin/dpezzin.github.io | /test/Python/dataquest/clustering_and_kmeans/function_recalculate_centroids.py | UTF-8 | 1,096 | 3.25 | 3 | [] | no_license | #!/usr/bin/env python
def recalculate_centroids(df):
new_centroids_dict = dict()
# 0..1...2...3...4
for cluster_id in range(0, num_clusters):
# Finish the logic
return new_centroids_dict
centroids_dict = recalculate_centroids(point_guards)
# Finish the function, recalculate_centroids, that t... | true |
31fc65ae30c250885cc01c6d6dd2ed304996bfb1 | r-mishra2126/IT475 | /050820_4.py | UTF-8 | 115 | 3.125 | 3 | [] | no_license | def print1(*argv):
arg1,arg2,arg3=argv
print(arg1,arg2,arg3,end= " ")
print1("HELLO"," MY " ,"NAME")
| true |
79679f3e72b0636d69e3588049bd79ca534a7d54 | mjmconvento/flask_graphql | /ws_app.py | UTF-8 | 2,476 | 2.5625 | 3 | [] | no_license | from flask import Flask
from flask_sockets import Sockets
from graphql_subscriptions import (
SubscriptionManager,
RedisPubsub,
SubscriptionServer
)
from schema import schema
import logging
import threading
from time import sleep
logging.basicConfig(filename='/var/www/flask_graphql/error_log/error_log.txt'... | true |
72341cb86e8d451d10f82e32dc37025e7d2ee889 | chekrizh/nlpfeatures | /nlpfeatures.py | UTF-8 | 2,053 | 3.015625 | 3 | [
"MIT"
] | permissive | import pandas as pd
from nlp_primitives import LSA, PartOfSpeechCount, PolarityScore, StopwordCount, DiversityScore, MeanCharactersPerWord
def feature_engineering(df, text_column,
useLSA=True, usePartOfSpeechCount=True, usePolarityScore=True,
useStopwordsCount=True, use... | true |
e5315c6d5769060e0912ccfe857908e1076968ec | jlopezbi/GeometricFractalsMaya | /nBranching.py | UTF-8 | 5,718 | 2.75 | 3 | [] | no_license | import maya.cmds as cmds
"""
Josh Lopez-Binder May 2015
Make a geometric branching fractal with "residue"
Run script in Maya. Then select base-object and run MakeArray(<nLevels>) in Python Command Line. Move around the
two children of the root node. Try scaling them by about 0.5 to get not-self-intersecting
patterns.
... | true |
be477aefba3606551d99672f3c89a2a936a99af6 | msmhrt/ynbr | /ynbr.py | UTF-8 | 4,170 | 2.5625 | 3 | [
"BSD-2-Clause"
] | permissive | #!/usr/bin/env python3
# vim:fileencoding=utf-8
# Copyright (c) 2014 Masami HIRATA <msmhrt@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code mus... | true |
81a7d66da4ad30e8b6941726cd53d86e73b87ff1 | hei-jung/202003_ai | /장혜정/sorting_algorithm/insertion_sort.py | UTF-8 | 292 | 3.859375 | 4 | [] | no_license |
def insertion_sort(list):
i = 1
for i in range(i, len(list)):
key = list[i]
j = i-1
while j >= 0 and list[j] > key:
list[j+1] = list[j]
j -= 1
list[j+1] = key
return list
list = [9, 4, 3, 1, 12]
print(insertion_sort(list)) | true |
503353a3c3f3d583c69e0d6425390d9a4024c90b | kevin-cai1/learning-shark_tank | /backend/apis/entry.py | UTF-8 | 8,268 | 2.625 | 3 | [] | no_license | from flask_restplus import Namespace, Resource, fields
from flask import request, jsonify
import db
import re
api = Namespace('entry', description='Entry specific operations')
entry_data = api.model('entry',{
'task' : fields.Integer(description = 'Task individual intends to complete i.e. certification, course, ex... | true |
4f5cafb6a16e66d1732fda996387a681862d692d | DylanArnold101/Pythonc0de | /Riddle.py | UTF-8 | 233 | 3.109375 | 3 | [] | no_license | num = raw_input("if hillary clinton and donald trump go on a cruise togethor and the ship sinks who survives")
if num.lower()== "america":
print("You're correct")
else:
print("You're incorrect the correct answer was america") | true |
08d998f6ef066c398ba39f934ccf97cd75e05fd7 | dnnxl/Whiskers | /python/src/main.py | UTF-8 | 532 | 2.96875 | 3 | [] | no_license | #include <Servo.h>
Servo servo9;
Servo servo10;
Servo servo11;
Servo servo12;
//Servo servo13;
void setup()
{
servo9.attach(9);
servo10.attach(10);
servo11.attach(11);
servo12.attach(12);
//servo13.attach(13);
}
void loop()
{
servo9.write(110);
delay(1000);
servo10.write(80);
delay(1000);
servo1... | true |
f05d2a66f2be8cec96af82fdd8ec768240bd83a0 | gabriellaec/desoft-analise-exercicios | /backup/user_186/ch20_2020_09_27_21_43_00_990490.py | UTF-8 | 199 | 3.40625 | 3 | [] | no_license | #Preço da Passagem
km=float(input("Quantos km? "))
taxa=5/10
Preco=taxa*km
if km<=200:
Preco=taxa*km
else:
Preco=200*(5/10)+(45/100)*(km-200)
print ("A passagem custa: {:.2f}".format(Preco)) | true |
622109d1b09a7e0602e2a6bc46cc1f3b3f27bcd1 | zoolhasson/gluon-ts | /src/gluonts/torch/distributions/discrete_distribution.py | UTF-8 | 6,435 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | true |
ec2d4aba6f1562a6d4a47641996df3bf8d5ab28c | finiteautomata/nlp-tools | /nlptools/stemming.py | UTF-8 | 7,306 | 3.65625 | 4 | [] | no_license | import re
import operator
def is_cvc(word):
return pattern(word)[-3:] == "CVC" and word[-1] not in ['w', 'x', 'y']
def same_last_letters(word):
return len(word) >= 2 and word[-1] == word[-2]
class EmptyRule:
def apply(self, word):
return word
class Rule:
def __init__(self, suffix, replacemen... | true |
f665694f27cf26241ced72a68b5953b17484058e | AdamZhouSE/pythonHomework | /Code/CodeRecords/2520/60771/287687.py | UTF-8 | 690 | 3.203125 | 3 | [] | no_license | #01
R = int(input())
C = int(input())
r0 = int(input())
c0 = int(input())
matrix = []
pointAndDistance = {}
outcome = []
for i in range(0,R): # 初始化
for j in range(0,C):
part = [i,j]
matrix.append(part)
for i in range(0,len(matrix)):
distance = abs(matrix[i][0]-r0) + abs(matrix[i][1]-c0)
po... | true |
659ca5d11750916fbab3920b751ce8bae1808f41 | antjimar/Friker | /frikr/photos/permissions.py | UTF-8 | 1,471 | 2.953125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from rest_framework.permissions import BasePermission
class UserPermision(BasePermission):
def has_permission(self, request, view):
"""
Queremos que:
- Solo los administradores puedan ver el listado o detalle de cualquier usuario (GET)
- Cualquiera... | true |
0c737ad1914528eceaedbfbc30cd8faba48cf307 | hieugomeister/ASU | /CST100/chfind3.py | UTF-8 | 421 | 4.03125 | 4 | [] | no_license | def find3(astring, achar, start=0):
"""
Find and return the index of achar in astring.
Return -1 if achar does not occur in astring.
"""
ix = start
found = False
while ix < len(astring) and not found:
if astring[ix] == achar:
found = True
else:
ix ... | true |
d5f1c370d0f639d7c2bb5bf4ba4466dc03ee62f0 | Pigmiral/Ejercicios-Python | /ejercicio_6.ty.py | UTF-8 | 134 | 3.125 | 3 | [] | no_license | peso =float(input("digite su peso"))
estatura= float(input("digite su estatura"))
print("su imc actual es de ",peso/pow(estatura,2))
| true |
a030aa0b2a6bca84511102b7d54d825024c76c1d | Drayton80/Learning | /Python/Natural Language Processing/Verb Conjugation/GramaticaPronome.py | UTF-8 | 1,446 | 3.109375 | 3 | [] | no_license | # Author: Drayton Corrêa Filho
# Email: <drayton80@hotmail.com>
# GitHub: Drayton80
#
# LAViD - Laboratório de Aplicações de Vídeo Digital
class GramaticaPronome:
def __init__(self):
self._pronomes = {}
self._pronomes['reto'] = {'1PS': ['eu'], '2PS': ['tu'], '3PS': ['ele', 'ela'], '1PP': ['nós'],... | true |
ed561c90639cfddf98d779b0498b5b17c057b241 | penda-diagne/projetMaster | /projets_probabilite/projet-1/binom_expo.py | UTF-8 | 695 | 2.796875 | 3 | [] | no_license | from numpy.random import binomial
import numpy as np
import scipy.stats as scs
import matplotlib.pyplot as plt
from scipy.stats import binom
plt.figure()
plt.subplot(2,2,1)
n, p, N = 20, 0.3, 50
X=np.random.binomial(n,p,N)
plt.bar(X,scs.norm.pdf(X,6))
plt.title("Densite de la loi Binomiale")
plt.subplot(2,2,2)
plt.bar... | true |
6a797f291e84c6d134537ece06f6766071180ceb | Ikaheishi/ProjectPrismarine | /modules/profiler.py | UTF-8 | 9,995 | 2.71875 | 3 | [
"MIT"
] | permissive | """Holds the profile cog."""
import logging
import re
import discord
from discord.ext import commands
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String, select
class SQLEngine:
"""Class containing the SQLEngine."""
engine = create_engine("sqlite:///ProjectPrismarine.db")
meta... | true |
d76002eb9fda18d6750af8f2adfe5dd044811c93 | ddipp/Euler_solutions | /p025.py | UTF-8 | 960 | 4.09375 | 4 | [] | no_license | #!/usr/bin/env python3
# ===============================================================================
# The Fibonacci sequence is defined by the recurrence relation:
#
# Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
#
# Hence the first 12 terms will be:
#
# F1 = 1
# F2 = 1
# F3 = 2
# F4 = 3
# F5... | true |
a04f6bac9fef1551d78b5fb6fcc0476b4314cb68 | ptbrowne/simple-dep-injection | /inject.py | UTF-8 | 2,781 | 3.40625 | 3 | [] | no_license | """
Proof of concept of doing dependency injection using functions.
Dependency injection
====================
Dependency injection is a form of Inversion of Control where
the user a service does not instantiate/call the service but where
the service is instantiated/called by the dependency injection
framework.
Here,... | true |
708153bde02638bbc605114e4056ae816e3ccd80 | tshankar35/pybasic | /Guessing Game Challenge.py | UTF-8 | 1,356 | 4.3125 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[3]:
print ("Welcome to the Guessing Game Challenge")
print ("Rules: ")
print ("1. The Computer Picks a number in the range of 1 to 100 and only computer knows it")
print ("2. The Player has to guess a number and the following messages will be displayed according to the gues... | true |
971c4fdf14b7cca5dc2ca749aa3746c03866f637 | Trackerming/bitcoin-sv | /test/functional/mempool_limit.py | UTF-8 | 4,088 | 3.03125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/usr/bin/env python3
# Copyright (c) 2020 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
# Test mempool limiting together/eviction with the wallet
# 1. Send transaction (cca 5MB) with smaller fee rate (0.00000399 BSV/kB).
# 2. Send 29 big transactions (cca ... | true |
7e33246b729b66dbcf4373bfe181cf737f6d2f16 | cksrb1616/Algorithm_past_papers | /dynamic_porgramming/dynamic_programming_8-11_soilder_allocation.py | UTF-8 | 269 | 3.03125 | 3 | [] | no_license | #longest increasing subsequences, LIS
#O(N^2)
n = int(input())
array = list(map(int, input().split()))
array.reverse()
dp = [1]*n
for i in range(0,n):
for j in range(0,i):
if array[j] < array[i]:
dp[i] = max(dp[i],dp[j] + 1)
print(n-max(dp)) | true |
69064897d9500e9d75a27b78a84f534d5a389f9a | sconr002/python-nfldata | /fantasypros_ff_projections.py | UTF-8 | 1,997 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
fantasypros_ff_projections.py
Usage:
fantasypros_ff_projections.py
optional arguments:
-h, --help show this help message and exit
--save_csv filename.csv
--save_json filename.json
'''
import argparse
import csv
import json
import logg... | true |
dc3da8c55bcb15b9e4bb801fd5079a259eb15251 | ntruongan/Artificia_lntelligence | /week03/An_NguyenTruong_18110246/An_NguyenTruong_18110246_code4.py | UTF-8 | 993 | 3.546875 | 4 | [] | no_license | # Tìm hoặc tạo một file dữ liệu tùy ý, định dạng csv. Đọc (dùng pandas) và vẽ dữ liệu trong file đó.
#-------Số lượng chợ có đến 31/12 hàng năm phân theo hạng và phân theo địa phương chia theo Hạng và địa phương và Năm
#-------Đơn vị tính: chợ
#-------Nguồn: Tổng cục thống kê
import pandas as pd
import numpy as np
im... | true |
bd8671e6a4accc6e061dfad75d746bcd69995321 | writefgj/todoparser | /parser.py | UTF-8 | 5,008 | 2.96875 | 3 | [] | no_license | import json
import requests
import os
import datetime
import time
from requests import RequestException
def response_from_api(url):
"""Запрашивает данные у сервера. Возварщает массив"""
response = None
try:
response = requests.get(url)
except RequestException:
print("Ошиб... | true |
ffeada7d0266e6ea40bcd8f0cc7474986692c32c | unscrollinc/unscroll | /server/bin/download/dl_google_mag.py | UTF-8 | 1,364 | 2.5625 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
from pprint import pprint
from unscroll import UnscrollClient
import datetime
import re
import datetime
from random import random
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36'
ISSN =... | true |
4c226b1fc11fa92af0e0ab8fbcbaf2f3d274d613 | reactome/reactome_gnn | /reactome_gnn/model.py | UTF-8 | 1,542 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | import torch
import torch.nn as nn
import dgl
from dgl.nn import GraphConv
class GCNModel(nn.Module):
"""
A model based on GCN layers. In a simple manner it takes the graph
and its features, first
"""
def __init__(self, dim_latent, num_layers=1, do_train=False):
"""
Parameters
... | true |
5f22393577613437c076395679a9aef379bdb7d9 | springer-math/Mathematics-of-Epidemics-on-Networks | /docs/examples/fig7p4.py | UTF-8 | 1,754 | 2.5625 | 3 | [
"MIT"
] | permissive | import networkx as nx
import EoN
from collections import defaultdict
import matplotlib.pyplot as plt
import scipy
import random
N=10**6
tau = 1.
gamma = 1.
colors = ['#5AB3E6','#FF2000','#009A80','#E69A00', '#CD9AB3', '#0073B3','#F0E442']
kave = 5
G = nx.fast_gnp_random_graph(N, kave/(N-1.))
initial_infecteds = rand... | true |
46fdf7a64f094af132ed76c5dec299944f4557dc | Skitzerkillax/budget_tracker | /budgetTracker.py | UTF-8 | 6,293 | 2.875 | 3 | [] | no_license | from __future__ import print_function
from appJar import gui
import sqlite3
import datetime
#GLOBAL VARIABLES
global sqlite_file, total_amount, date_time,description,message_board, cash_flow
sqlite_file = 'budgetTracker.sqlite'
total_amount = 0
date_time = " "
description = " "
message_board = " "
csh_flow = 0
#class ... | true |
ed384e31a58ddc5f7bde275f0238f4ceb987b7f3 | Max143/Python_programs | /odd and even.py | UTF-8 | 277 | 4.4375 | 4 | [
"MIT"
] | permissive | # Excercise - 2
print("Odd and Even")
while True:
user_input = int(input("Enter the number: "))
if user_input % 2 == 0 :
print("Entered number is even")
else:
print("Entered number is odd")
if user_input == "quit":
break
| true |
c9040ccd4b03385d6d4f17096bc4d9755b4faec3 | umyuu/Sample | /src/Python3/Q108589/exsample.py | UTF-8 | 396 | 3.359375 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import random
def main():
item = {'peach': '4', 'melon': '4', 'Cherry': '1', 'orange': '3', 'Grape': '4', 'persimmon': '3', 'strawberry': '3',
'watermelon': '7', 'pear': '4', 'grapefruit': '3', 'banana': '2', 'Apple': '5', 'pineapple': '6'}
fruit, val = random.choice(list(i... | true |
692fa805dc61e03b67ad01a029af04c6bf69f880 | imPatidar/HackerRankPythonProblems | /subsets.py | UTF-8 | 368 | 3.4375 | 3 | [] | no_license | def subsets(s):
if not s:
return [s]
sets = [s]
for i in range(0, len(s)):
tmp_subsets = subsets(s[:i] + s[i + 1:])
for subset in tmp_subsets:
if subset not in sets:
sets.append(subset)
return sets
s = [g for g in range(10)]
k = subsets(s)
for x in k... | true |
b0f2dcb1ba7803e4f1a7f768da247a54f29a0059 | jdiazmx/Ricnar-Exploit-Solutions | /Easy/008/exploit.py | UTF-8 | 1,433 | 3.171875 | 3 | [] | no_license | #Solucion stack5 http://www.ricardonarvaja.info/WEB/EXPLOITING/Nivel%20Basico/011%20stack8.idb/Soluciones/
#Esta solucion se desarrollo en linux Ubuntu 14.04 64 bits
#Se elimino #include "stdafx.h" del codigo fuente y se compilo con:
#gcc -m32 -fno-stack-protector -z execstack -fpermissive stack5.cpp -o stack5
import ... | true |
3c3b3b8501389933f01802a3a54e0cf9a3cbdb81 | little-young/home-assist | /homeassist/models/example.py | UTF-8 | 3,438 | 2.53125 | 3 | [] | no_license | # -*- encoding: utf-8 -*-
"""
@File : example.py
@Time : 2020/7/28 0028 01:18
@Author : delphi.young
@Email : -
@Software: PyCharm Community Edition
"""
import datetime
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String,... | true |
9987ee74e50abaa58c6832bcded279d86deb7580 | ArianPH/OWASP-Honeypot | /tests/test_core_compatible.py | UTF-8 | 760 | 2.734375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | import unittest
from unittest.mock import patch
import sys
from core.compatible import byte_to_str, is_verbose_mode
class TestCoreAlert(unittest.TestCase):
def test_run_with_verbose_option(self):
testargs = ['python3', 'ohp.py', '--verbose']
with patch.object(sys, 'argv', testargs):
r... | true |
ed32fd15ae2da3e5fbbbf96c0f129afa38c625ea | itsolutionscorp/AutoStyle-Clustering | /all_data/exercism_data/python/etl/18aecb5c292148c793cd75ed27b5a6e1.py | UTF-8 | 162 | 3.078125 | 3 | [] | no_license | def transform(old):
new = dict()
for score, letters in old.items():
for letter in letters:
new[letter.lower()] = score
return new
| true |
a2db787acdbad1dae286f7c66c3fff80d1137a0a | IDAPluginProject/x64dbg_TraceExecLoggerPlugin | /LogJsonSchema/validate_json.py | UTF-8 | 633 | 2.546875 | 3 | [] | no_license | from jsonschema import validate, RefResolver
import json
import os
import sys
def validate_file(path):
print(path)
f = open(path)
json_data = json.load(f)
f.close()
f = open("schema.json")
schema = json.load(f)
f.close()
schema_path = "file:///{0}/".format((os.getcwd()).replace("\\",... | true |
2576c5962eb0b764b834f5f3efcda7cf37765961 | Cnguyen823/MineSweeper | /Basic Agent/piece.py | UTF-8 | 962 | 3.515625 | 4 | [] | no_license | class Piece():
def __init__(self, isBomb):
self.isBomb = isBomb
self.clicked = False
self.flagged = False
self.index = ()
def getIsBomb(self):
return self.isBomb
def getClicked(self):
return self.clicked
def getFlagged(self):
return self.flagged... | true |
3d6467df26487b3a24153f633f8381dcdf0982ea | farrellsc/ContentSpecificStyleTransfer | /SuperStyleTransfer/Data/UnalignedDataSet.py | UTF-8 | 821 | 2.53125 | 3 | [] | no_license | import random
from torch.utils.data import DataLoader
class UnalignedDataset(DataLoader):
@staticmethod
def modify_commandline_options(parser, is_train):
return parser
def __init__(self, content_dataset, style_dataset, batch_size=1):
super(UnalignedDataset, self).__init__(None, batch_size... | true |
8c46de9ab4b8dbfe9b53745a51a88057411eb781 | DIN-Lab/PTX | /ptx.py | UTF-8 | 758 | 2.609375 | 3 | [
"MIT"
] | permissive | import datetime
import hmac
import base64
def getDatetimeString(dt=datetime.datetime.utcnow()):
return datetime.datetime.strftime(dt, '%a, %d %b %Y %H:%M:%S GMT')
def getSignature(dt_str, app_id, app_key):
dt_str = 'x-date: ' + dt_str
h = hmac.new(app_key.encode('utf-8'),
msg=dt_str.enc... | true |
7132b143139016c944d6bc66bb305e18cf82918a | Marcel5751/garbage-collection-calendar-bremen | /iCalExport.py | UTF-8 | 3,490 | 2.9375 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import os
from datetime import datetime
import pytz
from icalendar import Calendar, Event
from icalendar import vText
PATH_TO_OUTPUT_FOLDER = "./ics-data"
total_number_of_events = 0
def create_ical_file(list_of_events, strasse, hausnummer):
""" Creates an iCal file from a list of Events
... | true |
60097cd617d89758293600dd64330af2fefdd36e | jjayub/Makneep | /Game.py | UTF-8 | 6,164 | 3.015625 | 3 | [] | no_license | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from UI import *
from Board import *
from game_init import *
from pygame.locals import *
class Game:
def __init__(self):
self.ui = UI(menu=True)
self.board = Board()
self.turn = BL... | true |
a11b0a484d4e69e5ba5730d561078376fa95f5f5 | SachinKonan/Windows-RPI-Vision-Framework | /VisionCode/hist.py | UTF-8 | 445 | 2.890625 | 3 | [
"MIT"
] | permissive | import cv2
import numpy as np
from matplotlib import pyplot as plt
def onmouse(k, x, y, s, p):
global hsv
if k == 1: # left mouse, print pixel at x,y
print(hsv[y, x])
lower_green = (55, 130, 20)
upper_green = (90, 256, 180)
img = cv2.imread('Target.png')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h... | true |
fad7678b75173a0e63c89b3b8328694a4aa0cccf | nekoTheShadow/my_answers_of_yukicoder | /0018.py | UTF-8 | 270 | 3.296875 | 3 | [] | no_license | import string
if __name__ == '__main__':
line = input()
tp = tuple(string.ascii_uppercase)
ls = []
for i, ch in enumerate(line):
idx = tp.index(ch) - i - 1
while idx < 0: idx += 26
ls.append(tp[idx])
print(''.join(ls))
| true |
c5f1ee49cf49e757c1600b9734561876c75a8614 | Kkrishnakan/ML-Machine-Learning | /data maping/code/dt_model.py | UTF-8 | 997 | 2.828125 | 3 | [] | no_license | #-*- coding: utf-8 -*-
#Building a CART Decision Tree Model
import pandas as pd
from random import shuffle
import matplotlib.pyplot as plt
datafile = '../data/model.xls'
data = pd.read_excel(datafile)
data = data.as_matrix()
shuffle(data)
p = 0.8 #Set training data ratio
train = data[:int(len(data)*p),:]
test = data[... | true |
7249c371dba8a92cc023617a848f86c6da149a88 | nathanawmk/querybook | /querybook/tests/test_lib/test_query_executor/test_connection_string/test_sqlalchemy.py | UTF-8 | 3,038 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | from unittest import TestCase
from lib.query_executor.connection_string.sqlalchemy import (
_get_sqlalchemy_create_engine_kwargs,
)
class CreateEngineKwargsTestCase(TestCase):
def test_empty(self):
self.assertEqual(_get_sqlalchemy_create_engine_kwargs({}), ("", {}))
self.assertEqual(
... | true |
e448f4164a67c7b2ba26916c6dc83e0a87cbca51 | lbbgit/PythonDemo | /s3.py | UTF-8 | 1,919 | 3.125 | 3 | [] | no_license | # coding:utf8
import urllib2,cookielib
url = "https://www.baidu.com"
print '第一种方法'
response1 = urllib2.urlopen(url)
print response1.getcode() #返回状态码
print len(response1.read()) #返回的网页内容的长度
print "第二种方法"
request = urllib2.Request(url)
request.add_header("user-agent","Mozilla/5.0")
response2 = urllib2.urlopen(request)... | true |
751bd0048ae7d62fa83c7b90fae0c191e6ebdba7 | gimmy49699/MachineLearningNotes | /MachineLearningCode/SupportVectorMachine.py | UTF-8 | 8,698 | 3.203125 | 3 | [] | no_license | '''
Implementing of Support Vector Machine with soft margin and kernel function.
min{a} (1/2)∑i∑j[aiajyiyj*K<xi,xj>] - ∑i[ai]
s.t. ∑i[aiyi] = 0
0 ≤ ai ≤ C , i = 1, 2, ..., N
SMO algorithm:
1) Initialize alpha, beta = [0, ..., 0], 0
2) Find alpha_1 by:
... | true |
88946d342c93d9b66c58dfa6e15b83e543b8117b | kopok2/CodeforcesSolutionsPython | /src/1080B/test_cdf_1080B.py | UTF-8 | 582 | 2.625 | 3 | [
"MIT"
] | permissive | import unittest
from unittest.mock import patch
from cdf_1080B import CodeforcesTask1080BSolution
class TestCDF1080B(unittest.TestCase):
def test_1080B_acceptance_1(self):
mock_input = ['5 1 3 2 5 5 5 4 4 2 3']
expected = '-2 -2 -5 4 -1'
with patch('builtins.input', side_effect=mock_input... | true |
34781058b932d55c70431c3b6b51d5717bfebbdd | jacksonyoudi/AlgorithmCode | /PyProject/crawl/taogia/gia_3.py | UTF-8 | 1,700 | 2.65625 | 3 | [] | no_license | # -*- coding:utf-8 -*-
# author: youdi
# datetime: 2020/7/2 23:00
# software: IntelliJ IDEA
import csv
from bs4 import BeautifulSoup
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
import redis
import json
def get_gia_info(html):
soup = BeautifulSoup(html, 'html.parser')
... | true |
4b0898e50f080335178cfa8562df478c2b97b530 | Lunik/node-raspberry-api | /src/sensor/pysrc/gyroscope.py | UTF-8 | 199 | 2.609375 | 3 | [] | no_license | from sense_hat import SenseHat
sense = SenseHat()
sense.clear()
pitch, roll, yaw = sense.get_gyroscope_raw().values()
print("{"+"\"p\": "+str(pitch)+", \"r\": "+str(roll)+", \"y\": "+str(yaw)+"}")
| true |
7a37b27dee191fd186e9bf521eb77501a9b08272 | yoshiyoshiharu/leetcode | /a-106.py | UTF-8 | 187 | 2.8125 | 3 | [] | no_license | import math
import sys
N = int(input())
for a in range(1 , 100):
for b in range(1 , 100):
if 3**a + 5**b == N :
print(a , b)
sys.exit()
print("-1")
| true |
a69e1196f83c638365ab132da17665c21982f194 | magicaugust/The-Examination-of-Huawei-2016-Campus-Recruitment | /华为2016校园招聘上机笔试题:最高分是多少.py | UTF-8 | 2,112 | 3.78125 | 4 | [] | no_license | '''
[编程题] 最高分是多少
时间限制:1秒
空间限制:65536K
老师想知道从某某同学当中,分数最高的是多少,现在请你编程模拟老师的询问。当然,老师有时候需要更新某位同学的成绩.
输入描述:
输入包括多组测试数据。
每组输入第一行是两个正整数N和M(0 < N <= 30000,0 < M < 5000),分别代表学生的数目和操作的数目。
学生ID编号从1编到N。
第二行包含N个整数,代表这N个学生的初始成绩,其中第i个数代表ID为i的学生的成绩
接下来又M行,每一行有一个字符C(只取‘Q’或‘U’),和两个正整数A,B,当C为'Q'的时候, 表示这是一条询问操作,
他询问ID从A到B(包括A,B)的... | true |
68aa38688b8fca0d43c5147cd7b1e14761fd346f | banana-galaxy/challenges | /challenge19(prime)/solutions/Arnav.py | UTF-8 | 650 | 2.703125 | 3 | [
"MIT"
] | permissive | def f(n,e) :
hm=[]
for i in range (2, n):
if (e % i == 0):
hm.append(i)
while (e%i == 0):
e = e/i
return hm
def solution(n,l) :
c=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', ... | true |
27aa33fa82d5200fde9cf0e189c79f184910db56 | lcs-grtsch/Machine-Learning | /Udemy TensorFlow/Implementing Regression Problem.py | UTF-8 | 2,740 | 3.59375 | 4 | [] | no_license | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(101)
tf.set_random_seed(101)
#######################################################################
# Example Neural Network
#######################################################################
#
# # Number of features
# n_f... | true |
29e657eb0d02a742db5d756fb8dab846e6f7fc62 | jkobject/chipseq | /bin/check_design.py | UTF-8 | 8,642 | 2.890625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
#######################################################################
#######################################################################
## Created on April 4th 2019 to check nf-core/chipseq design file
#######################################################################
###############... | true |
128118f85bafdc6f7485c7865bf0ec190b921095 | dastultz/micropython-kabuki | /kabuki/__init__.py | UTF-8 | 1,133 | 2.734375 | 3 | [] | no_license | from kabuki.controller import Controller, FunctionInput, ValueInput
from kabuki.operators import Operand
""" Provide a default controller and façade methods. """
_default_controller = Controller()
def node_from_function(supplier):
"""
Create a node with a value supplied by a function.
:param supplier: A... | true |
4bc67e286b53af49bb3bf603f43c023a13603710 | sktime/sktime | /sktime/transformations/hierarchical/reconcile.py | UTF-8 | 18,935 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements hierarchical reconciliation transformers.
These reconcilers only depend on the structure of the hierarchy.
"""
__author__ = ["ciaran-g", "eenticott-shell", "k1m190r"]
from warnings import warn
import numpy as np
import pandas as p... | true |
4f2b48865c6c065dcd4360104b4a0ff4f58c4f9d | rmamba/pyLucasLehmer | /MersennePrime/__init__.py | UTF-8 | 7,807 | 3.59375 | 4 | [
"MIT"
] | permissive | """
Python library to test Mersenne prime numbers with Lucas-Lehmer algorythm.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the results
(TextTestRunner).
Simple... | true |
35dcd2e98616a21a8dcbacb7d075dc855fbbcd34 | CalmScout/LeetCode | /Python/easy/1394_find_lucky_integer_in_an_array.py | UTF-8 | 1,185 | 3.953125 | 4 | [
"MIT"
] | permissive | """
Given an array of integers arr, a lucky integer is an integer which has a frequency in the array equal to its value.
Return a lucky integer in the array. If there are multiple lucky integers return the largest of them. If there is no
lucky integer return -1.
"""
from typing import List
from collections import Count... | true |
dc3733313e92822a45947d02a3421173c6c1b769 | easy-software-ufal/easyexperiment | /experiments/managers/latin_square_manager.py | UTF-8 | 691 | 2.65625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import random
from django.db import models
class LatinSquareManager(models.Manager):
def create_with_rows(self, experiment):
from experiments.models import LatinSquare
latin_square = LatinSquare.objects.create(
experiment=experiment,
frame_sequenc... | true |
886d75eb51e6e880a474c6c94192a048db96c04d | RealImpactAnalytics/airflow | /airflow/hooks/slack_hook.py | UTF-8 | 2,265 | 2.5625 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"BSD-2-Clause"
] | permissive | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | true |
ffb656880cee07c289db8016c89e66c0b88544bc | omullo/piprojs | /Assignments/a1/python a1/a1..... 2.i/get_status_from_webpage.py | UTF-8 | 1,289 | 3.25 | 3 | [] | no_license | # get_status_from_webpage.py
# Prof. Lee (cs1110-prof@cornell.edu)
# Feb 14 2018
""" Allow user to repeatedly query a file to find out the
open/closed status of a class lecture or section. """
import a1
import urllib.request
import sys
data_name = input('Enter a roster website URL, including the http part: ')
t... | true |
c77f786ed9de87ba4798c824a08e62f3f9faa9a1 | kenkeiras/moovida-liberateca-plugin | /elisa/plugins/liberateca/liberateca.py | UTF-8 | 3,677 | 2.8125 | 3 | [] | no_license | # -*- encoding: utf-8 -*-
# Written by kenkeiras
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# ... | true |
d3cac5233cfdc74defed9f9e0d035ef488e5eb35 | eMZet777/python | /33 zagniezdzone typy danych lekcja 33.py | UTF-8 | 1,539 | 3.34375 | 3 | [] | no_license | # TYPY ZAGNIEZDZONE
imie = "Arkadiusz"
wiek = 29
plec = "mezczyzna"
imie2 = "Wioletta"
wiek = 23
plec = "kobieta"
#krotki :
osoba1 = ('Arkadiusz', 29, 'mezczyzna')
osoba2 = ('Wioleta', 23, 'kobieta')
osoba3 = ('Kuba', 33, 'mezczyzna')
# rozwiazanie poprzez typy zagniezdzone jak nizej poprzez listy"
"""
listaGos... | true |
9cd69f3f5cde0de27cf9d09412261350c32cb664 | LegendZh/tensorflow-learning | /GAN实战/gan.py | UTF-8 | 3,103 | 3.046875 | 3 | [] | no_license | """
实战操作GAN网络,使用Anime数据集作为例子
GAN网络比较复杂,具体解析见 https://blog.csdn.net/ifreewolf_csdn/article/details/89309912
WGAN的介绍见 https://www.cnblogs.com/Allen-rg/p/10305125.html
DCGAN的介绍见 https://blog.csdn.net/qq_33594380/article/details/84135797
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from t... | true |
f8e049739cf62baed07cd5bc83aec0b563d00823 | stevenpelley/gloomhaven-monster-ai | /src/graph.py | UTF-8 | 13,771 | 3.328125 | 3 | [
"MIT"
] | permissive | """Define and operate on graph objects."""
import abc
import collections
import collections.abc
import functools
import json
import logging
import queue
import typing
# each module/file should provide a global-level logger using this statement
logger = logging.getLogger(__name__)
"""A graph vertex is any hashable obj... | true |
6c0a7de851be398d18ce2a383c61dcc81c109285 | yjh8806/python-2019-July | /파이썬게임/10월 파이썬 우수연 박주형-퀴즈쇼 ★/01.게임.py | UTF-8 | 4,446 | 3.390625 | 3 | [] | no_license | #서바이벌퀴즈게임
#처음 100명이서 같이 퀴즈 시작->단계별로 몇명씩 죽었는지 알려주는 게임
#만약 틀리면 게임오버
#만약 게임 다 맞추면 상금부여(1억)
import random as r
class Quiz: #클래스 선언
def __init__(self):
self.quiz_list1 = {"2006년 팬택 SKY 휴대폰 CF에 출연한 배우 박기웅이 추었던 춤으로, 거북이 처럼 목을 뺀 뒤 빙빙 돌리는 이 춤의 이름은":"맷돌춤",
"조선 중기에 지었다고 하는 고전소설인 '홍길동전'의 저자는":"허균",
"이탈리아의 물리학자... | true |
f6f4c2c373d05f7052b5d2dc2f55fdb05c660ded | jimmy-sonny/IDACyber | /cyber/histogram.py | UTF-8 | 3,015 | 2.53125 | 3 | [
"MIT"
] | permissive | from math import log
from idacyber import ColorFilter
import ida_kernwin
# http://www.color-hex.com/color-palette/54234
# taken from http://blog.dkbza.org/2007/05/scanning-data-for-entropy-anomalies.html
def H(data):
if not data:
return 0
entropy = 0
for x in range(256):
p_x = float(data.c... | true |
c9efd5c94c762faccf83fc53c4e4d197193f4828 | ankiwoong/Check_Io | /Home/Backward_Each_Word.py | UTF-8 | 1,903 | 4.53125 | 5 | [] | no_license | '''
Backward Each Word
In a given string you should reverse every word, but the words should stay in their places.
Input:
A string.
Output:
A string.
Example:
backward_string_by_word('') == ''
backward_string_by_word('world') == 'dlrow'
backward_string_by_word('hello world') == 'olleh dlrow'
backward_string_by_word... | true |
62604ed934bba80ca79f9c5ba1c8bb2495dd803a | emendes28/microservice-generator | /src/main/resources/archetype-resources/replacer.py | UTF-8 | 2,400 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | import os
import argparse
parser = argparse.ArgumentParser(description="Replacer")
parser.add_argument('-i','--replace_input', help='Replace from', required=True)
parser.add_argument('-o','--replace_output', help='Replace to', required=True)
parser.add_argument('-p','--path', help='Path', required=True)
opts = parser... | true |
441df4a9dae2b91a76562977facba4c7572d06f6 | gabriellaec/desoft-analise-exercicios | /backup/user_344/ch28_2019_04_04_16_06_31_545928.py | UTF-8 | 189 | 3.0625 | 3 | [] | no_license | v=int(input('Qual velocidade?')
vmax=80
if v>vmax:
multa= 5*(v-vmax)
print('Sua multa foi de {0:.2f}'.format(multa))
else:
print('Não foi multado')
| true |
745f1555866e97de748399119e0daf2570475d5e | kapuskaFaizan/Data-Structures | /D_LinkedList.py | UTF-8 | 4,872 | 3.09375 | 3 | [] | no_license | #vehicle_model
class vehicle_model:
def __init__(self,vin,model_name,year):
self.vin = vin
self.model_name = model_name
self.year = year
def __add__(self, other):
x = self.year + other
return '(%s,%s,%d)' % (self.vin,self.model_name,x)
def __repr__(self):
... | true |
1a1dc47b50cc65050d270e8386799187aebbbc9a | liliankotvan/urionlinejudge | /URI1038.py | UTF-8 | 295 | 3.390625 | 3 | [] | no_license | x, y = map(int, raw_input().split(" "))
dictionary = {1: 4.0,
2: 4.5,
3: 5.0,
4: 2.0,
5: 1.5
}
if x in dictionary.keys():
resultado = dictionary.get(x) * y
print ("Total: R$ {:.2f}".format(resultado)) | true |
01650efa7524d08876f3850d844a05843bc045a8 | emuro7/learn-python | /python_work/part_three/ranges.py | UTF-8 | 559 | 4.0625 | 4 | [] | no_license | for value in range (1,5):
print(value)
numbers = list(range(1,6))
print(numbers)
even_numbers = list(range(2,11,2))
print(even_numbers)
squares = []
for value in range(1,11):
square = value**2
squares.append(square)
print(squares)
squares = []
for value in range(1,11):
squares.a... | true |
3624aa1d374c4cee18fbc02f03da424caaa38d14 | matthew-williams1/HRG-Ising | /Field Recognition NN/Shape Recognition.py | UTF-8 | 7,578 | 2.609375 | 3 | [] | no_license | import numpy as np
import torch as t
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pickle
import pandas as pd
import... | true |
8ef2c7d3c513cf40e0e17a2a7bdd4d9cebf20424 | douglas-archives/Learning-Python | /tips-tricks-hacks.py | UTF-8 | 3,838 | 4.3125 | 4 | [] | no_license | # Para estudo de mais dicas basta ir direto a fonte que foram retirados os exemplos:
# http://www.siafoo.net/article/52
# Voce pode incorporar certas estruturas de codigo em lugares bem diferentes em Python
# Por exemplo um for dentro de um if
numbers = [1,10,100,1000,10000]
if [number for number in numbers if number... | true |