seq_id
stringlengths
4
11
text
stringlengths
113
2.92M
repo_name
stringlengths
4
125
sub_path
stringlengths
3
214
file_name
stringlengths
3
160
file_ext
stringclasses
18 values
file_size_in_byte
int64
113
2.92M
program_lang
stringclasses
1 value
lang
stringclasses
93 values
doc_type
stringclasses
1 value
stars
int64
0
179k
dataset
stringclasses
3 values
pt
stringclasses
78 values
157055733
import cv2 # 导入人脸级联分类器引擎,'.xml'文件里包含训练出来的人脸特征,cv2.data.haarcascades即为存放所有级联分类器模型文件的目录 face = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') eye = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_eye.xml') smile=cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_s...
lijuncheng1993/FaceRecognition
摄像头_人脸识别+人眼识别.py
摄像头_人脸识别+人眼识别.py
py
2,327
python
zh
code
0
github-code
1
34100393197
frase = input("Ingrese una palabra/frase").lower() frase = frase.split() def prueba(): cont=0 dop = [] heterograma = True for n in range(len(frase)): for j in range(len(frase[n])): if frase[n][j] not in dop: dop.append(frase[n][j]) else: ...
brunopesta/Python
Practica/Practica2/ej7p2.py
ej7p2.py
py
456
python
es
code
0
github-code
1
37212994808
from tkinter import* import sqlite3 from PIL import Image,ImageTk from tkinter import messagebox from course import CourseClass from student import StudentClass from exam import ExamClass from st_exam import ScoreClass from result import ResultClass class RMS: def __init__(self,root): self.root=r...
asthavj/EQUINOX-The-Beginners
dashboard.py
dashboard.py
py
4,743
python
en
code
0
github-code
1
28631082334
import os import re import time t = int(time.time()) pat = '-v=[0-9]+' css_list = os.listdir('../static/stock-css') js_list = os.listdir('../static/stock-js') for i in css_list: new_name = re.sub(pat, f'-v={t}', i) os.rename(f'../static/stock-css/{i}', f'../static/stock-css/{new_name}') for ...
cncherisher/cjb-mystock
code/vol_renew.py
vol_renew.py
py
773
python
en
code
0
github-code
1
33805117197
#%% # imports import time from sklearn.datasets import load_sample_image import faimg as fg import numpy as np import random import matplotlib.pyplot as plt #%% # Tests for Image class: china = load_sample_image("china.jpg") imgProc = fg.ImageProcessor(china) # %% # Gini index y = [1, 1, 1, 1, 2, 32, 3, 12, 312, 31...
SamuelJosse/FAIMG
faimgTest.py
faimgTest.py
py
6,946
python
en
code
0
github-code
1
23395645622
"""visit_score Revision ID: 5bab531b457a Revises: e455d34da812 Create Date: 2022-05-22 20:03:01.685579 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '5bab531b457a' down_revision = 'e455d34da812' branch_labels = None depends_on = None def upgrade(): # ##...
Nikita-Filonov/visits_api
migrations/versions/5bab531b457a_visit_score.py
5bab531b457a_visit_score.py
py
661
python
en
code
3
github-code
1
44050740772
from rest_framework import serializers from .models import * from django.contrib.auth import get_user_model, authenticate class DynamicFieldsModelSerializer(serializers.ModelSerializer): """ A ModelSerializer that takes an additional `fields` argument that controls which fields should be displayed. ""...
NTNU-IndEcol/db_project_indecol
backend/app_indecol/serializers.py
serializers.py
py
3,755
python
en
code
0
github-code
1
12784989042
import RPi.GPIO as GPIO import time pins = (14, 15, 18) # 빨강은 14핀, 초록은 15핀, 파랑은 18핀 지정 def led(pins, color, t): RGBs = ( (1,1,1), # 하양색 (1,0,0), # 빨강색 (0,1,0), # 초록색 (0,0,1), # 파랑색 (0,1,1), # 청록색 (1,0,1), # 보라색 (1,1,0), # 노랑색 ) GPIO....
qkrtiger/Python
라즈베리파이/rgb_led.py
rgb_led.py
py
810
python
en
code
0
github-code
1
72105720995
################################################################################ # def CyclicSeqFound(happySumList): print( happySumList) #iterate until first 4 is found #iterated for pattern "4,16,37,58,89,145,42,20,4" notHappyPattern=[4,16,37,58,89,145,42,20,4] startIndex = happySumList...
carloserodriguez2000/HappyNumbers
test.py
test.py
py
1,056
python
en
code
0
github-code
1
36855948409
x=120 y=60 radius = 12 def setup(): size(240, 120) ellipseMode(RADIUS) def draw(): global radius background(204) d = dist(mouseX, mouseY, x, y) if d < radius: radius += 1 fill(0) else: fill(255) ellipse(x, y, radius, radius) saveFrame("frames/Sa...
dtolonen/Getting_started_with_Processing.py_book
Chapter_5_Response/example_5_14_the_bounds_of_a_circle/example_5_14_the_bounds_of_a_circle.pyde
example_5_14_the_bounds_of_a_circle.pyde
pyde
348
python
en
code
0
github-code
1
38895237497
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time # fo...
alec-horwitz/BlubeamDownloader
BluebeamDownloader.py
BluebeamDownloader.py
py
19,705
python
en
code
0
github-code
1
20353139946
import json import sys import uuid from dataclasses import dataclass from datetime import date, datetime from decimal import Decimal from pathlib import Path from typing import ( Any, Dict, FrozenSet, Iterable, Iterator, List, Mapping, Optional, Tuple, Union, ) from urllib.parse ...
delta-io/delta-rs
python/deltalake/writer.py
writer.py
py
19,851
python
en
code
1,524
github-code
1
39509436948
from collections import deque clock = deque([12, 3, 6, 9]) N = int(input()) N = (N//90)%4 for i in range(N): clock.rotate(1) while clock: print(clock.popleft(), end=" ") print(clock.pop(), end=" ")
choikeunyoung/algorithm
SWEA/D2/원형시계돌리기/원형시계돌리기.py
원형시계돌리기.py
py
214
python
en
code
1
github-code
1
12764354148
#!/usr/bin/env python3 import sys, subprocess, gzip, os, shutil, zipfile from os.path import join, relpath, abspath inAppPath = sys.argv[1] # "air/myapp.air" inTargetFile = sys.argv[2] # "localserver/app/testharness.tivoipkg" tempDir = "tivo-package_temp" if sys.platform == "win32": # Windows-specific code cmd_c...
muton/tivo_flash_packager
tivo-package.py
tivo-package.py
py
3,276
python
en
code
0
github-code
1
39329634660
d={} nd={} n=int(input("enter the no. of students")) for x in range(n): a=int(input("enter admission no")) b=input("enter name") c=input("enter class and section") e=input("enter stream") d[a]=b,c,e print(d) find=int(input("enter roll no to be searched")) for c in d: print("adm no....
barkhaaroraa/python-codes
dict loop.py
dict loop.py
py
1,063
python
en
code
1
github-code
1
45018635051
import cortexpy.__main__ from Bio import SeqIO import os from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from benchmark.commands import CortexpyCommandBuilder, MccortexCommandBuilder CHROM_GRAPH = 'fixtures/yeast/NC_001133.9.1kbp.ctx' CHROM_GRAPH3 = 'fixtures/yeast/NC_001133.9.c3.1kbp.ctx' CHROM_GRAPH_16...
winni2k/cortex_tools_benchmark
benchmark/test_unit/test_command/test_traverse/test_yeast_contig.py
test_yeast_contig.py
py
1,713
python
en
code
0
github-code
1
36801537781
from sentry.notifications.types import ( FineTuningAPIKey, NotificationSettingTypes, NotificationSettingOptionValues, UserOptionsSettingsKey, ) class UserOptionValue: # 'workflow:notifications' all_conversations = "0" participating_only = "1" no_conversations = "2" # 'deploy-emails...
The-Actual-Damien/https-github.com-getsentry-sentry
src/sentry/notifications/legacy_mappings.py
legacy_mappings.py
py
5,578
python
en
code
0
github-code
1
30058226860
import numpy import ammonia1 import system_aqua1 import scipy.optimize import aqua_chiller_spec1 import pandas def saturate(x, bottom=-numpy.inf, top=0): a_bottom = numpy.empty_like(x) a_top = numpy.empty_like(x) a_bottom.fill(bottom) a_top.fill(top) return numpy.minimum(a_top, ...
nfette/openACHP
src/optimize_aqua.py
optimize_aqua.py
py
6,768
python
en
code
8
github-code
1
75166301153
import pickle import time from absl import app, flags from utils.graphwave.graphwave import * # flags FLAGS = flags.FLAGS flags.DEFINE_integer('emb_dim', 64, 'Embedding dimension.') flags.DEFINE_integer('max_seq', 100, 'Max length of cascade sequence.') flags.DEFINE_integer('num_s', 2, 'Number of s for sp...
Xovee/ccgl
src/gene_emb.py
gene_emb.py
py
10,689
python
en
code
25
github-code
1
813294676
from torchvision import transforms from PIL import Image import numpy as np import os from .PreTrainingDataset import PreTrainingDataset class TestPreTrainingDataset(PreTrainingDataset): def __init__(self, dataset_root, train_size): # super().__init__(dataset_root, train_size) # self.joint_trans...
Robert-xiaoqiang/DS-Net
sodpackage/datasampler/TestPreTrainingDataset.py
TestPreTrainingDataset.py
py
1,123
python
en
code
11
github-code
1
74246086752
import sys sys.stdin = open('5202.txt') def solution(times): start = 0 answer = idx = 0 choiced = [0] * N while True: stop = True finish = 24 for i in range(N): if choiced[i]: continue if times[i][0] < start: choiced[...
jinyoong/SWEA
Python_advanced/5202. 화물 도크.py
5202. 화물 도크.py
py
787
python
en
code
0
github-code
1
12422761713
import time import sys INITIAL = { 'out1': 'G', 'out2': 'R', 'clock': 0, 'walk': False, } G1 = lambda s: (s['out1'] == 'G' and s['out2'] == 'R' and ( (s['clock'] < 30 and dict(s, clock=s['clock'] + 1, walk=False)) or (s['clock'] =...
logston/raft
src/raft/light.py
light.py
py
2,857
python
en
code
0
github-code
1
21447776273
def find_enemy(you, dir, enemy): vx, vy = ord(enemy[0]) - ord(you[0]), (int(enemy[1]) - int(you[1])) * 2 if (vx + vy) % 2 != 0: vy += 1 if vy > 0 else -1 if vx == 0: enemy_dir = "S" if vy > 0 else "N" elif abs(vx) == abs(vy): if vx > 0 and vy > 0: enemy_dir = "SE" if vx ...
zonkyy/checkio
mine/find-enemy.py
find-enemy.py
py
1,250
python
en
code
0
github-code
1
2020287014
from flask import Flask from firebase_admin import credentials, firestore, initialize_app from dotenv import load_dotenv import os from mockfirestore import MockFirestore from flask_cors import CORS import json load_dotenv() initialize_app(credentials.Certificate(json.loads(os.environ.get('KEY')))) db = firestore.clie...
DeeJMWilliams/nodwick-back-end
app/__init__.py
__init__.py
py
904
python
en
code
0
github-code
1
38126542920
import mediapipe as mp import numpy as np import cv2 from draw_landmarks import draw_landmarks_on_image model_path = 'pose_landmarker_lite.task' BaseOptions = mp.tasks.BaseOptions PoseLandmarker = mp.tasks.vision.PoseLandmarker PoseLandmarkerOptions = mp.tasks.vision.PoseLandmarkerOptions PoseLandmarkerResult = mp.t...
napongps/Muay-Thai-pose-similarity
Detector_live_stream.py
Detector_live_stream.py
py
2,056
python
en
code
0
github-code
1
12416397342
import socket ipaddress = '127.0.0.1' # change to ip address of server port = 8001 print(ipaddress) print('Creating a socket') with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((ipaddress, port)) print('listening for connections...') s.listen(1) conn, addr = s.accept() print(f'co...
5P1D3RR/5P1D3R-WARE
server.py
server.py
py
657
python
en
code
0
github-code
1
14420237441
import numpy as np from matplotlib import pyplot as plt import cv2 import glob import math from pathlib import Path import argparse def search_point(args): # images_path = sorted(glob.glob(input_path+folder+"/*/l.jpg", recursive=True)) distance_table = [] with open(args.input_directory+'/'+args.folder+"/d...
WangQin0001/pointCloudProcessing
3D-Model-Monocular-Vision-main/search_point_in_panorama.py
search_point_in_panorama.py
py
5,355
python
en
code
0
github-code
1
34270102431
def empingpong(l1,l2): #dadas dos listas l1 y l2 tales que len(l1)<=len(l2) retorna el emparejamiento ping-pong de l1 con l2 emp = [] l1 = l1+l1[-2:0:-1] # l1 ahora tiene un pedazo adicional de l1 pero invertido i = 0 while i<len(l2): # emparejamiento entre l2 y l1 'rotando' el indice de l1 ...
jabaier/iic1103.20152.s4
ejercicios_i2/emparejamiento_pingpong.py
emparejamiento_pingpong.py
py
1,943
python
es
code
0
github-code
1
9658391458
import json import mage import tempfile import time import unittest class TestAssessment(unittest.TestCase): TEST_ASSET = "unittest.example.com" @classmethod def setUpClass(cls): mage.connect() def setUp(self): self.a = mage.Assessment.create('EXTERNAL', name='UNITTEST') self...
Stage2Sec/magepy
tests/assessment.py
assessment.py
py
6,368
python
en
code
0
github-code
1
18681084368
## initial imports ------------------------------ import os, sys assert sys.version_info.major >= 3 sys.path.append( os.environ['BK_LCTR__PROJECT_PATH'] ) from book_locator_app import settings_app # requires above path to be set ## rest of imports ------------------------------ import json, logging, pprint import ...
Brown-University-Library/book_locator_project
book_locator_app/lib/index.py
index.py
py
16,650
python
en
code
0
github-code
1
20597475339
#!/usr/bin/env python3 # # Project homepage: https://github.com/mwoolweaver # Licence: <http://unlicense.org/> # Created by Michael Woolweaver <m.woolweaver@icloud.com> # ================================================================================ from os import path from sqlite3 import connect from sqlite3 import...
mwoolweaver/listManager.py
lib/findGravity.py
findGravity.py
py
2,737
python
en
code
1
github-code
1
20042611909
import json from utils.file_io import FileIO class IOjson(FileIO): def import_file( self, bucket: str, file_key_s3: str, ): ''' import_json allows to import json file containing the addresses with any vscode service on the datalab thanks to management of environment var...
alannadevgen/french-address-matching
utils/json_io.py
json_io.py
py
1,074
python
en
code
1
github-code
1
13049184792
with open("../input/day24.txt") as f: string_data = f.read() string_data = string_data.replace("inp", "\ninp") groups = string_data.split("\n\n") groups = map(lambda x: x.split("\n"), groups) # groups =map(lambda x: x.split("\n"), groups) # print(list(groups)[0]) # print() # groups=filter(lambda x: len(x) !=0, gr...
troyunverdruss/advent-of-code-2021
lib/parseday24.py
parseday24.py
py
683
python
en
code
0
github-code
1
2418194407
from odoo import models, api, fields from odoo.addons.base.models.ir_mail_server import extract_rfc2822_addresses class IrMailServer(models.Model): _inherit = "ir.mail_server" auto_add_sender = fields.Boolean( help="Automatically add sender to the list of hidden recipients", ) auto_cc_address...
decgroupe/odoo-addons-dec
base_mail_auto_copy/models/ir_mail_server.py
ir_mail_server.py
py
4,141
python
en
code
2
github-code
1
73033969953
# -*- coding: utf-8 -*- ''' Configuration of network interfaces =================================== The network module is used to create and manage network settings, interfaces can be set as either managed or ignored. By default all interfaces are ignored unless specified. .. note:: Prior to version 2014.1.0, on...
shineforever/ops
salt/salt/states/network.py
network.py
py
13,736
python
en
code
9
github-code
1
33490169208
#!/usr/bin/env python import sys import os import logging import torch.optim as optim # Assure that python can find the deeprank files: deeprank_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, deeprank_root) from deeprank.learn.NeuralNet import NeuralNet from deeprank.learn.Dat...
DeepRank/DeepRank-Mut
scripts/learn.py
learn.py
py
2,469
python
en
code
1
github-code
1
36355678261
from application.crud.public import download_shared_world, grab_shared_world from fastapi import APIRouter, Path, Query router = APIRouter() @router.get("/worlds/{world_id}") async def get_world_by_id( world_id: str = Path(..., description="The unique identifier of the world.") ): return grab_shared_world(w...
Valink-Solutions/ChunkVault-Lite
backend/application/routes/public.py
public.py
py
621
python
en
code
3
github-code
1
9449001858
from tkinter import * from tkinter import ttk window=Tk() frame=ttk.Frame(window) frame.grid(column=0,row=0) t=Text(frame,width=50,height=10) t.grid(column=1,row=1) b=ttk.Button(frame,text="Button") b.grid(column=1,row=2) spvar=StringVar() sp=Spinbox(frame,textvariable=spvar) sp["values"]=("lunes","Martes","Miercoles"...
sandra1036/DIN
Excercices/Widgets/MoreWidgets.py
MoreWidgets.py
py
367
python
en
code
0
github-code
1
36976818187
import pygame import cv2 import os import time import opensimplex import sys strLocalPath = os.path.dirname(sys.modules[__name__].__file__) if strLocalPath == "": strLocalPath = './' sys.path.append(strLocalPath+"/../alex_pytools/") import misctools def bgr2rgb(col): b = col[0] col[0] = col[2] col[2] = b ...
alexandre-mazel/electronoos
scripts/test_pygame.py
test_pygame.py
py
7,088
python
en
code
2
github-code
1
40926510217
import argparse import os from qsub import q_write, q_sub def main(): # arguments parser = argparse.ArgumentParser() parser.add_argument('-top_dir', help='top level directory of chromo grouped mafs', required=True) parser.add_argument('-ref', help='Reference species name', required=True) parser.a...
henryjuho/sal_enhancers
genome_alignment/roast_all.py
roast_all.py
py
1,985
python
en
code
1
github-code
1
4978461269
from tkinter import * from time import strftime class Relogio: def __init__(self): self.janela = Tk() self.janela.title("Relógio") self.janela.geometry("400x400") self.janela.resizable(width=False, height=False) self.label1 = Label(self.janela, width=20, height=3, text=""...
nicolasdonada/Exerc-ciosEmPython
PythonPOO/Testes/exemplo20.py
exemplo20.py
py
665
python
en
code
2
github-code
1
38038227705
import cooler import os.path as op import matplotlib.pyplot as plt import numpy as np import pandas as pd import h5py from toolz.curried import interleave, reduce, concat, concatv from toolz.curried import unique from toolz.curried import compose, compose_left, comp, complement from toolz.curried import pipe, thread_fi...
zelhar/mg21
hic/mymodule/hicCoolerModule.py
hicCoolerModule.py
py
3,514
python
en
code
0
github-code
1
39587452428
import requests import time import json from pprint import pprint import spotipy SPOTIFY_GET_CURRENT_TRACK_URL = 'https://api.spotify.com/v1/me/player/currently-playing' ACCESS_TOKEN = 'BQBvhtfdCngkgmTBhWj4b7XHlJ3tu1I47EB8f-ofjTWVuWyWt_zAVHKzAFmkUrSFyF_0P2n09Wsh3UvnNfmuXmI8_233CqaKkdTmuTqI8OtWWnk3gPhrFMqgMDdonZcOkKT_...
kasthuridinesh/pythonprojects
spotify_api/spotify_api/spotify/main.py
main.py
py
1,398
python
en
code
0
github-code
1
29275759751
import execjs def get_js(): f = open("./qd/index.js", 'r', encoding='UTF-8') line = f.readline() htmlstr = '' while line: htmlstr = htmlstr + line line = f.readline() return htmlstr jsster = get_js() ctx = execjs.compile(jsster) print(ctx.call('enString','123456'))
jos-jos/recommendation
Intelligent recommendation system/indexjs.py
indexjs.py
py
303
python
en
code
4
github-code
1
39997879253
#!/usr/bin/python3 """ script that lists all State objects that contain the letter a from the database hbtn_0e_6_usa """ from model_state import State, Base from sqlalchemy import (create_engine) from sqlalchemy.orm import sessionmaker import sys def state_a(): engine = create_engine('mysql+mysqldb://{}:{}@localh...
jerrynabango/alx-higher_level_programming
0x0F-python-object_relational_mapping/9-model_state_filter_a.py
9-model_state_filter_a.py
py
682
python
en
code
0
github-code
1
6213442958
from __future__ import absolute_import, unicode_literals, print_function from ply import lex from ..errors import ThriftParserError __all__ = ['Lexer'] THRIFT_KEYWORDS = ( 'namespace', 'include', 'void', 'bool', 'byte', 'i8', 'i16', 'i32', 'i64', 'double', 'string', ...
thriftrw/thriftrw-python
thriftrw/idl/lexer.py
lexer.py
py
3,534
python
en
code
37
github-code
1
4981509036
from __future__ import print_function import torch.nn as nn import torchvision.models as models from torchvision.models.inception import inception_v3 from mylibs import ContentLoss, StyleLoss, TVLoss from torchvision.models.feature_extraction import get_graph_node_names from torchvision.models.feature_extraction import...
Xinyan1020/Image-Synthesis-CNN-MRF
model.py
model.py
py
6,624
python
en
code
0
github-code
1
35198335445
from BaseRequest.BaseApi import BaseApi from tools.get_time_schedule import get_schedule class UpdateCampaign(BaseApi): @staticmethod async def post(session, form): params = { 'title': form.title.data, 'budget': form.budget.data, 'promoteTime': get_schedule(form.pr...
szshysj/Digital_marketing_web
spider/BaseRequest/UpdateCampaign.py
UpdateCampaign.py
py
880
python
en
code
0
github-code
1
7043170768
from dynamic import print_level, run_simulation, solve_game def left_shift(tup, n): """Given a tuple `tup` and an integer `n`, shifts all elements in `tup` `n` places to the left.""" if not tup or not n: return tup n %= len(tup) return tup[n:] + tup[:n] def build_dmg_grid(dmg_grid, ship...
eze210/tda1
tp3/part1/initial_pos.py
initial_pos.py
py
3,146
python
en
code
0
github-code
1
30716286936
from http import HTTPStatus """ Code in this module is based on https://auth0.com/docs/quickstart/backend/python#validate-access-tokens and course material """ class AuthError(Exception): """ AuthError Exception A standardized way to communicate auth failure modes """ def __init__(self, status_co...
ibuttimer/TeamPicker
src/team_picker/auth/exception/auth_error.py
auth_error.py
py
632
python
en
code
0
github-code
1
274105874
import os import re import sys import argparse import logging import shutil from pathlib import Path from collections import defaultdict from multiprocessing import Process from .codeql import build_codeql_db from .analyzer import extract_function_pointers, extract_structs from .instrumenter import instrument_library_...
untangle-tool/untangle
untangle/main.py
main.py
py
14,169
python
en
code
2
github-code
1
27405007230
import numpy as np import math import pydot # for visualizing the tree # MCTS (Monte Carlo Tree Search) is an algorithms # that plans ahead, estimating Q-values based on # "rollouts", which are simulated episodes. # This specific implementation is written for two-player # zero-sum games, but should be generalized to...
CogitoNTNU/vicero
vicero/algorithms/mcts.py
mcts.py
py
3,899
python
en
code
6
github-code
1
32458142731
# 1. Escreva uma função que receba uma string correspondendo a um número inteiro e retorne o valor inteiro correspondente. # Por exemplo, se a string for "-1234", a função deve resultar no valor -1234. # Seu programa deve conter alguns testes da função. def string_to_int(s): for num in s: int(s) print...
Jon710/python-topicos2
exercicio1.py
exercicio1.py
py
399
python
pt
code
0
github-code
1
39472288221
from brownie import ( ERC20, FeeGovernor, FeeGovernorProxy, PaymentTokenGovernor, PaymentTokenGovernorProxy, FundsDistributionTokenMultiERC20WithFee, FundsDistributionTokenMultiERC20WithFeeFactory, accounts, ) def main(): #acct = accounts.load('deployment_account') acct = accounts[0] # Deploy payment token...
tserg/vyper-fdt
scripts/deploy_multi_erc20_with_fee.py
deploy_multi_erc20_with_fee.py
py
1,618
python
en
code
0
github-code
1
30676173659
import time from MAISchedule import MAISchedule def full_test(): d = MAISchedule() d.update_schedule() for course in d.courses: for institute in d.courses[course]: for fields in d.courses[course][institute]: for group in d.courses[course][institute][fields]: ...
Allozo/Schedule
test_MAISchedule.py
test_MAISchedule.py
py
1,515
python
en
code
0
github-code
1
6902620957
import sys import os import numpy as np import tensorflow as tf import time import datetime from exploration.autoencoder import Autoencoder def parse_record(record_bytes, obs_steps=4): features = { #'game_name' : tf.FixedLenFeature((), tf.string), #'act_name' : tf.FixedLenFeature((), tf.str...
olegmyrk/retro-rl
autoencode.py
autoencode.py
py
3,918
python
en
code
0
github-code
1
43177440426
import uuid from datetime import datetime from models_manager import Field, Model from settings import USERS_DB_NAME, DEFAULT_TENANT from utils.utils import random_string class MailMessages(Model): SCOPE = [ {'name': 'MailMessage.Read', 'scope': None, 'scopeType': None}, {'name': 'MailMessage.De...
Nikita-Filonov/demo_auto_tests
models/users/mail_message.py
mail_message.py
py
1,376
python
en
code
3
github-code
1
8526799740
#!/usr/bin/env python # -*- coding: utf-8 -*- from lib.classes.weatherYahoo import WeatherYahoo class Core(object): _answer = [] _sqlo = None _services = { 'tiempo': WeatherYahoo, } def __init__(self): pass def instanceServices(self, service, args=[]): service = self._services[service] obj = service(...
lodeale/botBuffyWebServices
lib/core/core.py
core.py
py
787
python
en
code
0
github-code
1
36228793822
import names # pip install names import random import csv n_connections = 500 csvReader = csv.reader(open('sp500.csv'), delimiter=',', quotechar='"') companies = [row[1] for row in csvReader] with open('occupations.txt') as f: occupations = f.read().splitlines() def generate_fake_profile(): first_name = na...
mikhailklassen/Mining-the-Social-Web-3rd-Edition
notebooks/resources/ch04-linkedin/generate_fake_data.py
generate_fake_data.py
py
1,088
python
en
code
890
github-code
1
71103765473
# coding: utf-8 import datetime as dt today = dt.date.today() day = today while day.day != 13 or dt.datetime.isoweekday(day) != 5: day += dt.timedelta(days=1) print("Next friday the 13th will be ", day, " (", "in ", day - today, ")", sep="")
astro-kaba4ek/Python_5
DZ1/4/friday_the_13th.py
friday_the_13th.py
py
246
python
en
code
0
github-code
1
43771306259
#!/usr/bin/env python # Self contained script, based on Simon's script # https://raw.githubusercontent.com/IDR/idr0052-walther-condensinmap/master/scripts/upload_and_create_rois.py # and omero-roi package: https://github.com/ome/omero-rois import os import numpy as np from PIL import Image, ImageSequence import omero...
IDR/idr0101-payne-insitugenomeseq
scripts/seg_images_to_masks.py
seg_images_to_masks.py
py
6,417
python
en
code
0
github-code
1
25647842830
import mtcnn import PIL.Image as Image import numpy import os import json from matplotlib import pyplot import sklearn.svm def LoadConfig(filePath): with open(filePath, "r") as f: return json.load(f) def LoadImage(imagePath): image = Image.open(imagePath) image = image.convert('RGB') return nu...
bk202/Project_Warden
util.py
util.py
py
4,333
python
en
code
0
github-code
1
71409538594
# fight against a creature import sys, ticker, pygametest, random, pygame spk = pygametest.speak c = ticker.Scheduler(0.001) fps = 30 fpsClock = pygame.time.Clock() class Creature: """Create mobs and players""" def __init__(self, name, hp=10, strength=1, mob=True): self.name = name self.hp = hp ...
frastlin/Hero
tests/ticker_tests/game2.py
game2.py
py
3,759
python
en
code
0
github-code
1
11991611198
class PlayData: def __init__(self,raw_row=None): #no raw_row if raw_row is None: raw_row = {'gameid':'','season':'','off':'','def':'','down':'', 'togo':'','qtr':'','min':'','sec':'','offscore':'', 'defscore':'','ydline':'','qtr':'','description':''} ...
10flow/playbyplay
play-parser/play.py
play.py
py
1,624
python
en
code
19
github-code
1
13181608112
import argparse import h2o import mlflow import sys import os from mlflow.tracking import MlflowClient from h2o.automl import H2OAutoML, get_leaderboard # Add the src directory to the system path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from utils import * def main(): # Se...
gersongerardcruz/network_intrusion_detection
src/backend/train.py
train.py
py
4,763
python
en
code
0
github-code
1
23212413758
#!/usr/bin/env python3 """ plot_zoom_sequence.py Plot a series of inset zoom images based on pre-computed images in .npz files. """ import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as pl import unyt from plot_map import get_data, get_limits, plot_data_on_axis ## global parameters...
bwvdnbro/documentation
Visualisations/PlotMaps/plot_zoom_sequence.py
plot_zoom_sequence.py
py
8,356
python
en
code
0
github-code
1
8650792697
import pandas as pd import numpy as np import re from stanfordcorenlp import StanfordCoreNLP import os import nltk from nltk.corpus import stopwords from keras.models import load_model from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from gensim.models import KeyedVe...
OmarMeriwani/Fake-Financial-News-Detection
Numbers Meaning/NumbersTitlesDataset.py
NumbersTitlesDataset.py
py
9,012
python
en
code
4
github-code
1
73059429473
from dataclasses import dataclass from datetime import datetime from typing import Dict, Tuple from vnpy.api.tap.vntap import ( AsyncDispatchException, CreateTapQuoteAPI, FreeTapQuoteAPI, ITapQuoteAPINotify, TapAPIApplicationInfo, TapAPIContract, TapAPIQuotLoginRspInfo, TapAPIQuoteLoginAuth, TapAPIQuot...
AMAZED-FINTECH/vnpy-Amazed-Fintech
vnpy/gateway/tap/tap_gateway.py
tap_gateway.py
py
26,233
python
en
code
6
github-code
1
18098984608
import numpy as np ######## DO NOT MODIFY THIS FUNCTION ######## def draw_rand_label(x, label_list): seed = abs(np.sum(x)) while seed < 1: seed = 10 * seed seed = int(1000000 * seed) np.random.seed(seed) return np.random.choice(label_list) ############################################# cla...
Astatine404/IFT6390
HW1/solution.py
solution.py
py
4,648
python
en
code
0
github-code
1
7048959568
#GHOST+:MNIST dataset # This code can be used in any of the following cases: 1-9,2-8,3-7,4-6, but the data processing is different import cv2 import tensorflow as tf import pandas as pd import numpy as np from sklearn.utils import shuffle def read_csv(filename): file_name=pd.read_csv(filename,header=N...
yangjiamin123/When-Deep-Learning-Meets-Steganography-Protecting-Inference-Privacy-in-the-Dark
mnist.py
mnist.py
py
6,402
python
en
code
1
github-code
1
15518604699
#!/usr/bin/env python # -*- coding: utf-8 -*- # date: 2017-09-08 # 第一层 3:3:3 # 第二层 2:1 + 2:1 + 2:1 from subjects.pickballs.ball import * def handle(balls): balls = list(balls) normal = [] left = sum(balls[:3]) # 0, 1, 2 right = sum(balls[3:6]) # 3, 4, 5 if left == right: # 6, 7, 8 ...
shenzhiyong17/python_homework
subjects/pickballs/nine_balls.py
nine_balls.py
py
1,709
python
en
code
0
github-code
1
22504290089
import sys from collections import deque input = sys.stdin.readline def target(lst): lst.sort(key=lambda x: (x[2], x[0], x[1])) return lst[0] def help_mom(): global baby_shark # arr에 아기 상어보다 작은 개체가 있는지 for i in range(N): for j in range(N): if arr[i][j] < baby...
Kminwo-o/BaekJoon-Algorithm
백준/Gold/16236. 아기 상어/아기 상어.py
아기 상어.py
py
2,383
python
en
code
0
github-code
1
26104171645
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model from swagger_server import util class Social(Model): """NOTE: This class is auto generated by the swagger code...
JakubKuderski/Programowanie_Zespolowe
server/swagger_server/models/social.py
social.py
py
2,989
python
en
code
0
github-code
1
3355933963
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() category = Table('category', post_meta, Column('id', Integer, primary_key=True, nullable=False), Column('genre', String(length=50)), Column('age_cat', String(length=50)), Co...
pace-noge/online_shop
db_repository/versions/003_migration.py
003_migration.py
py
6,597
python
en
code
0
github-code
1
12951494655
import abc import json import urllib.parse from typing import ClassVar, List import aiohttp.web import google.auth.transport.requests import google.oauth2.id_token import google_auth_oauthlib.flow import msal from gear.cloud_config import get_global_config class FlowResult: def __init__(self, login_id: str, ema...
wlu04/hail
auth/auth/flow.py
flow.py
py
4,202
python
en
code
null
github-code
1
74391648354
# -*- coding: utf-8 -*- import requests url = 'https://www.douban.com/' #r = requests.get(url) #print('code:', r.status_code) #print('text: ', r.text) #r_params = requests.get('https://www.douban.com/search', params = {'q': 'python', 'cat': '1001'}) #print('url:', r_params.url) #print('code:', r_params.status_code) #...
hello-wn/python-basic-scripts
20180424/requests_samples.py
requests_samples.py
py
1,073
python
en
code
0
github-code
1
21929775849
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proTwo.settings') import django django.setup() import random from appTwo.models import AccessRecord, Topic, Webpage from faker import Faker fakegen = Faker() topics = ['Games', 'Books', 'News', 'Entertainment', 'Food', 'Health'] def add_topic(): t = Top...
RishiKumar158/my_django_stuff
proTwo/populate_access_records.py
populate_access_records.py
py
884
python
en
code
0
github-code
1
71496194593
import math import glob import re import os import logging import os pat = os.getcwd() pat = pat + '\word.txt' kgram_len_lst = [] dct_lst = {} filename_lst = [] path = os.getcwd() ''' List of stop words inserted in a list. ''' f = open(pat,'r') stop_word = set(f.read().split()) f.close() ''' To read files to creat...
yashwanth033/CSPP-1_project
Fingerprinting.py
Fingerprinting.py
py
3,683
python
en
code
0
github-code
1
20639764825
import cv2 as cv import numpy as np import sys # 白黒に閾値処理するプログラム def main(): # ファイルを読み込み image_file = 'fig/ipad.png' src = cv.imread(image_file, cv.IMREAD_COLOR) # イメージを読み込めなかった場合 if image_file is None: sys.exit("File not found.") # グレースケール化 img_gray = cv.cvtColor(src, cv.COLOR_RGB2GR...
kengo-0805/origami
BW.py
BW.py
py
2,091
python
ja
code
0
github-code
1
16080510727
# Importing libraries import pyautogui as notification import schedule import time import os from colorama import Fore, Style, init # Initialization for the colorama lib init(autoreset=True) def script(): # Defining the alert function def alert(message): # Printing text on screen print(Fore.GREEN + Style.BRIGH...
ArshansGithub/Science-Project
main.py
main.py
py
2,947
python
en
code
0
github-code
1
8701824769
# -*- coding: utf-8 -*- """ Created on Fri Apr 20 11:36:42 2018 @author: admin """ def gcd(a,b): if a!=0 and b!=0 and a>b: return gcd(b,a%b) elif a!=0 and b!=0 and a<=b: return gcd(a,b%a) elif a==0 or b==0: if a==0: return b else: retur...
songkwangho/algorithm
카잉달력.py
카잉달력.py
py
891
python
en
code
0
github-code
1
70270372835
from django.apps import apps as django_apps class RequisitionPanelError(Exception): pass class RequisitionPanelModelError(Exception): pass class InvalidProcessingProfile(Exception): pass class Names: def __init__(self, name=None, alpha_code=None): self.abbreviation = f'{name[0:2]}{name[...
botswana-harvard/edc-lab
edc_lab/lab/requisition_panel.py
requisition_panel.py
py
3,490
python
en
code
0
github-code
1
11109084072
from machine import Pin from neopixel import NeoPixel import urequests import time np = NeoPixel(Pin(13), 1) # D7 def get_next(): resp = urequests.get('http://bindicator-api.robberwick.com') data = resp.json() resp.close() return data def update(): print('fetching...') data = g...
robberwick/bindicator-client
main.py
main.py
py
586
python
en
code
0
github-code
1
33348188315
class student: def __init__(self,name,grade,number): self.name = name self.grade = grade self.number = number def __repr__(self): return repr((self.name, self.grade, self.number)) students = [ student('홍길동',3.9,20165232), student('김범수',3.0...
Leejeongbeom/basic
5-10.py
5-10.py
py
468
python
en
code
0
github-code
1
813232806
import torch from torch import nn from torch.nn import functional as F from torch.nn import init import numpy as np from pprint import pprint from .Backbone import Backbone from ..Component.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d BatchNorm2d = SynchronizedBatchNorm2d BN_MOMENTUM = 0.01 class RGB2Dept...
Robert-xiaoqiang/DS-Net
sodpackage/architecture/RGB2DepthNet/RGB2DepthNet.py
RGB2DepthNet.py
py
2,415
python
en
code
11
github-code
1
4166291003
import psycopg2 import pandas as pd def createTable(table_name, conn): cur = conn.cursor() create_table_query = "CREATE TABLE " + table_name + ''' ( ticket_id INT, trans_date DATE, event_id INT, event_...
Rafabaring/SpringBoard
Data_Pipeline_Unit_15/sqlManager.py
sqlManager.py
py
3,069
python
en
code
2
github-code
1
2671355782
# pylint: disable=no-self-use,invalid-name import pytest from allennlp.common import Params from allennlp.common.util import ensure_list from allennlp.data.dataset_readers import BabiReader from allennlp.common.testing import AllenNlpTestCase class TestBAbIReader: @pytest.mark.parametrize('keep_sentences, lazy',...
dki-lab/GrailQA
allennlp/tests/data/dataset_readers/babi_reader_test.py
babi_reader_test.py
py
1,273
python
en
code
89
github-code
1
6488723929
'''REVERSE GROUPS Given a list of numbers and a positive integer k, reverse the elements of the list, k items at a time. If the number of elements is not a multiple of k, then the remaining items in the end should be left as is. INPUT SAMPLE: Your program should accept as its first argument a path to a filename. Each...
mgorgei/codeeval
Medium/c71 Reverse Groups.py
c71 Reverse Groups.py
py
1,040
python
en
code
1
github-code
1
40134800075
from sys import stdin input = stdin.readline n = int(input()) a = 1 t = 1 while True: a = a + ((t - 1) * 6) if n <= a: break else: t += 1 print(t)
Woojun-Yoon/YOONJOON
2292 벌집.py
2292 벌집.py
py
175
python
en
code
1
github-code
1
70752872353
with open('day14.txt') as file: lines = [line.strip() for line in file.readlines() if len(line.strip()) > 0] template = lines[0] rules = {} for line in lines[1:]: left, right = line.split(' -> ') rules[left] = right def add(dict, item, count=1): if item not in dict: dict[ite...
blat-blatnik/Advent-of-Code
2021/day14.py
day14.py
py
1,559
python
en
code
0
github-code
1
19752223636
A = [23171, 21011, 21123, 21366, 21013, 21367] def solution(A): n = len(A) A.reverse() max = 0 profit = 0 tmp_profit = 0 for k in range(n): max = A[k] for j in range(k, n-k): tmp_profit = max - A[j] if tmp_profit > profit: profit = tmp_pr...
yoshikikasama/python
other/codility/maxProfit.py
maxProfit.py
py
374
python
en
code
0
github-code
1
2559839049
from azure.cognitiveservices.vision.computervision import ComputerVisionClient from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes from msrest.authentication import CognitiveServicesCredentials from ar...
sarajk/invoice-fields-recognition-py
microsoft_computer_vision.py
microsoft_computer_vision.py
py
2,387
python
en
code
0
github-code
1
2889159787
from pprint import pprint as pp from collections import defaultdict import sys sys.setrecursionlimit(10 ** 7) readlines = sys.stdin.buffer.readlines map_readlines = lambda: map(int, readlines()) readline = sys.stdin.buffer.readline map_readline = lambda: map(int, readline().split()) sreadline = lambda: readline().decod...
Kumamoto-Hamachi/atcoder_pr
others/abs/2.py
2.py
py
709
python
en
code
1
github-code
1
73654172833
import os import json from qgis.PyQt import QtWidgets, uic from qgis.core import QgsProject from qgis.PyQt.QtGui import QDesktopServices from qgis.PyQt.QtCore import pyqtSignal, QUrl from qgis.utils import iface from .api import endpoints from .utils import ( get_layer_config, sdo_to_layer, get_epsg_from...
danylaksono/GeoKKP-GIS
modules/import_wilayah_admin.py
import_wilayah_admin.py
py
10,924
python
en
code
2
github-code
1
11313104428
#!/usr/bin/env python # -*- encoding: utf-8 import collections from helpers import get_all_works, save_tally_to_path if __name__ == '__main__': tally_image = collections.Counter() tally_presentation = collections.Counter() tally_any = collections.Counter() for work in get_all_works(): for i...
saltaf07/Public-Scripts
works_analysis/get_digitised_images_per_work_tally.py
get_digitised_images_per_work_tally.py
py
1,505
python
en
code
0
github-code
1
6080761222
my_list = [] value = 0 a = eval(input("Enter value to be included in average(-999 quits):\n")) while (a != -999): my_list = my_list + [a] a = eval(input("Enter a value to be included in average(-999 quits):\n")) b = len(my_list) if b != 0: for x in range(b): value = value + my_list[x] print("Yo...
Anpandoh/PCC_Python
Chapter 8 Assignment.py
Chapter 8 Assignment.py
py
546
python
en
code
0
github-code
1
32639198474
from PIL import Image import os, sys def topng(path): for dirpath, dirs, files in os.walk(path): #ignore finished files if "finished" in dirs: dirs.remove("finished") for file in files: try: imgpath = os.path.join(dirpath, file) im = I...
sayidhe/image-compress-scale-transfrom
topng.py
topng.py
py
902
python
en
code
0
github-code
1
40214052858
import base64 import locale import sys """ def encoder(content): print('編碼類型:{:10}|{}'.format('default',content.encode())) print('編碼類型:{:10}|{}'.format('UTF-8',content.encode(encoding='utf8'))) print('編碼類型:{:10}|{}'.format('UTF-16',content.encode(encoding='utf16'))) print('編碼類型:{:10}|{}'.format('UTF-32...
katmenminzer/-Pratice-PySet
2.encoder.py
2.encoder.py
py
1,807
python
en
code
0
github-code
1
28997054142
class Nodo: def __init__(self, dato=None, prox=None): self.dato = dato self.prox = prox def __str__(self): return str(self.dato) def ver_lista(self): """Recorre todos los nodos a través de sus enlaces, mostrando sus contenidos.""" while self is not None: print(self) self = self.pr...
RoCeleste/Algo-I
Algoritmos I/Capitulo 15/eje1.py
eje1.py
py
5,609
python
es
code
0
github-code
1
27722012968
import codecs import os import setuptools with open("README.md", "r") as fh: long_description = fh.read() def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, rel_path), "r", encoding="utf-8") as fp: return fp.read() def get_version(rel_path):...
wuhanstudio/whitebox-adversarial-toolbox
setup.py
setup.py
py
2,007
python
en
code
8
github-code
1