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
24346437022
''' This project is an extention of the previous deepLearning-1.py project here openCV is used to display the image but processed using Jetson inference and utilities ------------------------------------------------------------------------------------------- ''' import jetson.inference import jetson.utils import cv2 im...
Vishvambar-Panth/Jetson-Nano-Exercise
NVIDIA/deepLearning-1a.py
deepLearning-1a.py
py
1,575
python
en
code
0
github-code
13
14629223597
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model from swagger_server import util class NearestLeaf(Model): """NOTE: This class is auto generated by OpenAPI Gen...
Mykrobe-tools/mykrobe-atlas-distance-api
swagger_server/models/nearest_leaf.py
nearest_leaf.py
py
2,449
python
en
code
0
github-code
13
41048361799
from io import BytesIO from PIL import Image from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from sfs_server.files.models import File class FilesHttpTest(APITestCase): def test_can_create_...
SteelTurtle/sfs_project
sfs_server/files/tests/test_files_http.py
test_files_http.py
py
1,498
python
en
code
0
github-code
13
36070401212
from django import forms from .models import People, Taluk class PersonCreationForm(forms.ModelForm): class Meta: model = People fields = '__all__' widgets ={ 'district':forms.Select(attrs={'class':'form-control'}), 'taluk': forms.Select(attrs={'class': 'form-cont...
msgokul/vaccineapp
vaccineproject/vaccineapp/forms.py
forms.py
py
1,137
python
en
code
0
github-code
13
25141038813
tableData = [['apples', 'oranges', 'cherries', 'bannana'], ['Alice', 'Bob', 'Carol', 'David'], ['dogs', 'cats', 'moose', 'goose']] # define function & parameter def table_printer(args): # zips list | *args unpacks the list into positional argument for data in zip(*args): # tem...
tyarr/atbswp
ch06/tablePrint3.py
tablePrint3.py
py
593
python
en
code
1
github-code
13
38832767504
#bunch of lists: employees = ['Corey', 'Jim', 'Steven', 'April', 'Judy', 'Jenn', 'John', 'Jane' ] gym_members = ['April', 'John', 'Corey'] developers = ['Judy', 'Corey', 'Steven', 'Jane', 'April'] #Which members are developers and go to the gym? result = set(gym_members).intersection(developers) print(result) #no...
hwsanchez/Python_ex
example.py
example.py
py
843
python
en
code
0
github-code
13
71395266578
# @Author Benedict Quartey import matplotlib.pyplot as plt import numpy as np #matrix math #simplified interface for building models import keras from keras.callbacks import ModelCheckpoint import model as NN_model import data_processing #for reading files import os batch_size = 128 num_classes = 6 epochs = 10 ...
benedictquartey/Chiromancer
train.py
train.py
py
3,097
python
en
code
6
github-code
13
74030503059
from concurrent.futures import ProcessPoolExecutor # , ThreadPoolExecutor import logging import time FORMAT = "%(asctime)s %(threadName)s %(thread)8d %(message)s" logging.basicConfig(format=FORMAT, level=logging.INFO) def worker(n): logging.info('enter thread~~~~~~~{}'.format(n)) time.sleep(5) ...
sqsxwj520/python
并发编程/进程/进程池.py
进程池.py
py
1,033
python
en
code
1
github-code
13
75058918096
def help(self, input): """Displays information, usage and examples for a given command.""" cmd = input.args if not cmd: raise self.BadInputError() if cmd in self.plugin_aliases: cmd = self.plugin_aliases[cmd] for e in self.doc[cmd]: if e: self.say(e) ...
liato/spiffy
plugins/help.py
help.py
py
977
python
en
code
4
github-code
13
26100863005
import os import csv cand_list = {} break_line = "------------------------------" csvpath = os.path.join(".", "Resources", "election_data.csv") with open(csvpath) as csvfile: csv_reader = csv.reader(csvfile, delimiter = ",") csv_header = next(csv_reader) total_vote = 0 for row in csv_reader: ...
eddiexunyc/python-challenge
PyPoll/main.py
main.py
py
2,182
python
en
code
0
github-code
13
2239877141
#!/usr/bin/env python3 # dump.py -- dump DAPHNE INPUT spy buffers # Jamieson Olsen <jamieson@fnal.gov> Python3 from oei import * for i in [4,5,7,9]: thing = OEI(f"10.73.137.10{i}") reg=hex(thing.read(0x3001,8)[2]) print(f"reg= {reg} in ip address ending in {i}!" ) thing.close()
matheos/daphne_slow_control_scripts
read_link_control.py
read_link_control.py
py
309
python
en
code
0
github-code
13
24693823534
from selenium.webdriver.common.keys import Keys from selenium import webdriver from selenium.webdriver.common.by import By import os import time import math class Linkedin: email = os.getenv('email') password = os.getenv('password') def __init__(self): # linkprofile = webdriver.Ch...
sterrado/linkedin_bot
job_apply.py
job_apply.py
py
8,537
python
en
code
1
github-code
13
70333243538
from cmath import inf MAX_VAL = 1000001 def update(i, add, BIT): while (i > 0 and i < len(BIT)): BIT[i] += add i = i + (i & (-i)) def sum(i, BIT): ans = 0 while (i > 0): ans += BIT[i] i = i - (i & (-i)) return ans def insertElement(x, BIT): update(x, 1, BIT) def deleteE...
Emad-Salehi/Data-Structures-and-Algorithms-Course
HW#3/Q2.py
Q2.py
py
1,127
python
en
code
0
github-code
13
1766108876
import numpy as np import cv2 as cv from matplotlib import pyplot as plt lookUpTable = np.empty((1,256), np.uint8) for i in range(256): lookUpTable[0,i] = np.clip(pow(i / 255.0, 0.6) * 255.0, 0, 255) daytime_img = cv.imread('./nighttime place recognition dataset/test/00021510/20151102_160120.jpg') night_img = cv....
JasmineZZZ9/nighttime_place_recognition
nighttime place recognition/test_matching_2.py
test_matching_2.py
py
3,650
python
en
code
0
github-code
13
18468474985
import os import sys import numpy as np import cv2 import csv from PIL import Image import matplotlib.pyplot as plt import numpy as np from maskrcnn_benchmark.config import cfg from predictor import COCODemo def getVideoFile(): # for arg in sys.argv[1:]: # for arg in sys.argv[1]: # video_file = arg ...
binbin-xu/maskrcnn_for_midfusion
demo/video_mask_rcnn.py
video_mask_rcnn.py
py
4,179
python
en
code
3
github-code
13
34887156104
import pickle import time from abc import ABC, abstractmethod from typing import Optional import numpy as np import matplotlib.pyplot as plt from prettytable import PrettyTable from fitness.fitness_functions import RealValueFitnessFunction, FitnessFunction class GeneticAlgorithm(ABC): """The base class used to ...
fredrvaa/IT3708
project1/evolution/genetic_algorithm.py
genetic_algorithm.py
py
17,311
python
en
code
0
github-code
13
26964802324
import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service import unittest import HtmlTestRunner class GoogleSearchTest(unittest.TestCase): @classmethod def setUpClass(cls) -> None: baseUrl = "https://google.com" ...
jongsungbae/SeleniumWithPython
small_project/small_project_01/GoogleSearchTest.py
GoogleSearchTest.py
py
1,192
python
en
code
0
github-code
13
23249619116
#!/usr/bin/env python3 # encoding: utf-8 import bisect import dataclasses from typing import List, Optional @dataclasses.dataclass class TreeNode: start: int end: int sum: int = 0 left: Optional['TreeNode'] = None right: Optional['TreeNode'] = None class SegTree: def __init__(self, length: ...
misaka-10032/leetcode
coding/00315-count-smaller-after-self/solution.py
solution.py
py
2,513
python
en
code
1
github-code
13
19466257765
def spec_sum(n): x = 0 for i in range(65, n, 3): x += i return x def add(a, b): return a + b # Print the incoming list in ascending order. def bubble_sort(list): for i in range(len(list)): for j in range(len(list)): if list[j] > list[i]: tmp = list[j] ...
turo62/exercise
sandbox/justtry2.py
justtry2.py
py
516
python
en
code
0
github-code
13
23676863660
import logging import rasa_core from rasa_core.agent import Agent from rasa_core.domain import Domain from rasa_core.policies.keras_policy import KerasPolicy from rasa_core.policies.memoization import MemoizationPolicy from rasa_core.featurizers import (MaxHistoryTrackerFeaturizer, B...
mayflower/err-rasa
dialogue_model.py
dialogue_model.py
py
1,112
python
en
code
1
github-code
13
23885696318
from django.contrib import admin from .models import * from django.contrib.auth.models import User @admin.register(Billinginfo) class BillinginfoAdmin(admin.ModelAdmin): list_display= ['user','country', 'postcode', 'phone', 'id_list'] list_editable= ['country', 'phone'] list_filter= ['country', 'phone'] ...
Huzzy619/it_next
users/admin.py
admin.py
py
493
python
en
code
0
github-code
13
39399916243
#!/usr/bin/env python import os import sys import subprocess import time import signal def file_filter(name): return (name.endswith(".py") and not ("autoreload.py" in name)) def file_times(path): for top_level in os.listdir(path): if not os.path.isdir(top_level) and file_filter(top_level ): ...
asano3091/autoreload
autoreload.py
autoreload.py
py
1,350
python
en
code
0
github-code
13
2591747786
class Array: def __init__(self,cape): self.arrty = [None] * cape self.size = 0 def insert(self,index,element): if index < 0 or index > self.size: raise Exception('数组越界') if self.size >= len(self.arrty): arrty.addkuorong() for i in range(self.size...
Mrliuyuchao/ds
6月18/lianxi1.py
lianxi1.py
py
907
python
en
code
0
github-code
13
39810039211
from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer from gensim.models import KeyedVectors import re import numpy as np from joblib import dump, load from utils import power_iteration, track_trans import tkinter as tk from tkinter import ttk from tkinter import scrolledtext d...
DongqiFu/DISCO
gui_disco.py
gui_disco.py
py
7,097
python
en
code
5
github-code
13
25941402395
# Shortest Path in Binary Matrix ''' n x n binary matrix인 grid가 주어졌을 때, 출발지에서 목적지까지 도착하는 가장 빠른 경로의 길이를 반환하시오. 만약 경로가 없다면 -1을 반환하시오. 출발지 : top-left cell 목적지 : bottom-right cell - 값이 0인 cell만 지나갈 수 있다. - cell끼리는 8가지 방향으로 연결되어 있다. (edge와 corner 방향으로 총 8가지) - 연결된 cell을 통해서만 지나갈 수 있다. ex) Input: grid = [ [0,...
cjkywe07/codingTestStudy
inflearn/ch06/shortestPath_05.py
shortestPath_05.py
py
3,595
python
ko
code
0
github-code
13
10719050269
from gensim.models import Doc2Vec def init_model(tagged_articles, dimension_size, iterations): model = Doc2Vec(min_count=1, size=dimension_size, iter=iterations, workers=1, window=4, seed=1) model.build_vocab(tagged_articles) model.train(tagged_articles) return model
vineetjohn/semeval2017-task5
utils/doc2vec_helper.py
doc2vec_helper.py
py
289
python
en
code
10
github-code
13
927337183
import tkinter as tk # this is for Window creation from tkinter import Tk, Label, Button, Menu, Entry, messagebox # that is required in my application # from tkinter import * import os # Python package os and it is used to know pwd # Done by Yuling, Mohammed, Tejal and Shahzeb: Below are all classes are implemente...
syed66/Student-voting-system
Main.py
Main.py
py
21,945
python
en
code
0
github-code
13
72275818257
# TODO: check format of file? guess format maybe; use BioPython to parse variety of formats? #: set: valid IUPAC nucleotide characters for checking FASTA format VALID_NUCLEOTIDES = {'A', 'a', 'C', 'c', 'G', 'g', 'T', 't', 'R', 'r', ...
phac-nml/sistr_cmd
sistr/src/parsers.py
parsers.py
py
3,758
python
en
code
21
github-code
13
10963963907
from . import icons, panel, preferences, localdb, ops, test, key, pie bl_info = { "name": "POPOTI Align Helper", "description": "More friendly alignment based on observation perspective", "author": "AIGODLIKE社区,小萌新", "version": (1, 2, 0), "blender": (3, 0, 0), "location": "Tool Panel", "sup...
AIGODLIKE/popoti_align_helper
__init__.py
__init__.py
py
628
python
en
code
5
github-code
13
7676896982
from collections import Counter # Function to check if a number is a permutation of other # it takes two strings as parameters, both being the respective numbers def is_perm(n, x): if len(n) != len(x): return False else: a = sorted(n) b = sorted(x) for i in range(len...
notBlurryFace/project-euler
PE062.py
PE062.py
py
800
python
en
code
1
github-code
13
39241066556
import os import shutil def remove(path: str): """ Fully remove directory """ if os.path.exists(path): if os.path.isdir(path): shutil.rmtree(path) else: os.remove(path) def mkfile(path: str): """ Create file """ if not os.path.exists(os.path.sp...
n00-name/12345
ide/utils/files.py
files.py
py
574
python
en
code
0
github-code
13
25935309643
from argparse import ArgumentParser import numpy as np from src.best_pairs_finder_non_brute_force import BestPairsFinderNonBruteForce from src.best_pairs_finder import BestPairsFinder class ParseArgs: def convert_to_dictionary( self, arg ): """ Function that converts to a dictionary the arguments r...
Team2Munchkin/particle_project
src/find_optimal_pairs.py
find_optimal_pairs.py
py
4,250
python
en
code
0
github-code
13
28187724655
import sys from PyQt4.QtCore import Qt from PyQt4.QtGui import * app = QApplication([]) tableWidget = QTableWidget() tableWidget.setContextMenuPolicy(Qt.ActionsContextMenu) quitAction = QAction("Quit", None) quitAction.triggered.connect(app.quit) tableWidget.addAction(quitAction) tableWidget.show() sys.exit(app.ex...
brownharryb/webtydesk
example_can_delete.py
example_can_delete.py
py
326
python
en
code
0
github-code
13
6616324034
agent = [(0, 0), (1, 3)] prob = {(0, 0) : 0.4, (1, 3) : 0.6} target = [(0, 1), (0, 2), (1, 1), (1, 2)] probs = [0, 0, 0, 0, 0, 0] for aR, aC in agent: for tR, tC in target: pr = prob[(aR, aC)] * 0.25 if aR == tR and aC == tC: probs[0] += pr elif aR == tR and aC+1 == tC: ...
Aa-Aanegola/ML-Assignments
Assignment_3/Part_2/calcObs.py
calcObs.py
py
588
python
en
code
0
github-code
13
37412156879
import re import csv def file_to_array(file_name, validation, ignore_line_1=True): output = [] f = file(file_name) f = f.readlines() if ignore_line_1 == True: f.pop(0) for line in f: l = line.split(',') output.append(l) if validation == True: output = output[3::4] elif validation == False: output = o...
pmiller10/best_buy
kaggle.py
kaggle.py
py
2,358
python
en
code
0
github-code
13
8442554274
# get all files import glob directory = 'ScaledWiki/Tests/Task07/1_24_23/Figs' pngs = glob.glob(directory + '/*') import markdown output = "" for figure in pngs: output += "![](%s)\n" % figure with open("Figures.md", "w") as f: f.write(markdown.markdown(output))
greyliedtke/PyExplore
SubProjects/DocGeneration/SPI/fig_to_md.py
fig_to_md.py
py
280
python
en
code
0
github-code
13
35596778209
from .i2cDevice import * from ..device import pyLabDataLoggerIOError import datetime, time import numpy as np from termcolor import cprint try: import Adafruit_ADS1x15 except ImportError: cprint( "Error, could not load Adafruit_ADS1x15 library", 'red', attrs=['bold']) #########################################...
djorlando24/pyLabDataLogger
src/device/i2c/ads1x15Device.py
ads1x15Device.py
py
4,282
python
en
code
11
github-code
13
73937024019
import unittest from modules.card_slot_mod import CardSlot from modules.game_controller_mod import GameController from unittest.mock import MagicMock from unittest.mock import Mock from modules.game_model_mod import GameModel test_winning_value_cases = [ [54, None], [0, None], [105, 10], [99, None], ...
willygroup/105-game
tests/game_controller_test.py
game_controller_test.py
py
1,932
python
en
code
1
github-code
13
37085208903
from __future__ import absolute_import from __future__ import unicode_literals import itertools import os from ..variants import revcomp try: from pyfaidx import Genome as SequenceFileDB # Allow pyflakes to ignore redefinition in except clause. SequenceFileDB except ImportError: SequenceFileDB = Non...
counsyl/hgvs
pyhgvs/tests/genome.py
genome.py
py
5,761
python
en
code
167
github-code
13
18194963659
# Coordinate systems transformations # # @author: Anna Eivazi import numpy as np from src.rotation_matrix import calculate_rotation_matrix_extrinsic def transform_2D_to_3D(x, y, focal_length, pixel_size_x, pixel_size_y, principal_point_x, principal...
aeivazi/gaze-estimation
src/coordinate_system_transformations.py
coordinate_system_transformations.py
py
2,657
python
en
code
4
github-code
13
24913491520
# 베르트랑 공준 def isPrime(n): for i in range(2, int(n**(1/2)) + 1): if n % i == 0: return False return True prime = list() for i in range(2, (123456 * 2) + 1): if isPrime(i): prime.append(i) while True: n = int(input()) if n == 0: break count = 0 for p in ...
yeon7485/cote-study
단계별로 풀어보기/기본 수학2/bj_4948.py
bj_4948.py
py
428
python
en
code
0
github-code
13
5911374664
class Solution: def deleteGreatestValue(self, grid): answer = 0 # first modify the rows in grid so that all rows are in assending order for row in range(len(grid)): grid[row] = sorted(grid[row]) # while grid[0] is not empty continue the loop while grid[0]: ...
collinsakuma/LeetCode
Problems/2500. Delete Greatest Value in Each Row/delete_greatest_value.py
delete_greatest_value.py
py
766
python
en
code
0
github-code
13
71899433618
import random import time import threading from collections import defaultdict from datetime import timedelta from dateutil import tz from dateutil.tz import tzutc import string import traceback from copy import copy from cement.utils.misc import minimal_logger from botocore.compat import six from datetime import date...
ianblenke/awsebcli
ebcli/health/data_poller.py
data_poller.py
py
13,638
python
en
code
3
github-code
13
6492842462
from flask import Flask, render_template, session, request, make_response, json, jsonify, url_for from flask_socketio import SocketIO, emit, join_room, leave_room,close_room, rooms, disconnect import glob # import json import math import numpy as np import os import pyaudio from random import randint from threading imp...
dggsax/vigilaveris
webpage/main.py
main.py
py
26,956
python
en
code
0
github-code
13
41310510364
from google.oauth2 import service_account from googleapiclient.errors import HttpError from googleapiclient.http import MediaFileUpload from googleapiclient.discovery import build import sys def main(): # Replace 'your-service-account-key.json' with the path to your Service Account key file credentials = servi...
wraith4081/gdrive-upload
index.py
index.py
py
1,418
python
en
code
3
github-code
13
70652616979
#!/usr/bin/env python #Author - Teja Koganti (D3B) import argparse import pandas as pd parser = argparse.ArgumentParser() parser.add_argument('-i', '--histologies', required = True, help = 'path to the histology file') parser.add_argument('-o', '--outnotebook', required = True, ...
AlexsLemonade/OpenPBTA-analysis
analyses/molecular-subtyping-EPN/01-make_notebook_RNAandDNA.py
01-make_notebook_RNAandDNA.py
py
3,009
python
en
code
94
github-code
13
33611716816
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import json import pandas as pd from companyMessage.items import CompanymessageItem from companyMessage.items import DetailedI...
DunShou/ScrapyItem
companyMessage/pipelines.py
pipelines.py
py
2,571
python
en
code
0
github-code
13
32078177510
#퍼셉트론 구현하기 def AND(x1 , x2): w1, w2, theta = 0.5, 0.5, 0.7 tmp = x1*w1 + x2*w2 if tmp <= theta: return 0 elif tmp > theta: return 1 print(AND(0,0)) print(AND(1,0)) print(AND(0,1)) print(AND(1,1)) """출력 0 0 0 1 """ #임계값을 편향으로 나타내기 import numpy as np def AND2(x1,x2): x = np.array([...
wotjd0715/DeepLearning2
2.Perceptron/letstudy.py
letstudy.py
py
1,330
python
en
code
0
github-code
13
17831477410
from .base import BaseTestCase from .fixtures import (create_customer_string, create_book_string, borrow_books_string) class MutationsTestcase(BaseTestCase): def test_create_customer(self): response = self.client.execute( create_customer_string.format(username='kafuuma'...
kafuuma/Rent-books-app
booksapp/tests/test_mutations.py
test_mutations.py
py
2,971
python
en
code
0
github-code
13
27389190173
from flask import Flask, render_template, request, url_for from datetime import datetime, date azi = date.today() app = Flask(__name__) app.secret_key = "asecretkey" @app.route('/', methods=['POST','GET']) def home(): name = request.form.get('name') if name != None: return render_template('bday.htm...
iancuioan/DdayFlask
app.py
app.py
py
766
python
en
code
0
github-code
13
19609893092
from typing import Dict, List from src.infra.interfaces import SpaceFlightNewInterfaceRepository from src.utils.errors import MissingParamError from src.infra.config import DBConnectionHandler class SpaceFlightNewRepository(SpaceFlightNewInterfaceRepository): def insert(self, data: Dict = None) -> Dict: i...
joaoo-vittor/back-end-challenge
src/infra/repo/space_flight_new_repository.py
space_flight_new_repository.py
py
2,576
python
en
code
0
github-code
13
21651845006
from tweepy import Stream from tweepy import OAuthHandler import time from tweepy.streaming import StreamListener ckey='eZSxJEtGtCY5SqcVh3cZUbf27' csecretkey='Ub7vovbs2M8uCAKBuGslBy4Sb9ArHOXFaRYhtp12k5ZMQDOZOF' atoken='449479332-1dha1NMfojFmuY1tBuNjrzHmZnJSRt8bhgejrV0p' asecret='hpmw39VPT5m3XlFmuDW416u24melcqLVur0E8vZ...
sdquintana/StreamingAPI
Streaming.py
Streaming.py
py
924
python
en
code
0
github-code
13
20074687346
import json import re import requests ###################################################### ########## TRAITEMENT DU FICHIER LIGNES TAO ########## def traitement(): raw_data = [] res = requests.get('https://data.orleans-metropole.fr/api/records/1.0/search/?dataset=referentielbdauao_dep_iti_cyclables&facet=co...
robinanthony/celc
bdd/resources/scripts_bdd/lignes_velo.py
lignes_velo.py
py
2,833
python
en
code
0
github-code
13
42054042398
import sys try: import frosch frosch.hook() except ImportError: pass ini = lambda: int(sys.stdin.readline()) inl = lambda: [int(x) for x in sys.stdin.readline().split()] ins = lambda: sys.stdin.readline().rstrip() debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) d...
keijak/comp-pub
atcoder/abc192/B/main.py
main.py
py
580
python
en
code
0
github-code
13
928031303
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, AutoToolsBuildEnvironment, tools import os class GPGErrorConan(ConanFile): name = "libgpg-error" version = "1.24" url = "http://github.com/DEGoodmanWilson/conan-libgpg-error" description = "Libgpg-error is a small library tha...
DEGoodmanWilson/conan-libgpg-error
conanfile.py
conanfile.py
py
3,511
python
en
code
0
github-code
13
20934317193
############################################### # # Author: Aniruddha Gokhale # Vanderbilt University # # Purpose: Skeleton/Starter code for the subscriber application # # Created: Spring 2023 # ############################################### # This is left as an exercise to the student. Design the logic in a manner ...
saydus/distributed-hw1
SubscriberAppln.py
SubscriberAppln.py
py
16,304
python
en
code
0
github-code
13
30118227450
from django import forms from django.contrib.auth.models import User from .models import Profile from django.views.generic import FormView from django.urls import reverse from paypal.standard.forms import PayPalPaymentsForm class ProfileUpdateForm(forms.ModelForm): class Meta: model=Profile fields...
dustyj1984/handygig01
accounts/forms.py
forms.py
py
1,024
python
en
code
0
github-code
13
7017992250
class classBecauseINeedToTurnTheseIntoMethodsForSomeReason: #Defibe the input class def checkFloat(self, inu): floatList = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."] #Define a list of string floats to compare the input to t = "" #Define blank string r = 0 ...
landynS8990/posSys2
inputControl.py
inputControl.py
py
4,927
python
en
code
0
github-code
13
18254582323
#coding:utf-8 # 2018-3-16 # build by qianqians # genjs import sys sys.path.append("./") sys.path.append("./parser") import os import jparser from checkAndPretreatCommon import * def gen(inputdir, lang, outputdir): syspath = "./common/" c_suffix = "" if lang == 'csharp': sys.p...
qianqians/discard
abelkan_rpc_typescript_csharp/gencommon.py
gencommon.py
py
1,915
python
en
code
1
github-code
13
73240313938
import matplotlib.pyplot as plt from matplotlib import animation import numpy as np from numba import jit from timeit import default_timer as timer import random start = timer() ''' FRACTAL Functions and parameters to change the appearance and behavior of the fractals generated ''' # PARAMETERS TO CHANGE THE FRACTA...
shaunramsey/FractalExploration
Fractals/Markus-Lyapunov Fractals/ANIMATED_lyapunov_fractal_probabilistic_logistic_map.py
ANIMATED_lyapunov_fractal_probabilistic_logistic_map.py
py
4,684
python
en
code
5
github-code
13
31200963128
from st2common.constants.pack import SYSTEM_PACK_NAME from st2common.models.system.common import ResourceReference __all__ = [ 'WEBHOOKS_PARAMETERS_SCHEMA', 'WEBHOOKS_PAYLOAD_SCHEMA', 'INTERVAL_PARAMETERS_SCHEMA', 'DATE_PARAMETERS_SCHEMA', 'CRON_PARAMETERS_SCHEMA', 'TIMER_PAYLOAD_SCHEMA', ...
gtmanfred/st2
st2common/st2common/constants/triggers.py
triggers.py
py
6,069
python
en
code
null
github-code
13
27165078205
from django.urls import path, include # from app.api.employee import views from app.api.accountant import views urlpatterns = [ path('create/', views.Accountant_createAPIView.as_view(), name='api-accountant-create'), path('update/<int:id>', views.Accountant_updateAPIView.as_view(), name='api-accountant-update...
shadowwa1k3r/osg_employee
app/api/accountant/urls.py
urls.py
py
520
python
en
code
0
github-code
13
5072810206
import glob import pickle import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.gaussian_process import GaussianProcessClassifier from sklearn.linear_model import LogisticRegression from sklearn.metrics import confusion_matrix from sklearn.model_selection import KFol...
kun0906/activity_recognition
legacy/shinan.py
shinan.py
py
13,386
python
en
code
2
github-code
13
31044921506
#!/usr/bin/env python2 # coding: utf8 from __future__ import division, print_function import itertools import os import time from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from .utilities import unicode_dammit, render_dict, by_chunks_of from .server import show_connection from .streamer import Metada...
johntyree/rio
rio/mock_server.py
mock_server.py
py
2,034
python
en
code
5
github-code
13
23870796408
from email import message from django_filters.rest_framework import DjangoFilterBackend from rest_framework import permissions from rest_framework.decorators import action from rest_framework.filters import SearchFilter from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from ...
Huzzy619/Learning-Management-System-API
learn/views.py
views.py
py
6,045
python
en
code
0
github-code
13
41767966472
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def f(self, root, parent, d): if root: if root.val == self.x: s...
ritwik-deshpande/LeetCode
993-cousins-in-binary-tree/993-cousins-in-binary-tree.py
993-cousins-in-binary-tree.py
py
960
python
en
code
0
github-code
13
11161186630
import random import time from pyinsect.collector.NGramGraphCollector import NGramGraphCollector if __name__ == "__main__": def getRandomText(iSize): # lCands = list("abcdefghijklmnopqrstuvwxyz" + "abcdefghijklmnopqrstuvwxyz".upper() + "1234567890!@#$%^&*()") lCands = list("abcdef") sRes ...
ggianna/PyINSECT
examples/example_n_gram_graph_collector.py
example_n_gram_graph_collector.py
py
1,443
python
en
code
3
github-code
13
72727926419
''' ODEs representing the HIV model. ''' import warnings import numpy from scipy import integrate import pandas from . import control_rates variables = ( 'susceptible', # S 'vaccinated', # Q 'acute', # A 'undiagnosed', # U 'diagnosed', # D 'treate...
janmedlock/HIV-95-vaccine
model/ODEs.py
ODEs.py
py
9,735
python
en
code
1
github-code
13
27454731834
import numpy as np class Renderer: def __init__(self, height, width, config): self.height = height self.width = width self.content = dict() self.m = None self.f = None self.resize(height, width) self.config = config self.btoggle = 0 self.act...
dewberryants/asciiMol
asciimol/app/renderer.py
renderer.py
py
11,649
python
en
code
344
github-code
13
41491176044
import os SECRET_KEY = os.urandom(32)# Grabs the folder where the script runs. basedir = os.path.abspath(os.path.dirname(__file__))# Enable debug mode. DEBUG = True# Connect to the database SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://sql11496228:fQvMfR2mG8@sql11.freesqldatabase.com/sql11496228'# Turn off the Flask-...
faroukdon/cynax-store
config.py
config.py
py
486
python
en
code
0
github-code
13
70674377299
# Importing necessary modules and libraries for the TextGeneratorServicer class. import grpc from transformers import AutoTokenizer, AutoModelWithLMHead import concurrent.futures as futures # Importing the textgen_pb2 and textgen_pb2_grpc modules generated from protobuf files. import textgen_pb2 import textgen_pb2_grp...
Codehackerone/storyforge
python-server/server.py
server.py
py
2,023
python
en
code
1
github-code
13
38035037138
__doc__ = '''a python script to workaround various limitations of rootmap files and reflex/cint typename impedance mismatches. ''' __version__ = '$Revision: 1.1 $' __author__ = 'Sebastien Binet <binet@cern.ch>' if __name__ == "__main__": import sys import os import PyUtils.Dso as Dso oname = 'typereg_...
rushioda/PIXELVALID_athena
athena/Tools/PyUtils/bin/gen-typereg-dso.py
gen-typereg-dso.py
py
765
python
en
code
1
github-code
13
24805170602
import argparse from randomPredictor import RandomPredictor from medianPredictor import MedianPredictor from basePredictor import BasePredictor from modePredictor import ModePredictor if __name__ == '__main__': parser = argparse.ArgumentParser(description='Local Value Predictor') parser.add_argument('--histor...
pushkarsharma/load-value-predictor
comparePredictors.py
comparePredictors.py
py
4,237
python
en
code
0
github-code
13
26836924912
import operator train = [('토마스', 5), ('헨리', 8),('에드워드', 9),('에밀리', 5),('토마스', 4),('헨리', 7),('토마스', 3),('에밀리', 8),('퍼시', 5),('고든', 13)] t_dic, t_list = {},[] tmpTup = None tot_rank, cur_rank = 1, 1 if __name__ == '__main__' : print('-----2021041047 허정윤-----') for tmpTup in train : tName = tmpTup...
inte168/OpenProject1
4weak/hw2.py
hw2.py
py
972
python
en
code
0
github-code
13
29651883673
from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ 'RemoveLiloPlugin', ] import os import logging from janitor.plugincore.i18n import setup_gettext from janitor.plugincore.core.package_cruft import PackageCruft from janitor.plugincore.plugin import Plugin ...
GalliumOS/update-manager
janitor/plugincore/plugins/remove_lilo_plugin.py
remove_lilo_plugin.py
py
1,172
python
en
code
4
github-code
13
39878884381
import pygame, random TOWER_SPEED = 5 SKY_COLOR = (25, 2, 52) score = 0 highscore = 0 started = False gameOver = False towers = [] opPlanes = [] deathMessage = None plane = pygame.transform.flip(pygame.image.load('plane.png'), True, False) opPlane = pygame.image.load('planeBlue.png') pygame.in...
Dante-W/PivotPilot
PivotPilot/Static.py
Static.py
py
2,871
python
en
code
0
github-code
13
21928358173
# Given an array of positive integers nums and an integer k, # find the length of the longest subarray whose sum is less than or equal to k. class Solution: def find_length(nums, k): ans = 0 l = 0 cur_len = 0 cur_sum = 0 for r in range(len(nums)): cur_len += 1 ...
dyabk/competitive-programming
LeetCode/find_length.py
find_length.py
py
525
python
en
code
0
github-code
13
38900165349
import graphene from graphene_django import DjangoObjectType from ..models import ( Author, Publisher, Genre, BookList, Format, ReadBy ) class AuthorOutputType(DjangoObjectType): id_int = graphene.Int(description="The integer representation of the ID") @staticmethod def resolve_i...
MichaelAchterberg72/MyWeXlog_v2
booklist/graphql/output_types.py
output_types.py
py
4,096
python
en
code
0
github-code
13
41777602056
# Define the actions we may need during training # You can define your actions here import random from Tool.SendKey import PressKey, ReleaseKey import time # Hash code for key we may use: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN UP_ARROW = 0x26 DOWN_ARROW = 0x28 LE...
Radiance-nt/HollowKnight-AI
Tool/Actions.py
Actions.py
py
2,165
python
en
code
0
github-code
13
29416481771
# creating index based on timestamp and symbol from openpyxl import load_workbook, Workbook def mongoDbpopulate(collection): print(collection.index_information()) # Loading all the excel files wb = load_workbook("./data/BNBUSDT.xlsx",data_only=True) shBNB = wb["BNBUSDT"] wb = load_workbook("./dat...
tarunsai284/flaskPro
static/mongoDBpopulate.py
mongoDBpopulate.py
py
1,808
python
en
code
0
github-code
13
41619144916
import pygame class Button: def __init__(self, pos, display_surface, path) -> None: self.image = pygame.image.load(path) self.image = pygame.transform.scale(self.image, (50,50)) self.rect = self.image.get_rect() self.rect.topleft = pos self.display_surface = display_surface ...
AgustinSande/sandeAgustin-pygame-tp-final
codefiles/button.py
button.py
py
944
python
en
code
0
github-code
13
7296431355
# Work №1 - Task №3 # Задача 6: Вы пользуетесь общественным транспортом? # Вероятно, вы расплачивались за проезд и получали билет с номером. # Счастливым билетом называют такой билет с шестизначным номером, где сумма первых трех цифр равна сумме последних трех. # Т.е. билет с номером 385916 – счастливый, т.к. 3+8+5...
Ritorta/HomeWork_Python
Work№1/Task3/W1Z3.py
W1Z3.py
py
1,659
python
ru
code
0
github-code
13
73226656338
from fastapi.responses import HTMLResponse, RedirectResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from fastapi import FastAPI from fastapi import Request, Depends, Request, Form from config.db import SessionLocal, engine import model.curso_model from sqlalchemy.orm ...
ctesenb/Cursos
main.py
main.py
py
4,036
python
en
code
0
github-code
13
13159929455
import numpy as np from DriftAnalysisFramework.Optimization import CMA_ES from DriftAnalysisFramework.Transformation import CMA_ES as TR from DriftAnalysisFramework.Fitness import Sphere from alive_progress import alive_bar # Globals groove_iteration = 5000 measured_samples = 1000000 alpha_sequence = np.linspace(0,...
Sm4ster/DriftAnalysisFramework
py/CMA_sigma_analysis.py
CMA_sigma_analysis.py
py
1,942
python
en
code
0
github-code
13
6213905517
# 557. Reverse Words in a String III class Solution: def reverseWords(self, s: str) -> str: s = list(s) l = len(s) start_index_list = list() end_index_list = list() start_index_list.append(0) for i in range(l): if s[i] == ' ': ...
feyza-droid/leetcode_solutions
0557/main.py
main.py
py
1,098
python
en
code
0
github-code
13
71670952018
#!/usr/bin/python3 if __name__ == "__main__": from sys import argv if len(argv) != 4: print("Usage: ./100-my_calculator.py <a> <operator> <b>") quit(1) a = int(argv[1]) b = int(argv[3]) ops = ["+", "-", "*", "/"] from calculator_1 import add, sub, mul, div funcs = [add, sub, ...
leelshaday/alx-higher_level_programming
0x02-python-import_modules/100-my_calculator.py
100-my_calculator.py
py
568
python
en
code
6
github-code
13
8092978118
from .bp_lib import bp_types, bp_unit, bp_utils from . import data_cabinet_parts from . import data_cabinet_carcass from . import data_countertops from . import data_cabinet_doors from . import kitchen_utils import time import math class Standard_Cabinet(bp_types.Assembly): show_in_library = True category_name...
CreativeDesigner3D/Library_Kitchen
data_cabinets.py
data_cabinets.py
py
4,099
python
en
code
2
github-code
13
10699623175
#!/usr/bin/python # -*- coding:utf-8 -*- import numpy as np from sklearn import svm import matplotlib.pyplot as plt from PIL import Image if __name__ == "__main__": ''' N = 50 np.random.seed(0) x = np.sort(np.random.uniform(0, 6, N), axis=0) y = 2*np.sin(x) x = x.reshape(-1, 1) print ('...
ParkerGong/Automatic_Ionogram_Detection_with_YOLOv3
SVR/SVR-Type3.py
SVR-Type3.py
py
3,066
python
en
code
0
github-code
13
2462880831
# -*- coding: utf-8 -*- """ Created on Sun Apr 24 18:25:56 2016 @author: Ryan-Rhys """ import numpy as np import matplotlib.pyplot as plt # Hamaker coefficient values taken from Parsegian and Weiss 1981. # The values given in table IId in this paper were converted to units of kT. # For reference: 1 erg = 1*10^-7 jo...
Ryan-Rhys/Nanoparticle-Systems
The_Bulk_Error_Margins.py
The_Bulk_Error_Margins.py
py
2,757
python
en
code
2
github-code
13
38899059956
# THIS SCRIPT IS PROVIDED BY THE ORGANIZATOR import re import pandas as pd import os import numpy as np import gradio as gr from src.utils.preprocess_utils import preprocess_text from src.utils.constants import TARGET_DICT, TARGET_INV_DICT from src.models.bert_model import BertModel # CV Voting Model Load # For mode...
L2-Regulasyon/Teknofest2023
app.py
app.py
py
5,610
python
en
code
8
github-code
13
5660744765
with open("score.txt", "r") as f : data = f.readlines() a=[]; b=[]; c=[] for i in data : a.append(i.split()) for i in a : b.append(float(i[1])*0.4+float(i[2])*0.6) for i in b : if i>=90 : c.append('(A)') elif i>=80 : ...
JinhoCHOIS/AB-A
파이썬기초/Day3_최진호.py
Day3_최진호.py
py
636
python
en
code
0
github-code
13
12139795183
import jieba.posseg as psg def pos(text): results = psg.cut(text) for w, t in results: print("%s/%s" % (w, t), end=" ") print("") text = "呼伦贝尔大草原" pos(text) text = "梅兰芳大剧院里星期六晚上有演出" pos(text)
15149295552/Code
Month09/NLP_DATA/NLP_study/NLP_study/06_jieba_pos.py
06_jieba_pos.py
py
261
python
en
code
1
github-code
13
39438590371
from typing import Union, Tuple, Callable, Optional, List from time import time from threading import Thread, Lock import numpy as np import matplotlib.pyplot as plt from PyQt5.QtCore import pyqtSignal, Qt, QObject from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QApplication from Utility.Layouts import ListWid...
atomicplasmaphysics/BCA-GUIDE
Simulations/Simulations.py
Simulations.py
py
57,933
python
en
code
4
github-code
13
1461993515
__docformat__ = "restructuredtext en" import roslib roslib.load_manifest('pr2_plan_utils') import rospy import actionlib import pr2_plan_utils.exceptions as ex import pr2_controllers_msgs.msg as pr2c import actionlib_msgs.msg as am import actionlib as al class Torso(object): def __init__(self): """ ...
natanaso/active_object_detection
pr2_planning_module/pr2_plan_utils/src/pr2_plan_utils/torso.py
torso.py
py
1,452
python
en
code
3
github-code
13
12139805943
# -*- coding: utf-8 -*- # 通过tf-idf提取高频词汇 import glob import random import jieba # 读取文件内容 def get_content(path): with open(path, "r", encoding="gbk", errors="ignore") as f: content = "" for line in f.readlines(): line = line.strip() content += line return content #...
15149295552/Code
Month09/NLP_DATA/NLP_study/NLP_study/ML_NLP/04_get_tf_demo.py
04_get_tf_demo.py
py
1,461
python
en
code
1
github-code
13
15540950482
import numpy as np import math # sigmoid from scipy.special import expit # returns word index def getWordIdx(word): idx = np.where(ptb_wtoi == word)[0] if len(idx) == 0: idx = np.where(ptb_wtoi == "<unk>")[0] return idx[0] # returns embedding given word index def getEmbedding(idx): return embedding_mat[id...
sy2358/Word-Embedding-and-LSTM-for-Language-Modelling
rnn.py
rnn.py
py
2,798
python
en
code
0
github-code
13
13356092137
# -*- coding: utf-8 -*- from __future__ import division #1/2 = float, 1//2 = integer, python 3.0 behaviour in 2.6, to make future port to 3 easier. from __future__ import print_function from optparse import OptionParser import os import struct import sys import zlib import time debug = False if not debug: impo...
HorstBaerbel/ubootwrite
ubootwrite.py
ubootwrite.py
py
7,502
python
en
code
21
github-code
13
2048451364
import os.path import time from iterfzf import iterfzf def iter_pokemon(sleep=0.01): filename = os.path.join(os.path.dirname(__file__), 'pokemon.txt') with open(filename) as f: for l in f: yield l.strip() time.sleep(sleep) def main(): result = iterfzf(iter_pokemon(), mul...
dahlia/iterfzf
examples/pokemon.py
pokemon.py
py
419
python
en
code
147
github-code
13
15049000700
from django.urls import path from . import views from . import url_handlers urlpatterns = [ #path("", views.index, name="index"), path("klient_index/", views.FilmIndex.as_view(), name="klient_index"), path("<int:pk>/klient_detail/", views.CurrentFilmView.as_view(), name="klient_detail"), path("create_k...
ladislav-moravec/mysite2
clientapp/urls.py
urls.py
py
705
python
en
code
1
github-code
13
2868328198
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow_probability import distributions as tfd from dreamer.tools import nested class MPCAgent(object): def __init__(self, batch_env, step, is_training,...
google-research/dreamer
dreamer/control/mpc_agent.py
mpc_agent.py
py
3,431
python
en
code
575
github-code
13