content stringlengths 5 1.05M |
|---|
"""empty message
Revision ID: 1dda1de84b36
Revises:
Create Date: 2019-11-17 11:24:28.953423
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1dda1de84b36'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... |
from PyQt5.QtCore import (Qt)
from PyQt5.QtWidgets import (QDialog, QVBoxLayout, QHBoxLayout,
QLineEdit, QLabel, QComboBox,
QCheckBox, QFrame,
QDialogButtonBox, QMessageBox)
import os
class ExportLayerAnimDialog(QDialog):
d... |
from flask_wtf import FlaskForm
from wtforms import IntegerField, StringField, SubmitField
from wtforms.validators import InputRequired, NumberRange
class NameForm(FlaskForm):
name = StringField("Full Name", validators=[InputRequired("Please add a name.")]) # add validation here
submit = SubmitField("Submit... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import socket
import sys
import json
import select
import logging
#logging.basicConfig(level=logging.DEBUG)
udpTimeout = 4
ADDR = 'heizungeg'
PORT = 5023
def getcmds():
valid_cmds = ['getTemperature',
'getHumidity',
'getPressure... |
"""Load the TIMIT dataset."""
import os
from scipy.io import wavfile
from python.params import MIN_EXAMPLE_LENGTH, MAX_EXAMPLE_LENGTH
from python.dataset.config import CORPUS_DIR
from python.dataset.txt_files import generate_txt
# Path to the TIMIT dataset.
__NAME = 'timit'
__FOLDER_NAME = 'timit/TIMIT'
__TARGET_P... |
import contextlib
import io
from typing import ContextManager, TextIO
import pytest
from synctogit import config
class MemoryConfigReadWriter(config.ConfigReadWriter):
def __init__(self, text: str) -> None:
self.file = io.StringIO(text)
@contextlib.contextmanager
def reader(self) -> ContextMana... |
#!/usr/bin/env python
# Copyright (c) 2015, Andre Lucas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this... |
from cpu import AddressingMode
class OpCode:
def __init__(self,
code: 'u8',
mnemonic: "&'static str",
len: 'u8',
cycles: 'u8',
mode: 'AddressingMode'):
self.code = code
self.mnemonic = mnemonic
self.len = len
self.cycles = cy... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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 a... |
# -*- coding: utf-8 -*-
"""
extensions.py
:copyright: (c) 2017 by Joe Paul.
:license: see LICENSE for details.
"""
from flask_wtf.csrf import CSRFProtect
csrf_protect = CSRFProtect()
|
"""
Utils related to different file operations
Creation Date: April 2020
Creator: Mafuba09
"""
# imports...
import os
import time
EXPERIMENTS_FOLDER = 'experiments'
def get_experiment_dir(script_file_path: str, sub_name: str = '') -> str:
"""
Creates a result structure in the main directory for the correspo... |
path = '.\\08-File-Handling-Lab-Resources\\File Opener\\text.txt'
try:
file = open(path, 'r')
print('File found')
except FileNotFoundError:
print('File not found')
|
# Copyright 2019 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... |
"""
Mask R-CNN
Train on the LIP dataset
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
the command line as such:
# Train a new model starting from pre-trained COCO weights
python3 humanparsing.py train --d... |
"""Tests for privacy.util.logging"""
from privacy.util import logging
def test_mock_logger():
class MockLogger(logging.LoggingClass):
pass
assert isinstance(MockLogger().log, logging.logging.Logger)
|
"""Useful mixins for code checking tools.
Version Added:
3.0
"""
from __future__ import unicode_literals
import os
import re
from reviewbot.config import config
from reviewbot.utils.filesystem import chdir, ensure_dirs_exist
from reviewbot.utils.process import execute
from reviewbot.utils.text import split_comm... |
import re
import random
import os
methodTmpl = """
func (r *{$typeName}Resolver) {$method}() {$fieldType} {
{$value}
return {$res}
}
"""
tmplHeader = """
package resolver
{$import}
type {$typeName}Resolver struct {
//m *model.{$typeName}
}
"""
importTmplOrigin = 'import (\n //"pinjihui.com/pinjihui/mo... |
from decimal import ROUND_DOWN, Decimal
from subprocess import check_output
def crypto_truncate(amount):
d = Decimal(amount)
return d.quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
def run(args, split="\n"):
output_byt = check_output(args)
return output_byt.decode("utf-8").split(split)
|
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
from django.apps import AppConfig
class ToolConfig(AppConfig):
name = 'tool'
|
from setuptools import setup
setup(
name='html-compiler',
version='0.1',
author='Hsuan-Hau Liu',
description='A simple and lightweight html compiler.',
packages=['html_compiler',],
install_requires=['beautifulsoup4'],
entry_points={
'console_scripts': [
'html_compiler=ht... |
# -*- coding: utf-8 -*-
from datetime import datetime, timezone
import time
import threading
import queue
import tidegravity as tide
def point_correction(lat, lon, alt=0, date=datetime.utcnow()):
"""Solve tidal correction for a static point and time"""
gm, gs, g0 = tide.solve_longman_tide_scalar(lat, lon, al... |
import unittest
from jina.main.parser import set_pea_parser, set_pod_parser, set_gateway_parser
from jina.peapods.gateway import GatewayPea
from jina.peapods.pea import BasePea
from jina.peapods.pod import BasePod, GatewayPod, MutablePod, GatewayFlowPod, FlowPod
from tests import JinaTestCase
class PeaPodsTestCase(J... |
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring,line-too-long
from eze.core.reporter import ReporterMeta
from tests.__fixtures__.fixture_helper import get_snapshot_directory
class ReporterMetaTestBase:
ReporterMetaClass = ReporterMeta
SNAPSHOT_PREFIX = "reporter... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = "postgresql://ed_user:ed_pass@localhost/stardrive_test"
TESTING = True
CORS_ENABLED = True
DEBUG = False
DEVELOPMENT = False
MASTER_URL = "http://localhost:5000"
MASTER_EMAIL = "daniel.h.funk@gmail.com"
MASTER_PASS = "dfunk7"
MI... |
"""
Copyright 2020 Skyscanner Ltd
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 dis... |
# -*- coding: utf-8 -*-
# pylint: disable=C0103
"""
This module contains a basic Word Model
"""
from __future__ import annotations
from flask_sqlalchemy import BaseQuery
from loglan_db import db
from loglan_db.model_db import t_name_words, \
t_name_types, t_name_events
from loglan_db.model_db.base_author import ... |
class IncorrectParametersException(Exception):
pass
class APIErrorException(Exception):
pass
|
from __future__ import print_function, division
import numpy as np
from .fitmodel import FitModel
class Gaussian(FitModel):
"""Gaussian fitting model.
Parameters are xoffset, yoffset, sigma, and amp.
"""
def __init__(self):
FitModel.__init__(self, self.gaussian, independent_vars=['x'])
... |
from setuptools import setup, find_packages
setup(name='django-response-mid',
version='2.1',
description='django response middleware',
classifiers=[
'Programming Language :: Python',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
],
... |
import pandas as pd
from neatrader.utils import small_date, from_small_date
from ta.utils import dropna
from ta.trend import MACD
from ta.volatility import BollingerBands
from ta.momentum import RSIIndicator
class TrainingSetGenerator:
def __init__(self, source_path):
self.source_path = source_path
d... |
"Test calltip, coverage 60%"
from idlelib import calltip
import unittest
import textwrap
import types
import re
# Test Class TC is used in multiple get_argspec test methods
class TC():
'doc'
tip = "(ai=None, *b)"
def __init__(self, ai=None, *b): 'doc'
__init__.tip = "(self, ai=None, *b)... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Profile(models.Model):
profile_photo = models.ImageField()
bio = models.CharField(max_length = 60)
user = models.OneToOneField(User,on_delete=models.CASCADE)
def __str__(self):
return ... |
# Generated by Django 3.0.5 on 2021-11-22 11:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('library', '0008_auto_20200412_1408'),
]
operations = [
migrations.AlterField(
model_name='book',
name='category',
... |
#!/usr/bin/env python
import rospy
import socket
from math import sqrt
from mavros_msgs.msg import RCIn
from sensor_msgs.msg import NavSatFix
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus
from system_monitor.msg import VehicleState
'''
This node verifies health for all modules, according to each m... |
#!/usr/bin/python
print('EV - initiating.')
import os
import pandas as pd
cwd = os.getcwd()
input_folder = "0_input"
prices_folder = "data"
output_folder = "0_output"
temp_folder = "temp"
temp_EV = "EV"
token_df = pd.read_csv(os.path.join(cwd,"0_api_token.csv"))
token = token_df.iloc[0,1]
url1 = "https://financialmo... |
import scrapy
from alleco.objects.official import Official
from alleco.objects.official import getAllText
from re import sub
class monroeville_b(scrapy.Spider):
name = "monroeville_b"
muniName = "MONROEVILLE"
muniType = "BOROUGH"
complete = True
def start_requests(self):
urls = ['https://www.monroe... |
import turtle as t
"""
多行
注释
可以
不错
"""
# 单行注释
print('Hello World')
# t.setup(width=0.6, height=0.6)
# t.pensize(4)
# t.pencolor('red')
# t.forward(100)
# t.right(90)
# t.forward(100)
# t.right(90)
# t.forward(100)
# t.right(90)
# t.forward(100)
# t.mainloop()
message = "hello world again"
print(message.islower())
... |
"""Remove radial distortion.
"""
from __future__ import division
import scipy as sp
import scipy.optimize
import scipy.ndimage
from skimage.transform import warp
import matplotlib.pyplot as plt
import numpy as np
import math
import sys
class RadialDistortionInterface:
"""Mouse interaction interface for radial... |
from numpy import array, abs
try:
import hermes_common._hermes_common
normal_import = True
except ImportError:
normal_import = False
if normal_import:
# Running in h1d, h2d or h3d:
from hermes_common._hermes_common import CooMatrix, CSRMatrix, CSCMatrix
else:
# Running from inside hermes_commo... |
"""
Allows users to authenticate a service account or installed application using
either:
* A .json key file for service accounts (must be in root directory of
where your script is run)
* A .env file with a path to the .json key for service accounts
* If no .env file is provided the environment variab... |
import itertools
from syloga.transform.get_assignments import get_assignments
from syloga.ast.traversal.iter_dependees import iter_dependees
from syloga.ast.traversal.iter_dependencies import iter_dependencies
from syloga.utils.functional import compose
from syloga.utils.functional import iter_unique
from syloga.ast... |
##################################################
## A helper to summarize the statistics from a ##
## concurrent run for the query workload. ########
##################################################
import argparse
import pprint
import glob
import os
import csv
import numpy as np
if __name__ == "__main__":
... |
# coding: utf-8
r"""
Run MasterInterpreter on TestBenches, run the JobManager command, and compare Metrics to MetricConstraints.
e.g.
META\bin\Python27\Scripts\python META\bin\RunTestBenches.py --max_configs 2 "Master Combined.mga" -- -s --with-xunit
"""
import os
import os.path
import operator
import unitte... |
'''
Author: your name
Date: 2022-02-14 11:41:47
LastEditTime: 2022-02-14 12:10:52
LastEditors: Please set LastEditors
Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
FilePath: \Work\Lensi\download_try.py
'''
from urllib.request import urlretrieve
url... |
from __future__ import print_function, unicode_literals
from PyInquirer import style_from_dict, Token, prompt, Separator
from examples import custom_style_1
from examples import custom_style_2
from examples import custom_style_3
from pprint import pprint
import os, errno
import wget
import urllib.request
import shutil
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import json
import re
from datetimewidget.widgets import DateTimeWidget
from django import forms
from django.utils.translation import ugettext_lazy as _
from django_summernote.widgets import SummernoteInplaceWidget
from validate_email imp... |
"""
Sample basic DAG which dbt runs a project
"""
import datetime as dt
from airflow import DAG
from airflow.utils.dates import days_ago
from airflow_dbt_python.dbt.operators import DbtRunOperator
with DAG(
dag_id="example_basic_dbt_run",
schedule_interval="0 * * * *",
start_date=days_ago(1),
catchup=... |
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Retrieve a record"
class Input:
EXTERNAL_ID_FIELD_NAME = "external_id_field_name"
OBJECT_NAME = "object_name"
RECORD_ID = "record_id"
class Output:
RECORD = "record"
class GetRecordInput... |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 26 15:38:12 2016
@author: raissaphilibert
"""
import datetime as dt # Python standard library datetime module
import numpy as np
from netCDF4 import Dataset # http://code.google.com/p/netcdf4-python/
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Ba... |
import asyncio
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP, StartTime, bot
from userbot.utils import bash, edit_or_reply, zelda_cmd
hpx_thumb = "https://telegra.ph/file/6c06e1d0a0183d0f4da06.jpg"
@zelda_cmd(pattern="hpx (.*)")
async def amireallycuan(cuan):
user = await bot.get_... |
import numpy as np
from xbbo.search_algorithm.base import AbstractOptimizer
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from . import alg_register
# from xbbo.configspace.feature_space import Uniform2Gaussian
from xbbo.search_algorithm.base import AbstractOptimizer
from xbbo.core.tri... |
import uuid
from django.db import models
class BaseObject(models.Model):
class Meta:
abstract = True
uid = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4)
created_at = models.DateTimeField(auto_now_add=True, editable=False)
modified_at = models.DateTimeField(auto_now=T... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='django-timecode',
version='0.1.4',
description='Provides classes for working with timecodes (as used in the video industry).',
long_description=open('README.md').read(),
author='Joe Rickerby',
author_ema... |
import torch
import os
import urllib
from transformers import ( BertConfig, BertForSequenceClassification, BertTokenizer,
GPT2Config, GPT2LMHeadModel, GPT2Tokenizer)
class TabooBasicRuler:
def __init__(self):
# ppl ruler
config_class, model_class, tokenizer... |
from argparse import ArgumentParser
import pytest
from espnet2.bin.enh_asr_train import get_parser
from espnet2.bin.enh_asr_train import main
def test_get_parser():
assert isinstance(get_parser(), ArgumentParser)
def test_main():
with pytest.raises(SystemExit):
main()
|
import types
from sqlalchemy import Column, String, BigInteger, Integer, DateTime, ForeignKey, Sequence, Table
import datetime
from models.BaseModel import BaseModel
#from models.FacilitiesRelated.RoomModel import RoomModel
# EventRoomModel = Table('events_rooms', BaseModel.metadata,
# Column('id', BigIntege... |
class Currency:
def __init__(self, code: str):
self.__code = code
def __repr__(self):
return self.retrieve_symbol()
@property
def code(self):
return self.__code
def retrieve_symbol(self):
return self._currency_codes(self.code)
@staticmethod
def _currency_c... |
"""Add on-delete to FKs.
Revision ID: 5ba9cd4297ea
Revises: d8fa81723cf3
Create Date: 2021-11-03 14:28:43.001481
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "5ba9cd4297ea"
down_revision = "d8fa81723cf3"
branch_labels = None
depends_on = None
def upgrade():
op.drop_constraint... |
import random
import math
import matplotlib.pyplot as plt
import matplotlib.colors
import numpy as np
np.random.seed(19680801)
N = 1000
fig, ax = plt.subplots()
dots = np.arange(N)
# Ici, Grid est pas super utile
class Grid:
def __init__(self, size_x, size_y):
self.size_x, self.size_y = size_x, size_y... |
#// //#
#// _oo0oo_ //#
#// o8888888o //#
#// 88" . "88 //#
#// (| -_- |) //#
#// 0\ = /0 //#
#//... |
import os
import pytest
from shapely.geometry import Point, Polygon
import geopandas as gp
from osmox import config, build, helpers
fixtures_root = os.path.abspath(
os.path.join(os.path.dirname(__file__), "fixtures")
)
toy_osm_path = os.path.join(fixtures_root, "toy.osm")
park_osm_path = os.path.join(fixtures_roo... |
__title__ = "playground"
__author__ = "murlux"
__copyright__ = "Copyright 2019, " + __author__
__credits__ = (__author__, )
__license__ = "MIT"
__email__ = "murlux@protonmail.com"
from logging import Logger
from typing import Any, Dict
from playground.abstract import Integrator
from playground.util import setup_logger... |
from django.contrib import admin
from .models import Bookmark
# Register your models here.
admin.site.register(Bookmark)
|
import argparse
import cntk as C
import numpy as np
from azureml.core.run import Run
parser = argparse.ArgumentParser()
parser.add_argument('--data-folder', type=str, dest='data_folder', default='./')
args = parser.parse_args()
run = Run.get_context()
run.log('cntk', C.__version__)
run.log('numpy', np.__version__)
ru... |
#!/usr/bin/env python3
# Copyright (c) 2019 The NRDI developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Covers the scenario of a valid PoS block where the coinstake input prevout is spent on main chain,
but not on the ... |
import m.common as common
class StatementBase(common.HelpClass):
def __init__(self):
pass
def dump(self, fh):
pass
def dumplog(self, log, context=""):
log.info("%sStatement %s", context, self.__class__.__name__)
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-03 11:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='DataSche... |
from pyopenproject.api_connection.exceptions.request_exception import RequestError
from pyopenproject.api_connection.requests.get_request import GetRequest
from pyopenproject.business.exception.business_error import BusinessError
from pyopenproject.business.services.command.find_list_command import FindListCommand
from... |
"""
Programa que leia um numero inteiro qualquer e peça para o usuário escolher qual será a base de conversão
1 - para binário
2 - para octal
3 - para hexadecimal
"""
num = int(input('Digite um numero inteiro: '))
print('''
1 - Converter para BINÁRIO
2 - Converter para OCTAL
3 - Converter para HEXADECIMAL
''')
opcao ... |
while True:
dados = []
matriz = []
n = int(input())
if n == 0:
break
for linha in range(0, n):
for coluna in range(0, n):
dados.append(0)
matriz.append(dados[:])
dados.clear()
resultado = 1
cima = 0
esquerda = 0
baixo = n - 1
direita = ... |
"""Loads a ggcm log file
Parses the view info """
from __future__ import print_function
import itertools
import re
import numpy as np
from viscid.readers import vfile
# FIXME: This lookup table is based on an enum in ggcm_mhd.h, ie, the numerical
# values (index in this list) could change in the future - b... |
#Decompiled At:Thu Mar 12 20:23:01 2020
import os, sys, time, hashlib, json, requests, mechanize, urllib, cookielib, re
from multiprocessing.pool import ThreadPool
from requests.exceptions import ConnectionError
from mechanize import Browser
reload(sys)
sys.setdefaultencoding('utf8')
br = mechanize.Browser()
br.set_h... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 23 01:01:43 2017
@author: abhisheksingh
"""
#%%
import cv2
import numpy as np
import os
import time
import gestureCNN as myNN
minValue = 70
x0 = 400
y0 = 200
height = 200
width = 200
saveImg = False
guessGesture = False
visualize = False
lastgesture = -1
kernel = ... |
from math import inf, isinf
from typing import List, Optional
from hwt.doc_markers import internal
from hwt.hdl.types.hdlType import HdlType
from hwt.serializer.generic.indent import getIndent
class HStream(HdlType):
"""
Stream is an abstract type. It is an array with unspecified size.
:ivar ~.element_t... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
MENUBAR
MenuBar class to display the Menu title.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of charge, to any... |
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests.testapp',
]
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': '127.0.0.1:6379',
'OPTIONS': { # optional
'DB': 15,
... |
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from .gen_inbox.inbox import TInboxService
class Client:
def __init__(self, ip_address, port, timeout=10000):
self._socket = TSocket.TSocket(ip_address, port)
self._socket.setTimeout(tim... |
from flask import Blueprint
from pf_auth.dto.operator_dto import LoginResponseDto, LoginDto, RefreshTokenDto, LoginTokenDto, RefreshTokenResponseDto
from pf_auth.service.operator_service import OperatorService
from pfms.swagger.pfms_swagger_decorator import simple_get, pfms_post_request
operator_controller = Blueprin... |
# Why this file exists:
# This file exists because of the circular dependency between emu.instruction
# and util.parse. doing any sort of `from util.parse import` in emu.instruction
# will fail because util.parse also requires emu.instruction.Instruction
# however, but that hasn't been loaded yet at import time. So we ... |
import abc
from utils.mixins import RenderMixin, CheckMethodsMixin
class View(RenderMixin, CheckMethodsMixin, abc.ABC):
_methods = [
'render',
]
_columns_width = [6, 3]
def __init__(self, **kwargs):
super().__init__(**kwargs)
self._check_class()
|
# coding: utf-8
from django.contrib import admin
from .models import Task,Attendance,Emergency
# Register your models here.
admin.site.register(Task)
admin.site.register(Attendance)
admin.site.register(Emergency) |
"""Game of ninja for geometric shapes."""
import numpy as np
import cv2
def dist(x1, x2, y1, y2):
return ((x2 - x1) ** 2. + (y2 - y1) ** 2.) ** 0.5
class Ninja:
frame_name = 'ninja'
def __init__(self, width: int, height: int):
self.shapes = []
self.garbage = []
self.probabilit... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from numpy import array, linspace, meshgrid, pi, zeros, sin, sqrt, arctan2
from numpy import save as npsave
from numpy import load as npload
from numpy.fft import fft, ifft
from scipy.ndimage import geometric_transform as transform
import argparse
import os
import sys
impor... |
import webbrowser
from ..utils import coveralls_project_exists
def enable_coveralls(automatically_open_browser: bool):
"""Handle guided coveralls."""
if not coveralls_project_exists():
print("You still need to create the coveralls project.")
if automatically_open_browser:
input("Pr... |
import pickle
import shutil
from pathlib import Path
from flask import request, Response
from hive.settings import hive_setting
from hive.util.auth import did_auth
from hive.util.common import deal_dir, get_file_md5_info, gene_temp_file_name, get_file_checksum_list, \
create_full_path_dir
from hive.util.constants ... |
import collections.abc
import logging
import os
import pkgutil
from collections import namedtuple
from urllib.request import _parse_proxy
log = logging.getLogger(__name__)
def get_upstream_proxy(options):
"""Get the upstream proxy configuration from the options dictionary.
This will be overridden with any co... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import collections
import json
import os
import secrets
import shutil
import string
import threading
import time
from multiprocessing.pool import ThreadPool
import yaml
from maro.cli.grass.executors.grass_executor import GrassExecutor
from mar... |
#!/usr/bin/env python
print ('hello')
|
#!/usr/bin/env python2
#
# Print out a few IEEE double representations related to the Duktape fastint
# number model.
#
# NOTE: signed zero does not work correctly here.
#
import struct
import math
def isFastint(x):
if math.floor(x) == x and \
x >= -(2**47) and \
x < (2**47) and \
True: # FIXME: not... |
#!/usr/bin/env python3
import os
from google.cloud import bigquery
import click
@click.command()
@click.option('--credentials', '-c', type=click.Path(exists=True), help='Path to your google API key, json file')
@click.option('--output', '-o', type=click.Path(exists=False), help='Output file (defaults to scikit-hep-FR... |
for the selected text
print('hello')
print('world')
print('!') |
import chess
#creates the board
board = chess.Board()
#shows chess board
print(board)
repeat = 1
while repeat < 6:
board.legal_moves
#White move
Whitemove = input("Enter your move in notation form: ")
board.push_san(Whitemove)
print(board)
Blackmove = input("Enter your move: ")
board.push_san(Blackmove)
pri... |
from a2s import A2S
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
import hashlib
from uuid import uuid4
key = uuid4().bytes
cipher = A2S(key)
p = []
c = []
for _ in range(3):
plaintext = uuid4().bytes
p.append(plaintext.hex())
ciphertext = cipher.encrypt_block(plaintext)
... |
class RouterOsBinaryResource(object):
def __init__(self, communicator, path):
self.communicator = communicator
self.path = clean_path(path)
def get(self, **kwargs):
return self.call('print', {}, kwargs)
def get_async(self, **kwargs):
return self.call_async('print', {}, kwar... |
bicycles = ['tek','cannondale','redline','specialized']
print (bicycles)
print(bicycles[0])
print(bicycles[0].title())
print(bicycles[-1])
# f-strings
message= f"My first bike was a {bicycles[0].title()}."
print(message)
motorcycles = ['honda','yamaha', 'suzuki']
print(motorcycles)
# replace
motorcycles[0] = 'ducati'
p... |
"""
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
from django.core.mail import send_mail
from meiduo_mall.settings import dev
import logging
logger = logging.getLogger('django')
from celery_tasks.main import celery_app
@celery_app.task(name='send_verify_main')
def send_verify_email(to_email, verify_url):
# 标题
subject = '商城邮箱验证'
# 发送内容
html_message = ... |
n=int(input());r=""
for _ in range(n):
c=[False]*26;a=0
s=input();l=len(s)
for i in range(l):
c[ord(s[i])-ord('A')]=True
for i in range(26):
if not c[i]:
a+=i+65
r+=str(a)+'\n'
print(r,end="")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.