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
27970246169
# coding=utf-8 import logging import os import uuid import xlwt from django.core.cache import cache from django.core.urlresolvers import reverse from django.db import IntegrityError from django.db import transaction from BanBanTong import constants from BanBanTong.db import models from BanBanTong.db import utils as db_...
xiaolin0199/bbt
apps/BanBanTong/views/system/lesson_teacher.py
lesson_teacher.py
py
11,751
python
en
code
0
github-code
1
22720982859
#!/usr/bin/env python3 from __future__ import annotations import torch from .. import settings from ..utils.broadcasting import _matmul_broadcast_shape, _mul_broadcast_shape from ..utils.deprecation import bool_compat from ..utils.getitem import _noop_index from .dense_linear_operator import DenseLinearOperator, to_...
cornellius-gp/linear_operator.old
linear_operator/operators/cat_linear_operator.py
cat_linear_operator.py
py
18,489
python
en
code
18
github-code
1
2347070900
from django.core.exceptions import ValidationError from django.db import transaction from rest_framework import exceptions, status, viewsets from rest_framework.decorators import action from rest_framework.response import Response from ESSArch_Core.ip.models import Agent, InformationPackage from ESSArch_Core.ip.permis...
ESSolutions/ESSArch_Tools_Producer
ESSArch_TP/profiles/views.py
views.py
py
5,722
python
en
code
4
github-code
1
19360145371
import logging import pandas as pd from zenml import step class IngestData: """ Ingesting data from the data_path provided. """ def __init__(self, path: str): """ Args: data_path: path to the data. """ self.path = path def get_data(self): """ ...
MaruthiKo/customer-satisfaction_mlops
steps/ingest_data.py
ingest_data.py
py
987
python
en
code
0
github-code
1
2949776160
from selenium.webdriver.firefox.options import Options as FirefoxOptions import filesHandler as fh import lpCrawler as lp def scrape_charts(filepath): """ Scrape the data of all the charts of Polish Radio Program 3. """ ff_options = FirefoxOptions() ff_options.add_argument('--headless') driver = lp.LP...
magdalena-natalia/PR3TimeMachine
lpJson.py
lpJson.py
py
434
python
en
code
0
github-code
1
71873135395
import re import sys from deep_translator import GoogleTranslator # Split the text into smaller groups up to 5000 characters without breaking lines so need to split on new lines def split_text(text, max_len=4500): # Split the text into lines lines = text.split("\n") # List of chunks chunks = [...
BaseMax/UnlimitedAutoTranslate
UnlimitedAutoTranslate.py
UnlimitedAutoTranslate.py
py
2,207
python
en
code
10
github-code
1
24870806650
#!/usr/bin/env python3 import lib.exitcode import lib.utilities as utilities import os import shutil import sys from lib.database import Database from lib.database_lib.config import Config from lib.lorisgetopt import LorisGetOpt __license__ = 'GPLv3' def main(): usage = ( "\n" "***************...
aces/Loris-MRI
tools/correct_blake2b_and_md5_hashes_in_database.py
correct_blake2b_and_md5_hashes_in_database.py
py
18,913
python
en
code
10
github-code
1
39546171687
''' 爬虫主程序 从工信部获取并下载《免征车辆购置税的新能源汽车车型目录》,《新能源汽车推广应用推荐车型目录》,《道路机动车辆生产企业及产品》文件,文件储存至 './data/origin_data' @Author: KivenChen @Date: 2019-04-10 ''' import os import asyncio from . import output from .spider import spider_1, spider_2 def main(): base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...
KivenCkl/New_Energy_Vehicles_Info_Crawler
Spider/main.py
main.py
py
1,597
python
zh
code
28
github-code
1
35008997186
import math import stdio import sys # Read four floats x1, y1, x2, and y2 as command-line arguments. x1 = float(sys.argv[1]) y1 = float(sys.argv[2]) x2 = float(sys.argv[3]) y2 = float(sys.argv[4]) sinx1 = math.sin(math.radians(x1)) sinx2 = math.sin(math.radians(x2)) cosx1 = math.cos(math.radians(x1)) cosx2 = math....
amandakwong898/cs110-project1
great_circle.py
great_circle.py
py
534
python
en
code
0
github-code
1
13261468913
import websocket, json, pprint,talib, numpy SOCKET = "wss://stream.binance.com:9443/ws/ethusdt@kline_1m" avg = 0 open_total = [] closed_total = [] high_total = [] low_total = [] SSL_PERIOD = 14 STOCK = "ETHUSD" PAY = 100.00 POSTION = False TRADE_QUANTITY = 0 profit = 0 def on_open(webS): print(" opened conn...
TDysart1/botbot
ethrium.py
ethrium.py
py
4,606
python
en
code
0
github-code
1
38920515345
from flask import Flask from flask import request # `request` is a global object that can be used to access the query string of a url # Create a new Flask instance (passing the current namespace to the Flask initializer) app = Flask(__name__) # Create a route # Note this uses 'pie syntax' to implement a decorator # ...
Crossroadsman/FlaskProject
simple_app.py
simple_app.py
py
2,440
python
en
code
0
github-code
1
18096921378
import requests from bs4 import BeautifulSoup as bs import arrow import csv import pandas as pd from time import sleep def forager(): venue = "Forager" prices = "NaN" month = input("Please enter the number of the month in the form '1': ") for l in range(1, 13): if month == str(l): ...
Astatham98/EventWebScrape
webscrape1/forager.py
forager.py
py
2,955
python
en
code
0
github-code
1
15871446797
# coding=utf-8 from openpyxl import Workbook #在内存中创建一个workbook对象 wb = Workbook() ws = wb.get_active_sheet() print(ws.title) ws.title = u'99乘法表' #设置单元格的值 for row in range(1,10): for col in range(1,10): ws.cell(row = row, column = col).value = row * col #最后保存 wb.save(filename='99乘法表.xls')
stella-chmt/daily_scripts
python/practise_for_yingl_lessons/lesson_1/multiply_sheet.py
multiply_sheet.py
py
359
python
en
code
0
github-code
1
29539726668
from traceback import print_tb from matplotlib import pyplot as pl import numpy as np import re def poly_regression(dataset1): x1 = np.arange(dataset1.size) z1 = np.polyfit(x1, np.log(dataset1),1) exp_1 = np.exp(z1[1]) plot_p1 = [exp_1*np.exp(z1[0]*x) for x in range(50)] return plot_p1 # ...
MatheusMenezes/latent_learning_app
plot_codes/plot_grid.py
plot_grid.py
py
14,212
python
en
code
0
github-code
1
11274134402
import z3 import random special_var_table = {} _var_count = 0 def new_variable(var_type): global _var_count _var_count += 1 if var_type == "Bool": return z3.Bool("Bool" + str(_var_count)) elif var_type == "Int": return z3.Int("Int" + str(_var_count)) else: assert False def...
hsh814/ExtractFix
src/synthesis/second_order/util/common.py
common.py
py
2,587
python
en
code
0
github-code
1
14851062460
import os import sys import numpy as np import cv2 as cv import matplotlib.pyplot as plt def homography_function(x, y, H): # x&y-> N-by-1, H-> 3-by-3, return-> (N-by-1,N-by-1) D = (H[2,0] * x + H[2,1] * y + 1) xs = (H[0,0] * x + H[0,1] * y + H[0,2]) / D ys = (H[1,0] * x + H[1,1] * y + H[1,2]) / D return xs, ...
burakkunkcu/image-stitching
image-stitching.py
image-stitching.py
py
12,882
python
en
code
1
github-code
1
20059712231
import os from setuptools import setup, find_packages exec(open('hops/version.py').read()) def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname), encoding='utf8').read() #python3 except: return open(os.path.join(os.path.dirname(__file__), fname)).read() #python2 se...
logicalclocks/hopsworks-cloud-sdk
setup.py
setup.py
py
1,664
python
en
code
1
github-code
1
22861823283
import json import requests import argparse import sys import os from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By chrom...
PFE-Attack-client/PFE-Attaques-client
platform/my-vuln-app/bot-victim/main.py
main.py
py
2,034
python
en
code
0
github-code
1
3028681836
import numpy as np import tensorflow as tf import extra_keras_datasets.emnist as centr_emnist # See https://github.com/machinecurve/extra_keras_datasets import nest_asyncio nest_asyncio.apply() tf.compat.v1.enable_v2_behavior() tf.compat.v1.graph_util.extract_sub_graph # Final evaluation in test dataset print("Eval...
fwilhelmi/blockchain_enabled_federated_learning
Code & Results/TensorFlow code/evaluate_models_test_dataset.py
evaluate_models_test_dataset.py
py
1,279
python
en
code
27
github-code
1
20920450281
#!/usr/bin/env python3 # publisher for a specific img folder import rospy from std_msgs.msg import String from detection_only.msg import Bbox_6, Bbox6Array from sensor_msgs.msg import Image import json import time import cv2 from os import listdir from os.path import isfile, join from cv_bridge import CvBridge import ...
ziyan0302/Yolov5_DeepSort_Pytorch_ros
src/detection_only/src/img_pubtest.py
img_pubtest.py
py
1,994
python
en
code
5
github-code
1
43216431795
# Imprimir los 20 años bisiestos siguientes a 2016 """ Para que un año sea bisiesto debe ser divisible por 4, excepto aquellos divisibles entre 100 pero no entre 400 """ maxBisiestos = 20 n = 2017 for i in range(maxBisiestos): bisiesto = False while not bisiesto: if n % 4 == 0 or n % 400 == 0 and not n ...
gasparpd/SGEM-python
EjerciciosIniciales/practica/ej10.py
ej10.py
py
473
python
es
code
0
github-code
1
14685003387
def load_caves(filename): file = open(filename, "r") lines = file.readlines() caves = CaveSystem() for line in lines: passage = line.strip().split("-") caves.add_passage(passage[0], passage[1]) return caves class CaveSystem: def __init__(self): self.caves = {} def...
sea36/aoc-2021
aoc_12.py
aoc_12.py
py
2,496
python
en
code
0
github-code
1
17977450408
# implementation based on DeepLTL https://github.com/reactive-systems/deepltl import sys import importlib import os.path as path import subprocess import re from timeit import default_timer as timer from typing import Tuple import multiexit from dlsgs.utils import ltl_parser DEFAULT_BINARY_PATH = "bin" def solve_...
ju-kreber/Transformers-and-GANs-for-LTL-sat
impl/dlsgs/data_generation/ltl.py
ltl.py
py
8,473
python
en
code
1
github-code
1
74081283232
from unittest.mock import patch, Mock import pytest from item_db import ItemDB from shopping_cart import ShoppingCart @pytest.fixture def cart(): return ShoppingCart(4) def mock_get_price(item: str): if item == 'pear': return 2 if item == 'banana': return 3 def test_can_add_item_to_c...
lorencmateusz/learning-tests
test_shopping_cart.py
test_shopping_cart.py
py
1,091
python
en
code
0
github-code
1
8980871742
import glob import os import sys if not os.geteuid() == 0: sys.exit('You must be root to run this application, please use sudo and try again.') # fix input def in python2 try: input = raw_input except NameError: pass PATHS = ['.']; for path in PATHS: path = os.path.abspath(path) projects = glob.gl...
MHMcz/docker-project-run
docker-project-run.py
docker-project-run.py
py
818
python
en
code
0
github-code
1
16538322007
import plotly.express as px import pandas as pd from datastructure import * from sklearn.decomposition import PCA import plotly.graph_objects as go def createSPLOM(data, idx, indexRange, maxComp): O = np.transpose(data.series[idx].orientations, (1, 0, 2))[indexRange[0]:indexRange[1]] O = O.reshape(O.shape[0],...
marinaevers/asevis
Components/splom.py
splom.py
py
1,208
python
en
code
0
github-code
1
40086162188
import argparse import pprint import shutil from pathlib import Path import tensorflow as tf import yaml from tensorflow import keras from dataset_factory import DatasetBuilder from losses import CTCLoss from metrics import SequenceAccuracy from models import build_model parser = argparse.ArgumentParser() parser.add...
FLming/CRNN.tf2
crnn/train.py
train.py
py
2,049
python
en
code
144
github-code
1
1972302698
# This demo shows how to plot the contour plot for given function, with resultant of the partial derivatives displayed # as arrows import numpy as np import matplotlib.pyplot as plt import math def func(x, y): z = y - x - 2 * x ** 2 - 2 * x * y - y ** 2 return z x = np.linspace(-2, 0, 20) y = np.linspace(1...
Homingdung/numerical_analysis_py
fieldsVisualize.py
fieldsVisualize.py
py
521
python
en
code
0
github-code
1
34013737364
from heapq import * from collections import deque from collections import Counter def schedule_tasks(tasks, k): # We should always try to schedule the task with the highest count. # So, we can get the counts for each task and add to max Heap. # Then, pop from maxHeap to schedule (k + 1) tasks # For each task,...
kjingers/Leetcode
Problems/TaskScheduler/TaskScheduler.py
TaskScheduler.py
py
1,856
python
en
code
0
github-code
1
25191387496
import os import pathlib import gzip from itertools import groupby from typing import List, Dict, TextIO, Tuple, Union import numpy as np import pandas as pd import plot # type aliases NX_DICT = Dict[str, List[int]] AUN_DICT = Dict[str, float] class AssemblyCollection: def __init__( self, pat...
W-L/pauNy
pauNy/lib.py
lib.py
py
10,096
python
en
code
1
github-code
1
70852654755
import csv from collections import OrderedDict from statistics import mean def calculate_averages(input_file_name, output_file_name): f1 = open(input_file_name) reader = csv.reader(f1) for row in reader: name = row[0] grd = list() for grade in row[1:]: grd.append(float(...
NafisehAbrishami/Python_and_C_Projects
Project-Source1.py
Project-Source1.py
py
3,671
python
en
code
0
github-code
1
33310802794
# Command tool to view system statisitics from commands import Command import psutil import math def convert_size(size_bytes): """Converts a number of bytes to its respective unit such as GB or MB""" if size_bytes == 0: return "0B" size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") i ...
grqphical07/Phosphate
commands/stats.py
stats.py
py
2,047
python
en
code
0
github-code
1
26443195131
import pymongo import os from datetime import datetime import math import re import pymongo import keys # .gitgnored file from bson.objectid import ObjectId from bson.son import SON import atexit import math CONNECTION = None PAGESIZE = 10 def date_now(): """ Needed to keep the same date in python and mong...
ssi-dk/BeONE-old-version
bifrost/bifrost_mongo_interface.py
bifrost_mongo_interface.py
py
8,965
python
en
code
0
github-code
1
42951189825
""" Created on Jan 4, 2017 Inception V3 2 Tower model implementation @author: Levan Tsinadze """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf map1 = 32 map2 = 64 num_fc1 = 700 # 1028 num_fc2 = 10 reduce1x1 = 16 dropout = 0.5 ...
ChelovekHe/tensorflow_ann_modules
cnn/inceptions/network_config.py
network_config.py
py
6,101
python
en
code
null
github-code
1
39884501056
"""Flame graph module.""" import inspect import runpy import signal import time from collections import defaultdict from vprof import base_profiler _SAMPLE_INTERVAL = 0.001 class _StatProfiler: """Statistical profiler. Samples call stack at regular intervals specified by _SAMPLE_INTERVAL. """ def ...
nvdv/vprof
vprof/flame_graph.py
flame_graph.py
py
6,376
python
en
code
3,934
github-code
1
2371194732
import json import os from datetime import timedelta, date, datetime from flask import render_template, request, redirect, Response, send_from_directory, session, url_for, abort from flask.views import MethodView from flask_admin.contrib import sqla from flask_security import current_user from clocking.models import ...
eaudeweb/mac-logging
clocking/api/view.py
view.py
py
6,160
python
en
code
0
github-code
1
26355834775
import json, os, platform, subprocess, sys, time from datetime import datetime, timedelta from operator import itemgetter isPy3 = True try: from colorama import init init() except ImportError as e: pass scripts_lib_path = os.path.join(os.path.dirname(__file__), "lib") this_platform_system = str(platform...
pgEdge/nodectl
cli/scripts/api.py
api.py
py
20,709
python
en
code
7
github-code
1
75108619553
#!/usr/bin/python3 """ 江西水库信息 Author: cg Date: 2020/7/11 15:58 """ import json import urllib.request from crawl.spiders.base_spider import BaseSpider from operate.schedulermgr import SchedulerMgr from db.mapping.jiangxi_reservoir.jiangxi_reservoir import JiangxiReservoir from db.mapping.jiangxi_reservoir.jiangxi_r...
0827cg/cgspiders
crawl/spiders/jiangxi_reservoir.py
jiangxi_reservoir.py
py
3,313
python
en
code
0
github-code
1
35483658265
from nltk.compat import gutenberg gutenberg.fileids() dir(gutenberg) JM_book = gutenberg.words('milton-paradise.txt') len(JM_book) sample_JM = JM_book[100:150] sample_JM len(sample_JM) set_JM = set(sample_JM) set_JM len(set(set_JM)) type(set_JM) sorteSet_JM = sorted(set_JM) sorteSet_JM len(sorteSet_JM) print("mil...
FernandoMartinezJara/Nltk
curso2/2 Organizing Words by Set and Sorted.py
2 Organizing Words by Set and Sorted.py
py
376
python
en
code
0
github-code
1
13967642156
import boto3 from colorama import Fore, Back, Style from functions import create_client def help(): print(Fore.YELLOW + "\n================================================================================================" + Style.RESET_ALL) print("[+] Module Description:\n") print("\tThis module will enumer...
MiedzinskiBuck/Kintoun
modules/enumeration/s3_enumerate_buckets.py
s3_enumerate_buckets.py
py
2,776
python
en
code
6
github-code
1
7065938845
""" Původní návrh: class Board - grid * reset * draw * score - z pohledu hráče * score_wnd5 * wintie - globálně, 0 = jedeme dál, 1/-1 win hráč, jinak = tie * wintie_wnd5 """ import pygame import random import math from pyshqorky.players import * class Board: """ Třída pro práci s herní deskou. Jsou zde informace ...
zdenekkhol/pyshqorky
pyshqorky/board.py
board.py
py
14,134
python
cs
code
0
github-code
1
15554588830
import os import smtplib import ssl from email.message import EmailMessage from email.utils import formataddr from dotenv import load_dotenv from pathlib import Path # Load the environment variables current_dir = Path(__file__).resolve().parent if "__file__" in locals() else Path.cwd() envars = current_dir / ".env" l...
martgjepali/E-mail-Automation
send_email.py
send_email.py
py
2,464
python
en
code
0
github-code
1
36170383161
from volatility3.framework import exceptions, renderers from volatility3.framework.configuration import requirements from volatility3.framework.interfaces import plugins from volatility3.framework.objects import utility from volatility3.framework.symbols import mac class Ifconfig(plugins.PluginInterface): """List...
volatilityfoundation/volatility3
volatility3/framework/plugins/mac/ifconfig.py
ifconfig.py
py
2,047
python
en
code
1,879
github-code
1
38812425841
import numpy as np import cv2 img=cv2.imread('img4.png',0) alto,ancho=img.shape[:2] img1=np.zeros([alto, ancho], np.uint8) img2=np.zeros([alto, ancho], np.uint8) img3=np.zeros([alto, ancho], np.uint8) k = np.array([[0, 1, 0], [1, 6, 1], [0, 1, 0]])/10 k1 = np.array([[0, -1, 0], [-1, 5, -1], [0, -1, 0]]) img...
jaime1315321/VisionArtificial2022_2
andres_carpeta/MATERAIAL COMPARTIDO/vision/sebas/Punto_e.py
Punto_e.py
py
1,991
python
es
code
0
github-code
1
34154846862
#!/usr/bin/python # -*- coding: iso-8859-1 -*- from Tkinter import * import Tkinter as tk from math import cos,sin,pi,ceil import sys, time from random import randrange class smallGauge2(Frame): def __init__(self,master,size,minValue,maxValue,stepValue): Frame.__init__(self,master,borderwidth=5,relief=GRO...
bwhitelock/elmobd
smallGauge2.py
smallGauge2.py
py
3,618
python
en
code
1
github-code
1
17716143801
import unittest from dosma.models import util as m_util class TestUtil(unittest.TestCase): def test_aliases_exist(self): # Verify that none of the supported segmentation models have overlapping aliases models = m_util.__SUPPORTED_MODELS__ alias_to_model = {} # noqa: F841 for m i...
ad12/DOSMA
tests/models/test_util.py
test_util.py
py
1,135
python
en
code
49
github-code
1
31551591291
# This code is written to extract electronic band structure data from V.A.S.P. calculation results. import codecs import re import linecache # 这个模块非常适合根据给出的行号, 从文本文件中读取指定行的数据 import numpy as np class vasp: def __init__(self): self.name = vasp ##############################################...
MajestyV/VASPWheels
VaspWheels/GetElectronicBands.py
GetElectronicBands.py
py
17,172
python
zh
code
5
github-code
1
6022783824
import time import multiprocessing from functools import partial from app import App CPU_COUNT = 4 # multiprocessing.cpu_count() TEST_TIME = 60 * 1 def run_application(index: int, test_time: int) -> int: print("Starting application:", index) app = App() app.start() # queue_sizes = [] for i in ...
EvgeniiTitov/naive-events-processing
run_app_multicore.py
run_app_multicore.py
py
889
python
en
code
0
github-code
1
37191536675
load("//:python.bzl", "PYTHON2", "PYTHON3") def _pytest_main_impl(ctx): substitutions = { "@@INTERPRETER@@": ctx.attr.interpreter, "@@TEST_PATH@@": ctx.file.src.short_path, } ctx.actions.expand_template( template = ctx.file._template, output = ctx.outputs.main, subs...
apt-itude/rules_pip
tools/pytest/rules.bzl
rules.bzl
bzl
1,477
python
en
code
30
github-code
1
26813527429
import os import numpy as np import pandas as pd from tqdm import * def label2csv(input_file, output_file, labels_file, train_dir): with open(labels_file, 'r', encoding='utf-8') as f: labels = f.readlines() labels = [a.strip() for a in labels] n_labels = len(labels) with open(input_file, 'r...
gen0924/ECG-HEFEI
round2/code/prep/ecg_prep.py
ecg_prep.py
py
7,039
python
en
code
6
github-code
1
72409330274
N = int(input()) magic = list(map(int, input().split())) Q = int(input()) target_stones = [int(input()) for _ in range(Q)] magic_graph = {n + 1: [magic[n], magic.count(n + 1)] for n in range(N)} states = [-1] * (N + 1) moves = 0 states[N] = 0 change = True while change: change = False remove = [] for n...
HliasOuzounis/xtreme
Magic Stones I (unsolved)/parents.py
parents.py
py
726
python
en
code
1
github-code
1
16735200242
# coding=utf-8 from charm.toolbox.pairinggroup import * from utils.newsecretutils import Utils from charm.toolbox.ABEncMultiAuth import ABEncMultiAuth import re # from newjson import ElementEncoder, ElementDecoder import utils.newjson as newjson import queue import time import threading debug = False import newma impo...
scottocs/OFE-ABE
Alice.py
Alice.py
py
4,244
python
en
code
0
github-code
1
15948730497
from datetime import datetime from django.contrib import messages from django.contrib.auth import get_user_model from django.db.models import F, Subquery, Count, Q from django.http.response import JsonResponse from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.decorators import lo...
NirushaaaR/CTF-platform-final-project
src/game/views.py
views.py
py
5,996
python
en
code
0
github-code
1
41755387984
# Server program import socket from _thread import * # ***************************************************** # ADD the IP-address of your computer and pick a Port: IP = '192.168.1.18' PORT = 2345 # ***************************************************** # List of all the sockets connected to the server. connections =...
Marhav/Computer-Network-and-Cloudservices-Portfolio-1
server.py
server.py
py
1,281
python
en
code
0
github-code
1
22048063398
import re from tkinter import Tk, Button, Entry, Label, Radiobutton, StringVar, Text from voiceAtis import VoiceAtis class VoiceAtisGUI(object): STEP_INTERVAL = 25 def __init__(self): # Init attributes. # Gui master. self.master = None # Gui elements. self.source = N...
Sowintuu/voiceAtis
voiceAtis/voiceAtisGUI.py
voiceAtisGUI.py
py
6,016
python
en
code
1
github-code
1
38841332585
import sqlalchemy from sqlalchemy.ext.declarative import declarative_base #Crear engine engine = sqlalchemy.create_engine("sqlite:///slangs2.db") Base = declarative_base() #Crear diccionario class Diccionario(Base): __tablename__ = "diccionario" id = sqlalchemy.Column(sqlalchemy.Integer, primary...
mtamburrelli/slangsSQLAlchemy
Slangs2(SqlAlchemy)/slangsTarea2(SQLALCHEMY).py
slangsTarea2(SQLALCHEMY).py
py
4,417
python
es
code
0
github-code
1
6127715262
from bs4 import BeautifulSoup import re from random_uk_bank_account.client.vocalink import VocalinkApi from random_uk_bank_account.utils.exceptions import ErrorInferringVocalinkVersions SORT_CODE_SUB_LINK_TEXT = "Sorting Code Substitution Data" MODULUS_WEIGHT_TABLE_LINK_TEXT = "Modulus weight table data" def _extrac...
j-puri/random-uk-bank-account
random_uk_bank_account/vocalink/vocalink_version.py
vocalink_version.py
py
978
python
en
code
0
github-code
1
18709087270
# Dictionary and counter in Python to find winner of election print("======== Counter + Sorted + Slicing ========") from collections import Counter def winner(input): votes = Counter(input) dic = {} # output : {4: [], 2: [], 3: []} for value in votes.values(): dic[value] = [] # output : ...
dilipksahu/Python-Programming-Example
Dictionary Programs/findElectionWinner.py
findElectionWinner.py
py
1,507
python
en
code
0
github-code
1
4517271354
# Допустим, что self. labell и self. label2 ссылаются на два элемента интерфейса Label. # Напишите фрагмент кода, который упаковывает эти два элемента таким образом, чтобы # они были расположены в своем родительском элементе интерфейса максимально слева. import tkinter class MyGUI: def __init__(self): se...
su1gen/python-homework
lesson08HW/task02.py
task02.py
py
957
python
ru
code
0
github-code
1
3294429630
import time from matplotlib import pyplot as plt from util import make_random import algorithms class Config: SORTING_ALGORITHMS = algorithms.__all__ # SORTING_ALGORITHMS = [algorithms.bubble_sort, algorithms.insertion_sort, algorithms.selection_sort, algorithms.merge_sort, algorithms.quick_sort] NUM_RA...
michael-lesirge/intermediate-programming-class
sorting/time_complexity_graph.py
time_complexity_graph.py
py
1,565
python
en
code
0
github-code
1
39925854328
from tkinter import * from tkinter import ttk class MyApp(Tk): def __init__(self): super().__init__() self.geometry('950x500+100+100') self.NewTree = [] label = Label(self,text='Table with some data', font=("Arial Bold", 25)) label.pack() self.addLi...
vytautasmatukynas/Python-Random-Learning-Testing
DESKTOP_DEV/tkinter/test_add_entryboxes_tk.py
test_add_entryboxes_tk.py
py
2,675
python
en
code
0
github-code
1
31980288440
from django.urls import path from . import views app_name = 'pages' urlpatterns = [ path('', views.index, name='index'), path('fare/', views.fare, name='fare'), path('about-us/', views.about, name='aboutus'), path('contact-us/', views.contactus, name='contactus'), path('complaints/', views.complai...
saidulroney/nuist-pms
pages/urls.py
urls.py
py
347
python
en
code
0
github-code
1
29591673257
# # Author: Dillon Barr # Description: This program takes user input and builds # a neubulon ship to the desired length and layers. largeLayers = int(input("Large Layers on bottom: \n")) mediumLayers = int(input("Medium Layers on bottom: \n")) smallLayers = int(input("Small Layers on bottom: \n")) frontLe...
DIllon-bot5000/CSC110-Projects
nebulon.py
nebulon.py
py
1,761
python
en
code
0
github-code
1
6160180783
class NewAlbum: def leastAmountOfCDs(self, nSongs, length, cdCapacity): canFill = cdCapacity / (length + 1) while (canFill + 1) * length + canFill <= cdCapacity: canFill += 1 if canFill % 13 == 0: canFill -= 1 dp = [0 for x in range(nSongs+1)] for i in range(1, nSongs+1): canTry = min(i, canFill) ...
yabincui/topcoder
dp/NewAlbum.py
NewAlbum.py
py
487
python
en
code
0
github-code
1
34541456179
import praw import gspread from oauth2client.service_account import ServiceAccountCredentials import bmemcached import re import time import os import json import threading ARTIST_COL = 0 ALBUM_COL = 1 SCORE_COL = 2 SUBREDDITS = 'fantanoforever+hiphopheads' COMMAND = re.compile('!fantanobot (.*)', re.IGNORECASE) U...
itsjackgardner/FantanoBot
responder.py
responder.py
py
5,602
python
en
code
0
github-code
1
43513383768
''' 剑指 Offer 07. 重建二叉树 输入某二叉树的前序遍历和中序遍历的结果,请重建该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。 例如,给出 前序遍历 preorder = [3,9,20,15,7] 中序遍历 inorder = [9,3,15,20,7] 返回如下的二叉树: 3 / \ 9 20 / \ 15 7 ''' # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # ...
km1994/leetcode
topic13_tree/offer07_buildTree/interview.py
interview.py
py
3,102
python
zh
code
24
github-code
1
8594332187
## The descriptor checksum functions are taken from Andrew Chow's repository ## Thanks Andrew <3 ## https://github.com/achow101/output-descriptors def PolyMod(c, val): c0 = c >> 35 c = ((c & 0x7ffffffff) << 5) ^ val if (c0 & 1): c ^= 0xf5dee51989 if (c0 & 2): c ^= 0xa9fdca3312 if (c...
PulpCattel/Spawn
advanced/watch_only.py
watch_only.py
py
2,306
python
en
code
2
github-code
1
22352902088
# a case has a number of stones, value a and value b class Case: def __init__(self, number_of_stones, a, b): self.number_of_stones = number_of_stones self.a = a self.b = b def find_last_stones(self): result = [] # we already have the first stone which is always 0 ...
gianglp/hackerrank
manasastones/src/Solution.py
Solution.py
py
1,766
python
en
code
0
github-code
1
17125680639
''' Author: Theo_hui Date: 2021-08-17 10:18:10 Descripttion: ''' # # @lc app=leetcode.cn id=3 lang=python3 # # [3] 无重复字符的最长子串 # # @lc code=start class Solution: # 双指针 滑动窗口法 def lengthOfLongestSubstring(self, s: str) -> int: res,left,c_dicts = 0,-1,{} #结果 左指针 字符最右下标 for right,c in enumerate(s)...
HTmonster/LeetcodeRepo
Codes/003_lengthOfLongestSubstring/3.无重复字符的最长子串.py
3.无重复字符的最长子串.py
py
778
python
zh
code
0
github-code
1
28096738039
import requests from text2speech.modules import RemoteTTS, TTSValidator class MaryTTS(RemoteTTS): PARAMS = { 'INPUT_TYPE': 'TEXT', 'AUDIO': 'WAVE_FILE', 'OUTPUT_TYPE': 'AUDIO' } def __init__(self, config=None): config = config or {"lang": "en-us", ...
HelloChatterbox/text2speech
text2speech/modules/mary_tts.py
mary_tts.py
py
2,017
python
en
code
2
github-code
1
16572439195
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns sns.set(style="whitegrid") sns.set_context("paper", font_scale=1.5) # read entire results data = pd.read_csv("../CSV/jmh-result.csv") # filter Benchmarks data = data.loc[data['Benchmark'].str.contains("OneShot")] # names ar...
huti26/project-loom-analysis
Plots/Seaborn/JMH/Scripts/OneShot-stackDepths-as-columns.py
OneShot-stackDepths-as-columns.py
py
1,252
python
en
code
0
github-code
1
8404044280
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Класс управления картой 2GIS. """ import jinja2 from . import double_gis_util from ic.utils import extfunc __version__ = (0, 1, 1, 1) # Шаблон результирующего HTML документа HTML_TEMPLATE = '''<!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
XHermitOne/defis3
analitic/analitic/double_gis/double_gis_map.py
double_gis_map.py
py
5,543
python
ru
code
0
github-code
1
36390024180
import os import numpy as np import torch import torch.utils.data as data from torch.utils.tensorboard import SummaryWriter from torchvision import transforms from tqdm.notebook import tqdm from dataset import MolecularDataset from pointnet import PointNetCls writer = SummaryWriter() # hyper parameters LR = 0.001...
HeatEnergists/PointNet
regression/train.py
train.py
py
3,150
python
en
code
1
github-code
1
26661711808
#!/usr/bin/env python3 """ Exemplo de funções """ """ f(x) = 5 *x/2 """ __version__ = "0.0.1" __author__ = "Rafael Freitas" __license__ = "Unlicense" def f(x): return 5 * (x/2) print(f(10)) print(f(10) == 25) def double(x): return x * 2 def print_in_super(text): print(text.upper()) print_in_super(...
rafaelhfreitas/python_base
funcoes.py
funcoes.py
py
902
python
en
code
0
github-code
1
10867699789
import numpy as np import pandas as pd from matplotlib import pyplot as plt from sklearn.cluster import KMeans df = pd.read_csv('dataset.csv') X = np.array(df) c_x = np.array([0.1,0.3]) c_y = np.array([0.6,0.2]) centroids = np.array(list(zip(c_x,c_y))) print(centroids) model = KMeans() model.fit(X, centroids) pl...
yogeshwarram/LP3-2
Kmeans.py
Kmeans.py
py
491
python
en
code
0
github-code
1
10220722502
import types, sys from . import termcap # somewhat arbitrary to look at stdout, but that's what the log module uses if sys.stdout.isatty(): class Module(types.ModuleType): def __init__(self): self.__file__ = __file__ self.__name__ = __name__ self.num_colors = termcap.get...
17twenty/pwntools
pwnlib/term/text.py
text.py
py
2,775
python
en
code
null
github-code
1
11344865437
from itertools import permutations import math # 소수 판별 함수 def is_prime_number(x): if x < 2: return False for i in range(2, int(math.sqrt(x)) + 1): if x % i == 0: return False return True def solution(numbers): answer = set() for length in range(1, len(numbers) + 1): ...
CHOJUNGHO96/algorithm
프로그래머스_고득점kit/완전탐색/2단계_소수찾기2.py
2단계_소수찾기2.py
py
560
python
en
code
0
github-code
1
33499976948
import numpy as np import pandas as pd from scoit import sc_multi_omics import time def load_data(): expression_data = pd.read_csv("data/PEA_STA/expression_data.csv", index_col=0) protein_data = pd.read_csv("data/PEA_STA/protein_data.csv", index_col=0) cell_stage = np.array(pd.read_csv("data/PEA_STA/cell_s...
deepomicslab/SCOIT
examples/case_studies/PEA_STA_analysis.py
PEA_STA_analysis.py
py
1,299
python
en
code
2
github-code
1
71015673315
# Title: 원영이는 ZOAC과 영원하고 싶다 # Link: https://www.acmicpc.net/problem/16723 import sys import math sys.setrecursionlimit(10 ** 6) read_single_int = lambda: int(sys.stdin.readline().strip()) def solution(n: int): s = 0 bin_num = bin(n)[2:] sums = [2, 4] for i in range(2, len(bin_num...
yskang/AlgorithmPractice
baekjoon/python/wonyoung_want_to_be_with_zoac_forever_16723.py
wonyoung_want_to_be_with_zoac_forever_16723.py
py
1,182
python
en
code
1
github-code
1
72111655074
import re import math #File input helpers def pretty_print_answer(part, answer): print('Answer to part {num}: {ans}'.format(num=part, ans=answer)) def read_lines(file_name, is_strip=True): file = open(file_name) lines = [s for s in file.readlines()] file.close() if is_strip: lines = [s.str...
akaps/advent_of_code
utils.py
utils.py
py
1,577
python
en
code
0
github-code
1
22504405759
import sys from collections import deque input = sys.stdin.readline d = [(-1, 0), (1, 0), (0, -1), (0, 1)] def dfs(r, c, llst): global max_ if lst[r][c] not in llst: llst.add(lst[r][c]) for dr, dc in d: nr = r + dr nc = c + dc if 0 <= nr < R and 0 <= nc...
Kminwo-o/BaekJoon-Algorithm
백준/Gold/1987. 알파벳/알파벳.py
알파벳.py
py
637
python
en
code
0
github-code
1
72799954595
import unittest from django.contrib.auth.models import User from django_reputation.models import (Reputation, ReputationAction, UserReputationAction, Permission, ReputationContent) import django_reputation.config as config from django_reputation.decorators import ReputationRequire...
genghisu/eruditio
eruditio/shared_apps/django_reputation/tests.py
tests.py
py
6,802
python
en
code
0
github-code
1
72115275875
"""Misc Migration.""" from masoniteorm.migrations import Migration class Misc(Migration): def up(self): """ Run the migrations. """ with self.schema.create("miscs") as table: table.increments("id") table.string("misc_name") table.string("misc_im...
knguyen111601/TINKER_Backend
databases/migrations/2021_12_09_073254_Misc.py
2021_12_09_073254_Misc.py
py
505
python
en
code
1
github-code
1
33520509892
import os import sys import time import pytest def test_modules(): topdir = os.path.dirname(__file__) for dirpath, _, filenames in os.walk(topdir): for fname in filenames: if _is_test_module(fname): yield os.path.join(dirpath, fname) def _is_test_module(fname): return...
robotframework/RIDE
utest/time_tests.py
time_tests.py
py
1,321
python
en
code
910
github-code
1
27701560902
import json import argparse from typing import Text, Dict, List def render_embedding(active: List[int], height: int, width: int) -> None: for row in range(height): print("|", end="") for col in range(width): i = row * width + col print("X" if i in active else " ", end="") ...
RasaHQ/semantic-map-embedding
scripts/view_smap.py
view_smap.py
py
1,651
python
en
code
0
github-code
1
6908770297
import json from django.http import HttpResponse from django.shortcuts import render from django.template.loader import render_to_string from django.views.decorators.csrf import csrf_exempt from django.views.generic.base import View from hipsterboard.board.models import Player from hipsterboard.board.models import It...
Olivia5k/hipsterboard
hipsterboard/board/views.py
views.py
py
1,530
python
en
code
0
github-code
1
27211792693
from generic.object import Object class NapsterTrackQuality(Object): @staticmethod def from_raw_data(raw_data): # qualities = [ # {} # ] track_qualities = [] for quality in raw_data['formats']: track_qualities.append('{}_{}'.format(quality['name'].split...
KGTasa/chimera
napster/track_quality.py
track_quality.py
py
667
python
en
code
18
github-code
1
20248326794
import os import h3.api.numpy_int as h3 import numpy as np from scipy import stats from grids_toolbox import H3Grids from indicator_toolbox import Indicator, dist_unit_converter class ProximityIndicator(Indicator): def __init__(self, H3, name='proximity', Table=None): super().__init__(H3, name, Table) ...
csl-hcmc/SaiGon-Peninsula
Software/L3_SZ_CityScope-cw_dev/backend/proximity_indicator.py
proximity_indicator.py
py
8,841
python
en
code
2
github-code
1
21099703898
# coding: utf8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from copy import deepcopy import gc gc.enable() import time import numpy as np from pyensemble.utils_const import DTY_FLT, DTY_BOL, GAP_MID, GAP_INF #================================== # \ci...
eustomaqua/PyEnsemble
pyensemble/pruning/optimization_based/DREP.py
DREP.py
py
3,875
python
en
code
8
github-code
1
8249401658
import inspect import types __all__ = ["aliases", "expose", "make_callable", "AWSpiderPlugin"] EXPOSED_FUNCTIONS = {} CALLABLE_FUNCTIONS = {} MEMOIZED_FUNCTIONS = {} FUNCTION_ALIASES = {} def aliases(*args): def decorator(f): FUNCTION_ALIASES[id(f)] = args return f return decorator def ...
wehriam/awspider
awspider/plugin.py
plugin.py
py
2,859
python
en
code
19
github-code
1
75249726112
# coding: utf-8 # In[4]: import sys get_ipython().system('{sys.executable} -m pip install tweepy') #Import the necessary methods from tweepy library from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream #Variables that contains the user credentials to access Twitter...
hameedmf/news_app
TwitterExtraction.py
TwitterExtraction.py
py
1,245
python
en
code
0
github-code
1
39726016923
SRCLANGUAGES = { 'Afrikaans': 'afr', 'Amharic': 'amh', 'Arabic': 'ara', 'Assamese': 'asm', 'Azerbaijani': 'aze', 'Belarusian': 'bel', 'Bengali': 'ben', 'Tibetan': 'bod', 'Bosnian': 'bos', 'Breton': 'bre', 'Bulgarian': 'bul', 'Catalan; Valencian': 'cat', 'C...
Shin-Hansol/TheMenu
server/TheMenu/sourceLanguage.py
sourceLanguage.py
py
2,562
python
ne
code
0
github-code
1
36921040940
import requests, os, json, time, argparse, threading, urllib from bs4 import BeautifulSoup import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def create_job(result): from pandas.io.json import json_normalize try: address = result['jobLocation']['address']['addressLocali...
sdf94/jobsearchtool
jobsearch/jobsearch/glassdoor.py
glassdoor.py
py
3,299
python
en
code
0
github-code
1
18325913004
#import dependencies import csv from ctypes import cast import os #declare variables candidate =[] diana_votes = 0 raymon_votes =0 caspar_votes=0 total = 0 #set path to csv path = os.path.join('Resources','election_data.csv') output_path = os.path.join('analysis','output.txt') #loop through file with open(path) as cs...
joshuasamuel4825/python-challenge
PyPoll/main.py
main.py
py
2,423
python
en
code
0
github-code
1
13734252379
# -*- coding: utf-8 -*- from django.db import models, migrations import accounts.models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('base', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
domino14/Webolith
djAerolith/accounts/migrations/0001_initial.py
0001_initial.py
py
1,684
python
en
code
32
github-code
1
36250660749
def prime_search(): # N의 최대 수는 1000이므로 리스트의 갯수는 1001개 까지 생성해야한다. prime = [False, False] + [True] * 999 for i in range(2, int(1001 ** 0.5) + 1): if prime[i]: # 소수일 때, 그 수의 배수는 모두 False 로 변환 for j in range(i * i, 1001, i): prime[j] = False r...
Choisiz/coding-test-Team
김정호/소수 찾기/소수 찾기.py
소수 찾기.py
py
513
python
ko
code
0
github-code
1
74394572512
from launch_ros.actions import Node from launch.actions import DeclareLaunchArgument, ExecuteProcess from launch import LaunchDescription from launch.substitutions import LaunchConfiguration, FindExecutable from launch.conditions import IfCondition """@brief Generate the launch descriptions for ROS """ def generate_la...
lorocks/beginner_tutorials
src/cpp_pubsub/launch/cpp_launch_bag.py
cpp_launch_bag.py
py
1,474
python
en
code
0
github-code
1
2712157705
import glob import os input_script = '/scratch/users/anniz44/scripts/covid/SNPcalling/' def time_sec(realtime): timeinsec = 0 if 'h' in realtime: timeinsec += float(realtime.split('h')[0])*360 realtime = realtime.split('h')[1] if 'm' in realtime: timeinsec += float(realtime.split('m...
caozhichongchong/covid_finder
bin/timecovsum.py
timecovsum.py
py
1,776
python
en
code
0
github-code
1
30211460192
import pytest import src.message as message class TestMessage: def test_create_message(self): message_obj = message.Message() assert message_obj.channel == "" assert message_obj.text == ("Category\n" ">%s\n" "Summarized article sent to Google NLP\n"...
smile-eh/unnamed-slack-nlp-bot
tests/test_message.py
test_message.py
py
707
python
en
code
0
github-code
1
12017136703
# 연결리스트의 구현 class Node: def __init__(self,data): self.data = data self.link = None def print_nodes(start): current = start if current.link == None: # print("원형 연결 리스트의 마지막 노드입니다.") return print(current.data, end=" ") while current.link != start: current = cu...
swm9283/Data_Structure
DataStructure/chapter05_circular_linked_list.py
chapter05_circular_linked_list.py
py
2,352
python
ko
code
1
github-code
1