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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
27948166826 | # students_score = {
# "Alex": 89,
# "Beth": 90
# }
# sentence = "what is the Airspeed velocity of an unladen swallow?"
# result = {word: len(word) for word in sentence.split()}
# print(result)
# student_dict = {
# "student":["Angela", "James","Lily"],
# "score": [56, 76, 98]
# }
# # for (key,value) in... | Fidelis-7/100-days-of-coding-in-python | 100-Days/Day_26/main.py | main.py | py | 1,020 | python | en | code | 2 | github-code | 1 |
10663353857 | from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM
from optimum.pipelines import pipeline
from pathlib import Path
class OptimizedM100Model:
def __init__(self, model_path, src_lang, tgt_lang):
model_path = Path(model_path)
assert model_path.exists(), "Model... | dsfsi/masakhane-web | src/m_to_m_models/model_handlers.py | model_handlers.py | py | 1,404 | python | en | code | 34 | github-code | 1 |
72551170595 | """Module test for the multi-agent action model learning."""
from pddl_plus_parser.models import Domain, MultiAgentObservation, ActionCall, MultiAgentComponent, \
GroundedPredicate
from pytest import fixture
from sam_learning.core import LiteralCNF
from sam_learning.learners import MultiAgentSAM
from tests.consts ... | argaman-aloni/sam_learning | tests/multi_agent_sam_test.py | multi_agent_sam_test.py | py | 14,700 | python | en | code | 1 | github-code | 1 |
70506253795 | import logging
import typing
from flask import render_template
import api
import api_types
from soda_api import client, LICENSE_DATASET
log = logging.getLogger(__name__)
def license_lookup(license: str) -> str:
if license:
try:
results = client.get(
LICENSE_DATASET, limit=1... | OrcaCollective/1-312-hows-my-driving | src/dataset.py | dataset.py | py | 2,722 | python | en | code | 3 | github-code | 1 |
5885967657 | test_word = input()
n = int(input())
rhyming = []
for _ in range(n):
rhyming.append(input())
m = int(input())
phrases = []
for _ in range(m):
phrases.append(input())
rhyming = [x.split() for x in rhyming]
phrases = [x.split()[-1] for x in phrases]
truths = []
for rhy in rhyming:
for r in rhy:
... | cliodhnaharrison/kattis | rhyming.py | rhyming.py | py | 643 | python | en | code | 5 | github-code | 1 |
14386432211 | '''
63. ์ ์ ๋ ฌ
๋นจ๊ฐ์์ 0, ํฐ์์ 1, ํ๋์์ 2๋ผ ํ ๋ ์์๋๋ก ์ธ์ ํ๋ ์ ์๋ฆฌ ์ ๋ ฌ์ ์ํํ๋ผ.
Example 1:
Input: nums = [2,0,2,1,1,0]
Output: [0,0,1,1,2,2]
Example 2:
Input: nums = [2,0,1]
Output: [0,1,2]
'''
# ๋ด ํ์ด
class Solution:
def sortColors(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-pl... | hyo-eun-kim/algorithm-study | ch17/taeuk/ch17_6_taeuk.py | ch17_6_taeuk.py | py | 1,040 | python | ko | code | 0 | github-code | 1 |
35441885260 | #! /usr/bin/env python3
import string
import math
message = "The Enigma cipher machine had the confidence of German forces who depended on its security"
key = "3571426"
padding = "X"
stages = 2
key = [int(c) for c in key]
def format_pad_message(msg, key, padding):
message = msg.replace(" ", "").upper()
full_... | finwarman/kcl-y3 | year3/term1/cis/scripts/columnar.py | columnar.py | py | 1,389 | python | en | code | 6 | github-code | 1 |
7954580347 | # -*- coding: utf-8 -*-
import select
import socket as sk
import logging
import common
import terminal
import commands.client
import commands.command
MAX_LOOP_TIME = 0.1 # s
server_ip = ("localhost", 23456)
class Client(common.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kw... | Unprex/python-server | client.py | client.py | py | 3,792 | python | en | code | 0 | github-code | 1 |
26139386529 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import accuracy_score
import category_encoders as ce
import warnings
import sys
import os
import logging
import mlflow
import mlflow.sklearn
import dvc.ap... | nshutijean/DVC-Mlflow-pipeline | train.py | train.py | py | 3,607 | python | en | code | 2 | github-code | 1 |
8975814633 | import os
from re import L
import sys
import numpy as np
from numpy import asarray
import PIL
from PIL import Image, ImageDraw, ImageFont
from PIL.ExifTags import TAGS
np.set_printoptions(threshold=sys.maxsize)
def addition_decode_algo(stego_path):
stego_image = Image.open(stego_path, 'r')
stego_array = np.... | PoornaHegde20/stegWebApp | algo/addition.py | addition.py | py | 4,609 | python | en | code | 0 | github-code | 1 |
36365978443 | import os
import glob
import shutil
import sys
import re
import string
import argparse
import unicodedata
import six.moves.configparser as ConfigParser
from os.path import expanduser
import h5py
import automo.util as util
import subprocess
from distutils.dir_util import mkpath
import logging
# logger = logging.getLog... | decarlof/automo | automo/robo.py | robo.py | py | 8,424 | python | en | code | 1 | github-code | 1 |
23582810441 | #!/usr/bin/python
import sys
def t2a (t):
a = ""
for i in range(0, len(t), 6):
p = 0
for c in t[i:i+6]:
p = p*3 + int(c)
a += chr(p)
return a
print(t2a(sys.argv[1]))
| Iiridayn/sample | ternary2ascii.py | ternary2ascii.py | py | 216 | python | en | code | 0 | github-code | 1 |
10576800492 | from pymongo import MongoClient
# Create a pymongo client
client = MongoClient("localhost", 27017)
# Get the database instance
db = client["mydb"]
# db collection
pytech = db["PyTech"]
# insert 3 students
records = [
{
"student_id": "1007",
"first_name": "Fred",
"last_name": "Jones"
... | taj1395/Python | csd_310/module_5/pytech_insert.py | pytech_insert.py | py | 829 | python | en | code | 0 | github-code | 1 |
31342083253 | # -*- coding: utf-8 -*-
import unittest
from src.logica.Logica_mock import Logica_mock
from src.vista.Vista_lista_actividades import *
from src.logica.cuentas_claras import Listado
from src.modelo.actividad import Actividad
from src.modelo.gasto import Gasto
# from src.modelo.viajero import Viajero
from src.modelo.... | ManuelMasferrer/MISW4101-202111-Grupo57-sandbox | tests/test_actividad.py | test_actividad.py | py | 2,232 | python | es | code | 0 | github-code | 1 |
36214270512 | import click
import joblib
import pandas as pd
import numpy as np
import sklearn
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OrdinalEncoder
from sklearn.impute import KNNImputer
from sklearn.tree import DecisionTreeClassifier
import src
CAT_F... | mikhailmartin/Breast-Cancer | src/models/train_decision_tree_pipe.py | train_decision_tree_pipe.py | py | 2,200 | python | en | code | 1 | github-code | 1 |
27271290016 | '''
hash์ ์ถฉ๋ ๋น๋๊ฐ ๋์์ง๋ฉด
๊ฒ์๊ณผ ์ฝ์
ํจ์จ์ด ๋๋ ค์ง ์๋ฐ์ ์์
๋ฐ๋ผ์ ์ถฉ๋ ๋น๋๋ฅผ ์ค์ด๋๊ฒ ๋ณด๋ค hash table์ ํจ๊ณผ์ ์ผ๋ก ๋ง๋๋ ํค ํฌ์ธํธ
๋ฐฉ๋ฒ
1. ์ ์ฅ ๊ณต๊ฐ์ ํ๋
2. ์ ์ผํ ํด์ฌ ํค๋ฅผ ๋ง๋๋ ํด์ฌ ํจ์๋ฅผ ์ฌ์ฉํ๋ ๋ฒ
: SHA(secure hash algorithm) ์์ ํ ํด์ ์๊ณ ๋ฆฌ์ฆ ์ฌ์ฉ
- ์ด๋ค ๋ฐ์ดํฐ๋ ์ ์ผํ ๊ณ ์ ๋ ํฌ๊ธฐ์ ๊ณ ์ ๊ฐ์ ๋ฆฌํดํด์ค
- ์์ธํ ๋ฐฉ๋ฒ ์๋ ์ฝ๋ #SHA ์ฐธ๊ณ
'''
#SHA
import hashlib
data = 'junit'.encode()
hash_object... | honggom/TIL | data-structure/hash/sha.py | sha.py | py | 888 | python | ko | code | 0 | github-code | 1 |
18270633501 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
# Load the data
train = torch.utils.data.DataLoader(
datasets.MNIST('../data', train=True, download=True,
transform=transforms.Compose([transforms.ToT... | bencarletonn/Intro-to-Deep-Learning | pytorchMNISTmodel.py | pytorchMNISTmodel.py | py | 2,007 | python | en | code | 0 | github-code | 1 |
71392438753 | import numpy as np
def sigmoid(x):
return 1/(1+np.exp(-x))
def sig_deriv(x):
array = []
for i in x:
array.append(sigmoid(i) * (1 - sigmoid(i)))
return np.array(array)
inn,layers = np.loadtxt("./xor.txt",delimiter=",").astype(int),np.loadtxt("./config_Rede.txt",delimiter=",").as... | Cardoso-CHM/MLP-Xor | MLP.py | MLP.py | py | 1,912 | python | en | code | 0 | github-code | 1 |
36930660381 | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from . import servise
from .forms import *
def login_required_decorator(f):
return login_required(f, login_url="login")
# @login_required_decorator
... | islombek-boboyorov/burger | mysite/spicyo/views.py | views.py | py | 2,340 | python | en | code | 0 | github-code | 1 |
36891714649 | from typing import List
def print_array(array: List[List]):
for i in range(0, len(array)):
print(" ".join([str(num) if num >= 10 else '0%s' % num for num in array[i]]))
def spiral(n: int) -> List[List]:
if n == 1:
return [[1]]
start, end = (0, n)
array = [[-1 for i in range(0, n)] fo... | peterehik/scripts | src/spiral.py | spiral.py | py | 2,015 | python | en | code | 0 | github-code | 1 |
20798569158 | import sys
import cv2
import numpy as np
class VideoWriter(object):
def __init__(self, save_path='./video.mp4', fps=25, imsize=(224, 224)):
# encoder(for mp4)
#imsize must be tuplle object
fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
# output file name, encoder, fps, size(fi... | WeLoveKiraboshi/DeepTiltedDepthEstimation | utils/VideoWriter.py | VideoWriter.py | py | 1,247 | python | en | code | 0 | github-code | 1 |
21843626083 | class Solution:
def maxScore(self, arr: List[int], k: int) -> int:
n, total = len(arr), sum(arr)
best = running_sum = sum(arr[:n - k])
for idx in range(n - k, n):
running_sum += (arr[idx] - arr[idx - n + k])
best = min(best, running_sum)
... | uditmanav17/leetcode | 1423-maximum-points-you-can-obtain-from-cards/1423-maximum-points-you-can-obtain-from-cards.py | 1423-maximum-points-you-can-obtain-from-cards.py | py | 340 | python | en | code | 0 | github-code | 1 |
32185064776 | import argparse
import datetime
import random
import socket
import struct
from binascii import hexlify
from copy import copy
from impacket.krb5 import constants
from impacket.krb5.asn1 import AS_REQ, KERB_PA_PAC_REQUEST, seq_set, seq_set_iter, KRB_ERROR, AS_REP, METHOD_DATA, \
ETYPE_INFO2, ETYPE_INFO, PA_ENC_TS_EN... | Amulab/CAudit | plugins/AD/Plugin_AD_Exploit_ASRepRoasting.py | Plugin_AD_Exploit_ASRepRoasting.py | py | 14,610 | python | en | code | 250 | github-code | 1 |
37205567624 | # -*- coding: UTF-8 -*-
from construct import *
from network.packet import PacketHeader
from network.handler import PacketHandler
# Create packet structure
PacketEnterWorld = Struct(
"header" / PacketHeader,
Padding(0x2F8),
"char_index" / Int16ul,
"session_index" / Int16ul
)
# Register packet
PacketHandler.re... | xBrunoMedeiros/wyd-bot | network/incoming/enter_world.py | enter_world.py | py | 378 | python | en | code | 1 | github-code | 1 |
12497455036 | """
Created 18th June 2019
"""
from urllib.parse import urlsplit, parse_qs
class LogLineProcessor:
"""
Class for applying log processing on a line by line basis.
Cleansing of PID data is applied here. Specific keys can
be passed to further processor classes if additional
processing is required.
... | NHSDigital/spine-core-aws-common | spine_aws_common/log/loglineprocessor.py | loglineprocessor.py | py | 3,616 | python | en | code | 11 | github-code | 1 |
2556952859 | import vcf
import numpy as np
def get_all_gt(records: vcf.Reader) -> list:
"""
Receiving all genotype values from vcf.Reader records
:param records: vcf.Reader records
:return: list with all genotype values
"""
all_gt_values = list()
for row in records:
samples = row.samples
... | Mil-m/bioinf-VAF_profile-barcode-mutations | calculate_VAF.py | calculate_VAF.py | py | 4,016 | python | en | code | 0 | github-code | 1 |
12246214497 | '''
Check for 4 repeating numbers in an NxN matrix
row-wise, column-wise or diagonally
Return true if found, else false
'''
def checkio(matrix):
vector = []
cols = list(zip(*matrix))
rows = matrix
for m in matrix:
vector += m
uniques = set(vector)
diagonalsnw, diagonalsne = ... | krkmn/checkio | electronic station/find_sequence.py | find_sequence.py | py | 2,118 | python | en | code | 0 | github-code | 1 |
18248847095 | import requests
from bs4 import BeautifulSoup
import time
# ็ฌๅ็พๅฅณๅฃ็บธ
url = 'https://pic.netbian.com/4kmeinv/'
resp = requests.get(url)
resp.encoding = 'gbk'
tags = BeautifulSoup(resp.text, 'html.parser')
imgs = tags.find('ul', class_='clearfix').find_all('img')
for img in imgs:
imgUrl = url[0:-9] + img.get('src')
... | xshxsh/pythonProject | ็พๅฅณๅฃ็บธ-bs4.py | ็พๅฅณๅฃ็บธ-bs4.py | py | 585 | python | en | code | 0 | github-code | 1 |
17329945888 | """
bid_frame.py represents the abstract frame for different types of auctions.
"""
__author__ = "Max Chan, Nick Chua"
# Library import
from tkinter import *
from datetime import datetime
from abc import ABC
# File import
from Controller.bid_controller import BidController
from View.abstract_frames import AbstractFr... | itsMoxMox/fit3077 | View/abstract_frames/bid_frame.py | bid_frame.py | py | 5,282 | python | en | code | 0 | github-code | 1 |
71015525475 | #!/usr/bin/env python3
"""Get the minimum distance ** 2 among the given points.
>>> main("testcases/test_100000_1")
0
>>> main("testcases/test_10000_1")
144
>>> main("testcases/test_1000_1")
200
>>> main("testcases/test_uniform")
3969
"""
import math
import fileinput
from collections import defaultdict... | yskang/AlgorithmPractice | baekjoon/python/closest_two_point_2261.py | closest_two_point_2261.py | py | 3,400 | python | en | code | 1 | github-code | 1 |
2737478756 | import scrapy
import time
limit = False
infty = 1000000
class Player(scrapy.Item):
name = scrapy.Field()
team = scrapy.Field()
passport = scrapy.Field()
birth_date = scrapy.Field()
height = scrapy.Field()
position = scrapy.Field()
class NewSpider(scrapy.Spider):
name = 'players'
def ... | handedeemirci/Webscraping-PolishBasketballLeague-UW2023 | scrapy/suzuki/spiders/players.py | players.py | py | 1,326 | python | en | code | 0 | github-code | 1 |
71904134113 | import numpy as np
import pyaudio
import wave
#define params manually here
from audio_utils import *
from Audio import *
from debugger import *
def get_zero_string(n):
"""Returns left padded number with zeros for file search
Args:
n (int): document number you want to query
Returns:
string:... | zacharyyamaoka/DE3-Audio | utils/data_utils.py | data_utils.py | py | 5,028 | python | en | code | 0 | github-code | 1 |
26433395460 | import sys
n, m = map(int, sys.stdin.readline().split())
board = []
for _ in range(n) :
row = list(sys.stdin.readline().rstrip())
board.append(row)
row_len_list = []
col_len_list = []
for r in board :
if r.count('#') > 0 :
row_len_list.append(r.count('#'))
# ์ํ์ข์ฐ ๊ฐ๊ฐ์ ๊ธธ์ด์์, ์ต๋์ธก์ ๊ธธ์ด๋ณด๋ค 1์ฉ ์์ ๋ถ๋ถ์ด ... | KimHyungkeun/AlgoPractice | Baekjoon/18242_๋ค๋ชจ๋ค๋ชจ์๋ ฅ๊ฒ์ฌ.py | 18242_๋ค๋ชจ๋ค๋ชจ์๋ ฅ๊ฒ์ฌ.py | py | 885 | python | ko | code | 0 | github-code | 1 |
3015667796 | #external
from coordination.runtime import FeaturesProvider as Provider
from coordination.runtime import Scope
from coordination.wire import Entity
# internal
import coordinators
import entities
class FeaturesProvider(Provider):
@Provider.feature('GUI.Qt')
def Qt(self):
from PyQt4 import QtCore, QtGui... | Evgenus/coordination | test/texteditor/main.py | main.py | py | 2,795 | python | en | code | 1 | github-code | 1 |
16854851533 | """
Pre-Processing
1. The JSON file is processed to extract raw data and store it.
2. Raw data is converted to a data frame and processed to filter non-English characters.
3. Messages containing SHIB and DODGE are kept.
"""
# Libraries
from tqdm import tqdm
import json
import argparse
import pandas as pd
# Creates an... | paritoshsinghrahar/telegram_crawler | preprocessing.py | preprocessing.py | py | 2,447 | python | en | code | 0 | github-code | 1 |
19609182885 | #!/usr/bin/python3
'''This module contains one class, HBNBCommand'''
import cmd
import sys
import models
import json
from models.engine.file_storage import FileStorage
from models.amenity import Amenity
from models.base_model import BaseModel
from models.city import City
from models.place import Place
from models.revi... | komerela/AirBnB_clone_v1 | console.py | console.py | py | 5,397 | python | en | code | 0 | github-code | 1 |
26212538295 | # -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
from datetime import datetime
class AflowzSchoolPolling(models.Model):
_name = 'aflowz.school.polling'
_description = 'Aflowz School Polling'
_inherit = ['mail.thread']
name = fields.Char(requi... | FRFirdaus/aflowz_school | aflowz_school/models/aflowz_school_polling.py | aflowz_school_polling.py | py | 5,583 | python | en | code | 0 | github-code | 1 |
8430419909 | import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
train_data = np.load("E:\\quant_research\\train the rank of ten points\\RNN_point\\data\\train_data_10num.npy")
train_aim = np.loa... | 00wuweimin/rank-ten-types-of-stocks-using-pointer-network | pointer_network.py | pointer_network.py | py | 7,979 | python | en | code | 0 | github-code | 1 |
15780207374 | import tkinter as tk
from tkinter import simpledialog
ROOT = tk.Tk()
ROOT.withdraw()
def is_even(a):
return a % 2 == 0
def simple_gui_input(text='๊ฐ์ ์
๋ ฅํ์ธ์'):
user_input = simpledialog.askstring(title='6. ์ง์์ ํฉ ๊ตฌํ๊ธฐ', prompt=text)
try:
return int(user_input)
except ValueError:
print('์ ํจ... | pinkocto/AS2023 | hw3/lec06_sum_even.py | lec06_sum_even.py | py | 791 | python | ko | code | 0 | github-code | 1 |
27514299411 | from base import Screen
import curses
from math import sin, cos, pi
from time import sleep, strftime
from datetime import datetime
from threading import Lock, Thread
class TimeClock(Screen):
name = 'ๆถ้'
used_pairs = (
(curses.COLOR_BLACK, curses.COLOR_WHITE),
(curses.COLOR_YELLOW, -1),
... | xiaohehao2009/lib | py/clock/builtin_components/timeclock.py | timeclock.py | py | 8,622 | python | en | code | 0 | github-code | 1 |
25745027158 | import tkinter as tk
import sys
class Menu():
def __init__(self,master):
self.master=master
self.master.geometry("330x350")
self.master.title("Blackjack")
self.titleLabel=self.Label(self,text="Blackjack",bg='green',font=("Arial",12),width=25,height=2)
self.title... | kuqiaaa123/Blackjack | Blackjack/c.py | c.py | py | 1,323 | python | en | code | 0 | github-code | 1 |
21967548926 | from GenericTree import *
def isIdentical(tree1, tree2):
if (tree1 or tree2) is None:
return None
q1 = queue.Queue()
q1.put(tree1)
q2 = queue.Queue()
q2.put(tree2)
if tree1.data != tree2.data:
return False
while (not(q1.empty())) and (not(q2.empty())):
node1 = q... | Saumya-svm/Python_DSA | Generic Trees/Structurally Identical.py | Structurally Identical.py | py | 672 | python | en | code | 1 | github-code | 1 |
20297696533 | # Creator: Alexander Ryan
# Task allocated by TradeWeb - Mike Byrne
# Tasks:
# System to cache sovereign bonds consiting of a 4 part string
# Add and cancel orders
# Queries:
# Search for Bond ID
# Return all Bond IDs above a specified quantity (buy and sell)
# Total quantity of orders
# Difference between buy... | AndromRyan/OrderCache | func_chache.py | func_chache.py | py | 7,208 | python | en | code | 0 | github-code | 1 |
29262785888 | import pygame
from pygame.sprite import Sprite
class Alien(Sprite):
"""a single alien class"""
def __init__(self, ai_settings, screen):
"""init alien set"""
super(Alien, self).__init__()
self.screen = screen
self.ai_settings = ai_settings
#load alien image, set it as r... | miasen939/alien_invasion | alien.py | alien.py | py | 745 | python | en | code | 0 | github-code | 1 |
11483540316 | from aws_cdk import core
from aws_cdk import aws_apigateway
class APIDeploymentStack(core.NestedStack):
def __init__(
self,
scope,
*,
rest_api_id,
root_resource_id,
methods=None,
parameters=None,
timeout=None
):
super().__init__(
... | imatw4r/aws-announcement-serverless-api | deployment/stacks/api_deployment.py | api_deployment.py | py | 1,638 | python | en | code | 0 | github-code | 1 |
467656577 | import spotipy
import sys
import pandas as pd
import numpy as np
from spotipy.oauth2 import SpotifyClientCredentials
from get_data import get_audio_features, get_songs, get_playlist_ID, preprocess_data
from model import separate_features, split_data, kNN_model, rf_model, logreg_model, mlp_model
import argparse
import s... | prathik-naidu/Spotify-Music-Analytics | predict.py | predict.py | py | 2,747 | python | en | code | 6 | github-code | 1 |
12828599322 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
4.11 ๅๆถ่ฟญไปฃๅคไธชๅบๅ
Created on 2016ๅนด9ๆ2ๆฅ
@author: wang
'''
xpts = [1, 5, 4, 2, 10, 7]
ypts = [101, 78, 37, 15, 62, 99]
for x, y in zip(xpts, ypts):
print(x, y)
a = [1, 2, 3]
b = ['w', 'y', 'z', 'x']
for x, y in zip(a, b):
print(x, y)
from itertoo... | hejiawang/PythonCookbook | src/four/11.py | 11.py | py | 555 | python | en | code | 0 | github-code | 1 |
26809118520 | #!/bin/env python
import time
from datetime import datetime
import numpy as np
import pandas as pd
from sportsipy.nfl.boxscore import Boxscore, Boxscores
from definitions import (
AGG_DROP_COLS,
AGG_MERGE_ON,
AGG_RENAME_AWAY,
AGG_RENAME_HOME,
AWAY_STATS,
AWAY_STATS_DROP,
ELO_DATA_URL,
... | mitch-avis/nfl-predictor | src/data_collection.py | data_collection.py | py | 17,657 | python | en | code | 0 | github-code | 1 |
36066718460 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 21 11:23:57 2023
@author: athar
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
path = r"C:\Users\athar\OneDrive\Desktop\Machine learning\Projects\SimpleLinearRegressionDataset\HtWt.csv"
df = pd.read_csv(path)
X = df['Height']... | atharvakalele/Machine_Learning | Projects/SImpleLinearRegression_4.py | SImpleLinearRegression_4.py | py | 1,299 | python | en | code | 0 | github-code | 1 |
10957002406 | def appendAndDelete(s, t, k):
# Write your code here
ls = len(s)
lt = len(t)
i = 0
while i < ls and i < lt and s[i] == t[i]:
i += 1
if k >= ls + lt:
return 'Yes'
elif k >= ls + lt - 2*i and (k - ls - lt + 2*i) % 2 == 0:
return 'Yes'
else :
re... | Jaymin28/Hackerrank-Solutions | Append and Delete.py | Append and Delete.py | py | 329 | python | en | code | 0 | github-code | 1 |
72361283873 | '''ะะพัะปะตะดะพะฒะฐัะตะปัะฝะพััั ะคะธะฑะพะฝะฐััะธ ะพะฟัะตะดะตะปัะตััั ัะตะบัััะธะฒะฝัะผ ะฟัะฐะฒะธะปะพะผ:
Fn = Fnโ1 + Fnโ2, ะณะดะต F1 = 1 ะธ F2 = 1.
ะขะฐะบะธะผ ะพะฑัะฐะทะพะผ, ะฟะตัะฒัะต 12 ัะปะตะฝะพะฒ ะฟะพัะปะตะดะพะฒะฐัะตะปัะฝะพััะธ ัะฐะฒะฝั:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 144
ะะฒะตะฝะฐะดัะฐััะน ัะปะตะฝ F12 - ะฟะตัะฒัะน ัะปะตะฝ ะฟะพัะปะตะดะพะฒะฐัะตะปัะฝะพััะธ, ะบะพัะพั... | Leonid-SV/Trainings | Euler Tasks/Euler Task 25.py | Euler Task 25.py | py | 1,344 | python | ru | code | 0 | github-code | 1 |
44649852104 | class Merge:
'''
Merge Sort
- It is a divide and conquer algorithm
- Divide the input array in two halves, and we keep having recursively until they become too small that cannot be broken further
- merge halves by sorting them
Time O(N logN) space O(n)
merge sort is out place algo... | TarakaKoda/Python-Data-Structures-and-Algorithms | 24 - Sorting Algorithms/Sorting Algorithms Techniques/05. Merge Sort.py | 05. Merge Sort.py | py | 1,286 | python | en | code | 0 | github-code | 1 |
18613301846 | import sys
import os
import ctypes
from pdt_uac import *
from pdt_bin_buf import *
from pdt_win_calls import *
from pdt_patch import *
############## first, get admin rights #############
if not is_admin():
get_admin()
#leave commented for now
#useful for debugging
sys.exit()
############### init stu... | gladladvlad/py-dcss-trainer | pdt.py | pdt.py | py | 1,666 | python | en | code | 0 | github-code | 1 |
41506966385 | import numpy as np
# ### K-Nearest Neighbors implementacja ###
# W celu klasyfikacji obliczana jest odlegลoลฤ czyli podobieลstwo od obiektu ktรณry chcemy
# sklasyfikowaฤย do obiektรณw z zestawu testowego.
# Podobieลstwo moลผe byฤย wyliczne w rรณลผny sposรณb w przypadku tej implementacji
# bฤdzie to odlegลoลฤ euklidesowa.
cla... | DonVitoMarco/algorytmy-uczenia-maszynowego | Zadanie06/KNN.py | KNN.py | py | 2,623 | python | pl | code | 0 | github-code | 1 |
12062159317 | #!/usr/bin/env python
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import pandas as pd
#warnings.resetwarnings()
import re
import os
import time
import argparse
import prob_dist as prob
import fano_calc as fc
import resfuncRead as rfr
import time
from argparse impor... | villano-lab/nrFano_paper2019 | python/sig_diff.py | sig_diff.py | py | 6,154 | python | en | code | 2 | github-code | 1 |
26406619282 | import json
import os
import datetime
import tarfile
import torch
import warnings
import copy
import yaml
from . import constants
from ... import utils
from . import datasets
from . import training
from . import compilation
from .params import init_params
from . import descriptions
class ModelRunner():
@classmet... | TexasInstruments/edgeai-modelmaker | edgeai_modelmaker/ai_modules/vision/runner.py | runner.py | py | 11,088 | python | en | code | 9 | github-code | 1 |
15497515273 | class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def deleteNode(self, node):
if not node:
return
elif not node.next:
node = None
return
node.val = node.next.val
... | swave2015/swave-LeetCode | Python/237. Delete Node in a Linked List.py | 237. Delete Node in a Linked List.py | py | 424 | python | en | code | 0 | github-code | 1 |
20191142944 | import datetime as dt
import pytz
import json
import os
from typing import Any, List, Tuple
from operator import attrgetter, itemgetter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pandas_datareader as web
import seaborn as sns
from functools import wraps
from dotenv import load_dotenv... | raphtlw/crypto-price-predictor | src/telegram-bot.py | telegram-bot.py | py | 9,734 | python | en | code | 1 | github-code | 1 |
33160864962 | import asyncio
import copy
import json
import re
import uuid
from datetime import datetime
from async_generator import aclosing
from jupyterhub.utils import maybe_future
from jupyterhub.utils import url_path_join
from traitlets import Callable
from traitlets import Dict
from traitlets import Union
from .backendspawne... | kreuzert/jupyterhub-backendspawner | backendspawner/eventspawner.py | eventspawner.py | py | 10,280 | python | en | code | 2 | github-code | 1 |
70839090593 | import sys
sys.stdin = open('input.txt', 'r')
q = int(input())
for test_case in range(1, q+1):
numbers = input()
cnt = 0
guest = 0
print('#{} '.format(test_case), end='')
guest = int(numbers[0])
for i in range(1,len(numbers)):
#print(i,int(numbers[i]), guest+cnt)
if i > guest +... | ckdfh0917/Algorithm | SW-Expert-Academy/D3/4789. ์ฑ๊ณต์ ์ธ ๊ณต์ฐ ๊ธฐํ.py | 4789. ์ฑ๊ณต์ ์ธ ๊ณต์ฐ ๊ธฐํ.py | py | 428 | python | en | code | 0 | github-code | 1 |
10563716155 | from pathlib import Path
import pytest
import time
import json
import platform
from usb_audio_test_utils import (
check_analyzer_output,
get_xtag_dut,
XrunDut,
XsigInput,
)
from conftest import list_configs, get_config_features
def OS_uncollect(features, board, config):
if (
platform.syst... | xmos/sw_usb_audio | tests/test_loopback.py | test_loopback.py | py | 2,914 | python | en | code | 16 | github-code | 1 |
26409258174 | import cv2
import numpy as np
import math
cap = cv2.VideoCapture(0)
def nothing():
pass
cv2.namedWindow('original')
cv2.createTrackbar('h_min', 'original', 0, 180, nothing)
cv2.createTrackbar('h_max', 'original', 0, 180, nothing)
cv2.createTrackbar('s_min', 'original', 0, 255, nothing)
cv2.createTrackbar('s_ma... | dsponer/opencv_lesson_two | color_space_contours.py | color_space_contours.py | py | 3,156 | python | en | code | 0 | github-code | 1 |
34091916829 | from math import cos, radians
import matplotlib.pyplot as plt
import numpy as np
def finger_path(phase):
"""
If you plot this function it is a graph of the motion of each finger
phase: 0-259, phase the finger is in
returns:
angle: offset angle from finger's step start position
z: heigh... | neutronztar/Pivot | MicroPython/testing/bunga.py | bunga.py | py | 876 | python | en | code | 5 | github-code | 1 |
32205008255 | import librosa
import joblib
import numpy as np
import pandas as pd
from typing import List
# Load the StandardScaler used during training
scaler = joblib.load("./resources/standard_scaler_pytorch_model_last.pkl")
def audio_to_csv(audio) -> List[pd.DataFrame]:
dfs = []
segments = get_3sec_sample(audio)
... | Pindice/Music | modules/preprocessing.py | preprocessing.py | py | 4,246 | python | en | code | 0 | github-code | 1 |
30079951396 | import time
import requests
import pandas as pd
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import json
import os
print("Opening web browser ")
url = "https://www.fifa.com/fifa-world-ranking/men"
option = Options()
option.headless = True
driver =... | mnluan/web_scrapping | rankingFIFA.py | rankingFIFA.py | py | 1,677 | python | en | code | 0 | github-code | 1 |
74736765474 | import json
from typing import TYPE_CHECKING, Optional, Iterable
from boxsdk.object.base_object import BaseObject
from ..pagination.marker_based_object_collection import MarkerBasedObjectCollection
from ..util.api_call_decorator import api_call
if TYPE_CHECKING:
from boxsdk.object.user import User
from boxsdk... | box/box-python-sdk | boxsdk/object/task.py | task.py | py | 2,694 | python | en | code | 395 | github-code | 1 |
10001371754 | import cv2
import numpy as np
from IMP_SD import computeHOGs,get_svm_detector
if __name__ == '__main__':
# ็ฌฌไธๆญฅ่ฎก็ฎHOG็นๅพ
gradien_list = []
labels = []
hard_neg_list = []
# ๆญฃๆ ทๆฌไปฅๅlabelๅฏผๅ
ฅ
# pos_num, gradien_list_pos = computeHOGs('C:\\Users\\SLJ\\Desktop\\OCR_Project\\sample_R')
pos_num, gradi... | SWSWswswZJU/OCR_Relative | TrainHOG.py | TrainHOG.py | py | 2,567 | python | en | code | 0 | github-code | 1 |
39820177774 | class Node:
def __init__(self, value):
self.value = value
self.next = None
self.previous = None
class LinkedList:
def __init__(self):
self.head = None
self.tail = None
def __str__(self):
if self.isEmpty():
return "Empty"
cur, s = self.hea... | 16sakuraa/OOD-Lab | 64010860-Lab5/64010860-5.py | 64010860-5.py | py | 6,883 | python | en | code | 0 | github-code | 1 |
25206615587 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 26 08:24:46 2019
"Brown Corpus Analysis"
@author: Singh Gagan Deep
The Brown Corpus was the first million-word electronic corpus of English,
created in 1961 at Brown University.
This corpus contains text from 500 sources,
and the sources have been... | Gagan40/NLP_Learn | brown_Corpus_Analysis.py | brown_Corpus_Analysis.py | py | 2,217 | python | en | code | 0 | github-code | 1 |
25650917410 | import os
def helloworld():
path = os.path.dirname(__file__)
print('path: ' + path)
f = open(path + '/data2.txt')
# ไธ่กใใค่ชญใฟ่พผใใง่กจ็คบใใ
for name in f.read().splitlines():
message = 'Hello ' + name + ' !'
print(message)
helloworld()
| toshio-shiratori/python-test | lesson1/hello6.py | hello6.py | py | 290 | python | en | code | 0 | github-code | 1 |
38572311065 |
INPUT_FILE = "input"
PART = 2
def is_fully_contained(assignment: str):
sections = [list(map(int, x.split("-"))) for x in assignment.split(",")]
return (sections[0][0] - sections[1][0]) * (sections[0][1] - sections[1][1]) <= 0
def has_overlap(assignment: str):
sections = [list(map(int, x.split... | MPinna/AOC22 | 04/solve04.py | solve04.py | py | 848 | python | en | code | 0 | github-code | 1 |
36170356261 | from typing import Any, Callable, Iterable, List
from volatility3.framework import interfaces, renderers
from volatility3.framework.configuration import requirements
from volatility3.framework.objects import utility
from volatility3.framework.renderers import format_hints
from volatility3.framework.symbols import inte... | volatilityfoundation/volatility3 | volatility3/framework/plugins/linux/pslist.py | pslist.py | py | 7,386 | python | en | code | 1,879 | github-code | 1 |
42643117573 | import shodan
import socket
from pprint import pprint as pp
import json
from openpyxl import Workbook
from openpyxl import styles
import argparse
import sys
from dotenv import load_dotenv
import os
from tqdm import tqdm
parser = argparse.ArgumentParser(
prog='shodanscanner',
description='Simple script to bul... | aerodiduch/shodanscanner | shodanscanner.py | shodanscanner.py | py | 4,339 | python | en | code | 2 | github-code | 1 |
74149748832 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 21 14:18:27 2022
@author: mamun
Face Recognition
Face recognition problems commonly fall into one of two categories:
Face Verification "Is this the claimed person?" For example, at some airports,
you can pass through customs by letting a system scan your passport an... | mamunrushdi/face_recognition | face_recognition.py | face_recognition.py | py | 18,244 | python | en | code | 0 | github-code | 1 |
20567820784 | import etl
import boto3
import io
ny_url = "data/ETL_data.csv"
jh_url = "data/ETL_recovery.csv"
ACCESS_KEY_ID = 'YOUR_ACCESS_KEY_ID'
SECRET_ACCESS_KEY = 'YOUR_SECRET_ACCESS_ID'
filename = 'MyPandasData.'
bucketName = 'mypyfile'
s3_client = boto3.client(
"s3",
aws_access_key_id=ACCESS_KEY_ID,
aws_secret_a... | Gayathrimahe/ETL-aws-cloud-project | lamda.py | lamda.py | py | 861 | python | en | code | 0 | github-code | 1 |
41440466992 | '''
-1, 0, 1 ์ ์ ์ธํ ์ซ์ ๋๊ฐ์ฉ ๋ฌถ๋๋ค
์์๋ ์์๋ผ๋ฆฌ, ์์๋ ์์๋ผ๋ฆฌ ๋ฌถ๋๋ค
์ ๋๊ฐ์ด ํฐ ๋ ์๋ฅผ ๊ณฑํด์ผ ํฌ๊ธฐ๊ฐ ์ปค์ง๋ค.
-๊ฐ ํ๋ ๋จ๊ณ -1 ์ด ์์๋๋ ๊ณฑํด์ +๋ฅผ ๋ํด์ค
-๊ฐ ํ๋ ๋จ๊ณ 0 ์ด ์์๋๋ ๊ณฑํด์ -๋ฅผ ์์ ์ค
** ์ด ์กฐ๊ฑด์ -1,0 ๋ ํฌํจ
====
๋ต์์ ๋ณด๊ณ ์ ๋ฆฌ
์์์ ์์, 0์ ๊ตฌ๋ถํ์ฌ ์ฐ์ ์์ ํ์ ์ ์ฅ
์์
๋๊ฐ์ฉ ๋ฌถ์ผ๋ฉด ๋ํ ๊ฒ๋ณด๋ค ์ปค์ง
1์ด ํฌํจ๋ ๊ฒฝ์ฐ๋ ๋ํ๋ ๊ฒ์ด ํผ
์์
์ ๋... | aszxvcb/TIL | BOJ/boj1744.py | boj1744.py | py | 2,254 | python | ko | code | 0 | github-code | 1 |
9379266210 | # Definition for a binary tree node
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
# @param root, a tree node
# @return a boolean
def isSymmetric(self, root):
if root is None:
... | kuz0/LeetCode | Easy/101-symmetric-tree.py | 101-symmetric-tree.py | py | 1,098 | python | en | code | 0 | github-code | 1 |
7214343538 | import sys
# sys.stdin = open('17592_input.txt')
input = sys.stdin.readline
N = int(input())
x = 0
result = 0
arr = []
for i in range(N) :
arr.append(list(map(int, input().split())))
if arr[0][0] == 0 :
arr.pop(0)
else :
if arr[-1][0] == 0 :
arr.pop()
arr[-1][2] -= 1... | HyunSeok0328/Algo | study problem/๋ฐฑ์ค/17592.py | 17592.py | py | 997 | python | en | code | 0 | github-code | 1 |
18355212386 | from datetime import datetime
import argparse
import kudu
from kudu.client import Partitioning
# Parse arguments
parser = argparse.ArgumentParser(description='Basic Example for Kudu Python.')
parser.add_argument('--masters', '-m', nargs='+', default='localhost',
help='The master address(es) to co... | apache/kudu | examples/python/basic-python-example/basic_example.py | basic_example.py | py | 2,191 | python | en | code | 1,762 | github-code | 1 |
72371652195 | salaries = [1_000, 5_300, 22_000]
# for index, salary in enumerate(salaries):
# salaries[index] = salary + 500
# salaries = [salary - 1000 for salary in salaries]
# print(salaries)
names = ["Kim", "Jim", "Lim"]
# greetings = [f"Hey there {name}" for name in names]
greetings = []
for name in names:
greetings.... | chousemath/wcoding_beginner_python_2022_01_06 | comprehension_01.py | comprehension_01.py | py | 379 | python | en | code | 1 | github-code | 1 |
10805770602 | from data import question_data
from quiz_brain import QuizBrain
import random
class Main:
def __init__(self, index):
self.index = index
def play(self):
self.index = random.randint(0, len(question_data) - 1)
quiz = QuizBrain(self.index)
return quiz.check_answer()
while True:
... | krasenHristov/pythonL | OOP/quiz_game/main.py | main.py | py | 625 | python | en | code | 1 | github-code | 1 |
28522705093 | from BaseUserHandler import *
import datetime as dt
class ResaveExercisesHandler(BaseUserHandler):
async def get(self, course_id, assignment_id):
try:
if self.is_administrator or await self.is_instructor_for_course(course_id) or await self.is_assistant_for_course(course_id):
cou... | srp33/CodeBuddy | front_end/server/handlers/ResaveExercisesHandler.py | ResaveExercisesHandler.py | py | 1,945 | python | en | code | 8 | github-code | 1 |
30342212944 | """
task1 task2ๆฐๆฎ้ ไธค่
็diff
1. queryไพงdiff (่ฎญ็ป้ๅ, query+prodctid+query_locale diff)
2. productไพงdiff (productid + locale diff)
"""
import pandas as pd
import string
import os
import sys
import re, datetime
hashseed = os.getenv('PYTHONHASHSEED')
if not hashseed:
# https://stackoverflow.com/questions/30585108/... | cuixuage/KDDCup2022-ESCI | code_preprocess/data_analysis/task1_task2_diff.py | task1_task2_diff.py | py | 5,495 | python | en | code | 18 | github-code | 1 |
44196525232 | # class book:
# def __init__(self, title, author):
# self.title = title
# self.author = author
#
# def __str__(self):
# return 'ใ%sใ' % self.title
#
# def __call__(self):
# print('ใ%sใ is written by %s' % (self.title, self.author))
#
# if __name__ == "__main__":
# stupidp... | fgfg56784/johnlee | nsd_2018/nsd1811/python2/day4/book.py | book.py | py | 1,081 | python | en | code | 0 | github-code | 1 |
9748320846 | '''
READ THIS!
caption have been exracted into the variable 'caption'
'''
import os
import shutil
from instaloader import Post
import instaloader
url = 'https://www.instagram.com/reel/Ce85ucDFx_F/?utm_source=ig_web_copy_link'
k = url.split("/")
url =... | AnsahMohammad/Hackmanthan | InstaPost.py | InstaPost.py | py | 796 | python | en | code | 0 | github-code | 1 |
31636756521 | from StringIO import StringIO
from lxml import etree
import requests
#NLM DTD is at http://dtd.nlm.nih.gov/archiving/3.0/archivearticle3.dtd
r = requests.get('http://dtd.nlm.nih.gov/archiving/3.0/archivearticle3.dtd')
NLM_DTD = r.text
dtd = etree.DTD(StringIO(NLM_DTD))
root = etree.XML("<foo/>")
print(dtd.validate... | elifesciences/elife-poa-xml-generation | validate.py | validate.py | py | 1,009 | python | en | code | 1 | github-code | 1 |
32613299240 | def binary_search(array, target):
'''Write a function that implements the binary search algorithm using iteration
args:
array: a sorted array of items of the same type
target: the element you're searching for
returns:
int: the index of the target, if found, in the source
-1: if the... | Malkeet12/Data-Structures-Algorithms---udacity-nanodegree | basic_algorithms/binary_search_1.py | binary_search_1.py | py | 1,998 | python | en | code | 0 | github-code | 1 |
70839068193 | q = int(input())
for test_case in range(1, q + 1):
result = 0
print('#{} '.format(test_case), end='')
N, M = list(map(int, input().split()))
arr = []
temp = []
for i in range(N):
temp = list(map(int, input().split()))
arr.append(temp)
# print(arr)
result = 0
for m ... | ckdfh0917/Algorithm | SW-Expert-Academy/D2/2001. ํ๋ฆฌ ํด์น.py | 2001. ํ๋ฆฌ ํด์น.py | py | 604 | python | en | code | 0 | github-code | 1 |
8551639203 | # ๅผๅๆถ้ด๏ผ2022/7/7 13:09
class Settings:
"""ๅญๅจๆธธๆใๅคๆไบบๅ
ฅไพตใ็งๆๆ่ฎพ็ฝฎ็lei"""
def __init__(self):
"""ๅๅงๅๆธธๆ็้ๆ่ฎพ็ฝฎ"""
# ๅฑๅน่ฎพ็ฝฎ
self.screen_width = 1200
self.screen_height = 800
self.bg_color = (230, 230, 230)
# ้ฃ่น่ฎพ็ฝฎ
self.ship_limit = 3
# ๅญๅผน่ฎพ็ฝฎ
self.bullet_w... | dingwapi123/python_test | alien_invasion/settings.py | settings.py | py | 1,409 | python | en | code | 0 | github-code | 1 |
4966719236 | from setuptools import setup, find_packages
version = '0.0.1'
setup(name="helga-naked-ping",
version=version,
description=('annoy users who insist (or have no idea) on naked pings'),
classifiers=['Development Status :: 1 - Beta',
'Environment :: IRC',
'Intended ... | alfredodeza/helga-naked-ping | setup.py | setup.py | py | 1,022 | python | en | code | 0 | github-code | 1 |
15651033397 | # -*- coding: utf-8 -*-
short_list = [1, 2, 3]
while True:
value = input('็ดขๅผ[q้ๅบ]:')
if value == 'q':
break
try:
pos = int(value)
print(short_list[pos])
except IndexError as err:
print('้่ฏฏ็็ดขๅผ๏ผ', pos)
except Exception as other:
print('้่ฏฏ๏ผ', other)
| ivix-me/note-introducing-python | ch04/0411/short_list_1.py | short_list_1.py | py | 336 | python | en | code | 0 | github-code | 1 |
36068249065 | from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm
from django.forms import TextInput, EmailInput, PasswordInput
from cloudinary.forms import cl_init_js_callbacks
class SignupForm(UserCreationForm):
class Meta(UserCreationForm.Meta):... | clara-lancelle/shareyourplate | authentication/forms.py | forms.py | py | 832 | python | en | code | 0 | github-code | 1 |
44750216174 | class Solution:
dic = {"2": ["a", "b", "c"], "3": ["d", "e", "f"], "4": ["g", "h", "i"], "5": ["j", "k", "l"], "6": ["m", "n", "o"], "7": ["p", "q", "r", "s"], "8": ["t", "u", "v"], "9": ["w", "x", "y", "z"]}
def letterCombinations(self, digits: str) -> List[str]:
result = []
def helper(digits, ... | kingtheoden/leet-code | solutions/0017 - Letter Combinations of a Phone Number/phone_letters.py | phone_letters.py | py | 599 | python | en | code | 0 | github-code | 1 |
22801704554 | import pygame,sys,math,time,copy,datetime,json
import numpy as np
SCREEN_WIDTH = 500
SCREEN_HEIGHT = 500
WHITE = (255, 255, 255)
ORANGE = (255, 127, 0)
BLACK = (0, 0, 0)
G = 6.673 * 1e-11
M_SUN = 1.98892e+30
M_EARTH = 5.9722e+24
camSize = 1
def add_h(arg):
h = 1e-6
return int(arg/(camSize+h))
def addTwo... | unknownbox-collab/gargantua | main.py | main.py | py | 8,166 | python | en | code | 0 | github-code | 1 |
39571750898 | import json
class json_setting:
def __init__(self, file:str) -> None:
self.file = file
def loging(self, massage) -> None:
with open('history.txt', 'a+') as file:
file.write(f'{massage}\n')
def get_json(self) -> dict:
with open(f"{self.file}", "r+") as json_file:
... | KASSAS20/learn_python | inventory_JSON/main.py | main.py | py | 2,219 | python | en | code | 0 | github-code | 1 |
10110617943 | #!/usr/bin/env python3
"""
Download JENDL data from JAEA and convert it to a HDF5 library for
use with OpenMC.
"""
import argparse
import ssl
from multiprocessing import Pool
from pathlib import Path
from urllib.parse import urljoin
import openmc.data
from openmc_data import download, extract, process_neutron, state... | openmc-data-storage/openmc_data | src/openmc_data/generate/generate_jendl.py | generate_jendl.py | py | 4,581 | python | en | code | null | github-code | 1 |
24808861508 | # https://github.com/rdegges/pelican-minify
# Not used anymore, see gulpfile.js at root
import os
import htmlmin
import rcssmin
import jsmin
import pelican
def minify_html(filename):
with open(filename, 'r') as f:
# Read file to minify
uncompressed = f.read()
with open(filename, 'w') as f:
... | lucas-santoni/blog.geographer.fr | plugins/minify/minify.py | minify.py | py | 1,909 | python | en | code | 4 | github-code | 1 |
25650715659 | from django.contrib import admin
from repairshop.models import SubCategory
# Class to control how to display SubCategory on admin page
class SubCategoriesAdmin(admin.ModelAdmin):
list_display = ["name", "url", "position", "image", "blank"]
list_display_links = ["name"]
list_editable = ["position"]
se... | bmyronov/eremont | repairshop/admin/sub_category.py | sub_category.py | py | 482 | python | en | code | 0 | github-code | 1 |
13387915055 | from fixture import DataSet
from datetime import datetime, date, time
class UserData(DataSet):
class LoggedInUser:
id = 101
username = "test_public"
first_name = "TestPublic"
last_name = "Public",
email = "test.public@parthenonsoftware.com"
raw_password = "password"... | fenriz07/flask-hippooks | hipcooks/fixtures.py | fixtures.py | py | 7,044 | python | en | code | 2 | github-code | 1 |
11479906122 | from flask import Flask, request
import argparse
import boto3
import json
from tqdm import tqdm
# Set up the Flask app
app = Flask(__name__)
# Set the values of the configuration, destination, and files variables
config = ""
dest = ""
files = []
@app.route("/", methods=["GET", "POST"])
def index():
if request.me... | OrShmuel22/boto3_searchfile | s3_search.py | s3_search.py | py | 2,531 | python | en | code | 0 | github-code | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.