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
38527310676
from cqpy import settings, cqp from cqpy.events import on, EventType, Event @on(EventType.Enable) def on_enable(event: Event): """ 机器人上线 demo :param event: :return: """ if 'master' in settings: cqp.send_private_msg(settings['master'], '我上线啦!') else: cqp.add_log(10, __name_...
nnnewb/CQPy
cqpy/tutorial.py
tutorial.py
py
1,451
python
en
code
1
github-code
36
10024409616
import csv import operator import decimal import numpy as np import matplotlib.pyplot as pl import calendar import sys import os.path h = open('../results/MonthlyTurnoverOldCerrado.csv','rb') data = csv.reader(h) months = [] bints = [] seasons = [] boundarys = [] sumprecips = [] avghumid = [] avgvisits = [] for col...
musikzauberin/buzz
code/OldCode/plotting2.py
plotting2.py
py
828
python
en
code
0
github-code
36
39277796402
from PIL import Image, ImageSequence from generators import Generator class OverlayGenerator(Generator): ALLOWED_OVERLAYS = { "fire.gif": "burning", "fire2.gif": "burning", "sparkle.gif": "sparkling", "sparkle2.gif": "sparkling", "loving.gif": "loving", } def __in...
grdaneault/emojigen
api/generators/overlay.py
overlay.py
py
2,116
python
en
code
0
github-code
36
21597631585
import random class Parameters(object): prob_m = 0.65 prob_f = 0.55 prob_q = 0.5 insect_num = 100 insect_iteration = 180 scenario_num = 100 x = 200 y = 200 step = 10 sample_num = 180 iteration = 50 pop_num = 50 test = True insect_fall_machine = 1 eliminated_number = 3*pop_num-5 archive_maximum = 50...
Djiahui/insect
parameters.py
parameters.py
py
603
python
en
code
0
github-code
36
40741554583
import os import time def watch_for_shutdown_file(): directory = os.path.dirname(os.path.realpath(__file__)) shutdown_file = os.path.join(directory, "cmd.shutdown.tmp") update_file = os.path.join(directory, "cmd.update.tmp") update_script = os.path.join(directory, "update.sh") while True: ...
playablestreets/the-plants
config/plants.watcher.py
plants.watcher.py
py
706
python
en
code
0
github-code
36
22577730329
''' Created on 06.12.2013 @author: hfrieden Import an Arma 2/Arma 3 unbinarized MDL file ''' import struct import bpy import bmesh import os.path as path import ArmaToolbox import ArmaTools def getLayerMask(layer): res = [False, False, False, False, False, False, False, False, False, False, ...
AlwarrenSidh/ArmAToolbox
ArmaToolbox/MDLImporter.py
MDLImporter.py
py
18,846
python
en
code
70
github-code
36
30509808806
#!/home/meichen/anaconda3/bin/python import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import glob import matplotlib.ticker as mticker from matplotlib.ticker import StrMethodFormatter, NullFormatter def main(): data = pd.read_csv('pairsfile_rgp_select.csv',skipinitialspace=True) ...
meichenl95/SR_deepfocus
figures/egfs_one.py
egfs_one.py
py
2,853
python
en
code
0
github-code
36
37407869802
import pandas as pd import numpy as np from sklearn.model_selection import train_test_split import os import shutil df = pd.read_csv('../data/speakers_all.csv') df.drop(columns=['Unnamed: 9', 'Unnamed: 10', 'Unnamed: 11'], inplace=True) df_full = df[df['file_missing?'] == False] df_full['sex'] = df_full['sex'].apply(l...
acaldwell93/Accent-Classification
src/create_train_test_directories.py
create_train_test_directories.py
py
1,769
python
en
code
0
github-code
36
2888068360
# -*- coding: utf-8 -*- from __future__ import absolute_import import json import logging from tornado.escape import json_encode from tornado.escape import json_decode from tornado.escape import utf8 from .constant import * logger = logging.getLogger('server.' + __name__) class JsonStream: def __init__(self, ...
All-less/exotic-server
lib/json_stream.py
json_stream.py
py
1,023
python
en
code
2
github-code
36
8550138978
from urllib.request import urlopen import plotly.graph_objs as go import plotly.express as px import pandas as pd import plotly import json import os data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..\..', 'data')) usa_data_dir = os.path.join(data_dir, 'usa') csv_dir = os.path.join(usa_data_dir, '...
vinitshah24/Coronavirus-Analysis
src/usa/data_plots.py
data_plots.py
py
3,402
python
en
code
0
github-code
36
70786129065
from Bio.Seq import Seq import os def parse_query_results(path): """ This fucntion will p[arse the query results :param path: The path of the file that contains the query results :return: An array that contains the results described in the file """ file = open(path,"r") results = [] for ...
guys79/BioInformaticsProject
main.py
main.py
py
11,616
python
en
code
0
github-code
36
36955780399
from wiredtiger import stat from wtdataset import SimpleDataSet from wtscenario import make_scenarios from rollback_to_stable_util import test_rollback_to_stable_base def mod_val(value, char, location, nbytes=1): return value[0:location] + char + value[location+nbytes:] # test_rollback_to_stable04.py # Test that ...
mongodb/mongo
src/third_party/wiredtiger/test/suite/test_rollback_to_stable04.py
test_rollback_to_stable04.py
py
7,749
python
en
code
24,670
github-code
36
21418641611
import ismrmrd import os import itertools import logging import numpy as np import numpy.fft as fft import ctypes import mrdhelper from datetime import datetime # Folder for debug output files debugFolder = "/tmp/share/debug" def groups(iterable, predicate): group = [] for item in iterable: group.app...
HMS-CardiacMR/MyoMapNet
InLine_Implementation/Code/simplefft.py
simplefft.py
py
4,004
python
en
code
23
github-code
36
19865653500
import streamlit as st import base64 import os from nbanalyzer import * from PIL import Image import time script_directory = os.getcwd() PROGRESS_BAR_CUSTOM_COLOR = '#f63366' ordinal = lambda n: "%d%s" % (n,"tsnrhtdd"[(n//10%10!=1)*(n%10<4)*n%10::4]) def load_data(year: int, stat_type: str): if stat_type == 'pla...
tta13/NBA-Stats-Explorer
nba_app.py
nba_app.py
py
9,140
python
en
code
2
github-code
36
30123704876
from base.game_2048 import game_2048 import copy class game_2048_power_state_custom_score(game_2048): def get_state(self): state = self.board.flatten() powers_state = [] for el in state: power = 0 while el > 1: power += 1 el /= 2 ...
daneel95/Master_Homework
SecondYear/TextMining/Homework/2048/games/game_2048_power_state_custom_score.py
game_2048_power_state_custom_score.py
py
1,306
python
en
code
0
github-code
36
24389916144
import os.path import warnings from collections import defaultdict from itertools import chain from . import builtin from .. import options as opts from .file_types import static_file from .path import relname from ..backends.compdb import writer as compdb from ..backends.make import writer as make from ..backends.nin...
jimporter/bfg9000
bfg9000/builtins/link.py
link.py
py
25,450
python
en
code
73
github-code
36
10865887350
# # Python based OpenWhisk action that sleeps for the specified number # of milliseconds before returning. # The function actually sleeps slightly longer than requested. # # @param parm Object with Number property sleepTimeInMs # @returns Object with String property msg describing how long the function slept # import s...
seashell-hb/incubator-openwhisk
tests/dat/actions/sleep.py
sleep.py
py
642
python
en
code
null
github-code
36
21331900027
import numpy as np import pandas as pd from os.path import join, dirname from copy import deepcopy from sostrades_core.tools.base_functions.exp_min import compute_dfunc_with_exp_min, compute_func_with_exp_min from climateeconomics.core.core_resources.resource_model.resource_model import ResourceModel from energy_mode...
os-climate/witness-core
climateeconomics/core/core_resources/models/platinum_resource/platinum_resource_model.py
platinum_resource_model.py
py
5,764
python
en
code
7
github-code
36
31347480186
from PIL import Image from gcbmanimation.util.tempfile import TempFileManager Image.MAX_IMAGE_PIXELS = None class Frame: ''' Represents a presentation-format image that can be included in an animation. A frame usually applies to a particular year and points to an image file on disk. Arguments: 'ye...
moja-global/GCBM.Animation
gcbmanimation/animator/frame.py
frame.py
py
4,162
python
en
code
1
github-code
36
8379980336
from sys import argv from panda3d.core import Vec3 from pandac.PandaModules import loadPrcFileData loadPrcFileData('configurate', 'window-title Loading') from direct.directbase import DirectStart from direct.task import Task from direct.actor.Actor import Actor from direct.gui.DirectGui import * from pandac.PandaModule...
ronanwow1001/Toontown-1
Landwalker Example.py
Landwalker Example.py
py
63,531
python
en
code
0
github-code
36
26014460878
from ..h2o import random_forest from .estimator_base import H2OEstimator class H2ORandomForestEstimator(H2OEstimator): def __init__(self,mtries=None,sample_rate=None,build_tree_one_node=None,ntrees=None, max_depth=None,min_rows=None,nbins=None,nbins_cats=None, binomial_double_trees=None...
tomasgreif/h2o-3
h2o-py/h2o/estimators/random_forest.py
random_forest.py
py
807
python
en
code
null
github-code
36
12478884070
import json import os import cv2 import numpy as np import numpy.matlib import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.animation as animation # change IDs to your IDs. ID1 = '206299463' ID2 = '312497084' ID = "HW3_{0}_{1}".format(ID1, ID2) RESULTS = 'results' os.makedirs(RESUL...
StudentYuval/VP2023
ex3/particle_filter.py
particle_filter.py
py
11,564
python
en
code
0
github-code
36
9915451095
def add_piece(music_list, song, information): new_singer = information[2] new_key = information[3] if song not in music_list: music_list[song] = {'composer': new_singer, 'key': new_key} print(f'{song} by {new_singer} in {new_key} added to the collection!') else: print(f"{song} is...
qceka88/Fundametals-Module
003 - Previous final Exams/01 Final Exam - Retake/03the_pianist.py
03the_pianist.py
py
6,378
python
en
code
8
github-code
36
12545797664
#!/usr/bin/env python def check_path(fp): import os if not os.path.exists(fp): raise FileNotFoundError("Could not find the file {}".format(fp)) def main(sew_file, orb_file, hdf_file, symmetry, index): import re import numpy as np import h5py print(' ') print(' M U L L I K...
gaurabganguly1989/molcas_mo2ao_weights
molcas_ao_weights.py
molcas_ao_weights.py
py
9,516
python
en
code
0
github-code
36
30722628061
#baekjoon_1072_게임 #=== import module ===# #=== variable declare ===# #=== Function define ===# #=== main function ===# x,y = map(int,input().split()); #게임 횟수, 이긴 횟수 currentRate = y*100 // x; if currentRate >= 99: print(-1); exit(0); high = 1000000000; row = 0; result = -1; while(row <= high): mid = (high + row)...
Hoony0321/Algorithm
2021_12/29/code.py
code.py
py
504
python
en
code
0
github-code
36
18873944718
from decimal import Decimal from background.celery_app import app as celery_app from services.csmoney import DotaDataProcessor from settings.config import SERVICES, CSMONEY from models.dota.item import DotaItem from models.dota.hero import Hero from models.dota.service_price import ServicePrice from models.dota.specifi...
NeKadgar/game_market_items_base
background/tasks/item_base.py
item_base.py
py
2,243
python
en
code
0
github-code
36
16627412673
''' ***************************************************************************************** * * ================================================= * Pharma Bot Theme (eYRC 2022-23) * ================================================= * * This script is intended for implementation of Ta...
advait-0/eyrc22_PB_3004
Task 4/Task 4A/task_4a.py
task_4a.py
py
20,080
python
en
code
3
github-code
36
26493496083
from django.urls import path from .import views urlpatterns = [ path("", views.index, name="storehome"), path("about/", views.about, name="aboutus"), path("contact/", views.contact, name="contactus"), path("Seller/", views.seller, name="sellerid"), #Seller/ is the html file name not t...
princegupta003005/E-commerce-Website
Anapp/store/urls.py
urls.py
py
697
python
en
code
0
github-code
36
5213223570
from queue import Queue class MovingAverage: def __init__(self, size: int): """ Initialize your data structure here. """ self.rolling_sum = 0 self.size = size self.q = Queue() def next(self, val: int) -> float: self.q.put(val) self.rolling_sum ...
tugloo1/leetcode
problem_346.py
problem_346.py
py
605
python
en
code
0
github-code
36
40857469466
import requests import show_route import serial class Navi_auto: def __init__(self): self.key = '1b1779b2176bc8d85a93f9aef22b8a53' self.latitude = 1 self.longitude = 0 self.start_coordinate = [116.481028, 39.989643] self.desti_coordinate = [116.434446, 39.90816] sel...
haiboCode233/KivyPlusAR
GPSAPI.py
GPSAPI.py
py
4,415
python
en
code
0
github-code
36
12151884978
import torch # noqa from model import softmax_classifier from model import softmax_classifier_backward from model import cross_entropy from utils import Metric, accuracy # noqa __all__ = ['create_model', 'test_epoch', 'test_epoch', 'train_loop'] ################################################# # create_model ###...
antebi-itai/Weizmann
DL for CV/HW1/Solution/Code/train.py
train.py
py
5,534
python
en
code
0
github-code
36
17232778502
import cv2 import numpy as np def bitmap(n): map = [] for i in range(256): if i & pow(2, n-1) == pow(2, n-1): map.append(255) else: map.append(0) print(map) return map def bitimage(x, n): image = x.copy() height, width = image.shape ...
VJaGG/digital-image-processing
chapter2/3.2.4.2、bitmaplayer.py
3.2.4.2、bitmaplayer.py
py
1,805
python
en
code
0
github-code
36
1071457395
from Module import getattendance,sendmail,gettime users={'Prajay':['160117735101','160117735101','mprajay999@gmail.com']} if __name__=='__main__': for name in users: try: attendance = getattendance(users[name][0], users[name][1]) print(attendance) sendmail(us...
mprajay999/Attendance-Notifier
Main.py
Main.py
py
438
python
en
code
1
github-code
36
34781259647
import h5py import numpy as np filename = 'weight_imgnet_ker5_h5/ResNet_18_ker5.h5' h5f = h5py.File(filename, 'r') cvsfmt = '%.18e' # covers upto float128 # get a List of data sets in group 'dd48' # print('h5f:', h5f.shape) # Get the data lv0_keys = list(h5f.keys()) print("lv0: ", lv0_keys) for keys0 in lv0_keys: ...
dwkim606/lattigo_conv
imgnet_read_h5.py
imgnet_read_h5.py
py
1,175
python
en
code
0
github-code
36
28522686817
from urbansim.abstract_variables.abstract_distance_to_SSS_dataset import abstract_distance_to_SSS_dataset class distance_to_SSS_dataset(abstract_distance_to_SSS_dataset): """distance of parcel centroid to nearest SSS dataset point, id name = dataset name_id, e.g. for busstop dataset, busstop_id x ...
psrc/urbansim
urbansim_parcel/parcel/distance_to_SSS_dataset.py
distance_to_SSS_dataset.py
py
1,645
python
en
code
4
github-code
36
38930132887
""" from pytube import Playlist import pytube itemlist = {} playlist = Playlist("") for item in playlist: j = pytube.YouTube(item).title.title() oi = pytube.YouTube(item).metadata.metadata print(oi) print(j) itemlist[j] = [item, oi] print(itemlist) from mutagen.easyid3 import EasyID3 audio = Eas...
Suave101/pytube-AHHHHHH
Tags.py
Tags.py
py
903
python
en
code
0
github-code
36
17217695574
from extras import * from common import Common from indexer import Indexer import math import re import nltk import operator from collections import defaultdict, OrderedDict from nltk.stem import SnowballStemmer from nltk.corpus import wordnet class Query_Expansion: def __init__(self): """ Constr...
ghildiyal-ashutosh/Search_Engine
tasks/query_expansion.py
query_expansion.py
py
6,739
python
en
code
2
github-code
36
33057055793
from flask import request from app import app from app.service import get_value, set_value, add_set, get_set, set_expiry, range_elements, rank #End point for GET, SET and EXPIRE command @app.route('/redis/key',methods=['POST','GET','PATCH']) def keyDetails(): if request.method == "GET": key = request.form[...
shreyans-sureja/Redis-Implementation
app/routes.py
routes.py
py
1,651
python
en
code
0
github-code
36
43008845296
import pytest from sqlobject import DatabaseIndex, ForeignKey, IntCol, MultipleJoin, \ SQLObject, StringCol from sqlobject.dberrors import DatabaseError, IntegrityError, \ OperationalError, ProgrammingError from sqlobject.tests.dbtest import raises, setupClass, supports #######################################...
sqlobject/sqlobject
sqlobject/tests/test_indexes.py
test_indexes.py
py
3,088
python
en
code
140
github-code
36
27283710636
""" 2020 (c) piteren """ class TE: def __init__(self): self.pa = 3 self.pb = 'text' def __str__(self): return f'pa:{self.pa} pb:{self.pb}' t = TE() print(t.__dict__) t.__dict__['pa'] = 4 print(t.__dict__) print(t)
piteren/pypoks
code_concepts/dict_attr.py
dict_attr.py
py
252
python
en
code
19
github-code
36
74551961384
#!/usr/bin/env python3 # encoding:utf-8 ''' @author: lierl @file: use_enum.py @time: 2018/3/24 17:31 ''' __author__ = 'lierl' from enum import Enum, unique Month = Enum('Month',('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')) for name, member in Month.__members__.items(): print(name, '=...
dream7319/djtest
demo/use_enum.py
use_enum.py
py
1,187
python
en
code
0
github-code
36
39056277589
from matplotlib import pyplot as plt vr=[2.6,2.8,3.0,3.1,3.2,3.3,3.4,3.6] VR=[48.37,57.55,64.92,69.12,72.82,74.12,73.1,67.66] plt.plot(vr,VR,'k',lw=1.5) plt.scatter(vr,VR,marker='+',s=90,lw=1.5) plt.grid() plt.xlabel('Rupture speed (km/s)') plt.ylabel('Variance reductio (%)') plt.show()
Ogweno/mylife
Nepal/plot_rupt_speed.py
plot_rupt_speed.py
py
290
python
en
code
0
github-code
36
13662077877
import tensorflow as tf from .network import Network from ..fast_rcnn.config import cfg class Resnet50_train(Network): def __init__(self, trainable=True): self.inputs = [] self.data1 = tf.placeholder(tf.float32, shape=[None, None, None, 3], name='data1') self.data2 = tf.placeholder(tf.flo...
lonl/DRoINs
lib/networks/Resnet50_train.py
Resnet50_train.py
py
16,743
python
en
code
0
github-code
36
4881635428
from chain import ChainObject import os ## # given vatic identifier string create vatic text file path class Ims2Txt(ChainObject): _consumer_ = [str] _producer_ = [str] def __init__(self, prms='~/vatic/vatic'): """ :param prms: location of vatic directory """ self.vaticPath = prms ChainObject.__init__(s...
gnetscher/chainer
vatic_chains.py
vatic_chains.py
py
2,775
python
en
code
0
github-code
36
3389898458
import random class Card: """Represents all the cards in the game""" def __init__(self): self.suits = ['Heart', 'Diamond', 'Spade', 'Club'] self.ranks = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A'] self.deckCards = [] def deck(self): """Creates a new deck of 52 cards ...
manideepa03/WarCardGame
WarGame.py
WarGame.py
py
5,325
python
en
code
0
github-code
36
22683081485
from tensorforce.execution.runner import Runner import numpy as np import time class DeepCrawlRunner(Runner): def __init__(self, agent, environment, max_episode_timesteps=None, history=None, curriculum = None): self.mean_entropies = [] self.std_entropies = [] self.history = history ...
SestoAle/Adaptive-NPCs-with-procedural-entities
deepcrawl_runner.py
deepcrawl_runner.py
py
7,100
python
en
code
2
github-code
36
43376024848
import RPi.GPIO as GPIO from basemode import BaseMode from time import sleep import os from random import choice, randint import threading import multiprocessing class PiPlayBoxMode(BaseMode): def setup(self): self.SOUND = 1 self.LCD = 2 self.LCDCOLOUR = 4 self.TRAFFICLIGHT = 8 ...
elParaguayo/PiPlayBox
modes/lights/mode.py
mode.py
py
2,266
python
en
code
3
github-code
36
72274077545
print("C++ Getters/Setters Generator") print("By hiraki\n") seperate = input("Do you want to seperate the declaration and the implementation? [Y/N]: ").lower() if (seperate == "y"): seperate = True classname = input("Enter class name: ") else: seperate = False print("\nPlease enter the member ...
hungngocphat01/cpp-getter-setter-generator
getter-setter-generator.py
getter-setter-generator.py
py
2,201
python
en
code
0
github-code
36
19788170743
#!/usr/bin/env python # -*- coding:utf-8 -*- import re import math import codecs import random import numpy as np import os import jieba import pickle import shutil jieba.initialize() def zero_digits(s): """将0~9数字字符统一用"0"字符取代 """ return re.sub('\d', '0', s) def load_sentences(path, lower, zeros): ...
churximi/Car-NER
data_utils.py
data_utils.py
py
14,187
python
en
code
0
github-code
36
41249722421
#!/usr/bin/env python3 #-*- encoding: UTF-8 -*- """Escreva um programa que leia a quantidade de dias, horas, minutos e segundos do usuário. Calcule o total em segundos.""" def main(): dias = int(input("Informe a quantidade de dias: ")) horas = int(input("Informe a quantidade de horas: ")) minutos = int(in...
luizfelipe1914/python4zumbis
Lista01/Q03.py
Q03.py
py
559
python
pt
code
0
github-code
36
71636332263
from miniMax import * from tree_parser import * from alphaBeta import * #filename = sys.argv[1] #print ("hello world! " + filename) #data_list = parse_data_as_list(filename) data_tree = GameTree() #data_tree.build_tree(data_list) #data_tree.armarArbol(1,3) data_tree.armarArbol([99,0,0,0,0,0],[99,99,0,0, 99,0],3) mi...
jpcifuentes16/Dots-And-Boxes-Ai
con MiniMax/main.py
main.py
py
484
python
en
code
0
github-code
36
37350976457
"""Zero-field splitting. See:: Spin decontamination for magnetic dipolar coupling calculations: Application to high-spin molecules and solid-state spin qubits Timur Biktagirov, Wolf Gero Schmidt, and Uwe Gerstmann Phys. Rev. Research 2, 022024(R) – Published 30 April 2020 """ from math import pi fr...
f-fathurrahman/ffr-learns-gpaw
my_gpaw/zero_field_splitting.py
zero_field_splitting.py
py
7,481
python
en
code
0
github-code
36
39804372033
from core_operations.models import US_COUNTRY_CODE, NUMBER_OF_DAYS_IN_A_YEAR, LIST_OF_STATES_IN_US from core_operations.models import FormattedPhoneNumberField, YearsOfWorkField from django.db import models import re from datetime import date from datetime import datetime # from internal_users.models import InternalUse...
zjgcainiao/new_place_at_76
talent_management/models.py
models.py
py
12,604
python
en
code
0
github-code
36
36788048136
from pydantic import BaseSettings, BaseModel from pathlib import Path from .languages import WIKIPEDIA_LANGS import toml class Settings(BaseSettings): status: str = "unknown" logging_chat: int = None db_path: Path = Path("jdanbot.db") music_path: Path = Path("media/music") admin_notes: list[s...
jDan735/jdan734-bot
bot/config/config.py
config.py
py
1,254
python
en
code
5
github-code
36
34182105193
import time from unittest import skip from qiskit.providers.jobstatus import JobStatus from qiskit_ibm_runtime.exceptions import RuntimeJobTimeoutError from ..unit.mock.proxy_server import MockProxyServer, use_proxies from ..ibm_test_case import IBMIntegrationJobTestCase from ..decorators import run_integration_test ...
Qiskit/qiskit-ibm-runtime
test/integration/test_results.py
test_results.py
py
9,622
python
en
code
106
github-code
36
74754794343
def get_employees(): db1 = {} key = 1 while key == 1: name = input("Введите имя рабочего:\n") salary = int(input(f"Введите зарплату, которую получает {name}:\n")) db = {name: salary} db1.update(db) exit_ = input("Продолжить?:\n") if exit_ == "да": ...
VadimZ92/Import_Module_Package
application/db/people.py
people.py
py
444
python
ru
code
0
github-code
36
10210350419
from sklearn import datasets from sklearn.impute import SimpleImputer from sklearn.model_selection import train_test_split import pandas as pd import numpy as np # Multiclass Classification Datasets def load_mnist(): mnist = datasets.load_digits(as_frame=True) mnist_X, mnist_y = mnist.data, mnist.target ...
eccabay/CMA-ES_hyperparameters
load_data.py
load_data.py
py
6,168
python
en
code
0
github-code
36
8890281336
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 18 11:28:15 2017 @author: vitorhadad """ import torch from torch import nn, cuda from torch.autograd import Variable import torch.nn.functional as F from torch import optim import numpy as np from torch.nn.utils.rnn import pack_padded_sequence, pa...
halflearned/organ-matching-rl
matching/deep_ml/count_lstm.py
count_lstm.py
py
6,722
python
en
code
2
github-code
36
8519295436
import pygame import Snake, Apple import os os.environ['SDL_VIDEO_CENTERED'] = '1' pygame.mixer.pre_init(44100, -16, 1, 512) pygame.init() pygame.display.set_caption("Sssssnake") # 10x10 segments winwidth = 200 winheight = 240 win = pygame.display.set_mode((winwidth, winheight)) # segment - 20x20px segsize = 20 sna...
TZdybel/Games-with-Pygame
snake/main.py
main.py
py
3,681
python
en
code
0
github-code
36
38516174008
# pip install uszipcode import pandas as pd from uszipcode import SearchEngine search = SearchEngine(simple_zipcode=False) def add_coordinates(df): '''Input: a pandas dataframe which includes a 'Zip' field representing a US zip code. Output: dataframe with 'lat' and 'lng' fields added which represent...
dslachar/analysis_of_crp_data
add_coordinates.py
add_coordinates.py
py
3,241
python
en
code
0
github-code
36
19840085119
import numpy as np import tensorflow as tf from mpl_toolkits import mplot3d from d2l import tensorflow as d2l def f(x): return x ** 2 def f_grad(x): return 2 * x def gd(eta, f_grad): x = 10.0 results = [x] for i in range(10): x -= eta * f_grad(x) results.append(float(x)) pr...
AnhVietPham/Deep-Learning
optimization-algrithms/gradient-descent/main.py
main.py
py
1,568
python
en
code
0
github-code
36
10713162688
import os import mujoco_py import numpy as np from mujoco_py import functions from learn_seq.utils.general import get_mujoco_model_path # object indicator in mujoco MJ_SITE_OBJ = 6 # `site` objec MJ_BODY_OBJ = 1 # `body` object MJ_GEOM_OBJ = 5 # `geom` object # geom types MJ_CYLINDER = 5 MJ_BOX = 6 MJ_MESH = 7 ...
deanpham98/learn-seq
learn_seq/utils/mujoco.py
mujoco.py
py
9,113
python
en
code
3
github-code
36
31458300119
import pygame import jumpingHorses.constants as Constants from .constants import BLACK_PIECE, WHITE_PIECE, MOVE_COLOR, MOVE_RADIUS, SQUARE_SIZE, WIDTH, HEIGHT, LETTER_GAP_SIZE, OUTLINE_SIZE from .board import Board from menu.main_menu import MainMenu import menu.gameState as GameState class GameMaster: #in...
perkonss/AI1darbs
jumpingHorses/game_master.py
game_master.py
py
3,699
python
en
code
0
github-code
36
29116232633
# -*- coding:utf-8 -*- # 这道题对于Python来说似乎没有意义 # 在Python中字符串类型是不可变类型,即不可以在原处修改 class Solution: # s 源字符串 def replaceSpace(self, s): s = s.replace(' ', '%20') return s if __name__=='__main__': s = Solution() string = "we are happy" print(s.replaceSpace(string))
hushaoqi/The_sword_refers_to_offer
5替换空格.py
5替换空格.py
py
373
python
en
code
0
github-code
36
10794984259
from absl.testing import absltest from absl.testing import parameterized import more_itertools import tensorflow as tf from uncertainty_baselines.datasets import datasets import data_preprocessor # local file import from experimental.language_structure.vrnn import data_utils # local file import from experimental.lang...
HeyGF/uncertainty-baselines
experimental/language_structure/vrnn/data_preprocessor_test.py
data_preprocessor_test.py
py
4,004
python
en
code
null
github-code
36
38568112529
import collections class Solution: def findLucky(self, arr) : count = collections.Counter(arr) max_count = -1 for key in count : if key == count[key]: max_count = max(max_count, key) return max_count s = Solution() print(s.findLucky([4,2,3...
archanakalburgi/Algorithms
daily_log/27_aug/lucky_num.py
lucky_num.py
py
561
python
en
code
1
github-code
36
13974889908
# 1. UPDATE VALUES IN DICTIONARIES AND LISTS x = [ [5,2,3], [10,8,9] ] students = [ {'first_name': 'Michael', 'last_name' : 'Jordan'}, {'first_name' : 'John', 'last_name' : 'Rosales'} ] sports_directory = { 'basketball' : ['Kobe', 'Jordan', 'James', 'Curry'], 'soccer' : ['Messi', 'Ronaldo', ...
Brad-Stewart/Projects
functions_intermediate_2.py
functions_intermediate_2.py
py
2,216
python
en
code
0
github-code
36
43046744636
import typing from datetime import datetime from discord import Activity, ActivityType, Embed, Game, HTTPException, Status, Member, User, TextChannel, VoiceChannel, Role, Invite, Game, Emoji, PartialEmoji, Colour from discord.ext import commands from discordbot.botmodules import serverdata, audio from discordbot.conf...
AlexeiSur/bot12345
discordbot/bot.py
bot.py
py
8,041
python
en
code
0
github-code
36
73603910825
from flask import Flask from bitrix24 import * import pycep_correios app = Flask(__name__) @app.route('/<id>', methods=['POST','GET']) def cep(id): bx24 = Bitrix24('https://megaisencoes.bitrix24.com.br/rest/XXXX/XXXXXXX/') dealId = id chamada= bx24.callMethod("crm.deal.get", id=dealId) ...
Gabriandl/Projetos-Mega
addCep/addCep.py
addCep.py
py
2,148
python
pt
code
1
github-code
36
15538629853
#!/usr/bin/env python # coding: utf-8 # In[63]: from PIL import Image, ImageDraw import numpy as np import math import imageio from copy import deepcopy import cv2 def to_integral_image(img_arr): """ Calculates the integral image based on this instance's original image data. """ row_sum = np.zeros(...
lizihao1999/Viola-Jones
hw4.py
hw4.py
py
9,985
python
en
code
2
github-code
36
35000637382
import numpy as np def compute_errors(gt, pred): """Computation of error metrics between predicted and ground truth depths Taken from Beyond Image to Depth Github repository """ # Select only the values that are greater than zero mask = gt > 0 pred = pred[mask] gt = gt[mask] thr...
AmandineBtto/Batvision-Dataset
UNetSoundOnly/utils_criterion.py
utils_criterion.py
py
995
python
en
code
6
github-code
36
39006259890
import os import anndata import scanpy as sc from matplotlib import rcParams import sccross rcParams["figure.figsize"] = (4, 4) PATH = "s01_preprocessing" os.makedirs(PATH, exist_ok=True) rna = anndata.read_h5ad("Saunders-2018.h5ad") met = anndata.read_h5ad("Luo-2017.h5ad") atac = anndata.read_h5ad("10x-ATA...
mcgilldinglab/scCross
data/unmatched_mouse_cortex/preprocess.py
preprocess.py
py
2,006
python
en
code
0
github-code
36
24922748658
# Given files of user data scrapped from Yelp on different dates # Merge the files so that each row represents one user # and his/her elite status on each date # For example, Jan 4: Not Elite, Jan 5: Not Elite, Jan 6: Elite # Find on what date the user's status changed to Elite import csv import copy def combineCityEl...
heejokeum/MitSloanYelpResearch
mergeDifferentDates.py
mergeDifferentDates.py
py
2,833
python
en
code
0
github-code
36
4957095145
import pytest @pytest.mark.asyncio async def test_healthcheck(test_client_rest): response = await test_client_rest.get("http://test/healthcheck") assert response.status_code == 200 data = response.json() assert data == {"status": "ok"}
riuzaver/market-temp-test
{{cookiecutter.project_name}}/tests/test_healthcheck.py
test_healthcheck.py
py
255
python
en
code
0
github-code
36
32017330441
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import numpy as np import math if __name__ == '__main__': SZ = 64 # taille de l'image SP = int(SZ / 2) # Coordonnee max/min im = np.zeros((SZ, SZ), np.uint8) # Image comme un tableau all_i = range(-SP, ...
JuIngong/TPTelecom
Signaux/TP2/tp2_2.py
tp2_2.py
py
815
python
en
code
0
github-code
36
27254983972
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------ Script to obtain uncertainties of heavy mass spectrum and widhts via bootstrap Authors: A. Ramirez-Morales (andres.ramirez.morales@cern.ch) and H. Garcia-Tecocoatzi -------------...
Ailierrivero/bottom-baryonsFW-copy
scripts/bootstrap_three_quark.py
bootstrap_three_quark.py
py
12,649
python
en
code
0
github-code
36
25314485217
import sys input = lambda : sys.stdin.readline() N, M = map(int,input().split()) P = [input().split() for _ in range(N)] def bs(rank, cnt): start, end = 0, len(rank) -1 res = 0 while start <= end: mid = (start+end) //2 if int(rank[mid][1]) >= cnt: end = mid -1 res =...
soohi0/Algorithm_study
4월_2주/BOJ_IF문좀대신써줘/BOJ_IF문좀대신써줘_염성현.py
BOJ_IF문좀대신써줘_염성현.py
py
451
python
en
code
0
github-code
36
29066069667
""" Given an amount and the denominations of coins available, determine how many ways change can be made for amount. There is a limitless supply of each coin type. """ def getWays(num, coins): """ 1. 0 Column always 1 since you can make 0 out of no coins. That is 1 way. 2. table[col][row] = table[col][row-...
juneadkhan/InterviewPractice
coinChange.py
coinChange.py
py
1,689
python
en
code
1
github-code
36
43190780850
from openpyxl.styles import PatternFill, GradientFill def set_fill_color_green(workbook): # read # http://openpyxl.readthedocs.io/en/stable/api/openpyxl.styles.fills.html ws = workbook.active a1 = ws['A1'] # 2 different fill types fill = PatternFill("solid", fgColor="DDDDDD") fill = Gradie...
simkimsia/ug-read-write-excel-using-python
examples/c09_2_fill_color/openpyxl/index.py
index.py
py
498
python
en
code
2
github-code
36
38083296585
import os import subprocess from migen import * from migen.genlib.resetsync import AsyncResetSynchronizer import qmatech from accel import * class ADXL362(Module): def __init__(self, platform): pads = platform.request("spi", 0) led = platform.request("led0", 0) # clock source request ...
kamejoko80/linux-on-litex-vexriscv-legacy
projects/Accel/adxl362_altera.py
adxl362_altera.py
py
2,019
python
en
code
0
github-code
36
14114202160
import sys sys.setrecursionlimit(2000 * 1000) def sol(n, cnt): if dp[1] <= cnt or n < 1: return dp[n] = cnt cnt = cnt + 1 if n % 3 == 0: sol(n // 3, cnt) if n % 2 == 0: sol(n // 2, cnt) sol(n - 1, cnt) if __name__ == "__main__": N = int(sys.stdin.readlin...
nashs789/JGAlgo
MorningTask/Day_4/Q1463_LIB.py
Q1463_LIB.py
py
401
python
en
code
2
github-code
36
23517075801
N = int(input("Antal med grönt kort, N ? ")) M = int(input("Antal utan grönt kort, M ? ")) minutes = 0 if M == 0: minutes += 20 if N % 2 == 0 else 30 elif M < N: minutes += 20 if N % 2 == 0 else 30 elif M == N: minutes += 30 elif M > N: minutes += 10*(M//N) + 10*(M % N) minutes += 20 print("Svar...
Goby56/Prog2-KR
programmerings-olympiaden/2022/uppg3.py
uppg3.py
py
1,125
python
en
code
0
github-code
36
12435271099
from urllib.request import urlopen from bs4 import BeautifulSoup import requests import csv import openpyxl import json import time from datetime import datetime from random import random start_time = time.time() print('scraping the site') test = [] options = [] answer = '' image_source = [] choices = None try: ye...
charlesinto/quizAppQuestions
index.py
index.py
py
3,056
python
en
code
2
github-code
36
27053376609
import pytest from oddEvenList import Solution class ListNode: def __init__(self, x): self.val = x self.next = None @pytest.mark.parametrize("nums, expected", [ ([1, 2, 3, 4, 5], [1, 3, 5, 2, 4]), ([2, 1, 3, 5, 6, 4, 7], [2, 3, 6, 7, 1, 5, 4]) ]) def test_oddEvenList(nums, expected): ...
ikedaosushi/leetcode
problems/python/tests/test_oddEvenList.py
test_oddEvenList.py
py
613
python
en
code
1
github-code
36
70387200423
import os import torch import timm import numpy as np from simple_network import SimpleNetwork from torch.utils.data import DataLoader from torchvision.datasets import ImageFolder from torchvision.transforms import Compose, Normalize, ToTensor, Resize from torchvision.models import resnet18 #from torch import nn from n...
Hamster-yang/FL_chest-xray_timm
app/custom/chestxrayvalidator.py
chestxrayvalidator.py
py
5,254
python
en
code
0
github-code
36
5217107857
import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt import contextily as ctx from adjustText import adjust_text from matplotlib.offsetbox import OffsetImage, AnnotationBbox file_path = '/Users/jakewatembach/Desktop/meteoriteLandings/Meteorite_Landings.csv' df = pd.read_csv(file_path) df['mass ...
jakeww/meteoriteLandings
landings.py
landings.py
py
3,775
python
en
code
0
github-code
36
788805808
import math import numpy as np import cv2 import settings from point import polarvec, Point class EV3Map: def __init__(self): self.settings = settings.SettingsRegistry['global'] self.image = cv2.imread(self.settings.load_map) self.gray = cv2.cvtColor(self.image, cv2.COLOR_RGB2GRAY) ...
pfnet-research/chainer-ev3
simulator2d/map.py
map.py
py
1,986
python
en
code
8
github-code
36
37451679140
import numpy as np def split_into_reading_frames(seq_obj): # we get Seq(AAAGGGTTT) # we return [Seq(AAAGGGTTT), Seq(AAGGGT), Seq(AGGGTT)] the_split = [seq_obj[x:(len(seq_obj)-x)//3*3+x] for x in range(3)] return the_split def find_start_ends(translated_seq_obj): # we get Seq(Q*MQMM*M**Q) # w...
egisxxegis/pirmasBioItLaboras
sequence_tools.py
sequence_tools.py
py
3,996
python
en
code
0
github-code
36
9853675254
class BuildStats: def __init__(self, values): self.stats_values = values def less(self, bound): result=0 resultItems=[] for item in self.stats_values: if item < bound: resultItems.append(item) result...
AndresLGomezO/TeamInternationalTest
stats.py
stats.py
py
2,503
python
en
code
0
github-code
36
16848170368
from app import app, mail from . import login_required, bad_request, created_request from flask import jsonify, request from db import db, User, Department, Role, UserRoles from sqlalchemy.exc import IntegrityError from setting import MAX_USER_PER_PAGE from dateutil import parser as TimeParser from secrets import toke...
hackernese/Idea-Manager
backend/api/routes/user.py
user.py
py
17,364
python
en
code
0
github-code
36
29224787647
from flask import Flask, request, render_template, redirect, flash from flask_sqlalchemy import SQLAlchemy import requests import sys import os app = Flask(__name__) app.config.from_pyfile("config.py") db = SQLAlchemy(app) def return_data_from_api(city_name_value): api_id = "24034c2fc253da6475cd74bc0b96cf5a" ...
artem-chigin/weather_app
program.py
program.py
py
2,458
python
en
code
0
github-code
36
22354333965
import os import re import typing import pymysql import mlrun.utils class MySQLUtil(object): dsn_env_var = "MLRUN_HTTPDB__DSN" dsn_regex = ( r"mysql\+pymysql://(?P<username>.+)@(?P<host>.+):(?P<port>\d+)/(?P<database>.+)" ) check_tables = [ "projects", # check functions as we...
mlrun/mlrun
server/api/utils/db/mysql.py
mysql.py
py
3,216
python
en
code
1,129
github-code
36
69833309223
# classes and object # class form: # name = "adarsh" # roll_no = "25492" # branch = "ecs" # def intro(self): #self maeans vo object jispe ye method/funtion call kiya gya h # print(f"my name is {self.name} and my roll no. is {self.roll_no}. My branch is {self.branch}") # a= form() # a.name="adar...
Adarsh1o1/python-initials
oops/oops_basic.py
oops_basic.py
py
3,040
python
en
code
1
github-code
36
70118415145
import webcolors from sklearn.cluster import KMeans import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from colormap import rgb2hex import pandas as pd from scipy.spatial import KDTree class ColorNames: WebColorMap = {} WebColorMap["AliceBlue"] = "#F0F8FF" WebColorMap["AntiqueWhite"]...
danydepo/ffs-backend
TrainAndTest/Color/color_detection.py
color_detection.py
py
10,216
python
en
code
0
github-code
36
24159423427
import subprocess import os import requests KEY = 'trnsl.1.1.20161216T160124Z.4a07c4b6a2f01566.ade260e6c684818698899fd08a9c15d72faca843' URL = 'https://translate.yandex.net/api/v1.5/tr.json/translate' # путь к файлу с текстом; directory_source = 'Source' # путь к файлу с результатом; directory_result = 'Result' # ...
pashkovsky/PY2PM
PY3_2/Homework/translator_files.py
translator_files.py
py
3,013
python
ru
code
0
github-code
36
9828545427
word_list = [ 'seara', 'deseuri', 'intrebare ', 'paragraf', 'distanta', 'vultur', 'maimuta', 'batran', 'varsta', 'birou', 'schimbare', 'frica', 'instalatie', 'raspuns ', 'limba', 'munca', 'doctor', 'lift', 'ochi', 'iesire', 'echipament'...
zioan/hangman_romanian
words.py
words.py
py
827
python
es
code
0
github-code
36
34547539160
import cv2 # 选择第二只摄影机 cap = cv2.VideoCapture(0) while(True): # 从摄影机撷取一张影像 ret, frame = cap.read() cv2.putText(frame, "aaqqqqqqqqqqqq", (0,100), cv2.FONT_HERSHEY_SIMPLEX,1, (0,0,0)) # 显示图片 cv2.imshow('frame', frame) cv2.waitKey(1) if cv2.getWindowProperty('frame', cv2.WND_PROP_AUTOSIZE) == -1: ...
Amenoimi/Simple_OCR
cv.py
cv.py
py
456
python
zh
code
0
github-code
36
43346932566
import datetime from discord import client, Message import aiohttp import random import time import typing import json import humanize import discord from discord.ext import commands start_time = time.time() intents = discord.Intents.default() bot = commands.Bot(command_prefix="!", intents=discord.Intents.all()) ff...
v1ss0nd/vsndbot-Discord
bot.py
bot.py
py
9,975
python
en
code
0
github-code
36
21216189520
import math def is_same(p1, p2): return p1[0] == p2[0] and p1[1] == p2[1] def mod_inverse(a, p): return pow(a,p-2,p) def add_points(p, q, curve, mod): if (is_same(p, (math.inf, math.inf))): return q if (is_same(q, (math.inf, math.inf))): return p if (p[0] == q[0] and p[1] ==...
marek-hradil/cryptohack-rubbish
PointAddition/main.py
main.py
py
792
python
en
code
0
github-code
36
19150802136
''' Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' import torch class ShallowResNetBlock(torch.nn.Module): ''' input -> Conv3x3 -> BN -> ReLU -> Conv3x3 -> BN + ShortCut -> Relu | ...
zllz4/Face-Recognition
models/resnet.py
resnet.py
py
11,268
python
en
code
1
github-code
36