text
stringlengths
3.07k
22.1k
import json import os import sys import time import numpy as np # Finally import tensorflow import tensorflow as tf from tensorflow import flags # Own files import models import record_reader import util import graph_builder FLAGS = flags.FLAGS if __name__ == "__main__": flags.DEFINE_string("training_directory...
from pathlib import Path import json import logging from typing import List, Any, Tuple, Optional, Dict, Iterable import toolz as tz from .core import UserScopeSettings, ScopeSettings, CodeElement, CallPosType, Node from . import serialize from .custom_typing import CheckableOptional, CheckableDict, CheckableTuple, Ch...
import os import pandas as pd import numpy as np import pysd from tqdm import tqdm #%% def TendayToDay(df, TendayColName = "Ten-days"): df = df.iloc[:,0:(df.shape[1])] df2 = [] N = [10, 10, 11, 10, 10, 8, 10, 10, 11, 10, 10, 10, 10, 10, 11, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, ...
import asyncio from contextlib import contextmanager from functools import partial, wraps from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Type, Union from urllib.parse import parse_qsl, urlparse from . import decorators, validation from .backends.interface import Backend from .backends.memory import...
import os import numpy as np from matplotlib import pyplot from mpl_toolkits.mplot3d import Axes3D from time import sleep def warm_up_exercise(): A = np.eye(5) return A def plot_data(x, y): figure = pyplot.figure() pyplot.plot(x, y, 'ro', ms=10, mec='k') pyplot.ylabel('Profit in $1...
# Copyright 2017 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 law or agreed to in writing, ...
import collections import logging import pymongo from .base import LitecordObject from ..enums import ChannelType from ..snowflake import _snowflake from .message import Message log = logging.getLogger(__name__) BareCategory = collections.namedtuple('BareCategory', 'id') class BaseChannel(LitecordObject): ""...
"""Basic Baseline Compare the count of events in a window to percentiles of counts in prior windows. """ from typing import List, Optional from runners.helpers import db from runners.helpers.dbconfig import WAREHOUSE OPTIONS = [ { 'name': 'history_size_days', 'title': "Window Size", 'pro...
import inspect from enum import Enum from io import StringIO from ruamel.yaml import YAML from ruamel.yaml.comments import CommentedMap from febo.utils import locate, get_logger logger = get_logger('config') class ConfigManager: """ class to track all instances of Config classes, and load and save configs to ya...
"""Tests pygments hooks.""" import pytest import os import builtins import stat from tempfile import TemporaryDirectory from xonsh.pyghooks import ( XonshStyle, Color, color_name_to_pygments_code, code_by_name, color_by_name, color_file, file_color_tokens, ) from xonsh.environ import LsCo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re import select import subprocess import sys from datetime import datetime, timedelta from time import sleep import colored from colored import stylize from .__version__ import __version__ as VERSION COLOR_LOG = colored.fg('dark_gray') ...
""" Copyright (c) 2015, 2018 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals from atomic_reactor.constants import YUM_REPOS_DIR from atomic_reactor.core import DockerTask...
""" Lvm - Combiner for lvm information ================================== This shared combiner for LVM parsers consolidates all of the information for the following information: * LVS * PVS * VGS The parsers gather this information from multiple locations such as Insights data and SOS Report data and combines the da...
import logging import os import sys import re import datetime import urllib3 import shutil import hashlib import urllib sys.path.append( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) ) from utils.get_doc_text import get_doc_text from utils.sam_utils import schematize_opp from utils.request_utils impo...
"""Inference on deep learning model previously trained * Build the instance name * Load one (or more) image(s) from the file system * Load a trained model starting from the instance name * Make label predictions on the test image(s) * Produce a result: for instance, only predicted labels Example of program call, that...
import flask import time from flask_login import UserMixin from contextlib import closing import gal_utils from passlib.apps import phpbb3_context from passlib.hash import bcrypt from gal_utils import text def canLogin(username, password): if not gal_utils.legalOwner(username) or not isinstance(password, text): ...
import numpy as np import pickle from sklearn.model_selection import KFold from keras.callbacks import LearningRateScheduler, EarlyStopping from sklearn.metrics import ( confusion_matrix, roc_auc_score, roc_curve, matthews_corrcoef, ) from .data_provider import load_chains, process_chains from .structu...
"""Utilities for graph not included in Networkx. .. MIT License .. .. Copyright (c) 2018 <NAME> .. .. Permission is hereby granted, free of charge, to any person obtaining a copy .. of this software and associated documentation files (the "Software"), to deal .. in the Software without restriction, including without l...
from openprocurement.api.utils import get_now, handle_store_exceptions, context_unpack from openprocurement.api.auth import extract_access_token from openprocurement.api.constants import SANDBOX_MODE, TZ, NORMALIZE_SHOULD_START_AFTER from openprocurement.tender.core.procedure.context import get_now from openprocurement...
__source__ = 'https://leetcode.com/problems/robot-room-cleaner/' # Time: O() # Space: O() # # Description: Leetcode # 489. Robot Room Cleaner # # Given a robot cleaner in a room modeled as a grid. # # Each cell in the grid can be empty or blocked. # # The robot cleaner with 4 given APIs can move forward, turn left or ...
import os, sys from PIL import Image, ImageDraw, ImageFont, ImageTk import tkinter as tk import argparse def show_image_and_annotation(image, label, type): # parser annotations in label file annotation = [] with open(label,'r') as f: for line in f.read().splitlines(): data = line.split(...
import asyncio import logging import discord import json import io from navibot.client import CliCommand, BotContext, CliContext, ClientEvent, Plugin from navibot.errors import CommandError class PConnectionManager(Plugin): def __init__(self, bot): super().__init__(bot) self.manager = Conn...
# -*- coding: utf-8 -*- import numpy as np import tkinter as tk import tkinter.ttk as ttk WIDTH_X = 800 WIDTH_Y = 600 class BuffonCal: def __init__(self, length, interval, width_x, width_y): assert length > 0 and interval > 0 self.length = length self.interval = inter...
# import the necessary packages from scipy.spatial import distance as dist from imutils.video import FileVideoStream from imutils.video import VideoStream from imutils import face_utils import argparse import imutils import time import dlib import cv2 import queue import numpy as np from matplotlib import pyplot as p...
import sys, os.path, MenuMaker, Prophet from Keywords import Keyword as Kw, Set as KwS import optparse from optparse import OptionParser as _OP from MenuMaker import msg, warn, fatal, fronts, terms writeToStdout = False # Output the generated menu to stdout instead of the menu file forceWrite = False #...
import scrapy from scrapy.loader.processors import MapCompose, Compose, TakeFirst from datetime import datetime import re class Match(scrapy.Item): match_id = scrapy.Field(output_processor=TakeFirst()) team_h = scrapy.Field(output_processor=TakeFirst()) team_a = scrapy.Field(output_processor=TakeFirst()) ...
# ======================================== # ENPM673 Spring 2021: Perception for Autonomous Robotics # Utils file providing various helper functions # # Author: <NAME>(<EMAIL>) # ======================================== # from imutils import paths import imutils import numpy as np import cv2 import matplotlib.pyplot a...
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import calendar import imageio import joblib from shutil import copy2, rmtree from datetime import datetime, timedelta def clean_nan(array): if type(array) == list: array = np.asarray(array) not_nan_array = ~ np.isnan(ar...
#!/usr/bin/env python """ Aggregates features per partner, for further retrieval from HDFS. """ import argparse import datetime import glob import os import sys import shutil import time import numpy as np import multiprocessing from shutil import copyfileobj from pid import PidFile #import bz2 import gzip import mat...
from __future__ import print_function import tensorflow as tf from tensorflow.contrib.layers import batch_norm, fully_connected, flatten from tensorflow.contrib.layers import xavier_initializer import numpy as np import scipy.io.wavfile as wavfile import os import scipy.signal as signal from matplotlib import pyplot as...
# -*- coding: utf-8 -*- # ******************************************************* # Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved. # SPDX-License-Identifier: MIT # ******************************************************* # * # * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT # * WARRANTIES OR C...
# MultiGPU implementation of dcgan - will be used for training on the CelebaAHQ dataset # Deep convolutional generative adversarial network # Make this code multi GPU trainable import torch import torchvision import torch.nn as nn import torchvision.transforms as transforms from torch.utils.data import DataLoader impo...
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # @author: <NAME> <<EMAIL>> # @date: Tue Aug 11 14:07:00 CEST 2015 # # Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import from telemetry.pedestrian_model import PedestrianModel from telemetry.subject_model import SubjectModel from telemetry.drone_model import DroneModel from telemetry.telemetryd import App from random import randint, random from datetime import...
# Copyright 2021, 2022 Cambridge Quantum Computing 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 la...
# -*- coding: utf-8 -*- """ engineauth.models ==================================== Auth related models. :copyright: 2011 by <NAME>. :license: Apache Sotware License, see LICENSE for details. :copyright: 2011 by tipfy.org. :license: Apache Sotware License, see LICENSE for details. """ from...
import turtle import time import random import math import sys # 动态创建类实例 def create_instance(module_name, class_name, *args, **kwargs): module_meta = __import__(module_name, globals(), locals(), [class_name]) class_meta = getattr(module_meta, class_name) obj = class_meta(*args, **kwargs) return obj ...
from collections import deque, namedtuple import json from statistics import mean import torch from event_logger import EventLogger from model import Policy, EPS Parameters = namedtuple( 'Parameters', [ 'seed', 'num_training', 'num_episodes', 'batch_size', 'restart_coun...
import torch.nn as nn import torch from torchvision import datasets, transforms, utils, models # from roi_pooling.crop_and_resize import CropAndResizeFunction from roi_pooling import RoIPoolFunction from torch.autograd import Variable import util import torch.nn.functional as F import numpy as np NUM_CLASSES = 29 FC_D...
from __future__ import absolute_import from __future__ import unicode_literals from django.core.urlresolvers import reverse_lazy from django.http.response import HttpResponseForbidden from django.shortcuts import render_to_response, get_object_or_404, redirect from django.template import RequestContext from django.uti...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ These plugins modify the behavior of py.test and are meant to be imported into conftest.py in the root directory. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import __future__ from ...
""" .. Copyright (c) 2015-2017, Magni developers. All rights reserved. See LICENSE.rst for further information. Module providing utility functions for initilisation of in- and output channels in the Generalised Approximate Message Passing (GAMP) algorithm. Routine listings ---------------- get_em_bg_amp_i...
""" Unittest coins """ import random from pathlib import Path from typing import cast import pytest from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import ec from spartancoin.exceptions import DecodeError from spartancoin.transactions import Receiver, Sender, T...
#!/usr/bin/env python # coding:utf-8 from __future__ import print_function import math import numpy as np #import scipy.linalg import scipy.sparse import scipy.sparse.linalg import argparse import time def parse_args(): parser = argparse.ArgumentParser(description='Calculate the ground state of S=1/2 Heisenberg c...
# -*- coding: utf-8 -*- """ Created on Sat Mar 14 16:45:29 2020 @author: ajink / manivs """ import cv2 import csv import argparse from DetectColour import DetectColour from DetectCar import DetectCar # Begin Mani from datetime import datetime import time from DetectCartype import DetectCartype from multiprocessing im...
import pickle import pymorphy2 import numpy as np import pandas as pd import nltk.classify.util import xml.etree.ElementTree as ET from re import match from nltk import FreqDist from random import shuffle from stemmer_ua import UAStemmer from nltk.classify import NaiveBayesClassifier from sklearn.model_selection impo...
import os import numpy as np # descr, i2c-addr, channel _nodes = [('module/main', '0041', '0'), ('module/cpu', '0041', '1'), ('module/ddr', '0041', '2'), ('module/gpu', '0040', '0'), ('module/soc', '0040', '1'), ('module/wifi', '0040', '2'), ('boa...
# coding=utf-8 import pickle import random import unittest import matplotlib.pyplot as plt import networkx from explorable_graph import ExplorableGraph from Dijkstras import dijktras_search from PriorityQueue import PriorityQueue class TestPriorityQueue(unittest.TestCase): """Test Priority Queue implementation"...
"""Action Module circuits component to update incidents from Queries""" import logging import time from signal import SIGINT, SIGTERM from collections import defaultdict from multiprocessing import Lock from circuits.core.handlers import handler from circuits import task from resilient_circuits.actions_component impor...
import pytest import numpy as np from tests.testing_utils import DummyPhysicalSystem, DummyReferenceGenerator, DummyRewardFunction, DummyVisualization,\ DummyCallback, DummyConstraintMonitor, DummyConstraint, mock_instantiate, instantiate_dict from gym.spaces import Tuple, Box import gym_electric_motor from gym_ele...
from django import forms from django.core.exceptions import ValidationError from django.utils.http import urlquote from django.utils import timezone from haystack.forms import ModelSearchForm from floppyforms import widgets import contacts as contact_constants from contacts.models import ( BookOwner, Contact, ...
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np import matplotlib.pyplot as plt mnist = input_data.read_data_sets("MNIST_data", one_hot=True) def _weight(shape_, name=''): #print(name) return tf.get_variable(name, shape=shape_, initializer=tf.random_nor...
#!/usr/bin/env python3 import argparse import asyncio import datetime import decimal import ipaddress import sys import uuid from signal import Signals import pysandra from pysandra.utils import set_debug class Tester: def __init__(self, client): self.client = client async def connect(self): ...
# -*- coding: utf-8 -*- # Copyright (C) 2017-2020 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************ # This module is licensed under the terms of the BSD 3-Clause License # <http://www.c-tanzer.at/license/bsd_3...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json from dashboard.common import histogram_helpers from dashboard.pinpoint.models.quest import execution from dashboard.pinpoint.models.quest import...
from sympy import (Symbol, Wild, Inequality, StrictInequality, pi, I, Rational, sympify, symbols, Dummy, S) from sympy.utilities.pytest import raises def test_Symbol(): a = Symbol("a") x1 = Symbol("x") x2 = Symbol("x") xdummy1 = Dummy("x") xdummy2 = Dummy("x") assert a != x1 assert a ...
""" Feature to get a buffer with jupyter output """ # Standard from time import sleep import vim # Local from jupyter_util import echom, prettify_execute_intput, str_to_vim, \ strip_color_escapes, unquote_string try: from queue import Empty except ImportError: from Queue import Empty...
import matplotlib.pyplot as plt import numpy as np import os from glob import glob from pickle import load from benchmark import DATA_PATH, FIGURE_PATH from benchmark.evaluation import estimate_nonequilibrium_free_energy fnames = glob(os.path.join(DATA_PATH, "*.pkl")) figure_1_fnames = [] for fname in fnames: if...
from .rman_translator import RmanTranslator from .rman_lightfilter_translator import RmanLightFilterTranslator from ..rman_sg_nodes.rman_sg_light import RmanSgLight from ..rman_utils import string_utils from ..rman_utils import property_utils from ..rman_utils import transform_utils from ..rman_utils import object_util...
# Copyright 2021 University College London. 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 appl...
#!/usr/bin/env python3 # pylint: disable=too-many-arguments ''' Client connection wrapper and network functions ''' import json import select import socket import subprocess import sys import threading import time from apocrypha.exceptions import DatabaseError from apocrypha.network import read, write HOST = 'loca...
from __future__ import absolute_import, division import networkx as nx import numpy as np from scipy.ndimage import binary_dilation, binary_erosion from scipy.special import comb from skimage.filters import rank from skimage.morphology import dilation, disk, erosion, medial_axis from sklearn.neighbors import r...
#!/usr/bin/env python # -*- coding: utf-8 -*- """access_address.py Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential Written by <NAME> <<EMAIL>>, november 2017 """ import datetime import uuid from dawa_facade.responses import BaseResponse, parse_datetime class Acce...
import sys from pprint import pprint from random import randrange import discord import math import rethinkdb as r import yaml from discord.ext import commands with open("config.yml") as config: config = yaml.safe_load(config) description = "Just a bot that grants members exp for being in a voice channel" bot = ...
# Copyright (c) 2012-2013 SHIFT.com # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, dist...
# (C) Copyright 2005-2021 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
# coding=utf-8 # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
import multiprocessing import face_alignment import cv2 import os import time import numpy as np import argparse import concurrent.futures from Utils.misc import create_directory parser = argparse.ArgumentParser( description='Landmark Processing Transcription') parser.add_argument( 'input', help="Folder contai...
"""Avalon Command-line Interface This module contains a CLI towards Avalon and all of what is bundled together in this distribution. - https://github.com/getavalon/setup dependencies: - Python 2.6+ or 3.6+ - PyQt5 example: $ python avalon.py --help overrides: avalon.py takes into account dependenci...
# Copyright (c) 2016 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
from typing import Optional from sortedcontainers import SortedDict from ....errors import SimRegionMapError from ....state_plugins import SimStatePlugin class AddressWrapper: """ AddressWrapper is used in SimAbstractMemory, which provides extra meta information for an address (or a ValueSet object) that ...
import re import numpy as np import os import sys from collections import OrderedDict, defaultdict import matplotlib.pyplot as plt import seaborn as sns from renewable import az_reprb, az_retcb, az_roprb, az_tpopp, \ ca_reprb, ca_retcb, ca_roprb, ca_tpopp, \ nm_reprb, nm_retcb, nm_roprb, nm_tpopp, \ tx_repr...
import time import supervisor import board import digitalio import pulseio from adafruit_motor import servo import neopixel from audiomp3 import MP3Decoder from adafruit_led_animation.animation.solid import Solid from adafruit_led_animation.animation.rainbow import Rainbow from adafruit_led_animation.animation.sparkle...
import csv import codecs import tweepy # external # keep track of the csv file in 2d list format tweets = [] # keep track of all the VALID tweet ids, aka those that the user owns and not anyone else's all_tweet_ids = [] # maps of ids and tweets both ways tweet_id_map = {} id_tweet_map = {} # authentication and api ...
from flask import Blueprint, current_app, redirect, render_template, request, flash, url_for from flask_login import login_required, current_user import os import shutil import pathlib import librosa import numpy as np from werkzeug.utils import secure_filename import tensorflow import soundfile as sf import matplotlib...
# Copyright 2020 <NAME> # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistr...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # (c) B.Kerler 2018-2021 MIT License import logging, os from struct import pack from Library.utils import LogBase regval = { "DXCC_CON": 0x0000, } class dxcc_reg: def __init__(self, mtk): self.mtk = mtk self.dxcc_base = mtk.config.chipconfig.dxcc_bas...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Find raw_datasets which are not accepted by the administrator and look different than other known datasets with the same accepted_formula_id. (So: Find outliers) """ import sys import logging logging.basicConfig(level=logging.INFO, stream=sys.stdou...
import time from collections import defaultdict from datetime import timedelta import cvxpy as cp import empiricalutilities as eu import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from tqdm import tqdm from transfer_entropy import TransferEntropy plt.style.use('fivethirtyei...
import torch import torch.nn as nn import torch.nn.functional as F import os.path as osp from corenet import StereoUnaryUnetDyn, PadUnpad, PaddedConv2d, ResidualBlock class SubNetwork(nn.Module): def __init__(self, args, device): super(SubNetwork, self).__init__() self.net = None self.pad...
from youtubesearchpython import SearchVideos from MusicDL import MusicDL import spotipy from spotipy.oauth2 import SpotifyClientCredentials import requests import json import os import shutil import eyed3 from mutagen.easyid3 import EasyID3 from mutagen.flac import Picture, FLAC from mutagen import File # Search yo...
import numpy as np import pandas as pd import tensorflow as tf import os import sys from termcolor import colored from tensorflow.contrib.layers import fully_connected as FC_Net from sklearn.metrics import brier_score_loss from sklearn.model_selection import train_test_split import import_data as impt import utils_ne...
# Libraries import re import ast import yaml import json import copy import logging import numpy as np import pandas as pd import logging.config # Specific from pathlib import Path # Own libraries from datablend.utils.pandas import save_xlsx from datablend.utils.transformations import convert_dtypes_categorical from ...
#!/usr/bin/python import numpy as np import scipy.spatial.distance import cv2 import sys, os import math from numpy.linalg import inv has_yaml = False try: import yaml # A yaml constructor is for loading from a yaml node. # This is taken from: http://stackoverflow.com/a/15942429 def opencv_matrix_con...
""" Processes for FSL tools These processes use the wrappers in the fslpy package FIXME: Is FSLDIR etc being set correctly or do we need to do something in FSL wrappers? Copyright (c) 2013-2020 University of Oxford Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c...
# -*- coding: utf-8 -*- """jordeck.py - Pythonic OOP card decks and shuffling""" __author__ = "<NAME>" __copyright__ = "Copyright 2021, 21stacks" __credits__ = ["<NAME>"] __license__ = "MIT License" __version__ = "1.0.0" __email__ = "<EMAIL>" __status__ = "Release" import random as rng f...
#!/usr/bin/env python # file: statusline-i3.py # vim:fileencoding=utf-8:fdm=marker:ft=python # # Copyright © 2019 <NAME> <<EMAIL>>. # SPDX-License-Identifier: MIT # Created: 2019-06-30T22:23:11+0200 # Last modified: 2020-11-19T12:33:40+0100 """ Generate a status line for i3 on FreeBSD. """ import argparse import ctype...
import math from tkinter import * from scipy.optimize import fsolve rho = 0.0 Re = 0.0 f = 0.0 count = 0 Q_23 = 0.0 L_23 = 0.0 epsilon = 0.0 u_12 = 0.0 R = 0.0 mu = 0.0 theta = 0.0 D_23_i = 0.0 u_23_i = 0.0 def residuals(initial): D_23 = initial[0] u_23 = initial[1] residual = [0.0, 0.0] global Re ...
# -*- coding: utf-8 -*- """ Created on Mon Apr 26 13:28:18 2021 @author: kmwh0 """ from collections import deque import numpy as np #TODO 리스트로 된 db를 딕셔너리로 바꿀 것!! # db = ["KRW-XRP":{"up_temp":0,"updated":0,...},"KRW-BTC":{"up_temp":0,"updated":0,...}] 이런식으로 class Singleton(type): #_instance = WeakVa...
from .models import * from .forms import * from datetime import datetime from django.shortcuts import render_to_response, get_object_or_404, redirect from django.http import HttpResponseForbidden from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.decorators import login_required from djan...
import numpy as np import time import h5py import matplotlib.pyplot as plt import scipy from sklearn.model_selection import train_test_split np.random.seed(1) def sigmoid(Z): A = 1/(1+np.exp(-Z)) cache = Z return A, cache def sigmoid_backward(dA, cache): Z = cache s = 1/(1+np.exp(-...
import requests import json import time import os import traceback import random from datetime import datetime, timedelta from colorama import Fore, Style from bs4 import BeautifulSoup, element from utils import sqlite db = sqlite.Database() db.create_tables() # Attempt to create table(s) if not exist...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ braggutils: utilities around the Bragg's law ($ n \lambda = 2 d sin \theta $) """ import warnings import numpy as np import logging try: import scipy.constants.codata as const HAS_CODATA = True h = const.value("Planck constant in eV s") # eV s c = con...
import sys from os.path import join, dirname, abspath from qtpy import uic from qtpy.QtCore import Qt, QTimer, Slot from qtpy.QtGui import (QStandardItemModel, QStandardItem, QImage, QPixmap, QPalette) from qtpy.QtWidgets import QApplication, QMainWindow import qtawesome as qta import qtmodern...
from collections import deque from dataclasses import dataclass from enum import IntEnum from functools import reduce, cached_property from typing import Optional, List, Tuple, Set, Deque from lxml.html import document_fromstring, HtmlElement @dataclass class Node: text: str tail: str visit_time: int ...
#!/usr/bin/env python2 import sys import os from os.path import join as opj from copy import copy import shutil import datetime import argparse import subprocess import getpass import socket from imp import load_source def check_stage(ist, st, nm, typ): if nm not in st: raise IOError('"{0}" parameter miss...
from dataclass import dataclass from sklearn.neighbors import NearestNeighbors from sklearn.neighbors import KNeighborsRegressor from sklearn.neighbors import KNeighborsClassifier from sklearn.neighbors import RadiusNeighborsClassifier from sklearn.neighbors import RadiusNeighborsRegressor from sklearn.naive_bayes imp...
# -*- coding: utf-8 -*- # @Author : gaodi12 # @Email : <EMAIL> # @License: Mulan PSL v2 # @Date : 2022-12-20 13:46:29 import time import pandas as pd from flask import jsonify, g from server import db, redis_client from server.model.task import TaskDistributeTemplate, DistributeTemplateType, \ Task, TaskStatus, ...
import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict class Net1(nn.Module): def __init__(self): super(Net1, self).__init__() self.dense1 = nn.Linear(300, 300) self.dense2 = nn.Linear(300, 300) self.dense3 = nn.Linear(300, 3) de...
# Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function """ Utilities for using modules """ import dataent, os, json import dataent.utils from dataent import _ from dataent.utils import cint def export_module_json(do...