index int64 0 1,000k | blob_id stringlengths 40 40 | code stringlengths 7 10.4M |
|---|---|---|
985,700 | bfb8de0ec59912dc52095dbb2ba49917eabe9d8e | """This module defines a class for running knoweng's gene prioritization jobs."""
### Summary of paths and docker mounts for AWS (TODO: generalize across hosts and pipelines) ###
# on the host:
#
# /mnt/storage/interface/ <-- mounted to pipeline's docker container
#
# /mnt/storage/interface/networks/ <-- contains ... |
985,701 | 613684f80b9985fa951a788ad21a8b27492d9eac | #user when you need to use key value pare
# name: uday kumar
# email: uday@gmail.com
# phone: 1234567890
customer ={
"name": "udaykumar",
"age": 30,
"is_verified": True
}
customer["name"]="Kranthi Kumar"
customer["birthdate"] = "jan 5th 2020"
print(customer["name"])
print(customer["age"])
print(customer... |
985,702 | 704d1cbbad802373372b6c321fcaae44215162c2 | from itertools import zip_longest
CLIPPY = r"""/ \
| |
@ @
|| || <--
|| ||
|\_/|
\___/ """
BLANK = '|' + ' '*70 + '|'
def clippify(func):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
if func.__doc__:
doc_lines = [f'|{line:70s}|' for line in func.__doc__.split('\n')]
... |
985,703 | d9522aaca54295d33d5f43b4a2e92011acbf03b3 | class Solution:
def balancedStringSplit(self, s: str) -> int:
balance = 0
ans = 0
for char in s:
balance += 1 if char == 'L' else -1
if not balance: ans += 1
return ans
|
985,704 | e5c220724fe339111c1827aaefe8d890ec859e13 | import pyqrcode #pip install pyqrcode
#pip install pypng
import sys
print("--- Command Line:", sys.argv)
if len(sys.argv) < 2:
# expect 2 arguments
print(f"Usage: {sys.argv[0]} my-msg")
exit(1)
msg = sys.argv[1]
qrcode = pyqrcode.create(msg)
qrcode.png("QRmsg.png", scale=8)
print("---... |
985,705 | cd576621d18ce0d252ef848010421a749767e070 | def nthUglyno(n):
ugl=[0]*(n)
ugl[0]=1
i2=i3=i5=0
next_multile_of_2=ugl[i2]*2
next_multile_of_3=ugl[i3]*3
next_multile_of_5=ugl[i5]*5
for i in range(1,n):
next_ugl_no= min(next_multile_of_2,next_multile_of_3,next_multile_of_5)
ugl[i]=next_ugl_no
if(next_ugl_... |
985,706 | 771857248a65452b3eb1830e06f6b4ede1a8ed42 | import math
from primecheck import IsPrime
def QuadPrimeFormula(n, a, b):
res = n**2 + a*n + b
return res
def QuadPrimeSeqLenght(n, a, b):
seq_len = 0
try:
while IsPrime(QuadPrimeFormula(n, a, b)):
seq_len += 1
n += 1
except ValueError:
seq_len = 0
... |
985,707 | 06dfc56aa2bf6047bb7a193ae3545bcc319abca3 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import (
BaseUserManager, AbstractUser
)
from django.utils import six, timezone
class EmployeeManager(BaseUserManager):
def _create_user(self, username, email, password,
... |
985,708 | de79f5b554b54cbf74edd3768956df838bd3c88a | import numpy as np
import random
from utils import *
np.random.seed(1234567)
random.seed(1234567)
Shuffle = False
points = generate_data(100)
# points = generate_cluster_data(20, maxn=5, std=3, domain=(0, 100))
n = len(points)
print("We have gotten %i sites to travel" % n)
# those in the same cluster may be close to ... |
985,709 | 0f4450813c992f2e46a76438a3fc6c4ea2f0f44d | ## Ejercicios
#Ejercicios 1 :
'''
Ejercicio 1
Escribir un programa que pregunte al usuario su nombre, y luego lo salude.
'''
Nombre = input("Ingrese SU nombre : ")
SaludoCompleto = "Hola Buenas Noches, {}.".format(Nombre)
print(SaludoCompleto)
'''
Ejercicio 2
Calcular el perímetro y área de un rectángulo dada su ... |
985,710 | ae9eb34563bfb5abac9c2528fd56c7a80dddabf9 |
#with open("newdatafile.txt", "r") as f:
# content = f.read()
#print(content)
#with open("newdatafile.txt", "w") as f:
# f.write("Qausain is written by coding")
#
import strip_function as f
print(f.greeting())
|
985,711 | a4b38310457f60d50bd90514bacf63ea67e9481e | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-03 14:53
from __future__ import unicode_literals
from django.db import migrations, models
import grid.models
class Migration(migrations.Migration):
dependencies = [
('grid', '0020_auto_20160703_0952'),
]
operations = [
migra... |
985,712 | d64c612593d63a1827eebc7b3e31c27b180f0f80 | from .common import (
OnExecutionDirective,
OnBuildDirective,
OnIntrospectionDirective,
CommonDirective,
)
from .deprecated import Deprecated
from .directive import Directive
from .non_introspectable import NonIntrospectable
from .skip import Skip
from .include import Include
BUILT_IN_DIRECTIVES = {
... |
985,713 | 05c0877bce2ccb8bfb468b016c668a92161cf7e1 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import db
class YoukuMovieCategoryPipeline(object):
def open_spider(self, spider):
# self.file = open('ten.txt', 'w... |
985,714 | 6d3944a8fcf9802b7c82f32b973f060f2693e727 | import asyncio
import json
from sys import stderr
from gtts import gTTS
from pathlib import Path
import httpx
URL = "https://v2.jokeapi.dev/joke/Any?type=single"
async def get_call() -> dict:
deserialized_json = {}
try:
async with httpx.AsyncClient() as client:
response = await client.get... |
985,715 | 8465c96a959c36e01924d0efcab39b26e3471c03 | # How to change tcp keepalive timer using python script?
socket.setsockopt
|
985,716 | 8e5c629de3e6b01293a7aa620feddd7f0b06eeef | import time
from selenium import webdriver
# Chromedriver path
ie_driver_path = 'C:\z-BrowserDrivers\IEDriverServer.exe'
# Create a new IE session
driver = webdriver.Ie(ie_driver_path)
driver.implicitly_wait(30)
driver.maximize_window()
# Navigate to the application home page
driver.get("http://www.google.com/")
ti... |
985,717 | fa2dc6bc7fbcb81307aaca0af8dc30f3e4b64821 | from django.urls import path
from . import views
producto_patterns = ([
path('producto/gestionar', views.ProductManage.as_view(), name='manage'),
path('producto/create/', views.ProductCreate.as_view(), name='create'),
path('producto/update/<int... |
985,718 | 3fd80393790dedc789e540ad89665395139f0fa5 | import re
# Precompile the patterns
regexes = [ re.compile(p) for p in ['this', 'that'] ]
text = 'Does this text match the pattern?'
print('Text: %r\n' % text)
for regex in regexes:
print('Seeking "%s" ->' % regex.pattern)
if regex.search(text):
print('match!')
else:
print('no match')
... |
985,719 | c8dec279ee447d8632c506ae28318c724979e8ea | from datetime import datetime
import pytest
import time
from app import db, create_app
from app.controllers.create_db_data import create_db_data
from .utils import login
from app.models import Schedule
@pytest.fixture
def client():
app = create_app(environment="testing")
app.config["TESTING"] = True
wit... |
985,720 | ebbcb0b09b0835956131cbf4000c5355e5bc21c3 | import os
import shutil
from baseline.utils import unzip_model, read_config_file, write_json, str_file
import json
import yaml
from xpclient import Configuration, ApiClient
from xpclient.api import XpctlApi
from xpclient.models import Result, Experiment
def read_logs(file_name):
logs = []
with open(file_name)... |
985,721 | 20ac86c620efa556f1c8e0902988fa3022d65158 | import os
import csv
"""Parse a csv file and create list of Car-objects"""
#Base class for all cars
class CarBase:
def __init__(self, car_type, photo_file_name, brand, carrying):
self.car_type = car_type
self.photo_file_name = photo_file_name
self.brand = brand
self.ca... |
985,722 | eddb17c5bc900573fcbd18090dabf88eca993d08 | import scrapy
NEW_POSITIONS ="http://www.1point3acres.com/bbs/forum.php?mod=forumdisplay&fid=198&typeid=653&orderby=dateline&sortid=192&typeid=653&orderby=dateline&sortid=192&filter=typeid"
INTERVIEW_REPORTS="http://www.1point3acres.com/bbs/forum.php?mod=forumdisplay&fid=145&orderby=dateline&sortid=311&orderby=datelin... |
985,723 | a0c9d88e863589d89b1d29164f4d9e4fae4d5690 | from bagatelle.ngs import openBam
def mhsmidcount(bamfile, chromosome, start, end, maxinsert=80, mininsert=1, paired=False):
"""
:param bamfile:
:param chromosome:
:param start:
:param end:
:param paired:
:return: dictionary of mhs middle site count
"""
samfile = openBam.openBam(... |
985,724 | a35bae92a245e5b30fab6333fe1358209da74c59 | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# 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 applicab... |
985,725 | 69b49fb2c961a3fec5c3311dcdcec9c5bbc5c1d0 | from django.db.models import Q
from django.shortcuts import render, Http404, get_object_or_404
from django.contrib import messages
from .models import Curso
def index(request):
dados = Curso.objects.order_by('-id').filter(
mostrar=True
)
return render(request,'home/index.html',{'dados':dados})
d... |
985,726 | 1e20543e0f3c194c0fe63f66580153677dfa8066 | """
* Licensed to DSecure.me under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. DSecure.me licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file ex... |
985,727 | df849da29a429e4cc0aa8de8a7e024aef632ca40 | from libs.catch_game import Labyrinth, PlayerMove
import random
def test_print(lab):
map = lab.get_current_map()
print(map)
board = lab.get_scores()
print(board)
pc = lab.get_scores()
for pc in lab.get_scores():
print(pc)
def test_loading():
"""
load default map.data
"""
... |
985,728 | 5cc67062913e4f37bf655e3cd93ab39ccf85e50b | # Copyright 2020 The TensorFlow Authors. 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 applica... |
985,729 | 8aaa1d436e3b3b33c57a7247cafaf4610da33ba3 | print("hello world")
for i in range(100):
print("hello james world!")
|
985,730 | 1a353c9df5b68095b44f220e53d851bae8ed1c85 | import os
os.environ.setdefault("SQL_SERVER", "mongodb+srv://root:r00tUser@cluster0.gwvhn.mongodb.net/myFirstDatabase?retryWrites=true&w=majority")
|
985,731 | 26b6134fd54e4928fdc468918df9358df9f5ecf6 | # -*- coding: utf-8 -*-
#
# Copyright (C) tkornuta, IBM Corporation 2019
#
# 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 require... |
985,732 | 4e06ff319e17d9d6daeca54f370298cc5e70483c | #creating a fibonacci sequence without using a function
const = [0,1]
for i in range(1,10):
fib = const.append(const[i] + const[i-1])
print const
|
985,733 | 096b36a382f535eb444935cce2e586ea2aa1ff99 | import tensorflow as tf
import sys
from model import Model
from dataset import Dataset
from network import *
from datetime import datetime
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def main():
# Dataset path
train_color_list = 'data_file_color.txt'
train_thermal_list = 'data_file_thermal.txt'
... |
985,734 | a089e9737dc385c166f00e7210844e868cc2a826 | list1 = [1, 2, 3, 4,5]
total = sum(list1)
print("Sum of all elements in given list: ", total)
|
985,735 | ecd78117d4fa318732b4477196f6ce50b3ea7ea8 | for _ in range(int(input())):
N = int(input())
S = {}
for i in range(N):
d, p = map(int, input().split())
S[d] = p
Q = int(input())
for q in range(Q):
d, p = map(int, input().split())
solved = 0
for i in S.keys():
if i <= d:
solved... |
985,736 | c07c71b2758b73b1279b87e914d8c2fa2fac099e | #-*- coding:utf-8 -*-
#!/usr/bin/python
"""
Author:$Author$
Date:$Date$
Revision:$Revision$
Description:
所有代理的上级代理做一个映射脚本
"""
import sys
sys.path.insert(0, 'server_common')
sys.path.insert(0, 'mahjong')
from web_db_define import *
from datetime import datetime,time
from config.config import *
import redis
import ... |
985,737 | 7b7bfd0fbc05d77fa3b4871c2a8e8bebfd930a55 | # Generated by Django 2.0.7 on 2018-08-01 14:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_auto_20180801_1418'),
]
operations = [
migrations.AddField(
model_name='article',
name='download_times'... |
985,738 | 4d487f238a88da7efbebecda3c42fde13193de72 | from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from accounts import views as accounts_views
from courts import views
urlpatterns = [
path('admin/', admin.site.url... |
985,739 | a9c6adb76704806df35731a9f842eaf90ba7ea4c | s='Bryan Tran'
print(s[::-1])
print(s.upper())
print(s.upper()[::-1])
print(s.lower()[::-1])
|
985,740 | b5353c17d4a38680af6255c0974c17031dd71945 | ''' FREEZE version 0.1.0 - test 12.04.14'''
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plot
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.font_manager import FontProperties
import scipy
import scipy.cluster.hierarchy as sch
from operator import *
pd.core... |
985,741 | dc5776ef962a04b66bba399229ba07af453b208c | #!/bin/python3
import os
import sys
import collections as cl
T = int(input())
array = []
for _ in range(T):
m,d = [int(temp) for temp in input().split()]
if d // 10 >= m or d % 10 >= m:
pass
else:
array.append((d // 10) * m + d % 10)
ans = 0
for c in cl.Counter(array).items():
ans += ... |
985,742 | eceb77fbcf99613044c77118bc5337389d13b394 | from mayavi.mlab import *
from const import *
def det_cmap(cmap,style):
|
985,743 | 2fb581e4da270dc46eeaebe165b9ad0840fdf6c4 | import pandas as pd
movies = [
{
"name": "Usual Suspects",
"imdb": 7.0,
"category": "Thriller"
},
{
"name": "Hitman",
"imdb": 6.3,
"category": "Action"
},
{
"name": "Dark Knight",
"imdb": 9.0,
"category": "Adventure"
},
{
"name": "The Help",
"imdb": 8.0,
"category": "Drama"
},
{
"name": "The Ch... |
985,744 | 19ca8176c97f6917bc99dfa034ee6af3f5fdf71b | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from subprocess import check_output
from keras.models import Model
from keras.layers import Dense, Embedding, Input
from keras.layers import LSTM, Bidirectional, GlobalMaxPool1D, Dropout, GRU
from keras.preprocess... |
985,745 | 272d41e13b42ac75e7759752e2dc123f25986f85 | import ctypes
import numpy as np
from OpenGL.GL import *
from omega_engine.core import load_obj_data
from omega_engine.core import MatrixModel
class Entity():
def __init__(self, vertices, vertex_format, indices, texture=None, model=None, draw_mode=GL_TRIANGLES):
self.draw_mode = draw_mode
self.ve... |
985,746 | 67ee0ecbf82c6883095af53cde635006cb07bade | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
#from werkzeug.wsgi import SharedDataMiddleware
from werkzeug.serving import run_simple
from lib.baseapp import BaseApp
from urls import make_url_map
def make_app():
app = BaseApp(make_url_map)
return app
if __name__ == '__main__':... |
985,747 | a97aca44c435a2c5cc082c53a7e9020284947fe0 | from django.contrib import admin
from address.models import *
# Register your models here.
admin.site.register(Currency)
admin.site.register(Country)
admin.site.register(City)
admin.site.register(Address)
|
985,748 | 31fe681a0a3130959f620c21845f525bf65f444c | """Keegan Naidoo
NDXKEE009
4 May 2014"""
import math
import sys
sys.setrecursionlimit (30000)
N=input("Enter the starting point N:\n") #Input starting number
M=input("Enter the ending point M:\n") #Input ending number
def Palindrome(No):
if (No==""): #Base cases to check if empty string or space ent... |
985,749 | 0e63d48b4a4dc760ff12aa84ddc419e79fb2780e | #!/usr/bin/env python
"""Generates random "fluff" news articles.
Usage: fluffy.py [topic] [company]
"""
import sys
import random
import textwrap
def main():
if len(sys.argv) > 3:
exit(__doc__)
elif len(sys.argv) == 3:
topic = sys.argv[-2]
company = sys.argv[-1]
elif len(sys.ar... |
985,750 | 0aa0a9829033d4e2875e227a36b57204efa9431e | """ Project Euler #6: Sum square difference """
t = int(input())
while (t > 0):
n = int(input())
result = (n*(n+1)*(3* n * n - n -2))//12
print(result)
t -= 1
|
985,751 | da23d91eed9d188a2f5a3af91bee8bd91c1152b7 | #This class will handle opening and scanning an img to get the values of each pixel to assign a tile to
#warning: Quite intensive, causes lag spike on call, use sparingly
from PIL import Image
class readMapTiles:
def __init__(self, path):
#Opens the image
self.map = Image.open(path)
#Gets a ... |
985,752 | 73e71b4d9e5853101b84fbc680d298848f692008 | #-*- coding:utf-8 _*-
"""
@version:
@author:yang
@time: 2018/05/15
@file: spider.py
@Project : stock
@Software: PyCharm
@function:
@modify:
"""
import ssl
from urllib import error
from urllib import request
class Spider(object):
def __init__(self):
pass
def spider(self, url, header):
... |
985,753 | e6045634773e969f953cb3060e7896a26884e905 | """The WaveBlocks Project
Sample wavepackets at the nodes of a given grid and save
the results back to the given simulation data file.
@author: R. Bourquin
@copyright: Copyright (C) 2010, 2011, 2012, 2013, 2016 R. Bourquin
@license: Modified BSD License
"""
from WaveBlocksND import BlockFactory
from WaveBlocksND imp... |
985,754 | e53d4ac54ca88c4364e24bc428ccc2cfa70e36cc | import herbicideMutationFinder as herb
from Bio import SeqIO
sha = 'githash unavailable'
__version__ = 1.00
__author__ = 'Nathan D. Hall'
__updated__ = 'December 13, 2019'
def batch_search(fasta,out,homeolog=True):
tsr = {}
stem = fasta.split('/')[-1]
for seq_record in SeqIO.parse(fasta, 'fasta'):
... |
985,755 | 5b97d2ddf8ebd041447d7b4afd58f96059283669 | import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.style as style
import pandas as pd
def eda(df):
style.use('seaborn-poster')
numerical_df = df[['likes', 'views', 'dislikes', 'comments_disabled', 'comment_count', 'ratings_disabled']].apply(pd.to_numeric)
sns.heatmap(numerical_d... |
985,756 | c5451c8a5b545177955a8679f6d909a92157e1e1 |
def sieve_of_erat(N):
grid = [True] * (N + 1)
primes = []
for i in range(2, N + 1):
if not grid[i]:
continue
primes.append(i)
for j in range(i * 2, N + 1, i):
grid[j] = False
return primes
PRIMES = sieve_of_erat(1000)
def factor_n(n):
for p in PRIME... |
985,757 | 1a226796f2b990db34bfb496bb47cf62de88d977 | # Author: Dylan Tong, AWS
import json
from time import sleep
from urllib.parse import urlparse
import pandas as pd
import boto3
from sagemaker import clarify
from sagemaker import Session
sm = boto3.client("sagemaker")
s3 = boto3.client("s3")
class TaskTimedOut(Exception): pass
def get_first_matching_s3_key(bucke... |
985,758 | 79442af38f0edbedc0931b2802d450dff77de2cd | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 18:14:48 2020
@author: norman marlier
"""
import tensorflow as tf
import tensorflow_probability as tfp
import json
import numpy as np
import sys
sys.path.append("../..")
from DexterousManipulation.model.object_model import ObjectDataset
class ObjectPrior():
"""P... |
985,759 | e77e8c759907274f7c9727e23faadb6ada128e7d | """Prints the content of a packet list."""
from fragscapy.modifications.mod import Mod
class Print(Mod):
"""Prints the content of a packet list.
Args:
*args: The arguments of the mods.
Raises:
ValueError: Unrecognized or incorrect number of parameters.
Examples:
>>> Print()... |
985,760 | 40094665448ac6f21464887292dc7a32d7521506 | print("Careers:")
careers = ["engineer", "hacker", "doctor", "chemist"]
print(careers)
careers.append("physicist")
print(careers)
careers.insert(2,"astronaut")
print(careers) |
985,761 | 53483d8b621600c6c9b3e146ca4fe83fc04fec2d | import unittest
import socket
import json
import base64
import zlib
import gzip
import bs4
from http.server import BaseHTTPRequestHandler, HTTPServer
from threading import Thread
import WebRequest
from . import testing_server
class TestPlainCreation(unittest.TestCase):
def test_plain_instantiation_1(self):
wg = W... |
985,762 | 2f6c6692bbd3f47f98b9dbf38c8fc9cabc2506f4 | import pymysql
class roleAssign:
def conn(self):
connection = pymysql.connect(host='localhost',user='root',password='',charset="utf8mb4")
return connection
def roleMaping(self,c):
#database name: USER_MANAGER
#SAP table name: AGR_USERS with 2 attribute UNAME(user),AGR_NAME(r... |
985,763 | 964a292b89f425450605f7a93807d54008e3effb | """Gulp installer class."""
import subprocess
from grow.sdk.installers import base_installer
class GulpInstaller(base_installer.BaseInstaller):
"""Gulp installer."""
KIND = 'gulp'
@property
def should_run(self):
"""Should the installer run?"""
return self.pod.file_exists('/gulpfile.... |
985,764 | 8488b57db819eced67e0e0a2bafbbcbac2bc6749 | from causal_world.task_generators.base_task import BaseTask
import numpy as np
import copy
class Stacking2TaskGenerator(BaseTask):
def __init__(self, reference={"mass":[], "size":[]},
mode=0,
variables_space='space_a_b',
fractional_reward_weight=1,
... |
985,765 | ba3241ffb66d3fc1dc942ba509e8ef60158849a2 | # Download all Media from Wordpress Website
# 0.0.1 - Tested to support images.
# Written by Quinston Pimenta
# This script exists purely for educational reasons.
# The writer of this script 'Quinston Pimenta' is not liable for
# the misuse of this script.
import os
import time
import re
import urllib.parse
import... |
985,766 | a0cbbfe7753d0d2c4a96027a23625c5169844c07 | from osgeo import gdal
import sys
input = 'NPP_21616_151230010535.tif'
#output =
ds = gdal.Open(input)
if ds is None:
print 'Unable to open INPUT.tif'
sys.exit(1)
#num = ds.RasterCount
#print 'Number of bands:', num
#if num > 1:
# print 'Leave one band'
# ds = gdal.Translate('output.tif', ds, bandList = [1])
# in... |
985,767 | 1c1ba5004cbc976de873880944891a3c068722c9 | n, m = map(int, input().split())
As = list(map(int, input().split()))
Bs = list(map(int, input().split()))
adjMat = [[0 for j in range(n + 2)] for i in range(n + 2)]
Cs = [As[i] - Bs[i] for i in range(n)]
movs = [[0 for j in range(n + 2)] for i in range(n + 2)]
for i in range(1, n + 1):
movs[i][i] = adjMat[i][i... |
985,768 | 5f770e00611a01d7879b7d247610ac6c79839cf7 | #
# This file is part of LiteEth.
#
# Copyright (c) 2015-2021 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2015-2017 Sebastien Bourdeauducq <sb@m-labs.hk>
# Copyright (c) 2018 whitequark <whitequark@whitequark.org>
# SPDX-License-Identifier: BSD-2-Clause
import math
from liteeth.common import *
# MAC... |
985,769 | c6be5fffa8d0b9bea020e3d21084c42c4407b0b6 | import refit_hbond_polynomials as rhp
import numpy
import blargs
from cvxopt import lapack, matrix
def drange( start, stop, step ) :
r = start
while r < stop :
yield r
r += step
def read_HBpoly_csv_file( fname ) :
polys = []
flines = open( fname ).readlines()
for line in flines :
... |
985,770 | 01b0b34a3249df0d777100037c647640642d2b8e | from flaskapp.recommend.final_freelancers.jobSimilarity import Similarity
from flaskapp.recommend.freelancers_for_jobs import recommend_freelancers as freelancers
import pandas as pd
import string
import os, sys
fileDir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
#fileDir = os.path.join(fileDir, '... |
985,771 | 4d43d9b3d8068a73d9172bbb19a415cb10e56990 | # Generated by Django 3.1 on 2020-09-07 08:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0002_auto_20200905_2008'),
]
operations = [
migrations.AddField(
model_name='article',
name='proto',
... |
985,772 | 3ecb0241b566e14959588e5ad2d5e0c39d3f95f5 | from flask_wtf import FlaskForm
from wtforms import StringField, TextField
from wtforms.validators import DataRequired
class RecipeForm(FlaskForm):
recipeName = StringField('recipeName', validators=[DataRequired()])
instructions = TextField('instructions', validators=[DataRequired()])
estimatedTime = StringField... |
985,773 | 4f9774c2b396e21239e15ca07598f462cf11cc03 | name = "JamesBond"
for index in name:
print("*****" + str(index) + "*****")
|
985,774 | 08ac2dad24d6dcc7a399b209988a335b1982e4df | from django.contrib import admin
from .models import Expert
admin.site.register(Expert)
|
985,775 | 6a409e95bd8b2e67951b2fb5ba7d71ff6be6d221 | """ API views list
QuestionViews
QuestionRetriveView
"""
from rest_framework import generics
from django_filters import rest_framework
from django.views.generic import ListView
from django.contrib.auth.models import User
from . import serializers, filters, authentication, models
# Create your views here.
class Q... |
985,776 | 90582d89e433f9c0b69f9b50439de245cc9a4c17 | # 문제 3
# 조건1 문자열을 입력받고 정수를 입력받아서 문자열의 맨 뒤부터 정수만큼 출력하는 프로그램을 작성하시오
# 조건 2 입력받은 정수가 문자열의 길이보다 크다면 맨 뒤부터 맨 처음까지 모두 출력한다
word = input("문자열을 입력하시오 : ")
num = int(input("정수를 입력하세요 : "))
word2 = word[::-1]
if num > len(word) :
print(word2)
else :
print(word2[0:num])
|
985,777 | 00e3d369e5e02f80f4779b3ed65e0acd03317690 | from airflow import DAG
import datetime as dt
import json
import arrow
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.slack_operator import SlackAPIOperator
from airflow.models import Variable
from airflow.hook... |
985,778 | c5e0ef619ec20bdfa9bc086747a0aa7d68a14b16 | # 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 writing, software
# distributed unde... |
985,779 | 2f2dfd516e7c8b8b89f00ba526026b67f1304b4c | import logging
from os import path, makedirs
class Logger(object):
'''
receive and save image from redis stream
'''
def __init__(self, input_log_path):
logFormatterStr = "%(asctime)s - %(levelname)s - [%(filename)s: %(lineno)d] - %(message)s"
logging.basicConfig(level = logging.INFO,f... |
985,780 | 5b69e1ed0ff6a2133e67fdfdbeaa396148e79e9a | print('Faça um programa para uma loja de tintas. O programa deverá pedir o tamanho em metros quadrados da área a ser '
'pintada. Considere que a cobertura da tinta é de 1 litro para cada 3 metros quadrados e que a tinta é vendida em latas de'
'18 litros, que custam R$ 80,00. Informe ao usuário a quantidades... |
985,781 | 5bc8d9f4da1e00afe48f8e5271715d6387877556 | from InitiationFiles.Query_execution_summary_File_creation import Query_Execution_Summary
from InitiationFiles.Task_execution_summary_File_creation import Task_Execution_Summary
from InitiationFiles.Detailed_metrics_per_task_File_creation import Detailed_Metrics_per_task
import logging
class ParseInputFile:
def p... |
985,782 | 2fa48fdc9e4cd276afa4a248b247536278ee92c2 | import numpy as np
import generador
import random
numerosGCL = generador.generadorgcl(1234,134775813, 1, pow(2, 32),10000)
uniforme = []
exponencial = []
normal = []
gamma = []
pascal = []
binomial = []
hipergeometrica = []
poisson = []
empirica = []
def distribucion_uniforme(a,b):
for r in ... |
985,783 | 70826b5326572537ea65730ed7481b4cac4c7a10 | import imutils
imutils.find_function("contour") |
985,784 | fe46ad7776361a6476373fa89db1c3633996a245 | # -*- coding: utf-8 -*-
import math
class Solution:
def isHappy(self, n: int) -> bool:
d = set()
while True:
n = self.cal(n)
if n in d:
return False
elif n == 1:
return True
d.add(n)
def cal(self, n):
ret ... |
985,785 | b18adb4e4cc3b51b2e072190608d3e5608066ea9 | import cv2
import numpy as np
import imutils
from PIL import Image
#import pyfirmata
import serial
port='port name'
#bluetooth=serial.Serial(port, 9600)
#bluetooth.flushInput()
def perspective_bird():
pts1 = np.float32([[430,320],[590,320],[120,450],[850,450]])
pts2= np.float32([[0,0],[999,0],[0,666],[9... |
985,786 | 3ab6a229e21da2b4099f5e60e47fa17fe83e5905 | def PredictTheWinner(nums):
"""
:type nums: List[int]
:rtype: bool
"""
if len(nums) % 2 == 0 or len(nums) == 1:
return True
n = len(nums)
dp = [[[0, 0] for row in range(n)] for _ in range(n)]
# bottom up, build each case starting from problem with 1 number in a game:
# base... |
985,787 | 78287c946b99d365000cdd7d2b0534353309d9d5 | #
# @lc app=leetcode.cn id=108 lang=python3
#
# [108] 将有序数组转换为二叉搜索树
#
# @lc code=start
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def sortedArrayToBST(self, nums: List[int]) -> Tr... |
985,788 | 5d3146b16df8ccd0bf1dfe6e870f365b410d21df | """
print("b mi계산기 입니다.")
weight = float(input("몸무게를 입력해주세요"))
height = float(input("키를 입력해주세요"))
print("측정도 : weight / %f*%f = %f"%(weight,height,height,))
"""
score = int(input("점수를 입력하세요"))
if score>=90:
print("수")
|
985,789 | d673b1992d4ba1fde3768339114737d05818648b | # -*- coding: utf-8 -*-
from flask import g
from flask_restful import reqparse, Resource, fields,marshal
from Apps.apis.common.amap_about.amap_about_utils import amapAboutHandle
from Apps.apis.common.user.user_utils import login_required
parser = reqparse.RequestParser()
dp_fields = {'dataTotal':fields.Integer,
... |
985,790 | 7292b449206b49cd0db70e1eaa41f1f2ff3c75a3 |
class Triangle:
height=""
base=""
def set_value(self,height,base):
self.height=height
self.base=base
def display(self):
result=(0.5*self.base*self.height)
print(result)
# print(f"height : {self.height},base : {self.base} , result = {0.5*self.height*self.base}... |
985,791 | a1edd64df6e2dbe3c4065fe1eac882f5023fe917 | # model.py ---
#
# Filename: model.py
# Description:
# Author: Kwang Moo Yi
# Maintainer:
# Created: Thu Jan 24 17:28:40 2019 (-0800)
# Version:
#
# Commentary:
#
#
#
#
# Change Log:
#
#
#
# Copyright (C), Visual Computing Group @ University of Victoria.
# Code:
import numpy as np
import torch
from torch import nn
... |
985,792 | 3b39e5c5e1e8019182b0eeb7a35cd97ae9fba185 | my_student_List =['Cristian' ,29, 'Juan',31, 'Luis',29, 'Juan',22]
"""
print(my_student_List)
print(my_student_List[0])
print(type(my_student_List))
"""
#clean code - Robert C Martin
for student in my_student_List:
print(student) |
985,793 | 346b08b62cbfb1df9592d34ecf370f57169f92c2 | import vampytest
from ..preinstanced import SortOrder
def test__SortOrder__name():
"""
Tests whether ``SortOrder`` instance names are all strings.
"""
for instance in SortOrder.INSTANCES.values():
vampytest.assert_instance(instance.name, str)
def test__SortOrder__value():
"""
Tests ... |
985,794 | 7493f49ac2783ef4a13faca5a4eaa8897998418f | #!/usr/bin/env python
# Code for converting wind sensor data to world frame
import rospy
from geographic_msgs.msg import Vector3
from geographic_msgs.msg import GeoPose
class Converter:
def __init__(self):
self.wind_sub = rospy.Subscriber('/crw_wind_pub', Vector3, self.wind_callback)
self.pose_sub = rospy.Su... |
985,795 | e966165bb73b58574b3be3f6d713daa0510bce6e | x = 1
y = 1
z = 0
k = 2
while len(str(z)) < 1000:
z = x + y
x = y
y = z
k += 1
print k
|
985,796 | 66d446f6f592a7c206c81693a72b244ca6ea1e1e | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Han"
__email__ = "liuhan132@foxmail.com"
import torch
import random
from collections import namedtuple, deque
from utils.functions import to_long_tensor, to_float_tensor
# Define one step transition in dialog
Transition = namedtuple('Transition', ('state', ... |
985,797 | 47db6ffd90ebfe6dacffa2bf62aa18f5f9445488 | """
Example:
Enter the number of rows: 5
0
1 0 1
2 1 0 1 2
3 2 1 0 1 2 3
4 3 2 1 0 1 2 3 4
"""
n = int(input("Enter the number of rows: "))
for i in range(1, n + 1):
print(" "*(n - i), end=" ")
for j in range(1, i):
print(i - j, end=" ")
for k in range(0, i):
print(... |
985,798 | dc3c9ced609d3c37c457911ec11939a70a58a534 | import re
import urllib
import string
import os
from urlparse import *
from HtmlParserEngine import *
from html_cut import *
import time
TYPE_URL = 1
TYPE_PAGE = 2
def echo_str(str):
if str != '':
print str
return
class search_1:
def __init__(self):
self.rule = ''
self.type = 0
... |
985,799 | 5126f1606db22ffa950e884f4730c119da23a542 | def number_loop(limit, increment=1):
i = 0
numbers = []
while i < limit:
print "At the top i is %d" % i
numbers.append(i)
i = i + increment
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
return numbers
result = number_loop(5, 2)
print "The n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.