content stringlengths 5 1.05M |
|---|
result = float('inf')
for i in range(3):
result = min(len(input()), result)
print(result)
|
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
class Inception_v3_version2(nn.Module):
def __init__(self, config):
super(Inception_v3_version2, self).__init__()
if config.pretrained is not None:
inception = models.inception_v3(pre... |
#!/usr/bin/env python
import click
import pycomplete
@click.group()
@click.version_option()
def cli():
pass
@cli.command()
@click.argument(
"shell", default=None, required=False, help="The shell to generate script for"
)
@click.pass_context
def completion(ctx, shell=None):
"""Show completion script for ... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test list builder."""
import abc
import ast
import collections.abc
import copy
import json
import logging
import os
from cros.factory.test import i18... |
#!/usr/bin/env python3
from aws_cdk import core
import os
from vpc.vpc_stack import VpcStack
app = core.App()
VpcStack(app, "vpc", env={'account': os.environ['CDK_DEFAULT_ACCOUNT'],
'region': os.environ['CDK_DEFAULT_REGION']})
app.synth()
|
from .env import collect_env
from .logger import get_root_logger
from .lr_scheduler import ClosedFormCosineLRScheduler
from .metric import accuarcy, mIoU
from .losses import BinaryFocalLoss, FocalLoss
from .window_utils import flat_gts, average_preds, flat_paths |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Original.name'
db.delete_column('cropper_original', 'name')
# Deleting field 'C... |
from __future__ import annotations
import e2cnn.group
from e2cnn.group import Representation
from typing import Callable, Any, List, Union, Dict
import numpy as np
__all__ = ["IrreducibleRepresentation"]
class IrreducibleRepresentation(Representation):
def __init__(self,
group: e2cnn.gro... |
import os
from sleap.io.videowriter import VideoWriter, VideoWriterOpenCV
def test_video_writer(tmpdir, small_robot_mp4_vid):
out_path = os.path.join(tmpdir, "clip.avi")
# Make sure video writer works
writer = VideoWriter.safe_builder(
out_path,
height=small_robot_mp4_vid.height,
... |
import glob
import pandas as pd
import os
from config import *
if __name__ == '__main__':
cm = pd.read_csv(os.path.join(DATASET_PATH, 'cm_norm.tsv'), header=0, sep='\t', index_col=0)
if CONDITION_COLUMN:
cm_ = cm.loc[cm[CONDITION_COLUMN] == CONDITION]
cm = cm_
col_cm = list(cm.index)
i... |
from django.conf.urls import *
from . import views
urlpatterns = [
url(r'', views.index, name='reports.views.index'),
url(r'staff/', views.staff, name='reports.views.staff'),
url(r'superuser', views.superuser, name='reports.views.superuser'),
]
|
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 16 18:58:10 2018
@author: jakec
"""
import os
import csv
row_list = []
csvpath = os.path.join('raw_data/budget_data_1.csv')
with open(csvpath, newline='') as csvfile:
csvreader = csv.reader(csvfile, delimiter=',')
for row in csvreader:
row_l... |
# Lint as: python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
# -*- coding: utf-8 -*-
'''
Author: TJUZQC
Date: 2020-09-08 14:05:31
LastEditors: TJUZQC
LastEditTime: 2020-09-27 17:26:24
Description: None
'''
import glob
import os
import threading
import cv2
import multiresolutionimageinterface as mir
import numpy as np
from libtiff import TIFF
from matplotlib import pyplot as plt... |
import torch
import numpy as np
import math
from scripts.config import Config
import cv2
# Math utilities for model creating, training, and testing.
cfg = Config()
def calculate_psnr(img1, img2, mask):
maskSize = cv2.countNonZero(mask.numpy())
print(maskSize)
mse = np.sum( (img2 - img1) ** 2 ) / (maskSize... |
# Tests for the hicstuff digest module
# 20190402
from tempfile import NamedTemporaryFile
import os
import pandas as pd
from os.path import join
from hicstuff import digest as hcd
from Bio import SeqIO
import filecmp
def test_write_frag_info():
"""Test generation of fragments_list.txt and info_contigs.txt"""
... |
try:
from unittest2 import TestCase
from unittest2 import skipIf
except ImportError:
from unittest import TestCase
from unittest import skipIf
|
"""
Contains URL patterns for a basic API using `Tastypie`_.
.. _tastypie: https://github.com/toastdriven/django-tastypie
"""
from django.conf.urls.defaults import patterns, include, url
from apis.api import v1_api
urlpatterns = patterns('',
url(r'^api/', include(v1_api.urls)),
) |
import pytest
import packerlicious.builder as builder
class TestVMwareIsoBuilder(object):
def test_required_fields_missing(self):
b = builder.VMwareIso()
with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.value)
def test_iso_checksum... |
import unittest
from scrapqd.client import execute_sync
from tests import MockServer
class TestClient(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.server = MockServer()
@classmethod
def tearDownClass(cls):
del cls.server
def setUp(self):
self.query = r"""
... |
import graphene
from graphene_django.types import DjangoObjectType
from .models import Countdown
class CountdownType(DjangoObjectType):
class Meta:
model = Countdown
class CountdownCreateInput(graphene.InputObjectType):
target = graphene.String(required=True)
target_date = graphene.DateTime(re... |
import time
import random
import ostore
import ptrie
import pdscache
from oidfs import OidFS
def rand_perm(txt):
''' Iterates random permutations of ''txt''. '''
txtlen = len(txt)
if txtlen == 0:
yield txt
return
for s in rand_perm(txt[1:]):
randpos = range(0, txtlen)
r... |
import matplotlib.pyplot as plt
def drawPlot(x, y, f):
plt.style.use('dark_background')
plt.scatter(x, y, color = "m",marker = "o", s = 30)
linearFunction = f[0]*x + f[1]
plt.plot(x, linearFunction, color = "g")
plt.xlabel('Size')
plt.ylabel('Price')
plt.show() |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
+-------------------------------------------------
@Author: cc
@Contact: yaochen@xjh.com
@Site: http://www.xjh.com
@Project: sobookscrawler
@File: base_web_driver_service.py
@Version:
@Time: 2019/5/23 10:15
@Descri... |
def validate_params(**kwargs):
exclude = ['self', 'kwargs']
# First remove self from the dict and any values that are None
params = {}
# update kwargs with the nested kwargs
#kwargs.update(kwargs['kwargs'])
for key, val in kwargs.items():
# if none or self continue
if val is Non... |
from platform import system
import pypython
from matplotlib import pyplot as plt
DEFAULT_DISTANCE = 100 * pypython.constants.PARSEC
SCALED_DISTANCE = 100 * 1e6 * pypython.constants.PARSEC
SCALE_FACTOR = DEFAULT_DISTANCE**2 / SCALED_DISTANCE**2
m_bh = "3e6"
root = "tde_opt_spec"
sm = 10
lw = 1.7
al = 0.75
inclination... |
#!/usr/bin/env python
# Project FartCHECKER
# Dmitriy Vetutnev, 2021
import serial
from uart import Receiver
from time import localtime, asctime
def get_concentration(packet):
return (packet[1] * 256) + packet[2]
def callback(packet):
time = asctime(localtime())
concentration = get_concentration(pack... |
from math import inf
from copy import deepcopy
import pickle
import os
import biorbd
import casadi
from casadi import MX, vertcat, sum1
from .enums import OdeSolver
from .mapping import BidirectionalMapping
from .path_conditions import Bounds, InitialConditions, InterpolationType
from .constraints import ConstraintFu... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import tagging.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PageTagging',
... |
import os
from os.path import dirname
import src.superannotate as sa
from src.superannotate.lib.core.plugin import VideoPlugin
from tests.integration.base import BaseTestCase
import pytest
class TestVideo(BaseTestCase):
PROJECT_NAME = "test video upload1"
SECOND_PROJECT_NAME = "test video upload2"
PROJEC... |
from functools import wraps
from flask_admin import Admin, AdminIndexView # type: ignore
from flask_admin.contrib.peewee import ModelView # type: ignore
from flask_login import current_user # type: ignore
from lms.lmsdb.models import Comment, CommentText, Solution
from lms.lmsweb import webapp
from lms.models.erro... |
# (c) @AbirHasan2005
import asyncio
from configs import Config
from pyrogram import Client
from pyrogram.types import Message
from pyrogram.errors import FloodWait
from helpers.filters import FilterMessage
async def ForwardMessage(client: Client, msg: Message):
try:
## --- Check 1 --- ##
can_forw... |
import os
from offenewahlen_api.settings_user import *
from offenewahlen_api.settings import *
DEBUG = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
USER_SETTINGS_EXIST = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'app.sqlite3')
}
}
|
from typing import List
from pickle import load
def clean_urls(urls: List[str], file_name='./cache.pkl') -> List[str]:
"""
Finds and removes duplicate urls from a list of urls.
Args:
urls (List[str]): list of urls
Returns:
List[str]: list of unique urls
"""
try:
with ... |
from setuptools import find_packages, setup
setup(
name="dtumlops",
packages=find_packages(),
version="0.1.0",
description="A simple CNN project, testing cookiecutter",
author="MichaelF",
license="MIT",
)
|
from fastapi import APIRouter, Depends, Request, Response
from sqlalchemy.orm import Session
from typing import List
from uuid import UUID
from api.models.event_type import EventTypeCreate, EventTypeRead, EventTypeUpdate
from api.routes import helpers
from db import crud
from db.database import get_db
from db.schemas.... |
import subprocess
import datetime
import os
NAME = 'clothstream'.replace('_', '-')
VERSION = __version__ = (0, 1, 0, 'alpha', 0)
__author__ = 'Julien Aubert'
def get_version(): # pragma: no cover
"""Derives a PEP386-compliant version number from VERSION."""
assert len(VERSION) == 5
assert VERSION[3] in ... |
from keras import backend as K
import os
def set_keras_backend(backend):
if K.backend() != backend:
os.environ['KERAS_BACKEND'] = backend
try:
from importlib import reload
reload(K) # Python 2.7
except NameError:
try:
from importlib impor... |
n = int(input(f'Digite um numero para ser convertido: '))
o = int(input(f'1 - para binário.\n'
f'2 - para octal.\n'
f'3 - para hexadecimal.\n'
f'Sua opção: '))
if o == 1:
print(f'O numero {n} em binário é igual a : {str(bin(n))[2:]}!')
elif o == 2:
print(f'O numero {n} ... |
import os
import pickle as pkl
from tqdm import tqdm
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import pandas as pd
import ujson as json
import nltk
from nltk.tokenize import word_tokenize
from time import time
np.random.seed(int(time()))
SPACE = ' '
def stat_length(seq_length):
... |
'''
Created on Mar 2, 2015
@author: Stefan-Code
'''
import unittest
from gglsbl3 import client
import os
from nose.tools import *
class ClientTest(unittest.TestCase):
def setUp(self):
self.api_key = "abcdef"
self.db_path = "./testdb.sqlite"
self.client = client.SafeBrowsingList(self.api_k... |
import pathlib
from pw_manager.db import Database
from pw_manager.utils import utils, errors
import paramiko
class Options:
UPLOAD = 1
DOWNLOAD = 2
def check_credentials(server: str, username: str, password: str) -> bool:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddP... |
import FWCore.ParameterSet.Config as cms
dqmFileReader = cms.EDAnalyzer("DQMFileReader",
FileNames = cms.untracked.vstring(),
referenceFileName = cms.untracked.string("")
)
|
import datetime
import logging
import os
import sqlite3
from functools import wraps
import tmdbsimple
# noinspection PyPackageRequirements
from routing import Plugin
from xbmc import executebuiltin
from xbmcgui import ListItem, Dialog
from xbmcplugin import addDirectoryItem, endOfDirectory, setContent, setResolvedUrl
... |
__version__ = "0.0.2"
__banner__ = \
"""
# aiosecretsdump %s
# Author: Tamas Jos @skelsec (info@skelsecprojects.com)
""" % __version__ |
#!/usr/bin/env python
""" Some tests for high-throughput calculations. """
import unittest
import os
import shutil
import glob
import psutil
import numpy as np
from .utils import MatadorUnitTest, REAL_PATH, detect_program
from matador.compute import ComputeTask
from matador.scrapers import cell2dict, param2dict, ph... |
# -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. 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 require... |
# user/serializers.py
from rest_framework import serializers
from dj_rest_auth.serializers import UserDetailsSerializer
from user.models import UserProfile
class ProjectField(serializers.RelatedField):
"""Custom RelatedField Serializer for representation of a project"""
def to_representation(self, value):
... |
"""
Module containing the `~halotools.empirical_models.LogNormalScatterModel` class
used to model stochasticity in the mapping between stellar mass and halo properties.
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
from astropy.utils.misc import NumpyRNGConte... |
import queue
L=queue.LifoQueue(maxsize=5)
L.put(5)
L.put(6)
L.put(1)
print(L.get())
print(L.get())
print(L.get())
if L.full():
print("full")
if L.empty():
print("empty")
|
def solution(n, arr1, arr2):
pattern = [' ', '#']
result = []
for i in range(n) :
decoded = ''
union = arr1[i] | arr2[i]
for _ in range(n):
decoded = pattern[union % 2] + decoded
union //= 2
result.append(decoded)
return result
if __name__ =... |
from django.apps import AppConfig
class RankestimateConfig(AppConfig):
name = 'rankestimate'
|
from aiogram import types
from aiogram.dispatcher.filters.builtin import CommandStart
from utils.misc.msg_dict import texts
from keyboards.inline.startKeyboard import menuStart
from loader import dp, db, bot
import asyncpg
from aiogram.dispatcher import FSMContext
@dp.message_handler(CommandStart())
async def bot_st... |
import torch
import torch.nn as nn
from ilm import ilm_IN
class ConvNet(nn.Module):
def __init__(self):
super(ConvNet, self).__init__()
self.relu1 = nn.ReLU()
self.relu2 = nn.ReLU()
self.relu3 = nn.ReLU()
self.relu4 = nn.ReLU()
self.relu5 = nn.ReLU()
self.rel... |
#!/usr/bin/python
import socket
import cv2
import numpy
def recvall(sock, count):
buf = b''
while count:
newbuf = sock.recv(count)
if not newbuf: return None
buf += newbuf
count -= len(newbuf)
return buf
#TCP_IP = 'localhost'
TCP_IP = '192.168.0.106'
TCP_PORT = 5001
try:
... |
"""Safe in Cloud dabase decryption"""
import struct
import io
import zlib
from Crypto.Cipher import AES
from passlib.utils import pbkdf2
def read_sic_db(filename, password):
"""Read the database and return the XML content."""
with open(filename, 'rb') as db_file:
db_file.seek(3) # skip magic + versi... |
'''
This is a converter for depth profiles created using RUMP the genplot based Rutherford Backscattering Spectrometry Analysis tool.
The discrete layers are treated as steps with a width defined by dx.
This program doubles the number of lines of code for a depth profile created using the WRITEPRO command in the SIM En... |
from pika_queue import PikaQueue
from settings import RABBIT_ACCOUNT, RABBIT_PASSWORD, RABBIT_HOST, RABBIT_PORT, ETL_QUEUE, PREDICT_ERROR_QUEUE
def publish_message(result_tid):
publish_queue = PikaQueue(RABBIT_HOST, RABBIT_PORT, RABBIT_ACCOUNT, RABBIT_PASSWORD)
publish_queue.AddToQueue(ETL_QUEUE, result_tid)
... |
import concurrent.futures
import platform
import tkinter as tk
import traceback
from io import BytesIO
from tkinter import ttk, messagebox
from typing import Tuple, List, Optional, Callable, Union
from urllib.request import urlopen
from thonny import tktextext, get_workbench
from thonny.ui_utils import scrollbar_style... |
import numpy as np
import scipy.sparse as spsp
import seaborn as sns
import scedar.eda as eda
import matplotlib as mpl
mpl.use("agg", warn=False) # noqa
import matplotlib.pyplot as plt
import pytest
class TestSparseSampleFeatureMatrix(object):
"""docstring for TestSparseSampleFeatureMatrix"""
sfm5x10_arr =... |
from boiga.compose import (
compose2, compose3, compose4, compose5, compose6, compose7
)
from tests.typecheck_helper import TypecheckResult, typecheck
# Ideally, these are @dataclass, but not in Python 3.6
class _Flow0:
a: int
def __init__(self, a: int) -> None: self.a = a # noqa: E301
def __eq__... |
from .allnumbers import Numbers as __num__
__languages = ['english', 'arabic', 'hindi', 'persian', 'bengali',
'chinese_simple', 'chinese_complex', 'malayalam', 'thai', 'urdu']
for __language_1 in __languages:
for __language_2 in __languages:
if __language_1 != __language_2:
loca... |
import numpy as np
import elfi
def uniform_prior(minv, maxv, name, **kwargs):
return elfi.Prior("uniform", minv, maxv - minv, name=name)
def truncnorm_prior(minv, maxv, mean, std, name, **kwargs):
return elfi.Prior("truncnorm", (minv - mean)/std, (maxv - mean)/std, mean, std, name=name)
def beta_prior(a, b,... |
from flask import Flask
from flask_restful import Api
from resources.user import User, UserList, UserBy
# from resources.store import Store, StoreList
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///data.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
api = Api(app)
@app.before_fir... |
class Nil:
pass
|
from django.conf import settings
if settings.USE_UPY_SEO and len(settings.LANGUAGES) > 1:
from modeltranslation.translator import translator, TranslationOptions
from upy.contrib.seo.models import MetaSite, MetaNode, MetaPage
class SiteTranslationOptions(TranslationOptions):
fields = ('title', 'des... |
from botnet.helpers import load_json, save_json, is_channel_name
def test_load_save_json(tmp_file):
data = {'key': 'value'}
save_json(tmp_file, data)
loaded_data = load_json(tmp_file)
assert loaded_data == data
def test_is_channel_name():
assert is_channel_name('#channel')
assert not is_chan... |
from flask_restx import Namespace
api_v1 = Namespace('Scholix Version 1.0', title='Scholexplorer API 1.0', description="scholexplorer API version 1.0")
import apis.v1.methods
|
"""Zero-shot Classification related modeling class"""
from typing import Dict, List, Optional
from pororo.tasks.utils.base import PororoBiencoderBase, PororoFactoryBase
class PororoZeroShotFactory(PororoFactoryBase):
"""
Zero-shot topic classification
See also:
https://joeddav.github.io/blog/20... |
import os
import random
import re
import requests
from PIL import Image
from validators.url import url
from userbot import CMD_HELP, bot
from userbot.tweet import (
bhautweet,
johnnytweet,
jtweet,
apjtweet,
moditweet,
sundartweet,
)
from userbot.utils import admin_cmd
EMOJI_PATTERN = re.compi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='blueprint_readthedocs',
version='1.0',
packages=find_packages(exclude=["tests", "tests.*"]),
license='MIT',
install_requires=[
],
extras_require={
'dev': [
'sphinx'
... |
import os
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
reqd_pkgs = [
"yt>=4.0",
"xmltodict",
]
setuptools.setup(
name="yt_aspect",
version="0.0.2",
author="Chris Havlin",
author_email="chris.havlin@gmail.com",
description="A yt p... |
# continue
i = 1
while i < 30:
i+=1 # careful with continue we need an increment to avoid forever loop
if i % 2 == 0:
print("Even Number!", i)
print("Jumping to the start of the loop")
continue # so continue jumps back to the start of the loop
# so sort of like else here
print("H... |
"""
Given a dictionary (tree), that can contains multiple nested structures.
Write a function, that takes element and finds the number of occurrences
of this element in the tree.
Tree can only contains basic structures like:
str, list, tuple, dict, set, int, bool
"""
from typing import Any
# Example tree:
exampl... |
import numpy as np
from PIL import Image
import vk4extract #<----module has to be in the same folder as this file to run
import os
# Change directory to the folder with Keyence .vk files
os.chdir(r'C:\Users\jespe\surfdrive\Thesis\microscopy\2021-09-21\TenCate_retake_20210920')
root = ('.\\')
vkimages = os.lis... |
# -*- coding: utf-8 -*-
description = 'system setup'
group = 'lowlevel'
sysconfig = dict(
cache = 'nectarhw.nectar.frm2',
instrument = 'Instrument',
experiment = 'Exp',
datasinks = ['conssink', 'filesink', 'daemonsink'],
notifiers = ['email', 'smser'],
)
modules = ['nicos.commands.basic', 'nicos.... |
#!/usr/bin/env python3
import os
import signal
import threading
from . import generic
import core.potloader as potloader
import core.utils as utils
from .dblogger import DBThread
class GenericPot(potloader.PotLoader):
""" Implementation of generic honeypot that listens on an arbitrary UDP port
and respo... |
"""Implementation of sample attack."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
#from cleverhans.attacks import FastGradientMethod
#from cleverhans.attacks import BasicIterativeMethod
from attacks import BasicIterativeMethod
import numpy a... |
from synapseConstantsMinimal import *
############# ORN to mitral!
############# Set these such that 100 ORNs at approx 50Hz make the mitral cell fire in the middle of its linear range.
#SYN_EXC_G = 1 * 8.6516e-9 # Siemens
#SYN_INH_G = 1 * 2.2126e-9 # Siemens
GRANULE_INH_GRADED = False#True
RECEPTOR_SATURATION = 1.0... |
#!/usr/bin/env python
# encoding: utf-8
# author: ryan_wu
# email: imitator_wu@outlook.com
# date: 2020-11-29 17:00:46
import os
import sys
import pickle
import argparse
import functools
import numpy as np
from sklearn import svm
from sklearn.model_selection import cross_val_score
PWD = os.path.dirname(os.path... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url, include
from delivery import deli, tasks
urlpatterns = [
url(r'^$', deli.delivery_list, name='delivery'),
url(r'^add/$', deli.delivery_add, name='delivery_add'),
url(r'^list/$', deli.delivery_list, name='delivery_list'),
ur... |
# Application condition
waitFor.id == max_used_id and not cur_node_is_processed
# Reaction
port = "NXT_PORT_S" + waitFor.Port
color_nxt_type = ""
color_str = waitFor.Color
if color_str == "Красный":
color_nxt_type = "NXT_COLOR_RED"
elif color_str == "Зелёный":
color_nxt_type = "NXT_COLOR_GREEN"
elif color_str ==... |
# Generated by Django 1.9.2 on 2016-03-01 09:56
from django.db import migrations, models
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="TestModel",
fields=[
(
... |
# a = [17, 37, 907, 19, 23, 29, 653, 41, 13]
# start = 1000186
# while all(start % n != 0 for n in a):
# start += 1
# print(start, [start % n == 0 for n in a])
# print((1000194-1000186)*13)
with open("data/day13.txt") as f:
lines = f.readlines()
print(lines)
lines = lines[1]
d = {int(num):i for i, num in en... |
'''
EBA & EIPOA rendering extensions
(c) Copyright 2015 Acsone S. A., All rights reserved.
'''
from arelle.ModelValue import qname
import arelle.EbaUtil as EbaUtil
qnFindFilingIndicators = qname("{http://www.eurofiling.info/xbrl/ext/filing-indicators}find:fIndicators")
# Note: Load and Update filing indicators are s... |
import pandas as pd
import os
import shutil
import time
from . import pdf_export
import csv
def tf_history_convert(history):
lossData = pd.DataFrame(history.history)
def torch_history_convert(history):
pass
def df_history_to_report(lossData,model_path,model_name,history,start,model):
if os.path.exists(mod... |
import discord, sqlite3
from discord.ext import commands
import modules.member_helper as helper
import modules.sql_init as sqlinit
sql = sqlinit.SQLInit()
class Quote():
def __init__(self, bot):
self.bot = bot
@commands.command()
async def quote(self, *, author : str = "Mitt Romney"):... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
import pytest
import hgvs.dataproviders.uta
import hgvs.location
import hgvs.parser
from hgvs.exceptions import HGVSError, HGVSDataNotAvailableError, HGVSInvalidIntervalError
from hg... |
###
Starting with a docstring in this
practice file
"""
a = "Hello, world!"
def print_var(a):
print(a)
print_var(a)
|
from django.contrib.auth.models import Group
from .base import Component
class Groups(Component):
field_name = "groups"
def parse(self):
for name, data in self.raw_data.items():
group = Group.objects.create(name=data["name"])
for username in data["users"]:
use... |
from package.puzzle_generator import *
def main():
p1 = Puzzle({
'A': [
Biconditional(
DisjunctiveStatement( # uncertain
IsOfType('B', Knight),
IsOfType('C', Knight),
IsOfType('B', Monk),
IsOfType(... |
from actions.demo_ban_user import DemoBanUserAction
from godmode.views.list_view import BaseListView
from godmode.models.base import BaseAdminModel
from godmode.widgets.base import BaseWidget
from groups.main_group import MainGroup
from database.db import User, pg_database
from widgets.boolean import BooleanReverseWidg... |
from setuptools import setup, find_packages
setup(name='deepART',
version='0.0.0',
description='A library containing adaptive resonance theory neural networks',
url='',
author='Nicholas Cheng Xue Law, Chun Ping Lim',
author_email='nlaw8@gatech.edu, lim.chunping@gmail.com',
license='... |
# -*- coding:utf-8 -*-
import subprocess
import os
class questionType:
def Person_type(self,list):
for word in list:
if word ==u'谁':
list.append(u'职业')
return list
def Number_type(self,list):
for word in list:
... |
# -*- coding: utf-8 -*-
import io
import re
from setuptools import setup
with io.open("README.md") as f:
long_description = f.read()
with io.open("fastapi_camelcase/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
setup(
name="fastapi_camelcase... |
#!/usr/bin/env python
from setuptools import setup,find_packages
setup(
name="fum-po",
version='0.1',
packages=find_packages(),
include_package_data=True,
install_requires=[
'click',
'pyyaml',
'couchdb',
],
entry_points='''
[console_scripts]
dream=fum... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^index/$', views.index),
url(r'^grades/$', views.grades),
url(r'^students/$', views.students),
url(r'^students1/$', views.students1),
url(r'^grades/(\d+)$', views.grade),
url(r'^students/(\d+)$', views.student),
ur... |
import speech_recognition as sr
import gtts
from playsound import playsound
import sys
from typing import Union, Any
from .AISayListenException import AISayListenAttributeTypeError
from .AISayListenException import AISayListenAttributeValueError
from .AISayListenException import AISayListenGttsError
from .AISayListenE... |
# Generated by Django 3.2.3 on 2021-07-22 17:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pythons_auth', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='profile',
old_name='id',
ne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.