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
41277479802
import pandas as pd import plot_likert as plot_likert import numpy as np import matplotlib.pyplot as plt import pylab as p import streamlit as st st.set_option('deprecation.showPyplotGlobalUse', False) st.title('Visualisierung der Seminarevaluation') st.text('Hier kannst du deine Seminarevaluation in Histogrammen anz...
larspelz/semev
webapp.py
webapp.py
py
4,263
python
de
code
0
github-code
1
16988141118
""" class Dog: def __init__(self,name): #allows to instanciate the object self.name = name # Create an attribute of the class Dog wichs is the Name # method is a functions created inside of a Class def bark(self): # print("bark") #d = Dog() # instance of my Class Dog d = Dog("Tim") #...
cartf15/ObjectOrientedProgramming
oop.py
oop.py
py
1,429
python
en
code
0
github-code
1
26218292301
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0019_auto_20150121_1722'), ] operations = [ migrations.AlterField( model_name='contestentry', ...
mikeparisstuff/nostrajamus
api/migrations/0020_auto_20150122_0435.py
0020_auto_20150122_0435.py
py
474
python
en
code
1
github-code
1
12377257670
# -*- coding: utf-8 -*- """ Created on Sun Nov 20 11:25:42 2022 @author: ChrisZeThird """ # import sqlite3 as sql """ Methods """ def create_table(db, list_name, item_name, item_price, item_url): cursor = db.cursor() cursor.execute('INSERT INTO Wishtable VALUES (?,?,?,?)',(list_name, item_name, i...
ChrisZeThird/WishlistApp
SourceCode/DataBase.py
DataBase.py
py
1,285
python
en
code
1
github-code
1
13199434646
from database import get_db import settings def set_air_temperature(airTemperature): db = get_db() db.execute("INSERT INTO airTemperature (value) VALUES (?)", (airTemperature,)) db.commit() return get_air_temperature() def update_temperature_auto(airTemperature): """ -> update temperature of ...
eGirlsAreRuiningMyAC/IoT-AC
SmartAC/environment.py
environment.py
py
1,579
python
en
code
0
github-code
1
28994921145
#!/usr/bin/env python import gtk, gobject class MyWindow(gtk.Window): def __init__(self): gtk.Window.__init__(self) self.connect("destroy", gtk.main_quit) self.box = gtk.VBox() self.add(self.box) self.push_button = gtk.Button(label='push') self.push_button.connec...
xu-pu/ptx-learning-log
python/GUI-bindings/pygtk-01.py
pygtk-01.py
py
1,206
python
en
code
1
github-code
1
36367686593
# -*- coding: utf-8 -*- import numpy as np import os import h5py import logging from data_exchange import DataExchangeFile, DataExchangeEntry class Export(): def __init__(xtomo, data=None, data_white=None, data_dark=None, theta=None, hdf5_file_name=None, data_exchange_type=None,...
decarlof/syncpy
syncpy/dataexchange/xtomo/xtomo_exporter.py
xtomo_exporter.py
py
14,858
python
en
code
0
github-code
1
70205744354
''' 텔레포트 3 시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율 2 초 512 MB 303 122 101 43.348% 문제 수빈이는 크기가 무한대인 격자판 위에 살고 있다. 격자판의 각 점은 두 정수의 쌍 (x, y)로 나타낼 수 있다. 제일 처음에 수빈이의 위치는 (xs, ys)이고, 집이 위치한 (xe, ye)로 이동하려고 한다. 수빈이는 두 가지 방법으로 이동할 수 있다. 첫 번째 방법은 점프를 하는 것이다. 예를 들어 (x, y)에 있는 경우에 (x+1, y), (x-1, y), (x, y+1), (x, y-1)로 이동할 수 있다. 점프는 1초...
hanseul-jeong/Coding_test
Backjoon/단계별로풀어보기/12908.py
12908.py
py
3,661
python
ko
code
0
github-code
1
36374467911
# import os module import os # allow for operating system/file handling functions # import module for csv files import csv # use os.path.join to form a path to the csv file csvFilePath = os.path.join("Resources", "election_data.csv") # use the with open() function to open the csvFilePath into an object with open(c...
tolaye/python-challenge
PyPoll/main.py
main.py
py
4,001
python
en
code
0
github-code
1
21094423421
import random from datetime import datetime import pytest from june import paths from june.activity import activity_hierarchy from june.epidemiology.epidemiology import Epidemiology from june.epidemiology.infection import Immunity, InfectionSelector, InfectionSelectors from june.groups.leisure import leisure from june...
UNGlobalPulse/UNGP-settlement-modelling
test_camps/test_simulator.py
test_simulator.py
py
6,046
python
en
code
6
github-code
1
24000459929
from django import forms from .models import Booking from django.core.exceptions import ValidationError class BookingForm(forms.ModelForm): """Form for the booking model.""" class Meta: model = Booking fields = ( 'first_name', 'last_name', 'phone_number', ...
rocrill/velo_city
bookservice/forms.py
forms.py
py
613
python
en
code
0
github-code
1
18204569793
from requests.exceptions import ReadTimeout from django.http import JsonResponse from ..keycloak_services import check_ldap_connection from ..keycloak_services import check_ldap_authentication from ..keycloak_services import request_access_token def process_request(request, parameter_keys, kc_call): token = req...
os2datascanner/os2datascanner
src/os2datascanner/projects/admin/import_services/views/keycloak_api_views.py
keycloak_api_views.py
py
1,718
python
en
code
8
github-code
1
16671735068
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- # @Time : 2018/7/10 PM4:59 # @Author : L # @Email : L862608263@163.com # @File : google.py # @Software: PyCharm import json import urllib import urllib.request import urllib.parse import re def url_open(url, data=None): request = urllib.request.Request(ur...
SnowStorm-L/WebCrawler
Code/google/google_translate.py
google_translate.py
py
5,312
python
en
code
0
github-code
1
10841797597
import logging from . import BinanceBrokers from .requests import unauthorizrd_request from core.config import ( BINANCE_SPOT_KLINES_URL, BINANCE_UM_KLINES_URL, BINANCE_CM_KLINES_URL, BINANCE_SPOT_MARKET_INFO_URL, BINANCE_UM_MARKET_INFO_URL, BINANCE_CM_MARKET_INFO_URL, ) async def get_kline...
Hudrolax/invest_tools
app/brokers/binance/market_data.py
market_data.py
py
1,915
python
en
code
0
github-code
1
19229736770
import ddt import unittest,requests @ddt.ddt class TestLogin(unittest.TestCase): @ddt.file_data(r'E:\login.yml') @ddt.unpack def test_run(self,**kwargs): method = kwargs.get('method') url = kwargs.get('url') data = kwargs.get('data',{}) header = kwargs.get('header',{}) is_json = kwargs.get('is_json',0) c...
hedyxy/APIauto
cases/TestLogin.py
TestLogin.py
py
683
python
en
code
0
github-code
1
18468768051
import numpy as np import matplotlib.pyplot as plt import sklearn import sklearn.datasets from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation from init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec import numpy as np import matplot...
sum-coderepo/Optimization-Python
NeuralNetwork/Weight_Initialization.py
Weight_Initialization.py
py
14,724
python
en
code
2
github-code
1
73016850594
def check_brackets(s): stack = list() i = 0 unmatched = list() while i < len(s): if s[i] in ['(', '{', '[']: stack.append(s[i]) unmatched.append(i + 1) elif s[i] in [')', '}', ']']: if len(stack) == 0: return i + 1 else: ...
dmitrav/stepik-algorithms
basic_structures/brackets.py
brackets.py
py
848
python
en
code
0
github-code
1
36690171785
from collections import deque import heapq class TreeNode(object): def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution(object): def verticalTraversal(self, root): """ :type root: TreeNode :r...
lingerxu/leetcode-solutions
heapq.py
heapq.py
py
1,648
python
en
code
0
github-code
1
25917719676
import csv import io import json import os.path import pickle from googleapiclient.discovery import build from googleapiclient.errors import HttpError from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request # If modifying these scopes, delete the file token.pickle. SC...
jchorl/auditor-functions
sheets/main.py
main.py
py
3,949
python
en
code
0
github-code
1
31259629280
#!/usr/bin/python3 """Defines an empty class""" BaseGeometry = __import__('7-base_geometry').BaseGeometry class Rectangle(BaseGeometry): """Class that defines a rectangle and inherits from BaseGeometry""" def __init__(self, width, height): """Initializer""" self.integer_validator("width",...
MwangiGregory/alx-higher_level_programming
0x0A-python-inheritance/8-rectangle.py
8-rectangle.py
py
437
python
en
code
0
github-code
1
472732608
''' 136. Single Number Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. ''' #CODE class Solution: def singleNumber(self, nums: List[int]) -> int: unique = 0 for i in range(len(nums)): unique = unique^nums[i] r...
176deepak/DSA-in-Python-LB
Single Number.py
Single Number.py
py
333
python
en
code
0
github-code
1
13799406873
import argparse import trimesh import numpy as np import json from math import * import math import requests import geopandas as gpd from shapely import Polygon #TODO args better ap = argparse.ArgumentParser() ap.add_argument("--method", help="method of gps", type=str) ap.add_argument("--GPSFile", help="GPSFile", type...
Just-Kiel/MeshroomGeoNode
scripts/OSMBuildings.py
OSMBuildings.py
py
4,129
python
en
code
3
github-code
1
8703812591
from __future__ import annotations import re import xml.etree.ElementTree as ET from datetime import datetime from operator import itemgetter from typing import TYPE_CHECKING from urllib.parse import urlparse import ds_caselaw_utils as caselawutils from caselawclient.Client import ( DEFAULT_USER_AGENT, Marklo...
nationalarchives/ds-caselaw-editor-ui
judgments/utils/__init__.py
__init__.py
py
6,412
python
en
code
1
github-code
1
72537368994
from rest_framework import serializers from .models import Departman,Personel from django.utils.timezone import now class DepartmanSerializer(serializers.ModelSerializer): count = serializers.SerializerMethodField() class Meta: model = Departman fields = ( 'id', ...
dedeogluie/Personel_APP
personelApp/serializers.py
serializers.py
py
1,076
python
en
code
1
github-code
1
5973276889
import os import logging import gzip from psycopg2 import sql from django.core.management.base import BaseCommand from django.db import connection from oac_search import models, pubmed logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class Command(BaseCommand): help ...
vpodpecan/pmcutils
oac_search/management/commands/search_export_fulltext.py
search_export_fulltext.py
py
2,276
python
en
code
0
github-code
1
72594416674
import torch import torch.nn as nn class UNet(nn.Module): """ add zero padding """ def __init__(self, num_classes=12): super(UNet, self).__init__() self.enc1_1 = self.CBR2d(in_channels=3, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True) self.enc1_2 = self.CBR2d(in_...
bcaitech1/p3-ims-obd-doggum
sooho_seg/models/UNet.py
UNet.py
py
5,802
python
en
code
3
github-code
1
38219482418
from pynput import keyboard from score_following_game.agents.optimal_agent import OptimalAgent human_action = 1 def on_press(key): global human_action if key == keyboard.Key.left: human_action = 0 if key == keyboard.Key.right: human_action = 2 class HumanAgent(OptimalAgent): def _...
CPJKU/score_following_game
score_following_game/agents/human_agent.py
human_agent.py
py
603
python
en
code
47
github-code
1
5477076800
#!/bin/python #coding=utf-8 ''' 1. 编写程序实现如下功能: reader.py 从argv[1]所指定的文件中读取内容,依次写到管道 /home/linux/myfifo中 writer.py 从管道/home/linux/myfifo中读取内容,写到argv[1]所指定 的文件中并保存 代码中可省略模块引入,/home/linux/myfifo无需创建 ''' import os,sys file_name = sys.argv[1] r = open(file_name,'r') w = open('myfifo','w') while True: buf = r.readl...
jasonfight/backup
HOME/笔记/guohao/1/reader.py
reader.py
py
523
python
zh
code
0
github-code
1
8118820886
# # Initiation à Pygame - Épisode 25 - Changer la vitesse de déplacement # # https://kreatuto.info # import pygame # Couleur du fond de la fenête COULEUR_FOND = (255, 255, 255) # Couleur de la zone de commande COULEUR_FOND_CMD = (211, 211, 211) # GRIS_CLAIR # Couleur d'affichage du texte dans la zone de commande C...
fred-lefevre/pygame
pygame-episode-25/changer-vitesse.py
changer-vitesse.py
py
4,932
python
fr
code
1
github-code
1
42583676722
# Describe a nonrecursive method for finding, by link hopping, the middle node of a doubly linked list with header and trailer sentinels. In the case of an even number of nodes, report the node slightly left of center as the "middle" (Note: This method must only use link hopping; it cannot use a counter.) What is the r...
guoweier/DSAP_exercise
Chapter7/R-7-8.py
R-7-8.py
py
2,698
python
en
code
0
github-code
1
14467406498
import os def register_all(): directory = os.path.dirname(__file__) for root, directories, files in os.walk(directory): # print({"root": root, "directories": directories, "files": files}) for f in [f for f in files if f.endswith('.py')]: file_path = os.path.join(root, f) ...
cslate42/alarm-clock
routes/__init__.py
__init__.py
py
429
python
en
code
0
github-code
1
73572536354
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 16 14:36:38 2021 @author: alef """ import random # cria um arquivo com 25 números randômicos with open('temp2.txt', 'w') as temp: for y in range(5): for x in range(5): # grava a saida do comando no arquivo indicado ...
alef123vinicius/Estudo_python
exemplo_45_with.py
exemplo_45_with.py
py
493
python
en
code
0
github-code
1
8913177888
from django.urls import path from .views import cart_detail,cart_add,cart_remove app_name='shopping' urlpatterns = [ path('<int:cart_id>/',cart_detail,name='cart_detail'), path('add/<int:product_id>/', cart_add, name='cart_add'), path('remove/<int:product_id>/', cart_remove, name='cart_remove'), ]
UhuruV/group2_greenskiosk
greenskiosk/shopping/urls.py
urls.py
py
314
python
en
code
0
github-code
1
42577664395
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 5 17:57 2021 @author: Pedro Vieira @description: Implements the test function for the DFFN network published in https://github.com/weiweisong415/Demo_DFFN_for_TGRS2018 """ import torch import torch.nn as nn from torch.utils.data import DataLoader i...
abandonsea/DFFN
test.py
test.py
py
5,216
python
en
code
6
github-code
1
39497079091
#비용이 k의 배수가 되는 최단 경로를 찾는 문제 import heapq from sys import stdin n,m,k = map(int,stdin.readline().split()) s,t = map(int,stdin.readline().split()) graph = [[] for _ in range(n+1)] for _ in range(m): u,v,w = map(int,stdin.readline().split()) graph[u].append((v,w)) queue = [] INF = 100000000000000000000...
yundaehyuck/Python_Algorithm_Note
theory_source_code/dijkstra/k-multiples_shortest_path.py
k-multiples_shortest_path.py
py
1,128
python
ko
code
0
github-code
1
71734194914
from random import randint def prompt_user(): while True: inp = input("\nWould you like to roll again?: (y for yes or q to quit)\n") if inp.lower() == "q": print("Quitting program...") quit() elif inp.lower() != "y": print("Invalid input ente...
tebohoxthapeli/20-python-projects
10_dice_rolling_simulator.py
10_dice_rolling_simulator.py
py
585
python
en
code
0
github-code
1
32795452501
import random import os def clear(): return os.system('cls') class Game(): NPC_LIST = ["A", "B", "C", "D", "E", "F"] LOCATION_LIST = ["Market", "Office", "Park", "Gym", "Coffee Shop", "Beach"] SUSPECT_COUNT = 4 def __init__(self): self.round = 0 self.traitor = random.choice(self.NP...
asrouji/digital-game-engine-cmsi3751
src/game.py
game.py
py
5,888
python
en
code
0
github-code
1
73910448994
__author__ = 'Victor Olaya' __date__ = 'May 2016' __copyright__ = '(C) 2016, Victor Olaya' # This will get replaced with a git SHA1 when you do a git archive __revision__ = '$Format:%H$' from qgis.PyQt.QtCore import QObject, pyqtSignal class AlgorithmList(QObject): providerAdded = pyqtSignal(str) provider...
nextgis/nextgisqgis
python/plugins/processing/core/alglist.py
alglist.py
py
1,726
python
en
code
27
github-code
1
37277011505
""" """ inputdata = open("input.data").read().splitlines() vent_map_1 = {} vent_map_2 = {} def parse_coord(data: str) -> (int, int): x, y = data.split(",") return (int(x), int(y)) def draw(vent_map: {}, x1, y1, x2, y2, diagonals=False): dir = stigningstall(x1, y1, x2, y2) if not diagonals and 0 not...
ochelset/advent-of-code
2021/Day 5/5.py
5.py
py
1,263
python
en
code
0
github-code
1
32545476270
#!/usr/bin/env python3 import pandas as pd import math import numpy as np from scipy.stats import entropy from tqdm import tqdm from scipy.spatial.distance import euclidean from fastdtw import fastdtw from evaluate import ACTIVITIES import sys import pickle import os def extractFeatures(x_axis, y_axis, z_axis, user)...
kennethtxytqw/Wharf-Experiments
feature_engineer.py
feature_engineer.py
py
5,733
python
en
code
0
github-code
1
29644079936
from django import forms from django.contrib import admin from django.db import models from indexpage.models import Section, SubSection class SectionAdmin(admin.ModelAdmin): formfield_overrides = { models.TextField: {"widget": forms.Textarea(attrs={"class": "ckeditor"})}, } class Media: ...
Ernir/old.ernir.net
indexpage/admin.py
admin.py
py
801
python
en
code
0
github-code
1
14719935805
import numpy as np import matplotlib.pyplot as plt import scipy.signal as sig #Opening file containing experiment data fin = open('/Users/ammaagyei/mu_code/Experiment1.txt') mytxt = fin.read() print(mytxt) #Splitting data on file into acceleration list, angular position list and time list t = [] acc = [] ang = [] i ...
ES2Spring2019-ComputinginEngineering/project-one-t2
ParsingData_Graphing_and_CalcuatingPeriod.py
ParsingData_Graphing_and_CalcuatingPeriod.py
py
1,956
python
en
code
0
github-code
1
32017784263
"""Master Section for the Video Converter controller""" import threading import pexpect from config import CONFIG class VideoConverterBase: """Master Section for the Video Converter controller""" def __init__(self, pool_sema: threading.BoundedSemaphore, db_id: int): self.__thread = threading.Thread...
GaryTheBrown/Tackem
ripper/video_converter/base.py
base.py
py
3,543
python
en
code
0
github-code
1
69850112355
#! /usr/bin/env python3 ######################################################################################## # # Script for generating a vocabulary file (character-based) on the transcriptions found # in one or more shard folders. # # Author(s): Nik Vaessen ##########################################################...
Loes5307/VocalAdversary2022
data_utility-main/data_utility/scripts/generate_character_vocabulary.py
generate_character_vocabulary.py
py
2,331
python
en
code
4
github-code
1
32477809320
class Cat() : species = "russian blue" # class 변수로 선언. 공통적으로 사용되기에 #개별적으로 사용되는 instance변수. 객체에서 사용됨 #각 객체가 개별적으로 가지는 메서드에서 사용되는 키워드 #클래스변수와 선언하는 위치가 다르고 선언 키워드가 달라 def __init__(self, name) : self.name = name # 선언한 Cat객체 사용하기.이렇게 선언하면 Cat객체의 __init__메서드가 자동 생성됨(생성자) cat1...
LEEJUNB/20190716_PyCrawling
test.py
test.py
py
771
python
ko
code
0
github-code
1
5746620273
import cv2 cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_FRAME_WIDTH,640) cap.set(cv2.CAP_PROP_FRAME_HEIGHT,480) cap1 = cv2.VideoCapture(1) cap1.set(cv2.CAP_PROP_FRAME_WIDTH,640) cap1.set(cv2.CAP_PROP_FRAME_HEIGHT,480) while(True): ret,frame = cap.read() ret2,frame2 = cap1.read() if ret2:...
chuchanhee/2022ESWContest_free_1009
Monitoring_robot.py
Monitoring_robot.py
py
581
python
en
code
0
github-code
1
1560988248
#!/usr/bin/env python #coding:utf-8 #@author: rye #@time: 2019/6/16 21:16 class Solution: def jumpFloorII(self, number): # write code here if number == 1: return 1 if number == 2: return 2 dp = [0] * number dp[0] = 1 dp[1] = 2 ...
ryeLearnMore/LeetCode
剑指offer/变态跳台阶.py
变态跳台阶.py
py
901
python
en
code
0
github-code
1
19986667975
import numpy as np import pandas as pd import sqlite3 from FoodTables.FoundationTable import FoundationTable from FoodTables.MarketTable import MarketTable VOLUME_CONVERSIONS_TABLE = "volume_conversions" MASS_CONVERSIONS_TABLE = "mass_conversions" FOOD_TABLE = "food" con = sqlite3.connect("data.sqlite") def reset_...
danzou56/food-data
make_db.py
make_db.py
py
1,128
python
en
code
0
github-code
1
7718670034
import json from sqlnet.lib.dbengine import DBEngine import numpy as np from tqdm import tqdm import re # pattern = re.compile(r'[-一二三四五六七八九十百千万亿年\d]{2,}|\d+') def load_data(sql_paths, table_paths, use_small=False): if not isinstance(sql_paths, list): sql_paths = (sql_paths, ) if not isinstance(table...
HoratioJSY/NL2SQL_CN
sqlnet/utils.py
utils.py
py
14,666
python
en
code
8
github-code
1
30297050435
#!/usr/bin/env python import visvis as vv # Create figure and make it wider than the default fig = vv.figure() fig.position.w = 700 # Create first axes a1 = vv.subplot(121) # Display an image im = vv.imread('astronaut.png') # returns a numpy array texture2d = vv.imshow(im) texture2d.interpolate = True # if False the...
almarklein/visvis
examples/overview.py
overview.py
py
1,552
python
en
code
227
github-code
1
40892075524
# Accessing classes and objects and class attribute/methods in Python from turtle import Turtle, Screen # In-built Python library my_turtle = Turtle() # Creating an object of the class Turtle from package turtle # Classes are named in Pascal case ("JustLikeThis" - every word starts with a capital letter) my_turtle.h...
hornet33/myPythonLearnings
02Intermediate/Day 16/oopConcepts.py
oopConcepts.py
py
598
python
en
code
0
github-code
1
8283102056
import GetOldTweets3 as got import time import datetime def got_func(search_word, search_lang,time_start, time_end): tweetcriteria = got.manager.TweetCriteria().setQuerySearch(search_word).setSince(time_start).setUntil(time_end).setLang(search_lang).setTopTweets(True).setMaxTweets(10) tweet = got.manag...
Swarnalathaa/Twitter
twitter_got.py
twitter_got.py
py
1,883
python
en
code
0
github-code
1
10086144499
import pytest import mongomock import pymongo from dotenv.main import find_dotenv, load_dotenv from todo_app.app import create_app @pytest.fixture def client(): file_path = find_dotenv('.env.test') load_dotenv(file_path, override=True, verbose=True) with mongomock.patch(servers=(('fakemongo.com', 27017),)...
lawli01/DevOps-Course-Starter
tests/integration/test_app.py
test_app.py
py
1,071
python
en
code
0
github-code
1
26780954219
import sys import skimage from skimage import io, filters, feature import numpy as np import math import time DEBUG = False edges = skimage.io.imread(fname="edges.png", as_gray=True) map = np.zeros(shape=(len(edges),len(edges[0]))).astype(int) #Current group ID number segment = 1 #Dictionary fo...
Sgordon4/ImgToTrack
OldInProgress/WorkingTwoPass.py
WorkingTwoPass.py
py
12,420
python
en
code
2
github-code
1
30289814434
import logging from google.cloud import secretmanager from google.cloud import pubsub # format logs formatter = '%(asctime)s - %(levelname)s - %(message)s' logging.basicConfig(format=formatter, level=logging.DEBUG) logging.basicConfig() logger = logging.getLogger(__name__) # get secrets secrets = secretmanager.Secret...
codefordemocracy/data
federal/fec/functions/federal_fec_ingest_queue_import/main.py
main.py
py
1,606
python
en
code
1
github-code
1
8625942380
#!/usr/bin/python3 # -*-coding:utf-8 -*- import psycopg2 from helper import config, utils from psycopg2 import pool from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT """ SQLHandler(데이터베이스 처리) - postgresql 사용 - ThreadedConnectionPool 사용 - 참고 : https://pynative.com/psycopg2-python-postgresql-connect...
volt772/prooya
BE (Python)/database/sql.py
sql.py
py
3,396
python
en
code
0
github-code
1
36634644803
# -*- coding: utf-8 -*- import scrapy from quotetutorial.items import QuoteItem class QuotesSpider(scrapy.Spider): name = "quotes" #指定spider的名称 allowed_domains = ["quotes.toscrape.com"] start_urls = ['http://quotes.toscrape.com/'] def parse(self, response): quotes = response.css('.quote') ...
Sylor-huang/quotetutorial
quotetutorial/spiders/quotes.py
quotes.py
py
1,268
python
zh
code
0
github-code
1
24864353513
import docker import smtplib import os from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from typing import Optional RUNNING = "running" containers = [ os.environ["WEB_MANAGER_CONTAINER_NAME"], os.environ["SALT_API_CONTAINER_NAME"] ] def is_container_running(container_name: ...
saltastroops/health-check
main.py
main.py
py
2,314
python
en
code
0
github-code
1
5928224769
import argparse import glob import logging import os from typing import Dict, Optional import ocpmodels """ This script provides users with an automated way to download, preprocess (where applicable), and organize data to readily be used by the existing config files. """ DOWNLOAD_LINKS_s2ef: Dict[str, Dict[str, str]...
Open-Catalyst-Project/ocp
scripts/download_data.py
download_data.py
py
6,541
python
en
code
518
github-code
1
29883473876
import threading import time from typing import Optional, Any, TypeVar, Callable import wx from morphzero.core.common.matrix_board import MatrixBoardCoordinates from morphzero.core.game import Player, State, Move from morphzero.core.game_service import GameService, GameServiceListener from morphzero.ui.common import ...
morph-dev/self-learning-ai
morphzero/ui/basegamepanel.py
basegamepanel.py
py
5,976
python
en
code
0
github-code
1
22261025139
from django.db import models from django.db.models import Q from users.models import User class Schedule(models.Model): statuses = ( ('pending', 'Pending'), ('occupied', 'Occupied'), ) status = models.CharField( max_length=64, choices=statuses, default='pending' ...
GaneaFunpay/Dentist-booking
dentist_booking/booking/models/schedule.py
schedule.py
py
647
python
en
code
0
github-code
1
29323426460
# Здаание А number = input() mas = list(number) dlina = len(mas) qwerty = 0 a = mas.reverse() #print(a) for i in range(0,dlina): mas[i] = mas[i].replace('a','10',1) mas[i] = mas[i].replace('A','10',1) mas[i] = mas[i].replace('b','11',1) mas[i] = mas[i].replace('B','11',1) mas[i] = mas[i].replace...
TimurGayazov/Python-Projects
other_files/lab2.py
lab2.py
py
1,629
python
en
code
0
github-code
1
32433714928
import sys import torch import torch.nn.functional as F import wandb from tqdm import tqdm from config import ParamConfig from help_funcs_wandb import define_wandb_lr_metrics class Trainer: def __init__(self, device: str, model: torch.nn.Module, config: ParamConfig, train_loader, optimizer, lr_s...
geyao1995/wandb_demo
trainer.py
trainer.py
py
2,248
python
en
code
0
github-code
1
15252805798
#!/usr/bin/env python # -*- coding:utf-8 -*- # author: evan-gyy import pandas as pd import openpyxl from openpyxl.styles import PatternFill, colors, Font import traceback import os import gc class LCStats: def __init__(self): self.file = '' self.find_file('.xlsx', '.') self.map = {} ...
evan-gyy/OrderStats
longchen/lc_stats.py
lc_stats.py
py
4,506
python
en
code
0
github-code
1
30946553807
""" 47. 機能動詞構文のマイニング 動詞のヲ格にサ変接続名詞が入っている場合のみに着目したい.46のプログラムを以下の仕様を満たすように改変せよ. 「サ変接続名詞+を(助詞)」で構成される文節が動詞に係る場合のみを対象とする 述語は「サ変接続名詞+を+動詞の基本形」とし,文節中に複数の動詞があるときは,最左の動詞を用いる 述語に係る助詞(文節)が複数あるときは,すべての助詞をスペース区切りで辞書順に並べる 述語に係る文節が複数ある場合は,すべての項をスペース区切りで並べる(助詞の並び順と揃えよ) 例えば「別段くるにも及ばんさと、主人は手紙に返事をする。」という文から,以下の出力が得られるはずである. このプログラムの出力...
hassyGo/NLP100knock2015
yada/chapter05/chp05_47.py
chp05_47.py
py
2,355
python
ja
code
1
github-code
1
30560767372
from enum import Enum import glm import numpy as np import math from Ray import * class Plane(): def __init__(self,pointOnPlane = glm.vec3(0.0,0.0,0.0),normal = glm.vec3(0.0,-1.0,0.0) ): self.pointOnPlane = pointOnPlane self.normal = normal # testpoint is glm.vec3 def isPointOnPla...
Gaterman007/PythonPyQt
src/Camera.py
Camera.py
py
23,068
python
en
code
0
github-code
1
35733723355
# -*- coding: utf-8 -*- # @Time : 2022/3/12 1:48 # @Author : Zhongyi Hua # @FileName: 220312_2.py # @Usage: # @Note: # @E-mail: njbxhzy@hotmail.com class Solution: def reverseString(self, s: List[str]) -> None: """ Do not return anything, modify s in-place instead. """ cur_l = 0 ...
Hua-CM/LeetCode
Code/220312_2.py
220312_2.py
py
472
python
en
code
0
github-code
1
37554850767
import sys, pickle from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import * from PySide2.QtGui import * from PySide2.QtWidgets import * from ui_splash_screen import Ui_Splash_Screen from ui_login import Ui_Login from ui_test_screen import Ui_MainWindow from main import Main from user import User splas...
hirokiyaginuma/scriptspinner-software
ScriptSpinner.py
ScriptSpinner.py
py
2,369
python
en
code
0
github-code
1
26074180933
#%% # 1 import pandas as pd import numpy as np import matplotlib.pyplot as plt import xgboost as xgb from sklearn import linear_model from sklearn.model_selection import ShuffleSplit, cross_val_score from sklearn.cluster import MiniBatchKMeans from sklearn.decomposition import PCA from sklearn.model_selection import tr...
Sivaram46/NYC-taxi-trip-duration-prediction
taxi_trip_duration.py
taxi_trip_duration.py
py
11,553
python
en
code
1
github-code
1
373923622
from typing import Any, List import vyper.utils as util from vyper.ast.signatures.function_signature import FunctionSignature, VariableRecord from vyper.exceptions import CompilerPanic from vyper.old_codegen.context import Context from vyper.old_codegen.expr import Expr from vyper.old_codegen.function_definitions.util...
webanck/GigaVoxels
lib/python3.8/site-packages/vyper/old_codegen/function_definitions/external_function.py
external_function.py
py
7,824
python
en
code
23
github-code
1
74738892194
from math import sin, cos, radians lines = [(line[0], int(line[1:])) for line in open("day12-input").read().splitlines()] DIRS = ["N", "E", "S", "W"] class State: def __init__(self, data): self.data = data self.dir = 1 self.pos = (0, 0) def run(self): for item in self.data:...
belak/adventofcode
2020/day12.py
day12.py
py
3,090
python
en
code
0
github-code
1
38833867659
class Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: ans = [] if len(matrix) == 0: return ans rowBegin = 0 rowEnd = len(matrix) - 1 colBegin = 0 colEnd = len(matrix[0]) - 1 while rowBegin <= rowEnd and colBegin <= colE...
VJ-P/Daily-Leetcode
December-2020/spiralOrder.py
spiralOrder.py
py
984
python
en
code
0
github-code
1
20897550219
# -*- coding: utf-8 -*- """Storj GUI metadata module.""" __author__ = ', '.join([ 'Marco Rosa', 'Mike Bailey', 'Wiktor Jezioro' ]) __author_email__ = ';'.join([ 'marcor165@hotmail.it', 'mibgranny@aol.com', 'lakewik@lakewik.pl' ]) # major version number should match the storj client major versio...
lakewik/EasyStorj
UI/metadata.py
metadata.py
py
344
python
en
code
74
github-code
1
17555507671
'''General utility functions Author: guangzhi XU (xugzhi1987@gmail.com) Update time: 2021-04-17 08:36:48. ''' from __future__ import print_function import os import re def isListTuple(x): """Check an input is a list or tuple or range Args: x (unknow type): input Returns: True if <x> is l...
Xunius/era5-dl
era5dl/util_general.py
util_general.py
py
3,887
python
en
code
2
github-code
1
41407124442
# 34. Find First and Last Position of Element in Sorted Array # https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ import math class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: left, right = 0, len(nums) - 1 while left <= right...
aszx4510/LeetCode
python/0034-find_first_and_last_position_of_element_in_sorted_array.py
0034-find_first_and_last_position_of_element_in_sorted_array.py
py
1,330
python
en
code
0
github-code
1
25463876505
import unittest import gflags as flags import unittest as googletest from closure_linter import errors from closure_linter import runner from closure_linter.common import erroraccumulator flags.FLAGS.strict = True class StrictTest(unittest.TestCase): """Tests scenarios where strict generates warnings.""" def ...
hanpfei/chromium-net
third_party/catapult/third_party/closure_linter/closure_linter/strict_test.py
strict_test.py
py
1,225
python
en
code
289
github-code
1
15302121570
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reorderList(self, head: Optional[ListNode]) -> None: """ Do not return anything, modify head in-place instead. """ ...
samixtures/Leetcode
reorderList.py
reorderList.py
py
1,206
python
en
code
0
github-code
1
41210256794
import re import unicodedata from nonebot.adapters.onebot.v11 import MessageEvent, Message def get_message_at(message:Message) -> list: ''' 获取at列表 ''' qq_list = [] for msg in message: if msg.type == "at": qq_list.append(msg.data["qq"]) return qq_list def image_url(event:Me...
KarisAya/nonebot_plugin_game_collection
utils/utils.py
utils.py
py
1,091
python
en
code
48
github-code
1
33056909838
''' Merge Sort: Shortcomings Merging A and B creates a new array C No efficient way to manage merge in place Extra storage can be costly Inherently recursive Recursive call and return are expensive Alternative approach Extra space is required to merge Merging happens because elements in left half must move right an...
avin82/Programming_Data_Structures_and_Algorithms_using_Python
quick_sort.py
quick_sort.py
py
1,596
python
en
code
0
github-code
1
27722483809
from fonduer.utils.data_model_utils import ( get_col_ngrams, get_horz_ngrams, get_page, get_row_ngrams, get_vert_ngrams, overlap, ) ABSTAIN = 0 TRUE = 1 FALSE = 2 def neg_low_page_num(c): if get_page(c[0]) > 8: return FALSE return ABSTAIN def pos_gain(c): row_ngrams = s...
lukehsiao/lctes-p27
hack/opamps/opamp_lfs.py
opamp_lfs.py
py
2,690
python
en
code
1
github-code
1
20453740741
import re import sqlite3 import mysql.connector from openpyxl import load_workbook def analytics(sheet_path_FINAL, code): try: row_number, retrieved_acc, video_links, video_likes, retrieved_views, video_names = [], [], [], [], [], [] connection = mysql.connector.connect(host='localhost...
quetzelcoatl/Instagram
analytics.py
analytics.py
py
7,375
python
en
code
0
github-code
1
42468668289
import cv2 import numpy as np from matplotlib import pyplot as plt def Thresholding(): img = cv2.imread('/home/mark/Desktop/gradient.png',0) ret, thresh1 = cv2.threshold(img,127,255,cv2.THRESH_BINARY) ret,thresh2 = cv2.threshold(img,127,255,cv2.THRESH_BINARY_INV) ret,thresh3 = cv2.threshold(img,127,255...
olinrobotics/irl
irl_archive/Fall_2017/button_game/Practice/Image_Processing.py
Image_Processing.py
py
3,235
python
en
code
7
github-code
1
6742353274
import math import pylab import itertools import random import random as rand import numpy as np import networkx as nx from networkx.utils import powerlaw_sequence import scipy.stats as stats def buildConfigModelNetwork(degreeSequence): MG = nx.MultiGraph() iter = (sum(degreeSequence)/2) print("Degre...
Dosclic98/Esame_Network_Science
configurationModel.py
configurationModel.py
py
2,310
python
en
code
0
github-code
1
73858346595
import sys # import for command-line parameters import pandas as pd # csv file reading # handle command line parameters raw_data = sys.argv[1] # one year daily observation file locations = sys.argv[3] # mapping from location ID to state/county FIPS code spatial = sys.argv[4] # spatial resolution of output data: s...
zacherymorris2021/BII-NSSAC-Internship
climate-variable-data-analysis/read-in-csv-v1.py
read-in-csv-v1.py
py
1,055
python
en
code
0
github-code
1
21534189825
import pygame pygame.init() import random as rand #screen screen = pygame.display.set_mode((800,800)) pygame.display.set_caption("quiozz") doExit = False #outer oX = 399 oY = 399 oR = 255 oG = 120 oB = 0 oRadius = 100 oThicc = 20 #inner iX = 399 iY = 399 iR = 0 iG = 120 iB = 255 iRadius = 60 iThicc = 20 #middle mX = 3...
SebastianStucklen/quizzzz2172023
quizzzz2172023/quizzzz2172023.py
quizzzz2172023.py
py
1,396
python
en
code
1
github-code
1
42972785052
from tkinter import Canvas class Illustrator: def __init__(self, parent, canvas_object): self.parent = parent self.canvas = canvas_object self.c = 10 # Parametrize the width and height of the canvas self.parent.update_idletasks() self.width = self.canvas.winfo_widt...
GabrielEdefors/Crossection
draw_beam.py
draw_beam.py
py
3,108
python
en
code
0
github-code
1
7981324402
import time import sys import os # force MAVLink 2.0 os.environ["MAVLINK20"] = "1" # doc: https://mavlink.io/en/mavgen_python/ from pymavlink import mavutil # Create a function to send RC values # More information about Joystick channels # here: https://www.ardusub.com/operators-manual/rc-input-and-outpu...
sslab-gatech/RoboFuzz
src/ros_to_mav.py
ros_to_mav.py
py
5,941
python
en
code
13
github-code
1
6608870263
#coding:utf-8 ''' Created on 2013-5-24 @author: shuangluo ''' import json from django.http import HttpResponse from ldap.models import Module, BizGroup, BizSet, Machine from ldap.utils import modules_for_user def top_group(request): tgSelect = [] tg = BizSet.objects.all() for item in tg: tgSelect...
no2key/ldap_management
ldap/ajax.py
ajax.py
py
1,492
python
en
code
0
github-code
1
40894326962
# -*- coding: utf-8 -*- '''--------------------------------------------------------------------------------------------------------------------------------------- version date author memo ----------------------------------------------------------------------------------------------------------------------------...
Why-Not-Sky/hunting
webTableCrawler/stockCrawler.py
stockCrawler.py
py
4,823
python
en
code
0
github-code
1
2789078157
# -*- coding: utf-8 -*- #定义质数的函数 #计算从0开始第1000个质数 def getprim(n): p = 3 x = 0 while(x<n): result = True for i in range(2,p-1): if(p%i==0): result = False if result==True: x=x+1 rst=p p+=2 print(rst) getprim(1000)
Lyueyeu/PyCharm_Files
GetPrim.py
GetPrim.py
py
343
python
ja
code
0
github-code
1
72349033954
class Solution: def threeSumClosest(self, nums: List[int], target: int) -> int: nums.sort() n = len(nums) closestSum = float('inf') for i in range(n - 2): left = i + 1 right = n - 1 while left < right: total = nums[i] + nums[left]...
juny-park-95/leet_code_answers
0016-3sum-closest/0016-3sum-closest.py
0016-3sum-closest.py
py
657
python
en
code
0
github-code
1
27052130514
import mock from dtat.models.player import Player data1 = { "status": "ok", "result": [ { "guild_id": "1", "guild_name": "Testtttttt", "level": 10 }, { "guild_id": "2", "guild_name": "testytesty", "l...
deeptownadmintools/main-server
tests/00_integration/test_data_update_id.py
test_data_update_id.py
py
3,152
python
en
code
3
github-code
1
4926506431
#1 from openvino.inference_engine import IENetwork, IECore, IEPlugin from time import time import logging as log class face_detection: ''' Class for the Face Detection Model. ''' def __init__(self, model_name, device='CPU', extensions=None): self.model_name = model_name model_weights = ...
pra-dan/Intel-EdgeAI-Nanodegree
starter/src/face_detection.py
face_detection.py
py
1,940
python
en
code
1
github-code
1
36105484053
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Define utility functions and classes for ccdproc """ __all__ = ["slice_from_string"] def slice_from_string(string, fits_convention=False): """ Convert a string to a tuple of slices. Parameters ---------- string : str A...
astropy/ccdproc
ccdproc/utils/slices.py
slices.py
py
4,170
python
en
code
86
github-code
1
29229830776
from github import Github import time import schedule import requests import json import logging import os logging.basicConfig(filename='debug.log', format='%(asctime)s %(levelname)-8s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S') """ GITHUB CREDENTIALS """ GITHUB_TOKEN = os.envir...
mukeshtiwari1987/ghub_watcher
gtoz.py
gtoz.py
py
3,062
python
en
code
0
github-code
1
3978585491
from google.appengine.dist import use_library use_library('django', '1.1') from google.appengine.ext import webapp from google.appengine.ext.webapp import util import helpers import models import settings import appengine_utilities.sessions import oauth import logging class MainHandler(webapp.RequestHandler): d...
bruntonspall/sessionpicker
main.py
main.py
py
3,721
python
en
code
5
github-code
1
73403156193
import webapp2 from twython import * import json TWITTER_APP_KEY = '' #supply the appropriate value TWITTER_APP_KEY_SECRET = '' TWITTER_ACCESS_TOKEN = '' TWITTER_ACCESS_TOKEN_SECRET = '' class MainHandler(webapp2.RequestHandler): def get(self): self.response.write('Hello world!') class GetTweets(webapp2....
aneesh-neelam/TwitterSearch-GAE
main.py
main.py
py
943
python
en
code
0
github-code
1
34000015765
from collections import deque import sys sys.setrecursionlimit(10**8) N, X, Y = map(int, input().split()) OXY = [list(map(int, input().split())) for _ in range(N)] D_POS = [(1, 1), (0, 1), (-1, 1), (1, 0), (-1, 0), (0, -1)] grid = [["." for _ in range(410)] for _ in range(410)] grid[205+Y][205+X] = "G" for ox, oy in...
yojiyama7/python_competitive_programming
atcoder/_old/past_3/g_.py
g_.py
py
1,061
python
en
code
0
github-code
1
16217047055
import pandas as pd orders = pd.read_csv('orders.csv', index_col='id') customers = pd.read_csv('customers.csv', index_col='id') pd.options.display.float_format = '{:,.1f}'.format cust_filter = 'CG-12520' ser = orders.query('customer_id == @cust_filter') new_df = pd.merge(orders, customers, how='inner', left_on='custom...
paseidon72/pythonProjectnewspes
new_project/tablexcel/sravnit.py
sravnit.py
py
890
python
en
code
0
github-code
1
42488837913
from spylls.hunspell import Dictionary import pandas as pd import unidecode if __name__ == '__main__': target_length = 5 list_of_words = [] dictionary = Dictionary.from_files('/Users/aitoriraolagalarza/Desktop/pycharm_projects/wordle_dictionary_builder/data/hunspell-cat/catalan') for word in dictiona...
aitirga/wordle_dictionary_builder
tasks/generate_catalan_dictionary/generate_catalan_dictionary.py
generate_catalan_dictionary.py
py
713
python
en
code
0
github-code
1