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 |
|---|---|---|---|---|---|---|---|---|---|---|
44374002a78e1bf97c019a97eca51b47060602c2 | HENRDS/Gomoku | /jorge.py | UTF-8 | 1,635 | 3.46875 | 3 | [] | no_license | from board import BoardState
from typing import Tuple, Optional
# Temos muitos Jorges aqui (https://youtu.be/FpSKUc6wcAY?t=135)
class Jorge:
def __init__(self, number: int, jorge_count=2):
self.number = number
self.jorge_count = jorge_count
def minimax(self,
state: BoardState,... | true |
6d842adc0d9b52c969166e01ec72d5047fd26ad7 | kporcelainluv/1_month_commit | /6_day/6_2.py | UTF-8 | 468 | 3.265625 | 3 | [] | no_license | with open("dataset_3363_2.txt") as fp:
text = fp.read().strip()
string = ""
count = 0
return_string = ""
for i in range(len(text)):
if text[i].isalpha() and i>0:
char, number = string[0], string[1:]
return_string += char * int(number)
string = text[i]
else:
string += text[i]
... | true |
8df9c8ef4765879c8cb910d5a299a2c0a395fa9f | maiyeu97/nguyenduyhoang-fundermental-c4e14 | /fundamental/session02/maze.py | UTF-8 | 142 | 2.875 | 3 | [] | no_license | from turtle import*
speed(-1)
screensize(10000, 10000)
width(4)
color("pink")
for i in range(100):
forward(i *4)
left(90)
mainloop()
| true |
45de46815991a5bc9b6c99277105f27c8de90669 | SlickAssassin03/Discord-Bot | /util/console.py | UTF-8 | 921 | 3.09375 | 3 | [] | no_license | # ========== Info ===========
"""
Made by Haven Selph - <havenselph@gmail.com>
Class make is specifically there to allow you to reference easy to use unicode. Use {self}.make.{form} to ref the class.
Out is made so console prints look well formatted and more readable.
"""
# ========= Imports =========
from datetime imp... | true |
89bbc0f02869f6934e5cf87cacf4420f4a7a62ff | VedangJoshi/benchmark_harness | /executor/LinuxPerf.py | UTF-8 | 5,009 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Linux Tools' Perf wrapper for Execute
Usage:
out, err = LinuxPerf(, outp=Plugin).run(['myapp', '-flag', 'etc'])
Plugin: parses the output of a specific benchmark, returns a dictionary
stderr is parsed by Perf's own local parser. If benchmark also
... | true |
7e319a6e29066279a92150b58bdbaec170dc6001 | daniel-reich/turbo-robot | /XoBSfW4j6PNKerpBa_11.py | UTF-8 | 923 | 4.21875 | 4 | [] | no_license | """
Create a function that decomposes an integer into its prime factors, ordered
from smallest to largest.
For instance:
complete_factorization(24) = [2, 2, 2, 3]
# Since 24 = 8 x 3 = 2^3 x 3 = 2 x 2 x 2 x 3
### Examples
complete_factorization(10) ➞ [2, 5]
complete_factorization(9) ➞ [3, 3]
... | true |
a617424c167573f2cbb88bfed788a97b35566570 | johnbeard/libree | /libree/templatetags/tools/resistor_codes.py | UTF-8 | 2,796 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
register = template.Library()
def text_or_dash(t, form=u"%s"):
return form % t if (t != None) else u'‒'
_colours = { 'black' : {'hex':'#000000', 'sf':0, 'mult':0, 'tol':None, 'tc':250, 'invert':True},
'brown' : {'hex'... | true |
bcdbc7e4f0358714132cfd09c71e7c1417606432 | lennartsteinhoff/belief-net | /train_mdn.py | UTF-8 | 309 | 2.6875 | 3 | [] | no_license | import csv
import numpy as np
from mixture_density_net import MixtureDensityNet
reader = csv.reader(open('test-distribution.csv', 'r'))
data = list(reader)
data = np.array(data, dtype=float)
x = data[1:100, 0:2]
t = data[1:100, 2]
net = MixtureDensityNet(2, 4)
net.train(x, t)
print(net.W2)
print(net.W1) | true |
8e29e6ce1d96d8587872f8b5be367bea987a9007 | SaifurShatil/pssp_lstm | /lm_pretrain/model_helper.py | UTF-8 | 5,258 | 2.6875 | 3 | [
"MIT"
] | permissive | import tensorflow as tf
from tensorflow.python import debug as tf_debug
from tensorflow.contrib.rnn import LSTMBlockCell, GRUBlockCell, MultiRNNCell
from custom_rnn.stlstm import STLSTMCell
from collections import namedtuple
from .dataset import create_dataset
ModelTuple = namedtuple('ModelTuple', ['graph', 'iterator'... | true |
0f4b7f8ae1e948dca879d530cd08776dc1797e71 | laserson/numba | /oldnumba/tests/test_forloop.py | UTF-8 | 5,694 | 2.78125 | 3 | [
"BSD-2-Clause"
] | permissive | #! /usr/bin/env python
# ______________________________________________________________________
'''test_forloop
Test the Numba compiler on a simple for loop over an iterable object.
'''
# ______________________________________________________________________
from numba import *
from numba.testing import test_support
... | true |
a1cd8861e012e6ec476a22dde1dd024146fec5b3 | vineel-raj-varma/Factorial-Using-Recursion | /Factorial.py | UTF-8 | 218 | 3.734375 | 4 | [] | no_license | def fact(num):
if num == 0:
return print(1)
else:
result = num
for i in range(1,num):
result = result * (num-i)
return print(int(result))
fact(5)
# If input is 5
# Output will be 120
| true |
f83be2a2171f1938a6b3ee52c9bd26f6ba2189f0 | Alexidis/algorithms_basics_py | /main/lesson9/task1.py | UTF-8 | 1,174 | 4.25 | 4 | [] | no_license | # 1. Определение количества различных подстрок с использованием хеш-функции.
# Пусть на вход функции дана строка. Требуется вернуть количество различных подстрок в этой строке.
# Примечания:
# * в сумму не включаем пустую строку и строку целиком;
# * без использования функций для вычисления хэша (hash(), sha1() или люб... | true |
dbce42e7079648d9281c22ffcd43d431ec83600e | JackLee1/tianchi_SVHN | /deeplearning_cat/SVHN/paixu.py | UTF-8 | 4,085 | 2.6875 | 3 | [] | no_license | # -*- coding:utf-8 -*-
# 对yolo3检测结果按边框位置排序
import numpy as np
import os
img_path='D:/data/SVHN/test/yolo3/paixu'
# img_list=os.listdir(img_path)
# img_list.sort()
# img_list.sort(key = lambda x: int(x[:-6])) ##文件名按数字排序
class ImageRename():
def __init__(self):
self.path = 'D:/data/SVHN/test/yolo3/paixu'... | true |
a6c6c89ba3d653d6719a78d223fcfcb8a6be9062 | kostrzmar/SATEF | /satef/dataset/AbstractDataset.py | UTF-8 | 1,019 | 2.53125 | 3 | [
"MIT"
] | permissive | from abc import ABC, abstractmethod
from tools import ConfigUtils
import os
class AbstractDataset(ABC):
""" Abstract document class """
def __init__(self, config_utils : ConfigUtils):
self.dataset_name = "N/A"
self.local_config_utils = config_utils
self.input_folder = self.getInputFile... | true |
d1fb80730a516d51a6261f13c0ab193549939190 | nizox/dypl1 | /TurtleRuntime.py | UTF-8 | 2,704 | 3.375 | 3 | [] | no_license | from math import pi, sin, cos, radians
from operator import add
class Vector(tuple):
def __new__(cls, *args):
return tuple.__new__(cls, args)
def __add__(self, right):
return Vector(*map(add, self, right))
def __mul__(self, other):
if isinstance(other, int):
return Ve... | true |
5aac8f448ddade8b35edf99e07ef23262c9ba765 | busisd/WikiBlurb | /WikiBlurb.py | UTF-8 | 957 | 3.171875 | 3 | [] | no_license | import requests
import re
from bs4 import BeautifulSoup
url_choice = ''
while url_choice != 'quitnow':
url_choice = input('\n\nWhat do you want to learn about today? ')
url_choice = url_choice.strip()
url_choice.replace(' ', '_')
print()
#url_choice = 'Donald_Harris_(composer)'
... | true |
87e665053c67616ce2de9420b626716494345918 | LitHaxor/Programming-revisited | /Python/Basics/1.List/1.2 adding-item-list.py | UTF-8 | 241 | 3.84375 | 4 | [] | no_license | # adding element in the list
languages = []
languages.append('C++')
languages.append('Java')
languages.append('Python')
languages.append('C#')
print(languages)
## Inserting after ino index
languages.insert(0, 'HTML')
print(languages) | true |
9da72b4346338fdc2cb2c27780a99f5cee552c09 | Tinypadfoot/Python-Web-App | /PythonWebApp/Python/tuples.py | UTF-8 | 255 | 4.09375 | 4 | [] | no_license | #Booleans
#True
#False
#Tuples
# mylist = [1,2,3]
# print(mylist[0])
#
# mylist = ['a',True,123]
# print(mylist)
#
# mylist[0] = 'new'
# print(mylist)
#Sets
#only takes in unique elements
x = set()
x.add(1)
x.add(2)
x.add(4)
x.add(4)
x.add(4)
print(x)
| true |
14a508936d633f0f8012b5b460f010cd654b9e71 | suryagokul/NLP | /$tokenize.py | UTF-8 | 884 | 2.90625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 24 18:15:01 2020
@author: SURYA
"""
import nltk
nltk.download()
paragraph = """Rohit Gurunath Sharma is an Indian cricket player.
Rohit is also the captain of IPL team Mumbai Indians.
Sharma currently holds the record for h... | true |
1a70d7ab34a8ac6cafc4016bce183613dbe6da4e | sarkarChanchal105/Coding | /Leetcode/python/Easy/valid-palindrome-ii.py | UTF-8 | 1,251 | 4.125 | 4 | [] | no_license | """
https://leetcode.com/problems/valid-palindrome-ii/
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.
Example 1:
Input: "aba"
Output: True
Example 2:
Input: "abca"
Output: True
Explanation: You could delete the character 'c'.
Note:
The string will only c... | true |
5d55944313e42d6747710e4c1ac9fd433db90dea | Aasthaengg/IBMdataset | /Python_codes/p02911/s005308649.py | UTF-8 | 220 | 2.734375 | 3 | [] | no_license | from collections import defaultdict
N, K, Q = map(int,input().split())
d = defaultdict(int)
for _ in range(Q):
a = int(input())
d[a]+=1
for i in range(1,N+1):
if K-Q+d[i]>0:
print('Yes')
else:
print('No') | true |
93fdaf0afdee4e42210ab4e884675f37272a6ef9 | lzhou1110/DistributedAI | /ipfs(python)/FileMangeSystem/get.py | UTF-8 | 2,754 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | import rsa
import sys,os
import ipfsapi
from Crypto.Cipher import AES
import rsa.randnum
class PrpCrypt(object):
def __init__(self, key):
self.key = key
self.mode = AES.MODE_CBC
def decrypt(self, text):
cryptor = AES.new(self.key, self.mode, b'0000000000000000')
plain_text =... | true |
71ec2c763b8d1972978fac995734d4f6ac9166f4 | AmeliaChady/SeniorProject | /textbook61_2/textbook61_2_BruteForce.py | UTF-8 | 997 | 3.375 | 3 | [] | no_license | from textbook61_2 import *
from itertools import combinations
'''
Returns true if there is no overlap between intervals
'''
def is_possible(intervals):
for x in range(len(intervals)-1):
interval_x = intervals[x]
for y in range(x+1, len(intervals)):
interval_y = intervals[y]
... | true |
c0eb208a658ac1a2e8b8ef621eaa16ff248b8e03 | coursewarefactory/CRM_BOT | /logistic.py | UTF-8 | 11,786 | 3.21875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
#! /usr/bin/env python
import sqlite3
import datetime
import random
import config
import g_utilities
def accepted(user_id, name_of_receiver, city_of_receiver):
'''Функция заполняет 7 строк таблицы:
трек_номер(Id) | город отправителя | дата и время отправления | имя получателя | горо... | true |
2a54e40900d183f731c72cc5d0608c0b463e850e | BackupTheBerlios/enonotes-svn | /trunk/enoNotes.py | UTF-8 | 1,979 | 2.53125 | 3 | [] | no_license | #!/usr/bin/python
import wx,os
from notebook import *
from notes import *
IDM_NOTE = wx.NewId()
IDM_CONFIG = wx.NewId()
IDM_EXIT = wx.NewId()
class SysIcon(wx.TaskBarIcon):
def __init__(self,app):
wx.TaskBarIcon.__init__(self)
self.app = app
self.SetIcon(self.app.appIcon,"enoNotes")
... | true |
b40ec9aa04a9bd0143ba85dd1b3907f6fffccfe1 | setu4993/Simple_RNN_Python | /rnn/__init__.py | UTF-8 | 3,299 | 2.71875 | 3 | [] | no_license | from .file_io import *
from .network import rnn_base, rnn_train, rnn_predict
"""
Descriptions for most recurring variables across functions.
Input parameters:
-----------------
- inputs: List of `[day, temp, prec]` lists containing the real-world values of the input variables. Ranges
(except d... | true |
7b23284c09665f31880094d13a1e1ef9f39ac237 | yannJu/ComputerNetwork | /NetworkProject/Receiver.py | UTF-8 | 5,667 | 2.515625 | 3 | [] | no_license | import Application as app
import StopAndWait as sw
import bitStuff_Unstuff as stuff
import CSMACD as csma
import MLT3 as mlt
import socket, time
from threading import Thread, Event
from queue import Queue
curAck = 0
t = 2
#---------Condition Variable---------
appFlag = [0, 0]
tranFlag = [0, 0]
nwkFlag = [0, 0]
dlFlag ... | true |
f89fefe5a55295ba6b9bb68850eef0b23a65ec8d | lynnvmara/CIS106-Lynn-Marasigan | /Session 8/Assignment 2.py | UTF-8 | 90 | 3.109375 | 3 | [] | no_license | for cycle in range(1, 5 + 1, 1):
for count in range(1, 10 + 1, 1):
print(str(count)) | true |
8dbbc5b6d22a64650ef64f2a6011762cfbad9e12 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_118/2418.py | UTF-8 | 815 | 3.5625 | 4 | [] | no_license | import math
def decompo(n): # The number will be spelled backwards, but doesn't matter for a palidrome-checking
l = []
while n != 0:
l.append(n % 10)
n /= 10
return l
def is_palindrome(n):
l = decompo(n)
return l == list(reversed(l))
def is_perfect_square(n):
return math.sqrt(... | true |
d452db918677b7cdd4a3b8d0f84b7853ddaa93c1 | aravindsriraj/machine-learning-python-datacamp | /Machine Learning Scientist with Python Track/13. Feature Engineering for NLP in Python/ch3_exercises.py | UTF-8 | 4,992 | 3.65625 | 4 | [
"MIT"
] | permissive | # Exercise_1
# Import CountVectorizer
from sklearn.feature_extraction.text import CountVectorizer
# Create CountVectorizer object
countVec = CountVectorizer()
# Generate matrix of word vectors
bow_matrix = countVec.fit_transform(corpus)
# Print the shape of bow_matrix
print(bow_matrix.shape)
--------... | true |
393ef4108aeac011625d97688a333c76d0c15849 | Aasthaengg/IBMdataset | /Python_codes/p02847/s044143119.py | UTF-8 | 119 | 2.796875 | 3 | [] | no_license | D = dict()
D['SUN'] = 7
D['MON'] = 6
D['TUE'] = 5
D['WED'] = 4
D['THU'] = 3
D['FRI'] = 2
D['SAT'] = 1
print(D[input()]) | true |
bb460d231e4cae6cde776e2d4f380d1734abb56a | renju-zacharia/WebScraping | /scrape_mars.py | UTF-8 | 2,689 | 2.796875 | 3 | [] | no_license | from splinter import Browser
from bs4 import BeautifulSoup as bs
import time
import pandas as pd
import requests
def init_browser():
# @NOTE: Replace the path with your actual path to the chromedriver
executable_path = {"executable_path": "chromedriver"}
return Browser("chrome", **executable_path, headles... | true |
3f7ed413ac093555e281554a38236361d257c85a | KlimDos/GrowMonitor | /TnH/trash/tnh_test.py | UTF-8 | 92 | 3.265625 | 3 | [] | no_license |
x = int (input('x='))
hum = 0
if x == 1:
hum = 200
print (hum)
print ("hum2",hum) | true |
73346eab1089fb274e357fa8a88fb60ca8190658 | jaydenwindle/python-graphql-benchmarks | /servers/django-strawberry/app/schema.py | UTF-8 | 506 | 3 | 3 | [] | no_license | import strawberry
from typing import List
@strawberry.type
class TestObject:
string: str
@strawberry.type
class Query:
@strawberry.field
def string(self, info) -> str:
return "Hello World!"
@strawberry.field
def list_of_strings(self, info) -> List[str]:
return ["Hello World!"] ... | true |
d448bfd64b71d34cfbd65e1ffbc2d5cbafbb177d | kussl/mdg | /cloud/randomizer.py | UTF-8 | 3,622 | 3.296875 | 3 | [] | no_license |
'''
This is a graph randomizer which switches edges and resets nodes on the two ends of the switched edge.
'''
from time import sleep
from threading import Lock
from mdg import GraphUtil,GraphGen
import random
class Randomizer:
def __init__(self):
self.gu = GraphUtil()
self.gg = GraphGen()
... | true |
bda48f42136169b033ba0b99e225a3b26ebe7d93 | kimsoosoo0928/BITCAMP_AI_STUDY | /keras/keras46_4_load_weight-git.py | UTF-8 | 2,560 | 2.875 | 3 | [] | no_license | import numpy as np
# import pandas as pd
from sklearn.datasets import load_diabetes
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import Dense
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_squared_error
from sklearn.preprocessin... | true |
6fe6d09833517c6d5826a462b26a6142ab815005 | sergeyrudov/py1h | /nn.py | UTF-8 | 443 | 3.484375 | 3 | [] | no_license | from random import randint
def randomsharik():
while True:
a = ['слева','справа','сверху','снизу']
b = randint(0, 3)
print ('Шарик прилетел {}'.format(a[b]))
d= ['влево', 'вправо', 'вверх', 'вниз']
c = input()
e = d.index(c)
if b == e:
print('ОШибка! Игра окончена!')
break
else:
print('Шарик ... | true |
02c82eb12e98dabdb8c57f66f5bcec6576957049 | krishauser/Klampt-examples | /Python2/testing/manyworldtest.py | UTF-8 | 1,001 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/python
import sys
import time
from klampt import *
if __name__ == "__main__":
print "manyworldtest.py: This example demonstrates loading of many worlds"
if len(sys.argv)<=1:
print "USAGE: manyworldtest.py world_file N"
exit()
N = int(sys.argv[2])
w0 = WorldModel()
w0.... | true |
a0ea18dc3a1ced01e0231fe46bb0e610d46e28c9 | lord-pradhan/SnowBot | /final_build_simulation/IMUArduino.py | UTF-8 | 3,662 | 2.671875 | 3 | [
"MIT"
] | permissive | import serial
import math
from usefulFuncs import *
import numpy as np
import time
###
class IMUArduino:
def __init__(self):
self.ser = serial.Serial(port='/dev/ttyACM0', baudrate = 115200)
self.bias =[-19.575, 16.65]
self.scale = [0.963556851, 1.039308176]
# N, W, S_H, S_L, E
... | true |
d5e3f518379eab3bf43722f5d28e06321dca65f2 | Maxibunny/TEAM-WORK | /Min_Max_.py | UTF-8 | 300 | 4.03125 | 4 | [] | no_license | print('Введи 2 числа')
x = int(input('x = '))
y = int(input('y = '))
if x == y:
print('Нет Min и Max >>>', x,'=',y)
else:
if x > y:
Max = x
Min = y
else:
Max = y
Min = x
print('Max -->', Max)
print('Min -->', Min)
| true |
f5bcac042f87aca1bfed0818c27d654565dc6eb2 | phondanai/audio-classification | /load_data.py | UTF-8 | 1,847 | 3.1875 | 3 | [] | no_license | import numpy as np
import h5py
def is_zero_value_inside(data):
"""Check numpy array data if contains zero value, will return True.
:param data: numpy array data
"""
results = False
for i in data:
zero_count = np.count_nonzero(i == 0)
if zero_count > 0:
results = ... | true |
1b7465dfd9e8b440a6f4cc50961f1c3a39b56753 | bcottman/photon | /photonai/examples/optimizer/smac_example.py | UTF-8 | 1,754 | 2.578125 | 3 | [] | no_license | from sklearn.datasets import load_boston
from sklearn.model_selection import KFold, ShuffleSplit
from photonai.base import Hyperpipe, PipelineElement, OutputSettings, Switch
from photonai.optimization import FloatRange, Categorical, IntegerRange
# WE USE THE BOSTON HOUSING DATA FROM SKLEARN
X, y = load_boston(True)
... | true |
2dabd9e56aaf110e764ce06506867bae06a10791 | i5545/AolaiDemo | /base/base_action.py | UTF-8 | 922 | 2.953125 | 3 | [] | no_license | from selenium.webdriver.support.wait import WebDriverWait
class BaseAction:
def __init__(self,dirver):
self.driver = dirver
# 查找单个元素方法
def find_element(self,feature,timeout = 5,poll = 1):
feature_by, feature_value = feature
return WebDriverWait(self.driver,timeout,poll).until(lam... | true |
eab4f996711e25d2b7a565c70332ea604f1e07d6 | sepehrfard/More_Attention_BIDAF | /model/model_layers.py | UTF-8 | 6,908 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | """
Model Layers:
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from util import masked_softmax
# Embedding layer:
# word vectors are embedded using GloVe embeddings
# projected using linear transoform and passed on t... | true |
dc779a232c363e7d9d710f6b6dc1142f3de6be5e | YMerrick/SkillShareCourseB2A | /MachineLearning/commands.py | UTF-8 | 1,000 | 2.890625 | 3 | [] | no_license | import subprocess
import os
from getAnswer import Fetcher
class Commander:
def __init__(self):
self.confirm = ["yes","affirmative","sure","do it","yeah","confirm"]
self.cancel = ["no","negative","don't","wait","cancel"]
def discover(self, text):
if "what" in text and "name" in text:
... | true |
d039c1850adf95378715cc9d6a6d5594f16b1cfd | GoodnessEzeokafor/computation_with_python | /recursion.py | UTF-8 | 575 | 3.84375 | 4 | [] | no_license | def fib(n):
""" assumes n an it >= 0"""
if n == 0 or n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
def testFib(n):
for i in range(n + 1):
print('fib of',i, '=', fib(i))
'''
def factI(n):
"""
Assumes that n is an int > 0
return n!
"""
res = 1
whil... | true |
5d285cf1ec3de7dbfff4b44f9a72ef848bb4036a | diisnc/Dialog_Agent_1819 | /projeto_v2/Engine/auxiliary.py | UTF-8 | 3,133 | 2.8125 | 3 | [] | no_license | import random
import json
import re
from datetime import datetime
# PyKnow Rules Engine
from pyknow import *
from pprint import pprint
# nltk package
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.tokenize.treebank import TreebankWordDetokenizer
# Collector Module
from collector import *
# Generator M... | true |
450ee28e548fb1987f0af8230c57f8ffcc721287 | ViggoC/MOT | /MOT_utils.py | UTF-8 | 1,981 | 2.625 | 3 | [] | no_license | import pygame as pg
from MOT_constants import *
from MOTobj import MOTobj
# Generate random x and y coordinates within the window boundary
boundary_location = ['up', 'down', 'left', 'right']
boundary_coord = [obj_radius, (win_height - obj_radius + 1), obj_radius, (win_width - obj_radius + 1)]
boundary = dict(zip(bo... | true |
fbdf22378f7b0c92be3add61a5116bd0285d3edc | eastein/ramirez | /hotwater/Mail.py | UTF-8 | 1,515 | 2.609375 | 3 | [] | no_license | import smtplib
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
class MailTransport:
""" a mechanism which will accept an E-mail message and deliver it to an MTA """
def __init__(self, mailHost, user, password):
self.MTA = smtplib.SMTP(mailHost)
self.MTA.set_de... | true |
45438062d68b0e7fb1ea7442bdd3103e61f18b96 | Ohohcakester/Charting | /testcases/shuffle.py | UTF-8 | 182 | 3.046875 | 3 | [] | no_license |
li = []
s = input()
while s != None:
li.append(s)
try:
s = input()
except:
s = None
import random
random.shuffle(li)
for s in li[0:10]:
print(s) | true |
7bdadbf241a017d1a55567c83b6b69168b6fe01d | cjoshmartin/car-detection | /neuron/neuron.py | UTF-8 | 3,550 | 2.796875 | 3 | [
"MIT"
] | permissive | # layers
import numpy
from numpy import uint16
from numpy.core.multiarray import zeros, arange
import matplotlib.pyplot as plt
from neuron.convolution import conv
from utils.general import dimensions
from utils.parse_images import save_image
from utils.ploting import graphs, save_plot
def max_pooling(feature_map, si... | true |
bf1c44b2bdee057bdf947e3e683491f2f2c7f409 | nakmuaycoder/trt_pose_tools | /trt_pose_tools/tracking/__init__.py | UTF-8 | 6,291 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | """
Tracking package:
Mother class of all the tracker
"""
import torch
import cv2
import numpy as np
import os
class _Tracker(object):
""""""
def __init__(self):
pass
def getProbTable(self):
"""
Return the prob table
:return:
"""
if hasattr(self, "_prob"):... | true |
ac9d24da6f1fbd001b1a49cc27f97f9585caf448 | hanzohasashi33/Competetive_programming | /Geeks4Geeks/Stacks/Maximum_Rectangle.py | UTF-8 | 840 | 3.46875 | 3 | [
"MIT"
] | permissive | def largestRectangleArea(self, heights):
stack = [-1]
maxArea = 0
for i in xrange(len(heights)):
# we are saving indexes in stack that is why we comparing last element in stack
# with current height to check if last element in stack not bigger then
# current element
... | true |
b1889814a549538e7a93560871d90faf4bb16176 | ubctokuriki/MetaSSN | /Python_script_tools/extract_one_to_many_mapping.py | UTF-8 | 2,591 | 3.15625 | 3 | [
"MIT"
] | permissive | #!python3
import helper
import argparse
import os
def convert(infile, mapping, sep, id_col, val_col, conv_only, outfile):
ids = {}
with open(infile, 'r') as f:
for line in f:
id = line.strip()
ids[id] = True
with open(mapping, 'r') as f:
w... | true |
a2ecaee4fcc20bc1a917d5fbedcad9151e4df6aa | nicholasRutherford/nBodySimulator | /examples/earthMoon.py | UTF-8 | 780 | 2.796875 | 3 | [
"MIT"
] | permissive | from nBody.src.body import Body
from nBody.src.nBodySimulator import NBodySimulator
accuarcy = 0.01
time_step = 1
frame_step = 60*60
length = 20
plot_size = 400000000 # size of the background for the animation (in meters)
file_name = 'earth_moon.mp4'
moon = Body(384400000, # x-position (distance from the earth)
... | true |
0a7c10916d304e05fc1e7ca62a199d6d6bf42d2d | DJSull93/keras_new | /01_keras/keras60_01_flow_데이터_증폭.py | UTF-8 | 2,416 | 3.21875 | 3 | [] | no_license | # flow one image to 100
from tensorflow.keras.datasets import fashion_mnist
import numpy as np
from tensorflow.python.keras.backend import zeros
(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()
from tensorflow.keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(
... | true |
af20214f15ee32144d12283ec67d5eb79382ed2f | painperdu-io/painperdu-connected-object | /raspberry-app/app.py | UTF-8 | 2,873 | 2.859375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import re
import serial
import sys
import time
import uuid
import accelerometer as ACCELEROMETER
import button as BUTTON
import led as LED
import potentiometer as POTENTIOMETER
import rfid as RFID
import sound as SOUND
from socketIO_client import SocketIO
this = sys.mod... | true |
b5fdece009097eb554f8e12d936d58f837946790 | adamstimb/nimbusinator | /test.py | UTF-8 | 8,554 | 2.9375 | 3 | [
"MIT"
] | permissive | import random
from nimbusinator.nimbus import Nimbus
from nimbusinator.command import Command
def test_slice(nim, cmd):
for mode in [40, 80]:
cmd.set_mode(mode)
if mode == 80:
x_max = 650
colour_max = 3
else:
x_max = 320
colour_max = 15
... | true |
a6f2d8c66ba6e9904a5fa8409389d7403d192c1f | choyunseol/nyunnyu | /E-oN 4th hw.py | UTF-8 | 254 | 3.703125 | 4 | [] | no_license | a = input("숫자를 입력하세요 (쉼표로 구분) :")
a = a.split(",")
a = list(map(int, a))
b = len(a)
for i in range(0,b-1):
for j in range(i+1, b):
if a[i] > a[j] :
x = a[i]
a[i] = a[j]
a[j] = x
print(a)
#bubble sort
| true |
f5f260a2ce2c8715a5a4ac98726d6bc325a5727d | singhrahuldps/covid19tracker | /run.py | UTF-8 | 3,439 | 2.796875 | 3 | [] | no_license | import DataHandler
import Algorithms
import ChartHandler
import argparse
import io
NO_ARGUMENT = "__none__"
def createAlgoSelect():
userClasses = dict([(name, cls) for name, cls in Algorithms.__dict__.items()
if name in Algorithms.usernames])
script = "window.addEventListener('DOMConte... | true |
b3495eea436d634f22bb73e1503c2523b8493358 | miseop25/Back_Jun_Code_Study | /back_joon/구현/back_joon_2136_개미/back_joon_2136_ver3.py | UTF-8 | 265 | 2.671875 | 3 | [] | no_license | import sys
input = sys.stdin.readline
if __name__ == "__main__":
N, L = map(int, (input().split(" ")))
ant = []
for i in range(1, N+1) :
buf = int(input())
ant.append([buf, i])
ant = sorted(ant, key= lambda x: abs(x[0]))
| true |
fb2566dbb958a3f7e7658da56e37e0a043076e95 | PietPtr/bin | /get-storage | UTF-8 | 505 | 2.609375 | 3 | [] | no_license | #!/usr/bin/python2.7
from __future__ import division
import time
import os
rawCommand = os.popen("df | grep '/dev/sda1'").read().split(' ')
sizeIndex = 0
usedIndex = 0
for i in range(1, len(rawCommand)):
if (rawCommand[i] != ""):
if sizeIndex == 0:
sizeIndex = i
elif sizeIndex != 0:
... | true |
36e569045fa79e1548a186d0ffd119678cee3b96 | wmalgoire/learning.python | /02.courses/01.pluralsight-python-fundamentals/01.hellopython/import.py | UTF-8 | 223 | 2.8125 | 3 | [] | no_license | ''' Demo of different syntax to import standard library module/function '''
# 1: import module
# 2: from module import function
# 3: from module import function as alias
from math import sqrt as sqroot
print(sqroot(81))
| true |
e76af7b9dc2878cc0452f1fb33c61181e33f6b34 | danielwelch/nflgame | /nflgame/tests/test_game.py | UTF-8 | 399 | 2.734375 | 3 | [
"Unlicense"
] | permissive | import unittest
import nflgame
class TestGame(unittest.TestCase):
def test_games(self):
expected = ["L.McCoy", "T.Pryor", "S.Vereen", "A.Peterson", "R.Bush"]
games = nflgame.games(2013, week=1)
players = nflgame.combine_game_stats(games)
for i, p in enumerate(players.rushing().so... | true |
c4af7025cd2b50622921af75f06f031cce361b4f | yxqd/luban | /core/tests/luban/ui/elements/ElementContainer.py | UTF-8 | 2,831 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2006-2011 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | true |
4476a884db2126a221801df85e3b723786582aa8 | tut-tuuut/advent-of-code-shiny-giggle | /2019/06.py | UTF-8 | 1,568 | 3.375 | 3 | [
"MIT"
] | permissive | class SpaceObject:
space = {} # spaaaace
def __init__(self, name):
self.name = name
self.space[name] = self
self.parent = None
def setParent(self, parent):
self.parent = parent
def orbitCount(self):
if self.parent == None:
return 0
else:
... | true |
e4cc46a7b8e8b95404b8526957f506743856b39c | caijinhai/crawl-demo | /sample/test-requests.py | UTF-8 | 1,068 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python
# coding=utf-8
import requests
res = requests.get('https://httpbin.org/get')
print(res.text)
params= {
'name': 'cesar',
'age': 15
}
res = requests.get('https://httpbin.org/get', params)
print(res.text)
print(type(res.text))
print(res.json())
print(type(res.json()))
headers = {
'User... | true |
f040e1607f8c90e562a770c7a30900e31d68fdc1 | GitHub-star-arch/uploadFolder | /uploadFolder.py | UTF-8 | 1,039 | 2.953125 | 3 | [] | no_license | import dropbox
import os
class TransferData:
def __init__(self, access_token):
self.access_token = access_token
def upload_file(self, file_from, file_to):
"""upload a file to Dropbox using API v2
"""
dbx = dropbox.Dropbox(self.access_token)
for root, dir, fil... | true |
d153526dd875dfbe136f4f25963b09ee193c6d09 | dr-dos-ok/Code_Jam_Webscraper | /solutions_python/Problem_199/1791.py | UTF-8 | 728 | 2.703125 | 3 | [] | no_license | import sys
sys.stdin = open('A.in')
t = int(raw_input())
for i in xrange(t):
s, k = raw_input().split()
s = list(s)
#print s
k = int(k)
ans = 0
flag = True
for j in xrange(len(s)):
if s[j] == '-':
if len(s) - j < k:
flag = False
break
... | true |
5214a5ff21fc54b96cc0378e25e90cabd509508b | zjuchenyuan/EasyLogin | /examples/jww/run.py | UTF-8 | 2,847 | 2.78125 | 3 | [
"MIT"
] | permissive | # coding:utf-8
from EasyLogin import EasyLogin
import sys
from pprint import pprint
HOST="https://jw.zjuqsc.com"
a = EasyLogin()
def jww_islogin():
global a
p = a.get(HOST+'/xsdhqt.aspx?dl=iconjskb',result=False,o=True)
if p and len(p.headers['Location'])>7:
return True
else:return... | true |
b7c610d93c46d5e25b99660713d8641111dee672 | roxas010394/PatternRecognitionProject | /Carlos/ImagenFacial.py | UTF-8 | 8,710 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: cp1252 -*-
from math import pow, cos, sin, pi
from PIL import Image, ImageOps
import matplotlib.pyplot as plt
import numpy as np
import Tkinter
import tkMessageBox
class ImagenFacial:
def __init__(self, nombreArchivo, K, nombreIndividuo):
#Donde self es una referencia a el mi... | true |
878f99e7554f2ac57b9570889477ffc6f50e5988 | napulen/encoding_matters | /cmp_diffs.py | UTF-8 | 759 | 3.03125 | 3 | [] | no_license | import sys
def read(filename):
with open(filename) as f:
lines = f.readlines()
lines = [l[:-1] for l in lines
if l[:2] not in ['@@', '++', '--', '\n']]
return lines
def parseIndex(index):
diff = 1 if index[0] not in ['+', '-'] else 0
indstr = index[1:]
m, o = indstr.spli... | true |
0ca2b81b8b370aec438dc31e14697025a849863d | IntAnalytic/cloud-monitoring | /py_src/LTCuniccp.py | UTF-8 | 2,268 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | import matplotlib.pyplot as plt
import pandas as pd
def sendfunc(rows3):
#Extract schemas from the list
ext_schemas = [i[0] for i in rows3]
#Extract values from the list
ext_values = [i[1] for i in rows3]
#Convert the values into int
int_values = [int(j) for j in ext_values]
... | true |
17bf1673db9dd1fed2fe45d3cd5ce859aa9a5682 | aksarkar/frea-work | /wtccc/gcta/matched-sets.py | UTF-8 | 1,081 | 2.859375 | 3 | [] | no_license | import collections
import gzip
import itertools
import random
import sys
def build_bins(snps, table):
overlap_bins = collections.defaultdict(list)
nonoverlap_bins = collections.defaultdict(list)
for rsid, *key in table:
k = tuple(key)
if rsid in snps:
overlap_bins[k].append(rsid... | true |
24d250e37d193b32ca6ec220d04270e0184dac45 | S-Yajima/UI_App_iOS_Python | /4_digital_ideology/main.py | UTF-8 | 22,239 | 3.03125 | 3 | [] | no_license | import ui
import threading
from math import cos
from math import sin
from math import radians
from math import isclose
from glyph import *
from figure import *
from dotmap import *
# Glyph Point Type
class TYPE():
LINE = 'line'
CURVE = 'curve'
CONTROL = 'control'
# 文字
class Character(... | true |
11ec6fdef0a40e7231fc57fef60a5d22a0dbcf63 | kaungkyawkhant/pythonAlgorigthmlab | /kkStringEncryptor.py | UTF-8 | 384 | 3.296875 | 3 | [] | no_license | def getConvertedString(letter, key):
newLetter = ord(letter) + key
return chr(newLetter) if newLetter <= 122 else chr(96 + newLetter % 122)
def caesarEncryptor(string, key):
resultString = []
newKey = key % 26
for char in string:
resultString.append(getConvertedString(char, newKey))
re... | true |
c29ea569b86b7644f9458cf341e1ccdbf788324f | sc-huipu-pc/scikit-learn | /Kmeans.py | UTF-8 | 2,487 | 2.984375 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
# from sklearn.datasets.samples_generator import make_blobs
from sklearn.datasets import make_blobs
from sklearn import cluster
from sklearn.metrics import adjusted_rand_score
from sklearn import mixture
#creat_data返回一个元组,第一个元素为样本点,第二个元素为样本点的真实簇分类标记,该函数产生的是分割的高斯分布的簇聚类... | true |
0684d3a9c1dee6d359b89f07bd9b1873a737ccf1 | mhardcastle/lofar-tools | /utils/tofits.py | UTF-8 | 440 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python
# Write CASA image to fits
import sys
import pyrap.images as pi
import os.path
args=len(sys.argv)
if (args==1):
print "usage: tofits.py [CASA images]";
sys.exit(1)
for fn in sys.argv[1:]:
print 'Doing',fn
outname=fn+'.fits'
if os.path.isfile(outname):
print '... skip, F... | true |
4d835dece258b176a8a2177baed460fa5fe3af91 | igijon/sge2021_python | /Ejercicios recuperación/examen_ghibli/main.py | UTF-8 | 6,370 | 3.859375 | 4 | [] | no_license | from Utilities import *
from Character import *
from Film import *
from Studio import *
from Vehicle import *
import json
def print_menu_principal():
print("********Studio Ghibli********")
print("1. Crear studio vacío")
print("2. Cargar studio de un fichero")
print("3. Salir")
opcion = leer_entero... | true |
001f73748e18f96fcb6c6d69ef5fff6eee15b2e9 | scalone/python-skeleton | /skeleton/blabla.py | UTF-8 | 429 | 2.828125 | 3 | [] | no_license | import logging
class Blabla(object):
def __init__(self, name, description):
self.name = name
self.description = description
self.paths = {}
def sum(self, a, b):
return a + b
def log(self):
logging.basicConfig(level=logging.NOTSET)
logging.info("Info - Blabl... | true |
8cc4111bf782fd12d38a60bc1160a85a99fed982 | ganggas95/side-service | /side_service/models/desa.py | UTF-8 | 1,092 | 2.609375 | 3 | [] | no_license | from sqlalchemy import Column
from sqlalchemy import String
from sqlalchemy.orm import relationship
from sqlalchemy import ForeignKey
from . import BaseModel, db
class Desa(db.Model, BaseModel):
__tablename__ = "tb_desa"
kode_desa = Column(String(40), unique=True,
autoincrement=False, ... | true |
bc7194d9480b0e8785ae4e0595e99805105ed208 | kinjalik/F-Stroke-Compiler | /AST.py | UTF-8 | 2,875 | 3.125 | 3 | [] | no_license | from enum import Enum
from typing import Any, List
from tokenizer import TokenList, Terminal
tokenList: TokenList
class AstNodeType(Enum):
Program = 0
List = 1
Element = 2
Atom = 3
Literal = 4
Identifier = 5
Integer = 6
class AstNode:
type: AstNodeType
value: Any
child_node... | true |
e6fd6456fdaab5b88960d18707066a65bc2edf4c | TopPano/AIResearch | /hello_caffe2.py | UTF-8 | 1,646 | 2.65625 | 3 | [] | no_license | import numpy as np
from caffe2.python import cnn, workspace
from caffe2.python import net_drawer
def gen_graph(net, output):
graph = net_drawer.GetPydotGraph(net, rankdir = 'LR')
graph.write_png(output)
# Create input data
data = np.random.rand(16, 100).astype(np.float32)
# Create Labels for the data as integ... | true |
bd7884eb4bbece33c03ce19146546b13cd859f32 | miokato/Obako | /obako_app/tools/parser.py | UTF-8 | 6,149 | 2.515625 | 3 | [] | no_license | import pandas as pd
import re
from _datetime import datetime
from random import randint
def time_zone():
hour = datetime.now().hour
if 6 <= hour <= 11:
return 'morning'
elif 11 < hour <= 13:
return 'lunch'
elif 13 < hour <= 23:
return 'evening'
elif 23 < hour <= 24:
... | true |
8cbc112bb1540a8127b3ecdc5bc0168df733fede | florimondmanca/fountain-lang | /tests/test_cli.py | UTF-8 | 12,897 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | import io
import sys
from typing import Any
import pytest
from fountain._cli import CLI
def test_cli_repl(monkeypatch: Any, capsys: Any) -> None:
mock_stdin = io.StringIO("print(1 + 2)")
monkeypatch.setattr(sys, "stdin", mock_stdin)
CLI().main([])
captured = capsys.readouterr()
assert captured.... | true |
d1d6bcd7d966c1c8a5b7e4e6a1d78ac613612696 | jmbarne3/pygame-rpg-sdk | /lib/Camera.py | UTF-8 | 1,097 | 2.96875 | 3 | [] | no_license | import os, sys
import pygame
from pygame.locals import *
from settings import *
class Camera(object):
"""
Camera class for screen control
"""
def __init__(self, pos, mapSize, movementSpeed=1):
if pos:
self.x = pos[0]
self.y = pos[1]
self.mapSize = mapSize
self.movementSpeed = movementSpeed
def... | true |
506c530e1a3093b71e17ec0f420da59c962ce91f | xqmmy/go-fresh | /other/PythonStart/zerorpc_test/server.py | UTF-8 | 382 | 2.53125 | 3 | [] | no_license | import zerorpc
class HelloRPC(object):
def hello(self, name):
#调用了另一个服务
#流处理
#本地查询了数据, 源源不断的给数据给客户端
return "Hello, %s" % name
#1. 实例化一个server
#2. 绑定我们的业务代码到server中
#3. 启动server
s = zerorpc.Server(HelloRPC())
s.bind("tcp://0.0.0.0:4242")
s.run() | true |
7cf63f6f3ea0ccf377abd5be3e1248517d14f68b | xiaonanln/myleetcode-python | /src/Spiral Matrix.py | UTF-8 | 1,546 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | class Solution:
# @param matrix, a list of lists of integers
# @return a list of integers
def spiralOrder(self, matrix):
if len(matrix) == 0: return []
if len(matrix[0]) == 0: return []
x, y = 0, 0
dirx, diry = 1, 0
minrow = 0
maxrow = len(ma... | true |
8242880a14694b7d868250eb87ae4b43bdc32d0f | robertknight/anchor-quote | /tools/fetch-annotations.py | UTF-8 | 824 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env python3
# Fetch all public annotations from Hypothesis on a given URL.
#
# Usage:
#
# pip3 install requests
# ./fetch-annotations.py <URL>
import json
import sys
import requests
url = sys.argv[1]
annotations = []
search_after = ""
while True:
results = requests.get(
"https://hypothe... | true |
33c2b0b9effa9539451e5d67a816a4c50168f584 | marcopestrin/TTSBot | /src/texttospeech/audio/tts.py | UTF-8 | 2,776 | 2.71875 | 3 | [] | no_license | import logging
import os
import ffmpeg
from gtts import gTTS
from gtts.lang import tts_langs
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from texttospeech.util import config, files
langs = None
def setup():
"""
Fetches the available languages from google's TTS API.
"""
glo... | true |
ad8a63fb86341cb85c54f807936c91d2428964cc | Lumexralph/solving-algorithm-questions | /python/array_string/compression/test_compression.py | UTF-8 | 658 | 3.15625 | 3 | [
"MIT"
] | permissive | from unittest import TestCase
from .compression import Solution
class TestStringCompression(TestCase):
def test_length_of_compressed_and_original_is_same(self):
result = Solution().compress_str("aabbccdd")
self.assertEqual(result, "aabbccdd")
def test_long_string_is_compressed(self):
... | true |
a92f021a1786873b8f40a364f012b6ed8a669040 | platiagro/pipelines | /pipelines/object_storage.py | UTF-8 | 2,784 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
from io import BytesIO
from os import getenv, SEEK_SET
from minio import Minio
from minio.error import BucketAlreadyOwnedByYou
BUCKET_NAME = "anonymous"
MINIO_CLIENT = Minio(
endpoint=getenv("MINIO_ENDPOINT", "minio-service.kubeflow:9000"),
access_key=getenv("MINIO_ACCESS_KEY", "minio... | true |
7ad3a64e51e0fd389c1db7012003f7f402e58642 | rsantellan/python-agenda-basica | /agenda/gtk_windows.py | UTF-8 | 1,150 | 2.921875 | 3 | [] | no_license | #!/usr/bin/python
import gtk
class PyAppFirstWindow(gtk.Window):
def __init__(self):
super(PyAppFirstWindow, self).__init__()
self.set_title("PyAppFirstWindow")
self.set_size_request(500, 400)
#self.set_border_width(8)
self.set_position(gtk.WIN_POS_CENTER)
... | true |
29512c595ac799456aaf3e9b2a3d85725ab1438a | MiguelLattuada/pyexpress | /src/http_response.py | UTF-8 | 1,052 | 2.890625 | 3 | [] | no_license | from src.http_response_builder import HttpResponseBuilder
from src.http_common import HttpCommon
class HttpResponse:
def __init__(self, http_request):
"""
Creates an instance of http response
:param src.http_request.HttpRequest http_request:
"""
self._request = http_reques... | true |
26f9365064210c80d6370da9e3e0c23b5e295964 | kowshikaRani/Foodilicious | /Indexing/Foodilicious_Indexing.py | UTF-8 | 2,421 | 2.953125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 29 18:16:21 2021
@author: kavitha and kowshika
"""
# Necessary imports
import json
from time import sleep
from elasticsearch import Elasticsearch, helpers # Client for elastic search
# Creating a instance
client = Elasticsearch("localhost:9200")
file_all... | true |
53437c0cd618d5c0a74f5e6090d1db5b315461e5 | pilino1234/AdventOfCode2017 | /Day12/Day12.py | UTF-8 | 791 | 3.09375 | 3 | [] | no_license |
if __name__ == "__main__":
with open("input.txt") as f:
read_pipes = [l.strip() for l in f]
data = [d.split(' <-> ') for d in read_pipes]
data = [(d[0], d[1].split(', ')) for d in data]
# create adjacency list
graph = {}
for d in data:
graph[d[0]] = d[1]
# count the numb... | true |
5e815142147e42f923fab6727d3354def030a902 | Durgesh15/python- | /dictionary/dic1.py | UTF-8 | 310 | 3.203125 | 3 | [] | no_license | student={'name':'john','age':20,'course':['history','math']}
print(student)
print(student['name'])
student['phone']=555555
student['name']='jane'
student.update({'name':'jia','age':25})
del student['age']
age=student.pop('name')
print(student)
print(age)
for key,value in student.items():
print(key,value) | true |
567546cdc48723c2d3a3a121b596372945807359 | hirani/pydec | /pydec/pydec/math/kd_tree.py | UTF-8 | 6,159 | 3.671875 | 4 | [
"BSD-3-Clause"
] | permissive | __all__ = ['kd_tree']
from math import sqrt
from heapq import heappush,heappop
class kd_tree:
class node:
def point_distance(self,point):
return sqrt(sum([ (a - b)**2 for (a,b) in zip(point,self.point)]))
def separator_distance(self,point):
return point[self.axis] - self.p... | true |
365bdf13bb08407dbfab3882f120408cf4d0af20 | mucahidyazar/python | /worksheets/tasks/problem15.py | UTF-8 | 775 | 4.375 | 4 | [] | no_license | # Problem 15
# 1'den 100'e kadar olan sayılardan sadece 3'e bölünen sayıları ekrana bastırın. Bu işlemi continue ile yapmaya çalışın.
print("""
***********************************************
x'den y'ye kadar olan sayilardan sadece z'ye bolunen sayilar
Press C to quit
Press Q to quit
***********************... | true |
b07962d746935ef026cb36b63510df1acf5337b3 | jonasdominguez1402/Patrones-de-dise-o | /Prototype Method/Prototype method1.py | UTF-8 | 2,070 | 3.46875 | 3 | [] | no_license | """
Patron de diseño Prototype
Jonathan Eliseo Dominguez Hdz
25/11/2019
"""
import copy
class Prototype:
_clonsombra = None
_numero = None
def clone(self):
pass
def getClonsombra(self):
return self._clonsombra
def getNumero(self):
return self._numero
... | true |