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
17514167841
from datetime import datetime import pytz as pytz import boto3 boto3.setup_default_session(profile_name='s3-viewer') s3 = boto3.client('s3') response = s3.list_buckets() bucket_names = [bucket['Name'] for bucket in response['Buckets']] print('Select the bucket:') for name in bucket_names: print(name) selected_buc...
Aleh-Zamzhytski/cloudx
get_object_by_date.py
get_object_by_date.py
py
1,407
python
en
code
0
github-code
1
24246196895
# # matplot graph class definition # # backend independent implementation # # Kazutomo Yoshii <ky@anl.gov> # import os, sys import matplotlib.pyplot as plt import matplotlib.animation as manimation #import matplotlib.collections as collections import matplotlib.cm as cm from matplotlib.offsetbox import OffsetImage, A...
UO-OACISS/tau2
tools/src/pycoolr/src/pycoolrgui/pycoolr-plot/clr_matplot_graphs.py
clr_matplot_graphs.py
py
11,842
python
en
code
34
github-code
1
35466272972
"""Models and all supporting code""" import cv2 import numpy as np import utils class OtsuThresholding(object): """Represents model for predicting i-contours given images and o-countours using Otsu's method""" def __init__(self, kernel_size=None): """Configures loader :param kernel_size: si...
vshmyhlo/dicom-data-loader
models.py
models.py
py
2,051
python
en
code
0
github-code
1
30724803476
import pygame from player import Player class GameScreen(object): def __init__(self, w, h, tilesize): pygame.init() #initialize all screen variables self.width = w self.height = h self.scene = pygame.display.set_mode( (w,h) ) self.caption = pygam...
LSCCyberHawks/GenCyber2023
Python/gamescreen.py
gamescreen.py
py
5,715
python
en
code
1
github-code
1
6123825523
from PIL import Image import numpy as np import matplotlib.cm as cm import math ASPECT_RATIO = 1.0 / 1.0 FRAME_HEIGHT = 8.0 FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO XRES = 1000 YRES = 1000 x_min = -FRAME_WIDTH/2 x_max = FRAME_WIDTH/2 y_min = -FRAME_HEIGHT/2 y_max = FRAME_HEIGHT/2 x_values = np.linspace(x_min, x_ma...
vivek3141/videos
create_img.py
create_img.py
py
1,195
python
en
code
132
github-code
1
15103892958
import imp from django.shortcuts import render from mywatchlist.models import Watchlist from django.http import HttpResponse from django.core import serializers # Create your views here. def show_watchlist(request): data_watchlist = Watchlist.objects.all() counter_watched = 0 for show in data_watchlist : ...
eruzetaien/PBPtugas2
mywatchlist/views.py
views.py
py
1,071
python
en
code
0
github-code
1
37913037798
import smilPython as sp import time thresh = 1000 im = sp.Image("https://smil.cmm.minesparis.psl.eu/images/balls.png") iml = sp.Image(im) img = sp.Image(im) ims = sp.Image(im) sp.label(im, iml) im.show("balls.png") iml.showLabel("iml") sp.areaThreshold(iml, thresh, True, img) img.showLabel("img") sp.areaThreshold(...
MinesParis-MorphoMath/smil
doc/demos/python/example-areathreshold.py
example-areathreshold.py
py
671
python
en
code
24
github-code
1
43495804534
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 12 01:26:44 2023 @author: mingjunsun """ import pandas as pd import numpy as np import os import torch import torch.nn as nn import torch.nn.functional as F import random import matplotlib.pyplot as plt #from livelossplot import PlotLosses from skl...
Sho-Shoo/36490-F23-Group1
example_code/random_forest.py
random_forest.py
py
4,038
python
en
code
0
github-code
1
24929462276
# Write a function to find the longest common prefix string amongst an array of strings. # If there is no common prefix, return an empty string "". # Example 1: # # Input: strs = ["flower","flow","flight"] # Output: "fl" def longestCommonPrefix(strs): if not strs: return "" shortest = min(strs, key=le...
cha1690/Data-Structures-and-Algoritms
string/longestCommonPrefix.py
longestCommonPrefix.py
py
480
python
en
code
2
github-code
1
9202673176
import numpy as np def Daylight(latitude,day): P = np.arcsin(0.39795 * np.cos(0.2163108 + 2 * np.arctan(0.9671396 * np.tan(.00860 * (day - 186))))) pi = np.pi hm = (np.sin((0.8333 * pi / 180) + np.sin(latitude * pi / 180) * np.sin(P)) / (np.cos(latitude * pi / 180) * np.cos(P))) daylightamount = 24 - (...
bawaji94/VisualizeDaylightHours
utils.py
utils.py
py
927
python
en
code
0
github-code
1
5927958459
import logging import math from typing import List, Optional import torch import torch.nn as nn from ocpmodels.common.registry import registry from ocpmodels.common.utils import conditional_grad from ocpmodels.models.base import BaseModel from ocpmodels.models.scn.smearing import GaussianSmearing try: pass excep...
Open-Catalyst-Project/ocp
ocpmodels/models/equiformer_v2/equiformer_v2_oc20.py
equiformer_v2_oc20.py
py
25,033
python
en
code
518
github-code
1
70137643235
print("Pancake's linear equation Solver.") # input equation ec = False while not ec: e = input("Enter Equation. (variable must be 'x') ") if not "=" in e: print("Wrong equation. (MUST INCLUDE '=')") else: ec = 1 # making parts before parsing eq = {} e = e.split("=") eq['left'] = {'exp':e[...
ZustFancake/Portfolio
일차방정식계산기.py
일차방정식계산기.py
py
2,433
python
en
code
0
github-code
1
7311764497
""" agent for training and using neural network """ import os import numpy as np import tensorflow as tf wikipedia = [ "-xxo", "-x-xo", "-oox", "-o-ox", "-x-x-", "-xx-", "-o-o-", "-oo-", "-x-xxo", "-xxxo", "-o-oox", "-ooox", "-x-xx-", "-xxx-", "-o-oo-", "-ooo-", "-xxxx-", "-xxxxo", "-oooo-", "-o...
TakLee96/alpha_gomoku
python/dual_fail/value_agent.py
value_agent.py
py
2,951
python
en
code
4
github-code
1
16058498554
from selenium.webdriver.chrome.service import Service """ @package base WebDriver Factory class implementation It creates a webdriver instance based on browser configurations """ from selenium import webdriver class WebDriverFactory(): def __init__(self, browser): """ Inits WebDriverFactory cla...
ManuBoca92/hudl-tech-test
base/WebDriverFactory.py
WebDriverFactory.py
py
1,156
python
en
code
0
github-code
1
73111744675
# -*- coding: utf-8 -*- # __author__ = 'XingHuan' # 6/30/2018 from sins.module.sqt import * from sins.utils.color import int10_to_rgb from sins.ui.widgets.colorwheel import ColorWheelWindow from sins.ui.utils.screen import get_screen_size from .basic import CellWidget # color class CellColorEdit(CellWidget): def...
ZackBinHill/Sins
sins/ui/widgets/data_view/cell_edit/color_edit.py
color_edit.py
py
2,322
python
en
code
0
github-code
1
30980103485
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^scrape_movies/$', views.scrape_movies, name='scrape_movies'), url(r'^view_movies/$', views.view_movies, name='view_movies'), url(r'^filter_movies/$', views.filter_movies, name='filter_movi...
manujosephv/MovieScraper
movielistview/urls.py
urls.py
py
1,055
python
en
code
0
github-code
1
9058903259
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # load all files inside folder src/tko # and merge them into one file import os import shutil # get all files inside folder src/tko files = [ "settings", "runner", "format", "basic", "diff", "down", "solver", "pattern", "loader", "writer", "wdir", "actions", "guide",...
senapk/tko
replit/merge.py
merge.py
py
1,102
python
en
code
2
github-code
1
28775868892
from typing import Optional from pydantic import Field, HttpUrl, validator from app.model.response import Success from app.model.base import DataModel, InCreateModel, InUpdateModel from app.database.table.location_cabinet import CabinetStatus from app.util.type.guid import GUID from app.util.regex_pattern imp...
batu1579/instrument-management-service
app/model/location_cabinet.py
location_cabinet.py
py
6,629
python
zh
code
0
github-code
1
13763393150
# [백준]2979번-구현-(트럭 주차)-B2-(1-내풀이-성공).py # https://github.com/irishNoah/Algorithm-Study # https://www.acmicpc.net/problem/2979 ''' # 문제 풀이 1. 각 차의 도착시간, 떠난 시간 입력 받는다. 2. 각 차에 대해 컴프리헨션을 활용하여 리스트 생성 후, 이를 set()로 타입을 변환한다. 3. 집합자료형을 활용해 교집합, 합집합, 차집합 등을 차례대로 구한다. 4. 구한 집합을 토대로 값을 구한다. ''' import sys a, b, c = map(int, ...
irishNoah/Algorithm-Study
알고리즘/파이썬(Python)/004-구현/011-[백준]2979번-구현-(트럭 주차)-B2-(1-내풀이-성공).py
011-[백준]2979번-구현-(트럭 주차)-B2-(1-내풀이-성공).py
py
1,492
python
ko
code
4
github-code
1
35075300303
from aiogram import Bot, Dispatcher, executor, types bot = Bot('') dp = Dispatcher(bot) @dp.message_handler(commands=['start']) async def start(message: types.Message): # await bot.send_message(message.chat.id, 'Hello') await message.answer('Hello, how are you?') @dp.message_handler(content_types=['photo'...
AntoshkaNaumov/bot_project
aiogram_bot.py
aiogram_bot.py
py
1,631
python
en
code
0
github-code
1
1703757308
import sys sys.setrecursionlimit(100000) input = sys.stdin.readline T = int(input()) dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] def dfs(i, j): graph[i][j] = 0 for k in range(4): nx = i + dx[k] ny = j + dy[k] if 0 <= nx < N and 0 <= ny < M: if graph[nx][ny] == 1: ...
SunghunKim98/Algorithm_Study
sprint01/KDH/01/BOJ_1012.py
BOJ_1012.py
py
735
python
en
code
0
github-code
1
11861469094
# import the necessary packages from Stitcher import Stitcher from MotionDetector import MotionDetector from imutils.video import VideoStream from datetime import datetime import numpy as np import imutils import time import cv2 # initialize the video streams and allow them to warmup print("[INFO] starting cameras......
sohamroy19/TryangleCam
Python/TryangleCam.py
TryangleCam.py
py
4,030
python
en
code
2
github-code
1
74540231072
import os import glob import re import shutil import sqlalchemy import traceback import importlib from rapidfuzz import fuzz from traitlets.config import LoggingConfigurable, Config from traitlets import Bool, List, Dict, Integer, Instance, Type, Any from traitlets import default, validate from textwrap import dedent ...
jupyter/nbgrader
nbgrader/converters/base.py
base.py
py
20,870
python
en
code
1,232
github-code
1
7359259043
def print_two_d(arr): for row in arr: print(' '.join(map(str, row))) N = int(input()) target = int(input()) dr = [[-1]*N for i in range(N)] middle = N//2 col, row = (middle, middle) up, right, bottom, left = (-1, 1, 2, -2) num = 1 flag = N*N dr[middle][middle] = num dr[0][0] = flag while num < flag: #...
parkdoyeon/Study
Algorithms/baekjoon/snail-1913.py
snail-1913.py
py
1,325
python
en
code
0
github-code
1
36926953733
# coding: utf-8 import json import re def sort_dict(dict): sort_dict = [] #print(len(dict)) all_vote=0 for i in range(len(dict)): flag=0 max=0 for key,value in dict.items() : if flag == 0: max=int(value) temp=...
herolf/Crawler_herolf
voters_read_sort_611.py
voters_read_sort_611.py
py
1,666
python
en
code
0
github-code
1
33951359126
import tkinter as tk from tkinter import ttk from PIL import ImageTk, Image from tkinter import messagebox from datetime import datetime import csv from pizza import * from sauce import * italian_pizza = {"Pizza Napoletana": PizzaNapoletana, "Pizza Capricciosa": PizzaCapricciosa, "Pizza Qu...
MelihGulum/Tkinter-Projects
Pizza Order System/main.py
main.py
py
18,745
python
en
code
2
github-code
1
13734241619
import re from django import forms from django.conf import settings from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from base.models import Lexicon, EXCLUDED_LEXICA class ProfileEditForm(forms.Form): lexiconChoices = Lexicon.objects.exclude(lexiconName__in=EXCLUDED...
domino14/Webolith
djAerolith/accounts/forms.py
forms.py
py
1,589
python
en
code
32
github-code
1
41766349642
from py2neo import Graph, Node, Relationship from flask import jsonify import json import re import chardet from demjson import decode import numpy as np from neo4j import GraphDatabase, basic_auth, kerberos_auth, custom_auth, TRUST_ALL_CERTIFICATES def build_nodes(node_record): data = {'id': str(node_record['id(...
ownia/KGRM
kg_web/test.py
test.py
py
5,914
python
en
code
0
github-code
1
21678788184
# https://leetcode.com/problems/merge-two-sorted-lists/ # Definition for singly-linked list. from typing import Optional class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[Li...
webdastur/ProgrammingProblems
LeetCode/merge_two_sorted_lists.py
merge_two_sorted_lists.py
py
946
python
en
code
0
github-code
1
19936644653
from functools import wraps from flask import Flask, request, jsonify, url_for, redirect from wallet import Wallet from error import Error from jose import jwt from urllib.request import urlopen import sys import os import json app = Flask(__name__) env = os.environ app.debug = env.get('ENVIRONMENT', 'development')...
SumanaMalkapuram/auth0
api/server.py
server.py
py
5,856
python
en
code
0
github-code
1
3651344308
import pycookiecheat import requests import re from bs4 import BeautifulSoup as beaty import smtplib from email.message import EmailMessage class CloudCancellation: def __init__(self, cancelling, reason=None, success=None): self.cancelling = cancelling self.reason = reason self.success = s...
galinvelikov/cloud_cancellation
cloud_cancellation.py
cloud_cancellation.py
py
2,438
python
en
code
0
github-code
1
12837454897
"""pim URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vie...
hackcasa/zappa_final
web/urls.py
urls.py
py
5,762
python
en
code
1
github-code
1
10786424127
# # Create on 4/17/2018 # # Author: Sylvia # """ 202. Happy Number A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in...
missweetcxx/fragments
leetcode/happy_number.py
happy_number.py
py
1,107
python
en
code
0
github-code
1
16974290130
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # JTSK-350112 # stack.py # Shun-Lung Chang # sh.chang@jacobs-university.de def push(stack, element): stack.append(element) print('Pushing {0}'.format(element)) def pop(stack): if not stack: print('Stack underflow') else: print('Popping el...
slchangtw/Advanced_Programming_in_Python_Jacobs
assignment_1/stack.py
stack.py
py
897
python
en
code
0
github-code
1
11810014858
import logging import logging.handlers import os import time class CustomFormatter(logging.Formatter): grey = "\x1b[38;20m" white = "\x1b[37;20m" yellow = "\x1b[33;20m" red = "\x1b[31;20m" bold_red = "\x1b[31;1m" reset = "\x1b[0m" format = "%(asctime)s - %(name)s - %(levelname)s - %(messag...
doppler-motion/code-pub
Python/python_modules/logging_demo/logging_demo.py
logging_demo.py
py
3,121
python
en
code
0
github-code
1
36529140223
import argparse import pandas as pd import numpy as np from sklearn.neighbors import KNeighborsClassifier from sklearn.datasets import load_digits from sklearn.model_selection import train_test_split def main(): print("*" * 20) print("Started HW1_ID1_ID2_old.py") # Parsing script arguments parser = ar...
omervered0708/hw1MLq2
test_sklearn.py
test_sklearn.py
py
1,818
python
en
code
0
github-code
1
33350375465
import torch import torch.nn as nn def weights_init(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0) elif classname.find('BatchNorm') != -1: m.weight.data.normal_(1.0, 0.02) m.bias.data.fill_(0) ...
htt210/GAN-GenAndMetric
Generators.py
Generators.py
py
2,673
python
en
code
0
github-code
1
31172637541
count = int(input()) list1 = [] for i in range(count): word = input() list1.append(word) list1.sort() list1.sort(key = len) back ='' for i in list1: if back != i: print(i) back = i else: continue
Juseong-Yu/Baekjoon
1000/1181.py
1181.py
py
235
python
en
code
0
github-code
1
36016560724
# lists [] can be changed 'ie are mutable' ["This", "list", "contains", "dicts", "numbers", "strings", "and", "booleans", 123, True, {}] # arrays are lists that must contain data types of the same element []: ["Meet", "Joe", "Bloggs"] # lists need not contain elements of the same element # tuples () cannot be changed '...
mhmdmahdi/myWork
Code/week05_datastructures/playingWithLists.py
playingWithLists.py
py
980
python
en
code
0
github-code
1
24486268464
import sys import math n = 8 datei = "C:\\Users\\wiedm\\Python\\codingame\\easy\\if then else\\input1.txt" # 4 n = 11 datei = "C:\\Users\\wiedm\\Python\\codingame\\easy\\if then else\\input2.txt" # 3 n = 30 datei = "C:\\Users\\wiedm\\Python\\codingame\\easy\\if then else\\input4.txt" # 13 befehle = ["if","else","en...
mw197hub/codingame
easy/if then else/main.py
main.py
py
1,179
python
en
code
0
github-code
1
12828451545
# pygame python第三方游戏库 .pyd 动态模块(可以导入,但是看不到源码) .py 静态模块 import pygame # 官方推荐这样导入 from pygame.locals import * import sys # 定义常量记录数据 (常量特点: 字母全大写 一旦定义,不要修改记录的值) WINDOW_H = 768 WINDOW_W = 512 def main(): # 一般将程序的入口定义为main函数 """主函数""" # 1. 创建窗口 window = pygame.display.set_mode((WINDOW_W, WINDOW_...
OreoCookiesYeah/base2
hm_03_飞机移动.py
hm_03_飞机移动.py
py
1,705
python
zh
code
0
github-code
1
35335374713
from typing import List from .Entry import Entry class EntryFilter: def __init__(self): pass def _filter_by_words_count( self, filter_fn: callable, entries: List[Entry], ) -> List[Entry] : return filter( lambda entry: filter_fn(len(entry.title.split())), ...
miguel-martinr/stackcrawler
stackcrawler/EntryFilter.py
EntryFilter.py
py
1,486
python
en
code
0
github-code
1
73424587235
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import cv2 import numpy as np from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from function_collection import custom_deal, my_utility import function_collection.ImageProcessing.scaling as scaling import function_collection.Ima...
freedomDR/pyqt5_project
src/qt.py
qt.py
py
8,875
python
en
code
1
github-code
1
5724769308
""" Примеры: 1)Ввод: 5 15 Вывод: 1+2+3+4+5=15 2)Ввод: 4 46 Вывод: 12+34=46 Введите максимльное число N последовательности: 10 Введите число M, которое необходимо получить в качестве ответа: 46 """ from typing import List import numpy as np import itertools """ если посмотреть пристально на задачку, то можно заметит...
MasheraAnna/Test_tasks
test1_2try.py
test1_2try.py
py
2,440
python
ru
code
0
github-code
1
31805780073
import pickle import time from dnslib import A, NS, QTYPE, RR qtype_to_int = {1: (QTYPE.A, A), 2: (QTYPE.NS, NS)} class Cache: TIME_CACHE_CLEANED = time.time() def __init__(self): self.cache = {} for record_type in qtype_to_int.keys(): self.cache[record_type] = {}...
Eepakura/task_2-dns_server
cache.py
cache.py
py
3,777
python
en
code
0
github-code
1
9416864340
try: import urllib2 except ModuleNotFoundError as exc: import urllib.request as urllib2 def stop_heizung(): response = urllib2.urlopen("http://127.0.0.1/stop") html = response.read() return html print(stop_heizung())
mneuroth/heizungsregelung-public
stop_heizung.py
stop_heizung.py
py
240
python
en
code
0
github-code
1
23613766958
# -*- coding: utf-8 -*- import math import torch import torch.nn.functional as F from torch import nn from ..utils.nn import get_activation_fn class FF(nn.Module): """A smart feedforward layer with activation support. Arguments: in_features(int): Input dimensionality. out_features(int): Out...
lium-lst/nmtpytorch
nmtpytorch/layers/ff.py
ff.py
py
2,163
python
en
code
391
github-code
1
10566901216
import random logo = """ ______ _ | ____| | | | |__ __ _ _ __ ___ ___ _ __ __ _ _ __ ___ ___| | | __/ _` | '_ ` _ \ / _ \ | '_ \ / _` | '_ ` _ \ / _ \ | | | | (_| | | | | | | __/ | | | | (_| | | | | | | __/_| ...
SaubhagyaSingh/100daysofcode
day14/higher_lower.py
higher_lower.py
py
2,410
python
en
code
1
github-code
1
29629691028
import pandas as pd import numpy as np from sklearn.cluster import KMeans from sklearn import preprocessing class K_Means: def __init__(self, k, input): self.k = k self.df = input self.C = None def centroids(self): import random C = {i:[data for data in self.df.values[i...
gospel306/Movie_recommend
data/kmeans.py
kmeans.py
py
2,008
python
en
code
0
github-code
1
28335860302
import abc import uuid from typing import TYPE_CHECKING, Any, Generic, Tuple, Type, TypeVar, Union import pydantic from typing_extensions import Self import prefect from prefect.blocks.core import Block from prefect.client.utilities import inject_client from prefect.exceptions import MissingContextError from prefect....
PatrickVieira1/dataengineering-zoomcamp
week_2_workflow_orchestration/venv/lib/python3.9/site-packages/prefect/results.py
results.py
py
15,848
python
en
code
2
github-code
1
29515845024
indian=["Paratha","Dosa","Idli","Sabji"] chinese=["Chowmein","Manchurian","Choupsey"] italian=["Pizza","Fries","Pasta"] Dish=input("Enter a dish") if Dish in indian: print("Indian") elif Dish in chinese: print("chinese") elif Dish in italian: print("Italian") else: print("Invalid dish")
muskan300600/python-practice
if.py
if.py
py
318
python
en
code
0
github-code
1
25507365738
from django.shortcuts import render from django.http import JsonResponse import json from django.shortcuts import get_object_or_404 from django.http import Http404 from django.views.decorators.csrf import csrf_exempt from . import models def index(request): ctx = {} return render(request, 'main/index.html', ctx) de...
jfsanchez91/CaseReportOpenData
main/views.py
views.py
py
4,026
python
en
code
0
github-code
1
13043600258
"""Sensor Graph main object.""" from collections import deque import logging import struct from pkg_resources import iter_entry_points from toposort import toposort_flatten from iotile.core.exceptions import ArgumentError from iotile.core.hw.reports import IOTileReading from iotile.core.utilities.hash_algorithms impor...
iotile/coretools
iotilesensorgraph/iotile/sg/graph.py
graph.py
py
31,087
python
en
code
14
github-code
1
28049663211
""" This script summarized DE results using mash model. """ import pandas as pd import session_info from pyhere import here from gtfparse import read_gtf from functools import lru_cache @lru_cache() def get_annotation(feature): config = { "genes": here("input/text_files_counts/_m/caudate/gene_annotation.ts...
LieberInstitute/aanri_phase1
differential_analysis/permutation_environmental/tissue_comparison/summary_table/_h/summarize_results.py
summarize_results.py
py
6,514
python
en
code
0
github-code
1
25869305063
# -*- coding: utf-8 -*- from dateutil import tz import datetime from django.contrib.auth.models import User, Group from django.db import models from django.db.models import Min from django.utils.timezone import utc from academy.models import Profile class Attendance(models.Model): profile = models.ForeignKey(Prof...
enoch2110/dodream
attendance/models.py
models.py
py
4,670
python
en
code
0
github-code
1
34264370130
# -*- coding: utf-8 -*- from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.listview import ListView class basitListeUyg(App): def build(self): duzen=BoxLayout() programlama_dilleri=["Perl", "PHP", "Pure", "Python", "Rebol", ...
mustafa-altinisik/kivy-tr
docs/programlar/listeEylem/programlar/1/listeGorunumu.py
listeGorunumu.py
py
593
python
en
code
1
github-code
1
36682252501
import cv2 import mediapipe as mp import time wcam, hcam = 680, 480 cap = cv2.VideoCapture(0) cap.set(3, wcam) cap.set(4, hcam) ptime = 0 mpDraw = mp.solutions.drawing_utils mpFaceMesh = mp.solutions.face_mesh faceMesh = mpFaceMesh.FaceMesh(max_num_faces=2) drawspecs= mpDraw.DrawingSpec(thickness = 1, circle_radius =...
kanojia-gaurav/Advance_opencv
FaceMesh/facemesh.py
facemesh.py
py
880
python
en
code
0
github-code
1
17794645978
# Lifted heavily from Mustard Mine, and may have some unnecessary guff import base64 import collections import datetime import functools import json import os import sys import threading import time import pytz from pprint import pprint, pformat # Hack: Get gevent to do its monkeypatching as early as possible. # I have...
Rosuav/sub-tracker
subtracker.py
subtracker.py
py
8,962
python
en
code
0
github-code
1
34989838921
import matplotlib import matplotlib.pyplot as plt import xlrd file = u'./data.xlsx' xlrd.open_workbook(file) data = xlrd.open_workbook(file) table = data.sheet_by_name(u'data') # 获得表格 x = table.col_values(0) x.pop(0) y1=table.col_values(1) y1.pop(0) y2=table.col_values(2) y2.pop(0) y3=table.col_values(3) y3.pop(0) y4...
kismet-laoqiu/undergrad-rep
2019KDD-邱柯铭-201693043-中国地铁数据分析-ver02 最新补充版/subway_analysis-master/plot.py
plot.py
py
1,269
python
en
code
0
github-code
1
41334774112
import torch import math import numpy as np # def dct1d(x, half_shift=None): # N = x.shape[-1] # if half_shift == None: # half_shift = torch.stack([torch.tensor(-1j * math.pi * k / (2 * N)).exp() for k in range(N + 1)]).to(x.device)[None] # x_ext = torch.cat([x, x.flip(-1)], -1) # z = torch.ff...
DiffEqML/kairos
src/utils/numerics.py
numerics.py
py
3,660
python
en
code
15
github-code
1
44094509671
from utils.timestamp_converter import TimestampConverter class MarketSituation: def __init__(self, csv_row=None, kafka_row=None): self.amount = None self.merchant_id = None self.offer_id = None self.price = None self.prime = None self.product_id = None self....
marcelja/dynamicpricing
merchant/models/market_situation.py
market_situation.py
py
1,799
python
en
code
10
github-code
1
40420432354
from pathlib import Path from numpy.lib.twodim_base import diag from numpy.ma.core import count import parse import numpy as np data_folder = Path(".").resolve() def parse_data(data): lines = [] line_parse = parse.compile("{},{} -> {},{}") for line in data.split("\n"): lines.append([int(d) for d ...
eirikhoe/advent-of-code
2021/05/sol.py
sol.py
py
1,887
python
en
code
0
github-code
1
17979032121
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from pyramid.config import Configurator from TechLurker.models import RedditData, PyjobData, SecurityNewsData, TechRepublicData...
han8909227/TechLurker
TechLurker/scripts/my_scraper/my_scraper/pipelines.py
pipelines.py
py
2,800
python
en
code
0
github-code
1
22942055132
import logging from typing import Callable, Union import numpy as np import torch from monai.apps.deepgrow.transforms import AddRandomGuidanced, FindDiscrepancyRegionsd from monai.handlers import MeanDice, from_engine from monai.handlers.ignite_metric import IgniteMetric from monai.inferers import SimpleInferer from m...
Project-MONAI/MONAILabel
sample-apps/endoscopy/lib/trainers/deepedit.py
deepedit.py
py
5,716
python
en
code
472
github-code
1
42646033615
import pandas as pd import numpy as np import ajf_plts import code import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from BeamModel import Beam from Simulation import perform_static_sim from scipy.stats import wasserstein_distance from numba import njit from numba impo...
alanjferguson/thesis-figure-code
chapter_3/tab02_gen_data.py
tab02_gen_data.py
py
3,551
python
en
code
0
github-code
1
6360755344
from scoringengine.scoringengine import ScoringEngine, ServiceReport import requests import requests.exceptions import os SERVICE_NAME = 'http' ScoringEngine.register_service(SERVICE_NAME) with open(os.path.join(os.path.dirname(__file__), ('http.sample'))) as f: sample_response = f.read() @ScoringEngine.schedul...
bburky/scoringengine
services/http.py
http.py
py
1,124
python
en
code
1
github-code
1
27960984590
from polygon import arc import turtle bob = turtle.Turtle() turtle.speed(speed=100) turtle.delay(0) petals = 16 angle = 30 radius = 10000/ angle def draw_petal(t, radius, angle): for i in range(2): arc(t, radius, angle) t.lt(180-angle) for i in range(petals): draw_petal(bob, radi...
MJC-code/thinkpython
Chapter04/Ex4_2.py
Ex4_2.py
py
382
python
en
code
0
github-code
1
72878881634
from tornado.web import RequestHandler from tornado.escape import json_decode import json class BaseHandler(RequestHandler): def prepare(self): if self.request.body: try: self.data = json_decode(self.request.body) except TypeError or json.JSONDecodeError as e: ...
zshuangyan/search_bookmark
base_handler.py
base_handler.py
py
761
python
en
code
0
github-code
1
32474589299
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('booking', '0001_initial'), ] operations = [ migrations.AlterField( model_name='meetuprequest', name=...
jkol36/glidewithus
glidewithus/booking/migrations/0002_auto_20141106_0150.py
0002_auto_20141106_0150.py
py
398
python
en
code
0
github-code
1
5587030547
#!/usr/bin/env python3 import argparse import collections import pdb def dump_map(map, field): print(f"(field: {field})") for row in map: print(row) print("\n%%%%%%\n") def count_lit(map): c = collections.Counter() for row in map: c += collections.Counter(row) return c["#"] ...
vmizener/adventofcode
2021/20/main.py
main.py
py
2,107
python
en
code
0
github-code
1
21728937931
import requests import json import datetime def format_date(date_str): # 将日期字符串解析为datetime对象 date = datetime.datetime.fromisoformat(date_str) # 将datetime对象转换为年月日格式字符串 return date.strftime("%Y.%m.%d") devices = { "device1": "iPhone", "device2": "iPad", "device3": "Mac" } for device_key,...
y0123456789/ipsw
ipsw1.py
ipsw1.py
py
3,288
python
en
code
1
github-code
1
27928911632
import random def getHex(): alph = "0123456789ABCDEF" ans = random.choice(alph) ans += random.choice(alph) return ans def bubbleSort(nums): for i in range(len(nums) - 1): for j in range(len(nums) - i - 1): if int(nums[j], 16) > int(nums[j + 1], 16): ...
teqnot/12thTASK
2_26.py
2_26.py
py
1,097
python
en
code
0
github-code
1
10501114655
from packets.Messages import Message from utils.reader import Reader from utils.writer import Writer import json class LeaderboardMessage(Message): def __init__(self, dataPlayers): super().__init__() self.id = 24403 self.dataPlayers = dataPlayers def decode(self, buffer): Reader.__init__(self, b...
rostokdev/retrobrawl-py-old
cheese/packets/Messages/Server/LeaderboardMessage.py
LeaderboardMessage.py
py
628
python
en
code
2
github-code
1
4848604123
#!/usr/bin/env python3 """ Launches a registered algorithm on the given set of media """ import argparse import logging import time import tator logging.basicConfig( filename='launch_algorithm.log', filemode='w', format='%(asctime)s %(levelname)s:%(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', leve...
cvisionai/tator-py
examples/launch_algorithm.py
launch_algorithm.py
py
2,972
python
en
code
4
github-code
1
33893292705
from rest_framework import serializers from rest_framework.reverse import reverse from api.serializers import UserPublicSerializer from .models import Product from .validators import validate_title class ProductInlineSerializer(serializers.Serializer): url = serializers.HyperlinkedIdentityField( view_name="pr...
AlizeeBoc/DRF-API
backend/products/serializers.py
serializers.py
py
1,723
python
en
code
0
github-code
1
75271721632
__author__ = 'eric' import cherrypy import threading import re import os from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool from ws4py.websocket import * cherrypy.config.update({'log.screen': False}) cherrypy.config.update({'server.socket_host': '0.0.0.0'}) class CommandWebSocket(WebSocket): ...
eburlingame/lightingserver
main/server.py
server.py
py
2,376
python
en
code
9
github-code
1
73034041633
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>` ''' # Import Python Libs import os import random import string # Import Salt Testing Libs from salttesting import skipIf from salttesting.helpers import ensure_in_syspath, expensiveTest ensure_in_syspath('../../../') # Import...
shineforever/ops
salt/tests/integration/cloud/providers/rackspace.py
rackspace.py
py
3,678
python
en
code
9
github-code
1
43779508077
# -*- coding: utf-8 -*- """ Created on Thu Apr 19 14:50:06 2018 @author: jieyang """ import os import time import re num_string = {} f = open(r'./tr.txt',"r") line = f.readline() dictionary = '' normal_dic = ' "!#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_`abcdefghijklmnopqrstuvwxyz~'...
SJHBXShub/Tool
tool_cv/gain_dictionary.py
gain_dictionary.py
py
976
python
en
code
0
github-code
1
19163726958
import pygame import random pasta = "..\\assets\\" class parede(): distancia = 200 speed =4 canos = [pygame.sprite.Sprite(),pygame.sprite.Sprite()] points = 0 reinitX = 3000 def __init__(self): self.canos[1-1].image = pygame.image.load(pasta+"canos_a.png") self.canos[1...
Pseudo-nimo/Jorge
código/parede.py
parede.py
py
2,276
python
en
code
0
github-code
1
41571308589
import pygame from decoration import Sky class GameOver: def __init__(self, surface, coin_data, reset_overworld): self.display_surface = surface self.coin_data = coin_data self.reset_overworld = reset_overworld self.sky = Sky(8, 'overworld') self.font = pygame.font.Font('g...
Stellar2004/Stellar2004---audio_testing
code/game_over.py
game_over.py
py
1,143
python
en
code
0
github-code
1
34887640346
import numpy as np class LPSolution(object): def __init__(self): self.iterations = None self.tolerance = None self.intermediates = [] self.solution = None self.solution_string = None def __str__(self): self.solution_string = 'Solution: ' + str(self.solution) ...
Notgnoshi/notgnoshi.github.io
_includes/snippets/linear-programming/linear_program.py
linear_program.py
py
2,793
python
en
code
2
github-code
1
40134108745
# N번째 피보나치 수를 구하는 함수 # 다이나믹 프로그래밍(타블레이션[Bottom-Up])(메모이제이션[Top-Down]) ''' dicZ = [0] * 50 #한번 계산된 값을 저장하는 리스트(0) dicO = [0] * 50 #(1) def fibo(n): if (n == 0): dicZ[n] = dicZ[n] + 1 elif (n == 1): dicO[n] = dicO[n] + 1 elif (dicZ[n] != 0 or dicO[n] != 0): #리스트에 올바른 값이 존재 할때 print(dic...
Woojun-Yoon/YOONJOON
1003 피보나치 함수.py
1003 피보나치 함수.py
py
1,002
python
ko
code
1
github-code
1
30522792727
""" Title: Find closest number Problem: Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. Execution: python find_closest_number.py """ import unittest from typing import List, Optional def find_closest_num(arr: ...
samgh/6-Weeks-to-Interview-Ready
quickstart_guides/sorting_searching/python/find_closest_number.py
find_closest_number.py
py
1,927
python
en
code
104
github-code
1
33685054332
from typing import List from time import sleep from models.cliente import Cliente from models.conta import Conta from utils.helper import verifica_tipo, validar_cpf, validar_nome, validar_email contas: List[Conta] = [] def main() -> None: menu() def menu() -> None: print('================================...
Wellington8962/Projetos_Python
BancoPy/banco.py
banco.py
py
6,754
python
pt
code
0
github-code
1
35390527776
from fastapi import FastAPI, Request from src.api.architectures import RecommenderNet from src.api.preprocessing import load_data, get_place_encodings import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import os import joblib import numpy as np import pandas as pd app = FastAPI()...
Tamirgading/Pacmann-Recommendation-System
src/api/collaborative.py
collaborative.py
py
4,243
python
en
code
0
github-code
1
16557617295
# https://www.acmicpc.net/problem/10773 # Solved Dated: 20.05.20. import sys read = sys.stdin.readline def main(): number_count = int(read().strip()) stack = [] for _ in range(number_count): number = int(read().strip()) if number > 0: stack.append(number) else: ...
imn00133/algorithm
BaekJoonOnlineJudge/SolvedACClass/Class2/baekjoon_10773.py
baekjoon_10773.py
py
399
python
en
code
0
github-code
1
32013676632
from __future__ import print_function, division import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader import numpy as np import torchvision from torchvision import transforms, datasets, models import os import cv2 from model.r...
liudaizong/Residual-Attention-Network
train.py
train.py
py
3,426
python
en
code
37
github-code
1
35432397724
import sys sys.stdin = open('input_1231.txt', 'r') def inorder(n): # 중위 순회 if n != 0: inorder(child[n][0]) print(letter[n], end='') inorder(child[n][1]) for tc in range(10): V = int(input()) # 간선의 수 child = [[0, 0] for i in range(V + 1)] letter = [0] for idx in range(V): ...
wally-wally/TIL
02_algorithm/sw_expert_academy/code_problem/D4/1231.중위순회/1231.py
1231.py
py
653
python
en
code
32
github-code
1
12733332965
import pygame import random class Monster(pygame.sprite.Sprite): def __init__(self, game): super().__init__() self.game= game self.health = 100 self.max_health=100 self.attack = 0.1 self.velocity= random.randint(1,2) self.image= pygame.image.load("assets/koo...
taha-khiari/zombie-game
monter.py
monter.py
py
1,192
python
en
code
0
github-code
1
22716966869
# importing modules from flask library from flask import Flask , render_template # creating instance of class Flask, by providing __name__ keyword as argument app = Flask(__name__) # write the routes using decorator functions # default route or 'URL' @app.route("/me") def home(): name = "TANIA SHAIKH"...
92009/family-info-web-pge
family tree/app.py
app.py
py
1,232
python
en
code
0
github-code
1
44859720522
import pandas as pd import sys inputfilename = sys.argv[1] y_data = open (inputfilename, "r") ori_container = [] a = 0 for line in y_data: ori_container.append([]) ori_container[a].append(line) if "$$$$" in line: a += 1 continue y_source = pd.read_csv("sum_log.csv") x_source = pd.read_csv("logS_mcd.csv") st...
miya-dai/system_design
exe/extract_x.py
extract_x.py
py
833
python
en
code
0
github-code
1
5968432199
#!/usr/bin/python3 # -*- coding: utf-8 -*- # http://google.github.io/styleguide/pyguide.html # # Assumptions: # 1. We don't limit the length of phone number. # 2. We assume the phone number can contain only numbers and a dash symbol # (no spaces). # 3. We assume 0 and 1 are not valid numbers for the phone number to c...
vpodk/coding-challenges
python-translate/translate.py
translate.py
py
1,460
python
en
code
0
github-code
1
5573233633
import os import sys import logging from flask import Flask # pylint: disable=no-member # Get configuration from environment DATABASE_URI = os.getenv('DATABASE_URI', 'postgres://soqerjpq:YZCacYhoNGHPtbX0zixiq7Lu81MrRJ1U@salt.db.elephantsql.com:5432/soqerjpq') SECRET_KEY = os.getenv('SECRET_KEY', ' f869ba13-9684-40ce-...
nyudevops-recommendation/recommendations
service/__init__.py
__init__.py
py
928
python
en
code
0
github-code
1
31637485511
# coding=utf-8 import os import unittest import shutil import zipfile from mock import patch from testfixtures import TempDirectory from provider import cleaner import activity.activity_OutputAcceptedSubmission as activity_module from activity.activity_OutputAcceptedSubmission import ( activity_OutputAcceptedSubmi...
elifesciences/elife-bot
tests/activity/test_activity_output_accepted_submission.py
test_activity_output_accepted_submission.py
py
8,902
python
en
code
19
github-code
1
8767127209
from threading import Thread,Lock import os,time def work(threadName): lock.acquire() # print(threadName) if n: print(n.pop()) lock.release() if __name__ == '__main__': lock=Lock() n=[i for i in range(50000)] total = [] for i in range(5): total.a...
Xianzheng/smallProgram
python 线程/thread4.py
thread4.py
py
800
python
en
code
0
github-code
1
30992969576
name, age, license_peronsal = "Angel", 30, False; # Conventiones bookName = "I Book" # Camel Case book_name = "I Book" # Snake Case BookName = "I Book" # Pascal Case PI = 3.1416 book_name = "I Robot" book_name = 5454524
angeldelacruzdev/learn-python
variables.py
variables.py
py
230
python
en
code
0
github-code
1
32552634273
# requests 모듈 import requests from bs4 import BeautifulSoup ''' url = "http://www.python.org" response = requests.get(url) print(response) print(response.status_code) html = response.text #print(html) url2 = "http://www.python.org/3" response = requests.get(url2) print(response) print(response.status_code) urls = ["h...
kiyongee2/green_pyworks
pylearning/웹 스크래핑.py
웹 스크래핑.py
py
5,186
python
en
code
0
github-code
1
246600446
import pandas as pd soubor_1 = "Workbook1.xlsx" df_1 = pd.read_excel(soubor_1, sheet_name="1st") df_2 = pd.read_excel(soubor_1, sheet_name="2nd") # print(df_1.head(5)) # print(df_2.head(5)) all_data = pd.concat([df_1, df_2], axis=0) #dávám axis = 0 aby byly nadpisy v jedné řádce, pokud 1 tak budou vedle sebe #print...
vrbato/pandas_learning
pivot_in_python/Pivot_tables.py
Pivot_tables.py
py
475
python
cs
code
0
github-code
1
21777075483
import platform from .update import VERSION, update, get_commit_hash_msg, get_current_branch import os PLATFORM = f'[ {platform.python_implementation()} {platform.python_version()} ] on {platform.system()}' options_dict = { "show_tree": False, "show_parse": False, "show_time": False, "show_error": Tru...
iewnfod/CAIE_Code
src/options.py
options.py
py
6,093
python
en
code
12
github-code
1
12710298499
# SinglyLinkedList # A singly linked list is a type of linked list that is unidirectional, that is, it can be traversed in only one direction from head to the last node (tail). # Each element in a linked list is called a node. # A single node contains data and a pointer to the next node which helps in maintaining the...
rowvln/Coding
python/Singly_Linked_List.py
Singly_Linked_List.py
py
13,116
python
en
code
0
github-code
1