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
7911071781
from typing import List from sqlalchemy.orm import Session from app.connectors.db_conn import get_db from app.core.constants import ( DATA_ERROR_LISTALL, DATA_NOT_FOUND_MESSAGE, DB_ERROR, DEFAULT_LIMIT_COUNT, DEFAULT_OFFSET_COUNT, ) from app.core.exceptions import InternalServerError, RecordNotFou...
avinash-chaluvadi-dev/pratilipi-ana
soa-gateway/app/api/voicemail_archive.py
voicemail_archive.py
py
4,265
python
en
code
0
github-code
90
72985664295
import sys r = sys.stdin.readline n = int(r()) lst = [] sumlst = [0]*n for _ in range(n): lst.append(int(r())) sumlst[0] = lst[0] if n>1: sumlst[1] = lst[0] + lst[1] if n>2: sumlst[2] = max(lst[0] + lst[2], lst[1] + lst[2]) if n>3: for i in range(3, n): sumlst[i...
dayeong089/python_algorithm_study
BOJ/2579_계단오르기_dp.py
2579_계단오르기_dp.py
py
396
python
en
code
0
github-code
90
25571691274
from __future__ import absolute_import import collections import io import itertools import traceback import unittest from xml.etree import ElementTree import coverage from tests import _loader class CaseResult( collections.namedtuple( "CaseResult", ["id", "name", "kind", "stdout", "stderr", "s...
grpc/grpc
src/python/grpcio_tests/tests/_result.py
_result.py
py
16,613
python
en
code
39,468
github-code
90
37565766286
# coding: utf-8 # Chinese CCGbank conversion # ========================== # (c) 2008-2012 Daniel Tse <cncandc@gmail.com> # University of Sydney # Use of this software is governed by the attached "Chinese CCGbank converter Licence Agreement" # supplied in the Chinese CCGbank conversion distribution. If the LICENCE file...
jogloran/cnccgbank
munge/trees/traverse.py
traverse.py
py
6,039
python
en
code
12
github-code
90
35554098206
from PyQt6.QtWidgets import QWidget, QLineEdit, QRadioButton,QStackedWidget,QGridLayout from network.packet_info import TCP_IP_PACKET, ICMP_IP_PACKET, UDP_IP_PACKET from widgets.packet_IP import IPPacketWidget class IPConfigurationWidget(QWidget): TCP_FLAG_MAP = { "tcp_ack_radio": "A", "tcp_fin_radio": "F...
MichaelHeinzman/Automatic-NPG-Interface
app/src/widgets/ip_packet_configuration.py
ip_packet_configuration.py
py
5,459
python
en
code
0
github-code
90
71632727656
import os import warnings import sys import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import f1_score from sklearn.metrics import roc_auc_score from sklearn.model_selection import train_test_split import mlflow import mlflow.sklearn from sk...
Biswajit7890/MLFLOW-Deployment
mlflow deploy.py
mlflow deploy.py
py
2,953
python
en
code
0
github-code
90
2627131682
def mergeSort(A): if len(A)>1: mid=int(len(A)/2) L=A[:mid] #dividing array into two halves R=A[mid:] #print(L) #print(R) mergeSort(L) mergeSort(R) mergePro(A,L,R) def mergePro(A,L,R): i = j = k = 0 while i < len(L) and j < len(R): if L[i] < R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] ...
karishmak8/DAA
mergesort.py
mergesort.py
py
477
python
en
code
1
github-code
90
8195377884
import ffmpeg import os def get_video_info(source_video_path): probe = ffmpeg.probe(source_video_path) print('source_video_path: {}'.format(source_video_path)) format = probe['format'] bit_rate = int(format['bit_rate'])/1000 duration = format['duration'] size = int(format['size'])/1024/1024 ...
lingchuanbo/WorkFlow
custom/python/ffmpeg提取音频合并.py
ffmpeg提取音频合并.py
py
1,212
python
en
code
10
github-code
90
33558266158
import PySimpleGUI as sg from random import randint import sqlite3 '''Saving the players file to a database rather than a text file. This is probably overkill for this application. Normally You would have more than just one field. ''' # connect to database (if it doesn't exist then create it) db = sqlite3.conn...
msjones3/rickstick-pysimplegui
main4_sql.py
main4_sql.py
py
3,668
python
en
code
0
github-code
90
31950657748
from functools import partial from collections import namedtuple import numpy as np import mindspore.common.dtype as mstype from mindspore.ops.primitive import Primitive from mindspore.ops import operations as P from mindspore.ops import functional as F from mindspore.common.parameter import Parameter from mindspore.co...
imyzx2017/mindspore_pcl
mindspore/nn/layer/quant.py
quant.py
py
62,541
python
en
code
5
github-code
90
30781373773
#See README.MD file from math import cos, sin from numpy import arange import matplotlib.pyplot as plt MIN = -100 MAX = 100 STEP = 0.1 def prepare_data(): f = lambda x: -12*sin(cos(x))*x**4 - 18*x**3 + 5*x**2 + 10*x - 30 x_y_list = [(round(x,2),round(f(round(x,2)),3)) for x in arange(MIN,MAX+STEP,STEP)] ...
pashtetrus33/pythonStart
dz_11/main.py
main.py
py
4,278
python
ru
code
0
github-code
90
34679816078
import psutil import datetime from apscheduler.schedulers.blocking import BlockingScheduler def job(): with open('/root/test/log.txt', 'a') as fp: now = datetime.datetime.now() boot_time = psutil.boot_time() result = '[{}][{}]\n'.format(now, boot_time) fp.write(result) sched = Block...
chrisandan/AIOPS_PLATFORM
Scheduler/getinfo.py
getinfo.py
py
391
python
en
code
null
github-code
90
74067944936
# -*- coding: utf-8 -*- import numpy as np from vietocr.tool.predictor import Predictor from vietocr.tool.config import Cfg from PIL import Image import cv2 def img_to_text(list_img): results = [] config = Cfg.load_config_from_name("vgg_transformer") # đường dẫn đến trọng số đã huấn luyện hoặc comment để ...
trongbui1105/VietCardOcr
vietcardocr/ocr.py
ocr.py
py
1,058
python
vi
code
5
github-code
90
18039287779
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") n,k,l = list(map(int, input().split())) from collections import defaultdict ns0 = defaultdict(list) ns1 = defaultdict(list) for i in range(k): p,q = map(int, input().split()...
Aasthaengg/IBMdataset
Python_codes/p03855/s222669114.py
s222669114.py
py
1,389
python
en
code
0
github-code
90
25872142760
from bs4 import BeautifulSoup import telebot import youtube_dl import requests token = '1702123934:AAG4xQh_ZnXnauuHnpjd0Jwojj9_fM4VwDw' bot = telebot.TeleBot(token) welcome_text = """ Youtube downmloader! """ type_url = """ Введите ссылку на видео """ @bot.message_handler(content_types=['text']) def send_welcome(...
xic2401/telegram_bot_1
main.py
main.py
py
967
python
en
code
0
github-code
90
18377275519
n, k = map(int,input().split()) MOD=10**9+7 def comb(n,k): if n < k: return 0 if n < 0 or k < 0: return 0 k = min(n-k,k) ans = 1 inv = [1]*(k+1) if k >= 1: ans *= (n-k+1)%MOD for i in range(2,k+1): inv[i] = MOD - inv[MOD%i]*(MOD//i)%MOD ans = ans*(n-...
Aasthaengg/IBMdataset
Python_codes/p02990/s906893137.py
s906893137.py
py
444
python
en
code
0
github-code
90
19203977080
__author__ = 'vriz' # !/usr/bin/env python # -*-coding: utf-8-*- """This module changes the visibility of links in the adjacency dictionary based on their ID""" from Adjacency_Dictionary_From_Database import Conversion, Connect class ChangeVisInDictByID: def __init__(self, dict, lst): self.dict = dict ...
Vriz/Thesis
Change_Visibility_Of_Link_In_Dictionary_By_ID.py
Change_Visibility_Of_Link_In_Dictionary_By_ID.py
py
1,869
python
en
code
0
github-code
90
30748698413
import os my_home = os.popen("echo $MYWORK_DIR").readlines()[0][:-1] from sys import path, argv path.append('%s/work/mylib/' % my_home) import h5py import numpy from mpi4py import MPI import hk_tool_box import warnings from sklearn.cluster import KMeans from astropy.cosmology import FlatLambdaCDM from astropy.coordinat...
hekunlie/astrophy-research
CFHTLenS/Fourier_Quad/gg_lensing/prepare_cata.py
prepare_cata.py
py
17,152
python
en
code
2
github-code
90
31606179036
#!/usr/bin/python3.6 # -*- coding: utf-8 -*- # @Time : 2020/7/10 14:47 # @Author : 代登辉 # @Email : 3276336032@qq.com # @File : word.py # @Software : PyCharm # @Description: 读取word import docx def getTextWord(wordFileName): doc = docx.Document(wordFileName) fullText = [] for para in ...
daidenghui1234/Natural-Language-Processing-with-Python-Cookbook
代码/针对原始文本获取源数据和规范化/在python中读取word文件/word.py
word.py
py
412
python
en
code
0
github-code
90
72290436138
# Functions for parsing command line arguments import argparse from argparse import RawTextHelpFormatter from .configuration_constants import convective_zone_types, variables_x, variables_y, overshoot_directions from shared.parse_arguments import arguments_for_axis_multiple, arguments_for_axis_single, verify_multiple_...
evgenyneu/OvershootPlot
evolution/parse_arguments.py
parse_arguments.py
py
2,848
python
en
code
0
github-code
90
33798246510
from django.shortcuts import render, HttpResponseRedirect, reverse, redirect, get_object_or_404, get_list_or_404 from django.http import HttpResponse, Http404 from .form import RequestForm, ReportUserForm, ReportContentForm from django.core.mail import send_mail from django.template.loader import render_to_string from ...
yankit293/support_system
support/views.py
views.py
py
8,832
python
en
code
0
github-code
90
73386876455
from realtweetornotbot import Bot, DebugBot from realtweetornotbot.bot import Config from realtweetornotbot.multithreading import MultiThreadSearcher def main(): run_once() # If infinite mode is on, run again in a loop while Config.RUN_INFINITELY == 1: run_once() def run_once(): bot = get_b...
giulionf/realtweetornotbot
src/main.py
main.py
py
711
python
en
code
76
github-code
90
17967394839
n = int(input()) tree = [[] for _ in range(n)] for i in range(n - 1): a, b, c = map(int, input().split()) a, b, c = a - 1, b - 1, c tree[a].append((b, c)) tree[b].append((a, c)) from heapq import heappush, heappop INF = 10 ** 18 def dijkstra(s, n): # (始点, ノード数) dist = [INF] * n hq = [(0, s)] # ...
Aasthaengg/IBMdataset
Python_codes/p03634/s130002712.py
s130002712.py
py
959
python
en
code
0
github-code
90
26903660763
# dobbelstenen aanvaller_1 = input('Wat is het nummer van de eerste dobblesteen van de aanvaller: ') aanvaller_2 = input('Wat is het nummer van de tweede dobblesteen van de aanvaller: ') aanvaller_3 = input('Wat is het nummer van de derde dobblesteen van de aanvaller: ') verdediger_1 = input('Wat is het nummer van de e...
xander27481/informatica5
06 - Condities/Risk.py
Risk.py
py
1,862
python
nl
code
0
github-code
90
17679494818
from sqlalchemy import Column, Integer, String, BigInteger, ForeignKey from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import relationship from .base import Base from .group_chat import GroupChat class Title(Base): __abstract__ = True id = Column(Integer, primary_key=True) text ...
cl0ne/cryptopotato-bot
devpotato_bot/commands/daily_titles/models/title.py
title.py
py
932
python
en
code
2
github-code
90
6336257089
# -*- encoding: utf-8 -*- ''' @Filename : downloader.py @Description: Downloader class for downloading files @Date : 2020/03/13 11:31:46 @Author : Wu Jiahao @Contact : https://github.com/flamywhale ''' import asyncio import os import sys from src.configs import (SQL_CMD, HTTP_HDRS) from src.logger impor...
wujiahao15/UCAS_AutoDownload
src/downloader.py
downloader.py
py
4,531
python
en
code
8
github-code
90
19286142972
from flask import Flask, render_template, session, redirect, url_for app = Flask(__name__) app.secret_key = 'your_secret_key_here' # Add a secret key for session encryption @app.route('/', methods=['GET']) def index(): # Check if 'counter' exists in the session, if not, initialize it if 'counter' not in sess...
Chayma15/python-2023
week 1/day5/core/counter/server.py
server.py
py
994
python
en
code
0
github-code
90
72333048297
# ===================================================================================== # Ask yes/no question # ===================================================================================== def askUser(title, prompt): from tkinter import Tk, filedialog, messagebox root = Tk() root.withdraw() ...
GordusLab/Corver-Wilkerson-Miller-Gordus-2021
pipeline/python/misc/gui_misc.py
gui_misc.py
py
2,991
python
en
code
1
github-code
90
29474195171
import torch from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig from peft import prepare_model_for_kbit_training from peft import LoraConfig, get_peft_model from utils import print_trainable_parameters def load_model(model_name): bnb_config = BitsAndBytesConfig( load_in_4bit=...
boostcampaitech5/level3_nlp_finalproject-nlp-08
model/LLM/train/load_model.py
load_model.py
py
1,033
python
en
code
29
github-code
90
18008586809
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") n = int(input()) a = list(map(int, input().split())) a.sort(reverse=True) from queue import deque q = deque(a) ans = 0 for i in range(n): v1,v2,v3 = q.popleft(), q.popleft()...
Aasthaengg/IBMdataset
Python_codes/p03767/s189920841.py
s189920841.py
py
354
python
en
code
0
github-code
90
17939475329
S = list(input()) T = list(input()) def compare(s, t): if len(s) != len(t): return False res = True for i in range(len(s)): res &= (s[i] == t[i] or s[i] == '?') return res n = len(S) m = len(T) pos = -1 for i in range(n): if compare(S[i:i+m], T): pos = i if pos == -1: print('U...
Aasthaengg/IBMdataset
Python_codes/p03565/s530089755.py
s530089755.py
py
420
python
en
code
0
github-code
90
452194055
import tempstore.engine as ts_e import werkzeug.exceptions import werkzeug.routing import werkzeug.utils import werkzeug.wrappers import werkzeug.wsgi import jinja2 import traceback # Base class for WSGI apps. class BaseApp: def __init__(self, base_url): # Initializes the base URL. self.base_url...
marcv81/tempstore
tempstore/webapp.py
webapp.py
py
5,606
python
en
code
0
github-code
90
22052213483
import pandas as pd import numpy as np from tqdm import tqdm from models.dataset import ATIS, preprocess_atis, padding_map from models.bilstm_model import BiLSTMmodel from quality_metrics.quality_metrics import intent_accuracy, slot_f1, sentence_accuracy import torch import torch.nn as nn from torch.nn.utils.rnn impo...
Polly42Rose/SiriusIntentPredictionSlotFilling
models/train.py
train.py
py
6,169
python
en
code
8
github-code
90
12957649045
from threading import Thread import cv2 import time class ReplayGetter: """ Class that continuously gets frames from a VideoCapture object with a dedicated thread. """ def __init__(self, fileFullRes='output-wide.mp4', fileCropped='output-zoom.mp4'): self.fileFullRes = fileFullRes s...
nick-cramer/fll-vision
ui/ReplayGetter.py
ReplayGetter.py
py
1,767
python
en
code
0
github-code
90
42296785110
import pandas as pd from lib import DS_PATH def load_full_df(): full_table = pd.read_csv(f'{DS_PATH}/covid_19_clean_complete.csv', parse_dates=['Date']) # replacing Mainland china with just China full_table['Country/Region'] = \ full_table['Country/Region'].replace('M...
hamasho-navagis/covid19-analysis
czml_generator/data.py
data.py
py
2,213
python
en
code
0
github-code
90
20440787817
# # Calendar.py # eAUrnik # from ics import Calendar, Event from datetime import datetime, timedelta from zoneinfo import ZoneInfo def make(parsed, monday): calendar = Calendar() calendar.creator = "eAUrnik - Fork me on GitHub: https://git.io/JO5Za" durations = [] for duration in parsed[0]: ...
umalavasic/eAUrnik
Calendar.py
Calendar.py
py
1,546
python
en
code
3
github-code
90
42429695161
import torch import numpy as np import torch.nn as nn import torch.nn.functional as nnf from .resnet import resnet18 from .ief_module import IEFModule, SpatialIEFModule, FuseIEFModule from .decoder import ResNet18Dec from .regressor import SingleInputRegressor from smplx.lbs import batch_rodrigues from...
gong-xuan/synhuman
model/regressor_align.py
regressor_align.py
py
24,719
python
en
code
0
github-code
90
75168062056
#!/usr/bin/env python3 import sys, re, os.path, itertools import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd from pylab import * params={'axes.linewidth' : .5} rcParams.update(params) # get the filename from the command line filename = sys.argv[1] # first figure out last l...
bramkuijper/dispersal_status
src/numerical/1player/plot_sims.py
plot_sims.py
py
4,107
python
en
code
0
github-code
90
21203322187
#!/usr/bin/python3 import json import math import os import random import sys """ { "METRIC_NODE_ADDR": "node21", "METRIC_LOCATION": 5000.0, "METRIC_LOCATION_VICINITY": { "node21": 5000.0, "node23": 2000.0 }, "METRIC_NUMBER_OF_INSTANCES_PER_SERVICE_A": 0, "METRIC_LOAD_PER_SERVICE_A_IN_CHILD_node22...
bruno-anjos/cloud-edge-deployment
scripts/generate_metrics.py
generate_metrics.py
py
14,935
python
en
code
0
github-code
90
33849840632
# 3. Создайте программу для игры в 'Крестики-нолики'. from asyncio import events from encodings import utf_8 import tkinter as tk from functools import partial class Game: player = 1 win_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 4, 7], [2, 5, 8], [3, 6, 9], [1, 5, 9], [3, 5, 7]] list_check = [] pl...
KovalchukMikhail/LessonPython
HomeWork005/HW5Part003.py
HW5Part003.py
py
3,532
python
en
code
0
github-code
90
18341732549
import heapq import sys lines = sys.stdin.readlines() N, M = [int(n) for n in lines[0].strip().split()] prices = [-int(n) for n in lines[1].strip().split()] heapq.heapify(prices) for _ in range(M): price = -heapq.heappop(prices) heapq.heappush(prices, -1 * (price // 2)) print(-sum(prices))
Aasthaengg/IBMdataset
Python_codes/p02912/s863277812.py
s863277812.py
py
303
python
en
code
0
github-code
90
11944993245
# 이진 탐색 # 재귀 사용 # param = 배열, 찾고자하는 숫자, 시작점, 끝점 def binarySearch(array, target, start, end): # 시작점이 끝점보다 위치값이 크다면 즉 정렬이 안되어 있다는 말과 동일 if start > end: return None # 중간 값을 구합니다. 수가 홀수라면 내림을 사용 mid = (start + end) // 2 # 배열의 중간 값이 찾고자하는 값과 같다면 if array[mid] == target: # 해당 배열 in...
EcoFriendlyAppleSu/algo
algorithm/binarySearch/BinarySearchBasicUsingRecursive.py
BinarySearchBasicUsingRecursive.py
py
1,078
python
ko
code
0
github-code
90
9777891430
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os from sys import argv if len(argv) < 3: exit (1) iname = unicode(argv[1]) iname_previous = unicode(argv[2]) itype = unicode(argv[3]) if iname_previous and iname_previous != 'None': cmd_ifdown = '/sbin/ifconfig '+iname_previous+' down 2> /dev/null && /b...
Tinkerforge/brickv
src/brickv/plugin_system/plugins/red/scripts/settings_network_apply.py
settings_network_apply.py
py
936
python
en
code
18
github-code
90
33657169537
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ maps = {} # time O(n) space O(n) for i in range(len(nums)): if nums[i] in maps: # more than one same n...
algorithm004-04/algorithm004-04
Week 01/id_359/LeetCode_1_359.py
LeetCode_1_359.py
py
706
python
en
code
66
github-code
90
30520435773
# -*- coding: UTF-8 -*- """ reader """ import numpy as np import config import random import paddle import json import os from PIL import Image, ImageEnhance import cv2 train_parameters = config.init_train_parameters() def box_to_center_relative(box, img_height, img_width): """ Convert COCO annotations box w...
shidian117/prune
reader.py
reader.py
py
16,160
python
en
code
0
github-code
90
29128893479
from tkinter import* import selenium from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager import time def download(link): driver = webdriver.Chrome(ChromeDriverManager().install()) driver.get('https://en.savefrom.net') link_box = driver.find_element_by_xpath('//*[@id...
brownie22322/my_projects
youtube_video_downloader.py
youtube_video_downloader.py
py
1,435
python
en
code
0
github-code
90
21323519384
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): pass def solve(self): ''' insert your code ''' if len(sys.argv) != 2: ...
lethe2211/nlp100
chap2/16.py
16.py
py
1,104
python
en
code
12
github-code
90
41169790625
# https://personal.ntu.edu.sg/lixiucheng/books/jax/jax-autodiff.html # http://implicit-layers-tutorial.org/implicit_functions/ # https://jax.readthedocs.io/en/latest/notebooks/autodiff_cookbook.html # https://scholar.princeton.edu/sites/default/files/nickmcgreivy/files/simons_summer_school_talk_august_21st.pdf # A Jac...
donboyd5/weighting
archive/test_build_jacobian.py
test_build_jacobian.py
py
4,328
python
en
code
0
github-code
90
35659799061
from __future__ import annotations from functools import partial from typing import cast, Callable, List, Optional, Union import numpy as np from qiskit.algorithms.eigensolvers import EigensolverResult from qiskit.algorithms.minimum_eigensolvers import MinimumEigensolverResult from qiskit_nature.second_q.hamiltonia...
dlasecki/qiskit-nature
qiskit_nature/second_q/problems/vibrational_structure_problem.py
vibrational_structure_problem.py
py
4,880
python
en
code
null
github-code
90
70618256297
import tensorflow as tf import keras from keras.layers import Input, Conv2D, MaxPooling2D, Dropout, BatchNormalization, Conv2DTranspose, concatenate, \ Activation, UpSampling2D, Cropping2D, Reshape, Permute from keras.regularizers import l2 from keras.models import Model from keras.optimizers import Adam act = 'r...
Julymycin/U-Net_keras_cardiovascular
get_model.py
get_model.py
py
10,312
python
en
code
0
github-code
90
75053671656
from fastapi import APIRouter, HTTPException, status from pydantic import ValidationError from sqlalchemy.exc import IntegrityError from app.const import MENU_GET_DESCRIPTION from app.domain.entities.restaurant import CreateMenuRequest from app.domain.usecases.menu_use_cases import MenuUseCases from app.infrastructure...
lucaspacifico/mashgin
api/app/router/menu_router.py
menu_router.py
py
1,332
python
en
code
0
github-code
90
39529584645
from odoo import models, fields, api, _ from datetime import datetime from odoo.exceptions import ValidationError class AnnualTicket(models.Model): _name = 'annual.ticket' _description = "Annual Ticket" _rec_name = 'year_id' name = fields.Char('Name', required=True) year_id = fields.Many2one('yea...
mooosamir/SFC-odoo-addons-hr-sa
saudi_hr_air_allowance/models/annual_ticket.py
annual_ticket.py
py
7,592
python
en
code
0
github-code
90
10129821516
from luigi import Task, Parameter, IntParameter, LocalTarget from preprocessing.global_config import GlobalConfig from preprocessing.fields import OutputFields from mltoolkit.mlutils.helpers.paths_and_files import iter_file_paths, \ get_file_name, \ comb_paths from preprocessing.helpers.data_utils import read_c...
abrazinskas/Copycat-abstractive-opinion-summarizer
preprocessing/steps/subsampling.py
subsampling.py
py
6,008
python
en
code
98
github-code
90
12643026649
import os import sys from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) try: README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() except IOError: README = CHANGES = '' install_requires=[ ] tests_req...
chrisrossi/minbool
setup.py
setup.py
py
1,249
python
en
code
1
github-code
90
21317386183
from queue import PriorityQueue def a_star(graph,start,goal,heuristic): # Initialize the open and closed sets open_set = PriorityQueue() open_set.put((0,start)) came_from = {} cost_so_far = {} came_from[start] = None cost_so_far[start] = 0 # Loop until goal is reached or open set is em...
es-amit/Artificial-Intelligence
Search algorithm/Heuristic Search/A* Algorithm/A* search algorithm.py
A* search algorithm.py
py
2,292
python
en
code
2
github-code
90
2826971940
import cv2 import numpy as np import random roi = None upper_color = np.array([255, 255, 255], dtype='uint8') lower_color = np.array([0, 100, 100], dtype='uint8') COLORS = ['R', 'G', "B", 'Y'] red_mask = [np.array([0, 100, 50]), np.array([6, 255, 255])] green_mask = [np.array([30, 100, 50]), np.array([70, 255, 255...
petrshirin/computer_vision_edu
follow_to_ball.py
follow_to_ball.py
py
4,326
python
en
code
0
github-code
90
13483312633
#!/bin/python3 # TryHackMe Advent of Cyber 2020 - Day 16 API challenge import requests for api_key in range (1,100,2): print ("api key:" + str(api_key) ) # enter IP target below. The f' is used to format the api_key number taken from the range into a string html = requests.get(f'http://<ENTER IP ADDRESS>/...
cyb3rkevin/tools
apibruter.py
apibruter.py
py
358
python
en
code
0
github-code
90
18113047579
dict = {} def insert(word): global dict dict[word] = 0 def find(word): global dict if word in dict: print('yes') else: print('no') def main(): N = int(input()) order = [list(input().split()) for _ in range(N)] for i in range(N): if order[i][0] == 'insert': ...
Aasthaengg/IBMdataset
Python_codes/p02269/s533097637.py
s533097637.py
py
425
python
en
code
0
github-code
90
32408638236
import os import numpy as np # 关于hdf5/lmdb/disk存储图片相关库 from PIL import Image import pickle import lmdb import h5py import time # 海量数据集读写测试函数 # ---------------------- disk -------------------------- # def store_many_disk(images, disk_dir): """ Stores an array of images to disk Parameters: ---------...
Daming-TF/HandData
library/file_format.py
file_format.py
py
3,783
python
en
code
1
github-code
90
8802973565
#Chaotic implementation of a z-rhombus. """ 3-levels output example: z zzz zzzzz zzzzzzz zzzzz zzz z """ #We determine each side's altitude floors = int(input()) x = 1 #Calculation of diagonal angles white_spaces = (x+2*floors)+(floors+3) #Printing out the upper triangl...
ccusrz/hakuna-matata
rhombus1.py
rhombus1.py
py
916
python
en
code
0
github-code
90
70549457577
# 供应商信息 class Supplier_count_struct: supplier_name: str ppn_count: int def __init__(self, supplier_name): self.supplier_name = supplier_name self.ppn_count = 0 # 品牌的供应商信息 class Manu_supp: manu_name: str supplier_info: [Supplier_count_struct] def __init__(self, manu_name): ...
gree180160/YJCX_AI
IC_stock/Supplier_analyth.py
Supplier_analyth.py
py
1,420
python
en
code
0
github-code
90
26542407287
import numpy as np from flask import Flask, request, jsonify import pickle from flask_cors import CORS app = Flask(__name__) cors = CORS(app) model = pickle.load(open('model.pkl', 'rb')) @app.route('/') def home(): return "<h1>Welcome to flask server !</h1>" @app.route('/results', methods=['POST...
iDuckDark/Full-Stack-Starter-Kit
machine-learning/predict-sales/app.py
app.py
py
623
python
en
code
3
github-code
90
37893254956
#!/usr/bin/env python # coding: utf-8 # In[1]: import socket try: url = input("Enter a URL:\n") for urlparts in url: urlparts = url.split("/") host = urlparts[2] print("host: ", host,"\n") mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect((host, 80)) cm...
DARSHITA188/PythonForEverybody_Answers11-12
Chapter 12_Exercise 1.py
Chapter 12_Exercise 1.py
py
615
python
en
code
0
github-code
90
40615615810
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 16.01.2021 @author: Feliks Kiszkurno """ from sklearn import svm import numpy as np import slopestabilityML.plot_results import slopestabilityML.split_dataset import slopestabilityML.run_classification import settings def svm_run(test_results, random_s...
felikskiszkurno/SlopeStability
slopestabilityML/SVM/svm_run.py
svm_run.py
py
1,462
python
en
code
4
github-code
90
32326036329
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('core', '0002_auto_20150604_1651'), ] operations = [ migrations.AlterField( mode...
alcarney/camel
core/migrations/0003_auto_20151016_0752.py
0003_auto_20151016_0752.py
py
689
python
en
code
0
github-code
90
30609213928
from Cat import Cat from Dog import Dog from Owl import Owl from Salmon import Salmon cat = Cat("Easeboy", 2) cat.voice() print(cat.getName()) dog = Dog("Firstdog", 5) dog.voice() owl = Owl("Owl", 8) # owl.addHunger(5) # owl.isHungry() # owl.feed(4) # owl.isHungry() # owl.feed(1) # owl.isHungry() salmon = Salmon("...
Aykivan/JavaOOP
PythonProject/main.py
main.py
py
425
python
en
code
0
github-code
90
8711064488
''' Created on Oct 27, 2011 @author: guillaume.aubert@eumetsat.int ''' import re import os import datetime import eumetsat.dmon.common.time_utils as time_utils #regular Expression to parse the xferlogs #to eat potential header addded by GEMS XFERLOG_GEMS_HEADER = r'\s*(xferlog:)?.*' XFERLOG_DATE_PATTERN = r'(?P<date...
gaubert/rodd
src/eumetsat/dmon/parsers/xferlog_parser.py
xferlog_parser.py
py
8,106
python
en
code
3
github-code
90
35770145631
from django.http import Http404 from rest_framework.permissions import BasePermission from selections.models import Selection # class IsOwner(permissions.BasePermission): # message = "No Permissions" # # def has_permission(self, request, view): # return request.user and request.user.is_authenticated...
Lakhmenev/HW__30
selections/permissions.py
permissions.py
py
994
python
en
code
0
github-code
90
71847067176
import sys def part1(lines): valid = 0 for line in lines: words = line.split() if len(words) == len(set(words)): valid += 1 return valid def part2(lines): valid = 0 for line in lines: words = line.split() if len(words) != len(set(words)): c...
alfredgamulo/advent_of_code
2017/04/main.py
main.py
py
685
python
en
code
2
github-code
90
607708338
import pickle from spacy.tokenizer import Tokenizer from spacy.lang.en import English def get_all_space_indexes(astring): l = -1 indexes = [] while True: l = astring.find(" ", l + 1) if l == -1: break indexes.append(l) return indexes def insert_str(string, index): ...
blodstone/Salience_Sum
preprocess/noisy_salience_model/gold.py
gold.py
py
2,023
python
en
code
2
github-code
90
41417079789
import json from pprint import pprint import pandas as pd pd.set_option('display.max_rows', None) pd.set_option('display.max_columns', None) name_file: str = input("digite o nome do arquivo json (sem .json no final)") name_product: str = input("Digite o nome do produto ") with open(f'{name_file}.json', 'r') as f: ...
ExcalDex/ScraperKabum
Indexer.py
Indexer.py
py
543
python
en
code
0
github-code
90
73559543015
"""colvacor URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Cl...
mikeberdugo/colvacor
colvacor/urls.py
urls.py
py
2,664
python
es
code
0
github-code
90
40618545064
#_*_coding:utf-8_*_ ''' 题目 121 买卖股票的最佳时机 给定一个数组,它的第i个元素是一支给定股票第i天的价格 如果你最多只允许完成一笔交易(即买入和卖出一支股票一次),设计 一个算法来计算你所能获得的最大利润。 注意:你不能再买入股票前卖出股票 示例 1: 输入: [7,1,5,3,6,4] 输出: 5 解释: 在第 2 天(股票价格 = 1)的时候买入,在第 5 天(股票价格 = 6)的时候卖出,最大利润 = 6-1 = 5 。 注意利润不能是 7-1 = 6, 因为卖出价格需要大于买入价格;同时,你不能在买入前卖出股票。 示例 2: 输入: ...
LeBron-Jian/BasicAlgorithmPractice
LeetCode_practice/DynamicProgramming/0121.BestTimeToBuyAndSellStock_1.py
0121.BestTimeToBuyAndSellStock_1.py
py
2,609
python
zh
code
12
github-code
90
74092838695
import os import numpy as np from numpy import inf import tensorflow as tf from tensorflow.keras import Model from tensorflow.keras import Input from tensorflow.keras.layers import Dense from tensorflow.keras.layers import Conv1D, Conv2D, Conv3D from tensorflow.keras.layers import Conv1DTranspose, Conv2DTranspose, Con...
cwentland0/ae_rom_training
ae_rom_training/ml_library/tfkeras/tfkeras_library.py
tfkeras_library.py
py
32,895
python
en
code
3
github-code
90
32346894589
from tkinter import * from tkinter import ttk from tkinter import messagebox from tkinter import filedialog class Application: def __init__(self, master=None): pass window = Tk() Application(window) window.title('WebDev Tech Talks') window.resizable(0,0) window.geometry('1080x600') # - - - - - - - GUI -...
lisboaab/AED-refaz-exs
testes anteriores/40220003_Talks.py
40220003_Talks.py
py
4,076
python
pt
code
0
github-code
90
20560105526
import tensorflow as tf class MaxPoolingLayer(object): @staticmethod def feed_input(input_tensor, stride): _, shape_x, _ = input_tensor.shape return tf.map_fn(lambda inp: tf.convert_to_tensor([[tf.reduce_max(MaxPoolingLayer .__get_input_slice__(inp, x, y, stride)) ...
awoods12/Sketch_It
src/network/MaxPoolingLayer.py
MaxPoolingLayer.py
py
652
python
en
code
0
github-code
90
18216303229
def modpow(a,n,m): res=1 while n>0: if n&1:res=res*a%m a=a*a%m n//=2 return res class mod_comb_k(): def __init__(self, MAX_N = 10**6, mod = 10**9+7): self.fact = [1] self.fact_inv = [0] * (MAX_N + 4) self.mod = mod #if MAX_N > mod:print('MAX_N > mod !') for i in range(MAX_N + 3):...
Aasthaengg/IBMdataset
Python_codes/p02685/s448960177.py
s448960177.py
py
887
python
en
code
0
github-code
90
32728237215
#coding:utf8 import code a = 1 b = "hello" # 新建一个终端 加载定义好的变量 # 参数 # banner 进入终端时打印出的提示信息 # readfunc 终端接收命令的函数 默认为 raw_input # local 终端作用域 code.interact(banner="code.interact session", readfunc=None, local=locals()) # class InteractiveInterpreter # 控制代码交互执行 # class InteractiveConsole # 控制台输出样式定义
dytttf/python_modules_test
test_code.py
test_code.py
py
427
python
zh
code
1
github-code
90
28105437092
""" CS 542: Machine Learning Final Project: Face Detection and Recongnition Part 1: Image Processing to Pattern through LBPH Algorithm. """ import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np class Image: def __init__(self): self.IMG_LEN = 0 self.IMG_...
frankduyu/ML-Project
LBPH.py
LBPH.py
py
2,345
python
en
code
1
github-code
90
34014323448
import json import requests import time from datetime import datetime import smtplib # Known scammers I don't want to list blacklist = ['GemsBitcoins', 'TechnoTrade'] while True: r = requests.get("https://localbitcoins.com/sell-bitcoins-online/US/united-states/ebay-gift-card-code/.json") data = r.json() ...
danielfain/lbtcscraper
localbitcoinstool.py
localbitcoinstool.py
py
1,119
python
en
code
0
github-code
90
14526099204
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Functions that work on images. The matplotlib functionality is purely for debugging puproses. """ from __future__ import print_function from __future__ import division from PySide import QtCore, QtGui import copy, logging import numpy as np import matplotlib.im...
titusjan/pymona
libimg.py
libimg.py
py
10,997
python
en
code
0
github-code
90
23651268002
import functools from addBigNumbers import addBigNumbers def multiplyBigNumbers(a,b): longerNumber, shorterNumber = "0", "0" if len(a) > len(b): longerNumber = a shorterNumber = b else: longerNumber = b shorterNumber = a shorterNumberLength = len(shorterNumber) longe...
hellyab/CompetitiveProgramming
week-1/multiplyBigNumbers.py
multiplyBigNumbers.py
py
1,227
python
en
code
0
github-code
90
10129399186
from mltoolkit.mldp.steps.transformers import BaseTransformer import numpy as np from mltoolkit.mlutils.helpers.general import listify class SeqWrapper(BaseTransformer): """ Wraps each sequence with single start and end elements. Those are useful as indicators of segment/sentence beginning and ending for ...
abrazinskas/Copycat-abstractive-opinion-summarizer
mltoolkit/mldp/steps/transformers/nlp/seq_wrapper.py
seq_wrapper.py
py
2,700
python
en
code
98
github-code
90
12476085244
import pygame as pg vec = pg.math.Vector2 #defining colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255,255,0) ORANGE = (255, 98, 0) #game settings WIDTH = 1024 HEIGHT = 768 FPS = 60 TITLE = "Get to the Bottom" TILESIZE = 16 GRIDWIDTH = WIDTH / TI...
Owen1225/introToProgrammingFinalProject
settings.py
settings.py
py
401
python
en
code
0
github-code
90
35603446326
import sys import os from pathlib import Path from pprint import pprint from datetime import datetime, timedelta from airflow.configuration import conf as airflow_conf from airflow.operators.python import PythonOperator from airflow.exceptions import AirflowException import utils from utils import ( localized_ass...
hubmapconsortium/ingest-pipeline
src/ingest-pipeline/airflow/dags/validation_test.py
validation_test.py
py
4,944
python
en
code
5
github-code
90
34514604197
from django.conf.urls import patterns, url, include from rest_framework import routers from . import views router = routers.DefaultRouter() router.register(r"diagnosis", views.DiagnosisViewSet, base_name="diagnosis") router.register(r"category", views.CategoryViewSet) router.register(r"case", views.CaseViewSet) route...
ministryofjustice/cla_backend
cla_backend/apps/checker/urls.py
urls.py
py
644
python
en
code
5
github-code
90
23816503937
import uuid import pytest from globus_sdk.tokenstorage import SQLiteAdapter def _add_namespace_to_test_storage(storage, namespace, token_data): alt_storage = SQLiteAdapter(":memory:", namespace=namespace) alt_storage._connection = storage._connection alt_storage.store(token_data) @pytest.fixture def du...
globus/globus-cli
tests/functional/test_cli_profile_list.py
test_cli_profile_list.py
py
3,143
python
en
code
67
github-code
90
74392711017
__author__ = 'DanielClarkJR' import pylab as plt import numpy as np import scipy.integrate as sp # dfasdf jlfdsasdf LAMBDA = 1 A = 1 def RHS(u = np.asarray([1,2]), Lambda=0, a=1): Udot1 = u[1, :] Udot2 = -u[0, :] + (Lambda/(a-u[0, :])) return Udot1, Udot2 # plotting information numx = 10 numv = 10 u1all =...
Clark333/InclassHW
MAIN.py
MAIN.py
py
2,080
python
en
code
0
github-code
90
18331741889
N = int(input()) L = list(map(int, input().split())) L = sorted(L) import bisect count = 0 for i in range (0, len(L)-2): for j in range (i+1, len(L)-1): count+= bisect.bisect_left(L[j+1:], L[i]+L[j]) print(count)
Aasthaengg/IBMdataset
Python_codes/p02888/s474838417.py
s474838417.py
py
219
python
en
code
0
github-code
90
7496523955
# Importar librerias from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.db.models import fields from django.forms import widgets # Importar el modelo de dato: from .models import PerfilUsuario # Formulario para el perfil de usuario: c...
viewEder/tienda-django
registration/forms.py
forms.py
py
1,442
python
es
code
1
github-code
90
5478483261
# Brian's Brain in Pygame # Code not written by me, I just made it brian's brain. # 0 = Dead cell # 1 = Wire # 2 = Header # 3 = Tail # A - Run simulation # S - Advance 1 frame import sys import pygame import random YELLOW = (255, 255, 0) RED = (255, 0, 0) BLUE = (30, 144, 255) BLACK = (0, 0, 0...
Wesius/Cellular-Automata
wireWorld.py
wireWorld.py
py
3,734
python
en
code
0
github-code
90
43449280556
import pandas as pd def pre_pro_build_word_vocab(sentence_iterator, word_count_threshold=1): """ Pre -process and build vocab, word_to_id and id_to_word dictionaries function from Andre Karpathy's NeuralTalk :param sentence_iterator: :param word_count_threshold: :return: """ print('Pre-pro...
sandareka/FLEX
utils.py
utils.py
py
1,266
python
en
code
2
github-code
90
40772528731
# Task 1 # First 20 fibonacci numbers # Define function def fib(a): # Stops parameter from being less than 1 if a <= 1: return a else: # Fibonacci calculation return fib(a - 1) + fib(a - 2) # Range to allow loop 20 times for i in range(20): print(str(fib(i)), end=" ")
Jason-Cee/Python-Recursion
Task.py
Task.py
py
312
python
en
code
0
github-code
90
18575719509
import sys def solve(): readline = sys.stdin.buffer.readline mod = 10 ** 9 + 7 n, a, b = list(map(int, readline().split())) print("Alice" if abs(a - b) % 2 == 0 else "Borys") if __name__ == '__main__': solve()
Aasthaengg/IBMdataset
Python_codes/p03463/s851455677.py
s851455677.py
py
234
python
en
code
0
github-code
90
71944572138
# dependencies from flask import Flask, jsonify, render_template from sqlalchemy import create_engine, desc from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session # Flask set up app = Flask(__name__) engine = create_engine("sqlite:///DataSets/belly_button_biodiversity.sqlite", echo=False)...
anjali-krishna/Bellybutton_biodiversity
app.py
app.py
py
2,785
python
en
code
0
github-code
90
807250002
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/1/28 10:36 # @Author : Fred Yang # @File : application.py # @Role : 定制Application from shortuuid import uuid from tornado import httpserver, ioloop from tornado import options as tnd_options from tornado.options import options, define fr...
yanghongfei/message_board
libs/application.py
application.py
py
1,847
python
en
code
2
github-code
90
5573365098
import cv2 import numpy as np from keras.models import load_model from os import path emotion_model = load_model("models/cnn_fed_model") cv2.ocl.setUseOpenCL(False) emotion_dict = {0: "Angry", 1: "Disgusted", 2: "Fearful", 3: "Happy", 4: "Neutral", 5: "Sad", 6: "Surprised"} cap = cv2.VideoCapture(0) cv2_base_dir = pa...
EagleEye1107/cnn-facial-emotions-recognition-project
src/cnn_model_testing.py
cnn_model_testing.py
py
1,544
python
en
code
0
github-code
90
28948924326
""" Módulo con funciones utilizable para el filtrado de cheques. """ import time import datetime import csv HEADER = [ "NroCheque", "CodigoBanco", "CodigoSucursal", "NumeroCuentaOrigen", "NumeroCuentaDestino", "Valor", "FechaOrigen", "FechaPago", "DNI", "Tipo", ...
Mateo-Ozino/ITBANK
python/procesamiento_cheques/biblioteca_filtrado.py
biblioteca_filtrado.py
py
3,824
python
es
code
0
github-code
90
39433933694
import sqlite3 connection = sqlite3.connect('database.db') cursor = connection.cursor() slots = [ ('Slot01','10:00 - 11:00'), ('Slot02','11:00 - 12:00'), ('Slot03','12:00 - 13:00'), ('Slot04','13:00 - 14:00'), ('Slot05','14:00 - 15:00'), ('Slot06','15:00 - 16:00'), ('Slot07','16:00 - 17:00'), ('Slot08','17:00 - 18:00...
soumyasouravpatnaik/saloon
create_tables.py
create_tables.py
py
1,993
python
en
code
0
github-code
90
22446384563
import numpy as np import disparity.sgm_cost_path as scp # semi global matching import pdb __all__ = ['sgm', 'consistency_check', 'uniqueness_check'] def _gen_starting_points(h, w): # the starting points are the border pixels # in python 3, zip returns a builtin, convert to list s0 = list(zip(range(...
freerafiki/PlenopticToolbox2.0
python/disparity/sgm.py
sgm.py
py
7,644
python
en
code
61
github-code
90