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 |
|---|---|---|---|---|---|---|---|---|---|---|
9c9f23211e20095afa2b5406cb23d4482336e849 | satsukiya/d3js_zoomable_sunburst_for_budget | /wallet.py | UTF-8 | 2,375 | 2.71875 | 3 | [] | no_license | import pandas as pd
import json
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('excel_file', help='[input]予算書.xls')
parser.add_argument('--output_file', default='output.json')
args = parser.parse_args()
file_name = args.excel_file
sheet_name = "一般会計 予定経... | true |
10c257b30c5dab8a9d4d34c4df7cdd0352bf39c2 | jeanieischool/aep_final | /Test.py | UTF-8 | 3,252 | 3.28125 | 3 | [] | no_license | import unittest
from FileImportModule import *
from BST_Module import *
import itertools
class TestFileImportAndBinarySearchTree(unittest.TestCase):
def test_fileRead(self):
F = FileImport('test1.txt')
self.assertEqual(F.StoreFileArray(), ['hello'])
def test_errorHandling(self):
F = File... | true |
a322c626c2d72460ebe402a4e571e90ee5e37c8a | m-lab/bigsanity | /tests/test_cli.py | UTF-8 | 3,680 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2016 Measurement Lab
#
# 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 writi... | true |
ff7887b962ea8f2efcdc5505a8b8b460d6e18807 | ivanfelipecp/BreakHisAssessment | /utils/tables_vars_multi.py | UTF-8 | 1,081 | 2.71875 | 3 | [] | no_license | def begin_accuracy():
return "\\begin{table}[H] \n\\scalebox{0.6}{ \n\\begin{tabular}{c|c|c|c|c|c|c|c|c|c|} \\cline{2-10} \n& Architecture & A & F & PT & TA & DC & LC & MC & PC \\\\ \\hline"
def end_accuracy(metric):
return "\end{tabular}} \n\caption{metric} \n\end{table}".replace("metric", metric)
def init_f... | true |
6d4885f00100e1676ff1ae4c1bb2fe19c685b894 | jackfan108/Level_3_AdventureGames | /dumbledore.py | UTF-8 | 1,341 | 2.65625 | 3 | [] | no_license | from player import *
from npc import *
import random
from quest import *
class Wizard (NPC):
wizards = []
def __init__ (self,name,loc,restlessness,professorial,desc):
NPC.__init__(self,name,loc,restlessness,100,desc)
self._professorial = professorial
Wizard.wizards.append(self)
... | true |
9f9d6725dc043b7f3598509dcedb752dff87542d | ZenKaiii/python-spider | /spider/socket_test/myqq_client.py | UTF-8 | 2,684 | 2.953125 | 3 | [] | no_license | # qq客户端
import socket
import json
import threading
client = socket.socket()
client.connect(("127.0.0.1",8000))
user = "zenkai"
#1.登录
login_template = {
"action":"login",
"user":user
}
client.send(json.dumps(login_template).encode('utf8'))
res = client.recv(1024)
print(res.decode('utf8'))
#2.获取在线用户
get_use... | true |
eabfb4563249c54cbdd02826786daa5d91c366e1 | iFengZhao/Algorithms-1 | /LeetCode/1. 两数之和.py | UTF-8 | 332 | 3 | 3 | [
"Apache-2.0"
] | permissive | class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
if len(nums) < 1:
return None
keys = {}
for k, v in enumerate(nums):
if target - v in keys:
return [keys[target - v], k]
else:
keys[v] = k
... | true |
8f6cd89cb8e4702b34dd047b0d33a457f5847d3b | tuhmez/linus | /bot.py | UTF-8 | 606 | 2.5625 | 3 | [
"MIT"
] | permissive | import discord
import json
import os
from discord.ext import commands
from os import listdir
from os.path import isfile, join
with open('./config/config.json') as f:
config = json.load(f)
token = config["token"]
bot = commands.Bot(command_prefix='-')
cogs = [f for f in listdir('./cogs') if isfile(join('./cogs', ... | true |
7567bba4cc408d856194307250a6e949682054ea | luksos/iSA_python_basic | /2018.11.28_zajecia_05/homework.py | UTF-8 | 3,715 | 3.953125 | 4 | [] | no_license | """
Zadanie
1) Napisz program, który poda statystki dowolnego tekstu pobranego z pliku, wypisze takie dane jak: ilość użyć poszczególnych literek i cyfr, ilość wyrazów, zdań etc.
Nie będzie możliwość wyboru tryb case sensitivity.
Niech program tworzy też plik ze statystyką swojej pracy. Czyli np:
"
Ilość u... | true |
68249e5017e55a17a6137492c505da4f175b63df | RichardAbsin98/CS171 | /src/MyAI.py | UTF-8 | 3,686 | 3.046875 | 3 | [] | no_license | # ======================================================================
# FILE: MyAI.py
#
# AUTHOR: Abdullah Younis
#
# DESCRIPTION: This file contains your agent class, which you will
# implement. You are responsible for implementing the
# 'getAction' function and any helper meth... | true |
245410fe58971a48f603bde9f28bbda6eeb32b4a | JohnArneOye/quarto | /TCP.py | UTF-8 | 1,257 | 3.234375 | 3 | [] | no_license | import socket
class TCP:
def __init__(self, ip, port):
self.ip = ip
self.port= port
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((self.ip, self.port))
#sends a string of information regarding the position selected by our agent
def send_... | true |
23e9c3e99be9bcab9471e2bc81a563ded4e66621 | SleepyCelery/FaceRetrieve | /database.py | UTF-8 | 1,958 | 2.875 | 3 | [] | no_license | import numpy as np
import cupy as cp
import pymongo
import time
from tqdm import tqdm
client = pymongo.MongoClient('mongodb://localhost:27017/')
db = client['facesets']
faces = db['faces']
# The data dump in database should include these attrs:
# _id(index begin from 0)
# filename
# feature_vector(numpy vector/... | true |
e369b57fc2a014830d66902ca4901d19b998427c | Fabaladibbasey/MITX_6.00.1 | /polySum | UTF-8 | 584 | 3.609375 | 4 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 17 03:41:21 2021
@author: suspect-0
"""
import math
def poly_sum(n, s):
"""
Parameters
----------
n : int
is the size of polygon and cannot be negative or decimal.
s : int or float
the length of polygon can be ... | true |
0682ad5526f07692803391f57ff1472b1a038d22 | PubFork/Myrepo | /rabbitmq/t1.py | UTF-8 | 426 | 2.96875 | 3 | [] | no_license | import re
typed = {'error':0,'abc':0,'ded':0,'fds':0,'jffg':0}
def get_type_count(type):
with open(r'C:\Users\Administrator\Desktop\appu\test.txt', 'r') as f:
texts = f.readlines()
for text in texts:
matcher = re.compile('^{}:'.format(type)).match(text)
if matcher:
... | true |
8893787f3d34bab9f661495b30aeb024c341fdca | 712Danila712/edu_projects | /python/second_element_in_list.py | UTF-8 | 103 | 2.71875 | 3 | [] | no_license | from random import randint as rnd
x = [rnd(15, 50) for i in range(int(input('N: ')))]
print(*x[::2])
| true |
60305d048f36bca1085f11ca89784bca5733e990 | smartlmy/tensorflow_project | /api_test/pairwise_loss.py | UTF-8 | 760 | 3.046875 | 3 | [] | no_license | import tensorflow as tf
import numpy as np
def apply_discount(x):
a = tf.constant(2.0)
return tf.math.log(a) / tf.math.log(a + tf.cast(x, tf.float32))
logit_vals = tf.random.normal([2, 5], 0, 1, tf.float32)
print(logit_vals)
a = tf.argsort(logit_vals, axis=1)
print("arg sort first")
print(a)
print("arg sort s... | true |
8bc150ce16f88c549be0acf8c168ffe8c9f6388e | EverydayQA/prima | /pytools/other/fsample/input_cls.py | UTF-8 | 230 | 3.078125 | 3 | [] | no_license |
class GameDisplay:
@staticmethod
def prompt(text):
input_value = input(text)
return input_value
@staticmethod
def prompt2(text):
input_value = raw_input(text)
return input_value
| true |
94078635b539d5f9f6ba11dc18498f00344c0012 | RisabhKedai/Spectrum-Internship-2020-task2 | /fulldb.py | UTF-8 | 1,019 | 2.734375 | 3 | [] | no_license | from tkinter import *
import sqlite3
import json
import info
import tkinter.font as font
def main():
disp=Toplevel()
disp.title('Your_Entries'.lower())
disp.geometry("1200x330")
byf=font.Font(family='Brush Script MT',size=15,weight='bold')
Button(disp,text='i',bg='green',width=3,height=0,pady=1,command=info.mai... | true |
a205b30bfadcf5a3229f08a21c4033973b468122 | Aasthaengg/IBMdataset | /Python_codes/p03998/s948272561.py | UTF-8 | 594 | 2.828125 | 3 | [] | no_license | from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChar():
return input()
def readChars():
return input().split()
a = list(input())
b = ... | true |
e4fec1c8fd4d58e88880e466e84d40cc4e570fbc | shitangdama/leetcode | /algorithms/205.Isomorphic_Strings/Isomorphic_Strings.py | UTF-8 | 792 | 3.734375 | 4 | [] | no_license | class Solution:
# @param {string} s
# @param {string} t
# @return {boolean}
def isIsomorphic(self, s, t):
return dict(zip(s, t)) == dict(reversed(list(zip(s, t)))) and dict(zip(t, s)) == dict(reversed(list(zip(t, s))))
# debug
s = Solution()
print (s.isIsomorphic('abcde', 'sdfgx'))
class Solut... | true |
4c5028570b380c081c3a2ee332da612a55eb184b | AndresChiarena/Fundamentos | /# tp4_para_entregar.py | UTF-8 | 4,398 | 4.4375 | 4 | [] | no_license | # Ejercicios a entregar de la práctica 4.
# Comisiones 01, 06, 10, 11, 16 y 17:
# Los ejercicios a entregar son el 2, 3, 5, 9 y 14.
#-----------------------------------------------------------------------------------
# Ejercicio 2: Escribir un programa que lea dos números “n” y “m” y determine si m es
# divisible ... | true |
07eb801623d6b9c107b996bc0e5161c2f1079c72 | jonilsenGithub/MSc_project | /flask_ml/svc/ml_app.py | UTF-8 | 1,567 | 2.953125 | 3 | [] | no_license | #importing necessary Python packages, modules and libraries
from flask import Flask, jsonify, request
import numpy as np
import pandas as pd
import pickle
import json
import ml_model
#instanciating Flask
app = Flask(__name__)
#calling ml_model to produce a new model with the latest dataset from Cassandra container
ml... | true |
8bd2622a1719c191e829e21e7f8f4269a388877b | samuelobe/RPI-Courses-API | /main.py | UTF-8 | 2,335 | 2.90625 | 3 | [
"MIT"
] | permissive | import pandas as pd
import time
import csv
import json
import sys
import os
from collections import defaultdict
def get_courses():
temp_csvfile = open('/tmp/data.csv', 'w')
# The webpage URL whose table we want to extract
url = 'https://sis.rpi.edu/reg/zs20200501.htm'
# Assign the table data to a P... | true |
04e6334a0f00959e2833ebe77665891633818d4c | NicolasThou/ReinforcementLearning | /Bilel/Section3.py | UTF-8 | 663 | 2.75 | 3 | [] | no_license | import Bilel.Section2 as S2
import environment as env
def J_N(x, mu, N, discount_factor=0.99): # computes J(mu,N,x)
if N < 0:
print("N cannot be negative !")
exit()
elif N == 0:
return 0
else:
new_state = env.f(x, mu(x))
r = env.rewards[new_state[0]][new_state[1]]
... | true |
bf6d1078c3e2c397ffbe7515835e3e8e3a76026b | Per-Finnerup/foerste | /tegn_figur_5.py | UTF-8 | 519 | 3.1875 | 3 | [] | no_license | # Tegn_figur_5
import turtle
# definer konstanter
TREKANDT = 3
FIRKANDT = 4
FEMKANDT = 5
HEKSAGON = 6
SYVKANDT = 7
def tegn_figur(sider, color):
turtle.color(color)
for i in range(0, sider):
turtle.fd(50)
turtle.lt(360/sider)
turtle.fd(100)
turtle.penup()
turtle.goto(-250,0)
turtle.pendo... | true |
e026eaf8bc728c4409b50c6a5deb6a276914374a | bwbobbr/pycharm-xx | /py从零书本text/part 5/text5-3.py | UTF-8 | 383 | 3.1875 | 3 | [] | no_license | student ={'小明':'1001','小红':'1002','小智':'1003','小芳':'1004'}
student['小红']='1005'
student['小张']='1006'
print ('各位学生的学号',student)
print ('小明的学号是:',student['小明'])
print ('小红的学号是:%(小红)s'%student)
x={}
y=x
x['key']='value'
print(y)
people=student
print(people)
seq=('abc','def','hij')
st=dict.fromkeys(seq)
print(st) | true |
0a523cf8aa3cc7732c51c64b621a257b6f461e2b | 5362396/Wizualizacja-Danych | /cw3/zad3.py | UTF-8 | 411 | 3.671875 | 4 | [] | no_license | #Utwórz słownik z produktami spożywczymi do kupienia. Klucz to niech będzie nazwa produktu a wartość - jednostka w jakiej się je kupuje (np. sztuki, kg itd.).
#Wykorzystaj Python Comprehension do zdefiniowania nowej listy, gdzie będą produkty, których wartość to sztuki.
produkty={"mieso":"kilogramy","piwo":"puszki","cy... | true |
beaf57fa65351ffe60321ff5dda294f9ca4db23b | bibaev/python | /hw2/2/2.py | UTF-8 | 999 | 3.203125 | 3 | [] | no_license | #! /usr/bin/env python3
import itertools
class Singleton(type):
__instances = dict()
def __call__(cls, *args, **kwargs):
arg_id = (args, tuple(kwargs.items()))
if arg_id in Singleton.__instances:
return Singleton.__instances[arg_id]
instance = super().__call__(*args, **kwa... | true |
ff8cab693e3a85abc803c70f0bde4e781fd23c69 | ruizeliu/TweePyTrends | /barplot.py | UTF-8 | 740 | 3.078125 | 3 | [] | no_license | import util
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
###### Trending Issue Bar Chart Plotting ######
def plot_bar_toptopic(dic, key):
'''
Plot bar plot for trending issues with mentioned frequency
'''
hashtag = util.extract_hash(dic)
top_freq = {h:hashtag.count(h) for h in hasht... | true |
ba3b932e31a0a898e02effa221caaab959f9b5a1 | amalag-19/Applied_Coursework | /Statistical_Computing/Homework 1/aua257HW1.py | UTF-8 | 1,684 | 3.515625 | 4 | [] | no_license | ## Q2
for x in range(1,11):
print "Iteration ", x
# Q3
def sqdiff(inpfile,whichcol1,whichcol2,outfile):
col1=[] # initialize the vector that will hold the extracted column
col2=[]
if isinstance(inpfile, basestring):
f=open(inpfile,'r') # this is a pointer to the file
else:
f=inpfile
i... | true |
8a2e64a607463a99a1721ed2224d6841534bdfe2 | CollegeBoreal/INF1086-200-20H-02 | /4.SQL-NoSQL/300112917/300112917.py | UTF-8 | 892 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 17:43:59 2020
@author: djumaster
"""
# Connecting to MySQL Server and working with a Collection
from mysqlsh import mysqlx
# La fonction mashup
def mashup(myDb):
# Create a new collection 'my_collection'
myColl = myDb.get_collection('products')
# Accessing ... | true |
3e197c8cc1a72c64adfe10c7f6ecde4365f4df92 | i-harbor/mongodb_zabbix | /monitoring for Standalone/mongodb_standalone_auth.py | UTF-8 | 5,789 | 2.609375 | 3 | [] | no_license | #!/usr/bin/python
#-*- coding: utf-8 -*-
'''
'@file: mongodb_standalone_auth.py
'@author: liyunting
'@version: 2
'@lastModify: 2019-02-14 14:58
'
'''
import sys, getopt
import subprocess
from pymongo import *
from pymongo.errors import ConnectionFailure
from pymongo.errors import OperationFailure
# the prefix of ho... | true |
1d3ed5c36ae1cd7e0248ff43be5ab4429c1717a1 | wiks/proxy | /python/__init__.py | UTF-8 | 5,331 | 2.703125 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import os
from datetime import datetime
# import logging
import bs4
import re
import urllib2
import wiks_comm
import db_proxies
import creds
db = db_proxies.DeBe()
def only_value(key, default=None):
"""
pobierz z settings-DB i zwróć tylko wartość, jeśli nie występuje
to zwróć de... | true |
9f5bcebf3209215da2542bdd6fba0a0012bd8ea3 | Lubos-source/PythonLearningProjects | /Projects/Virus/encrypting.py | UTF-8 | 1,147 | 2.96875 | 3 | [] | no_license | from cryptography.fernet import Fernet
import glob
def write_key():
key = Fernet.generate_key()
with open('mykey.key', 'wb') as mykey:
mykey.write(key)
print (key)
def load_key():
return open ("mykey.key", "rb").read()
def encrypt(filename, key):
f = Fernet(key)
... | true |
ca9dad6542b08f6d5fd239f5813a892d5377a248 | ThinkAbout1t/kolokwium2 | /54.py | UTF-8 | 417 | 3.8125 | 4 | [] | no_license | '''Введіть масив з 20 елементів і визначте, чи є в ньому елементи з
однаковими значеннями.
виконал Пахомов Олександр'''
import numpy as np
a=np.zeros(20, dtype= int)
for i in range(20):
a[i]=int(input('number:'))
new_a=set(a)
print(a)
print(new_a)
if len(a)==len(new_a):
print('no same elements')
els... | true |
493169fa8ca9173e71a83d62790eeca5f9d2b427 | cooljoseph1/battlehack20-minimal | /battlehack20/engine/game/robot.py | UTF-8 | 486 | 2.796875 | 3 | [
"MIT"
] | permissive | from .robottype import RobotType
class Robot:
def __init__(self, row, col, team, id, type, runner):
self.row = row
self.col = col
self.team = team
self.id = id
self.type = type
self.runner = runner
def __str__(self):
team = 'B' if self.team.value else 'W... | true |
ad77d5b673d523dbf6e58f2f231bcb2e07cc241c | lamida/kattis | /python/dice.py | UTF-8 | 283 | 2.8125 | 3 | [] | no_license | import sys
inn = sys.stdin
(n, m) = (int(i) for i in next(inn).strip().split(" "))
cache = [0] * (n + m + 1)
for i in range(1, m + 1):
for j in range(1, n + 1):
cache[i+j]+=1
mx = max(cache)
for i in range(1, len(cache)):
if cache[i] == mx:
print(i)
| true |
954345e5737b0040f654cdb736877126e3f2f737 | sireesha98/sasi | /buji.py | UTF-8 | 58 | 2.796875 | 3 | [] | no_license | z=int(input())
m=int(input())
z=z+m
m=z-m
z=z-m
print z,m
| true |
795ec8cbc59655fe87bb30e88ecc9e066db1c6f3 | sweersr/visions | /examples/data_analysis/categorical.py | UTF-8 | 2,361 | 2.828125 | 3 | [
"BSD-4-Clause",
"BSD-2-Clause"
] | permissive | import pandas.api.types as pdt
import pandas as pd
import numpy as np
from typing import Sequence, List
from visions import visions_string, visions_integer, visions_object
from visions.core.model.relations import IdentityRelation, InferenceRelation
from visions.core.model import TypeRelation
from visions.core.model.ty... | true |
ef20b1701980ca5b8a829046d46687b14c1b3b78 | ryanfarr01/BloomFilter_Hashtable | /bloom_filter_test.py | UTF-8 | 488 | 3.078125 | 3 | [
"MIT"
] | permissive | # Here are a set of very simple tests. Please make sure your code passes the provided tests -- this serves as a check that our grading script will work.
# You are encouraged to add additional tests of your own, but you do not need to submit this file.
from bloom_filter import BloomFilter
bfilter = BloomFilter()
bfilt... | true |
9b28c31433735d36af7de7022fad31558d8b4244 | nicecode996/Python_Test | /面向对象编程/创建和使用对象.py | UTF-8 | 119 | 2.671875 | 3 | [] | no_license | # coding=utf-8
# !/usr/bin/env python3
from 面向对象编程.定义类 import Animal
animal = Animal()
print(animal) | true |
694614ded5eb358ab984c2532484b71c5d6828d0 | xuxiaoyuspallow/SimplePortScan | /port_scan.py | UTF-8 | 2,459 | 2.53125 | 3 | [] | no_license | import socket
import sys
import threading
import time
import Queue
import struct
import json
#############
# config
TIMEOUT = 1
THREAD = 1
COMMON_PORT = ['80','443','3306','23']
############
RESULT = {}
q = Queue.Queue()
def ip_to_long(ip):
return socket.ntohl(struct.unpack("I",socket.inet_aton(str(ip)))[0])
... | true |
54c6b490498193019dd6ad7f3cdebd697a6e10cc | fams/linuxplace-deployer | /src/utils/deploy.py | UTF-8 | 11,242 | 2.609375 | 3 | [
"MIT"
] | permissive | from utils.utils import *
from utils.constants import *
from utils.git import *
"""
Class que possui informacoes e metodos relativos ao deploy e undeploy
"""
class Deploy:
release_name = ""
basename = ""
api_version = ""
group = ""
values = {}
pod_name = ""
events = {}
ns = ""
micro... | true |
63a25b2ae4858d658bfa5fa5ef712ee8cb75478a | vivaxy/algorithms | /python/problems/add_digits.py | UTF-8 | 604 | 3.5 | 4 | [
"MIT"
] | permissive | """
https://leetcode.com/problems/add-digits/
https://leetcode.com/submissions/detail/106673041/
"""
class Solution(object):
def addDigits(self, num):
"""
:type num: int
:rtype: int
"""
if num == 0:
return 0
return (num - 1) % 9 + 1
import unittest
... | true |
1710efcc06154a02d05422ab820258ad63beb712 | anton-shablyko/code_fights | /arcade_intro/23_boxBlur.py | UTF-8 | 508 | 3.375 | 3 | [] | no_license | def boxBlur(image):
result = []
for h in range(len(image)-2):
t_result = []
for w in range(len(image[0])-2):
top_row = image[h][w:w+3]
mid_row = image[h+1][w:w+3]
low_row = image[h+2][w:w+3]
blur = (sum(top_row + mid_row + low_row))//9
... | true |
70f6021bd28fe1fe490e421d2a525038459de131 | RayChen3636/Python_Basic_1 | /main16.py | UTF-8 | 624 | 4.125 | 4 | [] | no_license | person = {"name":"Elwing","height":175,"handsome":True}
print(person)
#取出東西: print(name)
print(person["name"])
#新增一個名字: weight = 75
person["weight"] = 75
print(person)
#更改名字背後的值: height = 177
person["height"] = 177
print(person)
#取出來做完運算設定回去: height = height +3
person["height"] = person["height"] + 3... | true |
ecd6b91bdbefcc268933fd3d49ecc64cc63f93cd | grb2015/machine-learning | /fangWei_DMandML_inAction/chapter3_regression/3.4/3.4.3.py | UTF-8 | 1,899 | 3.21875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn import metrics
import numpy as np
# read csv file directly from a URL and save the results
data = pd.rea... | true |
98309960149fe108c53c2c29559c695edc55f65a | EmilioDifferding/smc | /backend/app/api/api.py | UTF-8 | 11,612 | 2.640625 | 3 | [] | no_license | """
api.py
- provides the API endpoints for consuming and producing
REST requests and responses
"""
from flask import Blueprint, jsonify, request, current_app
from functools import wraps
import jwt
from datetime import datetime, timedelta
from .models import db, Alias, Device, Place, Measurement, Unit, Value, User, ... | true |
9a602b4d18b4c75884d69387941482edc4908e27 | haleyelena/ClassworkSpring2021 | /client.py | UTF-8 | 382 | 2.953125 | 3 | [] | no_license | import requests
server = "http://127.0.0.1:5000"
r = requests.get(server+"/")
print(r.status_code)
print(r.text)
blood_data = {"HDL": 5}
r = requests.post(server+"/HDL", json=blood_data)
# answer = r.json() # this makes is a json file, so will last print statment will
# return actual data type
print(r.status_code)
pr... | true |
36fa202ce17050ec574edd1e5983b518313fc179 | manojkumarpaladugu/LearningPython | /Automate the boring stuff with python/6.lists/basics.py | UTF-8 | 1,767 | 4.34375 | 4 | [] | no_license | # list is a value which contains multiple values
# we can store same or different types of data in it
# a list can store another list inside it
# list with same type of data
sampleList = ['cat', 'bat', 'rat']
print('sampleList[0]:',sampleList[0])
# list wit different types of data
sampleList = ['apple', 'bal... | true |
55c3f071bb4adead093b7a048c490e01600e11ee | camilaffonseca/Learning_Python | /Prática/ex081.py | UTF-8 | 774 | 4.09375 | 4 | [
"MIT"
] | permissive | # coding: utf-8
'''
Crie um programa onde 4 jogadores joguem um dado e tenham resultados
aleatórios. Guarde esses resultados em um dicionário em Python. No final,
coloque esse dicionário em ordem, sabendo que o vencedor tirou o maior
número no dado.
'''
from random import randint
from operator import itemgetter
from ... | true |
889897befe43a901b597cf7c41ff024a50054b25 | svet2000/Coding_Dojo_Python_1week | /sum.py | UTF-8 | 227 | 3.359375 | 3 | [] | no_license |
for num in range(1,1001):
if num%2==1:
print num
for num1 in range(5,1000001,5):
print num1
a = [1, 2, 5, 10, 255, 3]
sum=0
for item in a:
sum=sum+item
print sum
a = [1, 2, 5, 10, 255, 3]
print sum/len(a)
| true |
7670ddc4ddc98e49096054ee6c26397947feca8d | tathagata-raha/CP_python | /math/nCrmodp_lucas.py | UTF-8 | 1,446 | 3.8125 | 4 | [] | no_license | # A Lucas Theorem based solution
# to compute nCr % p
# Returns nCr % p. In this Lucas
# Theorem based program, this
# function is only called for
# n < p and r < p.
def nCrModpDP(n, r, p):
# The array C is going to store
# last row of pascal triangle
# at the end. And last entry
# of last row is nCr
C = [0] * ... | true |
44926faf635b377bc416aed8d3ddc02ec13fd455 | dariuszmarek/WSB_LAB | /MSI/Lab 3 i 4/rozwiazania/1_przetwarzanie_obrazu_do_pojedynczego_znaku.py | UTF-8 | 2,791 | 2.9375 | 3 | [] | no_license | import os
import os.path
import cv2
import glob
import imutils
IMAGES_FOLDER = "obrazy"
OUTPUT_FOLDER = "przetworzone_obrazy"
PIXEL_MARGIN = 3
# przygotowanie listy plików w określonym folderze
image_files = glob.glob(os.path.join(IMAGES_FOLDER, "*"))
# licznik okreslonych znakow
counts = {}
for (i, image_file) i... | true |
ac7ce24bc44c735af5f549cbc97c5636e4da0901 | wwsbbase/machineLearning | /second.py | UTF-8 | 1,615 | 2.796875 | 3 | [] | no_license | print("start...............")
import time
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction.text import CountVectorizer
from tqdm import ... | true |
8333b3646135cfd558e8d14315cf616339dc806b | towfeeqfayaz11/python_programs | /bubblesort_algo.py | UTF-8 | 358 | 3.875 | 4 | [] | no_license | # bubble sort
def bubble_sort(arr):
for i in range(len(arr)):
for j in range(0, len(arr)-i-1):
if (arr[j] > arr[j+1]):
arr[j],arr[j+1] = arr[j+1],arr[j]
#print(arr)
return arr
#main
my_list = [4,2,1,6,3,7,8,5,9]
print("orignial list before:", my_list)
bubble_sort(m... | true |
ebc7a6e35e23e98876dddeef86816617d0e8b8a0 | vadonmo/PythonDesignPatterns | /Singleton/demo4.py | UTF-8 | 1,138 | 3.8125 | 4 | [
"MIT"
] | permissive | '''
单例和元类
使用 metaclass 指定元类
'''
class MyInt(type):
def __call__(self, *args, **kwargs):
print("**** Here's My int ***", args)
print("Now do whatever you want with these objects...")
return super().__call__(*args, **kwargs)
pass
class int(metaclass=MyInt):
def __ini... | true |
d8be7ef9774553b0a97f301c28d2970108fbf643 | tirakitsu/Word-Prediction | /train.py | UTF-8 | 2,515 | 3 | 3 | [] | no_license | from numpy import array
from keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Embedding
class Training:
def ... | true |
5467f29452d5494196a9d3f26f86123e999fcf7f | chpplen/company_sponsor_media | /assignment_based_algorithm.py | UTF-8 | 3,547 | 2.796875 | 3 | [] | no_license | from munkres import Munkres, print_matrix
import random
import copy
import numpy as np
def solve_assignment(costMatrix, isProfit):
if isProfit:
costMatrix = [[-i for i in row] for row in costMatrix]
m = Munkres()
opt_assignment = m.compute(costMatrix)
print_matrix(costMatrix, msg='Lowest cost thro... | true |
a8e31f2ccda955a4a2ec394aeb5e741b3c0f3172 | LedererLab/HDIM-Py | /hdim/__init__.py | UTF-8 | 5,169 | 3.203125 | 3 | [
"MIT"
] | permissive | from .hdim import *
def ISTA( X, Y, Beta_0, convergence_criteria, Lambda, L_0 = 0.1, use_screening_rules = True, use_single_precision = False ):
"""
Use the Iterative Shrinkage Thresholding Algorithm ( ISTA ) to iteratively solve the LASSO.
Args:
X: An n x p 2D array representing the design matrix... | true |
2ba00c479ee202787ce99d415714b40a6a1cd6fa | xiang-daode/Python3_codes | /六年级学生成绩_3.py | UTF-8 | 722 | 3.203125 | 3 | [] | no_license | #生成文件:
import random
with open('六年级学生9个班成绩.txt',"w") as f:
f.write('姓名 \t班级 \t语文 \t数学 \t英语 \t科学 \t社会 \t总分\n')
for i in range(500):
s0=str(601+i%9)
s1=str((int)(100*random.random()))
s2=str((int)(100*random.random()))
s3=str((int)(100*random.random()))
s4=str((int)(100*ra... | true |
0ece90c2146ccc7c663ee6e29457dab25920c6e7 | joshnisly/wordament | /vision/squares.py | UTF-8 | 3,254 | 3 | 3 | [] | no_license |
import cv2
import numpy as np
def find_grid_squares(image, expected_count):
squares = _find_squares(image)
avg_sizes = []
for square in squares:
avg_size = _calc_avg_size(square)
if avg_size:
avg_sizes.append(avg_size)
if not avg_sizes:
return []
avg_sizes.so... | true |
ce73a78e24aa9c5af57b22b3f281121075780497 | vmlaker/pythonwildmagic | /test/ThinPlateSplines/ThinPlateSplines.py | UTF-8 | 5,726 | 2.9375 | 3 | [
"MIT"
] | permissive | # This file is a Python translation of the original C++ implementation.
# Original file header comment:
#
# Geometric Tools, LLC
# Copyright (c) 1998-2012
# Distributed under the Boost Software License, Version 1.0.
# http://www.boost.org/LICENSE_1_0.txt
# http://www.geometrictools.com/License/Boost/LI... | true |
5aa5176441de358f98491e5c88277831291c0822 | andysai/python | /风变编程/python基础-山顶班/fb_05.py | UTF-8 | 540 | 3.5625 | 4 | [] | no_license | # 假设感觉有困难,可查看步骤中的提示(鼠标移到步骤小标题上点击出现的问号)。
#请你通过文件读写命令,读取 photo1 里的数据(提示见代码区开头)。
#然后,新建名为“photo2”的图片(在同一个文件夹),写入读到的数据。
#这样,我们就通过文件读写的代码,完成了图片的复制(而非鼠标右键)。
with open('photo1.png','rb') as file:
data = file.read()
with open('photo2.png','wb') as newfile:
newfile.write(data) | true |
7cc4204e27db27c9d966aac1e5291a3b7d94189c | SarvasyaVikas/Image-Histograms | /Detecting_Contrast_SV.py | UTF-8 | 1,967 | 2.84375 | 3 | [] | no_license | import argparse
import imutils
import cv2
import numpy as np
from skimage.exposure import is_low_contrast
ap = argparse.ArgumentParser()
ap.add_argument("-I", "--source1", type = str, default = "examples/01.jpg")
ap.add_argument("-II", "--source2", type = str, default = "examples/02.jpg")
ap.add_argument("-III", "--so... | true |
f3f78e7a46ea2704561a23e7afc2e34aad8061c2 | joshbryan-globus/globus-sdk-python | /globus_sdk/authorizers/access_token.py | UTF-8 | 1,373 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | import logging
from globus_sdk.authorizers.base import GlobusAuthorizer
from globus_sdk.utils.string_hashing import sha256_string
logger = logging.getLogger(__name__)
class AccessTokenAuthorizer(GlobusAuthorizer):
"""
Implements Authorization using a single Access Token with no Refresh
Tokens. This is s... | true |
8d9a3210f418f0baa1821c90db9ef76ca3ef61a7 | vcu-stricklercb/spiral | /spiral/homework.py | UTF-8 | 314 | 3.171875 | 3 | [] | no_license | def spiralize(number):
n = 501
Spiralmatrix= None
Spiralmatrix_first_diagonal = sum(Spiralmatrix[i][i] for i in range(n))
Spiralmatrix_second_diagonal = sum(Spiralmatrix[i][n-i-1] for i in range(n)) - 1
number = Spiralmatrix_first_diagonal + Spiralmatrix_second_diagonal
print(number)
| true |
3e0d9aaa8a41aa2d5aef8fe8632613e92dfbc96b | hqcm/meitulu_scrapy | /ooxx/pipelines.py | UTF-8 | 1,597 | 2.734375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exceptions import DropItem
import scrapy
class ooxxScrapyPipeline(ImagesPipeline):
#通过修改file_path函数来改变图片保存的路径
def file_path(self, request, response=None, info=None):
#每套图的分类目录
item = request.meta['item']
... | true |
e0126d7f9d596383f3aa3d033ed18d36f82667cd | dougbel/iTpy | /examples/testing_env_single_it.py | UTF-8 | 8,865 | 2.5625 | 3 | [] | no_license | import trimesh
import numpy as np
import open3d as o3d
from transforms3d.affines import compose
import pandas as pd
import math
import time
import os
from it.testing.tester import Tester
import it.util as util
last_position = np.array([0, 0, 0])
index = 0
r = np.eye(3) # rotation matrix
z = np.ones(3) # zooms
MAX_SC... | true |
976a2f0b1f3539f3400fca5851cceb3063ce4aa7 | carlos-hernandezortiz/python-challenge | /PyParagraph/main.py | UTF-8 | 3,026 | 3.296875 | 3 | [] | no_license | import re
import os
import string
#preparing the output for both files foun in Output file. If you want to test it, you should add the path of you computer
#until "...paragraph_" and the code will do the magic.
for i in range(1,3):
txtpath = 'C:/Users/empha/Desktop/Data_Analytics/Semana_4/python-challenge/PyParagr... | true |
6e619e7613b975b5a762c5e6e9d4f8aae10a97fb | cheshrst/pythonProject4 | /task6.py | UTF-8 | 196 | 3.453125 | 3 | [] | no_license | ##from itertools import count
##for el in count(int(input("Введите число "))):
## print(el)
from itertools import cycle
my_list = [123, 33]
for el in cycle(my_list):
print(el) | true |
a7ac1e464bfe0e110fae5aee6eb9b0e6354b716f | IgorMichels/Monicas_Gang_Network | /Code/Functions/class_Graph_TM.py | UTF-8 | 9,108 | 2.625 | 3 | [] | no_license | import networkx as nx
import matplotlib.pyplot as plt
import networkx.algorithms.community as nxcom
from Functions.class_TM import TM
class Graph_TM:
def __init__(self):
self.Graph = nx.Graph()
self.edges2add = []
self.communities = None
self.node_weights = {}
def data2... | true |
9c5847d099bc1b72813bede3d5147f033c841506 | zahrajalilian/alexa_simple | /main.py | UTF-8 | 1,836 | 3.015625 | 3 | [] | no_license | """
import scope
"""
import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
# here we create a recognizer to recognize our voice
"""
here we use our mic as a source of audio/voice and use speech recognition to
"""
listener = sr.Recognizer()
engine = pyttsx3.i... | true |
d6489b78837cc17c3bcd0ae0c7d709158d4995ba | YanXuHappygela/Farsight-latest | /python/nuclei.py | UTF-8 | 4,370 | 2.640625 | 3 | [] | no_license | #############################################################################
# HOW TO GET STARTED:
#
# 1. OPEN THIS FILE (nuclei.py) USING IDLE
# 2. IMPORT THIS MODULE: >>>import nuclei
# 3. SEGMENT: >>>nuclei.segment()
# YOU WILL BE ASKED TO PROVIDE PATH CONTAINING THE IMAGE AND PARAMETER FILE
# MAKES SURE PARA... | true |
30a6410eff04e4ffdf4e8db0fa5521a9d60adc4b | ecnuitaa/chicolucio-PhaseDiagram | /src/plot.py | UTF-8 | 4,365 | 3.109375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | from matplotlib import pyplot as plt
from phase_diagram import ureg
class Plot:
def __init__(self, x_unit, y_unit, x_label='', y_label='', ax=None, scale_log=True, legend=False, title=True,
title_text=''):
"""
Parameters
----------
x_unit : str
pint uni... | true |
705e7ff8a6367a0bfe38e69e3e349af113ca3869 | Matrinos/mainfluxpy | /mainflux/api.py | UTF-8 | 13,243 | 2.75 | 3 | [
"MIT"
] | permissive | from .api_request import ApiRequest, GetRequest, PostRequest, DeleteRequest, PutRequest, PatchRequest
from typing import Iterable
from json.decoder import JSONDecodeError
from typing import List
class ApiException(Exception):
pass
class AppNotProvided(ApiException):
pass
def api_path(path):
"""
De... | true |
664d61d50ec8ac18fa22b701cd20062e048fec8b | NikkieS/Algorithm_practice | /ex.11651_sort.py | UTF-8 | 510 | 3.71875 | 4 | [] | no_license | """
Date : 10/21/20
Author : GaRam Song
URL : https://www.acmicpc.net/problem/11651
Description : sorting by second element
"""
case = int(input())
coor = []
for i in range(case):
coor.append(list(map(int, input().split())))
coor.sort(key = lambda x: (x[1], x[0]))
print(coor)
for i in range(case):
for j in ... | true |
b6ff72faab6a5b81b2b0fbd1cb5d27f8db4f02d0 | huangqiank/Algorithm | /laiclass/probability/random.py | UTF-8 | 673 | 2.96875 | 3 | [] | no_license | '''
Created on Jan 21, 2018
@author: qiankunhuang
'''
def random25():
return random(5) + 5*(random(5))
def random7():
num= random25()
while num>20:
num = random25()
return num%7
def random72():
num= random25()
while num>6:
num = random25()
return num%7
def random125():
... | true |
4a7775e8e13d1b48d4baf19d3f8e2a6d043a3ead | Jeanzw/LeetCode_Practice | /Python/Medium/Linked List & Math/2 Add Two Numbers.py | UTF-8 | 1,586 | 4 | 4 | [] | no_license | '''
Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
l1 = {val: 2, next: {val:4, next:{val:3, next: None}}}
“”“
这里对于linked list其实就是两个参数,一个是val,一个是next
对于l1 = [2,4,3]来说
l1.val = 2
l1.next.val = 4
l1.next.next.val = 3
”“”
head = {... | true |
0b042940aff1fff937f2cd14062b2d449a5a5260 | ZJUguquan/Leetcode | /leetcode_relearn/array/combination-sum-I.py | UTF-8 | 658 | 3.03125 | 3 | [] | no_license |
candidates = [2, 3, 5, 6, 7]
target = 7
from ..thinkcspy import thinkcspy01
class Solution:
def combinationSum(self, candidates, target):
candidates.sort()
return self._combinationSum(candidates, target, [])
def _combinationSum(self, candidates, target, item):
if not candidates:
... | true |
dfbb6dda5cacaa467d2451a5c787c15871fc2f4e | MateusMendesSantana/luy-iqoption-bot | /strategies/dark_cloud.py | UTF-8 | 944 | 2.609375 | 3 | [] | no_license | from candle import Candle
from graphic_analysis import GraphicAnalysis
from trend import Trend
from candle import Candle
from active import Active
class DarkCloud:
def __init__(self, active: Active, graphic_analysis: GraphicAnalysis):
self.active = active
self.graphic_analysis = graphic_analysis
... | true |
4481b946cbef881b60126017cb7e35c6e0a90060 | diegomvh/pyqt | /widgets/notification.py | UTF-8 | 8,513 | 2.5625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import collections
from PyQt4 import QtCore, QtGui
class Notification(QtGui.QWidget):
aboutToClose = QtCore.pyqtSignal()
contentChanged = QtCore.pyqtSignal()
def __init__(self, text, parent, timeout=None, icon=None, links=None,
recyclable=None):
super(Notification, ... | true |
dcdc70a150195df2e39ebc056b66c6cb13656048 | yfeng2018/IntroPython2016a | /students/mike_newton/Mailroom/mailroom.py | UTF-8 | 8,763 | 4.125 | 4 | [] | no_license | '''______________________________________________________
Mike Newton
newton33@uw.edu
Intro To Python 100A
University of Washington, Winter 2016
Last Updated: 02 February 2016
Python Version 3.5.1
Mailroom Exercise
http://uwpce-pythoncert.github.io/IntroPython2016a/exercises/mailroom.html
___________________________... | true |
03afd32857b0e12dbba1646d7b35786912afe089 | z-wade/algorithm004-01 | /Week 07/id_101/[58]最后一个单词的长度.py | UTF-8 | 1,092 | 3.484375 | 3 | [] | no_license | #给定一个仅包含大小写字母和空格 ' ' 的字符串,返回其最后一个单词的长度。
#
# 如果不存在最后一个单词,请返回 0 。
#
# 说明:一个单词是指由字母组成,但不包含任何空格的字符串。
#
# 示例:
#
# 输入: "Hello World"
#输出: 5
#
# Related Topics 字符串
#leetcode submit region begin(Prohibit modification and deletion)
class Solution(object):
def lengthOfLastWord(self, s):
"""
:type s: s... | true |
8bad7fb6320481737afb96e71da59b077214722e | Red350/docker-cms | /myapp/app.py | UTF-8 | 10,801 | 2.609375 | 3 | [] | no_license | from flask import Flask, Response, render_template, request
import json
from subprocess import Popen, PIPE
import os
from tempfile import mkdtemp
from werkzeug import secure_filename
import sys
app = Flask(__name__)
app.debug = True
# This is used to prevent the CMS from deleting itself
cms_name = "dockercms"
@app.r... | true |
530b9f7cc6f6958e5f4a0c245a1da20e11e13381 | qwert19981228/P4 | /课件/0304/3geventtx.py | UTF-8 | 2,005 | 2.53125 | 3 | [] | no_license | import gevent
from gevent import monkey
import time
# 补丁 替换系统的默认库
monkey.patch_all()
from queue import Queue
import requests
from bs4 import BeautifulSoup
from models import Mydb
from threading import Lock
import re
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, lik... | true |
c8497ea2f3c42dc6ec9af85494818aafe4f6829e | jardon-u/miniprojs | /map/dbpedia_test.py | UTF-8 | 269 | 2.578125 | 3 | [] | no_license | import urllib
import json
u = "http://dbpedia.org/data/Country.json"
data = urllib.urlopen(u)
json_data = json.loads(data.read())
for abstract in json_data[u]["http://dbpedia.org/ontology/abstract"]:
if abstract['lang'] == 'en':
print abstract['value']
| true |
33c8b36288c0e08217881e01cc6e2fbf6ee22a5e | Aleks8830/PythonPY100 | /Занятие4/Лабораторные_задания/task1_8/main.py | UTF-8 | 167 | 3.046875 | 3 | [] | no_license |
list_ = [4, -1, 10, -1, 3, -3, -6, 8, 6, 9]
list_1 = []
for i in list_:
if i > 0:
i = i ** 3
else:
i = 0
list_1.append(i)
print(list_1)
| true |
b7b9134ea7465d97051517df81d19efb94deb279 | chyd1k/Program-for-encryption-decryption-and-cryptanalysis | /Linear_cryptanalysis/asd.py | UTF-8 | 2,362 | 3.328125 | 3 | [] | no_license | '''
mes='011' '110' '111'
key='101' '101' '101'
xxx='110' '011' '010'
ccc='001' '001' '111'
print(list(mes))
c0=p0^k0^p1^k1
print(f'c0 {c0}')
c1=p0^k0^p1^k1^p2^k2
print(f'c1 {c1}')
c2=p1^k1^p2^k2
print(f'c2 {c2}\n')
k0=p0^(c1^c2)
k1=p1^(c0^c1^c2)
k2=p2^(c0^c1)
print(f'k0 {k0... | true |
09e8558f49b0436c4c4170eb313a0e5eb0e01e57 | ConsumerAffairs/django-locking | /locking/forms.py | UTF-8 | 1,056 | 2.546875 | 3 | [
"BSD-2-Clause-Views"
] | permissive | """ locking.forms
Forms class for the django-locking project.
"""
from django import forms
from django.contrib.contenttypes.models import ContentType
from locking.models import Lock
class LockingForm(forms.ModelForm):
"""
Clean the form to enforce orm locking before saving the object. This will only work i... | true |
599ff5d6d00c2f4aa6e5e035f821839d6f89d095 | emstoudenmire/2D_NLCE_DMRG | /cornerentropyfile.py | UTF-8 | 1,841 | 3.1875 | 3 | [] | no_license | ############### Corner Entropy Formulas ##################
import numpy
def cornerentropy(m,d):
#print "m = ",m
pmm = 0
x = 1
y = 1
if m==1: return 0 # p0101 = 0
# The contribution from the C's
while x < m: # loops from C0404_0101, C0404_0102, ... , C04... | true |
885eff44a75a3838984a46cb13b53bf2db97e0fc | Kama-kz/real_estate_project | /project Kaggle Real Estate-Copy1.py | UTF-8 | 13,509 | 2.859375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import csv
import sklearn as sk
# In[3]:
kaggle=pd.read_csv(r"C:\Users\kamal\Desktop\104\project\kaggle 1\hp/train.csv")
# In[3]:
kaggle.head()
# In[4]:
na=kaggle.isna().sum()
# In[5]:
len(kaggle)
# In[6]:
kaggl... | true |
5ed89bef9478b8f027ca1d673777c2746b742e20 | Escavadora/Wardens-Bot | /main.py | UTF-8 | 4,321 | 2.671875 | 3 | [] | no_license | # Work with Python 3.6
import discord
import random
from discord.ext import commands
import aiohttp
import pandas as pd
tokenFile = open('token.txt', 'r')
TOKEN = tokenFile.read()
bot = commands.Bot(command_prefix='!')
# @bot.command(name='rollplayer', help='KEKW')
# async def rollplayer(ctx, name):
# if name ==... | true |
39772fb24af2f12522fc94c1918883283c309f16 | arahansa/learn_tf | /00-arahansa/텐서다루기함수들/07-reduce-sum_다른값의차원.py | UTF-8 | 512 | 2.859375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
sess = tf.Session()
input1 = np.array([
[[1,2,3,4]],
[[11,12,13,8]]
])
input2 = np.array([
[[3,6,3,4], [2,4,6,8]]
])
tensor1 = tf.convert_to_tensor(input1, dtype=tf.float32)
tensor2 = tf.convert_to_tensor(input2, dtype=tf.float32)
print... | true |
516a376eb1e526a8a2cf33d343ca112a97e2f89f | claraj/ProgrammingLogic1150Examples | /7_dictionaries/change_dictionary_key.py | UTF-8 | 776 | 3.625 | 4 | [] | no_license |
colleges = {'Minneapolis College': '1501 Hennepin Avenue, Minneapolis',
'Metro State': '100 E 7th St, St. Paul',
'Saint Paul College': '235 Marshall Avenue, St. Paul',
'North Hennepin Community College': '7411 85th Ave N, Brooklyn Park',
'Century College': '3300 Century ... | true |
b29df7e1166070c35292b22be72ad868fab16d0a | torcor-dev/rdl | /reddit_downloader/imgur_api_wrapper/imgurmedia.py | UTF-8 | 936 | 2.890625 | 3 | [] | no_license | from .mediatypes import MediaType
class ImgurMedia:
MEDIA_TYPES = ["unknown", "video", "gallery", "image"]
def __init__(self, media):
self.media = media
self.urls = []
self.media_type = self.MEDIA_TYPES[0]
self.data = {
"urls": self.urls,
}
if self.... | true |
c64e81d66b766ae66a82375f993b6741ca226e84 | lorcanob/kol-optimization | /KOL_Selection.py | UTF-8 | 5,176 | 2.953125 | 3 | [] | no_license | import csv
import json
import os
import sys
# --------NOTES--------
# Estimated cost in ¥ per 1M Reach as benchmark:
# Facebook Insta Twitter YouTube Snapchat Blog
# 2,500,000 1,000,000 200,000 2,000,000 1,000,000 6,000,000
# --------TO DO LIST--------
# add LinkedIn, Pinterest, Ti... | true |
907629b4ffce6a743f3a2bcef90ab2fe5290d0d2 | kangxiaohui/learn_pytorch | /chapter05/learnpytorch_5.6.py | UTF-8 | 5,932 | 2.578125 | 3 | [] | no_license | import torchvision.models.alexnet
import torch
from torch import nn
import sys
sys.path.append("..")
import learntorch_utils
import time
# #net = nn.Conv2d(1, 96, 11, 4,4)
# #X= torch.randn((1,1,224,224))
# # out=net(X)
# # print(out.shape)
# net = nn.Conv2d(1, 1, 3, padding=0)
# X = torch.randn((1, 1, 5, 5))
# # pri... | true |
786ed3b0b9a96bd4f6dabc56f2d0667fc8902c10 | liuzike/starnet1 | /2_Preprocessing_of_Training_Data.py | UTF-8 | 5,368 | 2.96875 | 3 | [] | no_license |
# coding: utf-8
# # Preprocess training and test set for StarNet
# This notebook takes you through the steps of how to pre-process the training data necessary for training StarNet and separate out a high S/N test set.
#
# Requirements:
# - python packages: `numpy h5py vos`
# * required data files: apStar_visits_main... | true |
6c987a46f29ef4f19373a36851025b3e8bc63f11 | ruthhuillca/G_C_T | /template matching/match.py | UTF-8 | 2,939 | 3.09375 | 3 | [] | no_license | import numpy as np
import argparse
import imutils
import glob
import cv2
# construir el analizador de argumentos y analizar los argumentos
ap = argparse.ArgumentParser()
ap.add_argument("-t", "--template", required=True, help="Ruta a la imagen de la plantilla")
ap.add_argument("-i", "--imagenes", required=True,
help=... | true |