text stringlengths 8.04k 46.5k |
|---|
import random
from .. import bitstrings
from ..framework import ClassifierRule, LCSAlgorithm, EpsilonGreedySelectionStrategy, MatchSet, ClassifierSet
class XCSClassifierRule(ClassifierRule):
"""This classifier rule subtype is used by the XCS algorithm. The
metadata stored by the XCS algorithm for each class... |
import os
from collections import Counter
from glob import glob
from libtbx import easy_run, easy_pickle as ep
class InputFinder(object):
def __init__(self):
self.images = ["cbf", "img", "corr", "mccd", "marccd", "mar"]
self.multi_image = ["h5", "xtc"]
self.datafiles = ["mtz", "hkl"]
... |
from operator import attrgetter
from typing import Iterable, Iterator, List, MutableSequence, \
Optional, Sequence, TypeVar, Type
from iota.codecs import TrytesDecodeError
from iota.crypto import Curl, HASH_LENGTH
from iota.json import JsonSerializable
from iota.transaction.types import BundleHash, Fragment, Nonce... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import platform
import io
import math
import urllib.request
import pygame
import time
import traceback
from .. import utils
def init_display(size=(None, None), pos=(None, None), hideMouse=True, clearScreen=False,
icon=None, caption=None,... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import random
from typing import List, Optional
import numpy as np
import pydash
import habitat_sim
f... |
# -*- coding: utf-8 -*-
"""
This submodule provides the tools for instantiating the measurement and
signal objects to be used. We strongly recommend the use of this submodule
instead of directly instantiating classes, except when necessary.
The signal generating functions already have set up a few good practices... |
# The MIT License (MIT)
# Copyright (c) 2019 by the xcube development team and contributors
#
# 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... |
from .Cube import Cube
from .imports import *
from .CubeVisualizer import CubeVisualizer
binnedsavable = ['binned_cubes', 'squares', 'temporal', 'binned_spectral', 'stellar', 'target', 'comparisons']
# set a cmap for stars
starcm = craftroom.cmaps.one2another('royalblue', 'sienna')
class SquishableCube(Talker):
... |
from flask import Flask
from flask import jsonify, send_from_directory
from flask import request
from flask import current_app
from flask import make_response
from flask import render_template
from flask_pymongo import PyMongo
import xsg
import pymortar
import pandas as pd
import pendulum
import toml
import pytz
impor... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 18 15:52:58 2015
LIFTINGSURFACE.PY ============================================================
This module contains the definition of the class of 3d lifting surfaces.
This class can be instantiated to generate wings, tailplanes, fins, propeller-
or rotor blades, etc... |
import math
import glob, sys
import numpy as np
import pandas as pd
import argparse
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from scipy.optimize import curve_fit
from scipy.stats import norm
from lmfit import Model, Parameters
import tools
from astropy.time import ... |
# Overview
# --------
#
# The FX2 has four FIFOs, but only one at a time may be selected to be read (for OUT FIFOs) or
# written (for IN FIFOs). To achieve high transfer rates when more than one stream of data is used
# (bidirectional channel, two one-directional channels, and so on), the FPGA has its own FIFOs that
# ... |
"""
Module: LMR_verify_proxy_plot.py
Purpose: Plotting of summary statistics from proxy-based verification. Both proxy
chronologies that were assimilated to create reconstructions and those witheld for
independent verification are considered.
Input: Reads .pckl files containing verification data ... |
import os
import re
import collections
from medicaltorch import transforms as mt_transforms
from tqdm import tqdm
import numpy as np
import nibabel as nib
from torch.utils.data import Dataset
import torch
from torch._six import string_classes, int_classes
from PIL import Image
__numpy_type_map = {
'float64': t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Created on Mon Jun 1 09:11:26 2020
Channels Displacement Plot Generation
Generate plots of channel displacement data from planned traj at repeated site.
This module defines functions for plotting the channels and planned trajectory
on 2D slices on AllenAtlas CCF.
... |
"""
Adding and removing lexicons to/from the database.
"""
from typing import Optional, Type, Tuple, List
from itertools import islice
import logging
import wn
from wn._types import AnyPath
from wn.constants import _WORDNET, _ILI
from wn._db import connect
from wn._queries import find_lexicons, get_lexicon_extensions... |
import urllib.request # file downloads
import psycopg2 # db connection
import pandas as pd # data frames
import numpy as np # stuff
import time
import os
from psycopg2.extensions import register_adapter, AsIs
psycopg2.extensions.register_adapter(np.int64, psycopg2._psycopg.AsIs)
# Einlesen der Tabellenblätter... |
# -*- coding: utf-8 -*-
"""
@file
@brief Implémente la classe @see cl ConstraintKMeans.
"""
import bisect
from collections import Counter
from pandas import DataFrame
import numpy
import scipy.sparse
from scipy.spatial.distance import cdist
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.utils.ext... |
import numpy as np
import pandas as pd
from itertools import combinations
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.ticker import FormatStrFormatter
from matplotlib.offsetbox import AnchoredText
import seaborn as sns
font = {'family' : 'sans-serif',
'size' ... |
"""discord-hero: Discord Application Framework for humans
:copyright: (c) 2019-2020 monospacedmagic et al.
:license: Apache-2.0 OR MIT
"""
import inspect
import discord
from discord.ext.commands import converter
from django.conf import settings as django_settings
from django.db import models as _models
from django.... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
OpenSCENARIO Generator - Helper Functions
A collection of helper functions used throughout the plugin
"""
import os
# pylint: d... |
#!/usr/bin/env python3
# Copyright (c) 2019, 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
# fm.py
# Some code to try to convert dx7 patches into AMY commands
# Use the dx7 module if you want to A/B test AMY's FM mode against a dx7 emulation.
# AMY is not a dx7 emulator, so it's not going to be perfect or even close, especially for some of the weirder modes of the dx7
# but fun to play with!
# Get the dx7 mo... |
import itertools
import math
import re
import time
from collections import defaultdict as ddict, deque
from lib.tree import Tree
from common import log
from common.hgraph.hgraph import Hgraph
from common.cfg import Chart
from vo_item import CfgItem, HergItem, SynchronousItem
from vo_rule import VoRule
import pprint
c... |
# -*- coding: utf-8 -*-
import os.path
import re
from tkinter import ttk
import traceback
import thonny
from thonny import memory, roughparse
from thonny.common import ToplevelCommand, parse_shell_command
from thonny.misc_utils import running_on_mac_os, shorten_repr
from thonny.ui_utils import EnhancedTextWithLogging... |
from frasco import (Feature, action, request, signal, current_app, redirect, flash,\
url_for, cached_property, current_context, hook, Blueprint,\
lazy_translate, command, current_context)
from frasco.utils import unknown_value
from frasco_models import as_transaction, save_model
... |
""" pydatastream main module
(c) <NAME>, 2013 - 2021
"""
import warnings
import json
import math
from functools import wraps
import requests
import pandas as pd
###############################################################################
_URL = 'https://product.datastream.com/dswsclient/V1/DSService.svc/rest/'... |
import unittest
from riptable import *
from riptable.rt_enum import GROUPBY_KEY_PREFIX
funcs = [np.sqrt, lambda x: x + 1]
reduce_funcs = [sum, np.min, np.max]
def arr_eq(a, b):
return bool(np.all(a == b))
def arr_all(a):
return bool(np.all(a))
class transform_apply_test(unittest.TestCase)... |
# -*- coding: utf-8 -*-
import time
import itertools
import httplib as http
from collections import Counter
from flask import request
from modularodm.exceptions import ValidationValueError
from framework import forms
from framework import status
from framework.flask import redirect # VOL-aware redirect
from framewor... |
import numpy as np
import time
from time import ctime
#from quaternion import *
from mm_SPINNY.quaternion import *
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from mpl_toolkits.mplot3d import Axes3D
import sys
import os
sys.path.insert(1,"... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmseg.core import add_prefix
from mmseg.ops import resize
from .. import builder
from ..builder import SEGMENTORS
from .base import BaseSegmentor
# attack
from pdb import set_trace as st
from PIL import Image, ImageEnhance
import numpy as np
# fr... |
import numpy as np
import matplotlib.pyplot as plt
import os, sys, time
from scipy.interpolate import RectBivariateSpline
from sklearn.metrics.pairwise import euclidean_distances
from matplotlib.ticker import FuncFormatter, MaxNLocator
import matplotlib.lines as mlines
from se2waveload import *
from Lib_GeneralFunc... |
from ..preprocessing.moments import get_connectivities
from .utils import make_dense
import matplotlib.pyplot as pl
from matplotlib import rcParams
from scipy.sparse import issparse
import warnings
import numpy as np
exp = np.exp
"""Helper functions"""
def log(x, eps=1e-6): # to avoid invalid values for log.
... |
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import copy
import numpy as np
import tensorflow as tf
import evalu
import lrs
from data import Dataset
from models import model
from search import beam_search
from utils... |
# this program basically does a constexpr and generates cuda code
import textwrap
import numpy as np
from code_fragments import *
from utils import *
FUNC_NAME = "spmm"
EPI = "NONE"
def emit_load_block(index, currloadreg):
if X86:
if AVX512:
LOAD_CACHE = """
RC = _mm512_load_ps(&BC... |
import tensorflow as tf
import pandas as pd
import sys
import matplotlib.pyplot as plt
import time
flags = tf.app.flags
FLAGS = flags.FLAGS
# flags 함수를 이용, 자주 쓰는 상수들을 정의
flags.DEFINE_integer('image_size', 96, 'input image size.')
flags.DEFINE_integer('image_color', 1, 'color size.')
flags.DEFINE_integer('maxpool_filte... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: output_extract.py
@Time: 2020/3/21 5:57 PM
@Overview:
"""
from __future__ import print_function
import argparse
import json
import os
import pickle
import random
import time
from collections import OrderedDict
... |
"""NTopo.
Usage:
run.py list_problems
run.py list_problems_space
run.py train_config <config_file>
run.py train <problem> [--volume_ratio=0.5] [--lr_sim=3e-4] [--lr_opt=3e-4]
[--save_interval=5] [--use_mmse=1] [--filter=sensitivity] [--filter_radius=2.0]
[--vol_penalty_strength=10]
[--use_oc=1] [--... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# hammer_vlsi_impl.py
# hammer-vlsi implementation file. Users should import hammer_vlsi instead.
#
# Copyright 2017-2018 <NAME> <<EMAIL>>
from abc import abstractmethod
from enum import Enum
from functools import reduce
import importlib
from numbers import Number
im... |
"""Mystery Mansion, corb.co Edition.
Built in 2016 by <NAME> (http://corb.co)
Licensed under the MIT License.
Requirements:
- Windows: No additional packages are needed.
- Linux/MacOS: If audio is enabled, PyAudio is required. See:
https://people.csail.mit.edu/hubert/pyaudio/
for installation instr... |
# Copyright 2019-2020 Toyota Research Institute. All rights reserved.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.patches as patches
import scipy.special as spec
from scipy.stats import norm
rseed = 42
def label_to_color_codex(label):
"""
Takes in a... |
"""
hs - Python Version of the Augmented Lagrangian Harmony Search Optimizer
hso if a global optimizer which solves problems of the form:
min F(x)
subject to: Gi(x) = 0, i = 1(1)ME
Gj(x) <= 0, j = ME+1(1)M
xLB <= x <= xUB
"""
import random, time
from math import floor
import numpy as np
def HS(dimens... |
import math
import os
import sys
import numpy as np
import time
import threading
from scipy.interpolate import interp1d
import concurrent.futures
from collections import deque
import matplotlib.pyplot as plt
np.random.seed(25)
try:
from helper import Helper
except ImportError:
raise
show_animation = True
ob... |
import os
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.utils.data import DataLoader
from torchvision import transforms
from misc import check_mkdir, crf_refine
from dataset import ImageFolder
from backbone.resnext.resnext101_regular import ResNeXt101
import pytorch_... |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2010 California Institute of Technology. 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... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The Slicer classes.
The main purpose of these classes is to have auto adjust of axes size to
the data with different layout of cuts.
"""
from __future__ import absolute_import
import numpy as np
from... |
import os
import re
import sys
import json
import torch
import torch.utils.data as data
import numpy as np
from os import path as osp
from tqdm import tqdm
from collections import Counter
from bootstrap.lib.logger import Logger
from bootstrap.lib.options import Options
from bootstrap.datasets.dataset import Dataset
fro... |
"""Linear and integer program solver.
This module defines an LP class. LPs can be solved through an implementation
of phase I and the revised simplex method. Furthermore, integer solutions can
be obtained through an implementation of the branch and bound algorithm.
"""
__author__ = '<NAME>'
__all__ = ['BFS', 'LP', 's... |
import numpy as np
import networkx as nx
from RL_brain import DeepQNetwork as RL
from parameters import Parameters
import matplotlib.pyplot as plt
# request representation
class request:
def __init__(self, rq_id, rq_loc_id, rq_sf_id,rq_packrate, rq_delay,rq_duration):
self.rq_id = rq_id
s... |
import math
import logging
from simulation.units import *
from simulation.profiles import MassProfileNFW, MassProfileSIE
from simulation.lensing_sim import LensingSim
from astropy.cosmology import Planck15
from astropy.convolution import convolve, Gaussian2DKernel
from autograd import make_jvp
# from tqdm import *
lo... |
################################################################################
# Module: utils.py
# Description: Utility functions for configuration, logging
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/samuelduchesne/archetypal
############################################################... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Imports
########################################
import sys, os
# Update this to point to the directory where you copied the SciAnalysis base code
SciAnalysis_PATH='/home/kyager/current/code/SciAnalysis/main/'
#SciAnalysis_PATH='/home/xf11bm/software/SciAnalysis/'
#SciAnal... |
# *****************************COPYRIGHT******************************
# (C) Crown copyright Met Office. All rights reserved.
# For further details please refer to the file LICENCE.txt
# which you should have received as part of this distribution.
# *****************************COPYRIGHT******************************
#... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from cell2cell.preprocessing import integrate_data, cutoffs, get_genes_from_complexes, add_complexes_to_expression
from cell2cell.core import cell, cci_scores, communication_scores
import itertools
import numpy as np
import pandas as pd
def generate_pa... |
"""
The processors exist in Pythia to make data processing pipelines in various
datasets as similar as possible while allowing code reuse.
The processors also help maintain proper abstractions to keep only what matters
inside the dataset's code. This allows us to keep the dataset ``get_item``
logic really clean and no... |
import functools
import sys
import time
import uuid
import logging
import os.path
import types
import signal
from select import select, error as SelectError
from datetime import datetime
from collections import deque
from multiprocessing import Process, Queue
from multiprocessing.connection import Listener, Client, Aut... |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
import sys
from django import forms
from django.core.cache import cache as django_cache
from django.conf import settings as django_settings
from django.c... |
import csv
import argparse
import numpy as np
import matplotlib.pyplot as plt
import scipy
from scipy.stats import shapiro, anderson, ttest_1samp
def smoothen2(arr, gamma, count):
smooth = np.zeros(len(arr))
smooth[0] = arr[0]
for i in range(1, count):
smooth[i] = gamma * smooth[i-1] + arr[i]
... |
#
# This file is part of Healpy.
#
# Healpy is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Healpy is distributed in the hope... |
import re
import time
import pprint
import logging
import contextlib
import multiprocessing
from pathlib import Path
from logging import info, debug, warning
from collections import defaultdict, Counter
from iproute2_parse import Iproute2_parse
from netstat_parse import Netstat_parse
from system_files_parse import Sys... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2019/12/13 14:00
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : <EMAIL>
--------------------------------... |
'''piecewise polynomial functions
'''
import sys
import numbers
from fractions import Fraction
from Polynomial import Polynomial
def _newVarName(usedVarNames, baseName='t'):
if not baseName in usedVarNames: return baseName
idx = 0
varName = '%s%d' % (baseName, idx)
while varName in usedVarNames:
id... |
#!/usr/bin/env python
from __future__ import print_function, division
import sys, os, argparse, glob
from collections import OrderedDict
import pandas as pd
# Soothsayer Ecosystem
from genopype import *
from soothsayer_utils import *
pd.options.display.max_colwidth = 100
__program__ = os.path.split(sys.argv[0])[-1]... |
# Import required libraries
import os, re
from random import randint
import flask
from flask import Flask, render_template
import dash
import base64, io
#from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from dash_table import DataTable
i... |
#BEGIN_LEGAL
#
#Copyright (c) 2019 Intel 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 ... |
# -*- coding: utf-8 -*-
import logging
from functools import reduce
from threading import local
from contextlib import contextmanager
from django import forms
from django.core import serializers
from django.db import models
from django.db.models import options, ManyToManyRel
from django.db.models.signals import pre_sa... |
#!/usr/bin/env python
"""
Manage DFT calculations on the cluster computer via some scheduler.
- Search directories under given directory whether there are directories
in which a DFT calculation should be done.
- Compute nodes required to compute those DFT calculations.
- Create job scripts for each submission.
Usage... |
# -*- coding: utf-8 -*-
"""
Created on 2020.05.19
@author: <NAME>, <NAME>, <NAME>, <NAME>
Code based on:
Yang et al "Analyzing Learned Molecular Representations for Property Prediction" & "A Deep Learning Approach to Antibiotic Discovery" -> https://github.com/chemprop/chemprop
Song et al "Communicative Representatio... |
#from data.config import raw_dataset, render_dataset, archive_dataset, model_list, zip_path
import os
import cv2
import time
import math
import random
import pyexr
import argparse
import shutil
from tqdm import tqdm
from lib.renderer.camera import Camera
import numpy as np
import trimesh
from lib.renderer.mesh import ... |
"""
Simplified context class for the simultated disc tracking task described in the
paper "How to Train Your Differentiable Filter" to be used as example
implementation of a context.
"""
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
from differentiable_filters.contexts import base_co... |
# -*- coding: utf-8 -*-
"""
Created on 21/07/2020
Author : <NAME>
Calculating gradients in the stellar populations using a piecewise linear
function.
"""
import os
import numpy as np
from astropy.table import Table
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.patches import Patch
impor... |
"""
Generate a hints database file from RNAseq/IsoSeq alignments for AugustusTMR/AugustusCGP.
"""
import collections
import itertools
import os
import logging
import pyfasta
import pysam
from toil.fileStores import FileID
from toil.common import Toil
from toil.job import Job
import tools.dataOps
import tools.fileOps
... |
"""Module for generating batches of drawn blended images."""
import copy
import os
from abc import ABC
from abc import abstractmethod
from collections.abc import Iterable
from itertools import chain
import galsim
import numpy as np
from astropy.table import Column
from astropy.table import Table
from btk import DEFAU... |
import logging
import os
import random
from collections import OrderedDict
import numpy as np
import torch
import torch.distributed as dist
import torch.nn.functional as F
from PIL import Image
# from skimage.filters import gaussian
from skimage.measure import label, regionprops
@torch.no_grad()
def gather_together... |
'''ChIP-Seq tasks associated with intervals.
'''
import sys
import tempfile
import optparse
import shutil
import itertools
import csv
import math
import random
import re
import glob
import os
import shutil
import collections
import sqlite3
import cStringIO
import CGAT.Experiment as E
import CGAT.Pipeline as P
import... |
from __future__ import absolute_import, division, print_function
import argparse
import json
import os
import random
import numpy as np
import torch
import torch.nn.functional as F
from pytorch_pretrained_bert.optimization import BertAdam, WarmupLinearSchedule
from tqdm import tqdm, trange
from seqeva... |
# Cesty k tabulkám, viz. https://www.psp.cz/sqw/hp.sqw?k=1302
from glob import glob
import pytz
import pandas as pd
from snemovna.utility import *
from snemovna.Snemovna import *
from snemovna.PoslanciOsoby import Osoby, Organy, ZarazeniOsoby, Poslanci
from snemovna.TabulkyHlasovani import *
from snemovna.setup_l... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# coding: utf-8
import argparse
import time
import datetime
import math
import os
import itertools
import json
import numpy as np
import pandas as pd
from utils.dna_functions import Logger, FocalLoss
import torch
import torch.optim as optim
import torch.nn as nn
from data_utils import get_lm_corpus
from mem_transfor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 9 18:00:12 2019
@author: carsault
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import random
import numpy as np
#%% https://github.com/pengyuchen/PyTorch-Batch-Seq2seq/blob/master/seq2se... |
# Copyright 2013-2016 The Salish Sea MEOPAR contributors
# and The University of British Columbia
# 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... |
#%%
import itertools
from types import SimpleNamespace
from typing import List, Generator, Iterator, Sequence
from torch.utils.data.dataloader import _MultiProcessingDataLoaderIter,_SingleProcessDataLoaderIter,_DatasetKind
_loaders = (_MultiProcessingDataLoaderIter,_SingleProcessDataLoaderIter)
import multiprocessing
... |
# Author: <NAME>
# Email: <EMAIL>
import geopandas as gpd
import pandas as pd
import rasterio as rio
import numpy as np
import subprocess
import fiona
import os
import multiprocessing
from joblib import Parallel, delayed
from glob import glob
from Python_Files.hydrolibs.sysops import make_gdal_sys_call_str, make_prope... |
import os
import warnings
from .misc import *
import scipy.spatial.distance as sd
from collections import OrderedDict
from scipy.optimize import linear_sum_assignment
class FaceReidentifier(object):
def __init__(self, model_path=os.path.realpath(os.path.join(os.path.dirname(__file__), 'models',
... |
import json
from types import SimpleNamespace
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.utils import timezone
from graphene import (
Boolean,
Enum,
Field,
Float,
ID,
InputField,
InputObjectType,
Int,
List,
Mutation,
Non... |
#!/usr/bin/env python3
"""Library for performing speech recognition with support for Google Speech Recognition, Wit.ai, IBM Speech to Text, and AT&T Speech to Text."""
__author__ = "<NAME> (Uberi)"
__version__ = "3.1.3"
__license__ = "BSD"
import io, os, subprocess, wave, base64
import math, audioop, collections, th... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020/2/12 15:56
# @Author : Vodka0629
# @Email : <EMAIL>, <EMAIL>
# @FileName: mj_math.py
# @Software: Mahjong II
# @Blog :
from itertools import combinations
from random import random
from time import time
from treelib import Tree
from mahjong.mj_set... |
"""
MicroGridsPy - Multi-year capacity-expansion (MYCE)
Linear Programming framework for microgrids least-cost sizing,
able to account for time-variable load demand evolution and capacity expansion.
Authors:
<NAME> - Department of Energy, Politecnico di Milano
<NAME> - Department of Energy, Politecnico... |
from permuta import Perm
from permuta.bisc.perm_properties import (
_perm_to_yt,
av_231_and_mesh,
baxter,
dihedral,
forest_like,
hard_mesh,
in_alternating_group,
simsun,
smooth,
yt_perm_avoids_22,
yt_perm_avoids_32,
)
def test_smooth():
assert smooth(Perm(()))
asser... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 16:38:26 2019
@author: bruce
"""
import pandas as pd
import numpy as np
from scipy import fftpack
from scipy import signal
import matplotlib.pyplot as plt
def correlation_matrix(corr_mx, cm_title):
from matplotlib import pyplot as plt
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack LLC. 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/l... |
from unittest import TestCase
from pytest import raises
from utils import parse_course_str, get_class_type, ValidationError
# Handpicked test cases for `parse_course_str()`
course_str_data = {
# De Anza
'ANTH D001L51Z': ('ANTH', '1L', '51Z', {'Z'}),
'ARTS D001A62Z': ('ARTS', '1A', '62Z', {'Z'}),
'ARTS ... |
import os
import multiprocessing as multi
import logging
from ..config import config
from ..handler import add_handler
from ..backends.rasterio_ import check_crs
from ..backends.xarray_ import _check_config_globals
from ..backends import transform_crs
from .util import sample_feature
from .util import lazy_w... |
import pickle
from operator import itemgetter
import json
import os # for Silence and environ
from os import path
import collections
import string
from datetime import datetime, timedelta
import time
from simplerandom import random
from hashids import Hashids
from hashlib import md5
import base64
import uuid
import bis... |
#!/usr/bin/env python3
import argparse
from configparser import ConfigParser
from datetime import datetime, timedelta
import glob
import logging
import logging.config
import os
import os.path
from queue import Queue, Empty
import re
import signal
import sys
import threading
import time
import traceback
from ace_api i... |
import requests
from os import system
from Core import *
from scapy.layers.l2 import Ether, ARP, srp
from scapy.all import send, sendp, RandMAC
from scapy.layers.inet import IP, ICMP
from scapy.layers.dot11 import RadioTap, Dot11, Dot11Deauth
import threading
import os
import hashlib
import re
from cryptography.fernet ... |
# -*- coding: utf-8 -*-
# This code implements basic operations of CRF
# Modified from https://github.com/tensorflow/addons (compatible with keras, tf.keras)
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... |
#!/usr/bin/env python3.6
import argparse
import json
import os
import sys
from pathlib import Path
from typing import Mapping, Sequence, MutableSequence
import yaml
from dresources import DAction, action
from external_services import ExternalServices
from gcp import GcpResource
DEFAULT_OAUTH_SCOPES = [
"https:/... |
# -*- coding: utf-8 -*-
import os
import pdfkit
import logging
from datetime import datetime, date, timedelta
from django.core import serializers
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.db.models import Q, F
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.