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
15973370719
from dataclasses import dataclass import glob import json from multiprocessing import Pool, cpu_count import os from config_manager.config import Config import commits import variability class MetricsConfig(Config): repos_folder: str output_json: str @dataclass class RepoMetrics: variability: variabil...
evjeny/code_main_sequence_analysis
calculate_metrics.py
calculate_metrics.py
py
2,663
python
en
code
0
github-code
1
30880145691
import numpy as np import cv2 import requests cap = cv2.VideoCapture(0) ret, frame = cap.read() cv2.imwrite('pic.png',frame) url = "http://localhost:8000/meter/piupload/" fin = open('pic.png', 'rb') files = {'file': fin} try: r = requests.post(url, files=files) print(r.text) finally: fin.close()
SothanaV/smartmeter
pi/capup.py
capup.py
py
305
python
en
code
0
github-code
1
40003845498
from ortools.linear_solver import pywraplp from collections import namedtuple Item = namedtuple("Item", ['index', 'value', 'weight']) DEBUG = 0 def solve_it(input_data): # parse the input lines = input_data.split('\n') firstLine = lines[0].split() item_count = int(firstLine[0]) capaci...
thiagoaraujocampos/Knapsack-Problem
solver.py
solver.py
py
3,161
python
en
code
0
github-code
1
6044731535
""" Michael Neilson <github: nichael-meilson> 2022-06-30 """ import pytest from httpx import AsyncClient from fastapi import FastAPI from starlette.status import ( HTTP_201_CREATED, HTTP_404_NOT_FOUND, HTTP_422_UNPROCESSABLE_ENTITY, HTTP_200_OK, ) from app.models.articles import CreateArticle, Article...
nichael-meilson/camel2
src/tests/test_articles.py
test_articles.py
py
4,126
python
en
code
0
github-code
1
27188793196
from Quote import Quote from csv import reader from pyfiglet import Figlet from termcolor import colored from random import randint end = 1 book_of_quote = [] with open("qoute.csv" , newline='') as plik: csvv = reader(plik) csvv.__next__() for q in csvv: book_of_quote.append(Quote(q[0],q[1],q[2]))...
Swiatomil/scrap-qoute-game
game.py
game.py
py
1,490
python
en
code
0
github-code
1
15219909785
import os from pathlib import Path import coloredlogs, logging class FileObserver: """Searches in the time interval of search_interval for files in the Input folder and saves the filename, filetype and tablename in a list of list in the object atribute input_files. For instance: [{filename: 'file1...
kteppris/dwh
scripts/file_observer.py
file_observer.py
py
3,847
python
en
code
0
github-code
1
72370542435
# Calculating the factorial of a number # # Program prompts the user for the number # if number is smaller than zero, print error #else set fact to 1 and i to one #while number is greater than or equal to i #fact times i and increment by one #print out result number = int(input('Enter the number for which you wish to...
chowsychoch/Programming-1-
p11/p11p1.py
p11p1.py
py
586
python
en
code
0
github-code
1
43518145068
from optimize import snopta, SNOPT_options import numpy as np from scipy.spatial import Delaunay import scipy.io as io import os import inspect from dogs import Utils from dogs import interpolation from dogs ...
kimukook/SDOGS
dogs/adaptive_snopt_min.py
adaptive_snopt_min.py
py
18,534
python
en
code
0
github-code
1
14905298243
import pygame from pygame.sprite import Sprite class Bullet(Sprite): """A class to manage bullets fired from the ship. Attributes ---------- rect: pygame.Rect Rectangular coordinates of the bullet Methods ------- update() Move the bullet up the screen draw_bullet() ...
DeepWalter/python-projects
alien_invasion/bullet.py
bullet.py
py
1,622
python
en
code
0
github-code
1
14386200871
""" ## 14-10. 이진 탐색 트리를 더 큰 수 합계 트리로 BST의 각 노드를 현재값보다 더 큰 값을 가진 모든 노드의 합으로 만들어라. """ # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def __init__(self): s...
hyo-eun-kim/algorithm-study
ch14/saeyoon/ch14_10_saeyoon.py
ch14_10_saeyoon.py
py
1,026
python
ko
code
0
github-code
1
25452018907
import pygame, sys from grid import Grid from ai import AI #Get the number of rows and cols from the user. rows = cols = int(input('Enter the number of rows and cols: ')) screen = pygame.display.set_mode((600,600)) pygame.display.set_caption('Maze Solver') #Calculating res of each cell res = screen.get_height()//row...
pratripat/Maze-solving-AI
visualizer.py
visualizer.py
py
1,057
python
en
code
1
github-code
1
28567878265
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Task controller. The controller stores: - lists of tasks (ProcessorController.model), - their associated processors and cache (ProcessorController.data). It can add/delete/update tasks, emitting the corresponding events """ from typing import Union, Type, Di...
depixusgenome/trackanalysis
src/taskmodel/processors.py
processors.py
py
4,081
python
en
code
0
github-code
1
22106003302
import os import csv # CSV FILE LOCATION csv_file = os.path.join("Resources", "election_data.csv") # LIST TO STORE DATA Total_votes = 0 candidates = {} # OPEN AND READ THE CSV_FILE with open(csv_file, newline="") as csvfile: csv_reader = csv.reader(csvfile, delimiter=",") # SKIP THE HEADER csv_header =...
ruddysimon/Python_bank_analysis
ByPoll/main.py
main.py
py
2,310
python
en
code
0
github-code
1
37659351964
import numpy as np class Actor: def __init__(self, output_size): self.output_size = output_size # take action with epsilon-greedy def get_action(self, observation, episode, model): epsilon = 0.01 + 0.99 / (1.0+episode) if np.random.rand() > epsilon: action_...
runno0331/dqn-from-scratch
actor.py
actor.py
py
558
python
en
code
0
github-code
1
15413522535
""" 양의 정수 n이 주어집니다. 이 숫자를 k진수로 바꿨을 때, 변환된 수 안에 아래 조건에 맞는 소수(Prime number)가 몇 개인지 알아보려 합니다. 0P0처럼 소수 양쪽에 0이 있는 경우 P0처럼 소수 오른쪽에만 0이 있고 왼쪽에는 아무것도 없는 경우 0P처럼 소수 왼쪽에만 0이 있고 오른쪽에는 아무것도 없는 경우 P처럼 소수 양쪽에 아무것도 없는 경우 단, P는 각 자릿수에 0을 포함하지 않는 소수입니다. 예를 들어, 101은 P가 될 수 없습니다. 예를 들어, 437674을 3진수로 바꾸면 211020101011입니다. 여기서 찾을 수 있는 조건에...
high-skyy/test_practice
Solutions/k진수에서_소수_개수_구하기_2022.py
k진수에서_소수_개수_구하기_2022.py
py
2,767
python
ko
code
0
github-code
1
71509366755
import sys import os import glob import csv import logging from collections import OrderedDict from util import * def trade_dates(file): """Analyzes a trades csv file and returns a list of the corresponding dates that are covered in the file. """ dates = [] # Open the trades file and get each dat...
gnu-user/finance-research
scripts/align_quotes.py
align_quotes.py
py
11,709
python
en
code
1
github-code
1
25602454467
# text = input() # symbol = text[1] # print(symbol * 2) text = "" while text != "End": text = input() if text == "SoftUni": continue elif text == "End": break for symbol in range(len(text)): print(text[symbol] * 2, end="") print()
IvanRadunchev/Programming-Fundamentals-with-Python---September-2022
phyton_fundamentals_september_2022_exercises/16_september_exercise/07_double_char.py
07_double_char.py
py
275
python
en
code
0
github-code
1
15074079513
# -*- coding: utf-8 -*- """ Created on Tue Aug 1 09:00:01 2023 @author: Cathe """ import matplotlib.pyplot as plt import os import numpy as np import scipy.io import re from matplotlib import rc from scipy.stats import pearsonr def is_float(string): try: float(string) return Tr...
qiyaozhu/CyclicPeptide
Clustercenters_15res/Pnear_Modified/Pnear_15res.py
Pnear_15res.py
py
4,511
python
en
code
0
github-code
1
7499822304
import numpy as np import sympy from sympy.abc import alpha from funx import fun,gfun from armijo import armijo def line_search(xk,dk): # 精确线搜索 alphak = None eq = np.dot(gfun(xk+alpha*dk).T,dk)[0] alpha0 = sympy.solve(eq,[alpha]) if len(alpha0) > 1: for a in alpha0: a = a[0] ...
LMC20020909/HUST-SSE-Curriculum-Design
数学建模与最优化/最优化方法-源代码/梯度下降法.py
梯度下降法.py
py
1,730
python
en
code
0
github-code
1
38425972289
#!/usr/bin/env python3 # coding: utf-8 # add to crontab import json, time import time, datetime import yaml import argparse import os from influxdb import InfluxDBClient MEASUREMENT_OUT = 'holtwinters' MEASUREMENTS= [ { 'measurement_in': 'elasticsearch_jvm', 'value_in': 'mem_heap_used_percent', ...
markuskont/influx-holtwinters
main.py
main.py
py
4,227
python
en
code
1
github-code
1
44190566884
from flask import Flask from flask import redirect from flask import render_template from flask import url_for from flask.ext.script import Manager from flask.ext.sqlalchemy import SQLAlchemy from getpass import getuser from json ...
dark-ritual/cs373-idb
app/app.py
app.py
py
24,898
python
en
code
0
github-code
1
24602385004
from pydoc import text from flask import Flask, jsonify import socket import flask import netifaces import subprocess from flask.globals import request from uuid import getnode as get_mac from threading import Thread import os, sys, json, struct, socket, fcntl, time import subprocess from os import listdir from os.path...
khayalghosh/data
app.py
app.py
py
8,797
python
en
code
0
github-code
1
40585445114
import sys sys.path.insert(0, "../..") import ply.lex as lex # Reserved words reserved = ( 'RENDERER', 'INTEGRATOR', 'TRANSFORM', 'SAMPLER', 'FILTER', 'FILM', 'CAMERA', 'WORLDBEGIN', 'WORLDEND', 'ATTRIBUTEBEGIN', 'ATTRIBUTEEND', 'TRANSFORMBEGIN', 'TRANSFORMEND', 'MAKENAMEDMATERIAL', 'NAMEDMATERIAL', 'MATE...
lahagemann/pbr_scene_converter
src/core/LuxLex.py
LuxLex.py
py
2,530
python
en
code
18
github-code
1
3617920960
from re import X import torch import torch.nn as nn from torchvision.transforms import functional as F from PIL import Image from models.MIMOUNet import build_net from models.unet import DeblurUNet from models.face_model.face_gan import FaceGAN from skimage.metrics import peak_signal_noise_ratio import cv2 import os...
ckirchhoff2021/ImageSynthesis
MMU-DDP/gen2.py
gen2.py
py
4,212
python
en
code
2
github-code
1
9788724565
from app import app from flask import render_template, redirect, url_for, current_app from app import db from app.models import Car from app.forms import AddForm, SearchForm import sqlalchemy as sa import sys @app.route('/init') def initialize_db(): connection_uri = app.config['SQLALCHEMY_DATABASE_URI'] engin...
NormanBenedict/hwk2
hw2-cse-321/app/routes.py
routes.py
py
2,798
python
en
code
0
github-code
1
3527241237
# -*- coding: utf-8 -*- import pytest import requests from jsonschema import validate url_parts = ["", "/8094", "/search?query=Brewing", "/autocomplete?query=dog"] @pytest.mark.parametrize("params", url_parts) def test_status_code(base_url, params): """Проверка кода состояния HTTP""" target = ...
Eliseev-Max/API_testing
open_brewery_db/test_open_brewery.py
test_open_brewery.py
py
3,271
python
en
code
0
github-code
1
22406110387
#22. Escrever um algoritmo que leia os dados de “N” pessoas (nome, sexo, idade e saúde) e informe se está apta ou não para cumprir o serviço militar obrigatório. Informe os totais. contro = "n" contador = 0 while contro != "s": nome = input("informe seu nome: ") sex = input("informe seu sexo: ") idad = in...
caiocosta01/Atividades-Python
lista de exercícios-22.py
lista de exercícios-22.py
py
757
python
pt
code
0
github-code
1
44469912793
import gtk class PyApp(gtk.Window): def __init__(self): super(PyApp,self).__init__() self.set_title("Alignment demo") self.set_size_request(400,200) self.set_position(gtk.WIN_POS_CENTER) vbox=gtk.VBox(False,5) vb=gtk.VBox() hbox=gtk.HBox(True,3) valign=gtk.Alignment(0.5,0.25,0,0) ...
rong11417/PyGTK_demo
alignment.py
alignment.py
py
850
python
en
code
2
github-code
1
1145617455
import sys sys.setrecursionlimit(10**5) input = sys.stdin.readline N = int(input()) edge = [ [] for _ in range(N+1)] for _ in range(N-1): u,v,w=map(int,input().split()) edge[u].append((v,w)) edge[v].append((u,w)) def dfs(curr,dist): global max_dist, max_index if max_dist < dist: ...
seoljeongwoo/learn
algorithm/BOJ_1964.py
BOJ_1964.py
py
708
python
en
code
0
github-code
1
21173035808
from typing import Dict, List from app.utils import preprocessor_slot_description_to_value import torch from transformers import AutoTokenizer from app.model.pretrained_models import get_pretrained_model, get_tokenizer class FlanT5Sacc: def __init__(self, size: str, device) -> None: self.name = f"flan-t...
janpawlowskiof/template-based-response-generation-in-tod
app/rankers/flan_t5_ranker.py
flan_t5_ranker.py
py
2,949
python
en
code
0
github-code
1
71103588835
import os import ycm_core project_dir = os.path.dirname(os.path.abspath(__file__)) compilation_database_folder = os.path.join(project_dir, "code/build/") database = ycm_core.CompilationDatabase( compilation_database_folder ) additional_flags = [ '-isystem', '/usr/local/include', '-isystem', '/usr/include', ...
poutipie/yage
.ycm_extra_conf.py
.ycm_extra_conf.py
py
1,867
python
en
code
0
github-code
1
8692692038
import datetime import itertools from .models import Period # https://www.womenshealth.gov/a-z-topics/menstruation-and-menstrual-cycle AVERAGE_MENSTRUAL_CYCLE = datetime.timedelta(days=28) def avg(lst): length = 0 total = 0 for item in lst: total += item length += 1 return total / le...
rockymeza/ymrj
periods/utils.py
utils.py
py
1,161
python
en
code
0
github-code
1
71904125153
#Imports from torch.utils.data import Dataset import pandas as pd import numpy as np import librosa import torch class AudioLocationDataset(Dataset): def __init__(self, root="./../data_clip/", csv="./data_clip_label/label.csv", transform=None, use_subset=None, num_bin = 2): self.root = root self...
zacharyyamaoka/DE3-Audio
nn_utils/nn_util.py
nn_util.py
py
6,075
python
en
code
0
github-code
1
72921016995
import os from fabric.api import cd, run, env, task, get from fabric.contrib.files import exists from ..repositories import get_repo_name from fabric.context_managers import prefix @task def pip_download_cache(keep_dir=None): """Downloads pip packages into deployment pip dir. """ if not exists(env.deplo...
botswana-harvard/edc-fabric
edc_fabric/fabfile/pip/tasks.py
tasks.py
py
3,218
python
en
code
0
github-code
1
4489182542
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from tensorflow.keras.utils import to_categorical from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.applications import ResNet101 from tensorflow.keras.models import Model from tensorflow....
Taerimmm/ML
Lotte/06_1_ResNet101.py
06_1_ResNet101.py
py
2,392
python
en
code
3
github-code
1
4644928169
import base64 import glob import os import os.path as op import posixpath as pp from urllib.parse import urlencode, urljoin import pandas as pd import requests class EncodeClient: BASE_URL = "http://www.encodeproject.org/" # 2020-05-15 compatible with ENCODE Metadata at: METADATA_URL = "https://www.enc...
open2c/bioframe
bioframe/sandbox/clients.py
clients.py
py
5,776
python
en
code
127
github-code
1
42977750791
# coding=utf-8 def triplet_sum_close_to_target(arr, target_sum): arr.sort() smallest_diff = target_sum - arr[0] - arr[1] - arr[2] for left in range(len(arr) - 2): middle = left + 1 right = len(arr)-1 while middle < right: current_sum = arr[left] + arr[midd...
dzy176/KnowledgeMapping
Code/grokking/python/two_pointers/5_triplet_sum_close_to_target.py
5_triplet_sum_close_to_target.py
py
1,041
python
en
code
0
github-code
1
72301275554
#!/usr/bin/python3 from lxml import html import requests import hashlib import base64 import re session = "7uvlvl1ci3tho8pdl2pgrp7ag0" # NOT GETTING THE RIGHT CHALLENGE def process(data): print("="*35 + " Input " + "="*35) print(data) # can_decode = True # i = 0 # while can_decode: # i += 1 # try: # temp = ...
0xchase/ctfs
ring0/coding/7-littlelf/solve.py
solve.py
py
1,345
python
en
code
0
github-code
1
22091923760
n = int(input()) lista = [] for i in range(n): num = int(input()) lista.append(num) for x in lista: if x > 0 and x % 2 == 0: print('EVEN POSITIVE') elif x < 0 and x % 2 == 0: print('EVEN NEGATIVE') elif x > 0 and x % 2 != 0: print('ODD POSITIVE') elif x < 0 and x % 2 != ...
JoaoAssalim/Beecrowd-Solution
Python/1074.py
1074.py
py
384
python
en
code
5
github-code
1
36571798337
from flask import jsonify, request from flask_restful import Resource from Model import db, VistorChainsTotal, VistorLevel, Vistor, States from Model import VisitorChainTotalSchema, VistorLevelSchema, VisitorSchema, QuerySchema, StatesSchema, Names from webargs import fields, validate from webargs.flaskparser import...
donc310/WidgetApi
resources/Query.py
Query.py
py
9,773
python
en
code
0
github-code
1
14573968338
# import library and abbreviate pyplot for easier use import matplotlib.pyplot as plt # list of data we'll be plotting inputValues = [1, 2, 3, 4, 5] squares = [1, 4, 9, 16, 25] # using a built-in style # note: this needs to go BEFORE running subplots() and plot() plt.style.use('dark_background') # fig...
jamesastephenson/python-2022
matplotlib 1 (8-13-22)/mpl_squares.py
mpl_squares.py
py
1,027
python
en
code
0
github-code
1
19874279600
import cv2 import numpy as np #Fill the screen with digits def fill_digits_motion(num_array , coor_array , indexes , tos): cap=cv2.VideoCapture(0) if cap.isOpened() : ret,frame = cap.read() else: ret = False ret,frame1 = cap.read() ret,frame2 = cap.read() diff = ...
YashIndane/AR-Sudoku-Solver
python_files/motion_digits2.py
motion_digits2.py
py
1,761
python
en
code
26
github-code
1
8007887981
# App de Medição de Indice de Descarte # Imports import pickle import numpy as np import pandas as pd import logging, io, os, sys from sklearn.ensemble import GradientBoostingClassifier from flask import Flask, render_template, flash, request, jsonify # pip install flask_httpauth from flask_httpauth import HTTPBasic...
machadodecastro/animal_death_risk_prediction
app/app.py
app.py
py
3,775
python
pt
code
0
github-code
1
21447706332
import torch import torchvision import torchvision.transforms as transforms DATA_PATH = './data' def get_transform(): transform = transforms.Compose( [transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,))]) return transform def get_dataset(transform, download=True): train_set = to...
nmd-2000/torchserve-demo
model/utils.py
utils.py
py
809
python
en
code
0
github-code
1
22386365690
import random import torch import cv2 import json import os from typing import List, Tuple import asset from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler from asset.utils import dmsg,getIfAugmentData import imgaug.augmenters as iaa import numpy as np from tqdm import tqdm import random as rand from ...
AIS-Bonn/Local_Freq_Transformer_Net
lfdtn/dataloaders.py
dataloaders.py
py
22,110
python
en
code
14
github-code
1
72995391073
import pandas as pd import numpy as np import sys sys.path.append( '/groups/umcg-lifelines/tmp01/projects/ov20_0554/umcg-aewijk/covid19-qol-modelling/src/python') from config import get_config import matplotlib.pyplot as plt plt.switch_backend('agg') import warnings warnings.filterwarnings('ignore') def add_we...
molgenis/covid19-qol-modelling
src/python/make_dataframe_for_correlation.py
make_dataframe_for_correlation.py
py
7,731
python
en
code
0
github-code
1
17447453062
from typing import Callable, Dict from starlette import status from starlette.middleware.base import BaseHTTPMiddleware from starlette.requests import Request from starlette.responses import RedirectResponse, Response from starlette.types import ASGIApp, Receive, Scope, Send class LegacyRedirectMiddleware(BaseHTTPMi...
florimondmanca/www
server/web/legacy.py
legacy.py
py
2,045
python
en
code
31
github-code
1
11468156208
class SIGTools(object): """ This class collects all the sig functions to use in TileVect, GeomConfig """ @classmethod def get_extent_of_layer(cls, layer): """ Outputs length of the smaller size of the features' bbox Returns 0 if the bbox is a Point """ min_...
Terralego/django-geostore
geostore/tiles/sigtools.py
sigtools.py
py
827
python
en
code
21
github-code
1
6003789556
#!/usr/bin/env python # -*- coding: utf-8 -*- def docclass_test(): cl = fisherclassifier(getwords) cl.setdb('test1.db') sampletrain(cl) cl2 = naivebayes(getwords) cl2.setdb('test1.db') cl2.classify('quick money') if __name__ == '__main__': import nose nose.main()
cametan001/document_filtering
docclass_test.py
docclass_test.py
py
300
python
en
code
1
github-code
1
15345500601
#!/usr/bin/env python # coding: utf-8 # In[1]: print("Hello World!") # In[2]: import librosa import numpy as np import matplotlib.pyplot as plt import IPython.display as ipd import librosa.display from IPython.display import Audio from scipy import stats # In[3]: y, sr = librosa.load("yours.mp3") # In[4]: ...
kirtisubs06/AI-Music-Research-Code
MusicAIJupyterNotebook.py
MusicAIJupyterNotebook.py
py
13,649
python
en
code
1
github-code
1
7521363992
# 탐색과 정렬_순차 탐색 # first trial: error: # a[0]과 x가 같지 않다면 무조건 -1만 출력 # return -1이 if절에 속해, for 문의 반복이 이뤄지지 않았기 때문 def find_loc_err(a, x): n = len(a) for i in range(0, n): if a[i] == x: return i else: return -1 c = [44, 20, 47, 14, 22, 99, 63, 86] print(find_loc_err(c, 20)) print(find_loc_err...
kyueunQ/Python
algorithms/day07.py
day07.py
py
1,319
python
ko
code
0
github-code
1
20613432599
import maya.cmds as cmds from math import * psphere = cmds.sphere(r=5) pcube = cmds.polyCube() pcone = cmds.polyCone() closestToSurface = cmds.createNode("closestPointOnSurface") cmds.connectAttr(closestToSurface+'.position', pcube[0]+'.translate') cmds.connectAttr(pcone[0]+'.translate', closestToSurface+'.inPosition'...
ameliacode/BestTextbookforTechnicalArtists
Chapter 2. Procedure/object_movement.py
object_movement.py
py
401
python
en
code
0
github-code
1
27429545506
#REQUIREMENTS # ffmpeg # vosk # youtube-dl ## import vosk import os import sys import getopt from traceback import print_exc from subprocess import Popen, PIPE import shlex import json from vosk import Model, KaldiRecognizer, SetLogLevel def main(*argv): try: #argv = argv[0] argv = sys.argv[1:] ...
giraycoskun/vosk-ASR-app
app/commandline_tool.py
commandline_tool.py
py
3,878
python
en
code
0
github-code
1
42472504231
import json from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django.contrib.auth.mixins import LoginRequiredMixin from django.views import View from django.views.generic import FormView from django.views.generic import ...
ivn-svn/pionergallery
pionergallery/pioner_gallery/views.py
views.py
py
13,406
python
en
code
0
github-code
1
22735484746
import cv2 import sys import os # 解析gpfpd消息 def parse_gpfpd(gpfpdfile): with open(gpfpdfile, 'r') as f: dic1 = [] dic1.append(-1) dic2 = [] dic2.append([0,0,0,0,-0.202,0,0,0,0,0,0,0,0,0,0,0]) for line in f.readlines(): line = line.strip('\n') ...
guoxxiong/Lane-Image-Stitching-Based-on-Integrated-Inertial-Navigation
rotate.py
rotate.py
py
2,299
python
en
code
1
github-code
1
41034040354
from __future__ import annotations from typing import Any from typing import Optional from . import ext from .._typing import _OnConflictConstraintT from .._typing import _OnConflictIndexElementsT from .._typing import _OnConflictIndexWhereT from .._typing import _OnConflictSetT from .._typing import _OnConflictWhere...
sqlalchemy/sqlalchemy
lib/sqlalchemy/dialects/postgresql/dml.py
dml.py
py
10,965
python
en
code
8,024
github-code
1
15621341184
import urllib from bs4 import BeautifulSoup import re import csv url = "http://stats.footballpredictions.net/england/premier/1995-1996/results.html" htmlfile = urllib.urlopen(url) soup = BeautifulSoup(htmlfile) #home team names hometeam = soup.find_all("td", class_="hometeam") ht = [] for element in hometeam: ht.ap...
dviera/replications
Lee/get_data.py
get_data.py
py
1,233
python
en
code
0
github-code
1
10488495780
# 784. Letter Case Permutation # https://leetcode.com/problems/letter-case-permutation/ class Solution: def letterCasePermutation(self, s: str) -> List[str]: queue = [] queue.append(s) for i in range(len(s)): if s[i].isalpha(): for _ in range(len(queue)): ...
pablomdd/Algoritmia
Leetcode/BFS-DFS/letterCasePermutation.py
letterCasePermutation.py
py
583
python
en
code
2
github-code
1
11420247228
""" A script that compares image histograms quantitively. The user must specify either a single image or a directory (jpg/png). """ # system tools import os import argparse import sys # image and data tools import cv2 import numpy as np import glob import pandas as pd # plotting tools import matplotlib.pyplot as plt...
sarah-hvid/Vis_assignment1
src/hist_comparison.py
hist_comparison.py
py
5,910
python
en
code
0
github-code
1
33559442185
from django.contrib.auth.models import User from django.db import models from django.db.models import Index class EquipmentType(models.Model): """ Тип оборудования """ name = models.CharField(max_length=255, verbose_name='Type name') serial_number_mask = models.CharField(max_length=50, verbose...
KotelnikovKP/equipment
backend/models.py
models.py
py
2,379
python
en
code
0
github-code
1
23033725045
##diagonalize import numpy as np from qe.ReadDynMat import * import cmath def Get_Eval_Evec_dDdV ( Darray): Deq = [] ## equilibrium dyn matrices Dn = [] ## non-equilibrium dyn matrices dD = [] ## what will be returned (dD/dV) eval = [] ## eigenvalues (omega^2) evec = [] ## eigenvectors that diagona...
alex-miller-0/grupy
Versions/1.0/grupy/GruCalc.py
GruCalc.py
py
7,629
python
en
code
5
github-code
1
4327026652
import ipaddress import re import glob def Return_IP_adr(str): if re.match("^ ip address ([0-9.]+) ([0-9.]+)$", str): r = re.match("^ ip address ([0-9.]+) ([0-9.]+)$", str) return ipaddress.IPv4Network((r.group(1), r.group(2)),strict = False) else: return "None" list_files = glob.glo...
shpinatashan/p4ne
Lab1.6/Lab.py
Lab.py
py
827
python
en
code
0
github-code
1
20485270061
import requests from bs4 import BeautifulSoup import pandas as pd def extract(page): url = f'https://in.indeed.com/jobs?q=python+developer&l=India&start={page}' res = requests.get(url) # return res.status_code soup = BeautifulSoup(res.content, 'html.parser') return soup job_list = [...
ashish-ash303/Indeed-Scraping
indeed.py
indeed.py
py
1,067
python
en
code
0
github-code
1
25169636157
import time import datetime from grooveshark import Grooveshark ################################################################################ TITLE = 'Grooveshark' ART = 'art-default.jpg' ICON = 'icon-default.png' SEARCH_ICON = 'icon-search.png' PREFS_ICON = 'icon-prefs.png' PRE...
manfer/Grooveshark.bundle
Contents/Code/__init__.py
__init__.py
py
13,545
python
en
code
0
github-code
1
21237918702
import os import queue import json from jsonschema import validate import collections class TestCase(): """Attributes of a single test. Args: test_data (dict): data for a single test, parsed from JSON test declaration. """ __test__ = False #: Ignored by Pytest ...
MaxenceCaronLasne/unitbench
unitbench/testdeclaration.py
testdeclaration.py
py
4,307
python
en
code
1
github-code
1
751666782
import argparse import re import os import pickle '''--------------------Parsing argumnts--------------------''' parser = argparse.ArgumentParser(description="Этот код создаёт модель, обученную на текстах песен") parser.add_argument( '--input_dir', type=str, help="Путь к папке с песнями" ) pars...
DommeUse/Text-Generator
train.py
train.py
py
1,508
python
ru
code
0
github-code
1
2299118867
import os import xml.etree.ElementTree as ET import json def append_barcode(results, barcode): result = {} result["attrib"] = barcode.attrib Values = get_elements(barcode, "Value") for Value in Values: result["text"] = Value.text result["value_attrib"] = Value.attrib resu...
xulihang/Barcode-Reading-Performance-Test
utils/create_ground_truth_from_xml.py
create_ground_truth_from_xml.py
py
1,176
python
en
code
11
github-code
1
72551570275
from enum import IntEnum, auto from typing import Tuple, Sequence from unsserv.common.utils import parse_node from unsserv.common.structs import Node from unsserv.common.rpc.structs import Message from unsserv.common.rpc.protocol import AProtocol, ITranscoder, Command, Data, Handler from unsserv.extreme.searching.stru...
aratz-lasa/py-unsserv
unsserv/extreme/searching/protocol.py
protocol.py
py
3,158
python
en
code
5
github-code
1
1093253833
import sys import os sys.path.insert(0, os.getcwd() + '/../keggimporter') import logging import logging.handlers from Config import * from Importer import * config = Config() config.loadConfiguration() conf = config.getConfigurations() logFile = conf.get( 'log', 'info' ) log = logging.getLogger('') log.setLevel(lo...
alexanderfranca/keggimporter
bin/execute-importer.py
execute-importer.py
py
1,573
python
en
code
0
github-code
1
11602311705
import pandas as pd import functest as ft # 함수화 규칙 # 입력 데이터는 괄호안에 작성 # 데이터의 출력은 return # 출력 관련 함수 사용금지 def getSortData(data,groupList): data1 = data.set_index(groupList).sort_index() return data1.reset_index(inplace=False) data=pd.read_csv("ymd.csv",sep="\t|,",names=['year','month','day','data']) groupList...
zhtmr/pythoncode
test4-1.py
test4-1.py
py
849
python
ko
code
0
github-code
1
38547541466
import math #Obtenção de Dados matriz = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] sub1 = sub2 = sub3 = sub4 = sub5 = sub6 = sub7 = sub8 = sub9 = sub10 = sub11 = sub12 = 0 linha1 = linha2 = linha3 = linha4 = linha5 = linha6 = 0 mid1 = mid2 = mid3 = mid4 = mid5 = mid6 = 0 histeres...
PoshWizard376/Certificado-de-Calibracao
Incertezas.py
Incertezas.py
py
5,472
python
pt
code
0
github-code
1
34666592380
""" Useful functions for processing SMBL Data """ import requests import sys import re import libsbml import xmltodict import json def delete_doubles(arr): """ :param arr: list() :return: Given list, without duplicated entries """ arr2 = [] for element in arr: if not arr2.__contains__(...
JosuaCarl/Script_Assisted_Modeling
helper_functions.py
helper_functions.py
py
9,195
python
en
code
1
github-code
1
1914061684
""" NOTE: You will have to install the Haskell program find-clumpiness on your machine before running this script. For more info, see: https://github.com/GregorySchwartz/find-clumpiness Also, this script calls the find-clumpiness program using the terminal via linux commands. The commands may not work if y...
DrexelSystemsImmunologyLab/Pediatric_gut_homeostatsis_paper
Supplemental/preprocessing/get_clumpiness_by_POD.py
get_clumpiness_by_POD.py
py
27,497
python
en
code
0
github-code
1
7946558670
import warnings import argparse import mlflow from mlflow.tracking.client import MlflowClient warnings.filterwarnings("ignore", category=FutureWarning) from custom_preproc_classes.config.core import config def parse_bool(to_production: str): if to_production == "T": return True elif to_production ==...
afanzott/Data_Science_Best_Practice
register_mlflow_model.py
register_mlflow_model.py
py
1,955
python
en
code
0
github-code
1
8620148120
from django.core.management.base import BaseCommand from home2_app.models import Client class Command(BaseCommand): help = "edit client name " def add_arguments(self, parser): parser.add_argument('name', type=str, help="Client_name") parser.add_argument('new_name', type=str, help="New_Client...
vit21513/django_homework
home_project/home2_app/management/commands/edit_client_name.py
edit_client_name.py
py
698
python
en
code
0
github-code
1
75257613153
# goal # 실패율이 높은 스테이지부터 내림차순으로 스테이지의 번호가 담겨있는 배열을 return 하도록 solution 함수 # description # 실패율 - 스테이지에 도달했으나 아직 클리어하지 못한 플레이어의 수 / 스테이지에 도달한 플레이어 수 # 전체 스테이지의 개수 N, 게임을 이용하는 사용자가 현재 멈춰있는 스테이지의 번호가 담긴 배열 stages가 매개변수 # condition # 스테이지의 개수 N은 1 이상 500 이하의 자연수이다. # stages의 길이는 1 이상 200,000 이하이다. # stages에는 1 이상 N + 1 이하의...
jum0/ProblemSolvingPython
Programmers/42889.py
42889.py
py
1,713
python
ko
code
0
github-code
1
34121568699
import time import PySimpleGUI as sg from classes.logger import Logger from classes.microscope_mover import MicroscopeMover, mover from classes.scanner import Scanner from classes.solis import Automatization from gui.helpers import disable_element, enable_element, get_load_path, str_to_int from gui.scanner_gui import...
LZP-2020-1-0200/Solis-XY
scanner.py
scanner.py
py
4,903
python
en
code
0
github-code
1
74633942113
""" Django command to wait for DB to be available """ import time # Shows error but the psycopg2 is successfully installed on docker from psycopg2 import OperationalError as Psycopg2Error from django.db.utils import OperationalError from django.core.management.base import BaseCommand class Command(BaseCommand): ...
Uchiha-Itachi0/django-recipe-api
app/core/management/commands/wait_for_db.py
wait_for_db.py
py
898
python
en
code
0
github-code
1
7695455337
from .interpretpicklist import Interpretpicklist from . import dateutils from datetime import datetime from . import xmlutilities from synthesis.exceptions import DataFormatError#, SoftwareCompatibilityError from . import logger #from sys import version from . import dbobjects from .writer import Writer from zope.inter...
211tbc/synthesis
src/svcpointxml5writer.py
svcpointxml5writer.py
py
26,257
python
en
code
0
github-code
1
30151381555
import numpy as np import cv2 import matplotlib.pyplot as plt def getScoreImg(): nums = cv2.imread("numbers.png") ret, nums = cv2.threshold(nums,127,255,cv2.THRESH_BINARY_INV) nums = cv2.cvtColor(nums, cv2.COLOR_BGR2GRAY) top = np.zeros((1,530)) nums = np.concatenate((top,top,top,top, nums, top,top...
fancent/CSC420
Project/digitRecognition/numberSlicing.py
numberSlicing.py
py
2,270
python
en
code
0
github-code
1
8500981124
#!/usr/bin/env python # coding: utf-8 # # COEN 140 Final Project - Music Genre Classifer # In[241]: import os import json import numpy as np import scipy import pandas as pd import librosa as lb import warnings from sklearn.model_selection import train_test_split from sklearn.discriminant_analysis import LinearDis...
amiller5233/COEN140-genre-classifier
final_project.py
final_project.py
py
10,097
python
en
code
0
github-code
1
17381459463
import pyautogui as pag from collections import namedtuple,Counter import random """ https://asyncfor.com/posts/doc-pyautogui.html screenWidth, screenHeight = pyautogui.size() currentMouseX, currentMouseY = pyautogui.position() pyautogui.moveTo(100, 150) pyautogui.click() # 鼠标向下移动10像素 pyautogui.moveRel(None, 10) pyau...
dkluffy/Gamescripts
liverbot/devicebind.py
devicebind.py
py
1,283
python
en
code
1
github-code
1
40856341647
from api.repository.organization_repository import OrganizationRepository from api.services.formatter import FormatterService class OrganizationService: @staticmethod def get_all_organization_with_total_amount_paid(): organizations_with_total_amount_paid = [] organizations = OrganizationReposi...
NicolleLouis/theolex
back/api/services/organization/organization_service.py
organization_service.py
py
863
python
en
code
0
github-code
1
5081835274
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from tkinter import * class KitchenTable(): def __init__(self, root): self.tk=Frame(root) self.tk.pack(expand=True,fill="both") self.tk.configure(bg="white") self.order_ready=False self.food_placed=False # Set custom c...
tolas92/py_tree
src/waiter_tree/waiter_tree/table_page.py
table_page.py
py
3,330
python
en
code
0
github-code
1
14069660411
def eval(tokens): stack = [None] opstack = [None] for token in tokens: pending = None if token == '(': stack.append(None) opstack.append(None) elif token == ')': pending = stack.pop() opstack.pop() elif token == '+': ...
funkyt/AoC
2020/18/p18.py
p18.py
py
884
python
en
code
1
github-code
1
72227373155
from math import sqrt # ref = set((long, lat, val)) parsed_data = {} def fn(lat, lon, ref): ret = [0.0, 0.0] d_tot = 0.0 for data in ref: d_lat, d_lon, _, _ = data d_tot += 1.0/getDist(lon, lat, d_lon, d_lat) for data in ref: d_lat, d_lon, air, ground = data dist = getDist(lon, lat, d_lon, d_lat) ret[0]...
bagelSeed/FB_ML-Hack
PruneData.py
PruneData.py
py
1,756
python
en
code
0
github-code
1
20085148878
""" Test the rendering mechanism to see if inquirer works """ from unittest.mock import Mock, create_autospec, patch import inquirer from pytest import fixture from hacenada import render, session @fixture def renderer(): rr = render.InquirerRender() return rr def test_inquirer_type(renderer): """ ...
corydodt/Hacenada
src/hacenada/test/test_render.py
test_render.py
py
1,612
python
en
code
1
github-code
1
30473794377
from django import forms from django.contrib.contenttypes.models import ContentType from django.db import transaction from .fields import TaxiField, TaxiSingleField from .models import TermTaxonomy, TermTaxonomyItem class TaxiModelMixin(forms.ModelForm): """ Mixin used on model forms where a TaxiField is set...
nibon/django-taxi
django_taxi/mixins.py
mixins.py
py
3,745
python
en
code
0
github-code
1
26890455961
# -*- coding: utf-8 -*- """ Created on Fri Nov 4 14:23:45 2022 @author: Audi Aulia """ print ("Menentukan bilangan prima.") def prima(): num = int(input("Masukan angka : ")) for i in range(2, num): if num % i == 0: return False return True x = prima() print(x)
audliaaasss/Modul-7
Menentukan bilangan Prima.py
Menentukan bilangan Prima.py
py
320
python
en
code
0
github-code
1
40076125976
carte_chance = { 0:["Amende pour excès de vitesse", -15], 1:["La banque vous verse un dividende de € 50",50], 2:["Vous êtes imposé pour les réparations de voirie a raison de : € 40 par house et € 115 par hotel",""], 3:["Avancez jusqu'à la case Départ",0], 4:["Payez les frais de scolarité : € 150",-1...
JBretaud/monopoly_python
src/__init__.py
__init__.py
py
17,947
python
fr
code
0
github-code
1
28462169332
import pygame import Config import tile_map import light_handling win = pygame.display.set_mode(Config.WINDOW_SIZE) clock = pygame.time.Clock() map = tile_map.Tile_map() light = light_handling.light_handling(map.walls, map.points) flag = True while flag: clock.tick(Config.FPS) for event in pygame.event.get(...
XT60/Dynamic-lights-2D
Loop.py
Loop.py
py
672
python
en
code
10
github-code
1
73205778914
import sys from collections import deque n, w, L = map(int, input().split()) weight = deque(map(int, sys.stdin.readline().split())) # 트럭 무게 리스트 (=> 대기) bridge = deque() # 다리 위 for i in range(w-1): # w-1만큼 0으로 채우고 bridge.append(0...
eunjng5474/Study
week04/B_13335.py
B_13335.py
py
1,902
python
ko
code
2
github-code
1
71904121953
import serial import time import numpy as np class DummyHead(): def __init__(self, port): """Will work in deg in this class""" self.ino = serial.Serial('/dev/cu.usbmodem'+str(port), 115200, timeout=1) time.sleep(2) self.theta = 0 #need big range here self.max_left ...
zacharyyamaoka/DE3-Audio
dummy_head.py
dummy_head.py
py
2,099
python
en
code
0
github-code
1
27781889678
# -*- coding: utf-8 -*- """ Created on Mon Jan 28 20:19:55 2019 @author: mjkiqce3 """ import numpy as np import multiprocessing from multiprocessing import Pool def computeerr(n,regressor,cc,inputtest): for i in range(n): # We can parallelise here datause=cc[:,:,i] X=datause[:,0:10] ...
clementetienam/Machine-Learning-for-Model-Reduction-to-Fustion-Simulation-data_2
Clement_Codes/clementpara.py
clementpara.py
py
899
python
en
code
1
github-code
1
74473377953
from django import forms from .models import * class StockCreateForm(forms.ModelForm): class Meta: model=Stock fields=['category','item_name','quantity'] #prevent saving form with blank details def clean_category(self): category=self.cleaned_data.get('category') if not category: raise forms.ValidationErr...
graham218/Django-simple-stock-mgmt
stock_management_system/stockmgmt/forms.py
forms.py
py
3,448
python
en
code
1
github-code
1
72243973154
from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import urlfetch from django.utils import simplejson as json base = 'https://github.com/login/oauth/access_token' client_id = '?client_id=' redirect_url = '&redirect_uri=https://githubanywhere.appspot.com/call...
abraham/github-anywhere
appengine/main.py
main.py
py
2,176
python
en
code
40
github-code
1
7668299866
from __future__ import print_function import pandas as pd import numpy as np import matplotlib.pyplot as plt import sys dropOutColumn = ['MakeId', 'Url', 'FrontImagePath', 'PhotoCount', 'Price', 'Km', 'ModelName', 'VersionName', 'AdditionalFuel', 'VideoCount', 'OfferStartDate', 'OfferEndDate', 'LastUp...
liuxuhan/dataAnalysis
dataCleanNew.py
dataCleanNew.py
py
2,442
python
en
code
0
github-code
1
29461251296
from __future__ import division import numpy import matplotlib.cm as cm import matplotlib.pyplot as plt #import imp import os,sys import numpy as np #importlibutil #from scipy.optimize import minimize from scipy.optimize import basinhopping import random import math micron=1e-6 sys.path.append("/opt/...
jobayer07/integrated_photonics_design_optimization
optimize_polarization_rotator_step2.py
optimize_polarization_rotator_step2.py
py
3,159
python
en
code
0
github-code
1
73088426594
import asyncio import logging import signal import session log = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) class MyClientSession(session.ClientSession): async def on_connected(self): self.update_sock.subscribe('test.topic') self.client_state = session.ClientSessionStat...
hippysurfer/pyqtzmq
test_client.py
test_client.py
py
1,856
python
en
code
0
github-code
1
74826946272
from setuptools import setup, find_packages with open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='mycroft-ekylibre-utils', version='0.9', packages=find_packages(), url='http://github.com/ekylibre', author='Ekylibre', author_email='rdechazelles@ekylibre.co...
ekylibre/mycroft-ekylibre-utils
setup.py
setup.py
py
732
python
en
code
0
github-code
1