text stringlengths 6.04k 39.5k |
|---|
# --------------------------------------------------------
# The pipeline of preparing the training data for mmdetection(https://github.com/open-mmlab/mmdetection)
# Written by <NAME> (<EMAIL>), Version 20210301
# Inspired from DOTA dataset devkit (https://github.com/CAPTAIN-WHU/DOTA_devkit)
# -------------------------... |
import os, re, subprocess, tempfile, glob, shutil
from aqt import mw
from aqt.qt import *
from aqt.utils import *
from aqt.operations import CollectionOp
from anki import consts, collection
if qtmajor == 6:
from . import dialog_qt6 as dialog
elif qtmajor == 5:
from . import dialog_qt5 as dialog
if... |
"""
The file consists of:
● one line containing the following natural numbers separated by single spaces:
○ R (1 ≤ R ≤ 1000) i s the number of rows,
○ C (1 ≤ C ≤ 1000) is the number of columns,
○ L (1 ≤ L ≤ 1000) i s the minimum number of each ingredient cells in a slice,
○ H (1 ≤ H ≤ 1000) i s the m... |
import logging
import sys
import types
import warnings
from inspect import isawaitable
from traceback import format_exc
try:
import sanic
from sanic import Sanic
from sanic.exceptions import NotFound
from sanic.response import HTTPResponse, StreamingHTTPResponse
except ImportError:
print("Sanic is ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example usage and tests for :mod:`orion.client`."""
import copy
import json
from importlib import reload
import pytest
import orion.client
import orion.client.cli as cli
import orion.core
from orion.client import get_experiment
from orion.client.experiment import Exper... |
"""
This module contains Classes and helpers for the API
"""
import datetime
from collections import Iterable
from sqlalchemy.inspection import inspect
import sqlalchemy.orm
import glance_api.modules.models
# Helpers
allowed_fields = ['id', 'publisher', 'name', 'item_loc']
def jsonify(query, no_relationships=Fal... |
import blist
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
PALLETTE = list(colors.TABLEAU_COLORS.values())
epsilon = 0.0001
class SourceOrTarget(object):
def __init__(self, value, start, width):
self.value = value
self.start = s... |
# 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 use ... |
#!/usr/bin/env python
# Adapted from DEAP's NSGA-II example
import h5py
import array
import random
import time
import pickle # for checkpointing. Json doesn't work on the array object
import os
import sys
import numpy as np
#from scoop import ### logger
from deap import algorithms
from deap import base
from... |
# pylint: skip-file
import mxnet as mx
import numpy as np
import sys
import logging
from pprint import pprint
import math
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# make a bilinear interpolation kernel, return a numpy.ndarray
def upsample_filt(size):
factor = (size + 1) // 2
if... |
import os
import json
from multiprocessing import Pool
from re import I
from PIL import Image
import cv2
import clip # to obtain CLIP embeddings
import numpy as np
import torch
import torch.nn as nn
import torchvision.models as models
import torchvision.transforms as transforms
VID_PATHS = {
"train": "/mnt/gpid... |
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from collections import defaultdict
import json
import logging
import difflib
import Queue
from threading import Thread
import time
from google.appengine.ex... |
#isolated test of neural spatial interaction model
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, BatchNormalization, Activation, LeakyReLU
from tensorflow.keras.models import load_model
f... |
# https://lulstrup.medium.com/gaining-an-analytics-edge-using-federal-spending-open-data-b91b517f2c04
import os, glob
import pandas as pd
import requests
import bs4
import json
import time
from datetime import datetime
import zipfile
import pprint
import csv
import numpy as np
from requests_toolbelt.utils import dump
... |
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.nn.functional as func
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.autograd import Variable
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
import tim... |
# Copyright 2021 by Quopt IT Services BV
#
# Licensed under the Artistic License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://raw.githubusercontent.com/Quopt/ITR-webclient/master/LICENSE
#
# Unless required ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Apply susceptibility distortion correction (SDC)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. topic :: Abbreviations
fmap
fieldmap
... |
import abc
import threading
from typing import Optional
import numpy as np
from talon import Module, ui, canvas, screen, cron
from talon.experimental import locate
from talon.skia import image, rrect, paint
from talon.types import Rect as TalonRect
from .blob_detector import calculate_blob_rects
from .marker_ui impor... |
import numpy as np
import matplotlib.pyplot as plt
import torch
from torchvision.utils import make_grid
from base import BaseTrainer
from utils import inf_loop, MetricTracker
class Trainer(BaseTrainer):
"""
Trainer class
"""
def __init__(self, model, criterion, metric_ftns, optimizer, config, data_loa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import Counter
from .exceptions import ReactionError
from .grid import *
from .elements import elements_dict
# Diameter of an atom relative to a grid cell, per https://www.reddit.com/r/spacechem/wiki/gamemechanics#wiki_collisions
# Lower bound: 0.7465 (h... |
import matplotlib.image as mpimg
import os
from os import walk
import matplotlib.pyplot as plt
import numpy as np
import cv2
import pickle
import glob
import time
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from multiprocessing import cpu_count
from functools import partial
from m... |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#!/usr/bin/env python3
#
# Copyright 2021 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 ... |
"""
Structural variant collapser
Will collapse all variants within sizemin/max that match over thresholds
All variants outside size boundaries will be placed into the output
When collapsing, the first variant from a matching set of variants will
be written to the output while the others will be placed in collapsed o... |
# Copyright (c) 2018 Graphcore Ltd. All rights reserved.
from typing import Any, Dict, Iterable, List, Union
import re
import numpy as np
import popart
from popart_core import _BuilderCore
class Opset():
"""Minimal base class for the opsets
Arguments:
builder: An interface for a Builder, used for cr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##### Import #####
from UDFManager import *
import sys
import os
import math
import shutil
import numpy as np
import platform
import pandas as pd
################################################################################
def main():
print("このスクリプトを直接読んでも、初期状態が入っていません... |
import argparse
import logging
import asyncio
import struct
from migen import *
from migen.genlib.cdc import MultiReg
from migen.genlib.fsm import FSM
from .. import *
from ...database.jedec import *
from ...support.pyrepl import *
CMD_CONTROL = 0x01
BIT_CE = 0x01
BIT_CLE = 0x02
BIT_ALE = 0x04
CMD_WRITE... |
import argparse
import os
import sys
import numpy as np
import scipy.signal
import scipy.fftpack as fft
from librosa import cqt, magphase, note_to_hz, stft, resample, to_mono, load
from librosa import amplitude_to_db, get_duration, time_to_frames, power_to_db
from librosa.util import fix_length
from librosa.feature i... |
import uuid
import json
import bidict
import dateutil.parser
from brawlbracket.bracket import tournament as trn
from brawlbracket.bracket import player as plr
from brawlbracket.bracket import team as tem
from brawlbracket.bracket import match as mch
from brawlbracket import usermanager as um
from brawlbracket import ... |
# -*- coding: utf-8 -*-
from lxml import etree as ET
from operator import itemgetter
import os
import copy
import requests
import time
import string
import csv
__location__ = os.path.dirname(os.path.realpath(__file__))
#lxml parser for parsing XML files from strings
parser = ET.XMLParser(remove_blank_text=True)
#s... |
"""
Tools for making maps of the sky with healpix.
"""
import sys
import re
import gc
import numpy
import healpy
import pyfits
import ugali.utils.projector
from ugali.utils.healpix import superpixel,subpixel,ang2pix,pix2ang,query_disc
from ugali.utils.logger import logger
from ugali.utils.config import Config
#####... |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... |
import os
import numpy as np
import tensorflow as tf
import tf_models
import time
import argparse
from tqdm import tqdm
from sklearn import metrics
import horovod.tensorflow as hvd
import hetu as ht
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s... |
# 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 ... |
# Copyright 2008-2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute, s... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
import wkw
import numpy as np
import shutil
from os import path, makedirs
import pytest
POSITION = (0, 0, 0)
SIZE = (32, 32, 32)
def test_context_manager():
wkw.Dataset.create("tests/tmp", wkw.Header(np.uint16)).close()
with wkw.Dataset.open("tests/tmp") as dataset:
assert dataset.header.voxel_type ... |
"""Classes for finding and solving puzzles like Cheryl's birthday puzzle"""
from enum import Enum
from collections import Counter
from functools import partial
from operator import itemgetter
import random
class Player(object):
"""A Player who takes part in a Game
Attributes
----------
name: str
... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import torch
import torch.optim as optim
import torch.nn as nn
import directional_utils as du
def conv3x3x3(in_planes, out_planes, stride=1, bias=True):
"""3x3x3 convolution with padding"""
return nn.Conv3d(in_planes, out_planes, kernel_size=3, stride=... |
import logging
import os
from threading import Lock
import telegram
from telegram import TelegramError
from services.omw_service import OMWService
from services.subscription_service import SubscriptionService
from utils.slots_machine_value import slot_machine_value
from utils.weather_conversion import weather_convers... |
from qibo import K
from qibo.config import raise_error
from qibo.core.circuit import Circuit
from qibo.models.evolution import StateEvolution
class VQE(object):
"""This class implements the variational quantum eigensolver algorithm.
Args:
circuit (:class:`qibo.abstractions.circuit.AbstractCircuit`): ... |
import numpy as np
from tf_utils import visualization_utils_cv2 as vis_util
from tf_utils import ops as utils_ops
from lib.session_worker import SessionWorker
from lib.load_graph_deeplab_v3 import LoadFrozenGraph
from lib.load_label_map import LoadLabelMap
from lib.mpvariable import MPVariable
from lib.mpvisualizeworke... |
import pytest
import numpy as np
from numpy.testing import (assert_almost_equal,
assert_allclose)
from math import sqrt
import lib
@pytest.mark.parametrize("A, B, C, center, expected", [
# define a plane that divides unit sphere into
# East / West "hemispheres"
# then probe point... |
def test_prediction(outloc,
best_model,
X_mRNA_test,
X_promoter_test,
Y_test):
# Inputs
# outloc: a full path to a directory of the best model
# best_model: name of the best model
# X_mRNA_test: mRNA annoation data
# X_p... |
import scipy as SP
import numpy as NP
import scipy.stats as ST
import glob
from common import *
from io_tools import read_screen_colonysize_data, write_combined_colonysize_data, read_combined_colonysize_data, write_combined_strain_data, write_combined_fitness_data, write_combined_suppression_data, read_fitness_values
... |
'''A collection of little command line utilities for inspecting mass
spectrum data.
'''
import io
import os
import math
from collections import Counter
import click
import ms_deisotope
from ms_deisotope.feature_map import quick_index
from ms_deisotope.feature_map import scan_interval_tree
from ms_deisotope.cluster... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 1 17:21:05 2018
@author: damodara
"""
import numpy as np
import matplotlib.pylab as plt
import dnn
import ot
import os
import json
import copy
import h5py
import importlib
from scipy.spatial.distance import cdist
import matplotlib as mpl
mpl.use('Ag... |
import tensorflow as tf
import deep_components
import numpy as np
import nltk
import pickle
from tensorflow.python.keras.preprocessing.sequence import pad_sequences
from tensorflow.contrib.seq2seq import sequence_loss,BeamSearchDecoder
MAX_LENGTH = np.int64(60)
class seq2seq:
def __init__(self,vocab_s... |
from typing import *
from gym import Env, spaces
import numpy as np
import cv2
from ray.rllib.env.env_context import EnvContext
from ray.rllib.evaluation.episode import Episode
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from kodoku.env import MultiEnvWrapper
class Sim... |
# -*- coding: utf-8 -*-
# FeedCrawler
# Projekt von https://github.com/rix1337
import base64
import datetime
import os
import re
import socket
import sys
from feedcrawler import internal
from feedcrawler import myjdapi
from feedcrawler.config import CrawlerConfig
from feedcrawler.db import FeedDb
from feedcrawler.db ... |
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from . import *
from pya import *
def make_pin(cell, name, center, w, pin_length, layer, vertical = 0):
if vertical == 0:
p1 = pya.Point(center[0]+pin_length/2, center[1])
p2 = pya.Point(center[0]-pin_length/2, center[1])
elif vertical == 1:
p1 = pya.Point(center[0], center[1]+pin_length/2)
p2 = py... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 19:51:00 2020
@author: <NAME>
Minibatch training (Algorithm 2) on Reddit dataset
with the concept of bipartite graph
Build version:
+ PyTorch 1.1.0
+ DGL 0.4.3.post2
"""
import dgl
import numpy as np
import torch
import torch.nn as nn
import torch... |
''' This code implements an obstacle problem for the Canham-Helfrich functional, via a Monge parameterization'''
from __future__ import print_function
from fenics import *
from dolfin import *
from math import *
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import time
cla... |
#!/usr/bin/env python
"""
Taken from : https://github.com/deadpixi/contracts
Introduction
============
This module provides a collection of decorators that makes it easy to
write software using contracts.
Contracts are a debugging and verification tool. They are declarative
statements about what states a program mu... |
import torch
import torch.nn as nn
from .spectralnorm import SNConv2d
class SAGAN_Attention(nn.Module):
def __init__(self, ch, which_conv=SNConv2d):
"""A non-local block as used in SA-GAN.
Args:
ch (int): Number of channels/filters
which_conv (nn.Module, optional): A 2... |
"""Computational Physics Aufgabe 5.1, Autor: <NAME> 22.05.16
Quantenmechanik von 1D-Potentialen I
Berechnung und Zeichung der Loesungen fuer Eindimensionales Potential
der einheitenlosen Schroedinger-Gleichung.
Naeherung EF(x<=xmin)|EF(x>=xmax) = 0. Hoehere Energien sind breiter!
Blaue-Strich-Pun... |
"""Pre-process station data for app ingest"""
# pylint: disable=all
import argparse, math, os, time
import dask.dataframe as dd
import numpy as np
import pandas as pd
from datetime import datetime
from luts import speed_ranges, decades
from multiprocessing import Pool
def read_station(fp):
"""Read in a station d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import cStringIO
from django.http import Http404
from django.views.generic import CreateView
from django.views.decorators.... |
import collections
from nextcord.utils import MISSING
import nextcord
import types
import inspect
import sys
import traceback
import asyncio
import importlib.util
from typing import Any, Callable, Dict, List, Mapping, Optional, TypeVar
from nextcord.client import Client
from .cog import Cog
from nextcord.ext.abc import... |
#MenuTitle: Batch-Set Path Attributes
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Set path attributes of all paths in selected glyphs, the master, the font, etc.
"""
import vanilla
def intOrNone(value):
value = str(value)
if "." in value:
value = value[:va... |
#!/usr/bin/env python3
from info.theHarvester.theHarvester.discovery import *
from info.theHarvester.theHarvester.discovery import dnssearch, takeover, shodansearch
from info.theHarvester.theHarvester.discovery.constants import *
from info.theHarvester.theHarvester.lib import hostchecker
from info.theHarvester.theHarv... |
"""
Collapse a data cube down to a summary statistic using various methods. Now
returns statistical uncertainties for all statistics.
TODO:
- Deal with the fact we're using three different convolution routines.
"""
import argparse
import numpy as np
import multiprocessing
# -- DATA MANIPULATION -- #
def estima... |
"""wxPython versie van een op een treeview gebaseerde XML-editor
moet nog verder gestript net zoals dat bij de qt versie gedaan is
"""
## import logging
## logging.basicConfig(filename='axe_wx.log', level=logging.DEBUG,
## format='%(asctime)s %(message)s')
import os
import sys
import wx
from .axe_base import getsho... |
import os
os.environ["PYOPENGL_PLATFORM"] = "egl"
import os.path as osp
import sys
from datetime import timedelta
from plyfile import PlyData
import mmcv
import numpy as np
from tqdm import tqdm
cur_dir = osp.abspath(osp.dirname(__file__))
PROJ_ROOT = osp.join(cur_dir, "../../../..")
sys.path.insert(0, PROJ_ROOT)
fro... |
# coding: utf-8
__all__ = '__version__', 'Fanotify', 'FanotifyClient', 'FanoRule'
import array
import atexit
import datetime
import errno
import hashlib
import logging
import multiprocessing as mp
import os
import socket
import struct
import sys
from typing import Any, Callable, Iterable, Optional, Tuple, Union
fro... |
import numpy as np
import tensorflow as tf
def make_dict_from_param_list(paramlist):
res = {}
for param in paramlist:
res[param.name]=param
return res
class Rule(object):
def __init__(self):
pass
def isNaive(self):
return False
def isEps(self):
return False
... |
# Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.
from utils import context, BaseTestCase, interfaces, released, bug, irrelevant, mi... |
import json as js
import logging
import os
import time
import requests
from xml.dom import minidom
from cli import mmt
from cli.mmt.mmtcli import mmt_java
from cli.utils.daemon import Daemon
class Engine(object):
@classmethod
def list(cls):
engines = [cls(name)
for name in os.listd... |
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... |
"""Write Sparameters with Lumerical FDTD.
Disclaimer: This function automates the Sparameters but is hard to make a
function that will fit all your possible simulation settings.
You can use this function as an inspiration to create your own.
"""
import dataclasses
import time
from pathlib import Path
from typing impo... |
# -*- coding: utf-8 -*-
"""
:::::::::::::::::::::::: Critical Infrastructure Cyberspace Analysis Tool (CICAT) :::::::::::::::::::::::::::::::::::::::
NOTICE
The contents of this material reflect the views of the author and/or th... |
import pandas as pd
import statsmodels as sm
import numpy as np
from tsfresh.feature_selection.significance_tests import target_real_feature_real_test
from collections import OrderedDict
from sklearn.preprocessing import MinMaxScaler
import tsfresh
from tsfresh.feature_extraction import EfficientFCParameters, MinimalFC... |
import numpy as np
import matplotlib as mpl
from matplotlib.backends import backend_svg
import matplotlib.pyplot as plt
import seaborn as sns
import io
import numbers
bpj_template_linewidth = 3.132
half_width_figure_ratio = 3/4
golden_ratio = (1 + np.sqrt(5))/2
full_width_figure_ratio = 1/golden_ratio
def use_cell... |
#!/usr/bin/env python3
import io
import jinja2
import json
import os
import re
import shutil
import subprocess
import sys
import tempfile
# Conda's `pip` doesn't install `ruamel.yaml` because it finds it is already
# installed but the one from Conda has to be imported with `ruamel_yaml`
try:
from ruamel.yaml impo... |
import csv
import re
import pickle
import numpy as np
from collections import Counter
beginning_modifier_regex = r"^[a-z]\[\d+\]"
middle_modifier_regex = r"[A-Z]\[\d+\]"
position_regex = r"^[by](?P<position>\d+)"
charge_regex = r"\^(?P<charge>[\d])+"
neutral_loss_regex = r"[by][\d]+-(?P<neutral_loss>[\d]+)"
neutral_ga... |
from abc import ABC, abstractmethod
from collections import defaultdict
import torch
import torch.nn as nn
import torch.cuda as cuda
from pyblaze.nn.callbacks import TrainingCallback, PredictionCallback, CallbackException, \
ValueTrainingCallback
import pyblaze.nn.utils as xnnu
from pyblaze.utils.torch import gpu_d... |
from flask import Flask, jsonify, request, session, render_template, send_from_directory
from flask_bcrypt import Bcrypt
from flask_cors import CORS
import json
from datetime import datetime
import random
from collections import Counter
from personality_analysis.ppredict import PPredictor
from personality_analysis.cp... |
# nalutypes.py
#
# The MIT License (MIT)
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... |
#!/usr/bin/python
import os
import inspect
import sys
import pytest
import mock
from mock import sentinel
import tempfile
import subprocess
ourfilename = os.path.abspath(inspect.getfile(inspect.currentframe()))
currentdir = os.path.dirname(ourfilename)
parentdir = os.path.dirname(currentdir)
@pytest.fixture
def conf... |
#! /usr/bin/env/python
"""
Keeping with the structure of NRM_Model and how its drivers typically store data
this tool will allow the user to write out an oifits file (preferably calibrated)
given a directory where all the associated measurements are stored.
<NAME> <EMAIL> Nov 2014
"""
from __future__ import print_fu... |
from __future__ import division
from collections import namedtuple
from datetime import datetime, timedelta
from itertools import combinations
from uuid import uuid4
import networkx as nx
import numpy as np
from projectpredict.exceptions import InvalidProject
ExpectedCompletionTimeSamples = namedtuple('ExpectedComp... |
import mmcv
from mmcv import Config
import cv2
from mmdet.datasets import build_dataloader, build_dataset
import numpy as np
import matplotlib.pyplot as plt
import os
from PIL import Image
import pylab
pylab.rcParams['figure.figsize'] = (10.0, 10.0)
import math
from matplotlib.collections import PatchCollection
from ma... |
# libraries
import pandas as pd
from pandas.api.types import CategoricalDtype, is_categorical_dtype
import numpy as np
import string
import types
import scanpy.api as sc
import anndata as ad
from plotnine import *
import plotnine
import scipy
from scipy import sparse, stats
from scipy.cluster import hierarchy
import gl... |
import math
import random
import time
import os
import sys
import copy
from datetime import datetime
from os.path import join, exists
from os import mkdir
import collections
from collections import namedtuple
from collections import deque
from itertools import count
import torch
import torch.nn as nn
import torch.opt... |
"""Bootleg run command."""
import argparse
import logging
import os
import subprocess
import sys
from collections import defaultdict
from copy import copy
from pathlib import Path
import emmental
import faiss
import numpy as np
import torch
import ujson
from emmental.model import EmmentalModel
from rich.logging impor... |
import logging
from typing import List
import discord
from discord.ext import commands
from naotimes.bot import naoTimesBot
from naotimes.context import naoTimesContext
from naotimes.helpgenerator import HelpField, HelpOption
from naotimes.showtimes import Showtimes, ShowtimesKonfirmasi
from naotimes.utils import gen... |
#!/usr/bin/env python
""" Jet-Hadron analysis parameters.
Also contains methods to access that information.
.. codeauthor:: <NAME> <<EMAIL>>, Yale University
"""
from dataclasses import dataclass
import enum
import logging
import numpy as np
import re
from typing import Any, cast, Dict, Iterable, Iterator, Optional... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Package: mesxr.operation
Module: camera
Author: <NAME>
Affiliation: Department of Physics, University of Wisconsin-Madison
Last Updated: January 2019
Description:
This module is an updated version of the camera operations code contained in my old
PILATUS librar... |
import os
import sys
sys.path.append(os.path.join('..', 'codes'))
def confusion_all_matrix(epoch=20, saved=True,
weight_path='../datas/vis_down/outputs/learned/',
outputs_path='../datas/vis_down/outputs/check/'):
'''
正例・unknown・負例についてconfusion_matrixを作成
'... |
import numpy as np
import os
from sklearn import preprocessing
from .utilities import verboseprint, elapsed_time
import gc
from itertools import compress
# ---------------------------------------------
# Include all the object definitions for the different data sources
# ---------------------------------------------
... |
import logging
import time
import warnings
from itertools import product, repeat
from multiprocessing import Pool, cpu_count
from pathlib import Path
from typing import List, Optional, Tuple
import importlib_resources
import numpy as np
import spiceypy as spice
from shapely.geometry import Point, Polygon, box
from tqd... |
class ConjDados():
def __init__(self, dado1, unid1, dado2, unid2, incog, unidincog, respo):
self._d1 = dado1
self._u1 = unid1
self._d2 = dado2
self._u2 = unid2
self._i = incog
self._ui = unidincog
self._r = respo
@property
def d1(self):
... |
from collections import OrderedDict
from jinja2.loaders import FileSystemLoader
__author__ = 'BTimms'
import os
import json
import math
import pprint
from music21 import *
us = environment.UserSettings()
us['warnings'] = 0
from abc import ABCMeta, abstractmethod
from jinja2 import Template
class TSEvent(object, meta... |
from __future__ import division, print_function
import argparse
from functools import partial
from glob import glob
import os
from pathlib import Path
import sys
import traceback
import h5py
import numpy as np
import pandas as pd
from .featurize import (
get_embeddings,
read_file_chunks,
LinearFeaturizer,... |
#!/usr/bin/python3
from libs.telegramText import NotifyBot, SendDocumentBot, CheckTokens, GetTokens
import libs.coloredOP as co
from pathlib import Path
from zipfile import ZipFile
from halo import Halo
import threading
import os
import datetime
import re
import requests
import subprocess
import argparse
impor... |
import numpy
from shapely import geometry
from shapely.geometry import MultiPolygon, Polygon, mapping, shape
from shapely.geometry.polygon import LinearRing
from . import utils
def ts_polar(timeseries, funcs=["all"], nodata=-9999, show=False):
"""This function compute 9 polar metrics:
- Area - Area of the c... |
'''
Process the XML structure of the NCBI gene database and
the Pubmed database.
'''
import os
from Bio import Entrez
from lxml import etree
from StringIO import StringIO
import logging
from .pubmedcache import (make_pubmed_cache_dirname, save_pubmed_cache)
# XXX maybe should be a named tuple
class GeneHit(object):
... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import logging
import os
from time import sleep
from pytz import timezone
from sqlalchemy.orm import exc
from db.orm.tables ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Device types that are supported by the device manager and scanners.
Currently two types of devices are supported: USB and LAN devices. USB devices are identified by
their vendor id, product id and serial number. The ethernet (LAN) devices use their mac address for
a uni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.