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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
30293188969 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path("new", views.create, name='new'),
path('list', views.list, name='list'),
path('edit/<int:task_id>', views.edit, name='edit'),
] | drazisil/task-zero | tasks/urls.py | urls.py | py | 252 | python | en | code | 0 | github-code | 6 |
5308350680 |
# from math import sqrt
# def prime_list(n):
# sieve = [True] * n
# m = int(sqrt(n))
# for i in range(2, m+1):
# if sieve[i] == True:
# for j in range(2*i, n, i):
# sieve[j] = False
# return [i for i in range(2,n) if sieve[i] == True]
#
# def prime_num(n):
# li ... | louisuss/Algorithms-Code-Upload | Python/Baekjoon/Math/9020.py | 9020.py | py | 1,897 | python | en | code | 0 | github-code | 6 |
43281391404 | # -*- coding: utf-8 -*-
"""
Created on Tue May 23 22:30:25 2023
@author: user
"""
import numpy as np
import sys
print("\n-------------GAUSS ELIMINATION--------------\n")
n = int(input("Enter number of unknowns : "))
# for storing augmented matrix
a = np.zeros((n,n+1))
# for storing solution vec... | AksA1210/Numerical-Methods-Lab | Final/Gauss_elimination.py | Gauss_elimination.py | py | 1,142 | python | en | code | 0 | github-code | 6 |
7007626301 | def fib(n):
if n == 1:
return 1
return n + fib(n-1)
def main():
n = 0
m = 1
result = 0
while n < 4000000:
tmp = n
n = n + m
m = tmp
if n % 2 == 0:
result += n
# print(n, n % 2)
# print(n, result)
print("Problem 2:", result)
| minuq/project-euler | problems/problem_2.py | problem_2.py | py | 318 | python | en | code | 0 | github-code | 6 |
73017766588 | import json
from typing import Dict, List, Tuple
from flask import Flask, jsonify, request
from rb.complexity.complexity_index import compute_indices
from rb.complexity.index_category import IndexCategory
from rb.core.document import Document
from rb.core.lang import Lang
from rb.core.text_element import TextElement
f... | rwth-acis/readerbenchpyapi | rb_api/keywords/keywords.py | keywords.py | py | 6,881 | python | en | code | 1 | github-code | 6 |
44793179363 | # Solution 179 Inorder using Loop and Recursion
class Node:
def __init__(self, value):
self.data = value
self.left = None
self.right = None
def __str__(self):
return str(self.data)
def inorderR(root):
if root is None:
return
inorderR(root.left)
... | Shwaubh/LoveBabbarSolution | Binary Trees/Solution179InorderOrderTravesalLoop.py | Solution179InorderOrderTravesalLoop.py | py | 911 | python | en | code | 2 | github-code | 6 |
4406135371 | class TreeNode():
def __init__(self, val):
self.val = val
self.left = None
self.right = None
self.parent = None
class BST():
def __init__(self, root=None):
self.root = root
def insert_recursive(self, val):
def recursive(node, val):
if not node:
... | guzhoudiaoke/data_structure_and_algorithms | coding_interview_guide/3_binary_tree/17_find_successor/bst.py | bst.py | py | 2,083 | python | en | code | 0 | github-code | 6 |
8410504339 | #! /usr/bin/python
import logging
import os
from pathlib import Path
import coloredlogs
from dotenv import load_dotenv
PROJECT_ROOT = Path(__file__).parent.resolve()
#####################
# CONFIGURE LOGGING #
#####################
LOG_PATH = str(PROJECT_ROOT / "worker.log")
logging.basicConfig(
filename=LOG_... | darwin403/translate-transcribe-videos | settings.py | settings.py | py | 1,222 | python | en | code | 1 | github-code | 6 |
25033983488 | from django.urls import path
from . import views
urlpatterns = [
# UI & API hybrid routes
path("", views.index, name="index"),
path("posts/<int:page>", views.posts, name="posts"),
path("following/<int:page>", views.following, name="following"),
path("profile/<str:username>/<int:page>", views.profi... | csloan29/HES-e-33a-web-django | network/network/urls.py | urls.py | py | 773 | python | en | code | 0 | github-code | 6 |
40299141620 | import numpy as np
from typing import List, Optional, Tuple
from collections import defaultdict
from kaggle_environments.envs.halite.helpers import Ship
from .board import MyBoard, ALL_SHIP_ACTIONS
from .logger import logger
def ship_converts(board: MyBoard):
""" Convert our ships into shipyards """
if board.... | w9PcJLyb/HaliteIV-bot | halite/ship_converts.py | ship_converts.py | py | 5,297 | python | en | code | 0 | github-code | 6 |
8630223604 | # exceptions.py
#
# This module is part of linux_commands/commands module and is released under
# the GNU Public License: https://en.wikipedia.org/wiki/GNU_General_Public_License
""" Module containing all exceptions thrown throughout the cmd package, """
from commands.utils.cmd_utils import safe_decode
class QuietEr... | avitko001c/python_linux_command_module | exceptions.py | exceptions.py | py | 3,139 | python | en | code | 0 | github-code | 6 |
16543689747 | import csv
import sys
from nuitka.__past__ import StringIO
from nuitka.Tracing import my_print
from nuitka.utils.Execution import check_output
def main():
# many cases, pylint: disable=too-many-branches
my_print("Querying openSUSE build service status of Nuitka packages.")
# spell-checker: ignore kayha... | Nuitka/Nuitka | nuitka/tools/release/osc_check/__main__.py | __main__.py | py | 3,651 | python | en | code | 10,019 | github-code | 6 |
14654879415 | """
OWASP Maryam!
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, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT A... | callforpapers-source/maryam-deb | core/util/searchencrypt.py | searchencrypt.py | py | 2,452 | python | en | code | 0 | github-code | 6 |
31963159871 | from sys import stdin
import re
input = stdin.readline
pmon, q = map(int, input().split())
pmons = {}
for i in range(1, pmon+1):
pmons[i] = input().strip()
is_numb = re.compile('[0-9]')
reversed_pmons = {v: k for k, v in pmons.items()}
for _ in range(q):
res = input().strip()
res_int_valid = ... | yongwoo-jeong/Algorithm | 백준/Silver/1620. 나는야 포켓몬 마스터 이다솜/나는야 포켓몬 마스터 이다솜.py | 나는야 포켓몬 마스터 이다솜.py | py | 441 | python | en | code | 0 | github-code | 6 |
6148825082 | from selenium import webdriver
from time import sleep
import selenium
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
import pandas as pd
if __name__ == '__main__':
# option=webdriver.ChromeOptions()
# option.add_argument("--user-data-dir="+r"C:\\Users\\2014... | YN3359/runoob-git-test | PythonScripts/自动备案COC.py | 自动备案COC.py | py | 2,122 | python | en | code | 0 | github-code | 6 |
519381337 | from openmdao.core.driver import Driver, RecordingDebugging
from openmdao.api import SimpleGADriver, Problem, LatinHypercubeGenerator, DOEDriver
from dataclasses import dataclass
from copy import deepcopy
import random
import numpy as np
from itertools import chain
from deap import algorithms, base, tools
from deap.be... | ovidner/openmdao-deap | openmdao_deap/__init__.py | __init__.py | py | 5,155 | python | en | code | 0 | github-code | 6 |
2690012282 | import boto3
import os
class WasabiUploader:
def __init__(self, directory):
self.directory = directory
self.session = boto3.Session(profile_name="default")
self.credentials = self.session.get_credentials()
self.aws_access_key_id = self.credentials.access_key
self.aws_secret... | evanwmeeks/PersonalProjects | wasabi_interface/wasabi.py | wasabi.py | py | 3,414 | python | en | code | 0 | github-code | 6 |
11502963314 | with open('./input_day_8.txt') as file:
input = file.read().splitlines()
input = [i.split(' ') for i in input]
unique_len = [2, 4, 3, 7]
count = 0
for i in input:
for j in i[-4:]:
if j != '|':
if len(j) in unique_len:
count += 1
print('part 1: ' + str(count))
sum = 0
... | Camillemns/advent_of_code | day8.py | day8.py | py | 1,522 | python | en | code | 0 | github-code | 6 |
7796950374 | # 8min, 239 ms 14.7 MB
class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
dict = {}
for num in nums:
if num in dict.keys():
dict[num] += 1
else:
dict[num] = 1
... | sky77764/Leetcode | Top 100 Liked Questions/easy/169. Majority Element.py | 169. Majority Element.py | py | 505 | python | en | code | 0 | github-code | 6 |
70939657148 | from selenium import webdriver
import requests
from bs4 import BeautifulSoup
from pymongo import MongoClient
import time
import datetime
def get_page(url):
header = {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11"
... | lzzandsx/lizhengzhao_python_homework | xinlang.py | xinlang.py | py | 1,935 | python | en | code | 0 | github-code | 6 |
29279761170 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Ambre chamber
"""
__author__ = "Dennis van Gils"
__authoremail__ = "vangils.dennis@gmail.com"
__url__ = "https://github.com/Dennis-van-Gils/project-Ambre-chamber"
__date__ = "31-08-2020"
__version__ = "2.0"
# pylint: disable=bare-except, broad-except, try-except-raise
... | Dennis-van-Gils/project-Ambre-chamber | src_python/main.py | main.py | py | 22,276 | python | en | code | 0 | github-code | 6 |
13538653206 | import pygame
import numpy as np
from util.helpers import *
from physics.colliding_object import Colliding
class EyeBeam(Colliding):
def __init__(self, start, end):
self.start = np.array(start)
super(EyeBeam, self).__init__(self.start)
self.end = np.array(end)
self.collide_type = '... | SimonCarryer/video_game_ai | brains/eyes.py | eyes.py | py | 3,313 | python | en | code | 2 | github-code | 6 |
74451964986 | from core.visualization import PlotGraphics
from core.relation_extraction import SpacyRelationExtraction
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import Pipeline
from sklearn.tree import DecisionTreeClassifier
from skle... | eliseu31/MSDS-Analyser | core/text_pipeline.py | text_pipeline.py | py | 6,284 | python | en | code | 8 | github-code | 6 |
41550338634 | from . animation import Animation
from .. layout import circle
from .. util import deprecated
class Circle(Animation):
LAYOUT_CLASS = circle.Circle
LAYOUT_ARGS = 'rings',
def __init__(self, layout, **kwds):
super().__init__(layout, **kwds)
self.rings = layout.rings
self.ringCount ... | ManiacalLabs/BiblioPixel | bibliopixel/animation/circle.py | circle.py | py | 553 | python | en | code | 263 | github-code | 6 |
32644614877 | """
Given a universal mesh, record the placements of guide nodes as it relative to
universal mesh. And then repoisition guides to that relative position should
the universal mesh change from character to character.
from mgear.shifter import relativeGuidePlacement
reload(relativeGuidePlacement)
Execute the following c... | mgear-dev/mgear4 | release/scripts/mgear/shifter/relative_guide_placement.py | relative_guide_placement.py | py | 19,592 | python | en | code | 209 | github-code | 6 |
33914485796 | from django.conf.urls import patterns, url
from ventas import viewsInforme,viewsPedido
urlpatterns = patterns('',
url(r'^$', viewsPedido.venta_desktop, name='venta_desktop'),
url(r'^fac/', viewsPedido.venta_desktop, name='venta_desktop1'),
url(r'^mobile/$', viewsPedido.venta_mobile, name='venta_mobile'),
... | wilmandx/ipos | ventas/urls.py | urls.py | py | 1,020 | python | es | code | 0 | github-code | 6 |
33105484438 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging; logger = logging.getLogger("main")
FORMAT = '%(asctime)s - %(levelname)s: %(message)s'
logging.basicConfig(format=FORMAT, level=logging.WARNING)
import time
from flask import Flask, escape, url_for,render_template, g, request, redirect, jsonify, session
f... | severin-lemaignan/robomaze | backend/backend.py | backend.py | py | 4,956 | python | en | code | 1 | github-code | 6 |
27264160200 | """
GenT2MF_Trapezoidal.py
Created 3/1/2022
"""
from __future__ import annotations
from typing import List
from juzzyPython.generalType2zSlices.sets.GenT2MF_Prototype import GenT2MF_Prototype
from juzzyPython.intervalType2.sets.IntervalT2MF_Trapezoidal import IntervalT2MF_Trapezoidal
from juzzyPython.type1.sets.T1MF_Tr... | LUCIDresearch/JuzzyPython | juzzyPython/generalType2zSlices/sets/GenT2MF_Trapezoidal.py | GenT2MF_Trapezoidal.py | py | 6,556 | python | en | code | 4 | github-code | 6 |
71066844029 | from examples.example_imports import *
scene = EagerModeScene()
fixed_point = Sphere(radius=0.08).move_to(ORIGIN).set_color(GREEN_D)
scene.add(fixed_point)
start_rod = Vec3(*UP*3)
end_rod = Vec3(-3, 3, 0)
L = (end_rod - start_rod).norm()
# rod = Line3D(start_rod, end_rod, width=0.08).set_color(RED_D)
fine_line = Lin... | beidongjiedeguang/manim-express | examples/animate/单摆.py | 单摆.py | py | 1,885 | python | en | code | 13 | github-code | 6 |
22768172274 | from backend import credential
import urllib.parse
from google.cloud import storage
import streamlit as st
import os
import json
import fnmatch
import file_io
import utils
import traceback
import io
def init():
creds_str = credential.google_creds()
if not os.path.exists('temp'):
os.makedirs('temp')
... | sean1832/Mongrel-Assemblies-DB | src/backend/gcp_handler.py | gcp_handler.py | py | 6,361 | python | en | code | 0 | github-code | 6 |
22329941730 | from discord.ext import commands, tasks
import discord
import asyncio
import os
import json
import sqlite3
from dotenv import load_dotenv
import requests
from datetime import datetime,time
load_dotenv()
class Birthday(commands.Cog):
"""Birthday commands."""
def __init__(self, client):
self.client = c... | micfun123/Simplex_bot | cogs/birthday.py | birthday.py | py | 14,104 | python | en | code | 24 | github-code | 6 |
21932276295 | from discord.ext import commands
class ErrorHandeler(commands.Cog):
"""A cog for global error handling"""
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError):
if isinstance(error... | Jarkyc/Franklin-The-Undying | errorhandler.py | errorhandler.py | py | 599 | python | en | code | 0 | github-code | 6 |
27801635646 | import socket
import time
#traceroute.py 172.217.23.78 udp -p 53 -n 3 -d
class Tracerouter:
def __init__(self, ip,port,timeout,request,sendwait,debug,data,size):
self.ip = ip
self.request = request
self.timeout = timeout
self.port = port
self.sendwait = sendwait
self.... | belutkautka/Traceroute | UDP_traceroute.py | UDP_traceroute.py | py | 2,259 | python | en | code | 0 | github-code | 6 |
86625823283 | #! /usr/bin/env python
import argparse
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Linearly normalize intensity to between 0 and 255')
parser.add_argument("input_spec", type=str, help="Input specification")
parser.add_argument("out_version", type=str, ... | mistycheney/MouseBrainAtlas | preprocess/normalize_intensity_adaptive.py | normalize_intensity_adaptive.py | py | 8,733 | python | en | code | 3 | github-code | 6 |
29284611127 | # -*- coding: utf-8 -*-
import sys
import re
import pdb
def main(args):
#pdb.set_trace()
lines = args[1].decode("gb18030").encode("utf8").split("|||")
for line in lines:
if re.search(r"^(\S+)",line):
s = re.search(r"^(\S+)",line)
ss = s.group(1)
... | Tubao/xkx | pkuxkx/xx/getRoomName.py | getRoomName.py | py | 443 | python | en | code | 2 | github-code | 6 |
20503848569 | # Необходимо парсить страницу со свежими статьями (вот эту) и выбирать те статьи, в которых встречается хотя бы одно из ключевых слов (эти слова определяем в начале скрипта). Поиск вести по всей доступной preview-информации (это информация, доступная непосредственно с текущей страницы). Вывести в консоль список подходя... | Dimasuz/HW_4.3 | HW_4.3.py | HW_4.3.py | py | 3,750 | python | ru | code | 0 | github-code | 6 |
36697027175 | from jinja2 import Environment, PackageLoader
import os
from typing import Dict
import re
class SQLTemplate:
_templatePath = os.path.join(
os.path.dirname(os.path.dirname(os.path.relpath(__file__))), "templates"
)
_templatePath = os.path.join("templates")
# raise ValueError(f'temp... | ProjectiveGroupUK/tips-snowpark | tips/framework/utils/sql_template.py | sql_template.py | py | 1,001 | python | en | code | 2 | github-code | 6 |
9837393322 | import networkx as nx
# import pulp
G = nx.DiGraph()
G.add_nodes_from(['A', 'B', 'C', 'D', 'E', 'F'])
G.add_edges_from([('A', 'B'), ('A', 'D'), ('B', 'C'), ('B', 'E'), ('C', 'F'), ('D', 'C'), ('E', 'C'), ('E', 'D'), ('E', 'F')])
capacities = [4,5,5,4,4,3,2,2,1]
costs = [1,7,7,2,3,2,1,1,4]
for i, edge in enumerate(G... | havarpan/verkkomallit-k21-glitchtest | python/luentoesim.py | luentoesim.py | py | 639 | python | en | code | 0 | github-code | 6 |
21347456845 | class IP():
def __init__(self,ipaddress):
url='http://m.ip138.com/ip.asp?ip='
self.IP=ipaddress
self.site=url+self.IP
self.header={'User-Agent' :'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063'}
def get_phy(... | Alex-Beng/CubingQQBot | IP.py | IP.py | py | 1,869 | python | en | code | 0 | github-code | 6 |
5312412579 | import pygame
from flame import Flame
class Firework:
def __init__(self):
self.rect = pygame.Rect(640, 720, 25, 50)
self.image = pygame.Surface( (25, 50) )
self.image.fill( (255, 255, 255) )
self.exploded = False
self.flames = []
def update(self):
if not self.e... | jbedu1024/fajerwerki | firework.py | firework.py | py | 822 | python | en | code | 0 | github-code | 6 |
21725310389 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def push(self, new_data):
new_node = Node(new_data)
new_node.next = self.head
self.head = new_node
def printLL(self):
... | ItsSamarth/ds-python | DataStructures/linkedlist/basic.py | basic.py | py | 2,099 | python | en | code | 0 | github-code | 6 |
32757721309 | ############### Start stopBackupMaintSched() ###############
def stopBackupMaintSched():
message ="""
##################################################################
# Start stopBackupMaintSched #
##################################################################
"""
printLog... | abodup/Avamar-Upgrade-Tasks | upgrade_tasks/stopBackupMaintSched.py | stopBackupMaintSched.py | py | 2,022 | python | en | code | 1 | github-code | 6 |
29510374823 | import re
import pandas as pd
import fool
from copy import copy
from starter_code1.NER.ner01 import *
test_data = pd.read_csv('../data/info_extract/test_data.csv', encoding='gb2312', header=0)
# print(test_data.head())
test_data['ner'] = None
ner_id = 1001
ner_dict_new = {} # 存储所有实体
ner_dict_reverse_new = {} # 储存所... | jiangq195/tanxin | starter_code1/NER/ner02.py | ner02.py | py | 4,477 | python | en | code | 0 | github-code | 6 |
25549551579 | import logging
from core.connect_db import connect_db
from logger.logger import configLogger
from settings.settings import load_settings
logger = logging.getLogger()
class BaseFetcher(object):
def __init__(self):
super(BaseFetcher, self).__init__()
configLogger()
self._connect_to_db()
... | cipriantruica/news_diffusion | news-spreading-master/fetchers/base_fetcher.py | base_fetcher.py | py | 774 | python | en | code | 0 | github-code | 6 |
72478034429 | """HartPro URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | cjxxu/A_Fiction_web | HartPro/urls.py | urls.py | py | 2,203 | python | en | code | 1 | github-code | 6 |
22034953643 | import pandas as pd
import s3fs
def main(event = None, context = None):
print("Start running LinkedInScraper")
values = [['Atreish Ramlakhan',
'New York, New York, United States',
'Katz School at Yeshiva University',
'Graduate Teaching Assistant',
'https:... | sczhou0705/IA-FinalProject-YUconnect | LambdaDeployment/Code/LinkedInScraper.py | LinkedInScraper.py | py | 1,878 | python | en | code | 0 | github-code | 6 |
39612347075 | ##
## EPITECH PROJECT, 2019
## 108trigo_2019
## File description:
## utils.py
##
def printhelp():
print("USAGE\n"
"\t./108trigo fun a0 a1 a2....\n"
"\n"
"DESCRIPTION\n"
"\tfun\tfunction to be applied,"
' among at least "EXP", "COS", "SIN", "COSH" and "SINH"\n'
... | clementfleur/Epitech_Project | tek1/Mathématique/108trigo_2019/utils.py | utils.py | py | 571 | python | en | code | 2 | github-code | 6 |
42307014223 | import os
import sys
import time
from acbbs.drivers.ate.ClimCham import ClimCham
from acbbs.drivers.ate.DCPwr import DCPwr
from acbbs.drivers.ate.PwrMeter import PwrMeter
from acbbs.drivers.ate.RFSigGen import RFSigGen
from acbbs.drivers.ate.RFSigGenV import RFSigGenV
from acbbs.drivers.ate.SpecAn import SpecAn
from a... | Wonters/IHMweb | calib/tasks.py | tasks.py | py | 13,334 | python | en | code | 0 | github-code | 6 |
23541886221 |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 22 15:37:26 2022
@author: jeros
Hu moments analysis
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.ticker import PercentFormatter
def plotter(huN = 1, bananas = None,oranges = None,lemons = None):
# if bananas is not None:
... | jeroserpa/FruitClassifier | histogram_analisys.py | histogram_analisys.py | py | 1,459 | python | en | code | 0 | github-code | 6 |
7681527858 | #/usr/bin/python3
from pwn import *
context.arch = 'i386'
if args.REMOTE:
con = remote ('chals.damctf.xyz', 31312)
else:
con = process('./cookie-monster')
# Exploit format string vulnerability to leak stack canary.
def leak_canary():
con.recvuntil(b'Enter your name:')
con.sendline(b'%15$p')
con.... | dystobic/writeups | 2021/DAMCTF/cookie-monster/exploit.py | exploit.py | py | 1,728 | python | en | code | 1 | github-code | 6 |
5308409860 | N = int(input())
map_list = [[0]*101 for _ in range(101)]
dirs = {0:(1,0), 1:(0,-1), 2: (-1,0), 3: (0,1)}
# d=시작방향 / g=세대
for _ in range(N):
x, y, d, g = map(int, input().split())
curve_list = [d]
for _ in range(g):
curve_list += [(i+1)%4 for i in curve_list[::-1]]
map_list[y][x] = 1
f... | louisuss/Algorithms-Code-Upload | Python/Baekjoon/Simulation/15685.py | 15685.py | py | 620 | python | en | code | 0 | github-code | 6 |
29010500134 | import functools
import os
import sys
from typing import Any, Callable, Iterable, Optional, TextIO, Tuple
import click
from click import Command
from click_option_group import MutuallyExclusiveOptionGroup
from . import __version__
from .core import (
CheckHashLineError,
HashFileReader,
HashFileWriter,
... | xymy/gethash | src/gethash/script.py | script.py | py | 11,381 | python | en | code | 2 | github-code | 6 |
44075659516 | from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time
import pickle
import os
#put url here
#example_url= "https://archive.thehated3.workers.dev/0:/Statio... | aniket328/workers-dev-download-folders | fx.py | fx.py | py | 4,837 | python | en | code | 0 | github-code | 6 |
386960757 | import os
from flask import Response,Flask, request
from flask_cors import CORS
from insgraph import util, instagram
def create_app(test_config=None):
"""Create and configure an instance of the Flask application."""
app = Flask(__name__, instance_relative_config=True)
print("zhuangjb flask start.....:"+__... | jiebinzhuang/insgraph-flask | insgraph/__init__.py | __init__.py | py | 2,301 | python | en | code | 0 | github-code | 6 |
30409488540 | import os
import pytest
import logging
import cocotb
from cocotb.clock import Clock, Timer
from cocotb.binary import BinaryValue
from cocotb.runner import get_runner
from cocotb.triggers import FallingEdge
from cocotbext.uart import UartSource, UartSink
src_dir = os.path.dirname(os.path.dirname(os.path.abspath(__fi... | ryarnyah/zenika-fpga-pres | demo/fpga-risc-cpu/src/test/test_soc.py | test_soc.py | py | 2,170 | python | en | code | 1 | github-code | 6 |
27044024051 | from tkinter import *
main = Tk()
main.resizable(width=False, height=False)
main.config(bg="#2d3436")
main.title("Disappearing text App")
stop_writing_id = 'after' # store id of the scheduled call to traduire
main_text = Label(main, text="Start typing and text will disappear after a few seconds...", fg="#dfe6e9", fo... | Tabinka/disappearingTextApp | main.py | main.py | py | 915 | python | en | code | 0 | github-code | 6 |
19637375362 | import serial
import datetime as dt
import sys
class gps:
def __init__(self, port = "/dev/serial0"):
# Initializes serial connection for gps communication
try:
self.__ser = serial.Serial(port)
except Exception as e:
sys.exit("Can not connect with GPS usin... | maciejzj/pi-observer | scripts/gps.py | gps.py | py | 5,664 | python | en | code | 1 | github-code | 6 |
42992886102 | import gspread
import numpy as np
import pandas as pd
from datetime import date
from datetime import datetime
import csv
import pytz
from oauth2client.service_account import ServiceAccountCredentials
import requests
#authorization
service_account = gspread.service_account(filename = 'capstone-362722-f3745d9260b7.json' ... | mcenek/TeamLiftCSWaterProject | CloudUpload/datapusher.py | datapusher.py | py | 5,965 | python | en | code | 5 | github-code | 6 |
20281135464 | def notas(* n, sit = False):
'''
-> Função para notas e situacoes de varios alunos.
:param n: uma ou mais notas dos alunos (aceita carias).
:param sit: valor opcional, indicando se deve ou nao adicionar a situacao.
:return: dicionario com varias informacoes da turma.
'''
media = maior = meno... | JoooNatan/CursoPython | Mundo03/Exs/Ex105.py | Ex105.py | py | 1,636 | python | pt | code | 0 | github-code | 6 |
34959494378 | # 220728
# SWEA_D1
# 14553. Game Money
# N명의 사람이 게임을 하는데, 한 판에 두 사람이 참여함
# 두 사람은 각자 1원씩 게임 머니를 내야함
# 주어진 게임 머니를 통해 최대 몇 게임을 할 수 있는지 계산하기
# N은 최대 20, 초기 게임 머니는 최대 100
T = int(input())
for t in range(1, T+1):
N = int(input())
N_ls = sorted(map(int, input().split())) # 숫자 받아서 정렬
game_... | pearl313/Alorithm_study | 알스_220728.py | 알스_220728.py | py | 918 | python | ko | code | 0 | github-code | 6 |
33198762995 | import ConfigParser
import io
import sys
import os
import numpy as np
from scipy.stats import cumfreq
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.basemap import Basemap
from matp... | edwinkost/PCR-GLOBWB_validation | niko_validation_scripts/standAlone/plotValidation.py | plotValidation.py | py | 7,155 | python | en | code | 0 | github-code | 6 |
35379919905 | from flask import Flask
from flask_apscheduler import APScheduler
# config scheduling class
from statuschecker import get_health_status
class Config(object):
JOBS = [
{
'id': 'check_health',
'func': 'app:check_health',
'trigger': 'interval',
'seconds': 180... | tynorantoni/HealthCheckService | app.py | app.py | py | 687 | python | en | code | 0 | github-code | 6 |
40077076852 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import re
import logging
from .pushbullet import *
class Messenger(object):
"""docstring for Message"""
def __init__(self): #, arg):
# super(Message, self).__init__()
# self.arg = arg
self.ready = False
self.message = ''
... | lucy9215/jobNotification | pushbullet/messenger.py | messenger.py | py | 5,743 | python | en | code | 0 | github-code | 6 |
19645294724 | from Math import mathObject
import random
class areaObject(mathObject):
def __init__(self):
self.type = "Area"
self.areaType = None
self.pieces = []
self.content = []
def include(self, x):
pass
class areaPiece(areaObject):
def __init__(self, content, tp):
... | Anon-LeoH/UncleDaLearn | UD/Area/__init__.py | __init__.py | py | 2,974 | python | en | code | 2 | github-code | 6 |
33147997203 | from covid_constants_and_util import *
import geopandas as gpd
import statsmodels.api as sm
import json
import copy
from fbprophet import Prophet
from collections import Counter
import re
import h5py
import ast
from shapely import wkt
from scipy.stats import pearsonr
import fiona
import geopandas
import csv
import os
f... | snap-stanford/covid-mobility | helper_methods_for_aggregate_data_analysis.py | helper_methods_for_aggregate_data_analysis.py | py | 68,047 | python | en | code | 146 | github-code | 6 |
8655705907 | import errno
import os
import requests
from pathlib import Path
import sly_globals as g
import supervisely as sly
from supervisely.app.v1.widgets.progress_bar import ProgressBar
progress5 = ProgressBar(g.task_id, g.api, "data.progress5", "Download weights", is_size=True, min_report_percent=5)
local_weights_path = No... | supervisely-ecosystem/unet | supervisely/train/src/ui/step05_models.py | step05_models.py | py | 4,736 | python | en | code | 2 | github-code | 6 |
5475332432 | class Empleado():
def __init__(self, nombre, cargo, salario):
self.nombre = nombre
self.cargo = cargo
self.salario = salario
def __str__(self):
return "{} que trabaja como {} tiene un salario de {} €".format(self.nombre, self.cargo, self.salario)
listaEmpleados=[
Empleado("juan", "director", 75000),
Emp... | mivargas/ejercicios-de-python | funcion_filter2.py | funcion_filter2.py | py | 626 | python | es | code | 0 | github-code | 6 |
108222953 | '''
Created on Oct 31, 2010
@author: pekka
'''
from event import MapBuiltEvent, SectorsLitRequest, CharactorMoveEvent, CharactorTurnAndMoveRequest, \
DimAllSectorsRequest, CharactorPlaceEvent, CalculatePathRequest, OccupiedSectorAction, \
FreeSectorAction, ActiveCharactorChangeEvent, CharactorPlaceRequest
import cons... | speque/shallowspace | shallowspace/map.py | map.py | py | 10,022 | python | en | code | 2 | github-code | 6 |
40260766080 | import gvar as gv
import corrfitter as cf
import numpy as np
import collections
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.ticker import MultipleLocator
matplotlib.use('Agg')
plt.rc("font",**{"size":18})
import datetime
import os
import pickle
import copy
#fr... | WillParrott/New_bodiddley_fitter | functions.py | functions.py | py | 47,341 | python | en | code | 0 | github-code | 6 |
43067183900 | # Modified by: Dr. Smruti Panigrahi
import numpy as np
def mean_nav_angle(Rover):
# Add standard deviation to the mean Nav angle to make Rover a left-wall-crawler
return np.clip( (np.mean(Rover.nav_angles) + Rover.wall_offset_angle) * 180/np.pi, -15, 15)
def is_moving(Rover):
# Checks if the Rover h... | DrPanigrahi/RoboND-Rover-Project | code/decision.py | decision.py | py | 9,602 | python | en | code | 0 | github-code | 6 |
22791922218 | #2022.08.15
#Q1. 다음은 Calcutalor 클래스이다.
class Calculator:
def __init__(self):
self.value = 0
def add(self, val):
self.value += val
#위 클래스를 상속하는 UpgradeCalculator를 만들고 값을 뺄 수 있는 minus 메소드를 추가해 보자.
#즉 다음과 같이 동작하는 클래스를 만들어야 한다.
class UpgradeCalculator(Calculator):
def minus(self, val):
... | Yoon-kiyeong/Jump_Up_To_Python | Ch01/Part 04/Practice.py | Practice.py | py | 4,802 | python | ko | code | 0 | github-code | 6 |
8103602238 | #
# @lc app=leetcode id=25 lang=python3
#
# [25] Reverse Nodes in k-Group
#
# @lc code=start
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverseKGroup(self, head: Optional[ListNode], k: in... | HongyuZhu999/LeetCode | 25.reverse-nodes-in-k-group.py | 25.reverse-nodes-in-k-group.py | py | 1,035 | python | en | code | 0 | github-code | 6 |
74921836986 | import tkinter as tt
from tkinter import *
from tkinter import Tk, Label, Button,Entry, StringVar
win = tt.Tk()# 创建窗体对象
# win.title('来自我的表白')#标题
# win.geometry('350x200+430+350')
# label = tt.Label(win,text='能做我女朋友吗?',font="微软雅黑",fg='#666',bg='red')
# label.pack()
# def mClick():
# label = tt.Label(win,text='爱你哦!... | git123hub121/Python-analysis | Tkinter/Tk.py | Tk.py | py | 1,481 | python | en | code | 4 | github-code | 6 |
21396441749 | import os
from django.conf import settings
from django.db import connection, close_old_connections
from django.db.utils import OperationalError
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from racetrack_client.utils.shell import shell, CommandError
from lifecycle.django.registry.database im... | TheRacetrack/racetrack | lifecycle/lifecycle/endpoints/health.py | health.py | py | 2,317 | python | en | code | 27 | github-code | 6 |
29128123138 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import embed_video.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tracks', '0006_... | TimBest/ComposersCouch | tracks/migrations/0007_video.py | 0007_video.py | py | 924 | python | en | code | 1 | github-code | 6 |
32742347893 | import requests,time
from bs4 import BeautifulSoup
import p_mysql,json
class jxy_all():
def xunhuan(self,gol_cookies):
wrong = 0
first_run = 0
jishu = 0
toufayu = False
multiple = [1, 3, 7, 15, 31, 63, 127, 34, 55, 89, 144, 1, 1]
maxwrong = 6
global moni
... | ssolsu/newproject | server_jxy.py | server_jxy.py | py | 13,611 | python | en | code | 0 | github-code | 6 |
40253497699 | from django.urls import path
from . import views
app_name = 'chat'
urlpatterns = [
path('', views.index, name='index'),
path('create_room/', views.create_room, name='create_room'),
path('my_rooms/', views.rooms_list, name='rooms_list'),
path('<str:room_name>/', views.room, name='room'),
]
| michalr45/django-chat | chat/urls.py | urls.py | py | 308 | python | en | code | 0 | github-code | 6 |
73790991549 | from typing import List, Tuple
from abstract_puzzles import AbstractPuzzles
DATA_TYPE = List[Tuple[Tuple[int, int], Tuple[int, int]]]
class Puzzles(AbstractPuzzles):
def __init__(self, method_name):
super().__init__(
method_name,
day=4,
puzzle_1_example_answer=2,
... | Lynxens/AdventOfCode2022 | advent_of_code/day4.py | day4.py | py | 1,600 | python | en | code | 4 | github-code | 6 |
20236247442 | # WAP count how many times the word India is repeated
# Get the data from the file
f = open('about_india.txt', "r")
data = f.read()
f.close()
#print(data)
words = data.split(" ")
#print(words)
c = 0
for word in words:
if word == "India":
#print(word)
c = c+1
print(c)
| SreekanthChowdary19/PYCLS | class_examples/EVENING/example8.py | example8.py | py | 293 | python | en | code | 0 | github-code | 6 |
70097868029 | import pygame as pg
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, screen, settings):
super(Ship, self).__init__()
self.screen = screen
self.settings = settings
self.sprite = pg.image.load('./assets/spaceship.png')
self.scale_factor = 10
... | hoangdesu/Alien-Invasion-Pygame | ship.py | ship.py | py | 1,239 | python | en | code | 1 | github-code | 6 |
24199809037 | class Solution:
def maxSubArray(self, nums):
"""
parameter:
nums: list[int]
return: int
"""
temp = nums[0]
max_ = temp
for i in range(1, len(nums)):
if temp > 0:
temp += nums[i]
max_ = max(temp, max_)
... | AiZhanghan/Leetcode | code/53. 最大子序和.py | 53. 最大子序和.py | py | 1,851 | python | en | code | 0 | github-code | 6 |
28857307321 |
import torch
import numpy as np
from six import string_types
from torch import optim
import inspect
import torch.nn as nn
import torch.nn.parallel
from torch.autograd import Variable
import torch.nn.functional as F
from tqdm import tqdm
import copy
def get_function_args( fn ):
"""returns a list of all argum... | divamgupta/pytorch-propane | pytorch_propane/utils.py | utils.py | py | 4,467 | python | en | code | 5 | github-code | 6 |
32872627279 | from SofiPackage.enum_converter import ANSWERS_AND_QUESTIONS
from SofiPackage.db_choise import sample_of_values_to_enum
import random
def choose_from_random(options_dict):
rand = random.randint(0,100)
last_weight = 0
for option in options_dict:
if last_weight <= rand <= options_dict[option]:
... | IdanM75/Sofi | generate_dataset.py | generate_dataset.py | py | 3,039 | python | en | code | 0 | github-code | 6 |
36651482906 | from os import system
while True:
login = str(input("Informe o seu login: "))
senha = str(input("Informe a sua senha: "))
if senha == login:
print("Você não pode usar a mesma palavra em login e senha, pois não é seguro.")
print("Informe uma senha valida!")
else:
print("Você e... | ellencamile/pythonEllen | Excercicios while/Questão1.py | Questão1.py | py | 826 | python | pt | code | 1 | github-code | 6 |
30569513843 | from flask import Flask, render_template, flash, redirect, url_for, session, logging, request
from wtforms import Form, StringField, validators
import Project
import re
app = Flask(__name__)
@app.route("/search")
def search():
return render_template('search.html')
class WordPredictionForm(Form):... | jmgang/wordpredictor | app.py | app.py | py | 1,218 | python | en | code | 0 | github-code | 6 |
17661433287 | from itertools import islice
from collections import defaultdict
def distance(point):
return abs(point[0]) + abs(point[1])
def neighbours(point):
x, y = point
return ((x+1, y), (x-1, y), (x, y+1), (x, y-1),
(x+1, y+1), (x-1, y-1), (x+1, y-1), (x-1, y+1))
def spiral_seq():
yield 0, 0
x... | pdhborges/advent-of-code | 2017/3.py | 3.py | py | 1,231 | python | en | code | 0 | github-code | 6 |
17035306194 | def solve(input_str):
SIZE = 26
OFFSET = 97
a = list(input_str.strip().split()[1:])
result = [0] * SIZE
for char in a:
result[ord(char) - OFFSET] += 1
return " ".join(map(str, result))
print(solve(open(0).read()))
| atsushi0919/paiza_workbook | data_structure/03-02_dict_step2.py | 03-02_dict_step2.py | py | 250 | python | en | code | 0 | github-code | 6 |
5487284095 | import os
import subprocess
from typing import List # noqa: F401
from libqtile import bar, layout, widget, hook
from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
mod = "mod4"
alt = "mod1"
terminal = guess_terminal()
qtile_path =... | AhmedHalim96/dotfiles | .config/qtile/config.py | config.py | py | 7,199 | python | en | code | 0 | github-code | 6 |
10561942242 | # scrip for generation of charging points
#############################################################
import random
rng = random.Random()
import pandas as pd
import sys
import os
#############################################################
def eucl_dist(x1,y1,x2,y2):
return ( (x1-x2)**2 + (y1-y2)**2 )**0.5... | SteffenPottel/td_vrptw_instancegenerator | src/instances/instance_generator.py | instance_generator.py | py | 4,851 | python | en | code | 1 | github-code | 6 |
21071659263 | from enum import Enum
import ffmpeg
import numpy as np
import pandas as pd
import torch
from data_processing.custom_segmentation import CustomSegmentationStrategy
from data_processing.simple_segmentation import SimpleSegmentation
from data_processing.voice_activity_detection import VADSilero
class Method(Enum):
... | centre-for-humanities-computing/Gjallarhorn | data_processing/convert_audiofile_to_segments.py | convert_audiofile_to_segments.py | py | 4,941 | python | en | code | 1 | github-code | 6 |
18015910724 | import os
import numpy as np
import matplotlib.pyplot as plt
import cv2
# Import PyWavelets library
import pywt
import pywt.data
# Load an example image
path = os.path.dirname(__file__)
image_path = "image.jpg"
original_image = cv2.imread(os.path.join(path, image_path), cv2.IMREAD_GRAYSCALE)
# Perform 2D wavelet tra... | kio7/smart_tech | Submission 2/Task_4/wavelet_transform.py | wavelet_transform.py | py | 1,989 | python | en | code | 0 | github-code | 6 |
38265334911 | """
https://www.jianshu.com/p/892ebd063ad9
https://svn.python.org/projects/python/trunk/Objects/listsort.txt
https://hg.python.org/cpython/file/5c1bacba828d/Objects/listobject.c
https://www.infopulse.com/blog/timsort-sorting-algorithm/
https://github.com/RonTang/SimpleTimsort/blob/master/SimpleTimsort.py
是归并排序法和插入排序法的结... | wangbl11/yirobot | a7m/sort/timsort.py | timsort.py | py | 1,266 | python | en | code | 0 | github-code | 6 |
31963305131 | import sys, math
number_list=list(range(0,2*123456+1))
root_number = int(math.sqrt(123456*2))
for i in range(2,root_number+1):
if number_list[i]==0:
continue
target = i+i
while target <= 2*123456:
number_list[target] = 0
target +=i
while True:
N = int(sys.stdin.readline())
if N == 0 :
break
... | yongwoo-jeong/Algorithm | 백준/Silver/4948. 베르트랑 공준/베르트랑 공준.py | 베르트랑 공준.py | py | 465 | python | en | code | 0 | github-code | 6 |
7354238248 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from kouzi_crawler.items import KouziCrawlerItem
class QzkeySpider(CrawlSpider):
name = 'qzkey'
allowed_domains = ['qzkey.com']
start_urls = ['http://mimi1688.aly611.qzkey.com/... | largerbigsuper/kouzi_crawler | kouzi_crawler/spiders/qzkey.py | qzkey.py | py | 1,054 | python | en | code | 0 | github-code | 6 |
42543021370 | # Initial code written by Stevo.
"""Wraps BGT's timer object in Python.
"""
import time
class TimerException(Exception):
"""Raised when an error occurs.
Currently does nothing when raised.
"""
pass
class Timer:
"""Timer object."""
def __init__(self):
"""Initializes the object."""... | trypolis464/ag_py | agpy/timer.py | timer.py | py | 1,710 | python | en | code | 0 | github-code | 6 |
70063372668 | from pwn import *
from LibcSearcher import *
context.log_level = 'debug'
# p=process('./babyconact')
p=remote('t.ctf.qwq.cc',49512)
pause()
elf=ELF('./babyconact')
infos=0x4036E0
backdoor=0x0000000000401722
def show():
p.recvuntil(b'option> ')
p.sendline(b'1')
def create(name,val):
p.recvu... | CookedMelon/mypwn | NPU/babyconact/exp.py | exp.py | py | 1,060 | python | fr | code | 3 | github-code | 6 |
74280993467 | import os
import sys
import threading
import asyncio
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
import discord
client = None
channel = None
ready = False
def init():
global client
global channel
intents = discord.Intents.default()
intents.message_content = True
client = disc... | mojyack/rpi-cat-monitor | remote.py | remote.py | py | 1,161 | python | en | code | 0 | github-code | 6 |
11044907424 | import tkinter
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
from UI import helper_functions as hf
from operations import globalVars
from UI.PCCLI import PCCli
class PCCanvasObject(object):
def __init__(self, canvas, block_name, icons, class_object, master, time_class, load=False):
... | KarimKabbara00/Network-Simulator | UI/PCCanvasObject.py | PCCanvasObject.py | py | 34,256 | python | en | code | 0 | github-code | 6 |
26531202521 | from simplivity.resources.resource import ResourceBase
URL = '/hosts'
DATA_FIELD = 'hosts'
class Hosts(ResourceBase):
"""Implements features available for SimpliVity Host resources."""
def __init__(self, connection):
super(Hosts, self).__init__(connection)
def get_all(self, pagination=False, pa... | HewlettPackard/simplivity-python | simplivity/resources/hosts.py | hosts.py | py | 12,467 | python | en | code | 7 | github-code | 6 |
18602034777 | from django import forms
from bankapp.models import Person, City
GENDER_CHOICES = [
('Male', 'Male'),
('Female', 'Female')
]
MATERIALS_PROVIDE_CHOICE = [
('Debit Card', 'Debit Card'),
('Credit Card', 'Credit Card'),
('Check Book', 'Check Book'),
]
class PersonCreationForm(forms.ModelForm):
gender = forms.Ch... | Manjith123/Easybankproject | bankapp/forms.py | forms.py | py | 2,110 | python | en | code | 0 | github-code | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.