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
2049438118
# standard library imports import os # uraeus imports from uraeus.smbd.systems import standalone_topology, configuration # getting directory of current file and specifying the directory # where data will be saved dir_name = os.path.dirname(__file__) data_dir = os.path.join(dir_name, 'data') # =======================...
khaledghobashy/uraeus_mbd
standalone_models/double_wishbone_direct_acting/symenv/sym_model.py
sym_model.py
py
10,595
python
en
code
18
github-code
90
18205610479
N, S = map(int, input().split()) A = list(map(int, input().split())) MOD = 998244353 dp = [[0] * (S + 1) for _ in range(N + 1)] dp[0][0] = 1 for i in range(N): ai = A[i] for j in range(S + 1): here = dp[i][j] # aiがTに含まれない dp[i + 1][j] += here # aiがTに含まれるが, Uに含まれない dp[i...
Aasthaengg/IBMdataset
Python_codes/p02662/s206852465.py
s206852465.py
py
559
python
en
code
0
github-code
90
21436365041
## EJERCICIO #2 ## Realizar una función que pida por pantalla un número del 1 al 10 y muestre por pantalla el número escrito en letras. from os import system def number_to_str(number=0): data = ["CERO","UNO","DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE","DIEZ"] return data[number] while True: pri...
linaresdev/cursoPY3
src/practicing/job3/ejercicio_2.py
ejercicio_2.py
py
778
python
es
code
0
github-code
90
2090802247
import rospy import matplotlib.pylab as plt import time import pickle import cv2 import numpy as np import json from roboflow import Roboflow import math import functions as rc import take_pic from sensor_msgs.msg import Image from cv_bridge import CvBridge from matplotlib.pyplot import figure class GetOrien(object):...
ChengTang62/Robothon2023
get_orien.py
get_orien.py
py
1,995
python
en
code
0
github-code
90
4940087837
from variables.Variable import Variable from binder.BoundLiteralExpression import BoundLiteralExpression class Scope: def __init__(self, parentScope=None): self.parentScope = parentScope self.variables = {} self.isGlobalScope = parentScope == None def __repr__(self): s = "{\n"...
Lutetium-Vanadium/compiler
src/variables/Scope.py
Scope.py
py
2,041
python
en
code
0
github-code
90
41153954589
s = input() def reverse_word(): global start, end, s if start != -1: if end != -1: converted_data = s[start:end + 1] s = s[:start] + converted_data[::-1] + s[end + 1:] start, end = -1, -1 closed = True start = -1 end = -1 for index, s_ in enumerate(s): if s_ == '<'...
jhLim97/practice-coding-test
백준/bj17413.py
bj17413.py
py
594
python
en
code
0
github-code
90
26311739864
# %% import boto3 import datetime import time import requests from bs4 import BeautifulSoup # %% dynamodb=boto3.resource('dynamodb', region_name = 'eu-west-2') try: table= dynamodb.create_table( TableName='Trial', KeySchema=[ { 'AttributeName': 'tim...
EmilySpencer-Kubrick/test-repo-git
webscrape.py
webscrape.py
py
1,870
python
en
code
0
github-code
90
31994055361
# This is where python gets the info for the price price = float(input('What price is the object? (Without the "$" sign) ')) # This is where python gets info about the discount percent = int(input('What percent off is your coupon? (Without the "%" sign) ')) # This is where it all happens step1 = (percent / 100) step2...
arivvid27/Discount-Price-Finder
main.py
main.py
py
448
python
en
code
0
github-code
90
8428208299
#!/usr/bin/python3 import requests, datetime, json headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'} def getListofComicsInfo(YOUR_API_KEY, headers): # get comics basic info (picture,name,date) response = request...
Jdavp/sundevtest
models/list_of_comics.py
list_of_comics.py
py
1,306
python
en
code
0
github-code
90
35654940920
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages with open("requirements.txt", "r") as fh: requirements = fh.readlines() setup( name='antivirus_service', version='2.1.1', description='This service detects virus in downloaded files by using clamd', author='h...
hpi-schul-cloud/antivirus_check_service
setup.py
setup.py
py
574
python
en
code
4
github-code
90
9275515261
# ------------------------------------------------- # Server # ------------------------------------------------- import queue import socket import threading import time host = "127.0.0.1" # Set server ip port = 55556 # Set server port server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Select Internet a...
Oslo-Metropolitan-University-OsloMet/individual-portfolio-assignment-1-piotrpajchel
server.py
server.py
py
5,920
python
en
code
0
github-code
90
71976729257
#Finished on 11/19/2018 import serial #py -m pip install pySerial import csv import time from time import strftime, localtime import sys import os usbport = 'COM3' #Check and change if replugging the Arduino sensorListFile='sensorList.dat' filename=strftime("%Y%m", localtime())+'TemperatureLogFile.csv' cur...
eptru/auduinoTemp
LogTempV1_2018.py
LogTempV1_2018.py
py
2,381
python
en
code
0
github-code
90
74219241256
#!/usr/bin/env python #coding:utf-8 # Author: --<cj> # Purpose: # Created: 2013/10/28 import sys import os import read_data #---------------------------------------------------------------------- def autoget(time): """time : 201309-12-1222 """ ltime=time.split('-') def autoread(time): #latestime...
Andy10101/pycode
mycode/data_sync.py
data_sync.py
py
770
python
en
code
0
github-code
90
43788567648
from decimal import Decimal from unittest.mock import ANY from django.contrib.auth.models import User from django.test import TestCase from rest_framework.test import APIClient from rest_framework_simplejwt.tokens import AccessToken from budget.models import Budget, Expense class ExpenseTestCase(TestCase): @cla...
PawelKirszniok/task4
task4/budget/tests/test_expense.py
test_expense.py
py
4,218
python
en
code
0
github-code
90
5043886862
def main(): _ = int(input()) f = input() r_cnt = f.count("R") ans = 0 for i, s in enumerate(f): if s == "R" and r_cnt <= i: ans += 1 print(min(ans, r_cnt)) if __name__ == "__main__": main()
valusun/Compe_Programming
AtCoder/ABC/ABC174/D.py
D.py
py
240
python
en
code
0
github-code
90
31604766786
import pytesseract from pytesseract import Output import os from PIL import Image def image_rotation(): image_dir = 'img' # Defining folder name # Iterating through each image in folder and extracting OSD information for img in os.scandir(image_dir): osd = pytesseract.image_to_osd( "...
nordiws/tesseract-processor
utils/image_rotation.py
image_rotation.py
py
675
python
en
code
0
github-code
90
514354576
""" This module parses the ticketing data in .txt format, truncates it by a time period. It provides two functions, one to write the dealt data into json files, and the other to insert the data directly into MongoDB. """ import urllib2 import datetime as dt import json from pymongo import MongoClient import pymongo H...
Indoor-Mobility-Analysis/IMA-back-end
src/ticketParser/for_ticketing_data.py
for_ticketing_data.py
py
2,450
python
en
code
0
github-code
90
6626265984
"""Functions to load demo data.""" import json import os import random import numpy as np import pandas as pd from scipy.signal import stft DEMO_PATH = os.path.join(os.path.dirname(__file__), 'data') def _load_demo(nrows=None): demo_path = os.path.join(DEMO_PATH, 'demo_timeseries.csv') df = pd.read_csv(dem...
sintel-dev/SigPro
sigpro/demo.py
demo.py
py
5,440
python
en
code
7
github-code
90
24899922962
import unittest import json from parsers.iperf_parser import IperfParser class TestIperfParser(unittest.TestCase): def setUp(self): self.res_dict = { "error": None, "result": json.dumps({ "local_ip": " 10.6.60.38 ", "server_ip": " 10.6.193.161 ", ...
lenashanchuk/test_task
tests/iperf_parser_test.py
iperf_parser_test.py
py
1,621
python
en
code
0
github-code
90
26837580987
import tensorflow as tf import numpy as np np.random.seed(1337) # for reproducibility import os # import sys # sys.path.append("../models") # sys.path.append("../base") filename = os.path.basename(__file__) from dbn import DBN # from cnn import CNN from base_func import run_sess from tensorflow.examples.tutorials.mn...
erika1203/dbnTensorflow
DBNtensorflow/eastmoney.py
eastmoney.py
py
2,212
python
en
code
1
github-code
90
41915703484
import pandas as pd class Definition: def __init__(self, term): self.term = term def get(self): df = pd.read_csv("data.csv") return tuple(df.loc[df["word"]==self.term]["definition"]) if __name__ == "__main__": term = input("Type the term you want to search for the definition") ...
singularity-cc/Instant-Dictionary-Webapp
definition.py
definition.py
py
382
python
en
code
0
github-code
90
18130034851
from django.shortcuts import render from rest_framework import generics from django.shortcuts import render from .models import SolicitudTemporal, EncuestaSolicitudTemporal, UsuarioSolicitanteTemporal, SolicitantesPreAprobados from registro_inversionista.models import Pregunta, Respuesta from django.http import HttpRes...
eduardouio/test
creceEcuador/solicitante/views.py
views.py
py
8,401
python
es
code
0
github-code
90
35728396754
from django.test import SimpleTestCase, TestCase, Client from django.urls import reverse, resolve from books.views import HomeListView, BooksReviewDetailView from books.models import BooksReview class TestBooksURLs(SimpleTestCase): def test_books_index_url(self): url = reverse('books_index') sel...
Jatzek3/Reviews
tests/test_books.py
test_books.py
py
1,482
python
en
code
0
github-code
90
25372800669
#!/usr/bin/env python """ HiveMind Node Developed by Trevor Stanhope and Evan Henry Hive sensor node based on RaspberryPi and Arduino. TODO: - Authenticate to aggregator? - Authenticate to server? - Validate data received from Arduino - Add computer vision components """ #abcdefg recently edited by evan june 9th __aut...
trevstanhope/hive-node
hive-node.py
hive-node.py
py
16,399
python
en
code
0
github-code
90
22723608046
import base64 from flask import Flask, request from flask_cors import CORS, cross_origin from keras.models import load_model from tensorflow_addons.optimizers import AdamW from transformers import AutoTokenizer, TFRobertaModel import transformers import re app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADER...
ddevin96/oh-sh-t-flask
app.py
app.py
py
3,230
python
en
code
1
github-code
90
43101460795
"""Type check Write a function named only_ints that takes two parameters. Your function should return True if both parameters are integers, and False otherwise. For example, calling only_ints(1, 2) should return True, while calling only_ints("a", 1) should return False. """ ### my solution from xmlrpc.client import bo...
SirChelington/Bunch_of_challenges
5_type_check.py
5_type_check.py
py
689
python
en
code
0
github-code
90
3457819823
import math # Usado para palabras que no existen en el vocabulario de entrenamiento UNK = None # inicio y fin de oracion inicioOracion = "<s>" finOracion = "</s>" class UnigramaModeloLenguaje: def __init__(self, oraciones, smoothing=False): self.frecuenciasUnigramas = dict() self.tamanoCorpus = 0...
lmsanchezv/spell-checker
Unigrams.py
Unigrams.py
py
2,247
python
es
code
0
github-code
90
41663228082
import warnings from KFT.job_utils import run_job_func # devices = GPUtil.getAvailable(order='memory', limit=1) # device = devices[0] # PATH = ['public_data/' ,'public_movielens_data/' ,'tensor_data/' ,'CCDS_data/' ,'eletric_data/' ,'traffic_data/'] PATH = ['public_data_t_fixed/' ,'public_movielens_data_t_fixed/' ,'...
MrHuff/KernelFriedTensor
debug_run.py
debug_run.py
py
3,613
python
en
code
1
github-code
90
1681029252
# coding=utf-8 from collective.constants import Enum class Grammemes(object): class Post(Enum): """ Частини мови """ # самостійні NOUN = 0 # іменник ADJF = 1 # прикметник NUMR = 3 # числівник NPRO = 4 # займенник VERB = 2 # ді...
HaySayCheese/OpenCorporaUA
core/words/constants.py
constants.py
py
993
python
uk
code
1
github-code
90
18368764359
#d n = int(input()) a = list(map(int, input().split())) ans = [0]*len(a) for i in range(len(a),0,-1): if sum(ans[i-1::i])%2 != a[i-1]: ans[i-1] = 1 print(sum(ans)) if sum(ans) > 0: ans_n = [str(i+1) for i, x in enumerate(ans) if x==1] ans_n=" ".join(ans_n) print(ans_n)
Aasthaengg/IBMdataset
Python_codes/p02972/s318931862.py
s318931862.py
py
294
python
en
code
0
github-code
90
18390246699
n, m = list(map(int, input().split())) MOD = pow(10, 9) + 7 dp = [0] * (n+1) dp[0] = 1 broken = [False] * (n+1) for i in range(m): broken[int(input())] = True c = 1 for i in range(1, n+1): if broken[i]: dp[i] = 0 else: if i == 1: dp[i] = dp[i-1] % MOD else: ...
Aasthaengg/IBMdataset
Python_codes/p03013/s985728229.py
s985728229.py
py
380
python
en
code
0
github-code
90
38577505030
from typing import Final import glob import pandas as pd from src.result_plotters import ResultPlotter from src.transmittance_plotter import TransmittancePlotter from src.electrical_and_thermal_power import ElectricalThermalPowerCalculator def get_df_of_temperatures_per_metric(heat_transfer_fluid_name: str, is_cooling...
GuyKeogh/pvt-characterization-lab
main.py
main.py
py
5,460
python
en
code
0
github-code
90
4966167457
n=int(input("Enter the number of terms:")) n0,n1=0,1 count=0 fib=[] if(n<=0): print("Enter a positive integer please") elif(n==1): print(n0) else: while(count<n): print(n0) fib.append(n0) nth = n0+n1 n0=n1 n1=nth count+=1 print(fib[len(fib)-1])
Nivedha-85/pythonCodes
fibonacciSeries.py
fibonacciSeries.py
py
304
python
en
code
0
github-code
90
41154003009
n = int(input()) datas = [] result = [] for i in range(n): datas.append(input()) for data in datas: score = 0 prev = '' acc = 0 for d_ in data: if d_ == 'O': prev = 'O' if prev == 'O': acc += 1 else: acc = 1 s...
jhLim97/practice-coding-test
백준/bj8958.py
bj8958.py
py
456
python
en
code
0
github-code
90
17959246829
def main(): N = int(input()) P = list(map(int, input().split(' '))) flags = [1 if i + 1 == p else 0 for i, p in enumerate(P)] seq_nums = list() n = 0 for f in flags: if f == 1: n += 1 elif n > 0: seq_nums.append(n) n = 0 if n > 0: s...
Aasthaengg/IBMdataset
Python_codes/p03612/s031455336.py
s031455336.py
py
430
python
en
code
0
github-code
90
38633144987
# This script counts vowels in a given variable 's' s = "azcbobobegghaklbob" #i = 0 #count = 0 #print(len(s)) #f = s[i] #print(f) count = 0 for x in range(len(s)): if x == len(s) - 2: break if (s[x]) == 'b' and (s[x+1]) == 'o' and (s[x+2]) == 'b': count = count + 1 print('Number of times bob occ...
sebastiaanvroom/PythonEdx
CountBobs.py
CountBobs.py
py
541
python
en
code
0
github-code
90
43115884651
#!/usr/bin/env python import os, re, sys import subprocess import oyaml as yaml from collections import OrderedDict from parse_input_files import parse_library_md WORD_SOUP_FILE = 'word_soup.txt' with open('stop_words.txt','r') as f: STOP_WORD_LIST = f.readlines() STOP_WORD_LIST = [word.strip() for word in STOP_W...
nih-cfde/use-case-library-build
scripts/attic/extract_word_soup.py
extract_word_soup.py
py
7,234
python
en
code
1
github-code
90
29129479742
class Solution: def matrixReshape(self, mat: List[List[int]], r: int, c: int) -> List[List[int]]: nums, answer = [], [] for row in mat: nums += row if len(nums) != r * c: return mat else: return [nums[i : i + c] for i in range(0, len(nums), c)] ...
kovus380/LeetCode
566-reshape-the-matrix/566-reshape-the-matrix.py
566-reshape-the-matrix.py
py
325
python
en
code
0
github-code
90
18533265929
def solve(): N = int(input()) A = [int(input()) for _ in range(N)] if N==1: if A[0]==0: return 0 return -1 if A[0]>0 or A[1]>1: return -1 ans = N - A.count(0) for i in range(1,N-1): if A[i]+1<A[i+1]: return -1 if A[i]>=A[i+1] and A[i+1]>0: ans += A[i+1]-1 return ans p...
Aasthaengg/IBMdataset
Python_codes/p03347/s212219726.py
s212219726.py
py
333
python
en
code
0
github-code
90
18016385119
n = int(input()) arr = list(map(int,input().split())) arr.sort() outs = -1 c = 0 for i in range(n-1): c += arr[i] if 2*c < arr[i+1]: outs = i if outs >= 0: print(n - 1 - outs) else: print(n)
Aasthaengg/IBMdataset
Python_codes/p03786/s844305811.py
s844305811.py
py
219
python
en
code
0
github-code
90
18377469199
from collections import deque n,m=list(map(int,input().split())) g=[[] for _ in range(10*(n+1)+3)] for _ in range(m): u,v=list(map(int,input().split())) g[10*u].append(10*v+1) g[10*u+1].append(10*v+2) g[10*u+2].append(10*v) s,t=list(map(int,input().split())) inf=10**10 q=deque([10*s]) d=[inf]*(10*(n...
Aasthaengg/IBMdataset
Python_codes/p02991/s207131960.py
s207131960.py
py
632
python
en
code
0
github-code
90
17927851839
s = input() a = 'AKIHABARA' lis = ['KIHABARA', 'AKIHBARA', 'AKIHABRA', 'AKIHABAR', 'KIHBARA', 'KIHABRA', 'KIHABAR', 'AKIHABR', 'KIHBRA','AKIHBR', 'KIHBR', 'AKIHABARA','AKIHBRA', 'AKIHBARA','KIHBAR', 'KIHABR'] if s not in lis: print('NO') else: print('YES')
Aasthaengg/IBMdataset
Python_codes/p03523/s112306248.py
s112306248.py
py
268
python
en
code
0
github-code
90
20913221750
""" Implementation of the breadth first search (BFS) algorithm. """ import queue import torch from sevnet.utils import check_graph_input def breadth_first_search(graph, source=0): """ Perform breadth first search of the given graph `graph` starting from the node `source`. Parameters ----------...
nec-research/tf-imle
WARCRAFT/sevnet/search/breadth_first.py
breadth_first.py
py
1,659
python
en
code
69
github-code
90
24447602067
## https://old.reddit.com/r/dailyprogrammer/comments/5e4mde/20161121_challenge_293_easy_defusing_the_bomb/ wires = { "white": "purple red green orange", "black": "black purple red", "purple": "black red", "red": "green", "green": "orange white", "orange": "red black" } def defuse(cuts): fo...
oh2468/daily-programmer
challenges/293_DefusingTheBomb.py
293_DefusingTheBomb.py
py
627
python
en
code
0
github-code
90
70809125418
class Vertice: def __init__(self): self.edges = set() self.searched = False def main(): n, G = [int(x) for x in input().split()] relationships = dict() relationships['Rerisson'] = Vertice() for _ in range(n): S, T = input().split() person = relationships.get(S, No...
Dsbaule/INE5452
Simulado 07/03 - Rerisson and The Barbecue.py
03 - Rerisson and The Barbecue.py
py
1,393
python
en
code
0
github-code
90
33559678477
import requests from bs4 import BeautifulSoup import pprint # meta_tags = soup.find("meta", attrs={'property': "author"}) def scrape_page_metadata(url): headers = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Access-Control-Allow-Headers': 'Content-Type', ...
mcshakes/cleaning_service
only_facts/scraper.py
scraper.py
py
1,374
python
en
code
0
github-code
90
20368989021
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def rotateRight(self, head: Optional[ListNode], k: int) -> Optional[ListNode]: # At this point we don't know the size of the LL. So we will t...
RishabhSinha07/Competitive_Problems_Daily
61-rotate-list/61-rotate-list.py
61-rotate-list.py
py
1,676
python
en
code
1
github-code
90
74363967337
nomeDoArquivo = input('nome do arquivo: ') def validarSalvar(input): if input == 'SALVAR': return True def abrirArquivo(): global file file = open(nomeDoArquivo, 'w') def escrever(): global entrada entrada = input('escreva seu texto: ') if entrada == 'SALVAR': ...
lhckb/college
1/FP2021.2/python/aula12-1.py
aula12-1.py
py
591
python
pt
code
0
github-code
90
71170365737
""" Pokročilí: 1. Vaším úkolem je zjistit, jak na tom jste. 2. Chceme co nejdřív všechno zopakovat, abychom se pak mohli naučit funkce a následně začít pracovat na nějaké hře. 3. Je potřeba si zopakovat: 4. všechno 5. print a input 6. proměnné 7. operátory 7. podmínky 7. cykly 8. seznamy V TOMTO S...
Magmi183/programko
Archiv/2022_Zima/zari-16_hodina-1/ulohy_k_opakovani.py
ulohy_k_opakovani.py
py
3,646
python
cs
code
0
github-code
90
18575361653
import os from torch.utils.data import DataLoader from argparse import Namespace from typing import Optional from tpp.processes.multi_class_dataset import MultiClassDataset as Dataset def get_loader( dataset: Dataset, args: Namespace, shuffle: Optional[bool] = True) -> DataLoader: return...
babylonhealth/neuralTPPs
tpp/utils/data.py
data.py
py
1,153
python
en
code
24
github-code
90
70170293736
from ping3 import ping def ping_host(host): try: response_time = ping(host) if response_time is not None: return {"host": host, "response_time": response_time} else: return {"host": host, "response_time": float("inf")} except Exception as e: r...
margokdtb/ping2
a.py
a.py
py
1,003
python
en
code
0
github-code
90
30850641428
import streamlit as st import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans st.header("Mall_Customers K-means clustering") st.write("By Shuraikh 'Ezzuddin") df = pd.read_csv('https://raw.github...
shuraikhhh/airasiatalent
MLMall_Customers.py
MLMall_Customers.py
py
5,930
python
en
code
0
github-code
90
7259752920
# coding: utf-8 # In[1]: #测试脚本 import json import time import requests from lxml import etree url = "https://blog.csdn.net/m0_57011777/article/details/125365301" header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/...
luxuemeng/home_lab
爬虫.py
爬虫.py
py
15,479
python
en
code
0
github-code
90
18490185579
N = int(input()) def checkDigit(n): a = n % 10 n = (n-a)//10 b = n % 10 c = (n-b)//10 if a == b and b == c: return True else: return False for i in range(1000): if checkDigit(N): print(N) break N += 1
Aasthaengg/IBMdataset
Python_codes/p03243/s787807307.py
s787807307.py
py
234
python
en
code
0
github-code
90
18443664719
n = int(input()) a = list(map(int, input().split())) m = 0 tmp = min(a) while m != tmp: m = tmp for i in range(n): if a[i] != m: a[i] = a[i] % m if a[i] < m and a[i] != 0: tmp = a[i] print(m)
Aasthaengg/IBMdataset
Python_codes/p03127/s195906054.py
s195906054.py
py
241
python
en
code
0
github-code
90
24826711762
from pathlib import Path import numpy as np import pickle as pk from itertools import chain, product from collections import OrderedDict from structure import Struct MONKEYS = ['M', 'N'] REGIONS = ['OFC', 'ACC'] TASKVARS = ['value', 'type'] SUBSPACES = [True, False] EVT_WINS = OrderedDict((('cues ON', (-500, 1500)), ...
p-enel/stable-and-dynamic-value
generate_population_dataset.py
generate_population_dataset.py
py
11,162
python
en
code
2
github-code
90
17113007716
print("Welcome to the world of cryptography") def main(): print() print("Choose one option") choice = int(input("1. Encryption\n2. Decryption\nChoose(1,2): ")) if choice == 1: encryption() elif choice == 2: decryption() else: print("Wrong Choice") def e...
Harshit-Panigrahi/Cryptography
encrypter.py
encrypter.py
py
1,064
python
en
code
0
github-code
90
2607812102
# coding: utf-8 # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns get_ipython().run_line_magic('matplotlib', 'inline') # In[2]: train = pd.read_csv('desktop/ML/train.csv') test = pd.read_csv('desktop/ML/test.csv') # In[3]: train.head() # In[4]: train.s...
KarishmaDudekula/Titanic-machine-learning-from-disaster
titanic.py
titanic.py
py
2,736
python
en
code
0
github-code
90
14787327947
import json import requests import telebot import schedule import time import threading # Set the API_TOKEN in the docker_compose.yml or paste it in the comment below and uncomment the line # API_TOKEN = "000000000" bot = telebot.TeleBot(API_TOKEN) # Welcome Message from Bot or triggered with /start command @bot.mess...
MrWhiteHD/check-celo-balance-telegram-bot
celo_balane_bot.py
celo_balane_bot.py
py
5,874
python
en
code
1
github-code
90
14699972733
# oneDayTrip.py # # Find all instances of baseball teams that played a one-day road trip, # defined as any 3-day period where a team played # at least one home game on day 1, # at least one road game on day 2, # and at least one home game on day 3. # # Input: Download the Game Logs from www.retrosheet.or...
mikemav/Retrosheet
oneDayTrip.py
oneDayTrip.py
py
2,063
python
en
code
0
github-code
90
22824168322
import requests from django.conf import settings def apply_exchange(base_currency): api_key = settings.FIXED_ACESS_KEY_CURRENCY_CHANGE url = f"https://freecurrencyapi.net/api/v2/latest?apikey={api_key}&base_currency={base_currency}" r = requests.get(url) result = r.json() return result['data']
pabdelhay/paloptl
common/students/angola_estima.py
angola_estima.py
py
317
python
en
code
0
github-code
90
34385591947
# coding=utf-8 import numpy as np import struct import os import time import threading def show_matrix(mat, name): #print(name + str(mat.shape) + ' mean %f, std %f' % (mat.mean(), mat.std())) pass def show_time(time, name): #print(name + str(time)) pass class ConvolutionalLayer(object): def __in...
ysj1173886760/Learning
ai-system/exp_3_1_vgg/stu_upload/layers_2.py
layers_2.py
py
5,562
python
en
code
155
github-code
90
17963558899
from collections import Counter n = int(input()) A = list(map(int, input().split())) counter = Counter(A) work = [] temp = [] for k, v in sorted(counter.items(), key=lambda x:x[0], reverse=True): if v >= 4: temp.append(k) if v >= 2: work.append(k) if len(work)==2: break if...
Aasthaengg/IBMdataset
Python_codes/p03625/s398971945.py
s398971945.py
py
576
python
en
code
0
github-code
90
72479458538
# coding=utf-8 import os from models import Employee from bs4 import BeautifulSoup from config import Config from mparser import ProfileParser # @brief: 函数将过滤结果转化为Employee数据 # @tag: 输入为待处理的BeautifulSoup的tag对象 # @output:输出employee def handler(tag): employee = Employee() ass = tag.find_all('a',class_="orangea")...
yixiaoyang/pyScripts
eduPaser/out/pku/环境与能源学院/MyHandler.py
MyHandler.py
py
773
python
en
code
8
github-code
90
71573575338
import rospy # Importamos el módulo rospy para interactuar con ROS from geometry_msgs.msg import Twist # Importamos el mensaje Twist para el control de movimiento from grsim_ros_bridge_msgs.msg import SSL # Importamos el mensaje SSL para la comunicación con grSim from krssg_ssl_msgs.msg import SSL_DetectionFrame, SS...
janddres/proy-grsim-robocup
backup.py
backup.py
py
8,822
python
es
code
0
github-code
90
1859236218
import cv2 import dlib import time t1,t2=0,0 l=0 flag=0 idp = 0 data =[] face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') cap = cv2.VideoCapture(0) while True: _, img = cap.read() if not _: print("Can't receive frame (stream end?). Exiting ...") break gray =...
anjana-kt/face-detector
face.py
face.py
py
1,119
python
en
code
0
github-code
90
18800840152
from torch.utils.data import Dataset, DataLoader import torch import numpy as np import os import random import trimesh import csv from util.pc_utils import rotate_point_cloud_by_axis_angle, sample_point_cloud_by_n SPLIT_CSV_PATH = "data/shapenet-official-split.csv" def get_dataloader_3depn(phase, config): is_s...
ChrisWu1997/Multimodal-Shape-Completion
dataset/dataset_3depn.py
dataset_3depn.py
py
7,015
python
en
code
93
github-code
90
28149733480
import aiohttp from livekit.protocol import egress as proto_egress from ._service import Service from .access_token import VideoGrants SVC = "Egress" class EgressService(Service): def __init__( self, session: aiohttp.ClientSession, url: str, api_key: str, api_secret: str ): super().__init__(s...
livekit/python-sdks
livekit-api/livekit/api/egress_service.py
egress_service.py
py
3,469
python
en
code
19
github-code
90
18591146659
N = int(input()) A = tuple(map(int, input().split())) M, m = max(A), min(A) print(2 * N - 2) if abs(M) >= abs(m): ind = A.index(M) for x in set(range(N)) - {ind}: print(ind + 1, x + 1) for x in range(1, N): print(x, x + 1) else: ind = A.index(m) for x in set(range(N)) - {ind}: ...
Aasthaengg/IBMdataset
Python_codes/p03496/s922603715.py
s922603715.py
py
404
python
en
code
0
github-code
90
9955829623
from login_page import * import tkinter as tk from tkinter import ttk from tkinter import filedialog from PIL import Image, ImageTk import customtkinter as ctk import tkinter.messagebox as tkmb import time import check_login as cl import re from subjects import * import pytesseract from selenium import webd...
rootphrls/StudyGoProject
main.py
main.py
py
5,494
python
en
code
0
github-code
90
36126436206
import os from unittest import TestCase import xlrd from ..utils import spreadsheet2array class UtilsTestCase(TestCase): def test_spreadsheet2array(self): """ it should convert a spreadsheet table to an array """ dirname = os.path.dirname(os.path.realpath(__file__)) xlsx_path = os.path...
MTES-MCT/trackdechets-datascience
trackdechets/tests/test_utils.py
test_utils.py
py
724
python
en
code
0
github-code
90
37027801411
import os from csv import writer import nltk import itertools import re paths = '/media/chris/Elements/test' def consolidate(path): s_path = path Files = os.listdir(s_path) byteFiles = [i for i in Files if '.asm' in i] consolidatedFile = s_path + '_2gramoperation.csv' operationlist = ['mov', 'push...
Chris19920210/Microsoft_malware
2gram_operation.py
2gram_operation.py
py
1,468
python
en
code
1
github-code
90
33671240927
class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: length = len(nums) if length < 3: return [] nums.sort() res = [] for i in range(0,length - 2): if i > 0 and nums[i] == nums[i-1]: continue left = i +...
algorithm003/algorithm
Week_01/id_17/Leetcode_15_17.py
Leetcode_15_17.py
py
1,096
python
en
code
17
github-code
90
24552377567
import pyximport pyximport.install() from stackobjs import StackObjects found_objects = [1, 2, 3, 4, 5] dwoccupmap_dict = { 1: [0, 1, 1, 0, 0, 1], 2: [0, 0, 0, 0, 0, 1], 3: [1, 1, 1, 1, 1, 1], 4: [0, 1, 0, 0, 0, 0], 5: [2, 2, 2, 2, 2, 2], } alloctable = {} StackObjects(found_objects, dwoccupmap_d...
phu54321/eudplib
cython_src/stkobj_test.py
stkobj_test.py
py
631
python
en
code
13
github-code
90
11971255719
import sys if(len(sys.argv) != 2): print("Required input args: inputfile.txt") exit(0) inputfile = str(sys.argv[1]) #file = open(outputfile,"w") with open(inputfile,'r') as f: data = f.readlines() with open(inputfile,'w') as file: for i in range(0,len(data)): file.write(data[i].lstrip())
akselsv/CudaICP
CudaICP/removeSpaces.py
removeSpaces.py
py
298
python
en
code
7
github-code
90
18396904449
N, M = list(map(int,input().split())) K_and_Ss = [] for i in range(M): data = list(map(int,input().split())) K_and_Ss.append(data) Ps = list(map(int,input().split())) flag = False x = 2**N sum = 0 for i in range(x): for j in range(M): #j番目の電球がついているかを判定 count = 0 if flag: flag = ...
Aasthaengg/IBMdataset
Python_codes/p03031/s240497305.py
s240497305.py
py
761
python
en
code
0
github-code
90
39602074759
def get_reversal_indexes(my_list, current_position, length): max_index = len(my_list) - 1 last_index = current_position + length indexes = [] for index in range(current_position, last_index): if index > max_index: indexes.append(index % len(my_list)) else: indexe...
konstantinosBlatsoukasRepo/advent-of-code-2017
day_10_knot_hash/day_10.py
day_10.py
py
1,618
python
en
code
0
github-code
90
35132790559
import json from player.biz.client_player import auth_token from system.cache.channel_name import set_channel_name, get_player_token, del_channel_name from channels.generic.websocket import AsyncWebsocketConsumer from notice.enums.connection_code import ConnectionCode from notice.api_router import router import l...
ydtg1993/shaibao-server-python
notice/consumers.py
consumers.py
py
3,512
python
en
code
0
github-code
90
44995834269
#CodeName: coreGUI.py #Author: Dahir Muhammad Dahir #Date: 05th-May-2018 #About: codes from the GUI chapter in core python text[Wesely Chan] from Tkinter import * def main(): #tkhello() #buttonWidget() #buttonWithLabel() combined() def tkhello(): top = Tk() label = Label(top, text="Hello, GUI World...") labe...
Ethic41/codes
python/GUI_Tk/coreGUI/coreGUI.py
coreGUI.py
py
1,166
python
en
code
1
github-code
90
13357052181
from Playlist import Playlist import tkinter.constants as TkC from tkinter import Frame, PhotoImage from pimenu import FlatButton from math import floor, sqrt, ceil import vlc class MusicView(Frame): """ Easily configure a tkinter Frame for the Music app """ playlist = Playlist("playlist/") vo...
sebastiengrd/pi-menu-E23
MusicView.py
MusicView.py
py
6,583
python
en
code
0
github-code
90
17977315559
# https://atcoder.jp/contests/abc067/tasks/arc078_a n = int(input()) nums = [int(i) for i in input().split()] for i in range(n - 1): nums[i + 1] += nums[i] ans = float('inf') for i in range(n - 1): x = nums[i] y = nums[-1] - nums[i] ans = min(ans, abs(x - y)) print(ans)
Aasthaengg/IBMdataset
Python_codes/p03659/s440539210.py
s440539210.py
py
290
python
en
code
0
github-code
90
40166471731
''' Build a Query to Determine the Percentage of Population by Gender and State In this exercise, you will write a query to determine the percentage of the population in 2000 that comprised of women. You will group this query by state. INSTRUCTIONS 0XP INSTRUCTIONS 0XP Import case, cast and Float from sqlalchemy. Def...
kvmakk/Data-Science-Python
13-introduction-to-databases-in-python/05-putting-it-all-together/06-build-a-query-to-determine-the-percentage-of-population-by-gender-and-state.py
06-build-a-query-to-determine-the-percentage-of-population-by-gender-and-state.py
py
1,551
python
en
code
6
github-code
90
35188193713
""" Este codigo pretende construir la famosa sucesion de Fibonacci. Donde F(n) = F(n-1) + F(n-2) Ademas F(0) = 1 y F(1) = 1 1; 1; 2; 3, 5; 8; 13; 21; 34; 55; 89 """ # Para que la funcion no use tantos recursos definimos un diccionario fibo_dict = dict() #Construimos un diccionario vacio para guardar los valores de la s...
miguelvega0098/Practicas_python
serieFibonachi.py
serieFibonachi.py
py
1,076
python
es
code
0
github-code
90
30957434347
#!/bin/env python3 # -*- coding: utf-8 -*- import gevent from gevent import monkey import random import requests from bs4 import BeautifulSoup monkey.patch_all() urls = [] with open('urls.txt', 'r') as f: for url in f: urls.append(url.strip()) def parser_title(page): soup = BeautifulSoup(page, 'lx...
sincerefly/Learning
py/dragspeed_compare/use-gevent.py
use-gevent.py
py
606
python
en
code
22
github-code
90
38057710797
import socket import IPython import datetime import logging import random import threading import struct import time import sys import os # logging formatter="%(asctime)s %(levelname)-12s %(message)s" # to file log_filename="log_"+datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d.%H.%M.%S....
solvery/lang-features
python/case/case.dkm_api_sender_tcp_1/dkm_api_sender_tcp_interact.py
dkm_api_sender_tcp_interact.py
py
2,422
python
en
code
0
github-code
90
72909120936
from typing import Any, Callable def getVar(tokens: list[tuple[str, str]], idx: int) -> tuple[dict[str, Any], int]: assert tokens[idx][0] == "IDENTIFIER", "" tree: dict[str, Any] = {} tree["Category"] = "Object" tree["ObjectType"] = "Var" tree["Name"] = tokens[idx][1] return (tree, idx + 1) ...
LHS11110/PythonCompiler
Modules/Parser/Object.py
Object.py
py
761
python
en
code
0
github-code
90
15801769905
# -*- coding: utf-8 -*- """ 1433. Check If a String Can Break Another String Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa. In other words s2 can break s1 or vice-versa. A string x can break string y (both of size n) if x[...
tjyiiuan/LeetCode
solutions/python3/problem1433.py
problem1433.py
py
960
python
en
code
0
github-code
90
42871409455
import pandas as pd # Чтение данных из таблицы в формате CSV data = pd.read_excel('IT words.xlsx') # Открытие файла для записи with open('IT_words.txt', 'w', encoding='utf-8', errors='ignore') as file: # Запись данных в TXT файл for _, row in data.iterrows(): word = row['Слово'] transcription ...
NikitaZemtsov/scripts
python.py
python.py
py
739
python
ru
code
0
github-code
90
36127584836
"""Add parameter to enable/disable support activity Revision ID: e9e9adb7e801 Revises: b05231a3afda Create Date: 2021-06-13 20:52:31.981823 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "e9e9adb7e801" down_revision = "b05231a3afda" branch_labels = None depend...
MTES-MCT/mobilic-api
migrations/versions/e9e9adb7e801_add_parameter_to_enable_disable_support_.py
e9e9adb7e801_add_parameter_to_enable_disable_support_.py
py
894
python
en
code
1
github-code
90
27310084871
import gold.gsuite.GSuiteConstants as GSuiteConstants from proto.hyperbrowser.HtmlCore import HtmlCore from proto.tools.GeneralGuiTool import BoxGroup from quick.webtools.GeneralGuiTool import GeneralGuiTool ''' Preprocess: Yes Specify genome build for GSuite file: other... (genome is required but not previously speci...
uio-bmi/track_rand
lib/hb/quick/webtools/mixin/GenomeMixin.py
GenomeMixin.py
py
13,177
python
en
code
1
github-code
90
36578676164
#!/usr/bin/env nix-shell #!nix-shell -i python3 -p python3 python3Packages.pwntools from pwn import * context.update(arch='amd64', os='linux')#, terminal="/run/current-system/sw/bin/uxterm") shellcode = b"\x6a\x42\x58\xfe\xc4\x48\x99\x52\x48\xbf\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x57\x54\x5e\x49\x89\xd0\x49\x89\xd2\x0f...
berbiche/unitedctf2020
pwn/le_lac.py
le_lac.py
py
637
python
en
code
0
github-code
90
36355726271
person1 = { 'first_name': 'Kirk', 'last_name': 'Tolliver', 'age': '31', 'city': 'Chicago', } person2 = { 'first_name': 'Greg', 'last_name': 'Migos', 'age': '76', 'city': 'Mississippi', } person3 = { 'first_name': 'David', 'last_name': 'Banner', 'age': '45', 'city': 'Lous...
makeTaller/Crash_Course_Excercises
person_dict.py
person_dict.py
py
568
python
en
code
0
github-code
90
44298446388
from django.urls import reverse from django.db import models from user.models import UserRegister # Create your models here. class new_messages(models.Model): NEW_KINDS = ( ('A','新闻'), ('B','政策'), ('C','行情'), ('D','技术'), ('E','快讯') ) new_title = models.CharField(max...
SQQS123/DjangoProj_One
SmallWebsite/message/models.py
models.py
py
1,215
python
en
code
0
github-code
90
12849502908
import os from flask import Flask, jsonify, request from math import sqrt app = Flask(__name__) @app.route('/') def nao_entre_em_panico(): teste = 'Só sai texto nessa porra !' return teste if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
felipe1793/herokusolo
teste.py
teste.py
py
319
python
en
code
0
github-code
90
4239098048
# # @lc app=leetcode id=25 lang=python3 # # [25] Reverse Nodes in k-Group # # @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 reverseKGroup(self, head: Optional[ListNode], k: in...
wangyerdfz/python_lc
25.reverse-nodes-in-k-group.py
25.reverse-nodes-in-k-group.py
py
1,025
python
en
code
0
github-code
90
37045821719
import boto3 from botocore.exceptions import ClientError import sys import hashlib import re import mimetypes from loguru import logger from pathlib import Path class S3_DevOps_Utils: __client = None def __init__(self, session): self.__client = session.client('s3') @property def clien...
ruanmaia/python-devopsctl
devops/aws/s3.py
s3.py
py
6,153
python
en
code
0
github-code
90
24645712501
"""prisma_tools.cli""" import typer from prisma_tools import diff, migrate, utils from prisma_tools.PrismaSASECloudManaged_Python.access import prismaAccess app = typer.Typer( name="ptools", help="ptools: Prisma Access Tools", ) typer_tsg_id = typer.Option( "", "-tsg", "--tsg-id", help="TSG ID (12345678...
glspi/prisma_tools
prisma_tools/cli.py
cli.py
py
3,078
python
en
code
0
github-code
90
18428608789
N = int(input()) dp = [[0]*64 for i in range(N-2)] # 3進数で管理 mod = 10**9+7 d = dict() d2 = dict() d2[0] = 'A' d2[1] = 'G' d2[2] = 'C' d2[3] = 'T' for i in range(64): k = i ret = '' for j in range(3): ret += d2[k % 4] k //= 4 d[i] = ret for i in range(64): if d[i] == 'AGC' or d[i] =...
Aasthaengg/IBMdataset
Python_codes/p03088/s550393525.py
s550393525.py
py
874
python
en
code
0
github-code
90
21999543355
from model.smart_Device import SmartDevice, Thermostat, SmartVacuum, SmartFridge, LightBulb, GarageDoor, Home from flask import Flask, render_template, request, jsonify import json app = Flask(__name__) home = Home("204 Pitt St.") # array to store devices using JSON serializaiton devices = [] global numDevices ...
praneelm89/INFSCI-0201
Final Project/FlaskApp/env/app.py
app.py
py
8,065
python
en
code
0
github-code
90
27818233860
from prompt_toolkit.lexers import Lexer from prompt_toolkit.styles.named_colors import NAMED_COLORS from prompt_toolkit.completion import Completion, WordCompleter, ThreadedCompleter from prompt_toolkit import prompt from prompt_toolkit.history import FileHistory import dag from dag.util import prompter from...
dgilroy/dag
src/dag/dagcli/pt/dag_base_prompter.py
dag_base_prompter.py
py
1,657
python
en
code
0
github-code
90