text stringlengths 6.04k 39.5k |
|---|
import glob
import pickle
import multiprocessing
import time
from collections import Counter
from typing import Dict
from avro.datafile import DataFileReader
from avro.io import DatumReader
from preprocessing.pipeline_job import PipelineJob
from preprocessing.misc import normalize_wiki_entity, prettyformat_dict_stri... |
# coding=utf-8
# Copyright 2021 The init2winit 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 la... |
#cell 0
import os
import tempfile
import numpy as np
import datetime
import pandas as pd
import matplotlib as mpl
try:
import tkinter
except:
mpl.use('Agg') # Support running in headless mode
import matplotlib.pyplot as plt
SEC_PER_DAY = 3600 * 24
_HAS_DISPLAY = None
EPOCH = datetime.datetime.utcfromtimestam... |
#!/usr/bin/env python2
"""
builtin_pure.py - Builtins that don't do any I/O.
If the OSH interpreter were embedded in another program, these builtins can be
safely used, e.g. without worrying about modifying the file system.
NOTE: There can be spew on stdout, e.g. for shopt -p and so forth.
builtin_printf.py and buil... |
"""
ulmo.twc.kbdi.core
~~~~~~~~~~~~~~~~~~~~~
This module provides direct access to `Texas Weather Connection`_ `Daily
Keetch-Byram Drought Index (KBDI)`_ dataset.
.. _Texas Weather Connection: http://twc.tamu.edu/
.. _Daily Keetch-Byram Drought Index (KBDI): http://twc.tamu.edu/drought/kbdi
""... |
# -*- coding: utf-8 -*-
import os
import copy
import time
import pickle
import numpy as np
import torch
from torch.autograd import Variable
from torch.utils.data import TensorDataset
from torch.utils.data import DataLoader
import torch.nn.functional as F
import matplotlib.pyplot as plt
from IPython import display
cl... |
#!/usr/bin/env python3
'''
mpdmenu - mpd client powered by dmenu and python-mpd2
Copyright 2018 <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.apach... |
import os
import ptf
import ptf.packet as scapy
from ptf.testutils import *
from ptf.mask import Mask
from ptf import config
from ptf.base_tests import BaseTest
import ptf.testutils as testutils
from scapy.all import Ether
from scapy.layers.l2 import Dot1Q
from scapy.layers.inet6 import IPv6, ICMPv6ND_NA, ICMPv6NDOptDs... |
import csv
from collections import Counter
from nltk.util import ngrams
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import math, re, argparse
import json
import functools
from config import global_config as cfg
import pickle
from reader import clean_replace
import operator
en_sws = set(st... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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 Licens... |
"""
Setuptools integration for Wing IDE.
Copyright (c) 2015, <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, ... |
""" Transformation of features for Polynomial Chaos Expansion (PCE)
"""
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_array
from sklearn.linear_model import ElasticNetCV
import scipy as sp
def init_i... |
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""cros pinchrome: Pin chrome to an earlier version."""
from __future__ import print_function
import fnmatch
import glob
import os
import re
import shut... |
import collections
import enum
import functools
import math
import signal
import sys
from blessings import Terminal
from . import utils
from .input import ARROW, SPECIAL
t = Terminal() # TODO: move this out
class Error(Exception):
""" Generic class for all errors of this module. """
class NoSpace(Error):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, <NAME> <<EMAIL>> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: openssh_keypair
author: ... |
# coding: utf-8
# # Votecounter
# Includes Psyche's version of a VoteExtracter class for extracting votes from posts, and a set of helper functions and variables used to pull that off. These are discussed in detail at their location in the notebook.
#
# Rather than being very strict about what counts as a vote (ie l... |
import datetime
import os
import time
import logging
import json
import trollius
from autobahn.wamp.exception import ApplicationError
from trollius import From, Return
from active_migration import ActiveDataMigration, ERTMigrationFlags
from buildman.server import BuildJobResult
from buildman.component.basecomponent i... |
# Copyright 2019 The Texar 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 ... |
"""TPU training script"""
import datetime
import math
import os
import pickle
import random
import time
from pathlib import Path
import fire
import jax
import jax.numpy as jnp
import jax.tools.colab_tpu
import numpy as np
import opax
import pax
import tensorflow as tf
import config as CONFIG
from dsp import MelFilter... |
# -*- coding:utf-8 -*-
import pytest
import requests
from copy import deepcopy
from swagger_parser import SwaggerParser
# whatever is defined in the petstore, we should be able to parse the json
def test_validate_petstore_swagger_json():
complete_json = requests.get("http://petstore.swagger.io/v2/swagger.json"... |
# for technical file handling
import copy
import pickle
# for mathematical calculations and statistical distributions
from scipy.stats import truncnorm
from scipy.spatial.distance import cdist
import numpy as np
from gurobipy import *
# for graphics
import seaborn as sns
from matplotlib import pyplot as plt
sys.path.in... |
# Version: 2.3
# Author: <NAME>
# Uncomment the next line to see my email
# print("Author's email: %s"%"61706c69636163696f6e616d656469646140676d61696c2e636f6d".decode("hex"))
try:
from Tkinter import Frame, Label
from Tkconstants import *
from tkFont import Font, nametofont
from ttk import Treeview, St... |
import random
from math import sqrt, floor
try:
from game import Arena, Colors, Display, Void
except ImportError:
from .game import Arena, Colors, Display, Void
class Swarm(object):
def __init__(self, name='', bots=None, arena=None):
if not name:
raise ValueError("A name must be given... |
# Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Use the numpy package to convert RLE lossless pixel data to an ndarray.
**Supported transfer syntaxes**
* 1.2.840.10008.1.2.5 : RLE Lossless
**Supported data**
The RLE handler supports the conversion of data in the (7fe0,0010)
*Pixel Data* elem... |
from datetime import datetime
import pandas as pd
pd.options.mode.chained_assignment = None
import os
from sklearn.feature_extraction.text import CountVectorizer
from datetime import timedelta
import tweepy
from nltk.corpus import stopwords
import nltk
nltk.download('stopwords', quiet=True)
stop = stopwords.words('e... |
""" Sequencer
Paper: `Sequencer: Deep LSTM for Image Classification` - https://arxiv.org/pdf/2205.01972.pdf
"""
# Copyright (c) 2022. <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
import math
from functools import partial
from typing import Tuple
import torch
import torch.nn as nn
fro... |
import sys
import collections
import os
import regex as re
from mosestokenizer import *
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import random
import numpy as np
from torch.utils.data import TensorDataset, DataLoader
from transformers import A... |
#!/usr/bin/env micropython
#
# Copyright (c) 2020, <NAME> (Chapmip Consultancy)
#
# This software is licensed under the MIT license (see LICENSE.TXT)
#
# Low-level I/O classes to facilitate "bare-metal" access in Micropython
# to STM32 memory locations and device registers (for learning purposes)
#
# Created on a Pyboa... |
import torch.nn as nn
import torch
import torch.nn.functional as F
import math
import utils.logger as logger
import numpy as np
#from layers.attention import EmbeddingAttention
class VectorQuant(nn.Module):
"""
Input: (N, samples, n_channels, vec_len) numeric tensor
Output: (N, samples, n_channels,... |
# Author: <NAME>
from functools import wraps
from bisect import bisect_right, bisect_left
from pbcore.sequence import reverseComplement
from ._BamSupport import *
from ._AlignmentMixin import AlignmentRecordMixin
import os
__all__ = [ "BamAlignment" ]
def _unrollCigar(cigar, exciseSoftClips=False):
"""
... |
# python3.7
"""Contains the implementation of generator described in PGGAN.
Paper: https://arxiv.org/pdf/1710.10196.pdf
Official TensorFlow implementation:
https://github.com/tkarras/progressive_growing_of_gans
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['PG... |
# Copyright 2014 Open Source Robotics Foundation, 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 ... |
import os
import tensorflow as tf
import keras.backend.tensorflow_backend as K
os.environ['KERAS_BACKEND'] = "tensorflow"
# os.environ["CUDA_VISIBLE_DEVICES"] = '0'
gpu_options = tf.GPUOptions(allow_growth=True)
sess = tf.InteractiveSession(
config=tf.ConfigProto(
gpu_options=gpu_options))
K.set_session(ses... |
import gpu_util
import os
os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_util.pick_gpu_lowest_memory())
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot
import sys
import skimage.measure
import numpy
import numpy as np
import skimage.io
from skimage.morphology import disk, dilation
import skimage.fea... |
# Copyright 2018 The TensorFlow 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 applica... |
from __future__ import annotations
import itertools
import pickle
import traceback
from types import TracebackType
from typing import Dict, Iterable, Optional, Tuple, List, Type, Generator, Any
import grpc.aio
from meadowgrid.agent_creator import AgentCreatorType, AgentCreator
from meadowgrid.aws_integration import ... |
def plot_sns_kde(df, outpath, target_feature='Gene'):
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# allnames is 1d list of column names, data is 2d list: elements in container list are columns
sns.kdeplot(data=df) # bw_method=0.3
plt.grid(axis='y') # , alp... |
#!/usr/bin/python3
""" Script for building/installing new kernels """
import os
import sys
import subprocess
import shutil
import argparse
import configparser
from subprocess import CalledProcessError
from pathlib import Path
from typing import List
HAS_COLORAMA = 'colorama' in sys.modules
if HAS_COLORAMA:
from co... |
#!/usr/bin/env python3
"""This is a much more complex server that needs to exist solely to do ZLIB
decompression because we can't do it client-side because lol.
"""
import logger
logger.setup("WebServer", logfile=None)
log = logger.logging.getLogger(__name__)
import io
import os
import os.path
import sys
import time
i... |
import os
import sys
import torch
import torch.autograd as autograd
import torch.nn.functional as F
import copy
from chatscript_file_generator import print_test_features
def ensemble_predict(batch, models, args, **kwargs):
for model in models:
model.eval()
logits = []
confidences = []
feature, ... |
from itertools import izip, repeat
import numpy as np
import vigra
import theano
from lazyflow.operator import Operator, InputSlot, OutputSlot
from tsdl.tools import Buildable
from tsdl.tools import get_rng
from tsdl.tools import build_operator
try:
from scipy import cluster
except ImportError:
_HAVE_SCIP... |
"""TUF role metadata model.
This module provides container classes for TUF role metadata, including methods
to read/serialize/write from and to JSON, perform TUF-compliant metadata
updates, and create and verify signatures.
"""
# Imports
from datetime import datetime, timedelta
from typing import Any, Dict, Optional
... |
""" Wrappers for building piecewise linear nets
(generally we'll only worry about ReLU nets here)
"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from collections import OrderedDict
import matplotlib.pyplot as plt
import utilities as utils
import gurobipy as gb... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 15 15:44:55 2022
@author: ggorski
"""
from datetime import date
from LSTMDA_torch import LSTMDA, fit_torch_model, rmse_masked
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
from river_dl.preproc_utils import sep... |
#!/usr/bin/env python3
# This file is part of the Soletta (TM) Project
#
# Copyright (C) 2015 Intel Corporation. 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
#
# ... |
import cv2
import numpy as np
from tifffile import imread
import random
from scipy.signal import medfilt2d
import scipy.fftpack as fp
import math
from scipy.ndimage import gaussian_filter, morphology
from random import randint
import skimage.transform as ski_transform
import os
class AnnotatedObject:
... |
from __future__ import print_function, division, absolute_import
from collections import defaultdict
from datetime import timedelta
import logging
import six
import socket
import struct
from time import time
import traceback
import uuid
from toolz import assoc, first
try:
import cPickle as pickle
except ImportEr... |
from nipype.interfaces.fsl.model import MELODIC
from nipype.interfaces.afni.preprocess import Volreg
from nipype.interfaces.fsl.utils import ImageMaths, ConvertXFM
from banana.interfaces.fsl import (FSLFIX, FSLFixTraining,
SignalRegression, PrepareFIXTraining)
from arcana.data import ... |
# MIT License
#
# Copyright (c) 2020 - Present nxtlo
#
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 17 16:11:09 2018
@author: 754672
"""
import numpy as np
import pandas as pd
import h5py
import os
from sklearn.preprocessing import StandardScaler
import datetime
from dateutil.relativedelta import relativedelta
from pysolar.solar import *
#load MIPAS fi... |
# Copyright 2019 NEC Corporation
#
# 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... |
import base64
from cryptography.exceptions import (
UnsupportedAlgorithm,
)
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import (
ec,
)
from cryptography.hazmat.primitives.serialization import (
PrivateFormat, PublicFormat, Encoding, BestAvailable... |
import argparse
import time
import os
import numpy as np
import json
from PIL import Image
import matplotlib.pyplot as plt
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
import torch.utils.tensorboard as tb
from pdb import set_trace as st
... |
import os
import numpy as np
import tensorflow as tf
import parameters as param
import util as u
#tf.set_random_seed(1234)
#np.random.seed(7)
logs_path = "log"
# .... Loading the data ....
print("load all triples")
relation_embeddings = u.load_binary_file(param.relation_structural_embeddings_file)
en... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import os
import numpy as np
import skimage as sk
import skimage.io as skio
import skimage.transform as sktr
from skimage.transform import warp as skwarp
from skimage.transform import SimilarityTransform
import skimage.color as skcolor
import copy
import matp... |
"""
Functions to package BES metadata and signals in HDF5 files.
`package_bes` is the primary function that packages metadata (signals are
optional).
`package_8x8_signals` filters metadata and saves HDF5 files for signals and
filtered metadata.
"""
from pathlib import Path
import csv
import threading
import concurre... |
# Author: <NAME>
# Date started: 30/01/2020
# Last updated: <17/02/2020 13:02:19 (BrianM)>
import pandas as pd
import utils
import numpy as np
import NEURAL_parameters
from connectivity_features import channel_hemispheres
from scipy import signal
import mne
def load_edf_EEG_file(file_name, channels_to_look=Non... |
from system import __functioncontrolfolder
from typing import List
from model import date2secs, Node, getRandomId
# from tqdm import tqdm
import logging
import pandas as pd
import os
import json
import datetime as dt
import time
import numpy
previewFileTemplate = {
"name":"importer_preview",
"type":"function... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author Identity: <NAME>
# Copyright: 2019-2022 <NAME>. All rights reserved.
import asyncio
from array import array
from threading import Thread
import functools
import concurrent.futures
USE_FILTER_ONLY = 0
USE_BEANS = 1
HOT_PLATE_ON = True
STATE_READY_TO_START = 'ready'... |
#! /usr/bin/env python3
#
# Copyright (C) 2020 <NAME>
# This file is part of the legocad python module.
# 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 witho... |
from threading import active_count
import tensorflow as tf
import numpy as np
import h5py
from scipy import ndimage
import random
from icecream import ic
class PatchHandler3D():
# constructor
def __init__(self, data_dir, patch_size, res_increase, batch_size, mask_threshold=0.6):
self.patch_size = {True... |
"""
Utility functions used by report.py
"""
import pypandoc
import pandas as pd
import numpy as np
import altair as alt
from jinja2 import Template
EPSILON = 1e-9
def run_calc(calc, year, var_list):
"""
Parameters
----------
calc: tax calculator object
year: year to run calculator for
var_li... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Consensus mechanism for Truthcoin.
This is the mechanism that, theoretically:
1. Allows the software to determine the state of Decisions truthfully, and
2. Only allows an efficient number of most-traded-upon-Decisions.
"""
from __future__ import division, print_fun... |
import os
import subprocess
from utils.colors import colors as c
DOCKER_DEPLOY = "docker-compose up --build -d"
DOCKER_DOWN = "docker-compose down --remove-orphans"
# DOCKER_INSTALL = "curl -fsSL https://get.docker.com -o get-docker.sh ; sh get-docker.sh"
DOCKER_INSTALL = "curl -fsSL https://get.docker.com -o get-doc... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 <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:
#
... |
import numpy as np
import sys
import json
from ray.rllib.env.base_env import BaseEnv
from mprl.rl.envs.stratego.stratego_spatial_multiagent_env import SpatialStrategoMultiAgentEnv
# Need raw numba functions
from stratego_env.game.stratego_procedural_impl import _get_game_result_is_invalid
# Numba Methods
from mprl.r... |
#
# Copyright 2016 Quantopian, 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 wr... |
'''
**** ***** ****** **** ****** ****** ** **
** ** ** ** ** ** ** ** ** ** **
** ***** **** ****** ** **** ** ***** *****
** ** ** ** ** ... |
# coding: utf-8
from StringIO import StringIO
from collections import defaultdict
import keyword
import os
import re
from django import forms
from django.conf import settings
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
fr... |
"""
Reference:
https://github.com/AntoineTheb/RNN-RL
"""
import copy
import random
import numpy as np
import torch
import torch.nn.functional as F
from plato.config import Config
from plato.utils.reinforcement_learning.policies import base
from torch import nn
from torch.nn.utils.rnn import (pack_padded_sequence, pad... |
import os, subprocess, multiprocessing
import nipype, pandas as pd
import bash_function_generators as slurm
from pathlib import Path
import SimpleITK as sitk
#%% Change this to your local location that store MASHelperFunctions.sh
# mas_helpfunctions_path = f'../../MASHelperFunctions.sh'
mas_helpfunctions_path = f'{os.... |
# -*- coding: utf-8 -*-
import unittest
import logging
import numpy as np
import scipy.integrate
import scipy.special
import copy
import matplotlib.pyplot as plt
from .. import multilayer
from .. import compoundfromformula
from .. import compoundfromname
from .. import mixture
from .. import element
from .. import ty... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright 2019 Drunella
#
# 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:/... |
import os
import sys
import math
import glob
import shutil
import random
import tempfile
import importlib
import torch
import numpy as np
import pandas as pd
from tqdm import tqdm
from tensorboardX import SummaryWriter
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.distributed import is_initia... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Update Me !
This module has been written in order to be the main entry for every tests in a
directory which contain a list to test.
Also consider this script a clean script which have to be filled for every repository.
Author:
@Funilrys, <NAME> <contactTAfunilry... |
import os.path
import shutil
import statistics
from collections import defaultdict
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import torch
import torch_geometric
from torch.nn.utils.rnn import pack_padded_sequence
from torch_geometric.data import D... |
'''
__author__ : <NAME> <<EMAIL>>
__date__ : 23/04/2020
__brief__ : ManualTask classes
'''
import json
import sys
import numpy as np
from math import gcd
from lib.GanttPlot import GanttPlot
from lib.Trace import TraceToolbox
import os
current_directory = os.getcwd()
DEFAULT_TPL_PATH = current_directory + "/data/tp... |
slovar = {
#A
'avokada' : 'avokado',
#B
'banani' : 'banana',
'bananina' : 'banana',
'bananino' : 'banana',
'bazilike' : 'bazilika',
'beljak' : 'jajca',
'beljaki' : 'jajca',
'beljaki' : 'jajca',
'beljakov' : 'jajca',
'blitve' : 'blitva',
'brinovih' : 'brinove',
'b... |
import os
import sys
import argparse
import pathlib
import biblib.bib
import biblib.algo
import configparser
import string
import shutil
import collections
import logging
import pdflu
def main():
"""Bibmgr's main method.
Parses arguments and config, creates a Library object, then delegates
action to one ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init, kaiming_init
import numpy as np
from mmcv.ops import ModulatedDeformConv2dPack, batched_nms
from ..utils import gen_ellipse_gaussian_target
from mmdet.core import multi_apply, force_fp32
from mmdet.core.anchor import ca... |
from collections import OrderedDict
import numpy as np
import os
import pandas as pd
import warnings
from tqdm import tqdm
from . import quality_metrics
# from .wrappers import * # Except calculate_pc_metrics and calculate_metrics - they will be replaced below
def calculate_isi_violations(spike_times, spike_clust... |
'''
An engine that listens for libvirt events and resend them to the sal event bus.
Example configuration:
.. code-block:: yaml
engines:
- libvirt_events:
uri: lxc:///
tag_prefix: libvirt
filters:
- domain/lifecycle
- domain/reboot
The ... |
# Copyright 2018-2019 Xanadu Quantum Technologies 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... |
"""
First class functions.
"""
import os
import platform
import shutil
import subprocess
import tempfile
import pandas as pd
from multiprocessing import cpu_count
from multiprocessing.pool import ThreadPool
from pathlib import Path
from typing import Dict, List, Union, Tuple
from cmdstanpy import TMPDIR
from cmdstan... |
from src.data_loader import DataLoader
import pickle
import torch
from torch import nn, optim, utils
import torch.nn.functional as F
import torch.utils.data
import numpy as np
import more_itertools
from sklearn.metrics import confusion_matrix, roc_curve
from matplotlib import pyplot
class FFNN(nn.Module):
"""
Archit... |
import numpy as np
import pandas as pd
from scipy import interpolate
import pnptransport.finitesource as pnpfs
import os
import multiprocessing
import logging
from functools import partial
from datetime import datetime
import pidsim.ml_simulator as ml_kinetics
from pidsim.parameter_span import create_filetag
import tra... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: beam.py
# Purpose: music21 classes for representing notes
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2009-2012, 19 <NAME> and the music21
# Projec... |
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
import logging
import os
import pathlib
from typing import Union
import warnings
import cf
import cftime
from netCDF4 import Dataset
import numpy as np
import pytz
from pyschism.dates import localize_datetime
_logger = logging.getLogger(__... |
import os
import operator
import itertools
from datetime import datetime, timedelta
from models import Paths, PathRow, UserJob, RenderCache
from pyramid.view import view_config, notfound_view_config
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from sqs import make_SQS_connection, get_queue, build_job_mess... |
import logging
import os
import time
import re
import pytest
import uuid
from helper.sshclient import RemoteClient
from azure.core.exceptions import (
ResourceExistsError,
ResourceNotFoundError
)
from urllib.request import urlopen
from urllib.parse import urlparse
from azure.mgmt.compute import ComputeManag... |
import logging
import time
import torch
import torch.nn.functional as F
from pprint import pformat
from torch.utils.data.dataloader import DataLoader
from configs import Configs
from fl_densenet import FullyLinearDenseNet
from frf_dataset import FRFDataset
from trainer import Trainer
class FRFNet(object):
"""
... |
'''This module generates `Rewrite` impls for each AST node type.
By default, the generated impls simply walk recursively over their two input
ASTs, checking for differences (in the `rewrite_recycled` case) but otherwise
having no side effects. Rewriting is accomplished by marking some AST node
types as "splice points... |
from itertools import combinations
from collections import defaultdict
from scipy.stats import pearsonr
from tqdm import tqdm
from prody import parsePDB, fetchPDB, confProDy
from collections import OrderedDict
from difflib import SequenceMatcher
from src.utils import PAD_SS, to_one_letter, BACKBONE
from src.utils.prof... |
"""Testsuite for backend module."""
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
import datetime
import itertools
import pathlib
import orjson
import pytest
from pydantic import ValidationError
from tia.backend import TIA
from tia.backend import TiaProfile
from t... |
# Copyright 2013 Cisco Systems, 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 writin... |
import pytest
from pyscipopt import Model, Sepa, SCIP_RESULT, SCIP_PARAMSETTING
from pyscipopt.scip import is_memory_freed
class GMI(Sepa):
def __init__(self):
self.ncuts = 0
def getGMIFromRow(self, cols, rows, binvrow, binvarow, primsol):
""" Given the row (binvarow, binvrow) of the tableau... |
# USAGE
# python eyetracking.py --face cascades/haarcascade_frontalface_default.xml --eye cascades/haarcascade_eye.xml --video video/adrian_eyes.mov
# python eyetracking.py --face cascades/haarcascade_frontalface_default.xml --eye cascades/haarcascade_eye.xml
# import the necessary packages
from et import ET
import im... |
import json
import urllib.parse
from collections import Counter
from urllib.error import HTTPError
import challonge
from ckeditor_uploader.fields import RichTextUploadingField
from django import forms
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
from django.core.val... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
bootstrap.py - bootstrapping utility for hadrian
See bootstrap/README.md for usage instructions.
"""
USAGE = """
This utility is only intended for use in building hadrian
on a new platform. If you already have a functional cabal-install
please rather run `cabal buil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.