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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
5420361638 | import pandas as pd
from math import log
from init_var import *
#-----------------------------------------------------------------------------#
all_term = []
with open('all_term.txt', 'r') as all_term_file:
for line in all_term_file:
term = line.split()[0]
all_term.append(term)
tf_matrix = [[0] ... | Hansimov/info-theory-proj | proj-1/calc_tfidf.py | calc_tfidf.py | py | 2,481 | python | en | code | 0 | github-code | 36 |
35197943498 | import sys
import IPython
import numpy as np
import pprint as pp
from IPython.display import display
import sklearn
import matplotlib.pyplot as plt
from MembershipFunc import MemberFunc
# import Membership
class FuzzyLogic(object):
"""docstring for FuzzyLogic."""
def __init__(self, data2tes):
super(Fuz... | fianekame/ComputationalIteligence | Fuzzy/Manual/main.py | main.py | py | 6,526 | python | en | code | 0 | github-code | 36 |
32316213655 | import time
import threading
import logging
import traceback
import datetime
import os
import sys
import re
import robotparser as rp
import numpy as np
import random
import util
import decide
import queries
from conn import connect
class Crawler:
'''
Abstract class for crawling a news source.
'''
###... | bentruitt/TopicStory | topicstory/crawler/crawler.py | crawler.py | py | 8,339 | python | en | code | 0 | github-code | 36 |
71399122025 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
import time
driver = webdriver.Firefox()
driver.get('https://github.com/Vidoosh/Image-colorizer')
time.sleep(2)
code = driver.find_element(By.CSS_SELECTOR, '#re... | sravanithummapudi/st | download_button.py | download_button.py | py | 901 | python | en | code | 0 | github-code | 36 |
11876743553 | # 数据预处理 阴影过滤
#yangzhen
#2020.4.13
#translate from matlab
"""get the shadow proportion from images
of remote sensing"""
import numpy as np
import cv2
import os
import json
from shutil import copyfile
import argparse
def cv_imread(file_path):
cv_img=cv2.imdecode(np.fromfile(file_path,dtype=np.uint8),1)
retur... | jansona/GeoScripts | shadow_filter/shadowfilter.py | shadowfilter.py | py | 4,966 | python | en | code | 0 | github-code | 36 |
2986896269 | import os
import h5py
import numpy as np
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
if 'KAGGLE_BASE_URL' in os.environ:
challen... | felix-20/gravitational_oceans | src/helper/utils.py | utils.py | py | 5,376 | python | en | code | 1 | github-code | 36 |
23313577208 | import argparse
import gym
import random
import tensorflow as tf
import numpy as np
from tqdm import trange
from tensorflow import keras
from network import SharedModel
from subproc_env import EnvActor, SubProcessEnv
# Some parameters taken from OpenAI
# baselines implementation, since
# they're not mentioned in the... | james-sorrell/reinforcement_learning | atari/ppo/main.py | main.py | py | 4,674 | python | en | code | 2 | github-code | 36 |
39209701807 | # Create your views here.
from django.shortcuts import render
from team.models import Player
from django.shortcuts import render, get_object_or_404, redirect, render_to_response
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
def home(request):
context = {'message': 'Here is a message!'}
... | carolinp/Project-1 | team/views.py | views.py | py | 890 | python | en | code | 0 | github-code | 36 |
36872129562 | #! /usr/bin/python3
# -*- coding:utf-8 -*-
from flask import Flask, request, render_template, redirect
import json
import os
app = Flask(__name__)
@app.route('/')
def accueil():
if os.path.exists("db")==False:
os.mkdir("db")
return render_template('index.html')
@app.route('/formule')
def repon... | yahyalazaar/audit_project | __init__.py | __init__.py | py | 7,848 | python | en | code | 0 | github-code | 36 |
7784263631 | import twitter
class pytwitter_forecast(NebriOS):
listens_to = ['forecast_date']
def check(self):
return True
def action(self):
auth = twitter.OAuth(shared.ttoken, shared.ttoken_secret, shared.tconsumer_key, shared.tconsumer_secret)
t = twitter.Twitter(auth=auth)... | bandono/nebri | tweet_rain/pytwitter_forecast.py | pytwitter_forecast.py | py | 874 | python | en | code | 0 | github-code | 36 |
39184736012 | ####################### IMPORT LIBRARIES ####################################
from pandas import ExcelFile, read_excel
from pandas import datetime
from sklearn.metrics import mean_squared_error
from math import sqrt
import matplotlib.pyplot as plt
import warnings
from hmmlearn.hmm import GaussianHMM
import numpy as np
... | srihari1212/bloqq | HMM/Docstring_HMM_test.py | Docstring_HMM_test.py | py | 4,173 | python | en | code | 0 | github-code | 36 |
20170707726 | from dumpulator import Dumpulator
from pwn import *
import inspect
import sys
"""
.rdata:010F3C7C xmmword_10F3C7C xmmword 0BACA7A0A1B6B4A5BAEAEFF6B5B1B1BDAh
.rdata:010F3C7C ; DATA XREF: dga+6Er
.rdata:010F3C8C xmmword_10F3C8C xmmword 2818CF8A0A988AAE2B4A7BAE8AAA6ABEh
.rdata:010F... | SpiralBL0CK/ZERO2AUTO-CUSTOM-SAMPLE-SOLUTION | stage2_decrypt_strings_mal_analysis_corse.py | stage2_decrypt_strings_mal_analysis_corse.py | py | 10,493 | python | en | code | 0 | github-code | 36 |
18482541642 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .utils import weight_reduce_loss
class FocalLoss(nn.Module):
def __init__(self,
use_sigmoid=True,
gamma=2.0,
alpha=0.25,
reduction='mean',
loss_weight=1.0):
... | TWSFar/FCOS | models/losses/focal_loss.py | focal_loss.py | py | 1,798 | python | en | code | 1 | github-code | 36 |
16828444501 | from flask import Flask,request
import sqlite3
app = Flask(__name__)
connection = sqlite3.connect('sms.db')
curser = connection.cursor()
curser.execute('create table if not exists students (sid integer primary key,name text,age integer,address text)')
connection.close()
@app.route('/student_details')
def details():... | mubarakdalvi/mubarakdalvi | studnt_management.py | studnt_management.py | py | 868 | python | en | code | 0 | github-code | 36 |
74612380905 | import tkinter
win = tkinter.Tk()
win.title("hanyb")
win.geometry("400x400+200+0")
# 菜单条
menubar = tkinter.Menu(win)
win.config(menu=menubar)
# 创建一个菜单选项
menu1 = tkinter.Menu(menubar, tearoff=False)
# 给菜单选项添加内容
for item in ["Python","R","C","C++","Java","shell","c#","JS","PHP","汇编","NodeJS","quit"]:
if item =="q... | hanyb-sudo/hanyb | tkinter/tkinter组件/16、Menu顶层菜单.py | 16、Menu顶层菜单.py | py | 850 | python | en | code | 0 | github-code | 36 |
73532863784 | if __name__ is not None and "." in __name__:
from .SkylineParser import SkylineParser
from .SkylineVisitor import SkylineVisitor
from .Skyline import Skyline
else:
from SkylineParser import SkylineParser
from SkylineVisitor import SkylineVisitor
from Skyline import Skyline
class EvalVisitor(Sk... | anunez0/SkylineBot | cl/EvalVisitor.py | EvalVisitor.py | py | 3,416 | python | en | code | 0 | github-code | 36 |
31065907035 | students = ['Mosh', 'musa', 'uthman', 'khalil', 'mustafa']
for s in students:
print(s)
numbers = [1, 2, 3, 45, 66, 55, 9, 900]
sum = 0
for n in numbers:
sum = sum + n
print(sum)
name = 'Uthman'
for s in name:
print(s)
number = [1, -2, -9, 8, 7, -6]
for n in number:
if n >=0:
print(n)
| itcentralng/python-class-july-2022 | Practice/Bukar/aug17_bukar.py | aug17_bukar.py | py | 320 | python | en | code | 0 | github-code | 36 |
8573106133 | total = 0
count = 0
while True :
inp = input('Enter Number: ')
if inp == 'done' : break
value = float(inp)
total = total + value
count = count + 1
average = total / count
print('Average:', average)
#This is a loop that takes the average of a bunch of
#numbers, and then spits out the total, but can... | BunggoyLearn/Test | Averager.py | Averager.py | py | 935 | python | en | code | 0 | github-code | 36 |
38072060455 | from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.cores.clock import *
from litex.soc.interconnect.csr import *
from litex.soc.cores.prbs import PRBSTX, PRBSRX
from litex.soc.cores.code_8b10b import Encoder, Decoder
from liteiclink.transceiver.gtx_7series_init import GTXTXIn... | kamejoko80/linux-on-litex-vexriscv-legacy | liteiclink/liteiclink/transceiver/gtx_7series.py | gtx_7series.py | py | 47,116 | python | en | code | 0 | github-code | 36 |
37986696093 | """
This script is written to do analysis on GA study
"""
# import libraries
import re
import tsfresh
import numpy as np
import pandas as pd
from pandas import ExcelWriter
from sklearn.preprocessing import LabelBinarizer
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("darkgrid")
... | emilymacq/Project-Clear-Lungs | Parkinsons_ML/main/Study_Ga.py | Study_Ga.py | py | 12,820 | python | en | code | 2 | github-code | 36 |
27770003302 | import numpy as np
import pandas as pd
import matplotlib
import metrics
import sklearn
import xgboost
from sklearn import metrics
from decimal import *
import graphviz
'''
新細明體:PMingLiU
細明體:MingLiU
標楷體:DFKai-SB
黑体:SimHei
宋体:SimSun
新宋体:NSimSun
仿宋:FangSong
楷体:KaiTi
仿宋_GB2312:FangSong_GB2312
楷体_GB2312:KaiTi_GB2312
微軟正黑體... | kshsky/PycharmProjects | machinelearning/tools/mlTools.py | mlTools.py | py | 8,384 | python | en | code | 0 | github-code | 36 |
3458272947 | # -*- coding: utf-8 -*-
# @Time : 2020/6/1 16:16
# @Author : piguanghua
# @FileName: binary_search.py
# @Software: PyCharm
#titile:binary-search
#Number:704
class Solution:
#def search(self, nums: List[int], target: int) -> int:
def search(self, nums, target):
start = 0
end = len(nums) - 1... | pi408637535/Algorithm | com/study/algorithm/binary_search/binary_search.py | binary_search.py | py | 905 | python | en | code | 1 | github-code | 36 |
71002375784 | """
46. Faça um programa que leia um número inteiro positivo de três digitos (de 100 a 999),
Gere outro número formado pelos dígitos invertidos do número lido
"""
try:
valor = int(input('Insira um três digitos inteiros (de 100 a 999): '))
if (valor >= 100) and (valor <= 999):
x = str(valor)
... | Kaiquenakao/Python | Variáveis e Tipos de Dados em Python/Exercicio46.py | Exercicio46.py | py | 516 | python | pt | code | 5 | github-code | 36 |
40586478771 | from fastapi import APIRouter, Depends, status
from sqlalchemy.ext.asyncio import AsyncSession
from src.authentication import AuthModel, get_token_user
from src.core.exceptions import UnprocessableEntityException
from src.db.postgres import get_db
from .dependencies import get_token_parent
from .parents.crud import pa... | Xewus/KidEdVisor | backend/src/parents/router.py | router.py | py | 1,626 | python | en | code | 0 | github-code | 36 |
74649269864 | # -*- coding: utf-8 -*-
# @Project : selenium_event
# @File : test_alert.py
# @Software: PyCharm
# @Author : Lizhipeng
# @Email : 1907878011@qq.com
# @Time : 2021/9/26 17:16
from selenium.webdriver import ActionChains
from seleium_study.selenium_js.base import Base
class TestAlert(Base):
def test_alert(... | iospeng/python | pycharm_demo/selenium_event/seleium_study/selenium_file_alert/test_alert.py | test_alert.py | py | 1,036 | python | en | code | 0 | github-code | 36 |
2391690633 | from threading import Thread
from flask import Flask, request, redirect, session, render_template, send_file, Response, flash
from flask_session import Session
import os, json
from bs4 import BeautifulSoup, SoupStrainer
import requests, lxml, cchardet
app = Flask('')
app.config["SESSION_PERMANENT"] = False
app.confi... | CoolCoderSJ/DataPak | main.py | main.py | py | 17,220 | python | en | code | 3 | github-code | 36 |
11904574293 | def printGrid(grid):
for row in grid:
print("".join([str(i) for i in row]))
def copyGrid(grid):
return [row.copy() for row in grid]
def isInRange(grid, r, c):
return r >= 0 and r < len(grid) and c >= 0 and c < len(grid[0])
def flash(grid, alreadyFlashed, r, c):
if grid[r][c] <= 9 or (r, c) in... | ianlayzer/adventofcode2021 | code/11.py | 11.py | py | 1,607 | python | en | code | 0 | github-code | 36 |
12676975577 | import mlflow
import dvc.api
import pandas as pd
def yield_artifacts(run_id, path=None):
"""Yield all artifacts in the specified run"""
client = mlflow.tracking.MlflowClient()
for item in client.list_artifacts(run_id, path):
if item.is_dir:
yield from yield_artifacts(run_id, item.path)... | robert-min/bike_share_mlflow | model/utils.py | utils.py | py | 1,317 | python | en | code | 0 | github-code | 36 |
17579968573 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from numpy import *
import sys
file_name = sys.argv[1]
data1 = loadtxt("./" + file_name)
NUM=data1[:,0] #
TIME=data1[:,1] #
fig = plt.figure() #
top = fig.add_subplot(111) # 1 riga, 1 colonna, figura 1
top.set_title('BRUTE FORCE')
top.grid... | UnProgrammatore/CCQ | altre_cose/fattorizzazione_mpi_banale_print/plot.py | plot.py | py | 480 | python | en | code | 0 | github-code | 36 |
27511187637 | a=["Arun","Sri","Kavi"]
b=["male","female","female"]
c=["married","married","single"]
for i in range(0,len(a)):
if(b[i]=="male"):
print("mr:",a[i])
elif(c[i]=="single"):
print("Ms:",a[i])
else:
print("Mrs:",a[i])
| kavi234/GUVI | Zen Class/day 8/listif.py | listif.py | py | 259 | python | en | code | 0 | github-code | 36 |
11029799743 |
def fun(*args):
res = sum(args)
return res
def my_range(*args):
if len(args) == 1:
start = 0
stop = args[0]
step = 1
elif len(args) == 2:
start = args[0]
stop = args[1]
step = 1
elif len(args) == 3:
start = args[0]
stop = args[1]
... | pymft/mft-vanak-archive-october-2018 | S05/functions/test.py | test.py | py | 404 | python | en | code | 0 | github-code | 36 |
34189683080 | #!/usr/bin/env python
# coding: utf-8
# # Pandas Lab Exercise
#
#
# ## Part - 1
# We shall now test your skills in using Pandas package. We will be using the [games Dataset](https://www.kaggle.com/gutsyrobot/games-data/data) from Kaggle.
#
# Answer each question asked below wrt the games dataset.
# ** Import pand... | Pragati-Gawande/100-days-of-code | Day_13/Kaggle Games Dataset.py | Kaggle Games Dataset.py | py | 1,876 | python | en | code | 5 | github-code | 36 |
26823163714 | from math import trunc
a = 159 # Key 1
b = 580 # Key 2
n = 26 # Alphabet size
plaintext = 'no' # Plaintext
def encrypt(a,b,n,plaintext):
alphabet = None
ciphertext = ''
p = 0
if(n == 26):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
elif(n == 45):
alphabet = 'abdefghijklmnopqrstuvwxyz!£... | PadraigHalstead/Cryptography | Ciphers/Classical */Affine Cipher */Strengthened Affine */Encrypt.py | Encrypt.py | py | 858 | python | en | code | 0 | github-code | 36 |
31982185532 | import requests
from bs4 import BeautifulSoup
from datetime import datetime
import os.path
import csv
import threading
from queue import Queue
# Proxies for BURP - update requests if you want to use this proxy
proxies = {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}
playersFile = 'sample_corrected... | zcrosman/PDGAscrape | PDGAscrape.py | PDGAscrape.py | py | 9,296 | python | en | code | 0 | github-code | 36 |
17891621206 | __author__ = 'rogermao'
class person:
def __init__(self,name):
self.name = name
self.gender = ""
self.conflictDates = []
self.experience = -1
self.largeGroup = True
self.nineThirty = True
self.twelveThirty = True
self.largeGroupCount = 0
self... | toheebster/welcoMe | Person.py | Person.py | py | 621 | python | en | code | 0 | github-code | 36 |
73712141864 | from typing import Dict, Any
from argus.processors.post_processors.utils import post_process as pp
from h2o_docai_scorer.post_processors.post_processor_supply_chain import PostProcessor as PostProcessorSupplyChain
class PostProcessor(PostProcessorSupplyChain):
"""Represents a last step in pipeline process that re... | h2oai/docai-recipes | post_processor/v0.6/post_processor_4.py | post_processor_4.py | py | 1,636 | python | en | code | 4 | github-code | 36 |
28436305539 | import socket
import subprocess
import json
import os
import base64
import sys
import shutil
import time
import requests
from termcolor import colored
from mss import mss
def reliable_send(data):
json_data=json.dumps(data)
sock.send(json_data.encode('utf-8'))
def reliable_recv():
data=''
while True:
... | sharshith1312/reverse_shell | rstest1.py | rstest1.py | py | 5,215 | python | en | code | 0 | github-code | 36 |
43314571963 | import requests
def getweather(city):
api = "96e3cd3e19571466a39662b984eec5f1"
server = "https://api.openweathermap.org/data/2.5/weather"
request = f"{server}?q={city}&appid={api}"
output = requests.get(request)
if output.status_code == 200:
weather_data = output.json()
weather = w... | XBOPb/Projects | API_Weather_App/weatherAPI.py | weatherAPI.py | py | 821 | python | en | code | 0 | github-code | 36 |
40286818253 | # типы данных и переменная
# int, float, boolean, str, list, None
# value = None
# print(type(value))
# a = 123
# b = 1.23
# print(a)
# print(b)
value = 12334
# print(type(value))
# s = 'hello nworld'
# print(s) # вывод строки
# print(a, ' - ', b, ' - ', s)
# print('{1} - {2} - {0}'.format(a, b, s)) # формат
# print(f... | stannavi/python_intro_sborisovsky | lections/lec1.py | lec1.py | py | 1,822 | python | ru | code | 0 | github-code | 36 |
19530926102 | """
Projeto Marinha do Brasil
Autor: Pedro Henrique Braga Lisboa (pedro.lisboa@lps.ufrj.br)
Laboratorio de Processamento de Sinais - UFRJ
Laboratorio de de Tecnologia Sonar - UFRJ/Marinha do Brasil
"""
from __future__ import print_function, division
import os
import h5py
import warnings
import numpy a... | pedrolisboa/poseidon | poseidon/io/offline.py | offline.py | py | 6,116 | python | en | code | 2 | github-code | 36 |
1947313325 | import unittest
import pathlib
import typing
import kclvm.compiler.parser.parser as parser
import kclvm.tools.docs.doc_parser as doc_parser
import kclvm.kcl.types.checker as type_checker
import kclvm.api.object as obj_pkg
import kclvm.tools.docs.model_pb2 as model
_DIR_PATH = pathlib.Path(__file__).parent.joinpath("... | kcl-lang/kcl-py | test/test_units/test_kclvm/test_tools/test_doc/test_checker.py | test_checker.py | py | 2,149 | python | en | code | 8 | github-code | 36 |
15386994551 | #!/usr/bin/env python3
"""게임과 론처를 묶어서 새 앱 프로토콜 버전을 서명한 뒤 패키지로 생성한다."""
import argparse
import os
import os.path
import logging
import shutil
import tarfile
import tempfile
import zipfile
from zipfile import ZIP_DEFLATED
parser = argparse.ArgumentParser(description=__doc__.replace('\n', ' '))
parser.add_argument('out_... | FioX0/PandoraReborn | tools/pack/pack.py | pack.py | py | 3,340 | python | en | code | 0 | github-code | 36 |
4130563060 | import os
import os.path
# example user input C:\Users\<yourownusername>\Desktop
while True:
dir = input('Input the path file:')
if dir == '': break
if os.path.isdir(dir):
file_types = {}
file_size = {}
for r,d,f in os.walk(dir):
for fi in f:
... | AlexandrosPanag/My_Python_Projects | OS/OS_File_Format.py | OS_File_Format.py | py | 610 | python | en | code | 1 | github-code | 36 |
12087004714 | from sklearn.feature_extraction.text import TfidfVectorizer
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import spacy,os
import argparse
import re
from tqdm import tqdm
from collections import OrderedDict
import string
import numpy as np
from spacy.lang.en import En... | Law-AI/summarization | extractive/MMR/MMR.py | MMR.py | py | 4,098 | python | en | code | 139 | github-code | 36 |
10156278888 | from turtle import Turtle
FONT = ("Courier", 24, "normal")
ALIGNMENT = "center"
class Scoreboard(Turtle):
def __init__(self):
super().__init__()
self.score = 0
self.level = 1
self.penup()
self.hideturtle()
self.color("white")
with open("high_score.txt", "r"... | vaughnhamill/breakout-game | scoreboard.py | scoreboard.py | py | 1,106 | python | en | code | 0 | github-code | 36 |
71673325543 | import gc
import pandas as pd
import numpy as np
from .order import simulate_lqe_model
from .order import (
simulate_batch_lqe_model,
simulate_batch_from_order_func_low_param,
)
from .strategies.components.statistics import (
score_results, return_results, _weighted_average
)
def pairs_cross_validator(
... | jaythequant/VBToptimizers | optimizers/simulations/cv_orders.py | cv_orders.py | py | 5,840 | python | en | code | 2 | github-code | 36 |
11936036688 | from typing import Any, Optional, TYPE_CHECKING
import logging
from ..common.utils import deepmerge
from .execution_method import ExecutionMethod
from .aws_settings import INFRASTRUCTURE_TYPE_AWS, AwsSettings
if TYPE_CHECKING:
from ..models import (
Task,
TaskExecution
)
logger = logging.getLog... | CloudReactor/task_manager | server/processes/execution_methods/aws_base_execution_method.py | aws_base_execution_method.py | py | 3,685 | python | en | code | 0 | github-code | 36 |
3219242168 | import sys
sys.path.append('../VQ-VAE')
from auto_encoder2 import VQ_CVAE
import argparse
from torch import optim
from torchvision import transforms
import fpa_dataset
parser = argparse.ArgumentParser(description='Train an autoencoder for hand depth image reconstruction')
parser.add_argument('-r', dest='dataset_root_f... | pauloabelha/handy | train_autoencoder.py | train_autoencoder.py | py | 2,275 | python | en | code | 2 | github-code | 36 |
16627028163 | #!/bin/python3
import sys
def isBalanced(s):
if(len(s)) == 0:
return True
pairing = {"{": "}", "(":")", "[":"]"}
first = s[0]
try:
match = pairing[first]
except:
return False
openings = 0;
for i in range(1, len(s)):
if s[i] == first:
openings += 1
elif s[i] == match and openi... | mark-wiemer/hacker-rank | BalancedBrackets/balanced_brackets.py | balanced_brackets.py | py | 671 | python | en | code | 0 | github-code | 36 |
13988738028 | class Solution:
def twoSumLessThanK(self, A: List[int], K: int) -> int:
A.sort()
i = bisect_left(A, K)
if i == 0 and A[i] == K:
return -1
elif i == len(A) or A[i] > K:
i -= 1
ans = -1
for j in range(i, -1, -1):
target = K - A[j] - 1... | dariomx/topcoder-srm | leetcode/trd-pass/easy/two-sum-less-than-k/two-sum-less-than-k.py | two-sum-less-than-k.py | py | 593 | python | en | code | 0 | github-code | 36 |
40144939486 | from flask import request
from werkzeug.utils import secure_filename
from db import db
from models import Img
def upload_images(pic_list, private, user_id):
#import pdb; pdb.set_trace()
for pic in pic_list:
filename = secure_filename(pic.filename)
mimetype = pic.mimetype
if not filen... | elmanreasat/imagipy | controllers/upload.py | upload.py | py | 573 | python | en | code | 0 | github-code | 36 |
26908641087 | import unittest
from models import UserTokens, UserDetails
class TokenTest(unittest.TestCase):
def test_user_token(self):
user='gbabun@gmail.com'
ud=UserDetails.gql('WHERE instapaper_account = :1' , user).get()
#self.assertTrue(ud is not None)
token=UserTokens()
#token.user_details=ud
token.put()
| bojanbabic/Instaright | backend/test/tokens_test.py | tokens_test.py | py | 312 | python | en | code | 1 | github-code | 36 |
33171162837 | import matplotlib.pyplot as plt
import cv2
import numpy as np
# from pyradar.classifiers.isodata import isodata_classification
from isodataclassifier import isodata_classification
def equalize_histogram(img, histogram, cfs):
"""
Equalize pixel values to [0:255].
"""
total_pixels = img.size
N, M = i... | sauravkarn541/morphological_operators | isodata.py | isodata.py | py | 2,932 | python | en | code | 0 | github-code | 36 |
34023408707 | import cv2
import os
from ultralytics import YOLO
from datetime import datetime, timedelta
# Load the YOLOv8 model
modelo_pt = r'Modelos\Deploys_Ultralytics_Hub\detector_de_placas_yolov8_nano.pt'
model = YOLO(f'{modelo_pt}')
# Open the video file
video_path = r"Video\Video_teste.mp4"
cap = cv2.VideoCapture(video_path... | DevJoaoPedroGiancoli/BrazilTrafficSignsDetector | Detector/detector_com_ids.py | detector_com_ids.py | py | 3,255 | python | pt | code | 0 | github-code | 36 |
1655512886 | import random
from turtle import Screen
from display import DisplaySet
from paddle import Paddle
from ball import Ball
from score import Score
import time
screen = Screen()
screen.title('PONG')
screen.bgcolor('black')
screen.setup(height=600, width=800)
screen.tracer(0)
set_game_field = DisplaySet()
game_on = True
bal... | wojtekgajda/pong_game | main.py | main.py | py | 1,600 | python | en | code | 0 | github-code | 36 |
29295752629 | def multiply(*numbers): # use Asterik to make it a tupple , tuples are iterable
total = 1
for number in numbers:
total *= number
return total
print("start")
print(multiply(2, 3, 5, 6))
print("Finish")
# Debug Hot Keys
# fn+5 -> start
# fn+10 -> step over
# fn+11 -> step in
# fn+shift+11 -> step ... | hvaleri0/Python-Programming-for-developers | debugging.py | debugging.py | py | 324 | python | en | code | 0 | github-code | 36 |
41771854107 | from random import randint, choice
class Karma:
def __init__(self):
self.__karma_points = 0
self.__days_count = 0
def one_day(self, value):
self.set_day()
try:
if value == 10:
exepts_tuple = ('KillError', 'DrunkEror', 'CarCrashError', 'GluttonyError'... | Bednyakov/Tasks | OOP (ООП)/08_karma/main.py | main.py | py | 1,300 | python | en | code | 0 | github-code | 36 |
19839708610 | numero = 1237543
contador = 0
#permite ejecutar un bloque de codigo
#siempre y cuando la condicion se cumpla
#en el while podemos usar el else opcional
#y se ejecuta al finalizar el while
while numero >= 1:
#contador = contador + 1
contador += 1
numero = numero / 10
else:
print(contador)
| javieralarcon77/curso-python | 6. Condiciones - Ciclos/while.py | while.py | py | 307 | python | es | code | 0 | github-code | 36 |
21119814957 | from typing import List
class Solution:
def vowelStrings(self, words: List[str], left: int, right: int) -> int:
s = set()
s.add('a'); s.add('e'); s.add('i'); s.add('o'); s.add('u')
ans = 0
i = 0
for word in words:
if left<=i<=right:
if word[0] in... | plattanus/leetcodeDAY | python/6315. 统计范围内的元音字符串数.py | 6315. 统计范围内的元音字符串数.py | py | 648 | python | en | code | 0 | github-code | 36 |
43205799120 |
import pandas as pd
import numpy as np
import sqlite3
from datetime import timedelta
import matplotlib.pyplot as plt
import pandas as pd
from copy import deepcopy
from ipywidgets import IntProgress
import warnings
warnings.filterwarnings(action='ignore', category=FutureWarning) # setting ignore as a parameter and furt... | MaksimSavinov/demand_forecasting_pipeline | Pipeline/preABT.py | preABT.py | py | 7,729 | python | en | code | 0 | github-code | 36 |
2123056410 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 7 20:18:11 2018
@author: tanthanhnhanphan
MECH2700: Assignment 2
"""
import matplotlib.pyplot as plt
from numpy import *
from math import *
D = 100*10**3 #Dynamic Pressure
Ly = 1 #m
Lx = 5 #m
a = 20*pi/180
E = 70*10**9 #Young's Modulus
S = 96.5#... | oncernhan/MECH2700 | assignment2.py | assignment2.py | py | 8,879 | python | en | code | 0 | github-code | 36 |
36956060159 | from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_timestamp14(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp14'
uri = 'table:' + tablename
format_values = [
('integer-row', dict(key_format='i', value_... | mongodb/mongo | src/third_party/wiredtiger/test/suite/test_timestamp14.py | test_timestamp14.py | py | 15,173 | python | en | code | 24,670 | github-code | 36 |
20053108840 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 10 20:38:02 2018
@author: tf
"""
import AdaBoost
import numpy as np
#dataMat, labelMat = AdaBoost.loadDataSet()
#print(dataMat, '\n', labelMat)
#D = np.ones((5, 1)) / 5
#bestStump, minErr, bestClassEst = AdaBoost.buildStump(dataMat, labelMat, D)
#print(bestStump, '\n',... | Cjh327/Machine-Learning-in-Action | AdaBoost/AdaBoost_test.py | AdaBoost_test.py | py | 859 | python | en | code | 2 | github-code | 36 |
26667888776 | import codecs
import random
def read_proxy():
proxy_list = []
with codecs.open("proxy_pool.txt", "r") as f:
for line in f.readlines():
proxy_list.append(line.strip('\n'))
proxy = random.choice(proxy_list)
return proxy
| nado-dev/Spider_bilibili | proxy_setting.py | proxy_setting.py | py | 256 | python | en | code | 0 | github-code | 36 |
25718423751 | from roleidentification import pull_data, get_roles
def main():
print("Pulling data...")
champion_roles = pull_data()
print("Finished pulling data.")
print()
champions = [122, 64, 69, 119, 201] # ['Darius', 'Lee Sin', 'Cassiopeia', 'Draven', 'Braum']
roles = get_roles(champion_roles, champio... | meraki-analytics/role-identification | examples/get_roles.py | get_roles.py | py | 381 | python | en | code | 26 | github-code | 36 |
19293482431 | """Parameter Store Loader
Use (setting_name, cast function) or setting_name as lookup value.
If no cast function is passed, the parameter will be stored as retrieved
from Parameter Store, typically string or stringList.
Usage:
from awstanding.parameter_store import load_parameters
LOOKUP_DICT = {
'/my/parameter/p... | jiss2891/awstanding | src/awstanding/parameter_store.py | parameter_store.py | py | 4,272 | python | en | code | 13 | github-code | 36 |
9135179001 | from TWITOFF.twitter import *
DB.drop_all()
DB.create_all()
twitter_user = TWITTER.get_user('elonmusk')
tweets = twitter_user.timeline(count=200, exclude_replies=True, include_rts=False, tweet_mode='extended')
db_user = User(id=twitter_user.id, name=twitter_user.screen_name, newest_tweet_id=tweets[0].id)
for tweet... | Tclack88/Lambda | DS-3-3-Productization-and-Cloud/module2-consuming-data-from-an-api/add_musk.py | add_musk.py | py | 599 | python | en | code | 0 | github-code | 36 |
75312916265 | """
Usage:
trajectory.py <path> <start_time> <resolution> <x0> <y0> <z0> <t0> [<output_path>]
trajectory.py (-h | --help)
Arguments:
<path>
<start_time>
<resolution>
Options:
-h --help
Show this screen.
"""
import datetime
import warnings
import numpy as np
from twinotter.util.scrip... | leosaffin/moisture_tracers | moisture_tracers/trajectory.py | trajectory.py | py | 2,859 | python | en | code | 0 | github-code | 36 |
70141671463 | def read_file(filename):
file = open(filename)
content = []
for word in file.readlines():
content.append(word.strip())
return set(content)
WORDBANK = read_file("wordbank.txt")
PREV_ANSWERS = read_file("prev_answers.txt")
POSS_ANSWERS = read_file("poss_answers.txt") | cezar-r/wordle_bot | src/words.py | words.py | py | 273 | python | en | code | 0 | github-code | 36 |
36386993279 | #!/usr/bin/env python3
from ietf.sql.rfc import Rfc
def query_rfc_by_keyword(Session, search_terms):
"""Return a query that, if run, would return RFCs with the keywords in
`keywords`.
The matching on is case-insensitive.
"""
# Assemble a query for each name
queries = [] # Empty list to store... | lafrenierejm/ietf-cli | ietf/utility/query_keyword.py | query_keyword.py | py | 750 | python | en | code | 0 | github-code | 36 |
24788697819 | """
N×M 크기의 공간에 아기 상어 여러 마리가 있다. 공간은 1×1 크기의 정사각형 칸으로 나누어져 있다. 한 칸에는 아기 상어가 최대 1마리 존재한다.
어떤 칸의 안전 거리는 그 칸과 가장 거리가 가까운 아기 상어와의 거리이다. 두 칸의 거리는 하나의 칸에서 다른 칸으로 가기 위해서 지나야 하는 칸의 수이고, 이동은 인접한 8방향(대각선 포함)이 가능하다.
안전 거리가 가장 큰 칸을 구해보자.
"""
import sys
from collections import deque
N, M = list(map(int, sys.stdin.readline().stri... | inhyeokJeon/AALGGO | Python/baekjoon/17086_baby_shark_2.py | 17086_baby_shark_2.py | py | 1,975 | python | ko | code | 0 | github-code | 36 |
25946901690 | #=======================================================
# lm35_slave.py : ADRS2040U PICO HAT Test Program
# 2022.09.14 V0.0 New Create
# 2022.10.26 V1.0 for ADRS2040U Ver 1.0
#=======================================================
import utime
import time
from machine import mem32,Pin
... | bit-trade-one/ADRS2040U | Sample/ADRS2040U_SampleSource/main.py | main.py | py | 1,189 | python | en | code | 1 | github-code | 36 |
75263426665 | """
@Time : 30/03/2023
@Author : qinghua
@Software: PyCharm
@File : process_data.py
"""
import os.path
import pickle
import lgsvl
import pandas as pd
import json
from config import Config
from tqdm import tqdm
"""Processing deep scenario data"""
def get_ds_data(runner):
"""pair paths of ... | qhml/ppt | process_data.py | process_data.py | py | 10,320 | python | en | code | 0 | github-code | 36 |
1412530570 | from flask import Flask,render_template,flash,redirect,session,url_for,logging,request,Blueprint,json,session
from flask_json import FlaskJSON, JsonError, json_response, as_json
from smartiot.bin.config.db_config import mysql
from smartiot.routes.route_Permissions.userPermissions import getPermissions
import RPi.GPIO a... | Singh-Kiran-P/smart-iot-python-api | smartiot/routes/iot/ultraSonic.py | ultraSonic.py | py | 3,894 | python | en | code | 0 | github-code | 36 |
15741816314 | from vector_class import Vectors
import math as m
def main():
#ask user for components of the first vector
component_1=input("The first component of the vector is:")
component_2=input("The second component of the vector is:")
component_3=input("The third component of the vector is:")
vector_1=[co... | brendan-martin/CompMod-excercise_1 | exercise_1/main2.py | main2.py | py | 2,284 | python | en | code | 0 | github-code | 36 |
74901731943 | import time
import numpy as np
from librosa import load, stft, istft, resample
from librosa.output import write_wav
from sklearn.cluster import MiniBatchKMeans, FeatureAgglomeration
from sklearn import datasets
import warnings
# import matplotlib.pyplot as plt
import mir_eval
import corpus
from scipy.io import loa... | TeunKrikke/SourceSeparationNMF | CovNTF/beta_ntf_np.py | beta_ntf_np.py | py | 13,598 | python | en | code | 1 | github-code | 36 |
37634012720 | # Given the edges of a directed graph where edges[i] = [ai, bi] indicates there is an edge between nodes ai and bi, and two nodes source and destination of this graph, determine whether or not all paths starting from source eventually, end at destination, that is:
# At least one path exists from the source node to the... | sunnyyeti/Leetcode-solutions | 1059 All Paths from Souce Lead to Destination.py | 1059 All Paths from Souce Lead to Destination.py | py | 2,779 | python | en | code | 0 | github-code | 36 |
7662718828 | import sqlite3
import urllib
from bs4 import BeautifulSoup
from datetime import datetime
conn = sqlite3.connect('pftcrawlerdb.sqlite')
cur = conn.cursor()
# Setup database
cur.executescript('''
DROP TABLE IF EXISTS Podcasts;
DROP TABLE IF EXISTS Appearances;
CREATE TABLE Podcasts (
id INTEGER NOT NULL PRIMAR... | astewa13/PFTCrawler | ScrapeEarwolf.py | ScrapeEarwolf.py | py | 2,589 | python | en | code | 0 | github-code | 36 |
23111168251 | from mixer.auto import mixer
from rest_framework.test import APITestCase, APIClient
from stock_setup_info.factory import IndustryFactory
from stock_setup_info.models import Industry
# Create your tests here.
class BaseViewTest(APITestCase):
client = APIClient()
@staticmethod
def create_industry(name="... | Maxcutex/stockman_project | stock_setup_info/tests/test_models/test_industry_model.py | test_industry_model.py | py | 1,184 | python | en | code | 2 | github-code | 36 |
38437381382 | def dimensoes(matriz: list) -> str:
return f"{len(matriz)}X{len(matriz[0])}"
def soma_matrizes(m1: list, m2: list) -> list:
if dimensoes(m1) != dimensoes(m2):
return False
result = []
for x in range(len(m1)):
l = []
for i_k, i_v in enumerate(m1[x]):
for j_k, j_v in ... | carlos-moreno/algorithms | soma_matrizes.py | soma_matrizes.py | py | 452 | python | en | code | 0 | github-code | 36 |
34366380953 | from scripts.hackerrank.isLeapYear import is_leap, is_leap2, is_leap3, is_leap4
class Test:
test_cases = [
[2004, True],
[2008, True],
[2012, True],
[2016, True],
[2005, False],
[2009, False],
[2013, False],
[2017, False],
]
testable_fun... | TrellixVulnTeam/learning_to_test_code_BL81 | tests/hackerrank/test_isLeapYear.py | test_isLeapYear.py | py | 560 | python | en | code | 0 | github-code | 36 |
36911764017 | import emp,pickle
f=open("emp.dat","wb")
n=int(input("enter the number"))
for i in range(n):
eid=int(input("enter"))
name=input("enter teh name")
sal=float(input("enter the sal"))
e=emp.Emp_class(eid,name,sal)
pickle.dump(e,f)#this will enter the data in emp.dat
# print(type(e))
f.clos... | Sahil123git/Python | Pickling/picklse.py | picklse.py | py | 323 | python | en | code | 0 | github-code | 36 |
18036889347 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def pathSum(self, root: Optional[TreeNode], targetSum: int) -> int:
self.result = 0
oldPaths... | LittleCrazyDog/LeetCode | 437-path-sum-iii/437-path-sum-iii.py | 437-path-sum-iii.py | py | 974 | python | en | code | 2 | github-code | 36 |
37351904509 | # This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope tha... | RMerl/asuswrt-merlin | release/src/router/avahi-0.6.31/avahi-python/avahi/__init__.py | __init__.py | py | 3,082 | python | en | code | 6,715 | github-code | 36 |
28888308996 | '''
https://www.codewars.com/kata/52efefcbcdf57161d4000091/
The main idea is to count all the occurring characters in a string. If you have a string like aba, then the result should be {'a': 2, 'b': 1}.
What if the string is empty? Then the result should be empty object literal, {}.
'''
# my solution
def count(str):... | MSKose/Codewars | 6 kyu/Count characters in your string.py | Count characters in your string.py | py | 694 | python | en | code | 1 | github-code | 36 |
41068976001 | from matplotlib import pyplot as plt
from matplotlib import font_manager
# 设置中文
# !本字体路径为本机一款字体路径,运行时可任意替换为系统中的一款中文字体路径,必须为中文字体,系统不限:Windows/macOS/Linux
my_font = font_manager.FontProperties(
fname='C:\Windows\Fonts\STFANGSO.TTF')
# 设置图片大小
plt.figure(figsize=(20, 8), dpi=80)
# 数据
x_3 = range(1, 32)
x_10 = range(... | XiongZhouR/python-of-learning | matplotlib/scatter.py | scatter.py | py | 1,563 | python | zh | code | 1 | github-code | 36 |
35862373343 | import logging
import time
from aiogram import F, Router
from aiogram.fsm.context import FSMContext
from aiogram.types import CallbackQuery, InlineKeyboardMarkup, Message
from sqlalchemy.orm import Session
from keyboards.keyboards import (
back_keyboard,
pagination_keyboard,
yes_no_keyboard,
)
from keyboa... | Studio-Yandex-Practicum/EdGame_bot | handlers/methodist_categories_handlers.py | methodist_categories_handlers.py | py | 19,739 | python | ru | code | 0 | github-code | 36 |
22968912977 | from fastapi import APIRouter, Depends, Request
from sqlalchemy.orm import Session
from components.auth.logics import AuthLogic
from config.settings import get_db
from framework.api_response import ApiResponse
from framework.decorators import default_api_response, classview
from components.auth.schemas import (
L... | minhhh-0927/cookiecutter-fastapi-sun-asterisk | {{cookiecutter.project_slug}}/components/auth/routers.py | routers.py | py | 857 | python | en | code | 13 | github-code | 36 |
26755841181 | from Crypto.Cipher import AES
from base64 import b64decode
import os
def main():
key = 'YELLOW SUBMARINE'
cipher = AES.new(key, AES.MODE_ECB)
file_path = os.path.expanduser('~/Downloads/7.txt')
with open(file_path, 'r') as f:
data = f.read()
data = b64decode(data)
msg = cipher.decrypt... | dominicle8/cryptopals | 1_7.py | 1_7.py | py | 398 | python | en | code | 0 | github-code | 36 |
8756260225 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.addons.of_geolocalize.models.of_geo import GEO_PRECISION
class OFParcInstalle(models.Model):
_name = 'of.parc.installe'
_description = u"Parc installé"
name = fields.Char... | odof/openfire | of_parc_installe/models/of_parc_installe.py | of_parc_installe.py | py | 12,772 | python | fr | code | 3 | github-code | 36 |
3118375238 | import torch.optim as optim
ADADELTA_LEARNING_RATE = 0.05
ADADELTA_MOMENTUM = 0.9
ADADELTA_WEIGHT_DECAY = 0.005
def get_adadelta_halnet(halnet,
momentum=ADADELTA_MOMENTUM,
weight_decay=ADADELTA_WEIGHT_DECAY,
learning_rate=ADADELTA_LEARNING_RATE):... | pauloabelha/muellerICCV2017 | optimizers.py | optimizers.py | py | 520 | python | pt | code | 2 | github-code | 36 |
2530109965 | from typing import Tuple
from pricer.pricer import Offer, Basket, Catalogue
def multibuy(item: str, buy: int, get: int) -> Offer:
def offer(basket: Basket, catalogue: Catalogue) -> Tuple[float, Basket]:
basket = basket.copy()
if item not in basket or item not in catalogue:
return 0... | zamkot/basket_pricer | pricer/offers.py | offers.py | py | 950 | python | en | code | 0 | github-code | 36 |
31775295098 | """A module defining functions for playing multiplayer games"""
import abc
import socket
import os
import os.path
from . import base
def mk_server(game_name, player_name):
"""Returns a serer for a game"""
socket_name = ("/tmp/%s_%s_%s" % (game_name, player_name, os.getpid()))
if os.path.exists(socket_na... | percivalgambit/gofish_multiplayer | pytermgame/multiplayer.py | multiplayer.py | py | 714 | python | en | code | 0 | github-code | 36 |
9689098423 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, RequestFactory, Client
from app.tests.mixins import AuthRouteTestingWithKwargs
from app.tests.mixins import Pep8ViewsTests
import app.views as views
performance = views.user_performance_views
class PasswordResetPep8Test... | Contrast-Security-OSS/DjanGoat | app/tests/views/test_users_performance.py | test_users_performance.py | py | 1,247 | python | en | code | 69 | github-code | 36 |
34400546796 | from pages.courses.register_course_page import RegisterCoursePage
from utilities.test_status import TestStatus
from pages.home.login_page import LoginPage
import unittest
import pytest
from ddt import ddt, data, unpack
import time
from pages.home.navigation_page import NavigationPage
@pytest.mark.usefixtures("oneTime... | dragosavac/Testing_Framework | tests/courses/course_test.py | course_test.py | py | 1,440 | python | en | code | 0 | github-code | 36 |
41120702108 | from default.liststc import length
__k = 3
def __get_ciphered_char(p: str):
# cek apakah char merupakan sebuah alfabet
if 97 <= ord(p) <= 122 or 65 <= ord(p) <= 90:
# cek apakah char merupakan huruf kapital
is_upper_case = p.isupper()
# merubah char menjadi huruf kecil
p = ... | zidane-itb/tubes-daspro | security/cipher.py | cipher.py | py | 1,054 | python | id | code | 0 | github-code | 36 |
72653392105 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 2 15:17:31 2020
@author: PARK
"""
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
def disease_load(val_rate = 0.25, seed = 42, target_split = True):
# Load Data
disease_data = pd.read_csv('./dataset/thyroid_disease/... | Yukkiasuna-sao/Anomaly_Detection | implementation/loaddata.py | loaddata.py | py | 2,300 | python | en | code | 0 | github-code | 36 |
39122782459 | from clases import *
personas = persona()
personas.setNombre("Rene")
personas.setApellidos("Franco")
personas.setAltura(178)
personas.setEdad(200)
print(f"La persona es {personas.getNombre()} {personas.getApellidos()} ")
informatica = informatico()
informatica.setNombre("Paquito")
informatica.setApellidos("Cabezon")... | reneafranco/Course | POO-HERENCIAS/main.py | main.py | py | 456 | python | es | code | 0 | github-code | 36 |
41730576127 | # Create the grid
import numpy as np
import pygame
grid_size = 20
# The abstract representation of the grid.
# A nxn grid
grid = np.zeros((grid_size, grid_size))
pygame.init()
screen_width, screen_height = 600, 600
screen = pygame.display.set_mode((screen_width, screen_height))
clock = pygame.time.Clock()
class ... | crimsondevi/PathThroughDestruction | grid.py | grid.py | py | 2,736 | python | en | code | 0 | github-code | 36 |
7020319772 | import urllib.request
import urllib.parse
kw = '日本'
data = {
'wd': kw
}
data = urllib.parse.urlencode(data)
url = 'https://www.baidu.com/s?' + data
headers = {
'User-Agent': 'Mozilla/5.0(Macintosh;IntelMacOSX10.6;rv:2.0.1)Gecko/20100101Firefox/4.0.1'
}
request = urllib.request.Request(url=url, headers=headers)
re... | thearmada/spider | 3.py | 3.py | py | 527 | python | en | code | 0 | github-code | 36 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.