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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
39082569651 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import numpy as np
from sklearn.linear_model import LinearRegression
import pandas as pd
import plotly.gra... | estellekayser/cars | index.py | index.py | py | 7,502 | python | fr | code | 0 | github-code | 36 |
23600896108 | import sqlite3
import qrcode
import wx
import wx.aui
import wx.lib.agw.aui as aui
import wx.adv
from datetime import datetime
from dateutil.relativedelta import relativedelta
import bcrypt
import cv2
import phonenumbers
from phonenumbers import carrier
from phonenumbers.phonenumberutil import number_type
i... | najiar/Python-Fitness-App | Fitness_Project.py | Fitness_Project.py | py | 79,776 | python | en | code | 0 | github-code | 36 |
35683474953 | # Напишите программу, которая принимает на вход число N и выдает список факториалов для чисел от 1 до N.
# N = 4 -> [ 1, 2, 6, 24 ] (1, 1*2, 1*2*3, 1*2*3*4)
from math import factorial
number = int(input("Input number: "))
i = 1
list = []
while i <= number:
list.append(factorial(i))
i += 1
print(list)
| DmitriiZhuk/Py_Home_Task02 | Task 01.py | Task 01.py | py | 395 | python | ru | code | 0 | github-code | 36 |
39253306796 | fname = input('What is the player\'s first name?').lower()
lname = input('What is the player\'s last name?').lower()
year = input('What year are you trying to gather stats for? (Leave blank if current year stats are desired.').lower()
fname = fname[0:2]
lname = lname[0:5]
num = '01'
player_id = lname + fname + num
br... | pathwaydev/Fantasy-Sports-Scripts | Baseball/gen_br_src.py | gen_br_src.py | py | 483 | python | en | code | 0 | github-code | 36 |
6114010346 | import re
# program which validates a postal code
# a valid post code is between 10000 and 99999
# and does not have more than 1 alternative repeating digit
def check_zip_code_function(input_string):
non_recurring_count = 0
for counter in range(len(input_string) - 2):
if input_string[counter] == input... | mcgarry72/mike_portfolio | test_post_code.py | test_post_code.py | py | 1,405 | python | en | code | 0 | github-code | 36 |
10476978002 | # main_before.py
# 강화학습 전에 실행하는 모듈
# 주식 데이터를 읽고, 차트 데이터와 학습 데이터를 준비하고, 주식투자 강화학습을 실행하는 모듈
import os
import logging
import settings
import datetime
from data import data_management, save_csv
from learner import Learner
def main_before_run(before_start_date, before_end_date, before_min_unit,
before_... | 100th/AjouStock | main_before.py | main_before.py | py | 3,938 | python | ko | code | 23 | github-code | 36 |
42294319427 | """
TASK:
Написать функцию is_year_leap, принимающую 1 аргумент — номер года, и возвращающую True,
если год високосный, и False иначе.
Описание условий посмотрите здесь, раздел: Григорианский календарь.
"""
year_user = int(input('Введите год: '))
def is_year_leap(year):
if year % 4 == 0 or year % 400 == 0 or yea... | SergeyKomanich/homework_23 | is_year_leap.py | is_year_leap.py | py | 630 | python | ru | code | 0 | github-code | 36 |
7939032782 | def answer(pegs):
n = len(pegs)
if n <= 1: return [-1, -1]
# q = (p1-p0) - (p2-p1) + (p3-p2) ...
pegDistance = [(pegs[i] - pegs[i-1]) for i in range(1, n)]
q = sum((-1)**(i) * pegDistance[i] for i in range(n-1))
# specific case of gaussian elimination
r = [sum((-1)**(j-i) * pegDistance[j] for j in ... | deepspacepirate/googlefoobar | L3-gearing_up_for_destruction.py | L3-gearing_up_for_destruction.py | py | 793 | python | en | code | 0 | github-code | 36 |
40885660668 | import json
import logging
import os.path
from importlib import import_module
from nlp_architect.utils.io import gzip_str
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
def format_response(resp_format, parsed_doc):
"""
Transform string of server's response to the requested format
A... | IntelLabs/nlp-architect | server/service.py | service.py | py | 5,596 | python | en | code | 2,921 | github-code | 36 |
4062896268 | def main():
n = int(input("Enter a positive integer: "))
for r in range(0, n + 1):
print(C(n, r), end=" ")
def C(n, r):
if (n == 0) or (r == 0) or (n == r):
return 1
else:
return C(n - 1, r - 1) + C(n - 1, r)
main()
| guoweifeng216/python | python_design/pythonprogram_design/Ch6/6-4-E09.py | 6-4-E09.py | py | 286 | python | en | code | 0 | github-code | 36 |
7796083488 | # -*- coding: utf-8 -*-
# author: sunmengxin
# time: 18-11-27
# file: 二叉树的下一个节点
# description:
# 反思:
# 1. 开始没有理解题意,不懂给定了一个节点pNode怎么找到它的下一个节点
# 后来懂得了要找的是这个节点的中序遍历后的第一个节点
# 这个节点可能存在的位置是后继节点或者父节点
# class TreeLinkNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = ... | 20130353/Leetcode | target_offer/二叉树/二叉树的下一个节点.py | 二叉树的下一个节点.py | py | 1,070 | python | zh | code | 2 | github-code | 36 |
70721629544 | from datetime import datetime
import os
class Config:
FOOTBALL_DATA_URL = "https://www.football-data.co.uk"
FOOTBALL_DATA_TABLE = "mmz4281"
# Azure access
AZURE_CONNECTION_STRING = os.environ["AZURE_CONNECTION_STRING"]
AZURE_CONTAINER_NAME = os.environ["AZURE_CONTAINER_NAME"]
AZURE_RESULTS_TAB... | dimasikson/football-prediction-web-app | src/utils/config.py | config.py | py | 2,578 | python | en | code | 2 | github-code | 36 |
70677607784 | import jwt
class User:
id = None
email = None
groups = []
company = None
class RequestJwtMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def get_token_payload(self, request):
payload = {}
authorization = request.META.get("HTTP_AUTHORIZ... | damienLopa/ms_drf_utils | ms_drf_utils/middlewares.py | middlewares.py | py | 986 | python | en | code | 0 | github-code | 36 |
31572727177 | import request
def _get_data(year, month, day, hour, output_path, **_):
url = (
"https://dumps.wikimedia.org/other/pageviews/"
f"{year}/{year}-{month:0>2}/"
f"pageviews-{year}{month:0>2}{day:0>2}-{hour:0>2}0000.gz"
)
request.urlretrieve(url, output_path)
get_data = PythonOperator(
... | Weixin97/data-pipeline-with-airflow | Chap4/dags/listing4.13.py | listing4.13.py | py | 697 | python | en | code | 0 | github-code | 36 |
39112390989 | import re
from django.http.response import HttpResponseServerError
from django.shortcuts import render, HttpResponse, redirect
from miapp.models import Article
from django.db.models import Q
from miapp.forms import FormArticle
from django.contrib import messages
# Create your views here.
#MVC = MOdelo Vista Controla... | reneafranco/web-aplications | AprendiendoDjango/miapp/views.py | views.py | py | 4,619 | python | es | code | 0 | github-code | 36 |
22811835651 | from apscheduler.schedulers.background import BlockingScheduler
from model import Model
from tools.zlogging import loggers, post_trade_doc
from datetime import datetime
from threading import Thread
import time
class Instrument(Thread):
n_times_per_second = 10
N_BACKLOG_PERIODS = 3
def __init__(self... | zQuantz/Logma | ibapi/instrument.py | instrument.py | py | 3,436 | python | en | code | 0 | github-code | 36 |
26030345486 | import os
import sys
#モジュール探索パス追加
p = ['../','../../','../../../']
for e in p: sys.path.append(os.path.join(os.path.dirname(__file__),e))
import discord
import re
import requests
import database
class UserFunc():
def __init__(self) -> None:
pass
#入力されたフレンドコード(SW)の確認
def check_friendcode(self... | rich-bread/bmdb_bot | menu/usermenu/cmfunc/userfunc.py | userfunc.py | py | 1,852 | python | en | code | 0 | github-code | 36 |
75095087464 | # -*- coding: utf-8 -*-
"""
Python 3.5 Program to create music Database
Creato da Fabrizio Fubelli
"""
import os
import codecs
import Modality
import MusicSort
from datetime import datetime
from tinytag import TinyTag
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
... | FabrizioFubelli/py-music-sorting | modalities/Database.py | Database.py | py | 7,276 | python | en | code | 0 | github-code | 36 |
7346608770 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Mirantis/mos-horizon | openstack_dashboard/dashboards/admin/volumes/snapshots/forms.py | forms.py | py | 2,461 | python | en | code | 7 | github-code | 36 |
14310771223 | """
Nazwa: nms.py
Opis: Końcowe przetwarzanie wyjść z modelu. Filtracja po pewności,
transformacja koordynatów ramek, NMS.
Autor: Bartłomiej Moroz
"""
import torch
import torchvision
def transform_bbox(bboxes: torch.Tensor) -> torch.Tensor:
"""
Transform bounding boxes from (x, y, w, h) into (x1, y1, x... | The0Jan/GSN_YOLO | src/processing/nms.py | nms.py | py | 4,524 | python | en | code | 0 | github-code | 36 |
24492582780 | #create a class node
# node consists of two things - data and next pointer
class Node:
def __init__(self,data):
self.data = data
self.next = None
#create a class for LINKED LIST
#which contains Head pointer
class LinkedList:
def __init__(self):
self.head = None
#create an fu... | tanucdi/dailycodingproblem | DataStructures/LinkedList/03_HeadNodeInsertion.py | 03_HeadNodeInsertion.py | py | 1,776 | python | en | code | 1 | github-code | 36 |
69842961063 |
from django.conf import settings
from . import models
from .clients.bezant import Client as BezantClient
def _issue_point_to_user(user, behaviour_code, amount=0, reason=None):
try:
behaviour = models.Behaviour.objects.get(code=behaviour_code)
except models.Behaviour.DoesNotExist:
return
... | friendlywhales/lineup-web | backend/currencies/tasks.py | tasks.py | py | 3,415 | python | en | code | 0 | github-code | 36 |
27337201293 | from flask import Flask, render_template, redirect, request, session, url_for, send_file
import sqlite3
from datetime import datetime, timedelta, date
from werkzeug.security import check_password_hash, generate_password_hash
from io import BytesIO
import openpyxl as xl
from openpyxl.styles import Font
from os import pa... | weien0905/drcr | app.py | app.py | py | 34,057 | python | en | code | 0 | github-code | 36 |
31560861750 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/4/7 下午6:18
# @Email : lixiaoyu@bytedance.com
from __future__ import absolute_import, unicode_literals
"""
最长递增子序列LIS
"""
def lis(nums):
f = [1 for _ in xrange(len(nums))]
m = 1
for i in xrange(1, len(nums)):
for j in xrange(0, i):
... | lee3164/newcoder | base/LIS.py | LIS.py | py | 452 | python | en | code | 1 | github-code | 36 |
38507493376 | #Following code to authenticate with twitters API is from @llSourcell on github.
import tweepy
from textblob import TextBlob
#Use tweepy to authenticate with twitters API. Following keys have been removed
#because they are unique to my twitter profile. You can get yours at twitter.com
consumer_key = ''
consumer... | DevonWright/twitter_sentiment_analysis | twitter_sentiment_analysis.py | twitter_sentiment_analysis.py | py | 1,962 | python | en | code | 0 | github-code | 36 |
43013396871 |
"""
Purpose:
Date created: 2020-04-19
Contributor(s):
Mark M.
"""
from __future__ import print_function
from pyspark import SparkContext
# from pyspark.sql import SparkSession
# spark = SparkSession.builder.appName("test1").getOrCreate()
sc = SparkContext(appName="matrices1")
rdd = sc.parallelize([1, 2,])
s... | MarkMoretto/project-euler | spark/spark_basics_1.py | spark_basics_1.py | py | 473 | python | en | code | 1 | github-code | 36 |
70096896743 | # -*- coding: utf-8 -*-
"""Example script to show how to use mcetl.launch_main_gui with defined DataSource objects.
@author: Donald Erb
Created on Aug 22, 2020
"""
import itertools
import mcetl
import numpy as np
import pandas as pd
from scipy import optimize
def offset_data(df, target_indices, calc_indices, exc... | derb12/mcetl | examples/use_main_gui.py | use_main_gui.py | py | 29,127 | python | en | code | 0 | github-code | 36 |
1726687760 |
while 1:
n=int(input("Enter a number:"))
sum=0
i=1
while i<=n:
if n%i==0:
sum=sum+i
i+=1
if sum==1:
print(n,"is a Prime Number!!")
elif sum==n+1:
print(n,"is a Prime Number!!")
else:
print(n,"is not a Prime Number.")
| robinNcode/Python-Code | PrimeNum.py | PrimeNum.py | py | 256 | python | en | code | 1 | github-code | 36 |
17793968831 | n = int(input())
ans = float('inf')
for i in range(1, n+1):
w = n // i
for j in range(1, w+1):
diff1 = abs(j - i)
diff2 = n - j * i
ans = min(ans, diff1 + diff2)
print(ans)
| fastso/learning-python | atcoder/contest/solved/abc040_b.py | abc040_b.py | py | 206 | python | en | code | 0 | github-code | 36 |
34752433679 | #! python3.11
"""
--- Day 4: Camp Cleanup ---
Space needs to be cleared before the last supplies can be unloaded from the ships, and so several Elves have been assigned the job of cleaning up sections of the camp. Every section has a unique ID number, and each Elf is assigned a range of section IDs.
However, as s... | techartorg/Advent_of_Code_2022 | mitri_van/day_04.py | day_04.py | py | 4,817 | python | en | code | 4 | github-code | 36 |
7332846725 |
sqft = 0
with open("./input2.txt") as f:
for line in f:
split = line.split("x")
x = int(split[0])
y = int(split[1])
z = int(split[2])
xy = x*y
xz = x*z
yz = y*z
shortest = min(xy, xz, yz)
sqft += 2*x*y + 2*x*z + 2*y*z + shortest
print("total square feet: " + str(sqft))
| leecccc/advent-of-code | day2.py | day2.py | py | 308 | python | en | code | 0 | github-code | 36 |
27100233719 | import os
import json
import argparse
from pathlib import Path
import boto3
import sagemaker
from sagemaker.sklearn.estimator import SKLearn
# CloudFormationから環境変数を読み出し
## CFのStack設定
SERVICE_NAME = "sagemaker-serverless-example"
ENV = os.environ.get("ENV", "dev")
STACK_NAME = f"{SERVICE_NAME}-{ENV}"
## Outputsを{Key:... | ikedaosushi/serverless-sagemaker-example | iris/script/train.py | train.py | py | 1,797 | python | en | code | 2 | github-code | 36 |
28078896069 | # coding: utf-8
# Your code here!
n = int(input().rstrip())
class Node:
__slots__ = ['key', 'left', 'right']
def __init__(self,key):
self.key = int(key)
self.left = self.right = None
root = None
def insert(z):
global root
x, y = root, -1
while x != None:
y = ... | negiandleek/til | aoj/ALDS1_8_A_Binary_Search_Tree_I.py | ALDS1_8_A_Binary_Search_Tree_I.py | py | 954 | python | en | code | 0 | github-code | 36 |
21076570449 | #!/usr/bin/env python
# coding=utf-8
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from datetime import datetime,date
import time
import tushare as ts
from matplotlib.dates import DateFormatter, WeekdayLocator, DayLocator, MONDAY, YEARLY, date2num
from matplotlib.finance import quotes_historical_yahoo... | jcjview/stock | src/tushare_candle.py | tushare_candle.py | py | 2,646 | python | en | code | 0 | github-code | 36 |
15131390848 | total_sp = 20
skills = [[1, 2], [1, 3], [3, 4], [3, 5], [3, 6], [4, 7], [4, 8], [4, 9]]
ans = [44,11,33,11,11,11]
def solution(skills, total_sp):
nodes = set()
for skill in skills:
nodes.add(skill[0])
nodes.add(skill[1])
nodes = list(nodes)
print(nodes)
dict_tree = {}
... | EnteLee/practice_algorithm | leetcode/quiz_3/quiz_3_LJS.py | quiz_3_LJS.py | py | 1,637 | python | en | code | 0 | github-code | 36 |
10828794870 | # 효율성 실패
from collections import deque
def bfs(node,visit,dist,n):
q = deque()
visit[node] = 1
dist[node] = 0
q.append(node)
while q:
x = q.popleft()
if x == n:
return dist[n]
if x < n+1:
if x*2 < n+1:
if dist[x*2] == -1 ... | choijaehoon1/programmers_level | src/test122_01.py | test122_01.py | py | 843 | python | en | code | 0 | github-code | 36 |
33909516733 | # 1. Read input data
country = input()
instrument = input()
# 2. Grades
if country == "Russia":
if instrument == "ribbon":
grade_difficult = 9.100
grade_performance = 9.400
elif instrument == "hoop":
grade_difficult = 9.300
grade_performance = 9.800
elif instrument == "rope":... | IvayloSavov/Programming-basics | exams/9_10_march/gymnastics.py | gymnastics.py | py | 1,247 | python | en | code | 0 | github-code | 36 |
12298632553 | import re
from setuptools import setup, find_packages
from marcus import __version__
# Installation a packages from "requirements.txt"
requirements = open('requirements.txt')
install_requires = []
dependency_links = []
try:
for line in requirements.readlines():
line = line.strip()
if line and not l... | Carbon8Jim/marcus | setup.py | setup.py | py | 1,715 | python | en | code | null | github-code | 36 |
13019740753 | """
Deterministic nowcasting neural network base class.
Inherits from NowcastingModel.
Bent Harnist (FMI) 2022
"""
import torch
from models.nowcasting_model import NowcastingModel
class DeterministicModel(NowcastingModel):
"""
Deterministic nowcasting neural network base class.
Inherits from NowcastingMod... | fmidev/deuce-nowcasting | models/deterministic/deterministic_model.py | deterministic_model.py | py | 2,313 | python | en | code | 2 | github-code | 36 |
25796479489 | from django.core.management import BaseCommand
from integrations.left_right_eye_nn.LeftRightEyeNN import LeftRightEyeNN
class Command(BaseCommand):
def handle(self, *args, **options):
self.main()
def main(self):
print("Training Left Right Eye NN")
nn = LeftRightEyeNN()
nn.ge... | AkaG/inz_retina | integrations/management/commands/left_right_eye.py | left_right_eye.py | py | 352 | python | en | code | 0 | github-code | 36 |
6446628913 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 5 22:38:07 2020
@author: Ivano Dibenedetto mat.654648
"""
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk
import cv2
import tensorflow as tf
root = Tk(className=' CLASSIFICATORE')
root.geometry(... | Ivanodib/Neural-Network | GUI.py | GUI.py | py | 2,060 | python | en | code | 0 | github-code | 36 |
38736716412 | '''
Created on 9 Feb 2017
@author: tanumoy chakraborty
'''
DASHBOARD_NAME="KF Dashboard"
SIDEBAR_DROPDOWN_AUTOMATION_REPORT="Automation Report"
SIDEBAR_DROPDOWN_ENVIRONMENT_STATUS="View Environment Status"
HOME_PAGE_LATEST_BUILDS_BLOCK="Latest Completed Builds"
BUILDS_ARCHIVE_PAGE_APP_INFO="Archived Builds for"
RUNNI... | tanumoychakraborty/Reporting | dashboard/static/dashboard/messages/home.py | home.py | py | 1,429 | python | en | code | 0 | github-code | 36 |
36567852803 | from django.shortcuts import render
from django.contrib.auth import login, logout
from django.http.response import HttpResponseRedirect, JsonResponse
from .forms import RegistrationForm, LoginForm
from django.contrib.auth.models import User
from django_mfa.models import is_u2f_enabled
from django.conf import settings
... | MicroPyramid/django-mfa | sandbox/sample/views.py | views.py | py | 1,801 | python | en | code | 176 | github-code | 36 |
31045995588 |
def setData(field, value, path):
f = open(path, "r")
lines = f.readlines()
f.close()
f = open(path, "w+")
for line in lines:
if (line.find(field) != -1):
f.write(field + "=" + str(value) + "\n")
else:
f.write(line)
f.close()
return True
def getDat... | RyanKastl/Budgetizer | FlaskServer/budgetUtils/database.py | database.py | py | 1,019 | python | en | code | 0 | github-code | 36 |
35132702835 | import dataclasses
import tensorflow as tf
import gin.tf
from layers.embeddings_layers import EmbeddingsConfig
from models.transformer_softmax_model import TransformerSoftmaxModel, TransformerSoftmaxModelConfig
from datasets.softmax_datasets import MaskedEntityOfEdgeDataset
from datasets.dataset_utils import DatasetTy... | Dawidsoni/relation-embeddings | test/models/test_transformer_softmax_model.py | test_transformer_softmax_model.py | py | 3,150 | python | en | code | 0 | github-code | 36 |
8445855838 | import argparse
import os
import sys
from typing import Any, List, Mapping, Optional, Tuple
import cupy_builder
def _get_env_bool(name: str, default: bool, env: Mapping[str, str]) -> bool:
return env[name] != '0' if name in env else default
def _get_env_path(name: str, env: Mapping[str, str]) -> List[str]:
... | cupy/cupy | install/cupy_builder/_context.py | _context.py | py | 3,616 | python | en | code | 7,341 | github-code | 36 |
10358623287 | import asyncio
import io
import pickle
import discord
from pgbot import common
# Store "name: pickled data" pairs as cache. Do not store unpickled data
db_obj_cache: dict[str, bytes] = {}
# Optimisation: store per-db bool on whether it got updated or not
db_changed: dict[str, bool] = {}
# store per-resource lock
d... | gresm/PygameCommunityBot | pgbot/db.py | db.py | py | 3,779 | python | en | code | null | github-code | 36 |
21153851524 | class Node():
def __init__(self,value=None,next=None):
self.value = value
self.next = next
def __str__(self) -> str:
string = str(self.value)
if self.next:
string += ',' + str(self.next)
return string
class Stack():
def __init__(self) -> None:
self.top = None
self.minNode = N... | IsaacJM03/DataStructuresAndAlgorithms | StackAndQueueQns/Q2_minNode.py | Q2_minNode.py | py | 1,925 | python | en | code | 0 | github-code | 36 |
22781218068 | import pandas as pd
from extensions import extensions
from initial_values.initial_values import be_data_columns_to_master_columns, year_dict
from datetime import datetime
from dateutil.relativedelta import relativedelta
from initial_values.initial_values import sap_user_status_cons_status_list, be_data_cons_status_list... | Zhenya1975/bdo_v41 | functions/read_be_eo_xlsx_file_v5.py | read_be_eo_xlsx_file_v5.py | py | 24,681 | python | en | code | 0 | github-code | 36 |
7167965957 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
requires = [
'gces>=0.0.9a0',
]
extras_require = {
'test': [
'coverage==4.5.1',
'pytest==3.8.1',
'pytest-cov=... | debonzi/gces-subscriber-framework | setup.py | setup.py | py | 1,464 | python | en | code | 0 | github-code | 36 |
70868158825 | DIR_PATH = r"LibDir"
comandMain = ["Open libraris", "Stop program"]
comandLibrZero = ['Create new file', "Exit to main"]
comandLibr = ['Create new file', "Choise file", "Exit to main"]
comandFile = ["Update file", 'Delete file', "Save in CSV", 'Search contact', "Exit to library"]
comandContZero = ["Add contact", 'Exit... | AlfaReggie/fightClub | src/const.py | const.py | py | 737 | python | en | code | 0 | github-code | 36 |
18526461373 | from keras.models import Model
from keras.layers.recurrent import LSTM
from keras.layers import Dense, Input, Embedding
from keras.preprocessing.sequence import pad_sequences
from keras.callbacks import ModelCheckpoint
from collections import Counter
import nltk
import numpy as np
from sklearn.model_selection import tr... | sbarham/dsrt | Trial/fred_testing.py | fred_testing.py | py | 5,473 | python | en | code | 1 | github-code | 36 |
27688509753 | import csv
import os
import numpy as np
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
def get_data(filename):
# You will need to write code that will read the file passed
# into this function. The first line contains the column headers
# so you should ignore i... | seanjudelyons/TensorFlow_Certificate | Sign Language Part 2(CNN) Last exercise.py | Sign Language Part 2(CNN) Last exercise.py | py | 4,470 | python | en | code | 12 | github-code | 36 |
30212881066 | import os.path
import webshop
from setup_script import run_setup
def test_admin_creating_products():
user = webshop.class_administrator.Administrator('admin', 'admin')
user.add_verdampfer('SuperVape24', 8.99, 'VaperG', 2.8, 2.74, 'top fill')
user.add_verdampfer('Nebelmaschine V3', 9.99, 'B-Vape', 2.8, 2.... | jmk74871/Laborbericht-PRG24 | main.py | main.py | py | 2,156 | python | en | code | 0 | github-code | 36 |
13988100498 | class Solution:
def productExceptSelf(self, nums: List[int]) -> List[int]:
n = len(nums)
ans = [1] * n
ans[n - 1] = nums[n - 1]
for i in reversed(range(n - 1)):
ans[i] *= nums[i] * ans[i + 1]
pre = 1
for i, x in enumerate(nums):
prod = pre
... | dariomx/topcoder-srm | leetcode/mock/fb-online-2/product-of-array-except-self/product-of-array-except-self-spc.py | product-of-array-except-self-spc.py | py | 443 | python | en | code | 0 | github-code | 36 |
36714543817 | from dash import html, dcc
from dash.development.base_component import Component
from datafiles.views.view import View, DfView
from dataviz.irenderer import IDataStudyRenderer
import plotly.express as px
from dataviz.src.components.iplot import IPlot
class BubbleChart(IPlot):
_name = "bubble-chart"
@classme... | adangreputationsquad/theriver | dataviz/src/components/bubble_charts.py | bubble_charts.py | py | 3,249 | python | en | code | 0 | github-code | 36 |
4224032488 | import tensorflow as tf
from utils import *
from nn import *
from model import *
from data import *
from load_data import *
#from runeval import *
import numpy as np
from multiprocessing import Pool
from contextlib import closing
MAX_EPOCHS = 80.0
def optimizer(num_batches_per_epoch):
with tf.variable_scope("Opt... | KaranKash/DigitSpeak | crosslang/runtrain.py | runtrain.py | py | 10,117 | python | en | code | 2 | github-code | 36 |
13927812222 |
from git import Repo
repo = Repo.init('/Users/yitongli/pytorch')
# print([str(commit.summary) for commit in repo.iter_commits()][1])
# print([str(commit.count) for commit in repo.iter_commits()][0])
# print([str(commit.size) for commit in repo.iter_commits()][0])
# print([str(commit.hexsha) for commit in repo.iter_co... | Spring010/kano_auto_commit_message | repo.py | repo.py | py | 1,374 | python | en | code | 0 | github-code | 36 |
40156974543 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
# Copyright (c) 2017/18 Dennis Wulfert
#
# GNU GENERAL PUBLIC LICENSE
# Version 2, June 1991
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | Stakdek/EM | em.py | em.py | py | 3,939 | python | en | code | 1 | github-code | 36 |
41842464083 | import serial
import os
bluetooth = serial.Serial(0,9600)
#ser.isOpen()
while True:
recieve = bluetooth.readline()
recieve = recieve[0:-2]
result = os.popen(recieve).read()
bluetooth.write(result)
bluetooth.write('---------------------------------------------------------\n')
| fsaaa168/Radxa | service/bluetooth.py | bluetooth.py | py | 281 | python | en | code | 0 | github-code | 36 |
26141458473 | #!/usr/bin/env python2.7
from common import *
from input import *
##region input validate
#no param for `db name` exists => set ad deploy id or default name
if not DB_NAME:
from deploy_flask.steps.input_0th import DEPLOY_ID
DB_NAME = DEPLOY_ID if DEPLOY_ID \
else DB_NAME_DEFAULT
#regi... | namgivu/deploy-util | deploy_mysql/config/initial.py | initial.py | py | 2,580 | python | en | code | 0 | github-code | 36 |
74366652584 | # BOJ 2935 - 소음
import sys
r = sys.stdin.readline
A = r().strip()
operator = r().strip()
B = r().strip()
zeros = '1'
if operator == '*':
zeros += '0' * ((len(A)-1)+(len(B)-1))
else:
max_len = max(len(A), len(B))-1
min_len = min(len(A), len(B))-1
if max_len != min_len:
zeros += '0' * (max_len-mi... | dojinkimm/AlgorithmPractice | baekjoon/2935_sound.py | 2935_sound.py | py | 405 | python | en | code | 2 | github-code | 36 |
28520677387 | # 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
from variable_functions import my_attribute_label
from urbansim.functions import attribute_label
... | psrc/urbansim | urbansim/gridcell/gc_ln_access_to_workplace_from_residences.py | gc_ln_access_to_workplace_from_residences.py | py | 1,870 | python | en | code | 4 | github-code | 36 |
1292570084 | import tensorflow as tf
from pathlib import Path
import numpy as np
import dataset
import tensorflow_probability as tfp
tfd = tfp.distributions
class Encoder:
def __init__(self, latent_size):
super(Encoder, self).__init__()
# static parameters
self.latent_size = latent_size
self... | alicebizeul/progressiveAE | Vnetworks.py | Vnetworks.py | py | 6,915 | python | en | code | 0 | github-code | 36 |
27515698765 | from discord.ext import commands
import discord
import random
class HelpCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['хелп'])
async def help(self, ctx):
prefix = '!'
emb = discord.Embed(title='Команды сервера: ', description=f'`{prefix}help`... | RuCybernetic/CyberTyanBot | cogs/commands/Help.py | Help.py | py | 1,104 | python | en | code | 1 | github-code | 36 |
40518914045 | import sys
sys.path.append("..")
from common import *
def parse(d):
d = d.split(" ")
cords = dict()
for c in d[1].split(","):
c = c.split("=")
cords[c[0]] = tuple(map(int,c[1].split("..")))
return (d[0],cords)
data = fnl(parse)
opp = {
"on":"off",
"off":"on"
}
cubemap = defaultdict(i... | archanpatkar/advent2021 | Day-22/part1.py | part1.py | py | 802 | python | en | code | 0 | github-code | 36 |
11002983130 | #! /usr/bin/env python3.
from os import path
from pydub import AudioSegment
from custom_filesystem import CustomFilesystem, WAV_EXTENSION
import speech_accent_archive_analysis
# Create a wav duplicate (in the same directory) for an mp3 recording.
def create_wav_duplicate(mp3_recording_path):
path_without_extension... | albertojrigail/accented-speech-recognition | mp3-to-wav.py | mp3-to-wav.py | py | 1,112 | python | en | code | 0 | github-code | 36 |
35941249520 | import os
import sys
import inference
import storage
import boto3
# Flask
from flask import Flask, redirect, url_for, request, render_template, Response, jsonify, redirect
from werkzeug.utils import secure_filename
from gevent.pywsgi import WSGIServer
# Some utilites
import numpy as np
from util import base64_to_p... | pingyuanw/293B | app.py | app.py | py | 1,691 | python | en | code | 1 | github-code | 36 |
22169703217 | from flask import make_response
from google.cloud import bigquery
# my modules
import config
from my_logging import getLogger
log = getLogger(__name__)
config = config.Config()
with open('auth.txt', 'r') as f:
cf_token = f.readline().rstrip('\r\n')
# entry point of Cloud Functions
# trigger = http
def atm_iv_d... | terukusu/optionchan-gcp | functions_py/atm_iv/main.py | main.py | py | 3,306 | python | en | code | 0 | github-code | 36 |
32021204046 | import tensorflow as tf
from tensorflow.contrib.layers.python.layers import fully_connected
import numpy as np
def add_fc(inputs, outdim, train_phase, scope_in):
fc = fully_connected(inputs, outdim, activation_fn=None, scope=scope_in + '/fc')
fc_bnorm = tf.layers.batch_normalization(fc, momentum=0.1, epsilo... | kjanjua26/Single_Net_Image_Retrieval | Supervised_Model/network.py | network.py | py | 4,175 | python | en | code | 0 | github-code | 36 |
4509215591 | from __future__ import absolute_import, division, print_function
import torch
import torch.nn as nn
from torch.autograd import Variable
import os, sys, errno
import argparse
import time
import numpy as np
import cv2
import matplotlib.pyplot as plt
from tqdm import tqdm
from utils import post_process_depth, flip_lr
f... | surajiitd/jetson-documentation | model_compression/pixelformer/test.py | test.py | py | 13,368 | python | en | code | 0 | github-code | 36 |
25716938871 | import urllib
class ActionBatchNetworks(object):
def __init__(self):
super(ActionBatchNetworks, self).__init__()
def updateNetwork(self, networkId: str, **kwargs):
"""
**Update a network**
https://developer.cisco.com/meraki/api-v1/#!update-network
- networkI... | meraki/dashboard-api-python | meraki/api/batch/networks.py | networks.py | py | 37,488 | python | en | code | 269 | github-code | 36 |
75127901544 | from cravat.cravat_report import CravatReport
import sys
import datetime
import re
import pandas as pd
import cravat
import json
import pyreadr
import os
class Reporter(CravatReport):
def setup (self):
self.filenames = []
self.filename = None
self.filename_prefix = None
if self.sav... | KarchinLab/open-cravat-modules-karchinlab | reporters/genesis_variant_groupingsreporter/genesis_variant_groupingsreporter.py | genesis_variant_groupingsreporter.py | py | 55,376 | python | en | code | 1 | github-code | 36 |
35157843574 | """
https://dmoj.ca/problem/ccc03s3
"""
import sys; input = sys.stdin.readline
wood = int(input())
floor = []
row = int(input())
col = int(input())
for _ in range(row):
floor.append(list(input()[:-1]))
def fix(a, b):
counter, add = 0, 0
while len(floor[a])-b != add and floor[a][b+add] == ".... | Supermac30/DMOJ-Solutions | Graph Theory/CCC'03 S3 - Floor Plan.py | CCC'03 S3 - Floor Plan.py | py | 1,295 | python | en | code | 1 | github-code | 36 |
15558040897 | #!/usr/bin/env python3.2
import os
import sys
import time
import math
# Example for Unix or Mac OS X
shared_dir = os.environ['HOME'] + '/Dropbox/dropbox-buf'
# Example for Windows
#shared_dir = r'C:\Documents and Settings\userid\My Documents\My Dropbox\dropbox-buf'
chunk_size = 200 * 1024 * 1024 # 200 MB
cur_fi... | const-dev/dropbox-transfer | python/send.py | send.py | py | 2,824 | python | en | code | 1 | github-code | 36 |
8546499503 | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function, unicode_literals
from tensorflow.keras import backend as K
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Flatten, Dense,Dropout, Conv1D,BatchNormalization,Input,LeakyReLU
import tensorflow as tf
impor... | ViennaRNA/rnadeep | rnadeep/sliding_window.py | sliding_window.py | py | 1,575 | python | en | code | 8 | github-code | 36 |
33541610808 | #!/usr/bin/python
import os
import sys
import subprocess
import datetime
import math
try:
# Change the next line if your config folder is not $HOME/.config
config_directory = f"{os.environ['HOME']}/.config"
# If $HOME isn't set, os.environ['HOME'] will cause an error
except KeyError:
print("The envi... | michaelskyba/kvrg-avg | main.py | main.py | py | 21,826 | python | en | code | 0 | github-code | 36 |
14449457018 | #!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | SpiderLabs/Responder | odict.py | odict.py | py | 3,516 | python | en | code | 4,235 | github-code | 36 |
3722823623 | # Solution with Backtracking
import unittest
class Solution:
def subsetsWithDup(self, nums):
res = []
nums.sort()
self.dfs(nums, 0, [], res)
return res
def dfs(self, nums, idx, path, res):
res.append(path)
for i in range(idx, len(nums)):
if i > idx... | sokazaki/leetcode_solutions | problems/0090_subsets_II.py | 0090_subsets_II.py | py | 1,266 | python | en | code | 1 | github-code | 36 |
31361078041 | #!/usr/bin/python3
import pprint
import code
from googleapiclient.discovery import build
def main():
key=importkey("googlecustomsearch")
if (key is None):
print("no key")
sys.exit()
print(key)
service = build("customsearch", "v1", developerKey=key)
#res = service.cse().list(q='saunders', fileType="pdf", site... | KoalaTea/googlescraper | googlescraper.py | googlescraper.py | py | 829 | python | en | code | 0 | github-code | 36 |
10901099381 | # Описание класса
class MyClass:
# Конструктор
def __init__(self, n="Белый"):
self.name = n
print("Создан объект:", self.name)
# Деструктор
def __del__(self):
print("Удалён объект:", self.name)
# Функция
def create(n):
obj = MyClass(n)
# Создание объектов
A = MyClass()
B ... | SetGecko/PonPbyEandT | Chapter_8/Listing08_04.py | Listing08_04.py | py | 679 | python | ru | code | 0 | github-code | 36 |
6655501967 | from functools import partial
from typing import Callable
import numpy as np
import rospy
from stable_baselines3.common.vec_env import VecNormalize
from supersuit.vector import ConcatVecEnv, MarkovVectorEnv
from supersuit.vector.sb3_vector_wrapper import SB3VecEnvWrapper
class MarkovVectorEnv_patched(MarkovVectorEnv... | ignc-research/arena-marl | arena_navigation/arena_local_planner/learning_based/arena_local_planner_drl/rl_agent/utils/supersuit_utils.py | supersuit_utils.py | py | 3,409 | python | en | code | 11 | github-code | 36 |
14128001858 | #!/usr/local/bin/ python3
# -*- coding:utf-8 -*-
# __author__ = "zenmeder"
class Solution(object):
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
length = len(nums)
d = dict()
for i in range(length):
if nums[i] in d:
del d[nums[i]]
else:
d[nums[i]] = 1
return d.p... | zenmeder/leetcode | 136.py | 136.py | py | 648 | python | en | code | 0 | github-code | 36 |
28139542208 | import time
import pandas as pd
import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.crazyflie.log import LogConfig
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie
from cflib.crazyflie.syncLogger import SyncLogger
from cflib.utils import uri_helper
from cflib.positioning.position_hl_commander impo... | Rajpal9/crazypaths | pos_level_cont/autonomous_seq_par_path_base.py | autonomous_seq_par_path_base.py | py | 4,970 | python | en | code | null | github-code | 36 |
29550581614 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 13 15:41:54 2018
@author: usuario
"""
import pandas as pd
import numpy as np
from keras.models import load_model
from collections import Counter
import time
from datetime import datetime
def runClassifier (current_batch, clf):
current_batch=np.array(c... | palomadominguez/TFG-pulseras | src/classify.py | classify.py | py | 2,435 | python | en | code | 0 | github-code | 36 |
73257029225 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: williamhadnett D00223305
"""
import pymongo
import os
os.chdir('/Users/williamhadnett/Documents/Data_Science/Data_Science_CA3_William_Hadnett')
import atlasCredentials
# =============================================================================
# Connect... | hadnett/Data_Science_Ecommerce_Performance | section2_CA3_William_Hadnett.py | section2_CA3_William_Hadnett.py | py | 7,432 | python | en | code | 0 | github-code | 36 |
10343389752 | from PyPDF2 import PdfFileWriter, PdfFileReader,PdfFileMerger
import os
import glob
import time
def remove_blank():
files = os.listdir('temp')
print(len(files))
for i in range(len(files)):
input_pdf = PdfFileReader(open(f"temp/temp{i}.pdf", "rb"))
output_pdf = PdfFileWriter()
output... | neel-jotaniya/product_detail | pdf.py | pdf.py | py | 1,080 | python | en | code | 0 | github-code | 36 |
43507385682 | # MODULE IMPORTS
# Flask modules
from flask import Flask, render_template, request, url_for, request, redirect, abort
from flask_login import LoginManager, login_user, logout_user, login_required, current_user
from flask_talisman import Talisman
from flask_pymongo import PyMongo
from flask_bcrypt import Bcrypt
from fl... | chriswilson1982/flask-mongo-app | run.py | run.py | py | 10,514 | python | en | code | 20 | github-code | 36 |
16845647150 | from django.urls import path
from . import views
app_name = 'main'
urlpatterns = [
# not logged in
path('', views.index, name="index"),
path('search/', views.search, name="search"),
# logged in
path('home/', views.home, name="home"),
path('post/', views.addWord, name="post"),
path('resul... | Leomhango/ndamvesta2.0 | backend/main/urls.py | urls.py | py | 597 | python | en | code | 1 | github-code | 36 |
73118869864 | from abc import ABC, abstractmethod
class BankA(ABC):
def __init__(self, name="БанкА", golds=1000000):
self._name = name
self._golds = golds
@staticmethod
def verification_gold(ins):
return int(ins) if ins.isdecimal() else None
def gold_in(self):
gold = self.verifica... | IlyaOrlov/PythonCourse2.0_September23 | Practice/amarinin/Modul_7/modul7_lesson7_3.py | modul7_lesson7_3.py | py | 2,877 | python | en | code | 2 | github-code | 36 |
7048207063 | from flask import Flask, request, jsonify
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
import socket
import gridfs
UPLOAD_FOLDER = 'upload_temp'
ALLOWED_EXTENSIONS = {'pdf'}
app = Flask(__name__)
app.config["MONGO_URI"] = "mongodb://mongo:27017/dev"
app.config['UPLOAD_FOLDER'] = UPL... | cdsl-research/doktor | service/search/web/main.py | main.py | py | 2,596 | python | en | code | 1 | github-code | 36 |
15865559103 | import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--physics", help="physics marks")
parser.add_argument("--chemistry", help="chemistry marks")
parser.add_argument("--maths", help="maths marks")
args = parser.parse_args()
print(args.physics)
... | codebasics/py | Basics/Exercise/24_argparse/24_argparse.py | 24_argparse.py | py | 527 | python | en | code | 6,422 | github-code | 36 |
29022782188 | from . import Constants as co
from .Settings import Settings
from FEP_PELE.Utils.InOut import isThereAFile
class InputFileParser(object):
def __init__(self, path):
if (not isThereAFile(path)):
raise IOError('FEP_PELE input file not found')
self.path = path
def createSettings(self... | martimunicoy/FEP_PELE | FEP_PELE/FreeEnergy/InputFileParser.py | InputFileParser.py | py | 1,619 | python | en | code | 0 | github-code | 36 |
43043489806 | # Need to chop up files by a few different states
# Import all necessary libraries
import arcpy
import os
arcpy.env.overwriteOutput = True
arcpy.CheckOutExtension("Spatial")
from arcpy.sa import *
# establish scratch workspace
scratch_path = "F:/temp/ArcScratch"
arcpy.env.scratchWorkspace = scratch_path
lyr = "lyr"
p... | Smithsonian/z-star-mapping | python/ChopUpMapsByZone.py | ChopUpMapsByZone.py | py | 2,993 | python | en | code | 1 | github-code | 36 |
32842087226 | import cv2 as cv
import os
def YOLO():
dir = os.path.dirname(__file__)
net = cv.dnn.readNetFromDarknet(dir + "/models/yolov3-tiny.cfg", dir + "/models/yolov3-tiny.weights")
blob_options = {"scale": 1/255.0, "MeanSubtraction": (0, 0, 0)}
labels = open(dir + "/data/coco2014.names").read().strip().split... | adagun/detector | models.py | models.py | py | 1,137 | python | en | code | 1 | github-code | 36 |
6786663841 | import os
from .local import * # noqa
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', '6vj06c)fc=!9ot%7t6^r2v^=$5x-j*6*#kk))cg0e!9zcyp(y+')
JWT_VERIFY_EXPIRATION = False
JWT_VERIFY = True
JWT_LEEWAY = 0
JWT_AUDIENCE = None
JWT_ISSUER = None
JWT_ALGORITHM = 'HS256'
JWT_AUTH = {
'JWT_DECODE_HANDLER': 'utils.auth... | tomasgarzon/exo-services | service-exo-auth/service/jwt_settings.py | jwt_settings.py | py | 714 | python | en | code | 0 | github-code | 36 |
24108741135 |
# Generating images of handwritten digits using a Deep Convolutional Generative Adversarial Network
import numpy as np
import tensorflow as tf
from tensorflow.layers import batch_normalization
from tensorflow.keras.layers import UpSampling2D
import matplotlib.pyplot as plt
class DCGAN:
def __init__... | ShankulShukla/Generative-Modeling | DC-GAN.py | DC-GAN.py | py | 7,046 | python | en | code | 0 | github-code | 36 |
30794416092 | """
* **kwargs can be used to specify a variable number of keyword parameters
* Inside the function kwargs is a dictionary containing the supplied parameter name as key and their value as dictionary value
"""
def temp(**kwargs):
for k, v in kwargs.items():
print(f'{k} = {v}') # k: key, v: value
tem... | sokuro/PythonBFH | 01_Fundamentals/Functions/Kwargs.py | Kwargs.py | py | 746 | python | en | code | 0 | github-code | 36 |
40892463582 | import io
from datetime import datetime
import cv2
from django.http import FileResponse
from pdf2image import convert_from_bytes
from PIL import Image
from rest_framework import mixins, permissions, viewsets
from rest_framework.decorators import (action, api_view,
authentication_... | pierrotlemekcho/exaged | sifapi/planning/views.py | views.py | py | 8,175 | python | en | code | 0 | github-code | 36 |
71122270185 | # Excel写入的代码:
import openpyxl
wb = openpyxl.Workbook()
sheet = wb.active
sheet.title ='豆瓣'
sheet['A1'] = '豆瓣读书'
rows = [['美国队长','钢铁侠','蜘蛛侠','雷神'],['是','漫威','宇宙', '经典','人物']]
for i in rows:
sheet.append(i)
print(rows)
wb.save('Marvel.xlsx') | amuamu123/python_offices | EXECEL/CSV和EXCEL的基础写入方式/Excel写入的代码.PY | Excel写入的代码.PY | py | 312 | python | en | code | 1 | github-code | 36 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.