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
73577960018
#Cachary Tolentino #12/1/22 #This program will output the highest calories of the elf carrying the most calories #Main array containing all inputs calorieListArray = [] #Reading in inputs and assigning each to a slot in an array with open(r'C:\Users\rance\OneDrive\Documents\My Files\Git\AOC2022\Day1\inputDay1...
CacharyT/AdventOfCode2022
Day1.p1/Day1.py
Day1.py
py
854
python
en
code
0
github-code
13
9409380724
amnt = float(input("Enter the amount of money : ")) while amnt < 0: amnt = float(input("Please enter valid amount : ")) dot = str(amnt).find(".") dlr = int(str(amnt)[:dot]) cnts = int(str(amnt)[dot+1:]) while cnts >= 100: cnts = cnts - 100 dlr += 1 qtr = int(cnts/25) cnts = cnts - (qtr*25) dms = int...
sunay-sharma/sem4practicals
FP/YSL_python/prac_2.1.py
prac_2.1.py
py
544
python
en
code
0
github-code
13
72187828817
from ahps_web import app from ahps_web.bll.sun_data import get_astral_data from datetime import datetime, timedelta def house_codes(): codes = [] for hcx in range(0, 16): codes.append(chr(ord('A') + hcx)) return codes def device_codes(): codes = [] for dcx in range(1, 17): codes....
dhocker/ahps_web
ahps_web/views/view_helpers.py
view_helpers.py
py
2,519
python
en
code
0
github-code
13
4181061755
# Javier Franco # Texas is Awesome! import cv2 import numpy as np #from cv2 import cv #method = cv.CV_TM_SQDIFF_NORMED #methods = ['cv2.TM_CCOEFF', 'cv2.TM_CCOEFF_NORMED', 'cv2.TM_CCORR', # 'cv2.TM_CCORR_NORMED', 'cv2.TM_SQDIFF', 'cv2.TM_SQDIFF_NORMED'] # Read the images from the file small_image = cv2.i...
codybushnell/datachallenge-april7
Javier_Franco/ImageSearch_Loop4Numbers.py
ImageSearch_Loop4Numbers.py
py
4,098
python
en
code
0
github-code
13
17059461054
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.SearchProductOrientedRuleOpenApi import SearchProductOrientedRuleOpenApi from alipay.aop.api.domain.SearchProductPeriod import SearchProductPeriod from alipay.aop.api.domain.SearchP...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/SearchBoxExclusiveMarketingInfoRequest.py
SearchBoxExclusiveMarketingInfoRequest.py
py
8,101
python
en
code
241
github-code
13
37982264913
#!/usr/bin/env python r""" Numerical experiment of Chapter 14 (maximum likelihood estimation). See Figure 14.8 and surrounding discussion. The considered model and data are from Temereanca et al (2008): X_0 ~ N(0, sigma^2) X_t = rho X_{t-1} + \sigma U_t, U_t ~ N(0, 1) Y_t ~ Bin(50, logit_inv(X_t)) ...
nchopin/particles
book/mle/mle_neuro.py
mle_neuro.py
py
7,440
python
en
code
337
github-code
13
14386276155
# # @lc app=leetcode.cn id=206 lang=python3 # # [206] 反转链表 # # @lc code=start # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseList(self, head: ListNode) -> ListNode: if not head...
largomst/leetcode-problem-solution
206.反转链表.2.py
206.反转链表.2.py
py
586
python
en
code
0
github-code
13
1678756507
import argparse import os from tqdm import tqdm import os.path as osp import time import cv2 import torch import xml.etree.ElementTree as ET import pickle import numpy as np import sys import shutil def voc_ap(rec, prec, use_07_metric=False): """ Compute VOC AP given precision and recall. If use_07_metric i...
ttrung2h/ByteTrack
Eval/calMAP.py
calMAP.py
py
9,558
python
en
code
0
github-code
13
14381331936
import market def main(): # example: book trade id = market.book_trade('symbol', market.CURRENT_PRICE, 100) # example-end # example: cancel trade market.cancel_trade('id') # example-end if __name__ == "__main__": main()
byc1234/znai
znai-docs/znai/snippets/python-examples.py
python-examples.py
py
251
python
en
code
null
github-code
13
70427128977
import unittest from solutions.day_19 import Solution class Day19TestCase(unittest.TestCase): def setUp(self): self.solution = Solution() def test_seen(self): puzzle_input = ''' | | +--+ A | C F---|----E|--+ | ...
madr/julkalendern
2017-python/tests/day_19_tests.py
day_19_tests.py
py
768
python
en
code
3
github-code
13
22740065780
import sqlite3 from anki import __version__, Card, Deck, Grade, User, AnkiDB from pytest import fixture EXPECTED_TABLES = {"users", "decks", "cards"} @fixture def front(): return "Hello" @fixture def back(): return "World" @fixture def card(front, back): return Card( front=front, back=ba...
Brunods1001/anki
tests/test_anki.py
test_anki.py
py
3,399
python
en
code
0
github-code
13
32556749919
from bs4 import BeautifulSoup import requests import pandas as pd # 3 steps to get the data ETL(1.Extract 2.Trasform 3.Load) # ___________ 1. Extract _____________ def extract(page): headers = {'User-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5...
Aspersh-Upadhyay/Scrape-Linkedin-Blog
Scrape-Linkedin-Blog.py
Scrape-Linkedin-Blog.py
py
2,163
python
en
code
0
github-code
13
19992367964
import os, sys from pygame import * def menu(): print ("+-----------------------MENU----------------------+") print ("| 1 | 2 | 3 | 4 | 5 |") print ("+-------------------------------------------------+") print ("| Pause | Unpause | Play | Stop | Load |") pri...
linonepow/terminal-mp3player
src.py
src.py
py
2,235
python
en
code
0
github-code
13
21507445909
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from dip.boardgames.saboteur.Card import Card from dip.boardgames.saboteur.CardDetector import CardDetector from dip.boardgames.saboteur.PathPlanner import run_astar from dip.boardgames.saboteur.Grid import Grid from dip.boardgames.saboteur.Camera import Camera from dip.b...
new2me321/saboteur-card-game
dip/boardgames/saboteur/Game.py
Game.py
py
22,216
python
en
code
1
github-code
13
42746790135
import numpy as np from poptransformer import ops from poptransformer.layers import BaseLayer from poptransformer.layers import Linear from poptransformer.utils.param_handler.tensor_parallel_strategy import shard class BaseRWKVAttention(BaseLayer): def __init__(self, context, name, hidden_size, attention_hidden_s...
graphcore/PopTransformer
poptransformer/models/rwkv/attention.py
attention.py
py
8,361
python
en
code
6
github-code
13
21477799309
def main(): bass = 'Y' print ('Choose number :') print ('1) read ') print ('2) write ') choice = int(input(' : ')) while bass == 'Y' or bass == 'y' : if choice == 1: num_one() elif choice == 2: num_two() else: print('Only 1 or 2 ') ...
patsakon93/project1
15sep63/test1.py
test1.py
py
855
python
en
code
0
github-code
13
9070101877
import re def read_file_content(file_path): try: with open(file_path, "r") as file: return "".join(file.readlines()).split("\n") except FileNotFoundError: print("File or file path does not exist!") def count_characters(list_name): count = [] [count.append(len("".join(line...
vbukovska/SoftUni
Python_advanced/Ex6_file_handling/line_numbers.py
line_numbers.py
py
964
python
en
code
0
github-code
13
6868952689
from pymongo import MongoClient client = MongoClient('localhost', 27017) db = client.dbsparta # insert / find / update / delete # insert 예시 ----------------------------------------------------- doc = {'name':'jane','age':21} db.users.insert_one(doc) # find 예시 ------------------------------------------------------- ...
conagreen/TIL-hanghae99
Chapter0/sparta/pythonprac/dbprac.py
dbprac.py
py
1,202
python
ko
code
0
github-code
13
16918311179
from django.db import models from django.urls import reverse from django.utils.timezone import now from shop.custom_field import * from shop.define import * class Contact(models.Model): name = models.CharField(max_length=100) email = models.EmailField() phone = m...
newfeed123/django
shop/models/contact.py
contact.py
py
680
python
en
code
0
github-code
13
10191229125
n, m, k, x = map(int, input().split()) dis = [[10001] * (n + 1) for _ in range(n + 1)] for i in range(1, n + 1): dis[i][i] = 0 for i in range(m): a, b = map(int, input().split()) dis[a][b] = 1 for p in range(1, n + 1): for j in range(1, n + 1): dis[x][j] = min(dis[x][j], dis[x][p] + dis[p][j]) ...
Jinnie-J/Algorithm-study
algorithm study/dynamic_programming/A15_특정거리의도시찾기.py
A15_특정거리의도시찾기.py
py
1,122
python
en
code
0
github-code
13
39283202520
# Created by Qingzhi Ma at 27/01/2020 # All right reserved # Department of Computer Science # the University of Warwick # Q.Ma.2@warwick.ac.uk # # # hive -e "select ss_store_sk, count(*) from store_sales_40g where ss_sold_date_sk between 2451119 and 2451483 group by ss_store_sk;" > ~/group57counts.csv # # from dbestcl...
qingzma/DBEstClient
experiments/tpcds/groupby/groupby57.py
groupby57.py
py
3,112
python
en
code
14
github-code
13
6955083801
from liveapi.extensions import db, cache from .users import UserService from .transactions import managedtrans from liveapi.models import Chatterbox class TrackService: @staticmethod @managedtrans() @cache.memoize() def set_tracking(identity, display_name, channel_id=None): user = UserServic...
jobrienski/youtube_live
src/liveapi/services/track.py
track.py
py
1,071
python
en
code
0
github-code
13
25106628250
import requests from requests import request from bs4 import BeautifulSoup import urllib.parse import re import threading urls_to_city_pages = [ "https://pl.wikipedia.org/wiki/Kategoria:Miasta_w_wojew%C3%B3dztwie_dolno%C5%9Bl%C4%85skim", "https://pl.wikipedia.org/wiki/Kategoria:Miasta_w_wojew%C3%B3dztwie_kuja...
Tnovyloo/Poland-Cities-CSV
main.py
main.py
py
5,354
python
en
code
0
github-code
13
74251522258
import json import csv import requests import sys # keyword is a string # results_str is a str # results is a dictionary[keyword] -> sorted primary keys by table def parse_and_add_to_results(keyword, results_str, results): table_dict = {} if keyword in results: table_dict = results[keyword] # list...
jordvnkm/inf551_project
hw1/homework1/search.py
search.py
py
2,159
python
en
code
0
github-code
13
20437202594
import numpy as np fname='test_input.txt' # fname='input.txt' this_count = 0 max_count = 0 this_elf = 1 max_elf = 0 excl_1 = 127 excl_2 = 127 with open(fname) as fp: for line in fp: stripped = str.strip(line) if stripped == '': if this_count>max_count: ...
stephanemagnan/advent-of-code-2022
Day 01/day01.py
day01.py
py
536
python
en
code
0
github-code
13
8655680281
# from twilio.rest import Client # # Your Account Sid and Auth Token from twilio.com/console # # DANGER! This is insecure. See http://twil.io/secure # account_sid = 'AC6f88642acc6eaec6eac5214bff36d18c' # auth_token = 'cf7f64050ab8ed1c67a414fe216196e2' # client = Client(account_sid, auth_token) # # message = client.m...
struckchure/Finished-Projects
DiamondRubyQuiz/Test.py
Test.py
py
15,456
python
en
code
1
github-code
13
28541693689
import time # sudo pip3 install adafruit-blinka # sudo pip3 install adafruit-circuitpython-pca9685 # sudo pip3 install adafruit-circuitpython-servokit from adafruit_pca9685 import PCA9685 from board import SCL, SDA import busio from adafruit_motor import servo i2c_bus = busio.I2C(SCL, SDA) pwm = PCA9685(i2c_bus) ...
cocpy/raspberrypi4
第7章/2/control_servo_motors.py
control_servo_motors.py
py
967
python
en
code
0
github-code
13
20478620439
from .element import Element from collections import OrderedDict class Elements(OrderedDict): def __init__(self, elements=None): OrderedDict.__init__(self) if elements: if type(elements) == Elements: for key, val in elements.items: self[key] = Eleme...
etalpha/vaspm
lib/elements.py
elements.py
py
1,416
python
en
code
0
github-code
13
9715220364
from sqlalchemy import Column, Integer, DateTime, Text, ForeignKey from sqlalchemy.orm import relationship from GaleriaViewer.model.base import Base from GaleriaViewer.model import content_tag class Tag(Base): """Model for all tags stored in database""" __tablename__ = 'tag' id = Column(Integer, primary_...
gr8prnm8/GaleriaViewer
GaleriaViewer/model/tag.py
tag.py
py
714
python
en
code
0
github-code
13
42135008812
def Parity (x): ''' Проверка на четность ''' par = x % 2 == 0 if par == True: return ("Четное") else: return ("Нечетное") def biggestNumberAndMultiplicity (nOne, nTwo): ''' Определение большего числа И кратны ли числа ''' if nOne > nTwo: if nOne % nTwo == 0: r...
LevapTon/Studing
Информатика с основами программирования/Семестр 1/ЛабРаб 1 – Диалоги и ветвления/BackEnd.py
BackEnd.py
py
2,631
python
ru
code
0
github-code
13
21951228658
#!/usr/bin/python # SPLASH EROSION ########## HERE IS THE INITIAL SECTION OF PROGRAM HEADER CLASS ########## # PROGRAM TITLE # Sediment Transport & Erosion Prediction # PROGRAM DESCRIPTION # STEP was initiated by Jenderal Soedirman University, a research university of technology located in Indonesia in 2017. #...
GitContainer/STEPMaster
main/splasherosion.py
splasherosion.py
py
26,083
python
en
code
1
github-code
13
18365897211
import socket from threading import Thread class Server(Thread): def __init__(self, conn): super().__init__() self._conn = conn def run(self): conn.send(str.encode("Welcome, type your info\n")) while True: data = conn.recv(2048) if not data: ...
jeffnb/python-intermediate
foster-city/visa-python/fib_class.py
fib_class.py
py
818
python
en
code
0
github-code
13
2074506517
""" Author Jianzhe Lin May.2, 2020 """ from mpl_toolkits import mplot3d import argparse import multiprocessing from pathlib import Path import numpy as np import cv2 import matplotlib.pyplot as plt import open3d as o3d import torch import time from re_id import load_pv_data, match_timestamp, judge_loc, judge_list, get_...
VIDA-NYU/ptgctl
examples/re_identification.py
re_identification.py
py
15,306
python
en
code
0
github-code
13
4210525330
from typing import List class Solution: def minFallingPathSum(self, matrix: List[List[int]]) -> int: for i in reversed(range(0, len(matrix) - 1)): for j in range(0, len(matrix[0])): min_value = min(matrix[i + 1][j], matrix[i + 1][max(j - 1, 0)], matrix[i + 1][min(j + 1, len(mat...
mhasan09/leetCode_M
min_falling_path_sum.py
min_falling_path_sum.py
py
658
python
en
code
0
github-code
13
31935472902
#!/usr/bin/python ### IMPORT import os import os.path import sys ### GLOBAL VARIABLES # Location of the path that will contain the scripts for this phase # i.e. /home/user/project/scripts/variants_individual/ scriptsDir = sys.argv[1] # Location of folder containing the BAM files to be genotyped and unified # i.e. ...
jcvalverdehernandez/cr_dislipidemia_2022
post__variant_call_workflow_slurm/variants_individual/variants_individual.py
variants_individual.py
py
6,310
python
en
code
0
github-code
13
16773944453
# (1, 골2) bfs_Codetree_색깔폭탄 import heapq # n * n # === input === N, M = map(int, input().split()) board = [list(map(int, input().split())) for _ in range(N)] EMPTY, BLACK, RED = -2, -1, 0 # === algorithm === # 1. max(폭탄 묶음) 제거됨 # 2개 이상의 폭탄 # 모두 같은 색깔이거나, 빨간색을 포함 # 빨간색만으로 이루어...
1092soobin2/Algorithm-Study
bfs,dfs/(1, 골2) bfs_Codetree_색깔폭탄.py
(1, 골2) bfs_Codetree_색깔폭탄.py
py
3,619
python
en
code
1
github-code
13
7644105778
from django.urls import path from . import views urlpatterns = [ path('',views.vehicle_list,name='vehicle_list'), path('vehicle_detail/<int:vehicle_id>/',views.vehicle_detail,name='vehicle_detail'), path('vehicle_create/', views.vehicle_create, name='vehicle_create'), path('vehicle_update/<int:vehicle_...
SwetharajKP/Vehicle_Management
VMS/vehicles/urls.py
urls.py
py
465
python
en
code
0
github-code
13
19609761193
from turtle import * def blank_face(): color('wheat') begin_fill() circle(radius=50) end_fill() penup() def next(): penup() forward(150) pendown() def eyes(shape): x, y = pos() left(90) forward(55) left(90) forward(30) pendown() color('black') if shape ...
zhahchun/information_processing_retrieval
w04/Stu04/emoji.py
emoji.py
py
1,970
python
en
code
0
github-code
13
73468263697
import sys class User: name = "" def __init__(self, name): self.name = name def sayHello(self): print("Hello my name is " + self.name) def sayBye(self): print("Goodbye!!!!") james = User("MANGA") david = User("David") eric = User("Eric") james.sayHello() david.sayHello(...
BarringtonT/test
PythonTestFiles/user.py
user.py
py
466
python
en
code
0
github-code
13
17800569314
# encoding: utf-8 """Unit test suite for histolab.util module.""" import operator import numpy as np import pytest from tests.base import ( COMPLEX_MASK, IMAGE1_GRAY, IMAGE1_RGB, IMAGE1_RGBA, IMAGE2_GRAY, IMAGE2_RGB, IMAGE2_RGBA, IMAGE3_GRAY_BLACK, IMAGE3_RGB_BLACK, IMAGE3_RGB...
nsmdgr/histolab
tests/unit/test_util.py
test_util.py
py
7,699
python
en
code
0
github-code
13
34357336582
# This program is responsible for searching an e-mails and phone numbers in clipboard import re, pyperclip # This block of code contain a model to find phone numbers phone_model = re.compile(r'''( (\+(\d{2})|(\d){4})? # Phone code ((\s)|\-)? # separator - white sign or dash ...
lenncb/E-mail-adresses-and-phone-numbers-searcher
email_and_phonenum_searcher.py
email_and_phonenum_searcher.py
py
1,284
python
en
code
0
github-code
13
36322653083
from typing import Any, List def loopy_madness_with_while_loops(string1: str, string2: str) -> str: """ The exact same function as loopy_madness from Lab 5, but we ask that you change any for loops that you used to while loops. Refer back to Lab 5 for the specifications of this function. """ int...
initialencounter/code
Python/SCS/lab6.py
lab6.py
py
1,824
python
en
code
0
github-code
13
74076921936
import os import cv2 from piepline import BasicDataset from pietoolbelt.datasets.common import get_root_by_env class LIP(BasicDataset): def __init__(self): root = get_root_by_env('LIP_DATASET') items = [] for set_dir in ['train', 'val']: cur_images_dir = os.path.join(root, se...
HumanParsingSDK/datasets
human_datasets/lip.py
lip.py
py
952
python
en
code
2
github-code
13
15320287284
import os import tensorflow as tf # Désactiver les avertissements de niveau inférieur de TensorFlow os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # 3 = FATAL tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) from keras.models import load_model import pandas as pd import numpy as np from sklearn.model_selecti...
max260129/emotions-detector
scripts/predict.py
predict.py
py
2,364
python
fr
code
0
github-code
13
28396406872
import os import shutil import time from collections import OrderedDict import numpy as np import torch from torch.autograd import Variable from torch.backends import cudnn from torch.utils.data import DataLoader from detect import netdef, data from detect.data.dataset import DataBowl3Detector from detect.data.split_...
simsara/LNDCML
detect/__init__.py
__init__.py
py
12,171
python
en
code
1
github-code
13
33400710622
import sys import math from .json_request import json_request from urllib.parse import urlencode from datetime import datetime TOUR_URL_ENDPOINT = 'http://openapi.tour.go.kr/openapi/service/TourismResourceStatsService/getPchrgTrrsrtVisitorList' ED_URL_ENDPOINT = 'http://openapi.tour.go.kr/openapi/service/EdrcntTouris...
twooopark/Analysis_PublicData
collect/api/api.py
api.py
py
3,648
python
en
code
0
github-code
13
8562450264
#!/usr/bin/env python3 # Creates an answer key for all data owners specified # to be consumed by the scoring and evaluation tools for tuning import csv from pathlib import Path systems = ["site_a", "site_b", "site_c", "site_d", "site_e", "site_f"] # output is clk_pos | h_id header = ["HOUSEHOLD_POSITION", "HOUSEHOL...
mitre/data-owner-tools
testing-and-tuning/answer_key_map.py
answer_key_map.py
py
2,012
python
en
code
5
github-code
13
39751095932
from typing import Dict, Union # Third Party Imports from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.orm import relationship # RAMSTK Local Imports from .. import RAMSTK_BASE from .baserecord import RAMSTKBaseRecord class RAMSTKSubCategoryRecord(RAMSTK_BASE, RAMSTKBaseRecord): # type: ig...
ReliaQualAssociates/ramstk
src/ramstk/models/dbrecords/commondb_subcategory_record.py
commondb_subcategory_record.py
py
1,726
python
en
code
34
github-code
13
21453046038
# Title : 미로 탐색 # Date : 2022/11/19 # https://www.acmicpc.net/problem/2178 import sys from collections import deque def bfs(x,y): # 상, 하, 좌, 우 dx = [-1,1,0,0] dy = [0,0,-1,1] de = deque() de.append((x,y)) check[x][y] = 1 while de : tx, ty = de.popleft() if tx == n-1 and ...
kkyu-min/Baekjoon
BFS_DFS/2178.py
2178.py
py
958
python
en
code
0
github-code
13
17592793814
#largest and smallest x=0 largest=-1 smallest=None while True: x=input("enter the number: ") if x=="done": break a=int(x) if smallest is None: smallest=a elif a<smallest: smallest=a if a>largest: largest=a print(largest) print(smallest)
Mukesh-kanna/python-content-repo
largestsmallestnumber.py
largestsmallestnumber.py
py
294
python
en
code
0
github-code
13
8052784227
#!/usr/bin/env python # -*- coding: utf-8 -*- from ComssService.service.sync import SyncService from ComssService.ServiceController import ServiceController import re # Regexp dla formatu Access Loga Apache'a # Zgodny z Common Log Format (http://en.wikipedia.org/wiki/Common_Log_Format) regex = '([(\d\.)]+) - - \[(.*?...
pawellewandowski/TIRT
ComssService/project/http_extractor/http_extractor_service.py
http_extractor_service.py
py
1,024
python
en
code
0
github-code
13
26188296075
# Builder - common functions import functools import json from pathlib import Path import subprocess from urllib.parse import urlparse CONFIG_FILE = Path(__file__).parent.parent / "appliance_config.json" SECRETS_DIR = Path(__file__).parent.parent / 'secrets' SECRETS_FILE = SECRETS_DIR / 'secrets.json' SECRETS_NAMES = ...
tdesposito/Pi-Appliance
builder/__init__.py
__init__.py
py
2,968
python
en
code
0
github-code
13
1227186107
''' Created on 29 Nov 2013 @author: Oskar ''' class Unlock(object): ''' Unlocks doors ''' def __init__(self, console): ''' Constructor ''' self.console = console self.synonms = ["unlock"] @property def args(self): return [str(exit_.i_go(se...
OskarBun/Game
src/oskar/console_actions/unlock.py
unlock.py
py
904
python
en
code
0
github-code
13
15919398706
# -*- coding: utf-8 -*- # --- # title: "Fairness" # site: distill::distill_website # jupyter: # jupytext: # formats: ipynb,Rmd,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.11.4 # kernelspec: # display_name...
gpltr/Ethique
fairness.py
fairness.py
py
14,595
python
fr
code
0
github-code
13
34911062134
from toxcore_enums_and_consts import * from PySide import QtGui, QtCore import profile from file_transfers import TOX_FILE_TRANSFER_STATE from util import curr_directory, convert_time from messages import FILE_TRANSFER_MESSAGE_STATUS from widgets import DataLabel class MessageEdit(QtGui.QTextEdit): def __init__(...
SergeyDjam/toxygen
src/list_items.py
list_items.py
py
10,197
python
en
code
null
github-code
13
9341538822
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
SamsungSAILMontreal/ForestDiffusion
STaSy/losses.py
losses.py
py
7,927
python
en
code
41
github-code
13
22853438512
import datetime import json import os import joblib import matplotlib.pyplot as plt import mxnet as mx import numpy as np import pandas as pd from gluonts.dataset import common from gluonts.dataset.common import ListDataset from gluonts.dataset.field_names import FieldName from mxnet import gluon from tqdm.notebook i...
pedrogerum/probabilistic-traffic-forecating
make_chicago_data.py
make_chicago_data.py
py
5,314
python
en
code
0
github-code
13
25548143223
"""Hold configuration variables for the emulated hue bridge.""" import datetime import logging import os import uuid from getmac import get_mac_address from .utils import get_local_ip, load_json, save_json _LOGGER = logging.getLogger(__name__) CONFIG_FILE = "emulated_hue.json" class Config: """Hold configurat...
mustikkax/hass_emulated_hue
emulated_hue/config.py
config.py
py
8,137
python
en
code
1
github-code
13
22178883441
import math import random import numpy as np from scipy.stats import t import matplotlib.pyplot as plt def random_variable(s, a): r = sum([random.uniform(0,1) for _ in range(12)]) result = (r - 6) * s + a return result def correlation_field(xdata, ydata): correlation_field = np.correlate(xdata, ydata...
Vlad1kent1/MathStatistic
lab2/func.py
func.py
py
1,343
python
en
code
0
github-code
13
32900177034
# NO TOUCHING ============================================ from random import choice food = choice(['apple','grape', 'bacon', 'steak', 'worm', 'dirt']) # NO TOUCHING ============================================= if food == "apple" or "grape": print("fruit") elif food == "bacon" or "steak": print("meat"...
lepaclab/Python_Bootcamp
Food_classification.py
Food_classification.py
py
349
python
en
code
0
github-code
13
70392556819
from flask import Flask, render_template import json app = Flask(__name__) # Just for pytest purposes testing = 'Network Automation Training' # Dummy Database data call vendors = [ {'cisco': 'routers', 'juniper': 'switches', 'palo alto': 'firewall', 'aris': ' spine switch'}, {'country': 'USA',...
fonzynice/flaskdemo
myapp.py
myapp.py
py
680
python
en
code
0
github-code
13
16129401623
#!/usr/bin/python3 """ Purpose: """ from openpyxl import Workbook from openpyxl.chart import BarChart, Reference from openpyxl.worksheet import worksheet def main(filename): wb = Workbook() sheet = wb.active # Add data to spreadsheet data_rows = [ ("Book", "Kindle", "Paperback"), (1, ...
udhayprakash/PythonMaterial
python3/11_File_Operations/02_structured_files/05_xls_files/openpyxl_module/i_charts.py
i_charts.py
py
806
python
en
code
7
github-code
13
38317742695
import random print( "The game is simple. I will choose a number from 1 to 100.Your job is to guess the number.Don't worry I will help you :)") number = random.randrange(1, 100) you_win = False total_attempts = 0 while not you_win: current_guess = int(input("Please choose a number from 1 to 100: ")) total_...
Tsveti1103/Guess-the-number-game
game.py
game.py
py
659
python
en
code
1
github-code
13
3286012679
import matplotlib.pyplot as plt import numpy as np from sklearn.cluster import KMeans from djikstras import Dijkstra robot_starting_location=np.array([(0,10),(0,20)]) parcel_list=np.array([(40,30),(10,40),(20,35),(20,50),(40,40)]) class Warehourse_Router: ''' Takes initial robot and parcel locations as input ...
rutvikbaxi/VRP_codes
warehouse_MRTA/Greedy_strategy/clustering_based.py
clustering_based.py
py
5,315
python
en
code
0
github-code
13
18274342976
#!/usr/bin/env python import os import subprocess def install(alsi): from al_services.alsvc_mcafee.mcafee_lib import McAfeeScanner mcafee_tgz = 'vscl-l64-604-e.tar.gz' remote_path = 'mcafee/' + mcafee_tgz install_dir = os.path.join(alsi.alroot, 'support/mcafee') if not os.path.exists(install_dir...
deeptechlabs/cyberweapons
assemblyline/alsvc_mcafee/installer.py
installer.py
py
1,258
python
en
code
78
github-code
13
9936505146
#!/usr/bin/env python # coding: utf-8 # # Exploratory Analysis for COVID19 [3 pts] # # Inspired by the paper of [Brinati et al. (2020)](https://zenodo.org/record/3886927#.X7Jy_ZMzbm1), I produce an exploratory analysis attempting to detect COVID-19 (SWAB) based on features such as gender, age, blood exams, etc. # I...
aandrovitsanea/Exploratory-Data-Analysis-for-COVID-19-patients
exploratory_analysis_covid-19.py
exploratory_analysis_covid-19.py
py
25,179
python
en
code
0
github-code
13
27736135526
import turtle wn=turtle.Screen() turtle.bgcolor('white') turtle.color('red') turtle.shape('turtle') t5=turtle.Turtle() move=1 ############################### t5.speed("fastest") for i in range(10): for i in range(4): t5.pu() t5.goto(500,200) t5.pd() t5.color('orange') ...
Swapnil-Singh-99/PythonScriptsHub
TurtleAnimations/CirclePattern.py
CirclePattern.py
py
648
python
en
code
19
github-code
13
21126391353
import sys from random import randint from PyQt5.QtWidgets import QWidget, QPushButton, QApplication from PyQt5.QtGui import QColor, QPainter, QFont class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.setGeometry(600, 300, 500, 500) ...
rybolovlevalexey/Chelyabinsk-Rybolovlev
main.py
main.py
py
1,530
python
en
code
0
github-code
13
16394985132
""" Remediate Evident Signature: AWS:CLT-004 CloudTrail logs not integrated with CloudWatch Description: CloudTrail logs are not automatically sent to CloudWatch Logs. CloudWatch integration facilitates real-time and historic activity logging based on user, API, resource, and IP address. It will also establish alarm...
cloudcraeft/remediate
remediate/runbook/AWS-CLT-004.py
AWS-CLT-004.py
py
5,565
python
en
code
1
github-code
13
15867314837
import requests import json def matchingWord(strs): link= "https://api.datamuse.com/words" param={} param["rel_rhy"]=strs param['max']=3 page=requests.get(link, param) print(type(page)) jsonbanalam=page.json() return [name['word'] for name in jsonbanalam] inp=input("input word") matchingWord(inp)
aniksen0/pythonScriptsAndProject
returnSameTypewordAPI .py
returnSameTypewordAPI .py
py
314
python
en
code
0
github-code
13
72943446738
budget = float(input()) number_of_statist = int(input()) one_dress_price = float(input()) decore = budget * 0.1 dress_price = number_of_statist * one_dress_price if number_of_statist > 150: dress_price *= 0.9 needed_money = decore + dress_price differance = abs(needed_money - budget) if needed_money > budget: p...
Andon-ov/Python-Basics
conditional_statements_exercise/godzilla_vs_kong.py
godzilla_vs_kong.py
py
498
python
en
code
0
github-code
13
34377177829
#!/bin/python import argparse parser = argparse.ArgumentParser(description='Read a file in reverse') parser.add_argument('filename', help='the file to read') parser.add_argument('--limit', '-l', type=int, help='the number of lines to read') parser.add_argument('--version', '-v', action='version', version='%(prog)s ...
karthikghantasala/Py-learn
scripting_parsing_cmd_line_params_1.py
scripting_parsing_cmd_line_params_1.py
py
586
python
en
code
1
github-code
13
14724067420
from django.http import HttpResponse from django.shortcuts import render_to_response import datetime from django.utils import timezone import wikipedia import googleapiclient import json import wget import random import urllib.request from urllib.parse import urlparse def return_image_url(q): url = "https://www.google...
aaditkapoor/helpmerevise
Revise/views.py
views.py
py
1,506
python
en
code
0
github-code
13
74638018256
""" hosu 변수를 단지로 읽어주시면 감사하겠습니다... """ from collections import deque dx = [0,0,1,-1] dy = [1,-1,0,0] n = int(input()) q = deque() board=[] hosu = 0 # 단지 개수 for _ in range(n): board.append(list(map(int, input()))) countList= [] # 각 단지마다 몇 채의 집이 있는지 개수 세기 for i in range(n): for j in range(n): if board[i...
Coding-Test-Study-Group/Coding-Test-Study
byeongjoo/백준 2667 단지번호붙이기.py
백준 2667 단지번호붙이기.py
py
1,377
python
ko
code
4
github-code
13
73721998096
## This file contains the FuzzyClustering class definition import math import numpy as np class FuzzyClustering: ### Class variables ra = 1 rb = 1.25 alpha = 4 / ra / ra beta = 4 / rb / rb # original values elower = 0.15 and eupper = 0.5 elower = 0.01 eupper = 0.5 ###...
Donkeybobo/fuzzyclustering
scripts/FuzzyClustering.py
FuzzyClustering.py
py
5,580
python
en
code
0
github-code
13
20694296655
from django.shortcuts import HttpResponse from rest_framework.views import APIView from rest_framework.generics import GenericAPIView, ListAPIView from rest_framework.response import Response from student.models.student import Student, Branch from student.serializers.user import UserSerializer from student.serializers...
sanjay-sba3/Student_management_pro
student/views/student.py
student.py
py
4,017
python
en
code
0
github-code
13
12305133448
import audiofile import numpy as np from pathlib import Path from typing import Union import matplotlib.pyplot as plt from subprocess import Popen, PIPE from scipy.signal import savgol_filter from common import get_video_duration def db_to_AR(dB: float) -> float: """Convert decibels to amplitude ratio""" return np...
haganenoneko/ClippingTools
MainClippingTools/remove_silence.py
remove_silence.py
py
14,893
python
en
code
0
github-code
13
7469976703
from art import logo, vs from game_data import streamers from random import randint from os import system lost = False streamers_temp = streamers.copy() score = 0 def clear(): _ = system('clear') def get_streamer(): global streamers_temp streamer = list(streamers_temp.items())[randint(0, len(streamers_...
Ashoolak/higherOrLowerTwitch
main.py
main.py
py
2,014
python
en
code
0
github-code
13
20420653519
#!/usr/bin/python3 import config import csv import datetime import decimal import json import os import re import sys import time import itertools from common import Common from detectors.ficus import FICUS from detectors.ketek import KETEK from detectors.ic import IC from detectors.keithley_i0 import KEITHLEY_I0 from...
SESAME-Synchrotron/HESEBScanTool
heseb.py
heseb.py
py
14,968
python
en
code
0
github-code
13
28242146135
# coding: utf-8 # In[1]: import pandas as pd # In[3]: x = (1, 'a', 2, 'b') type(x) # In[4]: x = [1, 'a', 2, 'b'] type(x) # In[6]: x.append(3.3) print(x) # In[7]: for item in x: print(item) # In[8]: i = 0 while(i != len(x)): print(x[i]) i = i + 1 # In[9]: 1 in [1, 2, 3] # In[10]: ...
kammitama5/Data_Science_001
JupyterScratchNotes_001.py
JupyterScratchNotes_001.py
py
2,891
python
en
code
0
github-code
13
4991580174
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of ArchSetup. # # ArchSetup is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
antoniovazquezblanco/ArchSetup
Interface/Widgets/ProgressWidget.py
ProgressWidget.py
py
1,696
python
en
code
2
github-code
13
74675203856
import math import numpy as np def transform_coor(unit_vectors, xyz): ''' Transform the coordinates in new system back to its coordinates in old system Parameters ---------- unit_vectors : list of array unit_vectors of the new system in old system xyz : array coordinates in ne...
z-gong/mstk
mstk/topology/geometry.py
geometry.py
py
6,778
python
en
code
7
github-code
13
38657742741
#!/usr/bin/python3 """ FileStorage Module: Defines attributes and methods for handling the serialization and deserialization of class instances using JSON. """ import json class FileStorage: """ Serializes instances to a JSON file and deserializes JSON file to instances Private class attribute: __...
leoemaxie/AirBnB_clone
models/engine/file_storage.py
file_storage.py
py
2,345
python
en
code
0
github-code
13
39616286494
#!/usr/bin/env python3 import http.server import socketserver import urllib.parse import base64 import os import argparse PORT = 8000 HOST = "" RESERVED_DIR = "downloads" class RequestHandler(http.server.SimpleHTTPRequestHandler): def do_GET(self): file_path = self.path parsed_url = urllib.parse...
dani84bs/ctf-web-server
ctf_web_server.py
ctf_web_server.py
py
1,674
python
en
code
0
github-code
13
16706802054
''' PointGroup test.py Written by Li Jiang ''' import torch import time import numpy as np import random import os from util.config import cfg cfg.task = 'test' from util.log import logger import util.utils as utils import util.eval as eval from util_iou import * import glob, plyfile, numpy as np, multiprocessing as...
liuzhengzhe/One-Thing-One-Click
cvpr2021_version/merge/test_train.py
test_train.py
py
6,363
python
en
code
48
github-code
13
20941817006
# find uncoman element in a list of list s = ' native method ' print(s.center(len(s)+20,'*')) list1 = [] list2 = [] result = [] n = int(input()) print('for list1 enter element :\n') for i in range(n): a =list(map(int,input().split())) list1.append(a) print('for list2 enter element :\n') for i in ra...
Rohit-saxena125/Python-code
List/Uncomman_element.py
Uncomman_element.py
py
737
python
en
code
0
github-code
13
5276106856
#!/usr/bin/env python3 # # Dispersion of solutions, per cell, per method, shown in prior # from __future__ import division, print_function import os import sys import myokit import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.gridspec import Grid...
CardiacModelling/FourWaysOfFitting
figures-unused/u5-reliability/fx-dispersion-in-prior.py
fx-dispersion-in-prior.py
py
3,774
python
en
code
4
github-code
13
31193067870
import pymfx4 from pymfx4.mfx4device import mfx4Cut from pymfx4.mffullindex import FullIndex from pymfx4.mfconnection import mfx_endpoints, mfx_close_endpoints import time # connect to a MFX_4 EDI (Node=0). This function # will return a tuple of devices. cutDevice = 0 for device in mfx_endpoints("192.168.3.117:4003"...
AAngold/pymfx4
example/pymfx4_example.py
pymfx4_example.py
py
868
python
en
code
0
github-code
13
4193169346
import numpy as np import math import matplotlib.pyplot as plt import matplotlib.lines as mlines from heapq import heappush, heappop import rospy from geometry_msgs.msg import Point, Twist, PoseStamped from math import pow, atan2, sqrt import time # move robot function def move_robot(pub_vel, dvx, dvy, dw): """ ...
arp95/turtlebot_astar
scripts/turtlebot_astar.py
turtlebot_astar.py
py
25,317
python
en
code
1
github-code
13
35553784025
import numpy as np import torch import torch.nn as N import torch.nn.functional as F def _get_block(name): '''Maps string names to block classes. ''' if name == 'vgg': return _Vgg raise Exception(f"Unknown block type '{name}'") class _Vgg(N.Module): '''A simple block of 3x3 convolutions. ''...
WeiwenXu21/mahoney
mahoney/unet.py
unet.py
py
4,503
python
en
code
0
github-code
13
4882377036
""" Example of how to send MANUAL_CONTROL messages to the autopilot using pymavlink. This message is able to fully replace the joystick inputs. """ import time import math # Import mavutil from pymavlink import mavutil # Create the connection master = mavutil.mavlink_connection('udpin:192.168.2.6:14550') # Wait a hea...
Legohead259/Koda-AUV
examples/Manual_Control.py
Manual_Control.py
py
1,649
python
en
code
1
github-code
13
39200910038
from __future__ import print_function from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import mimetypes import os.path import re import shutil import tempfile import logging import tuf.client.updater import tuf.conf import tuf.log import six from tuf.inte...
vladimir-v-diaz/demo
tuf/tuf/interposition/updater.py
updater.py
py
35,913
python
en
code
1
github-code
13
17088588374
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.CatalogNodeData import CatalogNodeData class AlipayOpenSearchBrandcatalogBatchqueryResponse(AlipayResponse): def __init__(self): super(AlipayOpenSearchBr...
alipay/alipay-sdk-python-all
alipay/aop/api/response/AlipayOpenSearchBrandcatalogBatchqueryResponse.py
AlipayOpenSearchBrandcatalogBatchqueryResponse.py
py
1,033
python
en
code
241
github-code
13
39709990041
from manimlib.imports import * class Equations(Scene): def construct(self): #Making equations first_eq = TextMobject("$$d = \\sqrt{ {(x_{2} - x_{1})}^2 + {(y_{2} - y_{1})}^2}$$") second_eq = ["$d$", "=", "$\\sqrt{ {(\\Delta x)}^2 + {(\\Delta y)}^2}$",] second_mob = TextMobject(*se...
advayk/Manim-CalcII-Project
trial_equations copy.py
trial_equations copy.py
py
1,253
python
en
code
0
github-code
13
31713822284
class Solution: def build_mapping(self, order): return {char: i for i, char in enumerate(order)} def compare(self, prev, current): length = len(current) for i, char in enumerate(prev): if i >= length: return 1 a = self.mapping[char] b...
gsy/leetcode
verifying_an_alian_dictionary.py
verifying_an_alian_dictionary.py
py
1,120
python
en
code
1
github-code
13
3646677119
# -*- coding: utf-8 -*- """ Created on Mon Aug 31 07:54:42 2020 @author: Peng """ #%% # Libraries and modules import pandas as pd import random import numpy as np # from model_templates_tmr import original_blstm from keras.utils import to_categorical # import sys # sys.path.insert(1,'scripts/python/tmr/') #%% #Input...
taylorroyalty/sequence_cnn
gene_function/scripts/python/tmr/tmr_model_functions.py
tmr_model_functions.py
py
10,751
python
en
code
0
github-code
13
43737307405
import numpy as np def get_reward(env, cluster, action, is_scheduled, time, debug=False): # Weights for each factor w1 = 1 w2 = 1 w3 = 1 w4 = 1 util = {} for node in cluster.nodes: cpu_ratio, mem_ratio = node.get_node_rsrc_ratio() util[node.node_name] = { "...
seonwookim92/KubeEnv
kube_rl_scheduler/strategies/reward/static.py
static.py
py
1,976
python
en
code
0
github-code
13
42425897341
import numpy as np name = 'GENERIC' def load(train_input_file, train_output_file, test_input_file, test_output_file): global inputsize global inputdim global outputsize train_input = np.load(train_input_file) train_output = np.load(train_output_file) test_input = np.load(test_input_file) ...
kslaughter/opal
libOPAL/datasets/GENERIC.py
GENERIC.py
py
773
python
en
code
4
github-code
13
70170844819
######################################################### # ~ ~ ~ Diversify ~ ~ ~ # # A Spotify WebAPI that ranks the diversity of # # your music library and makes recommendations # # for new music if you'd like. # # Author: Fueg...
fueg0/diversify
main.py
main.py
py
5,019
python
en
code
0
github-code
13
17114167584
import argparse import itertools import json import logging import sys from os import environ, makedirs, path from dotenv import load_dotenv from agr_literature_service.lit_processing.utils.generic_utils import split_identifier from agr_literature_service.lit_processing.utils.tmp_files_utils import init_tmp_dir loa...
alliance-genome/agr_literature_service
agr_literature_service/lit_processing/tests/generate_dqm_json_test_set.py
generate_dqm_json_test_set.py
py
6,909
python
en
code
1
github-code
13