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
47206175294
# -*- coding: utf-8 -*- class Record(object): def __init__(self,artist,aside,bside,year,genre): self.artist = artist self.aside = aside self.bside = bside self.year = year self.genre = genre a_1 = Record("MC5","Kick Out The Jams","Motor City Is Burning",1969,"Rock") a_2 = Re...
rubinoAM/JukeboxPy
record.py
record.py
py
6,468
python
en
code
0
github-code
13
24367938105
# Ejercicio02 def every_other(array): # Cuando encuentre un número par dentro del array # mostraŕa las sumas con los demás números del mismo for index, num in enumerate(array): #O(n) if index % 2 == 0: for ob in array: #O(n) print(str(num) + " + " + str(ob)) # Compl...
julio-1610/LaboratorioADA-GC
Laboratorio04/every_other.py
every_other.py
py
370
python
es
code
0
github-code
13
6434022729
# pylint: disable=R0903 """ 'E1102': ('%s is not callable', 'Used when an object being called has been infered to a non \ callable object'), """ __revision__ = None __revision__() def correct(): """callable object""" return 1 __revision__ = correct() class Correct(object): ...
raymondbutcher/perfectpython
pylib/pylint/test/input/func_typecheck_non_callable_call.py
func_typecheck_non_callable_call.py
py
671
python
en
code
11
github-code
13
7407915901
import os import json import pandas as pd from barbell2_castor.api import CastorApiClient """ ------------------------------------------------------------------------------------------- """ class CastorToDict: COLUMNS_TO_SKIP = [ 'Participant Id', 'Participant Status', 'Site Abbrevia...
rbrecheisen/barbell2_castor
barbell2_castor/castor2df.py
castor2df.py
py
6,438
python
en
code
0
github-code
13
34445068158
from __future__ import print_function from dronekit import VehicleMode, mavutil, LocationGlobal, LocationGlobalRelative from pymavlink import mavutil # Needed for command message definitions import time import math def arm_and_takeoff(aTargetAltitude, vehicle): """ Arms vehicle and fly to aTargetAltitude. ...
Johnnysboys/Dilbert
flight.py
flight.py
py
6,217
python
en
code
0
github-code
13
15023015194
import sys import os.path import subprocess from collections import defaultdict import traceback import json from PyQt5.QtCore import ( QObject, QThread, QTimer, QPoint, QRect, QSize, Qt, pyqtSignal, ) from PyQt5.QtGui import ( QIcon, QPixmap, ) import patricia import polytaxis_...
rendaw/ptadventure
polytaxis_adventure/main.py
main.py
py
24,735
python
en
code
0
github-code
13
31114568479
"""changed users role_id Revision ID: 443b821478c1 Revises: 25a3ee0f9951 Create Date: 2022-04-11 02:19:53.722244 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '443b821478c1' down_revision = '25a3ee0f9951' branch_labels = None depends_on = None def upgrade()...
vishIGOR/MyCodeHedgehog
project/migrations/versions/443b821478c1_changed_users_role_id.py
443b821478c1_changed_users_role_id.py
py
1,185
python
en
code
0
github-code
13
20843373574
from __future__ import with_statement, print_function, absolute_import from itertools import * from functools import * import numpy import pandas from stitch.core.stitch_parser import StitchParser from stitch.core.utils import * # ------------------------------------------------------------------------------ ''' .. mo...
theNewFlesh/stitch
python/stitch/core/stitch_interpreter.py
stitch_interpreter.py
py
2,783
python
en
code
2
github-code
13
8310443184
import numpy as np import scipy.optimize import time import matplotlib.pyplot as plt import pandas as pd import math def log_reg(theta,x,y): """ Arguments: theta - A vector containing the parameter values to optimize. X - The examples stored in a matrix. X(i,j) is the i'th coordinate of th...
Tandon-A/ufldl-python-solutions
Logitsic_Regression.py
Logitsic_Regression.py
py
4,119
python
en
code
2
github-code
13
37933960492
import random import math def buyTickets(masterList, lottoNums, tixs): bought = [] for j in range(0, 5): bought.append(random.randint(0, lottoRange)) bought.sort() bought.append(random.randint(0, powerRange)) if bought == lottoNums: print("Winning ticket numbers: " + str(bought)) ...
RiskyClick/40Challenges
PowerballSimulation.py
PowerballSimulation.py
py
1,956
python
en
code
0
github-code
13
70662519059
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from settings import settings class PlotService: def __init__(self, df: pd.DataFrame): self.df = df def confusion_matrix(self, confusion_matrix: list[list[int]], categories: np.array, showfliers = True, filen...
lvvittor/ml
tps/tp1/app/services/plot_service.py
plot_service.py
py
2,195
python
en
code
0
github-code
13
38340516426
from PyQt5.QtGui import QPainter, QPixmap, QColor from PyQt5.QtCore import QCoreApplication, QEventLoop from math import isclose from geometry import Point, Segment, Vector from errors import callInfo, callError EPS = 1e-6 class Cutter: def __init__(self, scene, painter, img, color): self.scene = scene...
MyMiDiII/bmstu-cg
lab_08/cut.py
cut.py
py
2,571
python
en
code
0
github-code
13
36168109999
from chembl_webresource_client.new_client import new_client import pandas as pd import math from rdkit.Chem import PandasTools def BioactivityIC50(CHEMBLID): bioact = bioactivities.filter(target_chembl_id = CHEMBLID) \ .filter(type = 'IC50') \ .only('activity_id', 'assay_d...
Pawansit/LigandAnalysis
Chembl-Target-Info.py
Chembl-Target-Info.py
py
1,901
python
en
code
1
github-code
13
27449572416
import aiofiles __all__ = ['srun','read_text'] def srun(async_func, *args,extra_context_var: dict={} ,show_progress=False, **kwargs): """ Run asyncio function in synchronous way Input: func (function): function to run *args: arguments to pass to function extra_context_var (dict): ...
bigmb/mb_pandas
mb_pandas/src/aio.py
aio.py
py
1,612
python
en
code
0
github-code
13
37261514299
import os import sys import psycopg2 from aiogram import types from PIL import Image, ImageFont, ImageDraw, ImageFilter, ImageOps from bot.dispatcher import bot def get_main_menu(): keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True) buttons = ["Моя карта", "Другой игрок"] keyboard.add(*buttons) ...
hiimluck3r/BonchMafia
bot/controllers.py
controllers.py
py
9,831
python
en
code
0
github-code
13
38711443021
class People: def __init__(self,name,age): self.name=name self.age=age def full_info(self): full_information=f"Name-{self.name} age -{self.age}" print(full_information) name_second=input("Write name") age_second=int(input("Write age")) frolova_nata=People(name_second,age...
VigularIgnat/python
mygr/03.10/input_class.py
input_class.py
py
355
python
en
code
0
github-code
13
30793992926
# Debugger module by Ky Eltis. class DebugStream(): """Houses debug data for one stream/table.""" def __init__(self, header, row1) -> None: """Init.""" self.header: list[str] = header self.rows: list[list[str]] = [row1] self.lens: list[list[int]] = [[len(str(title)) for title i...
Skylite73/Python-Debugging-Modules
Modules/debugger.py
debugger.py
py
4,077
python
en
code
0
github-code
13
40997458925
# # # # make the aerosol time series plot using xarray. Way shorter and faster. Should re-write it all at some point. # July 2018 # # # import numpy as np import matplotlib.pyplot as plt import seaborn as sns import xarray as xr if __name__ == "__main__": datafile = xr.open_mfdataset('/home/kimberlee/OsirisData/...
KimDube/Masters-O3-Aerosol-Temp
AltTimeSeries_xarray_version.py
AltTimeSeries_xarray_version.py
py
2,327
python
en
code
0
github-code
13
30928221425
import io import torch from .hdfs_io import hopen def load(filepath: str, **kwargs): """ load model """ if not filepath.startswith("hdfs://"): return torch.load(filepath, **kwargs) with hopen(filepath, "rb") as reader: accessor = io.BytesIO(reader.read()) state_dict = torch.load(a...
zengyan-97/X-VLM
utils/torch_io.py
torch_io.py
py
636
python
en
code
411
github-code
13
19093079343
# coding=utf-8 """Decorators for ``cmd2`` commands""" import argparse import types from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Union from . import constants from .exceptions import Cmd2ArgparseError from .parsing import Statement if TYPE_CHECKING: # pragma: no cover im...
etherkit/OpenBeacon2
macos/venv/lib/python3.8/site-packages/cmd2/decorators.py
decorators.py
py
17,978
python
en
code
13
github-code
13
13726381394
import numpy as np import pickle import pandas as pd from ruffus import * from tqdm import tqdm from rdkit import Chem import pickle import os from glob import glob import time import util import nets import relnets from rdkit.Chem import AllChem from rdkit.Chem.Draw import IPythonConsole from rdkit.Chem import rd...
stefhk3/nmrfilter
respredict/create_datasets_many_nuc.py
create_datasets_many_nuc.py
py
7,919
python
en
code
1
github-code
13
14137405318
from .loghandler import logger from .lxdClient import lxd from .lxdClient import lxdException from . import overlay # dispatch based on cli args def dispatch(cmd, args): # launch a new container if cmd == "launch": # get container name if args: containerName = args[0] else...
Jayfrown/pycor
pycor/dispatcher.py
dispatcher.py
py
1,986
python
en
code
3
github-code
13
9376065077
from pathlib import Path import streamlit as st from PIL import Image #Ajustes de rutas this_dir = Path(__file__).parent if "__file__" in locals() else Path.cwd() assets_dir = this_dir / "assets" styles_dir = this_dir / "styles" css_file = styles_dir / "main.css" #Ajustes generales. Editar con los datos de tu produc...
valantoni/pagina-web-venta-pd
app.py
app.py
py
3,949
python
es
code
0
github-code
13
39724701567
#!/usr/bin/env python3 a, b = input().split('+') _rdecode = dict(zip('MDCLXVI', (1000, 500, 100, 50, 10, 5, 1))) def decode_roman(roman): result = 0 for r, r1 in zip(roman, roman[1:]): rd, rd1 = _rdecode[r], _rdecode[r1] result += -rd if rd < rd1 else rd return result + _rdecode[roman[-...
esix/competitive-programming
e-olymp/0xxx/0007/main.py
main.py
py
653
python
en
code
15
github-code
13
42591082173
import sys from Block import Block from Physics import Physics class Player(Block): player_width = 16 player_height = 32 color = (97, 169, 188) velocity_x = float(0) velocity_y = float(0) gravity_x = float(0) gravity_y = float(30) acceleration_x = float(100) acceleration_y = float...
Axdecces/Bounce
Player.py
Player.py
py
3,844
python
en
code
0
github-code
13
27169930776
from benchopt import BaseSolver from benchopt import safe_import_context from benchopt.utils.stream_redirection import SuppressStd with safe_import_context() as import_ctx: import numpy as np from scipy.optimize import fmin_l_bfgs_b class Solver(BaseSolver): name = "scipy L-BFGS" install_cmd = "cond...
agramfort/benchmark_ridge_positive
solvers/lbfgs_scipy.py
lbfgs_scipy.py
py
1,092
python
en
code
0
github-code
13
15172121998
# coding=utf-8 import os from gensim import corpora from sklearn.externals import joblib from scipy.sparse import csr_matrix from setup import * import re import json from src.score import * def init(): cate_ids = init_setup(config_cat_id) return cate_ids def cleanhtml(raw_html): """ Clear tag <.*?> ...
loilethanh/news_trending
src/category_classify.py
category_classify.py
py
2,266
python
en
code
0
github-code
13
30477232073
N = int(input()) S = input() a = 0 b = N - 1 ans = "" while a <= b: left = False for i in range(b - a + 1): if S[a + i] < S[b - i]: left = True break elif S[a + i] > S[b - i]: left = False break if left: ans += S[a] a += 1 else: ans += S[b] b -= 1 print(ans)
ShimizuKo/study
蟻本/2章/p45.py
p45.py
py
319
python
en
code
1
github-code
13
27074968495
import requests import os import time import re import json from openpyxl import Workbook from openpyxl import load_workbook from selenium import webdriver from selenium.webdriver import ChromeOptions from time import sleep from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from...
carryyangorz/pythonprojects
plantnet.py
plantnet.py
py
12,996
python
en
code
0
github-code
13
549007509
# coding: utf-8 __author__ = "wolf" """ 文件发送端 """ import socket import os import sys import struct import re def socket_client(): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) while 1: IP = input("请求建立socket通道ip地址为:") if check_Ip(IP): break ...
nhz94259/transport_socket
send.py
send.py
py
2,028
python
en
code
0
github-code
13
3791633151
from flask import Flask, render_template, request, url_for, flash, redirect from init_db import init_db import sqlite3 from werkzeug.exceptions import abort app = Flask(__name__) app.config['SECRET_KEY'] = 'bravaproject' init_db() # establish database connection, returns rows as python dicts def get_db_connection()...
sakuray10/BravaProject
app.py
app.py
py
1,796
python
en
code
0
github-code
13
41489427539
import math, torch import torch.nn as nn import torch.nn.functional as F # RoI-wise attention vector generating network class RAVNet(nn.Module): def __init__(self, num_classes, d_k=64): super(RAVNet, self).__init__() # list of number of instances(RoI predictions) in each image # len(num_i...
rach-rgb/RoI-wise-Attention-Vector
AttentionVector/src/components/rav_net.py
rav_net.py
py
2,172
python
en
code
0
github-code
13
26148839048
"""Classifier tests.""" from sklearn.naive_bayes import GaussianNB import strlearn as sl def get_stream(): return sl.streams.StreamGenerator(n_chunks=10) def test_ACS_Prequential(): "Bare ACS for Prequential" stream = get_stream() clf = sl.classifiers.ASC(base_clf=GaussianNB()) evaluator = sl....
w4k2/stream-learn
strlearn/tests/test_classifiers.py
test_classifiers.py
py
1,137
python
en
code
58
github-code
13
9051914597
import discord class SelectMenu(discord.ui.Select): def __init__(self,command_name:str,args:list,placeholder:str=""): options=[] for item in args: options.append(discord.SelectOption(label=item, value=f"{command_name}:{item}", description="")) super().__init__(placeholder=placeh...
sai11121209/Discord-EFT-V2-Bot
src/cogs/select_menu.py
select_menu.py
py
767
python
en
code
0
github-code
13
37432022725
from django.shortcuts import render from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient from django.http import HttpResponseRedirect,HttpResponse,FileResponse import os,uuid blob_lists = [] conn_string = os.environ["AZURE_STORAGE_CONNECTION_STRING"] blob_service_client = BlobServiceClient.fro...
RekhaBalamurugan/Upload-Download-Files-Django
upload_download/views.py
views.py
py
1,390
python
en
code
0
github-code
13
11997795563
''' Functions for case 9 simulations Author: Telma Afonso ''' from phenomenaly.simulation import fba, fva, pfba, lmoma from phenomenaly.variables import Media from types import * import pickle import string import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats import linregress from...
TelmaAfonso/DeYeast
case_9.py
case_9.py
py
9,995
python
en
code
0
github-code
13
33466459696
from keras.engine import Input from keras.engine import Model from keras.layers import Convolution2D, MaxPooling2D, Deconvolution2D, Dropout, Activation, Reshape from keras.layers import merge class Fcn_8(object): ''' exsample: model = Fcn_8(batch_size=batch_size, input_shape=(block_size,block_size), n_...
gawain93/handsegment_fcn
model.py
model.py
py
6,403
python
en
code
0
github-code
13
14115853149
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 name = "sender" pub_topic = "my_topic" rospy.init_node(name) pub = rospy.Publisher(pub_topic, Int32, queue_size=1) rate = rospy.Rate(1000) count = 1 while(pub.get_num_connections() ==0): count = 1 while not rospy.is_shutdown(): pub.publish(co...
JaeHongChoe/ROS_study
src/msg_send/src/sender_overflow.py
sender_overflow.py
py
354
python
en
code
1
github-code
13
7517129902
import scipy as sp from simulated_tools import get_simulated_im, WINDOW_WIDTH from caffe_tools import fill_database """IDs of file to be used to build the training set""" TRAINING_IDS = ['exp_low ({0})'.format(i) for i in range(1, 25)] """The mapping from types of pixels to classifier labels""" LABEL_ENUM = {'inside...
andyljones/NeuralNetworkMicroarraySegmentation
simulated_training.py
simulated_training.py
py
6,144
python
en
code
5
github-code
13
35794302213
from dolfin import Vector import numpy as np class TimeDependentVector: """ A class to store time dependent vectors. Snapshots are stored/retrieved by specifying the time of the snapshot. Times at which the snapshot are taken must be specified in the constructor. """ def __ini...
kamccormack/EQporoelasticity
local_lib/hippylib/timeDependentVector.py
timeDependentVector.py
py
3,153
python
en
code
6
github-code
13
71838069779
from ella.utils.settings import Settings ACTIVITY_NOT_YET_ACTIVE = 0 ACTIVITY_ACTIVE = 1 ACTIVITY_CLOSED = 2 IP_VOTE_TRESHOLD = 10 * 60 POLL_COOKIE_NAME = 'polls_voted' POLL_JUST_VOTED_COOKIE_NAME = 'polls_just_voted_voted' POLL_NO_CHOICE_COOKIE_NAME = 'polls_no_choice' POLL_MAX_COOKIE_LENGTH = 20 POLL_MAX_COOKIE_AG...
ella/ella-polls
ella_polls/conf.py
conf.py
py
683
python
en
code
3
github-code
13
247542092
from .settings import * DEBUG = False ALLOWED_HOSTS = ['1ww.me', 'www.1ww.me', 'api.1ww.me', ] # ALLOWED_HOSTS = ['*', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'haumea', 'USER': 'haumea', 'PASSWORD': 'haumea123', # 'HOST': '/tmp/mysql.soc...
edison7500/haumea
haumea/settings/production.py
production.py
py
767
python
en
code
0
github-code
13
6616278304
import numpy as np import cvxpy as cp import json POS = { "W" : 0, "N" : 1, "E" : 2, "S" : 3, "C" : 4 } MAT = { "0" : 0, "1" : 1, "2" : 2 } ARW = { "0" : 0, "1" : 1, "2" : 2, "3" : 3 } MM = { "D" : 0, "R" : 1 } HEL = { "0" : 0, "25" : 1, "...
Aa-Aanegola/ML-Assignments
Assignment_2/Part3/linear_programming.py
linear_programming.py
py
8,394
python
en
code
0
github-code
13
38999127760
import datetime from timeit import default_timer as timer from random import shuffle # Задание 1 # версия с timestamp class Benchmark1: def __init__(self, function, *arguments): self.code_start_timestamp = datetime.datetime.now() self.function = function self.arguments = arguments def __enter__(self): self.f...
ArteDuzz/python_lessons
home_work_2_5.py
home_work_2_5.py
py
4,688
python
en
code
0
github-code
13
22563427011
from GenObj import * class Atacker(GenObj): """Basic enemy class""" # speed = [0, 0] # __Alive = True def __init__(self, name, hp, img, rect, boundries): GenObj.__init__(self, name, hp, img, rect, boundries) self.__HP = hp # self.__Alive = True self.setAlive() s...
mgx259/PyGameTest1
Atacker.py
Atacker.py
py
1,039
python
en
code
0
github-code
13
30845767352
#getting input s is for plain text mam and k is for key ,number of rows in grid s=input("Enter string:") k=int(input("Enter key:")) #To create grid i use a blank list.NumPy arrays can be use here, # To initialize the list, first fill the list with ‘ ‘(single space) enc=[[" " for i in range(len(s))] for j in range(k)]...
Rakibul66/Cryptography-Lab
Cryptography Lab/Rail felce.py
Rail felce.py
py
1,234
python
en
code
0
github-code
13
70931156818
import pytest from tokamak.radix_tree import utils def test_dyn_parse_node_init(): with pytest.raises(ValueError): utils.DynamicParseNode("raw", "09ab") with pytest.raises(ValueError): utils.DynamicParseNode("raw", "") dyn = utils.DynamicParseNode("raw", "ab01", regex="[0-9]+") assert...
erewok/tokamak
tests/radix_tree/test_utils.py
test_utils.py
py
4,033
python
en
code
8
github-code
13
72014401299
from core.models import TimeStampModel from django.db import models class TrainTrack(TimeStampModel): source = models.CharField(max_length=255, help_text="the source name of the track") destination = models.CharField( max_length=255, help_text="the destination name of the track" ) is_busy = mo...
viprathore/Python
mail_service/service/shipping_parcel/models.py
models.py
py
3,054
python
en
code
0
github-code
13
21862133170
''' Adapted from the video in the Functions secitons of Runestone's FOPP Changes from house_1.py: implemented draw_triangle() implemented draw_rectangle() ''' import turtle skippy = turtle.Turtle() win = turtle.Screen() skippy.shape("turtle") house_llx = 0 house_lly = 0 house_size = 200 eve_size = 10 window...
NormandaleWells/CS111Demos
functions/house_2.py
house_2.py
py
1,660
python
en
code
1
github-code
13
20624458875
import torch import torch.nn as nn import torch.nn.functional as F import torch.cuda.amp as amp ''' proposed in the BMVC2019 paper: [Large Margin in Softmax Cross-Entropy Loss link to paper](https://staff.aist.go.jp/takumi.kobayashi/publication/2019/BMVC2019.pdf) ''' ## # version 1: use torch.autograd class LargeMar...
CoinCheung/pytorch-loss
large_margin_softmax.py
large_margin_softmax.py
py
9,752
python
en
code
2,048
github-code
13
31200586528
import datetime import mock import six from st2common.transport.publishers import PoolPublisher from st2common.persistence.reactor import TriggerInstance from st2common.models.db.reactor import TriggerInstanceDB from tests import FunctionalTest http_client = six.moves.http_client @mock.patch.object(PoolPublisher, '...
gtmanfred/st2
st2api/tests/unit/controllers/v1/test_triggerinstances.py
test_triggerinstances.py
py
5,055
python
en
code
null
github-code
13
10839976616
from flask import Flask from flask import render_template from flask import request import webbrowser,json,os def webrun(): app = Flask(__name__) @app.route('/index',methods=['GET','POST']) def index(): if request.method == 'POST': filename = request.form['filename'] data1 =...
dan890407/OCR_finalproject
OCR/house_web/house_web.py
house_web.py
py
639
python
en
code
0
github-code
13
161088098
# -*- coding: utf-8 -*- from selenium import webdriver import time from bs4 import BeautifulSoup import urllib.request def parser(): req=urllib.request.Request('https://www.nccst.nat.gov.tw/Vulnerability') response = urllib.request.urlopen(req) the_page = response.read() soup = BeautifulSoup(...
owen51251/linux-tcpreverse
parser_nccst.py
parser_nccst.py
py
742
python
en
code
0
github-code
13
21949248818
# encoding:utf-8 from kdmer import * from collections import defaultdict import sys class GrafoDeBruijn: def __init__(self, kdmers, k, d, rosalind=False): self.kdmers = kdmers self.k = int(k) self.d = int(d) self.rosalind = rosalind self.construirGrafo() def construirGrafo(self): # C...
marcoscastro/bruijn_graph
src/assembler.py
assembler.py
py
12,056
python
pt
code
3
github-code
13
33527990756
# -*- coding = utf-8 -*- # @Time : 5/5/2023 7:49 PM # @Author : zyxiao # @File : 计算均值和方差.py # @Software : {PyCharm} import torch from torchvision.datasets import ImageFolder # def getStat(train_data): # ''' # Compute mean and variance for training data # :param train_data: 自定义类Dataset(或ImageFo...
xzyxiaohaha/PythonUtil
pythonUtil/数据集操作工具类/计算均值和方差.py
计算均值和方差.py
py
2,215
python
en
code
0
github-code
13
33501959431
from Generator import DataGenerator from Model import BuildModel import json import pickle if __name__ == "__main__": with open("processedData/meta.json") as fl: meta = json.load(fl) # parameter to test model test = True train_ids = range(1, 100) val_ids = range(100, 140) batch_size...
ParthTandel/Bidaf
Main.py
Main.py
py
1,448
python
en
code
0
github-code
13
25810773494
#! /usr/bin/env python3 ''' Truck package Note: truck csv file is checked with module load. ''' import os import math import pandas as pd import config as cfg trucks_file = os.path.join(cfg.data_dir, cfg.trucks_csv) if not os.path.isfile(trucks_file): raise FileNotFoundError class Truck: def __init__(self) -> ...
nandoabreu/geo-coordinate-calc-and-pandas
truck/__init__.py
__init__.py
py
2,464
python
en
code
0
github-code
13
32471450025
from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from common.views import CommentList, FavoriteList, FavoriteDelete, Search from server import settings urlpatterns = patterns('', url(r'^$', 'common.views.index', nam...
wpstan/Nourriture
source/server/server/urls.py
urls.py
py
1,854
python
en
code
0
github-code
13
5471398164
# -*- coding: utf-8 -*- import pyupbit def get_coin(coin): if coin == None: pass # tickers = pyupbit.get_tickers() # return tickers elif coin != None: coin = coin.replace(" ","") ticker = coin.replace("코인","") price = format(pyupbit.get_current_price(ticker), ',...
redplug/slackbot
get_coin.py
get_coin.py
py
1,026
python
en
code
0
github-code
13
20644297624
from django import forms from .models import Tracker, Finance, Task, TaskStatus class TrackerForm(forms.ModelForm): class Meta: model = Tracker fields = ['init_name', 'supplier', 'type', 'scope', 'comments', 'theo', 'start_date', 'end_date', 'business_owner', 'division', 'proc_owner', 'category', ...
eric-oaktree/spat
tracker/forms.py
forms.py
py
1,847
python
en
code
1
github-code
13
40807770887
from sklearn import datasets from sklearn.model_selection import train_test_split from scipy.spatial import distance from sklearn.metrics import accuracy_score def euc(a, b): # gives distance between two points return distance.euclidean(a,b) class MyClassifier: def fit(self, x_train, y_train): self...
surazad99/Machine-Learning
MyOwnClassifier.py
MyOwnClassifier.py
py
1,295
python
en
code
1
github-code
13
27685531249
import moderngl import numpy as np from typing import Tuple Color = Tuple[float, float, float, float] Point2 = Tuple[float, float] _SIGNAL_VERTEX_SHADER = ''' #version 330 uniform int Start; uniform float XScale; uniform mat4 MainRect; in int in_vert; void main() { float x = 2. * (S...
monkeyman79/mutt
mutt/ui/shaders.py
shaders.py
py
9,906
python
en
code
0
github-code
13
39419187505
from requests import Session import json import psycopg2 import websocket, json from requests import Session import psycopg2 from symbol import simil,coins class Crypto: def CoinCaP(self,simil): def getInfo (): # Function to get the info url = 'https://pro-api...
D0723/forecaster-backend
pipeline.py
pipeline.py
py
8,269
python
en
code
0
github-code
13
32085588458
#!/usr/bin/python3 # This program makes the plot for L2 error of two series of data # Author : Bruno Blais #Python imports import os import sys import numpy import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import LogLocator, FormatStrFormatter import pylab from scipy import stats from matplot...
lethe-cfd/lethe-utils
python/mms/compareSolutionTime.py
compareSolutionTime.py
py
1,918
python
en
code
5
github-code
13
40322269014
from django.shortcuts import render from rest_framework.generics import GenericAPIView,CreateAPIView,RetrieveAPIView,UpdateAPIView from rest_framework.views import APIView from users.serializers import CreateUserSerializer,UserDetailSerializer,EmailSerializer,UserAddressSerializer,AddressTitleSerializer,UserBrowserHist...
frankky-cyber/meiduo2
meiduo_mail/meiduo_mail/apps/users/views.py
views.py
py
7,122
python
en
code
0
github-code
13
7404235796
#!/usr/bin/python3 """ 6. POST an email #1 """ import requests import sys if __name__ == '__main__': url = sys.argv[1] email = sys.argv[2] data = {'email': email} response = requests.post(url, data=data) print(response.text)
AmrShoukry/alx-higher_level_programming
0x11-python-network_1/6-post_email.py
6-post_email.py
py
249
python
en
code
0
github-code
13
34615264355
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('OrderPlacer', '0007_auto_20141204_2107'), ] operations = [ migrations.RenameField( model_name='medicalservice', ...
9929105/lini
src/OrderPlacer/migrations/backup/0008_auto_20141210_0544.py
0008_auto_20141210_0544.py
py
406
python
en
code
0
github-code
13
19902330877
from matplotlib import pyplot as plt import numpy as np from scipy.integrate import odeint class Parameters(): def __init__(self): # system parameters self.m = 1 self.c = 1 self.k = 1 # control gains self.kp = 0.1 self.kd = -self.c + 2 * np.sqrt((self.k +...
kimsooyoung/robotics_python
lec12_feedback_linearization/1_simple_control_partitioning/smd_main.py
smd_main.py
py
1,124
python
en
code
18
github-code
13
18314472395
from paterdal import Paterdal def test_instance_is_correct(): """ Verifies that a Paterdal instance initializes correctly :return: """ class ExpectedData: def __init__(self): self.col_offset = 10 self.row_offset = 10 self.h_tile_size = 80 se...
SeanWH/paterdal
tests/tests_paterdal.py
tests_paterdal.py
py
1,977
python
en
code
0
github-code
13
14505763267
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.action_chains import ActionChains from bs4 import BeautifulSoup from time import sleep import random from project_solo_app.models import Background_Task, Definition, Word def definition_search(word_id=0...
catalystTGJ/01_project_solo
tasks/webscrape_search.py
webscrape_search.py
py
2,570
python
en
code
0
github-code
13
4787290913
import csv path = r'C:\Users\Helen\Documents\ingest_files\test.csv' with open(path) as csvfile: m = list(csv.DictReader(csvfile)) columns = m[0].keys().replace('\t', '') print(columns) print(m[:2])
lenapy/learn_python
coursera/introduction_to_data_science/week_1/data_files_and_summary_statistics.py
data_files_and_summary_statistics.py
py
203
python
en
code
0
github-code
13
42304737139
class Person: name = "人間" def __init__(self, height, weight): self.age = 30 self.height = height self.weight = weight def walk(self): print("歩きます") def eat(self): print("食べます") @classmethod def say_classmethod(cls): print("classmethod") @static...
tokitsubaki/labcode
class/class_python.py
class_python.py
py
1,257
python
en
code
0
github-code
13
19117563824
def rod(length, price, cost): value = list() value.append(0) m = -1 for i in range(1,length): m = price[i] for j in range(1,i-1): m = max(m,price[i]+value[i-j]-cost) value[i] = max return value[length]
natthakan2000/ICCS313
a4/RodCutting.py
RodCutting.py
py
257
python
en
code
0
github-code
13
18644820539
import array import paho.mqtt.client as mqtt array_size = 10 # Create an array to store the ADC data adc_data = array.array("H", [0] * array_size) array_pratap = [] # The callback for when the client receives a CONNACK response from the server. def on_connect(client, userdata, flags, rc): print("Connected wit...
prataprobotics/2023-coding
PY_CODING/pythonProject/subscribe_adc_filter_random_ma.py
subscribe_adc_filter_random_ma.py
py
1,388
python
en
code
0
github-code
13
11855131414
import torch.nn as nn import torch from utils import TopPool, BottomPool, LeftPool, RightPool class convolution(nn.Module): def __init__(self, k, inp_dim, out_dim, stride=1, with_bn=True): super(convolution, self).__init__() pad = (k - 1) // 2 self.conv = nn.Conv2d(inp_dim, out_dim, (k, k...
xinyu-ch/ProgressiveTextDetection
models/pool_direction.py
pool_direction.py
py
2,546
python
en
code
3
github-code
13
25667347990
import sys import numpy as np from extract_squares_from_image import extract_cube_faces_from_stream, capture_faces, load_imgs_from_dir, capture_faces_from_images from color_classifier import get_classifier, label_images from Cube import Cube from Solver import Solver from SolutionGallery import SolutionGallery import m...
pkepley/rubiksolver
src/rubiksolver/end_to_end.py
end_to_end.py
py
6,935
python
en
code
0
github-code
13
70662527379
import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from settings import settings class StepPerceptron(): def __init__( self, learning_rate: float, inputs: np.array, expected_outputs: np.array ): """Constructor method ...
lvvittor/ml
tps/tp3/app/step_perceptron.py
step_perceptron.py
py
7,495
python
en
code
0
github-code
13
433305424
from PythonANN import Program from ProgramParameters import ProgramParameters def setNewNetwork(layers, nodes, divisbleBy, iterations, learningRate,algoNum): input = ProgramParameters(); input._init_(layers, nodes, divisbleBy, iterations, learningRate,algoNum); return Program(input); userInput = True; ch...
MagicalPlayGames/Artifical-Neural-Networks
interface.py
interface.py
py
2,821
python
en
code
0
github-code
13
30013739784
import numpy as np def get_data(path): # both train and test data files have the same format # so we only need one function to parse the data # returns a list of tuples, of the form tuple(the_text, the_class_name) # the list to store our tuples the_data = [] with open(path) as dataFile: ...
billkouts/Reuters_document_classification
randomClassifier.py
randomClassifier.py
py
9,995
python
en
code
0
github-code
13
40105255949
import requests from bs4 import BeautifulSoup url="https://www.instagram.com/{}/" def pic_downloader(username): full_url=url.format(username) r=requests.get(full_url) s=BeautifulSoup(r.text,"lxml") p=s.find("meta",property="og:image").attrs['content'] with open(username+".jpg","wb") ...
aryan091/WEB-SCRAPING
Instagram Pic Download.py
Instagram Pic Download.py
py
523
python
en
code
0
github-code
13
38701608385
""" Contains unit and integration tests for checking the models of the web application. """ import logging import sys from django.test import TestCase from questions.models import QuestionCategory from users.models import MyUser from ..models import Post if len(sys.argv) > 1 and sys.argv[1] == 'test': logging.di...
Lalluviadel/interview_quiz
posts/tests/test_models.py
test_models.py
py
1,668
python
en
code
0
github-code
13
2960969217
"""Sex terms.""" from spacy import registry from traiter.actions import text_action from traiter.patterns.matcher_patterns import MatcherPatterns from odonata.pylib.const import COMMON_PATTERNS, REPLACE COLORED = """ colored """.split() SIMILAR = """ like similar as than exactly """.split() TRAITS = """color color_m...
rafelafrance/traiter_odonata
odonata/patterns/color_like.py
color_like.py
py
1,213
python
en
code
0
github-code
13
29749092015
#!/usr/bin/env python # coding=utf-8 # author=hades # @Time : 2018/8/17 9:24 from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.project.access_and_security.keypairs \ import views from openstack_dashboard.dashboards.project.access_and_security.qos \ i...
leejshades/openstack-dashboard
openstack_dashboard/dashboards/project/access_and_security/qos/urls.py
urls.py
py
783
python
en
code
0
github-code
13
70416640337
import warnings warnings.filterwarnings("ignore") import os import sys import yaml import logging import pandas as pd import multiprocessing as mp from geckoml.data import * from geckoml.metrics import save_analysis_plots from argparse import ArgumentParser from functools import partial import tqdm # Get the GPU #...
NCAR/gecko-ml
applications/run_gecko_rnn_emulators.py
run_gecko_rnn_emulators.py
py
10,182
python
en
code
1
github-code
13
31291147964
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 3 10:21:27 2022 @author: dtjgp """ #!/usr/bin/python3 import random from queue import Queue, PriorityQueue import numpy as np import matplotlib.pyplot as plt import scipy.stats # ******************************************************************...
dtjgp/management-and-content-delievery-for-smart-network
lab1_task1.py
lab1_task1.py
py
10,332
python
en
code
1
github-code
13
42804444907
from pyquil.gates import * from pyquil.quil import Program LAYER_XZ_OPTIONS_DEFAULT={ 'nlayers': 1, 'dist': 1, } def layer_xz(params, qubits_chosen, options=LAYER_XZ_OPTIONS_DEFAULT): """ Variational circuit alternating between single-X rotations and constant distance controlled-Z gates (see Schuld et al. arXi...
zapatacomputing/QClassify
src/qclassify/proc_circ.py
proc_circ.py
py
2,317
python
en
code
26
github-code
13
70101632979
import pika # remote server IP addr remote_server_addr = 'a.b.c.d' credentials = pika.PlainCredentials('guest', 'guest') parameters = pika.ConnectionParameters(remote_server_addr, 5672, '/', credentia...
CuteLemon/Learn
RabbitMQ/receiver.py
receiver.py
py
671
python
en
code
0
github-code
13
7511155226
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split from keras.models import Sequential from keras.layers import Dense, LSTM,Dropout import tensorflow ...
Kennedy-Wanjiku/finalyearapp
StockMarket_UI.py
StockMarket_UI.py
py
15,466
python
en
code
0
github-code
13
42084563138
import itertools import sys from collections import Counter sys.setrecursionlimit(10 ** 9) input = sys.stdin.readline M = 1000000007 N = int(input()) left = list(map(int, input().split())) counter = Counter(left) def dp(t, n1, n2, n3): cached = t.get((n1, n2, n3)) if cached is not None: return cached...
keijak/comp-pub
atcoder/sumitrust2019/E/main_dp.py
main_dp.py
py
1,219
python
en
code
0
github-code
13
27736111316
import tkinter as tk def convert_temperature(): try: temperature = float(entry.get()) if var.get() == 1: # Fahrenheit to Celsius result.set((temperature - 32) * 5/9) elif var.get() == 2: # Celsius to Fahrenheit result.set((temperature * 9/5) + 32) except ValueE...
Swapnil-Singh-99/PythonScriptsHub
Temperature Converter/temperature_converter.py
temperature_converter.py
py
1,404
python
en
code
19
github-code
13
13340326045
from matplotlib import pyplot as plt import statsmodels.api as sm import seaborn as sns import pandas as pd from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from statsmodels.datasets.longley import load_pandas # pairplot (scatter plot) 확인하기 dfy = load_pandas().endog dfX = l...
doheelab/backend-study
Statistics/regression/다중공선성과 변수 선택.py
다중공선성과 변수 선택.py
py
5,366
python
ko
code
0
github-code
13
41478229173
from flask import Flask from flask import jsonify import json import requests #from pymongo import MongoClient import random app = Flask(__name__) smhi_url = 'https://opendata-download-warnings.smhi.se/api/version/2.json' data ={"events": [{"id": 0, "name": "average wind speed at sea", "severity": "Moderate", "descr...
ThisIsCodeCommunity/disaster_relief_back_end
index.py
index.py
py
2,434
python
en
code
0
github-code
13
10807516381
import platform import sys import numpy as np import cv2 from rknn.api import RKNN import torch model = 'mnist_cnn.pt' rknn_model = 'mnist_cnn.rknn' input_size_list = [[1, 28, 28]] jpg_data_path = './test.jpg' npy_data_path = './test.npy' dataset_path = 'dataset.txt' def postprocess(input_data): index = input_da...
rockchip-linux/rknn-toolkit
examples/common_function_demos/single_channel_input/mnist/test.py
test.py
py
3,673
python
en
code
658
github-code
13
11026482382
from anduril import constants from anduril.arrayio import get_array from fasta import fasta_itr import anduril.main def fasta_merge(cf): """Merge an array of fastafiles.""" outfh = open(cf.get_output('output'), 'w') fastafiles = get_array(cf, 'fastafiles') cf.write_log(str(fastafiles)) for key, fastafile in fast...
mc-assemblage/nembase
components/FASTAMerge/fastamerge.py
fastamerge.py
py
459
python
en
code
0
github-code
13
16673421757
def take(count, iterable): counter = 0 for item in iterable: if counter == count: return counter += 1 yield item def distinct(iterable): seen = set() for item in iterable: if item in seen: continue yield item seen.add(item) def ...
nickmcsimpson/python_playground
corepy/generators.py
generators.py
py
578
python
en
code
0
github-code
13
2123553279
import logging import json from kafka import KafkaConsumer from kafka import KafkaProducer from flask import Flask app = Flask(__name__) logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) queues = {} producer = KafkaProducer(bootstrap_servers='localhost...
chrisatnoviflow/open-kilda
docs/design/hub-and-spoke/v7/poc/nb&fl/fl.py
fl.py
py
1,395
python
en
code
null
github-code
13
12345036805
""" Given a string consisting of lowercase letters count the number of non-increasing and non-decreasing sequences in the input Sample Input :gfcbdhdd Output :3(gfcb | dh | dd) Approach :) At start we consider the sequence type as none and will define the type of sequence(whether it’s non-increasing or non-decrea...
souravs17031999/100dayscodingchallenge
strings/count_non_increasing_non_decreasing_sequences.py
count_non_increasing_non_decreasing_sequences.py
py
2,061
python
en
code
43
github-code
13
17785456993
import os import matplotlib.pyplot os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.datasets import mnist import tensorflow_datasets as tfds (ds_train, ds_test), ds_info = tfds.load( "mnist", split=["train"...
iampaigedlamini/TensorFlow
TensorFlow_datasets.py
TensorFlow_datasets.py
py
1,325
python
en
code
0
github-code
13
32808079501
from setuptools import setup from codecs import open from os import path import argparse from distutils.extension import Extension import numpy as np # If building on OSX, may need to do this first: # export CFLAGS="-I/Users/nielsond/miniconda3/lib/python3.6/site-packages/numpy/core/include $CFLAGS" DEBUG = False U...
compmem/MELD
setup.py
setup.py
py
3,295
python
en
code
3
github-code
13
73126796498
# -*- coding: utf-8 -*- from odoo import models, fields, api, _ class account_journal(models.Model): _inherit = "account.journal" deferred_check = fields.Boolean('Chèque différé', help="Cocher cette case si c'est un journal pour les chèques différé dans le pos") check= fields.Boolean('Chèque', help="Cocher ...
hilinares1/MADEMO
tit_pos_paiement/models/account_journal.py
account_journal.py
py
1,099
python
fr
code
0
github-code
13