index int64 0 1,000k | blob_id stringlengths 40 40 | code stringlengths 7 10.4M |
|---|---|---|
990,100 | 990bfa44057bbb64dadc59f3ced3686758ff98e8 | # coding: utf-8
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re # noqa: F401
import six
from cloudtower.configuration import Configuration
class NicOrderByInput(object):
"""NOTE: This class is auto generated by OpenAPI ... |
990,101 | e36b660fb7f0ead88c711375a046fb83878d47f8 | import marshal, base64
exec(marshal.loads(base64.b64decode("YwAAAAAAAAAABQAAAEAAAABzowMAAGQAAGQBAGwAAFoAAGQAAGQBAGwBAFoBAGQAAGQBAGwCAFoCAGQAAGQBAGwDAFoDAGQAAGQBAGwEAFoEAGQAAGQBAGwFAFoFAGQAAGQBAGwGAFoGAGQAAGQBAGwHAFoHAGQAAGQBAGwIAFoIAGQAAGQBAGwJAFoJAGQAAGQBAGwKAFoKAGQAAGQBAGwLAFoLAGUAAGoMAGQCAIMBAAF4SgBlDQBkAwCDAQBEXTwA... |
990,102 | 3fd328e82f0bb83347c79e0812f4e62764f835fe | # Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
if l1 == None:
return l2
if l2 == None:
return l1
... |
990,103 | 36176242a0015b76f57e506f0acd4d1510bbfd73 | import sqlite3
class DBHelper:
@staticmethod
def make_table(db_name, table_name):
conn = sqlite3.connect(db_name)
c = conn.cursor()
print "CREATE TABLE if not exists {} (artist_name text, lyrics text, phrase_counts text)".format(table_name)
c.execute("CREATE TABLE if not exists {} (artist_name text, lyrics... |
990,104 | c2fd5870cfe08c9c55c75dd2065678bffd0a3470 | # coding=utf-8
class ZoozException(Exception):
"""
Extends Exception class adding:
message: error message returned by ZooZ
status_code: response status returned by ZooZ
"""
def __init__(self, message, status_code):
Exception.__init__(self, message)
self.sta... |
990,105 | f79706e607f81916381e9ec96d9d61bab7436378 | from cuenta_bancaria import BankAccount
class User:
def __init__(self, name, email):
self.name = name
self.email = email
self.cuentas=[]
self.cuentas.append(BankAccount(int_rate=0.02, balance=0))
#self.account =
def new_account(self,int_rate=0, amount=0):
self.c... |
990,106 | 992d164eb956ab141ee853837687e946260aae9d | '''
Created on 2009-9-14
@author: selfimpr
'''
vowels = 'aeiou'
def count(s):
result = 0
for word in s.split():
if word[0] in vowels:
result += 1
return result
print count('hello, every are you fine these days') |
990,107 | 596712a85a7b1de2bba722cce2504c279c48fca3 | from math import inf
def median(prev, curr, size):
return curr if size % 2 else (prev + curr) / 2
# T=m+n,S=1
def x(nums1, nums2):
m, n = len(nums1), len(nums2)
mid, prev, curr, i, j, k = (m + n) // 2, None, None, 0, 0, -1
while i < m and j < n:
if nums1[i] < nums2[j]:
prev, curr... |
990,108 | b9f1c639cf60fb3506536d2825cd6112f5508e7b |
from django.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
path('admin/', admin.site.urls),
path('DR/', include("apps.webapp.url... |
990,109 | c11bc265a3b90e676bba7969abfb0b62de22a9e4 | """
`_evo.py`
========================================================
Copyright 2020 Alorium Technology. All rights reserved.
Contact: info@aloriumtech.com
Description:
This file is part of the Alorium Technology CiricuitPython Library Bundle
and provides the CSR address mapping for the Evo M51 board.
"""
impor... |
990,110 | 88c476542e5b32d3c3b260ca71d521ba85fdc18a | from huepy import *
# Define the dict of numbers in text form
singles = {1: 'One', 2: 'Two', 3: 'Three', 4: 'Four', 5: 'Five', 6: 'Six', \
7: 'Seven', 8: 'Eight', 9: 'Nine'}
teens = {10: 'Ten', 11: 'Eleven', 12: 'Twelve', 13: 'Thirteen', 14: 'Fourteen', \
15: 'Fifteen', 16: 'Sixteen', 17: 'Sevente... |
990,111 | b0d251daf0373e723d0453eae4e52be2a30f48ee | from django.shortcuts import render_to_response
def index(request):
return render_to_response('test_app/index.html', {})
|
990,112 | 05274130aecd18b128412d9b859b1445c979ffe7 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.utils.timezone import utc
import datetime
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20150506_1504'),
]
operations = [
migrations.RenameF... |
990,113 | d37f4e26371e91756b40c94018d15396a8699284 | for chiken in range(0,20):
for rabbit in range(0,20):
if chiken * 2 + rabbit * 4 == 44 and chiken + rabbit == 19:
print('鸡的数量:',chiken,'\n兔的数量:',rabbit)
|
990,114 | 05fb7fb9609fb5bbe5eb24935f2332953cb48bc2 | import os
import json
import configparser
from secretwallet.constants import parameters, CONFIG_FILE, CREDENTIALS_FILE
from secretwallet.utils.fileutils import touch
from secretwallet.utils.cryptutils import encrypt_key
from secretwallet.utils.dbutils import create_table, has_table
from secretwallet.utils.password_mana... |
990,115 | 3df54c1e3b276afc90e9cd113d41fc1d76f77d5e | """
1
5
8 3 5 7 2
3
"""
def main():
n_cases = int(input())
while n_cases > 0:
n_cases -= 1
n = int(input())
arr = map(int, input().split())
classes = set()
for num in arr:
cnt = 0
while num:
if num & 1:
cnt +=... |
990,116 | 9bd8be93b8c72a24c33f7682af0a523ad2abffb0 | from django.conf import settings
try:
# MiddlewareMixin is not available on older versions of Django
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
from airbrake.utils.client import Client
class AirbrakeNotifierMiddleware(MiddlewareMixin):
def __init_... |
990,117 | 9c6335d6920ae0aa412e9206feba05197d039f2f | import os
import json
import numpy as np
import pandas as pd
import sklearn.metrics as scores
THRTYPE = "calibration" # "fscore"
DATA_PATH = "data/models/targetmode_1/2022_02_22__reference"
FILE = os.path.join(DATA_PATH, "test_predictions.parquet")
FILE_VAL = os.path.join(DATA_PATH, "val_predictions.parquet")
print(... |
990,118 | 2b5ca5ef3bcea87df7f1aa4a69a1c1a5e00caa85 | """
"""
from src.domain.article import Articles
from src.interface import ArticleRepository
class ArticleInteractor:
"""
"""
article_repository: ArticleRepository
def __init__(self, article_repository: ArticleRepository) -> None:
self.article_repository = article_repository
async def get... |
990,119 | 9ed652cf3967006fd580e77d71621182874a6bfe |
# # CS 429: Information Retrieval
#
# <br>
# ## Lecture 3: Indexing II
#
# <br>
#
# ### Dr. Aron Culotta
# ### Illinois Institute of Technology
# ### Spring 2014
#
# ---
#
# # Recall Inverted Index
#
# 
#
# Runtime: $O(x + y)$, for postings lists of size $x$ and $y$
# # Ski... |
990,120 | d4bc84f2c3788e6645155f43c4c77d5325cdddfc | import unittest
import xml.etree.ElementTree as ET
from test.parser.template.graph.test_graph_client import TemplateGraphTestClient
class TemplateGraphListProcessingTests(TemplateGraphTestClient):
def test_first(self):
template = ET.fromstring("""
<template>
<first>one two th... |
990,121 | c37b1dc7c20ebb2597311116c6c234db1294566a | import json
import re
import sys
base_path = sys.path[0]+'/'
'''
The following file contains code that reads and writes a js object from/to
server.js that contains info(ip,port) about server
'''
def set_url(url1):
#validation of url -- remaining
base_url = url1.strip()
res = re.findall("http://(.*... |
990,122 | 8281cbfea96551ddf539e3c37b417539ee3d505d | """shop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... |
990,123 | 2801fa95e1f70f5808b67c25c2c065562a987c8e | def series(n):
x = 0
c = 1
total = 0
for i in range(n):
c = (1 + (2 * i))
flip = (-1) ** i
newC = c*flip
x = (4/newC)
total = total + x
return total
def main():
print("Program that estimates Pi")
times = eval(input("n? "))
... |
990,124 | 05a0849f019b37ace62af9960ba48f7c36d31ae2 | def medias_por_inicial(notas_por_nome):
notas_por_inicial = {}
for nome in notas_por_nome:
primeira_letra = nome[0]
contador = 0
for nota in notas_por_nome[nome]:
if primeira_letra not in notas_por_inicial:
notas_por_inicial[primeira_letra] = nota
... |
990,125 | 7ab1f3a708baad4261e9cda1635ee1b5c91d9f8f | ## Forest Gnome
## Rock Gnome
# 2'11" +2d4
# 35lb x 1 lb |
990,126 | 2724cf969bcb88a1952be1c3ab8d2bdb34c6f626 | import logging
from BaseHTTPServer import BaseHTTPRequestHandler
from openadr.util import *
from openadr.handlers.EiEventHandlers import OADR_MESSAGE_HANDLER
class VTNHttpServer(BaseHTTPRequestHandler):
@classmethod
def HttpPreStartCallback(cls):
pass
@classmethod
def HttpPostStartCallba... |
990,127 | 695741fda595eef71c777ab42d411a21fd26f23d | import logging
from forklib import fork_map
logging.basicConfig(level=logging.INFO)
def map_func(item):
return item + 1
def main():
for item in fork_map(map_func, range(20000), workers=10):
print(item)
if __name__ == "__main__":
main()
|
990,128 | 879e9cd32a6dd169631ad3c1eb54c779f61aefca | """create view student_signups
Revision ID: a5c1029ee0
Revises: 2eaab064932
Create Date: 2016-09-20 11:48:35.431922
"""
# revision identifiers, used by Alembic.
revision = 'a5c1029ee0'
down_revision = '2eaab064932'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade()... |
990,129 | a1ff380320baa0071041e14685da69dcd33bbe1d | import os
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow import keras
from tensorflow.keras.applications.inception_v3 import InceptionV3
weights_file = os.path.join("..", "TFExams", "inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5")
pre_trained_model = InceptionV3(
... |
990,130 | e652e28ae4a50dd1595681989efac27993f76cd5 | #script scale.py
#!/usr/bin/python3
"""
Auteur: Vianney Adou
date: 9 /Nov/ 2014
Version: 0.0.1
Licence: GPL2
"""
from tkinter import *
""" BKM couleur est une apllication pour les webmasters
BKM Vianny couleur produit les codes de couleurs en hexadecimal """
rougeb ="00"
vertb ="00"
bleub ="00"
#decodeur hexadeci... |
990,131 | 262e86635e73bea8766d64fea9196ed9d6385527 | # Queries
from queries import user_exists
from queries import insert_user
from queries import deactivate_user
from queries import insert_visitor
from queries import get_all_admins
# Helpers
from utils.helpers import format_text
# Misc
import json
async def process_start_command(chat, match, logger):
has_last_n... |
990,132 | d4f7e1c9f84216e34413b5f06963107f382cb999 | from __future__ import unicode_literals
import frappe, urllib2
from frappe.utils import flt, fmt_money, get_url, now_datetime, get_datetime
from frappe import msgprint, _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
@frappe.whitelist()
def redirect():
pass
... |
990,133 | d840000861bb4b525ba4f54a5302facd81499f71 | """
A generic database QuerySets caching example for any Model objects.
Multiple models with same id is supported in the same cache using class name prefixing to the key.
"""
import logging
from django.core.cache import cache
from .models import User
logger = logging.getLogger(__name__)
def test():
id = 1
... |
990,134 | be44d40f08f02073d7b89e1af7b0d384e51ae906 | import argparse
def get_args():
parser = argparse.ArgumentParser(description='Dictionary',formatter_class=argparse.ArgumentDefaultsHelpFormatter)
args = parser.parse_args()
return args
def main():
args = get_args()
#maps
nums = [1,2,3,4,5]
print(map(square,nums)) # --> <map object at 0x000... |
990,135 | d4b17fa25f7be0ef684722de57223969fcdf841c | import wx
from .Events import *
from collections import OrderedDict
class BitmapAnchor:
def __init__(self,parent,anchor_x=0.0,anchor_y=0.0):
self.parent=parent# Bitmap
self.anchor_x=anchor_x
self.anchor_y=anchor_y
def SetCoordinates(self,anchor_x=0.0,anchor_y=0.0):
self.anchor_x=... |
990,136 | fe11014b126c9f2c3a41d18f1c251ae056aa3b39 | import matplotlib.pyplot as plt
ages=[23,34,43,48,56,45,36,25,46,27,41]
bins=[0,10,20,30,40,50,60,70,80,90]
plt.hist(ages,bins,histtype='bar',color='green',rwidth=0.8)
plt.xlabel('ages of employees')
plt.ylabel=('salaries of employees')
plt.title('CLOWN MONSTERS')
plt.show() |
990,137 | bfb1a91a9e8dca5bdb142caaca52cbda5b9df203 | # def load_lines(path):
# with open(path, 'rb') as f:
# return [line.strip() for line in
# f.read().decode('utf8').splitlines()
# if line.strip()]
# ROTATING_PROXY_LIST = load_lines('proxies.txt')
# ROTATING_PROXY_PAGE_RETRY_TIMES = 1
DOWNLOADER_MIDDLEWARES = {
# 'rotating_proxies.middlewares.RotatingP... |
990,138 | 99a7734839eb14a18a8a725f713986cf770f6847 | ### Author: John Grezmak
### Library of functions for sensors used with Sebastian robots.
from multiprocessing.pool import ThreadPool
import pickle
import time
import numpy as np
import serial
def collectData(sensor_type, data_length, ser_ID):
### Function for collecting data from serial device for specified length... |
990,139 | a348c41228e6c386d3f9310da8f1128ff53e8c29 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 14 22:57:37 2019
@author: pengz
"""
class Node():
def __init__(self,initdata):
self.data = initdata #初始数据值
self.next = None ##最初创建的时候节点的next节点是None
def getData(self): #访问数据
return self.data
def getNext(self): #访问下一节点
retu... |
990,140 | d3007eb7fe0506b13f0c443ff9d4ad46966c34e6 | from common.commonData import CommonData
from conftest import http
import allure
@allure.feature("用户相关接口")
class Test_LoadUserInfo:
@allure.story("请求获取用户列表")
def test_LoadUserInfo(self):
path="/user/loadUserInfo"
data={'token':CommonData.token,'id':724}
res_getuserinfo=http.post(path,dat... |
990,141 | 3388875dbd366b55bd3e4d9c4dd54b7856bb17c1 | import winsound
import time
from animation import intro_animation
def Intro():
winsound.PlaySound(".\\music\\intro.wav", winsound.SND_ALIAS | winsound.SND_ASYNC +winsound.SND_LOOP)
intro_animation()
time.sleep(1)
input("Press enter to begin your struggle")
print("\033c", end="")
... |
990,142 | f1a1217e9cf77595a3a680e1cb8f56720ef923f3 | import cv2
import numpy
from matplotlib import pyplot as plt
image=cv2.imread("images/blue.png")
color=('b','g','r')
for i,col in enumerate(color):
hist=cv2.calcHist([image],[i],None,[256],[0,256])
plt.plot(hist,color=col)
plt.xlim([0,256])
plt.show()
|
990,143 | 7cd8d7659db25684b88567f0e658b1e5e4686634 | """gasto
Revision ID: 2d7dd71834d7
Revises: 032
Create Date: 2014-10-18 07:42:22.876984
"""
# revision identifiers, used by Alembic.
revision = '033'
down_revision = '032'
from alembic import op
import sqlalchemy as db
def upgrade():
op.create_table('gasto',
db.Column('id', db.Integer, primary_key=Tru... |
990,144 | ee21dc14ed2bb5f45e2b1d52be659959a1ce4d24 | # coding=utf-8
#!/usr/bin/python
import socket
import commands
HOST='127.0.0.1'
PORT=5000
s= socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.bind((HOST,PORT))
s.listen(1) # start TCP listen, only 1 request
while 1:
conn,addr=s.accept()
print'Connected by',addr
while 1:
data=conn.recv(102... |
990,145 | c74465933b05bf404efb6443cbe1b8f2fb1e60e9 | # Compatibility Python 2/3
from __future__ import division, print_function, absolute_import
from past.builtins import basestring
from builtins import range
# ----------------------------------------------------------------------------------------------------------------------
import numpy as np
import time
# import js... |
990,146 | 59c8d2b2c24ca1fdd03ba5630548189188982cf5 | #! /usr/bin/env python3
# BSD 3-Clause License
#
# Copyright (c) 2019, David Wuthier - daw@mp.aau.dk
# Aalborg University
# Robotics, Vision and Machine Intelligence Laboratory
# Department of Materials and Production
# A. C. Meyers Vaenge 15, 2450 Copenhagen SV, Denmark
# http://rvmi.aau.dk/
# All rights rese... |
990,147 | 443171cfa4acf911564f328fcf075e076748a919 | """Logging用Util"""
import logging
logging.basicConfig(
level=logging.ERROR,
format='%(asctime)s[%(name)s][%(levelname)s] %(message)s'
)
logger = logging.getLogger('ROBOTER')
logger.setLevel(logging.DEBUG)
def debug(message):
"""DEBUGログ出力
Args:
message (str): ログ出力内容
"""
logger.debug(... |
990,148 | 69b70ea717879eec4554efbc198ab6285baf5798 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
990,149 | b0fb2f85385f3a7e9e02eafd2f93cd789c8b3b53 | # -*- coding: utf-8 -*-
""" override order line """
import pprint
import logging
from openerp import models, fields, api, exceptions, tools
_logger = logging.getLogger(__name__)
class OrderLine(models.Model):
""" override order line """
_inherit = 'sale.order.line'
project_id = fields.Many2one('project... |
990,150 | 3926c4b35bcee1e2597e2da3d5d11e7fa29c4c93 | import FWCore.ParameterSet.Config as cms
l1MetFilterRecoTree = cms.EDAnalyzer("L1MetFilterRecoTreeProducer",
triggerResultsToken = cms.untracked.InputTag("TriggerResults::RECO"),
hbheNoiseFilterResultToken = cms.untracked.InputTag("HBHENoiseFilterResultProducer:HBHENoiseFilterResult"),
badC... |
990,151 | 04df38ed85279720a958d2a830ec48603b9879d8 | from serialization import *
class Serializer:
@staticmethod
def serialize_object(obj: object):
return serialize_object(obj)
@staticmethod
def deserialize_object(obj: object):
return deserialize_object(obj)
|
990,152 | c8dc22e16ca5617a2c3a50d31fa44f75597814be | import turtle
import time
t = turtle.Pen()
D = 0
d = 0
print("The equation is T = 0 + (n-1)d")
D = int(input("\nPick a number between 0 and 50: "))
if D <= 50 and D >= 10:
while d <= 500:
d = d + D
t.forward(d)
t.right(90)
else:
print("Invalid Input")
time.sleep... |
990,153 | 72835ca252b5dfc68973f7c61ca866067b7965e8 | #!/usr/bin/python
"""
Sample Run -
./get_activation_patterns.py -i weight_files/XOR.dat -c
./get_activation_patterns.py -i ../forward_pass/activation_pattern/models/fcnn_run_54/weights.dat | tee ../forward_pass/activation_pattern/models/fcnn_run_54/bounds.log
./get_activation_patterns.py -i ..... |
990,154 | 09804a679012fb70def25f44aba16840cb2588d7 | from tkinter import *
import os
from pygame import mixer
mixer.init()
def play():
mixer.music.load("Sound.mp3")
mixer.music.play()
play() #solve
class Sudoku:
def __init__(self, jogo):#jogo eh uma matrix 9x9:
try:
for i in range(9):
for j in range(9):
... |
990,155 | 13feaf39c4f133d2235b0685752e002883727262 | from flask import Blueprint, request
from app.shared.decorators import return_json, token_required, restaurant_required
from app.user.service import Service as UserService
user_service = UserService()
user_routes = Blueprint('user_routes', __name__)
@user_routes.route('/login', methods=['POST'])
@return_json
def log... |
990,156 | 82880acc782734eb96a6888e653b4f17f4220f78 | #!/usr/bin/env python3
import subprocess
import ipaddress
import os
import sys
login, passwd, subnet = sys.argv[1:]
head = '''daemon
maxconn 10000
stacksize 5000
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
setgid 65534
setuid 65534
flush
auth strong
users {login}:CL:{passwd}
allow {login}
'''
rc_local_head = ''... |
990,157 | 66ced51f63675f806c5170cb008836ad847cac22 | import argparse
import os
import re
import numpy as np
import pandas as pd
DOMAIN_REG_EP = r'_(.*?_\d+)_'
max_idx = 169
min_idx = 120
index_reg_exp = 'CC(.*?)_'
def is_train(file_name):
index = re.findall(index_reg_exp, file_name)[0]
index = int(index)
if min_idx <= index <= max_idx:
return Tru... |
990,158 | 4a71fe822c58a4835f11078ade14a88315df144b | import numpy as np
filename = 'colliders.csv'
# TODO: read lat0, lon0 from colliders into floating point values
# Read first line into var
# with open(filename) as f:
# x,y = f.readline().rstrip().split(',')
with open(filename) as f:
x,y = f.readline().split(',')
_,x= x.split(' ')
_,y = y.lstrip().split(' '... |
990,159 | 7f33b91d390b19eea73c9b893020240aa3df8fbf | """Client script to open client server."""
import socket
import sys
def client(msg):
"""Open client server to send a message."""
# address changed to 10000 for server2.py
infos = socket.getaddrinfo('127.0.0.1', 10000)
stream_info = [idx for idx in infos if idx[1] == socket.SOCK_STREAM][0]
client... |
990,160 | f758cd3eef11b63e91a66ba80a544251c9da3cd9 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
990,161 | c7a8be16cd2eb5f51c6dce32108c37147ac34a83 | from surface import *
from compareMatrices import *
from radialBinning import smooth
from matplotlib import rc
from scipy import ndimage
import matplotlib as mpl
import pickle
class ForceDistribution:
def __init__(self, N, surfN, nearestNeighbor, binWidth, cx, cy, timeStep=False, verbose=False):
self.N = ... |
990,162 | 2da458dd9d7db04644ecd14fe1f4e98546721d00 | import click
import os
from srtml_exp.utils import IMAGE_CLASSIFICATION_DIR_TWO_VERTEX
@click.command()
@click.option("--type", type=str, default="two_vertex")
@click.option("--exp-type", type=str, default="accuracy_degradation")
@click.option("--xls-file", type=str, default=None)
@click.option("--config-file", type=... |
990,163 | 4eae9f615870e23d31b4dde4ad4ea07f43f179bf | U2FsdGVkX1/o6AEVKdS/9fJL16Qk6TtEN9UDqQVUkBnJXPkpGcAUkNyTcXoV2urf
mk7gUAiU2YKfBhuE/GekNH92inK1wvL5qhqHsy3icGERbs9v8K/fVc/vnk8uPIPC
PPqV0dUouwVx0+xLz3gCR1eJJU5udbcOwT+op2YWNTf+AgElgQ4is8iY7WDfFSBw
1xDUdoDPgR8OVfR8LLQkPTUEUlez+bEVF77xE4tp4tAqxHRfwkMz01pF8Hvk6h3Y
cqnEtF1rpTYK8gNw7ipQZ2oUl+eYiW+EAew8a9DKrAPJxKuhIzeVcl+qlFxc... |
990,164 | 76dea293073a945d1d2c0c3d3291c346869acb0c | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Multiple'
SITENAME = 'Nairobi GNU/Linux Users Group'
SITEURL = 'http://nairobilug.or.ke'
TIMEZONE = 'Africa/Nairobi'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CAT... |
990,165 | a840e5aecf401614bdc60a6908220d5ae320f307 | # python3
from gooey import *
import synbiopython
import synbiopython.genbabel as stdgen
# imput parameters
@Gooey(required_cols=2, program_name='genbank to sbol', header_bg_color= '#DCDCDC', terminal_font_color= '#DCDCDC', terminal_panel_color= '#DCDCDC')
def main():
ap = GooeyParser()
ap.add_argument("-gb", "... |
990,166 | 5e570590e1e9f2583ec0041e4d3023e038b72e87 | from base_component import *
import os
import argparse
from multiprocessing import Pool, cpu_count
import tempfile
class IoctlCmdFinder(Component):
"""
Component which tries to find all ioctl commands and their corresponding structure.
"""
def __init__(self, value_dict):
ioctl_finder_so =... |
990,167 | 0637b132dc70535751708721d674a89284b19183 | from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(models.Model):
# identifier = models.CharField(max_length=40, unique=True)
USERNAME_FIELD = 'identifier'
user_name = models.CharField(max_length=300)
password = models.CharField(max_l... |
990,168 | 7be50eee83d8a726890edc5bb934fbcf3fadef4a | from ..models.courses import Course
from .base import BaseIndex
class CourseIndex(BaseIndex):
def get_model(self):
return Course
|
990,169 | c6a01891e77ea83ce13ee4a38806bed7728bcaee | #!/usr/bin/env python3
import os
import rospy
import time
import json
import serial
import pprint
from json_setup import telemetry
from sensor_msgs.msg import BatteryState
from sensor_msgs.msg import NavSatFix
from sensor_msgs.msg import Imu
from geometry_msgs.msg import Vector3Stamped
from geome... |
990,170 | acbf46fd80e875cb6a9894f72ae27ceb7d1d8298 | from turtle import *
screen=Screen()
pen=Turtle()
pen.speed(0)
pen.color('red')
pen.fillcolor('yellow')
for i in range(500):
pen.forward(400)
pen.right(100)
done() |
990,171 | b1565e0131a5147845b3e22e96e5e9953bd09733 | # coding:utf-8
import re
import openpyxl
import os
import jieba
# stopWord = [] # 停用词
def calFilename(num: int):
maxlen = 6 # 文件名一共是6位
t = num
cnt = 0
while t > 0:
t //= 10
cnt += 1
filename = "0" * (maxlen - cnt) + str(num) + ".txt"
return filename
def loadStopWord():
... |
990,172 | bc164f8f7a112c28356d2037c474402767b25e77 | satire_wire_articles = [['no-topic', 'ALTERNATIVE PUERTO RICO THRIVING AFTER HURRICANE MARIA', 'ALTERNATIVE SAN JUAN, APR (SatireWire.com) – White House officials today said President Trump’s claim that his handling of Hurricane Maria was a “tremendous success” was a reference to Alternative Puerto Rico, a land where 3... |
990,173 | 510eae113dc833f596a324e258cb0c855bac83ad | #
# Add genjet producer
#
def prod_genjets(process):
# === Produce genjets ===
# hi jet cfg
process.load("CmsHi.JetAnalysis.IterativeCone5HiGenJets_cff")
# subevent map
process.load("CmsHi.Utilities.HiGenParticles_cfi")
# genjet configuration
process.hiGenParticles.src = ["generator"]
process.r... |
990,174 | fe11835773c209539c16529386739b240015e9c5 | def max_char_count(st):
mapper = {}
max_char = 0
res = None
for char in st:
mapper[char] = mapper.get(char, 0) + 1
for key, value in mapper.items():
if value > max_char:
res = key
max_char = value
return res
print(max_char_count('abbccccccd'))
print(ma... |
990,175 | a6f84330474a1a2f92e761290a94fafa2503b7b0 | # #1. Дано целое число (int). Определить сколько нулей в этом числе.
#
my_value = int(input("Введите число "))
string_value = str(my_value)
counter = 0
for symbol in string_value:
if symbol == "0":
counter += 1
print("Количество нулей в числе: ", counter)
#2. Дано целое число (int). Определить сколько ну... |
990,176 | d2f720bd1b16635daa8e04178d8344904e80dbff | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 10:32:04 2020
@author: Ivan
"""
import requests
from bs4 import BeautifulSoup
import json
import pandas as pd
import time
from tqdm import tqdm
import time
import re
import random
keyword = '運動內衣'
page = 1
#封包標頭檔
my_headers = {'authority' : 'sho... |
990,177 | a3395757c7efb0b65cd10966c4a2472420c4d044 |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('images\davud ibrahim\di-1.jpg')
imgplot = plt.imshow(img)
plt.show() |
990,178 | 195f47f95f5e9e1ad8ff36a1a45da659198f2439 | import os
from urlparse import urlparse, urlunparse
from bpprov.components.rest_auth import Auth
class BPAuth(Auth):
schema_base = os.path.join(os.path.dirname(__file__), 'model', 'schema')
schema = 'bp-auth.json'
def start(self):
pass
def stop(self):
pass
def sign(self, url, bo... |
990,179 | 2a8115cde15550b9379f81497af00fece57b0380 | import json
import news_feed
import feedparser
import time
from pymongo import MongoClient
import pymongo
class NewsCollector():
"""
mongo
"""
def __init__(self, db_access=True, url="localhost", db="news", collection="yahoo"):
"""
"""
self.db_access = db_access
if db_a... |
990,180 | 14a7a1e099183f5b88f6cdf530ca01bc93921120 | __author__ = "Eric Dose :: New Mexico Mira Project, Albuquerque"
import os
from datetime import datetime, timezone, timedelta
from math import ceil, floor, sqrt
import numpy as np
import pandas as pd
# from astroquery.mpc import MPC
import requests
from bs4 import BeautifulSoup
import matplotlib
# matplotlib.use('Ag... |
990,181 | c060586b2b03a90e0915db789f05c341da454819 | from flask import Flask
from flask_restful import reqparse, abort, Api, Resource, fields, marshal_with
app = Flask(__name__)
api = Api(app)
# Data
TODOS = {
"todo1": {"task": "build an API"},
"todo2": {"task": "?????"},
"todo3": {"task": "profit!"},
}
parser = reqparse.RequestParser()
parser.add_argumen... |
990,182 | 064a90f6c2353ee8e982d704ddf76b2ccb241cc9 | __author__ = 'changyunglin'
def Question():
'''
This is rod cutting question: find the maximum revenue rj and optimal size sj of the first piece to cut off for each rod size j.
http://www.adchilds.com/2012/04/11/cut-rod-dynamic-programming/
'''
def rod_cutting(n, price, c):
revenue = [0] * (n+1)
... |
990,183 | f01bdfcac40a7ea181703e8e1c97693021487efc | '''
Created on Jan 31, 2014
@author: darkbk
'''
from time import time
from functools import wraps
import logging
from uuid import uuid4
from sqlalchemy.exc import IntegrityError, DBAPIError
from beecell.simple import id_gen
from beecell.simple import get_member_class, import_class
from beecell.db import TransactionErr... |
990,184 | 6420ec5a5a74214985d8fbdd87aef8286217e71d | #!/usr/bin/env python
#version 0.2
import requests
from bs4 import BeautifulSoup
import json
import numpy as np
class parse():
def __init__(self, datatype):
base_url = "http://webprod.hc-sc.gc.ca/nhpid-bdipsn/{}Req.do?id={}&lang=eng"
if datatype == "ingredient":
self.URL = base_url.format("ingred"... |
990,185 | c7e5ec8db074586b57c8b5dde48effc9fbb536f6 | def heapSort(arr):
for i in range(len(arr) / 2, -1, -1):
heapify(arr, i, len(arr))
for i in range(len(arr) - 1, 0, -1):
arr[0], arr[i] = arr[i], arr[0]
heapify(arr, 0, i)
return arr
def heapify(arr, i, arrLen):
left = i * 2 + 1
right = i * 2 + 2
root = i
if left < a... |
990,186 | 591286320a8e2ae685dd0e2799a8d4ffe136af91 | '''
Created on Mar 2, 2016
@author: yoav
'''
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.image import Image
from kivy.properties import *
from kivy.clock import Clock
from kivy.core.window import Window
from collections import defaultdict
from kivy.uix.widget import ... |
990,187 | 4a9b799448dac5c418f20b2dbc756d25f9be4e24 | import time
import os
time.sleep(10)
os.system("/home/pi/Desktop/greenHouseBusTimes/busTimes2LCD.py")
|
990,188 | 491e659517d363ffe180342604b4e2d6ed0be677 | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('all')
def test_upload(Command, Sudo, File):
with Sudo():
out = Command('rm -f /srv/ftp-incoming/upload_test.sh')
out = Command.check_output('/upload_tes... |
990,189 | 4b29ad78618e226e9bea18847e1c34a1f4a7a9f2 |
import pytest
import brownie
PRECIO95 = 10
PRECIO98 = 15
PRECION = 12
PRECIOP = 10
LITROS = 900
LITROS2 = 2
SEL1 = 10
SEL2 = 20
SEL3 = 30
SEL4 = 40
SEL5 = 50
SEL6 = 60
SEL7 = 100
MAXIMO = 1000
@pytest.fixture
def gasolinera1_contract(gasolinera1, accounts):
yield gasolinera1.deploy(PRECIO95,PRECIO98,PRECION,PREC... |
990,190 | e30839fa7059cef835961b7477ecee79cba7061c | from tkinter import *
import json
import math
from analysis import *
import random
import time
WIDTH = 800
HEIGHT = 700
EDGE = 200
H = math.sqrt(3) * EDGE / 2
HALF_EDGE = EDGE / 2
SIZE = 15
LOSE = 'lose'
WIN = 'win'
TIE = 'tie'
value_to_color = {WIN: 'darkgreen', LOSE: 'red', TIE: 'yellow'}
LEFT = 'left'
RIGHT = 'rig... |
990,191 | b8aca9cfd609595cb26ada8fe1089bbc0dd2ae52 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17/11/2 上午9:55
# @Author : Aries
# @Site :
# @File : py010_none.py
# @Software: PyCharm
# 核心笔记 布尔值
'''
python中的虽有标准对象都是可以进行bool测试的
'''
# None
print bool(None)
print None == None # True
# 布尔型
# 以及所有为零的数
print bool(0)
print bool(0.0)
print bool(0L)
pr... |
990,192 | fc7471b4bd4493ae3f54f873d333d76a3fe7862f | # pylint: disable=unused-import
from django.shortcuts import render, get_object_or_404, redirect, HttpResponse
from django.http import Http404
from django.core.exceptions import PermissionDenied
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from djang... |
990,193 | 0222dcc22b975852743b8285dbb7eeb1bf14e845 | import logging
import random
import select
import threading
from datetime import datetime
import time
import weakref
from django.db import connection
logger = logging.getLogger("zentral.core.probes.sync")
postgresql_channel = "probe_change"
class ProbeViewSync(threading.Thread):
def __init__(self, probe_view)... |
990,194 | 2d7a6e11031b7cb71dc9b81bc99df44e26f9f257 | from django.urls import path
# from .views import user_logout,user_login,user_registration, user_profile, update_profile,password_change
from . import views
urlpatterns = [
path('logout', views.user_logout, name='user-logout'),
path('login', views.user_login, name='user-login'),
path('register', views.user_... |
990,195 | d944086b382ba68c28da8de0e0358d2a84c16079 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from rest_framework.authtoken.views import obtain_auth_token
from django.conf.urls import url
# ViewSets
from api.viewsets.users.users import UserViewSet, AlumnosViewSet, AdminsViewSet
from api.viewsets.cursos.cursos import CursoVie... |
990,196 | 9b3843ca134f6600b739ac0b5986c7e71f49e04f | from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
def prepar... |
990,197 | a62a9a8978d940e84e3e2fce3b492c4c5bf2ee59 | import glob
import os
import io
# 텍스트 파일 처리( In-memory Streams )
# 파이썬 2.x 에서는 StringIO가 파이썬 3.x에서는 io.StringIO로 바뀌었습니다.
# StringIO는 파일처럼 흉내내는 객체라고 이해하면 됩니다.
# 문자열 데이터를 파일로 저장한 다음 여러가지 처리를 하게 되는데 그 파일이 다시 쓰이지 않을 때 유용하게 사용된다고 한다.
str = '파이썬 2.x 에서는 StringIO가 파이썬 3.x에서는 io.StringIO로 바뀌었습니다.'
f=io.StringIO()
f.wr... |
990,198 | 14f83bb73c33c09c95012e5365d44ee3c1522d7c | """
Complete all of the TODO directions
The number next to the TODO represents the chapter
and section in your textbook that explain the required code
Your file should compile error free
Submit your completed file
"""
# TODO 6.1 Introduction to File Input and Output
print("=" * 10, "Section 6.1 fil... |
990,199 | df8a5932fa7ff4b7e1ae8ddc8af9f0eae6b9ff87 | import pandas as pd
base = pd.read_csv('census.csv')
previsores = base.iloc[:, 0:14].values
classe = base.iloc[:, 14].values
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.compose import ColumnTransformer
labelencoder_previsores = LabelEncoder()
onehotencorder = ColumnTra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.