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
20445647795
import os import importlib.util import time print("Checking Dependencies") if importlib.util.find_spec("tkinter") is None: print("tkinter NOT INSTALLED,RUN pip install tkinter") os.system("pause") exit() print("Dependencies OK") time.sleep(5.5) from os import path from tkinter import filedial...
JohnavonVincentius/FileRename
filerename.py
filerename.py
py
1,010
python
en
code
0
github-code
6
43219185037
#!/usr/bin/env python from storytext import applicationEvent import time, signal, sys def handleSignal(signum, *args): sys.stderr.write("Got signal " + repr(signum) + "\n") signal.signal(signal.SIGQUIT, handleSignal) signal.signal(signal.SIGINT, handleSignal) time.sleep(0.5) applicationEvent("nothing to happen"...
texttest/storytext-selftest
console/appevent_delayed/target_ui.py
target_ui.py
py
488
python
en
code
0
github-code
6
8400225965
# Importamos tkinter from tkinter import * # Cargamos el modulo de Imagenes Pillow Python from PIL import Image, ImageTk # Creamos la ventana raiz ventana = Tk() ventana.title("Imagenes | Curso de master en Python") ventana.geometry("700x500") Label(ventana, text="Hola!!, Soy Lcdo. Josรฉ Fernando Frugone Jaramillo").pa...
jfrugone1970/tkinter_python2020
21-tkinter/03-imagenes.py
03-imagenes.py
py
500
python
es
code
1
github-code
6
11783428086
# coding: utf-8 # In[1]: #get_ipython().system(u'jupyter nbconvert --to script lstm_model.ipynb') import os import sys import time import pandas as pd import datetime #import pandas.io.data as web from pandas_datareader import data import matplotlib.pyplot as plt from matplotlib import style import glob import numpy...
thongnbui/MIDS_capstone
code/lstm_model.py
lstm_model.py
py
10,757
python
en
code
0
github-code
6
14019383059
# Standard Library Imports import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import seaborn as sns def mae(actual, preds): #INPUT: #actual - numpy array or pd series of actual y values #preds - numpy array or pd series of predicted y values #OUTPUT: #r...
tomgoral/Udacity_ML_Engineer_Nanodegree
3_capstone/utilities/print_metrics.py
print_metrics.py
py
1,738
python
en
code
0
github-code
6
29827950852
import featureEngineering import progress def get_classifier_score(classifier, settings={}) -> (float, float): tbl = featureEngineering.get_featured_data_frame(settings) train_data, test_data, train_survived_data, test_survived_data = featureEngineering.split_data_frame(tbl) classifier.fit(train_data, tr...
AliakseiDudko/PythonMachineLearning
solution.py
solution.py
py
2,370
python
en
code
0
github-code
6
8954419715
import requests,urllib import os,sys,re,zipfile,shutil,io from bs4 import BeautifulSoup cwd = os.getcwd() # taking the movie input movie_name = [s for s in re.split("[^0-9a-zA-Z]",input("enter the movie name : \n"))] movie_name = list(filter(lambda a: a != '', movie_name)) m1 = ' '.join(map(str,movie_name)) encod...
styx97/movie_subs
movie_subs.py
movie_subs.py
py
1,880
python
en
code
4
github-code
6
14524764116
import random from itertools import combinations from ltga.Mutation import Mutation class LTGA(object): def buildTree(self, distance): clusters = [(i,) for i in range(len(self.individuals[0].genes))] subtrees = [(i,) for i in range(len(self.individuals[0].genes))] random.shuffle(clusters)...
Duzhinsky/scheduling
ltga/LTGA.py
LTGA.py
py
2,220
python
en
code
0
github-code
6
38199809243
import sys from PyQt5.QtWidgets import QMainWindow, QApplication, QDesktopWidget, QFileDialog from PyQt5.QtGui import QPalette, QColor import numpy as np from typing import * import json import qtmodern.styles import qtmodern.windows from MyModules.MyWindow import Ui_MainWindow from MyModules.Orbits import Satellite ...
Keith-Maxwell/OrbitViewer
OrbitViewer.py
OrbitViewer.py
py
6,219
python
en
code
0
github-code
6
13498241289
import numpy as np from edges import * def allVertexOneRings(V,F): E = edges(F) keys = np.array([]) values = np.array([]) keys = np.append(keys, E[:,0]) keys = np.append(keys, E[:,1]) values = np.append(values, E[:,1]) values = np.append(values, E[:,0]) faceDict = {} keys = keys.astype(int) values = values.a...
oarriaga/PyGPToolbox
src/allVertexOneRings.py
allVertexOneRings.py
py
479
python
en
code
2
github-code
6
5229315790
from django.http import HttpResponsePermanentRedirect, HttpResponseGone def redirect_to(request, url, convert_funcs=None, **kwargs): """ A version of django.views.generic.simple.redirect_to which can handle argument conversion. The 'convert_funcs' parameter is a dictionary mapping 'kwargs' keys to a fu...
gboue/django-util
django_util/view_utils.py
view_utils.py
py
819
python
en
code
2
github-code
6
2089542339
import IMP import IMP.pmi import IMP.pmi.macros import IMP.test import glob class Tests(IMP.test.TestCase): def test_analysis_replica_exchange(self): try: import matplotlib except ImportError: self.skipTest("no matplotlib package") if IMP.get_check_level() >= IMP.US...
salilab/pmi
test/medium_test_analysis3.py
medium_test_analysis3.py
py
2,367
python
en
code
12
github-code
6
74575078906
from __future__ import print_function, unicode_literals from django.core.urlresolvers import reverse from cba import components from cba.base import CBAView class LinksRoot(components.Group): def init_components(self): self.initial_components = [ components.Group( css_class="...
diefenbach/cba-examples
cba_examples/views/links.py
links.py
py
907
python
en
code
0
github-code
6
19400757649
import os import sys import unittest import logging from datetime import datetime import json from flask import Flask, request from flask_restful import Resource import settings as CONST curpath = os.path.dirname(__file__) sys.path.append(os.path.abspath(os.path.join (curpath, "../"))) from app_models import Custom...
bbcCorp/py_microservices
src/flask_api_customers/customers.py
customers.py
py
5,316
python
en
code
1
github-code
6
37131397687
#!/usr/bin/env python #_*_coding:utf-8_*_ import re def checkFasta(fastas): status = True lenList = set() for i in fastas: lenList.add(len(i[1])) if len(lenList) == 1: return True else: return False def minSequenceLength(fastas): minLen = 10000 for i in fastas: if minLen > len(i[1]): minLen = len(i...
Superzchen/iFeature
codes/checkFasta.py
checkFasta.py
py
513
python
en
code
152
github-code
6
28493654402
from cProfile import label from tkinter import * import tkinter as tk import Calculos as Cal import numpy as np def fila_vacia(donde,cuantas,frame,tamaรฑo): #Crear Filas Vacias for n in range (0,cuantas): fila = Label(frame,width=tamaรฑo) fila.grid(column=0, row=donde+n) def columna_vacia(donde,cuan...
daridel99/UMNG-robotica
Funciones.py
Funciones.py
py
4,155
python
es
code
0
github-code
6
71091610109
root_path = '/mnt/d/KLTN/CNN-Based-Image-Inpainting/' train_glob = root_path + 'dataset/places2/train/*/*/*.jpg' test_glob = root_path + 'dataset/places2/test/*.jpg' mask_glob = root_path + 'dataset/irregular_mask1/*.png' #2 for partialconv log_dir = root_path + 'training_logs' save_dir = root_path + 'models' checkpoi...
realphamanhtuan/CNN-Based-Image-Inpainting
traingatedconv.py
traingatedconv.py
py
1,142
python
en
code
0
github-code
6
26238944709
# coding=utf-8 from __future__ import unicode_literals, absolute_import, print_function, division import errno import json import os.path import sys from sopel.tools import Identifier from sqlalchemy import create_engine, Column, ForeignKey, Integer, String from sqlalchemy.engine.url import URL from sqlalchemy.exc i...
examknow/Exambot-Source
sopel/db.py
db.py
py
19,385
python
en
code
2
github-code
6
22997884829
_base_ = [ '../../_base_/models/faster_rcnn_r50_fpn.py', '../../_base_/datasets/waymo_detection_1280x1920.py', '../../_base_/schedules/schedule_1x.py', '../../_base_/default_runtime.py' ] # model model = dict( rpn_head=dict( anchor_generator=dict( type='AnchorGenerator', ...
carranza96/waymo-detection-fusion
configs/waymo_open/study/faster_rcnn_r50_fpn_fp16_4x2_1x_1280x1920_redanchors.py
faster_rcnn_r50_fpn_fp16_4x2_1x_1280x1920_redanchors.py
py
1,460
python
en
code
0
github-code
6
25040767672
# ์ธํ•˜์€ํ–‰์—๋Š” ATM์ด 1๋Œ€๋ฐ–์— ์—†๋‹ค. ์ง€๊ธˆ ์ด ATM์•ž์— N๋ช…์˜ ์‚ฌ๋žŒ๋“ค์ด ์ค„์„ ์„œ์žˆ๋‹ค. # ์‚ฌ๋žŒ์€ 1๋ฒˆ๋ถ€ํ„ฐ N๋ฒˆ๊นŒ์ง€ ๋ฒˆํ˜ธ๊ฐ€ ๋งค๊ฒจ์ ธ ์žˆ์œผ๋ฉฐ, i๋ฒˆ ์‚ฌ๋žŒ์ด ๋ˆ์„ ์ธ์ถœํ•˜๋Š”๋ฐ ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„์€ Pi๋ถ„์ด๋‹ค. # ์‚ฌ๋žŒ๋“ค์ด ์ค„์„ ์„œ๋Š” ์ˆœ์„œ์— ๋”ฐ๋ผ์„œ, ๋ˆ์„ ์ธ์ถœํ•˜๋Š”๋ฐ ํ•„์š”ํ•œ ์‹œ๊ฐ„์˜ ํ•ฉ์ด ๋‹ฌ๋ผ์ง€๊ฒŒ ๋œ๋‹ค. # ์˜ˆ๋ฅผ ๋“ค์–ด, ์ด 5๋ช…์ด ์žˆ๊ณ , P1 = 3, P2 = 1, P3 = 4, P4 = 3, P5 = 2 ์ธ ๊ฒฝ์šฐ๋ฅผ ์ƒ๊ฐํ•ด๋ณด์ž. [1, 2, 3, 4, 5] ์ˆœ์„œ๋กœ ์ค„์„ ์„ ๋‹ค๋ฉด, # 1๋ฒˆ ์‚ฌ๋žŒ์€ 3๋ถ„๋งŒ์— ๋ˆ์„ ๋ฝ‘์„ ์ˆ˜ ์žˆ๋‹ค. 2๋ฒˆ ์‚ฌ๋žŒ์€ 1๋ฒˆ ์‚ฌ๋žŒ์ด ๋ˆ์„ ๋ฝ‘์„ ๋•Œ ๊นŒ์ง€ ๊ธฐ๋‹ค๋ ค์•ผ ํ•˜๊ธฐ ...
pnu-k-digital-2/pnu-k-digital-training-2023-2-coding-test-study
sangwook/Week1_๊ทธ๋ฆฌ๋””์•Œ๊ณ ๋ฆฌ์ฆ˜/ATM.py
ATM.py
py
2,183
python
ko
code
0
github-code
6
4869208113
import socket import select import sys client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if len(sys.argv) != 3: print ("Print in the following order : script, IP address, port number") exit() IP_address = str(sys.argv[1]) Port = int(sys.argv[2]) client_socket.connect((IP_address, Port)) while...
asyranasyran/GROUP-PROJECT
client.py
client.py
py
764
python
en
code
0
github-code
6
71839381629
# coding=utf-8 from __future__ import print_function from ActionSpace import settings from om.util import update_from_salt, syn_data_outside, fmt_salt_out, check_computer from om.models import CallLog from django.contrib.auth.models import User, AnonymousUser from om.proxy import Salt from channels.generic.websockets ...
cash2one/ActionSpace
om/worker.py
worker.py
py
12,465
python
en
code
0
github-code
6
41996577461
import socket TCP_IP = '0.0.0.0' TCP_PORT = 5 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((TCP_IP, TCP_PORT)) s.listen(1) conn, addr = s.accept() print("connection addr: {}".format(addr)) while True: data = conn.recv(1) print("recieved data: {}".format(data)) conn.send(data) conn.close()
Pgovalle/Proyecto_lab_control
Proyecto_redes/Photon/Codigo_Ejemplo/sockets/sockkk/server.py
server.py
py
311
python
en
code
0
github-code
6
23500788401
from alipy.index import IndexCollection from alipy.experiment import State from alipy.data_manipulate import split from sklearn.preprocessing import StandardScaler def cancel_step(select_ind, lab, unlab): lab = IndexCollection(lab) unlab = IndexCollection(unlab) unlab.update(select_ind) lab.di...
weiweian1996/VERSION2.0
GUI/Function/index_handle.py
index_handle.py
py
1,941
python
en
code
0
github-code
6
1121085852
''' https://programmers.co.kr/learn/courses/30/lessons/42577?language=python3# ์ „ํ™”๋ฒˆํ˜ธ ๋ชฉ๋ก - ํ•ด์‹œ ''' def solution(phoneBook): phoneBook = list(map(str,sorted(map(int,phoneBook)))) #phoneBook = sorted(list(set(phoneBook)), key=lambda x :len(x)and int(x)) #๊ธธ์ด๋กœ ์ •๋ ฌ + ์ˆซ์ž๋กœ ์ •๋ ฌ -> ์ˆœ์„œ ๋ฐ”๋€Œ๋ฉด ์•ˆ๋จ for j in range(len(phoneBook)...
thdwlsgus0/algorithm_study
python/์ „ํ™”๋ฒˆํ˜ธ ๋ชฉ๋ก.py
์ „ํ™”๋ฒˆํ˜ธ ๋ชฉ๋ก.py
py
528
python
en
code
0
github-code
6
30515350804
import typing as _ from pathlib import Path from jinja2 import Environment, FileSystemLoader from pypugjs.ext.jinja import PyPugJSExtension asset_folder = '' def _get_asset(fname: str) -> Path: return Path(asset_folder, fname) def _data_with_namespace(data: 'Data', namespace: _.Dict) -> 'DataWithNS': retur...
OnoArnaldo/py-report-generator
src/reportgen/utils/pug_to_xml.py
pug_to_xml.py
py
3,635
python
en
code
0
github-code
6
28838106101
import numpy as np try: from math import prod except: from functools import reduce def prod(iterable): return reduce(operator.mul, iterable, 1) import zipfile import pickle import sys import ast import re from fickling.pickle import Pickled if sys.version_info >= (3, 9): from ast import unparse else: ...
divamgupta/diffusionbee-stable-diffusion-ui
backends/model_converter/fake_torch.py
fake_torch.py
py
15,028
python
en
code
11,138
github-code
6
73919945469
import unittest from bs4 import BeautifulSoup from src import get_html_script as ghs from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from models.models import JobDataModel from models import domain_db_mappings as dbm from models.databa...
ctiller15/Board-scrape-tool
tests/functional_tests.py
functional_tests.py
py
5,831
python
en
code
0
github-code
6
31065262082
from tensorflow.keras.backend import clear_session from tensorflow.keras.models import load_model from tensorflow.keras.callbacks import ModelCheckpoint, Callback as keras_callback from tensorflow.keras.preprocessing.image import ImageDataGenerator import numpy as np from static.models.unet_model import unet from scipy...
GoldbergLab/tongueSegmentationServer
NetworkTraining.py
NetworkTraining.py
py
7,819
python
en
code
1
github-code
6
29537697201
# -*- coding: utf-8 -*- from openerp import models, fields, api class purchase_order(models.Model): _inherit = 'purchase.order' @api.multi def action_picking_create(self): res = super(purchase_order, self).action_picking_create() if self.picking_ids: picking_ids = [x.id for x...
odoopruebasmp/productions_stage_venv
document_sftp_more/models/purchase_order.py
purchase_order.py
py
418
python
en
code
0
github-code
6
14493907058
# -*- coding: utf-8 -*- # ''' -------------------------------------------------------------------------- # File Name: PATH_ROOT/utils/signal_vis.py # Author: JunJie Ren # Version: v1.1 # Created: 2021/06/15 # Description: โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” โ€” ...
jjRen-xd/PyOneDark_Qt_GUI
app/utils/signal_vis.py
signal_vis.py
py
11,107
python
en
code
2
github-code
6
31267028151
## Archived on the 22/09/2021 ## Original terrain.py lived at io_ogre/terrain.py import bpy def _get_proxy_decimate_mod( ob ): proxy = None for child in ob.children: if child.subcollision and child.name.startswith('DECIMATED'): for mod in child.modifiers: if mod.type == 'DE...
OGRECave/blender2ogre
archived_code/terrain.py
terrain.py
py
7,840
python
en
code
187
github-code
6
30197691279
from sense_hat import SenseHat import time import socket import gyrodata import sys host = '10.44.15.35' port = 5802 gyrodata.initGetGyroAngle() gyro_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) gyro_socket.bind((host, port)) print('Socket created') print('Listening...') gyro_socket.listen(1) conn, add...
VCHSRobots/2017NavSys
gyroreader.py
gyroreader.py
py
714
python
en
code
0
github-code
6
844258019
# coding: utf-8 """Train an ESN with a recursive least squares filter.""" from __future__ import ( absolute_import, division, print_function, unicode_literals, ) import logging import hyperopt import hyperopt.mongoexp import numpy as np from esn import RlsEsn from esn.activation_functions import l...
0x64746b/python-esn
examples/superposed_sinusoid/rls.py
rls.py
py
3,499
python
en
code
0
github-code
6
73817307386
# # test_ab.py - generic tests for analysis programs # repagh <rene.vanpaassen@gmail.com, May 2020 import pytest from slycot import analysis from slycot.exceptions import SlycotArithmeticError, SlycotResultWarning from .test_exceptions import assert_docstring_parse @pytest.mark.parametrize( 'fun, ...
python-control/Slycot
slycot/tests/test_analysis.py
test_analysis.py
py
2,436
python
en
code
115
github-code
6
71888974267
# Fn = F[n-1]+ F[n-2](n=>2) def fib(n): if n==0 : return [0] elif n==1 : return [0,1] else: fibs=[0,1,1] for i in range(3,n): fibs.append(fibs[-1]+fibs[-2]) return fibs # ่พ“ๅ‡บไบ†็ฌฌ10ไธชๆ–ๆณข้‚ฃๅฅ‘ๆ•ฐๅˆ— print(fib(8)) # a,b=0,1 # while a<1000: # print(a,end=",") # ...
fivespeedasher/Pieces
pra6.py
pra6.py
py
353
python
en
code
0
github-code
6
16151353249
from tqdm import tqdm import time import argparse N = int(1e9) T = 1e-2 MAX_LEN = 100 def parse_args(): parser = argparse.ArgumentParser(description='i really wanna have a rest.') parser.add_argument('-n', '--iters', type=int, default=N, help='rest iters.') parser.add_argument('-f', '--frequency', type=...
I-Doctor/have-a-rest
have-a-rest.py
have-a-rest.py
py
871
python
en
code
0
github-code
6
7918280184
import os import sys import argparse import netaddr from netaddr import EUI def _parse_args( args_str): parser = argparse.ArgumentParser() args, remaining_argv = parser.parse_known_args(args_str.split()) parser.add_argument( "--username", nargs='?', default="admin",help="User name") par...
sandip-d/scripts
vmi_scale.py
vmi_scale.py
py
3,983
python
en
code
0
github-code
6
73813195389
# physic_tank.py ''' ----------------------------------------------------- function for calculating physics formula 1) Calculate Parameter : Charging Time, Discharging Time 2) Reverse Compute Tank Outlet Temperature ----------------------------------------------------- ''' '=============================...
hyemi2022/hyemi2022
TotalModel_System_Calcuation/physic_tank.py
physic_tank.py
py
5,119
python
en
code
1
github-code
6
36703905624
import soundfile as sf import numpy as np import time import matplotlib.pyplot as plt from parameterization import STFT, iSTFT, optimal_synth_window, first_larger_square DEF_PARAMS = { "win_len": 25, "win_ovlap": 0.75, "blocks": 800, "max_h_type": "lin-lin", "min_gain_dry": 0, "bias": 1.01, ...
Revzik/AGH-ZTPS_Acoustical-Environment-Classification
deverb.py
deverb.py
py
10,820
python
en
code
0
github-code
6
31865827642
import tensorflow as tf import numpy as np import sys class conv3: def __init__(self,numfilter): self.numfilter=numfilter self.filmat=np.random.randn(3,3,numfilter)/9 #to decrease def forward(self,input): l,b=input.shape self.chache_input=input #paddedinput=zeros(input.shape[0]+2,input.shape[1...
Jitendra29-78/Sudoku-Digit-Recognition
cnn.py
cnn.py
py
5,170
python
en
code
0
github-code
6
27593505084
import logging from logging.handlers import TimedRotatingFileHandler import os server_logger = logging.getLogger('server') PATH = os.path.dirname(os.path.abspath(__file__)) PATH = os.path.join(PATH, 'server.log') formatter = logging.Formatter( '%(asctime)s %(levelname)-8s %(funcName)s %(message)s', datefmt='%...
ide007/DB_and_PyQT
Lesson_1/logs/server_log_config.py
server_log_config.py
py
902
python
en
code
0
github-code
6
71409709627
############################### ####### SETUP (OVERALL) ####### ############################### ## Import statements # Import statements import os from flask import Flask, render_template, session, redirect, url_for, flash, request from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, RadioFiel...
katmazan/SI364midtermKatmazan
SI364midterm.py
SI364midterm.py
py
6,662
python
en
code
0
github-code
6
40056102923
#Link: https://leetcode.com/problems/kth-largest-element-in-an-array/ # Name: Kth Largest Element in an Array # Difficulty: Medium # Topic: Min Heap #Time: O(n log k) since we update the root a maximum of n times, each update is a log k operation #Space: O(k) for size of heap used import heapq class Solution: def f...
Shivaansh/AlgoExpert-LeetCode-Solutions
LeetCode Problems/Python/KthLargestElementInAnArray.py
KthLargestElementInAnArray.py
py
879
python
en
code
2
github-code
6
29433457016
#! /usr/bin/env python # # Implementation of elliptic curves, for cryptographic applications. # # This module doesn't provide any way to choose a random elliptic # curve, nor to verify that an elliptic curve was chosen randomly, # because one can simply use NIST's standard curves. # # Notes from X9.62-1998 (draft): # ...
espressif/ESP8266_RTOS_SDK
components/esptool_py/esptool/ecdsa/ellipticcurve.py
ellipticcurve.py
py
8,609
python
en
code
3,148
github-code
6
16053211401
import os import sys import glob import argparse from lsdo_viz.problem import Problem from lsdo_viz.utils import clean, get_viz, get_args, exec_python_file def main_viz(args=None): if args is None: args = sys.argv[1:] parser = argparse.ArgumentParser() parser.add_argument('args_file_name', nargs...
MAE155B-Group-3-SP20/Group3Repo
lsdo_viz/lsdo_viz/main_viz.py
main_viz.py
py
1,938
python
en
code
0
github-code
6
22916095420
#Create a gspread class and extract the data from the sheets #requires: # 1. Google API credentials json_key file path # 2. scope e.g. ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive'] # 3. gspread_url e.g. 'https://docs.google.com/spreadsheets/d/1itaohdPiAeniCXNlntNztZ_oRvjh0HsGuJXUJWET...
yenlow/utils
apis/google.py
google.py
py
2,442
python
en
code
1
github-code
6
3084393112
import numpy as np import pandas as pd import math import json import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import warnings warnings.filterwarnings('ignore') import optuna def create_data(f1, f2, A1, A2, sigma=0.02): outs = [] ts = 1000 theta1 = 1.4 theta2 = 1.0 ...
ksk-S/DynamicChangeBlindness
workspace_models/mcmc_model/test_ekf.py
test_ekf.py
py
3,468
python
en
code
0
github-code
6
5104206621
import os import cv2 import numpy as np import faceRecognition as fr import HumanDetection as hd import time from playsound import playsound #variabel status ruangan. 0 = empty, 1 = uknown, 2 = known status = 0 #variabel timestamp tsk = [0,0,0,False] #untuk durasi status known, mendeteksi ruang kosong (isempty) tsu = ...
AfifHM/Smart-CCTV-Using-Face-and-Human-Detection
FullProgram/Source Code/forVideo.py
forVideo.py
py
5,897
python
en
code
5
github-code
6
71221562748
''' /********************************************************************************** * Purpose: Write a Util Static Function to calculate monthlyPayment that reads in three * commandยญline arguments P, Y, and R and calculates the monthly payments you * would have to make over Y years to pay off a P principal loan amo...
JanhaviMhatre01/pythonprojects
monthlypayment.py
monthlypayment.py
py
741
python
en
code
1
github-code
6
32145991026
# # @lc app=leetcode id=1 lang=python3 # # [1] Two Sum # # @lc code=start class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: d = {} for i, val in enumerate(nums): rev = target - val if rev in d: return [d[rev], i] else: ...
rsvarma95/Leetcode
1.two-sum.py
1.two-sum.py
py
362
python
en
code
0
github-code
6
26159783505
# Bootstrap dropdown doesn't have select tag # inspect the dropdown, find all the li under ui tag # Loop through it and click the right li from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service # Launch the browser service_obj = Servic...
skk99/Selenium
day13/BootstrapDropdown.py
BootstrapDropdown.py
py
915
python
en
code
0
github-code
6
36273427497
from collections import namedtuple import itertools import torch import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer import torch.nn.functional as F import data_utils import train_utils from models import BinaryClassifier, LSTM, CNN import part2_train_utils import helpers #################...
timt51/question_retrieval
part2.py
part2.py
py
5,017
python
en
code
0
github-code
6
15147278540
from django.urls import path from . import views app_name = 'cis' urlpatterns = [ path('cis/<status>/', views.CIListView.as_view(), name='ci_list'), path('ci/create/', views.CICreateView.as_view(), name='ci_create'), path('ci/upload/', views.ci_upload, name='ci_upload'), path('ci/<int:pk>', views.CIDe...
DiegoVilela/internalize
cis/urls.py
urls.py
py
1,043
python
en
code
0
github-code
6
73652428349
# ็ป™ไฝ ไธ€ไธชไธ‹ๆ ‡ไปŽ 0 ๅผ€ๅง‹็š„ๆ•ดๆ•ฐๆ•ฐ็ป„ nums ใ€‚ # ็Žฐๅฎšไน‰ไธคไธชๆ•ฐๅญ—็š„ ไธฒ่” ๆ˜ฏ็”ฑ่ฟ™ไธคไธชๆ•ฐๅ€ผไธฒ่”่ตทๆฅๅฝขๆˆ็š„ๆ–ฐๆ•ฐๅญ—ใ€‚ # ไพ‹ๅฆ‚๏ผŒ15 ๅ’Œ 49 ็š„ไธฒ่”ๆ˜ฏ 1549 ใ€‚ # nums ็š„ ไธฒ่”ๅ€ผ ๆœ€ๅˆ็ญ‰ไบŽ 0 ใ€‚ๆ‰ง่กŒไธ‹่ฟฐๆ“ไฝœ็›ดๅˆฐ nums ๅ˜ไธบ็ฉบ๏ผš # ๅฆ‚ๆžœ nums ไธญๅญ˜ๅœจไธๆญขไธ€ไธชๆ•ฐๅญ—๏ผŒๅˆ†ๅˆซ้€‰ไธญ nums ไธญ็š„็ฌฌไธ€ไธชๅ…ƒ็ด ๅ’Œๆœ€ๅŽไธ€ไธชๅ…ƒ็ด ๏ผŒๅฐ†ไบŒ่€…ไธฒ่”ๅพ—ๅˆฐ็š„ๅ€ผๅŠ ๅˆฐ nums ็š„ ไธฒ่”ๅ€ผ ไธŠ๏ผŒ็„ถๅŽไปŽ nums ไธญๅˆ ้™ค็ฌฌไธ€ไธชๅ’Œๆœ€ๅŽไธ€ไธชๅ…ƒ็ด ใ€‚ # ๅฆ‚ๆžœไป…ๅญ˜ๅœจไธ€ไธชๅ…ƒ็ด ๏ผŒๅˆ™ๅฐ†่ฏฅๅ…ƒ็ด ็š„ๅ€ผๅŠ ๅˆฐ nums ็š„ไธฒ่”ๅ€ผไธŠ๏ผŒ็„ถๅŽๅˆ ้™ค่ฟ™ไธชๅ…ƒ็ด ใ€‚ # ่ฟ”ๅ›žๆ‰ง่กŒๅฎŒๆ‰€ๆœ‰ๆ“ไฝœๅŽ nums ็š„ไธฒ่”ๅ€ผใ€‚ from typing import List class...
xxxxlc/leetcode
competition/ๅ•ๅ‘จ่ต›/332/findTheArrayConcVal.py
findTheArrayConcVal.py
py
1,115
python
zh
code
0
github-code
6
35970918283
from __future__ import annotations __all__: list[str] = [] import argparse import subprocess import sys import cmn class _LintReturnCodes(cmn.ReturnCodes): """Return codes that can be received from pylint.""" SUCCESS = 0 # Error code 1 means a fatal error was hit ERROR = 2 WARNING = 4 ERRO...
kiransingh99/gurbani_analysis
tools/lint.py
lint.py
py
2,043
python
en
code
0
github-code
6
4789054179
# -*-coding:utf-8-*- from __future__ import absolute_import, unicode_literals import tensorflow as tf import numpy as np import os import matplotlib.pyplot as plt from Utils.ReadAndDecode_Continous import read_and_decode_continous val_path = '/home/dmrf/GestureNuaaTeam/tensorflow_gesture_data/Gesture_data/continous_...
DmrfCoder/Tensorflow_gesture
Predict/gesture_lstm_pb_predict.py
gesture_lstm_pb_predict.py
py
5,528
python
en
code
0
github-code
6
32908608834
numbers = [1, 2, 5, 7, 89, 90, 10, 20] evens = [] for n in numbers: if n % 2 == 0: evens.append(n * n) # list comprehension evens = [ n * n # add value for n in numbers # set to draw from if n % 2 == 0 # test for inclusion ] print(evens) results = [ (1, 2, 70.1), (2, 2, 80.0), ...
mikeckennedy/python_workshop_demos_april_2018
demos/ch5_pythonic/inline.py
inline.py
py
650
python
en
code
1
github-code
6
14884570447
# ['ๅŸบ้‡‘็ผ–ๅท', '่ดญไนฐๆˆๆœฌ', 'ๅŸบ้‡‘ๅ'] fundList = [ ['160212', '3.6730', ' ๅ›ฝๆณฐไผฐๅ€ผไผ˜ๅŠฟๆททๅˆ(LOF)'], ['001230', '1.2350', ' ้นๅŽๅŒป่ฏ็ง‘ๆŠ€่‚ก็ฅจ'] ] # ๅ‘้€ๅŸบ้‡‘ๆ—ฅๆŠฅ็š„้‚ฎ็ฎฑsmtpๆœๅŠกๅ™จๅœฐๅ€ senderIMAP = 'smtp.126.com' # ๅ‘้€ๅŸบ้‡‘ๆ—ฅๆŠฅ็š„้‚ฎ็ฎฑๅœฐๅ€ senderEmailAddress = 'xxxxxxx@126.com' # ๅ‘้€ๅŸบ้‡‘ๆ—ฅๆŠฅ็š„้‚ฎ็ฎฑ็š„smtpๆŽˆๆƒ็  senderAuthCode = 'SNRRQHKFKEUNNSFT' # ้‚ฎไปถไธป้ข˜ subject = 'ๅŸบ้‡‘ๆ—ฅๆŠฅ' # ๆŽฅๆ”ถๅŸบ้‡‘ๆ—ฅๆŠฅ็š„้‚ฎ็ฎฑๅœฐๅ€ r...
VinciJoy/FundMonitor
config.py
config.py
py
533
python
en
code
4
github-code
6
43247812084
import subprocess import os import shutil import pytest TEMP_DIRECTORY = os.path.join(os.path.dirname(__file__), '..', 'tmp') TEMP_HEADER = os.path.join(TEMP_DIRECTORY, 'header.h') TEMP_SOURCE = os.path.join(TEMP_DIRECTORY, 'source.c') def set_up(): os.mkdir(TEMP_DIRECTORY) def tear_down(): shutil.rmtree(...
BjoernLange/C-Mock-Generator
tests/generate_mock_integration_test.py
generate_mock_integration_test.py
py
1,290
python
en
code
0
github-code
6
11315559084
#coding:utf-8 import sys sys.path.insert(0, "./") import os os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" from flask import Flask from flask import render_template, redirect, url_for from flask import request, session, json from flask import jsonify from keywords.keywordExtract import getKeywords from parser.analysis_doc i...
nlp520/policy_web
app.py
app.py
py
8,806
python
en
code
0
github-code
6
26252618051
import pandas as pd import os import sys file = sys.argv[1] names = pd.read_csv("classroom.csv").Name for name in names: os.system("git -C repositories/{} pull".format(name)) os.system("cp ../quizzes/{}.py repositories/{}".format(file, name)) os.system("git -C repositories/{} add {}.py".format(name, file...
wllsena/Quizzes_FGV_PL
broker/copy_quiz.py
copy_quiz.py
py
463
python
en
code
1
github-code
6
10786193976
class User: def __init__(self, name, email): self.name = name self.email = email self.account_balance = 0 def make_deposit(self, amount): # takes an argument that is the amount of the deposit self.account_balance += amount # the specific user's account increases by the amount of ...
imjustinluck/fundamentals
oop/user.py
user.py
py
1,280
python
en
code
0
github-code
6
40696675203
import re from typing import NamedTuple, Optional from magma.magmad.check import subprocess_workflow class LscpuCommandParams(NamedTuple): pass class LscpuCommandResult(NamedTuple): error: Optional[str] core_count: Optional[int] threads_per_core: Optional[int] architecture: Optional[str] mo...
magma/magma
orc8r/gateway/python/magma/magmad/check/machine_check/cpu_info.py
cpu_info.py
py
2,341
python
en
code
1,605
github-code
6
43597353426
# Sets: unordered, mutable, no duplicates # initialize 01 movies = {"50 shades of grey", "365", "The dictator", "Borat"} # print(movies) # initialize 02 web_series = set(["Suits", "Lucifer", "Dark", "Friends"]) # print(web_series) # empty # web_series = set() # print(type(web_series)) # string initialize hello_set ...
akshitone/fy-mca-class-work
DivA/set.py
set.py
py
2,359
python
en
code
1
github-code
6
73510642747
class Solution: def topKFrequent(self, words: List[str], k: int) -> List[str]: mapp = defaultdict(int) heap = [] ans = [] for word in words: mapp[word] -= 1 for key,val in mapp.items(): heappush(heap,(val,key)) for _ in range(k): ...
yonaSisay/a2sv-competitive-programming
top-k-frequent-words.py
top-k-frequent-words.py
py
408
python
en
code
0
github-code
6
74197689149
import workAssyncFile from sora.prediction import prediction from sora.prediction.occmap import plot_occ_map as occmap import json import datetime import restApi import os def __clearName(name): name = "".join(x for x in name if x.isalnum() or x==' ' or x=='-' or x=='_') name = name.replace(' ', '_'...
linea-it/tno
container-SORA/src/main.py
main.py
py
2,969
python
en
code
1
github-code
6
72614657467
import time h = input('Enter hex: ').lstrip('#') RGB = tuple(int(h[i:i+2], 16) for i in (0, 2, 4)) r, g, b = RGB Ri = (r / 255) Gi = (g / 255) Bi = (b / 255) print("{:0.2f}, {:0.2f}, {:0.2f}".format(Ri, Gi, Bi)) time.sleep(10) exit()
maikirakiwi/pyscripts
hex2imgui.py
hex2imgui.py
py
246
python
en
code
0
github-code
6
7263711725
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import QMainWindow, QVBoxLayout, QWidget, QTabWidget from .movies_view import MoviesTab from .games_view import GamesTab from .music_view import MusicTab class Window(QMainWindow): """Main Window.""" def __init__(self, parent=None): """Initializer.""" ...
aisandovalm/media-library
media_library/views/main_view.py
main_view.py
py
1,186
python
en
code
0
github-code
6
11849550981
""" Created on Thu Dec 10 22:51:52 2020 @author: yzaghir Image Arthmeric Opeations Add - We can add two images with the OpenCV function , cv.add() -Resize the two images and make sur they are exactly the same size before adding """ # import cv library import cv2 as cv #import numpy as np # read image from c...
zaghir/python
python-opencv/arithmetic_operations_addition_and_subtraction.py
arithmetic_operations_addition_and_subtraction.py
py
906
python
en
code
0
github-code
6
36559608646
import scipy as sci import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import animation import scipy.integrate #Definitionen G=6.67408e-11 m_nd=1.989e+30 #Masse der Sonne r_nd=5.326e+12 v_nd=30000 t_nd=79.91*365*24*3600*0.51 K1=G*t_nd*m_nd/(r_nd**2*v...
Gauner3000/Facharbeit
Euler_Planetenbewegung_3D.py
Euler_Planetenbewegung_3D.py
py
3,103
python
en
code
0
github-code
6
6606964316
import sys from collections import deque MOVES = [(-1, 0), (0, 1), (1, 0), (0, -1)] input = sys.stdin.readline def isrange(x: int, y: int) -> bool: return 0 <= x < n and 0 <= y < n def get_lands(x: int, y: int, island: int) -> set[tuple[int, int]]: lands: set[tuple[int, int]] = set() que: deque[tuple[...
JeongGod/Algo-study
seonghoon/week06(22.02.01~22.02.07)/b2146.py
b2146.py
py
2,298
python
en
code
7
github-code
6
25926762211
from random import randint import numpy def fill_unassigned(row): ''' >>> a = numpy.array([1, 0, 5, 5, 0, 2]) >>> fill_unassigned(a) >>> a array([1, 3, 5, 5, 4, 2]) ''' usednums, c = set(row), 1 for i, x in enumerate(row): if x != 0: continue while c in used...
gitter-badger/tierbots
tierbots/worldgen/maze.py
maze.py
py
3,577
python
en
code
0
github-code
6
6635020953
# -*- coding:utf-8 -*- # ่ฏท่ฎพ่ฎกไธ€ไธชๅ‡ฝๆ•ฐ๏ผŒ็”จๆฅๅˆคๆ–ญๅœจไธ€ไธช็Ÿฉ้˜ตไธญๆ˜ฏๅฆๅญ˜ๅœจไธ€ๆกๅŒ…ๅซๆŸๅญ—็ฌฆไธฒๆ‰€ๆœ‰ๅญ—็ฌฆ็š„่ทฏๅพ„ใ€‚ # ่ทฏๅพ„ๅฏไปฅไปŽ็Ÿฉ้˜ตไธญ็š„ไปปๆ„ไธ€ไธชๆ ผๅญๅผ€ๅง‹๏ผŒ # ๆฏไธ€ๆญฅๅฏไปฅๅœจ็Ÿฉ้˜ตไธญๅ‘ๅทฆ๏ผŒๅ‘ๅณ๏ผŒๅ‘ไธŠ๏ผŒๅ‘ไธ‹็งปๅŠจไธ€ไธชๆ ผๅญใ€‚ # ๅฆ‚ๆžœไธ€ๆก่ทฏๅพ„็ป่ฟ‡ไบ†็Ÿฉ้˜ตไธญ็š„ๆŸไธ€ไธชๆ ผๅญ๏ผŒๅˆ™่ฏฅ่ทฏๅพ„ไธ่ƒฝๅ†่ฟ›ๅ…ฅ่ฏฅๆ ผๅญใ€‚ # # ไพ‹ๅฆ‚ # a b c e # s f c s # a d e e # ็Ÿฉ้˜ตไธญๅŒ…ๅซไธ€ๆกๅญ—็ฌฆไธฒ"bcced"็š„่ทฏๅพ„๏ผŒ # ไฝ†ๆ˜ฏ็Ÿฉ้˜ตไธญไธๅŒ…ๅซ"abcb"่ทฏๅพ„๏ผŒ # ๅ› ไธบๅญ—็ฌฆไธฒ็š„็ฌฌไธ€ไธชๅญ—็ฌฆbๅ ๆฎไบ†็Ÿฉ้˜ตไธญ็š„็ฌฌไธ€่กŒ็ฌฌไบŒไธชๆ ผๅญไน‹ๅŽ๏ผŒ # ่ทฏๅพ„ไธ่ƒฝๅ†ๆฌก่ฟ›ๅ…ฅ่ฏฅๆ ผๅญใ€‚ # -*- coding:utf-...
rh01/gofiles
offer/ex25/hasPath.py
hasPath.py
py
1,862
python
zh
code
0
github-code
6
7920943241
""" Neural Networks - Deep Learning Heart Disease Predictor ( Binary Classification ) Author: Dimitrios Spanos Email: dimitrioss@ece.auth.gr """ import numpy as np from cvxopt import matrix, solvers # ------------ # Kernels # ------------ def poly(x, z, d=3, coef=1, g=1): return (g * np.dot(x, z.T)...
DimitriosSpanos/SVM-from-Scratch
SVM.py
SVM.py
py
2,908
python
en
code
0
github-code
6
25354426984
class Solution: def majorityElement(self, nums: List[int]) -> int: d={} for i in nums: if i in d: d[i]+=1 else: d[i]=1 d=sorted(d, key=d.get, reverse=True) return(d[0])
nikjohn7/Coding-Challenges
LeetCode/May challenge/day6.py
day6.py
py
260
python
en
code
4
github-code
6
16413423811
from datetime import datetime, date, time import time from collections import OrderedDict def parametrized_decor(parameter): def decor(foo): def new_foo(*args, **kwargs): print(datetime.now()) print(f'ะ˜ะผั ั„ัƒะฝะบั†ะธะธ - {foo.__name__}') if args is not None: print(f'ะŸะพะทะธั†ะธะพะฝะฝั‹ะต ะฐั€ะณัƒะผะตะฝั‚ั‹ arg...
Smelkovaalla/4.5-Decorator
main.py
main.py
py
1,414
python
en
code
0
github-code
6
5654287369
from django.shortcuts import render from django.http import Http404, HttpResponse, JsonResponse from django.template import loader from catalog.models import * from django.forms.models import model_to_dict import random from django.views.decorators.csrf import csrf_exempt from django.middleware.csrf import get_token im...
jng27/Agile
psb_project/locallibrary/catalog/views.py
views.py
py
2,686
python
en
code
0
github-code
6
36606021901
import os import csv import queue import logging import argparse import traceback import itertools import numpy as np import tensorflow.compat.v1 as tf from fedlearner.trainer.bridge import Bridge from fedlearner.model.tree.tree import BoostingTreeEnsamble from fedlearner.trainer.trainer_master_client import LocalTra...
rain701/fedlearner-explain
fedlearner/fedlearner/model/tree/trainer.py
trainer.py
py
21,840
python
en
code
0
github-code
6
9419348557
# Time limit exceeded at sight # range(n + 1 -i) in the second roop # You don't need to add the third roop. # Alternatively, you should use (k =) n - i - j n , y= map(int, input().split()) for i in range(n + 1): for j in range(n + 1): for k in range(n + 1): if i + j + k == n: if...
ababa831/atcoder_beginners
first_trial/c_otoshidama.py
c_otoshidama.py
py
746
python
en
code
1
github-code
6
28912342142
import transformers import torch.nn as nn import config import torch class BERT_wmm(nn.Module): def __init__(self, keep_tokens): super(BERT_wmm,self).__init__() self.bert=transformers.BertModel.from_pretrained(config.BERT_PATH) self.fc=nn.Linear(768,768) self.layer_no...
Zibo-Zhao/Semantic-Matching
model.py
model.py
py
1,326
python
en
code
0
github-code
6
17940241021
def load_train_test(train_file, test_file): """ load data from train and test files out of the project Args: train_file: a string of train data address test_file: a string of test data address Returns: train_feature: none train_label: none test_feature: none ...
jingmouren/antifraud
antifraud/feature_engineering/load_data.py
load_data.py
py
1,312
python
en
code
0
github-code
6
36008540577
import sqlite3 import os import shlex class Database(): def __init__(self, db_file): """Connect to the SQLite DB""" try: self.conn = sqlite3.connect(db_file) self.cursor = self.conn.cursor() except BaseException as err: #print(str(err)) self.c...
echeadle/File_Track
app/sqlite_db.py
sqlite_db.py
py
3,901
python
en
code
0
github-code
6
33800228048
# BFS from collections import deque import sys input = lambda: sys.stdin.readline() def bfs(i, c): # ์ •์ , ์ƒ‰์ƒ q = deque([i]) visited[i] = True color[i] = c while q: i = q.popleft() for j in arr[i]: if not visited[j]: visited[j] = True q.append(...
devAon/Algorithm
BOJ-Python/boj-1707_์ด๋ถ„๊ทธ๋ž˜ํ”„.py
boj-1707_์ด๋ถ„๊ทธ๋ž˜ํ”„.py
py
2,065
python
en
code
0
github-code
6
42710543766
''' @ Carlos Suarez 2020 ''' import requests import datetime import time import json from cachetools import TTLCache import ssl import sys class MoodleControlador(): def __init__(self,domain,token,cert): self.domain = domain self.token = token self.cert = cert #Moodle LTI def ...
sfc-gh-csuarez/PyCollab
controladores/MoodleControlador.py
MoodleControlador.py
py
6,010
python
en
code
15
github-code
6
23423087794
import logging from ab.base import NavTable from ab.base import Link, Data, Item class Console (object): def __init__ (self): self._indent = 0 self._nt = NavTable() self.logger = logging.getLogger ('ab') self.log = lambda msg, level=logging.INFO: self.logger.info (msg) def r...
oftl/ab
ui.py
ui.py
py
2,324
python
en
code
0
github-code
6
44407906870
import wx import ResizableRuneTag ''' Created on 23/lug/2011 @author: Marco ''' class DrawableFrame(wx.Window): ''' Allows user to put resizable rune tags in a A4 like white frame Configuration realized on that frame is then replicated proportionally at export time ''' def __init__(self, parent, ...
mziccard/RuneTagDrawer
DrawableFrame.py
DrawableFrame.py
py
2,831
python
en
code
3
github-code
6
10423490633
from __future__ import annotations import pytest from randovania.lib import migration_lib def test_migrate_to_version_missing_migration() -> None: data = { "schema_version": 1, } with pytest.raises( migration_lib.UnsupportedVersion, match=( "Requested a migration fro...
randovania/randovania
test/lib/test_migration_lib.py
test_migration_lib.py
py
899
python
en
code
165
github-code
6
18680754942
import matplotlib.pyplot as plt import numpy as np import os import PIL import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.models import Sequential import pathlib data_dir = "./Covid(CNN)/Veriseti" data_dir = pathlib.Path(data_dir) image_count = len(list...
elifyelizcelebi/Covid-CNN
model.py
model.py
py
7,465
python
tr
code
0
github-code
6
44364880366
''' (mdc) Programa que lรช dois inteiro positivos a e b e imprime o mรกximo divisor comum (mdc) de a e b. ''' def mdc(a,b): while b !=0: resto = a % b a = b b = resto return a print("Informe o valor de A e B: ", end='') a, b = map(int, input().split()) print("MDC de {} e {} = {}".form...
danilosheen/topicos-especiais
q1.py
q1.py
py
342
python
pt
code
0
github-code
6
30478129230
# Reverse a Linked List in groups of given size # Normal Reverse def reverseList(head): if head is None: return -1 curr = head temp = None prev = None while curr: temp = curr.next curr.next = prev prev = curr curr = temp return prev # Rever...
prabhat-gp/GFG
Linked List/LL Medium/5_reverse_k.py
5_reverse_k.py
py
828
python
en
code
0
github-code
6
6117949220
from google.cloud import bigquery import os import sys import json import argparse import gzip import configparser import pandas as pd def main(): # Load args args = parse_args() In_config=args.in_config Input_study=args.in_study Configs = configparser.ConfigParser() Configs.read(In_config) ...
xyg123/SNP_enrich_preprocess
scripts/LDSC_format_single_sumstat.py
LDSC_format_single_sumstat.py
py
3,343
python
en
code
1
github-code
6
70075742268
# -*- encoding:utf-8 -*- ''' @time: 2019/12/21 9:48 ไธ‹ๅˆ @author: huguimin @email: 718400742@qq.com ''' import os import random import math import torch import argparse import numpy as np from util.util_data_gcn import * from models.word2vec.ecgcn import ECGCN from models.word2vec.ecgat import ECGAT from models.word2vec....
LeMei/FSS-GCN
train.py
train.py
py
15,194
python
en
code
14
github-code
6
40467350126
# 1๋ฒˆ ํ’€์ด # import sys # dx = [0,0,-1,1] # ์šฐ์ขŒ์ƒํ•˜ # dy = [1,-1,0,0] # def dfs(places, x, y,depth): # if depth == 3: # depth 3๊นŒ์ง€ ์ฐพ์•„๋ดค๋Š”๋ฐ ๊ฑฐ๋ฆฌ๋‘๊ธฐ ์ž˜ ์ง€ํ‚ค๋Š” ๊ฒฝ์šฐ True # return True # for i in range(4): # nx = x + dx[i] # ny = y + dy[i] # if 0<= nx <5 and 0<= ny <5 and visited[nx][ny] == 0 and pla...
Cho-El/coding-test-practice
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๋ฌธ์ œ/ํŒŒ์ด์ฌ/level2/๊ฑฐ๋ฆฌ๋‘๊ธฐ ํ™•์ธํ•˜๊ธฐ.py
๊ฑฐ๋ฆฌ๋‘๊ธฐ ํ™•์ธํ•˜๊ธฐ.py
py
4,381
python
en
code
0
github-code
6
10424276001
#-*- coding: utf-8 -*- u""" .. moduleauthor:: Martรญ Congost <marti.congost@whads.com> """ from cocktail.translations import translations from woost.models import Extension, Configuration translations.define("AudioExtension", ca = u"ร€udio", es = u"Audio", en = u"Audio" ) translations.define("AudioExtensi...
marticongost/woost
woost/extensions/audio/__init__.py
__init__.py
py
3,596
python
en
code
0
github-code
6
7640577991
test = 2+3 # ็ญ”ๆกˆๅญ˜ๅœจๆŒ‡ๅฎštest็‰ฉไปถ test # ๆœ€ๅพŒไธ€่กŒๆ‰“ๆŒ‡ๅฎš็‰ฉไปถๅ็จฑ import random x=[random.randint(0,100) for i in range(0,12)] x x0_str=str(x[0]) x0_str x_str=[str(x[i]) for i in range(0,len(x))] x_str x6_logi=x[6]<50 x6_logi x_logi=[x[i]<50 for i in range(0,len(x))] x_logi num_false=x_logi.count(False) num_false import pandas as pd df_bus...
godgodgod11101/course_mathEcon_practice_1081
hw1_ans.py
hw1_ans.py
py
2,367
python
en
code
0
github-code
6
6425852046
# ํ•œ์ž๋ฆฌ ์ˆซ์ž๊ฐ€ ์ ํžŒ ์ข…์ด ์กฐ๊ฐ์ด ํฉ์–ด์ ธ์žˆ์Šต๋‹ˆ๋‹ค. ํฉ์–ด์ง„ ์ข…์ด ์กฐ๊ฐ์„ ๋ถ™์—ฌ ์†Œ์ˆ˜๋ฅผ ๋ช‡ ๊ฐœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š”์ง€ ์•Œ์•„๋‚ด๋ ค ํ•ฉ๋‹ˆ๋‹ค. # ๊ฐ ์ข…์ด ์กฐ๊ฐ์— ์ ํžŒ ์ˆซ์ž๊ฐ€ ์ ํžŒ ๋ฌธ์ž์—ด numbers๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, # ์ข…์ด ์กฐ๊ฐ์œผ๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ์†Œ์ˆ˜๊ฐ€ ๋ช‡ ๊ฐœ์ธ์ง€ return ํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”. # ์ œํ•œ์‚ฌํ•ญ # numbers๋Š” ๊ธธ์ด 1 ์ด์ƒ 7 ์ดํ•˜์ธ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. # numbers๋Š” 0~9๊นŒ์ง€ ์ˆซ์ž๋งŒ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. # 013์€ 0, 1, 3 ์ˆซ์ž๊ฐ€ ์ ํžŒ ์ข…์ด ์กฐ๊ฐ์ด ํฉ์–ด์ ธ์žˆ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. def find_prime(n...
script-brew/2019_KCC_Summer_Study
programmers/Lv_2/MaengSanha/findPrime.py
findPrime.py
py
1,326
python
ko
code
0
github-code
6
7868827179
# ๅ…ฅๅŠ› N = int(input()) S = input() # '(' ใฎๆ•ฐ - ')' ใฎๆ•ฐใ‚’ depth ใจใ™ใ‚‹ # ้€”ไธญใง depth ใŒ่ฒ ใซใชใฃใŸใ‚‰ใ€ใ“ใฎๆ™‚็‚นใง No depth = 0 flag = True for i in range(N): if S[i] == '(': depth += 1 if S[i] == ')': depth -= 1 if depth < 0: flag = False # ๆœ€ๅพŒใ€depth = 0 ['(' ใจ ')' ใฎๆ•ฐใŒๅŒใ˜] ใงใ‚ใ‚‹ใ‹ใ‚‚่ฟฝๅŠ ใงๅˆคๅฎšใ™ใ‚‹ if flag == True and depth == 0: print("Yes") els...
E869120/math-algorithm-book
codes/python/Code_5_10_4.py
Code_5_10_4.py
py
430
python
ja
code
897
github-code
6
33447423792
#Kieren Singh Gill #11/10/2020 #Python Fall 2020, Section 1 #GillKieren_Assign8_extra_credit.py #import random module import random import sys #cards list cards = ['10 of Hearts', '9 of Hearts', '8 of Hearts', '7 of Hearts', '6 of Hearts', '5 of Hearts', '4 of Hearts', '3 of Hearts', '2 of Hearts', 'Ace of Hearts', ...
kierengill/CS002-Intro-To-Programming
Assignment 8/GillKieren_Assign8_extra_credit.py
GillKieren_Assign8_extra_credit.py
py
4,617
python
en
code
0
github-code
6
21367959963
from socket import socket from os import system from time import sleep s = socket() s.bind(('localhost', 50550)) s.listen(1) while True: try: conn, addr = s.accept() conn.close() except KeyboardInterrupt: sleep(0.2) system('clear') system('git -P adog')
CodeTriangle/gitviz
watcher.py
watcher.py
py
298
python
en
code
0
github-code
6