content
stringlengths
5
1.05M
# -*- coding: utf-8 -*- from . import auth from . import events from . import player from . import queue handlers = { 'auth.login': auth.login, 'auth.logout': auth.logout, 'auth.authenticate': auth.authenticate, 'auth.register': auth.register, 'auth.update_profile': auth.update_profile, 'auth....
from dataclasses import dataclass @dataclass(frozen=True) class CameraObjectDetectionData: deplay_to_trigger_motion: int deplay_to_trigger_no_motion: int
from autogoal.contrib import find_classes from autogoal.kb import ( algorithm, Sentence, Seq, Word, Stem, build_pipeline_graph, Supervised, Label, ) from autogoal.grammar import generate_cfg, Symbol class Algorithm: def __init__( self, tokenizer: algorithm(Sentence,...
# Generated by Django 3.0.7 on 2020-11-25 16:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0002_auto_20201125_1118'), ] operations = [ migrations.AlterModelOptions( name='activity', options={'verbose...
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
# -*- coding: utf-8 -*- """ Population Outreach Module - Controllers """ module = request.controller if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------------------------------------------------- def index(): """ Module's Home Pag...
f = open("IND_stocks.csv") name = "rel" e = "NSI" print("NSE STOCKS") arr = [] for i in f: a = i.split(',') b = str(a[1]).lower() if name in b and a[2] == e: d = {"symbol": a[0], "name": a[1]} arr.append(d) print(arr)
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.db.models.signals import pre_delete, post_save from django.dispatch import receiver # ============================== # Book # ============================== class Bo...
# -*- coding: utf-8 -*- table = [ { 'id': 500, 'posizione_lat': '45.467269', 'posizione_long': '9.214908', }, { 'id': 501, 'posizione_lat': '45.481383', 'posizione_long': '9.169981', } ]
# 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...
#!/usr/bin/env python3 import os import time import trtlab import onnx_utils as utils import numpy as np import matplotlib.pyplot as plt import mxnet as mx from mxnet.gluon.data.vision import transforms from imagenet_labels import labels import click tests = {} def tensorrt_init(engines): manager = trtlab.I...
from aeternity import utils, defaults, identifiers, signing, compiler, hashing from aeternity.contract import Contract from munch import Munch class ContractNative(object): CONTRACT_ERROR_TYPES = ["revert", "abort", "error"] def __init__(self, **kwargs): """ Initialize a ContractNative obje...
import datetime from flask import url_for from app import db class Hire(db.Document): name = db.StringField(required=True) telephone = db.StringField(required=True) company = db.StringField(required=True) numberOfEmployee = db.IntField(required=True) numberOfDeveloper = db.IntField(required=True)...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libmad(AutotoolsPackage): """MAD is a high-quality MPEG audio decoder.""" homepage = ...
#!/usr/bin/env python # Copyright 2008-2014 Nokia Solutions and Networks # # 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 r...
import os import functools from flask import Flask, \ make_response app = Flask(__name__) app.config.from_envvar('FLASKR_SETTINGS', silent=True) if os.getenv('FLASK_ENV') == 'production': app.config.from_object('config.ProductionConfig') else: app.config.from_object('config.DevelopmentConfig...
# Copyright 2019 Alibaba Cloud 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 required by applicable la...
import pyre_test def cb(send, *args): send( False, b"HTTP/1.1 200 OK\r\n" b"Content-Length: 13\r\n" b"Server: Pyre\r\n" b"\r\n" b"Hello, World!" ) print("wew") pyre_test.create_server("127.0.0.1", 5050, cb, 5)
import musdb import math import numpy as np import torch from torch.utils.data import Dataset from tqdm import tqdm import random from lasaft.utils.fourier import get_trim_length class MusdbLoader(object): def __init__(self, musdb_root='data/musdb18_wav/', is_wav=True): self.musdb_train = musdb.DB(root...
from typing import List from codegen.ast import * from codegen.visitor import Visitor from codegen.operands import * from codegen.precision import * class InlinePrinter(Visitor): show_comments = True indent = " " depth = 0 lmargin = 0 rmargin = 60 vpadding = False output = None stack...
import os import sys sys.path.append(os.path.abspath("")) class environment_variables: def __init__(self): self.app_service_url = os.environ['APP_SERVICE_URL'] self.aad_app_client_id = os.environ['AAD_APP_CLIENT_ID'] self.aad_app_client_password = os.environ['AAD_APP_CLIENT_PASSWORD'] ...
# Demo Python Tuples ''' Tuple A tuple is a collection which is ordered and unchangeable. In Python tuples are written with round brackets. Tuple Methods Python has two built-in methods that you can use on tuples. count() Returns the number of times a specified value occurs in a tuple index() Searches the tuple for...
import numpy as np import csv import gensim.models import time from utils import one_hot_decode_seq_vanilla #todo could make this doable via command line arguments and export / document data processing process via a bash script startt = time.time() data_path = '../../data' embedding_model = gensim.models.Doc2Vec.load...
import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../AnnoDomini'))) import AnnoDomini.AutoDiff as AD import numpy as np from matplotlib import pyplot as plt from BFGS import BFGS def f(a...
from .BME280 import BME280, BME280Exception from .TSL2561 import TSL2561, TSL2561Exception from .YL83 import YL83, YL83Exception
import click from ...library.commands.pin import pin FAILURE_EXCEPTIONS = ( RuntimeError, AssertionError, AttributeError, FileNotFoundError, NotADirectoryError, ) @click.command(name="pin") @click.option( "--development", is_flag=True, default=False, help="Pin the versions of de...
# Author: Govind Gnanakumar import re # needs optimizations for larger lists, like: # asynchronously filtering suggestions so not all of them are pupulated at once # or just showing some x top results rather than all of them at once # add smartcase stuff # populate with possible words collection = [] def fuzzyfind...
import asyncio import asynctest import asynctest.mock as amock from opsdroid import events from opsdroid.cli.start import configure_lang from opsdroid.connector import Connector from opsdroid.core import OpsDroid class TestEventCreator(asynctest.TestCase): """Test the opsdroid event creation class""" async...
import time import numpy as np import matplotlib.pyplot as plt from Utils import * from PerformanceMeasure import * from multiprocessing import Pool def run(args): x_0, r = args X = [] x = x_0.copy() X.append(x_0.copy()) # algorithm 1, line 2 for n in range(N): # optional: if...
#! /usr/bin/env python """ # This file is part of the Astrometry.net suite. # Licensed under a 3-clause BSD style license - see LICENSE Convert an image in a variety of formats into a pnm file """ from __future__ import print_function from __future__ import absolute_import import sys import os import os.path import te...
"""empty message Revision ID: 88dd782ecb37 Revises: 6c9b5df74f75 Create Date: 2018-01-12 21:17:58.142317 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '88dd782ecb37' down_revision = '6c9b5df74f75' branch_labels = None depe...
# Plugin by @Rishisuperyo # Animation by kiddo # kang =gey ,keep credits = cool coder 😶 # usage .gim from userbot.utils import admin_cmd @borg.on(admin_cmd(pattern=r"gim", outgoing=True)) async def hapy(event): a = "🎱➖✊➖➖✊➖🎱\n🌟 \ / 🌟\n⭐ \😁/ ⭐\n✨ 🎽 ...
import numpy as np from sklearn.linear_model import LinearRegression a = np.array([1, 2, 3, 4, 5, 6]) b = np.array([10, 20, 30, 40, 50, 60]) test = np.array([8, 9, 10]) model = LinearRegression() model.fit(a.reshape(-1, 1), b) model.predict(test.reshape(-1, 1))
import operator import pickle from functools import reduce from moon_toe import available_moves, tuple_move_to_flat import numpy as np import tensorflow as tf def create_network(input_nodes, hidden_nodes, output_nodes=None, output_softmax=True): """Create a network with relu activations at each layer Args: ...
import copy import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator from matplotlib.colors import BoundaryNorm from mcstasscript.data.data import McStasData def _fmt(x, pos): """ Used for nice formatting of powers of 10 when plotting logarithmic """...
from pylps.core import * from pylps.lps_data_structures import LPSConstant from pylps_vis.visualiser import * from kivy.uix.label import Label from collections import defaultdict initialise(max_time=10) create_fluents('location(_, _)') create_actions('move(_, _)', 'say(_)') create_events( 'clear(_)', 'make_tower(...
import os import sys import numpy as np import pandas as pd import tensorflow as tf from Bio import SeqIO from numpy import array from numpy import argmax from warnings import simplefilter from contextlib import redirect_stderr from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncod...
from wpilib.command import Command from subsystems import shortarm, longarm import logging import oi class TankArm(Command): def __init__(self): super().__init__() self.longarm = longarm.LongArm() self.shortarm = shortarm.ShortArm() self.requires(self.shortarm) self.requi...
from django.contrib import admin from .models import Factura, FacturaProducto admin.site.register(Factura) admin.site.register(FacturaProducto)
# -*- coding: utf-8 -*- # Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy # System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import pandas as pd import numpy as np f...
#!/usr/bin/env python3 """ """ import argparse from .seek import seek from .load import load from .index import index from .table import table def main() -> int: params = {"description": __doc__} parser = argparse.ArgumentParser(**params) parser.set_defaults(func=None) subparsers = parser.add_subpar...
from __future__ import absolute_import from logging import getLogger, NullHandler logger = getLogger("i18n_core") logger.addHandler(NullHandler()) try: import __builtin__ as builtins except ImportError: import builtins import ctypes import datetime import locale import os import platform import...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Christian Heider Nielsen" __doc__ = r""" Created on 07/07/2020 """ from neodroidvision.classification.architectures.contrastive.contrastive_learner import ( ContrastiveLearner, ) if __name__ == "__main__": def simclr(): ...
import ROOT import time from copy import deepcopy from collections import OrderedDict import os ############################################################# ############### Configure Logging import logging log_format = ( '[%(asctime)s] %(levelname)-8s %(funcName)-20s %(message)s') logging.basicConfig( filename...
import tensorflow as tf import constants model = tf.keras.models.Sequential([ tf.keras.layers.Conv1D(64, 5, input_shape=(constants.capture_dimensions[1], constants.capture_dimensions[0])), tf.keras.layers.Conv1D(64, 5, input_shape=(constants.capture_di...
from django.conf.urls import url, include from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns=[ url('^$',views.welcome,name = 'welcome'), url(r'^accounts/', include('registration.backends.simple.urls')), url(r'^new/post$', views.new_post, name='new-...
from burp import IBurpExtender import jarray import os #Adding directory to the path where Python searches for modules module_folder = os.path.dirname('/home/arvind/Documents/Me/My_Projects/Git/WebAppsec/BurpExtensions/modules/') sys.path.insert(0, module_folder) import webcommon unique_list_of_urls=[] class BurpExt...
import requests # testing modes QUESTION_ADD_TEST = 1 QUESTION_GET_TEST = 2 DEFINITION_ADD_TEST = 3 # current mode (change this) mode = DEFINITION_ADD_TEST # sample data sample_question_data = { "explanation": "nothing here", "category": "test cat", "level": 2, "question": "helloworld", "option1"...
# 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...
#!/usr/bin/env python """ temperature_analysis.py: simulate python program for absorption calculation for different temperature analysis """ __author__ = "Chakraborty, S." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "Chakraborty, S." __emai...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Inheritence around add_cmdline_args can be tricky. This serves as an example, and verifies inheritence is behaving ...
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy as np include_dirs = [np.get_include()] library_dirs = [] #conda include path support import os if 'PREFIX' in os.environ: sys_include = os.path.join(os.environ['PREFIX'], 'include') ...
#!/usr/bin/env python import os import numpy as np import tables import pandas from opty.utils import parse_free def compute_gain_error(filename): # root mean square of gain error df = load_results_table(filename) rms = [] for run_id, sim_dur, sample_rate in zip(df['run_id'], ...
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SSL_DISBALE = False SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_RECORD_QUERIES = True MAIL_SERVER = 'smtp.googlemail.com' MAIL_PO...
""" Reads a file that was generated by GenerateDyadicGraph.py, and returns a reduced form, to account for aggregation. So far only works with simple aggregation (multiplicities = 1), and no fractional/weighted values """ import os import pandas as pd import numpy as np def read(fn="./data/dyadic_edges.csv", sep=" "...
from BioModelsDAG import extract_data, build_graph, DerivedModelParser from BioModelsDAG.utils import timeit, yield_model_paths @timeit def main(): import networkx filepaths = yield_model_paths() data = extract_data(filepaths, parser=DerivedModelParser()) graph = build_graph(data) networkx.write...
import numpy as np import pandas as pd from Happy_4 import solar_input, wind_input """ check if input year is in the right range, check if input location is in the right range, check if output of daily solar is right value, check if out of daily solar has right day value """ def test_year_value_input(): # check if i...
# Generated by Django 2.0.13 on 2019-03-21 23:51 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [("organizations", "0003_field_fix_and_editable")] operations = [ migrations.CreateModel( ...
# Copyright 2021 Jeremy Schulman, nwkautomaniac@gmail.com # # 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 applicabl...
from django import forms from django.core.exceptions import ValidationError from django.contrib.auth.models import User class RegisterForm(forms.Form): username = forms.CharField( min_length=4, max_length=488, required=True, label="用户名", error_messages={ "min_le...
from NCBounds.ArrivalCurve import ArrivalCurve from NCBounds.Flow import Flow from NCBounds.ServiceCurve import ServiceCurve from NCBounds.Server import Server from NCBounds.Network import Network, Ring, TwoRings from NCBounds.FeedForwardAnalyzer import FeedForwardAnalyzer, SFAFeedForwardAnalyzer, ExactFeedForwardAnaly...
# class definition for TTTBase # this is a class that stores the game history as a file of dict, in json format # written by Russell on 5/9/20 # modified on 3/6/21 by Russell to fix new file ('file does not exist') bug import json class TTTBase: # data_records = [ # {"result": "X", "game": [0, 6, 1, 4, 2...
from wavetorch import WaveSource, WaveIntensityProbe def setup_src_coords(src_x, src_y, Nx, Ny, Npml): if (src_x is not None) and (src_y is not None): # Coordinate are specified return [WaveSource(src_x, src_y)] else: # Center at left return [WaveSource(Npml + 20, int(Ny / 2))]...
import numpy as np import torch import math import torch.utils.data as Data from torch.autograd import Variable from EvalBox.Evaluation.evaluation import Evaluation from EvalBox.Evaluation.evaluation import MIN_COMPENSATION class TKNC(Evaluation): def __init__(self, outputs_origin,outputs_adv, device, model, **kw...
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import distutils.spawn import os import shutil import platform import re import sys import subprocess import xml.etree.ElementTree as EleTr from datetime import datetime from functools import partial from collections import defaultdict try: from PyQt5.Q...
import time import math import numpy as np from ...thread import run # noqa: F401 from ...base import StreamNone, StreamEnd # noqa: F401 from ..base import _wrap, FunctionWrapper # noqa: F401 from .ws import WebSocket, SyncWebSocket # noqa: F401 from .http import HTTP, SyncHTTP # noqa: F401 from .socketio import ...
from unittest import mock import pytest from pyramid.httpexceptions import HTTPNoContent from h.traversal import AnnotationContext from h.views.api import flags as views @pytest.mark.usefixtures("flag_service") class TestCreate: def test_it(self, annotation_context, pyramid_request, flag_service): respo...
#!/usr/bin/env python3 """ Generates kokoro config files based on template. """ db_full = """\ # Format: //devtools/kokoro/config/proto/build.proto # Generated from .github/kokoro/kokoro-cfg.py # To regenerate run: # cd .github/kokoro/ && python3 kokoro-cfg.py build_file: "symbiflow-arch-defs-%(kokoro_type)s-%(arch)...
#!/usr/bin/python3 import sys, os, logging, json sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import barbot.config config = barbot.config.load() import barbot.logging barbot.logging.configure() import barbot.audio cfg = json.loads(sys.stdin.read()) try: barbot.audio.tts(**cfg...
# Linguagem de Programação II # AC09 SI2A - Sistema da Informação - Querys LMS # alunos: maikon.silva@aluno.faculdadeimpacta.com.br from lms import (engine, Usuario, Aluno, Professor, Coordenador, Disciplina, Curso) from sqlalchemy.orm import sessionmaker from typing import List, Dict # Setu...
class KFACParamScheduler(): """Updates KFAC parameters according to the epoch Similar to `torch.optim.lr_scheduler.StepLR()` Usage: Call KFACParamScheduler.step() each epoch to compute new parameter values. Args: kfac (KFAC): wrapped KFAC preconditioner damping_alpha (float, o...
#!/usr/bin/env python import sys from PIL import Image from math import pi, sin, cos, tan, atan2, hypot, floor from numpy import clip import imageio import os import requests import numpy as np from urllib.request import urlopen import cv2 current_path = os.getcwd() try: os.mkdir(current_path + "/Dow...
from io import StringIO import requests import os import pandas as pd import regex as re import numpy as np import collections import textwrap from bs4 import BeautifulSoup, UnicodeDammit SECTION_NAMES = ['Business', 'Risk Factors', 'Unresolved Staff Comments', 'Properties', 'Legal Proceedings', ...
"""Adapted from https://github.com/pycontribs/tendo/blob/master/tendo/singleton.py""" import os import sys if sys.platform != "win32": import fcntl class ExclusiveFileLockException(BaseException): def __init__(self) -> None: super().__init__("Another process already holds this file lock") def excl...
from django.utils.encoding import force_str from django.utils.functional import keep_lazy from django.utils.safestring import SafeText, mark_safe _json_escapes = { ord('>'): '\\u003E', ord('<'): '\\u003C', ord('&'): '\\u0026', } _json_escapes_attr = { ord('>'): '\\u003E', ord('<'): '\\u003C', ...
""" Implements a class for conveniently and efficiently storing sets of ComputedReaction objects which share entries. """ from functools import lru_cache from typing import List, Optional, Union, Set, Iterable import numpy as np from monty.json import MSONable from pymatgen.core import Element from pymatgen.entries....
def insertion_sort(arr): """ Fuction to do insertion sort. :param arr: A list of element to sort. """ for slot in range(1, len(arr)): value = arr[slot] test_slot = slot - 1 while test_slot > -1 and arr[test_slot] > value: arr[test_slot + 1] = arr[test_slot] ...
#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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 l...
#!/usr/bin/env python import sys from uda_common import read_feature_groups from sklearn.datasets import load_svmlight_file import numpy as np from os.path import dirname, join def main(args): if len(args) < 1: sys.stderr.write("One required argument: <reduced training data> [freq=50]\n") sys.exit(...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
import os import sys import pytest # テスト対象のファイルへのパスを通している # pytestの設定 PARENT_PATH = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) SOURCE_PATH = PARENT_PATH.rsplit("/", 1)[0] print(f"test_target_path:= {SOURCE_PATH}") sys.path.append(f"{SOURCE_PATH}") # テスト対象のディレクトリに移動 os.chdir("./kabutobashi") # skip ...
from .client import Client from .consts import * class Spot(Client): def __init__(self, api_key, api_secret_key, passphrase, use_server_time=False, api_url=API_URL): Client.__init__(self, api_key, api_secret_key, passphrase, use_server_time, api_url) # query account def get_account(self): ...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2017-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
"""empty message Revision ID: 0044 add books Revises: 0043 add image_filename articles Create Date: 2020-09-28 01:25:21.879213 """ # revision identifiers, used by Alembic. revision = '0044 add books' down_revision = '0043 add image_filename articles' from alembic import op import sqlalchemy as sa from sqlalchemy.di...
# Copyright 2019 The OpenRadar 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 applicable law...
#!/usr/bin/env python3 import xml.dom.minidom import blmw_to_rst import os import shutil MANUAL_PATH = 'migration/rst_manual' USE_MULTIPROCESS = True def rst_title(title, char, single=True): if single: l = len(title) t = char * l return title + "\n" + t else: if char == "%": ...
def hcfnaive(a,b): if(b==0): return a else: return hcfnaive(b,a%b) a = 60 b= 48 # prints 12 print ("The gcd of 60 and 48 is : ",end="") print (hcfnaive(60,48))
import os import glob import shutil def fix_coltimes(coldir, newdir, resume=None): dirs = glob.glob(coldir + '/*/core.*') os.makedirs(newdir, mode=0o755, exist_ok=True) if resume: have_reached_resume = False else: have_reached_resume = True for sim in dirs: if not have_reach...
# Generated by Django 3.2.5 on 2021-08-14 05:37 import dashboard.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from setuptools import setup, find_packages # read long description from README with open('README.md', 'r', encoding='u...
from sql_alchemy import banco import hashlib class UserModel(banco.Model): __tablename__ = 'users' user_id = banco.Column(banco.Integer, primary_key=True) login = banco.Column(banco.String(50)) password = banco.Column(banco.String(128)) def __init__(self,login,password): self.logi...
from django.contrib.auth import authenticate from django.core.validators import RegexValidator from rest_framework import serializers from django.core.validators import RegexValidator from rest_framework.validators import UniqueValidator from random import randint from .models import User from .validators import ( ...
"""Reolink Camera Media Source Implementation.""" import datetime as dt import logging import os import secrets from typing import Dict, List, Optional, Tuple from urllib.parse import quote_plus, unquote_plus from aiohttp import web from dateutil import relativedelta from homeassistant.components.http.const import KEY...
from .models import Rating from .services import Method from django.shortcuts import render from .libraries.KohonenNet import KohonenNet from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def about(request): return render(request, 'banknet/about.html') def rating_list(request, method = 'byEu...
# -*- coding: utf-8 -*- # __author__ : py_lee # __time__ : '18-12-14 下午2:54' import re from rest_framework import serializers from rest_framework.validators import UniqueTogetherValidator from user_operation.models import UserFav, UserLeavingMessage, UserAddress from goods.serializer import UserFavGoodsSerializers f...
from django.contrib import admin from diary.models import Diary, Entry admin.site.register(Diary) admin.site.register(Entry)
# 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 by applicable law or agreed to in writing, ...
from pprint import pprint, pformat import jupyter_kernel_mgmt as jkm import asyncio import aionotify import aiohttp from aiohttp import web import re from itertools import zip_longest async def aseq(*futs): for fut in futs: await fut class dotdict(dict): __getattr__ = dict.get __setattr__ = di...
""" author: @kim3 This is a more complex scraping script that works on a Sidearm sports-based platform for roster information """ # MIT License # # Copyright (c) 2021 Sejin Kim # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ...
#!/usr/bin/env python from combinato.plot.plot_extracted import parse_args if __name__ == "__main__": parse_args()