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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
8833474558 | ########################################################
# Rodrigo Leite - drigols #
# Last update: 17/12/2021 #
########################################################
import pandas as pd
from matplotlib import pyplot as plt
df = pd.DataFrame(
{
... | drigols/studies | modules/math-codes/modules/statistics-and-probability/src/outliers-v2.py | outliers-v2.py | py | 804 | python | en | code | 0 | github-code | 6 |
21437122618 | import kivy
from kivy.app import App
from kivy.uix.label import Label
# 2
from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from kivymd.uix.screen import Screen
kivy.require('2.1.0')
class MyFirstApp(App):
def build(self):
# lbl = Label(text='Hello World')
# lbl = Label(text='Hel... | gonzales54/python_script | kivy/kivy1(text)/main1.py | main1.py | py | 2,528 | python | ja | code | 0 | github-code | 6 |
5609431554 | import gym
class SparseRewardWrapper(gym.Wrapper):
def __init__(self, env, sparse_level=-1, timestep_limit=-1):
super(SparseRewardWrapper, self).__init__(env)
self.sparse_level = sparse_level
self.timestep_limit = timestep_limit
self.acc_reward = 0
self.acc_t = 0
def st... | pfnet-research/piekd | sparse_wrapper.py | sparse_wrapper.py | py | 1,118 | python | en | code | 6 | github-code | 6 |
36154798504 | import streamlit as st
st.set_option('deprecation.showPyplotGlobalUse', False)
# for manipulation
import pandas as pd
import numpy as np
# for data visualization
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="ticks")
plt.style.use("dark_background")
#sns.set_style('whitegrid')
# t... | Jkauser/Agricultural-Production-Optimization-Engine | app.py | app.py | py | 10,888 | python | en | code | 0 | github-code | 6 |
8380997732 | import os
from flask import Flask, jsonify, request
from math import sqrt
app = Flask(__name__)
@app.route('/')
def nao_entre_em_panico():
nmax = 50
n1 = 0
n2 = 1
cont = 0
fib = 0
res = "Essa é sequencia dos 50 primeiros números da razão de Fibonacci: <br> Desenvolvido por Jefferson Alves. ... | jeffersonpedroza/Docker | fibonacci.py | fibonacci.py | py | 606 | python | pt | code | 0 | github-code | 6 |
36837090213 | import streamlit as st
from streamlit_option_menu import option_menu
import math
import datetime
from datetime import date
import calendar
from PIL import Image
from title_1 import *
from img import *
with open('final.css') as f:
st.markdown(f"<style>{f.read()}</style>",unsafe_allow_html=True)
def av... | Deepsphere-AI/AI-lab-Schools | Grade 08/Application/find_avg.py | find_avg.py | py | 1,787 | python | en | code | 0 | github-code | 6 |
19686018633 | #Caesar Cipher Technique
print ("\nCaesar Cipher Technique")
def encrypt(text,s):
result = ("")
for i in range(len(text)):
char = text[i]
if (char.isupper()):
result += chr((ord(char) + Shift - 65) % 26 + 65)
... | hsenhgiv/i | Practical 1.1 Caesar Cipher Technique.py | Practical 1.1 Caesar Cipher Technique.py | py | 1,256 | python | en | code | 0 | github-code | 6 |
35021100800 | from .base import BaseEnvironment
import os
import subprocess
class K3dEnvironment(BaseEnvironment):
name = "k3d"
def load_images(self, images):
loaded = []
for img, is_latest in images:
md = open(img+".txt")
image_id = md.readline().strip()
image_repo_tag ... | mvvitorsilvati/mysql-operator | tests/utils/ote/k3d.py | k3d.py | py | 1,357 | python | en | code | null | github-code | 6 |
2061469568 | from sklearn.preprocessing import StandardScaler
from sklearn import svm
class OneClassSVM:
def __init__(self, scaling=True):
self._scaling = scaling
def fit(self, X):
if self._scaling:
self._scaler = StandardScaler()
X = self._scaler.fit_transform(X)
X = X[:... | rom1mouret/cheatmeal | benchmarks/baselines/one_class_svm.py | one_class_svm.py | py | 559 | python | en | code | 2 | github-code | 6 |
41014218939 | #coding=utf-8
import numpy as np
import pyten
from scipy import stats
from pyten.method.PoissonAirCP import PoissonAirCP
from pyten.method import AirCP
from pyten.tools import tenerror
from pyten.method import cp_als
from pyten.method import falrtc,TNCP
import matplotlib.pyplot as plt
#参数设置
missList = [0.7]
duplicat... | yangjichen/ExpCP | realdata/GDELT_step3.py | GDELT_step3.py | py | 7,907 | python | en | code | 0 | github-code | 6 |
38026626999 | from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from Utils import Calendar
class App:
def __init__(self):
self.root = Tk()
self.root.title("Calendar App")
self.root.geometry("600x500")
self.root.resizable(False,False)
self.today = Calendar.getTod... | Paras-Punjabi/Calendar-App-in-Python | Calendar.py | Calendar.py | py | 6,488 | python | en | code | 0 | github-code | 6 |
25849292828 | # imports
import socket
import json
def extractData(ledger):
ledger = ledger['ledger']
title = ledger['title']
date = ledger['date']
people = [person['name'] for person in ledger['people']]
people = ', '.join(people)
summary = ledger['summary']
items = ledger['transactions']
htmlTable =... | alexcw08/email-microservice | server.py | server.py | py | 2,524 | python | en | code | 0 | github-code | 6 |
15751603227 | from elasticsearch import Elasticsearch, exceptions
import json, time
import itertools
from project import config
class SelectionAnalytics():
'''
SelectionAnalytics class
data analytics - elasticsearch
'''
# declare globals for the Elasticsearch client host
DOMAIN = config.DOMAIN
LO... | flabastie/news-analysis | project/queries/selection.py | selection.py | py | 11,437 | python | en | code | 0 | github-code | 6 |
22088681014 |
from helpers import setup_logger
menu_name = "Hardware test"
from threading import Event, Thread
from traceback import format_exc
from subprocess import call
from time import sleep
import sys
import os
from ui import Menu, Printer, PrettyPrinter, GraphicsPrinter
from helpers import ExitHelper, local_path_gen
logg... | LouisPi/piportablerecorder | apps/test_hardware/main.py | main.py | py | 4,539 | python | en | code | 1 | github-code | 6 |
37379251526 | import os
import glob
import numpy as np
import time
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from configs import *
def merge_shp(shp_list, save_dir):
"""merge shapefiles in shp_list to a single shapefile in save_dir
Args:
shp_list (list): _description_
save_dir (str)... | faye0078/RS-ImgShp2Dataset | make_dataset/shp_functions.py | shp_functions.py | py | 8,144 | python | en | code | 1 | github-code | 6 |
10434320461 | """
.. moduleauthor:: Martí Congost <marti.congost@whads.com>
"""
from woost.models import ExtensionAssets, Page, CustomBlock
def install():
"""Creates the assets required by the googlesearch extension."""
assets = ExtensionAssets("googlesearch")
assets.require(
Page,
"results_page",
... | marticongost/woost.extensions.googlesearch | woost/extensions/googlesearch/installation.py | installation.py | py | 574 | python | en | code | 0 | github-code | 6 |
21334940324 | import logging
import re
import urlparse
find_href = re.compile(r'\bhref\s*=\s*(?!.*mailto:)(?!.*mailto:)("[^"]*"|\'[^\']*\'|[^"\'<>=\s]+)')
# FYI: added a workaround to not to break inline akavita counter script
find_src = re.compile(r'\bsrc\s*=\s*("[^"\']*"|\'[^"\']*\'|[^"\'<>=\s;]{... | stachern/bseu_fm | hooks/subdir.py | subdir.py | py | 1,410 | python | en | code | 0 | github-code | 6 |
20543259826 | """
TIC TAC TOE
"""
#variables
board = ["*", "*", "*",
"*", "*", "*",
"*", "*", "*"]
player = "X" #first player is always X
winner = None
game_running = True
print("\033[95m-- TIC TAC TOE --\033[m\n")
#creating the board game
def print_board(board):
print("-" *10)
print(board[0] + " | " + boar... | rlorimier/tictactoe | tictactoe.py | tictactoe.py | py | 2,603 | python | en | code | 0 | github-code | 6 |
42496516652 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def append(self, data):
new_node = Node(data)
if self.head is None:
self.head = new_node
return
last_node... | kedarjk44/basic_python | linkedlist_insertion.py | linkedlist_insertion.py | py | 1,379 | python | en | code | 0 | github-code | 6 |
70780596348 | from flask import Flask, render_template, request
from modelo import modelagemPredicao
from data import gerarNovosDados
app = Flask(__name__, template_folder='templates', static_folder='static')
@app.route('/', methods=['GET', 'POST'])
def index():
# variáveis auxiliares
partidas = 0
precisaomedalha = 0
... | stardotwav/Dota2Predictor | web service/app.py | app.py | py | 2,788 | python | pt | code | 2 | github-code | 6 |
70110821308 | from copy import deepcopy
CHECK_DIRECTION = [
(-1, -1),
(-1, 0),
(-1, 1),
(0, -1),
(0, 1),
(1, -1),
(1, 0),
(1, 1)
]
DEBUG = False
def load_data(filename):
with open(filename, 'r') as f:
data = [[int(i) for i in line.strip()] for line in f.readlines()]
return data
def... | eVen-gits/advent_of_code_2021 | day_11/code.py | code.py | py | 2,004 | python | en | code | 1 | github-code | 6 |
10420612333 | from __future__ import annotations
from typing import TYPE_CHECKING
from randovania.exporter.hints import guaranteed_item_hint
from randovania.exporter.hints.hint_exporter import HintExporter
from randovania.exporter.hints.joke_hints import JOKE_HINTS
from randovania.game_description.db.hint_node import HintNode
from... | randovania/randovania | randovania/games/prime2/exporter/hints.py | hints.py | py | 4,216 | python | en | code | 165 | github-code | 6 |
32653169006 | from flask import Flask, send_file, send_from_directory, safe_join, abort
app = Flask(__name__)
# app.config["CLIENT_IMAGES"] = "/home/mahima/console/static/client/img"
app.config["CLIENT_IMAGES"] = "/home/lenovo/SEproject/OpsConsole/api/static"
# The absolute path of the directory containing CSV files for users to... | trishu99/Platypus | api/static/fileserver.py | fileserver.py | py | 882 | python | en | code | 0 | github-code | 6 |
41123532534 | from tkinter import *
import random
def resetSuggestion():
global currentSuspect
global currentWeapon
global currentLocation
global xChar, yChar
global count #NEW
xChar = 200
yChar = 400
count = 0
currentSuspect = "White"
currentWeapon = "Dagger"
currentLocation... | xantin/code-examples | python/Project - Haya_py/cluedo.py | cluedo.py | py | 7,073 | python | en | code | 0 | github-code | 6 |
16164892137 | from flask import Flask, request, jsonify, abort, Response, redirect
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
from os import environ
import sys
import os
import asyncio
import requests
from invokes import invoke_http
import pika
import amqp_setup
import json
from datetime import datetime
... | ESDeezknee/ESDeezknee | order/order.py | order.py | py | 9,606 | python | en | code | 1 | github-code | 6 |
27257763451 | #! /usr/bin/python -u
import fileinput
import getopt
import os
import re
import string, sys, time,random
printablestringre=re.compile('[\x80-\xFF\x00-\x08\x0A-\x1F]')
def safestring(badstring):
"""only printable range..i.e. upper ascii minus lower junk like line feeds, etc"""
return printablestringre.sub('',... | jeffbryner/blendersecviz | logs/logreplay.py | logreplay.py | py | 1,832 | python | en | code | 4 | github-code | 6 |
50847831 | class Solution:
def makeLargestSpecial(self, s: str) -> str:
def dfs(sbs):
res = []
i, height = 0, 0
for j in range(len(sbs)):
if sbs[j] == '1':
height += 1
else:
height -= 1
if he... | code-cp/leetcode | solutions/761/main.py | main.py | py | 680 | python | en | code | 0 | github-code | 6 |
72510037949 | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Profile
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit, HTML, Div, Row, Column, Fieldset
from crispy_forms.bootstrap import InlineRad... | userksv/carsbay | users/forms.py | forms.py | py | 3,773 | python | en | code | 0 | github-code | 6 |
16566979883 | # 파티
# N개의 마을에 학생이 각 한 명씩 있음. 모두들 특정 마을로 모이기로 함.
# 학생들이 모였다가 다시 본인들의 마을로 돌아가야 한다고 할 때, 가장 많은 시간을 소비하는 학생을 구하라.
# 내 답안1
import sys
import heapq
input = sys.stdin.readline
INF = 987654321
N, M, X = map(int, input().split())
graph = [[]for _ in range(N+1)]
for i in range(M):
a,b,c = map(int, input().split())
... | dngus1683/codingTestStudy | 알고리즘/dijkstra/백준/python/1238.py | 1238.py | py | 1,028 | python | ko | code | 0 | github-code | 6 |
14992716515 | #!/usr/bin/env python
# coding: utf-8
# In[37]:
# Questions for 10/28 meeting:
# Test set -> Should the test be just one game? Answer: Leave it the way it is for now.
# Train set -> Should we duplicate previous games to add weighting? Answer: Yes.
## November 6th, 2020 Backend Meeting ##
# 4 Factors to include for... | oohshan/SmartGameGoalsGenerator | passenger.py | passenger.py | py | 15,323 | python | en | code | 1 | github-code | 6 |
72650289467 | #
# @lc app=leetcode id=148 lang=python3
#
# [148] Sort List
#
# @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 sortList(self, head: Optional[ListNode]) -> Optional[ListNode]:
... | hieun314/leetcode_NguyenKimHieu | 148.sort-list.py | 148.sort-list.py | py | 636 | python | en | code | 0 | github-code | 6 |
32644084947 | import maya.cmds as cmds
import pymel.core as pm
from mgear.core import attribute
ATTR_SLIDER_TYPES = ["long", "float", "double", "doubleLinear", "doubleAngle"]
DEFAULT_RANGE = 1000
# TODO: filter channel by color. By right click menu in a channel with color
def init_table_config_data():
"""Initialize the di... | mgear-dev/mgear4 | release/scripts/mgear/animbits/channel_master_utils.py | channel_master_utils.py | py | 9,005 | python | en | code | 209 | github-code | 6 |
15142385428 | import requests
from flask import redirect, url_for, flash
from app.github import bp
from app.github.functions import request_interface
@bp.route('/update-database', methods=['GET', 'POST'])
async def update_database():
# get all repos sorted by star rating
# The max number of items per page is 100
url ... | Red-Hammer/most-starred-python-repos | app/github/routes.py | routes.py | py | 872 | python | en | code | 0 | github-code | 6 |
37226233681 | class flag():
def __init__(self, short_flag, long_flag, args_num, args_name_list, if_force_num):
self.short_flag = short_flag
self.long_flag = long_flag
self.args_num = args_num
self.args_name_list = args_name_list
self.if_force_num = if_force_num
try:
... | Ntimesp/AkinaChann | utils/arg_parser.py | arg_parser.py | py | 3,295 | python | en | code | 0 | github-code | 6 |
21099702516 | from sklearn import svm
import sklearn.linear_model.stochastic_gradient as sg
from sklearn.model_selection import GridSearchCV as grid
import numpy
#linear kernel support vector machine using tf-idf vectorizations
class SVM:
train_X = []
train_Y = []
test_X = []
test_Y = []
def __init__(self, train_... | hadarohana/Tweets | Tweets/SVM.py | SVM.py | py | 1,710 | python | en | code | 0 | github-code | 6 |
34196758257 | #/usr/bin/env python3
with open("day18_in.txt") as f:
lines = [l.strip() for l in f]
grid = ''.join(lines)
Y_END = len(lines)
X_END = len(lines[0])
def run(grid, times):
cache = {grid: 0}
i = 0
while i < times:
grid = next_grid(grid)
if grid in cache:
i = iterations_... | naggety/adventofcode2018.py | day18.py | day18.py | py | 1,518 | python | en | code | 0 | github-code | 6 |
19325512904 | from statsmodels.tsa.seasonal import seasonal_decompose
from dateutil.parser import parse
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv('../timeserie_train.csv',
parse_dates=['data'],
index_col='data',
squeeze=True)
# Multiplicative Decomposition
result_mul = seasonal_d... | gsilva49/timeseries | H/python_code/decom.py | decom.py | py | 1,379 | python | en | code | 0 | github-code | 6 |
19066210421 | from utils.crawling import *
Ctcd_name = {"11": "서울", "21": "부산", "22": "대구", "23": "인천", #4
"24": "광주", "25": "대전", "26": "울산", "45": "세종", #4
"31": "경기", "32": "강원", "33": "충북", "34": "충남", #4
"35": "전북", "36": "전남", "37": "경북", "38": "경남", "50": "제주"} #5
Pcd1_name = {"03":... | Park-Min-Jeong/Interface-Project-DataPreProcessing | 7 decode_data.py | 7 decode_data.py | py | 1,185 | python | en | code | 0 | github-code | 6 |
72994074107 | import torch.nn as nn
import torch
class NetworksFactory:
def __init__(self):
pass
@staticmethod
def get_by_name(network_name, *args, **kwargs):
################ Ours #################
if network_name == 'Ours_Reconstruction':
from networks.Ours_Reconstruction import N... | Lynn0306/LEDVDI | CODES/networks/networks.py | networks.py | py | 1,012 | python | en | code | 20 | github-code | 6 |
13437468850 | # Display a runtext with double-buffering.
import sys
sys.path.append("matrix/bindings/python/samples")
from samplebase import SampleBase
from rgbmatrix import graphics
import time
from PIL import Image
import requests
import json
import threading
from threading import Thread
from queue import Queue
import traceback
... | aqwesd8/MTAProject | mtatext.py | mtatext.py | py | 7,270 | python | en | code | 0 | github-code | 6 |
1396103450 | from django.shortcuts import render, redirect, reverse
from django.http import JsonResponse
from django.forms import ValidationError
from .models import *
import pyshorteners
def index(request):
data = {}
if request.method == "POST":
try:
l = Link()
s = pyshorteners.Shortener()
... | jennytoc/url-shortener | url_shortener_app/views.py | views.py | py | 976 | python | en | code | 0 | github-code | 6 |
10117546059 | import pytest
from dao.genre import GenreDAO
from service.genre import GenreService
class TestGenreService:
@pytest.fixture(autouse=True)
def genre_service(self, genre_Dao: GenreDAO):
self.genre_service = GenreService(genre_Dao)
def test_get_one(self):
certain_genre = self.genre_service.... | AgzigitovOskar/CR_4_Agzigitov | tests/service_tests/genre_service.py | genre_service.py | py | 618 | python | en | code | 0 | github-code | 6 |
8236657823 | # sets: unordered, mutable, no duplicates
myset = {1, 2, 3, 1, 2} # no duplicates allowed
print(myset) # {1, 2, 3}
myset1 = set([1, 2, 3, 4, 1, 2, 3, 4]) # turn list into a set and it removes duplicates
print(myset1) # {1, 2, 3, 4}
myset2 = set("Hello") # unordered
print(myset2) # {'e', 'H', 'l', 'o'}
myset3 = set(... | bhagya2002/python | Intermediate/4_sets.py | 4_sets.py | py | 1,703 | python | en | code | 0 | github-code | 6 |
37974828359 | '''
Program to be called from cron for working with lights - on and off
This is a wrapper for the Client, handling command line parameters
Author: Howard Webb
Date: 2/10/2021
'''
import argparse
from exp import exp
from GrowLight import GrowLight
parser = argparse.ArgumentParser()
# list of acceptable arg... | webbhm/GBE-Digital | python/Light_Switch.py | Light_Switch.py | py | 538 | python | en | code | 1 | github-code | 6 |
72708100028 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/8/13 15:04
# @Author : 0x00A0
# @File : main.py
# @Description : TKINTER窗口程序
import asyncio
import multiprocessing
import os
import re
import shutil
import sys
import threading
import time
import tkinter
from tkinter import filedialog, messagebox
from... | 0x00A0/FaceAge | main.pyw | main.pyw | pyw | 6,807 | python | en | code | 2 | github-code | 6 |
38928831481 | import os
from dotenv import load_dotenv
import requests
from lxml import etree
import re
from postgres import cursor, connection
from slugify import slugify
load_dotenv()
# --------------------------
# link đến trang hình ảnh của chapter
nettruyen = os.getenv("PUBLIC_NETTRUYEN_URL")
def openWebsite(domain: str):
... | baocuns/BCunsAutoCrawls | crawlChaptersNettruyenToPostgres.py | crawlChaptersNettruyenToPostgres.py | py | 2,686 | python | vi | code | 0 | github-code | 6 |
31008546048 | from flask import Flask
from flask_pymongo import PyMongo
from flask import Response
import random
import requests
from flask import request
import json
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer, BadSignature, SignatureExpired)
from flask import jsonify
from bson.... | SvTitov/tasker | SRV/tasker_srv/application.py | application.py | py | 5,493 | python | en | code | 0 | github-code | 6 |
18711654900 | import argparse
import logging
from pathlib import Path
from typing import List
import yaml
from topaz3.conversions import phase_remove_bad_values, phase_to_map
from topaz3.database_ops import prepare_labels_database, prepare_training_database
from topaz3.delete_temp_files import delete_temp_files
from topaz3.get_cc ... | mevol/python_topaz3 | topaz3/prepare_training_data.py | prepare_training_data.py | py | 14,661 | python | en | code | 0 | github-code | 6 |
8042412809 | import tornado.web
import tornado.ioloop
import tornado.httpserver
import tornado.options
# define parameter,like --port=9000 list=a,b,c,de,
tornado.options.define("port", default=8000, type=None)
tornado.options.define("list", default=[], type=str, multiple=True)
class IndexHandler(tornado.web.RequestHandler):
... | zuohd/python-excise | tornado/server04.py | server04.py | py | 847 | python | en | code | 0 | github-code | 6 |
4786996440 | #まだわからん。
from collections import defaultdict
n,k = map(int,input().split())
a = list(map(int,input().split()))
d = defaultdict(int)
right = 0
ans = 0 # 区間の最大を保存する。
kinds = 0
for left in range(n):
while right < n and kinds < k:
d[a[right]] += 1
right += 1
kinds = len(d)
print("while... | K5h1n0/compe_prog_new | typical90/034/main.py | main.py | py | 725 | python | ja | code | 0 | github-code | 6 |
34859170758 | #####
# Remove "warn" logs from spark
#####
from os.path import abspath
from pyspark.sql import SparkSession
# warehouse_location points to the default location for managed databases and tables
warehouse_location = abspath('spark-warehouse')
spark = SparkSession \
.builder \
.appName("Pyspark integration wit... | zaka-ai/data-engineer-track | Big_data_warehousing_in_hadoop/hive_hands_on/2_hive_partitioning_pyspark_integration/2_2_hive_with_pyspark.py | 2_2_hive_with_pyspark.py | py | 828 | python | en | code | 0 | github-code | 6 |
35164168406 | #!/usr/bin/python3
import os
import json
import html
import random
import string
import threading
import subprocess
from bottle import app, error, post, request, redirect, route, run, static_file
from beaker.middleware import SessionMiddleware
session_opts = {
'session.type': 'file',
'session.data_dir': './cfg/',
... | Cameron-IPFSPodcasting/podcastnode-Umbrel | webui.py | webui.py | py | 9,972 | python | en | code | 4 | github-code | 6 |
71552358588 | import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser
import os, os.path
import smtplib
import random
import win32gui
import win32con
try:
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
print(voices[0].id)
engine.setProperty('voice',voic... | IamVicky90/Desktop-AI | task.py | task.py | py | 10,566 | python | en | code | 0 | github-code | 6 |
24260931224 | # first=(input("Please input your first name:"))
# last=(input("Please input your last name:"))
# user={"name":first,"lname":last}
# print("My name is, " + user["lname"] + " " + user["name"])
#activity 2
first_name = "Wesley"
last_name = "Kolar"
home_address = {"street": "1200 Richmond Ave", "city": "Houston"... | wesleyjkolar/week1 | day4/dictionary.py | dictionary.py | py | 550 | python | en | code | 0 | github-code | 6 |
23476634886 | import joblib
wordsTB = ["'s", ',', 'keywords', 'Twitter', 'account', 'a', 'all', 'anyone', 'are', 'awesome', 'be', 'behavior', 'by', 'bye', 'can', 'chatting', 'check', 'could', 'data', 'day', 'detail', 'do', 'dont', 'find', 'for', 'give', 'good', 'goodbye', 'have', 'hello', 'help', 'helpful', 'helping', 'hey', 'hi'... | kaitong-li/Twitter-Bot | Twitter Bot/generatePkl.py | generatePkl.py | py | 906 | python | en | code | 0 | github-code | 6 |
27579907019 | from pyspark import SparkConf
from pyspark.context import SparkContext
from pyspark.sql.session import SparkSession
conf = SparkConf().set("spark.cores.max", "32") \
.set("spark.driver.memory", "50g") \
.set("spark.executor.memory", "50g") \
.set("spark.executor.memory_overhead", "50g") \
.set("spark.dr... | thuy4tbn99/spark_instacart | baskets.py | baskets.py | py | 2,095 | python | en | code | 0 | github-code | 6 |
1584371171 | import ctypes
import ctypes.util
import threading
# this is mostly copied from https://bugs.python.org/issue15500#msg230736
def patch():
if getattr(threading.Thread.start, "_namedthreads_patched", None):
# threading module is already patched
return
libpthread_path = ctypes.util.find_library("... | beniwohli/namedthreads | namedthreads.py | namedthreads.py | py | 1,681 | python | en | code | 1 | github-code | 6 |
27458445454 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.distributions.python.ops import vector_diffeomixture as vector_diffeomixture_lib
from tensorflow.contrib.linalg.python.ops import linear_operator_diag as linop_diag_l... | playbar/tfandroid | tensorflow/contrib/distributions/python/kernel_tests/vector_diffeomixture_test.py | vector_diffeomixture_test.py | py | 14,527 | python | en | code | 7 | github-code | 6 |
8765318097 | """ Faça um programa que pergunte ao usuário se ele quer passar uma temperatura de Fahrenheit
para Celsius ou de Celsius para Fahrenheit, e que, a partir da resposta do usuário, faça a devida
conversão. """
conversao = input("Digite F (De C° para F°) ou C (De F° para C°)")
temp = int(input("Digite a temperatura : "... | AndreDosSantosMaier/Liguagem_Programacao | Lista de Exercicios/Exer-16.py | Exer-16.py | py | 473 | python | pt | code | 0 | github-code | 6 |
20123867357 | import requests
import json
from collections import OrderedDict
target = "static/data/words_cached.json"
words_cached = json.loads(requests.get("http://mnemonic-si.appspot.com/api/words").text)
open(target, "w").write(json.dumps(words_cached, indent=4))
print("wrote to %s" % target)
words = OrderedDict({})
for word i... | flowcoin/mnemonic | frontend/scripts/dump_words.py | dump_words.py | py | 1,010 | python | en | code | 1 | github-code | 6 |
8056801684 | """
Static Pipeline representation to create a CodePipeline dedicated to building
Lambda Layers
"""
from troposphere import (
Parameter,
Template,
GetAtt,
Ref,
Sub
)
from ozone.handlers.lambda_tools import check_params_exist
from ozone.resources.iam.roles.pipeline_role import pipelinerole_build
fr... | lambda-my-aws/ozone | ozone/templates/awslambdalayer_pipeline.py | awslambdalayer_pipeline.py | py | 2,782 | python | en | code | 0 | github-code | 6 |
6757711914 | import json
import sys
import os.path
from mutagen.id3 import (ID3, CTOC, CHAP, TIT2, TALB,
TPE1, COMM, USLT, APIC, CTOCFlags)
audio = ID3(sys.argv[1])
if len(sys.argv) > 2:
data = json.loads(sys.argv[2])
chapters = data["chapters"]
ctoc_ids = list(map(lambda i: i.get("id"), chapt... | lukekarrys/audiobook | id3.py | id3.py | py | 1,967 | python | en | code | 1 | github-code | 6 |
74221349948 | t = int(input())
outs = []
for g in range(t):
equiv = []
for k in range(51):
equiv.append(0)
n = int(input())
a = []
a = list(map(int, input().split()))
s = input()
news = list(s)
ans = []
for i in range(n):
u = a[i]
if equiv[u] == 0:
equiv[u] = s... | El-Medonho/Contests | Geral/CodeForces/Contests/rnd 828/a.py | a.py | py | 479 | python | en | code | 1 | github-code | 6 |
4993994587 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 19 13:04:11 2019
@author: Diego Wanderley
@python: 3.6
@description: Train script with training class
"""
import tqdm
import argparse
import torch
import torch.optim as optim
import numpy as np
from torch.utils.data import DataLoader
from torch.utils.tensorboard import S... | dswanderley/detntorch | python/train_yolo.py | train_yolo.py | py | 12,881 | python | en | code | 1 | github-code | 6 |
21041808334 | """Pytorch dataset module"""
import json
from glob import glob
from pathlib import Path
import albumentations as A
import cv2
import numpy as np
import torch
from albumentations.pytorch import ToTensorV2
from torch import Tensor
from torch.utils.data import Dataset
from data.config import DataConfig, keypoint_indice... | mohamad-hasan-sohan-ajini/deep_fashion_2 | data/data_pt.py | data_pt.py | py | 7,291 | python | en | code | 1 | github-code | 6 |
69936276028 | import torch.nn as nn
import torch.optim as optimizers
from nlp.generation.models import CharLSTM
class CharLSTMTrainer:
def __init__(self,
model: CharLSTM,
vocab_size: int,
learning_rate: float = 1e-3,
weights_decay: float = 1e-3,
... | Danielto1404/bachelor-courses | python-backend/projects/nlp.ai/nlp/generation/trainers.py | trainers.py | py | 1,129 | python | en | code | 5 | github-code | 6 |
25442443781 | import pygame
from . import view
from . import render
from . import callback
from . import button
HORIZONTAL = 0
VERTICAL = 1
SCROLLBAR_SIZE = 12
class ScrollbarThumbView(view.View):
"""Draggable thumb of a scrollbar."""
def __init__(self, direction):
size = SCROLLBAR_SIZE
view.View.__init__(... | jwayneroth/mpd-touch | pygameui/scroll.py | scroll.py | py | 14,197 | python | en | code | 5 | github-code | 6 |
71943493307 | import csv
import math
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn.feature_selection import chi2, f_regression, mutual_info_regression
def mylog(x):
if x==0:
return -10000000000
else:
return math.log(x)
def entropy(probs, neg, pos):
'''
entropy for bin... | Arnabjana1999/scoring_models | feature_selectors.py | feature_selectors.py | py | 2,740 | python | en | code | 0 | github-code | 6 |
41559834396 | import string
def day3_part1(file):
priorities = string.ascii_letters
priority_sum = 0
with open(file, "r") as f:
data = f.readlines()
for line in data:
line_len = len(line)
half_way = int(line_len / 2)
comp_1 = line[0:half_way]
comp_2 = line[half_way:line_len]
... | cerneris/Advent_of_code_2022 | day3.py | day3.py | py | 1,082 | python | en | code | 0 | github-code | 6 |
39959163393 | # to build, use "cd (playsong directory)"
# pyinstaller --onefile playSong.py
#lib imports
import keyboard
import threading
import time
import os
import re
#local imports
from settings import SETTINGS,map_velocity,apply_range_bounds
global isPlaying
global midi_action_list
isPlaying = False
storedIndex = 0
convers... | eddiemunson/nn | playSong.py | playSong.py | py | 7,532 | python | en | code | 0 | github-code | 6 |
2958627650 | import Algorithmia
import logging
import os
LOG_FOLDER = 'logs'
if os.path.exists(LOG_FOLDER) is False:
os.mkdir(LOG_FOLDER)
logging.basicConfig(filename=LOG_FOLDER + '/' + __name__ + '.log', format='[%(asctime)s] %(message)s\n\n',
level=logging.DEBUG)
api_key = None
def get_emotion(photo: b... | FunRobots/candybot_v2 | src/coffebot/vision/utils/algorithmia.py | algorithmia.py | py | 3,841 | python | en | code | 0 | github-code | 6 |
25760910262 | import random
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, LSTM
# Define the RNN model
model = Sequential()
model.add(LSTM(64, input_shape=(1, 1)))
model.add(Dense(1, activation='linear'))
model.compile(optimizer='adam', loss='mean_squared_error')
balance = 100
be... | atleastimnotgay/python | 3cups_prediction.py | 3cups_prediction.py | py | 1,897 | python | en | code | 0 | github-code | 6 |
73583270588 | #!/usr/bin/python
# coding: utf-8
from flask import Flask, Blueprint, flash, g, redirect, render_template, request, url_for, session
import os
app = Flask(__name__)
tests = []
class TestObj:
def __init__(self, name, path):
self.name = name
self.path = path+self.name
self.countfile = self.pa... | rjames711/automation | flaskweb/app.py | app.py | py | 1,568 | python | en | code | 0 | github-code | 6 |
40411500341 | #!/usr/bin/env python3
"""
Name: example_ndfc_policy_delete_using_switch_serial_entity_type_entity_name.py
Description: Delete policies matching switch serial number, entity type,
and entity name
"""
import sys
from ndfc_python.log import log
from ndfc_python.ndfc import NDFC, NdfcRequestError
from ndfc_python.ndfc_cr... | allenrobel/ndfc-python | examples/ndfc_policy/policy_delete_using_switch_serial.py | policy_delete_using_switch_serial.py | py | 1,036 | python | en | code | 0 | github-code | 6 |
27216859235 | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
(r'^$', 'rss_duna.feed.views.home'),
# url(r'^myproject/', include('myproject.foo.urls')),
# Un... | yonsing/rss_duna | urls.py | urls.py | py | 965 | python | en | code | 0 | github-code | 6 |
13114754891 | import requests
import tkinter.messagebox
user = open('user.txt','r').read().splitlines()
def checking():
for users in user:
tik = (f'https://m.tiktok.com/node/share/user/@{users}')
head = {
'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/... | 8-wrk/TikCheck | Check.py | Check.py | py | 1,463 | python | en | code | 0 | github-code | 6 |
21764401402 | # Approach 1: Merge Sort
# Time: O(n log n)
# Space: O(n)
class Solution:
def sortArray(self, nums: List[int]) -> List[int]:
temp_arr = [0] * len(nums)
def merge(left, mid, right):
start1 = left
start2 = mid + 1
n1 = mid - left + 1
n2 = right - mid... | jimit105/leetcode-submissions | problems/sort_an_array/solution.py | solution.py | py | 1,582 | python | en | code | 0 | github-code | 6 |
19882566170 | from jinja2 import Environment, BaseLoader, TemplateNotFound
import importlib_resources
class PackageLoader(BaseLoader):
def __init__(self, path):
self.path = path
def get_source(self, environment, template):
from backendService import templates
try:
source = importlib_re... | bitlogik/guardata | backendService/templates/__init__.py | __init__.py | py | 648 | python | en | code | 9 | github-code | 6 |
10424214131 | #-*- coding: utf-8 -*-
u"""
@author: Martí Congost
@contact: marti.congost@whads.com
@organization: Whads/Accent SL
@since: October 2008
"""
import cherrypy
from cocktail.modeling import cached_getter
from woost.controllers.publishablecontroller import PublishableController
class DocumentController(PublishableCo... | marticongost/woost | woost/controllers/documentcontroller.py | documentcontroller.py | py | 1,181 | python | en | code | 0 | github-code | 6 |
31628139132 | # fastapi
from fastapi import APIRouter
from fastapi_sqlalchemy import db
# starlette
from starlette.requests import Request
# models
from server.models import User
router = APIRouter(
prefix="/accounts",
tags=["accounts"],
dependencies=[],
responses={
400: {"description": "Bad request"}
... | RajeshJ3/arya.ai | server/accounts/account_controllers.py | account_controllers.py | py | 525 | python | en | code | 0 | github-code | 6 |
21729046794 | import firebase_admin
from firebase_admin import db
from flask import jsonify
from hashlib import md5
from random import randint
from time import time
from time import time, sleep
firebase_admin.initialize_app(options={
'databaseURL': 'https://copy-passed.firebaseio.com',
})
waitlist = db.reference('waitlist')
id... | ocular-data/copy-passed-firebase | python_functions/authenticator/main.py | main.py | py | 2,575 | python | en | code | 0 | github-code | 6 |
15581775407 | #!/usr/bin/env python
import pygame
import constants
from network import Type
import physical_object
from physical_object import PhysicalObject
import bullet
import math
from pygame.rect import Rect
import play_sound
from pygame import mixer
from pygame.mixer import Sound
TURRET_WIDTH = 24
TURRET_HEIGHT = 28
GUN_CHA... | Nayruden/GameDev | turret.py | turret.py | py | 4,330 | python | en | code | 6 | github-code | 6 |
18262922550 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import types
import re
import subprocess
import unitTestUtil
import logging
sensorDict = {}
util_support_map = ['fbttn', 'fbtp', 'lightning', 'minipack', 'fby2... | WeilerWebServices/Facebook | openbmc/tests/common/sensorTest.py | sensorTest.py | py | 6,525 | python | en | code | 3 | github-code | 6 |
34172290130 | import os
import csv
file_path = os.path.join(".","Resources", "budget_data.csv")
# print(file_path)
with open(file_path, "r") as csv_file:
csv_reader_obj = csv.reader(csv_file, delimiter=",")
# print(list(csv_reader_obj))
# Read the header row first and move the pointer to next line
csv_header = next(csv_... | Simon-Xu-Lan/python-challenge | PyBank/main.py | main.py | py | 1,772 | python | en | code | 0 | github-code | 6 |
39275871070 | import sys
import time
import traceback
from datetime import datetime
import random
import re
from decimal import Decimal
import numexpr
from typing import List, Dict
import disnake
from disnake.ext import commands, tasks
from disnake import ActionRow, Button
from disnake.enums import OptionType
from disnake.app_comm... | wrkzcoin/TipBot | wrkzcoin_tipbot/cogs/mathtip.py | mathtip.py | py | 26,213 | python | en | code | 137 | github-code | 6 |
21813222206 | LEFT = 0
RIGHT = 1
DATA = 2
node = [
[1, 2, "38.5℃以上のねつがある?"],
[3, 4, "胸がヒリヒリする"],
[5, 6, "元気がある?"],
[None, None, "速攻病院"],
[None, None, "解熱剤で病院"],
[None, None, "様子を見る"],
[None, None, "氷枕で病院"]
]
MAX = len(node)
a = 0
while True:
print(node[a][DATA], end="")
s = input("(y/n)")
if ... | itc-s21007/algrithm_class | 練習問題/YesOrNo.py | YesOrNo.py | py | 641 | python | en | code | 0 | github-code | 6 |
18195204561 | #implementation of doubly link list
#-------implementation of node class------
class Node:
head = None
tail = None
def __init__(self, data):
self.key = data
self.prev = None
self.next = None
#--------Insert function-------------
def insert(data):
if Node.head == None:
N... | Sjasvin93/datastructures-with-python | doubly_linked_list.py | doubly_linked_list.py | py | 3,122 | python | en | code | 0 | github-code | 6 |
30357800081 | from math import log10
from pyface.qt import QtCore, QtGui
from traits.api import TraitError, Str, Float, Any, Bool
from .editor_factory import TextEditor
from .editor import Editor
from .constants import OKColor, ErrorColor
from .helper import IconButton
# ------------------------------------------------------... | enthought/traitsui | traitsui/qt/range_editor.py | range_editor.py | py | 25,173 | python | en | code | 290 | github-code | 6 |
3986831730 | """The abstract class for http routing"""
from abc import ABCMeta, abstractmethod
from typing import AbstractSet, Any, Mapping, Tuple
from .http_callbacks import HttpRequestCallback
from .http_response import HttpResponse
class HttpRouter(metaclass=ABCMeta):
"""The interface for an HTTP router"""
@property... | rob-blackbourn/bareASGI | bareasgi/http/http_router.py | http_router.py | py | 1,583 | python | en | code | 26 | github-code | 6 |
29180093984 | from bs4 import BeautifulSoup as soup
from urllib.request import urlopen as uReq
from datetime import datetime as dt
import re
import copy
import MySQLdb
dataBase = MySQLdb
userInput1 = str(input("Please Provide with Calendar link: "))
userInput2 = str(input("Please Provide a file name ending in .sql: "))
userInp... | ZbonaL/WebScraper | webscraper-Important-Dates.py | webscraper-Important-Dates.py | py | 7,088 | python | en | code | 1 | github-code | 6 |
37407141564 | from .core.Backtest import BackTesting
from .core.Feature import ApplyRule
import pandas as pd
import numpy as np
class ESG_rule(ApplyRule):
def __init__(self, min_buy_score, roe_score=None, roic_score=None):
self.min_buy_score = min_buy_score
self.roe_score = roe_score
self.roic_score... | etq-quant/etqbankloan | Lib/etiqabacktest/ESGRule.py | ESGRule.py | py | 1,279 | python | en | code | 0 | github-code | 6 |
20162423075 |
# Level 1
# Task 1. Reverse a negative integer and keep the negative sign at the beginning.
def reverse_negative_integer(n: int):
n = str(n)
n = "-" + n[:0:-1]
return int(n)
print(reverse_negative_integer(-234))
# Task 2. Write a function that takes two strings as input and returns True if they are anag... | OrbitWon45/git_hw | algorrithms_hw_2.py | algorrithms_hw_2.py | py | 1,692 | python | en | code | 0 | github-code | 6 |
1956715633 | from collections import deque
ulaz = open('ulaz.txt', 'r')
sve = ulaz.read()
ulaz.close()
igrači = sve.split('\n\n')
prvi = deque(igrači[0].split('\n')[1:])
drugi = deque(igrači[1].split('\n')[1:])
while len(prvi) != 0 and len(drugi) != 0:
a = int(prvi.popleft())
b = int(drugi.popleft())
if a > b:... | bonkach/Advent-of-Code-2020 | 22a.py | 22a.py | py | 582 | python | hr | code | 1 | github-code | 6 |
40403637355 | # Program swaps max and min elements of an array
mas = [5, 6, 7, 4, 3, 2, 1, 0, -2, 0, 9, 4, 7, -5, 3, 1]
def find_max(array):
maximum = array[0]
for i in range(1, len(array)):
if array[i] > maximum:
maximum = array[i]
return maximum
def find_min(array):
maximum = array[0]
for i in range(1, len(array)):
... | danielsummer044/EDUCATION | swap_min_max.py | swap_min_max.py | py | 516 | python | en | code | 0 | github-code | 6 |
70965223549 | ### THEORETICAL PROBABILITY ###
# For the following problems, use python to simulate the problem and calculate an experimental probability, then compare that to the theoretical probability.
from scipy import stats
import numpy as np
# Grades of State University graduates are normally distributed with a mean of 3.0 a... | crisgiovanoni/statistics-exercises | probability_distributions.py | probability_distributions.py | py | 9,018 | python | en | code | 0 | github-code | 6 |
36559869570 | from turtle import Turtle, Screen
from layout import Layout
import random
is_race_on = False
screen = Screen()
screen.setup(width=500, height=400)
user_bet = screen.textinput(title="Make your bet", prompt="Which turtle will win the race? Enter a color: ")
# Create layout
layout = Layout()
layout.draw_end_flag()
# ... | portoduque/Turtle-Race | main.py | main.py | py | 1,258 | python | en | code | 1 | github-code | 6 |
16799554480 | import argparse
from pathlib import Path
import sys
# Add aoc_common to the python path
file = Path(__file__)
root = file.parent.parent
sys.path.append(root.as_posix())
import re
from functools import lru_cache
from math import inf
parser = argparse.ArgumentParser()
parser.add_argument('--sample', '-s', help='Run wi... | mrkirby153/AdventOfCode2022 | day16/day16.py | day16.py | py | 3,973 | python | en | code | 0 | github-code | 6 |
18810536610 | from sympy import *
#Exercice de dérivation:
x = Symbol('x')
L=[]
def derivee(y):
yprime = y.diff(x)
print("la dérivée est :", yprime)
for i in range(1):
a=(input("Entrez la fonction à derivé :"))
L.append(a)
#print(L)
for a in L:
print(derivee(a))
| Mehdi921NSI/derivation | python.py | python.py | py | 299 | python | fr | code | 0 | github-code | 6 |
26024379550 | # 积分守恒型 Lax - Friedrichs 格式
# 导入所需要的模块
import numpy as np
from fealpy.decorator import cartesian
from scipy.sparse import diags
from scipy.sparse import csr_matrix
from typing import Union,Tuple,List # Union: 将多个集合合并为一个集合
from scipy.sparse.linalg import spsolve
import matplotlib.pyplot as plt
from fealpy.mesh import... | suanhaitech/pythonstudy2023 | python-jovan/Numerical solution of differential equation/hyperbolic/test_exp2.py | test_exp2.py | py | 3,132 | python | en | code | 2 | github-code | 6 |
28670801665 | from os import close
from numpy.lib.npyio import NpzFile
import pandas as pd
import os
import tqdm
import re
import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
from sklearn.metrics import r2_score
from scipy import stats
Folder_Path = r'C:\Users\hp\Desktop\wdpashp\wdpa... | HaoweiGis/EarthLearning | tools/LightPollution/LightPollution2.py | LightPollution2.py | py | 9,858 | python | en | code | 3 | github-code | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.