blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 2 333 | src_encoding stringclasses 30
values | length_bytes int64 18 5.47M | score float64 2.52 5.81 | int_score int64 3 5 | detected_licenses listlengths 0 67 | license_type stringclasses 2
values | text stringlengths 12 5.47M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
f95c2bca675bfc1d4b5d0c9e92a736753638e6a7 | Python | vuamitom/Code-Exercises | /android_cache/entry.py | UTF-8 | 5,772 | 2.671875 | 3 | [] | no_license | import sys
from common import *
from response_info import *
import m509
"""
// A file containing stream 0 and stream 1 in the Simple cache consists of:
// - a SimpleFileHeader.
// - the key.
// - the data from stream 1.
// - a SimpleFileEOF record for stream 1.
// - the data from stream 0.
// - (opti... | true |
39dec4c4812908caf52de55a67988ca0013d401f | Python | mborsetti/python-holidays | /holidays/countries/slovakia.py | UTF-8 | 2,335 | 2.78125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... | true |
c29fb4aa5a4264a755bf519bf05e6165cc907ec2 | Python | AbeelLab/GraphClean | /GraphClean.py | UTF-8 | 1,693 | 2.703125 | 3 | [] | no_license | import FeatureExtractor
import re
import networkx as nx
import UseExistingClassifier
import FilterOverlaps
import argparse
def Overlap_From_Paf(paf_filepath):
overlap_list = list()
with open(paf_filepath) as paf:
for line in paf:
line = line[:-1].split()
read1 = int(re.search(r... | true |
80143d7dae453b189e37be9fe2cec8af50df6f3a | Python | RobinMoRi/A211TG-neural-networks | /HAAR Wavelet/example_robin_haar.py | UTF-8 | 2,081 | 3.21875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 6 15:07:02 2020
@author: Robin Moreno Rinding
"""
import matplotlib.pyplot as plt
import numpy as np
class Signal:
def __init__(self, s, x):
self.s = s
self.x = x
def generateData():
j=np.power(2,7)
x=np.zeros(... | true |
a019082ce7244f856e98931a01e9bd086d3c153d | Python | HomerMadriz/Automaton_Module | /afd_jlta.py | UTF-8 | 1,450 | 3.796875 | 4 | [] | no_license | """Creación de diccionario de Alfabeto"""
def create_alf(str_alf):
alf = {}
n = 0
for letter in str_alf:
if letter != ";" and letter != "\n":
alf[letter] = n
n+=1
return alf
"""Creación de conjunto de estados finales"""
def create_fstate(str_fstate):
fstate = set(str_fstate)
fstate.remove(";")
fstate.re... | true |
577aa94d27ab1f038e8e82effaf3eea682ee59c3 | Python | SkillfulGuru/Webscraping-BeautifulSoup-NZX | /web4.py | UTF-8 | 338 | 2.515625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
myurl = 'https://www.nzx.com/markets/NZSX'
myweb_data = requests.get(myurl)
myweb_data.encoding = 'utf-8'
mysoup = BeautifulSoup(myweb_data.text, 'html.parser')
file = open("resp_text.html", "w+", encoding="utf-8")
file.write(myweb_data.t... | true |
993148332702639ebc6e7e15aac699198385e73a | Python | Oushesh/tennis-count | /score_count/Prototype/lucas_kanade.py | UTF-8 | 3,329 | 2.75 | 3 | [] | no_license | '''
Optical Flow is meant to find the
stationary regions
https://learnopencv.com/optical-flow-in-opencv/
https://developer.nvidia.com/blog/opencv-optical-flow-algorithms-with-nvidia-turing-gpus/
'''
import cv2
import numpy as np
#Python Lucas Kanade
def lucas_kanade_method(video_path):
# Read the video
cap = ... | true |
3dcdbe49d1836a1fb129b8c85b8933f38f65f730 | Python | dclsky/selenium-1 | /unittest/calctest20170620.py | UTF-8 | 827 | 3.171875 | 3 | [] | no_license | from calculator20170620 import Count # 从calculator20170620导入Countl类
import unittest # 引入unittest模块
class TestCount(unittest.TestCase): # 创建TestCount继承unittest的TestCase类
def setUp(self): # 测试用例前的初始化工作
print('test start')
def test_add(self):
j = Count(2,3) # 根据类Count创建对象j
self.assertEqu... | true |
f3286d9efd4dafeb1f4930147d6faf6908aca697 | Python | pranathivemuri/napari | /napari/_qt/widgets/qt_progress_bar.py | UTF-8 | 3,797 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | from qtpy import QtCore
from qtpy.QtWidgets import (
QApplication,
QFrame,
QHBoxLayout,
QLabel,
QProgressBar,
QVBoxLayout,
QWidget,
)
class ProgressBar(QWidget):
def __init__(self, parent=None) -> None:
super().__init__(parent)
self.setAttribute(QtCore.Qt.WA_DeleteOnClo... | true |
5f8678e6061abc20399379a12c3ecf92e44d6958 | Python | vck002/my-first-code | /add.py | UTF-8 | 194 | 3.96875 | 4 | [] | no_license | #addition of numbers
a = 10
print("the value of a is =")
print(a)
b = 20
print("the value of b is =")
print(b)
c = 30
print("the value of c is =")
print(c)
sum = a+b+c
print("sum = ")
print(sum) | true |
5b4e7b91dd72574ce0a422aa0cc4990095255a20 | Python | amandabedard/capstone-2020 | /vuln-bot/chatApi.py | UTF-8 | 1,318 | 2.640625 | 3 | [] | no_license | import flask
from chatbot import init, chatWithBot
from chatSession import checkSession, updateSession
import sys
import uuid
import json
from flask import jsonify, request
app = flask.Flask(__name__)
def createChatDict(request, chat):
# Checking to see if there's an ongoing chat session
if "chatId" in reque... | true |
68a7d647ad192ade047d966edbd4a8e7e9e2bfbd | Python | RainLeave/TourWeb | /accounts/MyCsrfMiddleware.py | UTF-8 | 2,346 | 2.578125 | 3 | [] | no_license | # from django.utils.deprecation import MiddlewareMixin
#
#
# # class MyCsrfMiddleware(MiddlewareMixin):
# #
# # def process_response(self, request, response):
# # response["Access-Control-Allow-Origin"] = "*"
# # if request.method == "OPTIONS":
# # response["Access-Control-Allow-Headers"... | true |
9e755cdb331aac3b0a10a4924b023950f0c7a83a | Python | IhorTarkhan/sorting-algorithms-visualisation | /calculation/service/sorting/algoritms/AbstractSorter.py | UTF-8 | 1,165 | 2.953125 | 3 | [] | no_license | import copy
import time
import psutil
from calculation.service.sorting.SorterResult import SorterResult
def sorting_time(sort, initial_array):
array_copy = copy.deepcopy(initial_array)
time_start = time.time()
sort(array_copy)
time_stop = time.time()
different = time_stop - time_start
return... | true |
a9673afa3dc06dee8dbc2894166833e379aa2115 | Python | hoon4233/Algo-study | /2021_spring/2021_05_07/오픈채팅방_JJ.py | UTF-8 | 706 | 3.46875 | 3 | [] | no_license | def solution(record):
nameTable = {}
answer = []
for each in record:
data = each.split()
# 최신 이름 저장
if data[0] == 'Enter' or data[0] == 'Change':
nameTable[data[1]] = data[2]
for each in record:
data = each.split()
# 최신 이름 변경하여 출력
if d... | true |
158466f9d44eae4c5dc134f6083e7b3cb66ff5c2 | Python | henricsoares/tg-supervisorio-online | /tg-html/vent.py | UTF-8 | 814 | 2.65625 | 3 | [] | no_license | import MySQLdb
import serial
import time
import datetime
ser = serial.Serial("/dev/ttyS0", 9600)
#Configura o MySQL
db = MySQLdb.connect("localhost", "root","34931123", "rasprush")
curs = db.cursor()
curs.execute('CREATE TABLE IF NOT EXISTS atuadores(time text, vent text, ilum text, irri text)')
date = str(datetim... | true |
a329f7f769cb27912316bbaae4136fea3ec66c62 | Python | sdasguptajr/Python_basic | /DataTypesTest.py | UTF-8 | 403 | 3.34375 | 3 | [] | no_license | x=5j
x="Rahul"
x=True
x=frozenset({"One","Two","Three"})
x={"firstname":"Rahul","lastname":"Arora"}
print(type(x))
print(isinstance(x,int))
print(2**10)
x=-100067576567234234234424243242424
print(type(x))
import random
print(random.randrange(1,20))
print(10==5)
from math import pi
... | true |
2f6025badab67e3dff709daa2349d1007f96bf00 | Python | karinakozarova/Learning-Python | /basics/power.py | UTF-8 | 95 | 3.171875 | 3 | [
"MIT"
] | permissive | a = int(input())
b = int(input())
c = int(input())
print(str(pow(a,b)))
print(str(pow(a,b,c))) | true |
c050ef4f2a4a4d42e339b6fb7a52ea46e658a529 | Python | Icohedron/EdgeGamers-Events | /lib/scoreboard.py | UTF-8 | 19,707 | 3.453125 | 3 | [] | no_license | """
Library for scoreboard teams and objectives
"""
from collections import OrderedDict
from lib.container import Container
from lib.consts import Colors
class Objective(Container):
"""
Represents a scoreboard objective
Attributes:
name (str):
criteria (str):
di... | true |
a6e14c3023da88951432c489750d7143646381db | Python | matt-kubica/vulnerable-forum | /vulnerable/server/src/database.py | UTF-8 | 3,334 | 2.640625 | 3 | [] | no_license | import psycopg2
import logging, os
from .models import User, Question, Answer
logging.basicConfig(level=logging.DEBUG)
connection_params = {
'database': os.environ.get('POSTGRES_DB') or 'default',
'user': os.environ.get('POSTGRES_USER') or 'admin',
'password': os.environ.get('POSTGRES_PASSWORD') or 'admi... | true |
040866bb7d36c1a8056cd9f9946c7cc30d390248 | Python | schirrecker/Geography-Quizz | /Geography v5.py | UTF-8 | 19,543 | 3.15625 | 3 | [] | no_license | import xlrd
import openpyxl
import random
import datetime
import os, os.path
import pickle
# -----------------------------------------------------
# openpyxl syntax:
# wb = openpyxl.Workbook()
# grab the active worksheet: ws = wb.active
# Data can be assigned directly to cells: ws['A1'] = 42
# Rows can al... | true |
4c7fb7a3af93022a6a80e7850679674a52b63b2f | Python | ionvision/frnn | /analysis/build_gifs.py | UTF-8 | 5,215 | 2.59375 | 3 | [] | no_license | import imageio
import glob
import scipy.ndimage as ndim
import scipy.misc as sm
import numpy as np
# Prepare method strings
PATH_STRINGS = '/home/moliu/Documents/Papers/Supplementary/titles/'
s_titles = [
ndim.imread(PATH_STRINGS + 'frnn.png'),
ndim.imread(PATH_STRINGS + 'rladder.png'),
ndim.imread(PATH_ST... | true |
4e1a500b76fe761deab4b8d5c6e301a2e331117b | Python | arjunbrara123/Day-17-quiz-game-start | /question_model.py | UTF-8 | 524 | 3.296875 | 3 | [] | no_license | import random
class Question:
def __init__(self, q_text, answer, choices):
self.text = q_text
self.answer = answer
if type(choices) == 'str':
self.choices[0] = choices
self.choices.append(answer)
random.shuffle(self.choices)
if choices[0] == 'Tru... | true |
9aac233abc2aa75fd77a934b49722f065e1e8a8b | Python | zhoujf2010/MyMachineLearning | /ch8_svm/step2.py | UTF-8 | 5,260 | 2.75 | 3 | [] | no_license | # -*- coding:utf-8 -*-
'''
Created on 2017年5月30日
@author: Jeffrey Zhou
'''
'''
SVM对鸢尾花数据分类
自建SVM
'''
import pandas as pd
from sklearn import svm
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
def selectJrand(i, m):
j = i
while(j == i):
j = int(np.ra... | true |
9fbabc6a1649ca02c9be32758b9a1f8739c23633 | Python | oadams/inflection-kws | /uam/asr1/local/prepare_universal_lexicon.py | UTF-8 | 3,690 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2017 Johns Hopkins University (Author: Matthew Wiesner)
# Apache 2.0
###############################################################################
#
# This script takes a kaldi formatted lexicon prepared by
#
# local/prepare_lexicon.pl (i.e. a lexicon that... | true |
e6b67933e4defc9ea3853f124a3a488d9f56c404 | Python | beiluo-horizon/Machine-Learning-Model | /RandomTree_Method.py | UTF-8 | 6,935 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 27 15:30:09 2019
@author: 81479
"""
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn import preprocessing
from result import result_process
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection imp... | true |
faa634e2a894a48538da8bccc0d681f8801829b6 | Python | zaberfire/TermProject | /Asteroid.py | UTF-8 | 2,648 | 3.078125 | 3 | [] | no_license | import math
import random
from Tkinter import *
from PIL import Image, ImageTk
class Asteroid(object):
@staticmethod
def init():
Asteroid.image = Image.open("images/asteroids2.png")
maxSpeed = 7
minSize = 2
maxSize = 7
def __init__(self, x, y, level = None):
if le... | true |
cef96db4987a5230b6d5abcd8e718afc8a719470 | Python | hamdiranu/backUp_Alta | /Alta Batch 4/Phase 1/Week 1/Day 6 (Weekend 1)/Two Sums.py | UTF-8 | 534 | 3.078125 | 3 | [] | no_license | def twoSum(nums, target):
output = []
for i in nums :
pair = target-i
if nums.index(i) not in output :
if target - i in nums :
calon = i
if nums.index(i) != nums.index(pair) :
output.append(nums.index(i))
output.... | true |
e7ed8ffb4fce774b1c980ae31c02ce55c6e89182 | Python | MuseumofModernArt/moma-utils | /reporting-tools/fixity_bdwidth.py | UTF-8 | 1,751 | 2.578125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import argparse, csv, urllib2, json, base64, getpass
from hurry.filesize import size, si
parser = argparse.ArgumentParser(description="script that uses Binder's API to add AIP size to the granular ingest report")
parser.add_argument('-i', '--input', type=str, required=True, help='source data fil... | true |
8f0a0e04aacce7ed5c401e2061097be51729b3cc | Python | JoseTg1904/-LFP-Proyecto2_201700965 | /arbol.py | UTF-8 | 1,099 | 3.03125 | 3 | [] | no_license | class ArbolS():
def __init__(self,tamanio,nodos):
self.tamanio = 0
self.nodos = []
def agregar(self,valor,idenPadre,idenHijo):
if self.tamanio == 0:
self.nodos.append(Nodo(valor,idenPadre,[]))
self.tamanio += 1
else:
for val in self.... | true |
673aabd60d7ab29649c29db3edd2908749ad1d98 | Python | MevlutArslan/neural-networks-from-scratch-book | /main/classes/neuron.py | UTF-8 | 591 | 3.453125 | 3 | [] | no_license | import numpy as np
class Neuron():
def __init__(self, inputs: list, weights: list, bias: float):
self.inputs = inputs
self.weights = weights
self.bias = bias
self.number_of_inputs = len(inputs)
def calculate_output(self):
output = 0
for i in range(self.number_... | true |
ab824ed434136c4103b842b2012f0cb55ee0c87b | Python | Noba1anc3/Machine_Learning | /python_standard/lesson7-if条件.py | UTF-8 | 821 | 3.65625 | 4 | [] | no_license |
# coding: utf-8
# In[ ]:
'''
> 大于
>= 大于等于
< 小于
<= 小于等于
== 等于
!= 不等于
'''
# In[1]:
a = 1
b = 2
c = 3
d = 1
if a>b:
print("right")
# In[2]:
if a>=d:
print("right")
# In[3]:
if a==d:
print("right")
# In[4]:
if a!=b:
print("right")
# In[5]:
if a<b<c:
print("right")
# In[6]:
... | true |
7ac1c4582f35815af242fd2736287395730c07b5 | Python | isikveren/demo | /python/6/6_9.py | UTF-8 | 255 | 3.453125 | 3 | [] | no_license | prompt = "\nTell me somthing, and I will repeat it it to you:"
prompt += "\nEnter 'quit' to end the program."
message = int(input(prompt))
while message <=100:
message += 1
if message % 2 == 0:
continue
print(message)
print('\t') | true |
3fc591b1898bb9b8ced1d1c034f11d6d5fad765d | Python | dudamarlena/self-balancing-robot | /memory/experience.py | UTF-8 | 635 | 3.265625 | 3 | [] | no_license | """ Module with Experience of agent getting in each state """
from typing import NamedTuple
import numpy as np
class Experience(NamedTuple):
""" Class with all experience fields """
state: np.ndarray
action: np.ndarray
reward: float
done: bool
next_state: np.ndarray
@classmethod
def ... | true |
51cace9854cc619c1fc4d79ee20150a3a23ff6aa | Python | guoqchen1001/microservice | /microservice/controllers/auth.py | UTF-8 | 2,718 | 2.515625 | 3 | [] | no_license | from flask_restful import abort,current_app,Resource
from functools import wraps
from .parsers import AuthParser
from ..models import User
from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer
, BadSignature, SignatureExpired)
from .base import ErrorCode
class AuthApi(Resou... | true |
bd1dc930b3dd2e495359983dc7b7c0141e036c57 | Python | mdeeds/genie | /py/modelStrategy.py | UTF-8 | 3,078 | 2.84375 | 3 | [
"MIT"
] | permissive | import random
import tensorflow as tf
import numpy as np
import ticTacToe as game
class ModelStrategy:
stateSize = 0
moveSize = 0
model = None
dictionaryModel = None
moveNoise = 0.0
moveDictionary = dict()
thisGame = None
def __init__(self, game, moveNoise=0.05):
... | true |
62fd73c5f0c81991f4a4949f0b7eca2dbb8f20fa | Python | saurav188/python_practice_projects | /distribute_bonus.py | UTF-8 | 660 | 3.8125 | 4 | [] | no_license | def getBonuses(performance):
bonus=[1 for i in performance]
for i in range(len(performance)):
#first person
if i==0:
if performance[i]>performance[i+1]:
bonus[i]+=1
#last person
elif i==len(performance)-1:
if performance[i]>performance[i-1]... | true |
6a5827f0be8c5b716b2a59475bb5c5c8390657a0 | Python | kimsungbo/Algorithms | /백준/유니온파인드/4195_친구네트워크.py | UTF-8 | 873 | 3.296875 | 3 | [] | no_license | # 4195 친구 네트워크
# 유니온 파인드에 집합의 크기를 구하는 기능을 넣는 문제
import sys
input = sys.stdin.readline
t = int(input())
def Find(parents, x):
if x == parents[x]:
return x
p = Find(parents, parents[x])
parents[x] = p
return parents[x]
def Union(parents, a, b, cnt):
x = Find(parents, a)
y = Find(paren... | true |
747c4fa6fbab1e5c8ac55a6c63b097c8379da370 | Python | rajeshsvv/Lenovo_Back | /1 PYTHON/1 EDUREKA/EDUREKA NEW/40_File_Operations.py | UTF-8 | 574 | 3.140625 | 3 | [] | no_license | import os
newfile=open("Edureka.txt","w+")
# newfile.close() # when uncomment this in write mode u got i/o operation on closed file errror.
# write mode
# for i in range(1,10):
# newfile.write("\n Welcome to Python")
# Read Mode
newfile=open("Edurekha.txt","r")
for i in range(1,10):
# prin... | true |
48f22ec1d66d7e1a7b1aa88d5abaeab367448a22 | Python | s-owl/algossstudy | /harvey/11048.py | UTF-8 | 700 | 2.90625 | 3 | [] | no_license | import sys
def solv(l):
n = len(l)
m = len(l[0])
d = [[0]*m for _ in range(n)]
for i in range(n):
for j in range(m):
if i == 0 and j == 0:
d[i][j] = l[i][j]
elif i == 0:
d[i][j] = d[i][j-1] + l[i][j]
elif j == 0:
... | true |
922281d44a2b8ae1dac92dc37b7b4e7775e20b34 | Python | keeyon2/Python-Practice | /test/test_two_arg.py | UTF-8 | 825 | 2.859375 | 3 | [] | no_license | import unittest
import sys
import os
from practicemodules import twoargprog
print "First Line in test"
# filename = "practicemodules/twoargprog"
# sys.path.insert(0, os.path.dirname(filename))
class TestTwoArgProgramFunctions(unittest.TestCase):
def setUp(self):
# self.twoargprog = practicemodules.twoarg... | true |
827438c995bf32905893bde8ed0b74018ae25d93 | Python | ntulsy/NTU_CZ3003_Extinguisher | /OS/Subscription/SMSSender.py | UTF-8 | 1,988 | 2.765625 | 3 | [] | no_license | from twilio.rest import TwilioRestClient
import threading
from Subscription import Subscription
import latlng
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def the_print(info):
print OKBLUE + "[SMS]" + ENDC, info
class SMSS... | true |
6adea29b24b2ba3441753854e0bb65f379f3f8cb | Python | agl10/spline_fitting | /my_functions.py | UTF-8 | 19,219 | 3.125 | 3 | [] | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 12:53:45 2018
@author: andy
"""
from scipy.interpolate import CubicSpline
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import splprep, splev
import time
from sklearn.neighbors import NearestNeighbors
import netwo... | true |
35762fd63d868d895e6c211f051cadd59e0ce4c3 | Python | kyoz/learn | /languages/python/1.learn_py_the_hard_way/ex23.py | UTF-8 | 572 | 2.9375 | 3 | [
"MIT"
] | permissive | import sys
script, input_encoding, error = sys.argv
def main(language_file, encoding, errors):
line = language_file.readline()
if line:
print_line(line, encoding, errors)
return main(language_file, encoding, errors)
def print_line(line, encoding, errors):
next_lang = line.strip()
raw... | true |
d0a4462d6cf31a90b2183b7bc85362c6935c9a6c | Python | kmod/icbd | /icbd/compiler/tests/34.py | UTF-8 | 2,347 | 3.953125 | 4 | [
"MIT"
] | permissive | """
closure tests
"""
def f1(x):
def g1():
return 2
def g2():
y = 2
def f1_2():
return y + x + g1()
return f1_2()
return g2
print f1(1)()
def f3(x):
if 1:
return x
return g3(x)
def g3(x):
return f3(x)
print f3(2)
y = 1
def f4(x):
retur... | true |
2fe6134fbc7d381aaa7f4fa7f03d7fabaad8983f | Python | eternaltc/test | /Test/Exception/except04_try_else.py | UTF-8 | 192 | 3.453125 | 3 | [] | no_license | try:
a = input("请输入一个被除数:")
b = input("请输入一个除数:")
c = float(a)/float(b)
# print(c)
except BaseException as e:
print(e)
else:
print(c)
| true |
af3de83602000068790f2892c9b3dc3d9affb80a | Python | shahhaard47/ML-CourseProjects | /course_project/create_splits.py | UTF-8 | 1,251 | 2.96875 | 3 | [] | no_license | ## CS 675 Course project
## Author: Haard Shah
from read_files import readData, readLabels
import sys
import os
import random
# hello OYOOOO
TRAIN_FOLDER = "train_data"
DATA_NAME = ""
TRAIN_PATH = os.path.join(os.getcwd(), TRAIN_FOLDER)
OUTPUT_TRAIN_PREFIX = ""
def createTrainDir():
if not os.path.exists(TRAIN_PAT... | true |
39df6a7b14bdf4f7af30839d6304497defa4f7ac | Python | ammishra78/Imfeelinglucky | /scale_images.py | UTF-8 | 353 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
import glob, os
size = 100, 100
all_images = glob.glob("Images/*.jpeg")
total = len(all_images)
for infile in all_images:
file, ext = os.path.splitext(infile)
im = Image.open(infile)
im = im.resize(size)
im.save("sm100x100" + file +... | true |
29088eb4684e429ab70ef1471aa67a8f962356e3 | Python | WillisLiao/10-29nice | /q1.py | UTF-8 | 448 | 3.609375 | 4 | [] | no_license |
def monkey(a,b):
while a<=10:
a+=1
bear(a)
def bear(n):
var = False
bool = False
for i in range(1,n):
sum=0
for j in range(i,n):
sum+=j
if(sum==n):
bool=True
for k in range(i,j):
print('... | true |
d804a25db6c636123aab9c9c7644d28934bf7db1 | Python | mmamoyco/python-console-game | /Game/LoginService.py | UTF-8 | 634 | 2.671875 | 3 | [] | no_license |
from UserService import UserService
from UserTO import UserTO
from DAO.UserDAO import UserDAO
class LoginService:
def __init__(self):
self.__userService = UserService()
self.__userDAO = UserDAO()
# return True if login success othervise returns false
def login(self, user):
# TOD... | true |
ae480a53e1520052426aaeefc01548b2ddaebc53 | Python | Mumbaikar007/Code | /SPCC shortcuts/firstfollow.py | UTF-8 | 2,212 | 3 | 3 | [] | no_license |
numberOfProductions = int ( input() )
givenProductions = []
for _ in range (0, numberOfProductions):
givenProductions.append(input())
print ( givenProductions )
terminals, nonTerminals = set (), set()
[terminals.add(ch) if ( 'a' <= ch <= 'z' or ch in ( '+', '*', '(', ')','/','~')) else nonTerminals.add(ch) if (ch !... | true |
c12aa6c9ba3a23c8463ead12a4800f6063616421 | Python | hunterachieng/python_class | /bank.py | UTF-8 | 6,034 | 3.328125 | 3 | [] | no_license | from datetime import datetime
class Account:
account_type = "student"
def __init__(self,name,phone):
self.name = name
self.phone = phone
self.balance = 0
self.transaction_fee = 50
self.loan_amount = 0
self.loan_fees = 5
self.loan_limit = 50000
sel... | true |
b95260d5d085467fc219737d4b4b7a7ec8e18767 | Python | p-b-j/uscb-das-container-public | /das_decennial/programs/reader/spar_table.py | UTF-8 | 5,138 | 3.078125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LicenseRef-scancode-public-domain",
"CC0-1.0"
] | permissive | """
This module implements a few table reading classes.
TableWithGeocode is a class that has a repartitionData function, that performs repartitioning of DataFrame by geocode before
creating histograms.
SparseHistogramTable is a class that reads table and converts it from Spark DataFrame with rows corresponding to rec... | true |
c4a3acdcae220600cea2105eb23e1d8738171961 | Python | jakoblover/TDT4265-Computer-Vision-and-Deep-Learning | /Assignment 1/LogisticRegression.py | UTF-8 | 2,831 | 3.140625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
class LogisticRegression:
def __init__(self, learningRate=0.000001,n=1000,l2_reg=True,lambd=0.001):
self.learningRate = learningRate
self._lambda = lambd
self.l2_reg = l2_reg
self.n = n
self.lossValsTraining = []
sel... | true |
0399fffcc3fc75b2d404230a3954b83f6e4b0547 | Python | sutizi/sentiment-analysis | /clasificador.py | UTF-8 | 1,250 | 2.890625 | 3 | [] | no_license | #!usr/bin/env python3
import os
import pickle as c
from sklearn.metrics import accuracy_score
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
def guardar(clf, nam... | true |
1b7c2d0511ba066baef031dd2354ee2152dc6b72 | Python | roeybenhayun/statistical_ml | /database/assigenment3/Interface.py | UTF-8 | 18,621 | 2.953125 | 3 | [] | no_license | #!/usr/bin/python2.7
#
# Interface for the assignement
#
import psycopg2
def getOpenConnection(user='postgres', password='1234', dbname='postgres'):
return psycopg2.connect("dbname='" + dbname + "' user='" + user + "' host='localhost' password='" + password + "'")
def loadRatings(ratingstablename, ratingsfilepa... | true |
ebedb3b80e419146e2e9fb79d4642337cc39f4c4 | Python | fbrute/lovy | /hymarch22/lovysplit/selectfiledialog.py | UTF-8 | 1,338 | 3 | 3 | [] | no_license | import tkinter as tk
from tkinter import ttk
from tkinter.filedialog import askopenfilename
from pathlib import Path
class SelectFileDialog(tk.Tk):
def __init__(self):
super().__init__()
# create the root window
self.geometry('200x100')
self.resizable(False, False)
self.ti... | true |
f84db34c8a05af6ec46e1dfb698bd48e6798fcb1 | Python | arcaputo3/algorithms | /algos_and_data_structures/nbit_addition.py | UTF-8 | 436 | 3.9375 | 4 | [] | no_license | # NBIT ADDITION: Adds two n length binary integers represented as arrays of 0's and 1's
# Input: Two binary arrays arr1, arr2
# Output: Addition of arr1 and arr2
def nbit_add(arr1, arr2):
n = len(arr1)
arr = [0]*(n+1)
for i in range(n):
if arr1[i] == 1 and arr2[i] == 1:
arr[i] = 1
... | true |
b10dab4ea9a799d1a5d3e0d11d5bb70f4d1f3a32 | Python | ovsartem/json_navigator | /main.py | UTF-8 | 1,933 | 3.671875 | 4 | [
"MIT"
] | permissive | import json
def get_info(path):
"""
Reads json file
"""
with open("frienfs_list_Obama.json", 'r', encoding='utf-8') as f:
data = json.load(f)
return data
def dictionary(element):
"""
Function to work with dictionary
"""
all_elements = list(element.keys())
print("T... | true |
ab34c7e2adbd68769e2269fe86c006bc5f942c65 | Python | jadsonlucio/Machine-learning-ufal-course | /activities/week-3/src/countries_data_collection.py | UTF-8 | 1,247 | 2.734375 | 3 | [] | no_license | import requests
from time import sleep
API_URL = "https://restcountries.eu/rest/v2/name/"
def get_countries_info(country_names):
responses = {}
for country_name in country_names:
if country_name not in responses:
print(f"{API_URL}{country_name}")
response = requests.get(f"{AP... | true |
7efd66dac8ba66100304ecfddf3ae98df0268cb8 | Python | embarktrucks/sour | /sour/common/utils/enum.py | UTF-8 | 819 | 3.265625 | 3 | [
"Zlib"
] | permissive | class enum(object):
"""@DynamicAttrs"""
__by_values = {}
def __init__(self, *items, **kwitems):
self.__by_names = {}
self.__by_values = {}
i = 0
for item in items:
self.__by_names[item] = i
self.__by_values[i] = item
self.__setattr__(ite... | true |
0cf64e667dd6a7e9d75d72d095f9c3bf410a37b3 | Python | dikopylov/Coursera.ML | /Week 2/Similarity-basedClassifier/knn.py | UTF-8 | 1,367 | 2.734375 | 3 | [] | no_license | from sklearn.model_selection import KFold, cross_val_score
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import scale
import pandas
data = pandas.read_csv('../wine.data', header=None)
data_class = data[0]
data_attribute = data.drop([0], axis=1)
kf = KFold(n_splits=5, shuffle=True, ran... | true |
73b14248d96ff055d9f472b1200b28a134afddd9 | Python | marekhanus/spja | /labs/04/tasks.py | UTF-8 | 7,310 | 4.28125 | 4 | [] | no_license | import math
class Vector:
"""
Implement the methods below to create an immutable 3D vector class.
Each implemented method will award you half a point.
Magic methods cheatsheet: https://rszalski.github.io/magicmethods
"""
"""
Implement a constructor that takes three coordinates (x, y, z) ... | true |
31456343538c2604bcd6a3d18c7fc0e5de1c9f5f | Python | CgnRLAgent/cog_ml_tasks | /gym_cog_ml_tasks/envs/copy_tasks/copy_repeat_env.py | UTF-8 | 4,731 | 3.5625 | 4 | [
"GPL-3.0-only"
] | permissive | """
simple copy-repeat task:
Copy the input sequence multi-times and reverse it every other time as output. For example:
(repeat time: 3)
Input: ABCDE
Ideal output: ABCDEEBCDAABCDE
At each time step a character is observed, and the agent should respond a char.
The action(output) is chosen from a char set e.g... | true |
de48841a8611853a6679c69c1cbe0ebce15c8e6f | Python | mahir-d/Solved-LeetCode-problems | /insert-delete-getrandom-o1/insert-delete-getrandom-o1.py | UTF-8 | 1,336 | 4.1875 | 4 | [] | no_license | class RandomizedSet:
def __init__(self):
"""
Initialize your data structure here.
"""
self.my_dict = dict()
self.my_arr = []
def insert(self, val: int) -> bool:
"""
Inserts a value to the set. Returns true if the set did not already contain the ... | true |
62a80b379d81fdc8237ee78b0bff133a41f38c97 | Python | sabrina-boby/practice_some-python | /for_loop-2.py | UTF-8 | 96 | 3.296875 | 3 | [] | no_license |
n=int(input("enter tha last number "))
sum=0
for i in range(1,n+1,1):
sum=sum+i
print(sum) | true |
9bbc6e4f7744627c84690eeb31eb1383b98aa6a9 | Python | maiacodes/school-shit | /Challanges/c13.py | UTF-8 | 109 | 3.765625 | 4 | [] | no_license | num = input("Enter a number under 20? ")
if int(num)>19:
print("Too high!")
else:
print("Thank you") | true |
6570ba01b57cbea01d54db715d751a9f48dfbc92 | Python | darkhader/LTU15 | /20201/image-processing/BaiTapLon/format.py | UTF-8 | 793 | 3.015625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import cv2 as cv2
import argparse
import os
def main():
argparser = argparse.ArgumentParser()
argparser.add_argument(
'--input_file',
default='./data/lenna.png',
help='Image to convert format')
... | true |
5febea2331437d649358ab7d04923c209606698a | Python | monsterone/automation_wg | /framework/testdemo/test_driver_add_fix.py | UTF-8 | 5,363 | 2.625 | 3 | [] | no_license | from time import sleep
from selenium import webdriver
from selenium.webdriver import ActionChains
# http://47.108.71.92
driver = webdriver.Chrome()
# driver = webdriver.Firefox()
driver.implicitly_wait(10)
driver.maximize_window()
driver.get('http://192.168.1.192:9000/index.html')
driver.find_element_by_xpath('/... | true |
3e65845c72f2143f2d7bf33e6dc3b52edda375bd | Python | anhsirksai/python-raxcli | /raxcli/utils.py | UTF-8 | 1,780 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2013 Rackspace
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the... | true |
3c3e08536b743e59b246d9af6856da379e3ff0fa | Python | guatty/job_offer_board_assignation | /test2.py | UTF-8 | 2,252 | 2.765625 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import pandas as pd
df = pd.read_csv('data/preprocessed_campaigns.csv')
# print(list(df))
i=0
columns_name = ['id', 'title', 'category', 'country', 'cpc', 'name', 'keywords', 'description', 'job_type', 'job', 'job_board_id', 'amount_action_0', 'amount_action_1', 'amount_a... | true |
0152abb595804c2829ed8b02b072f3209593d63b | Python | huangno27/learn | /早期/learning python/xy.py | UTF-8 | 201 | 3.421875 | 3 | [] | no_license | print(----ak-----)
temp = input ("不妨猜一下心里的数字")
guess = int(temp)
if guess == 8:
print("我擦")
print("厉害了")
else:
print("猜错了,不是这个")
print("over")
| true |
926b83867f2144e108b55f125c0a8b308808c067 | Python | SnakeOnex/twitter-word-embeddings | /input_data.py | UTF-8 | 5,387 | 3.234375 | 3 | [] | no_license | import numpy
from collections import deque
class InputData:
def __init__(self, file_name, min_count):
self.input_file_name = file_name
# loads the data from file and removes low count words and shit
self.get_words(min_count)
# not sure what this is for yet
self.w... | true |
bc93803fd574cee158ee61070b01e3dffc9fc105 | Python | bblwg2020/RCNN | /train_step3.py | UTF-8 | 1,251 | 2.546875 | 3 | [
"MIT"
] | permissive | from __future__ import division
from data.dataset_factory import DatasetFactory
from models.model_factory import ModelsFactory
from options.train_options import TrainOptions
import numpy as np
class Train:
def __init__(self):
self._opt = TrainOptions().parse()
self._dataset_train = Datas... | true |
c783cf5535d8cd5e2b2dfc60594291b542c8d4df | Python | RedLicorice/crypto-forecast | /lib/trading/exchange.py | UTF-8 | 13,175 | 2.84375 | 3 | [] | no_license | #
# This class handles Exchange-related operations.
# For methods where DB access is needed, a 'session' parameter is required.
# Please note that created orders need to be added to the session manually
#
# Margin wallets hold the lent positions, they don't count for the sake of equities
from lib.trading.models... | true |
f51c8d719fb9bf69880ae88212fe06310093d98a | Python | naquiroz/CSE-151B-PA4 | /pa4/dataset_factory.py | UTF-8 | 2,968 | 2.5625 | 3 | [] | no_license | ################################################################################
# CSE 253: Programming Assignment 4
# Code snippet by Ajit Kumar, Savyasachi
# Fall 2020
################################################################################
import csv
import os
from pycocotools.coco import COCO
from torch.u... | true |
1ae7a7ff3ab58e6382f29becda0b5c4fbc4b11ae | Python | ja-vpaw/stepik-autotests | /selenium_course/lesson2/lesson2_3_step4.py | UTF-8 | 510 | 2.625 | 3 | [] | no_license | from selenium_course.common_lib.calc import calc_x
from selenium import webdriver
link = "http://suninjuly.github.io/alert_accept.html"
browser = webdriver.Chrome()
browser.get(link)
button = browser.find_element_by_tag_name("button")
button.click()
confirm = browser.switch_to.alert
confirm.accept()
x = browser.fi... | true |
5300e5e207d29edcc42e2d0124cd7bd7fbc346b2 | Python | ali-moments/cryptography-in-python | /decrypt.py | UTF-8 | 288 | 2.875 | 3 | [
"CC0-1.0"
] | permissive | import pyAesCrypt
print("<Decrypt>")
bufferSize = 64 * 1024
file = input("File Name : ")
password = input("Password : ")
try:
pyAesCrypt.decryptFile(file,file+"_decrypted",password,bufferSize)
print("File Decrypted !")
except Exception as error:
print(error)
exit(1)
| true |
73fe1e1f48b48b589de060054139c6816db5f460 | Python | muxuanliang/Coding-Questions | /Util/quicksort.py | UTF-8 | 557 | 3.59375 | 4 | [] | no_license | # sort a list of numbers
def quicksort(lst):
if len(lst)<=1:
return lst
pivot = lst[0]
left,right = partition(lst[1:],pivot)
return quicksort(left) + [pivot] + quicksort(right)
# lenght of lst is at least 1
def partition(lst,pivot):
left = 0
right = 0
while right != len(lst):
if lst[... | true |
01c24d6d2b3df244e0b88d9b3ab3aba9d86f1726 | Python | NWood-Git/leet_code | /82_remove_duplicates_from_sorted_linked_list_ii.py | UTF-8 | 3,497 | 3.96875 | 4 | [] | no_license | # 82. Remove Duplicates from Sorted List II
# Difficulty - Medium
# https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/
# Description:
# Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
# Return the linked list sorted as w... | true |
4162c36a78565843f9113be4230e481d5d0b105f | Python | Harshit898/PythonWS | /load.py | UTF-8 | 3,715 | 2.734375 | 3 | [] | no_license | from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
import random
import ssl
import json
import sqlite3
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = 'https://pmjay.gov.in/pagination.php'
html = ur... | true |
30a442d9ce9103c4eaabc298fc17c4184140022c | Python | moxlev/AtCoder | /abc/abc044B.py | UTF-8 | 228 | 2.984375 | 3 | [] | no_license | from collections import Counter
def main():
w = input()
cnt = list(Counter(w).values())
s = list(filter(lambda x: x % 2 != 0, cnt))
print("Yes" if len(s) == 0 else "No")
if __name__ == '__main__':
main()
| true |
76a4cb6bc78a507ba50b8b081899f166405e9673 | Python | deepgbits/calculationEngine | /src/division.py | UTF-8 | 193 | 3.3125 | 3 | [
"MIT"
] | permissive | import math
def div(a, b):
#This program divides two numbers and return the result
if b==0:
return "Error" #if denominator is 0 then return error
result = a/b
return result
| true |
e8f682af80b2cc5e2d03f95a9b408fb0ba86abe2 | Python | nomanshafqat/CE888-Data-Science-and-Decision-Making-Labs | /project3/playTestGame.py | UTF-8 | 1,664 | 3.34375 | 3 | [] | no_license | '''Created by nomanshafqat at 2020-04-07'''
import time
from UCT import OthelloState, UCT, get_state
#plays games for testing
def UCTPlayTestGame(writer=None, classifier=None, expert_clf=None):
""" Play a sample game between two UCT players where each player gets a different number
of UCT iterations (= s... | true |
7e9c858e75970452c4de6406f82174c94eae7bfa | Python | Superpowergalaxy/AirBearingTable | /motor_control_cal.py | UTF-8 | 3,077 | 3.671875 | 4 | [] | no_license | #! /usr/bin/python
import os #importing os library so as to communicate with the system
import time #importing time library to make Rpi wait because its too impatient
time.sleep(1)
import pigpio #importing GPIO library
ESC=4 #Connect the ESC in this GPIO pin
pi = pigpio.pi();
pi.set_servo_pulsewidth(ESC, 0) ... | true |
deecbf6cffd6c4801c425c11bf0183b800785cb6 | Python | nickr1977/Learning | /ex6.py | UTF-8 | 769 | 4.59375 | 5 | [] | no_license | # A variable for the amount of people and a text string describing it.
types_of_people = 10
x = f"There are {types_of_people} types of people."
# A variable for defining binary and don't along with Y
binary = "binary"
do_not = "don't"
y = f"Those who know {binary} and those who {do_not}."
# A simple print out of X an... | true |
e49788c8447fe785299af2e47d85b9f86098132c | Python | TheInventorist/Material-Programacion | /Guias de programacion basica/Soluciones/Python/06-Archivos/06/modules.py | UTF-8 | 828 | 3.375 | 3 | [
"MIT"
] | permissive | def leerArchivo(nombreArchivo):
contenido = []
f = open(nombreArchivo, "r")
for line in f:
contenido.append(line)
f.close()
reworkedList = []
for item in contenido:
reworked = item.split("\n")
reworkedList.append(reworked[0])
return reworkedList
def estructurarDatos... | true |
62137adf033e3dbaec49ca17a1396b488706a40c | Python | lemillion12/sdpd-beaglebone-black-pir-sensor | /server.py | UTF-8 | 452 | 2.90625 | 3 | [] | no_license | import socket
def Main():
host = '10.42.0.1'
port = 6666
TestServer = socket.socket()
TestServer.bind((host,port))
print ("Server started!")
TestServer.listen(1)
c, addr = TestServer.accept()
print ("Connection from: " + str(addr))
while True:
data = str(c.recv(1024))
... | true |
58bbd4ba204553d3a2874d2a79b9c2055568b11b | Python | hengruizhang98/dgl | /examples/mxnet/gat/train.py | UTF-8 | 5,453 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | """
Graph Attention Networks in DGL using SPMV optimization.
Multiple heads are also batched together for faster training.
References
----------
Paper: https://arxiv.org/abs/1710.10903
Author's code: https://github.com/PetarV-/GAT
Pytorch implementation: https://github.com/Diego999/pyGAT
"""
import argparse
import net... | true |
347b521625574100e063aca18b5a43ef52839697 | Python | TDK211299/machine-learning-aug-2019 | /KNN & Face Recog/face_detect.py | UTF-8 | 886 | 2.671875 | 3 | [] | no_license | import cv2
import numpy as np
camera = cv2.VideoCapture(0)
face_detector = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml')
BASE_DIR = "./data/"
name = input("Enter your name : ")
faces_data = []
cnt = 0
while True:
ret,img = camera.read()
if ret==False:
continue
faces= face_detector.detectMultiScale... | true |
81d8369328dfbd3c7e769e59a571b45532c8461a | Python | AoiKuiyuyou/AoikPourTable | /src/aoikpourtable/count_io.py | UTF-8 | 3,211 | 2.703125 | 3 | [] | no_license | # coding: utf-8
#
from __future__ import absolute_import
from datetime import datetime
import sys
from .uri_util import uri_get_path
from .uri_util import uri_query_to_args
#
IS_PY2 = (sys.version_info[0] == 2)
#
def count_lines(uri, query, args, cmd_args):
"""
Count factory that counts lines of a file.
... | true |
b6c4ebb23c110c861cd7f663711ef62518497aed | Python | hramos21/MTH-497I | /MTH497Master/assay.py | UTF-8 | 3,266 | 3.015625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 10:03:27 2020
@author: hecto
"""
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
#from phase import phase1
def singleWell(location):
print('Here are the graphs for - '+location)
#reads excel file and plots graphs according to columns... | true |
f99c73b8106945c738850b9444caa79acf7c9864 | Python | estherica/wonderland | /modules/main_code.py | UTF-8 | 195 | 2.578125 | 3 | [] | no_license | from random import randint
from time import sleep
from modules.defim import menu,calculating,dogs_age
menu()
sleep(3)
print("wow!\n\n")
calculating(3,6)
dogs_age(int(input("Enter dog's age")))
| true |
3776956c360cae1663f00ef342a12995d3f27683 | Python | christopher-roy29/KMeansClustering-ImageDenoising | /task1.py | UTF-8 | 3,232 | 3.265625 | 3 | [] | no_license |
import utils
import numpy as np
import json
import time
def kmeans(img,k):
"""
Implement kmeans clustering on the given image.
Steps:
(1) Random initialize the centers.
(2) Calculate distances and update centers, stop when centers do not change.
(3) Iterate all initializations and return th... | true |
9f5313fc45085efacbaeef66e199fc3a893509c6 | Python | asolwa/solawa_rudnicki | /anro5/scripts/jcmd.py | UTF-8 | 708 | 2.515625 | 3 | [] | no_license | #!/usr/bin/env python
import sys
import rospy
from anro4.srv import Interpol
def interpolate(j1, j2, j3, t):
rospy.wait_for_service('Interpol_control')
try:
int_srv = rospy.ServiceProxy('Interpol_control', Interpol)
resp = int_srv(j1, j2, j3, t)
print(resp)
except rospy.ServiceExce... | true |
b26e340cc980d253b242c1a42a4d5e4100a1fd3f | Python | jesusa2624/PYTHON-BASCIO | /tuplas.py | UTF-8 | 543 | 4 | 4 | [] | no_license | #declarar tupla
mi_tupla = ()
mi_tupla = (1,2,3)
#generar una tupla de 1 solo valor (Obligatorio la ,)
mi_tupla = (1,)
#acceder a un indice de la tupla
mi_tupla = (1,2,3)
mi_tupla[0] #1
mi_tupla[1] #2
mi_tupla[2] #3
#reasignar una tupla
mi_tupla = (1,2,3)
mi_otra_tupla = (4,5,6)
mi_tupla =+ mi_otra_tupla
#metodos d... | true |
61b7b822b00f09e112bf48aa61bbfd852086778d | Python | shangrex/Novel_Recommend_System | /src/script/run_poet_cnt_spa.py | UTF-8 | 1,391 | 2.640625 | 3 | [] | no_license | '''
Use Spacy (Word Embedding) to Recommend Poet
'''
import spacy
from spacy.lang.zh.examples import sentences
from sklearn.metrics.pairwise import cosine_similarity
import argparse
import pandas as pd
import numpy as np
import pickle
from tqdm import tqdm
nlp = spacy.load("zh_core_web_lg")
nlp.enable_pipe("senter")... | true |
14221f1172aa447cf0f0259c9707f4dca1eeb1f4 | Python | husigntospeech/SeniorProjectSignLanguage | /SignLanguageToSpeechServer/backend/server.py | UTF-8 | 2,834 | 2.953125 | 3 | [] | no_license | import base64
import logging
import os
import uuid
import shutil
from open_cv_handler import OpenCVHandler
from lib.websocket_server import WebsocketServer
TEMP_FOLDER_PATH = 'temp'
def on_client_message(client, server, message):
print 'Got message.'
# If the message has a space in the 2nd position then the... | true |
973f9090c60444d4fc18a1126812e933f2578eb3 | Python | jpieper/legtool | /legtool/gait/leg_ik.py | UTF-8 | 7,931 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | # Copyright 2014 Josh Pieper, jjp@pobox.com.
#
# 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... | true |
eb863025f9446b826849a0ac7ad25b7a6c58ae9c | Python | shub-kris/coursework | /Probabilistic Machine Learning/Assignment_03/game.py | UTF-8 | 4,592 | 3.140625 | 3 | [] | no_license | import numpy as np
import random
from board import Board, cls
from MC_agent import MCAgent
from human_agent import HumanAgent
from random_agent import RandomAgent
import matplotlib.pyplot as plt
import time
# for usage with jupyter notebook
from IPython.display import clear_output
class Game:
def __init__(self... | true |
5eecb80fd9a5c2bed77de5e351f2a8f8e0246100 | Python | juneadkhan/InterviewPractice | /validPallindrome.py | UTF-8 | 385 | 3.9375 | 4 | [] | no_license | """
Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: "amanaplanacanalpanama" is a palindrome.
"""
# O(n) Time, O(n) Space
def isPalindrome(s: str) -> bool:
string = ''.join([x.lowe... | true |