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
22265028586
from mensajes import separador_chats from usuarios import inicio_sesion from parametros import VOLVER_FRASE, ABANDONAR_FRASE from datetime import datetime, date def lista_grupos(): #lee el archivo with open('grupos.csv', 'rt') as archivo_grupos: lista_grupos = archivo_grupos.readlines() for x in ra...
Alzvil/IIC2233-Progra-Avanzada-Tareas-2021-1
Tareas/T0/grupos.py
grupos.py
py
6,884
python
es
code
0
github-code
36
23268928678
#import sys, os #sys.path.append(os.path.abspath("")) from functionsDB.ConnectionDB import abrirconexion, cerrarconexion from functionsDB.entity.comentario import Comentario from datetime import datetime def altacomentario(comentario): cur,con = abrirconexion() sql = "insert into comentario(fecha,hora,conteni...
exegonzalez/Taller-de-Integracion
App/src/functionsDB/ABMComentario.py
ABMComentario.py
py
2,295
python
es
code
1
github-code
36
11545489040
from logging import INFO, getLogger, StreamHandler, Formatter, DEBUG, INFO from os import environ from urlparse import urlparse from gunicorn.glogging import Logger from log4mongo.handlers import MongoHandler, MongoFormatter # parse the MONGOLAB_URI environment variable to get the auth/db info MONGOLAB_URI_PARSED =...
mapio/heroku-log4mongo
heroku-log4mongo/logger.py
logger.py
py
2,096
python
en
code
5
github-code
36
939034143
from datetime import datetime from src.app import db, app import uuid from src.models.mixins import BaseMixin from src.helpers import * from sqlalchemy import exc class BookRating(BaseMixin, db.Model): __tablename__ = "book_ratings" rating_id = db.Column(db.String(50), primary_key=True, default=lambda: uuid.u...
Aaronh3k/book-status-api
src/models/book_ratings.py
book_ratings.py
py
7,769
python
en
code
0
github-code
36
150466023
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse, reverse_lazy from django.views import generic from django.views import View from django.views.generic.edit import CreateView, UpdateView, DeleteView from .models import Pla...
edbranson/scorekeeping
scorekeeping/play/views.py
views.py
py
3,501
python
en
code
0
github-code
36
17613529074
import pandas as pd, numpy as np import pytzer as pz from pytzer.libraries import Moller88 # Import data and prepare for tests pz = Moller88.set_func_J(pz) data = pd.read_csv("tests/data/M88 Table 4.csv").set_index("point") m_cols = ["Na", "Ca", "Cl", "SO4"] params = Moller88.get_parameters(solutes=m_cols, temperature...
mvdh7/pytzer
tests/test_M88.py
test_M88.py
py
984
python
en
code
15
github-code
36
23923499833
import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, concatenate, Conv2D, UpSampling2D from tensorflow.keras.layers import GlobalAveragePooling2D, Dense, LeakyReLU from tensorflow.keras import backend as K from keras.layers.core import Activation from keras.utils....
vosps/tropical_cyclone
wgan_no_rain/models.py
models.py
py
15,850
python
en
code
8
github-code
36
18877148508
# coding=utf-8 import frontik.handler class Page(frontik.handler.PageHandler): def get_page(self): self_uri = self.request.host + self.request.path invalid_json = self.get_argument('invalid', 'false') data = { 'req1': self.post_url(self_uri, data={'param': 1}), 'r...
nekanek/frontik-without-testing
tests/projects/test_app/pages/json_page.py
json_page.py
py
936
python
en
code
1
github-code
36
40761258837
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution(object): def addTwoNumbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode "...
QingbiaoLi/LeetCodeFighter
List/445_AddTwoNumberII.py
445_AddTwoNumberII.py
py
1,371
python
en
code
0
github-code
36
28090834284
import pytest import config import random from datetime import datetime from flask.testing import FlaskClient from webapp import create_app, db from flask import current_app from webapp.models import Theme, Timebox, Task, Project @pytest.fixture(scope='function') def models(): return {'timebox': Timebox} @pytest....
thekitbag/todoodleoo-server
tests/conftest.py
conftest.py
py
5,630
python
en
code
0
github-code
36
35416395710
import mnml from wiki import Wiki from tmpl import Tmpl, quote, unquote wiki = Wiki() class T(Tmpl): _base = """<html> <head><title>Wiki</title></head> <body><h1>${block t}${endblock}</h1>${block c}${endblock}</body> </html>""" _index = """${extends base} ${block t}All Pages${endblock} ...
sma/microwebframeworks
mnml-tmpl.py
mnml-tmpl.py
py
1,863
python
en
code
6
github-code
36
2911463134
import torch.nn as nn import torch.nn.functional as F class NeuralNet(nn.Module): def __init__(self): super(NeuralNet, self).__init__() self.conv1 = nn.Conv2d(1, 3, kernel_size=(3, 3), stride=1, padding=0) self.conv2 = nn.Conv2d(3, 6, kernel_size=(4, 4), stride=1, padding=0) sel...
arunsanknar/AlectioExamples
image_classification/fashion-mnist-and-mnist/model.py
model.py
py
870
python
en
code
0
github-code
36
2762523271
from flask import Flask, request, abort from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, ) app = Flask(__name__) line_bot_api = LineBotApi('1l6c8hOlVNiLh23YRFrdl1TxJxK4KUZpp...
vacharich1/testme
bot_test.py
bot_test.py
py
1,126
python
en
code
0
github-code
36
9045055933
from typing import Optional from xml.etree.ElementTree import Element, Comment from api.mvc.model.data.content_model import ContentModel from api.mvc.model.data.data_model import DataModel from api.mvc.model.data.data_type import DataType from api_core.exception.api_exception import ApiException from api_core.helper.f...
seedbaobab/alfresco_helper
api/mvc/model/service/file/content_model_service.py
content_model_service.py
py
30,329
python
en
code
0
github-code
36
5929748102
from flask_restx import Namespace, Resource, reqparse from main.model.ORM import * search_ns = Namespace('searching', description='search recipes by either recipe\'s name or ingredients list') search_name_rep = reqparse.RequestParser() search_name_rep.add_argument('name', type=str) search_name_rep.add_argument...
SHFeMIX/Comp3900
backend/main/controller/search.py
search.py
py
4,399
python
en
code
3
github-code
36
28517096997
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable, ln from variable_functions import my_attribute_label class county_id(Variable): """county ...
psrc/urbansim
psrc/household/county_id.py
county_id.py
py
1,610
python
en
code
4
github-code
36
18515443128
from sets import Set from collections import defaultdict class MagicDictionary(object): def __init__(self): """ Initialize your data structure here. """ def buildDict(self, dict): """ Build a dictionary through a list of words :type dict: List[str] :rtyp...
jimmy623/LeetCode
Solutions/Implement Magic Dictionary.py
Implement Magic Dictionary.py
py
1,413
python
en
code
0
github-code
36
28519396947
# PopGen 1.1 is A Synthetic Population Generator for Advanced # Microsimulation Models of Travel Demand # Copyright (C) 2009, Arizona State University # See PopGen/License DEFAULT_PERSON_PUMS2000_QUERIES = [ "alter table person_pums add column agep bigint", "alter table person_pu...
psrc/urbansim
synthesizer/gui/default_census_cat_transforms.py
default_census_cat_transforms.py
py
42,838
python
en
code
4
github-code
36
29403005622
import rooms import asyncio from asgiref.sync import async_to_sync import json as encoder class WebsocketFireClass(): @async_to_sync async def new_chat_message(self, state): encoded_state = encoder.dumps({'type': 'new_chat_message', 'data': state}) print("NEW CHAT MESSAGE, START FIRING...") ...
anotherrandomnickname/ffms-websocket-py
wsfire.py
wsfire.py
py
532
python
en
code
0
github-code
36
25540372658
def run(): mi_diccionario = { "llave1": 1, "llave2": 2, "llave3": 3, } # print(mi_diccionario["llave1"]) # print(mi_diccionario["llave2"]) # print(mi_diccionario["llave3"]) poblacion_paises = { "Argentina" : 40234658, "Brasil" : 70548621, "Chile" ...
MorenoChristian/Curso-Basico-de-Python-Platzi
Diccionarios.py
Diccionarios.py
py
901
python
es
code
0
github-code
36
17774181352
from rest_framework.permissions import BasePermission from noticeboard.utils.notices import ( user_allowed_banners, has_super_upload_right, ) class IsUploader(BasePermission): """ A custom Django REST permission layer to check authorization over different actions on notices. """ def has_...
IMGIITRoorkee/omniport-app-noticeboard
permissions/uploader.py
uploader.py
py
1,591
python
en
code
6
github-code
36
5049475129
# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master...
NVIDIA/TensorRT-LLM
docs/source/conf.py
conf.py
py
2,943
python
en
code
3,328
github-code
36
43343758366
def hanoi(n, src, via, dst) : global cnt if n == 1 : cnt += 1 # print(f"{src} -> {dst}") else : hanoi(n - 1, src, dst, via) hanoi(1, src, via, dst) hanoi(n - 1, via, src, dst) N = int(input()) cnt = 0 hanoi(N, "A", "B", "C") print(cnt)
RelexSun/python-jupyter-notebook
PythonAlgorithm/Alg.2.4/solve.py
solve.py
py
262
python
en
code
0
github-code
36
18745919637
from telegram import Bot, Update, ParseMode from telegram.ext import run_async import time from bot.modules.helper_funcs.extraction import extract_user from bot import dispatcher from bot.modules.disable import DisableAbleCommandHandler @run_async def gdpr(bot: Bot, update: Update): message = update.effective_...
koppiesttiajaykumar/bot
bot/modules/gdpr.py
gdpr.py
py
914
python
en
code
0
github-code
36
71075117545
import collections class Solution: def removeStones(self, stones: List[List[int]]) -> int: stones = list(map(tuple, stones)) s = set(stones) dx = collections.defaultdict(set) dy = collections.defaultdict(set) for i,j in s: dx[i].add(j) ...
nango94213/Leetcode-solution
0947-most-stones-removed-with-same-row-or-column/0947-most-stones-removed-with-same-row-or-column.py
0947-most-stones-removed-with-same-row-or-column.py
py
879
python
en
code
2
github-code
36
41224759283
''' Created on 15-Oct-2013 @author: Kashaj ''' import re, sqlite3,os db = sqlite3.connect('Train_Database.db') db.text_factory = str db.row_factory = sqlite3.Row db.execute('drop table if exists TrainStationNode') db.execute('create table TrainStationNode(Train_Num char[6],stn_code char[6],route int,arr_time text,dep...
ShaikAsifullah/Indian-Railways-Informal
getEdges.py
getEdges.py
py
2,447
python
en
code
1
github-code
36
75138929384
from loja.models import Produto from loja.models import Pedido from loja.models import CATEGORIAS from rest_framework import serializers class ProdutoSerializer(serializers.ModelSerializer): class Meta: model = Produto fields = ( 'id', 'nome', 'descricao', ...
jonasfsilva/desafio_intmed
loja/serializers.py
serializers.py
py
1,298
python
pt
code
0
github-code
36
20780721557
import os #to access files from PIL import Image #to open JPEGs import numpy as np #-------------------------------Custom INCLUDES------------------------------- import lookupTables as lT #-------------------------------Function DEFINITIONS---------------------------- def fittingEstimator(inDir, file_name, ...
nowaythatsok/GNU_lapser
version_01/estimators.py
estimators.py
py
1,924
python
en
code
0
github-code
36
2671289236
import os import shutil from fastapi import UploadFile # UPLOAD_DIR = "model_upload_dir" def upload_file(upload_dirname: str, file: UploadFile, filename: str): if file and filename: fileobj = file.file target_path = os.path.join(upload_dirname, filename) target_dir = os.path.dirname(targe...
w-okada/voice-changer
server/restapi/mods/FileUploader.py
FileUploader.py
py
1,402
python
en
code
12,673
github-code
36
19567593432
import requests import csv from bs4 import BeautifulSoup import json from collections import namedtuple from typing import List, Dict TOPICS_NUMBER = 6 LEVELS_NUMBER = 5 MIN_LEVEL_CONTEST_ID = "030813" MAX_LEVEL_CONTEST_ID = "030817" TABLE_URL = ("https://ejudge.lksh.ru/standings/dk/stand.php" "?from={}&t...
daniil-konovalenko/Cprime-practice-results
load_results.py
load_results.py
py
3,803
python
en
code
0
github-code
36
24401528809
"""Handles the creating of obstacles within the game instance.""" import pygame from src.scripts.coordinate import Coordinate class Obstacle: """Class for handling the creating of obstables.""" def __init__(self) -> None: self.size = (50, 300) self.position = [ Coordinate(700, 400)...
Carson-Fletcher/PY_Flappy_Bird
src/scripts/obstacle.py
obstacle.py
py
1,007
python
en
code
0
github-code
36
43431199600
#!/usr/bin/env python3 import unittest from game import * TEST_BOARD01 = [ # 0123456789ABCDEFGHI " W W W W ", # 0 " ", # 1 "W W W W", # 2 " W W W ", # 3 " W P P W ", # 4 "W W W W W W", # 5 " W P W ", # 6 " W ...
AquaSpare/Alea-Evangelii-group-g
tests.py
tests.py
py
14,013
python
en
code
0
github-code
36
24925255734
import pygame pygame.init() screen_width = 480 screen_height = 640 screen = pygame.display.set_mode((screen_width, screen_height)) background = pygame.image.load("D:/coding/python/pygame_basic/background.png") pygame.display.set_caption("offRo") running = True while running: for event in pygame.event.get(): ...
pla2n/python_practice
python/pygame_basic/2_background.py
2_background.py
py
496
python
en
code
0
github-code
36
25946850418
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def maxDepth(self, root: Optional[TreeNode]) -> int: result = 0 stack = [(root, 1)] ...
dzaytsev91/leetcode-algorithms
easy/104_maximum_depth_binary_tree.py
104_maximum_depth_binary_tree.py
py
631
python
en
code
2
github-code
36
41483919268
import json import requests from MGP_SDK import process from MGP_SDK.auth.auth import Auth class Pipelines: def __init__(self, auth: Auth): self.auth = auth self.api_version = self.auth.api_version self.base_url = f'{self.auth.api_base_url}/ordering/{self.api_version}/pipelines' ...
Maxar-Corp/maxar-geospatial-platform
src/MGP_SDK/ordering_service/pipelines.py
pipelines.py
py
3,242
python
en
code
2
github-code
36
14963550829
import shutil import logging from logging.config import fileConfig import sys import socket fileConfig('log.ini', defaults={'logfilename': 'bee.log'}) logger = logging.getLogger('health') # get hard drive space total, used, free = shutil.disk_usage("/") percent_used = used / total * 100.0 percent_used = '{:0.2f}'.fo...
jenkinsbe/hivekeepers
get_server_health.py
get_server_health.py
py
1,049
python
en
code
0
github-code
36
41560046268
# -*- coding: utf-8 -*- # @Time : 2018/5/6 20:21 # @Author : Narata # @Project : android_app # @File : insert_comment.py # @Software : PyCharm import pymysql import json db = pymysql.connect('localhost', 'root', 'narata', 'android', charset='utf8') cursor = db.cursor() with open('../dataset/review.json',...
narata/android_app
databases/mysql/insert_comment.py
insert_comment.py
py
874
python
en
code
0
github-code
36
17793632581
n = int(input()) s = input() ans = 0 for i in range(n): if i + ans*2 > n: break for j in range(ans, n - i // 2): print(s[i:j+1], end='=') print(s[i + j+1:i + j + j]) if s[i:j+1] == s[i + j+1:i + j + j]: ans = max(ans, j-i+1) print(ans) if i + ...
fastso/learning-python
atcoder/contest/abc141_e.py
abc141_e.py
py
364
python
en
code
0
github-code
36
4115074101
from util import * if __name__ == '__main__': # pass getAllLoadChange() getLoadChangeFile() f=open('initLoad.log','w') for i in range(1, 9): for j in range(1, 10): leo,load = getLoad('{}{}'.format(i, j)) f.write('{},{}\n'.format(leo,load)) print([1,2...
LaputaRobot/STK_MATLAB
PMetis/getSatLoad.py
getSatLoad.py
py
329
python
en
code
0
github-code
36
28984387817
import sys input = sys.stdin.readline score = [] s_score = [] answer = [] for i in range(8): score.append(int(input())) s_score = sorted(score, reverse=True) s_score = s_score[:5] for i in s_score: answer.append(score.index(i)+1) answer.sort() print(sum(s_score)) print(*answer)
youkyoungJung/solved_baekjoon
백준/Silver/2822. 점수 계산/점수 계산.py
점수 계산.py
py
311
python
en
code
0
github-code
36
6071785481
"""Create multi-level pandas dataframe for kinematic data in OpenSim style. """ __author__ = "Marcos Duarte, https://github.com/BMClab/" __version__ = "1.0.0" __license__ = "MIT" import numpy as np import pandas as pd def dfmlevel(x, labels=None, index=None, n_ini=0, names=['Marker', 'Coordinate'], ...
BMClab/BMC
functions/dfmlevel.py
dfmlevel.py
py
1,523
python
en
code
398
github-code
36
22169474472
import memcache, random, string mc = memcache.Client(['127.0.0.1:11211'], debug=0) HEAD_KEY = "mqueueheadpointer" TAIL_KEY = "mqueuetailpointer" SEPARATOR = "___" VALUE_KEY = "value" LINK_KEY = "link" def random_id(): rid = '' for x in range(8): rid += random.choice(string.ascii_letters + string.digits) return ri...
codescrapper/mqueue
mqueue.py
mqueue.py
py
1,142
python
en
code
1
github-code
36
18792168810
import sys from fractions import Fraction prog, name, reps, lead = sys.argv[:4] lead, reps = int(lead), int(reps) L = [Fraction(s) for s in sys.argv[4:]] L = L * reps pL = [] def add_invert(n,d): p = 1/d q = n + p pL.append((str(d), str(p), str(n), str(q))) return q def evaluate(L): d = L.pop() ...
telliott99/short_takes
contd_fracs.py
contd_fracs.py
py
604
python
en
code
0
github-code
36
71578859943
#!/usr/bin/env python import vtk def main(): font_size = 24 # Create the text mappers and the associated Actor2Ds. # The font and text properties (except justification) are the same for # each single line mapper. Let's create a common text property object singleLineTextProp = vtk.vtkTextProperty...
lorensen/VTKExamples
src/Python/Annotation/MultiLineText.py
MultiLineText.py
py
7,461
python
en
code
319
github-code
36
19856862641
# -*-- encoding=utf-8 --*- import pandas as pd import xlsxwriter import os import platform from pandas import ExcelWriter from util import main_function,plot_trend def __read_one_csv_file(inCsvFileName): try: callFailData=pd.read_csv(inCsvFileName, dtype={'呼叫对方号码': ob...
sundaygeek/bigdata-cloud-analysis
cloud_in_callfail.py
cloud_in_callfail.py
py
18,222
python
en
code
0
github-code
36
74551607144
""" Operadores Lógicos and, or, not in e not in """ """ nome = "Juliana" if 'Ju' not in nome: print('Executei.') else: print("Existe o texto.") """ usuario = input('Nome de usuário: ') senha = input('Senha do usuário: ') usuario_bd = 'Juliana' senha_bd = '123456' if usuario_bd == usuario and senha_bd == sen...
JudyCoelho/exerciciosCursoPython
aula12/aula12.py
aula12.py
py
424
python
pt
code
0
github-code
36
20756086605
""" Created on Thu Sep 8 14:37:34 2016 @author: Patrick Trainor @course: Artificial Intelligence @title: Project 2 Code for embedding of figure in tk credited to: http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html Code for labeling points on figure credited to "unknown" @ http://stackov...
trainorp/srch
TSP_BFS_DFS.py
TSP_BFS_DFS.py
py
6,501
python
en
code
0
github-code
36
13670330701
import random from random import choice import discord import asyncio from discord.ext import commands import requests bot = commands.Bot(command_prefix='.') class games(commands.Cog): def __init__(self, bot): self.bot = bot determine_flip = [1, 0] @commands.command() async d...
BrandonLee28/Cardinal4
games.py
games.py
py
4,082
python
en
code
0
github-code
36
32489489942
#-*-coding:utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ __all__ = ['Department'] class Department(models.Model): name = models.CharField(max_length=30,unique=True,blank=False,default='guest',verbose_name=_('Department')) # principal = models.ManyToManyField(U...
opnms/opnms
users/models/department.py
department.py
py
614
python
en
code
0
github-code
36
71362096425
import os import logging from logging.handlers import RotatingFileHandler #Bot token @Botfather TG_BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "") #Your API ID from my.telegram.org APP_ID = int(os.environ.get("APP_ID", "")) #Your API Hash from my.telegram.org API_HASH = os.environ.get("API_HASH", "") #Your db channe...
RymOfficial/HackerFileShare
config.py
config.py
py
3,331
python
en
code
2
github-code
36
15066809328
# This file is part of ZNC-Signal <https://github.com/poppyschmo/znc-signal>, # licensed under Apache 2.0 <http://www.apache.org/licenses/LICENSE-2.0>. import pytest from copy import deepcopy from collections import namedtuple from conftest import signal_stub, signal_stub_debug, all_in signal_stub = signal_stub # qui...
poppyschmo/znc-signal
tests/test_hooks.py
test_hooks.py
py
13,691
python
en
code
1
github-code
36
41756790109
# Implementation of pseudocode for generating instances for # Discrete Knapsack Problem (Chapter 2.5) # Link: # http://radoslaw.idzikowski.staff.iiar.pwr.wroc.pl/instruction/zto/problemy.pdf from RandomNumberGenerator import RandomNumberGenerator if __name__ == "__main__": # Step 0, initalization of used variable...
F3mte/L-Zaawansowane-techniki-optymalizacji
DoubleKnapsackProblemGenerator.py
DoubleKnapsackProblemGenerator.py
py
962
python
en
code
0
github-code
36
35398230138
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os import subprocess from contextlib import closing from StringIO import StringIO from twitter.common.collections import maybe_list from pants.backend.core.t...
fakeNetflix/square-repo-pants
tests/python/pants_test/tasks/test_base.py
test_base.py
py
8,440
python
en
code
0
github-code
36
4578617525
n,m,k = [int(x) for x in input().split()] area = [] for i in range(k): x,y,r = [int(a) for a in input().split()] area.append([[x-r,x+r],[y-r,y+r]]) dx,dy = 0,0 for x in range(n): cx = 0 for i in range(k): if area[i][0][0] <= x <= area[i][0][1]: cx +=1 dx = max(cx,dx) for y in ran...
naphattar/Betaprogramming
Chapter 1/1042.py
1042.py
py
485
python
en
code
0
github-code
36
17952105925
""" This file defines a mesh as a tuple of (vertices, triangles) All operations are based on numpy ndarray - vertices: np ndarray of shape (n, 3) np.float32 - triangles: np ndarray of shape (n_, 3) np.uint32 """ import numpy as np def box_trimesh( size, # float [3] for x, y, z axis length (in meter) under box ...
ZiwenZhuang/parkour
legged_gym/legged_gym/utils/trimesh.py
trimesh.py
py
2,093
python
en
code
301
github-code
36
23049817329
##Remove tax from a payment - start with the gross def onePercent(taxValue, num): value = 100 + float(taxValue) onePC = num/value return onePC def desiredPercentage(onePC, desired): value = onePC * desired return value def calcTax(tax, num, desired): onePC = onePercent(tax, num) total...
idwesar/vat-calculator
reverse_vat_calc.py
reverse_vat_calc.py
py
701
python
en
code
1
github-code
36
11045288759
from datetime import datetime from django.shortcuts import get_object_or_404 from rest_framework import status from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from rest_framework.decorators import action from rest_framework.viewsets import GenericViewSet, ModelViewSet...
mohsen-hassani-org/teamche
todo_list/api.py
api.py
py
3,846
python
en
code
0
github-code
36
72973366503
# coded by h4sski ''' https://adriann.github.io/programming_problems.html Write three functions that compute the sum of the numbers in a list: using a for-loop, a while-loop and recursion. (Subject to availability of these constructs in your language of choice.) ''' list_input = [1, 2, 3, 4, 5, 6, 7] def for_loop(...
h4sski-programming/Python
py2220.py
py2220.py
py
866
python
en
code
0
github-code
36
24214471653
from lib.api_lib import * faker = Factory.create() BILLING_FIRST_NAME = faker.firstName() BILLING_LAST_NAME = faker.lastName() BILLING_COMPANY = faker.company() BILLING_STREET_ADD1 = faker.buildingNumber().lstrip("0") BILLING_STREET_ADD2 = faker.streetName() BILLING_CITY = faker.city() BILLING_PHONE = faker.phoneNumb...
testing-sravan/tests-scripts-worked
Regression_suite_bigc/fixtures/order_coupons.py
order_coupons.py
py
3,006
python
en
code
0
github-code
36
25404288175
# -*- coding: utf-8 -*- import torch.nn as nn from network import Decomposition,MultiscaleDiscriminator,downsample from utils import gradient from ssim import SSIM import torch import torch.optim as optim import torchvision import os import torch.nn.functional as F from contiguous_params import ContiguousParams class...
thfylsty/ImageFusion_DeepDecFusion
model.py
model.py
py
11,325
python
en
code
5
github-code
36
73225167144
from extra_streamlit_tools._logging import logging as logger import streamlit as st from typing import Any, Optional def clear_cache(keep_keys: Optional[list[str]] = None) -> None: """ Resets the Streamlit cache. Parameters ---------- keep_keys:Optional[list[str]] Keys to not be c...
sTomerG/extra-streamlit-tools
src/extra_streamlit_tools/utils.py
utils.py
py
2,324
python
en
code
0
github-code
36
29945890561
from enaml.core.enaml_compiler import EnamlCompiler from enaml.core.parser import parse def compile_source(source, item, filename="<test>", namespace=None): """Compile Enaml source code and return the target item. Parameters ---------- source : str The Enaml source code string to compile. ...
codelv/enaml-web
tests/utils.py
utils.py
py
855
python
en
code
99
github-code
36
36812069772
# Code by @AmirMotefaker # projecteuler.net # https://projecteuler.net/problem=25 # 1000-digit Fibonacci number # Problem 25 # The Fibonacci sequence is defined by the recurrence relation: # Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. # Hence the first 12 terms will be: # F1 = 1 # F2 = 1 # F3 = 2 # F4 = 3 # F5...
AmirMotefaker/ProjectEuler
Problem25.py
Problem25.py
py
1,293
python
en
code
1
github-code
36
8890345896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 20 15:50:56 2018 @author: vitorhadad """ # import numpy as np import networkx as nx import os from tqdm import trange from matching.solver.kidney_solver2 import optimal, greedy, get_two_cycles from matching.utils.data_utils import clock_seed, evalu...
halflearned/organ-matching-rl
matching/temp/temp.py
temp.py
py
3,852
python
en
code
2
github-code
36
21437705635
from computer import TogglePuter class BadSignal(Exception): def __init__(self, signal): self.message = str(signal) class InfiniteLoop(Exception): pass class SignalPuter(TogglePuter): def __init__(self): super().__init__() self.signal = [] def out(self, x): value =...
philipdouglas/adventofcode
2016/25.py
25.py
py
1,108
python
en
code
1
github-code
36
35779416431
import time import netsvc from osv import fields,osv class purchase_requisition(osv.osv): _inherit = "purchase.requisition" _description="Purchase Requisition" _columns = { 'state': fields.selection([('draft','Draft'),('lv_approve2','Waitting Manager Approve'),('in_progress','In Progress'...
aryaadiputra/addons60_ptgbu_2013
ad_purchase_requisition_double_validation/purchase_requisition.py
purchase_requisition.py
py
2,365
python
en
code
0
github-code
36
7535403822
from __future__ import print_function # # -*- coding: utf-8 -*-# # eso.org # Copyright 2011 ESO # Authors: # Lars Holm Nielsen <lnielsen@eso.org> # Dirk Neumayer <dirk.neumayer@gmail.com> # # # Mantis 12175: Fix release dates for images and videos # # # Find wrong release_dates: # 1) Check id with release_date - e....
esawebb/esawebb
scripts/correct_dates.py
correct_dates.py
py
4,493
python
en
code
0
github-code
36
28068719892
stones = [2, 4, 5, 3, 2, 1, 4, 2, 5, 1] k = 3 def check(stones, k, mid): count = 0 for i in stones: if i < mid: count += 1 else: count = 0 if count == k: # 뛰어 넘어야 하는 stone의 개수가 k개가 되면 건널 수 없다. return 0 return 1 def solution(stones, k): answe...
hwanginbeom/algorithm_study
2.algorithm_test/21.03.21/징검다리 건너기_sejin.py
징검다리 건너기_sejin.py
py
987
python
ko
code
3
github-code
36
35751230673
from util.data_util import read_energy_data # best fit algorithm, which consistently choose the least frequency if applicable. class bestReward(): def __init__(self, env, max_episode, ep_long): self.env = env self.last_deploy_core = 0 self.max_episode = max_episode self.ep_long = ...
Tahuubinh/Adaptive_processor_frequency_IoT_offloading
code/schedule/best_reward.py
best_reward.py
py
1,907
python
en
code
0
github-code
36
10535469198
import pygame import os from sys import exit WIDTH, HEIGHT = 1600, 900 pygame.init() WIN = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Buildings") WHITE = (255, 255, 255) FPS = 60 indx = 0 font = pygame.font.Font(None, 50) class Building(): def __init__(self, name, offset_x, offset_y): ...
Hemant-29/pygame-project
building.py
building.py
py
2,913
python
en
code
0
github-code
36
41198927211
import logging import json from lxml import etree def get_field_text(tree, path): nsmap = {"n1": tree.getroot().nsmap['n1']} node = tree.xpath(path, namespaces=nsmap) if len(node) > 0: return node[0].text return '' def parse_metadata(scene, xml_filename, json_filename): logger = logging.ge...
amy-langley/irma-import
xml_operations.py
xml_operations.py
py
1,267
python
en
code
0
github-code
36
16435010481
import unittest from selectors.NumbersFormRangeSelector import NumbersFormRangeSelector class TestNumbersFormRangeSelector(unittest.TestCase): def test_should_return_empty_sequence_when_empty_sequence_is_given(self): empty_sequence = [] selector = NumbersFormRangeSelector(1, 10) self.ass...
stardreamer/patterns
Behavioral/strategy/examples/selection/Python/Selector/tests/NumbersFormRangeSelectorTests.py
NumbersFormRangeSelectorTests.py
py
1,106
python
en
code
0
github-code
36
13015450298
import asyncio import websockets HOST = '0.0.0.0' WS_PORT = 3333 TCP_PORT = 8888 loop = asyncio.get_event_loop() websocket_connections = [] tcp_connections = [] async def send_status(status: str): data = status.encode() for c in tcp_connections: try: writer = c[1] writer.write(data) await writer.drai...
DeadMorose777/UE4_SpeechController
speech_controller-main/host2.py
host2.py
py
2,119
python
en
code
0
github-code
36
36779117268
# NOTE: mini function for testing your UDP connection w the computer running the server and MAX from pythonosc import udp_client PORT_TO_MAX = 5002 IP = "192.168.2.2" global client client = udp_client.SimpleUDPClient(IP, PORT_TO_MAX) input("hello") while True: print("sent") client.send_message("/point", 1) ...
mshen63/RoboticMusicianship_CV_Project
oldReferenceFiles/socketTrial.py
socketTrial.py
py
336
python
en
code
0
github-code
36
37486686803
import random def find_duplicate(xs): mini, maxi, acc = xs[0], xs[0], xs[0] for i in range(1, len(xs)): mini = min(mini, xs[i]) maxi = max(maxi, xs[i]) acc = acc ^ xs[i] mask = mini for i in range(mini + 1, maxi + 1): mask = mask ^ i return mask ^ acc xs = [5, 3, 4,...
tvl-fyi/depot
users/wpcarro/scratch/facebook/find-unique-int-among-duplicates.py
find-unique-int-among-duplicates.py
py
382
python
en
code
0
github-code
36
11032982168
""" Given a singly linked list, determine if it is a palindrome """ class Solution(object): def isPalindrome(self, head): fast = slow = head # Move slow to the middle of the list while fast and slow: fast = fast.next.next slow = slow.next # Reverse second half node = None while slow: nxt = sl...
tonydelanuez/python-ds-algos
probs/palindrome-linked-list.py
palindrome-linked-list.py
py
523
python
en
code
0
github-code
36
34898939242
import numpy as np import librosa from typing import List import matplotlib.pyplot as plt from scipy import signal from scipy.fft import rfft, rfftfreq import os TECHNIQUES = ['High', 'Tasto', 'Bend', 'Harm', 'Strum', 'Pont', 'Ord', 'Chord', 'Smack', 'Palm', 'TEST', 'SILENCE'] #TECHNIQUES = os.listdir("samples/manual...
trian-gles/ai-technique-classification
utilities/analysis.py
analysis.py
py
4,193
python
en
code
0
github-code
36
73175113705
import pandas as pd import numpy as np from warnings import simplefilter simplefilter(action="ignore", category=pd.errors.PerformanceWarning) aaLi = ['A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y'] aaChargeDi = {'A': 0, 'C': 0, 'D': -1, 'E': -1, 'F': 0, 'G': 0,...
comics-asiis/ToxicPeptidePrediction
program_resource/extractfeature.py
extractfeature.py
py
10,874
python
en
code
0
github-code
36
21334783707
from os.path import join, dirname from pandas import read_csv from pathlib import Path from climateeconomics.core.core_agriculture.crop import Crop from sostrades_core.execution_engine.execution_engine import ExecutionEngine from sostrades_core.tests.core.abstract_jacobian_unit_test import AbstractJacobianUnittest fro...
os-climate/witness-core
climateeconomics/tests/l1_test_gradient_crop_discipline.py
l1_test_gradient_crop_discipline.py
py
10,121
python
en
code
7
github-code
36
21787505234
import json from datetime import date,timedelta path = '/Users/evcu/GitHub/evcu.github.io//assets/nyc365blog/data.json' data = {} newel = {} newel[u'date'] = str(date.today()-timedelta(days=365)) newel[u'mood'] = str(input("Enter mood -1/0/1:\n")) print(newel) newel[u'high'] = str(input("Highlights\n")) newel[u'low'] ...
evcu/evcu.github.io
assets/nyc365blog/newDay.py
newDay.py
py
704
python
en
code
1
github-code
36
21570782786
class Solution: def deleteAndEarn(self, nums: List[int]) -> int: #storing preprocessed nums nums = sorted(nums) hashmap = defaultdict(int) maxnumber = 0 for i in nums: hashmap[i] += i maxnumber = max(i, maxnumber) @cache def m...
gourab337/leetcode
DP/deleteAndEarn.py
deleteAndEarn.py
py
562
python
en
code
0
github-code
36
23597687031
import sieve from typing import Dict, List import os from dotenv import load_dotenv load_dotenv() api_key = os.environ.get('SIEVE_API_KEY') sieve.SIEVE_API_KEY = os.getenv('SIEVE_API_KEY') sieve.SIEVE_API_URL = os.getenv('SIEVE_API_URL') @sieve.Model( name="deepface-emotion-detector", gpu = True, python_pack...
GauravMohan1/sieve_emotion_face_tracker
main.py
main.py
py
3,571
python
en
code
0
github-code
36
38568004929
''' 113 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is a node with no children. Example: Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ / \ 7 2 5 1 Return: [ [5,4,11,2], [5,8,...
archanakalburgi/Algorithms
binary_tree/pathsum2.py
pathsum2.py
py
2,490
python
en
code
1
github-code
36
16321882534
import logging from mmpose.apis.inference import inference_top_down_pose_model, init_pose_model, vis_pose_result from mmpose.datasets import DatasetInfo logger = logging.getLogger(__name__) def loadModel(configPath, ckptPath, device, half): model = init_pose_model(configPath, ckptPath, str(device).lower()) da...
ideguchi92/assignment
src/vitposeModule.py
vitposeModule.py
py
1,323
python
en
code
0
github-code
36
38715427758
light_matrix_string = "00000:00000:00000:00000:00000" # Convert light matrix to a multidimensional array def convert_light_string_to_array(array_str): outer_demension = array_str.split(':') multi_dimension_array = [] for inner in outer_demension: inner_list = [int(char) for char in inner] ...
igMike-V/kids-python-challenges
legoDimensions/lightMatrix.py
lightMatrix.py
py
1,159
python
en
code
0
github-code
36
35196657682
import os import dataclasses import unittest import torch import math import copy import numpy as np import lpips from dataset.co3d_dataset import Co3dDataset, FrameData from dataset.dataset_zoo import DATASET_ROOT from tools.utils import dataclass_to_cuda_ from evaluation.evaluate_new_view_synthesis import eval_batc...
eldar/snes
3rdparty/co3d/tests/test_evaluation.py
test_evaluation.py
py
10,050
python
en
code
59
github-code
36
11704013339
# -*- coding: utf-8 -*- """Translator module""" from __future__ import division from data import NUMBERS class Translator(object): """Translator class""" @classmethod def translate(cls, data): """The method for converting a input data to number instance """ if isinstance(data, str): ...
russtanevich/num_converter
translator.py
translator.py
py
2,596
python
en
code
0
github-code
36
1124194920
#!/usr/bin/python3 from models.rectangle import Rectangle class Square(Rectangle): """This represents a Square, inheriting from Rectangle.""" def __init__(personal, size, x=0, y=0, id=None): """This initializes a new Square. Args: size (int): The size of the Square. ...
Fran6ixneymar/alx-higher_level_programming
0x0C-python-almost_a_circle/models/square.py
square.py
py
2,094
python
en
code
0
github-code
36
74260920742
import numpy as np import torch import copy from pathlib import Path from torch_scatter import scatter from typing import Dict, Tuple from pcdet.datasets.v2x_sim.v2x_sim_dataset_ego import V2XSimDataset_EGO, get_pseudo_sweeps_of_1lidar, get_nuscenes_sensor_pose_in_global, apply_se3_ from pcdet.datasets.v2x_sim.v2x_sim...
quan-dao/practical-collab-perception
pcdet/datasets/v2x_sim/v2x_sim_dataset_ego_late.py
v2x_sim_dataset_ego_late.py
py
6,411
python
en
code
5
github-code
36
42037688043
""" Signal characteristics animation """ import os import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from matplotlib import gridspec matplotlib.use('TkAgg') class sigCharacterAnimation: ''' Animation for signal characteristics ''' # si...
PenroseWang/SimGPS
code/utils/signal_characteristic.py
signal_characteristic.py
py
6,216
python
en
code
11
github-code
36
3206852190
""" Provides the different Bounds that are used by the Table to determine the Cells that are adjacent to the Table. """ from __future__ import annotations from _operator import attrgetter from itertools import cycle from typing import Callable, cast, Iterable, NamedTuple, Protocol, TypeVar from pdf2gtfs.config impor...
heijul/pdf2gtfs
src/pdf2gtfs/datastructures/table/bounds.py
bounds.py
py
13,748
python
en
code
1
github-code
36
8639831743
SHAPE = "shapeBean" COLOR = "colorBean" SIZE_X = "sizeXBean" SIZE_Y = "sizeYBean" SIZE_Z = "sizeZBean" RADIUS = "radiusBean" POSITION_X = "positionXBean" POSITION_Y = "positionYBean" POSITION_Z = "positionZBean" ROTATION_X = "rotationXBean" ROTATION_Y = "rotationYBean" ROTATION_Z = "rotationZBean" GEOMETRY = "geometryF...
virtualsatellite/VirtualSatellite4-FreeCAD-mod
VirtualSatelliteCAD/plugins/VirtualSatelliteRestPlugin/virsat_constants.py
virsat_constants.py
py
525
python
en
code
9
github-code
36
43008955586
import os import sys from sqlobject.compat import load_module_from_file def load_module(module_name): mod = __import__(module_name) components = module_name.split('.') for comp in components[1:]: mod = getattr(mod, comp) return mod def load_module_from_name(filename, module_name): if mod...
sqlobject/sqlobject
sqlobject/util/moduleloader.py
moduleloader.py
py
1,175
python
en
code
140
github-code
36
20078827999
from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from api.serializers import BookSerializer from books.models import Book, PublicationLanguage, Author from django.test import Client client = Client() class TestBookList(APITestCase): def setUp(self) ->...
tomasz-rzesikowski/books_poc
api/tests/tests_views.py
tests_views.py
py
2,504
python
en
code
0
github-code
36
33133914412
# Google Question # Given an array = [2, 5, 1, 2, 3, 5, 1, 2, 4] # It should return 2 # Given an array = [2, 1, 1, 2, 3, 5, 1, 2, 4] # It should return 1 # Given an array = [2, 3, 4, 5] # It should return undefined # input: # array - always an array of integers # negative and positive # no size limit...
Iuri-Almeida/ZTM-Data-Structures-and-Algorithms
data-structures/hash-tables/first_recurring_character.py
first_recurring_character.py
py
1,238
python
en
code
0
github-code
36
73339180903
import asyncio import json from datetime import datetime import aiohttp from pydantic import BaseModel, Field, NonNegativeFloat from faststream import ContextRepo, FastStream, Logger from faststream.kafka import KafkaBroker broker = KafkaBroker("localhost:9092") app = FastStream(broker) class CryptoPrice(BaseMode...
airtai/faststream-gen
docs_src/tutorial/retrieve-publish-crypto/app/application.py
application.py
py
2,687
python
en
code
19
github-code
36
4705152598
import numpy as np import pandas as pd import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) logger = logging.getLogger(__name__) try: from sklearn.base import TransformerMixin, BaseEstimator except ImportError: msg = "scikit-learn not installed" logger.warning(msg) try: from ...
skerryvore/pyrolite
pyrolite/util/skl/impute.py
impute.py
py
6,714
python
en
code
null
github-code
36
32413884802
import pytest import torch from renate.benchmark.models.transformer import HuggingFaceSequenceClassificationTransformer @pytest.mark.parametrize("model_name", ["distilbert-base-uncased", "bert-base-uncased"]) def test_init(model_name): HuggingFaceSequenceClassificationTransformer( pretrained_model_name_o...
awslabs/Renate
test/renate/benchmark/models/test_text_transformer.py
test_text_transformer.py
py
844
python
en
code
251
github-code
36
71656889065
import torch import torchaudio from torchaudio.transforms import MelSpectrogram, Spectrogram def load_wav_to_torch(full_path, hop_size=0, slice_train=False): wav, sampling_rate = torchaudio.load(full_path, normalize=True) if not slice_train: p = (wav.shape[-1] // hop_size + 1) * hop_size - wav.shape[...
jisang93/VISinger
utils/audio/mel_processing.py
mel_processing.py
py
2,724
python
en
code
13
github-code
36
14521287997
#imports the os package and inotify import os from inotify_simple import INotify, flags #pulls in the package inotify = INotify() #runs the below command so this script will keep running once it's finished os.system("while :; do python3 File-Changes.py; done") #creates the watch flags watch_flags = flags.CREATE | flags...
Splixxy/Cron-Job
File-Changes.py
File-Changes.py
py
907
python
en
code
0
github-code
36