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 |
|---|---|---|---|---|---|---|---|---|---|---|
bb1d5874958d7604fd249c5b8a2406877594dbe7 | elizabethschall2934/Project-2 | /Veronica/misc scripts/Count-unique.py | UTF-8 | 563 | 2.9375 | 3 | [] | no_license | import json
unique = []
with open("small_data.json", encoding="utf-8") as f:
data = json.load(f)
i = 0
for x in data:
# Parse address components
street = data[i]["contact"]["address"]["address1"]
city = data[i]["contact"]["address"]["city"]
state = data[i]["contact"]["addr... | true |
9e65781ef03c881e970b7d45ccc61d06a6070659 | alfian853/py-chat | /py-chat/client/activities/contact_activity.py | UTF-8 | 2,740 | 3.015625 | 3 | [] | no_license | import socket
from activities.abstract_activity import AbstractActivity
from activities.activity_container import ActivityContainer
from activities.private_chat_activity import PrivateChatActivity
class ContactActivity(AbstractActivity):
instance = None
@staticmethod
def get_instance(connection: socket... | true |
2a5340ada063d47971a330bfc62a149afee1ecbc | ezyang/ghstack | /ghstack/shell.py | UTF-8 | 11,678 | 2.9375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import asyncio
import logging
import os
import shlex
import subprocess
import sys
from typing import Any, Dict, IO, Optional, overload, Sequence, Tuple, TypeVar, Union
# Shell commands generally return str, but with exitcode=True
# they return a bool, and if stdout is piped straight to sys.stdo... | true |
c179d7b2945d0138313f6aee23ffd7ef9423ba57 | ameybhavsar24/competitive-programming | /SPOJ/ADDREV.py | UTF-8 | 186 | 3.078125 | 3 | [] | no_license | # your code goes here
t = int(input())
while t:
n,m = map(int,input().split())
n=str(int(str(n)[::-1]))
m=str(int(str(m)[::-1]))
print(int(str(int(n)+int(m))[::-1] ))
t-=1
| true |
74de932df3c6db5c3b29525b8648409b0c9818ba | gizemgndy/Python-Metrics | /metrics.py | UTF-8 | 1,206 | 4.1875 | 4 | [] | no_license | import random
#nxn 2d list generating method
def myList(rows, cols):
matrix = []
#The loop that fills the sent row and column up to 2d list with 100-200 random numbers
for r in range(0, rows):
matrix.append([random.randrange(100,200) for c in range(0, cols)])
return matrix
print("---... | true |
9fa10719a16b84197c910d89f5d71e620d128d9d | badboycxcc/security | /python/getMeezin.py | UTF-8 | 2,061 | 2.703125 | 3 | [] | no_license | #!/usr/bin/python
#encoding:utf-8
import time
import urllib
import sys
import os
import requests
from bs4 import BeautifulSoup
#####################
# Use:
# ./getMeezin.py 1 1080
#
def getPicId(num):
# 返回双位的字符串
if len(str(num)) == 1:
return '0'+str(num)
else:
return str(num)
def sav... | true |
5f0b0434382c5cbb0abb50b846ec316f4ca7abd3 | L4RBI/FCM-x-Metaheuristics | /tools.py | UTF-8 | 2,083 | 2.875 | 3 | [] | no_license | from matplotlib.image import imread
import matplotlib.pyplot as plt
from math import sqrt
import math
import random
import numpy
import operator
from scipy.spatial.distance import cdist
from scipy.linalg import norm
#computes the histogram of an image
def Histogram(path):
image = imread(path)
if len(image.sha... | true |
c899c9e25e15438793a61bba79a1ce3310bd9fb8 | Yuranus/Leetcode-Chinese-Version | /Code/434.字符串中的单词数.py | UTF-8 | 525 | 4 | 4 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
'''
统计字符串中的单词个数,这里的单词指的是连续的不是空格的字符。
请注意,你可以假定字符串里不包括任何不可打印的字符。
示例:
输入: "Hello, my name is John"
输出: 5
'''
class Solution:
def countSegments(self, s):
"""
:type s: str
:rtype: int
"""
if len(s)==0:
return 0
return len(s.split())
... | true |
37e0541a8fccf774b77ad794a5bb66bfb499d88f | blackskygg/S33dCup2016 | /python_snippet/gen_ast.py | UTF-8 | 247 | 2.65625 | 3 | [] | no_license | # coding=utf-8
# cannot parse comments
import pycparser
with open("input.txt") as f:
raw = "void program() {\n" + f.read() + "}\n"
parser = pycparser.c_parser.CParser()
ast = parser.parse(raw, filename='input.txt').ext[0].body
ast.show()
| true |
bfb16567d035fe7d14c5a860984b33c6b3c7d57a | ljm198134/Vessel-Captcha | /captcha/utils/wnetseg.py | UTF-8 | 6,908 | 2.96875 | 3 | [] | no_license | """
File name: wnetseg.py
Author: ngocviendang
Date created: July 13, 2020
This file defines the 2D-WnetSeg architecture.
Reference https://github.com/prediction2020/unet-vessel-segmentation
"""
from keras.models import Model
from keras.layers import Dropout, Convolution2D, MaxPooling2D, Input, UpSampling2D, concatena... | true |
57c67e862a45f717cb4681a600912729b002ad4c | masoom-A/Python-codes-for-Beginners | /test array is duplicate or not.py | UTF-8 | 196 | 3.1875 | 3 | [] | no_license | def numbers(data):
if len(data)==len(set(data)):
return True
else:
return False
print(numbers([1,2,4,5]))
| true |
0dc4cbe38373b98c0b908e650f2fcfdcd7fcde0a | samuelstevens/arxiv-edits | /arxivedits/detex/opendetex.py | UTF-8 | 3,587 | 2.75 | 3 | [] | no_license | """
Exports detex_file(), which extracts text using `opendetex` and extensive preprocessing.
"""
import subprocess
import re
import logging
from arxivedits.detex import latex
from arxivedits.detex.constants import INLINE_MATH_TAG, ACKNOWLEDGEMENT_PATTERN
from arxivedits.structures import Result
TMP_NOUN_TAG = "[TMP... | true |
fd4c4c7b5e34e600aa74457df8fdcbbf33c99e88 | jonfisik/ScriptsPython | /Scripts4/Script28.py | UTF-8 | 783 | 4.53125 | 5 | [
"MIT"
] | permissive | '''Jonatan Paschoal - 15 /05 /2020. Condicionais if, else. Escreva um programa que faça o computador pensar em um número inteiro entre 0 e 5 e peça para o usuário tentar descobrir qual foi o número escolhido pelo computador. O computador deverá escrever na tela se o usuário venceu ou perdeu.'''
import random
print('--... | true |
8afdf0ff50f8eda14643b3129e220b9574e8edaa | kevinleequinn/samples | /phonegap_serve.py | UTF-8 | 3,410 | 2.515625 | 3 | [] | no_license | #!/usr/bin/python
import cgi, re
FORM = cgi.FieldStorage()
# this script is used to insert descrepancies whether it's a browser or the Cordova/Phonegap app.
def cordova_swap():
"""determine cordova specifics and fill swap dictionary with replacements for browser vs app"""
# gather specifics from cordova param and p... | true |
52daddecd77819dcd484f001e5a141f872ebb2af | CodeLagos/Batch-Five | /Isolo/Python/electronicVoting.py | UTF-8 | 1,926 | 3.734375 | 4 | [] | no_license | print("OJIKUTU PAUL TEMIDAYO")
print("dayo.ojikutu@gmail.com")
print("08030561715")
print("This program will be used for Electronic Voting \nUser have to be 18 years and above to participate")
print("Voting can be stopped at anytime by typing 'end' to view the results")
print("Batch 5 CodeLagos\n\n")
voteADP=0
voteAP... | true |
03c82124d2c09b02ef3c8e10f36b82c3eb00a419 | FcoLopezQ/MachineLearning | /LogisticRegression/Log_Regression_MNIST.py | UTF-8 | 6,407 | 3.359375 | 3 | [] | no_license | # ===========================================================================
# Logistic Regression By Hand - Training of Model
# Author: Francisco Iván López Quihuis
#
# References:
# Code Reference:
# Valdés Aguirre, Benjamin (2021) perceptron vectorized.py
# Ng, Andrew (n.d.) Deeplearning AI Course
#
#... | true |
ecd5353d295d289981c43ac85c51184ca250603d | fmproduct/AnalysisPolindromyNumbers | /source/polindrome_file_writer.py | UTF-8 | 524 | 3.390625 | 3 | [] | no_license |
def reverse(data):
s = str(data)
return int(s[::-1]);
def isPolindrome(d):
return reverse(d) == d
i = 0
f = open("note.txt", "w+")
x = 10
y = 9000000000000000000
for j in range(x,y):
f.write('------------------------------------------ \r\n')
f.write('original: '+str(j)+"\r\n")
while not isPolindrome(j):
if... | true |
c7bfca28dfcacf9005fa4e77e25b8115613f862c | Goddiemk/API | /apicall.py | UTF-8 | 347 | 2.75 | 3 | [] | no_license | import requests
import json
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('type', help='Type of currency')
parser.add_argument('date', help='Date (dd-mm-yyyy)')
args = parser.parse_args()
r = requests.get('http://forex.cbm.gov.mm/api/history/%s' % args.date)
data = json.loads(r.content)
print... | true |
197ba91a1e99ac0b79b5cdec712afde1efc0dd06 | RajaShekhar1/IPC | /taa/services/products/payment_modes.py | UTF-8 | 1,775 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
MODE_WEEKLY = 52
MODE_BIWEEKLY = 26
MODE_SEMIMONTHLY = 24
MODE_MONTHLY = 12
MODE_CHANGEABLE = -1
MODES_BY_MODE = {
MODE_WEEKLY: u'weekly',
MODE_BIWEEKLY: u'biweekly',
MODE_SEMIMONTHLY: u'semimonthly',
MODE_MONTHLY: u'monthly',
}
MODES_BY_NAME = dict(zip(MODES_BY_MODE.values(),... | true |
6d1d8dbd72682e7746cf3bad1e5caa15126691a5 | sreeharshaparuchur1/media_data_tracker | /main.py | UTF-8 | 4,855 | 2.71875 | 3 | [] | no_license | from flask import Flask, request
from flask_restful import Api, Resource, reqparse, abort, fields, marshal_with
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
api = Api(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///databse.db' #relative path
db = SQLAlchemy(app)
class VideoModel(db.Model):
... | true |
4be5c705733824d91930e4adb35b634e97b9f99a | GlebOlegovich/check_templates_for_spaces | /check.py | UTF-8 | 7,113 | 3 | 3 | [
"MIT"
] | permissive | import os
import sys
from typing import Dict, Tuple, Union
BASE_DIR = os.path.dirname(__file__)
# Мамкины программисты скажут что глобальные нельзя!
# Нефиг свистеть, отвечу я вам!
# Тэги, которые мы ищим, чтобы добавить пробел
TAGS = ['{%', '{{', '}}', '%}', '{#', '#}']
# !!!!!!!!!!
def tags_in_str(str) -> Dict:... | true |
a3c42ebe67e5867c4d8f2f0947dfb03ea6d8800c | naimadswdn/isapy9-Damian | /send_email.py | UTF-8 | 640 | 2.796875 | 3 | [] | no_license | import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
def send_email(topic, content):
"""
Function that is sending an email.
:param topic: it is a topic of an email
:param content: it is a content of the message
:return:
"""
mail = MIMEMultipart... | true |
3132641dfa2b46146edf9131694fd4bc19852231 | temmy222/Lattice-Boltzmann-Method-with-Python | /testpylbm.py | UTF-8 | 1,618 | 3.171875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 9 14:27:28 2019
@author: tajayi3
"""
import numpy as np
import pylab as plt
def mesh(N):
xmin, xmax = 0., 1.
dx = 1./N
x = np.linspace(xmin-.5*dx, xmax+.5*dx, N+2)
return x
#x = mesh(10)
#plt.plot(x, 0.*x, 'sk')
#plt.show()
def equilibrium(m0, c):
... | true |
dfa88b7e7091fb6a767bf30037002ea9a808339d | damicoedoardo/Hashcode-2019 | /Read_file.py | UTF-8 | 2,401 | 2.9375 | 3 | [] | no_license | import numpy as np
import random
from sklearn.preprocessing import MultiLabelBinarizer
def input_reader(filename, header_lines = 1, separator = ' '):
with open(filename, 'r') as file:
# store headers line in headers row
header_rows = []
for i in range(header_lines):
row = file.... | true |
860c297f8bd3ec45fdff8c712030ca64fe4119ae | Jerwinprabu/practice | /coins.py | UTF-8 | 1,096 | 3.78125 | 4 | [] | no_license | #!/usr/bin/python
""" Given an infinite number of coins. Find the number of ways of
representing n cents in cents, nickels, dimes, and quarters """
import random
def ways_internal(cents, den):
#print "cents {} den {}".format(cents, den)
if cents == 0:
return 1
if den == 25:
coun... | true |
c91e628c860eb018b19d8fafc75cd8ffbe602bc5 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_74/408.py | UTF-8 | 1,567 | 3.109375 | 3 | [] | no_license | ROBOTS = ['O', 'B']
def find_dest(moves, robot):
for i, (candidate_robot, button) in enumerate(moves):
if robot == candidate_robot:
return i, button
return -1, -1
def solve_test_case(line):
tokens = line.split(' ')
N = int(tokens[0])
moves = []
for i in xrange(N):
robot = tokens[2*i+1]
bu... | true |
4f169cbd44556f84eb182e49711646ea3b586715 | parkhongbeen/Network | /소켓프로그래밍연습/socket_tcp_snd.py | UTF-8 | 287 | 2.734375 | 3 | [] | no_license | import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('127.0.0.1', 9999))
data = 'Hello TCP Socket!?'
client_socket.sendall(data.encode())
data = client_socket.recv(1024)
print('Client Recv', data.decode('utf-8'))
client_socket.close()
| true |
d8a21c214f9f86a63471d2eb5735c386d7788f61 | ken626014896/python-practice | /leetcode/itertools库的排列组合.py | UTF-8 | 119 | 3.265625 | 3 | [] | no_license | import itertools
a=[1,2,3,4,5,6]
b=[]
for i in itertools.combinations_with_replacement(a, 7):
b.append(i)
print(b) | true |
a308bae278c68a5a68ff8f461f0875c0cef5dd97 | nahlaerrakik/collisions-map | /application/utils.py | UTF-8 | 1,879 | 2.953125 | 3 | [] | no_license | __author__ = 'nahla.errakik'
import os
import folium
from pathlib import Path
from folium import FeatureGroup, LayerControl
class Map:
def __init__(self, starting_latitude, starting_longitude):
self.map = folium.Map(location=[starting_latitude, starting_longitude], tiles='Open Street Map', zoom_start=10... | true |
4a8f3f6679b6525d5cc02a74a0a00ff1b1b0eb66 | drunkwater/leetcode | /medium/python3/c0013_24_swap-nodes-in-pairs/00_leetcode_0013.py | UTF-8 | 770 | 3.421875 | 3 | [] | no_license | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#24. Swap Nodes in Pairs
#Given a linked list, swap every two adjacent nodes and return its head.
#Example:
#Given 1->2->3->4, you should return the list ... | true |
b5643c50ea908fbb6d3933afdcfae143cbd0d27d | c0go233/SkynetSecurityDemonstration | /master/master_sign.py | UTF-8 | 1,136 | 2.984375 | 3 | [] | no_license | import os
from Crypto.Signature import PKCS1_PSS
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
def sign_file(f):
# TODO: For Part 2, you'll use public key crypto here
# The existing scheme just ensures the updates start with the line 'Caesar'
# This is naive -- replace it with something bet... | true |
744273236ce2372f679ea455d2dfd4d7bd654285 | arminha/lolin-d32-micropython-playground | /blinker/blinker.py | UTF-8 | 445 | 3.5625 | 4 | [] | no_license |
# blink the given pin at 1Hz 50% duty cycle
# use ctrl-c to end
# notify
print('LOAD: blinker.py')
import time
from machine import Pin
def blink(pin=5):
p = Pin(pin,Pin.OUT)
try:
while True:
p.value(0)
print('pin',pin,'ON')
time.sleep_ms(500)
p.value... | true |
4b361e946272e4d94642cd83490bf9c80f6374b8 | lihaoliu-cambridge/StrawHat | /leetcode_ac_questions/6.zigzag_conversion.py | UTF-8 | 661 | 3.109375 | 3 | [] | no_license | class Solution(object):
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
if len(s) == 0 or numRows < 2:
return s
reset_s = []
for i in range(numRows):
j = i
while j <= len(s) - 1:... | true |
9c107207660fe5f24c82841e350d436aa2da25dd | pedrohba1/Artifical-Intel | /Prova2/tempera/graph_plotting.py | UTF-8 | 232 | 2.65625 | 3 | [] | no_license | import matplotlib.pyplot as plt
import pandas as pd
df =pd.read_csv('labirinto_2.csv')
print(df['movimentos'].mean())
print(df['caminho_total'].mean())
print(df['distancia_ao_final'].mean())
plt.boxplot(df.passos)
plt.show() | true |
154d4b6c4d534dc0d46e0cc66b8176b389bd8161 | LissaAlissa/The_self-taught_programmer | /python_ex212.py | UTF-8 | 80 | 2.671875 | 3 | [] | no_license | import math
import random
print(math.pow(2, 3))
print(random.randint(0, 100)) | true |
e64f82aab0f769f2174b84ae340f76872fd3b15b | onyeskee/awslambda | /mysql_data_sanity.py | UTF-8 | 1,236 | 2.734375 | 3 | [] | no_license | def send_mail(msg):
import smtplib
from email.mime.text import MIMEText
msg = MIMEText(msg)
msg['Subject'] = 'Hash mismatch in data'
s = smtplib.SMTP('localhost')
s.sendmail('info@localhost','vinayak.p@abc.com', msg.as_string())
s.quit()
def main():
import MySQLdb
dbProd1 = MySQLd... | true |
e47b492e9072c98df12b42fe81c11a9b63367a48 | rijun/electric-load-viewer | /elv/figures.py | UTF-8 | 7,864 | 2.734375 | 3 | [] | no_license | import arrow
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from elv import dh
from dlp import DefaultLoadProfile
def yearly_energy_usage(meter_id):
"""
Calculate the previous yearly energy usage.
If the number of days in the dataset is > 365 (one year), the sum of all meter... | true |
ac0159eb0101c4691a63514553481f3d0fdaa1ad | Sahilamin219/Competitive-Programing | /exercise.py | UTF-8 | 1,380 | 3.359375 | 3 | [] | no_license | #given i,Fi,j,Fj,n(synatax:Fi1 = Fi+1)
def f(k):
a =0
b =1
if k == 0:
return 0
if k == 1:
return 1
for i in range(2,k+1):
c=a+b
a=b
b=c
return c
def determineFn(i,Fi,j,Fj,n):
if n == i:
global Fn
Fn=Fi
if i<n:
# mycode
# if i<j:
# Fi1 = (Fj-f(j-i-1)*Fi)/f(j-1)
# n=n-1
# while(i != n):... | true |
fa99c0a711c90e70310c19de7b8130659fabfba6 | amorale4/CS598CXZ-Project | /pysrc/SearchFiles.py | UTF-8 | 3,017 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python
import sys, os, lucene
from java.io import File
from org.apache.lucene.analysis.standard import StandardAnalyzer
from org.apache.lucene.index import DirectoryReader
from org.apache.lucene.queryparser.classic import QueryParser
from org.apache.lucene.store import SimpleFSDirectory
from org.apach... | true |
b1846210dd4ef49754a00fd60daf9e6ecf504fab | Krisfer1988/Curso-Python | /Comenzando/EjemplosBuclesDiapositivas.py | UTF-8 | 367 | 3.890625 | 4 | [] | no_license | #Ejemplos diapositivas, for
#bucle for
for i in [0,1,2,3,4] :
print ("Iteración")
print("fin")
#bucle for con range()
for i in range(0,5):
print("Iteración")
print("fin")
#bucle while
i=1
while i<=4:
print (i)
i +=1
print("fin de la ejecucion")
#Emulacion de do while
i = 1
while True:
print(i)
... | true |
972489b0dc2eb842ec806186b090c974bc321f67 | appfr3d/AdventOfCode2017 | /Day 16/day16.py | UTF-8 | 1,631 | 3.25 | 3 | [] | no_license | puzzle = open('input.txt', 'r')
commands = puzzle.readline().split(',')
prog = list('abcdefghijklmnop')
def spin(prog, n):
start = prog[-n:]
end = prog[:-n]
return start + end
def exchange(prog, a, b):
tmp = prog[a]
prog[a] = prog[b]
prog[b] = tmp
def partner(prog, a, b):
indexA = prog.index(a)
indexB = prog... | true |
a831ad1e251db7cbbf364979614ac2e3415c596e | imneverdied/Python-note | /output txt/output txt.py | UTF-8 | 873 | 3.5625 | 4 | [] | no_license | import tkinter as tk
# 讀取輸入值輸出txt
def onOK():
# 更新Label
print("--> {}".format(entry.get()))
try:
with open(format(entry.get()) + ".txt", "w", encoding="UTF-8") as f: # 產出輸入之txt
f.write(format(entry.get()))
tk.Label.configure(label, text='已產出 '+format(entry.get())+'.txt')
... | true |
45e4a13cefcbc92043c186444ec3beb846208f40 | vivekyadav6838/Data-Structures-and-Algorithms-for-Interviews | /Python/Graph/RottenOranges.py | UTF-8 | 2,267 | 3.40625 | 3 | [] | no_license | # @author
# Aakash Verma
# www.aboutaakash.in
# www.innoskrit.in
# Instagram: https://www.instagram.com/aakashverma1102/
# LinkedIn: https://www.linkedin.com/in/aakashverma1124/
# Problem Link: https://leetcode.com/problems/rotting-oranges/
# Only functions are written in this code
from collections import deque
cl... | true |
71b0a7e0347cfb52bf75acbfa2878db2b95f1dea | Shreyanand/stats_comp | /stats_comp/analysis_nn.py | UTF-8 | 7,690 | 3.09375 | 3 | [] | no_license | from scipy.stats.stats import pearsonr
import plotly.graph_objs as go
from plotly import tools
def boxPlotComparison(df, colNames):
"""This function creates a box plot of two datasets compared aganist each other.
Args:
df (pandas.DataFrame): The pandas dataframe that contains data columns to be a... | true |
e69c870d275d365d215ba49b46ba4b0624530d96 | zhangx2019/Face_recognition | /face_interception.py | UTF-8 | 3,780 | 2.71875 | 3 | [] | no_license | # -*-coding:utf8-*-
import os
import cv2
import time
import shutil
# 将目录下的所有文件进行列表
def getAllPath(dirpath, *suffix):
PathArray = []
# os.walk(dirpath,dirnames,filenames)中第一个为起始路径,第二个为起始路径下的文件夹,第三个是起始路径下的文件
# os.path.split()返回文件的路径和文件名
# dirname,filename=os.path.split('/home/ubuntu/python_coding/split_... | true |
749d5201d070a1fe674d477e4d2d38b1c61d8919 | zurdo09/python-maquina-registradora | /application.py | UTF-8 | 7,679 | 3.375 | 3 | [] | no_license | #-*- coding: utf-8-*-
import sys
# *******************************************
# *********primera parte Gerente*************
# *******************************************
articulos={}
fulltotal=0
def ingreso_productos():
caja=True
while caja==True:
opcion =raw_input("Desea ingresar un producto SI/NO... | true |
c796b0535fd94da2a7826177c6df5e27cc44bf93 | ritikanagar09/FancyRISC-Manager | /Simple-Assembler/errors.py | UTF-8 | 4,706 | 2.9375 | 3 | [] | no_license | import json
import re
import memory
cats = json.load(open('categories.json'))
"""
A few notes about error handling for the person correcting this:
> I have chosen to allow blank lines after the hlt instruction at the end. I think those are commonly seen in programs and it is acceptable to ignore them.
> It is told to ... | true |
9b47c5edf59ef42003a8abf5241b9b1c0a4e32f9 | JorgeSchelotto/practica3 | /Ejercicio3Json.py | UTF-8 | 1,007 | 2.53125 | 3 | [] | no_license | import json
"""Registrar los jugadores del Ejercicio 7 de la Práctica 1 en un archivo utilizando cualquiera de
las librerías dadas en la teoría (Pickle, JSON, CSV). Implementar una función denominada
modificoDatos, la cual solicita por teclado los datos de un jugador, si este existe en el
archivo, modifica dichos d... | true |
c91ad7f9cb8fb3da74ffbd25bf2221258de7a30e | pedrohenriquebraga/Curso-Python | /Mundo 1/Exercícios/ex_025.py | UTF-8 | 130 | 3.96875 | 4 | [
"MIT"
] | permissive | # Verifica se tem Silva no nome
name = str(input("Digite seu nome: ")).title()
print(f"Seu nome é {'Silva' in name} para Silva") | true |
79dfdf2c9d076fbd6847fc670baf6114c194e919 | ahadkar/politician-sentiment-analysis | /psa_app/load_tweets.py | UTF-8 | 1,380 | 2.9375 | 3 | [] | no_license | # Created by Aditya Hadkar
import csv, sqlite3, time
db_filename = "db.sqlite3"
# Loads all the tweets from a csv file in a db.sqlite3 database.
def parse(filename):
SQL = """
insert into psa_tweet (tweet_id, user_id, created_at, tweet_text, hashtag_entities, url_entities, favorite_count, retweet_coun... | true |
ac825fa8e1be2f6c72873ed5610c820065761ab8 | project-oak/oak | /oak_ml_transparency/runner/testdata/eval.py | UTF-8 | 730 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | import argparse
import json
def main():
parser = argparse.ArgumentParser(
allow_abbrev=False,
prog='MNIST evaluation',
description='Evaluates an MNIST model against adversarial examples')
parser.add_argument('--model', help="the model as a compressed tar archive")
parser.add_argume... | true |
dd446d70e9b2578c7b10034ba76d53d583bf4b5a | Wubuntu88/CarND-Vehicle-Detection | /feature_extraction/tests/test_hog_extract_training_images.py | UTF-8 | 720 | 2.515625 | 3 | [] | no_license | import feature_extraction.feature_extractor as fe
import data_loader.training_data_loader as tdl
import feature_extraction.hog_extractor as he
import matplotlib.pyplot as plt
vehicles_array, non_vehicles_array = \
tdl.load_training_data(car_images_file_path='../../matrix_image_data/vehicle_images_matrix.npy',
... | true |
a3aa8848d3cb275d12f5e82326f52b0fc3b655fc | amirkhan1092/Hackerrank-contests-python37 | /brakets_balance.py | UTF-8 | 491 | 3.4375 | 3 | [] | no_license | def pairs_stack(string):
opening = list('[{(')
closing = list(']})')
match = list()
for s in string:
if s in opening:
match.insert(0, s)
elif s in closing:
if len(match) == 0:
return False
if match[0] == opening[closing.index(s)]:
... | true |
742e3a4d4e3187630f1328464a6f189fa0af3af1 | RageTF/MachineLearning | /cube/Cube.py | UTF-8 | 661 | 2.78125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plot
from mpl_toolkits.mplot3d import Axes3D
data = np.array([[i, 2 * i, np.random.uniform(-100, 100)] for i in range(100)])
fig = plot.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(data[:, 0], data[:, 1], data[:, 2], c='green')
ax.set_xlabel('x')
ax.set_... | true |
de27cfc999ab626637e67733270d36a789988013 | ggodol/Python-practice | /9-1.py | UTF-8 | 1,414 | 4.71875 | 5 | [] | no_license | """
9-1 클래스
https://youtu.be/kWiCuklohdY?t=13088
"""
"""
# 마린 : 공격 유닛, 군인. 총을 쏠 수 있음
name = "마린" # 유닛의 이름
hp = 40 # 유닛의 체력
damage = 5 # 유닛의 공격력
print("{} 유닛이 생성되었습니다.".format(name))
print("체력 {0}, 공격력 {1}\n".format(hp,damage))
# 시즈탱크 : 공격 유닛, 탱크. 포를 쏠 수 있는데, 일반 모드 / 시즈 모드.
tank_name = "탱크"
tank_hp = 150
tank_damage ... | true |
138d23d36b01f2ef6ee02c2e0cdcf17710811e08 | ucbrise/aws-audit | /plots.py | UTF-8 | 1,793 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | import matplotlib
matplotlib.use('Agg') # (ノಠ益ಠ)ノ彡┻━┻
import pandas as pd
import matplotlib.pyplot as plt
import re
import sys
def account_spend_plot(csvfile=None, outputfilename=None, outputfiletype="png"):
"""
creates a plot for account-based spends
args:
csvfile: full path to the CSV file
outputfil... | true |
fb3a699d4807979b553249431f3bd0f2444f2922 | SlickChris95/pythonProjects | /practiceProjects1.py | UTF-8 | 1,442 | 4.125 | 4 | [] | no_license | '''
Practice Projects
pg 102
'''
#Comma Code
#takes a list and returns a string separated with
#commas and a space and with and inserted before
#the last item
spams = ['apples','bannanas','tofu','cats']
spam = ['apples','bannanas','tofu','cats']
def commaCode(l):
for i in range(0,len(l)):
if(l[i] == l[l... | true |
01d01deef55711e613f7944c5d864c51a89f3ddd | Chennyyyy/RecSys | /FM/FM.py | UTF-8 | 6,314 | 3.25 | 3 | [] | no_license | from __future__ import division
from math import exp
from numpy import *
from random import normalvariate # 正态分布
import time
import pandas as pd
import numpy as np
import random
from sklearn.model_selection import train_test_split
def data_preprocessing(input_data):
"""预处理数据
:param input_data: 输入的数据
:re... | true |
25f0f7f6e3a9f54541c19a33f40fa9e16fce928f | tniyer2/github_repo_cache | /src/github_collect/user_stats.py | UTF-8 | 1,471 | 2.6875 | 3 | [] | no_license |
class UserStats:
def __init__(self, name):
self.name = name
self.commits = 0
self.merges = 0
self.comments = 0
self.open_pull_requests = 0
self.closed_pull_requests = 0
def get_name(self):
return self.name
def get_commits(self):
return self.... | true |
73dcf5fb731e5c2c71ee2b3a1bb9f5ddb7a3cbee | ethanjperez/convince | /ParlAI/parlai/tasks/integration_tests/agents.py | UTF-8 | 5,519 | 3.09375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
These agents contain a number of "unit test" corpora, or
fake corpora that ensure models can learn simple behavior e... | true |
a880be8d0f9ea3373eafe4ee87fe4dcd53708274 | ninanursita/tugas-ddp1 | /TP3.py | UTF-8 | 8,817 | 3.5 | 4 | [] | no_license | # A. Penggunaan defaultdict untuk mengeset tipe data dari values yang ada pada dictionary
from collections import defaultdict
# B. Pengesetan tipe data standar untuk values dari dictionary
classes = defaultdict(list)
quiz1 = defaultdict(int)
quiz2 = defaultdict(int)
task1 = defaultdict(int)
task2 = defaultdict(int)
ta... | true |
84ae90ef20e0fb3ed6f7d337558a23f6186c7375 | ailogan/pynigma | /pynigma.py | UTF-8 | 19,882 | 3.328125 | 3 | [] | no_license | #!/usr/bin/python
# pynigma.py
#
# Andrew Logan - 12/21/2013
#
# Enigma simulator written in python
import sys
import argparse
import ConfigParser
#Ja, ist plugboard!
class Steckerbrett:
letters = None
def __init__(self, steckerbrett_list):
#Set up our memory
self.letters = []
sub_l... | true |
b21492a054e9d403007fa76f8fecf5ed6b119710 | zjam9333/StudyOpenCV | /demos/Image Processing in OpenCV/Template Matching/templateMatching.py | UTF-8 | 3,286 | 3.890625 | 4 | [] | no_license | # Template Matching
# Goals
# In this chapter, you will learn
# To find objects in an image using Template Matching
# You will see these functions : cv2.matchTemplate(), cv2.minMaxLoc()
# Theory
# Template Matching is a method for searching and finding the location of a template image in a larger image. OpenCV comes... | true |
1bfe2febc37d08c9263ec947522b5bb3ba62d9c7 | wxh09/Gaitset-code | /model/network/triplet.py | UTF-8 | 2,446 | 2.609375 | 3 | [] | no_license | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
class TripletLoss(nn.Module):
def __init__(self, batch_size, hard_or_full, margin):
super(TripletLoss, self).__init__()
self.batch_size = batch_size
self.margin = margi... | true |
edefe7fd4940c65c359308ff9d8555fec4e24cd1 | longle2718/fundaCS | /shortestPath/findLadders.py | UTF-8 | 3,381 | 3.078125 | 3 | [
"MIT"
] | permissive | class Solution:
def findLadders(self, beginWord, endWord, wordList):
"""
:type beginWord: str
:type endWord: str
:type wordList: List[str]
:rtype: List[List[str]]
"""
prev = {} # word->prev word
prev[beginWord] = None
... | true |
3ef2acfd6b70e877e20e417f5249e459c87c0527 | carolana/learning-area | /projects/scripts/radar-eletronico.py | UTF-8 | 326 | 3.8125 | 4 | [] | no_license | velocidade = float(input('Qual a velocidade do carro? '))
if velocidade > 80:
print('Você excedeu o limite de velocidade de 80km/h')
print('O valor da sua multa será de R${:.2f}'.format((velocidade - 80) * 7 ))
else:
print('Parabéns! Você está dirigindo dentro do limite permitido e não será multado(a)')
| true |
60380ad7d7378102853041855d34c7f9340db4fe | trepudox/Python | /relembrar/L1/L1E7.py | UTF-8 | 371 | 4 | 4 | [] | no_license | a = int(input("Digite o valor de A: "))
b = int(input("Digite o valor de B: "))
c = int(input("Digite o valor de C: "))
d = int(input("Digite o valor de D: "))
e = int(input("Digite o valor de E: "))
f = int(input("Digite o valor de F: "))
x = (c*e - b*f) / (a*e - b*d)
y = (a*f - c*d) / (a*e - b*d)
print("Os valores ... | true |
2e3ac142716383c6e4842b6ebaac4a4ee6f5a45d | Lee-HyeongBin/Data_Science_Project | /3. 로보어드바이저/red/scrapper/scraper.py | UTF-8 | 5,315 | 2.765625 | 3 | [
"MIT"
] | permissive | from . import stock
from . import etf
from . import finance
import pandas as pd
import numpy as np
import os
from tqdm import tqdm
pd.options.mode.chained_assignment = None
class Scraper:
def __init__(self, path=os.getcwd()):
self.path = path
data_path = os.path.join(self.path, "data")
if... | true |
fc9dad1c0270469a28f686541596a0a504280491 | ChocolatePadmanaban/Learning_python | /Day7/part4.py | UTF-8 | 642 | 3.890625 | 4 | [] | no_license | #matrix operations:
# 1.convert list to matrix
# 2.MatrixTranspose
def MatrixCreate(l,s):
if s[0]*s[1] == len(l):
answer = []
for i in range(0,s[0]):
answer1 = l[i*s[1]:(i+1)*s[1]]
answer.append(answer1)
return answer
else:
return "Invalid Inp... | true |
6bf402178020ab26ff2f95bb3c2a6d76811a118d | byaminov/advent-of-code-2018 | /aoc/day13.py | UTF-8 | 3,647 | 3.25 | 3 | [] | no_license | def solve1(text: str):
carts, tracks, max_width = parse(text)
tick = 0
while True:
carts_sorted = list(carts.items())
carts_sorted.sort(key=lambda id_data: id_data[1][0][0] * max_width + id_data[1][0][1])
for cart_id, cart_data in carts_sorted:
if cart_id not in carts:
... | true |
da260450a340c09fdf568a2ec2e2fb14c67a68ca | LatorreDev/SpaceXLaunchBot | /spacexlaunchbot/structure.py | UTF-8 | 1,296 | 2.5625 | 3 | [
"MIT"
] | permissive | import logging
import logging.handlers
import datetime
import config
async def utc_from_ts(timestamp):
"""Get a UTC string from a unix timestamp
Specifically, for getting the launch time, so if timestamp is not an int, returns
"To Be Announced"
"""
try:
formatted_date = datetime.datetime.... | true |
6eba889273eb3ab6da95397200dcac20733fb983 | tsubame-misa/Atcoder | /ABC220/C.py | UTF-8 | 239 | 2.921875 | 3 | [] | no_license | n = int(input())
a = list(map(int, input().split()))
x = int(input())
a_sum = sum(a)
a_div = x//a_sum
ans = n*a_div
x -= a_sum*a_div
for i in range(len(a)):
x -= a[i]
ans += 1
if x < 0:
print(ans)
exit()
| true |
b2fd91c98b34d097ea6e02c7854cf8c9578bb590 | abbottLane-zz/DOD_Scraper | /DBAccessController.py | UTF-8 | 1,500 | 2.609375 | 3 | [] | no_license | import os
import pyodbc
import traceback
import configparser
class DBAccess():
def __init__(self, db_config_name):
self.db_env = db_config_name
self.config_path = "dbaccessconfig.ini"
self.config = configparser.ConfigParser()
self.config.read(self.config_path)
self.host = ... | true |
4640f3745a9230babc7a76724e31780345ebca0c | teohhanhui/ggplib | /src/ggplib/non_gdl_games/baduk/desc.py | UTF-8 | 2,479 | 3.125 | 3 | [
"MIT"
] | permissive | # This Python file uses the following encoding: utf-8
import string
BLACK, WHITE = 0, 1
def role_str(r):
return "white" if r == WHITE else "black"
class BoardDesc:
def __init__(self, size):
self.size = size
self.cords = string.ascii_letters[:size]
self.bases = self.create_bases()... | true |
71c270bde0786a592ccc14e0316c312747f5f5ef | Shivani3012/PythonPrograms | /string functions.py | UTF-8 | 810 | 3.796875 | 4 | [] | no_license | a="Hey user"
b="Welcome"
c="to the world of"
d="python3.7.3"
print("Uppercase")
print(a.upper())
print(b.upper())
print(c.upper())
print(d.upper())
print("lowercase")
print(a.lower())
print(b.lower())
print(c.lower())
print(d.lower())
print("Checking that whether all strings are in uppercase or lowercase")
print(a.isup... | true |
06034efc1f632b4e776ac69df4036cd38b5c7dd8 | sebastiancepeda/vanessa | /cv/tests/test_tiles.py | UTF-8 | 1,226 | 2.875 | 3 | [
"MIT"
] | permissive | """
@author: Sebastian Cepeda
@email: sebastian.cepeda.fuentealba@gmail.com
"""
import cv2
import numpy as np
import pytest
from cv.image_processing import image2tiles, tiles2images, get_labels_tiles
def test_split_and_merge():
folder = "./test_data/"
image = "top_mosaic_09cm_area1_image_resized.tif"
im... | true |
0542418ef9d2503cd2ae5f6ae19cd7d2da5a7b0d | joshuacassidy/Movie-Ratings-Analysis | /Movie-Ratings.py | UTF-8 | 3,102 | 3.484375 | 3 | [] | no_license | import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
movies = pd.read_csv('Movie-Ratings-Data.csv')
movies.columns = ['Film', 'Genre', 'CriticRating', 'AudienceRating','BudgetMillions','Year']
movies.Genre = movies.Genre.astype('category')
distribution = [movies.AudienceRating,movies.CriticRa... | true |
acc4e78e314ce9aa38aaab86a0cd141168c9d558 | zhanghao1989718/baizhu | /pyautogui_demo/demo_1.py | UTF-8 | 3,014 | 3.34375 | 3 | [] | no_license | # coding = utf-8
import pyautogui
# # 获取屏幕尺寸
# pyautogui.size()
# # 把屏幕尺寸赋予变量(宽,高)
# width, height = pyautogui.size()
# # 打印屏幕尺寸
# print(width,height)
# 鼠标顺时针移动,并划10次方框
# for i in range(10):
# pyautogui.moveTo(300, 300, duration=0.25)
# pyautogui.moveTo(400, 300, duration=0.25)
# pyautogui.moveTo(400, 4... | true |
3dec9f0e7f0a27aa82d0e5822c26691572921154 | WambuiK/Coursera---Bioinformatics-Algorithms | /chapter1/C1_8/8_4/8_4.py | UTF-8 | 2,664 | 3.15625 | 3 | [] | no_license | #################################################################
#
# Author: Min Wang (san-heng-yi-shu@163.com)
#
# Date Created:
# 21 Nov 2013
#
# Coursera - Bioinformatics Algorithms
# - Some Hidden Messages are More Elusive than Others
#
# Frequent Words with Mismatches Problem:
# Find the most frequent k-mers... | true |
e25c49a0667dc262e74c45a145ab41458798de24 | rjorgestudent/SimulationOfComplexSystems | /PedestrianModel.py | UTF-8 | 1,235 | 3.203125 | 3 | [] | no_license | import numpy as np
class Pedestrians():
def __init__(self, init_positions, init_velocities, desired_positions, desired_speeds):
self.positions = init_positions
self.velocities = init_velocities
self.desired_positions = desired_positions
self.desired_speeds = desired_speeds
... | true |
22e04c1b4d924ae5811e350a349f2570fadebbcf | samakj/directory_explorer | /Folder.py | UTF-8 | 2,656 | 3.046875 | 3 | [] | no_license | import os
from os import listdir, path
from typing import List, Union, Optional
from datetime import datetime
from File import File
class FolderDoesNotExist(Exception):
pass
class Folder(File):
def __init__(
self,
name: str,
absolute_path: str,
size: int,
... | true |
0305489fb71e49cd43e3cac9d7a768738c476bda | hemanta212/hello-manim | /assignments/reviews/probability/raw_probability_video_1.py | UTF-8 | 4,811 | 3.390625 | 3 | [] | no_license | from manimlib.imports import *
class Math1(TeacherStudentsScene, Scene):
def construct(self):
self.wait(2)
Text1 = TextMobject("What will we study today, Teacher?")
Text1.scale(1.8).set_color(RED)
self.student_says(Text1)
self.wait(2)
Text2 = TextMobject("Today we will study ab... | true |
7d4d18e384bab234884724097aec7c15baadf8eb | Zli123123/Carleton-Python | /threaded-server.py | UTF-8 | 975 | 3.0625 | 3 | [] | no_license | import socket # Import socket module
import threading
def clientServerT(clientsocket, addr):
print('*** Client Server started', addr)
while True:
msg = clientsocket.recv(1024)
#do some checks and if msg == someWeirdSignal: break:
print(addr, ' >> ', msg)
... | true |
a8a392363f2c71c4053cb6ea525352a7b74fde36 | andy-maier/python-yagot | /tests/unittest/test_decorator.py | UTF-8 | 1,446 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | """
Test the garbage_checked decorator.
"""
from __future__ import absolute_import, print_function
import pytest
from yagot import garbage_checked
class SelfRef(object):
# pylint: disable=too-few-public-methods
"""
A self-referencing class, for testing memory leaks.
Due to the circular reference it... | true |
10743aacb8883257192e4947e97b02b922abcfa9 | ktsujino/regex_engine | /regex.py | UTF-8 | 488 | 2.859375 | 3 | [] | no_license | import automata
import lex
import syntax
def compile_regex(regex):
tokens = lex.lexical_analysis(regex)
ast = syntax.syntactic_analysis(tokens)
nfa = automata.NFA.from_ast(ast)
nfa.epsilon_elimination()
dfa = automata.DFA.from_nfa(nfa)
return dfa
if __name__ == '__main_... | true |
ce06a17586d04dfd6c9af1d96868110ded1cf599 | DeepDarkOdyssey/text_loop_identification | /src/base_model.py | UTF-8 | 436 | 2.53125 | 3 | [] | no_license | import tensorflow as tf
def input_fn(file_path):
dataset = tf.data.TextLineDataset(file_path)
iterator = dataset.make_one_shot_iterator()
sample = iterator.get_next()
return sample
if __name__ == "__main__":
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
tf.logging.set_verbosity(tf.log... | true |
5f3c622bdced997519621d906f7bf0e00b74abd4 | legend507/MyLeetCodeSolutions | /InterviewQuestions/ClassifySomeData/solution.py | UTF-8 | 846 | 3.6875 | 4 | [] | no_license | """
k-NN based.
Using priority heap is a bonus.
"""
import heapq
A = (1.0,2.0,3.0)
B = (4.0,5.0)
X = 4.0
K = 2
i = -1
heap = []
"""
Traverse every element in A, B tuples, calc distance with X.
Then append the distance with the lable i to heapq.
"""
# 1st loop: c = A (a tuple), 2nd loop: c = B (a tuple)
for c in A,B:... | true |
8cbb816fb1adc0a035d57b46e44b2d63b5124f7e | yiannisha/UrbanDictionaryBot | /scraping/process_data.py | UTF-8 | 1,357 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive |
"""Module for processing data scraped from UrbanDictionary"""
from scraping.page_scrape import Tags
from bs4 import BeautifulSoup
from bs4.element import (Tag, NavigableString)
def _get_div_text(tag : Tag, class_name : str) -> str:
"""Returns a string of the tag's text."""
return tag.find('div', {'class' : ... | true |
e118decfcefd29c1c86eb3a56c54495a5d542d8b | mlsmlk/Python-Practice | /guessTheNumber.py | UTF-8 | 1,511 | 3.765625 | 4 | [] | no_license | import getpass
def game():
number = list(getpass.getpass(
'Welcome to \'Guess the number\'!\nUser 1 please enter the number: '))
count = 1
while True:
guess = input(f'\n\nUser 2 Guess {len(number)} digit number: ')
guess_list = list(guess)
guess_result = []
... | true |
6d7e006951a0a8fd83fa2dc8b6ea55c487d02dd3 | 951237/python_crawling | /크롤링_날씨_201808/py_script_일기예보_선택하기_180823.command | UTF-8 | 2,277 | 3.125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 다음 일기예보 #180822
from urllib.request import urlopen
from bs4 import BeautifulSoup
from urllib import request, parse #url을 파라미터로 받을 때 사용하기 parse
import copy
print('1. 새솔동 \n2. 학현초등학교 \n3. 예천 대심동\n')
k = input('날씨가 궁금한 장소는? ')
while True:
if k == '1':
sel = pa... | true |
f3d6ff16778b6eff734dfcab594377064d77252d | redbeardmickey/html-scrubber | /parser_test.py | UTF-8 | 271 | 2.65625 | 3 | [] | no_license | import html5lib
with open("test_site/test.html", "rb") as f:
element = html5lib.parse(f)
walker = html5lib.getTreeWalker("etree")
stream = walker(element)
s = html5lib.serializer.HTMLSerializer()
output = s.serialize(stream)
for item in output:
print("%r" % item) | true |
8846dbd60e1977a518520e819735737dd785f73b | etzimopoulos/LiRA-Web-App | /pages/homepage.py | UTF-8 | 7,905 | 3.703125 | 4 | [] | no_license | """LiRA Web Home page"""
import streamlit as st
import pandas as pd
import functions.sfunctions as sf
# pylint: disable=line-too-long
def write():
#"""Used to write the page in the app.py file"""
with st.spinner("Loading Homepage ..."):
#ast.shared.components.title_awesome(" - Homepage")
#st.t... | true |
c1420284f06f133b71681ad308c30bfe26a316e9 | brian1985/snakeGame-RL | /firstEnvSnake.py | UTF-8 | 6,319 | 2.875 | 3 | [] | no_license | import numpy as np
import gym
from gym import spaces
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation, Flatten, Conv2D, MaxPooling2D,Permute
from tensorflow.keras.optimizers import Adam
import tensorflow
print(tensorflow.version)
from rl.agents.dqn import DQN... | true |
79e741098c6118d85d7b5788e6664ca80d340a2e | daniel-reich/ubiquitous-fiesta | /jjPGM3a22AgzcBFCx_5.py | UTF-8 | 253 | 3.125 | 3 | [] | no_license |
def decrypt(lst):
abet = list("abcdefghijklmnopqrstuvwxyz")
nums = []
for i in abet:
nums.append(abet.index(i)+1)
for n in lst:
nums.remove(n)
x = nums[0] - 1
let = abet[x]
let = let.upper()
return(let)
| true |
172edd2ded948fd30a212c7070201dca14a50894 | wanglik04/CS677 | /Assignment/Assignment4_donghangHe_113/Part1/examine_labels.py | UTF-8 | 1,697 | 2.8125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from pandas_datareader import data as web
import os
import math
import numpy as np
import pandas as pd
import traceback
import matplotlib.pyplot as plt
ticker = 'HSBC'
input_dir = r'../datasets'
ticker_file = os.path.join(input_dir, ticker + '_weekly_return_volatility.csv')
def main():
t... | true |
1013577eb1ec714a5f9ab7a65f776a726d8ab180 | DIAfuad/classwork | /Lesson11.py | UTF-8 | 1,381 | 4.28125 | 4 | [] | no_license | from os import system
#def defines method
def Add(a,b):
c= a+b
print("Additional is {}".format(c))
def Sub(a,b):
c= a-b
print("Subtraction is {}".format(c))
def Multi(a,b):
c=a*b
print("Multiplication is {}".format(c))
def Div(a,b):
c=a/b
print("Division is {}".for... | true |
338f9db5d1a5e726111dcc2e5d588e0c73973099 | KunitakeYuto/AtCoder | /ABC/ABC140/B.py | UTF-8 | 288 | 2.75 | 3 | [] | no_license | N=int(input())
AList = list(map(int, input().split()))
BList = list(map(int, input().split()))
CList = list(map(int, input().split()))
mae=0
MAN=0
i=0
while i<N:
MAN+=BList[(AList[i])-1]
if (mae+1)==AList[i] and i!=0:
MAN+=CList[mae-1]
mae=AList[i]
i+=1
print(MAN) | true |
29f4949083a7e9818fea76a60bb541441cb3e39d | adrielt07/AirBnB_clone_v3 | /api/v1/views/places_reviews.py | UTF-8 | 2,722 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python3
'''
API for Review
'''
from api.v1.views import app_views
from flask import jsonify, abort, request
from models import storage
import models
@app_views.route('/places/<place_id>/reviews/', methods=['GET'])
@app_views.route('/places/<place_id>/reviews', methods=['GET'])
def all_places_reviews(place_... | true |
adfc4b8433b420b947a0dec355a4724beabb33f7 | PRAKASH9497/database-connect | /my connector.py | UTF-8 | 473 | 2.859375 | 3 | [] | no_license | import mysql.connector
mydb=mysql.connector.connect(
host='localhost',
user='prakash',
password='anand1',
port='3306',
database='usersdb'
)
mycursor = mydb.cursor()
mycursor.execute('select * from user_details')
user_details = mycursor.fetchall()
for user_details in user_details:
pri... | true |
e0798325e1e7c31d7f900b8d95c28c79affc3fe3 | rimbendhaou/PyCIM | /CIM15/IEC61968/PaymentMetering/AccountingUnit.py | UTF-8 | 2,762 | 2.515625 | 3 | [
"MIT"
] | permissive | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | true |