seq_id
stringlengths
7
11
text
stringlengths
156
1.7M
repo_name
stringlengths
7
125
sub_path
stringlengths
4
132
file_name
stringlengths
4
77
file_ext
stringclasses
6 values
file_size_in_byte
int64
156
1.7M
program_lang
stringclasses
1 value
lang
stringclasses
38 values
doc_type
stringclasses
1 value
stars
int64
0
24.2k
โŒ€
dataset
stringclasses
1 value
pt
stringclasses
1 value
13588905096
import numpy as np from sklearn.decomposition import PCA # Calculate the average of the list def calculate_list_avg(lst): if len(lst) == 0: avg_list = 0.0 else: avg_list = sum(lst) / len(lst) return avg_list # Extract the information for each sample def extract_msg(mrna_exp...
yiangcs001/CSPRV
extract_features.py
extract_features.py
py
5,370
python
en
code
0
github-code
6
36814841108
import importlib from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_assets import Environment from flask_socketio import SocketIO from config import config db = SQLAlchemy() migrate = Migrate() assets = Environment() socketio = SocketIO() def create_app(confi...
reaper47/weather
app/__init__.py
__init__.py
py
1,223
python
en
code
0
github-code
6
31871823537
from http.server import HTTPServer, SimpleHTTPRequestHandler, BaseHTTPRequestHandler, test import json import io, shutil,urllib from raidtool import get_models host = ('localhost', 8888) class CORSRequestHandler(SimpleHTTPRequestHandler): def end_headers(self): self.send_header('Access-Control-Allow-Origi...
a1992012015/find-tool
tool/api.py
api.py
py
1,861
python
en
code
14
github-code
6
43535235941
# function which returns the correct number entered by the user def validate(numberPosition): correctNumberEntered=False while correctNumberEntered == False: # Exception Handling using try except block try: if numberPosition==1: # Converting the entered number to Int datatype number=int(input("\nEnter ...
PratikAmatya/8-bit-adder-Python-Program
Program Files/NumberValidation.py
NumberValidation.py
py
1,028
python
en
code
0
github-code
6
15444668840
from champ2.models import * #====================================================== def matrice_value_set_incomplete_count(matrice_value_set): #check to see that counts match up metrics_count = MatriceMetric.objects.all().count() values_count = matrice_value_set.values.filter(value__isnull=False).co...
adamfk/myewb2
myewb/apps/champ2/helper.py
helper.py
py
1,167
python
en
code
null
github-code
6
27259885900
"""We are the captains of our ships, and we stay 'till the end. We see our stories through. """ """515. Find Largest Value in Each Tree Row """ from collections import deque class TreeNode: def __init__(self, val): self.val = val self.left = None self.right = None class Solution: d...
asperaa/back_to_grind
Trees/largestValues.py
largestValues.py
py
1,007
python
en
code
1
github-code
6
38601541912
#!/usr/bin/python3 import argparse import sys import json import dballe __version__ = '@PACKAGE_VERSION@' def main(inputfiles, out): importer = dballe.Importer("BUFR") out.write('{"type":"FeatureCollection", "features":[') for f in inputfiles: with importer.from_file(f) as fp: is_f...
ARPA-SIMC/bufr2json
bufr2json.py
bufr2json.py
py
2,639
python
en
code
0
github-code
6
21160846100
# -*- coding: utf-8 -*- """ Created on Tue Jan 30 19:00:57 2018 @author: HP """ from numpy import asarray from numpy import zeros import numpy as np from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential, Model from keras.la...
mharish2797/DNN-Text-Classifiers
Simple DNN classifiers/Brown Corpus based basic DNN Classifiers/Brown_classifier with parallel network.py
Brown_classifier with parallel network.py
py
4,703
python
en
code
2
github-code
6
18601147125
from . import utils from . import s_1040 data = utils.parse_values() ################################### def build_data(): form_1040 = s_1040.build_data() data_dict = { 'ssn' : data['ssn'], 'first_and_initial' : data['name_first'] + ' ' + data['name_middle_i'], 'last' ...
pyTaxPrep/taxes-2018
forms/s_1040v.py
s_1040v.py
py
1,004
python
en
code
31
github-code
6
70488535867
# accepted on codewars.com import math # max recursion depth exceeded for the max text value = 9000000000000000000 def count_digit_five(max_num: int) -> int: memo_table = [-1] * len(str(max_num)) def recursive_seeker(n: int) -> int: if n < 10: if n < 5: return 0 ...
LocusLontrime/Python
CodeWars_Rush/_4kyu/Dont_give_me_five_Really_4kyu.py
Dont_give_me_five_Really_4kyu.py
py
3,693
python
en
code
1
github-code
6
17668930312
#!/usr/bin/env python3 # Compare event boundary timing in HMMs from cortical Yeo ROIs # to timing in hand(RA)-labeled events import os import tqdm import brainiak.eventseg.event from scipy.fftpack import fft,ifft from scipy.stats import zscore, norm, pearsonr from HMM_settings import * from event_comp import ev_conv,...
samsydco/HBN
HMM_vs_hand.py
HMM_vs_hand.py
py
1,502
python
en
code
2
github-code
6
15983166378
# Mjolnir from ...infrastrcutures.dynamo.infrastructure import DynamodbInfrastructure # Third party from boto3.dynamodb.conditions import Key from decouple import config class DynamodbRepository: infra = DynamodbInfrastructure @classmethod async def get_items(cls, key: str, value: str) -> list: ...
vinireeis/Mjolnir
src/repositories/dynamodb/repository.py
repository.py
py
895
python
en
code
0
github-code
6
342809739
from collections import OrderedDict import numpy as np import pandas as pd import requests from bs4 import BeautifulSoup import re df = pd.read_csv('pd_url_list_short.csv') #df ๋ณ€์ˆ˜๋กœ csv ํŒŒ์ผ์„ ์ฝ์–ด์˜ต๋‹ˆ๋‹ค. #๊ธฐ์กด์— ์ˆ˜๋™์œผ๋กœ ์ž…๋ ฅํ•˜๋˜ ํฌ๋กค๋ง ๋ฒ”์œ„๋ฅผ start์™€ end๋กœ ์ง€์ •ํ•ด์คฌ์Šต๋‹ˆ๋‹ค.(ํด๋ž˜์Šค ๋งŒ๋“ค๋•Œ ์ž…๋ ฅ) class GetText(object): def __init__(self, ulist, start, ...
nosangho/team_project
[02-15][junyang] wine21_save_loop.py
[02-15][junyang] wine21_save_loop.py
py
6,458
python
ko
code
0
github-code
6
7759575517
import serial class SerialParameters: def __init__(self, port=None, baudrate=9600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=None, xonxoff=False, rtscts=False, write_timeout=None, dsrdtr=False, inter_byte_timeout=None, exclusive=N...
timhenning1997/Serial-Port-Monitor
SerialParameters.py
SerialParameters.py
py
1,086
python
en
code
2
github-code
6
10914883697
import sys import pickle as pkl import sciunit_tree import ExecutionTree as exT from algorithms import pc def replay_sequence(tree_binary, cache_size, replay_order_binary): sciunit_execution_tree, _ = sciunit_tree.tree_load(tree_binary) tree = exT.create_tree('SCIUNIT', tree_binary) tree.cache_size = cac...
depaul-dice/CHEX
src/replay/replay-order.py
replay-order.py
py
972
python
en
code
0
github-code
6
18572100394
#ๅˆคๆ–ญๅผ # x=input("่ฏท่พ“ๅ…ฅๆ•ฐๅญ—:") #ๅ–ๅพ—ๅญ—ไธฒๅฝขๅผ็š„ไฝฟ็”จ่€…่พ“ๅ…ฅ # x=int(x) #ๅฐ†ๅญ—ไธฒๅฝขๆ€่ฝฌๆขๆˆๆ•ฐๅญ—ๅฝขๆ€ # if x>200: # print("ๅคงไบŽ 200") # elif x>100: # print("ๅคงไบŽ 100, ๅฐไบŽ็ญ‰ไบŽ 200") # else: # print("ๅฐไบŽ็ญ‰ไบŽ 100") # ๅ››ๅˆ™่ฟ็ฎ— n1=int(input("่ฏท่พ“ๅ…ฅๆ•ฐๅญ—1:")) n2=int(input("่ฏท่พ“ๅ…ฅๆ•ฐๅญ—2:")) op=input("่ฏท่พ“ๅ…ฅ่ฟ็ฎ—: + , - , * , / =") if op=="+": print(f"{n1}ๅŠ {n2}็ญ‰ไบŽ{n1+n2}") #ๅŽๆฅๆ”น #...
yeste-rge/-Python-By-
ๅฝญๅฝญ/#06 ๆต็จ‹ๆŽงๅˆถ๏ผšif ๅˆคๆ–ทๅผ/condition.py
condition.py
py
805
python
zh
code
1
github-code
6
37552127134
from utils.utils import getLinesOfFile def getPriority(char: str): asciiVal = ord(char[0]) if(asciiVal>=97 and asciiVal<=122): # lettera minuscola return asciiVal-96 else: #lettera maiuscola return asciiVal - 65 + 27 def findLetterInBothString(s1,s2): for char in s1: ...
liuker97/adventOfCode2022
src/day3/day3.py
day3.py
py
1,216
python
en
code
0
github-code
6
19243874206
import sys from pathlib import Path import environ PROJECT_DIR = Path(__file__).resolve().parent ROOT_DIR = PROJECT_DIR.parent # Environment ENV_FILE = "/etc/purldb/.env" if not Path(ENV_FILE).exists(): ENV_FILE = ROOT_DIR / ".env" env = environ.Env() environ.Env.read_env(str(ENV_FILE)) # Security SECRET_K...
nexB/purldb
purldb_project/settings.py
settings.py
py
7,976
python
en
code
23
github-code
6
31812175593
def sqdlist(l): i=0 while(i<len(l)): l[i]=(l[i])**2 i=i+1 return l #trace of a matrix def trace(m): if len(m)!= len(m[0]): print('matrix is non-square') else: i=0 a=0 while i<len(m[0]): a=a+m[i][i] i=i+1 return a #c...
cnc99/Collab
sqdlist.py
sqdlist.py
py
580
python
en
code
0
github-code
6
30898444460
#READING AND ORDERING fin=open("cowjump.in", "r") lines=fin.readlines() n=int(lines[0]) lines.remove(lines[0]) #Sweep points=[] for i in range(n): lines[i]=lines[i].split() lines[i]=[int(x) for x in lines[i]] beg=lines[i][0]>lines[i][2] points.append([lines[i][0], lines[i][1], beg, i]) points....
nomichka/2019-03-31-USACO-Silver
cowjump.py
cowjump.py
py
3,850
python
en
code
0
github-code
6
28395932084
import torch from torch import optim from torch import nn from torch.utils import data from data import AnimeDataset, LossWriter from model import Generator, Discriminator DATA_DIR = "../datasets/selfie2anime/all" MODEL_G_PATH = "./Net_G.pth" MODEL_D_PATH = "./Net_D.pth" LOG_G_PATH = "./Log_G.txt" LOG_D_PATH = "./Log_...
cwpeng-cn/DCGAN
train.py
train.py
py
3,971
python
en
code
0
github-code
6
39920785113
from flask import Flask, render_template, request, redirect, jsonify, after_this_request from flask_cors import CORS from app.trajectory import * from app.ion import get_ion from app.esp import * esp_addr = '' data = {} app = Flask(__name__, static_url_path='', static_folder='static', template_folder="templ...
Eugen171/gps
app/__init__.py
__init__.py
py
1,952
python
en
code
0
github-code
6
39911784422
import argparse import time import warnings import pickle import torch import random import numpy as np import pandas as pd import torch.nn.functional as F from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TrainingArguments, ElectraForSequenceClassification, AdamW from torch import ...
TEAM-IKYO/Open-Domain-Question-Answering
code/question_labeling/train.py
train.py
py
5,127
python
en
code
24
github-code
6
32925752157
import scrapy import os import wget class BlogSpider(scrapy.Spider): name = 'blogspider' start_urls = ['https://www.va.gov/vdl/application.asp?appid=6'] def parse(self, response): try: link='https://www.va.gov/vdl/' for title in response.xpath('//tr'): sect=respon...
RamSailopal/VA-Markup
scrape3.py
scrape3.py
py
1,537
python
en
code
0
github-code
6
27391464453
import logging import os from urllib.parse import urljoin, urlunparse from rdflib import Graph, Literal, Namespace from rdflib.namespace import OWL, RDF, RDFS, XSD from crunch_uml import const, db, util from crunch_uml.excpetions import CrunchException from crunch_uml.renderers.renderer import ModelRenderer, Renderer...
brienen/crunch_uml
crunch_uml/renderers/lodrenderer.py
lodrenderer.py
py
6,268
python
en
code
0
github-code
6
19400181919
from typing import List import common.arrayCommon as Array import heapq class Solution: def pondSizes(self, land: List[List[int]]) -> List[int]: h = len(land) w = len(land[0]) result = [] for i in range(h): for j in range(w): if land[i][j] == 0: ...
Yigang0622/LeetCode
pondSizes.py
pondSizes.py
py
1,310
python
en
code
1
github-code
6
28487843956
from ..database.userProgressPlans import \ userSkillProgressPlan, \ skillsMappedToSkillSet, \ collaboratorMappedToCollabSet, \ goalsMappedToGoalSets, \ goals, \ weeklySkillSetFeedBack, \ users, \ skills from ..database.dbConnection import dbConnection class usersDao(dbConnection): ...
mraison/work_profiling_app
work_profiling_app/modules/daos/daos.py
daos.py
py
4,213
python
en
code
0
github-code
6
22257701787
"""Filters module with a class to manage filters/algorithms for polydata datasets.""" import collections.abc import logging import numpy as np import pyvista from pyvista import ( abstract_class, _vtk, NORMALS, generate_plane, assert_empty_kwargs, vtk_id_list_to_array, get_array ) from pyvista.core.errors import ...
rohankumardubey/pyvista
pyvista/core/filters/poly_data.py
poly_data.py
py
77,050
python
en
code
0
github-code
6
15835641511
from config import db class PricePerHour(db.Model): id = db.Column(db.Integer, primary_key=True) date_of_parsing = db.Column(db.String(10), nullable=False) hour = db.Column(db.Integer, nullable=False) price = db.Column(db.Float, nullable=False) sales_volume_MWh = db.Column(db.Float, nullable=False...
BohdanLazaryshyn/rdn_test_task
models.py
models.py
py
986
python
en
code
0
github-code
6
70065264188
'Program to create the Functional Requirement Classifer model and validate it' from fileProcess import FileProcess import numpy from pandas import DataFrame from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import MultinomialNB from sklearn.pipeline import Pipeline from sklearn.cross...
xiejen/rfpFunctionReqClf
classifier.py
classifier.py
py
2,435
python
en
code
0
github-code
6
37300539440
import csv def add_topic_to_csv(url): try: id_start_index = url.find('/topics/') + len('/topics/') id_end_index = url.find('?') curid = url[id_start_index:id_end_index] topic_name_start_index = url.rfind('/') + 1 topic_name = url[topic_name_start_index:id_start_index - ...
Lucascuibu/xis_topic_py
topic_grab/add_topic.py
add_topic.py
py
652
python
en
code
0
github-code
6
29947747353
""" Tesla Crystal for Tornado wallet """ import sys import time from os import path from modules.basehandlers import CrystalHandler from modules.i18n import get_dt_language from modules.helpers import base_path from modules.helpers import async_get_with_http_fallback sys.path.append('crystals/420_tesla') from bismuth...
bismuthfoundation/TornadoWallet
wallet/crystals/420_tesla/__init__.py
__init__.py
py
7,537
python
en
code
14
github-code
6
17508342693
from typing import List class Solution: def maxArea(self, height: List[int]) -> int: i,j=0,len(height)-1 im,jm,mx=0,0,0 while i<j: val = (j-i)*min(height[i],height[j]) if val > mx: im,jm,mx=i,j,val if height[i]<height[j]: i+...
soji-omiwade/cs
dsa/before_rubrik/container_with_most_water.py
container_with_most_water.py
py
426
python
en
code
0
github-code
6
73879522109
# -*- coding: utf-8 -*- import requests import pandas as pd import pytest import urllib import pprint # ่ชฒ้กŒ1 def get_api(url): result = requests.get(url) return result.json() def main(): keyword = "้ฌผๆป…" url = "https://app.rakuten.co.jp/services/api/IchibaItem/Search/20170706?format=json&keyword={}&ap...
KanjiIshikawa-lab/Kadai6syuusei
kadai6_4.py
kadai6_4.py
py
2,333
python
en
code
0
github-code
6
39174277833
import numpy as np import torch from torch.utils.data import DataLoader from random import seed from dataset import MNIST from network import FeedForward from train_mnist import Train, TrainConfig from plotter import Plotter np.random.seed(1234) seed(1234) torch.manual_seed(1234) if '__main__' == __name__: da...
shalomma/PytorchBottleneck
ib_mnist.py
ib_mnist.py
py
1,394
python
en
code
7
github-code
6
8267950596
from __future__ import annotations import socket import pytest from kombu import Connection, Consumer, Exchange, Producer, Queue class test_PyroTransport: def setup(self): self.c = Connection(transport='pyro', virtual_host="kombu.broker") self.e = Exchange('test_transport_pyro') self.q...
celery/kombu
t/unit/transport/test_pyro.py
test_pyro.py
py
2,892
python
en
code
2,643
github-code
6
26682571553
import sys import os import re import logging from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox, QPushButton, QLabel, QFileDialog, QMainWindow, QMessageBox, QCheckBox from gui import Ui_MainWindow from function import * project_file = ".project" cproject_file = ".cproject" recove...
maivananh111/stm-edf
tools/setup/setup.py
setup.py
py
38,714
python
en
code
0
github-code
6
34214181391
t = int(input()) for _ in range(t): lst = input().split(" ") total = int(lst[0]) diff = 0 for i in range(1, len(lst)-1): add = int(lst[i]) diff += max(add-total*2, 0) total = add print(diff)
david-vinje/kattis-problems
Solutions/Zanzibar.py
Zanzibar.py
py
213
python
en
code
0
github-code
6
28076023790
from .gaussian_attention import gaussian_mask, gaussian_attention from keras.layers import Layer class VisualAttentionLayer(Layer): def __init__(self, output_dim, transpose=False, **kwargs): if len(output_dim) != 2: raise ValueError("`output_dim` has to be a 2D tensor [Height, Width].") ...
zimmerrol/tf_keras_attention
src/gaussian_attention_layer.py
gaussian_attention_layer.py
py
1,066
python
en
code
2
github-code
6
3536318559
from django.db import models class Task(models.Model): username = models.CharField(verbose_name='ะ˜ะผั ัะพั‚ั€ัƒะดะฝะธะบะฐ', max_length=30) task_name = models.CharField(verbose_name='ะขะตะบัั‚ ะทะฐะดะฐั‡ะธ', max_length=100) per_day = models.PositiveIntegerField( default=1, verbose_name='ะšะพะปะธั‡ะตัั‚ะฒะพ ะฝะฐะฟะพะผะธะฝะฐะฝะธะน ...
DalaevBC/ping_bot
inside/models.py
models.py
py
658
python
en
code
0
github-code
6
40199173264
from django.test import TestCase from django.urls import reverse from . import utils class TestView(TestCase): """ Test that access to views that accept get do not raise exception. """ def setUp(self) -> None: self.views = [ {"name": 'index', 'requires_authentication': False}, ...
Koffi-Cobbin/ACES-WEB
core/tests/test_views.py
test_views.py
py
961
python
en
code
2
github-code
6
40367677442
import pygame import random from Farm import Farm from Lab import Lab from Armor import Armor from PowerPlant import PowerPlant from Battery import Battery from Engine import Engine from Command_module import Comand_Module from Warehouse import Warehouse from Laser import Laser from Biome import Biome from Asteroid im...
Martian2024/PyGame_Project
Ship.py
Ship.py
py
5,582
python
en
code
3
github-code
6
42602830723
from matplotlib import pyplot as plt font = {'family':'sans-serif', 'sans-serif':'Arial'} plt.rc('font', **font) plt.title('', fontsize='x-large', pad=None) plt.xlabel('', fontsize='x-large') plt.ylabel('', fontsize='x-large') # plt.xscale('log') plt.tick_params(axis="both",direction="in", labelsize='x-large') plt.su...
hitergelei/tools
plt-format.py
plt-format.py
py
475
python
en
code
0
github-code
6
3528547150
import os import pytest from dvclive.data.scalar import Scalar from dvclive.keras import DvcLiveCallback from tests.test_main import read_logs # pylint: disable=unused-argument, no-name-in-module, redefined-outer-name @pytest.fixture def xor_model(): import numpy as np from tensorflow.python.keras import S...
gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs
myenve/Lib/site-packages/tests/test_keras.py
test_keras.py
py
4,219
python
en
code
3
github-code
6
71477711228
import sys sys.stdin = open('input.txt') def cook(i, n, group1, group2): global selection, result # ์กฐํ•ฉ ๊ฒฐ์„ฑ์‹œ return if len(group1) == n//2 and len(group2) == n//2: ans1 = 0 ans2 = 0 for i in range(n//2): for j in range(i, n//2): ans1 += data[group1[i]][grou...
YOONJAHYUN/Python
SWEA/4012_cook/sol2.py
sol2.py
py
1,095
python
en
code
2
github-code
6
26248063876
from datetime import datetime import six from oslo_config import cfg from oslo_log import log from oslo_utils import uuidutils, importutils from delfin import db from delfin.common.constants import TelemetryCollection, TelemetryJobStatus from delfin.exception import TaskNotFound from delfin.i18n import _ from delfin....
sodafoundation/delfin
delfin/task_manager/scheduler/schedulers/telemetry/job_handler.py
job_handler.py
py
9,923
python
en
code
201
github-code
6
23188032907
# link : https://school.programmers.co.kr/learn/courses/30/lessons/172928 # title : ๊ณต์› ์‚ฐ์ฑ… def solution(park, routes): for r_idx, i in enumerate(park): for c_idx, j in enumerate(i): if(j == "S"): dog = Dog(park, c_idx, r_idx) for inst in routes : arg = inst.split(" ")...
yuseung0429/CodingTest
Programmers/Python/solved/Problem_172928.py
Problem_172928.py
py
1,740
python
en
code
0
github-code
6
44793171293
class Solution: def levelOrder(self, root): # ans = [] que = [] if root is None: return que.append(root) while len(que) > 0: data = que.pop(0) if data.left: que.append(data.left) if data.right: qu...
Shwaubh/LoveBabbarSolution
Binary Trees/Solution174LevelOrderTravesal.py
Solution174LevelOrderTravesal.py
py
1,131
python
en
code
2
github-code
6
18769333881
while(True): m,n = map(int,input().split()) if not m: break a = list(range(1,m+1)) b = [input() for _ in range(n)] t = [str(i+1) for i in range(n)] t[2::3] = ["Fizz"]*len(t[2::3]) t[4::5] = ["Buzz"]*len(t[4::5]) t[14::15] = ["FizzBuzz"]*len(t[14::15]) i=0 for j in range(n): ...
ehki/AOJ_challenge
python/0221.py
0221.py
py
494
python
en
code
0
github-code
6
37539866054
import corexyLib import motorLib from time import sleep import RPi.GPIO as GPIO SQUARE_SIDE = 57.3 resolution = 'Half' corexy = corexyLib.CoreXY(20, resolution, motorLib.Motor(20, 21, 1, (14, 15, 18), 400, resolution), motorLib.Motor(19, 26, 1, (14, 15, 18), 400, resolution), 0, 0) corexy.motorA.initial_set_up() corex...
Pearston/ReChess
motorEmbeddedCode/test_corexy.py
test_corexy.py
py
1,248
python
en
code
0
github-code
6
5648159483
import sys from typing import List, Optional, Tuple, cast import unittest def how_construct(target_string: str, strings: List[str]) -> Optional[List[str]]: n = len(target_string) + 1 table: List[Optional[List[str]]] = [ [] if i == 0 else None for i in range(n)] for i in range(n): if table...
bradtreloar/freeCodeCamp_DP_problems
problems/tabulated/how_construct.py
how_construct.py
py
1,311
python
en
code
0
github-code
6
21002262598
import os import pandas as pd from natsort import natsorted from openpyxl import load_workbook dirName = './pozyxAPI_dane_pomiarowe' def parse_learn_data(): data = pd.DataFrame() for filename in natsorted(os.listdir(dirName)): if filename.endswith(".xlsx"): df = pd.read_excel(f"{dirName}/...
precel120/SISE
Task 2/excel.py
excel.py
py
1,618
python
en
code
0
github-code
6
36837442603
""" Ex 7. Program description: The objective of this program is to create a function named โ€œprint dateโ€ which will print in the format (from previously created list ). The format is Month/Day/Year. """ days = ["Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wensday", "Thursday"] year = 2021 month = 1 day = 23 ...
Deepsphere-AI/AI-lab-Schools
Grade 09/Unit-1/Python/Nine_PPT_7.py
Nine_PPT_7.py
py
682
python
en
code
0
github-code
6
27569063700
class CityPlan: def __init__(self, city_plan): self.position = city_plan["position"] self.criteria = city_plan["criteria"] self.score1 = city_plan["score1"] self.score2 = city_plan["score2"] @property def criteria(self): return self._criteria @propert...
maxlou188/WelcomeTo
city_plan.py
city_plan.py
py
1,977
python
en
code
0
github-code
6
39380955921
#%% Imports import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from collections import defaultdict from helpers import pairwiseDistCorr,nn_reg,nn_arch,reconstructionError from matplotlib import cm from sklearn.neural_network import MLPClassi...
SenRamakri/CS-7641-Assignment-3
RP.py
RP.py
py
3,594
python
en
code
0
github-code
6
18131109931
import sys N = int(input()) Nums = list(map(int, sys.stdin.readline().split())) M = int(input()) Mums = list(map(int, sys.stdin.readline().split())) Nums.sort() def binary_search(answer): start = 0 end = N - 1 while start <= end: mid = (start + end) // 2 if Nums[mid] == answer: ...
Hyeneung-Kwon/Baekjoon_Python
1920.py
1920.py
py
563
python
en
code
0
github-code
6
45478158273
# Parse Data from hex data helper class. from common.types import * class ParseHelper: @staticmethod def getData(rawdata, format_info): data_type = format_info[0] if(data_type==DataType.NUM): return ParseHelper.getNumber(rawdata, format_info[1], format_info[2]) elif(data_typ...
Bitbyul/protocol-analyzer
model/parseHelper.py
parseHelper.py
py
3,078
python
en
code
0
github-code
6
30510489975
# coding=utf-8 import hashlib from falcon.errors import HTTPBadRequest from ultros_site.base_route import BaseRoute __author__ = "Gareth Coles" class ProfileRoute(BaseRoute): route = "/profile" def on_get(self, req, resp): user = req.context["user"] if not user: raise HTTPBadRe...
UltrosBot/Ultros-site
ultros_site/routes/users/profile.py
profile.py
py
719
python
en
code
2
github-code
6
26471185861
import unittest from solution.batch4.problem47 import consecutive_distinct_primes, \ first_4_distinct_primes class DistinctPrimesFactors(unittest.TestCase): def test_HR_problem_k2(self): k = 2 nums = [20, 100] expected = [ [14, 20], [14, 20, 21, 33, 34, 35, 38, ...
bog-walk/project-euler-python
test/batch4/test_problem47.py
test_problem47.py
py
1,245
python
en
code
0
github-code
6
5906135972
#!/usr/bin/env python import rospy import math import sys import tf from el2425_bitcraze.srv import SetTargetPosition from el2425_bitcraze.srv import SetPolygonTrajectory from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Point rate = 5 deltaTheta = 20 class PolygonTrajectoryPlanner: def _...
SabirNY/el2425_bitcraze
scripts/trajectory_handler.py
trajectory_handler.py
py
3,126
python
en
code
null
github-code
6
21402626105
import numpy as np import tensorflow as tf from pyTasks.task import Task, Parameter from pyTasks.task import Optional, containerHash from pyTasks.target import CachedTarget, LocalTarget from pyTasks.target import JsonService, FileTarget from .gram_tasks import PrepareKernelTask import logging import math from time impo...
cedricrupb/pySVRanker
word2vec_tasks.py
word2vec_tasks.py
py
14,557
python
en
code
2
github-code
6
44112547600
from tkinter import * root = Tk() root.title("Calculator") entry_box = Entry(root,width=35,font=('Century Schoolbook', 12)) entry_box.grid(row=0,column=0,columnspan=4,padx=10,pady=20,ipady=5) answer = 0 val1="" operands=['+','-','*','/','='] def button_click(number): current = entry_box.g...
shaharyar797/tkinter
Calculator.py
Calculator.py
py
4,607
python
en
code
1
github-code
6
25566549731
from django.shortcuts import render from .models import Product from .forms import ProductForm from django.http import HttpResponse def list(request): products = Product.objects.all() context = {'products': products} return render(request, 'product/list.html', context) def save_product(request): if(re...
d3stroya/ob-django
wishlist/product/views.py
views.py
py
1,700
python
en
code
0
github-code
6
28492207070
import librosa,librosa.display import matplotlib.pyplot as plt import numpy as np file="your-summer-day-5448.wav" #waveform signal,sr=librosa.load(file,sr=22050) #signal will be a numpy array which will have no.of values=sr*duration of sound track librosa.display.waveplot(signal,sr=sr) #visualizing the wave ...
yashi4001/ML_Basics
audio_preprocess.py
audio_preprocess.py
py
1,735
python
en
code
0
github-code
6
12397412517
import sys import re import os # nagios exit code STATUS_OK = 0 STATUS_WARNING = 1 STATUS_ERROR = 2 STATUS_UNKNOWN = 3 def main(): try: with open('/proc/drbd') as f: for line in f: match = re.search('^\ *(.*): cs:(.*) ro:([^\ ]*) ds:([^\ ]*) .*$', line) if match...
Sysnove/shinken-plugins
check_drbd.py
check_drbd.py
py
1,342
python
en
code
9
github-code
6
17651189647
import telebot from config import TOKEN, keys from extensions import ExchangeException, Exchange bot = telebot.TeleBot(TOKEN) # ะžะฑั€ะฐะฑะพั‚ะบะฐ ะบะพะผะฐะฝะดั‹ /start @bot.message_handler(commands=['start']) def start(message): start = "ะŸั€ะธะฒะตั‚! ะฏ ะฑะพั‚, ะบะพั‚ะพั€ั‹ะน ะผะพะถะตั‚ ะฒะตั€ะฝัƒั‚ัŒ ั†ะตะฝัƒ ะฝะฐ ะพะฟั€ะตะดะตะปะตะฝะฝะพะต ะบะพะปะธั‡ะตัั‚ะฒะพ ะฒะฐะปัŽั‚ั‹.\n\n...
Airton99999/telegram_bot_convertor
bot.py
bot.py
py
2,989
python
ru
code
0
github-code
6
34336638325
# main.py from project.scraper import Scraper from project.database import Database def main(): """ main function """ #Initialize the scraper scraper = Scraper() #Get the data response = scraper.scrape_data() data = scraper.parse_response(response) #Connect to the database ...
MiriamGeek/scraper-pipeline
project/__main__.py
__main__.py
py
480
python
en
code
0
github-code
6
9185132950
import collections from collections import abc import getpass import io import itertools import logging import os import socket import struct import sys import threading import time import timeit import traceback import types import warnings from absl import flags from absl.logging import converter try: from typing...
bazelbuild/bazel
third_party/py/abseil/absl/logging/__init__.py
__init__.py
py
38,729
python
en
code
21,632
github-code
6
38474237620
from trainer import image_classifier, augmentation_pipeline,GCSHelper import argparse def str2bool(v): if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Boolean value exp...
chrike-platinum/Cloud_ML_Template
trainer/task.py
task.py
py
2,861
python
en
code
0
github-code
6
19407988415
from flask import Flask, jsonify, request from flask_cors import CORS from flask_jwt_extended import create_access_token, JWTManager from flask_mysqldb import MySQL from dotenv import load_dotenv import os from datetime import datetime app = Flask(__name__) load_dotenv() app.config['MYSQL_HOST'] = os.environ.get('MY...
RogelioBenavides/frida-kitchen
tracking_service/routes/tracking.py
tracking.py
py
1,020
python
en
code
1
github-code
6
24059326549
from PIL import Image from os import listdir, mkdir def PrepareChars5x7(jmeno, mezX, mezY): im = Image.open(jmeno) Pixels = im.load() for x in range(13): for y in range(4): imnew = Image.new(mode="RGB", size=(5, 7)) pole = imnew.load() print(pole[1, 1], imnew.si...
MedOndrej/ASCIIart
Preparation.py
Preparation.py
py
1,019
python
en
code
0
github-code
6
30478191100
# Merge k Sorted Linked Lists and return in form of Array class Node: def __init__(self, head): self.head = head self.next = None def merge(self, left, right): if left is None: return right if right is None: return left ans = Node(-1) temp = a...
prabhat-gp/GFG
Linked List/Love Babbar/26_merge_k_sorted_ll.py
26_merge_k_sorted_ll.py
py
1,084
python
en
code
0
github-code
6
14040284357
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
yenbryan/raffle
ticketing/migrations/0001_initial.py
0001_initial.py
py
2,454
python
en
code
0
github-code
6
25072840538
#!/usr/bin/env python3 #_*_ coding: utf8 _*_ #------------------------------------------------------------ #----- GUILLOTINE -----| # ---- FINDER HTTP SECURITY HEADERS ----| # ---- Gohanckz ----| # ---- Contact ...
Gohanckz/guillotine
guillotine.py
guillotine.py
py
3,431
python
en
code
12
github-code
6
32936869929
# ๅฏผๅ…ฅๆ‰€้œ€็š„ๅบ“ import jieba import docx from docx import Document from docx.shared import Inches import matplotlib.pyplot as plt from wordcloud import WordCloud, STOPWORDS # ่ฏปๅ–ๆ–‡ๆกฃๅ†…ๅฎน filter_words = ['', '','','','','','',''] document = Document('221.docx') text = '' text= jieba.cut(text) text = ''.join(str(x) for x in text) ...
lingqingjiuying/9ying1
day1class1.py
day1class1.py
py
1,150
python
en
code
0
github-code
6
39359053941
import time from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait import selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import service #driver ...
Paviterence/Selenium-Python-BasicCodes
fb_select_method.py
fb_select_method.py
py
5,232
python
en
code
1
github-code
6
14974723036
import torch import torch.nn as nn from torch_geometric.loader import DataLoader from torch_geometric.data import Data, Batch from torch.utils.data import Dataset import torch_geometric.transforms as T from torch_geometric.nn import GATConv import torch.nn.functional as F class GATNet(torch.nn.Module): def __init_...
mo7amed7assan1911/Floor_Plan_Generation_using_GNNs
model.py
model.py
py
5,015
python
en
code
3
github-code
6
30513354824
import os import requests from app import Processing import nltk from moviepy.editor import * from pexels_api import API from pathlib import Path import time import pyttsx3 # configurations of paths, output URL, file structure # 16:9 ratios possible for upright smartphone usage # 1080, 1920 --> FullHD resolution # 54...
oliverkoetter/kopfkino
tasks.py
tasks.py
py
6,989
python
en
code
2
github-code
6
16536913637
import pandas as pd dataset = pd.read_csv('iris.csv') data = dataset.iloc[ : 99 , :] target = data.iloc[ : , -1: ] y = [] for x in target.values: if x == 'Iris-setosa': y.append(1) else: y.append(0) x = data.iloc[ : , : -1] x = x.values.tolist() from sklearn.utils i...
Nuhru1/Machine_Learning_Logistic_Regression_From_Scratch
Logistic_Regression_with_Sklearn.py
Logistic_Regression_with_Sklearn.py
py
897
python
en
code
0
github-code
6
35041146572
import copy import json import logging import os from threading import Thread import requests import six import yaml from toscaparser.tosca_template import ToscaTemplate from yaml import Loader from configuration_tool.common.tosca_reserved_keys import IMPORTS, DEFAULT_ARTIFACTS_DIRECTORY, \ EXECUTOR, NAME, TOSCA_...
sadimer/clouni_configuration_tool
configuration_tool/common/translator_to_configuration_dsl.py
translator_to_configuration_dsl.py
py
9,016
python
en
code
0
github-code
6
37220130073
# 46__method_chaining class Car: def turn_on(self): print("You started the engine") turned_on = "turned on" return self def turn_off(self): print("You turned of the engine") return self def brake(self): print("You stepped on the brake") return self ...
GGisMee/Python
pfc/tutorials/46__method_chaining.py
46__method_chaining.py
py
627
python
en
code
3
github-code
6
69928685308
from django.db import models class Vehicles(models.Model): class Meta: ordering = [ 'year'] id = models.AutoField( primary_key = True ) year_min = 1900 year_max = 2100 year = models.IntegerField( 'Year', ) man_max_len = 50 manufacturer = models.CharField(...
babarehner/carwork
carrepairs/models.py
models.py
py
640
python
en
code
0
github-code
6
15996890764
from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('api/songs', views.SongsView.as_view(), name='songs'), path('api/songs/<int:song_id>', views.SongInfoView.as_view(), name='song_info'), path('api/songs/search/', views.SongSearchView.as_view(), name='song...
artooff/2023-MAI-Backend-A-Artov
lab3/musicProject/musicService/urls.py
urls.py
py
652
python
en
code
0
github-code
6
37030043869
import PySimpleGUI as sg import numpy as np import cv2 import matplotlib.pyplot as plt from Baysian_Mat import Bayesian_Matte from PIL import Image, ImageOps import time # Execution TIme imports import psutil from laplac import Laplacianmatting from compositing import compositing from QualityTest import mse2d from Q...
ADG4050/Bayesian-Matting-Implementation
bayesian-Matting-Python/UI.py
UI.py
py
4,145
python
en
code
0
github-code
6
72530296187
import os import cv2 import pytesseract import numpy as np from tqdm import tqdm INPUT_PATH: str = "inputs_control/" OUTPUT_PATH: str = "text_pred_control/" #CONFIG: str = "--psm 6 --oem 1" CONFIG: str = "--psm 7 --oem 1" def pipeline(file) -> str: path: str = f"{INPUT_PATH}{file}" img: np.ndarray = cv2.imre...
lukeabela38/image2text-tesseract
workspace/main.py
main.py
py
693
python
en
code
0
github-code
6
28811405161
import torch import csv import pytorch_lightning as pl from sys import platform if platform == "linux": from pypesq import pesq from pystoi import stoi from math import isnan from numpy import random def check_inf_neginf_nan(tensor, error_msg): assert not torch.any(torch.isinf(tensor)), error_msg if tensor...
Youzi-ciki/DCS-Net
network_functions.py
network_functions.py
py
22,891
python
en
code
1
github-code
6
16254773107
import pandas as pd import numpy as np import random from sklearn.datasets import load_iris import matplotlib.pyplot as plt x= "" def calc_color_indxs(centroids): #function assigns centroid indexes to each training example i.e. it assigns the # nearest cluster centroid to each training example # It uses ...
DhyeyDabhi/Machine-Learning
K Means Clustering/Logic Code/KMeans.py
KMeans.py
py
3,311
python
en
code
0
github-code
6
21480313260
import bpy import re from ..helpers import sentence_join default_lock = False default_lock_array = [default_lock] * 3 component_names = ('X', 'Y', 'Z', 'W') def is_prop_locked(pb, name, component_index): if name == 'location': return getattr(pb, 'lock_location', default_lock_array)[component_i...
greisane/gret
anim/channels_delete_unavailable.py
channels_delete_unavailable.py
py
3,374
python
en
code
298
github-code
6
29841914634
import threading import traitlets import pyrosetta import pyrosetta.rosetta.basic.options import pyrosetta.rosetta.protocols.rosetta_scripts as rosetta_scripts import pyrosetta.rosetta.protocols.moves as moves import pyrosetta.distributed import pyrosetta.distributed.tasks.taskbase as taskbase import pyrosetta.distr...
MedicaicloudLink/Rosetta
main/source/src/python/PyRosetta/src/pyrosetta/distributed/tasks/rosetta_scripts.py
rosetta_scripts.py
py
2,892
python
en
code
1
github-code
6
2279604404
from Sentence import Sentence import nltk class Text: def __init__(self, rawText, name): self.rawText = rawText#self.formatText(rawText) self.name = name splitAtNewlines = [s.strip() for s in rawText.splitlines()] rawSentences = [] for line in splitAtNewlines: ...
Lombre/LemmaLearner
Text.py
Text.py
py
745
python
en
code
0
github-code
6
75336194426
import requests import collections import secrets import json import sqlite3 import scrape from bs4 import BeautifulSoup API_KEY = secrets.API_KEY headers = { "Authorization": "Bearer %s" % API_KEY } BASEURL = 'https://api.yelp.com/v3/businesses/search' CACHE_DICT = {} CACHE_FILENAME = 'search_cache.json' DB_NAM...
kedongh/507_final_proj
yelp.py
yelp.py
py
8,122
python
en
code
0
github-code
6
32181991364
''' - Change tree from octree to R-tree. or study other balanced trees - If octree pool overflows it should create a second pool ''' from Framework.Segmentation.SegmentationHandler import * from Framework.Segmentation.ROI import ROI from Framework.Tools.shunting_yard import shuntingYard from Framework.Tools.DataStruc...
GonzaloSabat/phybers
phybers/src/utils/fibervis/Framework/Segmentation/ROISegmentation.py
ROISegmentation.py
py
4,067
python
en
code
0
github-code
6
22389699971
# -*- coding: utf-8 -*- # (C) 2013 Smile (<http://www.smile.fr>) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models, _ from odoo.tools import format_date class AccountInvoice(models.Model): _inherit = 'account.invoice' @api.multi def action_invoice_open...
detian08/bsp_addons
smile/smile_account_tax_period/models/account_invoice.py
account_invoice.py
py
2,040
python
en
code
1
github-code
6
41034447740
from django.test import TestCase from car import models class ModelTest(TestCase): def test_create_user_with_email_successful(self): """Test creating a new car is successful""" category = 'CO' model = "TT RS 2020" name = 'Audi TT RS TURBO' number_of_doors = 3 descr...
Womencancode/technical-test-Talana
app/car/tests/test_models.py
test_models.py
py
814
python
en
code
0
github-code
6
27447292826
import time from selenium.webdriver.support.ui import Select from selenium import webdriver class InventoryPage(): def __init__(self,driver) : self.driver = driver def navigate(self, urlLogin): self.driver.get(urlLogin) def changeSorting(self, locatorClass, option): self.sel =...
Abanoub-waheed/python_test
inventoryPage.py
inventoryPage.py
py
3,580
python
en
code
0
github-code
6
70096737469
import itertools # ์†Œ์ˆ˜ ํŒ๋ณ„ ํ•จ์ˆ˜ # 2๋ณด๋‹ค ์ž‘์œผ๋ฉด ๋ฌด์กฐ๊ฑด False # 2๋‚˜ 3์ด๋ฉด ์†Œ์ˆ˜๋‹ค. # 2 ๋˜๋Š” 3์œผ๋กœ ๋‚˜๋ˆ ์ง€๋ฉด ์†Œ์ˆ˜๊ฐ€ ์•„๋‹ˆ๋‹ค. # 10 ๋ฏธ๋งŒ์˜ ๊ฐ’๋“ค์€ 2๋‚˜ 3์œผ๋กœ๋งŒ ๋‚˜๋ˆ ์ง€์ง€ ์•Š์œผ๋ฉด ๋œ๋‹ค. # ๊ทธ ์ด์ƒ์˜ ์ˆ˜๋“ค์— ๋Œ€ํ•ด์„œ๋Š” 5, 7, 9, 11, 13, 15... ๋“ฑ์˜ ํ™€์ˆ˜๋กœ ๋‚˜๋ˆ ๋ณด๋ฉด ๋œ๋‹ค. ํ•˜์ง€๋งŒ ์ด๋ฏธ 3์˜ ๋ฐฐ์ˆ˜์— ๋Œ€ํ•ด์„œ๋Š” ์•ž์—์„œ ๊ฒ€์‚ฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— 5, 7, 11, 15,... ์˜ ํŒจํ„ด์œผ๋กœ ๊ฒ€์‚ฌํ•  ์ˆ˜ ์žˆ๋‹ค. # N์ด ์†Œ์ˆ˜์ธ์ง€๋ฅผ ์•Œ๊ณ  ์‹ถ์œผ๋ฉด N์˜ ์ œ๊ณฑ๊ทผ๊นŒ์ง€๋งŒ ๊ฒ€์‚ฌํ•ด๋ณด๋ฉด ๋œ๋‹ค. def is_prime(n): if n < 2: ...
YooGunWook/coding_test
practice_coding_old/์—ฐ์Šต๋ฌธ์ œ/์†Œ์ˆ˜ ๋งŒ๋“ค๊ธฐ.py
์†Œ์ˆ˜ ๋งŒ๋“ค๊ธฐ.py
py
1,070
python
ko
code
0
github-code
6
31496165105
import unittest import socket def test_server_connection(): # Cria um socket e envia uma mensagem para o servidor client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) client.sendto(b"Hello, server!", ("127.0.0.1", 333)) # Verifica se a mensagem foi recebida pelo servidor corretamente received...
Trincazul/server-upd
src/test/test_server.py
test_server.py
py
701
python
pt
code
0
github-code
6
24293577173
from copy import deepcopy def courses_to_take(course_to_pre_reqs): if not course_to_pre_reqs: return [] for course in course_to_pre_reqs: ret = list() if not course_to_pre_reqs[course]: print(course_to_pre_reqs) ret.append(course) next_pre_reqs = dee...
ckallum/Daily-Interview-Pro
solutions/courseCodes.py
courseCodes.py
py
1,367
python
en
code
16
github-code
6
33548045927
from django.test import TestCase from costcenter.forms import FundForm class FundFormTest(TestCase): def test_empty_form(self): form = FundForm() self.assertIn("fund", form.fields) self.assertIn("name", form.fields) self.assertIn("vote", form.fields) self.assertIn("downloa...
mariostg/bft
costcenter/tests/test_forms.py
test_forms.py
py
1,394
python
en
code
0
github-code
6
44497013120
from traceback import print_stack from allure_commons.types import AttachmentType from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException, ...
sudeepyadav5/SeleniumA2Z
SeleniumFrameWork/basepage/BasePage.py
BasePage.py
py
6,476
python
en
code
0
github-code
6