text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
# mnis.mnislib module
"""
Name: mnislib.py
Author: <NAME>
About: A library of ad-hoc functions for downloading data from
the Members Names Information Service (MNIS) at data.parliament.uk.
A description of the MNIS API can be found here:
http://data.parliament.uk/membersdataplatform/memberqu... |
from __future__ import absolute_import, division, print_function
import argparse
import csv
import json
import logging
import os
import random
import sys
import time
import formation_model
import numpy as np
import torch
import torch.nn.functional as F
from pytorch_transformers import (WEIGHTS_NAME, Ad... |
import inspect
import importlib
import pkg_resources
import transaction
from contextlib import contextmanager
from inspect import getmembers, isfunction, ismethod
from itertools import chain
from onegov.core import LEVELS
from onegov.core.orm import Base, find_models
from onegov.core.orm.mixins import TimestampMixin
f... |
import os
import sys
import numpy as np
import time
import psutil
from sklearn.externals import joblib
default_settings_alg_io = None
def is_lap_in_custom_str(
cur_lap=None,
laps_to_save_custom='',
):
''' Determine if current lap is specified by user custom lap list
Returns
------... |
from __future__ import print_function
import six
import os
import sys
import platform
import ctypes
import re
import numpy as np
import numpy.ctypeslib as npc
from collections import OrderedDict
from hls4ml.model.hls_layers import *
from hls4ml.templates import get_backend
from hls4ml.writer import get_writer
from hls... |
#!/usr/bin/python3
import sys
import time
import binascii
import os
import threading
import bluepy
import yaml
from .util import *
#should it be in a different format?
RobotControlService = "22bb746f2ba075542d6f726568705327"
BLEService = "22bb746f2bb075542d6f726568705327"
AntiDosCharacteristic = "22bb746f2bbd75542d6... |
"""
Tasks for creating and inspecting Prefect flow runs
Example:
```python
import prefect
from prefect import task, Flow, Parameter
from prefect.tasks.prefect.flow_run import (
create_flow_run,
get_task_run_result,
)
@task
def create_some_data(length: int):
return... |
from __future__ import with_statement, unicode_literals
import os
import re
import sys
from tempfile import mkdtemp
from shutil import rmtree, copytree
from bs4 import BeautifulSoup
from django.core.cache.backends import locmem
from django.test import SimpleTestCase
from django.test.utils import override_settings
fr... |
import pendulum
import pytest
def test_dashboard_located(connection):
dash = connection.get_dashboard("sales_dashboard")
assert dash is not None
assert dash.name == "sales_dashboard"
assert dash.label == "Sales Dashboard (with campaigns)"
assert dash.layout == "grid"
assert isinstance(dash.el... |
# This is the reinjection problem described in the MT3D supplementary
# information.
import os
import pytest
import sys
import numpy as np
try:
import flopy
except:
msg = "Error. FloPy package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install flopy"
r... |
# --------------------------------------------------------------------------------
# Copyright (c) 2017-2020, <NAME>, All rights reserved.
#
# Define basic classes to deal with graphs.
# --------------------------------------------------------------------------------
from collections import OrderedDict
import numpy as ... |
# Copyright (C) 2011 by <NAME> (<EMAIL>)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import re
line_floats_re = re.compile("-*\d+\.\d+")
def parse_basics(lines, results):
"""Parse the basic ... |
import os
import cv2
import numpy as np
import os
import shutil
import time
import random
import math
import functools
class Point(object):
def __init__(self, x, y):
self.x = x
self.y = y
def __str__(self):
return '[{},{}]'.format(self.x,self.y)
def cmp(a, b, c):
if a.x-c.x >= ... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 30 16:40:47 2019
@author: aimachine
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 30 14:38:04 2019
@author: aimachine
"""
import numpy as np
import os
#from IPython.display import clear_output
from stardist.models impo... |
#
# Copyright (c) 2021 Project CHIP Authors
#
# 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 i... |
import urllib
import requests
import pandas as pd
import numba
import numpy as np
import strax
import straxen
from datetime import datetime
from datetime import timedelta
import time
import pytz
import getpass
import warnings
from configparser import NoOptionError
import sys
if any('jupyter' in arg for arg in sys.... |
# The MIT License (MIT)
#
# Copyright (c) 2014, <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... |
import heterocl as hcl
import numpy as np
import time
import plotly.graph_objects as go
from gridProcessing import Grid
from shape_functions import *
from custom_graph_functions import *
from InvertPendulum import *
from argparse import ArgumentParser
import math
""" USER INTERFACES
- Define grid
- Generate initial ... |
import logging
import pickle
import uuid
import os
import importlib
import yaml
from abc import ABCMeta, abstractmethod
from typing import Any, Optional, Union, List, Dict, Text
from os import mkdir
from copy import deepcopy
import posixpath
import shutil
import cloudpickle
import numpy as np
import pandas
import mlfl... |
# -*- coding: utf-8 -*-
"""
Class "Circuit" defines simple one port object/circuit having
frequency (single point or array), impedance, and possibly a list
of components that constitute the circuit.
"""
import numpy as np
import scipy
import matplotlib.pyplot as plt
import skrf
class Circuit:
def __init__(s... |
import torch
import colorful
import os
import math
import numpy as np
from utils import AverageMeter, Group_AverageMeter, accuracy, summarize_example_wise, average_lst, \
f1_score_per_class, precision_score_per_class, recall_score_per_class, \
f1_score_overall, precision_score_overall,... |
#! /usr/bin/python
################################################################################
# 1st parameter = trace to read
################################################################################
from otf import *
import sys
def handleDefComment( fha, stream, comment, kvlist ):
print ( ' handleD... |
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Integration with webapp2."""
# Disable 'Method could be a function.'
# pylint: disable=R0201
import functools
import json
import logging
impo... |
"""
Backend for xESMF. This module wraps ESMPy's complicated API and can create
ESMF Grid and Regrid objects only using basic numpy arrays.
General idea:
1) Only use pure numpy array in this low-level backend. xarray should only be
used in higher-level APIs which interface with this low-level backend.
2) Use simple,... |
#!/usr/bin/env python3
# Copyright 2019 <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 agree... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
"""Shared utilities used by various classes, all placed here to avoid circular imports.
This file INTENTIONALLY has NO module dependencies!
"""
from __future__ import absolute_import, divi... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
post processing the bold
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_ciftipostprocess_wf
"""
import os
import sklearn
import numpy as np
from copy import deepcopy
import nibabel as nb
from nipyp... |
'''
data.py: contains all data generating code for datasets used in the script
'''
import os, sys
import h5py
import numpy as np
from sklearn import preprocessing
from keras import backend as K
from keras.datasets import mnist
from keras.models import model_from_json
import vdae.pairs as pairs
def get_data(params,... |
"""
tests the pysat utils area
"""
import pysat
import pandas as pds
from nose.tools import assert_raises, raises
import nose.tools
import pysat.instruments.pysat_testing
import numpy as np
import os
import tempfile
import sys
if sys.version_info[0] >= 3:
if sys.version_info[1] < 4:
import imp
re_l... |
from __future__ import print_function
import sys
import threading
from time import sleep
try:
import thread
except ImportError:
import _thread as thread
import pybullet as p
import math
import operator
import json
from scipy.spatial import distance
import matplotlib.pyplot as plt
import time
import numpy as n... |
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
##############################################################################
# Copyright 2003 & onward LASMEA UMR 6602 CNRS/Univ. Clermont II
# Copyright 2009 & onward LRI UMR 8623 CNRS/Univ Paris Sud XI
#
# Distributed under the Boost ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import keras.backend as keras_backend
import numpy as np
import pandas as pd
import scipy.sparse as sps
import sys
from imblearn.over_sampling import RandomOverSampler
from itertools import compress
from scipy.sparse import issparse
fro... |
import time
import errno
import socket
import six
from weakref import ref as weakref
try:
from itertools import izip as zip
except ImportError:
pass
from redis import StrictRedis
from redis.client import list_or_args
from redis.exceptions import ConnectionError
try:
from redis.exceptions import TimeoutEr... |
from tkinter import *
import numpy as np
from tkinter.filedialog import askopenfilename,asksaveasfilename
from PIL import Image, ImageTk
import tkinter as tk
from tkinter import ttk
import os
import ReadLog as RL
import pandas as pd
class Main(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
# ---... |
""" Generate the information necessary to product the vrctst input files
"""
import os
import subprocess
import automol
import varecof_io
def input_prep(ts_zma, rct_zmas, dist_name, vrc_path):
""" prepare all the input files for a vrc-tst calculation
"""
# Set info on the form indices
bnd_frm_idxs =... |
# Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
import math, os, sys
sys.path.append("../../../lib") # for _simV2.so
sys.path.append... |
import git
import yaml
import glob
import os
import tarfile
import pandas as pd
import numpy as np
from astropy.time import Time
from astropy import units as u
from astropy.coordinates import Angle
from astropy.coordinates import SkyCoord
from astropy.io import ascii
from astropy.table import QTable, Table
from astrop... |
__copyright__ = """
Copyright (C) 2012 <NAME>
Copyright (C) 2016, 2017 <NAME>
"""
__license__ = """
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 limitatio... |
"""Inference engine (types, values, etc.)."""
import asyncio
from .ir import is_constant, is_constant_graph, is_apply
from .utils import Named, Partializable
# Represents an unknown value
ANYTHING = Named('ANYTHING')
class InferenceError(Exception):
"""Inference error in a Myia program."""
pass
class M... |
#%% Imports
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, LSTM, Dense, Embedding, Flatten, TimeDistributed, Dropout, LSTMCell, RNN, Bidirectional, Concatenate, Layer
from tensorflow.keras.callbacks import ModelCheckpoint
from te... |
from ScenarioHelper import *
class CharInfo:
def __init__(self, id, name, SetChipHandler = None):
self.Name = name
self.Id = id
self.SetChipHandler = SetChipHandler
StaticCharList = \
(
CharInfo(0x00, '罗伊德'),
CharInfo(0x01, '艾莉'),
CharInfo(0x02, '缇欧'),
CharInfo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" ConfTest """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import prin... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from .exceptions import IndexAlreadyExistsException, IndexMissingException
from .utils import make_path
from .filters import Filter
from .mappings import Mapper
import six
class Indices(object):
alias_params = ['filter', 'routing', 'search_routing', 'index_... |
# Copyright (C) Schweizerische Bundesbahnen SBB, 2016
# Python 3.4
__author__ = 'florianseidl'
import json
import logging
import re
import sys
from concurrent import futures
from datetime import datetime
from urllib.parse import urlparse
from urllib.error import HTTPError, URLError
from cimon import JobStatus, Reque... |
#!/usr/bin/env python3
__author__ = "<NAME>"
__copyright__ = "Copyright 2017"
__version__ = "0.3.1"
__email__ = "<EMAIL>"
__status__ = "Beta"
# Imports
import sys
import openpyxl
import datetime
import time
import os
import jinja2
import re
import selenium.webdriver
import selenium.webdriver.chrome.options
impor... |
from photons_protocol.packets import dictobj, reprer
from photons_app.errors import ProgrammerError
from photons_protocol.errors import PhotonsProtocolError
from photons_messages import TileMessages
from delfick_project.norms import sb, BadSpecValue
from datetime import datetime
from unittest import mock
import date... |
import json
import os
from datetime import datetime
import numpy as np
import pandas as pd
from imageio import imwrite
from torch.utils.tensorboard import SummaryWriter, FileWriter
import atexit
from tensorboard.compat.proto.event_pb2 import SessionLog
from tensorboard.compat.proto.event_pb2 import Event
from tensorbo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME>
"""
utilites
"""
import numpy as np
import sklearn.metrics as metrics
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import dates
from datetime import datetime
from sklearn import preprocessing, linear_model
from sklearn.model_selecti... |
from __future__ import print_function
from __future__ import absolute_import
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
i... |
#!/usr/bin/python
import sys
"""
Zadani:
Vasim ukolem je implementovat funkce, ktere pracuji s datovou strukturou 2-3 strom.
2-3 strom je B-strom, jehoz kazdy vnitrni uzel obsahuje 1 nebo 2 klice (a tedy 2 nebo 3 potomky).
Prazdny strom ma korenovy uzel None. Delka vetvi musi byt stejna (vsechny listy jsou ve
stejne ... |
import datetime
from functools import partial
import numpy as np
import regex as re
import toolz
from multipledispatch import Dispatcher
import ibis
import ibis.common as com
import ibis.expr.datatypes as dt
import ibis.expr.lineage as lin
import ibis.expr.operations as ops
import ibis.expr.types as ir
import ibis.sq... |
# -*- coding: utf-8 -*-
#
# This file contains code related to acoustics (critical / octave bands, etc)
# 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 ... |
import sys
import os
import subprocess
import os.path
import glob
import time
import copy
from .tools import DD, filemerge
from .sql import RUNNING, DONE
from optparse import OptionParser
from .runner import runner_registry
from contextlib import contextmanager
CACHESYNC_VERBOSE = False
CACHESYNC_LOCK = True
_endms... |
import os
import copy
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import roc_auc_score
def cal_precision_recall(positive_scores, far_neg_scores, close_neg_scores, fpr):
"""
Computes the precision and recall for the given... |
#
# Copyright (c) 2010, <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:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... |
import json
from Qt import QtCore, QtWidgets, QtGui
from dcc import fnscene, fntransform
from dcc.ui import qrollout, qiconlibrary, qdivider, qtimespinbox, qxyzwidget, qseparator
from ezalign.abstract import qabstracttab
import logging
logging.basicConfig()
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)... |
""" Provides classes for creating RTMP (Real Time Message Protocol) servers and clients. """
# This is an edited version of the old library developed by prekageo and mixed with edits from nortxort.
# https://github.com/prekageo/rtmp-python & https://github.com/nortxort/pinylib
import socket
import logging
import rand... |
"""
PyPortal based alarm clock.
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open source hardware by purchasing
products from Adafruit!
Written by <NAME> for Adafruit Industries
Copyright (c) 2019 Adafruit Industries
Licensed under the MIT license.
All text above m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import collections
import os
import pickle
import numpy as np
from antlia import dtype
from antlia import kalman
from antlia import record
from antlia import trial2
BICYCLE_LOG_FILES = [
'2018-04-23_12-30-38.csv',
'2018-04-23_13-13-36.csv',
'2018-04-23_14-22-5... |
# A demo of a fairly complex dialog.
#
# Features:
# * Uses a "dynamic dialog resource" to build the dialog.
# * Uses a ListView control.
# * Dynamically resizes content.
# * Uses a second worker thread to fill the list.
# * Demostrates support for windows XP themes.
# If you are on Windows XP, and specify a '--noxp' ... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#! /usr/bin/env python
"""Catch moment when tables are in sync on master and slave.
"""
import sys, time, os, subprocess
import pkgloader
pkgloader.require('skytools', '3.0')
import skytools
class TableRepair:
"""Checks that tables in two databases are in sync."""
def __init__(self, table_name, log):
... |
# Copyright <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS ... |
import os
import base64
from datetime import date
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import dash
import flask
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_extendable_graph as deg
import plotly.graph_objects as go
import dash_html_components a... |
import argparse
import cv2
from models import * # set ONNX_EXPORT in models.py
from utils.datasets import *
from utils.utils import *
###############################################################
class_index = { '0':0, '1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9,\
'A':10, 'B':11,... |
import os
from typing import Any, List, Optional
from fastapi import APIRouter, Body, Depends, Form, Query, Request, status
from requests_oauthlib import OAuth2Session
from starlette.responses import RedirectResponse, Response
from contaxy import config
from contaxy.api.dependencies import (
ComponentManager,
... |
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Uploads a number of viewpoints and episodes and tests query of
viewpoints by viewpoint id, with limits and start keys.
"""
__author__ = '<EMAIL> (<NAME>)'
import random
import time
from copy import copy
from functools import partial
from viewfinder.backend.ba... |
"""
Created on Wed Nov 07 2018
@author: Analytics Club at ETH <EMAIL>
"""
import itertools
import time
from time import localtime, strftime
from os import path, mkdir, rename
import sys
from sklearn.metrics import (accuracy_score, confusion_matrix, classification_report)
from sklearn.model_selection import GridSearch... |
# Copyright 2021 The Scenic Authors.
#
# 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 w... |
"""
Experiment metadata parsing and validation.
"""
import os.path as osp
import json
from collections import defaultdict
from lrgasp import LrgaspException, gopen, iter_to_str, existing_datafile_name
from lrgasp.objDict import ObjDict
from lrgasp.defs import Repository, Species, Challenge, DataCategory, Sample, Librar... |
"""
Type definition for model parameters
"""
from numpy import int_
from pydantic import BaseModel, Extra, root_validator, validator
from pydantic.dataclasses import dataclass
from datetime import date
from typing import Any, Dict, List, Optional, Union
from autumn.settings.constants import COVID_BASE_DATETIME, GOOGL... |
import sublime, sublime_plugin
from ..hook import Hook
from .window_view_manager import window_view_manager
from ..folder_explorer import FolderExplorer
class WindowView():
def __init__(self, title="WindowView", window=None, view=None, restore_layout=False):
self.view_caller = sublime.active_window().active_vie... |
"""
Copyright 2018 InfAI (CC SES)
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... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# -*- coding: utf-8 -*-
""" # CRÉDITOS
Software desarrllado en el laboratorio de biología de plantas ubicado en el campus Antumapu perteneciente a la Universidad de Chile.
- Autores:
- <NAME>.
- <NAME>.
- Contacto:
- <EMAIL>
- <EMAIL> """
#package imports
import pandas as pd
import os
... |
import numpy as np
import scipy as sp
import scipy.special
from tqdm import tqdm
import utils
from .model import HierarchicalVAE
def calculate_evidence(sess, data, iwhvae, iwae_samples, iwhvi_samples, batch_size, n_repeats,
tau_force_prior=False, tqdm_desc=None):
losses = utils.batched_run... |
#!/usr/bin/env python
# coding: utf-8
# IMPORTS
import numpy as np
from numpy import array
import matplotlib.pyplot as plt
import string
import os
from PIL import Image
import glob
from pickle import dump, load
from time import time
from keras.preprocessing import sequence
from keras.models import Sequential
from ker... |
import numpy as np
import scipy.special
import lmfit
h = 6.626e-34 # J/s
hbar = 1.054571e-34 #J/s
kB = 1.38065e-23 #J/K
qC = 1.602e-19 # C
kBeV = kB/qC
def sigmas(fres,Tphys,Tc):
wres = fres*2*np.pi
xi = hbar*wres/(2*kB*Tphys)
Delta = 3.52*kB*Tc/2.0
sigma1 = (((4*Delta) / (hbar*wres)) *
... |
# coding=utf-8
"""
flask_resteasy.configs
~~~~~~~~~~~~~~~~~~~~~~
"""
import datetime
import json
from flask import current_app
from flask import url_for
from sqlalchemy.inspection import inspect
from inflection import underscore, camelize, singularize, pluralize
from flask_resteasy.factories import ParserF... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import os
import gc
import numpy as np
import pandas as pd
from category_encoders import TargetEncoder
from features import one_hot_encoder, Feature, LargeFeature
from features.base import Base
from features.feature_cleaner import clean_data
from features.raw_data import Bureau, BureauBalance
class BureauFeatures(Fe... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import os
import typing
from . import common
from . import lexer
__all__ = [
"PreprocessError",
"RezPreprocessor",
]
# NOTE: The meanings of the control characters "\r" and "\n" are reversed in Rez. For example, in $$read input and #printf output, all "\r" are replaced with "\n" and vice versa. This is because th... |
import datetime as dt
import dateutil.tz
import pandas as pd
from pandas import NaT
utc = dateutil.tz.tzutc()
def prep_based_on_load_profile(res_dict, highest_generation_df, max_kwh=28500):
prep_start_time = res_dict['prep_start']
if prep_start_time is None or prep_start_time is NaT:
return res_dict
... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2019 CNRS
# 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 limita... |
"""
适用于连续动作的model_based算法
论文:https://arxiv.org/abs/1805.12114
"""
import numpy as np
from scipy.stats import truncnorm
import gym
import itertools
import torch
import torch.nn as nn
import torch.nn.functional as F
import collections
import matplotlib.pyplot as plt
class CEM:
""" 交叉熵模型 """
def __init__(self, n... |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import torch
import torch.utils.data as data_utils
import signal
import sys
import os
import logging
import numpy as np
import json
import time
import deep_sdf
import deep_sdf.workspace as ws
class LearningRateSchedule:
def get_learn... |
#!/usr/bin/env python
"""
##########################
Hazard Package Data Module
##########################
"""
# -*- coding: utf-8 -*-
#
# rtk.analyses.hazard.Hazard.py is part of The RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com
#
# Redistribution an... |
import abc
import collections
import concurrent.futures
import enum
import itertools
import logging
import multiprocessing as mp
import os
import pathlib
import signal
import sys
import time
import traceback
import typing
import zipfile
from collections import namedtuple
from typing import (
Any,
Dict,
Tupl... |
'''
# Pipeline for designing qPCR primers
- batch processing
- similar to primer-BLAST, but can be used to analyze any genomes
- customized gene annotations (gff3), genomes, transcripts seq
- pick primers using primer3
- runs blast against genome and transcriptome seq.
- finally reports primers as .tsv.
- plot primer l... |
from io import BytesIO, TextIOWrapper
from pathlib import Path
from time import time
from typing import Union, TextIO, List
from lzma import compress, decompress
import PIL.Image
import discord
from core.abc.fileSystem import AbstractFileSystem, AbstractFile, openingReadMode, openingWriteMode, AbstractFolder, fileTy... |
"""
Implement a residualizer pipeline that, given data (e.g., returns or features),
computes:
1) factors
2) loadings
3) residuals
Each of the 3 components:
- has an interface and multiple implementations
- supports both stateful and stateless operations
- supports a functional style, composable with pandas and followi... |
from __future__ import annotations
import time
import traceback
from ..ocr import ocrhandle
from ..utils import config
from ..utils import typealias as tp
from ..utils.image import scope2slice
from ..utils.log import logger
from ..utils.recognize import Scene, RecognizeError
from ..utils.solver import BaseSolver, Str... |
import blosc
from meshparty import trimesh_vtk
from meshparty.trimesh_io import Mesh
import pandas as pd
import numpy as np
from .utils import InputError, unique_column_name, DEFAULT_VOXEL_RESOLUTION, MaskedMeshMemory, _compress_mesh_data, _decompress_mesh_data
class AnchoredAnnotationManager(object):
def __init_... |
from scipy.io import netcdf
import numpy as np
import numpy.matlib
tave = 900
basedir = '/marconi_work/FUA34_MULTEI/stonge0_FUA34/rad_test/2nd_deriv/T1/'
basedir = '/marconi_work/FUA34_MULTEI/stonge0_FUA34/rad_test/2nd_deriv/rho_scan2/r0.001/'
basedir = '/marconi_work/FUA34_MULTEI/stonge0_FUA34/rad_test/fg_drive/r... |
import json
import random
import os
def flip_row(row):
return reversed(row)
def flip_board(board):
new_board = []
for i in range(0, 20):
new_board += flip_row(board[i*10:(i+1)*10])
return new_board
# piece: {frame: {column: result(pfc)}}
result_table = {
1: { # O - same frame, same block
0: {
-2: (1, ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe.model.document import Document
from frappe.utils import flt, getdate,cint, cstr
import pandas as pd
import math
from datetime... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import argparse
import os
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.trainer as trainer
import torch.utils.trainer.plugins
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datase... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.