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
7915943779
#!/usr/bin/python3 "IMPORTS" import os,sys,time,getpass from platform import system "COLORS" green='\033[32m' blue='\033[34m' red='\033[31m' white='\033[37m' black='\033[30m' pink='\033[95m' end="\033[0m" "RESIZE" os.system("resize -s 25 95 > /dev/null") "Functions To Help Me Later" def remv(): os.system("rm -r ...
black15/Lazy-PY
Lazy.py
Lazy.py
py
13,070
python
en
code
3
github-code
1
36234924161
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Nov 1 10:04:59 2018 @author: vganapa1 """ import numpy as np from scipy.io import loadmat import matplotlib.pyplot as plt from scipy.ndimage.interpolation import shift def F(mat2D): # Fourier tranform centered at zero mat2D = np.fft.fftshift(mat2D...
Mualpha7/Engineering_JupyterFiles
ENGR 030. Computation optics/CLEAN_TutorialNov1.py
CLEAN_TutorialNov1.py
py
2,511
python
en
code
0
github-code
1
20048120941
from django.db import models from django.utils import timezone from embed_video.fields import EmbedVideoField from multiselectfield import MultiSelectField CATEGORY_CHOICES =( ('action','ACTION'), ('biography','BIOGAPHY'), ('drama','DRAMA',), ('comedy','COMEDY'), ('romance','ROMANCE',), ) LANGUAG...
sureshsaravananbabu/IMDB-clone
imdb/movie/models.py
models.py
py
1,730
python
en
code
0
github-code
1
13042849748
"""State machine for parsing IOTile reports coming in on a streaming basis""" from iotile.core.exceptions import ArgumentError from iotile.core.dev import ComponentRegistry class IOTileReportParser: """Accumulates data from a stream and emits IOTileReports Every time new data is available on the stream, add...
iotile/coretools
iotilecore/iotile/core/hw/reports/parser.py
parser.py
py
6,460
python
en
code
14
github-code
1
38755112529
import numpy as np import pyart import gc import tempfile import os # We want cfgrib to be an optional dependency to ensure Windows compatibility try: import cfgrib CFGRIB_AVAILABLE = True except ImportError: CFGRIB_AVAILABLE = False # We really only need the API to download the data, make ECMWF API an #...
openradar/PyDDA
pydda/constraints/model_data.py
model_data.py
py
21,863
python
en
code
77
github-code
1
35627807301
# Файл с N последовательностью натуральных чисел, sep = ' '. Последовательность A[i] - 1 = A[i - 1]. Найти нехватающее число # Пример 1 2 3 4 5 7 8 9 -> 6 from pathlib import Path path = Path(r'task1File.txt') with open(path, 'r') as data: string = data.readline() array = list(map(int, string.split())) tmp = -1 fo...
RamkaTheRacist/python-RTR
PY_les5_s/task1.py
task1.py
py
652
python
ru
code
0
github-code
1
3770129321
#! /usr/bin/python # -*- coding : utf-8 -*- import rospy import csv from sensor_msgs.msg import PointCloud2 from sensor_msgs.msg import Image from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import TwistStamped from autoware_msgs.msg import Lane from autoware_msgs.msg import DetectedObjectArray from s...
kuriatsu/other_applications
python/topic_analyze.py
topic_analyze.py
py
9,287
python
en
code
0
github-code
1
70647529633
#!/usr/bin/env python3 import numpy as np from galois_field.core import validator def experiment(fw): primes = [n for n in range(2,100) if validator.is_prime(n)] for p in primes: for i in range (1,p): poly_array = [1] + (p-2)*[0]+[i] poly = np.poly1d(poly_array) is_...
guenterjantzen/workshop-groups
weitere/lookup_irreducible_polys/gen_poly_validator_test.py
gen_poly_validator_test.py
py
1,015
python
en
code
0
github-code
1
35733914527
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='pydrip', version='0.2.0', author="Matthew Clarkson", author_email="mpclarkson@gmail.com", description="A Python 3 client for the Drip API.", long_description=long_description,...
flypaperplanes/pydrip
setup.py
setup.py
py
682
python
en
code
4
github-code
1
20577209057
#!/usr/bin/python import getopt import sys from Life import Game def getInput(filename, steps): if filename == '': print("Please write count of steps\n") steps[0] = int(input()) print("Please write ocean size (hight, witdh)\n") hight, witdh = map(int, input().split()) pri...
qugok/GameOfLife
script.py
script.py
py
1,797
python
en
code
0
github-code
1
16176218244
# coding: utf-8 from rest_framework import serializers from swutils.phone import gen_canonical_phone, CanonicalPhoneGenerationException from sms_devino.client import DevinoException from core import models class Sms(serializers.ModelSerializer): result = serializers.SerializerMethodField() class Meta: ...
telminov/sms-service
core/serializers.py
serializers.py
py
2,693
python
en
code
2
github-code
1
11072263346
# # var1是全局名称 # var1 = 5 # def some_func(): # # var2 = 6 # # var2是局部名称 # def some_inner_func(): # var3 = 7 # # var2是内嵌局部名称 """ 有四种作用域:在局部找不到,便会去局部外的局部找(例如闭包),再找不到就会去全局找,再者去内置中找。 L(Local):最内层,包含局部变量,比如一个函数/方法内部。 E(Enclosing):包含了非局部(non-local)也非全局(non-global)的变量。比如两个嵌套函数,一个函数(或类) A 里面又包含了一个...
suntingting100/python_unittest
随便写写/python3 命名空间作用域.py
python3 命名空间作用域.py
py
2,387
python
zh
code
0
github-code
1
26602884292
''' http://effbot.org/librarybook/binascii.htm http://www.programcreek.com/python/example/1814/binascii.a2b_base64 ''' import binascii text = b'hello, mrs teal' data = binascii.b2a_base64(text) text = binascii.a2b_base64(data) print (text, "<=>", repr(data)) data = binascii.b2a_uu(text) text = binascii.a2b_uu(data) ...
rduvalwa5/Py_Servers
BinaryConversions/src/binascii-example-1.py
binascii-example-1.py
py
827
python
en
code
0
github-code
1
4848628333
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.3 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # + """ This cell sets up the information ...
cvisionai/tator-py
examples/move_to_new_section.py
move_to_new_section.py
py
4,081
python
en
code
4
github-code
1
1440866299
# stdlib imports import sqlite3 import xml.etree.ElementTree as ET import copy from collections import OrderedDict import re import logging # third party imports import numpy as np # local imports TABLES = OrderedDict(( ('station', OrderedDict(( ('id', 'str primary key'), # id is net.sta ...
ynthdhj/shakemap
shakelib/station.py
station.py
py
26,887
python
en
code
1
github-code
1
8698747409
import random import matplotlib.pyplot as plt import numpy as np class Bucket: def __init__(self, start, end, sub_sum=None): self.start = start self.end = end self.sub_sum = sub_sum if sub_sum is None else sub_sum def __repr__(self): return f"({self.start},{self.end})" class...
songks0922/algorithm
python/solutions/dgim.py
dgim.py
py
4,149
python
en
code
0
github-code
1
17959330568
# 16진수를 2진수로 변환하기(convert hexadecimal to binary number) # 16진수가 입력되면 2진수로 변환하여 출력하시오. # 예를 들어, 7AF 를 2진수로 변환하면, 0111 1010 1111이다. # 입력으로 16진수가 입력되고 알파벳은 대문자로 입력된다.(각 자리는 : 0~9, # A~F) (길이는 50,000글자 이내) # 2진수로 변환하여 4자리씩 끊어서 출력한다. 단, 최상위 비트의 불필요한 0도 # 출력한다.( 1 -> 0001) # method 1 s = input() for i in range(len(s)): ...
junes7/python_algorithm
CodeUp/deep_problem/2026.py
2026.py
py
754
python
ko
code
1
github-code
1
33593215042
""" 2005B DVD租赁 考虑如下的在线DVD租赁问题。顾客缴纳一定数量的月费成为会员,订购DVD租赁服务。会员对哪些DVD有兴趣,只要在线提交订单,网站就会通过快递的方式尽可能满足要求。会员提交的订单包括多张DVD,这些DVD是基于其偏爱程度排序的。网站会根据手头现有的DVD数量和会员的订单进行分发。每个会员每个月租赁次数不得超过2次,每次获得3张DVD。请考虑以下问题: 数据中会在测试点中给出。数据包括:网站n种DVD的现有张数和当前需要处理的m位会员的在线订单。 如何对这些DVD进行分配,才能使会员获得最大的满意度。 具体数据大家可以参考2005年全国大学生数学建模竞赛B题。 """ import numpy as np...
MicroPlusone/SDU_mathmodeling_program
山东大学 数学模型 程序汇总/2005年全国大学生数学建模竞赛B题 DVD租赁.py
2005年全国大学生数学建模竞赛B题 DVD租赁.py
py
1,302
python
zh
code
1
github-code
1
16913404673
import tkinter as tk from tkinter import ttk mainWindow = tk.Tk() mainWindow.title("svenmap") mainMenu = tk.Menu(mainWindow) scanMenu = tk.Menu(mainMenu, tearoff=0) scanMenu.add_command(label="Scan", command=None) mainMenu.add_cascade(menu=scanMenu, label="Scan") toolsMenu = tk.Menu(mainMenu, tearoff=0) toolsMenu....
The3Null4Player613310/svenmap
svenmap.py
svenmap.py
py
2,931
python
en
code
0
github-code
1
35133536117
""" randomized hill climbing: estimated average number of evaluations before reaching the global optimum """ import numpy as np import random def find_peak(index, f): peak = False indices_evaluated = [] while not peak: if index == 0: f_right = f[index + 1] if index not in ...
mfleury89/algo-dev
randomized_hill_climb.py
randomized_hill_climb.py
py
2,609
python
en
code
0
github-code
1
20392370999
import time from splinter import Browser from bs4 import BeautifulSoup from selenium import webdriver def init_browser(): # @NOTE: Replace the path with your actual path to the chromedriver executable_path = {"executable_path": r"C:/Users/ddzmi/Desktop/chromedriver.exe"} return Browser("chrome", **executa...
ddzmitry/Tutoring
PythonScraping/scrape_surfing.py
scrape_surfing.py
py
1,566
python
en
code
0
github-code
1
24237381680
import cv2 from matplotlib import pyplot as plt import numpy as np img = cv2.imread('flower.jpg',0) equ = cv2.equalizeHist(img) res = np.hstack((img,equ)) cv2.imshow('histogram img',res) cv2.waitKey(0) cv2.destroyAllWindows() histg = cv2.calcHist([img],[0],None,[250],[0,256]) plt.plot (histg) plt.show()
puja2504/cv-programs
histogram.py
histogram.py
py
317
python
en
code
1
github-code
1
38896014904
import sys f_count = False f_num = False f_sort = False file = None for el in sys.argv: if el == '--num': f_num = True elif el == '--count': f_count = True elif el == '--sort': f_sort = True else: file = el try: with open(file, 'r', encoding='utf-8') as f: ...
Ritips/ThemeWeb
TasksCMD/superCat.py
superCat.py
py
685
python
en
code
0
github-code
1
5053431386
from flask_classful import FlaskView, route from flask import request, jsonify from application.API.utils import AuthorizeRequest, notLoggedIn, b64_to_data from application.API.Factory.BLFactory import BF from application.API.Factory.SchemaFactory import SF class APIPostView(FlaskView): def index(self): re...
theirfanirfi/flask-book-exchange-apis
application/API/APIRoutes/PostView.py
PostView.py
py
5,197
python
en
code
0
github-code
1
4767495324
# coding: utf-8 from fastapi import FastAPI from starlette.middleware.cors import CORSMiddleware from predict import FineTuningNet from pydantic import BaseModel app = FastAPI() # モデルの定義 net = FineTuningNet() app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_met...
May4bwu/perfume-ai
api/main.py
main.py
py
524
python
en
code
0
github-code
1
72401623395
import base64 import io import json import os from os import listdir from os.path import join from time import time import PIL.Image import numpy as np import matplotlib.pyplot as plt import cv2 import src.data.utils.utils as utils import src.data.constants as c ''' There will be folders inside masks_test called 'file...
gummz/cell
src/data/annotate_from_json_old.py
annotate_from_json_old.py
py
3,338
python
en
code
0
github-code
1
21844120874
# -*- coding: utf-8 -*- __author__ = 'Mr.Finger' __date__ = '2017/10/16 14:11' __site__ = '' __software__ = 'PyCharm' __file__ = '3.tensorflow中的Variable.py' import tensorflow as tf state = tf.Variable(0, name='counter') # 在tensorflow中只有定义了他是变量,他才是变量 print(state.name) # counter:0 one = tf.constant(1) new_value = tf....
zhentoufei/TensorflowLearning
莫烦Python的学习/3.tensorflow中的Variable.py
3.tensorflow中的Variable.py
py
629
python
en
code
0
github-code
1
34442426524
import theano import theano.tensor as T import numpy as np from neupy.core.properties import (NumberProperty, ProperFractionProperty, ParameterProperty) from neupy.utils import asfloat, as_tuple from neupy.core.init import Initializer, Constant from .activations import AxesProperty f...
ravisankaradepu/saddle
layers/normalization.py
normalization.py
py
6,242
python
en
code
0
github-code
1
24929505318
def bubblesort(list): intercambio = True while intercambio: intercambio = False for i in range(len(list) - 1): if list[i].tiempo_llegada > list[i+1].tiempo_llegada: list[i], list[i+1] = list[i+1], list[i] intercambio = True return list def fifo(l...
CesarLeiva/Planificacion
fifo.py
fifo.py
py
677
python
es
code
1
github-code
1
41585759269
from typing import Optional, List from .types import LanguageConfig, ModifierType, ResourceStr, PRODUCES_ADD, PRODUCES_MULT, \ UPKEEP_MULT, UPKEEP_ADD, EconomicCategoryKey, COST_MULT, COST_ADD from .utils import Writer, generate_resource_loc def _unpack_resource_id(resource: ResourceStr): return resource if ...
Stellaris-Evolved/stellaris-evolved
tools/uml/modifier.py
modifier.py
py
5,978
python
en
code
6
github-code
1
33372804607
import logging import os from aiogram import Bot, Dispatcher, types from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import State, StatesGroup from aiogram.utils import executor from smartcontract_interaction import * from dot...
dexXxed/student_residence_queue
main.py
main.py
py
4,564
python
uk
code
0
github-code
1
70170767393
import pyttsx3 from datetime import * import speech_recognition as sr import wikipedia import webbrowser import os #Initialization of pyttsx3 module engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voices', voices[0].id) #Creating a function which will speak the giv...
gauravmanocha/Virtual-Assistant
VAssistant.py
VAssistant.py
py
5,775
python
en
code
1
github-code
1
18601164642
import sys import os # Tell syspath where to import modules from other folders in root direcotry sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from env import EnvReader from model.combine import CombineData class Command: """ Command line command execution """ def __init__(self):...
piotrr79/csvApiParser
command.py
command.py
py
1,641
python
en
code
0
github-code
1
38856315888
import sys sys.path.append('../../src/python') from quickSel import * query_dir = '../../test/python/queries/' data_file_name = query_dir + 'gaussian_3d.data' query_file_name = query_dir + 'gaussian_trans.query' # get data def get_data(): data_file = open(data_file_name) data = [] for li...
TsinghuaDatabaseGroup/AI4DBCode
CardinalityEstimationTestbed/Overall/quicksel/test/python/test_time_gaussian_3d.py
test_time_gaussian_3d.py
py
5,494
python
en
code
56
github-code
1
15674132526
# -*- coding: utf-8 -*- # karaoke sampler v.1.0 import sys #reload(sys) #sys.setdefaultencoding('utf-8') #reload(sys) #sys.setdefaultencoding('utf8') import webbrowser from samplerPlayer import samplerPlayer from karaokesampler import karaokesampler from tools.GUIutils import GUIutils import json import cv2 i...
carlitoselmago/karaokeSampler
src/main.py
main.py
py
4,399
python
en
code
0
github-code
1
15690331612
from django.conf.urls import patterns, url from rest_framework import routers import views import api from forms import LoginForm urlpatterns = patterns('', url(r'user/(?P<pk>[\d]+)/?$', views.ListTweetsByUser.as_view(), name='user-tweet-list'), url(r'hashtag/(?P<tag>[-_\w]+)/?$', views.ListTweetsByHashTag.as_v...
lafaiDev/mini-blog
apps/blog/urls.py
urls.py
py
972
python
en
code
0
github-code
1
33649721176
import tweepy from tweepy import OAuthHandler from tweepy import API C_KEY = '' C_SECRET = '' A_TOKEN_KEY = '' A_TOKEN_SECRET = '' auth = tweepy.OAuthHandler(C_KEY, C_SECRET) auth.set_access_token(A_TOKEN_KEY, A_TOKEN_SECRET) api = tweepy.API(auth) keyword = '@delta' keyword2 = 'delta airlines' keyword3 = 'american ...
lauradan/cse482
twitter_collection_rest.py
twitter_collection_rest.py
py
1,422
python
en
code
0
github-code
1
5059645380
from __future__ import annotations from dataclasses import dataclass from itertools import zip_longest from math import floor, sqrt from typing import Any, Literal, Sequence, Tuple from vsexprtools import ExprList, ExprOp, ExprToken, complexpr_available, norm_expr from vsrgtools.util import wmean_matrix from vstools ...
jiaolovekt/HPCENC
deps/vs-plugins/vsmasktools/morpho.py
morpho.py
py
15,970
python
en
code
11
github-code
1
38938274806
from contextlib import suppress from .utils import ( sap_hana, df, ) from .agent_based_api.v1 import ( register, Service, Result, State as state, get_value_store, ) from .agent_based_api.v1.type_defs import ( DiscoveryResult, StringTable, CheckResult, Parameters, ) def pa...
superbjorn09/checkmk
cmk/base/plugins/agent_based/sap_hana_data_volume.py
sap_hana_data_volume.py
py
3,083
python
en
code
null
github-code
1
25503890255
import os import sys from core import path_util from telemetry.core import local_server from telemetry.core import util # This invokes pywebsocket's standalone.py under third_party/pywebsocket class PywebsocketServerBackend(local_server.LocalServerBackend): def __init__(self): super(PywebsocketServerBackend,...
hanpfei/chromium-net
tools/perf/benchmarks/pywebsocket_server.py
pywebsocket_server.py
py
1,095
python
en
code
289
github-code
1
8092625762
import argparse import requests import os import queue import sounddevice as sd import vosk import sys import json from bs4 import BeautifulSoup from query_wikipedia import process_p, process_l import win32com.client import re head = """<?xml version="1.0"?> <speak version="1.0" xml:lang="ru">\n""" tail = "\n</speak...
eabuntov/poiist_lab
lab3.py
lab3.py
py
6,875
python
en
code
0
github-code
1
16805360824
#!/usr/bin/python3 import argparse from os import system from sys import stdout from scapy.all import * from random import randint def get_args(): parser = argparse.ArgumentParser(description='SYN Flood Attack --- Press CTRL+C to stop the attack!') parser.add_argument('--ip', required=True) parser.add_arg...
OceanicSix/Python_program
scapy_code/tcp_attack/syn_flood.py
syn_flood.py
py
1,386
python
en
code
1
github-code
1
32774521611
# We import the libraies from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 import KratosMultiphysics import KratosMultiphysics.MeshingApplication as MeshingApplication import KratosMultiphysics.KratosUnittest as KratosUnittest impor...
asroy/Kratos
applications/MeshingApplication/tests/test_remesh_sphere.py
test_remesh_sphere.py
py
5,103
python
en
code
0
github-code
1
27670978290
#! /usr/bin/env python3 # -*- coding:utf-8 -*- ''' cleans the an crubadan corpus for fijian a bit. all consonant-final words are removed. all words with 'h' are removed. then english words are identified by intersecting list with Celex. hyphens, hashtags, ampersands removed. spaces added. ''' import os,sys, itert...
gouskova/transcribers
fijian/fijian_cleaner.py
fijian_cleaner.py
py
1,649
python
en
code
3
github-code
1
28770160800
from matplotlib import pyplot as plt from GradientByHand import renew_lrbyhand from GradientDescentUpdateModel import renew_gradientdescent from MultiScikit import renew_multivariate def plot(): ypoints = [] for i in range(50): ypoints.append(i) byhandpoints = [] gradient, bias = re...
EFRobins/SurfPrediction
Graphs.py
Graphs.py
py
900
python
en
code
0
github-code
1
14651846444
# Time complexity - O (n) def partition(A,p,r): x = A[r] # last element in our array will be the pivot element i = p - 1 # boundary marker is i, A[:i] <= x and A[i+1:] > x for j in range(p, r): # range has a non inclusive upper bound so we are doing this until the element right before the pivot if ...
DhruvSrikanth/Algorithms
Sorting/partition.py
partition.py
py
703
python
en
code
0
github-code
1
25513805421
from sys import implementation from typing import Optional, Sequence, Tuple, Union import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from monai.networks.blocks import Convolution, UpSample from monai.networks.layers.factories import Conv, Pool from monai.utils import ensure_tuple_r...
KumoLiu/explainablePN
blocks/basic_block.py
basic_block.py
py
13,887
python
en
code
1
github-code
1
25171252929
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/core/actions/#custom-actions/ # This is a simple example for a custom action which utters "Hello World!" from typing import Any, Text, Dict, List,...
KushanChamindu/hcss-rasa-chatBot-Doctor
actions.py
actions.py
py
7,646
python
en
code
1
github-code
1
33383446242
def convert(s: str) -> int: symbols = { "I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000 } value = 0 i = 0 while i < len(s) - 1: current = symbols[s[i]] peek = symbols[s[i + 1]] if peek > current: ...
Zehua-Chen/coding-interview
problems/leetcode-1-100/013-romans-to-int/convert.py
convert.py
py
554
python
en
code
0
github-code
1
24349331321
import api import logbook from webbrowser import open as web_open logbook.RotatingFileHandler('my_search_api', level=logbook.TRACE).push_application() logger = logbook.Logger("Main") def main(): logger.info('Taking user input...') user_input = input('Enter search criteria: ') logger.info(f'Searching for {...
pgmilenkov/100daysofcode-with-python-course
days/43-45-search-api/my_search_api_43/program.py
program.py
py
855
python
en
code
null
github-code
1
70478293475
import resources clYN = input("Hi, let's get you a new RP. You want to create from the command line? (Y/N): ") if clYN == 'Y': print("Great - here we go! Just answer these questions.") clProj = resources.getProjectCL() clProj.writeXLSX() print("That was fun - Bye!") else: print("Sorry, file input ...
darrenrichmond/rp_mgr
create_basic_rp_m.py
create_basic_rp_m.py
py
359
python
en
code
1
github-code
1
1287824220
import random import numpy as np # Adapted from https://github.com/siddharth691/Path-Planning-using-Markov-Decision-Process class GridClass: def __init__(self, maxRow=10, maxCol=10, num_obstacle_pts=20, cor_pr=0.95, wr_pr=0.025, n_actions=4, startRow=2, startCol=2, goalRow=8, goalCol=9, goalRewa...
mishabuch/Assignment-4
grid.py
grid.py
py
8,238
python
en
code
0
github-code
1
6785175471
import MySQLdb import logging from logging import handlers import ogr, osr import sys, os import math from ConfigParser import SafeConfigParser logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') vlbg = (1,) def setupLogging(): ''' set up the Python logging facility ''' #...
JosephSchafer/sbstools
testing/flightstats.py
flightstats.py
py
3,820
python
en
code
0
github-code
1
24485477779
# -*- coding: utf-8 -*- """ Created on Fri Apr 28 11:21:32 2023 @author: rghot """ import streamlit as st from st_aggrid import JsCode, AgGrid, GridOptionsBuilder #https://blog.streamlit.io/building-a-pivottable-report-with-streamlit-and-ag-grid/ from st_aggrid.shared import GridUpdateMode import datetime...
heliostrome/streamlit_app
pages/Add_solar_pumping_system_files/solar_module_files/solar_funcs.py
solar_funcs.py
py
12,154
python
en
code
0
github-code
1
24843804603
"""Helper functions for decoding analysis.""" import warnings warnings.simplefilter(action='ignore', category=FutureWarning) warnings.simplefilter(action='ignore', category=DeprecationWarning) import os from pathlib import Path import numpy as np from scipy import stats from sklearn.pipeline import make_pipeline fro...
Cogitate-consortium/cogitate-msp1
coglib/ieeg/decoding/decoding_helper_functions.py
decoding_helper_functions.py
py
39,193
python
en
code
0
github-code
1
70205762914
''' 부모님을 기다리던 영일이는 검정/흰 색 바둑알을 바둑판에 꽉 채워 깔아 놓고 놀다가... "십(+)자 뒤집기를 해볼까?"하고 생각했다. 십자 뒤집기는 그 위치에 있는 모든 가로줄 돌의 색을 반대(1->0, 0->1)로 바꾼 후, 다시 그 위치에 있는 모든 세로줄 돌의 색을 반대로 바꾸는 것이다. 어떤 위치를 골라 집자 뒤집기를 하면, 그 위치를 제외한 가로줄과 세로줄의 색이 모두 반대로 바뀐다. 바둑판(19 * 19)에 흰 돌(1) 또는 검정 돌(0)이 모두 꽉 채워져 놓여있을 때, n개의 좌표를 입력받아 십(+)자 뒤집기한 결과를 출력하는 프로그램을 ...
hanseul-jeong/Coding_test
CodeUp/[6096] 바둑알 십자 뒤집기.py
[6096] 바둑알 십자 뒤집기.py
py
1,311
python
ko
code
0
github-code
1
22576769447
# 최장 경로 11:03 -> 11:52 힌트봄 def dfs(x): global count global result if visited[x]==False: visited[x]=True count += 1 for i in n_list[x]: dfs(i) result=max(count,result) visited[x] = False count -= 1 T = int(input()) for testCase in range(1,T+1): ...
dydwkd486/coding_test
sweExpertAcademy/python/swExpertAcademy2814.py
swExpertAcademy2814.py
py
678
python
en
code
0
github-code
1
20022974903
#!/usr/bin/env python3 """ session.py ========== Small library for interacting with the sendgrid API """ from .base import BaseMailService import requests import json __version__ = 'v0.0.1' class MailService(BaseMailService): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) ...
alexdro87/sendgrid
sendgrid/syncservice.py
syncservice.py
py
1,451
python
en
code
0
github-code
1
13210571246
from flask import Flask, request import json import mysql.connector from flask_cors import CORS from flask import jsonify import ast app = Flask(__name__) CORS(app) current_user_id = 0 #Set mysql access credentials file = open("/tmp/secrets/credentials", "r") content = file.read() config = ast.literal_eval(content...
EGS-BillsDivider/WebApp
app/backend/src/main.py
main.py
py
2,704
python
en
code
0
github-code
1
41758952234
from django.urls import path from . import views from django.conf.urls import url urlpatterns = [ path('', views.home, name='dict-home'), path('about/', views.about, name='dict-about'), url(r'^$', views.button), url(r'^output', views.output,name="script"), path('about/', views.home), url(r'^tes...
ManolisFrag/django_dictionary
dict/urls.py
urls.py
py
397
python
en
code
0
github-code
1
8218028
from pathlib import Path import shutil the_dir = Path().home() / "repos/pyman" dest_dir = Path().home() / "repos/myst_nb/docs/examples/pyman" notebooks = list(the_dir.glob("**/*txt")) print(notebooks) for a_notebook in notebooks: new_name = dest_dir / a_notebook.name print(new_name) shutil.copy(a_notebook...
eoas-ubc/eoas_tlef
pyman/move_material.py
move_material.py
py
331
python
en
code
3
github-code
1
22687540784
# Coffee maker machine MENU = { "espresso": { "ingredients": { "water": 50, "milk":0, "coffee": 18, }, "cost": 1.5, }, "latte": { "ingredients": { "water": 200, "milk": 150, "coffee": 24, }, ...
dsNikhilds/Python
Day15/Coffee_Maker_Machine.py
Coffee_Maker_Machine.py
py
2,148
python
en
code
0
github-code
1
43788038067
program = ' Cáculo média ' arr = [] soma = 0 state = '' print(f'{program:=^30}') countNotas = int(input('Quantas notas deseja inserir ?\n: ')) for item in range(1, countNotas + 1): nota = float(input(f'{item}º Nota: ')) if nota < 0: print('Erro! Valores negativos não são aceitos ') elif ...
Guribeiro/python
exercicios/ex5.py
ex5.py
py
685
python
pt
code
0
github-code
1
27948174896
from tkinter import * def button_clicked(): print("I got clicked") new_input = input.get() my_label.config(text=new_input) window = Tk() window.title("My first GUI program") # to add title window.minsize(width=500, height=300) # to set size window.config(padx=20, pady=20) # Label my_label = Label(tex...
Fidelis-7/100-days-of-coding-in-python
100-Days/Day_27/main.py
main.py
py
734
python
en
code
2
github-code
1
15703394426
from django.http import JsonResponse from django.shortcuts import render from .forms import MyForm import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from .chat_actions import action_check from .questions_answers import qa_pairs as qa_pairs # De...
ignitedevv/mMoney1
budget/howy_views.py
howy_views.py
py
2,544
python
en
code
0
github-code
1
13379850354
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ### # Name: Amelia Roseto & Gwyneth Casey & Gabriella Nutt # Student ID: 2289652 # Email: roseto@chapman.edu # Course: PHYS220/MATH220/CPSC220 Fall 2018 # Assignment: CW08 ### import numpy as np import pandas as pd import matplotlib as plt def s(t, n, T=2*np.pi): """...
chapman-phys220-2018f/cw08-betterthanfrank
sinesum.py
sinesum.py
py
1,042
python
en
code
0
github-code
1
31754675357
from lib import config from lib import utils CONF = config.get_config().CONF class Mock(object): """ Centralize calls to mock command, setting the arguments common to all of them. """ def __init__(self, config_file, unique_extension): """ Initialize arguments common to all mock ca...
schabrolles/open-power-host-os-build
lib/mock.py
mock.py
py
1,198
python
en
code
0
github-code
1
37237339387
# -*- coding: utf-8 -*- """ Created on Sat Dec 23 09:03:44 2023 @author: Nickolas """ matutino = 'M' vespertino = 'V' noturno = 'N' usuario = input('Digite o seu turno: ') if(usuario==matutino): print('Bom dia') elif(usuario==vespertino): print('Boa tarde') elif(usuario==noturno): print(...
nikolau96/faculdade
LPIII-exPython-lista1/Exercício 10.py
Exercício 10.py
py
369
python
pt
code
0
github-code
1
16852115889
class Settings(): """存储所有的设置类,如飞船的外观、速度等""" def __init__(self): """初始化游戏的设置""" #屏幕的相关设置 self.screen_width=1200 self.screen_height=500 self.bg_color=(230,230,230) #子弹设置,宽3像素,高15个像素,深灰色子弹 self.bullet_speed_factor=1 self.bullet_width=3 self.bu...
SunMig/Aliens
settings.py
settings.py
py
1,442
python
zh
code
1
github-code
1
46350327621
from django.shortcuts import render, HttpResponse, redirect from django.contrib import messages from datetime import datetime from .models import User # Create your views here. def index(request): for object in User.objects.all(): context = { 'id': object.id, 'first_name': object.fi...
RamS2k/Python
Django Apps/main/apps/users/views.py
views.py
py
1,509
python
en
code
0
github-code
1
44771865121
# -*- coding: utf-8 -*- from typing import Tuple import numpy as np import torch def batched_tensor_indexing( t: torch.Tensor, index: Tuple[torch.Tensor] ) -> torch.Tensor: """Index a tensor by matching dimensions from right-to-left instead of left-to-right. This allows for broadcasting of tensor indexi...
TylerSpears/carn-le
pitn/utils/_utils.py
_utils.py
py
1,396
python
en
code
1
github-code
1
21519230741
import pandas as pd import numpy as np import seaborn as sns from sklearn.preprocessing import OneHotEncoder, StandardScaler import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split class ImportData: def __init__(self): unit_2018=pd.read_csv("Datas/2018_DATA_SA_Units.csv") crash_201...
matthew2019369/roadCrashAnalysis
script.py
script.py
py
2,458
python
en
code
0
github-code
1
1145453365
import sys input = sys.stdin.readline N,M,K = map(int,input().split()) edge = [ [] for _ in range(N+1)] rev_edge = [ [] for _ in range(N+1)] inQ_state = [0]*(N+1) build = [0] * (N+1) for _ in range(M): u,v = map(int,input().split()) edge[u].append(v) rev_edge[v].append(u) inQ_state[v] += 1 o...
seoljeongwoo/learn
algorithm/BOJ_14676.py
BOJ_14676.py
py
959
python
en
code
0
github-code
1
36250472449
# 좋은 수열 n = int(input()) result = [] def checkSequence(count): for i in range(1,count // 2 + 1): # 체크해야되는 반복수열 개수 if result[count - 2 * i:count - i] == result[count-i:]: #반복하는지 안하는지 체크 return False return True def backTracking(count): if not checkSequence(count): #좋은 수열인지 체크 re...
Choisiz/coding-test-Team
김수빈/완전탐색 & 백트래킹/좋은수열.py
좋은수열.py
py
744
python
ko
code
0
github-code
1
2399192428
# -*- coding: utf-8 -*- """ Created on Wed Feb 24 14:19:50 2021 抽取感兴趣的领域所在的句子 """ import pandas as pd from pandas import DataFrame import re import os import csv #获得公司列表 def get_compIndex(filepath): compDf_all = pd.read_csv(filepath) companyList = list(set(list(compDf_all['stock_code']))) print("完成get_com...
zhongshsh/SYSU-ForeSee
ForeSee_DataMining/interest_field/get_field_sentence.py
get_field_sentence.py
py
3,748
python
en
code
null
github-code
1
19968338135
import cv2 as cv import numpy as np from shared import imgs sLine = 200 pLine = 200 cannyth = 120 fname = "/Users/kolsha/Pictures/2O_aUamZRZU.jpg" def standard_lines(dst): cdst = cv.cvtColor(dst, cv.COLOR_GRAY2BGR) lines = cv.HoughLines(dst, 1, np.pi / 180, sLine) if lines is not None: for line ...
Kolsha/sai_processing
7task.py
7task.py
py
1,877
python
en
code
0
github-code
1
7612581895
import argparse import numpy as np import motmetrics as mm parser = argparse.ArgumentParser() parser.add_argument('--eval_dir_dpm',type=str, required=True) parser.add_argument('--eval_dir_ssd',type=str, required=True) parser.add_argument('--output_path', type=str, required=True) args = parser.parse_args() ########...
cnmy-ro/Enhanced-DeepSORT
Tools/run_mot16_benchmark.py
run_mot16_benchmark.py
py
4,756
python
en
code
3
github-code
1
70336270754
# coding: utf-8 # Neural Network from __future__ import print_function #========================================== # chap 3.4.1 function, procedure #========================================== # http://playground.tensorflow.org #========================================== # chap 3.4.2 forward-propagatio...
JaneHappy/Code
Google_DL_framework/chap-3-4_NN.py
chap-3-4_NN.py
py
8,283
python
zh
code
0
github-code
1
39585919033
def strings(A, n): if n <= 0: return [''] return [r + c for r in A for c in strings(A, n-1)] def strings_2(A, n): index_of = {x: i for i, x in enumerate(A)} s = [A[0]] * n while True: yield ''.join(s) for i in range(1, n + 1): print ("i: ", i) print (...
peanut-buttermilk/fun-run
python/comb-rec-template.py
comb-rec-template.py
py
1,821
python
en
code
0
github-code
1
3813653520
""" Simple implementation of the CulliganIoT API This is used to provide an interface between Culligan and Ayla. Additional API endpoints are unknown and closed source. Logging in directly to Ayla still works for some endpoints. Others such as /devices.json only seem to work when obtaining the token through Culliga...
rewardone/Culligan
src/culligan/uniapi_culliganiot.py
uniapi_culliganiot.py
py
13,114
python
en
code
3
github-code
1
12715597973
# coding=utf8 from socket import * from time import ctime HOST = '' PORT = 21567 BUFSIZ = 1024 # 1kb ADDR =(HOST, PORT) tcpSerSock = socket(AF_INET, SOCK_STREAM) # udpSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) tcpSerSock.bind(ADDR) tcpSerSock.listen(5) # 传入请求的最大数 while True: print('等待连接...') tcpCliS...
mchjmwjw/FirstRep
demo-practice/socket-server.py
socket-server.py
py
599
python
en
code
0
github-code
1
34370474574
import copy from config_manager import ConfigManager from lib import arrow from master.error.validate_exception import RecipeValidationException from util.gdal_util import MAX_RETRIES_TO_OPEN_FILE from util.time_util import DateTimeUtil, execute_with_retry_on_timeout from util import list_util from master.evaluator.ev...
kalxas/rasdaman
applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
grib_to_coverage_converter.py
py
19,682
python
en
code
4
github-code
1
74703532193
from collections import OrderedDict class Solution: def containsNearbyDuplicate(self, nums: list[int], k: int) -> bool: dic = OrderedDict() first_key = 0 for i in range(len(nums)): if i < k + 1: if nums[i] in dic: return True ...
Carl-Johnsons/Noob
PracticeCoding/LeetCode/#1Easy/Contains_Duplicate_II.py
Contains_Duplicate_II.py
py
686
python
en
code
1
github-code
1
29144885954
import asyncio import datetime from utils import postReminder from dbmongo import db from utils import premeetReminder from utils import postmeetReminder import pytz Task_details = db.connection() async def remainder(Client): try: data = Task_details.discord.find() for eachTask...
Guvi-CodeCamp-SRM/GuviBot
src/remainder/remainder.py
remainder.py
py
1,481
python
en
code
0
github-code
1
5738020347
class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def deepestLeavesSum(self,root: TreeNode) -> int: sums = [] def dfs(node: TreeNode, lvl: int): if lvl == len(sums): su...
EthanCLEMENT/Leetcode
382.py
382.py
py
523
python
en
code
2
github-code
1
12504212316
#this code is developed by Suraj CB #Github Profile URL: https://github.com/SurajCB #This code is contributed to be an Open Source Program import openai openai.api_key = "your api openai api key" messages = [] system_msg = input("What type of chatbot would you like to create?\n") messages.append({"role": "system", "c...
SurajCB/AI-Chat-bot
Chat gpt powered smart ai chat bot.py
Chat gpt powered smart ai chat bot.py
py
737
python
en
code
0
github-code
1
1908192107
import tkinter as tk import tkmacosx as tkmac from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from display_cube import plot_cube import cube_moves as cm import time import copy def virtual_cube(master=None): """ Provides a virtual interface for cube solving...
gaurav-behera/virtual-rubiks-cube
rubiks_cube/virtual_cube.py
virtual_cube.py
py
6,875
python
en
code
0
github-code
1
19455497708
from django.shortcuts import render, redirect from .models import * from django.contrib import messages def index(request): return redirect('/main') def main(request): return render(request, "index.html") def register(request): errors = User.objects.regValidator(request.POST) if errors: for k...
CLMason/travel_buddies
myapp/views.py
views.py
py
3,216
python
en
code
0
github-code
1
69999816675
from datetime import date from fastapi import APIRouter, Depends from fastapi_versioning import version from pydantic import TypeAdapter from app.bookings.dao import BookingDAO from app.bookings.schemas import SBooking from app.exceptions import RoomCannotBeBooked from app.tasks.tasks import send_booking_confirmation...
Sauberr/bookings_project_v1
app/bookings/router.py
router.py
py
1,576
python
en
code
1
github-code
1
38612962346
# https://www.youtube.com/watch?v=g7KoOUu4v7Q - followed along with this video # https://drive.google.com/drive/folders/0BwDJQBs1OukNOEtwNlBxUkVlcFk - images and scripts import sys import random import math import pygame import pygame.gfxdraw from pygame.locals import * pygame.init() CLOCK = pygame.time.Clock() # ...
DLopez6877/pgyame-animation
cat_animation.py
cat_animation.py
py
2,465
python
en
code
0
github-code
1
72797936675
import pickle from typing import List import faiss from langchain.schema import Document from langchain.vectorstores import FAISS from kb_guardian.utils.deployment import get_deployment_embedding def create_FAISS_vectorstore(document_chunks: List[Document]) -> FAISS: """ Create a FAISS vector store from a l...
datarootsio/knowledgebase_guardian
kb_guardian/utils/vectorstore.py
vectorstore.py
py
1,831
python
en
code
4
github-code
1
1027569415
from sklearn.ensemble import RandomForestRegressor from sklearn.datasets import make_regression import numpy as np from RobustRF import * X, y = make_regression(n_features=4, n_informative=2,random_state=0, shuffle=False) regr = RandomForestRegressor(max_depth=2, random_state=0) regr.fit(X, y) RandomForestRegres...
dma092/Forest-type-Regression-with-General-Losses-and-Robust-Forest-an-implementation
base.py
base.py
py
1,105
python
en
code
2
github-code
1
72857354914
from qubit import Qubit, tensordot, Hadamard, Cnot, Measure, Identity, RCnot, randomQubit, PauliX, PauliY, PauliZ, M0, M1 from complex import Complex import numpy as np import math #Inicjalizacja Bramek X = PauliX() Y = PauliY() Z = PauliZ() H = Hadamard() CNOT = Cnot() I = Identity() M0 = M0() M1 = M1() x = Qubit(Co...
jakmac5/algorytmy-kwantowe
superdensecoding.py
superdensecoding.py
py
1,747
python
en
code
0
github-code
1
21735603758
import os import sys import PIL from PIL import Image, ImageStat from restore import restore def main(): # Set default parameters. debug = False directory = os.getcwd() # Parse the command line parameters. for param in sys.argv: Dir = param.find("dir=") if Dir>=0: directory = param[Dir+4:] g...
monkidea/restore
main.py
main.py
py
1,652
python
en
code
0
github-code
1
17847426563
import StringIO from datetime import timedelta from twisted.trial import unittest from twisted.internet import defer, error from twisted.mail import pop3 from twisted.cred import error as ecred from epsilon import structlike, extime from epsilon.test import iosim from axiom import store from xquotient import gra...
rcarmo/divmod.org
Quotient/xquotient/test/test_grabber.py
test_grabber.py
py
12,582
python
en
code
10
github-code
1
72399640994
name = "pyopengl" version = "3.1.0" authors = [ "Mike C. Fletcher" ] description = \ """ Standard OpenGL bindings for Python. """ requires = [ "cmake-3+", "pip-19+", "python-2.7+<3" ] variants = [ ["platform-linux"] ] build_system = "cmake" with scope("config") as config: conf...
OSS-Pipeline/rez-pyopengl
package.py
package.py
py
472
python
en
code
0
github-code
1
71301226594
import re import copy import sq_oper def echo_input_file(path): try: print('\necho of input file:') print('----------------------------------------------------------') with open(path, 'r') as f: while True: line = f.readline() if not line: ...
aoleynichenko/EXP-T
scripts/wick/src/readinp.py
readinp.py
py
4,558
python
en
code
12
github-code
1
132017384
""" Kafka Collector Bot Collects information from the Apache Kafka distributed stream processing system. Args: topic (str): topic to collect information from bootstrap_servers (str): the ‘host[:port]’ string of the Apache Kafka system. Defaults to `localhost:9092` """ from intelmq.lib.bot import CollectorBot...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/certtools@intelmq/intelmq/bots/collectors/kafka/collector.py
collector.py
py
2,178
python
en
code
2
github-code
1
40508376516
import requests from tqdm import tqdm from subprocess import Popen def _download_file(url, destination): r = requests.get(url, stream=True) # Total size in bytes. total_size = int(r.headers.get("content-length", 0)) block_size = 1024 # 1 Kibibyte t = tqdm(total=total_size, unit="iB", unit_scale...
acannistra/landwatch
landwatch/get/util.py
util.py
py
765
python
en
code
6
github-code
1
25269160771
import mysql.connector config = { 'user': 'root', 'password': '12345678', 'host': 'localhost', 'database': 'db_test', 'raise_on_warnings': True } conn = mysql.connector.connect(**config) cursor = conn.cursor() emp_nos = [10001, 10002, 10003] dept_no_start = 1 dept_no_end = 9 for...
JackRipTak/db_lab
lab2_lastquery.py
lab2_lastquery.py
py
1,006
python
en
code
0
github-code
1