seq_id stringlengths 7 11 | text stringlengths 156 1.7M | repo_name stringlengths 7 125 | sub_path stringlengths 4 132 | file_name stringlengths 4 77 | file_ext stringclasses 6
values | file_size_in_byte int64 156 1.7M | program_lang stringclasses 1
value | lang stringclasses 38
values | doc_type stringclasses 1
value | stars int64 0 24.2k ⌀ | dataset stringclasses 1
value | pt stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
* commandline 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.