index int64 0 1,000k | blob_id stringlengths 40 40 | code stringlengths 7 10.4M |
|---|---|---|
990,900 | 6b0dc8484aa97bf8feb6c39b61f688323b79b53d | """Calculator For Random Things"""
__author__ = "Khushi Patel"
import math
def welcome_message():
"""
This function asks the user for their name in order to print a
welcome message.
"""
print("Welcome to the calculator.")
name = input("What is your name? ")
print("Let's get started, " + n... |
990,901 | 37edac5e903511e1766df914f133080a8c9abf41 | """Config for drift system.
This is a system of circles that drift with constant velocity, do not interact,
and do not bounce of the walls.
This config has a train mode and a test mode. In the train mode there are 3-5
sprites, yet in the test mode there are 6-11.
To demo this task, navigate to the main directory and... |
990,902 | 6959a05fa9d84982a113eeaeea8e4d95ad612924 | #modBySobyDamn
from bsUtils import *
import bsUtils
bs.screenMessage("Pro Unlocked By SobyDamn")
def _000OOO0():
return True
def _00000OOO():
return True
bsUtils._haveProOptions = _000OOO0
bsUtils._havePro = _00000OOO |
990,903 | a4303f7fb10c65ca80a2692daa7bae03364e4e8c | import unittest
from bs4 import BeautifulSoup
from webstories import Story, StoryPage
class TestStory(unittest.TestCase):
def setUp(self):
self.example_html = """
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>Joy of Pets</title>
<link rel="canonical" href="pets.html">
<m... |
990,904 | b55851f00e7e98da5bb213a20538040b561900fd | import inspect
import os
import sys
CURRENT_DIR = os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
PARENT_DIR = os.path.dirname(CURRENT_DIR)
# Include paths for module search
sys.path.insert(0, PARENT_DIR)
import numpy as np
import pytest
from myapi import vecutil
class TestVecUtil():
... |
990,905 | 7831a1b567629aac87577f12cadafffa7cd65e2f | from flask_sqlalchemy import SQLAlchemy
from flask import Flask, request, jsonify, render_template
from db import Member, Facility, db
import json
import psycopg2
import config
app = Flask(__name__)
app.config["DEBUG"] = False
# app config
app.config["SQLALCHEMY_DATABASE_URI"] = config.URI
app.config["SQLALCHEMY_TRAC... |
990,906 | 8e2a2cf1a7084e8477987006823acc17a6adb62b | """Initialize the distributed services"""
import multiprocessing as mp
import traceback
import atexit
import time
import os
import sys
from . import rpc
from .constants import MAX_QUEUE_SIZE
from .kvstore import init_kvstore, close_kvstore
from .rpc_client import connect_to_server, shutdown_servers
from .role import ... |
990,907 | 9cd6e75cf7f4921eb30834b7412bc35f8e7b7d04 | #!/usr/bin/env python3
import argparse
from bs4 import BeautifulSoup
import logging
import os
import pdb
import requests
import subprocess
def initlog():
FormatString='%(asctime)s %(levelname)s %(lineno)s %(message)s'
logging.basicConfig(level = logging.DEBUG, format=FormatString)
logger = logging.getLogg... |
990,908 | b6e412119e01e6c64ec2602003fbd7f577d13e95 | # Generated by Django 2.2.10 on 2021-10-05 20:30
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0003_auto_20211005_2217'),
]
operations = [
migrations... |
990,909 | a46308c8e2284a4a16bfdf3e710fd73118bc3545 | # Generated by Django 2.2 on 2019-04-20 16:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cergen', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ReferenceEquipment',
fields=[
... |
990,910 | 1a2752cd47cca9b16c6f0572346bae0e06d3ce28 | '''
Tests agiovanni.intersect code.
'''
__author__ = 'Christine Smit <christine.e.smit@nasa.gov>'
import unittest
import os
import agiovanni.intersect as intersect
class Test(unittest.TestCase):
"""Tests that the intersection code."""
def setUp(self):
test_dir = os.path.dirname(__file__)
se... |
990,911 | 9c9569c2a37690741b47abd8e1f22465903664f7 | import os
import os.path
from argparse import ArgumentParser
from functools import wraps
import logging
logging.captureWarnings(True)
logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
formatter = logging.Formatter(fmt='%(message)s',datefmt='%Y-%m-%d %H:%M:%S')
handler.setF... |
990,912 | 33132db9d4a1ef593cac30ef8bd22b2b816ac700 | from ctypes import *
kerne32 = windll.kernel32
pid = input("pid : ")
if kerne32.DebugActiveProcess(int(pid)):
print "attached:", pid
kerne32.DebugActiveProcessStop(int(pid))
print "detached:", pid
else:
print("error:",pid)
print(WinError(GetLastError()))
|
990,913 | ca59749828a646627f74f031ef57203f51875721 | from .cart import Cart
# Makes the cart available to all templates in the project
def cart(request):
return {'cart': Cart(request)}
|
990,914 | 47ac53fccf19a2067f50c18bd9306d8297d2280f | """cinema pricing"""
def main():
"""person x price"""
date = str(input()).lower()
pers = int(input())
if date in "monday tuesday":
print(pers * 120)
elif date == "wednesday":
print(pers * 80)
elif date in "thursday friday saturday sunday":
print(pers * 140)
main()
|
990,915 | 79c7d0a9f30607d11cb2fa91a2fd8bb37daaeb5b | errorCodeMessage = {}
errorCodeMessage[1062] = 'Borrower already exists' |
990,916 | e17198bb8c95397b4a8c6dc74072159b0c422c85 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt # plt 用于显示图片
import matplotlib.image as mpimg # mpimg 用于读取图片
import numpy as np
lena = mpimg.imread('C:/Users/Administrator/Documents/test.jpg') # 读取和代码处于同一目录下的 lena.png
# 此时 lena 就已经是一个 np.array 了,可以对它进行任意处理
plt.imshow(lena) # 显示图片
plt.axis('off') # 不显示坐标轴... |
990,917 | 52069ab12d33a1915d703a3745a03daf5ab01132 | import serial
from collections import deque
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import tkinter as Tk
from tkinter.ttk import Frame
from itertools import count
import random
class serialPlot:
... |
990,918 | 6264f726f1d6df6e086e12b713e7d5f39016a02f | import json
import urllib3
post_url = "http://0.0.0.0:8383/add_task/"
data = {
"id": "2",
"info": "第二",
}
encoded_data = json.dumps(data).encode("utf-8")
http = urllib3.PoolManager()
r = http.request(
"POST",
post_url,
body=encoded_data,
headers={
'content-type': 'application/json;char... |
990,919 | 7392d0c0d1c7c281ea0bd766a2589006a0a77a6a | # -*- coding: utf-8 -*-
"""
.. codeauthor:: Daniel Seichter <daniel.seichter@tu-ilmenau.de>
"""
class SceneNetRGBDBase:
SPLITS = ['train', 'valid']
# number of classes without void (NYUv2 classes)
N_CLASSES = 13
CLASS_NAMES = ['void',
'bed',
'books',
... |
990,920 | 3092d98465392f5aacb9ce2fae6e4bda0705188b | #problem 541 / reverse string II
#注意字符串下标,s[i:j]切片后,包括 s[i] 不包括 s[j]
class Solution(object):
def reverseStr(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
if k >= len(s):
return s[::-1]
if k < len(s) <= 2*k:
return s[k-1::-1... |
990,921 | 9aca86a921232775b753673a175b23a72544ee0a | import boto3
class RdsNotReadyError(Exception):
pass
def create_instance(db_instance, engine):
"""Create a new RDS instance for this DB instance.
:param aws_db_addons.models.DbInstance db_instance:
:param str engine:
:raises botocore.exceptions.ClientError:
"""
rds = boto3.client('rds'... |
990,922 | 08ea73f9f61b139c7bb33aba207f1a666cf23815 | """
Given a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise.
Return the number of negative numbers in grid.
"""
class Solution(object):
def countNegatives(self, grid):
def binary_search(row):
start, end = 0, len(row)
while start < end:
... |
990,923 | 84ca6ffd7994517b9735b1b6b3844aa37c67c2c6 | class Solution(object):
def searchRange_lowerandupperboundbinarysearch(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
# lower
l, r = 0, len(nums)-1
while l <= r:
m = (l+r) // 2
if nums[m] ... |
990,924 | 2688699cbfdaf393344e67397a13261f9ad5ae79 | import pandas as pd
import matplotlib.pyplot as plt
import os
import tempfile
tempdir = tempfile.gettempdir()
tempfolder = os.path.join(tempdir, 'dataframe')
filename = os.path.join(tempfolder,'salary.csv')
try:
salary = pd.read_csv(filename)
except:
print('Fail to read from source file')
df = salary
plt.figu... |
990,925 | 98d944295bee89b3298f9fd8edb2cdc3ba5bf797 | class Solution(object):
def trimMean(self, arr):
"""
:type arr: List[int]
:rtype: float
"""
arr.sort()
five = int((len(arr) * 0.05))
arr = arr[five:-five]
if len(arr) == 0:
return 0
return sum(arr) / len(arr)
if __name__ == '__mai... |
990,926 | 57b750fe51b7da7fea9316feda177aee727c2cd3 | #!/usr/bin/python
# -*- coding:utf-8
import re,sys
sys.path.append('..')
from expFunc import *
url=sys.argv[1]
payload ="\"/shopadmin/index.php?ctl=passport&act=login&sess_id=1'+and(select+1+from(select+count(*),concat((select+(select+(select+concat(userpass,0x7e,username,0x7e,op_id)+from+sdb_operators+Order+by+userna... |
990,927 | ca23d027d787d1fa4cc50e2aa3541e0032ee48ab | import numpy as np
import mpmath
# import COLD GASS functions
import models
def log_schechter_true(logL, log_phi, log_L0, alpha):
# print (log_phi, log_L0, alpha)
log = np.log(10)
frac = np.power(10,(alpha+1)*(logL-log_L0))
exp = np.exp(-np.power(10,logL-log_L0))
return log*log_phi*frac*exp
def d... |
990,928 | 6b94e6acc2117e6cc393bcb3d72a62cb04bb1add | import keras
from keras.layers import LSTM
from keras.layers import Dense, Activation, Input, Dropout, Activation
from keras.datasets import mnist
from keras.models import Sequential, Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard
learning_rate = 0.001
training_iters = 3
batc... |
990,929 | 6875b4aafa85198e6be282a9db46dfbf1b863533 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/3/29 20:56
# @Author : lingxiangxiang
# @File : demon1.py
'''
这是一个测试程序
'''
"""
hello world
"""
# java c 都需要先声明,在实例化
# int a; a = 10;
a = 10
b = "hello world"
c = 11.961
d = True
print(type(a))
print(type(b))
print(type(c))
print(type(d)... |
990,930 | 0e6551ca9068693ab96f952490133763937b7ad8 | # vi: ts=8 sts=4 sw=4 et
#
# config.py: config commands
#
# This file is part of Draco2. Draco2 is free software and is made available
# under the MIT license. Consult the file "LICENSE" that is distributed
# together with this file for the exact licensing terms.
#
# Draco2 is copyright (c) 1999-2007 by the Draco2 auth... |
990,931 | d4aaa8f38a25121e2e122bc58aa3266edb316a6c | import re
from typing import List, Tuple, Set
from collections import Counter, defaultdict
import numpy as np
import pandas as pd
from tqdm import tqdm
import seaborn as sns
from click import secho
import stanza as stanza
import matplotlib.pyplot as plt
from datasets import load_dataset
from pandas import DataFrame, S... |
990,932 | d6c3ceca2e97a6a08f21abdbfb95e421d4cbd588 | ###############################################################################
''''''
###############################################################################
from .. import _classtools
from .._ptolemaic import Ptolemaic as _Ptolemaic
from ._ur import *
from .var import *
from .dat import *
from .seq import... |
990,933 | 2327b9c1cea89dbadd0d10e009fd4a5144d056a5 | from matplotlib.pyplot import figure
import typing
import pandas
import numpy as np
def doplot(
data: pandas.DataFrame, ind: np.ndarray, saltype: str, thres: float, ax
) -> typing.Tuple[float, float, float, float, float]:
# %% for analysis, remove new trainees arbitrarily chosen making less than threshold
... |
990,934 | 30cee57c7d88dbb7fab087338a4797525a2ea4f4 | # -*- coding: utf-8 -*-
import sys
from os.path import basename
from pprint import pprint
from commando import Application, command, subcommand, version, store, true, param
import ROOT as R
from minty.main import make_main
import results
import datasets
import jobs
import plot
import fit
class Engine(Application... |
990,935 | a18d8098d4b87661bff2d12b105abaa3afe9f3d3 | # -*- coding: utf-8 -*-
from With_DB import Mysql_DB
class Proxy(object):
def __init__(self):
self.db = Mysql_DB()
def GetIP(self): # 先委屈下放sql里,之后想办法放到redis里去管理
#sql = "SELECT ip, port FROM proxys WHERE id >= ((SELECT MAX(id) FROM proxys)-(SELECT MIN(id) FROM proxys)) * RAND() + (SELECT MIN(... |
990,936 | 54b7fdf41babc234a4fec7ca20cf9d8406adef10 | """
GDB function test module for ELF section convenience functions
"""
from tests.utils import _target, gdb_run_cmd, gdb_run_silent_cmd, gdb_start_silent_cmd, is_64b
from tests.utils import GefUnitTestGeneric
class ElfSectionGdbFunction(GefUnitTestGeneric):
"""GDB functions test module"""
def test_func_ba... |
990,937 | 41a293b0ac82acdb418f94fc1720ea5150f0e734 | # import...as for abbreviations
import statistics as stat
grades = [89, 56, 78, 34, 23]
print(stat.mean(grades))
|
990,938 | ac3a1fd0bf2e0e3e33a6458f91f8c3ca19230608 | Leninsky_photo = [
"encyclopedia_leninsky_guestion_1", "encyclopedia_leninsky_guestion_2","encyclopedia_leninsky_guestion_3", "encyclopedia_leninsky_guestion_4", "encyclopedia_leninsky_guestion_5","encyclopedia_leninsky_guestion_6",
"encyclopedia_leninsky_guestion_7","encyclopedia_leninsky_guestion_8","encyclopedia... |
990,939 | 32911332687880c552f5d8b75ad3f83247c522a2 | def Evaluation(Word1,Word2):
if len(Word1)<len(Word2):
mini=len(Word1)
maxi=len(Word2)
else:
mini=len(Word2)
maxi=len(Word1)
SameValue=0 # counter to poso idia eiani ta 2 string
for i in range(0,mini):
if Word1[i]==Word2[i]:
SameValue=SameValue+1
SameValue=float(SameValue)
EvalPersent=(SameValue/m... |
990,940 | 404b7c5e8a6710b38d8ff140fa3524cf1d56556b | # Write a function to find the longest common prefix
# string amongst an array of strings.
class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
min_len, ans = 2**32, 0
min_index = 0
if len(strs) == 0:
... |
990,941 | 71d61cb7829129202c70e327fe314ac7bd95206b | # coding=utf-8
import logging
import time
import urllib
logger = logging.getLogger(__name__)
def getIp():
order = "8eb1b6753a6652c56f1a05f132cb304f"
apiUrl = "http://dynamic.goubanjia.com/dynamic/get/" + order + ".html"
try:
ress = urllib.urlopen(apiUrl).read().strip("\n")
print("---???-... |
990,942 | 985d1a1ef067574c9f76cbc3806bf98a36dad6e1 | #!/usr/bin/python env
# coding: utf-8
from ConfigParser import ConfigParser
import os
root = os.path.abspath(".")
config_path = os.path.join(root, "config")
# 导入配置
config = ConfigParser()
config.read(os.path.join(config_path, "db.conf"))
# 要迁移的数据库
migrate_db_dict = dict(config.items("migrate_db"))
migrate_db_dict["... |
990,943 | 549e7c8eae2ce26027a2732e141947cca244486e | /home/jibin/anaconda3/lib/python3.6/codecs.py |
990,944 | dbcfa52a22163cc418b38d16c0e2a863604cb7f3 | from math import floor
record = float(input())
meters = float(input())
seconds_per_meter = float(input())
time = meters * seconds_per_meter
resistance_seconds = floor(meters / 15) * 12.5
# resistance_seconds = int(meters / 15 * 12.5)
diff = record - (time + resistance_seconds)
if diff > 0:
print(f"Yes, he succeed... |
990,945 | 3177c8450ef94d1b9279d77d82995d57001253b4 | from typing import List
class Solution:
def find132pattern(self, nums: List[int]) -> bool:
""" 暴力法,o(n^3) 复杂度 不推荐 """
i = 0
n = len(nums)
while i < n - 2:
j = i + 1
while i < j < n - 1:
k = j + 1
while j < k < n:
... |
990,946 | d878afd96c0f4cac9e4d6b93bc7b84cbb7d2e4ce | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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
# (at your option) any later version.
#
# Ans... |
990,947 | bd7be83833c964277600814f4d597d03115a833f | from pathlib import Path
src_data_path = Path(__file__)
|
990,948 | 1a37e083e00e475ee2f9d03b80b671667a27ba0d | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-23 08:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deals', '0002_auto_20171021_1137'),
]
operations = [
migrations.AddField(
... |
990,949 | 992b0f733c317b6154b62b115cd874b1d234dda5 |
import numpy as np
from scipy import stats
x = np.array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 2., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,... |
990,950 | 85df36f1a412a40bc8b39b8be55646de8d2c8b16 | #Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
import requests
#Variables that contains the user credentials to access Twitter API
access_token = ""
access_token_secret = ""
consumer_key = ""
consumer_s... |
990,951 | 03468eb136177ef0c398e46aef70d153904bfc61 | import torch
from tqdm import tqdm
class InputExample(object):
"""A single training/test example for simple sequence classification."""
def __init__(self, guid, text_a, pos, label=None):
"""Constructs a InputExample.
Args:
guid: Unique id for the example.
text_a: strin... |
990,952 | f729f0424aec4725e5525873dbfa5a5cbfddbbfe | # Generated by Django 3.1 on 2021-05-14 23:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Productos', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='productos',
name='activo',
... |
990,953 | ce7a4cca9a9c0f68485006c6d08d602366ff4532 | import numpy as np
from numpy import ones, zeros, diag, sqrt, r_, atleast_2d
from numpy import sum as npsum
from numpy.linalg import solve, norm
from sklearn.covariance import graph_lasso
from FPmeancov import FPmeancov
from LassoRegFP import LassoRegFP
# from GraphLasso import GraphLasso
def RobustLassoFPReg(X,Z,p,... |
990,954 | 56890266a2b54a68b8a4256f9538fcd44295bfb9 | Clock.bpm = 120
Root.default = 'C'
Scale.default = Scale.major
d1 >> play("----", amp=1, sample=3, dur=1, formant=0)
d2 >> play("x x x x", sample=3, formant=0).every(4, "stutter", 2)
d3 >> play(" |o5|", dur=2, lpf=1200)
b1 >> bass([0, -2.5, -3, -3], dur=[3, 5], amp=0.5)
b2 >> ambi([0, -2.5, -3, -3], dur=[3,... |
990,955 | 3f636acbb7c778ea534ca99f4d60f7d4ed61704f |
import binascii
from .. import encoding
from ..networks import DEFAULT_NETCODES, NETWORK_NAMES, NETWORKS
from ..serialize import h2b
DEFAULT_ADDRESS_TYPES = ["address", "pay_to_script"]
def _generate_network_prefixes():
d = {}
for n in NETWORKS:
for prop in "wif address pay_to_script prv32 pub32".spl... |
990,956 | 07dfae53d2c5a23be3f526201d6884a866e48bc0 | from ROOT import TFile, TTree, gROOT, TH1F, TCanvas, gStyle, TF1, TProfile, TH2F
from sys import exit
import os
#import argparse
#Open Jan TDR analysis file
janName = 'Run-497-TDR-Analysis'
janFileName = janName + '-BeamPeriod.root'
janFile = TFile(janFileName, 'READ')
if (janFile.IsOpen == False):
print "ERROR: RO... |
990,957 | 89ab79c0639406402d2a96878615a57c5a5d5b96 | #sıradan
element=(1,2)
print(element)
#tek tek erişim
x,y =(1,2)
print(x)
print(y)
#deneme2
x,_ =(1,2)
print(x)
#print(y)
#deneme3
x,y,*z =(1,2,3,4,5,6)
print(x)
print(y)
print(z)
#deneme4
x,y,*z,t =(1,2,3,4,5,6)
print(x)
print(y)
print(z)
print(t)
#z'yi yorum satırı yapssak dahi t hep en son değeri alacaktır
|
990,958 | db52faff7c91ca7b855add1493ccbad4319f126e | from AI.vocab.CaptionVocab import load_voca,load_tokenized_data,save_tokenized_data,tokenized_data
from AI.dataload.CaptionDataManagement import make_caption_loader
from AI.models.Captionmodel.Encoder import EncoderCNN
from AI.models.Captionmodel.Decoder import DecoderRNN
import torch
import torch.nn as nn
import torch... |
990,959 | 1d7498eaadabcd78a74c65c0c086953d51ae6bc4 | from django.db import models
from django.urls import reverse
# ORM : OBEJCT RELATIONAL MAPPING
# Create your models here.
class course_info(models.Model):
#member variable
name=models.CharField(max_length=30)
descrition=models.TextField()
duration=models.IntegerField()
fees=models.IntegerField()
... |
990,960 | eee229d0947f2f0713aa80073e2caf4230d2fb75 | from sebastian.src.ChoraleAnalysis.ChoraleAnalysis import XMLChoraleAnalysis
import sebastian.tests.testfiles.TestFilePaths as TestFilePaths
from sebastian.src.SebastianStructures import Constants
from sebastian.src.Utils.Utils import *
from music21 import note
import unittest
class ParallelUnisonIntegrationTests(uni... |
990,961 | 65cf0ba746ccc59bbb6d96fca5250447c1815b57 | #用request+beautifulsoup抓取tripadvisor
print('hi')
from bs4 import BeautifulSoup
import requests
import time#为了做一个保护
#模拟登陆:
'''
headers = {
'User-Agent':'ctrl+v'
'Cookie':'ctrl+v'
}
url=''
wb_data = requests.get(url,headers=headers)
soup = BeautifulSoup(wb_data.text,'lxml')
'''
url=('https://mp.weixin.qq.com/s/xu... |
990,962 | 2bd4037127d967a20dc2785775ef3686a1de5fb4 | import scrapy
from ..items import WoodsItem
class ManningtonspiderSpider(scrapy.Spider):
name = 'manningtonSpider'
allowed_domains = ['mannington.com']
start_urls = ['https://mannington.com/']
def parse(self, response):
category_urls = ['https://www.mannington.com/Residential/Adura-Vinyl-Plank... |
990,963 | 1a9067bc15662bdfec6ec716a5c488ee242ea67b | #!/usr/bin/python
import os, sys, MySQLdb, time
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../")
import credentials
try:
domain = sys.argv[1].strip()
scanId = sys.argv[2]
if not os.path.exists("/tmp/ICU"):
os.makedirs("/tmp/ICU")
if not os.path.exists("/tmp/ICU/"+domain+"/"):
os.mak... |
990,964 | b1670868f5a33460a203d07135cfabe1c91622da | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
import json
class MlbScrapeItem(scrapy.Item):
# define the fields for your item here like:
#name = scrapy.Field()
def __init__(self, raw):
... |
990,965 | c8920f368cbdebc5f2a1318d5ab6f2b1dc8edbe3 | import psutil
from plyer import notification
import time
battery = psutil.sensors_battery()
while True:
percent = battery.percent
notification.notify(
title = "Battery Percentage",
messege = str(percent) + "% Battery remaining",
timeout = 10
)
time.sleep(60*60)
continue |
990,966 | fe8efa2c4da43d57bad02c9d739e25be4f4e49b8 | T=int(input())
for t in range(T):
V,E=map(int,input().split())
total_map=[[0]*(V+1) for i in range(V+1)]
for e in range(E):
y,x=map(int,input().split())
total_map[y][x]=1
total_map[x][y]=1
start,end=map(int,input().split())
queue=[]
vistied=[0]*(V+1)
distance=[-1]*... |
990,967 | 024d94925c6c19fb676bfb31d1dbb7ba2d8edd98 | import socket
import time
import json
# Set variables to connect
HOST = 'irc.twitch.tv'
PORT = 6667
NICK = 'ENTER NICK HERE'
PASS = 'ENTER PASS HERE'
# Connect to specific channel
CHANNEL = input('What channel are you connecting to? ')
s = socket.socket()
s.connect((HOST, PORT))
s.send(str.encode('PASS ' + PASS + '\r... |
990,968 | 7c68a8488f068db99dc572bfdbfea77627bc4abc | # -*- coding: utf-8 -*-
# @Time : 2019-03-22- 0022 17:34
# @Author : Andy
# @Email : 498330580@qq.com
# @File : tieba_time_task.py
# @Software: PyCharm
import os, sys
import random
import re
import time
import django
import requests as req
# 启用邮箱
import smtplib
from email.mime.text import MIMEText
from ema... |
990,969 | 60d0d7d69631811f2cd8de78ec57476b0f611b69 | # -*- coding: utf-8 -*-
import crom
import dawnlight
from urllib.parse import unquote
from cromlech.browser import IRequest, IResponse
from cromlech.browser import IPublisher, IView, IResponseFactory
from zope.location import ILocation, LocationProxy, locate
from .lookup import ModelLookup, ViewLookup
from .utils im... |
990,970 | 218d17f27a4854f037858985c013634188fa9c52 | class Solution:
def countDiff(self, nums, k):
table = {}
copy = set()
res = 0
for num in nums:
if num not in copy or k == 0:
if num in table:
res += table[num]
table[num] = -1
if k != 0:
table[num - k] = table.get(num - k, 0) + 1
table[num + k] = table.get(num + k, 0) + 1
els... |
990,971 | 19623492726052910386c5b35116f27cb7412869 | ''' --- Commented Out ---
#Visualize boundaries of 3D Grid
def makeMaterial(name, diffuse, specular, alpha):
mat = bpy.data.materials.new(name)
mat.diffuse_color = diffuse
mat.diffuse_shader = 'LAMBERT'
mat.diffuse_intensity = 1.0
return mat
def setMaterial(ob, mat):... |
990,972 | 0cb2287f5198344ff441a48cd9a2ecfaacd370a8 | import collections
import copy
import gym
import itertools
import numpy as np
import spinup.algos.pytorch.sac.core as core
import time
import torch
import torch.nn as nn
from spinup.utils.logx import EpochLogger
class ReplayBuffer:
"""
A simple FIFO experience replay buffer for DDPG agents.
"""
def __... |
990,973 | c86b9a251675f2ac107bfc8f881ea7e35c4fc47a | import django
import json
import os, sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bibstat.settings")
from django.conf import settings
from mongoengine.django.auth import User
user = User.create_user(email = '',
username = '',
password = '')
user.is_active = T... |
990,974 | 3d716886653bcd2390eda507fe5daf993e1fe537 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 11 19:44:20 2017
@author: jcoleman
"""
# Coleman lab modules - combine into a single class?
from calcium import OpenStepCalcium as OSC
from calcium import calcium_imaging_data_fast as cidfast
from calcium import open_calcium_data_fast as ocdfast
from calcium import StepCo... |
990,975 | 5dbae4d97e53d04e4c2390a67ec248fa9da2496f | import turtle as trtl
import random
t = trtl.Turtle()
a = -400
b = -400
t.speed(5)
t.pensize(5)
for x in range(5):
a = a + 100
b = b + 100
t.penup()
t.setposition(a, b)
t.pendown()
randint2 = random.randrange(1,8)
if randint2 == 1:
t.color("red")
elif randint2 == 2:
t.color("blue")
... |
990,976 | b71f32279ec3cb0fd9f24098468d57686ae80256 | """
vega-admin module to test forms
"""
from django.test import TestCase, override_settings
from vega_admin.forms import ListViewSearchForm
class TestForms(TestCase):
"""
Test class for forms
"""
@override_settings(
VEGA_LISTVIEW_SEARCH_QUERY_TXT="Search now",
VEGA_LISTVIEW_SEARCH_TX... |
990,977 | ae1b43849814e4dc7b666a0f913d77db0ed7eb03 | L = list(map(lambda x: x*x,[1,2,3,4,5,6,7,8,9]))
print(L)
def build(x,y):
return lambda : x*x+y*y
L = build(1,2)
print(L())
L = list(filter(lambda x: x%2==1,range(1,20)))
print(L) |
990,978 | 2a46896cd404638d9e382d2f086dd519c7a3898b | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os
import shutil
import subprocess
from multiprocessing import Pool, Process, Queue, Manager
from PIL import Image
from scipy import ndimage
from skimage import feature, filters, measure, morphology, data, color
from skimage.transform import... |
990,979 | fdfded4f9ada0b63d584f4144c1a86027269e8f2 | import logging
from typing import Optional
import numpy as np
from lhotse.features.base import FeatureExtractor
from lhotse.utils import Decibels, NonPositiveEnergyError, Seconds, compute_num_frames
class FeatureMixer:
"""
Utility class to mix multiple feature matrices into a single one.
It should be in... |
990,980 | 48cb6f2f8d759652affadb185386e77e577d4260 | __author__ = 'SunnyYan'
class SNode:
def __init__(self,item,next):
self.item = item
self.next = next
class SLinkedList:
def __init__(self):
self.size = 0;
self.head = None
self.tail = None
def insertFront(self, item):
self.head = SNode(item, self.head)
... |
990,981 | 07cdfbf30ac167d438d18e6a2d74a0a97dc3f5cd | #coding=utf-8
import numpy as np
import datetime
import sklearn.ensemble
import sklearn.model_selection
import pickle
import util
class GbdtModel(object):
def __init__(self):
self.best_gbdt = None
def get_sample_weight(self, target_values):
pos_sample_n... |
990,982 | 52315178e81c9bba570f6fe4e945d5e701d63f05 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui2.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow... |
990,983 | c95a45b24848b7b034f8ef16b61deb2c5874ccc0 | '''
Created on Oct 28, 2016
@author: Bogdan Boboc (bogdanboboc97@gmail.com) && Florin Tamas (tamasflorin@live.com)
'''
from flask import Flask, request, jsonify
import cv2
import numpy as np
app = Flask(__name__)
rooms_hash = {}
persons_count_hash = {}
humidity_hash = {}
temperature_hash = {}
def get_number_of_per... |
990,984 | ada9f195c9c727cb37c59ab355c608621256ad73 | from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import ListAPIView
from goods.models import SpecificationOption, SPUSpecification
from meiduo_admin.serializers.option import OptionSerializer, OptionSpecificationSerializer
from meiduo_admin.utils import PageNum
class OptionModelViewSet(M... |
990,985 | de292693bdda103f60160877967d1ee62e2043a0 | # -*- coding: utf-8 -*-
"""
Created on Sat May 26 18:19:58 2018
@author: Harini Gowdagere Tulasidas
PSU ID: 950961342
@Course : CS 545- Machine Learning
Programming Assignment2: Gaussian Naïve Bayes and Logistic Regression to classify
the Spambase data from the UCI ML repository
"""
from __future__ import division... |
990,986 | 36a408da5446c5ce29160f8b3e71c26eb622f03a | #!python3
# -*- coding: utf-8 -*-
"""
@Author: Anscor
@Date: 2020-04-06 10:15:47
@LastEditors: Anscor
@LastEditTime: 2020-04-06 10:15:48
@Description: 验证类
"""
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.db.models import Q
from rest_framewor... |
990,987 | f7372b7f99575296343100180cdd3424d04ea69f | class Solution:
def productExceptSelf(self, nums):
prefixProduct = 1
responseArr = []
for n in nums:
responseArr.append(prefixProduct)
prefixProduct *= n
suffixProduct = 1
for i in range(len(nums)-1, -1, -1):
responseArr[i] *= suffixPro... |
990,988 | 2b8b568c5d132b22487d850ab9b39b5e0443f4bb | ins = input()
ins = ins.strip("0")
print(["NO", "YES"][ins == ins[::-1]]) |
990,989 | 2fcabb86a182027dbae88144bb28d3141d7b771e | import re
from string import digits
from Sastrawi.StopWordRemover.StopWordRemoverFactory import StopWordRemoverFactory
def process(txtString):
factory = StopWordRemoverFactory()
stopwords = factory.create_stop_word_remover()
remove_digits = str.maketrans('','',digits)
doc = txtString.translate(remove_... |
990,990 | be316f6f289978c88cca39ecc081687689514513 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 3 13:45:08 2020
@author: lucas
"""
from urllib.request import urlopen
import json
import plotly.express as px
import pandas as pd
import numpy as np
data2 = pd.read_csv('../../../Data/countyPop2014_v3.csv',',',dtype = {'county': 'str'})
# select data syntax data1.loc... |
990,991 | 9315787c8174999e8fefd970d7fd806244692785 | import unittest
from logutils import LogUtils
import os
import json
import time
logconfig = """
{
"loglevel" : "DEBUG",
"format" : "[%(asctime)s] %(message)s: %(levelname)s",
"dateFormat" : "%m/%d/%Y %I:%M:%S %p"
}
"""
class TestLogUtils(unittest.TestCase):
def setUp(self):
... |
990,992 | 12c3665c80f4e18a6cba25f38964a2308800a86c | #! /usr/bin/env python3
import requests
import sys
import os
listOfFiles = []
srcDir = "/home/student-01-c4b067d66a1f/supplier-data/images/"
url = "http://localhost/upload/"
for (dirpath, dirname, filename) in os.walk(srcDir):
for file in filename:
if file.endswith(".jpeg"):
print(file)
... |
990,993 | d70c2c1ca161ba82a3e7d2a9ce2abbdfdd0e191a | ##################################################
# WaterOneFlow_services_server.py
# Generated by ZSI.generate.wsdl2dispatch.ServiceModuleWriter
#
##################################################
from WaterOneFlow_services import *
from ZSI.fault import Fault, ZSIFaultDetail
from ZSI.ServiceContainer ... |
990,994 | c1bb0f0a7558092b72a7fac8d5589eed1107ed36 | num = 300
final1 = num + (num * (1.6/100))
final2 = final1 + num + ((final1 + num) * (1.6/100))
final3 = final2 + num + ((final2 + num) * (1.6/100))
final4 = final3 + num + ((final3 + num) * (1.6/100))
final5 = final4 + num + ((final4 + num) * (1.6/100))
final6 = final5 + num + ((final5 + num) * (1.6/100))
final... |
990,995 | a77533994d1857badeb0fd4f99bb42bb25f21f30 | #!/usr/bin/env python3
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a... |
990,996 | 80f95fa98b5bc37bcea7fa02b69b2e30ce231a3b | #!/usr/bin/env python -B
"""
Bootstrap the configuration for a module that uses the ortho module to control the configuration.
Note that this script must be called `bootstrap.py` and must supply a function called `bootstrap_default`
which returns the default configuration and/or a function called `bootstrap_post` whi... |
990,997 | 14ac550e7b44d460a183b2084dfbd6b566511e8d | import math
print(math.floor(3.7))
print(math.ceil(3.7))
|
990,998 | 3b24b3b877e7a6bc30666148c95adf9e172b7624 |
# csdn
import scrapy
import json
import time
class CsdnBlogsSpider(scrapy.Spider):
# t = str(time.time()).replace
name = 'blogs_csdn_spider'
allowed_domains = ['blog.csdn.net']
# new表示刚刷新的文章,more刚刷新下面的表示全部文章
start_urls = ['https://blog.csdn.net/api/articles?type=new&category=home']
def pa... |
990,999 | 9f07a69fb51531aa26e45ee9898268f120d3dbb7 | # import re
#
# str = 'code // annotation'
#
# # ret = re.findall('o', str) # 返回所有满足匹配条件的结果,放在列表里
# ret = re.findall('\/\/[^\n]*', str) # 返回所有满足匹配条件的结果,放在列表里,不明白这里为什么要对斜杠(/)转义
# # [^\n]* 匹配不是(^)换行符(\n)的任意字符若干次(*)
# ret2 = re.sub('\/\/[^\n]*', '', str)
# print(ret2)
# # print('\/\/')
ll = [1, 3, 5, 3, 4, 3]
for i ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.