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
16068511369
price = 22.50 print("hello and welcome to dogsRus") loop = True dog_name = "" while loop: print("1: Pick up dog\n2: Drop of dog\n3: List all staying dogs\nX: Exit program") option = input("what option would you like to choose? ") section = ["Betty", "Dog"] if option == "1": dog_name = input("en...
turnera2122/code-lmao
dog walker code.py
dog walker code.py
py
1,021
python
en
code
0
github-code
36
16759793113
import datetime from ..command_system import Command from ...models import Client, Schedule, Teacher, Subject from ...utils import awesome_date def next_lesson(domain): client = Client.query.filter(Client.social_network == 'https://vk.com/'+ domain['domain']).first() schedule = Schedule.query.filter((Schedule.c...
edukato/learning
app/home/commands/next_lesson.py
next_lesson.py
py
1,707
python
ru
code
0
github-code
36
20500455998
import mailbox from contextlib import contextmanager import tempfile from io import BytesIO import gzip import logging import requests from mlarchive2maildir.message import deobfuscate class MessageIdMaildir(mailbox.Maildir): """ An extension of the mailbox.Maildir class that you can ask whether a me...
flokli/mlarchive2maildir
mlarchive2maildir/mailbox.py
mailbox.py
py
3,148
python
en
code
2
github-code
36
13895020960
import matplotlib.pyplot as plt import numpy as np x = np.array([[1,0],[0,1],[0,-1],[-1,0],[0,2],[0,-2],[-2,0]]) y = np.array([-1,-1,-1,1,1,1,1]) def z(X): x1, x2 = X[0], X[1] t1 = x2**2 - 2*x1 - 2 t2 = x1**2 - 2*x2 - 1 return [t1,t2] T = np.array([z(i) for i in x]) for i in T: print(i) from sklearn import svm...
kevinliu726/MachineLearningTechnique
hw1/1.py
1.py
py
1,275
python
en
code
0
github-code
36
12467284700
from cell import Cell, WrongCellsAmountError cell_one = Cell(amount=4) cell_two = Cell(amount=3) cell_three = Cell(amount=2) cell_four = Cell(amount=5) cell_five = Cell(amount=3) cell_six = Cell(amount=33) result = (cell_one + cell_two - cell_three) * cell_four / cell_five print(result) print(f'Make order with size...
acselerai/pyf
home_work_7/task_3/main.py
main.py
py
639
python
en
code
0
github-code
36
21119796127
import heapq from math import inf from typing import List class Solution: def minimumTime(self, grid: List[List[int]]) -> int: m, n = len(grid), len(grid[0]) if grid[0][1] > 1 and grid[1][0] > 1: return -1 dis = [[inf] * n for _ in range(m)] dis[0][0] = 0 h = ...
plattanus/leetcodeDAY
python/2577. 在网格图中访问一个格子的最少时间.py
2577. 在网格图中访问一个格子的最少时间.py
py
961
python
en
code
0
github-code
36
41917076519
from flask import jsonify, make_response import src.flaskr.controllers.turn_logic as turn_logic from src.flaskr.controllers.uuid_supplier import UuidSupplier import src.flaskr.controllers.winner_logic as winner_logic from src.flaskr.models.game_model import Game, GameSchema, MoveSchema from src.flaskr.persistence.repos...
eriklong95/tiktak
src/flaskr/controllers/games_controller.py
games_controller.py
py
3,297
python
en
code
0
github-code
36
27052806329
from typing import List class Solution: def _fizzBuzz(self, number): if number % 15 == 0: return "FizzBuzz" elif number % 5 == 0: return "Buzz" elif number % 3 == 0: return "Fizz" else: return str(number) def fizzBuzz(self, n: in...
ikedaosushi/leetcode
problems/python/fizzBuzz.py
fizzBuzz.py
py
397
python
en
code
1
github-code
36
39853467321
import cv2 as cv import numpy as np im = cv.imread('car.png', 0) kernel = np.ones((5, 5), np.int16) * 1 / 25 out = cv.filter2D(im, -1, kernel) print(out) for i in range(len(out)): for j in range(len(out[0])): if out[i][j] < 128: out[i][j] = 255 else: out[i][j] = 0 cv.imsh...
RonaldCDO/Python
python_opencv/grayscale_images.py
grayscale_images.py
py
376
python
en
code
0
github-code
36
22530241228
from itertools import zip_longest from typing import Optional import numpy as np import pytest import gym from gym.spaces import Box, Graph, utils from gym.utils.env_checker import data_equivalence from tests.spaces.utils import TESTING_SPACES, TESTING_SPACES_IDS TESTING_SPACES_EXPECTED_FLATDIMS = [ # Discrete ...
openai/gym
tests/spaces/test_utils.py
test_utils.py
py
3,718
python
en
code
33,110
github-code
36
70062828584
from flask import Blueprint, render_template, request, current_app,redirect from flask import url_for, flash from jobweb.decorators import admin_required from jobweb.models import db,User from jobweb.forms import UserRegisterForm, CompanyRegisterForm,UserEditForm, CompanyEditForm admin = Blueprint('admin', __name__, u...
LouPlus/jobplus3-9
jobweb/handlers/admin.py
admin.py
py
2,498
python
en
code
0
github-code
36
7974449383
import string class Token(object): eof = 'EOF' ident = 'IDENT' number = 'NUMBER' operator = 'OP' punctuator = 'PUNC' keyword = 'KEYWORD' block_start = 'START' block_end = 'END' keywords = ['if', 'else', 'while', 'output'] def __init__(self, type, value, line, line_no, lin...
paynetechnologies/SimpleOnePass
src/lexer2.py
lexer2.py
py
4,248
python
en
code
0
github-code
36
984949848
"""empty message Revision ID: dde24bfed677 Revises: 0c89b9c0a9cd Create Date: 2020-04-07 16:50:44.747914 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'dde24bfed677' down_revision = '0c89b9c0a9cd' branch_labels = None depends_on = None def...
torbjomg/pwa_flask_app
migrations/versions/dde24bfed677_.py
dde24bfed677_.py
py
1,867
python
en
code
0
github-code
36
27490420908
import datetime from FileBlackHolePy import FileBlackHole, initLib, destroyLib from MigurdiaPy import Migurdia from json import dumps, loads from colors import log, bcolors from PIL import Image from credentials import __USERNAME__, __PASSWORD__, __TOKEN__ from os.path i...
iLikeTrioxin/PTMU
pixivToMigurdiaUploader.py
pixivToMigurdiaUploader.py
py
6,744
python
en
code
0
github-code
36
476311110
import json import clearskies from clearskies.handlers.exceptions import ClientError, InputError from clearskies.handlers.base import Base from .exceptions import ProducerError class NoInput(clearskies.handlers.SchemaHelper, Base): _configuration_defaults = { 'base_url': '', 'can_rotate': True, ...
cmancone/clearskies-akeyless-custom-producer
src/clearskies_akeyless_custom_producer/handlers/no_input.py
no_input.py
py
10,414
python
en
code
0
github-code
36
30337199579
import Gui import networkx as nx import random def ant(graph:nx.Graph, psize:int, node:tuple, pgraph, pherom, pheromcoef, update): ants = [] for i in range(psize): ants.append([set(),0]) findway(graph, pgraph , ants[-1], node, pheromcoef) update() s = node for n in ants[...
rawr-0/ants_algorithm_lab
main.py
main.py
py
1,524
python
en
code
0
github-code
36
41550884221
import math import warnings from typing import Sequence import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torchmetrics.functional import pairwise_cosine_similarity from mmcv.cnn import (build_activation_layer, build_conv_layer, build_norm_layer, xavier_ini...
parkyongjun1/rotated_deformabledetr
AO2-DETR/mmrotate/models/utils/rotated_transformer.py
rotated_transformer.py
py
59,187
python
en
code
0
github-code
36
4941442035
import requests import configparser import json cfg = configparser.ConfigParser() cfg.read("config.ini") _api_url = str(cfg["default"]["api_url"]) def test_post_scm_repo(): response = requests.post(f"{_api_url}/scm-repos", json={"url": "abc"}) assert response.status_code == 201 body = response.json() ...
shmenkins/acceptance-tests
shmenkins/at/api_test.py
api_test.py
py
378
python
en
code
0
github-code
36
16103131667
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='ISY994v5', version='0.9.7', description='ISY99 Controller Rest and Websocket client v5 firmware', author='Michael Cumming', author_email='mike@4831.com', long_description=long_descrip...
mjcumming/ISY994v5
setup.py
setup.py
py
804
python
en
code
4
github-code
36
10900975641
A = ["Alpha", "Bravo", "Charlie"] print("Список: ", A) B = ", ".join(A) print("Текст: ", B) C = B.split(", ") print(C) txt = """Прошли года И в свете лет Есть мудрость А вот счастья нет""" print(txt) D = txt.splitlines() print(D)
SetGecko/PonPbyEandT
Chapter_5/Listing05_09.py
Listing05_09.py
py
287
python
ru
code
0
github-code
36
14063780861
#Exercicio 1 print("Lojas Quase Dois - Tabela de preços") a = 1 while a < 51: print(a, "Total R$:", (a * 1.99)) a = a + 1 #Exercicio 2 print("Panificadora Pão de Ontem - Tabela de preços") quantity = int(input("Informa a quantidade de pães: ")) while quantity < 51: print(quantity, "Total R$:", (quantity * ...
kaueribeiro99/training-python-logic
training-while.py
training-while.py
py
2,438
python
pt
code
0
github-code
36
44007402888
from django.urls import path from .views import ( BasicInfoView, ContactFormView, FindProviderMedicationView, GetFormOptionsView, ) public_api_urlpatterns = [ path( 'options/', GetFormOptionsView.as_view(), ), path( 'find_providers/', FindPro...
ninjadevtrack/medifiner-api
public/api_urls_v1.py
api_urls_v1.py
py
521
python
en
code
1
github-code
36
1791196487
import numpy as np import csv, operator from matplotlib import pyplot from mpl_toolkits.mplot3d import Axes3D from matriz import minimosCuarados, readFile, mat from gauss import convertirCeros, convertirUnos from sistemasEcuaciones import ecuacionesParciales,solve matriz, renglones, columnas = readFile() readFile() po...
lucalice/Multiple-Linear-Regression-MLR-
main.py
main.py
py
2,170
python
en
code
0
github-code
36
12607805013
from gevent import monkey monkey.patch_all() from bs4 import BeautifulSoup import requests from fake_useragent import UserAgent import gevent from gevent.queue import Queue import os def getPictures(): while not urls.empty(): item = urls.get_nowait() if not os.path.exists(f'F://meiziba//{item[1]}...
Kenny3Shen/CodeShen
Code/Python/Web Crawler/meiziba.py
meiziba.py
py
1,509
python
en
code
0
github-code
36
36838033719
import os import sys from typing import List import yaml # Permit imports from "buildscripts". sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '../../..'))) # pylint: disable=wrong-import-position from buildscripts.idl import lib from buildscripts.idl.idl import parser def gen_all_feature...
mongodb/mongo
buildscripts/idl/gen_all_feature_flag_list.py
gen_all_feature_flag_list.py
py
1,844
python
en
code
24,670
github-code
36
8445360878
import operator import warnings import numpy try: import scipy.sparse _scipy_available = True except ImportError: _scipy_available = False import cupy from cupy._core import _accelerator from cupy.cuda import cub from cupy.cuda import runtime from cupyx.scipy.sparse import _base from cupyx.scipy.sparse i...
cupy/cupy
cupyx/scipy/sparse/_csr.py
_csr.py
py
42,419
python
en
code
7,341
github-code
36
21809713879
import asyncio import logging from bleak import BleakClient, BleakScanner DEVICE_NAME = "iBobber" IBOBBER_ADDR = "34:14:B5:4B:B9:15" ACCEL_SERVICE_UUID = "1791FFA0-3853-11E3-AA6E-0800200C9A66" CUSTOM_SERVICE_UUID = "1791FF90-3853-11E3-AA6E-0800200C9A66" BATT_SERVICE_UUID = "0000180F-0000-1000-8000-00805F9B34FB" DEVIC...
limehouselabs/i.-bobba
ibobber/__main__.py
__main__.py
py
1,810
python
en
code
0
github-code
36
21619772911
from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import apache_beam as beam from apache_beam.runners.direct import direct_runner from apache_beam.runners.interactive import cache_manager as cache from apache_beam.runners.interactive import pi...
a0x8o/kafka
sdks/python/apache_beam/runners/interactive/pipeline_analyzer_test.py
pipeline_analyzer_test.py
py
10,712
python
en
code
59
github-code
36
26383130759
import os os.environ["XLA_FLAGS"] = "--xla_force_host_platform_device_count=4" import sys from typing import Literal import pickle sys.path.append(snakemake.config['workdir']) import jax from jax.config import config config.update("jax_enable_x64", True) print(f"Jax device count: {jax.local_device_count()}") impor...
jarsba/gradu
scripts/create_models_for_linear_regression.py
create_models_for_linear_regression.py
py
4,405
python
en
code
0
github-code
36
24184494226
""" H4xton fake typing chat exploit """ import requests,os,sys,time,random class Discord(): def TypeExploit(token,channelid): url = f"https://canary.discord.com/api/v9/channels/{channelid}/typing" headers = { 'authority': 'canary.discord.com', 'content-length': '0', ...
lnfernal/Discord-Hearbeat-Exploit
main.py
main.py
py
1,350
python
en
code
0
github-code
36
14326782104
__author__ = 'Xing' # Given a linked list, remove the nth node from the end of list and return its head. # # For example, # # Given linked list: 1->2->3->4->5, and n = 2. # # After removing the second node from the end, the linked list becomes 1->2->3->5. class ListNode(object): def __init__(self, x): ...
jinxin0924/Algorithms-Design-and-Analysis
Remove Nth Node From End of List.py
Remove Nth Node From End of List.py
py
818
python
en
code
1
github-code
36
6519049093
from tkinter import* import tkinter as tk import cv2 import numpy as np import webbrowser #GRAY ONLY def obj(): thres = 0.45 nms_threshold = 0.2 cap = cv2.VideoCapture(0) className = [] classFile = 'coco.names' with open(classFile, 'rt') as f: className = f.read().rstrip('\n').split(...
jahin44/Python
pythonopencv/pro_gui.py
pro_gui.py
py
6,916
python
en
code
1
github-code
36
72975128425
from django import forms from crispy_forms.layout import Submit from core.forms.base_crispy_form import BaseCrispyForm from core.models.round import Round class WinnerForm(BaseCrispyForm, forms.ModelForm): SUBMIT_BUTTON_VALUE = "Declare Winner" SUBMIT_BUTTON_CSS_CLASSES = "btn-no-bg btn-outline-info" c...
lekjos/dailygroove
src/core/forms/winner_form.py
winner_form.py
py
1,864
python
en
code
2
github-code
36
73243352745
import streamlit as st import pytube as pt import os import subprocess import re from utils import logtime, load_ffmpeg import whisper from langchain.document_loaders import YoutubeLoader from langchain.text_splitter import RecursiveCharacterTextSplitter URL = 'URL' TEXT = 'TEXT' WHISPER = 'WHISPER' PROCESSING = 'PROC...
olanigan/Youtube_Assistant
app.py
app.py
py
4,825
python
en
code
0
github-code
36
5099132593
from html import escape import constants import re def attack_found(data_dict): """ This function uses the attack detecting functions below to check for possible cases of an attack. Input: data_dict - a dictionary containing the data from the user request. Output: True if a possible attack is detected ...
BarakNK/Lightning-Shield-WAF
defense_manager.py
defense_manager.py
py
3,663
python
en
code
0
github-code
36
6788861571
import codecs from django.conf import settings from django.views.generic.edit import CreateView from django.contrib.auth.mixins import PermissionRequiredMixin from django.urls import reverse from django.http.response import HttpResponseRedirect from django.contrib import messages from achievement.models import Achiev...
tomasgarzon/exo-services
service-exo-core/consultant/views/network/bulk.py
bulk.py
py
3,853
python
en
code
0
github-code
36
70734503465
def obtener_palabras_mayores(parrafo: str, largo: int) -> list: palabras = parrafo.split(" ") palabras_mayores = [] for palabra in palabras: palabra_limpia = limpiar_palabra(palabra).upper() if len(palabra_limpia) == largo: palabras_mayores.append(palabra_limpia) return palabras_m...
gcc-cdimatteo/Algoritmos-y-Programacion-I-75.40
Parciales/2023C1P0-20230427-parrafo_loco.py
2023C1P0-20230427-parrafo_loco.py
py
2,259
python
es
code
9
github-code
36
8478439649
#Python imports import json from uuid import UUID from datetime import date from datetime import datetime from typing import Optional, List #Pydantic imports from pydantic import Field as FD from pydantic import BaseModel as BMW from pydantic import EmailStr #FastAPI imports from fastapi import FastAPI...
davidcordellatt/Twitter-Api-Fastapi-practice-
main.py
main.py
py
13,686
python
en
code
0
github-code
36
13991546388
class BigBurger: def maxWait(self, arrival, service): start = 0 maxW = 0 for i in xrange(len(arrival)): a, s = arrival[i], service[i] if a < start: wait = start - a else: wait = 0 maxW = max(maxW, wait) ...
dariomx/topcoder-srm
old-stuff/topcoder-srm/149/250.py
250.py
py
412
python
en
code
0
github-code
36
42154062828
# 걷기 import sys input = sys.stdin.readline if __name__ == "__main__": # x,y,w,s # x,y = 도착점 좌표 # w: x 나 y 를 한칸 이동할때 걸리는시간 # s: 대각이동 할때(x,y) 걸리는 시간 x, y, w, s = map(int, input().split()) gap = abs(x-y) # 큰수에서 작은수를 뺀값 diagnol = min(x, y) # 대각 이동 가능한수 move1 = (x+y)*w # 평행이동만 하는경우 ...
FeelingXD/algorithm
beakjoon/1459.py
1459.py
py
615
python
ko
code
2
github-code
36
70115961064
import random import db_wrap from config import * class Racing: def __init__(self, tracks_cnt=TRACKS_NUM, race_len=RACE_LEN): self._tracks_cnt = tracks_cnt self._race_len = race_len self._race_width = race_len self._race_id = None self._finished = None self._starte...
AnTi3z/HorsesBot
racing.py
racing.py
py
3,723
python
en
code
0
github-code
36
26162010139
import re pattern = re.compile(r'palScreen(\[\S+\]) = olc::Pixel\(([0-9]{1,3}), ([0-9]{1,3}), ([0-9]{1,3})\);') inFile = open("palette_data.txt") lines = inFile.readlines() inFile.close() for line in lines: matches = pattern.findall(line) with open("palette_out.txt", "a") as outFile: for match in mat...
Skadic/nest
scripts/palette_conversion.py
palette_conversion.py
py
479
python
en
code
0
github-code
36
21600216675
# -*- coding: utf-8 -*- """ ReferIt, UNC, UNC+ and GRef referring image segmentation PyTorch dataset. Define and group batches of images, segmentations and queries. Based on: https://github.com/chenxi116/TF-phrasecut-public/blob/master/build_batches.py """ import os import re # import cv2 import sys import json impo...
djiajunustc/TransVG
datasets/data_loader.py
data_loader.py
py
9,900
python
en
code
134
github-code
36
35675499105
""" *Position* The inder of a character in the text. More precisely, a position identifies the place between two characters. """ __all__ = ["Position"] class Position( int, ): def __init__( self, position: int, ): super(BufferPosition, self).__new__( int, ...
jedhsu/text
text/_elisp/position/_position.py
_position.py
py
352
python
en
code
0
github-code
36
27898714417
from datetime import datetime def foo(n): n = int(n) global start_time start_time = datetime.now() list = [] i = 0 while len(list) < n: flag = True if i == 0 or i == 1: i += 1 continue for j in range(i+1): if j == 0 or j == 1 or j == ...
stgolovin/js_hw
lesson2/task1.py
task1.py
py
556
python
en
code
0
github-code
36
13257862183
def checkio(f, g): def call(function, *args, **kwargs): try: return function(*args, **kwargs) except Exception: return None def h(*args, **kwargs): value_f, value_g = call(f, *args, **kwargs), call(g, *args, **kwargs) status = "" if (value_f is None and value_g...
Amaimersion/CheckiO-solutions
solutions/Dropbox/Compare Functions/1.py
1.py
py
2,586
python
en
code
0
github-code
36
31071015439
from core_algo.SGA import SGA import alarm import sys import json import time from tabulate import tabulate def average_res(ga, cal_times=100, **params): cost_sum = 0 runtime_sum = 0 gen_sum = 0 speed_sum = 0 for _ in range(cal_times): # solve the question res, runtime, last_gen =...
UTP-project/core-algo
exp_compare.py
exp_compare.py
py
7,044
python
en
code
0
github-code
36
10514105287
import allure from selenium.webdriver.common.by import By from extensions import ui_actions from utilities.Base import Base @allure.step("Business Flow: Login") def login(email, password): ui_actions.update_text(Base.LOGIN_PAGE.textbox_user_email, email) ui_actions.update_text(Base.LOGIN_PAGE.textbox_passwor...
liorc955/Python-automation
workflows/web_flows.py
web_flows.py
py
3,153
python
en
code
0
github-code
36
70230219944
# Your task this week: given a 3 by 3 list of lists that represents a Tic Tac Toe game board, tell me whether anyone # has won, and tell me which player won, if any. A Tic Tac Toe win is 3 in a row - either in a row, a column, # or a diagonal. Don’t worry about the case where TWO people have won - assume that in every ...
izdomi/python
exercise26.py
exercise26.py
py
4,029
python
en
code
0
github-code
36
16675308280
import sqlite3 import Login import CurrentBalance def deposit_on_account_balance(conn, usr, deposit): """ Check for the existence of a specified user in the database :param conn: the Connection object :param id_pub: user :param deposit: amount to deposit :return: True if transaction preceeded ...
EmanuP/AccountManager
Deposit.py
Deposit.py
py
767
python
en
code
0
github-code
36
6660104628
import pprint import subprocess import univention.management.console as umc import univention.management.console.modules as umcm import univention.config_registry import univention.admin.uldap from fnmatch import * import re from univention.management.console.log import MODULE from univention.management.console.proto...
m-narayan/smart
ucs/services/univention-printserver/umc/python/printers/__init__.py
__init__.py
py
15,824
python
en
code
9
github-code
36
29746225249
import emp import pickle f=open("emp1.dat","wb") n=int(input("enter no of employees: ")) for i in range(n): eno=int(input("enter empno: ")) ename=input("enter empno: ") e=emp.Employee(eno,ename) pickle.dump(e,f) print(e) f.close()
gurram1223/PythonExamples
PythonEx/Examples/pickleExamples/dump.py
dump.py
py
254
python
en
code
0
github-code
36
4585824107
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 30 20:16:19 2020 @author: Antonio Hickey """ #------------------------------------------------------------------- # Importing Modules from bs4 import BeautifulSoup as soup from urllib.request import urlopen as uReq import pandas as pd import csv #--...
antonio-hickey/Economics
Yeild Curve/Data Collection/Web_Crawler_Bot.py
Web_Crawler_Bot.py
py
1,268
python
en
code
2
github-code
36
5450602551
from enum import Enum import numpy as np import pandas as pd from dataclasses import dataclass from copy import deepcopy from typing import List, Union class Direction(Enum): UP = 'U' DOWN = 'D' LEFT = 'L' RIGHT = 'R' @dataclass class Motion: direction: Union[Direction, str] steps: int ...
wbonna352/adventofcode2022
day_09/main.py
main.py
py
3,827
python
en
code
0
github-code
36
44255351041
#https://codeforces.com/problemset/problem/1517/B #Morning Jogging trials = int(input()) while trials > 0 : trials -= 1 n,m = input().split(" ") n,m = int(n),int(m) x = 0 r = 0 while r != n : r += 1 b = list(input().split(" ")) globals()["i"+f"{x+1}"] = list(map(int , b))...
Ghanashyam-Bhat/CompetitiveProgramming
Non_contest/MorningJog.py
MorningJog.py
py
908
python
en
code
1
github-code
36
5023782942
# -*- coding: utf-8 -*- import os import shutil import torch # from torch.utils.data import * from torch.utils import data from imutils import paths import numpy as np import random from PIL import Image from torchvision.transforms import transforms import cv2 def cv_imread(path): img = cv2.imdecode(...
stlyl/crack_detection
crack_detection_python/crack_dataset.py
crack_dataset.py
py
2,601
python
en
code
2
github-code
36
7927334038
from PyQt5.QtWidgets import (QWidget, QCalendarWidget,QLabel, QApplication, QVBoxLayout,QPushButton) from PyQt5.QtCore import QDate import sys global ap class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): vbox = QVBoxLayout(self) ...
fernandezjared1/Vodafone-Idea---PS1
cal.py
cal.py
py
1,361
python
en
code
0
github-code
36
27878022936
# First things, first. Import the wxPython package. from concurrent.futures import thread from tracemalloc import start from turtle import pos from numpy import size, true_divide import wx from wx.adv import * from Utilities.media_utils import batchDownload, download, spotifyToSearches, ytFromLink import misc from spot...
missing-atabey/PyraTunes
main.py
main.py
py
3,400
python
en
code
0
github-code
36
23306080113
import streamlit as st import plotting def stats_view(dfmedicine, dfuniques, visualization_mode): st.markdown("## Conteos generales del hospital respecto a los pacientes ingresados por trauma") metric_values = zip(dfuniques.iloc[:, 0].values, dfuniques.iloc[:, 1].values) metric_columns = st.colum...
SimonPGM/ds4adashboard
Dashboard/generalstatsvis.py
generalstatsvis.py
py
937
python
es
code
0
github-code
36
15827613862
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * import logging import pymongo import emission.storage.timeseries.timequery a...
e-mission/e-mission-server
emission/storage/decorations/analysis_timeseries_queries.py
analysis_timeseries_queries.py
py
4,240
python
en
code
22
github-code
36
15335677363
#!/usr/bin/env python # # Add `#pragma once` to headers import sys def _main(): for filename in sys.argv[1:]: with open(filename, 'rb') as f: data = f.read() if not data.startswith('#pragma once\n'): with open(filename, 'wb') as f: f.write('#pragma once\n\n...
STYTZ/catboost
catboost/jvm-packages/catboost4j-prediction/src/native/fix_jni_headers.py
fix_jni_headers.py
py
394
python
en
code
null
github-code
36
32829594866
# 내 풀이 from bisect import bisect_left, bisect_right def count_x(array, x): left_idx = bisect_left(array, x) # 정렬된 배열에 x를 삽입할 가장 왼쪽 인덱스 찾기 right_idx = bisect_right(array, x) # 정렬된 배열에 x를 삽입할 가장 왼쪽 인덱스 찾기 return right_idx - left_idx # x의 개수 n, x = map(int, input().split()) numbers = list(map(int, input...
veluminous/CodingTest
[이것이 코딩테스트다] 실전 문제/[이진탐색] 정렬된 배열에서 특정 수의 개수 구하기.py
[이진탐색] 정렬된 배열에서 특정 수의 개수 구하기.py
py
543
python
ko
code
0
github-code
36
8435375603
from aiogram import types, Dispatcher from config import bot, dp, ADMINS import random async def game(message: types.Message): if message.text.startswith('game') and message.from_user.id in ADMINS: list_emoji = ['⚽', '🏀', '🎰', '🎳', '🎯', '🎲'] emoji_random = random.choice(list_emoji) awa...
kasi170703/bots
handlers/admin.py
admin.py
py
577
python
en
code
0
github-code
36
8567322626
# coding: utf-8 #from PyInstaller.utils.hooks import copy_metadata, collect_data_files #datas = copy_metadata('google-api-python-client') #datas += collect_data_files('googleapiclient.discovery') #datas += collect_data_files('PyInstaller.utils.hooks') import os, sys, re import pandas as PD from datetime impo...
jameswhc/QUA
QUA_Classify.py
QUA_Classify.py
py
19,830
python
en
code
0
github-code
36
23414624364
# -*- coding: utf-8 -*- from hotkeynet import api class TestScript: def test_render(self): with api.Script() as script: api.Label(name="w1", window="WoW1") api.Label(name="w2", window="WoW2") with api.Command( name="LaunchAndRenameGameClient", ...
MacHu-GWU/hotkeynet-project
tests/test_script_script.py
test_script_script.py
py
954
python
en
code
4
github-code
36
13460739357
import torch, torchvision import os class CNN(torch.nn.Module): def __init__(self, network_type, dataset_name): super(CNN, self).__init__() self.network_type = network_type if dataset_name == 'dogscats': classes = 2 elif dataset_name == 'imagenet': class...
burklight/Adversarial-Attacks-Pytorch
src/networks.py
networks.py
py
943
python
en
code
0
github-code
36
8247729107
import cdd from numpy import array, hstack, vstack def cdd_solve_lp(c, G, h, A=None, b=None): """ Solve a linear program defined by: minimize c.T * x subject to G * x <= h A * x == b using the LP solver from `cdd <https://github.com/mcmtroffaes/pycdd...
furiiibond/Tinder
venv/Lib/site-packages/lpsolvers/cdd_.py
cdd_.py
py
1,497
python
en
code
0
github-code
36
16964477743
from bs4 import BeautifulSoup import re import requests ENROLLMENT_BOUNDS = { 0: [0, 5000], 1: [5000, 15000], 2: [15000, 30000], 3: [30000, 10000000], } def get_college_basic(uni_id_list): where_str = '' order_by_str = 'ORDER BY (CASE' counter = 1 for id in uni_id_list: id_str...
michaelpri10/collegecalculator
query_schools.py
query_schools.py
py
10,807
python
en
code
0
github-code
36
28798137601
def squares(list): for i in range(len(list)): list[i] = int(list[i]) ** 2 print(list) def main(): input_list = input("Enter values separated by a space: ") list = input_list.split() print(list) squares(list) print("the new list is: ", list) main()
Eric-Wonbin-Sang/CS110Manager
2020F_hw5_submissions/kohlimeher/hw chap 6.py
hw chap 6.py
py
285
python
en
code
0
github-code
36
3909141090
#Osiris Team binary decoding program #Written originally by Dustin Smith #input grab binaryString = input("Input binary string: ") #checks if the message is encoded in ASCII 7 or binary 8 via modulus if(len(binaryString)%8==0): ASCIISize = 8 elif(len(binaryString)%7==0): ASCIISize = 7 #indexes the string based...
cyberstormosiris/Cyberstorm_Code
binary.py
binary.py
py
665
python
en
code
0
github-code
36
5318351393
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import scipy from scipy.misc import derivative def fn_plot1d(fn, x_min, x_max, filename): num_values = 1000 x = np.linspace(x_min, x_max, num_values) fnv = np.vectorize(fn) y = fnv(x) Xlabel = "X axis" Yl...
CS251-Fall-2020/outlab4-190050013-190070020
task4/task4.py
task4.py
py
2,230
python
en
code
0
github-code
36
17849902067
from scripts.src.common.config import Color, Keywords, Direct, DataType from common_and_plotting_functions.functions import check_and_mkdir_of_direct from scripts.src.common.plotting_functions import multi_row_col_bar_plot from scripts.data.common_functions import common_data_loader from scripts.model.model_loader im...
LocasaleLab/Automated-MFA-2023
scripts/src/experimental_data_analysis/specific_data_model_combination/renal_carcinoma_invivo_infusion.py
renal_carcinoma_invivo_infusion.py
py
21,216
python
en
code
0
github-code
36
27145275012
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/7/3 16:46 # @Author : wenlei ''' 找二叉树节点的后续节点 ''' class Node(): def __init__(self, x): self.value = x self.left = None self.right = None self.parent = None def getSuccessorNode(node): if not node: return ...
sherryxiata/zcyNowcoder
basic_class_04/SuccessorNode.py
SuccessorNode.py
py
3,649
python
en
code
0
github-code
36
19686841128
from argparse import ArgumentParser import tabulate argparser = ArgumentParser() argparser.add_argument('--device', type=int, required=True, help='id of device to run training on.') argparser.add_argument('--seed', type=int, required=True, help='random seed to use for training.') argparser.add_argument('--dir', type=s...
ChaseDuncan/2dunet
train.py
train.py
py
9,434
python
en
code
0
github-code
36
6797208641
# app imports import random from django.utils.translation import ugettext_lazy as _ from django.conf import settings from utils.faker_factory import faker from ..mails import BaseMailView class InvitationConsultantProjectMailView(BaseMailView): template_name = 'mails/invitation_consultant_project.html' man...
tomasgarzon/exo-services
service-exo-mail/mail/mailviews/invitation_consultant_project.py
invitation_consultant_project.py
py
1,281
python
en
code
0
github-code
36
13097992788
# !/usr/bin/env python # -*- coding: utf-8 -*- """ @author: lishuang @description: 利用 LSTM 预测股票价格 """ import os from itertools import chain import matplotlib.pyplot as plt import numpy as np import pandas as pd from tensorflow.keras.layers import Dense, Dropout, LSTM from tensorflow.keras.models import load_model, Se...
TatenLee/machine-learning
bi/core/l8/stock_lstm.py
stock_lstm.py
py
4,659
python
en
code
1
github-code
36
4635120984
#coding=utf-8 from confluent_kafka import Producer import MySQLdb import json import time import random p = Producer({"bootstrap.servers": "118.24.53.99:9092"}) db = MySQLdb.connect("localhost", "root", "123456", "test_kafka", charset='utf8' ) cursor = db.cursor() sql = "SELECT msg_body FROM order_kafka_msg;" def ...
liu-xiaoran/demo
java/kafka/pd2.py
pd2.py
py
1,018
python
en
code
0
github-code
36
31428868731
# 2021.09.12 # 2484 # 주사위 네개 def reward(ls): ls.sort() set_ls = set(ls) len_set = len(set_ls) if len_set == 1: # 4개가 같을 때 result.append(50000 + ls[0] * 5000) return elif len_set == 2: if ls[1] != ls[2]: # 2개, 2개씩 같을 때 result.append(2000+(ls[1]+ls[2])*500) ...
Minkeyyyy/OJ
BaekJoon/All/2484.py
2484.py
py
812
python
ko
code
0
github-code
36
1576881503
from setuptools import setup, find_packages with open('readme.md', encoding='utf-8') as f: long_description = f.read() setup( packages = find_packages(), name = 'pbat', version = '0.0.16', author = "Stanislav Doronin", author_email = "mugisbrows@gmail.com", url = 'https://github.com/mugise...
mugiseyebrows/pbat
setup.py
setup.py
py
705
python
en
code
0
github-code
36
34603286556
import input_data import tensorflow as tf import input_data # 数据集导入 mnist = input_data.read_data_sets("C:\\USers\\hyq\\PycharmProjects\\DataAnalysis", one_hot=True) # 实现回归模型 x = tf.placeholder("float", [None, 784]) W = tf.Variable(tf.zeros([784,10])) b = tf.Variable(tf.zeros([10])) # 建立模型 y = tf.nn.softmax(...
cloud0606/AI
BP神经网络/read.py
read.py
py
1,067
python
en
code
0
github-code
36
42493495025
from __future__ import absolute_import, print_function, division import os from string import Template import numpy as np import theano from theano import Apply from theano.tensor import as_tensor_variable from theano.tensor.sort import TopKOp from .basic_ops import (GpuKernelBase, Kernel, infer_context_name, ...
Theano/Theano
theano/gpuarray/sort.py
sort.py
py
12,720
python
en
code
9,807
github-code
36
43844905296
import argparse from dataclasses import dataclass from decimal import * import re import sys from typing import Dict, List int_re = re.compile('[-+]?[0-9]+') float_re = re.compile('[-+]?[0-9]+(\.[0-9]+)?') def extract_int(l: str) -> (int, str): m = int_re.match(l) assert m s = m.group() return int(...
brouhaha/gridcheck
gridcheck.py
gridcheck.py
py
4,133
python
en
code
0
github-code
36
17096720993
# ############################################################################# # 本題參數設定,請勿更改 seed = 0 # 亂數種子數 # ############################################################################# import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd evaluation = pd.DataFrame({'Model...
neochen2701/TQCPans
機器學習Python 3答案檔/MLA305.py
MLA305.py
py
5,623
python
en
code
4
github-code
36
41473256040
from PyQt5.QtWidgets import QLabel, QApplication, QDialog, QGridLayout, QHBoxLayout, QPushButton, QFormLayout, \ QWidget, \ QLineEdit import sys from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon class calculator_frame(QDialog): def __init__(self): super().__init__() self.shower = Q...
siuwhat/calculator
calculator_frame.py
calculator_frame.py
py
5,213
python
en
code
0
github-code
36
2014305094
import speech_recognition as sr import pyttsx3 def SpeakText(command): engine = pyttsx3.init() engine.say(command) engine.runAndWait() def CollectText(x, gram): recognizer = sr.Recognizer() microphone = sr.Microphone() with microphone as source: recognizer.adjust_for_ambient_noise(sour...
Dorito-Dog/Python_Ktane_Bot
solvers/solverSpeech.py
solverSpeech.py
py
488
python
en
code
0
github-code
36
34222275021
from django.shortcuts import render, redirect from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.contrib.auth import login as auth_login, logout as auth_logout from django.views.decorators.http import require_http_methods from .forms import CustomUserCreationForm @require_http_metho...
kimhyunso/exampleCode
django/ONE_TO_MANY/accounts/views.py
views.py
py
1,375
python
en
code
0
github-code
36
18647131917
from django.http import HttpResponse from django.template import RequestContext from taikoexplorer_db.models import Video, Composer, Song, Group, SongStyle, ComposerSong, VideoSong, VideoGroup from django.core import serializers from django.forms.models import model_to_dict from django.db.models import Count import yo...
mitchfuku/taikoexplorer
taikoexplorer/data.py
data.py
py
12,403
python
en
code
1
github-code
36
10663470223
log_file_name = 'log.txt' warnings_count = 0 info_count = 0 error_count = 0 try: with open(log_file_name,'r') as log_file: for line in log_file: print(line) if(line.find('INFO:') > -1): info_count+= 1 elif(line.find('ERROR:') > -1): error...
santosh-potu/python-test
devops_bootcamp_excercise/test_log_file.py
test_log_file.py
py
611
python
en
code
0
github-code
36
72488882665
from rest_framework import viewsets, views from ..models import * from .serializers import * from rest_framework.permissions import * from rest_framework.response import Response from rest_framework.exceptions import NotFound, ValidationError from rest_framework import mixins from .custom_mixins import CreateListModelM...
artgas1/dlab_django
lab/lab_web/views/api.py
api.py
py
18,206
python
en
code
1
github-code
36
16908305317
# import package import os, random, tweepy, time, schedule def job(): folder=r"F:\mat\twitterbot\pics" # Set your folder here, twitter allows .jpg, .jpeg, .png, .gif and mp4 videos to be uploaded as media. # Current limitations as of 18/07/2...
mdsmendes94/twitterdailybot
ttbot.pyw
ttbot.pyw
pyw
1,988
python
en
code
1
github-code
36
12303872667
from albumentations.augmentations.transforms import Normalize import torch import torchvision import albumentations import albumentations.pytorch from adamp import AdamP import torch.nn as nn from torch.utils.data import Dataset, DataLoader from torchsummary import summary as summary_ from dataset import C...
taeyang916/kaggle_fruits
train.py
train.py
py
2,350
python
en
code
1
github-code
36
74298282342
#!/usr/bin/env python #encoding=utf8 BLACK = 'B' WHITE = 'W' NONE = "N" class Point: def __init__(self, x, y, color): self.x = x self.y = y self.color = color @property def neighbours(self): return [ (self.x - 1, self.y), (self.x + 1, self.y), (sel...
xiaket/exercism
python/go-counting/go_counting.py
go_counting.py
py
3,755
python
en
code
0
github-code
36
2364287539
from PyQt5 import QtWidgets, uic,QtSql,QtCore from rajon_1 import Ui_Dialog import sqlite3 as sql from vypocet import vypocty from data import Databaze from PyQt5.QtWidgets import QFileDialog from cesta import path import math class Rajon(QtWidgets.QDialog,Ui_Dialog): def __init__(self,cesta_projektu): su...
ctu-yobp/2020-a
app/rajon_2.py
rajon_2.py
py
4,041
python
en
code
0
github-code
36
10337668124
hrs = input("Enter Hours:") rate = input("Enter Rate:") try: h = float(hrs) r = float(rate) except: print("Error, please enter numeric input") quit() def computepay(hours, rates): otrate = rates * 1.5 if hours <= 40: grosspay = hours * rates else: grosspay = (40 * rates) + (...
maxoconnor1/Python-for-Everybody
PFE_4.6.py
PFE_4.6.py
py
405
python
en
code
0
github-code
36
20515420312
import os import PyPDF2 import openai from flask import Flask, redirect, render_template, request, url_for app = Flask(__name__) # Set your API key directly os.environ["OPENAI_API_KEY"] = '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' openai.api_key = os.getenv("OPENAI_API_KEY") @app.route("/", methods=["GET"...
OUABSL/Congreso
app.py
app.py
py
1,642
python
es
code
0
github-code
36
17778652132
from PyQt4.QtGui import * from PyQt4.QtCore import * import matplotlib.pyplot as plt import matplotlib.backends.backend_qt4agg import ReportDBOps as db class ReportLogs(QWidget): def __init__(self): super(ReportLogs, self).__init__() # Main Layout self.mainGridLayout = QGridLayout() ...
subhamoykarmakar224/WindowsThreatAttackAnalyzer
ReportLogs.py
ReportLogs.py
py
2,477
python
en
code
0
github-code
36
27705026419
# Knowledge Technologies Project 1 # Mitchell Brunton #537642 # mmbrunton@gmail.com # # Configurable settings # file containing twitter user ids and their locations USER_FILE = 'data/training_set_users.txt' # do we only want substrings in our trie which start with a new word NEW_WORD_SUBSTRINGS = True # how much edi...
mbrunton/twitter_locations
configurations.py
configurations.py
py
444
python
en
code
0
github-code
36
33390403216
from django.shortcuts import redirect, render from animalprofile.models import Animal, Kind from userprofile.models import UserAccount from .forms import SearchAnimalsForm def index(request): if request.method == 'POST': form = SearchAnimalsForm(request.POST) if form.is_valid(): try: ...
manulovich/zoo-friend
zoofriends/animalprofiles/views.py
views.py
py
1,839
python
en
code
0
github-code
36
7114744218
import numpy as np import pandas as pd from sklearn.preprocessing import Imputer import keras from keras.utils import np_utils # Veri dosya üzerinden okunur. data = pd.read_csv('spambase.data') # PART 1 - DATAPREPROCESSING # Okunan veri girdi ve çıktı olarak ayrıştırılır. input_datas = np.array(data.iloc[:,:57]) out...
zekikus/Yapay-Sinir-Agi-Uygulamalari
SpamBase_ANN/SpamBase_ANN.py
SpamBase_ANN.py
py
3,448
python
tr
code
8
github-code
36
20371505372
import tensorflow as tf gpus = tf.config.list_physical_devices('GPU') if gpus: tf.config.set_logical_device_configuration(gpus[0], [tf.config.LogicalDeviceConfiguration(memory_limit=5292)]) import keras import matplotlib.pyplot as plt import numpy as np from keras import layers, optimizers, losses, metrics, Model...
Logann120/Logann120.github.io
img_gen/python_code/img_gen.py
img_gen.py
py
7,935
python
en
code
0
github-code
36