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
259844212
from c3d3.infrastructure.c3.interfaces.cex_order_history_screener.interface import iCexOrderHistoryScreenerHandler from c3d3.domain.c3.wrappers.binance.usdtm.wrapper import BinanceUsdtmExchange from c3d3.core.decorators.to_dataframe.decorator import to_dataframe import datetime import time import requests as r class...
e183b796621afbf902067460/c3d3-framework
c3d3/infrastructure/c3/handlers/cex_order_history_screener/binance/usdtm/handler.py
handler.py
py
3,034
python
en
code
0
github-code
36
31530311323
import cv2 # ^ Must be installed via pip import os import re # ^ Should be there by default idk why it didnt work import pytesseract from PIL import Image def optimize_image_for_ocr(image_path, lang='eng', image_dpi=300, image_format='png', whitelist = None, blacklist = None): # Load the image ...
WorcestershireSample/FIA-Project
Tesseract/OCRfunc.py
OCRfunc.py
py
2,641
python
en
code
0
github-code
36
40567581461
# Initialize an empty dictionary to store the data import numpy as np import math import matplotlib.pyplot as plt import matplotlib as mpl mpl.use('TkAgg') from mpl_toolkits.mplot3d import Axes3D def projectFull(H, X, Y): w11, w12, w21, w22, w31, w32, t1, t2, t3 = H u = (fu * w11 + u0 * w31) * X + (fu * w12 ...
bach05/PanNote
src/auto_calibration_tools/scripts/camera_laser_calibration/readTest.py
readTest.py
py
4,496
python
en
code
0
github-code
36
9042470942
import os from doroto import create_app, db from doroto.models import User from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand from seed import seed_roles, seed_departments_and_positions from flask_cors import CORS, cross_origin app = create_app(os.environ.get('FLASK_CONFIG', 'tes...
shmundada93/doroto-api
api/manage.py
manage.py
py
800
python
en
code
1
github-code
36
72766914984
import shutil import os import sys import re import csv def f(entry): return entry[entry.find("=")+1:] #clue_type: strongsubj, weaksubj #clue_polarity: positive, negative, neutral #sent_file format: filename, pattern, patterninfo, sentence, fulltext #given sentences_csv, make a new file with all sentences that cont...
arnab64/slugbot
tryout/lenas_tool/lenas_tool/code/get_mpqa_emotion.py
get_mpqa_emotion.py
py
2,628
python
en
code
1
github-code
36
10742295231
import xml.etree.ElementTree as et def import_monster(name): tree = et.parse("stats/monster_manual.xml") root = tree.getroot() if (root.tag != "mm"): print ("Monster manual not found!\n") return None # Iterate through entries in monster manual for monster in root: for child in monster: if (child.tag ==...
MontyKhan/DnD_Scripts
monster_manual.py
monster_manual.py
py
451
python
en
code
0
github-code
36
23988113634
import re import ast import json import tiktoken from langchain.prompts import PromptTemplate from ..embeddings.chroma import chroma_openai_cwe_collection, chroma_openai_attack_collection tokenizer = tiktoken.get_encoding("cl100k_base") general_cyber_security_prompt = PromptTemplate( input_variables=["query"], temp...
yadneshSalvi/cybersec_genai
src/cve_to_attack/cve_to_attack_utils.py
cve_to_attack_utils.py
py
7,776
python
en
code
0
github-code
36
73970333864
from .rl import train_rl_agent import numpy as np import os from os import path from datetime import datetime import time import json import subprocess from threading import Lock from typing import Union, Callable, Optional from multiprocessing import Process, Pipe import optuna def train_rl_agent_worker(pipe, hype...
imoneoi/xrl-script
rl-auto-gpu.py
rl-auto-gpu.py
py
6,769
python
en
code
4
github-code
36
33959849387
import tkinter as tk from tkinter import ttk, messagebox, scrolledtext class WindowComponents(tk.Tk): def __init__(self): super().__init__() self.title("Window Components") self.geometry("500x500") self.resizable(False, False) self.columnconfigure(0, weight=1) self.c...
D-Forz/python-projects
Learning_projects/Tkinter/components/components_POO.py
components_POO.py
py
3,375
python
en
code
0
github-code
36
9369219764
# -*- coding: utf-8 -*- """ La fonction analyseLienImage retourne un nombre entre 0 et 1 """ def analyseLienImage(tabLien, nom): """ :param tabLien: tableau avec tous les liens dans le mail :param nom: nom de l'envoyeur :return: pourcentage de retour """ ratio = 0 nombreLiens = len...
PtspluS/Phising-Analising
src/AnalyseImage.py
AnalyseImage.py
py
712
python
fr
code
1
github-code
36
1946291291
from collections import deque def bfs(l,startx,starty,goalx,goaly): visited = [[0]*l for _ in range(l)] queue = deque() queue.append((startx,starty)) visited[startx][starty] = 1 while queue: nowx, nowy = queue.popleft() if nowx == goalx and nowy == goaly: return visited[...
hellokena/2022
DFS & BFS/re/7562 나이트의 이동.py
7562 나이트의 이동.py
py
972
python
en
code
0
github-code
36
3883610301
# ============================================================= # Imports # ============================================================= import time import threading from server.app.engine.models import * from __init__ import DictDiffer as diff from server.utils.notification.notificationdispatch import * # ========...
CaptFrank/EsxiController
server/utils/engine/core/stagetask.py
stagetask.py
py
8,488
python
en
code
0
github-code
36
36008270872
#!/bin/python # -*- coding: utf-8 -*- # Created by 顾洋溢 from mqtt_test.mqtt_bussiness.iot_base64 import Base64 import base64 from Crypto.Cipher import AES import json import demjson from mqtt_test.mqtt_bussiness import iot_sha256 class Iot_encry_decry(object): def __init__(self, msg, AESkey, secretuId): ...
xuxiuke/Android_test
SmartHomeV6Code_TestTeam-InterfaceTest/mqtt_test/mqtt_bussiness/iot_encry_decry.py
iot_encry_decry.py
py
1,326
python
en
code
1
github-code
36
31330328592
d = { 'apple': 'яблоко', 'white': 'белый', 'red': 'красный', 'walk': 'ходить', 'car': ['машина', 'автомобиль'], 'dictionary': { 'car': 'машина', 'white': 'белый', }, 'date': ['свидание', 'финик', 'дата', 'встречаться'], 'zero': 0, 0: 'Ноль' } d_rus = { 'машин...
Daniiarz/python07.01
lesson5/lesson5_2.py
lesson5_2.py
py
1,160
python
ru
code
0
github-code
36
12638712949
import numpy as np from collections import OrderedDict from dataset.mnist import load_mnist def numerical_gradient(f, x): h = 1e-4 # 0.0001 grad = np.zeros_like(x) it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite']) while not it.finished: idx = it.multi_index tmp_val = x[...
wk1219/Data-Science
AI/Back-Propagation/Back-propagation.py
Back-propagation.py
py
4,461
python
en
code
1
github-code
36
74160035623
''' Descripttion: 两个数组的交集 II version: 1 Author: Jason Date: 2020-11-22 16:58:35 LastEditors: Jason LastEditTime: 2020-11-22 16:59:35 ''' import random from typing import List def GenerateRandomList(number, size): temp = list() random_legth = random.randint(0, size) current_length = 0 ...
CodingProgrammer/Algorithm
双指针/350.py
350.py
py
1,700
python
en
code
1
github-code
36
18489853000
from sys import stdin N = int(input()) req = list(map(int, stdin.readline().split())) M = int(input()) start, end = 0, max(req) while start <= end: mid = (start + end) // 2 total = 0 for i in req: if i > mid: total += mid else: total += i if total <= M: ...
Hansung-include/Coding-Test-Study
05주차/2512/김민준_2512.py
김민준_2512.py
py
382
python
en
code
0
github-code
36
15380008623
import sqlalchemy as sql from sqlalchemy.sql.expression import func from datetime import datetime import _pickle as cPickle import logging logging.basicConfig(filename='overlaps.log', level=logging.DEBUG, format='%(asctime)s %(levelname)s %(name)s %(message)s') logger=logging.getLogger(__name__) c...
KiranGershenfeld/VisualizingTwitchCommunities
AtlasGeneration/Python/CalculateOverlaps.py
CalculateOverlaps.py
py
7,918
python
en
code
338
github-code
36
33922218913
# 6. Calculating the price in USD price_tablecloth = fabric_tablecloth * price_tablecloth_for_1_square_meter price_quads = fabric_quads * price_quads_for_1_square_meter # 7. Total price in dolars price_in_dolars = (price_tablecloth + price_quads) # 8. Exchange rate for USD to BGN exchange_rate = 1.85 # 9. Converting US...
IvayloSavov/Programming-basics
simple_operations_and_codding_exercise/demo.py
demo.py
py
482
python
en
code
0
github-code
36
38293660056
""" ResBlocks for WGAN-GP. """ import torch.nn as nn import torch.functional as F from torch_mimicry.modules import resblocks class GBlock(resblocks.GBlock): r""" Residual block for generator. Modifies original resblock definitions with small changes. Uses bilinear (rather than nearest) interpolati...
kwotsin/mimicry
torch_mimicry/nets/wgan_gp/wgan_gp_resblocks.py
wgan_gp_resblocks.py
py
5,220
python
en
code
593
github-code
36
36954820069
import wttest import os from wtbackup import backup_base from wtscenario import make_scenarios # test_backup07.py # Test cursor backup with target URIs, logging and create during backup. class test_backup07(backup_base): dir='backup.dir' # Backup directory name logmax="100K" newuri="tabl...
mongodb/mongo
src/third_party/wiredtiger/test/suite/test_backup07.py
test_backup07.py
py
2,625
python
en
code
24,670
github-code
36
36165455796
# coding=utf-8 from django.utils import timezone from django.db import models from tinymce.models import HTMLField class News(models.Model): title = models.CharField(u'заголовок', max_length=255) announce = HTMLField(u'анонс') content = HTMLField(u'описание', blank=True, null=True) on_main_page = mod...
lambospeed/ryabina
apps/newsboard/models.py
models.py
py
1,084
python
ru
code
0
github-code
36
36913924087
import struct from dh import create_dh_key, calculate_dh_secret from .xor import XOR from enum import Enum import hmac import hashlib # part 2 - start from CA import Certificate_Authority # part 2 - end # Add messages class Message(bytes, Enum): LIST = bytes("LIST", "ascii") AUTH = bytes("AUTH", "ascii"...
Sahil123445/SecureChat
SecureChat Project/Code/lib/comms.py
comms.py
py
6,218
python
en
code
0
github-code
36
477494635
#coding=utf-8 #__author__ = 'zgs' import socket import logging import struct import com_config class Connection(): def __init__(self, host='127.0.0.1', port=1000): if host == '127.0.0.1' and port == 1000: self.host = com_config.access_host self.port = com_config.access_port ...
Oreobird/face_id
src/test/common/connection.py
connection.py
py
2,483
python
en
code
4
github-code
36
25813270402
from sys import stdin lines = [list(map(int, line.split())) for line in stdin.readlines()] avgs = [] for line in lines[1:]: avgs.append(sum(line[1:]) / len(line[1:])) for i, line in enumerate(lines[1:]): above_avg = sum([grade > avgs[i] for grade in line[1:]]) percentage = above_avg / len(line[1:]) * 100...
Anders-E/Kattis
aboveaverage/aboveaverage.py
aboveaverage.py
py
362
python
en
code
4
github-code
36
19678324749
from src.database import Database # """ # A "main" created for testing purposes # """ # # # [[ci,at], an] # query = "SELECT ci.id AS id FROM cast_info AS ci, aka_title AS at, aka_name AS an " \ # "WHERE ci.movie_id=at.movie_id AND ci.person_id=an.person_id LIMIT 5;" # # # query = ''' # # SELECT MIN(cn.name) AS...
antonismand/ReJOIN
main_testing.py
main_testing.py
py
1,938
python
en
code
37
github-code
36
36253389052
import threading import time from datetime import timedelta from typing import Callable from src.models import Team from src.score_scraper import ScoreScraper # Monitors a match and notifies the observer when the score changes class ScoreChangeMonitor: def __init__( self, score_scraper: ScoreScra...
holstt/celebrating-hue-lights
src/score_monitor.py
score_monitor.py
py
1,755
python
en
code
0
github-code
36
11952058238
from pymongo.errors import DuplicateKeyError import requests,os,sys,inspect,uuid currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir+"/../dao/") sys.path.insert(0,parentdir) from hashVTDAO import createHashVTDAO, getHashVTDAO parentdir = os.pa...
Gershpenst/PA-EDR-LIKE
service/hashVTService.py
hashVTService.py
py
1,801
python
fr
code
0
github-code
36
32149237289
# invoer antwrd_1 = str(input('Trek je aan de hendel: ')) antwrd_2 = str(input('Duw je de man van de brug: ')) # berekenen if antwrd_1 != antwrd_2: doden = '1' elif antwrd_1 == 'ja': doden = '2' else: doden = '5' # uitvoer print(doden)
Milan9870/5WWIPython
06-Condities/trolleyprobleem.py
trolleyprobleem.py
py
251
python
nl
code
0
github-code
36
4192973907
import sqlite3 from flask import Flask, render_template,request from flask_paginate import Pagination, get_page_parameter app = Flask(__name__) @app.route('/') def index(): page = request.args.get(get_page_parameter(), type=int, default=1) per_page = 8 offset = (page - 1) * per_page conn = sqlite3.co...
grace-lliu/CS551P-assignment
index.py
index.py
py
1,361
python
en
code
0
github-code
36
2446313714
import unittest from scripts.experiment import ExperimentalMicData class ExperimentalMicDataTestCase(unittest.TestCase): def setUp(self): head = '/home/akhil/Sound-Source-Localization/data/' self.sample_filename = "".join([head, 'CMU_ARCTIC/cmu_us_bdl_arctic/wav/', ...
akhilvasvani/Sound-Source-Localization
test/unit/test_experiment.py
test_experiment.py
py
2,693
python
en
code
27
github-code
36
26902432728
#!/usr/bin/env python3 """ What is this code? - prolog module for explanatory ontology-based narratives for collaborative robotics and adaptation. You can expect to find here definitions that are useful to query and assert knowledge to a prolog knowledge base that uses the ontology for collaborative robotics a...
albertoOA/explanatory_narratives_cra
src/prolog/prolog_module.py
prolog_module.py
py
3,328
python
en
code
0
github-code
36
24059635257
from flask import session # Dictionary uniter def MagerDicts(dict1, dict2): if isinstance(dict1, list) and isinstance(dict2, list): return dict1 + dict2 elif isinstance(dict1, dict) and isinstance(dict2, dict): return dict(list(dict1.items()) + list(dict2.items())) return False # Cart ite...
Jean029/DataBaseProyect
frontend_model/cartModel.py
cartModel.py
py
1,528
python
en
code
0
github-code
36
32472626332
import colorama from colorama import Fore, Back, Style import re import analyze colorama.init(autoreset=True) #Input is list of word objects. Prints all words, unknown words being marked red. def mark_unknown_words_red(words): for word in words: if word.known is False: print(Back.RED + word.w...
estakaad/Pronto
pronto/display.py
display.py
py
4,765
python
en
code
0
github-code
36
4406266697
from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import os import py.twitter_credentials import sys class TwitterAuthenticator: def twitter_authenticate(self): auth = OAuthHandler(py.twitter_credentials.CONSUMER_KEY, py.twitter_credentials.CONSUMER_SECRET) au...
mukul29/TwiXtract
src/py/tweepy_streamer.py
tweepy_streamer.py
py
1,911
python
en
code
0
github-code
36
3923018795
file = open("entries.txt", 'r') data = file.readlines() inputs = [] for element in data: inputs.append(element.strip()) ids = [] for word in inputs: seats = list(range(128)) for char in word[0:7]: end = len(seats) / 2 if char == 'F': seats = seats[0:int(end)] else: ...
Carls13/advent-of-code-2020
Day 5/part-1.py
part-1.py
py
650
python
en
code
0
github-code
36
37030347193
''' Check if the string is of length = 2. ''' def isOfLengthFour(string1): if len(string1) == 2: return True else: return False def main(): listOfStr = ['hi', 'this' , 'is', 'a', 'very', 'simple', 'string' , 'for', 'us'] print("Original List is : ", listOfStr) print("F...
Karan-hash/Python_Questions_Hackerrank_Solutions
Filter_in_Python.py
Filter_in_Python.py
py
1,226
python
en
code
0
github-code
36
1441399647
from operator import itemgetter from math import inf as infinity, isinf from random import choice from CGSserver.Player import TrainingPlayer from games.TicketToRide.server.Constants import MULTICOLOR, NONE, Scores def Dijkstra(tracks, nbCities, city1, city2, opponent): """Returns the tracks to follow from city1 to ...
thilaire/CodingGameServer
games/TicketToRide/server/NiceBot.py
NiceBot.py
py
7,281
python
en
code
0
github-code
36
10831135327
class student: def stuinput(obj,name,rollno,fee): obj.name = name obj.rollno = rollno obj.fee = fee def stuoutput(obj): print("Student Name=",obj.name) print("Student Rollno=",obj.rollno) print("Student Fee=",obj.fee) obj=student() obj.stuinput("karan",33,4564) o...
Karan-Johly/Python_journey
d13_dynamicclass_3.py
d13_dynamicclass_3.py
py
334
python
en
code
0
github-code
36
42213778138
# !/usr/bin/env python # -*- coding: utf-8 -*- from random import Random __author__ = 'rdy' def create_eamil_code(random_length=6): str_code = '' chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789' length = len(chars) - 1 random = Random() for i in range(random_length): ...
292887172/open
util/email/email_code.py
email_code.py
py
389
python
en
code
0
github-code
36
24793623369
import open3d as o3d import random import csv import numpy as np import torch import torch.utils.data as torchdata from torchvision import transforms import torchaudio import librosa from . import point_transforms as ptransforms class BaseDataset(torchdata.Dataset): def __init__(self, list_sample, opt, max_sampl...
francesclluis/point-cloud-source-separation
dataset/base.py
base.py
py
6,285
python
en
code
8
github-code
36
7946314672
import csv; from datetime import datetime; from urllib.request import urlopen; from bs4 import BeautifulSoup; import os os.chmod("D:\program\python", 0o777); def convertString(string): x,y = string.split(","); string = x + "." + y; return float(string); quote_page = "https://www.avanza.se/...
brjj/Avanza
avanza.py
avanza.py
py
889
python
en
code
0
github-code
36
429935439
import sys from distutils.core import setup version = '1.0.1' libname = 'pawnpy' if sys.maxsize > 2**32: bitness = '.x64' else: bitness = '.x86' if sys.platform == 'win32': libname += bitness + '.dll' else: libname = 'lib' + libname if sys.platform == 'darwin': libname += '.darwin' + bi...
pgurenko/pawnpy
setup.py
setup.py
py
1,071
python
en
code
2
github-code
36
12029401118
#!/usr/bin/env python3 #if __name__ == '__main__': # n = int(input()) # arr = map(int, input().split()) # #sorted_list = sorted(arr) #uniq_list = [] # #for i in sorted_list: # if i not in uniq_list: # uniq_list.append(i) # #print(uniq_list[-2]) """ Below is the improved version (thanks to someone) Above I take ...
NateDreier/Learn_Python
hackerrank/runner_up.py
runner_up.py
py
807
python
en
code
0
github-code
36
4029209236
import pandas as pd from bs4 import BeautifulSoup import requests x = input('ievadi loterijas nosaukumu(eurojackpot;viking-lotto;superbingo;latloto;keno;loto5;joker;joker7) \n') y = [] i = 1 if x =='loto5': web = 'https://www.latloto.lv/lv/rezultati/loto5' source = requests.get(web).text ...
kakaoenjoyer/-odien_paveiksies
sodien_paveiksies.py
sodien_paveiksies.py
py
1,175
python
en
code
0
github-code
36
18036337899
from utils.cs_parser import CsharpParser from utils.html import HtmlMaker import argparse import os def main(filename, destination): with open(filename, 'rt') as file: lines = file.readlines() csparser = CsharpParser() oop_result = csparser.parse_file(lines) name = filename.split(os...
eyeless12/2html
converter.py
converter.py
py
934
python
en
code
0
github-code
36
17837697632
# -*- coding: utf-8 -*- # E # 実質的には重複ありナップサック問題 # dp[i][j]をi番目までのパターンで体力jのモンスターを倒すのに必要な魔力の最小値とする # 重複ありの場合、m個を全て試しているとO(NHH)かかってしまうため、 # dp[i][j] = max(dp[i][j], dp[i][j - A[i]]という形で前の結果を再利用することでO(NH)で済ませる H, N = map(int, input().split()) data = [] for i in range(N): a, b = map(int, input().split()) data.a...
hsuetsugu/atc
ABC153/E.py
E.py
py
1,048
python
ja
code
0
github-code
36
37709437793
from datetime import timedelta from flask import Flask, render_template, session, url_for, request, jsonify, app from pymongo import MongoClient import hashlib import json client = MongoClient('mongodb://bibi:6666667!@3.34.129.197', 27017) db = client.MyPick31 app = Flask(__name__) ############ #라우팅 함수# : 홈 / 디테일 /...
JiHoon-JK/MyPick31
app/run.py
run.py
py
34,199
python
ko
code
0
github-code
36
27784230868
import yaml # save_load将yaml数据流准成python对象 # save_dump将python对象转换成yanl格式 def get_data(): with open('yaml01.yaml', encoding='utf-8') as f: datas = yaml.safe_load(f) return datas def get_yaml(): aa = {'language': ['ruby', 'python', 'java'], 'websites': {'yaml': 'YAML', 'python': 'PYTHON'}} ...
BrandonLau-liuyifei/TestByPython
python_base/test_framework_foundation/yamldemo/getdata.py
getdata.py
py
440
python
en
code
0
github-code
36
10166527789
import os from datetime import datetime import tensorflow as tf import numpy as np import json from sklearn.model_selection import train_test_split DATA_IN_PATH ='./data_in/' DATA_OUT_PATH = './data_out/' FILE_DIR_PATH = DATA_IN_PATH INPUT_TRAIN_DATA_FILE_NAME = 'nsmc_train_input.npy' LABEL_TRAIN_DATA_FILE_NAME = 'ns...
minkyujoo/TCL_NLP
TCL_NLP/textclassifier_modeling.py
textclassifier_modeling.py
py
3,951
python
en
code
0
github-code
36
33221925828
import logging from sqlalchemy import case, create_engine, select from . import schema from .. import client from ..common import Results, date_range from ..constants import MARKS, PERIODS logger = logging.getLogger(__name__) class Store: def __init__(self, bind=None): if bind is None: sel...
dwayne/playwhe
playwhe/cli/store.py
store.py
py
3,488
python
en
code
1
github-code
36
35851739766
from __future__ import print_function from future import standard_library standard_library.install_aliases() import configparser import sys from paste.script import command import http.cookiejar, urllib.request, urllib.error, urllib.parse class PackCommand(command.Command): max_args = 2 min_args = 1 usa...
wyldebeast-wunderliebe/w20e.pycms
w20e/pycms/pack.py
pack.py
py
1,538
python
en
code
11
github-code
36
36896153949
__all__ = [ 'AFSDB', 'CERT', 'CNAME', 'DLV', 'DNAME', 'DNSKEY', 'DS', 'GPOS', 'HINFO', 'HIP', 'ISDN', 'KEY', 'LOC', 'MX', 'NS', 'NSEC', 'NSEC3', 'NSEC3PARAM', 'NXT', 'PTR', 'RP', 'RRSIG', 'RT', 'SIG', 'SOA', 'SPF', ...
RMerl/asuswrt-merlin
release/src/router/samba-3.6.x/lib/dnspython/dns/rdtypes/ANY/__init__.py
__init__.py
py
356
python
en
code
6,715
github-code
36
40857498901
from __future__ import print_function import numpy as np import scipy as sp from healpy import query_disc from numba import jit from picca import constants from picca.utils import print # npb = number of parallel bins (to avoid collision with numpy np) npb = None ntb = None ntm= None npm= None rp_max = None rp_min =...
vserret/picca
py/picca/cf.py
cf.py
py
24,065
python
en
code
0
github-code
36
12601628610
from typing import List class Solution: def deleteAndEarn(self, nums: List[int]) -> int: calculation = [n for n in range(0, max(nums)+1)] arr_size = len(calculation) for i in range(0,arr_size): calculation[i] = 0 for n in nums: calculation[n] += n ...
goldy1992/algorithms
delete_and_earn/delete.py
delete.py
py
523
python
en
code
0
github-code
36
73433072104
#!/usr/bin/env python3 """ sklearn_pack.py: Do Model training with large sparse matrix with sklearn """ __author__ = "Yanshi Luo" __license__ = "GPL" __email__ = "yluo82@wisc.edu" import pandas as pd def random_forest(finalX_train, finalY_train, finalX_test, n_parallel=1, write_csv=False, write_filename='rf_pref.c...
yanshil/STAT628_GM2_Yelp
code/Yanshi/sklearn_pack.py
sklearn_pack.py
py
1,351
python
en
code
0
github-code
36
30524149041
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: HuHao <huhao1@cmcm.com> Date: '2018/7/21' Info: """ import os,traceback,time,socket,multiprocessing from threading import Thread def countdown(n): while n>0: print('T-minus',n) n -=1 time.sleep(2) def start(): # 创建一个线程,target 为目标函数,args 为入参,默...
happy-place/data-base
api-test/py-test/Part3_Python_CookBook/test_thread.py
test_thread.py
py
2,251
python
en
code
1
github-code
36
37634720193
import socket import sys HOST = '127.0.0.1' # The server's hostname or IP address PORT = 8000 # The port used by the server mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect((HOST, PORT)) url = input("enter url in desired format\neg. GET site1/filename.extension\n\n") #get url in desir...
AnchalSoni512/Internals-of-application-server-IAS
Lab1/client.py
client.py
py
1,040
python
en
code
0
github-code
36
29158312367
import sys from layers import WEIGHT_DECAY_KEY sys.path.append('/gan_segmentation/models/discriminators') import largeFOV, smallFOV, stanford_background_dataset_discriminator sys.path.append('/gan_segmentation/models/generators') import fcn32, unet, deeplab_v3 import tensorflow as tf import numpy as np from utils impo...
ChangqingHui/Semantic-Segmentation-with-Adversarial-Networks
updater.py
updater.py
py
14,171
python
en
code
1
github-code
36
30330479959
# !/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/3/26 1:57 下午 # @Author : wangHua # @File : ProductAddConsumer.py # @Software: PyCharm from app.consumers import BaseConsumer from utils import Logger, Http from app.proxies import get_proxy_engine from app.exceptions import NotFoundException, CrawlErrorEx...
whale-fall-wh/producer-consumer
app/consumers/ProductAddConsumer.py
ProductAddConsumer.py
py
2,913
python
en
code
0
github-code
36
34337388292
import cv2 import time def cam(i): bs = cv2.createBackgroundSubtractorKNN(detectShadows = True) camera = cv2.VideoCapture(i) while True: ret, frame = camera.read() fgmask = bs.apply(frame) # img = frame th = cv2.threshold(fgmask.copy(), 244, 255, cv2.THRESH_BINARY)[1] th = cv2.erode(th, cv2.getStructuri...
0x024/MS
Ubuntu/cam.py
cam.py
py
968
python
en
code
23
github-code
36
70562634984
import sys from collections import deque input = sys.stdin.readline M, N, H = map(int, input().rstrip().split()) box = [[list(map(int, input().rstrip().split())) for _ in range(N)] for _ in range(H)] visited = [[[False for _ in range(M)] for _ in range(N)] for _ in range(H)] tomato = [] check = 0 for h in range(H):...
zsmalla/algorithm-jistudy-season1
src/chapter3/3_DFS와BFS(2)/7569_python_임지수.py
7569_python_임지수.py
py
1,089
python
en
code
0
github-code
36
72482582503
from fhcrc_pathology.OneFieldPerReport import OneFieldPerReport import global_strings as gb class DCIS_NuclearGrade(OneFieldPerReport): ''' find the invasive nuclear pleomorphism in the templated pathology report ''' __version__ = 'DCIS_NuclearGrade1.0' def __init__(self): super(DCIS_NuclearGrade, ...
esilgard/BreastMR
fhcrc_pathology/breast/DCIS_NuclearGrade.py
DCIS_NuclearGrade.py
py
641
python
en
code
0
github-code
36
18420782029
from requests_html import HTMLSession s = HTMLSession() location = input("Enter Location: ") url = f'https://www.eldersweather.com.au/climate-history/vic/{location}' r = s.get(url, headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'}...
JPanettieri/historic-weather-scraper
main.py
main.py
py
759
python
en
code
0
github-code
36
37384049849
import logging from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from ..items import BbcNewsItem from readability import Document import html2text from datetime import datetime from goose3 import Goose class BbcSpider(CrawlSpider): name = 'bbc' start_urls = ['https:/...
ahmad-haggag/bbc-news-scraper
scraper/scraper/spiders/bbc.py
bbc.py
py
2,514
python
en
code
0
github-code
36
34885776973
# %% from enum import Enum from typing import List, AnyStr, Callable, Sequence, Union import matplotlib.pyplot as plt import numpy as np import pandas as pd from transformers.pipelines.base import Pipeline import tweepy as tw import plotly.express as px import os import json from transformers import (AutoModelForSequen...
talk2sunil83/BERTLearnings
twitter_sentimant_analysis.py
twitter_sentimant_analysis.py
py
6,031
python
en
code
1
github-code
36
10183802878
import socket import threading IP = socket.gethostbyname(socket.gethostname()) PORT = 56011 ADDR = (IP, PORT) SIZE = 4096 FORMAT = "utf-8" DISCONNECT_MSG = "!DISCONNECT" def handle_client(conn, addr): print("[New Connection] {} Connected.".format(addr)) connected = True while connected: msg = con...
tobeking01/WebServer-TCP-Socket-Programming
MultiThreadServer.py
MultiThreadServer.py
py
1,004
python
en
code
0
github-code
36
74872050985
import io import os # Imports the Google Cloud client library from google.cloud import speech from google.cloud.speech import enums from google.cloud.speech import types credential_path = "C:/Users/nickj/OneDrive/Documents/Capstone/voice.json" os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credential_path # Instanti...
refridgerators/raspicode
voice.py
voice.py
py
1,005
python
en
code
0
github-code
36
9730112950
#///////////////// Use this pattern to gererate a GUI to manipulate a struct. import progSpec import codeDogParser from progSpec import cdlog, cdErr classesToProcess=[] classesEncoded={} currentClassName='' currentModelSpec=None # Code accmulator strings: newWidgetFields='' widgetInitFuncCode='' widgetFromVarsCode...
BruceDLong/CodeDog
pattern_MakeGUI.py
pattern_MakeGUI.py
py
36,319
python
en
code
16
github-code
36
13962392009
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import Http404 from django.shortcuts import render, redirect, get_object_or_404 from django.utils.translation import gettext as _ from django.views.decorators.cache import never_cache from account.templatetag...
helfertool/helfertool
src/registration/views/event.py
event.py
py
10,145
python
en
code
52
github-code
36
2882981479
import requests import json urlApiProductos = "http://localhost:8085/colaboradores" # Petición get response = requests.get(urlApiProductos) print(response) print(response.status_code) print(response.encoding) print(response.headers) print(response.text) producto = json.loads(response.text) print(producto) print(js...
ariasDev/semillero
Python/Curso Python/python/api.py
api.py
py
842
python
es
code
0
github-code
36
13149151210
palabra='HoLa' palabra=list(str.lower(palabra)) contador=0 palabra2=[] diccionario =dict() diccionario = { 'a':1, 'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8, 'i':9, 'j':10, 'k':11, 'l':12, 'm':13, 'n':14, 'ñ':15, 'o':16, 'p':17, 'q':18, 'r':19, 's':20, 't':21, 'u':22, 'v':23, 'w':24, 'x':25, 'y':26 ,'z':27} for i ...
jmarrieta98/Programacion
Python/Codewars/diccionario.py
diccionario.py
py
489
python
en
code
0
github-code
36
11369950241
from unittest import TestCase from guitarpractice.exercises import list_exercises, get_exercise from guitarpractice.models import Sequence class TestListExercises(TestCase): def test_list_of_exercises_is_returned(self): result = list_exercises() expected = { 'exercises': { ...
craigargh/guitar-practice-core
guitarpractice/tests/exercises/test_queries.py
test_queries.py
py
2,102
python
en
code
0
github-code
36
18551322259
from .models import Speaker import csv def to_bool(s): return s == "1" def import_speaker_data(csv_file): with open(csv_file, 'r') as file: reader = csv.DictReader(file) for row in reader: speaker_name_list = [row["First Name"], row["Surname"]] name = " ".join(speaker_...
byronho24/uqds-debating-draw
baseapp/importer.py
importer.py
py
1,072
python
en
code
1
github-code
36
73921571944
import torch import numpy as np def inference(network, image, checkpoint_path): """ Network inference function Args: network: Network object to make the inference image: Numpy array of the image to infer on checkpoint_path: Path to the weights to use for the inference Returns...
ValentinFigue/Images-Restoration
Network/inference.py
inference.py
py
1,037
python
en
code
0
github-code
36
25697455302
''' Created on Sep 26, 2022 @author: estudiante ''' ''' 1. numero = int(input("Introduce un numero: ")) if numero%2 == 0: print("Es par") else: print("Es impar") 2. numero1 = int(input("introduce primer número: ")) numero2 = int(input("Introduce segundo numero: ")) if numero1 == n...
alvarojimeenez/Programacion
Programación/Boletin3.py
Boletin3.py
py
6,230
python
es
code
0
github-code
36
15979499427
import logging class LoggingConfig: """ Configure and use logs with logging for repository use. """ @staticmethod def configureLog(level=logging.INFO, filename="run.log"): """ Configure the logging settings. Args: level (int, optional): The logging level (DEBU...
nemacdonald/otis
src/utils/logger.py
logger.py
py
929
python
en
code
0
github-code
36
25679055608
from rllab.algos.batch_polopt import BatchSampler from math import exp import random import copy class ISSampler(BatchSampler): """ Sampler which alternates between live sampling iterations using BatchSampler and importance sampling iterations. Currently works with vpg, not guaranteed to work with othe...
buduo15/rllab
contrib/alexbeloi/is_sampler.py
is_sampler.py
py
3,827
python
en
code
null
github-code
36
11562594754
from django.contrib import admin from django.urls import path from interview.views import createInterview, showInterviews, uploadResume urlpatterns = [ path('admin/', admin.site.urls), path('', createInterview), path('create', createInterview), path('interviews', showInterviews), path('interviews/<...
strikeraryu/scaler_interview
scaler_interview/urls.py
urls.py
py
441
python
en
code
0
github-code
36
39207374957
# --- carolin schieferstein & jose c. garcia alanis # --- utf-8 # --- Python 3.7 / mne 0.20 # # --- EEG prepossessing - dpx-r40 [WIP] # --- version march 2020 [WIP] import mne import re import glob import os from mne import pick_types, Epochs, combine_evoked import pandas as pd import numpy as np output_dir = '/Volu...
CarolinSchieferstein/Master-DPX-EEG
python_scripts/07_export_epochs.py
07_export_epochs.py
py
8,133
python
en
code
1
github-code
36
74029485864
import re from datetime import datetime def format_date(date): """Format the date to datetime string""" month, day, year = date.split("/") return datetime(int(year), int(month), int(day)).strftime( "%Y-%m-%dT%H:%M:%S%Z" ) def get_ajax_identifier(page_text): """Extract from raw HTML the A...
guicrespo/farascraper
farascraper/farascraper/spiders/utils.py
utils.py
py
504
python
en
code
0
github-code
36
73571223143
import config import regex from models.candidate import Candidate def fuzzy_search(pattern, string, error_max): """Find approximately matching pattern in string Args: pattern (string): regex pattern string (string): where search is performed error_max (int) Returns: error...
TemryL/EyeDocScanner_API
reader_scripts/search.py
search.py
py
6,576
python
en
code
0
github-code
36
947704012
pkgname = "xeyes" pkgver = "1.3.0" pkgrel = 1 build_style = "gnu_configure" hostmakedepends = ["pkgconf", "xorg-util-macros"] makedepends = ["libxmu-devel", "libxt-devel", "libxrender-devel", "libxi-devel"] pkgdesc = "Follow the mouse" maintainer = "q66 <q66@chimera-linux.org>" license = "MIT" url = "https://xorg.freed...
chimera-linux/cports
contrib/xeyes/template.py
template.py
py
573
python
en
code
119
github-code
36
24945678151
# -*- coding: utf-8 -*- # ____ __ __ ___ _ _ _ # |_ /___ / _|/ _|/ __| (_)___ _ _| |_ # / // -_) _| _| (__| | / -_) ' \ _| # /___\___|_| |_| \___|_|_\___|_||_\__| # """Zeff unstructured temporal data.""" __author__ = """Lance Finn Helsten <lanhel@zeff.ai>""" __copyright__ = """Copyright © 2019, Zif...
zeff-ai/ZeffClient
src/zeff/record/unstructuredtemporaldata.py
unstructuredtemporaldata.py
py
2,133
python
en
code
1
github-code
36
3756817154
import jpype as jp from monostrategy import Monostrategy class Kmeans(Monostrategy): def __init__(self,arff_string,weights,nb_seeds,nb_steps): if not jp.isThreadAttachedToJVM(): jp.attachThreadToJVM() Monostrategy.__init__(self,arff_string,weights) self.nb_seeds = int(n...
Alshak/jcl
jcl/methods/kmeans.py
kmeans.py
py
847
python
en
code
0
github-code
36
72242724903
import requests import re from airports.serializers import AirportSerializer, RunwaySerializer, AirportCommSerializer from airports.models import Airport, Runway, AirportComm from datetime import datetime, timedelta, timezone class FlightPlanAPIClient(object): """ API Client class used to construct requests t...
bfolks2/django-aviation
api/flightplan_client.py
flightplan_client.py
py
9,259
python
en
code
2
github-code
36
25460961095
'''import pandas as pd garden_data = pd.read_csv("gardenAll.csv", encoding='euc-kr') plant = "청옥" data2 = garden_data[garden_data['name'] == "청옥"] print(data2['temp(°C)']) print(data2['hd(%)']) print(data2['light(Lux)']) print(data2['water']) temp1 = data2['temp(°C)'] if float(temp1) >= 5: for i in range(5): ...
Yoonseungwook/dailylog
aa.py
aa.py
py
1,601
python
en
code
0
github-code
36
4078678340
"""Figure 1: teaser figure""" import argparse import os import sys from os.path import join SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__)) sys.path.append(join(SCRIPT_DIR, '..')) from common import * import configs import tqdm from constants import OUTPUT_DIR fig_name = 'teaser' fig_dir = join(FIGURE_DIR...
rgl-epfl/differentiable-sdf-rendering
figures/teaser/teaser.py
teaser.py
py
1,970
python
en
code
810
github-code
36
23439474515
def find_unique_delivery_id(arr): histogram = {} # O(n) runtime for item in arr: key = str(item) if key in histogram: histogram[key] += 1 else: histogram[key] = 1 # O(n) runtime for k, val in histogram.iteritems(): if val == 1: ...
KamalNaidu/Competitive_Programming
Week-2/Day-1/Drone_21.py
Drone_21.py
py
346
python
en
code
0
github-code
36
43296737164
from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rthread, rgil def signals_enter(space): space.threadlocals.enable_signals(space) def signals_exit(space, w_ignored1=None, w_ignored2=None, w_ignored3=None): space.threadlocals.disable_signals(sp...
mozillazg/pypy
pypy/module/__pypy__/interp_signal.py
interp_signal.py
py
1,254
python
en
code
430
github-code
36
14366833514
from flask import Flask, Response import json import pickle import pmdarima from datetime import datetime import pandas as pd def predecir(period): pred_temp = pickle.load( open('./modelo_temperatura.p', 'rb') ) pred_hum = pickle.load( open('./modelo_humedad.p', 'rb') ) prediccion_temp = pred_temp.predict...
fer227/API_WeatherPredictor
apiV1/apiV1.py
apiV1.py
py
1,349
python
en
code
0
github-code
36
17253375732
import os import traceback from datetime import datetime, timedelta import pytz import config from manage_transactions import get_first_transaction_timestamp, get_transaction_data from util import logging # structure /terra-data/raw/stats_daily_transaction/<type>/<token>.csv STORE_DAILY_TRANSACTIONS_DIRECTORY = '/te...
joergkiesewetter/terra-analytics
calculate_daily_transaction_data.py
calculate_daily_transaction_data.py
py
10,541
python
en
code
0
github-code
36
36829592590
# mne.python.loading.data import os import numpy as np import mne # 1. Loading data # mne-python库支持直接读取各种格式的数据文件,支持众多EEG数据采集设备 # 主要包括设置数据文件夹,原始数据读取到文件句柄,通过句柄传递给变量 sample_data_folder = mne.datasets.sample.data_path() # 数据文件夹 sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', ...
oca-john/EEG.DeepLearning-xi
Python(EEG)/mne.python.loading.data--.py
mne.python.loading.data--.py
py
2,168
python
zh
code
1
github-code
36
16162661371
#!/usr/bin/env python3 import rospy from Adafruit_PCA9685 import PCA9685 import RPi.GPIO as GPIO from std_msgs.msg import Float32 from geometry_msgs.msg import Twist import tty import termios import sys # Initialise the PCA9685 using the default address (0x40). pwm = PCA9685() # Configure min and max servo pulse len...
oguzhanbzglu/SergeantBot
idu_robot/scripts/turning.py
turning.py
py
3,287
python
en
code
2
github-code
36
71249204904
__author__ = 'zfh' import os import utils import matplotlib.pyplot as plt artistList=set() dir=os.path.join(utils.allResultPath,'bestanalysis') files = os.listdir(dir) for file in files: with open(os.path.join(dir,file),'r') as csvfile: while True: line=csvfile.readline().strip('\n') ...
ifenghao/tianchi_contest
test/plotresults.py
plotresults.py
py
1,360
python
en
code
0
github-code
36
19733948574
n = int(input()) for i in range(n): a = int(input()) if a == int(0): print('NULL') elif a%int(2)!=int(0): if a<int(0): print('ODD NEGATIVE') else: print('ODD POSITIVE') elif a%int(2)==int(0): if a<int(0): print('EVEN NEGATIVE') els...
MasumTech/URI-Online-Judge-Solution-in-Python
URI-1074.py
URI-1074.py
py
357
python
en
code
1
github-code
36
3911965751
import metview as mv # define a view over the area of interest and set land shading on land_shade = mv.mcoast( map_coastline_land_shade=True, map_coastline_land_shade_colour="RGB(0.98,0.95,0.82)", map_coastline_sea_shade=False, map_coastline_sea_shade_colour="RGB(0.85,0.93,1)", ) area_view = mv.geov...
ecmwf/metview-python
examples/UC-03-bufr.py
UC-03-bufr.py
py
1,847
python
en
code
116
github-code
36
20136022872
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import ByteString, Callable, Generic, Tuple, TypeVar from network import UDPLink import torch import numpy as np # import aestream T = TypeVar("T") class Observation(): def __init__(self, tof, bat, imu, uwb): self.tof = ...
jpromerob/MockUpBot
durin/sensor.py
sensor.py
py
1,470
python
en
code
0
github-code
36
4909866886
from tkinter import * from tkinter import ttk import sqlite3 from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import letter, A4 from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.platypus import SimpleDocTemplate,Image import webbrowser root = Tk() ...
Felipe500/CRUD-CADASTRO-CLIENTES-PYTHON-TKINTER-SQLITE
main.py
main.py
py
10,777
python
pt
code
6
github-code
36
23411926390
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('compras', '0181_auto_20160908_2139'), ] operations = [ migrations.Remo...
pmmrpy/SIGB
compras/migrations/0182_auto_20160909_1149.py
0182_auto_20160909_1149.py
py
1,387
python
es
code
0
github-code
36