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
15731112153
import cv2 from cv2 import * import numpy as np from .cv2pynq import * from pynq.lib.video import * __version__ = 0.3 c = cv2pynq() video = c.ol.video #cv2pynq uses the pynq video library and the Pynq-Z2 video subsystem def Sobel(src, ddepth, dx, dy, dst=None, ksize=3, scale=1, delta=0, borderType=cv2.BORDER_DEFAULT...
JinChen-tw/PYNQ-Z2
E_Elements_labs/cv2pynq/__init__.py
__init__.py
py
2,147
python
en
code
9
github-code
13
21800376232
# Time Limit per Test: 1 seconds # Memory Limit per Test: 256 megabytes # Using: PyPy 3-64 # Solution Link: https://codeforces.com/contest/1775/submission/189010130 ''' Question Link: https://codeforces.com/contest/1775/problem/C Petya and his friend, robot Petya++, like to solve exciting math problems. One day Petya...
Squirtleee/AlgoPractice
Solutions/Interesting Sequence.py
Interesting Sequence.py
py
1,942
python
en
code
0
github-code
13
12156328110
import pymongo import datetime import customers def getAllFilms(client): try: movies_collection = client["rentals"] movies = movies_collection.find().sort("_id",1) retList = [] for m in movies: m_obj = {"Title" : m["Title"], "Category" : m["Category"], "id" : m["_id"], ...
Ekhemlin/flask_mongo_assesment
backend/films.py
films.py
py
1,283
python
en
code
0
github-code
13
43594177885
import requests from pprint import pprint import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') log = logging.getLogger('root') # CONSTANT COINDESK_URL = 'https://api.coindesk.com/v1/bpi/currentprice.json' def main(): bitcoin_num = get_user_bitcoin_value() co...
xd3262nd/lab-8
bitcoin.py
bitcoin.py
py
1,802
python
en
code
0
github-code
13
34809869814
import codecs import json import cv2 import tensorflow as tf import matplotlib.pyplot as plt IMAGE_SIZE = 64 feature_description = { 'label': tf.io.FixedLenFeature([], tf.int64, default_value=-1), 'data': tf.io.FixedLenFeature([], tf.string) } def json_labels_read_from_file(file_path): with codecs.ope...
1984xunhuan/face_classify
load_dataset.py
load_dataset.py
py
2,912
python
en
code
3
github-code
13
35451305782
# -*- coding:utf-8 -*- # REG_PATTERN REG_PATTERN = { 'video': r'/video/av(\d+)', 'article': r'/read/cv(\d+)', 'user': r'/(\d+)/', 'tag': r'/tag/(\d+)', 'online': r'/x/web-interface/online', 'reply': r'/reply' } # Bilibili category maps CATEGORY_MAP = { "douga": { "name": "动画", ...
SatoKoi/BilibiliSpider
BilibiliSpider/map/defaults.py
defaults.py
py
1,654
python
en
code
15
github-code
13
32293934235
import os import sys import shutil import numpy as np import tensorflow as tf from tensorflow.python.ops import init_ops from tensorflow.contrib.layers.python.layers import regularizers module_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..") if module_path not in sys.path: sys.path.append(mod...
kabrapratik28/DeepVideos
model/model_skip_autoencoder.py
model_skip_autoencoder.py
py
23,767
python
en
code
4
github-code
13
73729121296
import cv2 import numpy as np import os from tqdm import tqdm import matplotlib.pyplot as plt CLASS_NAMES = ("None", "Road", "Sign", "Car", "Pedestrian") colorB = [0, 0, 255, 255, 69] colorG = [0, 0, 255, 0, 47] colorR = [0, 255, 0, 0, 142] N_...
madara-tribe/SetupSystems
ML/segmentation/IOUScore/utils.py
utils.py
py
3,251
python
en
code
0
github-code
13
7290416706
#!/usr/bin/env python3 import xml.etree.cElementTree as ET import re from matplotlib import pyplot as plt import numpy as np from svg.path import parse_path from functools import lru_cache it = ET.iterparse('RS1096.svg') for _, el in it: if '}' in el.tag: el.tag = el.tag.split('}', 1)[1] # strip all name...
wenlintan/musiqcWashington
PyPlay/trap_fe/geometry/hoa-geometry.py
hoa-geometry.py
py
7,028
python
en
code
0
github-code
13
2355560597
# 344 - Reverse String # https://leetcode.com/problems/reverse-string/ class Solution: # list the methods to be run against the test cases implementations = ["reverse_string"] def reverse_string(self, s: list[str]) -> list[str]: """ Use two pointers, left and right, and swap opposing ele...
andrewt110216/algorithms-and-data-structures
leetcode/p0344_solution.py
p0344_solution.py
py
1,481
python
en
code
0
github-code
13
73662999056
# -*- encoding: utf-8 -*- import os import warnings __all__ = [ 'check_pid', 'warn_if_not_float' ] def warn_if_not_float(X, estimator='This algorithm'): """Warning utility function to check that data type is floating point. Returns True if a warning was raised (i.e. the input is not float) and F...
dingdian110/alpha-ml
alphaml/utils/common.py
common.py
py
1,738
python
en
code
1
github-code
13
14508410119
import unittest import os from pathlib import Path def sys_path_init(): import sys # For tests/main.py Path path = Path(os.path.realpath(__file__)).parent.parent.parent.absolute() sys.path.append(str(path)) # For test.sh Path path = Path(os.path.realpath(__file__)).parent.parent.absolute() ...
soo4767/sprint-backend-v2
tests/main.py
main.py
py
2,781
python
en
code
0
github-code
13
31509237214
import unittest from unittest import TestCase from enum import Enum from functools import wraps from typing import ( Callable, Optional, List, Any ) class TestNumber(TestCase): def setUp(self) -> None: self.incorrect_values: List[Any] =\ ['3', 1.2, -2, 'asf', []] self.c...
madjar-code/LeetCode-Solutions
Binary Search/Sqrt(x).py
Sqrt(x).py
py
2,242
python
en
code
0
github-code
13
13939558511
import sqlite3 from sqlite3 import Error import PySimpleGUI as gui gui.theme('DarkAmber') # color # inside window layout = [ [gui.Text('Tables')], [gui.Text('Search'), gui.InputText()], [gui.Text('Command'), gui.InputText()], [gui.Button('Ok'), gui.Button('Cancel')] ] # Create t...
griimgir/Database
FinalProject/eftBB-Prototypes/Draftprototype2.py
Draftprototype2.py
py
643
python
en
code
0
github-code
13
71473315537
import numpy as np from onnx.reference.op_run import OpRun class CenterCropPad(OpRun): def _run(self, input_data, shape, axes=None): # type: ignore axes = axes or self.axes # type: ignore input_rank = len(input_data.shape) if axes is None: axes = list(range(input_rank)) ...
onnx/onnx
onnx/reference/ops/op_center_crop_pad.py
op_center_crop_pad.py
py
1,525
python
en
code
15,924
github-code
13
25139376309
"""Test of the hypercube function that is used to to assign positions to the channels. """ import math from typing import Dict, Tuple import pytest import torch from topography.core.distance import hypercube expected_grids: Dict[Tuple[int, int], Dict[bool, torch.Tensor]] = { (5, 1): { True: torch.tensor(...
bootphon/topography
tests/test_hypercube.py
test_hypercube.py
py
2,960
python
en
code
4
github-code
13
6538058478
from __future__ import division import numpy as np import matplotlib.pyplot as plt duration = .1 # Duration in seconds signal_frequency = 600 sample_frequency = 1000 # timesteps t = np.arange(0, duration*sample_frequency)/sample_frequency # the signal x = np.sin(2*np.pi*signal_frequency*t) # number of samples n = x....
IzzyBrand/ledvis
testing/hanning_test.py
hanning_test.py
py
907
python
en
code
40
github-code
13
26973434535
import sys def sumMaxRange(array): totalIndex = len(array) sum = max = array[0] for index in range(1, len(array)): if sum < 0: sum = array[index] else: sum += array[index] if sum > max: max = sum return max def main(argv): arrayExercise = [31, -41, 59, 26, -53, 58, 97, -93, -23, 84] sum = sum...
laerciovacca/BitsOfBytes
sources/python/exercise.py
exercise.py
py
400
python
en
code
0
github-code
13
33558395733
import sparknlp from pyspark.ml import PipelineModel spark = sparknlp.start(m1=True) import streamlit as st @st.cache(allow_output_mutation=True) def load_pipeline(name): return PipelineModel.load(name) @st.cache(allow_output_mutation=True) def process_text(model_name, text): pipeline = load_pipeline(m...
hannnnk1231/Covid-19-Fake-News-Detector
demo.py
demo.py
py
734
python
en
code
1
github-code
13
41470194233
import cv2 from cv2 import blur #use of blur to remove noise and augment dataset for noisy images img = cv2.imread('F:\Edge ai\images\\balloons_noisy.png') blurIMG = cv2.blur(img,(5,5)) cv2.imshow("OG img",img) cv2.imshow("Blurred img",blurIMG) cv2.waitKey(0)
kunal118/Edge-ai
Class 3/blur.py
blur.py
py
267
python
en
code
0
github-code
13
4321498591
from financepy.utils.global_types import OptionTypes from financepy.models.sabr import SABR from financepy.models.sabr import vol_function_sabr import numpy as np def test_SABR(): nu = 0.21 f = 0.043 k = 0.050 t = 2.0 alpha = 0.2 beta = 0.5 rho = -0.8 params = np.array([alpha, beta, r...
domokane/FinancePy
tests/test_FinModelSABR.py
test_FinModelSABR.py
py
2,419
python
en
code
1,701
github-code
13
19189801083
#!/usr/bin/python3.7 # -*-coding:Utf-8 -* # version 1.0-alpha import datetime, time import os, shutil, sys, glob from os import path varld4 = 0 varactu = 0 home = os.environ['HOME'] chemindst = 0 dstf = 0 def moove_question(): print("\nQue voulez-vous déplacer ? :\n") print("1 - De(s) fichier(s).") prin...
Porteur98/Script-python-pour-d-placement-de-fichier-et-dossier
script_version_1.0-alpha.py
script_version_1.0-alpha.py
py
45,405
python
fr
code
0
github-code
13
16707436806
""" Written by Lorenzo Vainigli This program provides a correct solution for the following problem: https://www.facebook.com/codingcompetitions/hacker-cup/2019/qualification-round/problems/C """ import re filename = "mr_x" DEBUG = 0 if DEBUG: input_filename = filename + "_example_input.txt" output_filename ...
lorenzovngl/meta-hacker-cup
2019/qualification_round/mr_x/mr_x.py
mr_x.py
py
3,471
python
en
code
1
github-code
13
21524253114
import cherrypy from Networking.statuscodes import StatusCodes from Networking.network import Network class Networking(Network): _config = None def __init__(self, config): self._registerStatusCodes() self._config = config from tophat import TophatMain TophatMain(self._config) def _registerStatusCodes(s...
tcd-tophat/TopHat-Platform
Networking/Protocols/Tpcustom/networking.py
networking.py
py
600
python
en
code
4
github-code
13
13416275499
import face_recognition as face import numpy as np import cv2 video_capture = cv2.VideoCapture("sample.mp4") pop_image = face.load_image_file("pop.jpg") pop_face_encoding = face.face_encodings(pop_image)[0] face_location = [] face_encodings = [] face_names = [] face_percenrt = [] process_this_frame = True known_fac...
Sasina21/FacialRecognition
FacialRecognition.py
FacialRecognition.py
py
2,339
python
en
code
0
github-code
13
1280636508
from sklearn.cluster import KMeans from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler class PostProcess: """ This class performs post-processing on features to cluster them based on the specified method. It supports scaling the features using different scaling methods before clust...
JordanWhite34/Multi-Object-Tracking
baseline/Processing.py
Processing.py
py
2,094
python
en
code
0
github-code
13
22528155731
class AFN: def __init__(self,inicial, final, estadosOrigen, estadoDestino, transicion, estadosPosibles): self.inicial = inicial self.final = final self.estadosOrigen = estadosOrigen self.estadoDestino = estadoDestino self.transicion = transicion self.estadosPosibles = estadosPosibles def establecer_inic...
JoseZapataJ/Compiladores
Practica1/Automatas.py
Automatas.py
py
2,361
python
es
code
0
github-code
13
906387567
import re import string import sys class VerifierReader(object): def __init__(self, text): self.text = text self.position = 0 def HasNext(self): return self.position < len(self.text) def Read(self, target): actual = self.text[self.position : self.position + len(target)] assert actual == ta...
jonathanirvings/icpc-jakarta-2020
robust/verifier.py
verifier.py
py
4,866
python
en
code
11
github-code
13
5979348171
# importing json and urllib library import json from urllib.request import urlopen def main(): try: # Storing URL in url url = "https://raw.githubusercontent.com/prust/wikipedia-movie-data/master/movies.json" # storing the url response response = urlopen(url) # storing JSON r...
Mahesh3655/Assignment2
NumberOfMovies.py
NumberOfMovies.py
py
1,088
python
en
code
0
github-code
13
2895548416
# Variables # As seen so far, we don't put data type for variables, it automatically judges the data type a=10 b=10.0 c="10" d='10' e='''10''' print(a,b,c,d,e) # use type() for getting it's type print(type(a),type(b),type(c),type(d),type(e)) # we can assign values like this also a,b,c=10,20,30 #this could be used f...
AdarshRise/Python-Nil-to-Hill
1. Nil/7. Variable.py
7. Variable.py
py
1,061
python
en
code
0
github-code
13
20346821283
from .porttypebase import DPWSPortTypeBase, WSDLMessageDescription, WSDLOperationBinding, mk_wsdl_two_way_operation from .porttypebase import msg_prefix from sdc11073.dispatch import DispatchKey from sdc11073.namespaces import PrefixesEnum class GetService(DPWSPortTypeBase): port_type_name = PrefixesEnum.SDC.tag(...
Draegerwerk/sdc11073
src/sdc11073/provider/porttypes/getserviceimpl.py
getserviceimpl.py
py
9,319
python
en
code
27
github-code
13
39812352529
import itertools import pandas as pd import numpy as np import pathlib import sqlalchemy import sys def calculate_parameters(data): data['rrt'] = data['RT'] / data['is_RT'] data['ion_ratio'] = data['peak_area'] / data['confirming_ion_area'] data[['rrt', 'ion_ratio']] = data[['rrt', 'ion_ratio']].apply(pd....
pablouw/opiateDashboard
process_data.py
process_data.py
py
3,715
python
en
code
0
github-code
13
42482317404
# # Bentobox # SDK - Simulation # Simulation # from typing import Iterable, List, Optional, Set from bento.client import Client from bento.ecs.grpc import Component, Entity from bento.graph.compile import ConvertFn, compile_graph from bento.protos import sim_pb2 from bento.spec.ecs import ComponentDef, EntityDef, Sys...
bentobox-dev/bento-box
sdk/bento/sim.py
sim.py
py
10,643
python
en
code
0
github-code
13
13429854622
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path("busqueda_en_inventario/", views.busqueda_en_inventario, name='busqueda en inventario'), path("reporte_de_inventario/", views.reporte_de_inventario, name='reporte de inventario'), path("busqueda_...
Baalzul/proyect
distribucion/urls.py
urls.py
py
726
python
es
code
0
github-code
13
72855485457
from __future__ import absolute_import import os import sys from st2common import log as logging from st2common.service_setup import setup as common_setup from st2common.service_setup import teardown as common_teardown from st2common.util.monkey_patch import monkey_patch from st2actions.notifier import config from st2...
kkkanil/mySt2
st2actions/st2actions/cmd/st2notifier.py
st2notifier.py
py
1,255
python
en
code
0
github-code
13
41837438414
import argparse import re from tsm.util import read_file_to_lines, write_lines_to_file parser = argparse.ArgumentParser() parser.add_argument('input_file') parser.add_argument('map_file') parser.add_argument('output_file') parser.add_argument('--col', type=int, help="starting from which column") parser.add_argument('...
Chung-I/ChhoeTaigiDatabase
syl2phone.py
syl2phone.py
py
1,232
python
en
code
null
github-code
13
17342179866
#!/usr/bin/python3 import argparse import binascii from textwrap import wrap from intelhex import IntelHex as IH parser = argparse.ArgumentParser(description='Analyze Zephyr FCB storage and print contents.') parser.add_argument('file', help='binary dump of the storage partition') def fcb_crc8(data): crc8_ccitt_s...
maz3max/ble-coin
prod/analyze_fcb.py
analyze_fcb.py
py
4,038
python
en
code
7
github-code
13
7165630295
import time class HtmlExporter: """Class to export NETSCAPE-Bookmark-file-1 format HTML bookmarks file. NOTE: Data is immediately written through `output_file` handle in order to avoid memory overflows trying to concatenate the text. """ def export_html(self, bookmarks_bar, bookmarks_menu, other...
digital-engineering/bookmarks-consolidator
bookmarks_consolidator/html_exporter.py
html_exporter.py
py
2,565
python
en
code
7
github-code
13
15486488741
# To manage HttpResponses: from django.shortcuts import render, redirect from django.http import HttpResponse, HttpRequest from django.template import Context # To manage templates: from django.template.loader import get_template # For security: from django.views.decorators.csrf import csrf_exempt from django.template....
pablopavon23/TFG
motas/views.py
views.py
py
12,192
python
es
code
0
github-code
13
37022962406
from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.utils import np_utils batch_size = 128 nb_epoch = 10 nb_filters = 32 nb_pool = 4 nb_conv = 3 (X_train, ...
vks4git/Machine-learning
task11/main_t11.py
main_t11.py
py
1,516
python
en
code
0
github-code
13
38399548474
import numpy as np import tensorflow as tf def SPP_layer(input, levels=3, name='SPP_layer', pool_type='max'): shape = input.shape with tf.variable_scope(name): for l in range(levels): l = 2 ** l ksize = [1, np.ceil(shape[1] / l + 1).astype(np.int32), np.ceil(shape[2] / l + 1...
saberholo/Anime_cnn
SPP.py
SPP.py
py
1,153
python
en
code
0
github-code
13
3334881906
import numpy as np import os import random import datetime import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt import torch from torch import nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from torch.utils.data.sampler import BatchSampler, Subset...
nsidn98/Transfer-Learning-for-RL
src/coinrun/main.py
main.py
py
4,176
python
en
code
1
github-code
13
19734014881
from flask import Flask import connexion from swagger_server import encoder from flask_cors import CORS # print a nice greeting. def say_hello(username = "World"): return '<p>Hello %s!</p>\n' % username # some bits of text for the page. header_text = ''' <html>\n<head> <title>EB Flask Test</title...
HebbaleLabs/Python-Assessment-Template
application.py
application.py
py
1,666
python
en
code
0
github-code
13
33018633786
import os import sol4 import time def main(): experiments = ['living_room.mp4'] for experiment in experiments: trans = True exp_no_ext = experiment.split('.')[0] os.system('mkdir dump') path = 'dump/' + exp_no_ext os.mkdir(path) os.system('ffmpeg ...
damebrown/IMPR_ex4
my_panorama.py
my_panorama.py
py
818
python
en
code
0
github-code
13
7455792329
import os import subprocess import numpy as np import itertools import time import pickle def make_idun_train_ann_test_job( dim, index, I, d, K, h, tau, it_max, tol, name): filetext = f"""#!/bin/sh #SBATCH --partition=CPUQ #SBATCH...
TheBjorn98/nummat_p2
make_idun_files.py
make_idun_files.py
py
2,119
python
en
code
0
github-code
13
37719747621
import numpy as np import pandas as pd import os import random import multiprocessing as mp TRAIN_DATA = r'E:\NearXu\train_data\train_' AUTOENCODER_TRAIN_PATH_CSV = r'E:\NearXu\autoencoder2\train_' AUTOENCODER_TRAIN_CSV = r'E:\NearXu\autoencoder2\train.csv' AUTOENCODER_TEST_CSV = r'E:\NearXu\autoencoder2\test.c...
neardws/fog-computing-based-collision-warning-system
train_autoencoder/get_autoencoder_train_data.py
get_autoencoder_train_data.py
py
4,510
python
en
code
10
github-code
13
9844722345
# -*- coding: utf-8 -*- # pylint: disable=too-many-lines import logging import random import time import gevent from gevent.event import AsyncResult from gevent.queue import Empty, Queue from gevent.timeout import Timeout from random import randint from ethereum import slogging from ethereum.utils import sha3 from ...
utzig/raiden
raiden/tasks.py
tasks.py
py
52,323
python
en
code
null
github-code
13
31126659944
from django.db import models from pods.models import User # Data representing the underlying assets that a user wants to insure. # there are differnt bits of information that are needed for each type of item # These are all subsequenty organized into a single Risk model that is attached to the policy for each user via...
daxaxelrod/open_insure
policies/risk/models.py
models.py
py
3,560
python
en
code
33
github-code
13
1391849265
import copy from math import log import os.path class AmplifierConfig: def __init__(self, modification, sn): self.__file_name = '__Config_Write_XXX_' self.mod = modification self.sn = sn self.u_drv = 30 self.i_op = 650 self.i_eol = 661 self.nf = 4.35 ...
Alexander2327/GUI-for-job
AmplifierConfig.py
AmplifierConfig.py
py
8,112
python
en
code
0
github-code
13
10789097760
from .KontroleryModeli.KontrolerKontaPrywatnego import KontrolerKontaPrywatnego from .KontroleryModeli.KontrolerKontaFirmowego import * from .KontroleryModeli.KontrolerSal import * from .KontroleryModeli.KontrolerTerminow import * from .KontroleryModeli.KontrolerRezerwacji import * from .KontroleryModeli.KontrolerModel...
danielswietlik/WypozyczalniaSalKonferencyjnych
source/WarstwaBiznesowa/PosrednikBazyDanych.py
PosrednikBazyDanych.py
py
1,895
python
pl
code
0
github-code
13
17078651514
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.VoucherTemplateBudgetDTO import VoucherTemplateBudgetDTO class AlipayAssetVoucherTemplateInfoQuerybudgetResponse(AlipayResponse): def __init__(self): sup...
alipay/alipay-sdk-python-all
alipay/aop/api/response/AlipayAssetVoucherTemplateInfoQuerybudgetResponse.py
AlipayAssetVoucherTemplateInfoQuerybudgetResponse.py
py
1,177
python
en
code
241
github-code
13
32376721773
from api.models.crud import check_id_exists_in_table, insert_tuple_on_open_stocks_table, retrieve_tuple_from_id, delete_tuple_from_table_by_id, update_tuples from api.database.db_connection import OPEN_STOCKS_TABLE from api.models.open_stocks.valid_ibovespa_symbols import check_if_symbol_is_valid class OpenStock: ...
Gui-Luz/CarteiraAppApi
api/models/open_stocks/open_stocks.py
open_stocks.py
py
7,577
python
en
code
0
github-code
13
17091595794
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.WeatherInfo import WeatherInfo class AnttechBlockchainDefinDataserviceWeatherinfosQueryResponse(AlipayResponse): def __init__(self): super(AnttechBlockch...
alipay/alipay-sdk-python-all
alipay/aop/api/response/AnttechBlockchainDefinDataserviceWeatherinfosQueryResponse.py
AnttechBlockchainDefinDataserviceWeatherinfosQueryResponse.py
py
1,152
python
en
code
241
github-code
13
72425118418
import os import json from flask import Flask, Response, jsonify, request from flask_sqlalchemy import SQLAlchemy from sqlalchemy.orm import sessionmaker from flask_cors import CORS from flask_socketio import SocketIO, send from IAModel import IAModel from PredictedClass import ClassList from core.definitions import CH...
lemmau/real-time-detector
flask-back/app.py
app.py
py
8,180
python
en
code
0
github-code
13
73534348178
import logging import json from flask import request, make_response, jsonify from flask.views import MethodView from flask_login import current_user from burgeon import db from burgeon.models import Goal, Task log = logging.getLogger('burgeon.api.task.delete_task_api') class DeleteTaskAPI(MethodView): """ D...
danielvinson/Burgeon
burgeon-server/burgeon/api/tasks/delete_task_api.py
delete_task_api.py
py
1,340
python
en
code
1
github-code
13
40332714193
import os import re import csv import sys from docutils import nodes from sphinx.builders import Builder detect_all = re.compile(r''' ::(?=[^=])| # two :: (but NOT ::=) :[a-zA-Z][a-zA-Z0-9]+| # :foo `| # ` (seldom used by itself) (?<!\.)\.\.[ \t]*\w+: # .. foo: (but NOT...
kbengine/kbengine
kbe/src/lib/python/Doc/tools/extensions/suspicious.py
suspicious.py
py
7,967
python
en
code
5,336
github-code
13
21419996698
from darkflow.net.build import TFNet import cv2 import numpy as np options = {"model": "cfg/yolo.cfg", "load": "bin/yolo.weights", "threshold": 0.1} tfnet = TFNet(options) # 動画の読み込み cap = cv2.VideoCapture("/content/darkflow/sample_movie/デモ.mp4") # アウトプットの準備 output_file = "/content/darkflow/sample_movie/デモ_output....
kanno0725/201106_kanno
test4.py
test4.py
py
1,385
python
en
code
0
github-code
13
12732695580
from django.conf import settings from django.utils.html import format_html_join from wagtail.core import hooks @hooks.register("insert_editor_js") def editor_js(): js_files = ["js/override_preview.js"] return format_html_join( "\n", '<script src="{0}{1}"></script>', ((settings.STATIC_U...
michael-caktus/headless_wagtail_test
lp_test/wagtail_hooks.py
wagtail_hooks.py
py
367
python
en
code
0
github-code
13
2993932369
# -*- coding: utf-8 -*- import os from tencentcloud.common import credential from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException # 导入对应产品模块的client models。 from tencentcloud.soe.v20180724 import soe_client, models from tencentcloud.common.profile.client_profile import Client...
Leavemaple/voice-recognition-evaluation
examples/soe/v20180903/init_oral_process.py
init_oral_process.py
py
1,760
python
en
code
1
github-code
13
39132842472
# 2292 벌집 - 구글링 # 랜덤으로 숫자 N이 주어질 때 1이 있는 벌집 위치에서 N방 까지 거쳐가는 "단계"의 수를 찾기 # 즉, 숫자 N이 벌집에서 몇 겹째에 있는지 # 벌집의 개수가 6의 배수로 증가하면서 규칙적으로 한 겹씩 쌓인다. # while문을 통해 6의 배수로 숫자 증가시키기 - N에 도달할 때 까지만 n = int(input()) honeycomb = 1 #벌집은 1부터 시작 -> 6의 배수로 증가할 예쩡 ( 1 , 6, 12, 18 ...) count = 1 #벌집의 겹수를 나타내기 위한 변수 while n > honeycomb : #...
wndnjs2037/Algorithm
백준/Bronze/2292. 벌집/벌집.py
벌집.py
py
757
python
ko
code
0
github-code
13
71876364497
#!/usr/bin/env python3 # A program that prompts a user for two operators and operation (plus or minus) # the program then shows the result. # The user may enter q to exit the program. calc1 = 0.0 calc2 = 0.0 operation = "" # Missing colon at end of 'while' line while (calc1 != "q"): print("\nWhat is the first ope...
Binkledurg/mycode
broken01/ifixed.py
ifixed.py
py
1,225
python
en
code
0
github-code
13
22334642425
#Leetcode 1417. Reformat The String class Solution: def reformat(self, s: str) -> str: result = "" digits = [] alpha = [] for i in s: if i.isdigit(): digits.append(i) else: alpha.append(i) if abs(len(alpha)-len(digits))...
komalupatil/Leetcode_Solutions
Easy/Reformat The String.py
Reformat The String.py
py
594
python
en
code
1
github-code
13
71473329617
import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Hardmax(OpRunUnaryNum): def _run(self, x, axis=None): # type: ignore axis = axis or self.axis # type: ignore x_argmax = np.argmax(x, axis=axis) # type: ignore y = np.zeros_like(x) np.put_along_axis( ...
onnx/onnx
onnx/reference/ops/op_hardmax.py
op_hardmax.py
py
426
python
en
code
15,924
github-code
13
16863736563
from __future__ import division from __future__ import print_function from builtins import range from past.utils import old_div import sys import argparse from mapperlite import MapperLite import struct import hashlib import pysam import chicago_edge_scores as ces #import BamTags from bamtags import BamTags from chicag...
DovetailGenomics/HiRise_July2015_GR
scripts/chicago_support_bootstrap.py
chicago_support_bootstrap.py
py
30,342
python
en
code
28
github-code
13
71808371858
from vb2py.vbfunctions import * from vb2py.vbdebug import * from vb2py.vbconstants import * import ExcelAPI.XLW_Workbook as P01 import proggen.M02_Public as M02 #import proggen.M02_global_variables as M02GV #import proggen.M03_Dialog as M03 #import proggen.M06_Write_Header as M06 #import proggen.M06_Write_Header_LED2...
haroldlinke/pyMobaLedLib
python/proggen/M31_Sound.py
M31_Sound.py
py
4,975
python
en
code
3
github-code
13
72144182737
n = int(input('Digite um n > 0: ')) soma_p = 0 if n > 0: for i in range(1, n+1): i = i ** 2 soma_p += i print(soma_p) else: print('input inválido!')
LogLucasRocha/UFABC
BCC/Estrutura de Repetição for/Exercicios Teoricos/SomaP.py
SomaP.py
py
178
python
pt
code
0
github-code
13
72941944018
def FindAngle (hour, minute): degreePerMin = 360/60 degreeOfMin = degreePerMin * minute #degree/x * x/hour = degree/hour degreePerHour = 360/12 degreeOfHour = degreePerHour * (hour + minute/60) # 30 * (3+0/60) = 90 # 0-90=90, 360-90-0=270 return min(abs(de...
isabellakqq/Alogorithm
math/Angle.py
Angle.py
py
404
python
en
code
2
github-code
13
24129383424
# Instructions : # Create a class to handle paginated content in a website. A pagination is used to divide long lists of content in a series of pages. # The Pagination class will accept 2 parameters: # items (default: []): A list of contents to paginate. # pageSize (default: 10): The amount of items to show in each p...
ydb5755/DI_Bootcamp
Week-8/Day-4/DailyChallenge/Pagination.py
Pagination.py
py
3,672
python
en
code
0
github-code
13
21616011612
import json from bson.dbref import DBRef from bson import json_util import sys import pymongo import logging from fuzzywuzzy import process #Create and configure logger logging.basicConfig(filename="server.log", format='%(asctime)s %(message)s', filemode='a') ...
SecEveryday/FlaskApp
dbaccesslibUserInfo.py
dbaccesslibUserInfo.py
py
3,622
python
en
code
1
github-code
13
21690314697
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('aggregateur', '0018_settings_main_settings'), ] operations = [ migrations.CreateModel( name='WelcomeText', ...
Brachamul/elan-democrate
aggregateur/migrations/0019_auto_20151022_1926.py
0019_auto_20151022_1926.py
py
762
python
en
code
2
github-code
13
28447880020
import csv import os import pickle import time from collections import defaultdict import random import pandas as pd from scipy import sparse import numpy as np import logging from spacy.cli.init_model import read_vectors from src.utlis import filter_pair_by_class, batch_item_similarity_matrix logging.basicConfig(l...
haonan3/CGIR
src/dataloader.py
dataloader.py
py
8,734
python
en
code
5
github-code
13
32719505873
import pandas as pd import os df = pd.read_csv("SF Visulisation/Police_Department_Incidents_-_Previous_Year__2016_.csv") df = df.groupby(['Category', 'DayOfWeek']).count() df.reset_index(inplace = True) df = df[['Category', 'DayOfWeek', 'IncidntNum']] df.rename(columns = {"IncidntNum": "Count"}, inplace = True) ...
alanshiau717/FIT3179
data_wranging/crime_by_day.py
crime_by_day.py
py
368
python
en
code
0
github-code
13
42652906446
import os,json import pickle from torch.utils.data import Dataset from torchvision import transforms import torch import torch.nn as nn from PIL import Image import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader import torchvision.models as models from collections impor...
jia1995/char-CNN-RNN_pytorch
dataset.py
dataset.py
py
3,734
python
en
code
0
github-code
13
31501333995
from control_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal from trajectory_msgs.msg import JointTrajectoryPoint import geometry_msgs.msg import sensor_msgs.msg import numpy as np import threading import rospy class TopicLogger: def __init__(self,topic_name,message_type,log_length,subscribe_buffer_l...
baxelrod/pr2_calibrated_ft
scripts/TopicLogger.py
TopicLogger.py
py
4,794
python
en
code
1
github-code
13
26570386455
"""Chat receiver.""" import traceback from websockets.exceptions import ConnectionClosedError from chat import chat_events from events import DummyEvent from init import EVENT_QUEUE from log import LOG class ChatReceiver(object): """Chatreceiver.""" def __init__(self, connection) -> None: """Init....
amorphousWaste/twitch_bot_public
twitch_bot/chat/chat_receiver.py
chat_receiver.py
py
3,657
python
en
code
0
github-code
13
74150534416
import os import shutil import pickle import copy import torch import pytorch_lightning as pl import neurogym as ngym from pytorch_lightning.callbacks import ModelCheckpoint from neurogym.wrappers import PassAction, PassReward, Noise from ttrnn.trainer import Supervised, A2C, MetaA2C from ttrnn.dataset import Neurogym...
felixp8/ttrnn
scripts/rl_example.py
rl_example.py
py
4,583
python
en
code
0
github-code
13
17047673474
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AntMerchantExpandIotdeviceChangeModifyModel(object): def __init__(self): self._device_sn = None self._gmt_created = None self._order_id = None self._policy_type = ...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/AntMerchantExpandIotdeviceChangeModifyModel.py
AntMerchantExpandIotdeviceChangeModifyModel.py
py
10,161
python
en
code
241
github-code
13
28157494330
#External libs import ast import boto3 import json import sys import os from botocore.exceptions import ClientError #Establish our boto resources client = boto3.client('lambda') session = boto3.session.Session() region = session.region_name ec2Client = boto3.client('ec2') def import_config(lambda_name, alias=False): ...
tunein/Maestro
maestro/providers/aws/import_lambda.py
import_lambda.py
py
7,825
python
en
code
10
github-code
13
25982341602
import sys from PyQt6.QtWidgets import * from PyQt6.QtGui import QPixmap, QImage, QClipboard import qrcode import pay_by_square from PIL import ImageQt from PyQt6 import uic, QtWidgets from dialog import Dialog from parser import getAccount from parser import configChecker class UI(QMainWindow): #Opens dialog wind...
radoslavpalenik/SEPA-QR-generator
main.py
main.py
py
2,631
python
en
code
0
github-code
13
2641273373
email = input("Enter your Email ID: ") domain = '@gmail.com' ledo = len(domain) lema = len(email) sub = email[lema-ledo:] if sub == domain: if ledo != lema: print("It is a valid Email ID: ") else: print("This is a invalid Email ID: ") else: print("This email ID is either not valid or belongs to some other domain...
avrajit-das/Python-Programming
Email_Checker.py
Email_Checker.py
py
326
python
en
code
0
github-code
13
39151922455
import cv2 import numpy as np from glob import glob import matplotlib.pyplot as plt from tqdm import tqdm from multiprocessing import Pool from itertools import product import pandas as pd from well_matrix import Well import datetime from datetime import datetime import os from sklearn.cluster import KMeans from collec...
sidguptacode/ML_AT_Interpretation
agglutination-detection/well_matrix_creation/compute_well_matrix.py
compute_well_matrix.py
py
4,172
python
en
code
0
github-code
13
18304161525
import pexpect import sys import ipaddress def process_wordlist(filepath, shell): fd = open(filepath, 'r') for line in fd: print("trying password:", line) shell.sendline(line) response = shell.expect(['#\$', '(yes/no)?', '[Tt]erminal type', '[Pp]ermission denied'], timeout=5) if...
bhrtdas/Scripts
login-scripts-master/login-scripts-master/ssh_login.py
ssh_login.py
py
1,613
python
en
code
0
github-code
13
26137422688
import os import sys import struct import ctypes import ctypes.util import functools LIBNAME = 'libramses.so' _physaddr_t = ctypes.c_ulonglong BADADDR = _physaddr_t(-1).value class RamsesError(Exception): """Exception class used to encapsulate RAMSES errors""" @functools.total_ordering class DRAMAddr(ctypes...
vusec/ramses
pyramses/__init__.py
__init__.py
py
8,561
python
en
code
9
github-code
13
29402813688
import datetime import csv import logging from .models import Project def do_upload_projects_from_csv(request): """Upload project data from csv into the database. The given file should be in legal csv format and include the field names in its first row """ # get the given csv file name parametr from...
maozmussel/Demo
myworkspace/upload_data_from_csv.py
upload_data_from_csv.py
py
1,509
python
en
code
0
github-code
13
8107288810
from django.urls import path, include from . import views urlpatterns = [ path('', views.home, name='home'), path('register', views.register, name='register'), path('login', views.user_login, name='login'), path('logout', views.user_logout, name='logout'), path('hello', views.hello, name='hello'), ...
Cyrusluke925/languagefinder
languagefinder/urls.py
urls.py
py
517
python
en
code
0
github-code
13
17088445804
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.MsgSendErrorData import MsgSendErrorData class AlipayOpenPublicMessagePreviewSendResponse(AlipayResponse): def __init__(self): super(AlipayOpenPublicMess...
alipay/alipay-sdk-python-all
alipay/aop/api/response/AlipayOpenPublicMessagePreviewSendResponse.py
AlipayOpenPublicMessagePreviewSendResponse.py
py
1,102
python
en
code
241
github-code
13
15597690753
import os import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import glob def format_loss_columns(df, col=""): gabor_model_loss_suffix = len('tensor-') df[f'{col}'] = df[f'{col}'].str[gabor_model_loss_suffix:] df[f'{col}'] = df[f'{col}'].str.split(',')....
dineenai/fit_receptive_field
plot_rf_size.py
plot_rf_size.py
py
6,382
python
en
code
0
github-code
13
25518348784
import sys import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.compose import ColumnTransformer from sklearn.pipeline import Pipeline from sklearn.ensemble import RandomForestRegressor from sklearn.preprocessing import OneHotEncoder from sklearn.metrics import r2_sco...
ysfesr/Laptop-Price-Prediction
Project/train.py
train.py
py
4,822
python
en
code
3
github-code
13
30567836553
import random import Characters import PlayerStrings import BossStrings import DropStrings import CharactersGenerator import InteractionParameters import FightCycle import FightStrings class BossList(): list_easy = [BossStrings.Palich.name, BossStrings.Chaikovskii.name, BossStrings.Viv.name, BossStr...
AssBurger69/BurgerGame
FightFunctions.py
FightFunctions.py
py
7,667
python
en
code
0
github-code
13
9255633778
from tkinter import * from admin import Admin from admin_gui import admin_gui from manager import Manager from managergui import Manager_Gui from user import User from usergui import User_Gui class System_Gui(Tk): def __init__(self, estate_system): super().__init__() self.estate_system = estate_sy...
cwilson98/projects
Estate Management System/systemgui.py
systemgui.py
py
1,970
python
en
code
0
github-code
13
16502343137
""" 1. 엑셀 데이터 읽고 쓰기 2. 엑셀 데이터 편집하기 3. 엑셀 데이터 출력하기 4. XML 기상청 날씨 데이터 지역별 파싱 및 출력 5. 본인 거주 지역 날씨 정보 XML 파싱 및 출력 """ import xml.etree.ElementTree as ET from urllib.request import urlopen from bs4 import BeautifulSoup import numpy as np import pandas as pd # 기상청 URL URL = 'http://www.weather.go.kr/weather/li...
So-chankyun/Crawling_Study
week3/extract_weather.py
extract_weather.py
py
4,088
python
ko
code
0
github-code
13
35128720979
class Solution: def increasingTriplet(self, nums: List[int]) -> bool: # https://leetcode.com/problems/increasing-triplet-subsequence/discuss/79004/Concise-Java-solution-with-comments. # linear scan # time O(n) # space O(1) n = len(nums) if n < 3: ret...
aakanksha-j/LeetCode
334. Increasing Triplet Subsequence/linear_scan_constant_space_1.py
linear_scan_constant_space_1.py
py
565
python
en
code
0
github-code
13
5551584371
array = list(map (int, input("Введите массив:").split())) delta = input("Введите delta:") try: delta = int(delta) except ValueError: print("Ошибка") exit() c = abs(delta) a = min(array) b = len([x for x in array if x == a + c]) print(b)
maaar18/task6
1.py
1.py
py
271
python
ru
code
0
github-code
13
3139265197
import os from django_template.setting_basic import BASE_DIR DEBUG = False # -- add -- import logging import django.utils.log import logging.handlers # -- modify -- LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'standard': { 'format': '%(asctime)s %(level...
mo891916/django_template
django_template/setting_prod.py
setting_prod.py
py
2,808
python
ar
code
1
github-code
13
38796447020
import pandas as pd import numpy as np np.random.seed(2) from sklearn.model_selection import train_test_split from keras.utils.np_utils import to_categorical from keras.preprocessing.image import ImageDataGenerator def normalize_data(X_train, test): # Transforming the data, that is of range [0..255], # to [...
lievi/cnn_tutorial
src/data/process_mnist.py
process_mnist.py
py
1,475
python
en
code
0
github-code
13
73704427857
from django.urls import path, include from rest_framework.routers import DefaultRouter from record import views app_name = 'record' class CustomDefaultRouter(DefaultRouter): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.trailing_slash = '/?' router = CustomDefaultRo...
emilylu123/MindSpace_Angular_Django
MindSpaceApi/app/record/urls.py
urls.py
py
532
python
en
code
1
github-code
13
8630176581
from Training.util.binary import dc,assd import os import numpy as np from Training.data_process.data_process_func import load_nifty_volume_as_array def one_hot(img, nb_classes): hot_img = np.zeros([nb_classes]+list(img.shape)) for i in range(nb_classes): hot_img[i][np.where(img == i)] = 1 return h...
HiLab-git/SepNet
util/visualization/evalution.py
evalution.py
py
2,262
python
en
code
18
github-code
13
11642118382
import json import pytest from unittest.mock import patch, mock_open, MagicMock from checkout_and_payment import checkoutAndPayment, update_users_json, products @pytest.fixture def mock_open_users_file(): """Fixture to mock opening of the users file with predefined user data.""" users = [{"username": "user1", ...
guritaalexandru/SoftwareTestingA1
A1_unit_testing_students/test_checkout_and_payment.py
test_checkout_and_payment.py
py
5,064
python
en
code
0
github-code
13
43351515673
import sys import heapq right_left = [(0, 1), (0, -1)] up_down = [(-1, 0), (1, 0)] n, m = map(int, sys.stdin.readline().split()) matrix = list() for _ in range(n): matrix.append(list(map(int, sys.stdin.readline().split()))) d = int(sys.stdin.readline()) item_list = list() for _ in range(d): a, b = map(in...
W00SUNGLEE/codingmasters
4263/4263.py
4263.py
py
1,784
python
en
code
0
github-code
13
72943534418
# Write a program that reads a single string with # numbers separated by comma and space ", ". Print the indices of all even numbers. string = input().split(", ") # с лист компрехеншан int_as_str_1 = [int(i) for i in string] # с мап int_as_str = list(map(int, string)) # с лист компрехеншан filter1 = [index for inde...
Andon-ov/Python-Fundamentals
13_lists_advanced_lab/05_even_numbers.py
05_even_numbers.py
py
592
python
en
code
0
github-code
13