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 |
|---|---|---|---|---|---|---|---|---|---|---|
6bf1ea2d38500edf0b396f058251ea126801deae | endreujhelyi/endreujhelyi | /week-04/day-4/12.py | UTF-8 | 381 | 3.578125 | 4 | [] | no_license | # 12. write a recursive function that can add numbers in
# [1, 2, [3, 4], 1, [1, [2, 4]]]
listed = [1, 2, [3, 4], 1, [1, [2, 4]]]
def adder_robot(listq):
if len(listq) == 0:
return 0
elif type(listq[0]) == list:
return adder_robot(listq[0]) + adder_robot(listq[1:])
else:
return li... | true |
885d0b7a1bbf2d2f8006400d1546a987b68cce23 | giselilla/VideoDeduplication | /winnow/annotation/tools.py | UTF-8 | 2,619 | 2.796875 | 3 | [
"MIT"
] | permissive | import pandas as pd
from .utils import create_interface
class Annotator:
def __init__(self,report_path,save_path,annotation_label = 'is_match',annotation_default_value=-1,transform_query_path=True,frames_directory=None):
"""Instantiates the Annotator class
Arguments:
report_p... | true |
4332ab4257ba10b8459d9149864f8c583634a943 | darthgera123/POIS_deepcrypt | /paillierlib2/test_paillier.py | UTF-8 | 1,468 | 2.625 | 3 | [] | no_license | from paillierlib import paillier as pal
from gmpy2 import mpz
m1 = mpz(10)
m2 = mpz(1)
m3 = mpz(0)
m4 = mpz(2000)
m5 = mpz(4000)
m6 = mpz(999)
key_pair = pal.keygen()
c1 = pal.encrypt(m1, key_pair.public_key)
c2 = pal.encrypt(m2, key_pair.public_key)
c3 = pal.encrypt(m3, key_pair.public_key)
c4 = pal.en... | true |
643dd0d66a7b89b6700508dffa173378429a5905 | cwgaldino/FI226-Magnetic-trap | /coilSimulation_exact.py | UTF-8 | 7,837 | 3.03125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Simulation of the magnetic field generated by a perfect anti-helmholtz coil.
It calculates the magnetic field in the z direction at x=0 and y=0. The coils
normal vector points in the +z direction.
"""
# %% ############## Imports ########################
import pyqtgra... | true |
e440a328cc96fe3b7260eabab8f9ea092b92d980 | FreekManders/Denovo_SNV_Analysis | /Python/annotateDANN.py | UTF-8 | 3,545 | 2.625 | 3 | [
"MIT"
] | permissive | import os
import pandas as pd
from multiprocessing import Pool as ThreadPool
import argparse
import datetime
from timeit import default_timer as timer
###Start timer
start = timer()
time = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M")
print "Start running script at: {0}".format(time)
###Parse arguments
parser = ... | true |
031359672c33f43ec95f7064a46324526e09292e | kuhung/SMP-ETST-2018 | /sentence2vec-master/train.py | UTF-8 | 1,325 | 3.046875 | 3 | [] | no_license | import pandas as pd
import re
import logging
from nltk import word_tokenize
from nltk.corpus import stopwords
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',
level=logging.INFO)
import nltk
nltk.download('stopwords')
nltk.download('punkt')
... | true |
e9d3e3c3e01c457c2dbd32159f4ba176af34baef | kumar100966/InfoExams | /models.py | UTF-8 | 2,070 | 2.8125 | 3 | [] | no_license | from flask_sqlalchemy import SQLAlchemy
from werkzeug.security import generate_password_hash, check_password_hash
db = SQLAlchemy()
#Code imported from assignment 2
#Class to model User
class User(db.Model):
id = db.Column('id', db.Integer, primary_key=True)
username = db.Column("username", db.String(50), unique... | true |
88d633ce7d4bfef2f8367dcf7ca111f4d611692b | digitalarche/haveibeenpwned_api | /pwned_api.py | UTF-8 | 11,943 | 2.8125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
###############################################################################################################
# Author: Paragonsec (Quentin) @ Critical Start
# Title: pwned_api.py
# Version: 2.0
# Usage Example: python pwned_api.py -h
# Description: This script queries the 'haveibeenpwned' API
... | true |
b2a77181f2d69ae0072bb9bb5fd3d649f969bd91 | OGKevin/ComBunqWebApp | /apiwrapper/endpoints/avatar.py | UTF-8 | 395 | 2.578125 | 3 | [
"MIT"
] | permissive | from apiwrapper.endpoints.endpoint import Endpoint
class Avatar(Endpoint):
__endpoint_avatar = "avatar"
@classmethod
def _get_base_endpoint(cls, avatar_id):
return "/%s/%s" % (cls.__endpoint_avatar, avatar_id)
def get_avatar_by_id(self, avatar_id):
endpoint = self._get_base_endpoint... | true |
e90e9ec1941e991a3faf0a95f2c4df9226b99833 | VaibhavRangare/python_basics_part1 | /PythonCollections/itemset.py | UTF-8 | 274 | 3.515625 | 4 | [] | no_license | """
Set
Unordered
Unindexed
Mutable
No Duplicates allowed
"""
items = 1,2,3
items = {1,2,3,3}
items = range(1,11)
items = {1,2,2,3,3}
items = set(range(1,10))
items = set([1,2,3])
print(type(items))
items.add(5)
for item in items:
print(item)
| true |
b8979cc2e9e86b373e334f574a2c128872325ffa | Emmanuel-lpz/CRUD | /binary_search.py | UTF-8 | 552 | 3.859375 | 4 | [] | no_license | import random
def binary_search(datos, target, bajo, alto):
if bajo > alto:
return False
medio = (bajo + alto) // 2
if target == datos[medio]:
return True
elif target < datos[medio]:
return binary_search(datos, target, bajo, medio - 1)
else:
return binary_search(datos, target, medio + 1, alto)
if _... | true |
b6af2ffc25be70f69216f6dfbcf724881eff0973 | Willzy-x/kits_experiment | /modules/vnet_parts.py | UTF-8 | 5,409 | 2.59375 | 3 | [] | no_license | import torch
import torch.nn as nn
import torch.nn.functional as F
def passthrough(x, **kwargs):
return x
def ELUCons(elu, nchan):
if elu:
return nn.ELU(inplace=True)
else:
return nn.PReLU(nchan)
# pass through
class Identity(nn.Module):
def forward(self, x):
... | true |
e860100d687a278ac409865ba5a2d48e408113d5 | imsoumen/HackerRank | /Challenges/Subsequence_Weighting.py | UTF-8 | 3,766 | 3.796875 | 4 | [] | no_license | """
Subsequence Weighting
------------------------------------
Link: https://www.hackerrank.com/contests/wissen-coding-challenge-2021/challenges/subsequence-weighting
------------------------------------
A subsequence of a sequence is a sequence which is obtained by deleting zero or more elements from the sequence.
Y... | true |
73a2903cb68d29d45a64afd6d47e6a263202d8d4 | FlipskiZ/FZRL | /src/Time.py | UTF-8 | 644 | 3 | 3 | [] | no_license | from src import Stats
class QueueEntity:
def __init__(self, entity, ticksLeft=0):
self.entity = entity
self.ticksLeft = ticksLeft
timeQueue = []
def addToQueue(entity, ticksLeft=0):
timeQueue.append(QueueEntity(entity, ticksLeft))
def removeFromQueue(i):
del timeQueue[i]
... | true |
d7af540d494a9aa643019ff64c64f6450fd9af0d | anu-coder/Basics-of-Python | /scripts/L2Q12.digiplay.py | UTF-8 | 613 | 4.34375 | 4 | [] | no_license | '''
Question: Write a program, which will find all such numbers between 1000 and 3000 (both included)
such that each digit of the number is an even number.
The numbers obtained should be printed in a comma-separated sequence on a single line.
'''
def even_digits(n: int):
n1 = str(n)
c = 0
for i in n1:
... | true |
a3ee8fe544314783a79f58f8d5ab79ae34c21290 | dobrosketchkun/drunken-bishop | /drunken-bishop.py | UTF-8 | 1,763 | 2.859375 | 3 | [
"MIT"
] | permissive | import base64
import hashlib
import string
import math
import argparse, sys
from Fingerprint import Fingerprint
def get_key_typestring(key_type):
return {
'ssh-rsa': 'RSA',
'ssh-dss': 'DSA',
'ecdsa-sha2-nistp256': 'ECDSA 256',
}.get(key_type)
def get_rsa_key_length(keyraw):
keyHe... | true |
f43b0f9ac12f3925d51747a1b206ecab23ca2525 | gabriellaec/desoft-analise-exercicios | /backup/user_340/ch28_2020_04_06_19_26_50_234171.py | UTF-8 | 68 | 2.921875 | 3 | [] | no_license | a=[]
s=0
i=0
a[i]=1/2**i
for e in a:
s+=e
i+=1
print(s)
| true |
67f4c108c57d249163d9c3698e3572cc29229a76 | barbararaquelperez/Python | /actividadespyhton3.py | UTF-8 | 212 | 3.328125 | 3 | [] | no_license | x=range(100)
range(100)
list(x)
print"pares e impares"
num=int(raw_input("introduce algun numero entero :"))
if num%2==0:
print"este numero es par"
if num%2!=0:
print"este numero es impar"
| true |
0114e153e6afae807b958b0585158be6d96b245f | lymanmcbride/tech-academy-python-projects | /html_challenge/create_html.py | UTF-8 | 2,439 | 3.28125 | 3 | [] | no_license | import tkinter
from tkinter import *
import webbrowser #necessary for launching the browser
class ParentWindow(Frame):
def __init__(self, master, *args, **kwargs):
Frame.__init__(self, master, *args, **kwargs)
self.master = master
self.master.title('Check files')
self.master.minsi... | true |
5a8a456d1fef912b6187581a16a42050a0e8cd73 | maxZimm/tictacpab | /player.py | UTF-8 | 1,245 | 3.9375 | 4 | [] | no_license |
class Player():
def __init__(self, _id):
self.name = self.getName()
self.id = _id
def getName(self):
user_inp = input('Player Name: ').strip()
user_inp = self.nameValidation(user_inp)
return user_inp
def nameValidation(self, name):
if len(name) < 3:
... | true |
eead138f1c9a639cbfc1c0f302383738c9c6e566 | green-fox-academy/Hedvegia | /week-03/day-2/15.py | UTF-8 | 313 | 3.078125 | 3 | [] | no_license | from tkinter import *
root = Tk()
canvas = Canvas(root, width='300', height='300', bg='black')
canvas.pack()
for i in range(20):
lines = canvas.create_line(0, 20+i*20, 20+i*20, 300, fill='yellow')
for i in range(20):
lines = canvas.create_line(300, 280-i*20, 280-i*20, 0, fill='orange')
root.mainloop() | true |
e028ef6deedc83a291c3d6f7682e6e0023c4ce75 | utisz86/ThinkLike | /11 Fejezet/vector.py | UTF-8 | 3,439 | 3.6875 | 4 | [] | no_license | import sys
def teszt(sikeres_teszt):
""" Egy test eredmenyenek megjelenitese. """
sorszam = sys._getframe(1).f_lineno
if sikeres_teszt:
msg = "A(z) {0}. sorban allo teszt sikeres.".format(sorszam)
else:
msg = ("A(z) {0}. sorban allo teszt SIKERTELEN".format(sorszam))
print(msg)
... | true |
d4acd9d63825045e623d8708762ead73364b69b4 | erikssod/CXpipeline | /modules/pipelines/modules/xprep_ref.py | UTF-8 | 4,269 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python3
####################################################################################
#----------------------------------CX-ASAP: xprep----------------------------------#
#---Authors: Amy J. Thompson, Kate M. Smith, Daniel J. Eriksson & Jason R. Price---#
#----------------------------Python Imple... | true |
1e2291bfc53508b9a3c3f5cb5a655df9ea1c904c | mike10004/smatterscripts | /calculation/roc.py | UTF-8 | 4,720 | 2.640625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
"""Perform receiver-operating characteristic transform on input values."""
import csv
import re
import os
import sys
import json
import errno
import logging
import _common
import calculation
from _common import predicates
from typing import Callable, TextIO, List, Any, Pattern, Dict, Sequence, ... | true |
f36dda4d5c1636619199ca6e52ca113e16ed5852 | kelvinxu/fuel | /tests/test_utils.py | UTF-8 | 536 | 2.859375 | 3 | [
"MIT"
] | permissive | import pickle
from six.moves import range
from fuel.utils import do_not_pickle_attributes
@do_not_pickle_attributes("non_pickable", "bulky_attr")
class TestClass(object):
def __init__(self):
self.load()
def load(self):
self.bulky_attr = list(range(100))
self.non_pickable = lambda x: ... | true |
be2f8810480e12a0b60d7902992bcdb38bd86843 | prashanth018/AutoEncoders | /mnist.py | UTF-8 | 6,268 | 2.515625 | 3 | [] | no_license | import os
from AutoEncoder import AutoEncoder
from VariationalAutoEncoder import VariationalAutoEncoder
from keras.datasets import mnist
import pickle
import numpy as np
import matplotlib.pyplot as plt
def load_mnist():
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.astype('float3... | true |
bce6c7421d7651d58bc094c9cda39a2f5e70f3aa | Evolutionary-Computing-2019/Juan-David-Valencia | /experiments/graph.py | UTF-8 | 1,030 | 3.25 | 3 | [] | no_license | import pandas as pd
import matplotlib.pyplot as plt
def read_data(file_name):
info = open(file_name, 'r').read()
info = list(map(lambda x: list(map(float, x.split())), info.split('\n')[:-1]))
return pd.DataFrame(info)
list_data = []
algorithms = ['haea', 'hill', 'sa', 'selfadaptation']
titles = {
... | true |
9a21747c8b71fa2792efd6244c38ff094520552a | moshegplay/moshegplay | /LABs/dictionary.py | UTF-8 | 361 | 2.609375 | 3 | [] | no_license | dict_names={"dudu":25000,"avi":30000,"itay":76000,"ortal":66000,"gal":120000}
print(dict_names)
summary=dict_names["dudu"]+dict_names["gal"]
print("The summary is: " +str(summary))
#dict_names["yoel"]=summary
#print(dict_names)
dict_names.update({"yoel":summary})
print(dict_names)
print("number of entries: " +str(len(d... | true |
76e52c510655680377d8e9786d0a6a19b1eadf1c | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/web-dev-notes-resource-site/2-content/Data-Structures/1-Python/queues/max_sliding_window.py | UTF-8 | 1,016 | 4.09375 | 4 | [
"MIT"
] | permissive | """
Given an array and a number k
Find the max elements of each of its sub-arrays of length k.
Keep indexes of good candidates in deque d.
The indexes in d are from the current window, they're increasing,
and their corresponding nums are decreasing.
Then the first deque element is the index of the largest window value... | true |
2669adb12866d5d828bf1382bfbc60c95f1d5f3c | Giallo0/PythonRepo | /Exercise/SecretMessage/SecretMessage.py | UTF-8 | 4,421 | 3.4375 | 3 | [] | no_license | import os
#*******************************************#
# DEFINIZIONE FUNZIONI #
#*******************************************#
def F0010_carica_alfabeto(dicti,r_dicti):
f = open('Alphabet.mbg','r')
for line in f:
word = ''
key = 0
lett = ''
for ch in line:
... | true |
526a211f1ce0a1e71be2a159c94d7cbb1e1e05be | ParkSeoJune/html_and_python | /python/연습문제.py | UTF-8 | 682 | 3.921875 | 4 | [] | no_license | #소음이 가장 심한 층 구하기
#공식은 0.2467 * 도로와의 거리(m) + 4.159
#층수를 출력할 때는 소수점 이하 자리는 버림(즉 정수로 출력)
#도로와의 거리를 12라고 가정
#print(int(0.2467*12+4.159))
#변수를 지정하여 50, 100, None 출력
#a,b,c=50,100,None
#print(a)
#print(b)
#print(c)
#표준 입력으로 국어, 영어, 수학, 과학 점수가 입력
#평균 점수를 출력하는 프로그램 만들기(input에서 안내 문자열 출력 X)
#단, 평균 점수를 출력할 때는 소수점 이하 자리는 버림 (... | true |
ffad9ec5194c46c5d8388bb1ddda869b83961f52 | zmbslyr/holbertonschool-higher_level_programming | /0x0B-python-input_output/12-student.py | UTF-8 | 1,250 | 3.640625 | 4 | [] | no_license | #!/usr/bin/python3
"""Module to create a student"""
class Student:
"""Student Class"""
def __init__(self, first_name, last_name, age):
"""Init method
Args:
first_name (str): First name of the student
last_name (str): Last name of the student
age (int): Age... | true |
69865937dc9c1da16c45a82cef9b017788eca713 | JuliaFEM/juliafem.github.io | /scripts/create_project_pages.py | UTF-8 | 915 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
import json
import urllib.request
__template__ = """\
---
layout: page
title: {name}
---
{description}
"""
def main(args):
url = "https://api.github.com/orgs/%s/repos" % args.organization
resp = urllib.request.urlopen(url).read()
data =... | true |
feb9a1318d86cc4e48978f85d9ae850d98af0f92 | lanl/scico | /examples/scripts/ct_astra_modl_train_foam2.py | UTF-8 | 10,883 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SCICO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
r"""
CT Training and Reconstructions with MoDL
=========================================
This example demonstrates ... | true |
ba6abe90570837200ec4893d0c0e66af9be6bd7f | ShekhRaselMasrurAhmmadNissan/URI-Online-Judge | /Beginner/1149_summing_consecutive_integers.py | UTF-8 | 300 | 3.046875 | 3 | [] | no_license | numbers = list(map(int, input().split()))
number_to_be_sum = numbers[0]
for number in range(1, len(numbers)):
if (numbers[number] > 0):
time_to_sum = numbers[number]
break
sum = 0
for number in range(number_to_be_sum, number_to_be_sum + time_to_sum):
sum += number
print(sum)
| true |
8e6c23ccc325174338f097901a43424b41c877d3 | jelkner/gis_front_and_back | /back/arl_voter_precincts/precinct_bounding_boxes.py | UTF-8 | 1,409 | 3.265625 | 3 | [] | no_license | #!/usr/bin/env python3
"""Compute bounding boxes for Arlington, Virginia voter precincts.
This script uses the osgeo module to compute the bounding boxes of the 52
polygons desribing the boundaries of the voter precincts in Arlington County,
Virginia.
Requires `Voter_Precinct <http://gisdata.arlgis.opendata.arcgis.co... | true |
a9c8655d62bc4463f45798d15826bd568fb73a4f | 3eca/ProjectClickBalls | /main.py | UTF-8 | 3,973 | 3.171875 | 3 | [] | no_license | import tkinter as tk
from random import randint, choice
WIDTH = 600
HEIGHT = 400
SCORE = 0
DELAY_TIME = 30
class Ball:
def __init__(self, canvas):
self.radius = randint(10, 90)
self.x1 = randint(self.radius, WIDTH - self.radius) - self.radius
self.y1 = randint(self.radius, HEIGHT - self.r... | true |
983959589f3e8d27adf53b9a07610c8122bdbae6 | MisaelAugusto/computer-science | /programming-laboratory-I/42bz/corredor.py | UTF-8 | 430 | 3.53125 | 4 | [
"MIT"
] | permissive | # coding: utf-8
# Aluno: Misael Augusto
# Matrícula: 117110525
# Problema: Classifica Corredor
kilometros = float(raw_input())
tempo = float(raw_input())
velocidade = kilometros / tempo
if velocidade < 10:
print "Velocidade: %.1fkm/h. Corredor amador." % velocidade
elif 10 <= velocidade <= 15:
print "Velocidade: ... | true |
73cf53c700e352b9c944286fc96106487d11e04a | rafaelperazzo/programacao-web | /moodledata/vpl_data/47/usersdata/124/16641/submittedfiles/lecker.py | UTF-8 | 436 | 3.125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import division
def lecker(lista):
c = 0
if lista[0] > lista[1]:
c = c + 1
if lista[len(lista) - 1] >lista[len(lista) - 2]:
c = c + 1
for i in range(1, n - 1, 1):
if lista[i] > lista[i + 1] and lista[i] > lista[i - ... | true |
f4f63fd7c47c78e0278cd2067334976adc0fb5f7 | freeitaly/Trading-System | /vn.trader/ctaAlgo/ctaTemplate.py | UTF-8 | 6,882 | 2.578125 | 3 | [
"MIT"
] | permissive | # encoding: UTF-8
'''
本文件包含了CTA引擎中的策略开发用模板,开发策略时需要继承CtaTemplate类。
'''
from ctaBase import *
from vtConstant import *
########################################################################
class CtaTemplate(object):
"""CTA策略模板"""
# 策略类的名称和作者
className = 'CtaTemplate'
author = EMPTY_UNICODE
... | true |
e61b19a53a480df629625f1d6652bd2073e432ea | TomBers/eko_client | /tools/keygen/eko-keygen.py | UTF-8 | 1,490 | 2.515625 | 3 | [] | no_license | import os.path
import urllib2
from baseconv import BaseConverter
from Crypto.Hash import MD5
from Crypto.PublicKey import RSA
from datetime import datetime
import time
import pickle
import os
baseconv = BaseConverter('0123456789abcdef')
def load_RSA():
if os.path.isfile('/etc/eko/prikey.pickle'):
f... | true |
28a63ce2bb96b695fa11431ffba10a7b887220de | FightForDobro/PythonAdv | /ClassWork/Lesson04/main.py | UTF-8 | 2,840 | 3.46875 | 3 | [] | no_license | # # a = tuple([1, 2])
# #
# # print(type(int))
#
# my_class = type(
# 'ClassExample',
# (),
#
# {
# 'attr_1': 100,
# 'attr_2': 200,
# 'get_attr_1': lambda self: self.attr_1, # Место селф может быить что угодно
# 'get_attr_2': lambda self: self.attr_2,
#
# }
# )
#
#
# obj... | true |
b37a0a2c663bfc4da21ada313ee85cc6b2be25cd | Snbig/SimpleMTProto2 | /Oracle.py | UTF-8 | 2,137 | 2.625 | 3 | [] | no_license | import tgcrypto
from KDF import KDF
import hashlib
import random
class Oracle:
def __init__(self, secret_key):
self.secret_key = secret_key
self.msg_key = None
@staticmethod
def pad(message):
block_size = (len(message) + 16) - (len(message) % 16)
random_pad_length = random... | true |
19b6585caea96bfefb015189beb83c1cabd986c0 | krupagaliya/basic_ml_projects | /linear_multi_reg.py | UTF-8 | 1,169 | 3.1875 | 3 | [] | no_license | import numpy as np
x1 = [0.18 ,0.89]
x2 = [1.0, 0.26]
x3 = [0.92 ,0.11]
x4 = [0.07 ,0.37]
x5 = [0.85 ,0.16]
x6 = [0.99, 0.41]
x7 = [0.87, 0.47]
x = [x1,x2,x3,x4,x5,x6,x7]
y = [[109.85],[155.72],[137.66],[76.17],[139.75],[162.6],[151.77]]
X = np.array(x)
Y = np.array(y)
iters = 2000
alpha = 0.05
#need... | true |
de3b44a2619b8147b5dc80b1632ce6c57ba2d649 | np179/Team2_0 | /src/LCpackage/test/test_LCpackage.py | UTF-8 | 4,308 | 2.640625 | 3 | [
"MIT"
] | permissive | import pytest
import numpy as np
import pandas as pd
import statistical as st
@pytest.mark.parametrize('df_in, thresh, df_out',
[
(pd.DataFrame(
data={'col1': [1, 1, 1, 1],
'col2': [1, 2, ... | true |
a90e0a833691499d309a89a9677fefa2f705f424 | m0nx73r/hacktober2020 | /printit.py | UTF-8 | 51 | 2.859375 | 3 | [] | no_license | x = input("Enter something : ")
def(x):
print(x)
| true |
f1f2a0295102ee52f13c083fde2494119f33286c | AnalyticsAutomated/commandRunner | /tests/test_localRunner.py | UTF-8 | 5,776 | 2.515625 | 3 | [] | no_license | import unittest
import os
import stat
from unittest.mock import patch
from commandRunner.localRunner import *
# TODO: Fixtures and actual system calls aplenty here, could all be mocked if
# I had time to fix all that. At the moment we just mock the time consuming
# calls
class localRunnerTestCase(unittest.TestCase)... | true |
964abd2371c2a7dd9621ef68e5e6d65c52dbdacd | luiz158/Dica_Python_Linkedin | /15_captura_IP/captura_IP.py | UTF-8 | 213 | 3.53125 | 4 | [] | no_license | import socket
# Host
host = 'google.com'
# Recebendo IP do host
ip = socket.gethostbyname(host)
# Exibir resultado
print(f"O IP do Host '{host}' é : {ip}")
# Saida: O IP do Host 'google.com' é : 216.58.202.142
| true |
f58b7cd5a06bc43398d8e6dff17025921a10e4b2 | mudlark54/Unioverse | /GIT/19_play_for_keeps.py | UTF-8 | 2,879 | 3.734375 | 4 | [] | no_license | #------------------------------------
# read the whole file into a list
# read EVERY OTHER line, if it has the _R, then print out the NEXT Line
fout1 = open("output1.txt", 'w') #open file for writin
with open("Pfile.fas") as fin1:
lines = fin1.readlines() #reads all of the lines into a list []
for i in range(0, len... | true |
e647d54f74997e186f5ad229b686eeb0642e42f3 | riyazwalikar/shells | /websocketshell/ws_server/server_wsh.py | UTF-8 | 880 | 2.640625 | 3 | [] | no_license | import subprocess
def web_socket_do_extra_handshake(request):
#if request.ws_origin == 'http://localhost':
# return
#raise ValueError('Unacceptable origin: %r' % request.ws_origin)
pass # Always accept. # Can someone add this?
def web_socket_transfer_data(request):
while True:
line = req... | true |
6d01fd355a787a8b7c2aa20e61fb37f86780771a | LYC941012/repository | /ganji_thread/ganji_Thread.py | UTF-8 | 4,294 | 2.9375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import threading
import urllib2
import csv
import Queue
from lxml import etree
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
crawl_Exit = False
parser_Exit = False
class crawl_Tread(threading.Thread):
def __init__(self, treadName, url_Queue, page_Queue):
... | true |
56bb19a0d033e986d082de2c46a1fba0df3d74c3 | ChahidAbderrazak/CTimageSegmentation-Unet | /data_prep/make_dataset.py | UTF-8 | 5,811 | 2.515625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 12 17:55:52 2021
@author: Abderrazak Chahid
"""
import sys
import os
import numpy as np
import SimpleITK as sitk
import gzip
import shutil
from sklearn.model_selection import train_test_split
from data_prep import *
import pickle
## Routines
def ch... | true |
08efce141f0f8fe1f7f666708e19b0e95d7e022c | shdb1/PythonWorks | /com/shadab/python/basics/program2_operators.py | UTF-8 | 917 | 3.953125 | 4 | [] | no_license | '''
Created on Nov 9, 2017
@author: Mohammad Shadab
'''
print("Python contains following operators !!!")
print(" 1) Arithmetic Operators \n \
2) Assignment Operators \n \
3) Comparison Operators \n \
4) Logical Operators \n \
5) Bitwise Operators \n \
6) Membership Operators \n \
7) Identity Operators");
print("Let... | true |
014dbbe14c138ebb1f5f9344e43b5bd357b33ee4 | pedro1hen1/treinamento | /lista_02/ex02.py | UTF-8 | 292 | 4.1875 | 4 | [] | no_license | #Exercicio 02
# Faça um programa que permita ao usuário digitar o seu nome
nome=input("Digite seu nome ")
#Converter as letras para maiscula
n=nome.upper()
#Em seguida mostre o nome do usuário de trás para frente
print("O nome -> %s de trás para frente fica -> %s " % (n, n[::-1]))
| true |
9ab40669e2748fd56cb41cdc8d56e0cd230c8acf | chiradeep1310/amfoss_task | /Task 2/hackarank/diagonal_difference.py | UTF-8 | 550 | 3.578125 | 4 | [] | no_license | def main():
n = int(input('the number and columns are '))
arr = []
for i in range(n):
x = list(map(int,input().split()))
arr.append(x)
print(arr)
print(array(arr,n))
def array(arr,n):
sum1 = 0
sum2 = 0
for k in range(n):
for j in range(n):
... | true |
4a1eae6d0e10eafdfba7c6bd6a1fddc0308cc259 | Hahn9/Programming | /A08.py | UTF-8 | 821 | 3.78125 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[30]:
script01 = input("Enter the first script name: ")
script02 = input("Enter the second script name: ")
output = input("Enter output file name: ")
def counter_py(script01, script02, output):
with open(script01, "r") as f1:
char1 = f1.read()
char1 = ""... | true |
20f23fc3501b7ea3c9edecc3afdb0797b6ec2f96 | ViliamVadocz/Misc | /curves/cubic_splines.py | UTF-8 | 1,256 | 3.421875 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
def cubic_spline(points, s, n : int):
t = np.linspace(0, 1, n)[:, np.newaxis]
x = points[:, 0]
x1 = x[:-1]
x2 = x[1:]
s_x = s[:, 0]
s1_x = s_x[:-1]
s2_x = s_x[1:]
y = points[:, 1]
y1 = y[:-1]
y2 = y[1:]
s_y = s[:, 1]
s... | true |
6bc5dd47f6af7ce686000c7b53b1013953f0c183 | NickFleece/CSI4106_Reddit_Project | /ML_test.py | UTF-8 | 3,189 | 3.171875 | 3 | [] | no_license | import csv
import pickle
from sklearn.feature_extraction.text import CountVectorizer
import nltk
###
### This file tests our models on the tweet data at: "data/testing_tweets.csv" & "data/testing_tags.csv"
### It prints out the precision, recall, and accuracy
###
data = {
"testing_tags": [],
"testing_tweets":... | true |
762331a76df0540395cdba9a98c220a09f893918 | madeleinehuish/magic_util | /lib/old/getNumberOfCardsInSet.py | UTF-8 | 790 | 2.53125 | 3 | [] | no_license | # this can easily be pushed to a file to create a javascript object
from mtgsdk import Card, Set
# sets = Set.all()
# print('export default [')
# for set in sets:
# print('{ set: "')
# print(set.code)
# print('", setName: "')
# print(set.name)
# print('"},')
#
# print(']')
# Get all Sets
# Get a... | true |
228ae00c8cfeaae3ef3950bdc2b24cbd1293f4bd | pedr0diniz/cevpython | /PythonExercícios/ex022 - Analisador de Textos.py | UTF-8 | 1,379 | 4.625 | 5 | [] | no_license | # DESAFIO 022 - Crie um programa que leia o nome completo de uma pessoa e mostre:
#O nome com todas as letras maiúsculas;
#O nome com todas as letras minúsculas;
#Quantas letras ao todo (sem considerar espaços);
#Quantas letras tem o primeiro nome.
nome = str(input('Digite seu nome completo: '))
M = nome.upper()
m = ... | true |
eb79c21a47c075b32c47855da93b838e3cbfb61b | ponkotsuMEN/AtCoder | /ABC/188/b.py | UTF-8 | 193 | 3.109375 | 3 | [] | no_license | import numpy
n = int(input())
a = numpy.array(list(map(int, input().split())))
b = numpy.array(list(map(int, input().split())))
if numpy.dot(a, b) == 0:
print("Yes")
else:
print("No")
| true |
6a1a62f2f6ae66c3bad7361d42e63b6b6273d581 | hoodielive/pysizes | /newstuff.py | UTF-8 | 180 | 3.34375 | 3 | [] | no_license | egregori = [ 911, 404, 187, 28 ]
for hex in egregori:
print(hex)
count = 3
while count > 0:
print('Howdy There ladies and gents: ', count)
count -= 1
print('Boom!')
| true |
5076c5130f8ab5ddd5f47f9612b361d484d476c2 | bostonbell/MMapsAPI | /app.py | UTF-8 | 5,476 | 2.546875 | 3 | [] | no_license | """Starting point of the application. Maps resources to endpoints and runs the application."""
# Standard Library Utilities
import json
# Flask Stuff
from flask import Flask, Response
from flask_restful import Api
from flask_swagger_ui import get_swaggerui_blueprint
from flask_cors import CORS
from flask_httpauth imp... | true |
38871e7f09be7c8d37c00742c07dbac736906d8a | AICDEV/rest-api-fuzzer | /lib/Randomness.py | UTF-8 | 1,782 | 2.578125 | 3 | [] | no_license | import random
import string
import jwt
import datetime
from datetime import datetime, timedelta, date
def getRandomMail():
randomMail = getRandomString(getRandomNumber()) + '@' + getRandomString(getRandomNumber()) + '.' + getRandomDomain()
return randomMail
def getRandomDomain():
return ''.join(random.c... | true |
e96e92bb4a1c892dbbf941787905edd476424173 | john-waczak/dynein_walk | /scripts/bb_energy_distribution.py | UTF-8 | 8,152 | 2.65625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../data")
import importlib
params = importlib.import_module("params")
eq_in_degrees=True
def spring_energy(theta, theta_eq, c): #domain angle, equilibrium angle, spring constant
"""
Calculate the Hooke's law energy for the spring... | true |
4c1ccb89e78ad0d31597ec1d7746f32e9bbe046a | ahlusar1989/various | /MSMQ.win32com.py | UTF-8 | 1,993 | 2.859375 | 3 | [] | no_license | ###########################################
## Microsoft Messaging Queue (MSMQ) Examples
###########################################
############################################
## Example #1: Write to a private Queue
############################################
import win32com.client
import time
qinfo=win32com.clie... | true |
322e2778f1ed8f902c874358829bd57768447191 | justin-hackin/play-svg | /scripts/concentricStripeBox.py | UTF-8 | 1,022 | 3.25 | 3 | [] | no_license | """creates a box in a box recursively, with alternating black and white fills to create a nested rectangle pattern"""
from playsvg.document import *
from playsvg.element import *
from playsvg.path import *
import os
import string
def makeCentredBox(docu, size):
boxPath = PathData().moveTo(Point(size, size)).\
... | true |
7b3e2bbbb7a6bbe5b439a56471c4d8f9b240f298 | chenhaoxxx/pythonProject1 | /prac9/sort_files_1.py | UTF-8 | 552 | 3.3125 | 3 | [] | no_license | """sort files in FilesToSort- 1"""
import os
import shutil
FOLDER_TO_SORT = 'FilesToSort'
def main():
os.chdir('..')
os.chdir(FOLDER_TO_SORT)
files_to_sort = [f for f in os.listdir('.') if os.path.isfile(f)] # ignores folders
for filename in files_to_sort:
file_extension = filename.split('.'... | true |
054cf8235027e01dd58e16fd08f2f57b25470ede | alexpriem/heatmapr | /examples/build_exampledata.py | UTF-8 | 4,299 | 2.75 | 3 | [] | no_license | from scipy import misc
import sys
import datetime
from collections import Counter
# tricolor.png is een 500x500 png
p = misc.imread('data\\tricolor.png')
s = misc.imread('data\\shapes.png')
def example_split1(f):
f.write('x,y,color1,color2\n')
cnt=Counter()
for i in range(0,500):
for j in range... | true |
0fbc24b6094ca3b0e851b2d95a4864c023580c58 | lunardog/ssd_keras | /convert_annotations.py | UTF-8 | 925 | 2.546875 | 3 | [
"MIT"
] | permissive | import os
import json
annotation_dir = './annotations'
json_files = [f for f in os.listdir(annotation_dir) if f.endswith('.json')]
region_data = {}
for json_file in json_files:
ann_data = json.load(open(os.path.join(annotation_dir, json_file), 'r'))
# print(ann_data)
# convert regions
width, height ... | true |
7a85c0703a2681eb74122541fe8db7475988caa1 | xyphanajay/multi_projection | /aes.py | UTF-8 | 2,588 | 2.8125 | 3 | [] | no_license | import base64
import os
from Crypto.Cipher import AES
from Crypto import Random
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.fernet import Fernet
password_provided = "passwo... | true |
31181b2edf30eef65e0abcc9e9bb977746eed076 | Deblish/code-generator | /lector.py | UTF-8 | 362 | 2.859375 | 3 | [] | no_license | #obtengo n
#f = open("apuntador.txt", "r")
#apuntador = int(f.read())
#f.close()
#try:, obtengo generado(n)
#codigo = linecache.getline('generados.txt', apuntador)
#print(codigo)
#exception: poner
#siguiente
#f = open("apuntador.txt", "w")
#f.write(str(apuntador+1))
#f.close()
#anterior
#f = open("apuntador.txt", "w... | true |
cbef26a1fa1efb64319028e8ec8435a93657afb0 | Webb-balson/30DaysOfPython | /day_8/exe.py | UTF-8 | 145 | 3.078125 | 3 | [] | no_license | dog = {}
print(type(dog))
print(dog)
dog['name']='pete'
dog['color']='black'
dog['legs']=4
dog['skills']=['a','b','c']
print(dog)
print(len(dog)) | true |
09a8284ddaa539c5948c068ac3542d13a7a3b355 | rohit98077/mis2 | /src/repos/outagesRepo.py | UTF-8 | 1,796 | 2.859375 | 3 | [] | no_license | from typing import List, Tuple, TypedDict
import cx_Oracle
class Outages(TypedDict):
columns: List[str]
rows: List[Tuple]
class OutagesRepo():
"""Repository class for outages data of application"""
localConStr: str = ""
def __init__(self, dbConStr: str) -> None:
self.localConStr = dbConStr... | true |
4c9483e78671ea910fd76a5dfefdc802ccd2d01e | Grahack/pypsi | /pypsi/commands/tail.py | UTF-8 | 4,946 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #
# Copyright (c) 2014, Adam Meily
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the ... | true |
8aa3b5ef461fb70fe25990bd746059409db2f61d | OpenBEL/resource-generator | /gene_scaffolding.py | UTF-8 | 5,342 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
import datetime
import argparse
import os
from string import Template
from bel_functions import bel_term
""" Generates Gene Scaffolding BEL script document used in Phase III.
Given the urls for gene/protein domain .belns files, uses the
encodings to generate transcribedTo and translatedTo BEL s... | true |
a003a53439daec26c51fd5d939b17fa151112a3d | KennedyAlison/metCS521-termproject | /TERM PROJECT - Jira Analysis.py | UTF-8 | 11,387 | 3.234375 | 3 | [] | no_license | from datetime import datetime
from pandas._testing import assert_frame_equal
import pandas as pd
class Jira_Analysis:
"""
Construct a Jira Analysis object with Epic, Feature, and Dependency Data
"""
def __init__(self, epics=None, features=None, dependencies=None):
self.epics = str(epics)... | true |
9c9fc8b263d4b414c9b3eb2c05191ab92f115e3b | zyk930/leetcode | /010_regular-expression-matching.py | UTF-8 | 1,887 | 3.828125 | 4 | [] | no_license | #!/usr/bin/env python
# _*_coding:utf-8 _*_
#@Time :2019/1/12 20:23
#@Author :ZYK
#@FileName: 010_regular-expression-matching.py
'''
给定一个字符串 (s) 和一个字符模式 (p)。实现支持 '.' 和 '*' 的正则表达式匹配。
'.' 匹配任意单个字符。
'*' 匹配零个或多个前面的元素。
匹配应该覆盖整个字符串 (s) ,而不是部分字符串。
说明:
s 可能为空,且只包含从 a-z 的小写字母。
p 可能为空,且只包含从 a-z 的小写字母,以及字符 . 和 *。
示例 1:
输... | true |
d10e388e23a260df0da7429aa90e6b7222ee0435 | Sergeymonstrik16/PskovGorshkov | /3.py | UTF-8 | 3,814 | 3.359375 | 3 | [] | no_license | import copy
import pygame
import random
class Board:
def __init__(self, width, height):
self.width = width
self.height = height
self.board = [[0] * width for _ in range(height)]
self.left = 10
self.top = 10
self.cell_size = 30
def set_view(self, left, top, cel... | true |
1109dedb91c0fb077c00d950f7525da43a238540 | srjoglekar246/TensorFlow-Examples | /som.py | UTF-8 | 9,155 | 3.328125 | 3 | [
"MIT"
] | permissive | import tensorflow as tf
import numpy as np
class SOM(object):
"""
2-D Self-Organizing Map with Gaussian Neighbourhood function
and linearly decreasing learning rate.
"""
#To check if the SOM has been trained
_trained = False
def __init__(self, m, n, dim, n_iterations=100, alpha=None,... | true |
a10340c1755d70fe3a784e80e1103a764bdee9ef | zmlabe/StratoVari | /Scripts/calc_SSWEvents_WACCM.py | UTF-8 | 6,564 | 2.578125 | 3 | [
"MIT"
] | permissive | """
Composite SSW events for SC-WACCM4
Notes
-----
Author : Zachary Labe
Date : 15 October 2019
"""
### Import modules
import numpy as np
import cmocean
import matplotlib.pyplot as plt
import scipy.stats as sts
### Directories
directoryfigure = '/home/zlabe/Desktop/'
def readData(exp):
"""
Read in... | true |
f4f1954c6d942e0ae2db6bfd40daaa7b99ab6a70 | zhaoqi94/The-Boomsday-Project | /cluster/test_dbscan.py | UTF-8 | 4,581 | 2.859375 | 3 | [] | no_license | # K-means无法聚类非凸数据,而DBSCAN可以
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
plt.figure(figsize=(10,6))
X1, y1=datasets.make_circles(n_samples=5000, factor=.6,
noise=.05)
X2, y2 = datasets.make_blobs(n_samples=1000, n_features=2, centers=[[1.2,1.2... | true |
f3c9c1afd84b678126bceb7c9732e5e8a2ac14f9 | ArshGoyal25/Eyantra | /6338_Task4/Test_Codes/codes_from_arnav_and_sujith/structure_test.py | UTF-8 | 1,090 | 2.859375 | 3 | [] | no_license | import serial
import time
class AntHill:
def __init__(self, t1, n, s1, s2):
self.type = t1
self.number = n
self.service1 = s1
self.service2 = s2
b={'5','46','195','124'}
def getinfo(c):
"""s = serial.Serial("/dev/ttyUSB0", 9600,
parity=serial.PARITY_NON... | true |
f5c0fd50645128d57156f64bef1f3704b73ed11c | Heringer-Epson/routines_DTD | /analyses/plot_CMD.py | UTF-8 | 6,685 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import MultipleLocator
mpl.rcParams['mathtext.fontset'] = 'stix'
mpl.rcParams['mathtext.fontset'] = 'stix'
mpl.rcParams['font.family'] = 'STIXGeneral'
fs = 36.
c = ['#fdae61', '... | true |
a75a4d05edde60baf2bb8bd8a3269dd9176ecfac | Chase2816/Voice-wake-up | /Voice-wake-up/test.py | UTF-8 | 5,785 | 2.609375 | 3 | [] | no_license | import tensorflow as tf
import wave
import os
import numpy as np
# class Sample:
#
# def __init__(self,path):
#
# self.path=path
# files=[]
# ys=[]
# for file in os.listdir(self.path):
# files.append(os.path.join(self.path,file))
# ys.append(i... | true |
424e817238933bb4f0f66e1f82f3cbfab66c6d49 | emanoelmlsilva/PycharmProjects | /Livropython/ex3.11.py | UTF-8 | 102 | 3.078125 | 3 | [] | no_license | #Exemplo de composiçao com numeros decimais
print('%5f' % 5)
print('%5.2f' % 5)
print('%10.5f' % 4) | true |
37cfe79275fea3013ac45e3ed5ffeb4a07c8a036 | rakeshku93/Python-Mini-Projects | /regularExpression/detectStrongPassword.py | UTF-8 | 1,730 | 3.375 | 3 | [] | no_license | import os
import re
import sys
def detect_password_stregth(passwrd="Regex@09!"):
"""This function detects whether a given password is strong or not."""
print("\nTesting for password:", passwrd)
if len(passwrd) >= 8:
digitRegex = re.compile(r"\d+")
digitMatchObject = dig... | true |
f45f91a0ae7c4003c943c9ec989273ff425b9f86 | busrasavran/Alistirma1 | /Alıştırma 1.2.py | UTF-8 | 214 | 3.28125 | 3 | [] | no_license | sum=0
for n in range(1,10**4,1): #Sonsuzu nasıl ifade edebileceğimi bilemedim ama büyük bir sayı yazınca pi'nin yaklaşık değerini verdi
sum+= 1/n**2
sum=float(sum)
print((6*sum)**(1/2))
| true |
21bf93e840d98baf3a0710aead605613e6ad985b | aguscoppe/ejercicios-python | /TP_4_Estructura_iterativa/TP4_EJ30.py | UTF-8 | 149 | 3.90625 | 4 | [] | no_license | # EJERCICIO 30
n = int(input("Ingrese un número natural: "))
i = 0
resultado = 0
while i < n:
resultado = 3**i
print(resultado)
i += 1 | true |
553aa56ddd35212a02f3f5839838608a9169ec73 | sharveka/BOJ_Exercise | /Sorting/11728_배열합치기.py | UTF-8 | 198 | 2.859375 | 3 | [] | no_license | import sys
input=sys.stdin.readline
n, m=map(int,input().split())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
a.extend(b)
a.sort()
for datum in a:
print(datum, end=' ') | true |
f32dda7b7a6e02000aad2775245a7246ebc6a5d1 | bsrjy/Python-Machine-Learning | /example.py | UTF-8 | 3,737 | 2.90625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 24 15:45:00 2017
@author: dell
"""
import numpy as np
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import AdaBoostRegressor
from sklearn import datasets
from sklearn.metrics import mean_squared_error, explained_
variance_score
from sk... | true |
9f3ad2c01b35928f85ce716382c1b1f46fff7128 | hoangph3/typingdna-trx-wallet | /with-typingdna/typingdna.py | UTF-8 | 1,232 | 2.703125 | 3 | [
"MIT"
] | permissive | import base64
import hashlib
import requests
class TypingDNA:
def __init__(self, apiKey, apiSecret):
self.apiKey = apiKey
self.apiSecret = apiSecret
self.base_url = "https://api.typingdna.com"
authstring = f"{apiKey}:{apiSecret}"
self.headers = {
"Authorization... | true |
620540162b97a6a126433929474100d64fac246f | mirarifhasan/PythonLearn | /module_execute.py | UTF-8 | 303 | 3.125 | 3 | [] | no_license | import datetime
import module
# import module as m
# from module import greeting
print(module.greeting("Arif"))
name = module.person['name']
print('\n' + name)
print()
x = datetime.datetime.now()
# x = datetime.datetime(2020, 5, 17)
print(x)
print(x.year)
print(type(x.year))
print(x.strftime("%A"))
| true |
7c70c31c25a0f16dcac31ffd2288196c2a69d586 | Uran198/new_project_without_name | /local_feature.py | UTF-8 | 589 | 2.5625 | 3 | [] | no_license | import cv2
import numpy as np
def do_it(im1, im2):
orb = cv2.ORB_create()
m = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck = True)
kp1, desc1 = orb.detectAndCompute(im1, None)
kp2, desc2 = orb.detectAndCompute(im2, None)
matches = m.match(desc1, desc2)
matches = sorted(matches, key=lambda x:x.distance)
res = cv2.... | true |
d5d80bafc9d112aa70527b663084e1a1401d20b2 | Arielliu3124/drl4rec-thesis | /evaluation/save_callbacks.py | UTF-8 | 3,601 | 2.65625 | 3 | [] | no_license | import csv
import logging
import pickle
from collections import deque, Counter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from environments.recommendation_env import ReturnStateTuple
from util.helpers import flatten
logger = logging.getLogger(__name__)
class PredictionSaver:
def __i... | true |
52a8a4a560a107941c772a13c962a6594c89354a | matsengrp/vampire | /vampire/germline_cdr3_aa_tensor.py | UTF-8 | 1,927 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | import pandas as pd
import numpy as np
def aa_encoding_tensors(germline_cdr3_csv, aa_order, v_gene_list, j_gene_list, max_cdr3_len):
"""
Build tensors that one-hot-encode the germline sequences that extend into the CDR3.
V genes are left-aligned, while J genes are right-aligned.
"""
aa_list = list... | true |
30debcb3894b2bc2521cb65ad73c0f8d57f19288 | 527088995/s-analysetooldemo | /Browser.py | UTF-8 | 4,054 | 2.578125 | 3 | [] | no_license | from selenium import webdriver
from bs4 import BeautifulSoup
from SearchEngine import EngineConfManage
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import hashlib
import time
import xlwt
class Brow... | true |
a744cdff9b2ffa69cb48c41fc032bffc82309b4e | Mike030668/EvolutionaryComputation | /EvolutionaryComputation/GeneticAlgorithms/constrained.py | UTF-8 | 14,353 | 3.578125 | 4 | [] | no_license | from EvolutionaryComputation.util import *
class ConstrainedProblem:
"""Genetic Algorithm for Constrained Optimization Problems
ConstrainedProblem is an algorithm that works by utilizing relative fitness
instead of raw fitness. Relative fitness is computed by examining how many
times the ... | true |
b2e3912f6ac5803551db196dc5553da8ce73a751 | Dennis-Cao/predictitProfitGraph | /graphtool.py | UTF-8 | 1,679 | 3.171875 | 3 | [] | no_license | import csv
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.ticker as ticker
import sys
if(len(sys.argv) != 2):
print("Incorrect argument. Please use the following format:")
print("python graphtool.py (Insert Trade History File Here, no parenthesis)")
... | true |
445040cdada4744229c15db9dd5c1dc8d7738832 | minghao2016/biopython | /Bio/_py3k/__init__.py | UTF-8 | 6,112 | 2.609375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-biopython"
] | permissive | # Copyright 2010-2018 by Peter Cock. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Python 3 compatibili... | true |