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
38829265127
"""add location deets Revision ID: 4cefc8b79e71 Revises: 7b55bb4d5cd5 Create Date: 2023-05-16 12:50:25.397006 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4cefc8b79e71' down_revision = '7b55bb4d5cd5' branch_labels = None depends_on = None def upgrade(): ...
jordandc20/Vicariously_DJordan-capstone
server/migrations/versions/4cefc8b79e71_add_location_deets.py
4cefc8b79e71_add_location_deets.py
py
925
python
en
code
0
github-code
13
679773796
import urllib2 import json from dateutil.rrule import * from dateutil.parser import * # Variables daySt = "20140601" # state date dayEnd = "20140602" # end date outPath = '/Users/dtodd/Documents/Work/Weather/' # output path station = 'KDEW' # weather station ID api = 'b316a72d2e91b2e7' # developer API key # Create li...
dmofot/weather
url2json_urllib.py
url2json_urllib.py
py
782
python
en
code
5
github-code
13
38231434146
# coding=utf-8 from abc import ABCMeta, abstractmethod from urllib.parse import urlparse import html try: import chardet as chardet # as前的模块名可选:cchardet或chardet except: has_chardet = False else: has_chardet = True from red import red class AbPageParser(metaclass=ABCMeta): '''页面解析 抽象类''' # 注册的解析...
animalize/tz2txt
tz2txt/AbPageParser.py
AbPageParser.py
py
6,631
python
en
code
48
github-code
13
34385137544
import streamlit as st import numpy as np import pandas as pd # streamlit run main.py st.title('Streamlit 超入門') st.write('DataFrame') df = pd.DataFrame( np.random.rand(20,3), columns = ['a','b','c'] ) #折れ線 st.line_chart(df) #折れ線 色で埋める st.area_chart(df) #棒グラフ st.bar_chart(df)
mymt616/youtube-streamlit
main2.py
main2.py
py
324
python
ja
code
0
github-code
13
6798458742
import json import requests from pepeCSV import readCSV from xcp_get import asset_info # Checks if image exists at html source def is_url_image(asset): image_formats = ("image/jpg", "image/png", "image/gif", "image/jpeg") print("https://digirare.com/storage/rare-pepe/" + asset) r = requests.head("https://d...
burstMembrane/Counterview
json_updater/OG_PEPES/og_json_creator.py
og_json_creator.py
py
2,417
python
en
code
0
github-code
13
3185024780
import numpy as np import torch from reprod_log import ReprodLogger from transformers.models.luke import LukeForEntityClassification as Model # from transformers.models.luke import LukeModel as Model np.random.seed(42) if __name__ == "__main__": # def logger reprod_logger = ReprodLogger() model = Model.f...
xzk-seu/Paddle-LUKE
ReProd_Pipeline/squad/pipeline/Step1/pt_forward_luke.py
pt_forward_luke.py
py
995
python
en
code
0
github-code
13
14865749719
import json from flask import Flask, request, jsonify from data import Deployment import os app = Flask(__name__) @app.route('/',methods=['get']) def index(): return json.dumps({'name': 'alice', 'email': 'alice@outlook.com'}) @app.route('/send', methods=['...
Ibrahemhasan15/MyRestAPI
index.py
index.py
py
575
python
en
code
0
github-code
13
73671509776
from mayavi import mlab import numpy as np import vtk output = vtk.vtkFileOutputWindow() output.SetFileName("/dev/null") vtk.vtkOutputWindow().SetInstance(output) def quiver3d(x, n, **kwargs): return mlab.quiver3d( x[:, 0], x[:, 1], x[:, 2], n[:, 0], n[:, 1], n[:, ...
jpanikulam/python_pointclouds
visualize.py
visualize.py
py
1,910
python
en
code
1
github-code
13
11534537302
import pystray from time import sleep from PIL import Image, ImageDraw from threading import Thread import subprocess import json import argparse def red_image(): image = Image.new('RGB', (64, 64), 'red') dc = ImageDraw.Draw(image) dc.rectangle((0, 0, 64, 64), fill='red') return image def green_imag...
Areso/vitess-workflow-monitor
moveworkflowmon.py
moveworkflowmon.py
py
5,429
python
en
code
1
github-code
13
24882884895
# I'm not a personal trainer # It costs me mental energy to plan a workout # So I want to automate it # I have a structure the workouts should follow # Other than that, I dont care # This program is going to build my workouts for me import random compound_list = ["Squats", "Deadlift"] full_list = ["Cleans", "Burpees...
oliverjallman/workout_builder
workout_builder.py
workout_builder.py
py
1,307
python
en
code
0
github-code
13
71083998099
def odd_occurrences(): some_words = input().split(' ') occurrences = {} for word in some_words: word = word.lower() if not word in occurrences.keys(): occurrences[word] = 0 occurrences[word] += 1 for (word, count) in occurrences.items(): if count % 2 == 1: ...
bobsan42/SoftUni-Learning-42
ProgrammingFunadamentals/a24Dictionaries/oddoccurrences.py
oddoccurrences.py
py
368
python
en
code
0
github-code
13
9070303627
items_collection = input().split('|') budget = float(input()) items_info = [] bought_items = [] for i in range(len(items_collection)): items_info.append(items_collection[i].split('->')) for item in range(len(items_info)): if items_info[item][0] == 'Clothes': price = float(items_info[item][1]) i...
vbukovska/SoftUni
Python_fundamentals/Lists_basics/HelloFrance.py
HelloFrance.py
py
1,134
python
en
code
0
github-code
13
23676344485
import art alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] def ceasar(userChoice, plainText, sh...
josesanchez45/Caesar-cipher-python
main.py
main.py
py
1,257
python
en
code
0
github-code
13
33526971243
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait import unittest import system.page import time class Checkout2SauceDemo(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome( "C:/Users/randa/Documents/Chromedriver.exe") self.driver....
Asarmir/SauceDemoTestStandardUser
tests/checkout2_test.py
checkout2_test.py
py
1,620
python
en
code
0
github-code
13
41644121562
import matplotlib.pyplot as plt import spectview.settings as settings class PlotManager: def __init__(self, window_object): self.window_object = window_object self.name_to_line2d = {} self.plot_setup = {} def add_plot(self, name, data_x, data_y): if name in self.name_to_line2d...
ewaAdamska/spectview
spectview/plot_utils.py
plot_utils.py
py
4,959
python
en
code
0
github-code
13
43403763451
from rest_framework.exceptions import AuthenticationFailed from django.utils.translation import ugettext_lazy as _ from munch import models from rest_framework import serializers from django.contrib.auth.models import User from rest_framework.validators import UniqueValidator from csp import settings from munch.validat...
adam-codaio/munch_api
munch/serializers/user.py
user.py
py
1,607
python
en
code
0
github-code
13
5825281301
import numpy as np import rbfnet as rn from utilities import * def gmm(dim, ncentres, covar_type): """ Description MIX = GMM(DIM, NCENTRES, COVARTYPE) takes the dimension of the space DIM, the number of centres in the mixture model and the type of the mixture model, and returns a data structure ...
zhy1024/GGTM-Mixed-type-of-data
mixmodel.py
mixmodel.py
py
7,592
python
en
code
0
github-code
13
24634140510
from django.contrib.contenttypes.models import ContentType from django.db import models import pytest try: import yaml PYYAML_AVAILABLE = True del yaml except ImportError: PYYAML_AVAILABLE = False from django.core import serializers from .models import TypedModelManager from .test_models import Angr...
caseyrollins/django-typed-models
typedmodels/tests.py
tests.py
py
9,363
python
en
code
null
github-code
13
14861219767
def sol(score): result=None if score>=90 and score<=100: result="A" elif score>=80: result="B" elif score>=70: result="C" elif score>=60: result="D" else: result="F" print(result) score=int(input()) sol(score)
halee0/BaekJoon_python
9498.py
9498.py
py
278
python
en
code
0
github-code
13
25672760161
from IPython.display import clear_output import os class HANGMAN(): def __init__(self,word): self.screen = ''' ___________________________________ | ________ | | | | | | HANGMAN | | | | ...
rogerwang0/HANGMAN_Game
hangman.py
hangman.py
py
2,966
python
en
code
0
github-code
13
25303791799
import os from PIL import Image import torch.tensor from torch.utils.data import Dataset from torchvision import transforms import pandas as pd import matplotlib.pyplot as plt import cv2 class MotionData(Dataset): def __init__(self, data_json, reso=256): self.reso = reso self.data = pd.read_json(data_json, lines...
grok0n/vics
guide/neuralnet/dataset.py
dataset.py
py
2,022
python
en
code
0
github-code
13
9731110105
from google.cloud import firestore import pandas as pd import json # 使用前,請先更改 # 金鑰、專案id、讀取json的路徑、寫入csv的路徑 list_ = [] # db = firestore.Client() db = firestore.Client.from_service_account_json("./cloud-master-3-29-cfb7e9371055.json", project='cloud-master-3-29') with open('ccs_line_richmenus.json', ...
Whaleman0423/1111
old_data_trans_rich_menu_upload_save_local.py
old_data_trans_rich_menu_upload_save_local.py
py
1,386
python
en
code
0
github-code
13
33578974135
import uvicorn from database import Base, engine from fastapi import HTTPException, FastAPI from fastapi.middleware.cors import CORSMiddleware from routes import auth as auth_router, bucket as bucket_router, user as user_router Base.metadata.create_all(bind=engine) app = FastAPI( title="Demo FastAPI and Github act...
rexsimiloluwah/fastapi-github-actions-test
src/main.py
main.py
py
1,078
python
en
code
1
github-code
13
47190581364
import warnings import logging import sys import itertools from pathlib import Path import hydra from omegaconf import DictConfig, OmegaConf import yaml import matplotlib.pyplot as plt import numpy as np import torch import pytorch_lightning as pl from pytorch_lightning.loggers import TensorBoardLogger, WandbLogger ...
ejnnr/steerable_pdo_experiments
main.py
main.py
py
9,840
python
en
code
0
github-code
13
73753758737
import pymysql class Checkin: #def __init__(self): # try: # conexion = mysql.connect(host='localhost', user='root', password='', db='Tienda') # except (pymysql.err.OperationalError, pymysql.err.InternalError) as e: # print("Ocurrió un error al conectar: ", e) @s...
Estroberti2/Apremdiendo-Python
curso python/Proyrcto Python/chekin.py
chekin.py
py
1,789
python
es
code
0
github-code
13
27941511643
from flask import Flask, render_template, request, flash, redirect, session, g, abort from models import db, connect_db, User, Sighting from forms import NewUserForm, LoginForm, AddSightingForm, EditUserForm, EditSightingForm from sqlalchemy.exc import IntegrityError from sqlalchemy import desc import os import r...
petitepirate/psosightings
app.py
app.py
py
9,825
python
en
code
0
github-code
13
26010468248
"""This module contains the class for the popup window to add a custom category to the combobox""" from PyQt6.QtWidgets import QDialog from UI.popup import Ui_Form from src.controllers.popup_accounts_controller import PopUpAccountsController class PopUpWindowAcc(QDialog, Ui_Form): """Popup window class""" def...
razvanmarinn/expense-tracker
src/views/popup/p_accounts.py
p_accounts.py
py
565
python
en
code
0
github-code
13
11737129081
from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep import itertools as it import wikipedia import sys def get_words(): terms = [] with open('terms.txt', encoding="utf8") as f: for line in f: terms.append(line) print("$$ Loaded all t...
SmithJesko/ocr-define-quizlet
main.py
main.py
py
4,948
python
en
code
1
github-code
13
36832532016
#!/usr/bin/python2.7 # -*- coding: utf-8 import httplib import urllib import urllib2 import Parser from BeautifulSoup import BeautifulSoup import pdb """ <option value="010000">AMAZONAS</option> <option value="020000">ANCASH</option> <option value="030000">APURIMAC</option> <option value="040000">AREQUIPA</option>...
PuercoPop/EleccionesPeru
get_mesas.py
get_mesas.py
py
6,639
python
es
code
4
github-code
13
26790022261
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]: l1_l = [] l2_l = [] while l1...
forestphilosophy/LeetCode_solutions
Interview Questions/add_two_numbers.py
add_two_numbers.py
py
885
python
en
code
0
github-code
13
36988347576
import os from pydevlake import logger def init(): debugger = os.getenv("USE_PYTHON_DEBUGGER", default="").lower() if debugger == "": return # The hostname of the machine from which you're debugging (e.g. your IDE's host). host = os.getenv("PYTHON_DEBUG_HOST", default="localhost") # The p...
apache/incubator-devlake
backend/python/pydevlake/pydevlake/helpers/debugger.py
debugger.py
py
1,170
python
en
code
2,256
github-code
13
8816168376
import cv2 img = cv2.imread("./img/4.d6206092.jpg") gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) detector = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml") faceRect = detector.detectMultiScale( gray, scaleFactor=1.08, minNeighbors=15, minSize=(32, 32) ) for x, y, w,...
ChungyiBossi/computer_vision_playground
basic_sample/detect_face.py
detect_face.py
py
457
python
en
code
1
github-code
13
24723155294
from django.conf.urls import url from . import views from rest_framework.urlpatterns import format_suffix_patterns from django.contrib.auth import views as auth_views from bakery import views from .models import Recipes urlpatterns = [ url(r'^$', views.index, name="index"), url(r'^recipe_list$', views.cakes, ...
SterreVB/TheLittleBakery
bakery/urls.py
urls.py
py
1,911
python
en
code
0
github-code
13
74266572179
import random import sys import threading from collections import deque from datetime import datetime from threading import Thread from time import sleep from mpi4py import MPI # Here using MPI to basically communicate among the various sites # The code can be run by mpiexec -n <no.ofsites to execute> python SuzukuKa...
ThulasiRamNTR/SuzukiKasami
SuzukiKasami/SuzukiKasami.py
SuzukiKasami.py
py
5,868
python
en
code
0
github-code
13
42395521763
''' É aniversário da Creuza e ela não sabe quantas velas colocar em cima do bolo. Problema: Ela sabe o ano em que nasceu, mas não sabe qual a idade dela. ''' from datetime import date def age_of_creuza(): birth_year = int(input("Creuza, em que ano você nasceu ? ")) current_year = date.today().year old = ...
brualvess/python_exercises
helping_creuza/situation01.py
situation01.py
py
464
python
pt
code
0
github-code
13
73967349136
def isNaN(num): #Non-numpy nan check... #https://stackoverflow.com/questions/944700/how-can-i-check-for-nan-values return num != num def str2bool(v): #https://intellipaat.com/community/2592/converting-from-a-string-to-boolean-in-python if str(v).upper() in ("yes", "true", "t", "1", "y"): return (...
rseeton/data_dictionary_generator
utility_functions.py
utility_functions.py
py
980
python
en
code
0
github-code
13
73902857298
''' Function support clone data Edit by: AnhKhoa Date: April 07,2023 ''' from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D import csv import numpy as np import os import datetime from sk...
trandoanhkhoa/Classification_Food
step2_trainWindows.py
step2_trainWindows.py
py
4,005
python
en
code
0
github-code
13
42798416615
import idaapi, idautils, ida_funcs, idc def dump_funcs(res_path): funcs = [] for entry in Functions(): funcs.append(int(entry)) with open(res_path, 'w') as f: for entry in funcs: f.write('%x\n' % entry) if __name__ == '__main__': idaapi.auto_wait() res_path = idc.ARGV[1] dump_funcs(res_pa...
B2R2-org/FunProbe
tools/ida/scripts/idascript.py
idascript.py
py
344
python
en
code
3
github-code
13
40467902835
from collections import Counter import sys input = sys.stdin.readline N, M, B = map(int, input().split()) heights = [] for _ in range(N) : heights += list(map(int, input().split())) counter = Counter(heights).items() answer = 0 time = 999999999 for i in range(min((B + sum(heights)) // (N * M), max(hei...
dakaeng/Baekjoon
백준/Silver/18111. 마인크래프트/마인크래프트.py
마인크래프트.py
py
785
python
ko
code
0
github-code
13
16131962503
""" Purpose: OpenTelemetry provides a vendor-agnostic standard for observability, allowing users to decouple instrumentation and routing from storage and query. pip install opentelemetry-api opentelemetry-sdk """ from random import randint from flask import Flask, request from opentelemetry import tr...
udhayprakash/PythonMaterial
python3/16_Web_Services/f_web_application/d_using_flask/i_telemetry_monitoring/b_OpenTelemetry/d_OpenTelemetry.py
d_OpenTelemetry.py
py
2,095
python
en
code
7
github-code
13
71446916499
# -*- coding: utf-8 -*- """ Created on Mon May 8 18:36:58 2023 @author: talbanesi """ # Importacion de librerias import numpy as np import scipy.signal as sig import matplotlib.pyplot as plt # from splane import analyze_sys # version vieja from pytc2.sistemas_lineales import analyze_sys from sympy import Symbol ###...
tomasalbanesi/TC2_2023
Guia_Ejercicios/TP2_AproximacionFuncionesTransferencia/Ejercicio_3/scripts/GE2023_TP2_EJ3_SimulacionNumerica.py
GE2023_TP2_EJ3_SimulacionNumerica.py
py
1,738
python
es
code
0
github-code
13
25933076945
from socket import * from select import * from time import sleep s = socket() s.setsockopt(SOL_SOCKET,SO_REUSEADDR,1) s.bind(('0.0.0.0',8888)) s.listen(5) p = epoll() fdmap = {s.fileno():s} p.register(s, EPOLLIN | EPOLLERR) while True: print('listen port ....') events = p.poll() for fd,event in events...
Ahead180-103/ubuntu
python/shell.py/pynet/select_poll_epoll/tcp_IO_epoll.py
tcp_IO_epoll.py
py
821
python
en
code
0
github-code
13
4664704821
from dj_ast import ASTNode, TDUnit from dj_ops import PerEntryFilter from common import InitializationFailed, escape class IsPartOf(PerEntryFilter): """ Tests if a given entry is part of the specified sequence. For example "cde" is part of the sequence "abcdefghijklmnopqrstuvwxyz". """ def op_na...
Delors/DJ
operations/is_part_of.py
is_part_of.py
py
4,179
python
en
code
2
github-code
13
72838131538
#!/usr/bin/env python3 # Valutaomräkningsprogram, version 1 import pickle ladda = input("Vill du ladda tidigare kurs? (j/n): ") if (ladda == "j"): kurs = pickle.load(open('kurs.p', 'rb')) elif (ladda == "n"): kurs = float(input("Ange ny USD-kurs: ")) pickle.dump(kurs,open('kurs.p', 'wb')) else: print (...
jackbenny/grunderna-i-programmering-andra-utgavan
kapitel8/sidan_145_ex1.py
sidan_145_ex1.py
py
469
python
sv
code
1
github-code
13
4213640348
import os from flask import (render_template, current_app, url_for, flash, redirect, request, abort, Blueprint) from flask_login import current_user, login_required from blog import db from blog.models import Upload from blog.uploads.forms import UploadForm uploads = Blueprint('uploads', __name__) ...
bull-mawat-lang/lang-blog
blog/uploads/routes.py
routes.py
py
3,025
python
en
code
0
github-code
13
16368515637
import time from django.shortcuts import render,redirect from django.http import HttpResponse,JsonResponse from .forms import * from django.views import View from .models import * # Create your views here. from keras.models import load_model from keras.models import Sequential from keras.layers import Convolution2D ...
Augustinetharakan12/hack-for-tomorrow-main
django-web-app/web_app/main/views.py
views.py
py
3,981
python
en
code
0
github-code
13
34090830130
#!/usr/bin/python3 """This script uses the `json` module to write the tasks data""" import csv import json import requests import sys if __name__ == '__main__': import json import requests import sys from sys import argv emp_id = argv[1] file_name = emp_id + '.json' total_todos = 0 d...
udobeke/alx-system_engineering-devops
0x15-api/2-export_to_JSON.py
2-export_to_JSON.py
py
995
python
en
code
0
github-code
13
32071977058
from pytest import fixture from longest_substring_without_repeating_characters import ( Solution, ) @fixture def s() -> Solution: return Solution() def test_example_one(s: Solution): assert ( s.lengthOfLongestSubstring("abcabcbb") == 3 ), """ Input: s = "abcabcbb" Output: 3 Expl...
peterjamesmatthews/leetcode
Longest Substring Without Repeating Characters/test_longest_substring_without_repeating_characters.py
test_longest_substring_without_repeating_characters.py
py
1,634
python
en
code
0
github-code
13
33253610559
from langchain.chat_models import ChatOpenAI from langchain.prompts import MessagesPlaceholder from langchain.schema import SystemMessage from langchain.agents.openai_functions_agent.base import OpenAIFunctionsAgent from langchain.memory import ConversationTokenBufferMemory from langchain.agents.agent import AgentExecu...
abdelrahmangasser555/agents
agents.py
agents.py
py
2,658
python
en
code
0
github-code
13
21487257460
import string num_lanes = 3 detector_head = '<additional>\n' detector_template = string.Template('\t<laneAreaDetector id="$id" lane="$lane" \ pos="$pos" endPos="$end_pos" file="cross.out" freq="30"/>\n') def create_left_lane_detector(edge_id): ''' Creates lane detectors on left turn lane of every edge. ...
d-hasan/sumo-grid
network/generate_detectors.py
generate_detectors.py
py
974
python
en
code
2
github-code
13
72762937937
# pylint: disable=C0111,R0201,C0325 """ classes for npmanager """ import shlex import sys import select import os from functools import wraps from subprocess import call, Popen, PIPE, STDOUT from _npmanager.utils import commandutils as cmdutils from _npmanager.utils import screen class Package(object): COMMAND = ...
ssut/npmanager
_npmanager/classes.py
classes.py
py
2,822
python
en
code
15
github-code
13
22996662188
from pathlib import Path from ase.io import write from ase.optimize import LBFGS # USER from grrmpy.io import log2atoms from grrmpy.optimize.attach import automate_maxstep from grrmpy import pfp_calculator try: from grrmpy.optimize import FIRELBFGS except: pass class AutoOpt(): """最適化後の構造は'Structure'フォルダ内...
kt19906/GRRMPY_code
grrmpy/automate/auto_opt.py
auto_opt.py
py
6,754
python
ja
code
0
github-code
13
8595892444
import numpy as np import matplotlib.pyplot as plt # Citation starts # Source: https://www.freesion.com/article/5297307805/ class EpsilonGreedy: def __init__(self): self.epsilon = 0.1 self.num_arm = 10 self.arms = np.random.uniform(0, 1, self.num_arm) self.best = np.argmax(self.arm...
ShuyanWang1996/CSYE7370
EGreedy.py
EGreedy.py
py
1,728
python
en
code
0
github-code
13
9063191173
# n, m을 입력받음 n, m = map(int, input().split()) # 보드를 입력받음 data = [] for _ in range(n): data.append(list(input())) # 최솟값을 계산하기 위해 10억으로 설정 min_value = int(1e9) # 8 * 8 격자를 움직여가며 for i in range(n - 8 + 1): for j in range(m - 8 + 1): result = 0 c = data[i][j] # 맨 왼쪽위의 색 # 8 * 8 격...
yudh1232/Baekjoon-Online-Judge-Algorithm
1018 체스판 다시 칠하기.py
1018 체스판 다시 칠하기.py
py
1,042
python
ko
code
0
github-code
13
25213574468
import lightgbm as lgb import re import pytest import pitci.lightgbm as pitci_lgb class TestCheckObjectiveSupported: """Tests for the check_objective_supported function.""" @pytest.mark.parametrize( "objective, supported_objectives, message", [ ("regression", ["huber", "fair"], "...
richardangell/pitci
tests/lightgbm/test_lightgbm.py
test_lightgbm.py
py
1,248
python
en
code
7
github-code
13
22148359926
import os from rest_framework import serializers from django.contrib.auth import get_user_model from authapp.serializers import UserDataSerializer from .models import Group, CommentGroup, CommentGroupFile, CommentGroupReply, CommentStep, CommentStepReply User = get_user_model() # create group class GroupSerialize...
PlayingSpree/intern_project_backend
grouplearning/serializers.py
serializers.py
py
4,633
python
en
code
0
github-code
13
33300696325
import numpy as np def to_numpy_array(args) -> np.ndarray: if not isinstance(args, (list, tuple, np.ndarray)): raise ValueError("Invalid args.") if isinstance(args, np.ndarray): if len(args.shape) == 1: return np.array(args).reshape(1, 2) return args if not isinstance...
dylanwal/flex_optimization
flex_optimization/problems/utils.py
utils.py
py
1,081
python
en
code
1
github-code
13
17060733424
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class TenantChannelDetailDTO(object): def __init__(self): self._channel_code = None self._channel_desc = None self._channel_id = None self._channel_name = None s...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/TenantChannelDetailDTO.py
TenantChannelDetailDTO.py
py
6,011
python
en
code
241
github-code
13
38595224262
from django.shortcuts import render, redirect from django.contrib import messages from django.urls import reverse from Authentification.models import UserP from Authentification.models import UserS # Create your views here. def index(request): if 'id' in request.session: if request.session['is_prof'] is Tr...
kaddachi17/q
Authentification/views.py
views.py
py
2,384
python
en
code
0
github-code
13
17050228974
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class ConditionEntry(object): def __init__(self): self._dim_key = None self._value = None @property def dim_key(self): return self._dim_key @dim_key.setter def...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/ConditionEntry.py
ConditionEntry.py
py
1,264
python
en
code
241
github-code
13
4087242521
import numpy as np import matplotlib.pyplot as plt import urllib.request # ごくシンプルな畳み込み層を定義しています。 class Conv: # シンプルな例を考えるため、Wは3x3で固定し、後のセッションで扱うstridesやpaddingは考えません。 def __init__(self, W): self.W = W def f_prop(self, X): out = np.zeros((X.shape[0]-2, X.shape[1]-2)) for i in range(o...
yasuno0327/LearnCNN
aidemy/cnn/task2.py
task2.py
py
2,448
python
ja
code
1
github-code
13
3241982845
from PySide2 import QtCore import os import sqlite3 from ..sqlite_init import povezivanje_baza class PlaceviModel(QtCore.QAbstractTableModel): def __init__(self): super().__init__() # matrica, redovi su liste, a unutar tih listi se nalaze pojedinacni podaci o korisniku iz imenika self._co...
krstovicjelena/MRS
JelenaKrstovic2016200143/PlaceviJelenaKrstovic2016200143/modeli/placevi_model.py
placevi_model.py
py
4,397
python
en
code
1
github-code
13
72378909137
import time import random def radixsort( aList ): RADIX = 10 maxLength = False tmp , placement = -1, 1 while not maxLength: maxLength = True # declare and initialize buckets buckets = [list() for _ in range( RADIX )] # split aList between lists for i in aList: tmp = i / placement ...
cefeboru/ComparacionAlgoritmos
radixSort.py
radixSort.py
py
1,231
python
en
code
0
github-code
13
16083160331
""" Create a function that retrieves every number that is strictly larger than every number that follows it. Examples [3, 13, 11, 2, 1, 9, 5] ➞ [13, 11, 9, 5] 13 is larger than all numbers to its right, etc. [5, 5, 5, 5, 5, 5] ➞ [5] Must be strictly larger. Always include the last number. [5, 9, 8, 7] ➞ [9, 8, 7]...
MelekAlan/Python_Challenge
Larger_to_Right.py
Larger_to_Right.py
py
688
python
en
code
0
github-code
13
36907276267
import math def SquareRootContinuedFraction(n): # This computes the continued fraction of a square root function # if n is a perfect square if math.sqrt(n) == int(math.sqrt(n)): return [ int(math.sqrt(n)) ] # we iterate on the form (sqrt(n) + a)/b # to get to the next iteration, we ne...
ekeilty17/Project_Euler
P064.py
P064.py
py
1,740
python
en
code
1
github-code
13
43272157790
''' difPy - Python package for finding duplicate and similar images 2023 Elise Landman https://github.com/elisemercury/Duplicate-Image-Finder ''' from glob import glob from multiprocessing import Pool from uuid import uuid4 import numpy as np from PIL import Image from distutils.util import strtobool import os from dat...
elisemercury/Duplicate-Image-Finder
difPy/dif.py
dif.py
py
34,530
python
en
code
346
github-code
13
20884770174
from aip import AipSpeech # 替换为您的百度 API 密钥 BAIDU_APP_ID = 'xxx' BAIDU_API_KEY = 'xxx' BAIDU_SECRET_KEY = 'xxx' # 创建一个 AipSpeech 对象 client = AipSpeech(BAIDU_APP_ID, BAIDU_API_KEY, BAIDU_SECRET_KEY) def recognize_wav_file(filename): with open(filename, 'rb') as file: audio_data = file.read() response...
brcarry/Embedded_Project
unit_test/test01-baidu.py
test01-baidu.py
py
832
python
en
code
0
github-code
13
18233368981
from collections import OrderedDict from distutils import util import os import re from typing import Callable, Dict, Sequence, Tuple, Type, Union import pkg_resources import google.api_core.client_options as ClientOptions # type: ignore from google.api_core import exceptions # type: ignore from google.api_core impo...
Global19/python-assured-workloads
google/cloud/assuredworkloads_v1beta1/services/assured_workloads_service/client.py
client.py
py
29,069
python
en
code
null
github-code
13
36662166048
import array as arr import numpy as np import time import csv import scipy.misc import matplotlib.pyplot as plt import channelrowparse_maxmin as testmain import channelrowparse_zett as zettmain StartTime = time.time() def UseCallPy(): ''' testmain.nROI_X = 3998 testmain.nROI_Y = 2998 ''' sFilePat...
dinoliang/SampleCode
Python/raw/simulation_main.py
simulation_main.py
py
1,920
python
en
code
0
github-code
13
278474212
from django import forms from .models import UserModel class BaseForm(forms.ModelForm): def get_errors(self): errors = self.errors.get_json_data() new_errors = [] for messages in errors.values(): for message_dicts in messages: for key, message in message_dicts.ite...
ApostleMelody/Django
ManagerSystem/UserManager/forms.py
forms.py
py
1,563
python
en
code
0
github-code
13
24764097098
import socket # operating on IPv4 addressing scheme sSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # This is to bind and listen to the server sSocket.bind(("127.0.0.1",25)) sSocket.listen() # Accept connections while(True): (cConnected, cAddress) = sSocket.accept() print("Accepted a connection r...
Maher512/NetworkingCW
server.py
server.py
py
527
python
en
code
0
github-code
13
12645251563
#!/usr/bin/python2 import matplotlib matplotlib.use('Agg') import numpy as np from matplotlib import pyplot as plt from VectorAlgebra import * from Bio.PDB.PDBParser import PDBParser def checkIfNative(xyz_CAi, xyz_CAj): v = vector(xyz_CAi, xyz_CAj) r = vabs(v) if r<12.0: return True else: return Fals...
xinyugu1997/CPEB3_Actin
AWSEM_simulations/annealing_unstructured_domain/HB_term_on/result/Drawcontactmap.py
Drawcontactmap.py
py
1,511
python
en
code
0
github-code
13
33654291546
"""empty message Revision ID: 14af6017bb46 Revises: 7292deb23125 Create Date: 2020-11-16 14:58:23.526641 """ from alembic import op import sqlalchemy as sa from pytz import utc from datetime import datetime # revision identifiers, used by Alembic. revision = '14af6017bb46' down_revision = '7292deb23125' branch_lab...
kzagorulko/flower-system
backend/migrations/versions/14af6017bb46_.py
14af6017bb46_.py
py
3,157
python
en
code
2
github-code
13
5848977424
# coding: utf-8 from keras.models import Sequential from keras.layers import Dense from keras.layers import Reshape from keras.layers.core import Activation from keras.layers.normalization import BatchNormalization from keras.layers.convolutional import UpSampling2D from keras.layers.convolutional import Conv2D, MaxPo...
huht3k/GAN
mnist_gan.py
mnist_gan.py
py
6,548
python
en
code
0
github-code
13
3229608656
from flask import Flask from flask_sqlalchemy import SQLAlchemy from os import path from flask_login import LoginManager # database db = SQLAlchemy() DB_NAME = "database.db" def create_app(): app = Flask(__name__) app.config['SECRET_KEY'] = 'jdgalwbeflahugfs' app.config['SQLALCHEMY_DATABASE_URI'] = f'sql...
Lord-Psarris/Flask-notes-app
website/__init__.py
__init__.py
py
1,193
python
en
code
0
github-code
13
11161256570
import itertools import logging import random import string from pyinsect.documentModel.comparators import SimilarityHPG, SimilarityVS from pyinsect.documentModel.representations.DocumentNGramGraph import DocumentNGramGraph logger = logging.getLogger(__name__) class HPGTestCaseMixin(object): graph_type = None ...
ggianna/PyINSECT
tests/hpg/base.py
base.py
py
4,016
python
en
code
3
github-code
13
29396043152
import SimpleITK as sitk import sys import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import scipy.ndimage as nimg from numba import njit import tensorflow as tf # tf.__version__: 1.12.0 from skimage.feature import peak_local_max from skimage.segmentation import w...
awjibon/laa-orifice
orifice.py
orifice.py
py
23,785
python
en
code
0
github-code
13
17661254312
#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator from collections import namedtuple from matplotlib import ticker n_groups = 6 default = [0, 0, 0, 0, 0, 0] data = { 'ext4': default, 'xfs': default, 'nova': default, 'pmfs': default, 'be...
miaogecm/FlatFS
evaluation/path_walk_efficiency/plot.py
plot.py
py
3,843
python
en
code
20
github-code
13
16610693647
#!/usr/bin/env python3 """ Training script for xview challenge """ __author__ = "Rohit Gupta" __version__ = "dev" __license__ = None from utils import load_xview_metadata from utils import read_labels_file from utils import labels_to_segmentation_map, labels_to_bboxes from utils import colors from torchvision.model...
rohit-gupta/building-damage-assessment
scratch/dataset_tests.py
dataset_tests.py
py
3,243
python
en
code
0
github-code
13
1538158363
import tkinter as tk class NameFrame: def __init__(self, master, ok_callback, exit_callback, **kwargs): self._frame = tk.Frame(master, **kwargs) self._frame.pack(padx=5, pady=5) self._top_frame = tk.Frame(self._frame) self._top_frame.pack(side="top", pady=5) self._bot_fram...
AnttiVainikka/DistributedProject
src/gui/name.py
name.py
py
1,406
python
en
code
0
github-code
13
42436729976
""" The data source is https://www.kaggle.com/datasets/amananandrai/ag-news-classification-dataset?resource=download&select=train.csv \ It is saved in this directory by **'train_original'** and **'test_original.csv'** """ from datasets import load_dataset import pandas as pd from tqdm import tqdm import os def prepro...
yookyungkho/MAV
data/original/agnews/preprocess.py
preprocess.py
py
1,388
python
en
code
0
github-code
13
70427179537
import unittest from solutions.day_11 import Solution class Day11TestCase(unittest.TestCase): def setUp(self): self.solution = Solution() self.puzzle_input = self.solution.parse_input( """ L.LL.LL.LL LLLLLLL.LL L.L.L..L.. LLLL.LL.LL L.LL.LL.LL ...
madr/julkalendern
2020-python/tests/test_day_11.py
test_day_11.py
py
3,615
python
en
code
3
github-code
13
35472032233
import numpy as np from .gellmann import gellmann_basis_to_dm, dm_to_gellmann_basis def get_numpy_rng(np_rng_or_seed_or_none): if np_rng_or_seed_or_none is None: ret = np.random.default_rng() elif isinstance(np_rng_or_seed_or_none, np.random.Generator): ret = np_rng_or_seed_or_none else: ...
Sunny-Zhu-613/pureb-public
python/pyqet/random.py
random.py
py
3,322
python
en
code
0
github-code
13
35383595791
from django.shortcuts import render from .models import Salesperson, Branch, profit, customer from django.template.defaultfilters import floatformat from django.db.models import Sum, Count from django.http import JsonResponse # Create your views here. def company(request): totalthisJuly = Branch.objects....
10944146/SE-final
finalapp/views.py
views.py
py
7,473
python
en
code
0
github-code
13
75052992016
class Solution: def leaders(self, arr): n=len(arr) leaders=list() maxval = float('-inf') for i in reversed(range(0, n)): if arr[i]>=maxval: maxval = arr[i] leaders.append(maxval) return leaders
Roy263/SDE-Sheet
Leaders In array/leaderFromRight.py
leaderFromRight.py
py
281
python
en
code
0
github-code
13
74525535058
# -*- coding: utf-8 -*- """ Created on Wed Oct 24 13:05:05 2018 @author: Hugo """ print('This program is used to calculate the sum of the divisiors of a certain number') n = int(input('Introduce that number: ')) divisors = 0 for i in range(1,n + 1): if n % i == 0: divisors += i print(divisors)
Hugomguima/FEUP
1st_Year/1st_Semestre/Fpro/Python/saved files/question2.py
question2.py
py
310
python
en
code
0
github-code
13
13546154086
ans , guess = 37 , 0 max , min = 100 , 1 while ans != guess: guess = int((input(str(min)+"~"+str(max)+">> "))) if guess > ans: max = guess print("太大了") elif guess < ans: min = guess print("太小了") print("讚啦") import random from random import randint as rdt guess , ans = 0, rdt...
Delocxi/python-workspace
guessAnswer.py
guessAnswer.py
py
794
python
en
code
0
github-code
13
35345174334
import os import shutil class make_all_folders(object): def __init__(self): """Need a folder? This makes it. Don't like the folder you got... take care of it. This initalizes with make temp running because everything else counts on this folder.""" self.make_temp() pass ...
underminerstudios/ScriptBackup
FlashArtPipeline/art_pipeline/ExternalCalls/make_folders.py
make_folders.py
py
2,380
python
en
code
2
github-code
13
42274469179
from flask import ( Blueprint, flash, g, redirect, render_template, request, session, url_for ) from werkzeug.exceptions import abort from runmetric.auth import login_required from runmetric.models.database.run import Run bp = Blueprint('activities', __name__, url_prefix='/activities') @bp.route('/create', me...
wtbarras/AthMetric
runmetric/activities.py
activities.py
py
493
python
en
code
0
github-code
13
28497607276
import unittest import boto3 import pandas as pd from moto import mock_s3 from datetime import datetime, timedelta from io import StringIO from xetra.common.constants import MetaProcessFormat from xetra.common.meta_process import MetaProcess from xetra.common.s3 import S3BucketConnector class TestMetaProcessMethods...
andreyDavid/Deutch_stock_market_ETL
tests/common/test_meta_process.py
test_meta_process.py
py
7,441
python
en
code
0
github-code
13
9919033504
import constants import pygame import random class Asteroid(pygame.sprite.Sprite): def __init__(self, size, speed): super().__init__() self.image = pygame.Surface([size, size]) self.image.fill(constants.BLUE) self.rect = self.image.get_rect() self.size = size self....
BeachedWhaleFTW/SpaceShooterExample
asteroids.py
asteroids.py
py
680
python
en
code
0
github-code
13
7834549900
import logging from datetime import datetime from functools import wraps from logging import NullHandler GNUPG_STATUS_LEVEL = 9 def status(self, message, *args, **kwargs): # type: ignore[no-untyped-def] """LogRecord for GnuPG internal status messages.""" if self.isEnabledFor(GNUPG_STATUS_LEVEL): sel...
freedomofpress/securedrop
securedrop/pretty_bad_protocol/_logger.py
_logger.py
py
1,627
python
en
code
3,509
github-code
13
28678668384
import requests import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('-t', '--target', help = " *** Set an URL page for analyze *** ex. http://www.google.com") parser = parser.parse_args() def main(): if parser.target: try: url = requests.get(url=parser.target) ...
Antonio152/Hacking_CMS
Headers.py
Headers.py
py
762
python
en
code
0
github-code
13
40608043850
import os import cv2 import matplotlib.pyplot as plt import numpy as np def find_board(src_img: np.ndarray): board = (0, 0, 0, 0) img = cv2.cvtColor(src_img, cv2.COLOR_BGR2GRAY) h, w = img.shape result = np.zeros((h, w, 3), dtype=np.uint8) ret, binary = cv2.threshold(img, 0, 255, cv2.THRESH_BINAR...
VGxiaozhao/Sudoku
preprocess.py
preprocess.py
py
3,468
python
en
code
3
github-code
13
23471993260
from odoo import models, fields, api, _ from odoo.exceptions import ValidationError class TfHrJobAssignmentSAWizard(models.TransientModel): _name = 'tf.hr.job_assignment.sa.wizard' employee_id = fields.Many2one('hr.employee', 'Employee') currency_id = fields.Many2one('res.currency') job_config_id = f...
taliform/demo-peaksun-accounting
tf_peec_job_assignment/wizard/tf_hr_job_assignment_sa_wizard.py
tf_hr_job_assignment_sa_wizard.py
py
2,167
python
en
code
0
github-code
13
74377822416
import numpy as np from math import pi, cos, sin import modern_robotics as mr def forward_kinematics(joints): # input: joint angles [joint1, joint2, joint3] # output: the position of end effector [x, y, z] # add your code here to complete the computation link1z = 0.065 link2z = 0.039 link3x = ...
Zachattack98/EE144_Labs
lab4/forward_kinematics.py
forward_kinematics.py
py
721
python
en
code
1
github-code
13
7226787445
import PySimpleGUI as sg from string import punctuation rus_alph = ['а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] ...
IgelSchnauze/info-security
CaesarCipher_1.py
CaesarCipher_1.py
py
4,808
python
en
code
0
github-code
13
21580874835
from OpenGL.GL import * # noqa from math import radians, cos, sin, tan, sqrt from PyQt5 import QtCore, QtWidgets, QtGui from .camera import Camera from .functions import mkColor from .transform3d import Matrix4x4, Quaternion, Vector3 class GLViewWidget(QtWidgets.QOpenGLWidget): def __init__( self, ...
Liuyvjin/pyqtOpenGL
pyqtOpenGL/GLViewWiget.py
GLViewWiget.py
py
7,912
python
en
code
0
github-code
13
41768092902
class Solution: def f(self, n): if n in self.dp: return self.dp[n] if n == len(self.books): return 0 shelf_h = 0 shelf_w = 0 min_h_overall = sys.maxsize for i in range(n, len(self.books)): book = self...
ritwik-deshpande/LeetCode
DP/min_height_of_shelves.py
min_height_of_shelves.py
py
910
python
en
code
0
github-code
13
16756066715
"""Test w_state.""" import numpy as np import pytest from toqito.matrix_ops import tensor from toqito.states import basis, w_state def test_w_state_3(): """The 3-qubit W-state.""" e_0, e_1 = basis(2, 0), basis(2, 1) expected_res = ( 1 / np.sqrt(3) * (tensor(e_1, e_0, e_0) + tensor(e_0, e_1, e_0) ...
vprusso/toqito
toqito/states/tests/test_w_state.py
test_w_state.py
py
1,258
python
en
code
118
github-code
13