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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
18363144949 | a,b=map(int,input().split())
count = 0
num = 0
for i in range(int((a+b)/2)-5, int((a+b)/2)+5):
if abs(a-i) == abs(b-i):
count += 1
num = i
if count > 0:
print(num)
else:
print("IMPOSSIBLE") | Aasthaengg/IBMdataset | Python_codes/p02957/s402072802.py | s402072802.py | py | 203 | python | en | code | 0 | github-code | 90 |
4946296430 | # coding:utf-8
# __autor__:'cyb'
# sqlite示例 查询 修改 删除
import sqlite3
connect = sqlite3.connect("testsqlite.db")
cursor = connect.cursor()
cursor.execute("""
SELECT id,name from student;
""")
student_list = cursor.fetchall()
print(student_list)
cursor.execute("""
SELECT * FROM student WHERE name="小青";
... | wantwantwant/tutorial | L10数据库基础sqlite(重要)/《3》sqlit_select.py | 《3》sqlit_select.py | py | 3,722 | python | zh | code | 1 | github-code | 90 |
10972727567 | # -*- coding: utf-8 -*-
# author: itimor
import requests
import datetime
salt_info = {
"url": "http://salt.tbsysmanager.com:8080",
"username": "saltdev",
"password": "FF01VeF4hs1FqZ5M"
}
class SaltAPI(object):
def __init__(self, url, username, password):
self.__url = url
... | OpsWorld/oms | omsBackend/salts/saltapi.py | saltapi.py | py | 5,505 | python | en | code | 37 | github-code | 90 |
71877451176 | import os
import glob
import datetime
import hashlib
import json
import numpy
from numpy import random
from keras import models
from keras import layers
from matplotlib import pyplot
name, ext = os.path.splitext(__file__)
MODELS_DIR = 'models_' + name
examples_amount = 100000
x_start = 0
x_end = 50
x_size = x_end -... | ihoromi4/cnn_spectrum_approximate | approximate/hypothesis_22.py | hypothesis_22.py | py | 8,247 | python | en | code | 0 | github-code | 90 |
72292470698 | # 주요변수에 대한 설명
# N : 정렬해야하는 원소들의 수
# arr : 정렬해야하는 원소를 가지고 있는 리스트
'''문제해결 팁
1. 전체 선택정렬 알고리즘에 대한 코드를 공부했다면 해결할 수 있다.
'''
T = int(input())
for test_case in range(1, T + 1):
############################################################
N = int(input())
arr = list(map(int, input().split()))
###############... | ldgeao99/Algorithm_Study | SW_Academy/Programming_Intermediate/2. Python_SW_Problem_Solving_Basic-LIST2/Q4. 4843 특별한 정렬(선택정렬).py | Q4. 4843 특별한 정렬(선택정렬).py | py | 994 | python | ko | code | 0 | github-code | 90 |
32414677215 | from flask import Flask, request, redirect, render_template, url_for
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
#user:password@server:portNumber/databaseName
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://buildblog:buildblog@localhost:3306/buildblog'
#Not for deployment
app.config['SQLALC... | antwon97/BuildABlog | main.py | main.py | py | 1,812 | python | en | code | 0 | github-code | 90 |
19910102076 | print("Welcome to the Assil Canteen")
print("1.Veg")
print("2.Non-Veg")
items=[]
count=0
price=0
option=input("Select one of the following options given above")
#if the user selects the veg option
if option == '1':
print("1.Masala Dosa")
print("2.Idli")
print("3.Veg Puff")
print("4.Fried Rice")
prin... | firas98/Python-program | canteen.py | canteen.py | py | 1,703 | python | en | code | 0 | github-code | 90 |
22346763105 | """Pipeline module."""
from typing import Any
from typing_extensions import Self
from pysetl.utils import BenchmarkResult, pretty
from pysetl.utils.exceptions import InvalidDeliveryException, PipelineException
from pysetl.utils.mixins import (
HasRegistry, HasLogger, IsIdentifiable, HasBenchmark,
HasDiagram
)
f... | JhossePaul/pysetl | src/pysetl/workflow/pipeline.py | pipeline.py | py | 10,279 | python | en | code | 0 | github-code | 90 |
18641651323 | #!/usr/bin/env python3
# coding : utf-8
# Date : 2022/5/6
# Author: knight2008
# QQ&Wechat: 496966425
# TG: @knight2008
# Filename: batch_get_balance.py
# Github: https://github.com/knight2008
# 版权:自由转载-开源免费-任意使用
# 功能: 批量查询 EVM chain 基础币余额 或 ERC20 token 余额
# 版本: Python 3.8.6
# 依赖库:
# pip install argparse
... | knight2008/eth-tools | batch_get_balance.py | batch_get_balance.py | py | 2,987 | python | en | code | 4 | github-code | 90 |
40730344229 | from conf import conf
from pro_data import dataloader
from Model import ADMN
import pickle
import time
import os
def save_data(data,parameter):
now = time.strftime('%Y%m%d_%H%M%S', time.localtime(time.time()))
save_path = os.path.join(os.getcwd(), "Result")
save_file = os.path.join(save_path, str(parameter... | wiio12/ADMN | main.py | main.py | py | 2,756 | python | en | code | 4 | github-code | 90 |
70904584617 | array = list(map(int, input()))
#제일 처음 value로 시작
result = array[0]
for i in array[1:]:
if result <= 1 or i <= 1:
result += i
else: result *= i
print(result) | dohun31/algorithm | 2021/week_01/greedy/02곱하기혹은더하기.py | 02곱하기혹은더하기.py | py | 189 | python | ko | code | 1 | github-code | 90 |
5390590202 |
from rich.console import Group
import time
from rich.columns import Columns
from rich.console import Console
from rich.panel import Panel
from rich.markdown import Markdown
from rich.align import Align
from rich.table import Table
from rich import print
from rich.layout import Layout
import win32gui, win32c... | DamnUi/PyStats | All current dashboard ideas.py/design 1.py | design 1.py | py | 1,316 | python | en | code | 7 | github-code | 90 |
73679664935 | n, k = map(int, input().split())
dp = [10001] * (k + 1)
dp[0] = 0
for i in list(int(input()) for _ in range(n)):
for j in range(i, k + 1):
dp[j] = dp[j] if dp[j] < dp[j - i] + 1 else dp[j - i] + 1
if dp[j] > 10000:
print(-1)
exit()
print(dp[k]) | y7y1h13/Algo_Study | 백준/Silver/2294. 동전 2/동전 2.py | 동전 2.py | py | 264 | python | en | code | 0 | github-code | 90 |
18881559055 | import json
class StatsVM:
def __init__(self, _attribute, _min, _max, _avg, _stdv, _median, _iqr, _q1, _q3):
self._attribute = _attribute
self._min = _min
self._max = _max
self._avg = _avg
self._stdv = _stdv
self._median = _median
self._iqr = _iqr
se... | MarcinJaworski247/kepler-classifier | api/app/main/util/stats_vm.py | stats_vm.py | py | 468 | python | en | code | 0 | github-code | 90 |
22936096372 | """
Team Id: HC#3266
Author List: Hemanth Kumar K L, Mahantesh R, Aman Bhat T, Nischith B.O.
Filename: main.py
Theme: Homecoming
Functions: run_module , imshow , predict
Global variables: class_names
"""
import torch
from torchvision.transforms import transforms
from torch.autograd import Variable
from P... | MahanteshR/eYRC_2018 | Task3/Task3a/Code/main.py | main.py | py | 5,489 | python | en | code | 0 | github-code | 90 |
382953529 | # -*- coding: utf-8 -*-
import scrapy
from ..items import BookItem
class BookSpider(scrapy.Spider):
name = 'book'
allowed_domains = ['book.douban.com']
start_urls = 'https://book.douban.com/top250'
def start_requests(self):
yield scrapy.Request(url=self.start_urls, callback=self.parse_b... | WhiteBrownBottle/Python- | DouBan/DouBan/spiders/book.py | book.py | py | 1,723 | python | en | code | 0 | github-code | 90 |
10237098646 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
import codecs
import os
import random
import tempfile
import numpy as np
from prepare_dict import load_lexicon
from compare_lexicons import compare_lexicons
def create_tmp_file_name():
basedir = os.path.join(os.path.dirname(__fil... | nsu-ai-team/russian_g2p_neuro | do_experiments.py | do_experiments.py | py | 9,704 | python | en | code | 19 | github-code | 90 |
74728744935 | #!/usr/bin/env python3
class Solution:
def searchInsert(self, nums: [int], target: int) -> int:
left = 0
right = len(nums) - 1
while left <= right:
mid = (left + right)//2
if nums[mid] == target:
return mid
elif nums[mid] > target:
right = mid-1
else:
left = mid+1
if left>=right and n... | GeneralLi95/leetcode | Python/35.py | 35.py | py | 478 | python | en | code | 0 | github-code | 90 |
29307286053 | import numpy as np
import matplotlib.pyplot as plt
import librosa
import librosa.display
import os
import sys
import tensorflow as tf
import dataset
def get_dev_eval_str(idx):
if idx == 0:
output = 'dev_data'
else:
output = 'eval_data'
return output
def get_machine_... | PDDBori/DCASE2020 | WN_figure.py | WN_figure.py | py | 10,475 | python | en | code | 0 | github-code | 90 |
36508004638 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 4 16:14:55 2022
@author: amanda
"""
##define function##
def calculate_savings(portion_saved, current_savings, monthly_salary):
for months in range (0, 36):
current_savings = current_savings + (current_savings*r/12.0) + \
(... | Amanda-Wright17/6.0001 | pset1/ps1c.py | ps1c.py | py | 1,857 | python | en | code | 0 | github-code | 90 |
43852855880 | from scipy.spatial.distance import cdist
import scipy.io as sio
from FeatureExtractor import *
from config import *
import h5py
def extractLayerFeat_whole_fixrr(category, extractor, resize_tar, set_type='train'):
print('extracting {} set features for {} at resize value {}'.format(set_type, category, resize_tar))
... | qliu24/SP | src/extractLayerFeat_whole_fixrr.py | extractLayerFeat_whole_fixrr.py | py | 3,465 | python | en | code | 0 | github-code | 90 |
12474073056 | from aiogram.types import InlineKeyboardMarkup
from aiogram.utils.callback_data import CallbackData
from tgbot.misc.markup_constructor.inline import InlineMarkupConstructor
class UsersInlineMarkup(InlineMarkupConstructor):
def menu(self, is_admin: bool) -> InlineKeyboardMarkup:
schema = [2, 1]
a... | mandico21/bot_course_task | tgbot/keyboards/inline/iusers.py | iusers.py | py | 1,494 | python | en | code | 1 | github-code | 90 |
18455772409 | from heapq import heappush, heappop
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
sushi = [None] * N
for i in range(N):
t, d = map(int, input().split())
sushi[i] = (d, t-1)
sushi.sort(reverse=True)
types = set()
cand = []
s = x = 0
for d, t in sushi[:K]:
if t in types:
he... | Aasthaengg/IBMdataset | Python_codes/p03148/s200889209.py | s200889209.py | py | 605 | python | en | code | 0 | github-code | 90 |
10540116381 | import os
import glob
import pdftotext
import re
import math
def print_options():
print("Please select an option from below:")
print("1. Set directory for indexing")
print("2. Add search category")
print("3. Build index")
print("4. Print index")
print("5. Enter query")
print("(or type 'qui... | dawsfox/laase | laase.py | laase.py | py | 6,860 | python | en | code | 0 | github-code | 90 |
23578212893 | #!/bin/usr/python
from threading import *
from time import sleep
class Prod:
def __init__(self):
self.products=[]
#self.flag=False
self.c=Condition()
def produce(self):
self.c.acquire()
for i in range(1,5):
self.products.append("Product"+str(i))
... | kokot300/python-core-and-advanced | threadcommunicationusingthreatingapi.py | threadcommunicationusingthreatingapi.py | py | 849 | python | en | code | 0 | github-code | 90 |
41276430363 | import torch
from torch import nn
from torchvision import models
import config
def load_model():
model = models.vgg16(pretrained=True, progress=True)
# Freezing other layers of the model
for p in model.parameters():
p.requires_grad = False
model.classifier = nn.Sequential()
model.classifi... | akuma527/IProjects | Fruit_Prediction/scripts/model.py | model.py | py | 648 | python | en | code | 0 | github-code | 90 |
34681053325 | def __check(A):
for i in A:
if i % 2 == 0:
continue
else:
# print(i,"は2で割れません")
return 1
return 0
def do_division(A, count, n):
if __check(A) == 0:
for i in range(n):
# print(count - 1, "回目の処理です。\nprint before:", A[i])
A[i] = A[i] / 2
# print("print after:", A[i])
count += 1
# print("pri... | fideguch/AtCoder_answers | AtCoder_Beginners_Selection/made_by_python/shift_only.py | shift_only.py | py | 605 | python | en | code | 0 | github-code | 90 |
7927690601 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# gingerprawn / api.ui / draggable Grid control
# this code is taken from wxPython demo with minor modifications
import wx
import wx.grid as gridlib
import wx.lib.gridmovers as gridmovers
from gingerprawn.api.utils.titledtable import TitledTable
#-----------------------... | xen0n/gingerprawn | gingerprawn/api/ui/dragablegrid.py | dragablegrid.py | py | 7,749 | python | en | code | 1 | github-code | 90 |
27613616394 | from data.redressal import Redressal
from repository.issue_repository import IssueRepository
from repository.redressal_repository import RedressalRepository
from data.const import IN_PROGRESS, PENDING, REDRESSED, REJECTED
from utils.printing import print_issue_details, print_issues, print_redressal_details, print_redre... | Farhan-Khalifa-Ibrahim/CZ4010-Project | admin.py | admin.py | py | 8,306 | python | en | code | 0 | github-code | 90 |
27992718025 | import os
import setuptools
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "PyAnEn", "version.py")) as fp:
exec(fp.read())
setuptools.setup(
name="PyAnEn",
version=__version__,
author="Weiming Hu",
author_email="huweiming950714@gmail.com",
description="The pyth... | Weiming-Hu/PyAnEn | setup.py | setup.py | py | 889 | python | en | code | 3 | github-code | 90 |
5645258036 | # coding: utf-8
'''
Veredi Mediator Message.
For a server mediator (e.g. WebSockets) talking to a game.
'''
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from typing import (TYPE_CHECKING,
... | cole-brown/veredi-code | interface/mediator/message.py | message.py | py | 19,684 | python | en | code | 1 | github-code | 90 |
7621789259 | import os
import asdf
import pytest
from astropy.time import Time
from roman_datamodels.testing.utils import mk_level2_image
from roman_datamodels.datamodels import ImageModel, FlatRefModel
from romancal.stpipe import RomanPipeline, RomanStep
@pytest.mark.parametrize("step_class", [RomanPipeline, RomanStep])
def t... | kmacdonald-stsci/romancal | romancal/stpipe/tests/test_core.py | test_core.py | py | 3,071 | python | en | code | null | github-code | 90 |
8727567558 | # Practice Exercise 6_1 (decision control)
def seizoen(maand):
if 0 <= maand <= 2:
print('Het is winter')
elif 3 <= maand <= 5:
print('Het is lente')
elif 6 <= maand <= 8:
print('Het is zomer')
elif 9 <= maand <= 11:
print('Het is herfst')
seizoen(2)
#Practice Exercis... | Fardowsa030/Programmeren | Practice Exercises/Les 6.py | Les 6.py | py | 1,896 | python | nl | code | 0 | github-code | 90 |
1249440112 | import dateparser
import scrapy
import time
import datetime
import json
import re
from scrapy import Selector
from tpdb.BasePerformerScraper import BasePerformerScraper
from tpdb.items import PerformerItem
class PornCZPerformerSpider(BasePerformerScraper):
name = 'PornCZPerformer'
network = 'PornCZ'
star... | SFTEAM/scrapers | performers/networkPornczPerformer.py | networkPornczPerformer.py | py | 4,842 | python | en | code | null | github-code | 90 |
24247433868 | class Pet:
def __init__(self, name, type, tricks, health, energy, sound):
self.name = name
self.type = type
self.tricks = tricks
self.health = health
self.energy = energy
self.sound = sound
def sleep(self):
self.energy += 25
return self
def ea... | EmilioTello/Python_Part_1 | fundamentals/fundamentals/Dojo_Pets.py | Dojo_Pets.py | py | 1,576 | python | en | code | 0 | github-code | 90 |
2653496374 | from dataclasses import dataclass
from distutils.sysconfig import PREFIX
from tokenize import maybe
from typing import List, Optional, Tuple
import rdflib
from pathlib import Path
def get_first_interaction_uri(grap: rdflib.Graph) ->str:
interaction_uri = """
SELECT ?conversationmap ?interaction
WHERE{
... | nimshi89/Individual_Project | Project.py | Project.py | py | 4,185 | python | en | code | 0 | github-code | 90 |
28734464160 | import json
import os
import confuse
import boto3
from botocore.exceptions import ClientError
from cachetools import Cache
required_credentials = [
'aws_access_key',
'aws_secret_key',
'lwa_app_id',
'lwa_client_secret'
]
class MissingCredentials(Exception):
"""
Credentials are missing, see th... | LancersSEO/sp-api-amazon | base/credential_provider.py | credential_provider.py | py | 4,890 | python | en | code | 0 | github-code | 90 |
18202398619 | N = int(input())
A = list(map(int, input().split()))
if 0 in A:
print(0)
else:
ans = 1
a = sorted(A, reverse=True)
for i in a:
ans *= i
if ans > 10 ** 18:
print(-1)
break
else:
print(ans) | Aasthaengg/IBMdataset | Python_codes/p02658/s187258590.py | s187258590.py | py | 256 | python | en | code | 0 | github-code | 90 |
18242444649 | def divisors(n):
lst = []; i = 1
while i * i <= n:
q, r = divmod(n, i)
if r == 0:
lst.append(i)
if i != q: lst.append(q)
i += 1
return lst
N = int(input())
ans = len(divisors(N-1)) - 1
divs = divisors(N)
for k in divs:
if k == 1: continue
temp = N
... | Aasthaengg/IBMdataset | Python_codes/p02722/s811950870.py | s811950870.py | py | 394 | python | en | code | 0 | github-code | 90 |
34384607257 | class InvalidFormatException(Exception):
"""Raised when the input format isn't fitting"""
pass
class InvalidOperatorException(Exception):
"""Raised when the operator format isn't fitting"""
pass
# Checks if number is one digit and integer
def is_one_digit(v):
v = float(v)
output = - 10 < v <... | Cilosan/calculator | main.py | main.py | py | 3,323 | python | en | code | 0 | github-code | 90 |
1964853761 | import retro #pip install gym-retro
import numpy as np #pip install numpy
import cv2 #pip install opencv-python==4.1.2.30
import neat #pip install neat-python
import pickle #pip install pickle
#IMPORTANT! You need the ROMS of Balloon Fight and Arkanoid to run this.
#Note the original co... | ZackPoorman/CIS365-Project-3 | TrainingAlg.py | TrainingAlg.py | py | 4,672 | python | en | code | 2 | github-code | 90 |
11609423816 | import os
import sys
sys.path.append("./")
# pylint:disable=no-name-in-module
from PySide2.QtWidgets import QApplication
from GWA2019.anmorph import AnmorphWindow
if __name__ == "__main__":
if len(sys.argv) >= 2:
app = QApplication(sys.argv)
data_path = sys.argv[1]
if not os.path.ex... | seantyh/GWA2019 | anmorph.py | anmorph.py | py | 552 | python | en | code | 0 | github-code | 90 |
12303475940 | import sqlite3
from api_ege.database.Problem import Problem
class Database:
def __init__(self):
self.db = sqlite3.connect('problems.db')
self.cursor = self.db.cursor()
self.cursor.execute('''
CREATE TABLE IF NOT EXISTS problems (
id INTEGER PRIMARY K... | BonePolk/AutoInfEgeSolver | api_ege/database/Database.py | Database.py | py | 1,041 | python | en | code | 1 | github-code | 90 |
7990456378 | import re
import reprlib
RE_WORD = re.compile('\w+')
class Sentence:
def __init__(self, text):
self.text = text
self.words = RE_WORD.findall(text)
def __getitem__(self, index):
return self.words[index]
def __len__(self):
return len(self.words)
# def __iter__(sel... | SELO77/selo_python | 3.X/FluentPython/14-iterator,generator/14-1.py | 14-1.py | py | 808 | python | en | code | 0 | github-code | 90 |
27093389228 | from spack import *
class Portcullis(AutotoolsPackage):
"""PORTable CULLing of Invalid Splice junctions"""
homepage = "https://github.com/maplesond/portcullis"
url = "https://github.com/maplesond/portcullis/archive/Release-1.1.2.tar.gz"
version('1.1.2', '5c581a7f827ffeecfe68107b7fe27ed60108325f... | matzke1/spack | var/spack/repos/builtin/packages/portcullis/package.py | package.py | py | 1,529 | python | en | code | 2 | github-code | 90 |
38984752044 |
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
plt.ioff()
# Parameters for user to set
testing_batch_size = 64
epochs = 10
plot_rows = 4 # num of test image rows to run and plot
plot_cols... | Adrian-Markelov/Deblurring | experiments/AE_model/AE_test.py | AE_test.py | py | 1,804 | python | en | code | 0 | github-code | 90 |
6384857318 | from unittest import TestCase
from unittest.mock import patch, MagicMock
from domain.book.entities.book_entity import Book, BookStatus
from domain.book_borrowing.entities.book_borrowing_entity import BookBorrowing, BookBorrowingBookStatus
from domain.book_borrowing.use_cases.return_book.return_book_use_case import Ret... | EduardoThums/online-bookstore-challenge | domain/book_borrowing/use_cases/return_book/return_book_use_case_test.py | return_book_use_case_test.py | py | 3,457 | python | en | code | 0 | github-code | 90 |
22205107861 | ### Requisitos
#Para resolver este problema, você deve usar no máximo três comparações básicasNão
#serão consideradas soluções que utilizem funções prontas para identificação dos valores maiores/menores
#--------------------------------------------------------------------------------------------------------
### Maior
... | amandachipolito/Estudos | Atividade8.py | Atividade8.py | py | 1,212 | python | pt | code | 0 | github-code | 90 |
383114929 | import requests
import os
from bs4 import BeautifulSoup
def get_html(url):
r = requests.get(url, timeout = 30)
r.raise_for_status()
r.encoding = 'gbk'
return r.text
def get_content(url):
html = get_html(url)
soup = BeautifulSoup(html, 'lxml')
#找到电影排行榜的ul列表
movie_list = soup.find('ul... | WhiteBrownBottle/Python- | dianying.py | dianying.py | py | 1,244 | python | en | code | 0 | github-code | 90 |
33074765629 | #!/usr/bin/env python3
import chess
import chess.pgn # read Portable Game Notation format
import chess.svg # Scalable Vector Graphics
from cairosvg import svg2png
import os
import io
from PIL import Image
from tqdm.auto import tqdm # Progress bar
from pydub import AudioSegment
images = dict([(os.path.splitext(f)[0], ... | UoA-eResearch/chess | generate.py | generate.py | py | 1,802 | python | en | code | 0 | github-code | 90 |
6593743891 | class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
"""
ncol = len(matrix[0])
zero_col = []
for index, row in enumerate(matrix):
if 0 in row:
zero_col = zero_col ... | ConorMcNamara/Project-Euleetcode | Leetcode/Python/73_setMatrixZeros.py | 73_setMatrixZeros.py | py | 494 | python | en | code | 0 | github-code | 90 |
40920895688 |
from testconfig import config
from collections import defaultdict
from tests.integration.core.chroma_integration_testcase import ChromaIntegrationTestCase
class TestStartingAndStoppingTargets(ChromaIntegrationTestCase):
def test_filesystem_stops_and_starts(self):
filesystem_id = self.create_filesystem_s... | GarimaVishvakarma/intel-chroma | chroma-manager/tests/integration/shared_storage_configuration/test_stop_and_start_filesystem.py | test_stop_and_start_filesystem.py | py | 2,150 | python | en | code | 0 | github-code | 90 |
21171911137 | import matplotlib.pyplot as plt
import pandas as pd
import argparse
import numpy as np
from pathlib import Path
from datetime import datetime
from loadingData import univariateDatasets
import os
def parse_args():
parser = argparse.ArgumentParser(description='Create plot 1')
parser.add_argument('--filepath', '... | JakubBilski/mini-fcm | src/render_heatmap_acc.py | render_heatmap_acc.py | py | 3,720 | python | en | code | 0 | github-code | 90 |
35133245169 | from django.core.cache import cache
prefix = 'player_'
def set_player_hall(key, value):
u_key = '%s%s' % (prefix, key)
if cache.has_key(u_key):
cache.delete(u_key)
cache.set(u_key, value)
def get_player_hall(key):
u_key = '%s%s' % (prefix, key)
if cache.has_key(u_key):
... | ydtg1993/shaibao-server-python | system/cache/player.py | player.py | py | 370 | python | en | code | 0 | github-code | 90 |
30786654314 | """
Radio button page test
"""
import time, unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
from pages.radio_button_page import RadioButtonPage
class TestRadioButton(unittest.TestCase):
RADIO_BTN = (By.XPATH, '/html/bod... | AntonioIonica/Automation_testing | OOP_formy/src/tests/test_radio_button_page.py | test_radio_button_page.py | py | 2,719 | python | en | code | 0 | github-code | 90 |
3753639128 | #Write pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours (Input: hours and rate).
hrs=int(input('Enter the number of hours the employee worked '))
rate=int(input("Enter the hourly rate "))
if hrs<=40:
pay=round(rate*hrs)
else:
pay=round(rate*40 + 1.5*rate... | Sounav201/itworkshop | Assignment2._Prog2.py | Assignment2._Prog2.py | py | 399 | python | en | code | 0 | github-code | 90 |
13117964979 | """This module contains helper functions for the api blueprint."""
import os
from flask import current_app
from datetime import datetime
def string_to_date(date_string, format):
"""Given a string date and format, return a
corresponding date object.
"""
try:
return datetime.strptime(date_str... | EricMontague/MailChimp-Newsletter-Project | server/app/api/helpers.py | helpers.py | py | 1,456 | python | en | code | 0 | github-code | 90 |
11601127778 | from setuptools import find_namespace_packages, setup
with open("README.md", encoding="utf8") as readme_file:
long_description = readme_file.read()
setup(
name="merlin",
version="0.0.1",
packages=[],
url="https://github.com/NVIDIA-Merlin/Merlin",
author="NVIDIA Corporation",
license="Apach... | NVIDIA-Merlin/Merlin | setup.py | setup.py | py | 804 | python | en | code | 627 | github-code | 90 |
3207647136 | # coding=utf-8
import json
from flask import Flask, jsonify, request
from flask_cors import CORS
from .entities.entity import Session, engine, Base
from .entities.exam import Exam, ExamSchema
###################################################
from .entities.phone_book import PhoneBook, PhoneBookSchema
######... | ted-ghd/react-flask-sample | 5th-191029/phone-book/backend/src/main.py | main.py | py | 1,489 | python | en | code | 0 | github-code | 90 |
48890916530 | import os
import time
import unittest
from selenium import webdriver
from pages.base_page import BasePage
from pages.dashboard import Dashboard
from pages.login_page import LoginPage
from utils.settings import DRIVER_PATH, IMPLICITLY_WAIT
from selenium.webdriver.chrome.service import Service
class TestLoginPage(unitte... | NataSQT/Challenge_NataliiaSokolova | test_cases/login_to_the_system.py | login_to_the_system.py | py | 1,783 | python | en | code | 0 | github-code | 90 |
22029052740 | def bin_to_dec(binary_str):
# 将二进制字符串转换为十进制整数
return str(int(binary_str, 2))
def dec_to_bin(decimal_str):
# 将十进制字符串转换为二进制字符串
decimal_int = int(decimal_str)
return bin(decimal_int)[2:]
def hex_to_dec(hex_str):
# 将十六进制字符串转换为十进制整数
return str(int(hex_str, 16))
def dec_to_hex(deci... | ShawnVon98/RaydarTest | RaydarTest.py | RaydarTest.py | py | 1,942 | python | en | code | 0 | github-code | 90 |
26717472414 | """
Toy Python Knowledgebase
"""
class Knowledgebase():
def __init__(self):
self._entities = {}
self._constraints = {}
self._inverses = {}
self._graph = KnowledgeGraph()
def ent(self, name, type=None):
""" Adds a new Entity to the graph. """
self._entities[name... | Yuffster/toykb | kb.py | kb.py | py | 7,440 | python | en | code | 1 | github-code | 90 |
73094946855 |
import Adafruit_DHT
#import adafruit_dht
#from board import *
DHT_SENSOR = Adafruit_DHT.DHT11
DHT_PIN = 17
#SENSOR_PIN = D4
#dht22 = adafruit_dht.DHT22(SENSOR_PIN, use_pulseio=False)
def get_data():
humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
#temperature = dht22.temperature
#h... | heavenluv/AC-Remote-Control | webapp/humidity.py | humidity.py | py | 607 | python | en | code | 0 | github-code | 90 |
30137664918 | # File: semantics.py
# Template file for Informatics 2A Assignment 2:
# 'A Natural Language Query System in Python/NLTK'
# John Longley, November 2012
# Revised November 2013 and November 2014 with help from Nikolay Bogoychev
# Revised October 2015 by Toms Bergmanis
# Revised October 2017 by Chunchuan Lyu with help fr... | adelliinaa/ProcessingNaturalLanguages-CW2 | statements.py | statements.py | py | 4,259 | python | en | code | 0 | github-code | 90 |
17862643547 | import animal
from math import sin, cos
class Aquarium:
def __init__(self, height, length):
self.Height = height
self.length = length
self.animals = {} # dict of tha object and there place re presented as x * y
"""
@property
def animals(self):
return se... | og134/aquarim | Aquarium.py | Aquarium.py | py | 1,653 | python | en | code | 0 | github-code | 90 |
1442450456 | class Solution:
def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]:
in_degree = [0] * numCourses
adj_list = [[] for x in range(numCourses)]
queue = []
final = []
counter = 0
for course, prereq in prerequisites:
... | tanyajha16/6Companies30Days | Intuit/Construct Schedule II.py | Construct Schedule II.py | py | 904 | python | en | code | 1 | github-code | 90 |
28151382291 | import PyDelFEM2 as dfm2
import PyDelFEM2.gl.glfw
import numpy
########################################
def example1():
cad = dfm2.Cad2D()
cad.add_polygon([+0,0, +1,0, +1,+1, 0,+1.0])
cad.add_polygon([+2,0, +3,0, +3,+1, 2,+1.0])
mesher = dfm2.Mesher_Cad2D(edge_length=0.03)
mesh = mesher.meshing(cad)
###... | nobuyuki83/pydelfem2 | examples_py/53_pbd_cloth.py | 53_pbd_cloth.py | py | 2,681 | python | en | code | 10 | github-code | 90 |
18263878569 | from bisect import bisect_left
import string
dic={c:[] for c in string.ascii_lowercase}
N=int(input())
S=list(input())
Q=int(input())
for i in range(len(S)):
dic[S[i]].append(i+1)
for i in range(Q):
a,b,c=map(str,input().split())
if a=='1':
if S[int(b)-1]==c:
continue
b=int(b)
f=S[b-1]
d=... | Aasthaengg/IBMdataset | Python_codes/p02763/s410883081.py | s410883081.py | py | 612 | python | en | code | 0 | github-code | 90 |
43978807060 | import os
import json
from web3 import Web3
from pathlib import Path
from typing import Any, Dict, List
PROTOCOL_TO_ID = {
'uniswap_v2': 0,
'sushiswap_v2': 0,
'uniswap_v3': 1,
'sushiswap_v3': 1,
}
DIR = os.path.dirname(os.path.abspath(__file__))
ABI_FILE_PATH = Path(DIR) / 'SimulatorV1.json'
SIMULATOR... | solidquant/whack-a-mole | simulation/online_simulator.py | online_simulator.py | py | 7,530 | python | en | code | 47 | github-code | 90 |
16517285628 | # coding=utf-8
#
# 기업 open_api 이용하기
#
from urllib.request import urlopen
import pandas as pd
from bs4 import BeautifulSoup
import webbrowser
API_KEY="2672b31cfb74118a9f7c11cfcce685bbeef77f19"
company_code="014680"
url = "http://dart.fss.or.kr/api/search.xml?auth="+API_KEY+"&crp_cd="+company_code+"&start_dt=19990101&... | picopoco/gongsi | gapi.py | gapi.py | py | 1,051 | python | en | code | 0 | github-code | 90 |
40128212015 | # class DeluxePizza:
# number_of_pizzas = 0
#
# def __init__(self, size_of_pizza = "s", cheese_toppings = 0, pepperoni_toppings = 0, mushroom_toppings = 0,
# veggie_toppings = 0, stuffed_with_cheese = False):
# self.size_of_pizza = size_of_pizza
# self.cheese_toppings = cheese_t... | DavinderSohal/Python | Activities/Final/ProjectPizza.py | ProjectPizza.py | py | 21,602 | python | en | code | 0 | github-code | 90 |
33458262714 | from typing import List
class Solution:
def minMutation(self, startGene: str, endGene: str, bank: List[str]) -> int:
def isValidMutation(s1: str, s2: str) -> bool:
diff = 0
for i in range(0, len(s1)):
diff+=1 if s1[i] != s2[i] else 0
return diff == 1
# start at ... | Samuel-Black/leetcode | minimum-genetic-mutation.py | minimum-genetic-mutation.py | py | 1,019 | python | en | code | 0 | github-code | 90 |
4483678378 | import json
import requests
import pprint
from sqlalchemy import all_
#let's try to get the response 1st test whats up dawg?
response = requests.get("https://api.opendota.com/api/players/1163336706/matches")
all_match_ids = []
for i in response.json():
match_id = i['match_id']
all_match_ids.append(match_id)
pri... | rbekeris/databakery | get_all_matches_for_player.py | get_all_matches_for_player.py | py | 666 | python | en | code | 0 | github-code | 90 |
21237705852 | from django import forms
from django.contrib.auth.models import User
from foi.models import Case, Comment, Referral, Assessment, Outcome, InternalReview, InformationCommissionerAppeal, AdministrativeAppealsTribunal
class CaseForm(forms.ModelForm):
class Meta:
model = Case
fields = [
'ti... | switchtrue/FOXFOI | foi/forms.py | forms.py | py | 7,660 | python | en | code | 0 | github-code | 90 |
31780751809 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 22 21:51:00 2022
@author: JalenL
"""
import time
import random
Ingio_lost_list = ['Victory is fleeting. Losing is forever.','You have no choices about how you lose,' +
'but you do have a choice about how you come back and prepare to win agai... | CtrlVEarlSweatpants/Games | RPS_Game.py | RPS_Game.py | py | 2,741 | python | en | code | 0 | github-code | 90 |
28518879404 | import copy
import math
import sys
from filter_list import filter_module, filter_real_numbers
from list_operations import _replace, move_elements, delete_elements
from list_operations import sort_descending_imaginary
from user_menu import right_operation
class Complex:
def __init__(self, real, imaginary, module)... | darian200205/FP-python | lab4/do_task.py | do_task.py | py | 5,659 | python | ro | code | 0 | github-code | 90 |
24414923952 | # coding=utf-8
from __future__ import print_function
import numpy as np
from imgProcessor.exceptions import EnoughImages
class Iteratives(object):
def __init__(self, max_iter=1e4, max_dev=1e-5):
self._max_iter = max_iter
self._max_dev = max_dev
self._last_dev = None
... | radjkarl/imgProcessor | imgProcessor/utils/baseClasses.py | baseClasses.py | py | 650 | python | en | code | 28 | github-code | 90 |
19017277473 | def create_array(input_lines):
res = []
for l in input_lines:
row = []
for c in l:
row.append(c)
res.append(row)
return res
def solve(fname, row_steps, col_steps):
with open(fname) as f:
lines = f.read().split('\n')
tree_array = create_array(lines)
r... | PyJay/aoc2020 | day03.py | day03.py | py | 743 | python | en | code | 1 | github-code | 90 |
25525439418 | from flask import request
from app import app
from app.db import postgre
from app import utils
from app.utils import wrappers, session, crossdomain, logger
logger = logger.Logger(__name__)
# This method removes pack from user's assinged packs
# Pack itself is not removed
def removePack():
logger.info("API Handl... | codingjerk/ztd.blunders-web | app/api/pack/remove.py | remove.py | py | 1,259 | python | en | code | 0 | github-code | 90 |
27620508174 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def maxPathSum(self, root):
"""
:type root: TreeNode
:rtype: int
"""
if root is N... | Nazmul-islam-apu/Leetcode-Problem-Solution | Problem 101 - 200/124. Binary Tree Maximum Path Sum.py | 124. Binary Tree Maximum Path Sum.py | py | 781 | python | en | code | 0 | github-code | 90 |
10299627765 | import argparse, os, sys
from os import listdir
from os.path import isfile, join
from ipywidgets import widgets
import pickle
import math
import collections
import time
import numpy as np
import pandas as pd
import scanpy as sc
import warnings
warnings.filterwarnings('ignore')
from sklearn.metrics import silhouette_s... | Starlitnightly/omicverse | omicverse/single/_scdrug.py | _scdrug.py | py | 18,135 | python | en | code | 119 | github-code | 90 |
20818549972 | from datetime import datetime
from django.shortcuts import render
from .models import FamilyMember
def home(request):
context = {'family_members': FamilyMember.objects.all()}
return render(request,'home.html',context)
def family_member_registration(request,name: str,surname: str,birthdate: str,email: str,p... | AgusSalvidio/MVT_Salvidio | Family/views.py | views.py | py | 683 | python | en | code | 0 | github-code | 90 |
37835769805 | import os
import cv2
import numpy as np
global dstfolder
def mse(a, b):
err = np.sum((a.astype("float") - b.astype("float")) ** 2)
err /= float(a.shape[0] * a.shape[0])
return err
def judgement_class(context_2, picture_name, output_name):
im = cv2.imread(picture_name)
h, w, _ = im.shape
ob... | TaoBowoa180011/WorkingScrip | pythonProject/creat_to_efficent_and_yolo/unzip5.py | unzip5.py | py | 5,539 | python | en | code | 0 | github-code | 90 |
9776444210 | from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPainter
from PyQt5.QtWidgets import QFrame
from brickv.utils import draw_rect
class ColorFrame(QFrame):
def __init__(self, width, height, color, parent=None):
super().__init__(parent)
self.color = color
self.setFixedSize(width, height)... | Tinkerforge/brickv | src/brickv/color_frame.py | color_frame.py | py | 652 | python | en | code | 18 | github-code | 90 |
24818970018 | #Imports
import time
import os
import sys
import json
#Func's
def typingPrint(text):
for character in text:
sys.stdout.write(character)
sys.stdout.flush()
time.sleep(0.05)
def typingInput(text):
for character in text:
sys.stdout.write(character)
sys.stdout.flush()
time.s... | IForgotHowToCode/Ascii-Sheep-Tomagotchi-Game | main.py | main.py | py | 6,199 | python | en | code | 0 | github-code | 90 |
32998558011 | from overrides import overrides
from allennlp.common.util import JsonDict
from allennlp.data import Instance
from allennlp.predictors.predictor import Predictor
@Predictor.register('sharc_predictor')
class ShARCPredictor(Predictor):
"""
Predictor for the :class:`~allennlp.models.bidaf.BidirectionalAttentionFl... | IBM/UrcaNet | orca/predictors/sharc_predictor.py | sharc_predictor.py | py | 843 | python | en | code | 2 | github-code | 90 |
74431912296 | from librep.embeddings_eval.embeddings_eval_base import *
import tabulate
import sklearn.metrics
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
import numpy as np
class RF_KNN_SVM_Scores_Result(Evaluation_Result_Text): pass
c... | joaoppagnan/demonstracao-motionsense | librep/embeddings_eval/RF_KNN_SVM_Scores.py | RF_KNN_SVM_Scores.py | py | 2,513 | python | en | code | 0 | github-code | 90 |
42300580697 | from pylab import *
import inspect
import os
import time
import vray
import path_utils
current_source_file_path = path_utils.get_current_source_file_path(frame=inspect.currentframe())
vrscene_file = os.path.abspath(os.path.join(current_source_file_path, "..", "..", "..", "examples", "00_empty_scene", "... | apple/ml-hypersim | code/python/tools/_check_vray_appsdk_install.py | _check_vray_appsdk_install.py | py | 854 | python | en | code | 1,500 | github-code | 90 |
1990188255 | import asyncio
from typing import Any
class AsyncFunWrapper:
def __init__(self, blocked_fun) -> None:
super().__init__()
# 记录阻塞型 IO 函数,便于后续调用
self._blocked_fun = blocked_fun
def __call__(self, *args):
"""
重载函数调用运算符,
将阻塞型 IO 的调用过程异步化,
并返回一个可等待对象 (Awaita... | GitHub-WeiChiang/main | Asyncio/Chapter1/aiofile.py | aiofile.py | py | 2,084 | python | zh | code | 7 | github-code | 90 |
4388702393 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""投诉建议页面"""
__author__ = 'kejie'
from appium.webdriver.common.mobileby import MobileBy
from page_object.base_page import BasePage
class ComplaintSuggestionPage(BasePage):
# 添加投诉建议按钮
add_complaint_suggestion_button_loc = (MobileBy.ACCESSIBILITY_ID, '+ 添加投诉建议')... | reach950/hangzhoubanshi-uitest-iOS | page_object/mine/complaint_suggestion/complaint_suggestion_page.py | complaint_suggestion_page.py | py | 723 | python | en | code | 0 | github-code | 90 |
39241813827 | import wx
import inspect
import os
[wxID_ROW, wxID_ROWDELETE, wxID_ROWGO, wxID_ROWLABEL, wxID_ROWSET, wxID_ROWX,
wxID_ROWY,
] = [wx.NewId() for _init_ctrls in range(7)]
class Row(wx.Panel):
'''One row of settings in a wxmtxy table'''
def _init_coll_sizer_Items(self, parent):
# generated method, do... | APS-USAXS/wxmtxy | wxmtxy_row.py | wxmtxy_row.py | py | 6,277 | python | en | code | 1 | github-code | 90 |
6328160269 | #!/usr/bin/python3
""" Entry point of the command interpreter """
import cmd
from models import storage
from models.base_model import BaseModel
from models.user import User
from models.place import Place
from models.city import City
from models.amenity import Amenity
from models.state import State
from models.review im... | luischaparroc/AirBnB_clone | console.py | console.py | py | 5,636 | python | en | code | 8 | github-code | 90 |
34093976965 | nums = [1,3]
# nums = [5,1,6]
nums = [3,4,5,6,7,8]
sum = 0
f = nums[0]
for i in range(len(nums)):
sum += nums[i]
y = nums[i]
for j in range(i+1,len(nums)):
x = 0
x = nums[i]^nums[j]
sum += x
y = y^nums[j]
sum += y
print(sum) | Hotheadthing/leetcode.py | Sum of all subsets XOR total.py | Sum of all subsets XOR total.py | py | 272 | python | en | code | 2 | github-code | 90 |
12083985464 | import socket
import threading
import sqlite3
import datetime
from datetime import date
import sys
PORT = 2090
BUF_SIZE = 2048
lock = threading.Lock()
clnt_imfor = [] # [[소켓, id]]
def dbcon(): #db연결
con = sqlite3.connect('serverDB.db') # DB 연결
c = con.cursor() # 커서
return (con, c)
de... | Education-project-3team/education_application | server.py | server.py | py | 8,756 | python | en | code | 0 | github-code | 90 |
74946853095 | # -*- coding: utf-8 -*-
"""
Problem 187 - Semiprimes
A composite is a number containing at least two prime factors. For example,
15 = 3 × 5
9 = 3 × 3
12 = 2 × 2 × 3
There are ten composites below thirty containing precisely two, not necessarily
distinct, prime factors: 4, 6, 9, 10, 14, 15, 21... | yred/euler | python/problem_187.py | problem_187.py | py | 920 | python | en | code | 1 | github-code | 90 |
32913177252 | ### python stat.py
import sys
inFile1=open(sys.argv[1],'r')
seq=[]
for line in inFile1 :
seq.append(line)
inFile1.close()
ouFile1=open(sys.argv[1]+'.seq.len','w')
seqlen=[]
for i in range(0,len(seq),2) :
seqlen.append(len(seq[i+1])-1)
seqlen.sort()
ouFile1.write('\n'.join(str(i) for i in seqlen)+'\n')
ouFil... | wanghuanwei-gd/SIBS | Project/lncRNA/S1/lncRNA_UCSC/stat.py | stat.py | py | 335 | python | en | code | 0 | github-code | 90 |
13609236989 | #
# abc146 a
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.r... | mskt4440/AtCoder | abc146/a.py | a.py | py | 851 | python | en | code | 0 | github-code | 90 |
26208992475 | """
将benders cut生成进行展示
"""
import matplotlib.pyplot as plt
import numpy as np
# 创建一个figure和axes对象
fig, ax = plt.subplots(figsize=(15, 10))
# 设置x和y轴的范围
ax.set_xlim([-100, 1100])
ax.set_ylim([1020, 1120])
# 设置X轴的间距为50, Y轴的间距为10
ax.set_xticks(np.arange(-100, 1101, 100))
ax.set_yticks(np.arange(1020, 1121, 10))
# 画出直线... | chiangwyz/Operation-Research-Algo | benders decomposition/benders cut illustration of example.py | benders cut illustration of example.py | py | 3,097 | python | ja | code | 2 | github-code | 90 |
18165801169 | N = int(input())
str_in = input()
num = [int(n) for n in str_in.split()]
num = list(map(int, str_in.strip().split()))
hight = num[0]
stools = 0
for x in range(1,len(num)):
if hight>num[x]:
stools+=hight-num[x]
elif num[x] > hight:
hight = num[x]
print (stools) | Aasthaengg/IBMdataset | Python_codes/p02578/s839429915.py | s839429915.py | py | 293 | python | en | code | 0 | github-code | 90 |
74761193577 | # MIMO - 02 - Tipos e comparações - DESAFIO 2
# Lorde esqueceu sua senha e está usando um programa para restaurá-la. O programa verifica se a nova senha dela é diferente da antiga. Também faz com que lorde digite a nova sena duas vezes para ter certeza que está escrita corretamente. Vamos terminar esse programa.
senha... | dualsgo/meus-estudos | mimo_app/Desafios/02_desafio_2.py | 02_desafio_2.py | py | 834 | python | pt | code | 0 | github-code | 90 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.