text stringlengths 6.04k 39.5k |
|---|
from bolsonaro.data.dataset_parameters import DatasetParameters
from bolsonaro.data.dataset_loader import DatasetLoader
from bolsonaro.models.model_factory import ModelFactory
from bolsonaro.models.model_parameters import ModelParameters
from bolsonaro.models.ensemble_selection_forest_regressor import EnsembleSelection... |
"""Solve big cube by solving edges, then centres, then as a 3x3."""
from cube.functions import orient
def edges(self) -> tuple:
"""
Solve edges of a big cube.
Returns
-------
tuple of (list of str, dict of {'EDGES': int})
Moves to solve edges, statistics (move count in ETM).
... |
#!/usr/bin/env python
#
# Process a list of Python and/or XML files containing SCons documentation.
#
# This script creates formatted lists of the Builders, functions, Tools
# or construction variables documented in the specified XML files.
#
# Dependening on the options, the lists are output in either
# DocBook-format... |
# python GenerateImages.py [-h] -i INPUT -o OUTPUT [-n NUMBER]
# Import all the needed modules
from torchvision import transforms
from scipy.stats import norm
from PIL import Image
import numpy as np
import argparse
import decimal
import random
import glob
import cv2
# Helper function to generate a mask for parallel... |
# 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 ... |
"""Image module image.py
Capturing and providing images.
"""
import time
import os
import logging
from typing import Type
import threading
import cv2
import enum
import numpy as np
import tkinter as tk
from PIL import Image, ImageTk
from typing import Tuple, Callable, Any, List, Dict
from beeclient.drop_scanner.came... |
# coding: utf-8
# In[1]:
# These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import imageio
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import tarfile
from IPython.display import display, Image
... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 27 12:11:58 2021
@author: jakubicek
"""
import os
import numpy as np
import numpy.matlib
import matplotlib.pyplot as plt
import torch.optim as optim
import glob
import torch.nn as nn
import torch.nn.functional as F
import torch
import random
# import pandas as pd
from t... |
# -*- coding: utf-8 -*-
#
# LICENCE MIT
#
# DESCRIPTION Callgraph symbols representations.
#
# AUTHOR <NAME> <<EMAIL>>
#
import os
from itertools import chain, islice
from inspect import isclass, isbuiltin, getmro
from abc import ABCMeta, abstractmethod
from callgraph.finder import find_object
from cal... |
"""
Command send to RCs.
Usage:
app [-h]
app [-v]
app [-a <element>]
app [-u <element>]
app [-d <element>]
app [-f <filter>]
Options:
-h --help Sports bet application:
app <option> <parameters>
To create a el... |
import pytest
import sympy
from comb_spec_searcher import CombinatorialSpecification
from comb_spec_searcher.rule_db import RuleDBForest
from comb_spec_searcher.strategies import ReverseRule
from comb_spec_searcher.utils import taylor_expand
from permuta import Av, Perm
from tilings import GriddedPerm, Tiling
from til... |
import numpy as np
from transformer import Transformer
import time
import sklearn
import random
import sklearn.gaussian_process
from mydirect import direct
import math
import json
DOT_SIG_VAL = 0.1
class DataPoint:
def __init__(self,coord,reward,group,fid_level,stdev):
self.coord = coord
self.rewa... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <<EMAIL>>
#
# 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 ... |
import argparse
import numpy as np
import tensorflow as tf
import socket
import importlib
import os
import sys
from tqdm import tqdm
from timeit import default_timer as timer
import utils.tfrecord_utils as tfrecord_utils
from tensorflow.python.client import timeline
def log_string(out_str):
#LOG_FOUT.write(out_st... |
#!python3
# Copyright 2021 SVA System Vertrieb Alexander GmbH
# 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... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from os.path import basename, splitext
import yaml
import os
import sys
import glob
import logging
from glue.core import Data, Subset
from glue.core.coordinates import coordinates_from_header
from glue.config import data_factory, data_exporter
from glue.c... |
"""
Original Author: SilentSpike (https://github.com/SilentSpike)
Modified: Dorbedo for TFAR
The functions searches all functions headers and creates an documentation for public functions
Supported header sections:
- Name (the function name)
- Author(s) (with description below)
- Arguments
- Return Value
- Examp... |
#!/usr/bin/env python
import numpy as np
# No error is raised if matplotlib cannot be imported here, because
# matplotlib and plotly are not needed for core operation of
# booz_xform, so we don't want to make them mandatory requirements.
try:
import matplotlib.pyplot as plt
except:
pass
try:
import plotly... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Functions to create nanowire networks.
#
# Author: <NAME>
# Date: July 26, 2021
from typing import List, Tuple, Union, Iterable, Dict
from numbers import Number
import numpy as np
from shapely.geometry import LineString
import networkx as nx
from .line_functions i... |
# This software is distributed under the 3-clause BSD License.
# Started 12 April by DLW
# Replace baseparsers.py and enhance functionality.
# The vision is that global_config ConfigDict can be accessed easily
# by all code.
# NOTE: at first I am just copying directly from baseparsers.py
# TBD: reorganize some of this.... |
"""extra utility functions"""
import os
import sys
import logging
import random
import operator
import numpy as np
import math
import tensorflow.keras
import tensorflow as tf
from tensorflow.python.keras.layers import Dropout
from tensorflow.keras.callbacks import Callback
from sklearn.metrics import f1_score, precisi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 <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 limitation
# the rights to use, copy, modify, mer... |
#!/bin/env python3
import argparse
import sys
import os
import re
from smrtsvlib.args import args_dict
from smrtsvlib.args import get_arg
from smrtsvlib import smrtsvrunner
# Get SMRTSV base directory
SMRTSV_DIR = os.path.dirname(os.path.abspath(__file__))
# Modify environment and get a copy
PROCESS_ENV = smrtsvru... |
"""Make plots for displaying results of BEST test.
This module produces plots similar to those in
<NAME>. (2012) Bayesian estimation supersedes the t
test. Journal of Experimental Psychology: General.
"""
from typing import Optional, Union
try:
import matplotlib.pyplot as plt
except ImportError:
import m... |
#%%
import pytest
from numpy.testing import assert_allclose
import numpy as np
import natural_bm.backend.theano_backend as BTH
import natural_bm.backend.numpy_backend as BNP
from natural_bm.backend.common import floatx, set_floatx
#%% Define checks
def check_dtype(var, dtype):
assert var.dtype == dtype
def che... |
# Copyright (c) 2021 Institute for Quantum Computing, Baidu 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
#
# Un... |
#!/usr/bin/env python
from __future__ import print_function
import os, sys, math, re
import numpy as np
from itertools import islice
from collections import defaultdict, OrderedDict
"""
In a folder that looks like this:
chunk_0000
chunk_0000/run.out
chunk_0000/scr/coors.xyz
chunk_0000/scr/grad.xyz
chunk_0000/scr/bond... |
"""
Low-level database routines.
This is a thin wrapper around Psycopg2 for database access, adding niceties like logging,
transaction handling, simple DSN strings, as well as simple commands
(for new users, schema creation, etc.)
For a description of the connection string, take inspiration from:
https://www.postgres... |
"""
深证信基础模块
"""
import math
import os
import time
import re
import logbook
import pandas as pd
from logbook.more import ColorizedStderrHandler
from selenium.common.exceptions import ElementNotInteractableException, NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.w... |
import pathlib
import pickle
import os
import copy
import json
import argparse
import datetime
import random
import numpy as np
from pprint import pprint
from collections import defaultdict
import torch
from src.helpers.data_loading import create_data_loader
from src.helpers.utils import load_json, save_json, str2boo... |
# -*- coding: utf-8 -*-
import importlib
import json
import logging
import os
import sys
from datetime import datetime, timedelta
from multiprocessing import Queue, Process
from time import sleep, time
import psutil
import six
from django.db import connections, transaction, connection
from django.db.models import Q
fr... |
"""
Asynchronous Advantage Actor Critic, A3C + RNN in continuous action space (https://arxiv.org/abs/1602.01783)
with Generalized Advantage Estimation, GAE (https://arxiv.org/abs/1506.02438)
Actor and Critic share similarities with the DDPG architecture (https://arxiv.org/abs/1509.02971)
Special thanks to the followin... |
###############################################################################
###############################################################################
"""Example usage:
from QNLP import *
vsm_verbs = VectorSpaceModel.VectorSpaceModel("file.txt")
vsm_verbs.sort_tokens_by_dist("verbs")
vsm_verbs.assign_indexing... |
import os
import sys
import cv2
import time
import torch
import shutil
import random
import numpy as np
import pandas as pd
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import transforms, utils
from torch.utils.data import Dataset... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 11 12:16:04 2019
@author: gryang
"""
import os
import sys
import pickle
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
rootpath = os.path.dirname(os.path.dirname(os.pa... |
'''Module to read in i3cols format data
i3cols is available here: https://github.com/jllanfranchi/i3cols
'''
import os
import pkg_resources
import numpy as np
def get_energies(mcprimary, mctree, mctree_idx, dtype=np.float32):
'''Get energies per event'''
neutrino_energy = mcprimary['energy']
track_ene... |
from __future__ import absolute_import
import functools # pylint: disable=unused-import
import logging
import os
import re
import shutil
import stat
import sys
import tempfile
import uuid
import datetime
from threading import Timer
from abc import ABCMeta, abstractmethod
from io import IOBase, open # pylint: disable... |
"""Mesoscale Convective System Identification and Tracking using Doppler Weather Radar Images"""
"""by <NAME>"""
"""Algorithm for plotting the Convective_System sequence with a folder of consecutive images given as input"""
#Importing the necessary libraries for the project
"""
LIBRARY : USE
1. cv2: OpenSourced Com... |
import random
# Constants that Scout uses to compute domains for element sizes.
CANVAS_HEIGHT = 640
CANVAS_WIDTH = 360
CANVAS_ALIGNMENT = ["left", "center", "right", "other"]
MAX_WIDTH = 360 # Largest while subtracting the smallest amount of padding
MAX_HEIGHT = 640 # Largest while subtracting the smallest amount of ... |
"""Data generation of simulated data for the Cox model."""
from typing import Callable, Sequence, Tuple, Optional, Union, List
import math
import functools
import simpleeval as se
import numpy as onp
import jax.numpy as jnp
from jax import vmap
import jax.lax
import jax.config
from jax import random as jrandom
im... |
"""
General utility class for accessing pickle data files and for simple transformations
Generally data is stored as dict of arrays, as dumped and compressed file.
using pytables is probably the best approach but we may have problems with portability
(or easy installation in different environments)
so here we use simp... |
import numpy as np
from numpy import ma
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
from skimage.feature import canny
from skimage.transform import probabilistic_hough_line
from skimage import morphology as ... |
import random
import threading
from sqlalchemy import Column, String, Boolean, UnicodeText, Integer, BigInteger
from gotti.modules.helper_funcs.msg_types import Types
from gotti.modules.sql import SESSION, BASE
DEFAULT_WELCOME = 'Hey {first}, how are you?'
DEFAULT_GOODBYE = 'Nice knowing ya!'
DEFAULT_WELCOME_MESSAG... |
# Copyright (c) 2020 <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 limitation the rights
# to use, copy, modify, merge, publish, distribute,... |
# Copyright (c) 2019 Cisco and/or its affiliates.
# 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 ag... |
"""Multi target Haskell REPL."""
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_skylib//lib:shell.bzl", "shell")
load("@io_tweag_rules_haskell//haskell:private/context.bzl", "haskell_context", "render_env")
load(
"@io_tweag_rules_haskell//haskell:private/path_utils.bzl",
"link_libraries",
"matc... |
"""
This module implements reading and writing of Measurements using netCDF4.
Each node is a netCDF4 group;
numpy arrays that are have entries in the dimensions dictionary are stored as netCDF4 variables;
other sequences like lists and tuples, or arrays that do not have a dimensions entry, are stored as variables with... |
import numpy as np
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.gaussian_process.kernels import RBF
class Dataset(object):
def __init__(self, X, Y, T, n_candidate, n_safety, n_test, seed=None, include_T=False, include_intercept=True, standardize=False):
n_train = n_candidate + n_saf... |
import os
import json
import numpy as np
import torch
from scipy.ndimage import gaussian_filter1d
def trans_motion2d_rc(motion2d, flip, visibility=False):
# subtract centers to local coordinates
if visibility:
ra_center = motion2d[2, :-1, :]
la_center = motion2d[5, :-1, :]
rl_center =... |
import argparse
from pathlib import Path
import numpy as np
import copy
import pickle
from collections import defaultdict
import torch
from torch import nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from datasets.vcoco import build as build_dataset
from models.backbone import build_backbo... |
"""
Train Transformer-VAEs using the Huggingface Trainer with Weights and Biasis.
"""
import logging
import inspect
import os
import sys
from dataclasses import dataclass, field, make_dataclass
from typing import Optional, Any
from datasets import load_dataset
import transformers
from transformers import (
Aut... |
#!/usr/local/bin/python3.6
import sys
import re
import ast
from datetime import datetime, timedelta
from collections import namedtuple, Counter
from statistics import mean, pstdev
from django.core.management.base import BaseCommand
from django.conf import settings
from archiver.models import Tune
Datum = namedtuple... |
''' This function reads a core script and creates line and verse info. of target language
EX run:
python3 create_lines_from_corescript_xls.py -i /Users/spanta/Desktop/jon_code_test/XLScr1051m_N_eng__English_N2_ESV__02.xls -o ENG_lines.csv -fileset 'ENG_N2'
python3 create_lines_from_corescript_xls.py -i /Users/spanta/... |
#!/usr/bin/env python3
# smugsync v2.3
# to keep my sanity since local directories can be both folders and galleries in SmugMug
# I use the following terminology in the code:
# local filesystem directory intended to be a 'Folder' in SmugMug is called a directory
# local filesystem directory intended to be a 'Gallery'... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
from numba import njit
import pickle
# load results and config
##############
# load results
idx = 0
path = '/home/rgast/PycharmProjects/BrainNetworks/BasalGanglia/config'
params = np.load(f"{path}/stn_gpe_str_params_{idx}.npy")
... |
# Author: <NAME>
# email: <EMAIL>
# this file define a set of functions which converting data type
import struct, numpy as np
from itertools import islice
from .private import safe_list
from .type_check import isstring, isinteger, isnparray, islist, isext, islistoflist, isrange, isscalar, isfloat
from .counter import... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.contenttypes.models import ContentType
from django.contrib import admin
from goflow.apptools.forms impo... |
#!/usr/bin/env python3
"""
Magi REST API © MIT licensed
https://magi.duinocoin.com | https://m-core.org
https://github.com/revoxhere/magi-rest-api
Duino-Coin Team & Community 2019-2021
"""
import gevent.monkey
gevent.monkey.patch_all()
import sys
import os
from flask_cors import CORS
from flask_caching import Cache
f... |
from application import app, db, ai_model, NEIGHBORHOODS, ROOM_TYPES
from application.models import (
User,
add_user,
Entry,
add_entry,
get_history,
delete_entry,
)
from flask import (
render_template,
request,
flash,
redirect,
abort,
session,
url_for,
jsonify,
)
... |
from torch.utils.data import Dataset, ConcatDataset
import copy
import os
import warnings
import torch
import numpy as np
import skimage
from scipy import ndimage
from torch import nn
import random
import sys
import six
from .residuals import upsample_residuals
from .augment import apply_transform, get_center_crop_coo... |
import os
import re
import time
import bisect
import textwrap
import threading
import traceback
from prompt_toolkit.application import Application
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.document import Document
from prompt_toolkit.enums import DEFAULT_BUFFER
from prompt_toolkit.filters import Con... |
#!/usr/local/bin/python3
"""A transpilation and minification tool for KerboScript (Extended)"""
# https://stackoverflow.com/questions/952914/how-to-make-a-flat-list-out-of-list-of-lists
flatten = lambda l: [item for sublist in l for item in sublist]
class ImportFileNotFoundError(FileNotFoundError):
"""Raised whe... |
import os
import json
import logging
import numpy as np
import torch
from torch.utils.data import Dataset
from collections import defaultdict
from dep_parser import DepInstanceParser
def change_word(word):
if "-RRB-" in word:
return word.replace("-RRB-", ")")
if "-LRB-" in word:
return word.rep... |
from tkinter import *
from tkinter import ttk
from tkinter.font import Font
from tkinter.scrolledtext import ScrolledText
from tkinter.ttk import Combobox, Style
import subprocess
from subprocess import PIPE, Popen, STDOUT
from OpenFiles import *
from functools import partial
from helpers import *
__author__ = "<NAME... |
#!/usr/bin/env python3
"""
# Processing Status
## Initial
The initial processing_status when the container first runs is:
{
processing_status = ProcessingStatus.PENDING
upload_status = UploadStatus.WAITING
upload_progress = 0
upload_message = ""
validation_status = ValidationStatus
validation_... |
from __future__ import unicode_literals
import os
import shutil
import subprocess
import multiprocessing as mp
from builtins import dict, input, str
from distutils.dir_util import copy_tree
from concurrent.futures import ThreadPoolExecutor, as_completed
from subprocess import CalledProcessError, PIPE, Popen, STDOUT
im... |
# Copyright (c) 2019-2021 <NAME>
# License: MIT License
from typing import (
TYPE_CHECKING,
List,
Iterable,
Tuple,
Any,
Dict,
MutableSequence,
MutableMapping,
Iterator,
Union,
)
from collections import OrderedDict
from contextlib import contextmanager
from ezdxf.math import Vec3,... |
#!/usr/bin/python3
import os
import cv2
import tqdm
import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.cm
matplotlib.use("cairo")
import tensorflow as tf
# tf.enable_eager_execution()
tf.compat.v1.enable_eager_execution()
from way... |
# Copyright 2018 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, ... |
#!/usr/bin/env python3
import csv
import io
import os
import os.path
import pickle
import sys
import tkinter as tk
from tkinter import ttk
import webbrowser
from pkg_resources import resource_filename
import nch
import nch.cargos
FILL = tk.N + tk.S + tk.W + tk.E
def save_config(data):
os.makedirs(os.path.dirn... |
from __future__ import print_function
from __future__ import division
import pandas as pd
import numpy as np
import click
import glob
import os
import sys
READ_CUTOFF = 2
SAMPLE_CUTOFF = 1
CIRC_HEADER = [
'chrom',
'start',
'end',
'name',
'score',
'strand',
'thickStart',
'thickEnd',
... |
import numpy as np
import matplotlib.pylab as plot
from scipy import interpolate
from BurstCube.LocSim.Spacecraft import Spacecraft
import healpy as hp
from pylab import cm
import matplotlib.colors as mpl_col
def load_mission(mission, lat=0., lon=np.radians(260.)):
"""Detector setup for various missions.
Pa... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 14 14:20:02 2020
@author: aliha
@twitter: rockingAli5
"""
import time
import pandas as pd
pd.options.mode.chained_assignment = None
import json
from bs4 import BeautifulSoup as soup
import re
from collections import OrderedDict
import datetime
from datetime import date... |
# -*- coding: utf-8 -*-
"""Triangular mesh data
This module provides a class for storing triangular meshes. Attributes
of the triangular mesh can be determined. In addition, methodes are available
to derive further information from the triangular grid.
"""
import numpy as np
__author__ = "<NAME>"
__copyright__ = "C... |
# This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... |
from __future__ import print_function
from bs4 import BeautifulSoup
import time
import lxml
import sys
import os
import re
import csv
import progressbar
import concurrent.futures as futures
from string import punctuation
# Break up CSVs into seasons
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
SITE_FOLDER... |
# License: MIT
# Author: <NAME>
import torch
import torch.nn as nn
import torch.distributions as dists
import numpy as np
import torchvision
def double_conv(in_channels, out_channels):
return nn.Sequential(
nn.Conv2d(in_channels, out_channels, 3, padding=1),
nn.BatchNorm2d(out_channels),
... |
#!/usr/bin/python3
# Create the field maps used by the simulation
# Implement the 2021 competition map and the ones for the Skills Challenge
# resources:
# https://firstfrc.blob.core.windows.net/frc2020/Manual/Sections/Section03.pdf
# https://firstfrc.blob.core.windows.net/frc2020/PlayingField/LayoutandMarkingDiagram... |
"""A module containing metaclass for all unit classes"""
from __future__ import annotations
import copy
import math
from collections import defaultdict
from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast
from ordered_set import OrderedSet # type: ignore
UNITS_CHARACTERS_BLACKLIST = "*/ "
UNITS_S... |
#! /usr/bin/env python3
import argparse
import json
import multiprocessing
import neat
import numpy as np
import os
import random
import re
import shutil
import time
from itertools import count
from deap import base, creator, tools
import robot
from goal_reaching.controller import Controller
from goal_reaching.rob... |
import tensorflow as tf
import numpy as np
import re
try:
from .trf_gpt_noise import model_fn_builder as noise_dist
from .trf_ebm_bert import model_fn_builder as ebm_dist
from .trf_classifier import get_ebm_loss, get_noise_loss, ebm_noise_train_metric, ebm_noise_eval_metric
except:
from trf_gpt_noise import model_... |
#!/usr/bin/env python3
# Copyright 2015, 2016 <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 ... |
"""Module for thin film functions to make complex-valued HLC occulters."""
import numpy as np
from os.path import isfile
import os
import numpy as np
import falco
from falco.check import real_scalar, real_positive_scalar,\
real_nonnegative_scalar, scalar_integer,\
... |
from dataclasses import dataclass
import json
import logging
import math
import svgpathtools
from PyQt5 import QtWidgets, QtCore, QtGui
logger = logging.getLogger(__name__)
@dataclass
class Point:
x: float
y: float
tabwidth: float = 0.0
def xv(self):
return self.x if self.tabwidth == 0 else... |
#!/usr/bin/env python
# pylint: disable=missing-docstring,line-too-long
# pylint: disable=useless-object-inheritance,len-as-condition
# pylint: disable=too-many-boolean-expressions,too-many-branches
#
# Licensed under the CC-GNU Lesser General Public License, Version 2.1 (the "License");
# you may not use this file ex... |
import os
from datetime import datetime
import time
import random
import inspect
import platform
import getpass
import socket
from Main.Utility import xmlReader as Env
from pathlib import Path
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
... |
# -*- coding: utf-8 -*-
# TODO - MUST ADD ACCRUED INTEREST TO MODEL!!!!
from math import exp, sqrt
from numba import njit
import numpy as np
from ...finutils.FinDate import FinDate
from ...finutils.FinError import FinError
from ...finutils.FinFrequency import FinFrequency, FinFrequencyTypes
from ...finutils.FinMath ... |
#! python
## Copyright (c) 2018-2021, Carnegie Mellon University
## See LICENSE for details
## This script reads a file, cube-sizes.txt, that contains several cube size
## specifications for the 3D DFT. This script will:
## Generate a list of source file names for CMake to build
## Create the source fi... |
from subprocess import call
import git
from os import path
import os
import re
import requests
import subprocess
import json
import time
import sys
import base64
import shutil
import argparse
# Filenames for input/output files
workspaceFolder = "workspace_licenses"
reposFilename = "repos.txt"
combinedFilename = 'combi... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
import logging
import logging.config
import os
import random
import shutil
import sys
from datetime import date, datetime, timedelta
from time import sleep
from absl import app, flags
from tqdm import tqdm
from . import config_util, datetime_util
from .downlo... |
# MIT License
# see LICENSE for details
# Copyright (c) 2017-2019 Arkrissym
import json
import os
import pathlib
import re
import time
import urllib.error
import urllib.request
import discord
from discord.ext import commands
from core import config, dataBase
from core.logger import logger as log
class LeagueOfLe... |
"""TabularData.
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
<NAME> 2019-2020, Citrine Informatics.
Tabular indexed finite data.
Can handle several million data points.
See TabularData for details and tests for timings.
"""
from typing import Any, Callab... |
#!/usr/bin/env python
# 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
# "L... |
import csv
import html
import json
import logging
import os
import re
import tempfile
from collections import OrderedDict
from datetime import timedelta
from decimal import Decimal
import subprocess
from io import StringIO
from typing import List, Any, Optional, Union, Dict, Sequence, Tuple, TypeVar
from django.conf im... |
# In the training code we have given comments for various lines to facilitate the understanding. Please read 'train.py' first.
opt = {'switch':20000}
opt.update({'lr':1e-4})
opt['dir_root']='/home/mohit/Music/attention_low_light/'
opt['exp_name'] = 'AVG-sir-amplifier'
opt['gpu'] = "1"
opt['epochs'] = 1000000
opt['bat... |
from __future__ import print_function
from builtins import object
from emspy.query import LocalData
import networkx as nx
import pandas as pd
import os, sys, re
class Flight(object):
temp_exclude = [
'Download Information',
'Download Review',
'Processing',
'Profile 16 Extra Data',... |
"""
this is a trial to see how we can generate openscad via python in an oriented object way
"""
try :
from . import render_openscad as render
except :
import render_openscad as render
try :
from . import python_to_openscad_globals_variables as glbs
except:
import python_to_openscad_glob... |
#!/usr/bin/python3
import os
import sys
import json
import argparse
import subprocess
from PIL import Image, ImageOps
from glob import glob
animSize = 65536
srcdir = os.path.dirname(os.path.abspath(__file__))
ldsfile = os.path.join(srcdir,'animation.lds')
# The list of animations to build.
animations = ['marquee-ima... |
'''
MyChem Data-Aware Tests
'''
import pytest
from biothings.tests.web import BiothingsTestCase
class TestMyChem(BiothingsTestCase):
inchikey_id = 'ZRALSGWEFCBTJO-UHFFFAOYSA-N'
drugbank_id = 'DB00551'
chembl_id = 'CHEMBL1308'
chebi_id = 'CHEBI:6431'
unii_id = '7AXV542LZ4'
pubchem_id = ... |
from __future__ import absolute_import, division, print_function
import os, random
import numpy as np
from enum import Enum
import cv2 # for FaceEncoderModels.LBPH, FaceEncoderModels.OPENFACE
import pickle # for FaceEncoderModels.OPENFACE and FaceEncoderModels.DLIBRESNET
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.