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
20246347128
#A '''import sys import math N,M,a,K=map(int, sys.stdin.readline().split()) print(min(N-1,a-K)+1, math.ceil((a-K)/M)+1)''' #B '''import sys N=int(sys.stdin.readline()) a=[] answer=0 for _ in range(N): aa,bb=map(int, sys.stdin.readline().split()) a.append(aa) answer+=bb a.sort() for i in range(1,N+1): ...
jhan-04/Test
baekjoon/Untitled-1.py
Untitled-1.py
py
886
python
en
code
0
github-code
1
20741454900
import json import re import logging from __init__ import app def extract_dispatch_content(text): pattern = r'R9\.redux\.dispatch\((\{.+?\})\)' matches = re.findall(pattern, text, flags=re.DOTALL) return matches def add_quotes(json_str): # Agregar comillas a las claves de primer nivel regex_keys =...
danielurrutxua/easyflight
scrapi/app/search/service/sources/utils/kayak_parser.py
kayak_parser.py
py
1,665
python
es
code
1
github-code
1
34623651816
# -*- coding: utf-8 -*- # + import argparse import datetime import random import time import pandas as pd from pathlib import Path import torch import torchvision.transforms as standard_transforms import numpy as np from PIL import Image import cv2 from crowd_datasets import build_dataset from engine import * from mo...
kookmin-sw/capstone-2023-26
headcount/CrowdCounting_P2PNet/run_test_stream.py
run_test_stream.py
py
4,511
python
en
code
7
github-code
1
29640416232
import datatable as dt import pytest import random import re from datatable import stype, f from datatable.internal import frame_integrity_check from tests import noop, random_string, assert_equals def test_issue_1912(): # Check that the expression `A==None` works if A is a string column DT = dt.Frame(A=["dfv...
h2oai/datatable
tests/munging/test-str.py
test-str.py
py
6,248
python
en
code
1,763
github-code
1
11196328840
import numpy as np from scipy import interpolate class SkeletonASCIIPhraser(object): def __init__(self, export_path): self.__export_path = export_path def save(self, beams): file = open(self.__export_path, 'w') self.__plot_analytical_skeleton_beams(file, beams) file...
Foxelmanian/ParametrizationSkeleton
SkeletonASCIIPhraser.py
SkeletonASCIIPhraser.py
py
11,419
python
en
code
0
github-code
1
26904524656
h, w = map(int, input().split()) n_guards = 0 lst = [] for k in range(h): lst.append(list(input())) ww = 0 for i in range(h): checka = True checkb = True for j in range(w): if lst[i][j] == 'X': checka = False if lst[j][i] == 'X': checkb = False if (checka and...
habaekk/Algorithm
boj/xx_1236.py
xx_1236.py
py
699
python
en
code
0
github-code
1
16616864622
from simpleimage import SimpleImage """ This program highlights fires in an image by identifying pixels whose red intensity is more than INTENSITY_THRESHOLD times the average of the red, green, and blue values at a pixel. Those "sufficiently red" pixels are then highlighted in the image and other pixels are tur...
gxgarciat/Playground-CiP-py
1_Assigments/3_Q2_ForestFlames.py
3_Q2_ForestFlames.py
py
3,579
python
en
code
0
github-code
1
2715638565
import os,glob from Bio import SeqIO import statistics import numpy as np from Bio.Seq import Seq import re vcf_folder = '/scratch/users/anniz44/genomes/donor_species/vcf_round2/merge/details/' output_folder = '/scratch/users/anniz44/genomes/donor_species/vcf_round2/BS/' target_TF = '%s/target.TF.faa'%(output_folder) ...
caozhichongchong/snp_finder
snp_finder/scripts/compareBS_coassembly.py
compareBS_coassembly.py
py
28,977
python
en
code
2
github-code
1
32184257693
import sys import asyncio from aioconsole import ainput async def input_loop(loop): while True: input_ = await ainput(loop=loop) if input_ == "@end": sys.exit(0) print(f"Echo: {input_}") if __name__ == "__main__": loop = asyncio.get_event_loop() loop.run_until_complete(...
metamarcdw/async-interface
test.py
test.py
py
338
python
en
code
0
github-code
1
44344599062
import unittest from libs.model import MonthClosings class MyTestCase(unittest.TestCase): def test_closing_performance(self): #given: closings = MonthClosings() closings.closings = [100, 100, 105] #when: performance = closings.calculate_performance() #then: ...
dhering/stock-scoring
tests/model/test_MonthClosings.py
test_MonthClosings.py
py
503
python
en
code
4
github-code
1
24893300426
# -*- coding: utf-8 -*- import scrapy from scrapy import Request from lxml import etree from WaiBaoSpider.utils.csvWriter import CSVDumper from WaiBaoSpider.utils.base import unicode_body, deal_ntr import os class LuAnSpider(scrapy.Spider): name = "luan" # base_url = "http://www.luan.gov.cn/nocache/supervisio...
jamesfyp/WaiBaoSpider
WaiBaoSpider/spiders/liuan.py
liuan.py
py
7,327
python
en
code
1
github-code
1
29341535711
import cv2 import numpy as np img = cv2.imread('/home/kanish/Documents/ICR advanced forms/Advanced handwritting samples/athul_scanned/525/525_2.png', 0) kernel = np.ones((5, 1), np.uint8) erosion = cv2.erode(img, kernel, iterations=1) cv2.imwrite('morphex.png', erosion) cv2.imshow('gray', erosion) cv2.waitKey(0)
kanishmathew777/image_processing
backend/image_processing_backend/scipy_width_path_finder/image_preprocessing/denosing.py
denosing.py
py
318
python
en
code
0
github-code
1
32601137836
#!/usr/bin/python3 from typing import List import json from bplib.butil import TreeNode, arr2TreeNode, btreeconnect class Solution: def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: st = {} for n in nums1: if n not in st: st[n] = 0 st[n]...
negibokken/sandbox
leetcode/350_intersection_of_two_arrays_II/main.py
main.py
py
588
python
en
code
0
github-code
1
29455061606
import pygame import field_and_pointer as fp import argparser as ap # Stack, field, pointer and the 2-input operators stackstack = [[]] the_field = fp.Field(fp.load_code()) pointer = fp.Pointer((0, 0), (1, 0)) operators = { "+": lambda x1, x2: stackstack[-1].append(x1 + x2), "-": lambda x1, x2: stackstack[-1]....
johanasplund/befunge-98
lib/initialize.py
initialize.py
py
2,188
python
en
code
1
github-code
1
8202759653
import requests from bs4 import BeautifulSoup as soup def requesting_ip(): HEADERS = { 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', #'Accept-Encoding':'gzip, deflate, br', 'Accept-Language':'en-US,en;q=0.5', 'Connection':'keep-alive', 'Upgrad...
DemolitionLovers/PythonCode
Requests-DDG.py
Requests-DDG.py
py
1,134
python
en
code
0
github-code
1
8595088170
import hashlib import zlib from PyQt5 import QtCore, QtGui, QtWidgets from file_browse import * data=[ {'Check':'','More':'','Details':'','@timestamp':'2023/03/12 12:00:00','Rule':'Enumeration of users or Groups','Severity':'low','Risk Score':'21','Reason':'process event with process dsmemberutil, parent proce...
marioara-biblioteca/IOC
file_scan.py
file_scan.py
py
5,566
python
en
code
0
github-code
1
28418620847
import nibabel as nib import matplotlib.pyplot as plt #import cv2 import os # https://www.kaggle.com/kmader/show-3d-nifti-images import numpy as np import tqdm as tqdm data_path = '../dataset/wonjun_processing/imagesTr' label_path = '../dataset/wonjun_processing/labelsTr' data_file_list = sorted(os.listdir(data_path))...
WonJunPark/unetr_custom_code
data_preprocessing2.py
data_preprocessing2.py
py
1,292
python
en
code
2
github-code
1
26021338569
from django.conf.urls.defaults import * from django.conf import settings from django.contrib import admin from seishinkan.website.feeds import NewsFeed, TerminFeed admin.autodiscover() feeds = { 'termine': TerminFeed, 'news': NewsFeed, } urlpatterns = patterns('', (r'^i18n/', include('django.conf.urls.i18n')...
marcusti/seishinkan
urls.py
urls.py
py
2,423
python
en
code
0
github-code
1
7807302748
# importing Numpy package import numpy as np # To declare symbol variables x and y from sympy import symbols # You can't use numpy arrays for symbolical calculations with sympy. Instead, use a sympy Matrix # (https://stackoverflow.com/questions/68589864/matrix-determinant-symbolic-in-python) import sympy as sp...
Sergio-Ibarra-1795/Python-self-1
Primer_semestre/Mate/Determinant.py
Determinant.py
py
1,173
python
en
code
0
github-code
1
191560534
import numpy from chainer import cuda from chainer import optimizer class RMSpropGraves(optimizer.Optimizer): """Alex Graves's RMSprop. See http://arxiv.org/abs/1308.0850 """ def __init__(self, lr=1e-4, alpha=0.95, momentum=0.9, eps=1e-4): # Default parameter values are the ones in the ori...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/jamieoglindsey0@chainer/chainer/optimizers/rmsprop_graves.py
rmsprop_graves.py
py
1,771
python
en
code
2
github-code
1
38901553531
import os import traceback from prefect import flow from conf.config import DATA_DIR, DATASET_EXCEL_LINKS from src.utils import write_local_to_parquet from src.flows.pipeline_components import ingest_data_from_list_files, load_csv_dataset, save_dataset_to_csv, upload_to_gcs_bucket, write_data_google_bq @flow(name="en...
lironesamoun/data-engineering-capstone-project
src/flows/parameterized_flow_http_pipeline.py
parameterized_flow_http_pipeline.py
py
2,406
python
en
code
0
github-code
1
74356016992
# importint the necessary lirbraries # import tensorflow.keras as kerasfrom __future__ import print_function from __future__ import print_function import keras from keras.layers import Convolution2D from keras.layers import Flatten from keras.layers import Dense from keras.layers import Dropout from keras.layers impo...
Tobenna-KA/mimeai-api
api/src/capsule_net.py
capsule_net.py
py
15,008
python
en
code
0
github-code
1
35601265161
from extract_words import extract_words import gi gi.require_version('Gtk', '3.0') gi.require_version('WebKit', '3.0') from gi.repository import Gtk, Gdk, WebKit class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title='My Window Title') self.AUTHEN_CODE = None # authent...
qzhqzh/EnglishReadingCompanion
src-python/GUI.py
GUI.py
py
10,726
python
en
code
0
github-code
1
1490074469
import re data = input() pattern = r"^>{2}(?P<product>\w+)<<(?P<price>\d+(\.\d+)?)\!(?P<quantity>\d+)($|\s)" product = [] total_price = 0 while not data == "Purchase": match = re.match(pattern, data) if match: obj = match.groupdict() product.append(obj["product"]) total_price += floa...
DavidStoilkovski/python-fundamentals
regular-expressions-fundamentals/furniture.py
furniture.py
py
488
python
en
code
0
github-code
1
20962583832
from pyspark.sql import SparkSession from pyspark.sql import S Logger.getLogger("org").setLevel(Level.ERROR) sparkConf = newSparkConf() sparkConf.set("spark.app.name", "My Application 1") sparkConf.set("spark.master", "local[2]") spark = SparkSession.builder()\ .config(sparkConf)\ .getOrCreate() DDLString =...
Nishant-001/BigData_PySpark
week11assignment.py
week11assignment.py
py
750
python
en
code
0
github-code
1
22377846455
from django import http from django.http.response import Http404, HttpResponseForbidden from rest_framework import viewsets, mixins, status from rest_framework.response import Response from rest_framework.decorators import action, api_view, permission_classes from django.shortcuts import get_object_or_404 from .model...
insper-education/devlife-support-api
core/views.py
views.py
py
8,481
python
en
code
0
github-code
1
36287026868
import tkinter import time from AlgorithmSimulator.config import general_setting from AlgorithmSimulator.model import sort class View(): def __init__(self, master): 'UI関連のオブジェクト生成' # 各種設定 self.drawn_obj = [] # キャンバスのサイズを決定 self.canvas_width = general_setting.CANVAS_WIDTH ...
cayk326/AlgorithmSimulator
view/main_view.py
main_view.py
py
7,337
python
ja
code
0
github-code
1
34523979340
# Line requirements: # Apply Google CLI Syntax for required and optional args # https://developers.google.com/style/code-syntax import os import re current_dir = os.path.dirname(os.path.realpath(__file__)) # os.chdir(current_dir) IGNORE_VARIABLES = ["flags"] # [flags] def _replace_array(line: str): ''' Con...
notional-labs/chain-chores
Conversion.py
Conversion.py
py
1,895
python
en
code
4
github-code
1
23051368660
#Faça um programa para a leitura de duas notas parciais de um aluno. O programa deve calcular a média alcançada por aluno e apresentar: #A mensagem "Aprovado", se a média alcançada for maior ou igual a sete; #A mensagem "Reprovado", se a média for menor do que sete; #A mensagem "Aprovado com Distinção", se a média for ...
ruirodriguessjr/Python
EstruturaDecisão/ex5AprovadoReprovado.py
ex5AprovadoReprovado.py
py
725
python
pt
code
0
github-code
1
32942262031
import datetime import json import os import random import string import sys import time import urllib.request os.system("title WARP-PLUS-CLOUDFLARE By Tran Thai Tuan Anh") os.system('cls' if os.name == 'nt' else 'clear') print ("[+] About script: With this script, you can getting unlimited GB on Warp+") print ("[+] T...
tranthaituananh/mini_projects
buffKey_1111.py
buffKey_1111.py
py
2,770
python
en
code
1
github-code
1
20599371961
from flask import Flask, request app = Flask(__name__) @app.route('/02-server') def server01_views(): return "This is my first response by Ajax" @app.route('/03-server') def server03_views(): uname = request.args['uname'] return "欢迎" + uname if __name__ == '__main__': app.run(debug=True)
demo112/1809
PythonWeb/Ajax/1809/Day01/1809self/run01.py
run01.py
py
316
python
en
code
0
github-code
1
24946960553
from selenium import webdriver from time import sleep from selenium.webdriver import Keys from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By chrome_options = Options() chrome_options.add_argument("--headless") # Chạy trình duyệt ẩn danh browser = webdriver.Chrome() bro...
Namgiangvt12/Upwork
50.0478-multithread.py
50.0478-multithread.py
py
911
python
en
code
0
github-code
1
29430526212
#Import Libs import time import click import mouse import keyboard import pyautogui def inicialize(): print(''' ========================================================================= || Configure according to screen size: || || Configurar de acordo com o tamanh...
Alissonfersoa/bombcrypto-bot
bot.py
bot.py
py
3,666
python
en
code
0
github-code
1
14282958757
import serial import numpy as np import matplotlib.pyplot as plt # シリアルポートの設定(必要に応じて変更) ser = serial.Serial('/dev/ttyACM0', 115200) # グラフの初期化 fig, ax = plt.subplots() x_data, y_data = [], [] line, = ax.plot(x_data, y_data, 'o', markersize=6) # 3秒間のデータを保持するためのリングバッファ max_data_points = 300 # 1秒あたり100データ点...
Altairu/raspberrypi
python/PCaruduino2.py
PCaruduino2.py
py
1,149
python
ja
code
0
github-code
1
21642185259
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import pickle # In[2]: train=pd.read_csv('sales_train.csv') items=pd.read_csv('items.csv') shops=pd.read_csv('shops.csv') cats=pd.read_csv('item_categories.csv') # In[3]:...
rishabhagarwal8979/Predicting-Future-Sales-Web-API
model.py
model.py
py
7,422
python
en
code
0
github-code
1
40420378554
from pathlib import Path import numpy as np from collections import Counter from itertools import product DIRECTIONS = ("up", "down", "left", "right") ROTATIONS = (0, 90, 180, 270) def get_tile_borders(tile, dir="all"): borders = [] border = None for d in DIRECTIONS: if dir in [d, "all"]: ...
eirikhoe/advent-of-code
2020/20/sol.py
sol.py
py
8,548
python
en
code
0
github-code
1
31539109692
def min_max(): print("Ingresa los numeros que quieras, cuando termines escribe 'fin'") lista = [] while True: numero = input("Ingresa un numero: ") if numero == "fin": break else: lista.append(int(numero)) print("valores introducidos") print(lista) ...
borolasgamer/ProyectoParcial2
MinMaxValor.py
MinMaxValor.py
py
410
python
es
code
0
github-code
1
40938120333
# This defines the model import torch.nn as nn from torchvision import models import torch.nn as nn import torch class MyEnsemble(nn.Module): def __init__(self, modelA, modelB, input): super(MyEnsemble, self).__init__() self.modelA = modelA self.modelB = modelB self.fc1 = nn.Li...
agossouema2011/WCEBleedGenChallenge_Colorlab_Team
Classification/model.py
model.py
py
1,124
python
en
code
0
github-code
1
40880454626
# -*- coding: utf-8 -*- n = int(input()) emails = set() for i in range(n): email = input() user, provider = email.split('@') if('+' in user): user, dump = email.split('+') user = user.replace('.', '') email = user + '@' + provider emails.add(email) print(len(emails))
andrefakhoury/competitive-programming
problems/solutions/Brazilian Summer School/Summer School 2019/Dia 1/D.py
D.py
py
287
python
en
code
7
github-code
1
25449310072
from django.shortcuts import render from .models import AreaOfExpertise, Expert def browser(request): aoe = AreaOfExpertise.objects.all().order_by('field') experts = Expert.objects.all() institutes = set() for expert in experts: institutes.add(expert.institute) if expert.institute is not No...
ztimson/OACPL
expert_witnesses/views.py
views.py
py
1,066
python
en
code
0
github-code
1
3121199006
import math print("Enter the time of year you were born") year_time = input(">>> ") print("Enter x") x = int(input(">>> ")) year_time = year_time.lower() if year_time == "winter": y = ((math.sin(x) + 23 * x) ** 4) / (math.sqrt(abs(x) ** x - 3)) y = round(y, 2) print(y) elif year_time == "spring": y = (...
Weit1sh/math
src/01_math.py
01_math.py
py
752
python
en
code
0
github-code
1
25607810331
ms="the quick brown fox over lazy dog.the dog slept over a varandah" ss="over" i=0 k=" " s=ms.split() while i<len(s): if s[i]==ss: k=k+" on" else: k=k+" "+s[i] i+=1 print(k)
Subhkirti/PYTHON
LISTS/remove substring.py
remove substring.py
py
201
python
en
code
0
github-code
1
29640359742
import math import pytest from datatable import f, dt, update from tests import assert_equals stypes_int = dt.ltype.int.stypes stypes_float = dt.ltype.real.stypes stypes_str = dt.ltype.str.stypes stypes_all = [dt.bool8, dt.obj64] + stypes_int + stypes_float + stypes_str #--------------------------------------------...
h2oai/datatable
tests/ijby/test-assign-scalar.py
test-assign-scalar.py
py
9,236
python
en
code
1,763
github-code
1
72537165153
""" Created on 03.12.2020 :author: Ilya Krasnokutskiy converting codewords to Newick format :functions: add_brackets add_commas codewords_conversion """ def add_brackets(code_words: list, code_chars: list) -> str: ''' Перевод кодовых слов в скобочную последовательность (The Newick format). Д...
IDeltaT/ShannonCoding
ShannonСoding/codewordsconv.py
codewordsconv.py
py
4,146
python
ru
code
0
github-code
1
19494187982
#================================================================================================= # Assignment: 1 Long assignment 2 # Author: Feiran Yang # # Course: CSc 120 # Instructor: Saumya Debray # # Description: This program will read two user input as grid size and random number see...
moyuwangP/CSc120
1/long/word-grid.py
word-grid.py
py
2,459
python
en
code
0
github-code
1
2997714658
# -*- coding: utf-8 -*- import requests import os # 6000 is a large number to make sure we get all the components of a collection. Please do note that RISE also has a pagination feature, # which can be implemented by clients if they wish. per_page = 6000 # getting the list of collections that the user has access to: ...
RISE-MPIWG/hylg
FetchTextFromRISE.py
FetchTextFromRISE.py
py
2,253
python
en
code
1
github-code
1
23244688379
# import cv2 # import glob # import numpy as np def bbox_for_deepsort(*x1y1x2y2): ''' return bbox info for deep_sort :param x1y1x2y2: (tensor(), tensor(), tensor(), tensor()) :return: (center_x, center_y, bbox_width, bbox_height) ''' x1, y1, x2, y2 = \ x1y1x2y2[0].item(), x1y1x2y2[1]....
unique-chan/Pedestrian-Counting
util.py
util.py
py
4,027
python
en
code
1
github-code
1
37683131562
# Python Project 1: Sudoku Solver # Started 8/8/2021 # Finished 8/11/2021 # Status: Completed # ----------------------------------------------------- # Purpose of Project/Learning Goals: # -Understand Recursion # -Understand Backtracking # -Python Syntax (transitioning from C++) # -----------------------...
arabellesarreal/SudokuAutoSolver
sudokuSolver.py
sudokuSolver.py
py
2,676
python
en
code
0
github-code
1
44587979411
"""Control module for the Vapourtec R4 heater.""" from __future__ import annotations from collections import namedtuple from collections.abc import Iterable import aioserial import pint from loguru import logger from flowchem import ureg from flowchem.components.device_info import DeviceInfo from flowchem.components...
cambiegroup/flowchem
src/flowchem/devices/vapourtec/r4_heater.py
r4_heater.py
py
6,914
python
en
code
11
github-code
1
43652346391
from os import name from django.urls import path #from .views import HomePageView from . import views urlpatterns = [ path('',views.teacher_index,name='teacher'), # Homepag path('<slug:teacher_id>/<int:choice>/Classes/', views.teacher_home, name="teacher_home"), #Student Batches path('<slug:classid>/Students...
abidgulshahid/Department-Managment-System
teacher/urls.py
urls.py
py
1,885
python
en
code
1
github-code
1
20418665838
import tensorflow as tf # Softmax Regression Model # Multilayer Convolutional Network # batch_size=128 def convolutional(image_holder): def variable_with_weight_loss(shape, stddev): var = tf.Variable(tf.truncated_normal(shape, stddev=stddev)) return var weight1 = variable_with_weight_loss(shap...
WilliamWang1994/car-recognition
model.py
model.py
py
2,279
python
en
code
0
github-code
1
25500941930
from fastapi import HTTPException, status from odmantic.bson import ObjectId from typing import List # Import helpers from helpers.database import db # Import Models from models.currency import Currency async def currency_exists(cid: ObjectId, loc=None): if loc is None: loc = [] loc = ['body'] + loc...
arif-sajal/mondol-int-accounts-backend
validators/form/currencyExists.py
currencyExists.py
py
1,453
python
en
code
0
github-code
1
38773818788
from os import path from tIGAr.timeIntegration import * from PENGoLINS.occ_preprocessing import * from PENGoLINS.nonmatching_coupling import * parameters["std_out_all_processes"] = False SAVE_PATH = "./" class SplineBC(object): """ Setting Dirichlet boundary condition to tIGAr spline generator. """ d...
hanzhao2020/PENGoLINS
demos/bicuspid-valve/bicuspid_structural_dynamic.py
bicuspid_structural_dynamic.py
py
8,478
python
en
code
15
github-code
1
3275424876
from typing import List from PyQt5 import QtGui import networkx as nx from commandbar.api import cmdutils from commandbar.commands.cmdexc import PrerequisitesError from commandbar.utils import objreg from mainwindow.graph_view import GraphView from mainwindow.mainwindow import MainWindow from tree_covers.pygraph.metric...
yairmol/graphui
commands/stretch.py
stretch.py
py
3,000
python
en
code
0
github-code
1
7735829542
#!/usr/bin/env python # vim: set expandtab tabstop=4 shiftwidth=4: import struct from ftexplorer.data import Data data = Data('BL2') #bpd = data.get_struct_by_full_object('GD_ButtStallion_Proto.Character.AIDef_ButtStallion_Proto:AIBehaviorProviderDefinition_1') bpd = data.get_struct_by_full_object('gd_slotmachine.Sl...
apocalyptech/ft-explorer
sandbox/linkids.py
linkids.py
py
1,556
python
en
code
4
github-code
1
28013600994
import citations as cit import json from flask import Flask, request from flask_cors import CORS app = Flask(__name__) cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) years = [ 2015, 2016, 2017, 2018, 2019 ] class_names = [ "-", "A", "B", "C", "D", "E", ] sectors = [ "MAT01", ...
robol/citation-count
citationserver.py
citationserver.py
py
2,855
python
en
code
0
github-code
1
26385311712
import numpy as np # from sklearn.metrics import accuracy_score from sortedcontainers import SortedList import math import matplotlib.pyplot as plt class ml_model(object): """ Parameters ------------ method : str which ML lib learning_rate : float (default: 0.01) Learning rate (be...
u8913557/myDataScience
Model/ml_model.py
ml_model.py
py
21,075
python
en
code
0
github-code
1
24925249732
# -*- coding: utf-8 -*- import json import os from locale import getdefaultlocale from .internationalization import SUPPORTED_LANGUAGES _lang = getdefaultlocale()[0] for _supported_lang in SUPPORTED_LANGUAGES.keys(): if _lang in _supported_lang or _supported_lang in _lang: _lang = _supported_lang ...
Sa-RSt/WordByWord
wordbyword/settings.py
settings.py
py
1,265
python
en
code
0
github-code
1
3874579333
#! py -2 from krldriver import * def take(): PTP(POS,"","",-857) GRIPPER_CLOSE() PTP(POS,"","",-757) def drop(): PTP(POS,"","",-857) GRIPPER_OPEN() PTP(POS,"","",-757) def p(n): if n == 1: PTP(POS,-80,-125,-757) if n == 2: PTP(POS,-80,50,-757) if n == 3: PTP(POS,90,50,-757) if n == 4: PTP(POS,90,-125,-757)...
mnourgwad/zuka
codes/krl-driver/example.py
example.py
py
2,377
python
en
code
9
github-code
1
6853539137
""" Wrapper for accessing AWS credentials. NOTE: DO NOT CHECK PASSWORD INFO INTO ANY GITHUB REPOS. All credential information must be stored in a secure location. CREDENTIAL FILE FORMAT: key = value """ import os CREDENTIAL_DIR = "keys" def read(credential_name: str, directory: str = CREDENTIAL_DIR) -> dict: ...
akikoiwamizu/ai-exercise
utils/credential_manager_utils.py
credential_manager_utils.py
py
1,372
python
en
code
1
github-code
1
17885667606
import pytest from sqlalchemy import create_engine from sqlalchemy.orm import Session, sessionmaker import pdb from src import config from src.domain import model from src.services_layer import unit_of_work from src.adapters import repository @pytest.fixture def tear_down(): session_factory = postgres_db_session...
yellowBunnyy/audio_teka
tests/test_uow.py
test_uow.py
py
2,066
python
en
code
1
github-code
1
70337406114
class Solution: def maximumWealth(self, accounts: List[List[int]]) -> int: max = 0 for man_accounts in accounts: sum = 0 for acc in man_accounts: sum += acc if sum > max: max = sum del sum return max
exsky/leetcode
easy/1672_Richest_Customer_Wealth/__init__.py
__init__.py
py
292
python
en
code
1
github-code
1
27537495283
import torch import torch.nn as nn import torch.nn.functional as F class CNN(nn.Module): def __init__(self, args, data, vectors): super(CNN, self).__init__() self.args = args self.word_emb = nn.Embedding(args.embed_num, args.embed_dim, padding_idx=1) # initialize word embedding with pretrained word2vec ...
UVa-NLP/HEDGE
cnn/cnn_model.py
cnn_model.py
py
1,848
python
en
code
30
github-code
1
42895748829
import torch import pandas as pd import numpy as np from tqdm.notebook import tqdm from joblib import Parallel, delayed #conda install -c anaconda joblib class DatasetHandler: def __init__(self, dataframes, config_dict): """ cols_input, cols_target, dataframes_descriptions, keep_na=Fa...
DoriNiss/dust_prediction_using_deep_learning
packages/data_handlers/DatasetHandler.py
DatasetHandler.py
py
12,765
python
en
code
0
github-code
1
11742668018
import eval7 from tqdm import tqdm import traceback import sys from pprint import pprint sys.path.insert(0, "../") sys.path.insert(0, "../.libs") from pokereval import PokerEval pokereval = PokerEval() from pprint import pprint import numpy as np import operator from tqdm import tqdm import datetime import re rank = ...
jinyiabc/holdem_board_analyzer
hr/fictious_raise.py
fictious_raise.py
py
7,896
python
en
code
0
github-code
1
30262906364
import time from logging import getLogger from typing import Any, Dict, Optional, Tuple import numpy as np import torch import torch.nn as nn import torch.optim as optim from sklearn.metrics import confusion_matrix, f1_score from torch.utils.data import DataLoader from .meter import AverageMeter, ProgressMeter from ....
yiskw713/pytorch_template
src/libs/helper.py
helper.py
py
4,370
python
en
code
22
github-code
1
73551408992
def addition(a, b): x = a + b return x def subtraction(a, b): x = a - b return x def multiplication(a, b): x = a * b return x def division(a, b): x = a / b return x def power(a, b): x = a**b return x operations = { "+": addition, "-": subtraction, "*": multiplic...
tasnimxpress/100DaysOfPython
Day-10 Calculator/Calculator.py
Calculator.py
py
1,080
python
en
code
0
github-code
1
2759222029
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Author: chenhao # Date: 2020-09-13 # Description: #------------------------------------------------------------------------------- import torch import torch.nn as nn from torch.nn import functional as F clas...
chenhaoenen/FCTest
nlp/ChnSentiCorp_htl_all/src/model/textcnn.py
textcnn.py
py
2,010
python
en
code
0
github-code
1
12815370075
fp = open("C:\\Users\\kartick kolachala\\Desktop\\kartick\\data\\trans1\\transaction201906\\Transactions1.txt", 'rt').read().splitlines() fETH = open("C:\\Users\\kartick kolachala\\Desktop\\experiments\\outETH.txt", 'w') paymentList = [] for i, line in enumerate(fp): paymentList=line.split(" ") if ...
kartick-bot/ripple
All_ETH.py
All_ETH.py
py
456
python
en
code
0
github-code
1
9726738798
from flask import Response, Flask from time import sleep import random import prometheus_client from prometheus_client import Counter, Histogram app = Flask('prometheus-app') REQUESTS = Counter( 'requests', 'Application Request Count', ['endpoint'] ) TIMER = Histogram( 'slow', 'Slow Requests', ['endp...
leonekwolfik/python_devops
python-dla-devops-naucz-sie-bezlitosnie-skutecznej-automatyzacji-noah-gift-kennedy-behrman-alfredo-deza-grig-ghe/src/roz07-Monitoring/web.py
web.py
py
847
python
pl
code
0
github-code
1
25643939545
def dfs(root, board, path): # print(root) i,j = root copy = board copy[i][j] = None # print(path, end=',') if len(path) == 0: return True entry = path[0] # print(path) if len(path) == 0: return True found = False for neighbour in [(i-1, j), (i,j-1), (i,j+1), (i+1,j)]: x, y = neighbour if x < 0 or y <...
chenchals/interview_prep
sort/string_dfs.py
string_dfs.py
py
1,318
python
en
code
0
github-code
1
22418570468
#!/usr/bin/env python3 import argparse import requests def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--url", type=str, default="http://0.0.0.0:8000/model") parser.add_argument("--host", type=str) parser.add_argument("--port", type=str) parser.add_argument("-n", "--name...
ktro2828/DenseMatching-API
example/load_model.py
load_model.py
py
1,046
python
en
code
0
github-code
1
16196933934
import time import random import zmq context = zmq.Context() zmq_socket = context.socket(zmq.PUSH) zmq_socket.connect("tcp://127.0.0.1:5557") # Start your result manager and workers before you start your producers consumer_id = random.randrange(1,10005) print("I am consumer #%s" % (consumer_id)) for num in range(200...
telminov/my_notes_for_various-_programlanguages
python/сокеты/ZMQ с очередями/Zmq/messaging_pattern/3.5/push_pull_(many_pushed)/push_.py
push_.py
py
423
python
en
code
0
github-code
1
16600501275
from funciones import * comandos = { "pwd": lambda: print(os.getcwd()), "date": lambda: print(datetime.date.today()), "time": lambda: print(datetime.datetime.now().time()), "exit": exit, "clear": lambda: os.system('cls' if os.name == 'nt' else 'clear'), "man": mostrar_ayuda, "uname...
Andres-Paz/proyecto1_compi
main.py
main.py
py
692
python
es
code
0
github-code
1
11548576270
import string def binarySearch(arr: list, num: int): low = 0 high = len(arr) mid = (high + low) // 2 while(low <= high): if arr[mid] == num: print ("FOUND") break elif arr[mid] < num: low = mid + 1 mid = (high + low) // 2 pri...
maykhid/study
binary_search/binary_search_iterative.py
binary_search_iterative.py
py
595
python
en
code
0
github-code
1
27666235820
# -*- coding: utf-8 -*- import logging from .utils import parse_date from .config import Config import xmltodict logger = logging.getLogger() class XMLParser(object): def __init__(self, xml, config=None): self.xml = xml self.errors = None if config is None: config = Config()...
Japle/python-pagseguro
pagseguro/parsers.py
parsers.py
py
6,801
python
en
code
173
github-code
1
16662772162
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd # In[3]: df=pd.read_csv(r'C:\Users\msid4\OneDrive\Desktop\cc\music.tsv',sep='\t',encoding='utf-8',error_bad_lines=False) # In[3]: df.head() # In[90]: df.shape # In[4]: import findspark # In[5]: findspark.init('C:\spark') # In[6]...
msid4459/Cloud-Computing-Spark_ML_MapReduce-project
stage2.py
stage2.py
py
2,337
python
en
code
0
github-code
1
75168964833
"""This module includes dependencies.""" from fastapi import Header, status, HTTPException from settings import INTERNAL_CONFIGS def verify_api_key( x_auth: str = Header(description="API key"), x_from_name: str = Header(description="Name of services from where request is came"), ): """Check if user is l...
Monoboard/monoboard.api.auth
src/dependencies.py
dependencies.py
py
707
python
en
code
0
github-code
1
35872126644
"""\ Reference Directive for L.E.A.R.N ================================= Author: Akshay Mestry <xa@mes3.dev> Created on: Friday, July 28 2023 Last updated on: Monday, July 31 2023 This module provides a custom directive for L.E.A.R.N's custom theme, that allows authors and contributors to add a dedicated references s...
xames3/learn
docs/source/_extensions/sphinx/ext/learn/references.py
references.py
py
5,586
python
en
code
8
github-code
1
33082316879
import re from googletrans import Translator # Dòng chứa thông tin sinh viên student_info = "Full name: BUI HUY HOANG\nDoB\n11/12/2003\nGender: Male\nIntake\n2021-2024\nCourse: Bachelor\nMajor\nInformation and Communication Technology\nBI12-170\nValidity: 30/10/2024" # Tìm và ghép các phần của đối tượng lại với nhau...
Huyen165/ML2
Src/Identify_info.py
Identify_info.py
py
1,705
python
vi
code
0
github-code
1
19118236265
import pandas as pd import matplotlib.pyplot as plt # Load the CSV data into a DataFrame df = pd.read_csv("suicide_reates.csv") # Menu for user's choice print("Select a graph to display:") print("1. Bar Graph") print("2. Histogram") print("3. Scatter Plot") print("4. Line Graph") # Add Line Graph option choice = in...
praveenkumar-byte/ml
visualize.py
visualize.py
py
1,709
python
en
code
0
github-code
1
17036383575
# explanation: max-heapify each row, pop n-1 times, put these into row max-heap of size m # add the root (largest of deleted) into a sum # repeat until no columns left import heapq def deleteGreatestValue(grid): sum = 0 # turn each row into a heap and put those heaps into a list row_heaps = [] for r...
rwang2022/Leetcode
heap/2500.py
2500.py
py
937
python
en
code
0
github-code
1
31772141626
# coding=utf-8 import json import telegram import logging from telegram.error import NetworkError, Unauthorized from time import sleep TOKEN = '206483377:AAHnQ_ohMuvDhI5mfbDMrHKTnTGIi7YhT6A' # Ponemos nuestro Token generado con el @BotFather #bot.setWebhook('https://api.tekegram.org/bot/'+TOKEN+'/') def main(): ...
LucasHG94/VallaBot
vallaBotOld.py
vallaBotOld.py
py
1,480
python
en
code
0
github-code
1
10389850703
import matplotlib.pyplot as plt import numpy as np from math import factorial, sqrt from scipy.misc import derivative def f(x, l): return (x ** 2 - 1) ** l def der_f(x, l, m): order = l + abs(m) return derivative(f, x0=x, n=order, args=[l], order=2 * order + 1) def calculate_func(theta, phi, l, m): ...
Mihinator3000/Group-Projects
Physics/Modeling5/main.py
main.py
py
2,850
python
en
code
0
github-code
1
7900094304
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("login", views.login_view, name="login"), path("logout", views.logout_view, name="logout"), path("register", views.register, name="register"), path("allPosts",views.allPosts,name="allPosts")...
keshavanand/Network
network/urls.py
urls.py
py
702
python
en
code
0
github-code
1
15405581753
#!/usr/bin/env python3 """ https://adventofcode.com/2016/day/18 """ import aoc PUZZLE = aoc.Puzzle(day=18, year=2016) def solve(part='a'): """Solve puzzle""" rows = 40 if part == 'a' else 400000 prev = PUZZLE.input tiles_per_row = len(prev) safe_tiles = prev.count('.') for _ in range(1, rows)...
trosine/advent-of-code
2016/day18.py
day18.py
py
722
python
en
code
0
github-code
1
71632700195
import logging logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.INFO) def do_add_remove_maglev(test, table, add, remove, exp_table, exp_prev_ele_map): logger.info("===Add/Remove Maglev test===") if add: logger.info("Adding {} to the table.".format(add)) table.add(add...
futurewei-cloud/zeta
test/helper.py
helper.py
py
803
python
en
code
16
github-code
1
34002248465
N, K = map(int, input().split(" ")) V = list(map(int, input().split(" "))) max_score = 0 for i in range(N+1): # print(list(range(i, N+1))) for j in range(i, N+1): # print(i, j) p = V[:i] + V[j:] # print(p) if len(p) > K: continue p.sort(reverse=True) ...
yojiyama7/python_competitive_programming
atcoder/abc/abc128/d_equeue.py
d_equeue.py
py
542
python
en
code
0
github-code
1
226116276
class Argument: # self.command - the command string for this argument # self.value - the actual value of this argument # self.branchable - the true/false state of the branchable flag # self.is_flag - whether or not this argument is a flag command = None value = None branchable = True is_...
acgt-tax-consultants/orchard
orchard/module/_argument.py
_argument.py
py
2,745
python
en
code
1
github-code
1
2548449685
"""Finetune 3D CNN.""" import os import argparse import itertools import time import math import random import builtins import warnings import string import numpy as np import pandas as pd from PIL import ImageFilter import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import...
guoshengcv/CACL
train_finetune.py
train_finetune.py
py
23,057
python
en
code
22
github-code
1
5823107738
from PythonPrograms.Oblig2_A_star.Vertex import Vertex from PythonPrograms.Oblig2_A_star.Edge import Edge from PythonPrograms.Oblig2_A_star.Graph import Graph import pygame as pg ''' The AStar class inherits the Graph class ''' class AStar(Graph): """ # # delay: seconds between each iteration when visu...
HalilIbrahimKeser/AStarAndKalmanPython
PythonPrograms/Oblig2_A_star/AStar.py
AStar.py
py
18,462
python
en
code
0
github-code
1
11347730200
import numpy as np # Coordinates of the Anchor points (Sensors) X = np.linspace(12,200-12,np.sqrt(16)) Y = np.linspace(12,200-12,np.sqrt(16)) sensors = np.zeros( (16,2) ) i=0 for x1 in X : for y1 in Y : sensors[i] = np.array( (x1,y1) ) i += 1 # okumura hata rssi simulation def get_rssi( pos , sensor = sensor...
abdullahalsaidi16/wsn_localization_tracking
Random Fourier Features/Lib/rssi_gen.py
rssi_gen.py
py
573
python
en
code
12
github-code
1
32746010298
import numpy as np from PIL import Image import matplotlib.pyplot as plt class clusteredData(): def __init__(self,dataSet)-> None: self.__dataSet = dataSet self.__centriods,self.__belongsTo = elbowMethod(dataSet,8) #self.__centriods,self.__belongsTo = kmeans(3,dataSet) #self.plot() ...
danieljimenez1337/tlds-parser
kmeans_util.py
kmeans_util.py
py
4,685
python
en
code
1
github-code
1
29443739493
############################################################################################ # # Cálculo do desvio padrão para as idades dos personagens dos Simpsons # # Cálculo do desvio padrão populacional e amostral para as idades dos personagens dos Simpsons: # As regras básicas para os cálculos de desvios padrã...
Grinduim/Bosch-2022.2
Bosch/InnoHub/Treinamento de IA/materiais/Exemplos_1/SIMPSONS_EXAMPLE/SIMPSONS_STANDARD_DEVIATION.py
SIMPSONS_STANDARD_DEVIATION.py
py
2,853
python
pt
code
0
github-code
1
21843642223
class Solution: def maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int: horizontalCuts.extend([0, h]) horizontalCuts.sort() verticalCuts.extend([0, w]) verticalCuts.sort() # print(horizontalCuts, vertica...
uditmanav17/leetcode
1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.py
1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.py
py
713
python
en
code
0
github-code
1
21941953653
import tkinter as tk class App: def __init__(self, root): frame = tk.Frame(root) frame.pack() self.hi_three = tk.Button(frame,text="say hello",bg="white",fg="red", command=self.say_hi) self.hi_three.pack(side=tk.LEFT) def say_hi(self): print("hello ,welcome to the real ...
helloword1314/caowei_pythion3
cwpack/tktinte/02_按钮.py
02_按钮.py
py
377
python
en
code
0
github-code
1
35010952644
# 스포츠 기사 크롤링 import requests from bs4 import BeautifulSoup as bs from apps.resources.models import Article def crawling_entertain_news(): entertain_url = "https://entertain.naver.com" entertain_url_home = entertain_url + "/home" response = requests.get(entertain_url_home) soup = bs(response.text, ...
Billionaire-Project/four_hours_service
scheduler/news_crawling_entertain.py
news_crawling_entertain.py
py
1,835
python
en
code
0
github-code
1
41304347612
import torch print(torch.__version__) torch.get_default_dtype() torch.get_num_threads() torch.set_default_dtype(torch.float64) torch.get_default_dtype() tensor_arr = torch.Tensor([[1, 2, 3], [4, 5, 6]]) torch.is_tensor(tensor_arr) torch.numel(tensor_arr) #Gives the number of elements in the tensor tensor_unin...
subhankar453/ExploringPyTorch
models/ExploringPyTorch.py
ExploringPyTorch.py
py
3,807
python
en
code
0
github-code
1
4851382797
from scout.build.disease import build_disease_term def test_build_disease_term(adapter): ## GIVEN some disease info and a adapter with a gene disease_info = { 'mim_number': 615349, 'description': "EHLERS-DANLOS SYNDROME, PROGEROID TYPE, 2", 'hgnc_symbols': set(['B3GALT6']), 'inh...
gitter-badger/scout
tests/build/test_build_disease.py
test_build_disease.py
py
803
python
en
code
null
github-code
1
33970522684
import logging from typing import Any, Callable, Dict, Iterable, Iterator, Optional, Tuple, Union from swh.core.db import BaseDb from swh.model.model import ( BaseModel, Directory, DirectoryEntry, ExtID, RawExtrinsicMetadata, Release, Revision, Snapshot, SnapshotBranch, TargetTy...
SoftwareHeritage/swh-storage
swh/storage/backfill.py
backfill.py
py
20,163
python
en
code
6
github-code
1