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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
17114111094 | """
# query database for xrefs, extra MODs, post to populate mod_corpus_association
# python process_mod_corpus_association_to_api.py
"""
import logging.config
from os import path
from agr_literature_service.api.database.main import get_db
from agr_literature_service.api.models import ModCorpusAssociationModel, Refer... | alliance-genome/agr_literature_service | agr_literature_service/lit_processing/oneoff_scripts/process_mod_corpus_association_to_api.py | process_mod_corpus_association_to_api.py | py | 2,621 | python | en | code | 1 | github-code | 13 |
28561344222 | from StringIO import StringIO
from bzrlib.errors import BinaryFile
from bzrlib.tests import TestCase, TestCaseInTempDir
from bzrlib.textfile import text_file, check_text_lines, check_text_path
class TextFile(TestCase):
def test_text_file(self):
s = StringIO('ab' * 2048)
self.assertEqual(text_fil... | ag1455/OpenPLi-PC | pre/python/lib/python2.7/dist-packages/bzrlib/tests/test_textfile.py | test_textfile.py | py | 1,029 | python | en | code | 19 | github-code | 13 |
20477380346 | from framework import utili
from framework.data_manager import data_manager_creator
from framework import register
from tensorflow.keras.models import load_model
class creator(register.base):
def create(self, data_manager, config):
name = config['name']
fn = self.get_entry(name)
return fn(d... | jian626/deepseq | framework/model_manager/model_manager_creator.py | model_manager_creator.py | py | 774 | python | en | code | 0 | github-code | 13 |
14078303328 | from comcrawl import IndexClient
import pandas as pd
import time
from concurrent.futures import ThreadPoolExecutor
from urlfetcher import df, fname
'''
websites = ["asmag", "AmericanMachinist", "assemblymag", "automationworld"]
# [ "aviationweek", "BestManufacturingPractices", "Chemengonline","ComputerWeek... | mayankrichu/Textextractor | htmlfetcher.py | htmlfetcher.py | py | 2,042 | python | en | code | 0 | github-code | 13 |
4447573502 | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from rest_framework.urlpatterns import format_suffix_patterns
from RESTservice import views
#
# # Create a router and register our viewsets with it
router = DefaultRouter()
router.register(r'topics', views.TopicViewSet)
router.re... | owenstranathan/Collector | RESTservice/urls.py | urls.py | py | 1,022 | python | en | code | 0 | github-code | 13 |
22606959092 | from django.urls import path, re_path
from shortener import views
app_name = "shortener"
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
re_path(r'^(?P<pk>[^\/]+)/$', views.URLResolver.as_view(), name='resolver'),
]
| rrr3try/shortener | shortener/urls.py | urls.py | py | 246 | python | en | code | 0 | github-code | 13 |
39929114749 | import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--alg', type=str, default="sample_avg", help="sample_avg | constant")
args = parser.parse_args()
print(args)
qstar = np.array([0.] * 10)
mu, sigma = 0, 0.01 # mean and standard deviation
q_avg = np.array([0.] * 10) # q value
... | Gordon-Guojun-Zhang/RL | Reinforcement_Learning/multi-armed-bandit.py | multi-armed-bandit.py | py | 2,241 | python | en | code | 0 | github-code | 13 |
30567825793 | # модуль создания объектов игрока и боссов,
# функции выбора босса от количества побед игрока,
# способности боссов перед боем с игроком
import GameStrings
import PlayerStrings
import BossStrings
import Characters
import random
def player_get_stats(hero_name):
# создание экземпляра игрока с данными характеристик... | AssBurger69/BurgerGame | CharactersGenerator.py | CharactersGenerator.py | py | 7,581 | python | en | code | 0 | github-code | 13 |
507204917 | import sqlite3
from models.models import Person
import uuid
import cv2
from PIL import Image as im
def create_db():
conn = sqlite3.connect('database/Person.db',timeout=20)
c = conn.cursor()
c.execute("CREATE TABLE IF NOT EXISTS user ( id TEXT PRIMARY KEY, name TEXT NOT NULL, mobile_no INTEGER, adhar_no INT... | aadityapritam001/Face_Recognition | db.py | db.py | py | 4,640 | python | en | code | 0 | github-code | 13 |
5661371339 | from functools import partial
from qtpy import QtWidgets
from qtpy.QtCore import Qt
import matplotlib.colors as colors
from matplotlib.legend import Legend
from matplotlib.text import Text
from mslice.models.colors import to_hex, name_to_color
from mslice.models.units import get_sample_temperature_from_string
from m... | mantidproject/mslice | src/mslice/plotting/plot_window/slice_plot.py | slice_plot.py | py | 25,085 | python | en | code | 1 | github-code | 13 |
72421476817 | import RPi.GPIO as GPIO
import time
# declare the sensor and led pin
sensor_pin = 23
led_pin = 26
# GPIO setup
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(sensor_pin, GPIO.IN)
GPIO.setup(led_pin, GPIO.OUT)
try:
while True:
if GPIO.input(sensor_pin):
# If no object is near
... | donskytech/raspberrypi-projects | ir_sensor/ir_sensor.py | ir_sensor.py | py | 565 | python | en | code | 3 | github-code | 13 |
17194176065 | import pickle
import numpy as np
import streamlit as st
import utils
print(utils.load_model_from_disk)
best_mrnet_model_name = 'MRNet_Model3'
best_mrnet_model_cutoff_threshold = 0.429860
mrnet_model = utils.load_model_from_disk(best_mrnet_model_name)
best_kneemri_model_name = 'kneeMRI_Model6'
kneemri_model = utils.... | tomasbarak/acl-tear-detector | src/app.py | app.py | py | 3,298 | python | en | code | 0 | github-code | 13 |
40518343024 | import time
#import RPi.GPIO as gpio
#gpio.setmode(gpio.BCM)
#gpio.setup(12, gpio.OUT)
#led= gpio.PWM(12,10000)
#led.start(0)
global x
from matplotlib import pyplot as plt
def EMG_V():
for i in range(0,5):
time.sleep(0.01)
#p segment
for i in range(40,80):
x=i
... | VipulAlgoSoul/Raspberrypi_oldrobotics | ecgP_001.py | ecgP_001.py | py | 1,729 | python | en | code | 1 | github-code | 13 |
71678517137 | import math
import numpy as np
from .PropagationRule import PropagationRule
from .SlopeFunctions import SlopeFunctions
from .WindFactorCalculator import WindFactorCalculator
class ExtendedRule(PropagationRule):
"""
The extended model defined by the following paper:
A. Hernández Encinas, L. Hernán... | gdepianto/forest_fire_simulation | forest_fire/ExtendedRule.py | ExtendedRule.py | py | 2,898 | python | en | code | 0 | github-code | 13 |
20194327876 | import pygame as py
from assets import *
import sys
# UI CONSTANTS
HEIGHT = 720
WIDTH = 720
UI_BORDER = 10
NUM_COLS = 10
NUM_ROWS = 20
GRID_BORDER_WIDTH = 2
# GAME CONSTANTS
movespeed = .5
deltamovespeed = 0
board = Board(NUM_ROWS, NUM_COLS, GRID_BORDER_WIDTH) #list to hold all the pieces on the playfield
board.... | lukedwards99/tetris-clone | game.py | game.py | py | 2,988 | python | en | code | 0 | github-code | 13 |
34617658639 | import time
import pandas as pd
def replace_chars(x):
x = x.replace(' ', '').replace('.', '')
x = x.replace('D', '3').replace('L', '1').replace('-', '2')
s = list(x)
return pd.Series({'game' + str(i): s[i] for i in range(20)})
def convert_game_to_cols(df):
# print("Converting 'game' to a series ... | qwertyuu/python-ur-machine-learning | src/prep.py | prep.py | py | 655 | python | en | code | 0 | github-code | 13 |
13000140680 | import asyncio
from services.ascn_connection import second_request
import locale
# this function puts values from the second request to datalist for the further iterating to get info user needs
async def listing():
data = await second_request()
datalist = []
for item in data:
datalist.appe... | moretobasco/firstOptiBot | services/opti_parser.py | opti_parser.py | py | 1,810 | python | en | code | 0 | github-code | 13 |
71415131219 | import re
import pickle
from tornado.escape import to_unicode
from tornado import web, escape
from tornado.web import RequestHandler
class FlashMixin(RequestHandler):
"""
Extends Tornado's RequestHandler by adding flash functionality.
(c) Bahman Movaqar http://www.bahmanm.com
"""
def _cookie_name... | gruentee/tornado-tutorial | blog/handlers/mixins/message.py | message.py | py | 1,500 | python | en | code | 0 | github-code | 13 |
37130158991 | # paths
import os
import settings as S
from useful_functs import functions
train_folder_name = "train_" + S.epoch_load + functions.string(S.fold_load)
run_folder_name = os.path.join(S.save_data_path, S.run_folder)
epoch_load = os.path.join(run_folder_name, train_folder_name)
PATH_load = os.path.join(e... | oubino/General-location-finding | paths.py | paths.py | py | 1,307 | python | en | code | 3 | github-code | 13 |
21767103539 | from django.db import models
from catalog.models import Order, Order_Item
class OrderSummary(Order):
class Meta:
proxy = True
verbose_name = 'Order Report'
verbose_name_plural = 'Order Reports'
class OrderItemSummary(Order_Item):
class Meta:
proxy = True
verbose_name ... | kwabena-aboah/POSsystem | summary/models.py | models.py | py | 387 | python | en | code | 0 | github-code | 13 |
28601573176 | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from main.constants import *
from django.contrib.auth.models import AbstractUser
from random_word import RandomWords
from django.utils import timezone
import shortuuid
import uuid
class User(AbstractUser, models.Model)... | codelikeak47/matter_code | backend/main/models.py | models.py | py | 5,540 | python | en | code | 0 | github-code | 13 |
29075760804 | class RefreshIpOperation(object):
public_ip = "Public IP"
def __init__(self, instance_service):
"""
:param instance_service: Instance Service
:type instance_service: cloudshell.cp.aws.domain.services.ec2.instance.InstanceService
"""
self.instance_service = instance_servi... | AdamSharon/AWS-Shell | package/cloudshell/cp/aws/domain/ami_management/operations/refresh_ip_operation.py | refresh_ip_operation.py | py | 1,409 | python | en | code | null | github-code | 13 |
20941674436 | def dictionary_input_1d(n):
d1 = {}
for i in range(n):
a = input().split()
d1[a[0]] = eval(a[1])
return d1
""" This is used for 1 dimensional dictionary enter from user"""
#first method
def merge1(dict1,dict2):
"""Using update method merge dictionary"""
return dict2.upd... | Rohit-saxena125/Python-code | Dictionary/Mergingdict.py | Mergingdict.py | py | 737 | python | en | code | 0 | github-code | 13 |
2062035670 | import pathlib
import typing
import warnings
import zipfile
import numpy as np
import pandas as pd
import requests
from nemdata import mmsdm, nemde
headers = {
"referer": "https://aemo.com.au/",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0... | ADGEfficiency/nem-data | nemdata/utils.py | utils.py | py | 2,339 | python | en | code | 4 | github-code | 13 |
72694241297 | import os
import pymongo
if os.path.exists("env.py"):
import env
# static variables
MONGO_URI = os.environ.get("MONGO_URI")
DATABASE = "myFirstDB"
COLLECTION = "celebrities"
def mongo_connect(url):
try:
connection = pymongo.MongoClient(url)
return connection
except pymongo.errors.Connect... | RicardoAzuul/CI-Go_humongous_with_MongoDB | mongo_project.py | mongo_project.py | py | 3,761 | python | en | code | 0 | github-code | 13 |
40021303655 | from question_model import Question
from data import question_data
from quizz_brain import QuizzBrain
question_bank = []
for element in question_data:
question = Question(element["text"], element["answer"])
question_bank.append(question)
quizz = QuizzBrain(question_bank)
while quizz.still_has_question():
... | olivska/quizz_true_false | main.py | main.py | py | 445 | python | en | code | 0 | github-code | 13 |
73783621778 | """
Configuration file for MLDaemon
"""
from sklearn.decomposition import PCA, FactorAnalysis
from sklearn import tree, svm, preprocessing
from sklearn.naive_bayes import GaussianNB, MultinomialNB
from sklearn.neural_network import MLPClassifier
import os
MONGO_HOST = "127.0.0.1"
MONGO_PORT = 27017
DATABASE_PATH = '... | LascaTorbot/mldaemon | config.py | config.py | py | 1,138 | python | en | code | 0 | github-code | 13 |
43586801899 | from channels.layers import get_channel_layer
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework import permissions, status
from rest_framework.generics import Crea... | mwangihub/innovest-shop | shop/api/views_functions.py | views_functions.py | py | 7,378 | python | en | code | 0 | github-code | 13 |
26415138399 | import sqlite3
from xml.dom.minidom import Identified
from flask import Blueprint, render_template, request
from . import db
from flask_login import login_required, current_user
from fonction import get_familles, get_date
main = Blueprint('main', __name__)
@main.route('/')
def index():
return render_template('... | uclthomasblaimont/projet2_the_farm | flask_auth_app/project/main.py | main.py | py | 8,555 | python | fr | code | 0 | github-code | 13 |
15303461336 | from typing import List
from copy import deepcopy
class Solution:
def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
planted = 0
for i in range(len(flowerbed)):
if (
flowerbed[i] == 0
and (i == 0 or flowerbed[i - 1] == 0)
a... | JosephLYH/leetcode | leetcode/605.py | 605.py | py | 959 | python | en | code | 0 | github-code | 13 |
31942994330 | class ListNode:
def __init__(self, x):
self.val = x
self.next = None
# @lc code=start
class Solution:
def reverseList(self, head: ListNode) -> ListNode:
prev = None
while head:
tmp = head.next
head.next = prev
prev = head
head = t... | wylu/leetcodecn | src/python/p200to299/206.反转链表.py | 206.反转链表.py | py | 360 | python | en | code | 3 | github-code | 13 |
16644614637 | """
You are given a binary tree.
Write a function that can return the inorder traversal of node values.
Example:
Input:
3
\
1
/
5
Output: [3,5,1]
"""
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left =... | JeffreyAsuncion/CodingProblems_Python | Lambda/inorder_traversal_iterative.py | inorder_traversal_iterative.py | py | 538 | python | en | code | 0 | github-code | 13 |
14487118963 | import tensorflow as tf
import string
# Load the dataset
with open('TENSORFLOW/data.txt', 'r') as f:
data = f.read().splitlines()
# Preprocess the dataset
correct_words = set(data[::2])
incorrect_words = set(data[1::2])
all_words = correct_words.union(incorrect_words)
# Create a dictionary to map words to indice... | Thewildraptor777/School-Code | PYTHON/TENSORFLOW/model.py | model.py | py | 1,500 | python | en | code | 0 | github-code | 13 |
2867311378 | # -*- coding: utf-8 -*-
from unittest import TestCase
from jsonschema import RefResolver
from mock import patch, Mock
from pluct.resource import Resource, ObjectResource, ArrayResource
from pluct.session import Session
from pluct.schema import Schema
class BaseTestCase(TestCase):
def setUp(self):
self.... | globocom/pluct | pluct/tests/test_resource.py | test_resource.py | py | 9,929 | python | en | code | 39 | github-code | 13 |
73668968656 | import cc_types
def create_type(cpp_type):
return cc_types.typen(cpp_type)
def create_lvalue(cpp_type, name):
created_type = create_type(cpp_type)
return {
'kind': 'lvalue',
'type': created_type,
'name': name,
}
def create_struct(name, members, default_values={}, member_fun... | jpanikulam/op_graph | op_graph/create.py | create.py | py | 1,156 | python | en | code | 2 | github-code | 13 |
15978452273 | """Given an array of integers temperatures represents the daily temperatures,
return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature.
If there is no future day for which this is possible, keep answer[i] == 0 instead
"""
from stack_array_... | abood-74/Data-Structer-and-Algorithms | DS/Stack/Daily Temperatures.py | Daily Temperatures.py | py | 1,270 | python | en | code | 0 | github-code | 13 |
24968795421 | # Escreva um programa que leia a quantidade de dias, horas, minutos e segundos do usuário
# Calcule o total em segundos.
dias = int(input("Dias: "))
horas = int(input("Horas: "))
minutos = int(input("Minutos: "))
segundos = int(input("Segundos: "))
dias_seg = 86400 * dias
horas_seg = 3600 * horas
minutos_seg = 60 *... | Monamello/introducao-programacao-python-exercicios | capitulo_3/exercicio3-9.py | exercicio3-9.py | py | 426 | python | pt | code | 0 | github-code | 13 |
9521370707 | from __future__ import absolute_import
from datetime import datetime, timedelta
from mock import patch, MagicMock, call
from django.test import TestCase, override_settings
from silver.fixtures.factories import TransactionFactory
from silver.fixtures.test_fixtures import PAYMENT_PROCESSORS
from silver.utils.decorator... | silverapp/silver | silver/tests/unit/test_payments_util.py | test_payments_util.py | py | 2,574 | python | en | code | 292 | github-code | 13 |
17934531417 | #!/bin/python3
#https://www.hackerrank.com/challenges/three-month-preparation-kit-minimum-absolute-difference-in-an-array/problem?isFullScreen=true&h_l=interview&playlist_slugs%5B%5D=preparation-kits&playlist_slugs%5B%5D=three-month-preparation-kit&playlist_slugs%5B%5D=three-month-week-four
import math
import os
import... | antoniojsp/retos | absolute_diff.py | absolute_diff.py | py | 1,349 | python | en | code | 0 | github-code | 13 |
21462711099 | import numpy as np
class CustomerSimulator(object):
def __init__(self, params, factor=80):
self.params = np.asarray(params)
self.num_comps = 1
self.factor = factor
def get_lambda(self, length, a, p, r):
features = np.array([
1,
(1 + ((1 if p < a else 0) ... | Pancakeme/Dynamic-Pricing | customer.py | customer.py | py | 921 | python | en | code | 0 | github-code | 13 |
16006896140 | from rpg.maze_tester.maze_exp import *
if __name__ == '__main__':
exp = build_exp(base_config)
exp.add_exps(
'hammer',
dict(
_base=['mbsac', 'mbsacrnd', 'rpgnormal', 'rpgdiscrete', 'mbsacrnd5', 'rpgnormal1', 'rpgdiscrete1'],
env_cfg=dict(reward_type='sparse'),
)... | haosulab/RPG | rpg/maze_tester/exp_1_11.py | exp_1_11.py | py | 1,509 | python | en | code | 18 | github-code | 13 |
36082893572 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pomocny skript na vyhodnoceni, jestli je den nebo noc (a jestli se
behem foceni ma zapinat baterka nebo ne).
Pouziti:
./tma.py <OD> <DO>
./tma.py 20:00 6:30
Parametry <OD> <DO> rikaji, odkdy dokdy je tma. Po spusteni skriptu
si zjisti aktualni cas, a pokud s... | msgre/kvetinac | kv_pi/bin/noc.py | noc.py | py | 2,004 | python | cs | code | 8 | github-code | 13 |
15102313701 | from tqdm.auto import tqdm
import pandas as pd
import numpy as np
class CFG:
train_path = "../inputs/train_valid/train_parquet"
val_path = "../inputs/train_valid/test_parquet"
val_label_path = "../inputs/train_valid/test_labels.parquet"
aid_feat_path = "../inputs/aid_feats/"
df = pd.read_parquet(... | mrkmakr/OTTO-Multi-Objective-Recommender-System | codes/otto/scripts_stats/session_feats.py | session_feats.py | py | 1,253 | python | en | code | 5 | github-code | 13 |
21572581652 | '''
抓取百度贴吧---言情小说的基本内容
爬虫线路: requests - bs4
Python版本: 3.6
'''
import requests
import time
from bs4 import BeautifulSoup
def get_html(url):
r = requests.get(url,timeout=30)
r.raise_for_status()
r.encoding = 'utf-8'
return r.text
def get_content(url):
comments = []
html =... | Carrie999/Python-spider | tiebaxiaoshuo.py | tiebaxiaoshuo.py | py | 1,629 | python | en | code | 6 | github-code | 13 |
43061439521 | import numpy as np
import math
import copy
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset, DataLoader
import torchvision.datasets.cifar as cifar
from torchvision import datasets, transforms
from livelossplot import PlotLosses
import os
from .train_utils import test_binary_model
from .e... | psr6275/HEDL_inference | codes/utils/mia_utils.py | mia_utils.py | py | 10,204 | python | en | code | 0 | github-code | 13 |
559899514 | import pygame
from constants import *
from utils import *
from titlebar import Titlebar
from board import Board
from assetloader import AssetLoader
from diffselect import DifficultySelector
class Game:
board = None
solution = None
def __init__(self):
self.win_anim = 0
self.titlebar = Titl... | quasar098/kabufuda-solitaire | game.py | game.py | py | 1,866 | python | en | code | 2 | github-code | 13 |
32077973068 | #!/usr/bin/env python
"""Python script for assembly comparison.
"""
from __future__ import print_function
import os
import sys
import warnings
from optparse import OptionParser
from Bio import BiopythonExperimentalWarning
with warnings.catch_warnings():
warnings.simplefilter("ignore", BiopythonExperimentalWarnin... | peterjc/picobio | assembly_comparison/assembly_comparison.py | assembly_comparison.py | py | 20,141 | python | en | code | 44 | github-code | 13 |
177682708 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$',views.index, name = 'index'),
url(r'^activity/([1-9][0-9]*)$', views.activity, name='activity'),
url(r'^activity/submit/([1-9][0-9]*)$', views.activity_submit, name='activity-submit'),
url(r'^activity/unsubmit/([1-9][0-9]*)$... | owen6314/scheduleWebsite | ActivitiesManager/urls.py | urls.py | py | 1,497 | python | en | code | 0 | github-code | 13 |
15496665205 | from tkinter import *
from tkinter import messagebox
from tkinter import ttk
import time
named_tuple = time.localtime()
time_string = time.strftime("%d/%m/%Y, %H:%M", named_tuple)
print(time_string)
gui = Tk()
gui.title('My Note')
gui.geometry("600x400")
gui.configure(bg='#e6e5da')
Font = ('Bahnsc... | zawaneemakeng/GUI-Read-Write-Append | GUIReadWriteAppend/GUI.py | GUI.py | py | 2,600 | python | en | code | 0 | github-code | 13 |
37861908843 | from .voigtAstro import VoigtAstroP
from PyAstronomy import funcFit as fuf
from PyAstronomy.pyasl import convertDampingConstant
import numpy as np
class LyaTransmission(fuf.OneDFit):
"""
Lyman alpha transmission profile including Deuterium absorption.
The transmission is given by
.. math::
... | sczesla/PyAstronomy | src/modelSuite/LyAProfile.py | LyAProfile.py | py | 2,392 | python | en | code | 134 | github-code | 13 |
37829991998 | # coding: utf-8
"""
OpenAPI Petstore
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema... | openapi-json-schema-tools/openapi-python-client-comparison | petstore/openapi_json_schema_generator_python/src/openapi_client/paths/store_inventory/get/responses/response_200/content/application_json/schema.py | schema.py | py | 1,139 | python | en | code | 0 | github-code | 13 |
42153438001 | import pynput
import cv2
import numpy as np
import time
from mss import mss
import win32gui
import multiprocessing
import multiprocessing.shared_memory
import pickle
from tools import BoundingBox
from button_click import ButtonClicker
from fishing import Fisher
from avoidance import Avoidance
class Bot:
"""also k... | CrunchyDuck/DUCCI-AITG | main.py | main.py | py | 16,084 | python | en | code | 0 | github-code | 13 |
38394257246 | """
Analyze Trades Streamlit App - see README.md for details
"""
from src import predictresult as analyze_pred
import streamlit as st
import numpy as np
import pandas as pd
# tables
df = pd.DataFrame({"first column": [1, 2, 3, 4], "second column": [10, 20, 30, 40]})
st.dataframe(df.style.highlight_max(axis=0))
st.... | sws144/AnalyzeTradesApp | app.py | app.py | py | 671 | python | en | code | 0 | github-code | 13 |
34360459479 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import path
# Specify bounding polygon within source image
top_left = [152,120]
top_right = [305,150]
bottom_right = [241,295]
bottom_left = [38,255]
def main():
guney = np.array(plt.imread("images/dyson.jpg"), dtype=np.float) * (1./255... | l-j-oneil/free_beers | free_beers.py | free_beers.py | py | 2,767 | python | en | code | 0 | github-code | 13 |
70099483537 | from Function import *
def secant(aa, bb, cc):
func = Functions(aa, bb, cc)
x0 = float(input("Masukkan x0: "))
x1 = float(input("Masukkan x1: "))
error = float(input("Masukkan error: "))
n = int(input("Masukkan banyak iterasi: "))
i = 0
if (func.fx(x0)*func.fx(x1) > 0):
... | caesarjalu/Metnum-Metode | Secant.py | Secant.py | py | 766 | python | en | code | 0 | github-code | 13 |
20702834627 | from django.contrib import admin
from django.urls import path, include
from pages import views
urlpatterns = [
path('project/page/', views.page, name="index"),
path('load_page/<page>', views.load_page, name="load_page"),
path('loaded_page/', views.PageLoader.as_view(), name="loaded_page"),
path('clea... | maxnth/ocr2tei | pages/urls.py | urls.py | py | 767 | python | en | code | 0 | github-code | 13 |
4132816507 | import random
SHOP = {
"ether": {
"ether": 50,
"mid-ether": 100,
"hi-ether": 150,
"turbo-ether": 200
},
"potion": {
"potion": 25,
"mid-potion": 30,
"hi-potion": 70
},
"vest": {
"black-vest": 100,
"ruby-vest": 15... | rachmifadillah/100DaysofCode | Chrono Triggers/chrono_triggers.py | chrono_triggers.py | py | 5,564 | python | en | code | 0 | github-code | 13 |
41318475545 | import os
from setuptools import setup
def packages(directory):
return [
_[0].replace('/','.')
for _ in os.walk(directory)
if os.path.isfile(os.path.join(_[0], '__init__.py'))
]
setup(
name = "ngnos",
version = "1.3.0",
author = "ngNOS maintainers and contributors",
aut... | ngnos/ngnos-1x | python/setup.py | setup.py | py | 892 | python | en | code | 0 | github-code | 13 |
17706532480 | #_*_coding= utf-8
import pickle
import pymongo
import pandas as pd
def location_mul(list):
for lst in list:
location(lst)
def location(str):
lines=[]
data = read()
movie_dic={}
result_dic={}
for movie_id in data:
index = movie_id
movie = data[movie_id]
... | 2019-Spring-Information-Retrieval/backend | positionFinal.py | positionFinal.py | py | 1,754 | python | en | code | 0 | github-code | 13 |
5692699272 | import pickle as pk
from sklearn.metrics import accuracy_score, f1_score
from match import models
from util import map_item
path_sent = 'feat/ml/sent_test.pkl'
path_pair = 'feat/nn/pair_test.pkl'
path_label = 'feat/label_test.pkl'
with open(path_sent, 'rb') as f:
sents = pk.load(f)
with open(path_pair, 'rb') a... | CyanYoung/chinese_intent_match | eval.py | eval.py | py | 1,079 | python | en | code | 2 | github-code | 13 |
22336979933 | is_happy = False
class Flower():
def __init__(self, name, req):
self.name = name
self.req = req
def water(self, flower_water):
if flower_water >= self.req:
global is_happy
is_happy = True
def status(self):
if is_happy:
return f"{self.... | DimitarGospodinov/softuni-python | Python OOP/Flower.py | Flower.py | py | 492 | python | en | code | 0 | github-code | 13 |
24297963134 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('race', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operat... | garyditsch/grand_prix | results/migrations/0001_initial.py | 0001_initial.py | py | 1,067 | python | en | code | 0 | github-code | 13 |
71350180819 | from albumentations import DualTransform
from albumentations.augmentations import functional as F
from albumentations.augmentations.bbox_utils import normalize_bbox, denormalize_bbox
import cv2
class PadConstant(DualTransform):
"""Pad side of the image / max if side is less than desired number.
Args:
... | cafeal/SIGNATE_AIEdge2 | src/TF_CenterNet/transforms/pad_constant.py | pad_constant.py | py | 3,216 | python | en | code | 3 | github-code | 13 |
23650378000 | import pytest
from .app import app as app_
def test_get_content_type():
"""
Testa se o `content_type` da resposta do `GET` da rota quiz
é um template HTML renderizado corretamente.
"""
with app_.test_client() as client:
response = client.get('/quiz/')
assert response.content_ty... | Sergio-Daniel-Pires/BlueSaver | test_quiz.py | test_quiz.py | py | 1,891 | python | pt | code | 2 | github-code | 13 |
12441992476 | import pytest
from gameprices.cli.mailalert import main as psnmailalert_main
from gameprices.test.commons import mailalert
from gameprices.test.test_psn import NO_SEARCH_FOR_CID_REASON
def test_mailfunc_not_existing():
wrong_line = "EP9000-CUSA07123_00-000000000000000,10.00,DE/de"
mailalert(wrong_line, psnma... | snipem/gameprices | gameprices/test/test_dealmailalert.py | test_dealmailalert.py | py | 989 | python | en | code | 65 | github-code | 13 |
12914079503 | import pandas as pd
from sqlalchemy import create_engine, text
from sqlalchemy.engine.url import URL
class Database:
def __init__(self, db_connection=None, dataframe=pd.DataFrame({"A": []}), dfname="DF_NAME"):
self.driver_name = db_connection["drivername"]
self.database_name = db_connection["datab... | SANElibDevTeam/SANElib | util/database.py | database.py | py | 2,667 | python | en | code | 7 | github-code | 13 |
36603777014 | from sys import *
setrecursionlimit(10**4)
# 위 코드 추가해서 통과!!!
def dfs(j_type, x, y, v, check, n):
dx, dy = [-1,0,1,0], [0,1,0,-1]
if check[x][y]:
return
else:
check[x][y] = 1
for i in range(4):
xx, yy = x + dx[i], y + dy[i]
if xx < 0 or xx >= n or yy < 0 or ... | majung2/CTpractice | python/2020하반기/2020WinterCoding/03.py | 03.py | py | 987 | python | en | code | 0 | github-code | 13 |
29876294147 | from __future__ import absolute_import
import shutil
from jens.maintenance import validate_directories
from jens.git_wrapper import clone
from jens.settings import Settings
from jens.errors import JensError
from jens.test.tools import create_fake_repository
from jens.test.testcases import JensTestCase
class Mainten... | cernops/jens | jens/test/test_maintenance.py | test_maintenance.py | py | 2,335 | python | en | code | 42 | github-code | 13 |
6217496754 | from django.contrib.auth.models import User
from django.db import models
from .api.APIFactory import APIFactory
from .api.CoinMarketCap import CoinMarketCap
class Crypto(models.Model):
"""Defines cryptocurrencies which can be used in tracker"""
symbol = models.CharField(max_length=10, primary_key=True)
n... | nazarpechka/bittracker | tracker/models.py | models.py | py | 5,315 | python | en | code | 0 | github-code | 13 |
11217897400 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# In[4]:
train_csv = pd.read_csv("D:\\OneDrive\\Desktop\\projects\\spooky authentication\\spooky-author-identification\\train.csv")
train_csv.head()
# In[5]:
test_csv = ... | SampathPalivela/Spooky-Author-identification | Spooky Authentication .py | Spooky Authentication .py | py | 4,837 | python | en | code | 1 | github-code | 13 |
73117875857 | import itertools
class Solution:
def compare(self, n1, n2):
n1, n2 = int(n1), int(n2)
if n1 > n2:
return 1
elif n1 == n2:
return 0
else:
return -1
def compareVersion(self, version1: str, version2: str) -> int:
v1 = version1.spl... | abaksy/leetcode-sol | 165/compareVersion.py | compareVersion.py | py | 719 | python | en | code | 1 | github-code | 13 |
71421319057 | #!/usr/bin/env python
#Finding a Spliced Motif
from Bio import SeqIO
with open('data/rosalind_sseq.txt') as f:
dna = []
for record in SeqIO.parse(f, 'fasta'):
dna.append(record.seq)
s, t = dna[0], dna[1]
memo = [0]*len(t)
for i in range(len(t)):
if i-1 >= 0:
memo[i] = s[memo[i-1]:].f... | dogaukinder/dogalind | sseq.py | sseq.py | py | 465 | python | en | code | 0 | github-code | 13 |
39398630615 | from propositions_dictionary import propositions
import random
import pyfiglet
end_game = True
score = 0
#Continuer tant que c’est pas faux
#Avec une while boucle
while end_game == True :
#Assigner pour chaque phrase la variable A et B
#Utilisation du dictionnaire python dans le fichier "propositions_dic... | raych78/HigherOrLower | Game.py | Game.py | py | 2,053 | python | fr | code | 0 | github-code | 13 |
14450330336 | import json
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIRequestFactory, APIClient, APITestCase
from mixer.backend.django import mixer
from django.contrib.auth.models import User
from .views import UserModelViewSet
from .models import User
class TestUserModelVi... | Alex-Ruf/django_rest | backend/users/tests.py | tests.py | py | 1,559 | python | en | code | 0 | github-code | 13 |
24810405446 | from __future__ import annotations
from typing import Dict, TYPE_CHECKING
import discord
import asyncio
import json
import re
import webcolors
from discord.app_commands import command, describe, guilds, checks
from discord.ext import commands
from utils import SERVER_ID, Role
import uuid
if TYPE_CH... | TMS-SciO/tms-scioly-bots | cogs/embed.py | embed.py | py | 32,226 | python | en | code | 1 | github-code | 13 |
1750283690 | from functions.validação import lerNota
from functions.visual import arredondamento
notas = []
for x in range(3):
notas.append(lerNota(f'Nota {x + 1}: '))
media = arredondamento(sum(notas) / len(notas))
if media < 7:
situacao = 'Reprovado(a)'
elif media < 10:
situacao = 'Aprovado(a)'
else:
situacao = ... | Noronha1612/wiki_python-brasil | Estruturas de Decisão/ex20.py | ex20.py | py | 442 | python | pt | code | 0 | github-code | 13 |
2005505321 | import os
from fastapi import FastAPI, Request
from fastapi.responses import FileResponse
from fastapi.middleware.cors import CORSMiddleware
from google.cloud import storage
from google.cloud import vision
from models import Parking
from send_pushover import send_pushover
from orm import access_table
from typing imp... | blacksnail789521/TSMC_parking_lot | main.py | main.py | py | 5,594 | python | en | code | 0 | github-code | 13 |
36330642485 | import re
import os
from functools import cmp_to_key
from hw2.tokenize_lemmatize import get_normal_form
from utilz.utils import get_tokenize_res
from utilz.const import limit as LIMIT
class WordInfo:
def __init__(self):
self.documents = []
self.general_count = 0
def append_document_info(self,... | borisgk98/itits-infosearch | hw3/create_index.py | create_index.py | py | 2,599 | python | en | code | 0 | github-code | 13 |
14570745682 | #!/usr/bin/env python3
from Bio import Entrez
import progressbar
import sys
Entrez.email = sys.argv[1]
Entrez.api_key = sys.argv[2]
query = sys.argv[3]
def get_taxid(result):
return result['LinkSetDb'][0]["Link"][0]["Id"]
def format_taxa(text):
try:
lineage = text["Lineage"]
except:
lin... | dwthomas/NCBI-denovo-reference-database | download_ncbi.py | download_ncbi.py | py | 6,251 | python | en | code | 3 | github-code | 13 |
41243305994 | """ Enter docstring for this program
"""
import random
import matplotlib.pyplot as pyplot
def guessingGame1(limit):
"""Play the guessing game by making random guesses."""
secretNumber = random.randrange(1, limit + 1)
myGuess = 0
guesses = 0
while (myGuess != secretNumber):
myGuess = random... | gsakkas/seq2parse | src/tests/parsing_test_37.py | parsing_test_37.py | py | 860 | python | en | code | 8 | github-code | 13 |
38901782236 | # -*- coding: utf-8 -*-
"""
LEAP™ TransmissionCache
=======================
Contributors: Christian Sargusingh
Date: 2020-06-06
Repository: https://github.com/cSDes1gn/LEAP/tree/master/src/tcs
README available in repository root
Version:
Class `TransmissionCache` defines a LIFO caching architecture saving a... | LEAP-Systems/tesseract | legacy/codec/cache.py | cache.py | py | 5,815 | python | en | code | 0 | github-code | 13 |
36805441026 | #!/usr/bin/env python
import re, sys
from poserFile import *
def scalingData(source, actor_names):
wrapper_text = """\
{
version
{
number 4.1
}
Figure
{
}
}"""
content = PoserFile(wrapper_text.split... | odf/pfool | Python/extractScaling.py | extractScaling.py | py | 822 | python | en | code | 1 | github-code | 13 |
12206536772 | #!/usr/bin/python3
"""
Author: Zixiang Ma
Email: ericma0824@gmail.com
Time created: Sept 20 2019
ReadMe
1. Throught Process
This script contains two phases. Phase 1 is meant for data manipulation where files are parsed
and converted into tuples or dictionary. In phase 2, the script counts the mathching tuple by f... | maxxx580/tripadvisor-take-home | main.py | main.py | py | 5,803 | python | en | code | 0 | github-code | 13 |
37248696444 | import torch
import jax
from jax import numpy as jnp
def onehot(labels, num_classes, on_value=1.0, off_value=0.0):
if torch.is_tensor(labels):
x = torch.nn.functional.one_hot(labels, num_classes=num_classes)
else:
x = (labels[..., None] == jnp.arange(num_classes)[None])
x = j... | minyoungpark1/swin_transformer_v2_jax | core/criterion.py | criterion.py | py | 893 | python | en | code | 8 | github-code | 13 |
18391427814 | import tornado.ioloop
from tornado.web import RequestHandler
import requests
import json
JOKE_URL = "https://official-joke-api.appspot.com/jokes/programming/random"
VALIDATE_KEY = "http://localhost:8080/api/validate?api_key={}"
class MainHandler(RequestHandler):
async def get(self):
api_key = self.get_ar... | Rangeeshar/sample_microservice | python_microservice/python_server.py | python_server.py | py | 1,426 | python | en | code | 0 | github-code | 13 |
9087030040 | #https://www.acmicpc.net/problem/11000
#백준 11000번 강의실 배정(정렬)
#import sys
#input = sys.stdin.readline
import heapq
n = int(input())
classes = []
for _ in range(n):
classes.append(list(map(int, input().split())))
classes.sort(key = lambda x : (x[0],x[1]))
cnt = 1
lesson = []
heapq.heappush(lesson, classes[0][... | MinsangKong/DailyProblem | 06-01/2.py | 2.py | py | 516 | python | en | code | 0 | github-code | 13 |
33650008966 | '''
This Module read video file and process each frame.
processed frame again write to new video object file.
'''
import cv2
import numpy as np
import download
import config
import logging
import transformer
import result
logger=logging.getLogger(__name__)
def main():
'''
this function downlaod video from ... | shubham1809/pla-image-processing-brightness_adjust | playment/processing.py | processing.py | py | 1,706 | python | en | code | 0 | github-code | 13 |
23080422 | ############ Chaplygin gas
######## definition of Friedmann universe filled with CG
import numpy as np
def CG(a, t, A, B):
dadt = np.sqrt(np.sqrt(A*a**6 + B) )/np.sqrt(3.*a)
return dadt
###### parameters
A = 1./3
B=0.3
a0 = 0.1
##### time
t = np.linspace(0, 16, 101)
from scipy.integrate import... | rubbyaworka/The_codes_of_Chaplygin_gas_model | The_codes_of_Chaplygin_gas_models/CG_density_on_time.py | CG_density_on_time.py | py | 709 | python | en | code | 0 | github-code | 13 |
38028110388 | # Location & number of raw data file:
#runnumber=1000613
runnumber= 1000536
#runnumber = 1000855
RawDataDir="/castor/cern.ch/atlas/testbeam/combined/2004/"
#RawDataDir="/data/calo"
RawDataFilePrefix="daq_SFI-51_calo"
#include( "AthenaCommon/Atlas.UnixStandardJob.py" )
include( "ByteStreamCnvSvc/TBEventSelector_jobOp... | rushioda/PIXELVALID_athena | athena/TestBeam/TBCnv/share/CheckBCIDs.py | CheckBCIDs.py | py | 1,380 | python | en | code | 1 | github-code | 13 |
20981852185 | import networkx as nx
import sys
import numpy as np
import matplotlib.colors as colors
import random
import matplotlib.pyplot as plt
def internal_density (G, partition):
# the average density of the node belongs to each commmnities
val = 0.
n = G.number_of_nodes()
for com in set(partition.values()) :
... | b02901017/NS2017 | hw2/scoringfunction.py | scoringfunction.py | py | 3,197 | python | en | code | 0 | github-code | 13 |
71594429138 | from backend.stats.database import DBClient
from nitrotype import Racer
import datetime
dbclient = DBClient()
c = dbclient.db.racers
def create_profile(username):
racer = Racer(username)
races = (racer.races)
wpm = racer.wpm_average
data = {'username': username, "races": [races], "wpms": [wpm], 'hourly'... | Try2Win4Glory/Lacan-NTSport-Website | backend/stats/players/stats.py | stats.py | py | 1,129 | python | en | code | 1 | github-code | 13 |
15595409637 | import pandas as pd
import numpy as np
import os
def append_function(cant_ejec):
for i in (np.arange(int(cant_ejec))):
df_dnn = pd.read_csv('dnn_accuracy_delta'+str(i)+'.csv', header=None)
df_ph0 = pd.read_csv('perc_hidden0_delta'+str(i)+'.csv', header=None)
df_ph1 = pd.read_csv('perc_hidde... | M2odrigo/model_config | data/test/append_function.py | append_function.py | py | 1,130 | python | en | code | 0 | github-code | 13 |
17041645184 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.InsPerson import InsPerson
from alipay.aop.api.domain.InsClaimPolicy import InsClaimPolicy
from alipay.aop.api.domain.InsPerson import InsPerson
class AlipayInsSceneClaimApplyMode... | alipay/alipay-sdk-python-all | alipay/aop/api/domain/AlipayInsSceneClaimApplyModel.py | AlipayInsSceneClaimApplyModel.py | py | 7,688 | python | en | code | 241 | github-code | 13 |
39540885695 | # modified from http://deeplearning.net/tutorial/
import os
import sys
import timeit
import numpy
import theano
import theano.tensor as T
class HiddenLayer(object):
def __init__(self, rng, input, n_in, n_out, W=None, b=None,
activation=T.tanh):
"""
Typical hidden layer of a MLP: u... | aporcel/Machine-Learning | homework4/mlp.py | mlp.py | py | 5,059 | python | en | code | 1 | github-code | 13 |
14211299621 | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser
from blog.models import article, category
from blog.serializers import BlogSerializer, BlogCategorySerializer
# Create your views her... | ESBOL2312/djr-blog-back | blog/views.py | views.py | py | 2,468 | python | en | code | 0 | github-code | 13 |
34619302234 | import streamlit as st
# url video: https://www.youtube.com/watch?v=_9WiB2PDO7k&list=PLJ39kWiJXSixyRMcn3lrbv8xI8ZZoYNZU
# Text/Title
st.title("Streamlit tutorial")
# Header/Subheader
st.header("This is a header")
st.subheader("This is a subheader")
# Text
st.text("Hello Streamlit")
# Markdown
st.markdown("### This... | joseignaciorm/share-streamlit-app | app.py | app.py | py | 2,973 | python | en | code | 0 | github-code | 13 |
72516562578 | import bittensor
import torch
import wandb
import datetime
import traceback
import sys
import os
from loguru import logger; logger = logger.opt(colors=True)
from torch.nn.utils import clip_grad_norm_
from datetime import datetime,timedelta
from threading import Lock
os.environ['TOKENIZERS_PARALLELISM'] = 'false'
def ... | isabella618033/neurons | neurons/text/advanced_server/run.py | run.py | py | 8,940 | python | en | code | 1 | github-code | 13 |
17036383544 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayBossProdContractDownloadModel(object):
def __init__(self):
self._business_id = None
self._file_key = None
self._source_system_id = None
self._tenant = None
... | alipay/alipay-sdk-python-all | alipay/aop/api/domain/AlipayBossProdContractDownloadModel.py | AlipayBossProdContractDownloadModel.py | py | 2,439 | python | en | code | 241 | github-code | 13 |
13443425668 | import sys
from definitions import *
from units import *
def preprocess_line( line ):
if line[ 0 ] == '<':
return UnitLine( line )
else:
return TokenLine( *( line.split() ) )
sys.stdout = open( 'a.frisc', 'w' )
tlines = sys.stdin.readlines()
lines = [ t.rstrip() for t in tlines ]
indented = ... | PPJ-Grupa/PPJ | Lab4_zj/GeneratorKoda.py | GeneratorKoda.py | py | 1,043 | python | en | code | 0 | github-code | 13 |
17061075054 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class UboVO(object):
def __init__(self):
self._duty = None
self._invest_rate = None
self._name = None
@property
def duty(self):
return self._duty
@duty.set... | alipay/alipay-sdk-python-all | alipay/aop/api/domain/UboVO.py | UboVO.py | py | 1,700 | python | en | code | 241 | github-code | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.