text stringlengths 6.04k 39.5k |
|---|
# Copyright (c) 2022, Eskill Trading and contributors
# For license information, please see license.txt
from datetime import date
from locale import currency
import frappe
from frappe import _
def execute(filters=None):
"Main function."
columns = []
columns.extend(get_columns(filters))
data = []
... |
#!/bin/python
import argparse
import hashlib
import http.cookiejar
import time
from concurrent.futures import ThreadPoolExecutor
from json import JSONDecodeError
from math import floor, log2
from pathlib import Path
import requests
from dateutil import parser as dt_parser
from ruamel.yaml import YAML
from slugify impo... |
import numpy as np
from random import shuffle
import multiprocessing as mp
import itertools
from astrodash.helpers import temp_list, div0
from astrodash.sn_processing import PreProcessing
from astrodash.combine_sn_and_host import training_template_data
from astrodash.preprocessing import ProcessingTools
from astrodash... |
from sklearn.datasets import fetch_mldata
from sklearn.datasets import fetch_openml
import pickle
import numpy as np
from PIL import Image
import os
import sys
import h5py
import time
import json
import threading as th
from params import path_cifar10, path_cifar100, path_fmow_rgb, path_catch_files, fmow_category_names... |
"""
This code implements a K-means and EM Gaussian mixture models per week 8 assignment of the machine learning module part of Columbia University Micromaster programme in AI.
Written using Python 3.7 for running on Vocareum
Execute as follows:
$ python3 hw3_clustering.py X.csv
"""
# builtin modules
import sys
impor... |
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple, Union, TYPE_CHECKING
import h5py
import lmfit as lm
import numpy as np
from deprecation import deprecated
from dat_analysis import useful_functions as U
from dat_analysis.analysis_tools.general_fitting import _get... |
#!/usr/bin/env python
import pytest
import sys, os
sys.path.append('..')
import logging
logging.basicConfig(level=logging.DEBUG)
from pymoku.dataparser import *
binfmt_data = [
("<s32", b"\x00\x00\x00\x00", [[0]]), # Simple signed unpack
("<s32", b"\x00\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x11\x22\x33", [[0], [-1], [... |
"""
main.py | <NAME> | 2021 / 2022
Goal : Create a user interface to controle the light of the ELO's workshop.
Explanation : I use Flask for create a Web server.
A shield is plug on the Raspberry Pi (server) with optocoupleur to ABB module with the GPIO.
┌─────────────────────────────────┐
│ Raspbe... |
# -*- coding:utf-8 -*-
# Usage : spark-submit ~~.py
# Usage : spark-submit --properties-file spark.conf ~~.py
from pyspark.context import SparkContext
from pyspark.mllib.fpm import FPGrowth
from pyspark import StorageLevel
from pyspark import SparkConf
import sys
import os
import pickle
import collections
import pandas... |
################ BASIC ################
import os
import sys
import traceback
import io
import shutil
import subprocess
import sqlite3
import logging
import re
import copy
from collections import OrderedDict, defaultdict, Counter
import time
from datetime import datetime
import threading
from threading import T... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-04-09 07:45
import glob
import os, sys
from shutil import copyfile
import numpy as np
import tensorflow as tf
from edparser.components.parsers.parse_alg import adjust_root_score_then_add_secondary_arcs, mst_then_greedy
from edparser.components.parsers.conll import ... |
import math
import typing
import pymunk
import pymunk.constraints
from PIL import Image, ImageDraw, ImageFont
from configuration import *
font = ImageFont.truetype('JetBrainsMono-Regular.ttf', 14)
body_sprite = Image.open(body_sprite_path)
thigh_sprite = Image.open(thigh_sprite_path)
tibia_sprite = Image.open(tibia_sp... |
# Copyright (c) 2014, <NAME>
# All rights reserved.
#
# 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 foll... |
# -*- coding: utf-8 -*-createacsr_handler
from __future__ import unicode_literals
import json
import logging
import os
import uuid
import time
import secrets
import cryptography
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.p... |
from dataclasses import dataclass
from llvmlite import ir
from lleaves.compiler.utils import ISSUE_ERROR_MSG, MissingType
BOOL = ir.IntType(bits=1)
DOUBLE = ir.DoubleType()
FLOAT = ir.FloatType()
INT_CAT = ir.IntType(bits=32)
INT = ir.IntType(bits=32)
LONG = ir.IntType(bits=64)
ZERO_V = ir.Constant(BOOL, 0)
FLOAT_PO... |
# PYTHON_ARGCOMPLETE_OK
import argparse
import os
import logging
import ast
import random
import mpmath
from sympy import (nsolve, symbols, Mul, Add, chebyshevt, exp, simplify,
chebyshevt_root, Tuple, diff, N, solve, Poly, lambdify, sign, fraction,
sympify, Float, srepr, Rational, log, GoldenRatio)
from sympy... |
"""
GUI launcher for magnetotransport DAQ for magnetic JJ research
Implement only simple functions
BB, 2016
"""
import tkinter as tk
from tkinter import filedialog
import os, platform, sys, queue, time, threading, shlex, functools
import subprocess as subp
import signal
import configparser
#def call_daq(cmd, **kwarg... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2020/5/9 21:55
# @author : Mo
# @function: trainer of sequence-labeling
# 适配linux
import sys
import os
path_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path.append(path_root)
## cpu-gpu与tf.keras
# os.environ["CUDA_VISIBLE_DEVICE... |
from enum import Enum
from nmigen import *
from nmigen.hdl.rec import Direction
from nmigen.utils import log2_int
from ..memory import MemoryMap
__all__ = ["CycleType", "BurstTypeExt", "Interface", "Decoder", "Arbiter"]
class CycleType(Enum):
"""Wishbone Registered Feedback cycle type."""
CLASSIC = 0b... |
#!/usr/bin/env python3
##Author: xujunhao <EMAIL>
##Date: 2020-6-1
##modified by liuxing on 2021-09-18
import os
from optparse import OptionParser
import sys
from collections import defaultdict
import re
import json
import threading
from numpy import *
def main():
"""
%prog [options]
stat spatial filter result to... |
import traceback, sys
from js_ast import *
from js_global import glob, Glob
from js_typespace import *
from js_cc import *
from js_process_ast import *
from js_util_types import *
import os, os.path
from js_type_emit import resolve_types, types_match, templates_match
#rules for registers: 0 and 1 are reserved for our
... |
from textwrap import wrap
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import kstest, uniform
# data collected on pi day 2022, March 14th
# 29 people participated
x_list = [
14, 12, 17, 5, 56, 39, 21, 67,
4, 42, 6, 7, 47, 13, 14, 73,
51, 57, 76, 1, 4, 8, 13, 19,
77, 17, 98, 33,... |
#!/usr/bin/env python3
"""A simple memory game.
Based on memorypuzzle by <NAME>
"""
import logging
import random
import sys
import pygame
from gamelib import colors, icons, sounds
from pygame.locals import K_ESCAPE, KEYUP, MOUSEBUTTONUP, MOUSEMOTION, QUIT
log = logging.getLogger(__name__)
# static variables
FPS = ... |
""" A 3D mesh representing a stoma """
from __future__ import print_function
import collections
import logging as lg
import numpy as np
from scipy import sparse
from sortedcontainers import SortedDict
from stomasimulator.geom import point as p
import stomasimulator.stomata.stoma_config as sc
from . import element... |
"""OA
"""
import numpy as np
from NNBlocks import tanh,sigm,relu,iden,isNone,expo,lrelu
def boxcars(periods):
periods = np.array(periods,dtype=int)
phases = np.zeros(periods.shape,dtype=int)
def filt(v,ph=phases,pd=periods,stored=[None]):
if isNone(stored[0]):
stored[0] = np.zeros(per... |
__author__ = 'teo'
from bs4 import BeautifulSoup
import requests
import itertools
import sys
import re
sys.setrecursionlimit(1073741824)
'''
Used for testing, to be replaced with IO system
start = "http://archiveofourown.org/works/search?utf8=%E2%9C%93&work_search[query]=&work_search[title]=&work_search[creator]=&wor... |
################################################################################################################################
## Este programa realiza o scraping de vagas no site da gupy, tratamento dos dados e salva a base de dados em um bucket do S3 ##
##############################################################... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
"""
Models for training Multilabel classification tasks.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import numpy as np
from tqdm import tqdm
from scipy import sparse
import torch
import torch.nn as nn
import torch.nn.functional as F
# Faiss for MIPS (maximum inner product search)
import faiss
# Internal.
from ... |
#!/usr/bin/env python
# coding: utf-8
# In[7]:
import pandas as pd
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import time
import random
from itertools import chain
# Digit data loading
#
# In[8]:
training_data = pd.read_csv("C:\\Users\\<NAME>\\Desktop\\Project\\digitdata\\trainin... |
##
# Copyright (c) 2008-2017 Apple 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 l... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 16:32:55 2020
IN DEVELOPMENT
atm - automated test measurements
Utility toolset that will eventually enable automated measurement of test structure devices.
Consists of a few important classes:
MeasurementControl - performs and analyses measurements according to a... |
import math
from collections import OrderedDict
from itertools import chain
import numpy
import torch
from aydin.it.base import ImageTranslatorBase
from aydin.nn.pytorch.models.jidcnet import JInet2D
from aydin.nn.pytorch.models.masking import Masking
from aydin.nn.pytorch.optimizers.esadam import ESAdam
from aydin.ut... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 24 00:24:09 2022
@author: taeni
"""
# Import libraries
import neuralforecast as nf
import numpy as np
import pandas as pd
import pytorch_lightning as pl
import torch as t
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.model_s... |
import csv
import os
import librosa.display
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.tree import DecisionTreeClassifier
from sklearn.utils import shuffle
from sklearn.model_selection import KFold
from sklearn.neighbors import KNeighborsClassifier
from sklearn.... |
import unittest
import numpy as np
from scipy import signal
import paderbox.testing as tc
from paderbox.testing.testfile_fetcher import get_file_path
from paderbox.io import load_audio
from paderbox.transform.module_stft import _biorthogonal_window
from paderbox.transform.module_stft import _biorthogonal_window_loopy... |
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.>
"""
Tests for the Argoverse 2.0 map API.
Uses a simplified map with 2 pedestrian crossings, and 3 lane segments.
"""
from pathlib import Path
import numpy as np
import pytest
from av2.map.drivable_area import DrivableArea
from av2.map.lane_segment i... |
"""Compilation rules definition for rules_proto_grpc."""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//internal:common.bzl",
"copy_file",
"descriptor_proto_path",
"get_int_attr",
"get_output_filename",
"get_package_root",
"strip_path_prefix",
)
load("//internal:providers.bzl", ... |
import hashlib
import hmac
import random
import warnings
from math import floor
import bitstring
import numpy as np
import pyfiglet
import torch
import torch.nn as nn
import torch.optim as optim
import tqdm
from cryptography.fernet import Fernet
from torch.utils.data import DataLoader
from mlmodelwatermarking.loggers... |
import random
import warnings
from datetime import datetime, date
from .chart import trade_to_cropped_pic
from .datareader import datepreprocess
import numpy as np
import pandas as pd
class TradeEnv:
def __init__(self, input_df, frame_length, stop=None, target=None,
TICK_SIZE=.25, MAX_... |
import time
def elem_identice(lista):
""" Primeste o lista si returneaza
-> simbolul jucatorului castigator (daca lista contine doar acel simbol repetat)
-> sau False (daca a fost remiza sau daca nu s-a terminat jocul)
"""
mt = set(lista)
if len(mt) == 1:
castigator = list(mt)[0]
if castigator != Joc.GOL:
... |
import csv
import os
import re
import sys
import time
def read_csv_file(csv_name):
# parse csv into a dictionary
with open(csv_name, newline='') as csvfile:
reader = csv.reader(csvfile)
reader = [r for r in reader if r]
return {row[0]: row[1] for row in reader}
# output file path
# s... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : dataset.py
@Time : 2022/01/27 09:14:07
@Author : <NAME>
@Version : 1.0
@Contact : <EMAIL>
@License : (C)Copyright 2021-2022, SAIL-Lab
'''
######################################## import area ########################################
# common... |
# 基于LeNet的mnist分类
# 用于熟悉搭建整个深度学习网络
# 包含:
# 1 自定义数据类:读文件、预处理、封装
# 2 模型设计:网络、损失函数
# 3 自定义训练配置:优化器、资源配置(cpu/gpu)
# 4 自定义训练过程:评价指标、验证集验证、作图、可视化、保存中间结果
# 5 模型保存:为了训练保存/为了预测保存
# 6 部署:动态图转静态图(装饰器 @paddle.jit.to_static)
# 作者:星期六的故事
# 时间:2022/03/25 03:02
# 注意:
# 1 交叉熵内置了softmax,而且针对数值溢出做了优化(每一个输出值减去输出值的最大值)
# 2... |
#! /usr/bin/env python
# coding: utf-8
import multiprocessing as mp
from ctypes import c_double, c_int
import numpy as np
import os
import sys
import signal
import logging
from multiprocessing.sharedctypes import Value, Array
from multiprocessing import Lock
from multiprocessing.managers import SyncManager
import cP... |
# ------------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# Code written by <NAME>.
# ------------------------------------------------------------
# Training Script
# For CUB birds reconstruction, without semantic corres... |
import argparse
import glob
import os
import psycopg2
from collections import defaultdict
from datetime import datetime
from ebi_eva_common_pyutils.logger import logging_config
from ebi_eva_common_pyutils.mongodb import MongoDatabase
from ebi_eva_common_pyutils.config_utils import get_pg_metadata_uri_for_eva_profile
f... |
import torch
import torch.nn.parallel
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from IPython import embed
from SS_CNN import *
from torch.nn.parameter import Parameter
import math
from utils import *
import torch.nn.functional
class Downsample(nn.Module):
def __init__(self, pad_type=... |
import re
from typing import Set, List, Tuple
from itertools import combinations
def parseAP(formula: str) -> Set[str]:
"""从LTL公式解析出原子命题集合"""
ap_list = re.split('[()XGFUR∧∨]', formula)
ret = set(ap_list)
ret -= {'', 'True', 'False'}
return ret
def powSet(s: Set[str]) -> List[List[str]]:
"""求... |
# -*- coding: utf-8 -*-
"""Test the probability DSL."""
import itertools as itt
import unittest
from y0.dsl import (
A,
B,
C,
CounterfactualVariable,
D,
Distribution,
Element,
Fraction,
Intervention,
One,
P,
Product,
Q,
R,
S,
Sum,
T,
Variable,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2021/7/21 5:51 下午
# @File : scratch_A2C.py
# @Author: johnson
# @Desc : A2C
import math
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt
import torch
import torch.nn as nn
import torch.nn.functional as F
import gfootball.env as football... |
from unittest import TestCase
from src.datagenerator import XGenerator, Labels, Dataset, BatchGenerator
import numpy as np
len_mock = 1000
x_window = 10
mock_prices = np.arange(len_mock, dtype=np.int)
start_index = np.datetime64(0, "ns")
mock_index = []
mock_index.append(start_index)
for i in range(1, le... |
"""
Rethinking Portrait Matting with Privacy Preserving
Copyright (c) 2022, <NAME> (<EMAIL>) and <NAME> (<EMAIL>)
Licensed under the MIT License (see LICENSE for details)
Github repo: https://github.com/ViTAE-Transformer/ViTAE-Transformer-Matting.git
Paper link: https://arxiv.org/abs/2203.16828
"""
from fu... |
#!/usr/bin/python
# Copyright 2014-2015 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distr... |
import os
import shutil
import zipfile
import urllib.request
import keras
import skimage
import numpy as np
import skimage.io as ski_io
from pycocotools_m.coco import COCO
from pycocotools_m import mask as maskUtils
from mrcnn import utils
DEFAULT_DATASET_YEAR = "2017"
class CocoDataset(utils.Dataset):
def lo... |
from typing import Type, Dict, Set, Optional
from django.db.models import Model, Expression, Q
from baserow.contrib.database.fields.dependencies.types import FieldDependencies
from baserow.contrib.database.fields.field_cache import FieldCache
from baserow.contrib.database.formula import (
BaserowFormulaException,... |
import keras.backend as K
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from keras import Input, utils
from keras.initializers import Constant
from keras.layers import (Activation, Add, BatchNormalization, Concatenate,
Conv2D, Cropping2D, Dropout, GlobalAverag... |
import itertools
import unittest
from typing import List, Optional, Union, Tuple
from . import children_entity_parser
from .predicate import Predicate
from ..most_general_unifier import MostGeneralUnifier
class Clause(object):
"""
Class for keeping predicates together and some several multi-predicate suppor... |
# 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
# "Licens... |
import textwrap
footnotes = []
footnotecounter = 1
def section(Title=None, Desc=None):
print("%s" % Title)
print("-" * len(Title))
if Desc:
print("%s" % Desc)
print()
print("+" + ("-" * 27) + "+" + ("-" * 57) + "+" + ("-" * 57) + "+")
print("| %-25s | %-55s | %-55s |" %
... |
# Copyright 2014 <NAME>
#
# 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, softw... |
import jax.numpy as jnp
from jax import jit, random, grad, vmap
from jax.config import config
from jax.ops import index_update, index
try:
from tqdm import trange
except ModuleNotFoundError:
trange = range
from time import time
import os
import matplotlib.pyplot as plt
import seaborn as sns
sns.set("notebook... |
# Module containing functions that interact with the statline API
from typing import Union
from pathlib import Path
import requests
import xml.etree.ElementTree as ET
import pyarrow as pa
import dask.bag as db
from statline_bq.utils import _create_dir, _url_to_ndjson, convert_ndjsons_to_parquet
from statline_bq.log i... |
"""
Copyright 2019-present NAVER Corp.
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, so... |
from robot.utils import get_timestamp, unic
from robot.version import get_full_version
from robot.result.visitor import ResultVisitor
from robot.errors import DataError
from .loggerhelper import IsLogged
import enum
import json
import copy
# Temporary fix to not break RF
try:
import jsonstreams
except ImportErro... |
# -*- coding: utf-8 -*-
from collections import defaultdict
from pathlib import Path
from textwrap import dedent
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Protocol
from typing import Sequence
from typing import Tuple
from typing import Union
fr... |
# isotropic Mo<NAME>
import numpy as np
import sys, os
# number of elements
nx = 2 # 2
ny = 2 # 2
nz = 3 # 5
# number of nodes
mx = 2*nx + 1
my = 2*ny + 1
mz = 2*nz + 1
# boundary conditions (for quadratic elements)
dirichlet_bc = {}
xpos = 0.0
ypos = 0.0
zpos = 0.0
# fix bottom plane in z direction, disp... |
from math import sqrt, acos, pi
from typing import List
from numpy.matlib import matrix, absolute, full, minimum, logical_not, ones
from pygeom.geom3d import Vector, Coordinate, ihat, khat
from pygeom.matrix3d import MatrixVector
from .grid import Grid
from .dirichletpoly import DirichletPoly
from .horseshoedoublet imp... |
import random
import os
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from collections import deque
from torch.distributions import Categorical
import matplotlib.pyplot as plt
class Actor_network(nn.Module):
def __init__(self, num_inputs, num_outputs):
super... |
"""Some utilities for manipulating GeoSpatial data."""
import contextlib
import logging
import numbers
import sys
import tempfile
import uuid
from pathlib import Path
from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Union
import geopandas as gpd
import numpy as np
import pandas as pd
import pyproj
impo... |
#-- coding: utf-8 --
from django.conf import settings
from django.shortcuts import render
from djaludir.core.sql import (
ACTIVITIES, ALUMNA, MAJORS, PRIVACY, RELATIVES_ORIG
)
from djaludir.core.models import (
Activity, Address, Alumna, Relative, EXCLUDE_FIELDS
)
from djzbar.utils.informix import do_sql
from... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# To fitting the given SBP data with the following beta model:
# s = s0 * pow((1.0+(r/rc)^2), 0.5-3*beta) + c
# And this tool supports the following two requirements for the fitting:
# (1) ignore the specified number of inner-most data points;
# (2) ignore the da... |
__all__ = ['expr_generate_funcs','cblk_generate_funcs','inst_generate','decl_generate','meta_generate']
from pyvmodule import viterator as viter
from .code_align import align_expr_area,align_mat,align_assign
import warnings
precedences_list = {
0:('const','wire','reg','[]','{}','{{}}'),
1:('~','!',' -',' ... |
#!python
import json
import os
import time
import io
from itertools import izip
import click
import numpy as np
import mitty.lib
import mitty.lib.util as mutil
import mitty.lib.mio as mio
import mitty.lib.variants as vr
import mitty.lib.vcf2pop as vp
import logging
logger = logging.getLogger(__name__)
__param__ = ... |
import os
import os.path as op
from typing import Dict, Union
import glob
import numpy as np
from PIL import Image
# cyclic import
# from panoptic_parts.utils.format import decode_uids, encode_ids
# Functions that start with underscore (_) should be considered as internal.
# All other functions belong to the public ... |
import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import sys
import os
import pickle
import seaborn as sns
import scipy.stats as ss
import numpy as np
import core_compute as cc
import core_plot as cp
from scipy.integrate import simps, cumtrapz
def deb_Cp(theta, T):
T = np.ar... |
# -*- coding: UTF-8 -*-
# From <NAME>'s iSRb tool
from warnings import warn
import numpy as np
#from skimage.measure import profile_line # toolbox implements its own line profle measurement routine
from scipy.optimize import curve_fit, minimize
from scipy.signal import find_peaks, peak_widths
from time import time
... |
# Import dependencies.
import json
import pandas as pd
import numpy as np
import re
from sqlalchemy import create_engine
import psycopg2
import time
from config import db_password
# Define a variable file_dir for the directory that’s holding our data.
file_dir = 'C:/Users/User/Desktop/Class/Goddard_Shannon_Movies-ETL'
... |
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
from math import sin, cos, atan2, ceil, sqrt
from typing import Any, Text, Dict, List, Union, Optional, Tuple
import lo... |
# Script which downloads and preprocesses a collection of UCI datasets.
# Flag --dir specifies the relative path at which the script will work.
# The script creates a directory called "data" under --dir and downloads
# the UCI data there. It then preprocesses the data to a format ready
# to be consumed by the models. B... |
#!/usr/bin/env python3
#
# real-time data processor
import os
import threading
import multiprocessing as mp
from time import sleep
import numpy as np
import yaml
import h5py
from darc import DARCBase
from darc.processor_tools import Clustering, Extractor, Classifier, Visualizer
from darc import util
class Processor... |
"""
Fast methods for forward and inverse spin-weighted spherical harmonic transforms.
An extension of the methods presented in McEwen and Wiaux (2011) [MW], the transforms here
use FFTs and numba-acceleration to rapidly compute the spin-weighted spherical harmonic
decomposition of a discretely-sampled function on a sp... |
'''Command line tool that uses a process pool to parrallelise searches'''
import os
import sys
from time import time
from multiprocessing import Pool, cpu_count, freeze_support
import mmap
def text_search_file_list(files, text_string, file_suffix, case_less, root=None):
'''Takes the given file list and returns a ... |
from django.shortcuts import render, redirect, HttpResponse, HttpResponseRedirect
from django.contrib.auth.models import User
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from .models import MapGeometry, CompletedMaps, FinalMaps, ApprovedMap
from django.contrib.auth.decorators import lo... |
import os
import csv
import numpy as np
import pandas as pd
import pickle
import networkx as nx
from scipy.linalg import eigh
from itertools import product, permutations, combinations
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, roc_auc_score
class DeshpandeMontanari:
def __init__(self, ... |
"""
MandoPuter will display text in a Mandalorian font on a tiny LCD display
File - code.py
Author - <NAME>
https://github.com/Breazile/MandoPuter
Font credits to ErikStormtrooper, the bitmap fonts were created from his TrueType font
http://www.erikstormtrooper.com/mandalorian.htm
"""
import time
import board
impo... |
import glob
import random
import time
from collections import defaultdict
import cv2
# import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
# Set printoptions
torch.set_printoptions(linewidth=1320, precision=5, profile='long')
np.set_printoptions(linewidth=320, formatter={'float_kind... |
import numpy as np
import scipy as sci
import scipy.spatial as scisp
import Utility as utl
import FiniteElement as fem
import importlib
'''
This program was written by <NAME> on June 10th, 2015.
It is based upon the OdfPf library that the Deformation Processing Lab has written in MATLAB.
The following functions are a... |
import argparse
import time
import shutil
import os
import os.path as osp
import csv
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau, StepLR
from data_cnn60 import NTUDataLoaders, AverageMeter, make_dir, get_cases, get_num_classes
... |
from IPython.display import display, HTML
import time
import math
# Created at: 23rd October 2018
# by: <NAME>
# Edited: December 2020
# by: <NAME>
# Module for drawing classic Turtle figures on Google Colab notebooks.
# It uses html capabilites of IPython library to draw svg shapes inline.
# Lo... |
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2022 appliedAIstudio LLC"
__version__ = "0.0.1"
# needed to create markdown files for the demo visualization software
from mdutils.mdutils import MdUtils
# needed to create time stamps for visualizing the diary entries
from datetime import datetime
# needed to del... |
# -*- coding: UTF-8 -*-
"""
This is the default app controller for portality.
For inclusion in your own project you should make your own version of this controller
and include the views you require, as well as writing new ones. Of course, views must
also be backed up by models, so have a look at the example models and... |
from __future__ import print_function
import tensorflow as tf
import numpy as np
from scipy import ndimage
from scipy.spatial.distance import euclidean
import TensorflowUtils as utils
import read_Data_list as scene_parsing
import BatchDatsetReader as dataset
from six.moves import xrange
import sys
FLAGS = tf.flags.FL... |
# Copyright 2019 Neural Networks and Deep Learning lab, MIPT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: <NAME>
## Gorilla Lab, South China University of Technology
## Email: <EMAIL>
## Copyright (c) 2020
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root d... |
import os
import sys
import tempfile
import random
from textwrap import dedent
import torch
from torch.testing._internal.jit_utils import JitTestCase, execWrapper
# Make the helper files in test/ importable
pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(pytorch_test_di... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
from rdkit import Chem
import numpy as np
from collections import Counter, defaultdict
from sklearn.metrics import roc_auc_score, mean_squared_error
import argparse
import re
from utils import read_contrib_spci
def calc_auc(merged_df,
which_lbls=(... |
###################################################################################################
# Libraries
###################################################################################################
# Python 3 compatibility
from __future__ import print_function
from __future__ import division
# Python
im... |
from collections import deque
from dataclasses import dataclass, field
from typing import Any, List, Union, Dict, Sequence, NamedTuple, Optional
from mdiff.block_extractor import OpCodeDeleteThenInsertBlockExtractor, ConsecutiveVectorBlockExtractor, \
NonIntegersBlockExtractor
from mdiff.utils import OpCode, longe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.