text stringlengths 8.04k 46.5k |
|---|
# Copyright (c) 2018, MD2K Center of Excellence
# All rights reserved.
# author: <NAME>
# 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
# l... |
from typing import List, Iterable, Tuple, Any, Union, Dict, Optional, Callable, overload
import itertools
from collections import defaultdict
import json
from pathlib import Path
import torch
import numpy as np
import transformers
from transformers import AutoTokenizer, LogitsProcessorList
# from .set_decoding import... |
import copy
import hashlib
import hmac
import io
import json
import logging
import os
import secrets
import xml.etree.ElementTree as ET
from PIL import Image
from decimal import Decimal
from email.mime.image import MIMEImage
from pathlib import Path
from requests_pkcs12 import post
from django.conf import settings
fr... |
import re
import numpy as np
from .skbio_protein import SkbSequence
from .align import align_seqs, parental_numbering
import warnings
"""
mutation strings attempt to follow HGVS-nomenclature
http://varnomen.hgvs.org/recommendations/protein/
but for now, the assumption is generally for single-letter AA codes
whereas th... |
import argparse
import numpy as np
import torch
from utils import ODE_dataset, utils
import models
import os
from config import load_goku_train_config
###### REMOVE THIS
import matplotlib.pyplot as plt
def plot_samples(pred_x, mini_batch, file='sample.png'):
plt.figure() # specifying the overall grid size
... |
# vim: sw=4:ts=4:et
__all__ = [
'EV_TEST_DATE',
'EV_ROOT_ANALYSIS_TOOL',
'EV_ROOT_ANALYSIS_TOOL_INSTANCE',
'EV_ROOT_ANALYSIS_ALERT_TYPE',
'EV_ROOT_ANALYSIS_DESCRIPTION',
'EV_ROOT_ANALYSIS_EVENT_TIME',
'EV_ROOT_ANALYSIS_NAME',
'EV_ROOT_ANALYSIS_UUID',
'create_root_analysis',
'ACE... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""This module corresponds to the bspline directory in idlutils.
"""
from warnings import warn
import numpy as np
from numpy.linalg.linalg import LinAlgError
from scipy.linalg import cholesky_banded, cho_solve_banded
from . import P... |
# -*- coding: utf-8 -*-
"""lagrangian_case.py: Defines the classes for CSET Lagrangian data case types."""
__author__ = "<NAME>"
__version__ = "0.1"
from CSET_data_classes import CSET_Data, CSET_Flight_Piece
import utils
import met_utils as mu
import re
import numpy as np
import os
import xarray as xr
import matplot... |
"""
This is a Python implementation of the ideas described in Chapter 19 (Archimedean Tilings) of the book
"Symmetries of Things" by <NAME>, <NAME>, and <NAME>.
"""
import re
class DoilyFeature(object):
ROTARY_ARM = 0
FOLDED_BAND = 1
HALF_ARM = 2
UNTWISTED_BAND = 3
TWISTED_BAND = 4
HALF_BAND ... |
# -*- coding: utf-8 -*-
import pytz
import datetime
from pyramid.view import view_config
from stalker import db, Project, Status, Daily, Link, Task
from stalker.db.session import DBSession
import transaction
from webob import Response
from stalker_pyramid.views import (get_logged_in_user, logger,
... |
# -*- coding: utf-8 -*-
# This file is part of the OpenSYMORO project. Please see
# https://github.com/symoro/symoro/blob/master/LICENCE for the licence.
"""
This module of SYMORO package provides symbolic
solutions for inverse geometric problem using Pieper Method.
"""
from sympy import var, sin, cos, eye, atan2... |
"""
module for generating C, C++, Fortran77, Fortran90 and python routines that
evaluate sympy expressions. This module is work in progress. Only the
milestones with a '+' character in the list below have been completed.
--- How is sympy.utilities.codegen different from sympy.printing.ccode? ---
We considered the id... |
from __future__ import division
import random
import warnings
import numpy as np
from numpy.testing import assert_allclose, raises
from nose.plugins.attrib import attr
from menpo.testing import is_same_array
from menpo.image import Image, MaskedImage
from menpo.feature import (hog, lbp, es, igo, daisy, no_op, normali... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# this file is modified from https://github.com/Friends-of-Tracking-Data-FoTD/LaurieOnTracking/blob/master/Metrica_PitchControl.py
# original author: <NAME> (research work developed by William Spearman)
import numpy as np
"""
Created on Mon Apr 19 14:52:19 2020
Module f... |
# 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... |
from __future__ import absolute_import, division, print_function
import os
from nltk.util import pr
from torch._C import dtype
from typing_extensions import final
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # del
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import argparse
import random
import sys
import re
import js... |
#####################
# Built-In Modules
from calendar import c
from errno import errorcode
import locale
import logging
from operator import sub
import pytest
import os
import random
import subprocess
import webbrowser
from xml.etree.ElementTree import TreeBuilder
import colorama
import json
import sys
... |
import sys
import logging
import math
from threading import Lock
from PyQt5.QtWidgets import QFrame, QGridLayout, QLabel, QPushButton, QSizePolicy, QHBoxLayout, QVBoxLayout, QWidget
from PyQt5.QtGui import QColor, QPainter, QPixmap
from PyQt5.QtCore import pyqtSignal, Qt, QSize
from .gui_browser import Browser, printa... |
# -*- coding: utf-8 -*-
"""
Unit tests for the ASSET analysis.
:copyright: Copyright 2014-2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
import random
import unittest
import itertools
import neo
import numpy as np
import quantities as pq
import scipy.spatia... |
import collections
import XenAPI
from xmlrpc.client import DateTime as xmldt
from datetime import datetime
import pytz
from exc import *
from authentication import BasicAuthenticator, AdministratorAuthenticator, NotAuthenticatedException, \
with_default_authentication
from rethinkdb import RethinkDB
from handlers... |
from datetime import datetime
import dateutil.parser
from openpyxl import load_workbook
from matplotlib import pyplot
import pylab as plt
import random
WIDE_BODY = ["332", "333", "33E", "33H", "33L", "773"]
NARROW_BODY = ["319", "320", "321", "323", "325", "738", "73A", "73E", "73H", "73L"]
# 5分钟为时间步长
TIME_STEPS = 28... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Utils module - deepcv.utils.py - `DeepCV`__
.. moduleauthor:: <NAME>
"""
import os
import re
import imp
import sys
import time
import math
import types
import random
import inspect
import logging
import builtins
import threading
import importlib
import subprocess
import... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 5 13:51:11 2018
@author: alex_
"""
from scipy.signal.wavelets import cwt, ricker
from scipy.stats import scoreatpercentile
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
# Basic imports
import pandas as pd
import numpy as np
# Advanced ... |
import pygame
black = (0, 0, 0)
white = (255, 255, 255)
blue = (0, 0, 255)
green = (0, 255, 0)
red = (255, 0, 0)
purple = (255, 0, 255)
yellow = (255, 255, 0)
vaxman = pygame.image.load('C:/Users/neela/Downloads/vaxman-main/images/vaxman.png')
pygame.display.set_icon(vaxman)
# This class represents the bar at the b... |
import copy
import json
import logging
import os
import pickle
import random
from typing import Dict
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
plt.style.use('seaborn-whitegrid')
import ray
from ray import tune
from ray.rllib.agents.pg import PGTrainer
from ray.tune.analysis import Experi... |
from enum import Enum
# from sdl.rdfmt_extractor import RDFMTExtractor
from awudima.sdesc.utils import contact_sparql_endpoint
class Federation:
"""Description of data source federation
It represents a virtual view over group of data sources in a semantic data lake.
This class represents a set of data ... |
import logging
import math
from functools import partial
from typing import List
import numpy as np
from PIL import Image
from scipy import ndimage
import torch
import torch.nn as nn
import torch.nn.functional as F
from cvpods.layers import ShapeSpec, get_norm, matrix_nms
from cvpods.modeling.losses import dice_loss... |
'''IGS log files parser'''
import glob as _glob
import re as _re
from multiprocessing import Pool as _Pool
import numpy as _np
import pandas as _pd
from p_tqdm.p_tqdm import tqdm
from ..gn_datetime import datetime2yydoysec, j20002datetime
from ..gn_frame import get_frame_of_day
from ..gn_transform import xyz2llh_heik... |
# -*- coding: utf-8 -*-
#
import json
import datetime
from django.utils.translation import ugettext_lazy as _
from app.review.models import Department
from app.review.models import Review, ReviewRule, ReviewCondition, ReviewConfig
from app.review import constants
from lib.forms import BaseFormField, BaseFieldFormat, ... |
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivymd.app import MDApp
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.scrollview import ScrollView
from kivy.core.window import Window
from default_widgets import DefaultTextInput, DefaultButton, Defa... |
import os
import numpy as np
from shapely.geometry import Polygon, Point
import torch
from torch import nn
from collections import defaultdict
from utils.layout_utils import wall_bdb3d_from_manhattan_world_layout, wall_contour_from_manhattan_pix_layout, \
manhattan_world_layout_info, manhattan_2d_from_manhattan_wo... |
"""This module contains the Gov class that provides an interface to all data in the Gov database.
Examples:
```Python
# first, initialize the instance properly
gov = Gov(data_root)
gov.load_data()
gov.build_indices()
# now you can call any gov method.
gov.all_paths()
```
"""
import logging
import pickle
from collecti... |
import json
import os
import time
import argparse
import sys
import datetime
import functools
import timeit
import collections
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../storage"))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../utils"))
import k8sUtils
imp... |
"""Dataset utilities."""
from __future__ import absolute_import
import os
import sys
import hashlib
import warnings
import requests
import pickle
import errno
from multiprocessing import Manager,Process
import numpy as np
import scipy.sparse as sp
try:
import spacy
from sklearn.preprocessing import LabelBina... |
"""
Generates a set of synthetic ruptures based on a point source configuration
"""
import numpy as np
import matplotlib.pyplot as plt
# import pandas as pd
from math import radians, sin, exp, sqrt, pi, log
from scipy.stats import norm, truncnorm, chi2, multivariate_normal
# import emcee
from openquake.hazardlib.pmf ... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2022 BigML
#
# 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 ... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... |
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for ONTAP Ansible module na_ontap_info '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
import sys
from ansible... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
from pandapower.auxiliary import _add_pf_options, _add_ppc_options, _add_opf_options, \
_check_if_numba_is... |
################################################################################
### Python port of rlassoEffects.R
### https://github.com/cran/hdm/blob/master/R/rlassoEffects.R
################################################################################
############################################################... |
import json
import os
import logging
import subprocess
import time
from datetime import datetime
import re
from ocs_ci.ocs.resources import pod
from ocs_ci.framework import config
from ocs_ci.ocs import constants
logger = logging.getLogger(__name__)
DATE_TIME_FORMAT = "%Y I%m%d %H:%M:%S.%f"
interface_data = {
c... |
#!/usr/bin/env python
# coding: utf-8
# not used in current version
import logging
import math
import numpy as np
from . import dtutil
from . import period
from amulog import config
from amulog import db_common
_logger = logging.getLogger(__package__)
class TimeSeriesDB():
def __init__(self, conf, edit = Fa... |
# -*- coding: utf-8 -*-
"""
Created on 2018-07-01, Last Modified on 2020-02-10;
@author Yi.Q
"""
"""
Metrics to assess the performance on a classification model
Measures are from: https://en.wikipedia.org/wiki/Confusion_matrix;
———————————————————————————————————————————————————————————————————————————
| ... |
import json
import numpy as np
from .base import GravitationalWaveTransient
from ...core.utils import BilbyJsonEncoder, decode_bilby_json
from ...core.utils import (
logger, create_frequency_series, speed_of_light, radius_of_earth
)
from ..prior import CBCPriorDict
from ..utils import build_roq_weights
class R... |
import os
from pathlib import Path
from nipype.interfaces.base import (
InputMultiPath,
TraitedSpec,
traits,
isdefined,
File,
Str,
)
from nipype.interfaces.cat12.base import Cell
from nipype.interfaces.spm import SPMCommand
from nipype.interfaces.spm.base import (
SPMCommandInputSpec,
... |
'''
Collection of helper function to extract geometry properties from OCC elements
Most of the functions are borrowed directly from assembly2lib.py or lib3D.py in
assembly2
'''
import math
from collections import namedtuple
import FreeCAD, FreeCADGui, Part, Draft
import numpy as np
from .FCADLogger import FCADLogger
... |
import torch, os, sys, time, tqdm
from torch.autograd import Variable
import torch.nn.functional as F
from collections.abc import Iterable
from torch import nn
import re
tics = []
def prt(verbose, *args, **kwargs):
if verbose:
print(*args, **kwargs)
def filter(rawtriples, all, true):
filtered = [... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function # force to use print as function print(args)
from __future__ import unicode_literals
from math import ceil, floor
from collections import deque
import numpy as np
import os
import rando... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Time: 2021-10-14 3:54 下午
Author: huayang
Subject:
"""
import abc
import os
from collections import defaultdict
from typing import *
import numpy as np
from sortedcollections import OrderedSet
from torch.utils.data import DataLoader
from huaytools.nlp.bert.tokenizat... |
import collections
import errno
import fnmatch
import glob
import json
import os
import re
import shutil
import subprocess
import sys
import time
from optparse import OptionParser
from sandbox import get_sandbox
try:
from server_info import server_info
MEMORY_LIMIT = server_info.get('memory_limit', 1500)
except Imp... |
import numpy as np
import nnfs
from nnfs.datasets import spiral_data
nnfs.init()
# Dense layer
class Layer_Dense:
# Layer initialization
def __init__(self, n_inputs, n_neurons,
weight_regularizer_l1=0, weight_regularizer_l2=0,
bias_regularizer_l1=0, bias_regularizer_l2=0):
... |
"""
kaldo
Anharmonic Lattice Dynamics
"""
import pandas as pd
import numpy as np
from kaldo.phonons import Phonons
from ase.units import Rydberg, Bohr
from ase import Atoms
import os
import re
from kaldo.grid import Grid
from sparse import COO
from kaldo.helpers.logger import get_logger
logging = get_logger()
BUFFER_P... |
from dataloader.DataloaderApi import *
from config.config import *
import torch
from vocab.vocab import *
from Classifier import *
from build_train_data import *
from data_utils import *
from GPT.tokenization import *
import random
from torch.backends import cudnn
import numpy as np
from model import GPT, GP... |
import transformers.generation_tf_utils as GenUtils
from DecodingStrategies import WordInclusion
import tensorflow as tf
def _generate_no_beam_search(self, input_ids, cur_len, max_length, min_length, do_sample, temperature, top_k, top_p,
repetition_penalty, no_repeat_ngram_size, bad_words... |
#!/usr/bin/env python2.7
# Author : <NAME> (<EMAIL>)
#
# Description : This code reads the KSTAR ECEI data via the iKSTAR server
#
# Acknowledgement : Dr. Y. Nam and Prof. G.S. Yun
#
# Last updated
# 2018.02.15 : version 0.10; cold resonance positions
import numpy as np
import h5py
import matplotlib.p... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 17:27:18 2020
@author: sopmathieu
This script contains different functions that could be used to preprocess the
data and isolate an interesting component for the monitoring.
They also allow us to automatically choose a subset of stable series from the
panel and to ... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
"""
Preprocessing layer for image augmentation in neuronal networks based on the NiftyNet framework.
The NiftyNet Framework (https://niftynet.io/) is Apache licensed:
Copyright 2018 University College London and the NiftyNet Contributors
Licensed under the Apache License, Version 2.0 (the "License");... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2016, ARM Limited and contributors.
#
# 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
#
# ... |
import os
import shutil
import json
import re
import sys
import subprocess
import pulsectl
from .settings import CONFIG_DIR, CONFIG_FILE, ORIG_CONFIG_FILE, __version__
class Pulse:
def __init__(self, init=None, loglevel=0):
self.loglevel = loglevel
try:
subprocess.check_call('pmctl')... |
# Copyright 2021 StreamSets 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 writi... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 2 21:33:22 2018
@author: kunal
"""
#%%
import os
import pickle
import networkx as nx
from networkx.algorithms import isomorphism
from .merge_nodes import merge_nodes, merged_value,convert_unit
from .util import max_connectivity
import logging
logger = logging.getLogger... |
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
# Copyright 2020 Petuum. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
from typing import Dict
import math
from .key_mixins import *
from src import model_importer
_cliargs, config = model_importer.import_config()
"""
Indexing and terms:
first key (keys are not aligned to columns)
↓
╭────────────────────────────────────────────────────────────────────... |
import json
import codecs
import uuid
from decimal import Decimal
import hashlib
import json
from .pw_converter_input_normelizer import normelize_prrat,normelize_sonix_data
from .pw_converter_const import Categories,Languages,Tables
from .pw_converter_db import DynamoDB #get_index,get_transforms,update_index,update_tra... |
"""time_series.py: RESQML time series class."""
version = '16th September 2021'
# Nexus is a registered trademark of the Halliburton Company
# At present, no time zone information is handled
# This module differentiates between 'human timeframe' and 'geologic timeframe' time series, though RESQML does
# not make su... |
########################################################################################
# mobile_platform.py
#
# Author : PaulMich
# GITHUB: https://github.com/PaulMich/MobilePlatform
# LICENSE: MIT License, https://github.com/PaulMich/MobilePlatform/blob/master/LICENSE
# ##############################################... |
import numpy
import scipy.misc
import sklearn.model_selection
import sklearn.metrics
# import tools.prepare_data as prepare
# import tools.io_helper as io_helper
# import tools.load_documents as load_documents
# import tools.math_helpers as math_helpers
TRAINING_RESULTS_FOLDER = "../trainingResults/"
EVALUATION_RESU... |
from collections import defaultdict, Counter
from itertools import combinations
import os
import json
import logging
import re
import numpy as np
import socket
import time
import threading
from datetime import datetime, timedelta
from django.utils import timezone
import uuid
from getpass import getuser
from pprint impo... |
import random
import numpy as np
import scipy.linalg
import EKF
import pdb
import kf_2d
import os
import pickle
import torch
from copy import deepcopy
import matplotlib.pyplot as plt
from read_detections import read_ground_truth_3d_detections, read_ground_truth_2d_detections
np.set_printoptions(precision=4, suppress=Tr... |
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
import json
import re
from functools import cmp_to_key
from urllib import parse
import sys
import app.common
LINK_SPEED_UNKNOWN = -1.0
LINK_SPEED_NOT_APPLICABLE = 0
def application(env, start_response):
start_response("200 OK", [("Content-Type", "application/json")])
urlList = re.findall("[^/]+", ... |
#!/home/miranda9/miniconda3/envs/automl-meta-learning/bin/python
import torch
import torch.nn as nn
import torch.optim as optim
# import torch_uu.functional as F
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter # https://d... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: meter.tools.py
# Purpose: Tools for working with meter
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2009-2012, 2015, 2021 <NAME>
# and the music21 P... |
# -*- coding: utf-8 -*-
import abc
import warnings
import numpy as np
import astropy.nddata
import astropy.units as u
from astropy.utils.misc import InheritDocstrings
from ndcube import utils
from ndcube.ndcube_sequence import NDCubeSequence
from ndcube.utils.wcs import wcs_ivoa_mapping
from ndcube.mixins import NDC... |
"""Heat and material (mole or mass) balance class(es)"""
from sim21.solver import Ports, Error
from sim21.solver.Variables import *
from sim21.unitop import UnitOperations
MASS_BALANCE = 1
MOLE_BALANCE = 2
ENERGY_BALANCE = 4
S_MAT = 'Mat'
S_ENE = 'Ene'
BALANCETYPE_PAR = 'BalanceType'
class Balance:
def __init_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import book
import issue
import curses
import time
import sys
import yaml
import os
import errno
import time
import datetime
import locale
locale.setlocale(locale.LC_ALL, '')
code = locale.getpreferredencoding()
def utc_to_local(utc_dt):
return utc_dt.replace(tzinfo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
__author__ = '<NAME>'
__contact__ = '<EMAIL>'
__copyright__ = '(c) <NAME>'
__license__ = 'MIT'
__date__ = '15 APR 2019'
__version__ = '1.1'
__status__ = "initial release"
__url__ = "https://gith... |
import os
from xd.definition import (
SEQUENCE, ALL, CHOICE, GROUP, RESTRICTION, EXTENSION, ElementDec, ComplexTypeDef,
ContentType, SimpleTypeDef, ModelGroup, Partical, is_complex, ais_simple,
is_elm, AttributeDec, AttributeUse, ModelGroupDef, AttributeGroupDef,
Reference, is_elm_ref, WildCard, ELO... |
import numpy as np
import tensorflow as tf
import random
from functools import reduce
from scipy.linalg import expm
from scipy.special import i0, i1
# from matrices import GELLMANN_MATRICES, PAULI_MATRICES
from .gauge_generators import generate_SU2, generate_SU3, generate_SU3_array
# from HMC.hmc import HMC
import ... |
"""
Captioning dataset.
"""
import copy
import json
import math
import os
from pathlib import Path
from typing import List, Optional, Tuple
import h5py
import nltk
import numpy as np
import torch
from torch.utils import data
from torch.utils.data.dataloader import default_collate
from tqdm import tqdm
... |
"""Objects for interacting with bulk nlp reading tools."""
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import sys
import shutil
import re
import tempfile
import glob
import json
import logging
import subprocess
import zlib
from os import path, mkdir, environ,... |
'''
Created on Sep, 2017
@author: hugo
'''
import os
import math
import argparse
from itertools import count
from fuzzywuzzy import fuzz, process
from collections import defaultdict
from ..utils.utils import *
from ..utils.generic_utils import normalize_answer, unique
from ..utils.freebase_utils import if_filterout
... |
from __future__ import division, print_function
import sys
import os
import importlib
import numpy as np
import scipy
import tensorflow as tf
from scipy import signal
from matplotlib.colors import ListedColormap
from safe_learning import config, DeterministicFunction, GridWorld
from safe_learning.utilities import con... |
from linlearn import BinaryClassifier
from linlearn.robust_means import Holland_catoni_estimator, median_of_means
import numpy as np
import logging
import pickle
from datetime import datetime
import sys
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import os
from sklearn.model_selection impo... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import datetime
import glob
import hashlib
import importlib
import json
import os
import shutil
import string
import subprocess
import sys
# Color printing
def color_print(str, col='red', pre=''):
color = {
'reset': '\033[0m',
... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
#!/usr/bin/env python
import argparse
# import json
import logging
import sys
import datetime
import os
import re
from lxml import html
import requests
# from zipfile import ZipFile
from blackduck.HubRestApi import HubInstance
script_version = "0.16 Beta"
logging.basicConfig(format='%(asctime)s:%(levelname)s:%(messa... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import random, math, itertools
from modules import MLP
from collections import defaultdict
class AdversarialSampler(nn.Module):
def __init__(self, loss_function, step=10, lr=0.01, gamma=0.01, normalization=False):
nn.Module.__init__(self)
... |
import sys, os
from lists import *
def check_args():
"""
checks for correct command-line inputs
returns file stuff from the command line inputs
"""
# check for correct command-line inputs
if len(sys.argv) != 2:
print ("usage: python reformat_asc.py [original_asc_filename input]")
... |
import torch
import time
import math
import os
import shutil
import torch.optim as optim
from torchvision import models, datasets, transforms
from torch.utils.data import DataLoader
from torchsummary import summary
import matplotlib.pyplot as plt
import eecs598
def hello_helper():
print("Hello from a5_helper.py!"... |
import arcade
import itertools
import json
import time
import os
import vlc
import _thread
from .perspective_objects import ShapeManager
from .display import ColourBlend as cb
from . import Button
TESTING = False
SAMPLING = False
if SAMPLING:
sample_list = []
sample_sec = []
prev = 0
class Audio:
B... |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------------------------------------
# Script to cluster words by k-means and cosine distance of features
#
# Usage:
# cluster_words.py [--clusters num] [--rounds num] [--items num] [--quiet]
# (It reads the s... |
"""!
This is the main thread from which the program is started/runs.
This thread will periodically call the sensor worker processes to
poll for their data. This data is returned here, so it can be analysed
and control signals can be generated.
"""
import sys
import time
import datetime
import atexit
import argparse
i... |
#####################################################.
# This file stores all the functions #
# used for genrating a graph #
#####################################################.
import os
from rdkit.Chem import AllChem as Chem
import numpy as np
from sklearn.metrics import mean_... |
"""AlphaPlantImpute2: software for phasing and imputing genotypes in plant populations """
import argparse
import concurrent.futures
import random
import sys
from itertools import repeat
import numpy as np
from numba import jit
from pkg_resources import get_distribution, DistributionNotFound
from . tinyhouse import Co... |
#----------------------------------------------------------------------------
# Created By : <NAME> <EMAIL>
# Date: 2021
# ---------------------------------------------------------------------------
import numpy as np
import itertools
from scipy import interpolate
from collections import defaultdict
import copy
def c... |
from typing import Union
from functools import partial
import random
import math
import time
import numpy as np
from gym import spaces
import gym
from osim.env import L2M2019Env
from .utils import _get_mean_std, _prepare_observation, \
_get_osim_features, _generateY
VECTOR_BONUS = 9 # = 3^2
DIRECTION_BONUS ... |
from __future__ import print_function, division, absolute_import
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import os
import sys
import torch.nn.functional as F
import random
import math
from torch.autograd import Variable
__all__ = ['InceptionResNetV2', 'inceptionresnetv2']
pretrain... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.