text stringlengths 6.04k 39.5k |
|---|
import json
import os
import argparse
import torch
import pickle
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from knowledge_bert.tokenization import BertTokenizer
from knowledge_bert.modeling import BertForFeatureEmbs
from knowledge_bert.file_utils import PYTORCH_PRETRAINED... |
"""@package XLM_Object
Class for representing a single XLM formula (1 cell).
"""
import json
import six
if six.PY3: unicode = str
# https://github.com/kirk-sayre-work/office_dumper.git
import excel
from XLM.stack_item import *
import XLM.xlm_library
import XLM.color_print
#import XLM.compute_decode_keys
debug = Fa... |
""" The controller """
import abc
import random
import sys
import time
import uuid
from warnings import warn
from . import datamodel
from .datamodel import Bot, CTFUniverse
from .graph import Graph, NoPathException, manhattan_dist
class GameFinished(Exception):
pass
class PlayerTimeout(Exception):
pass
cl... |
#!/usr/bin/python3
from posixpath import basename
import subprocess
import os
import os.path
import argparse
import json
import sys
import tempfile
import time
import multiprocessing
import shutil
VERSION = "v0.2.0"
DEFAULTS = {
"input_files": None,
"codec": "libfdk_aac",
"bitrate": None,
"cover_file... |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... |
import multiprocessing as mp
import os
import time
from collections import defaultdict
from dataclasses import dataclass, field
from typing import List, Dict, Set, Tuple, Callable
import pandas as pd
from jaal import Jaal
from numpy import random
@dataclass
class Peer:
idx: int
edges: Set[Tuple[int, int]] = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import logging
import re
import yaml
from functools import wraps
from datetime import datetime, timedelta
from collections import OrderedDict
from ecoline import Ecoline
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, C... |
"""various helpful utilities for plotting or displaying information
"""
import warnings
import torch
import numpy as np
import matplotlib.pyplot as plt
import plenoptic as po
try:
from IPython.display import HTML
except ImportError:
warnings.warn("Unable to import IPython.display.HTML")
def clean_up_axes(ax, ... |
from __future__ import print_function
from netCDF4 import Dataset, date2num, num2date
from datetime import datetime, timedelta
import numpy as np
import interp2D
import interpolation as interp
import IOwrite
import os
import barotropic
import IOinitial
import datetimeFunctions
import forcingFilenames as fc
try:
im... |
import numpy as np
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import cross_val_predict
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score, balanced_accuracy_score, classification_... |
"""
This module has methods for creating a game corsi timeline.
"""
import matplotlib.pyplot as plt
import pandas as pd # standard scientific python stack
from scrapenhl2.manipulate import manipulate as manip
from scrapenhl2.plot import visualization_helper
from scrapenhl2.scrape import parse_pbp, parse_toi, schedul... |
#! /usr/bin/env python3
from enum import Enum
from numba import jit
from random import choice, randrange, shuffle
from itertools import accumulate, chain
from section_type import SectionType, short_section, long_section
#from random_util import subsets, random_bjorklund2, random_bool
#from song imp... |
import os
import sys
import time
import datetime
import copy
import json
import pickle
import sqlite3
import csv
import threading
from concurrent.futures import ThreadPoolExecutor
import numpy as np
from pandacommon.pandalogger import logger_utils
from pandaatm.atmconfig import atm_config
from pandaatm.atmcore.core_... |
#!/usr/bin/env python
import sys
import math
from PySide2 import QtCore, QtGui, QtWidgets, QtOpenGL
from PySide2.QtCore import Signal, Slot
import rospy
from std_msgs.msg import String
import threading
from datetime import datetime
try:
from OpenGL import GL
except ImportError:
app = QtWidgets.QApplication(sy... |
# -*- coding: utf-8 -*-
"""
Collect concerns itself with the screen scraping functionality.
"""
# TODO(jkelly) Ensure team names are consistent
import os
import re
import pytz
import json
import logging
import urllib2
import datetime
from io import StringIO
from hashlib import sha1
from lxml.html import parse as lxml... |
#Misc
import time, os, sys, pdb, argparse
from glob import glob
from fnmatch import fnmatch
#Base
import numpy as np
import numpy.ma as ma
import pandas as pd
import scipy.io as sio
import scipy.stats as st
import multiprocessing
#Save
import json
import scipy.io as sio
import h5py
import io_dict_to_hdf5 as ioh5
#Pl... |
import curses
import math
import time
import logging
from tinywin import core, helpers
class Input_Event(object):
def __init__(self, key):
self.key = key
self._mouse_event = False
if key == curses.KEY_MOUSE:
try:
# mouse_res = curses.getmouse()
#... |
import os
import re
from collections import defaultdict
import click
import pint
import yaml
from botocore.exceptions import NoRegionError
from sigopt.paths import get_bin_dir, ensure_dir
from sigopt.utils import accept_sigopt_not_found
from .cluster.errors import AlreadyConnectedException, ClusterError, MultipleClu... |
# -----------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# Code written by <NAME>.
# -----------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from ... |
import os
import subprocess
import re
class DpiConfig(object):
def __init__(self, pysv_li, pkg_sv_path=".sv/pkg/pysv_pkg.sv", lib_path=".build/libpysv.so"):
self.sv = pkg_sv_path
self.lib = lib_path
self.bname = " ".join(pysv_li)
...
class Simlite(object):
# init for fork met... |
import random
import struct
import asyncio
import functools
import hashlib
from binascii import unhexlify
import zmq
import zmq.asyncio
import bitcoin.core.serialize
import bitcoin.base58
import anytree
import pylibbitcoin.error_code
def merkle_branch(hash_, tree):
tree_walker = anytree.PostOrderIter(tree)
no... |
import torch
import numpy as np
import matplotlib.pyplot as plt
import cv2
from detectron2.projects.panoptic_deeplab.segmentation_metrics import SegmentationMetrics
import pdb
def visualize_center_offset(image, center_targets, offset_targets, center_weights, offset_weights):
print(image.shape, center_targets.shape,... |
# This is modified from Upenn MEAM 620 course:
# https://alliance.seas.upenn.edu/~meam620/wiki/index.php
import numpy as np
import torch
import matplotlib.pyplot as plt
class qd_object:
"""
Struct to hold qd information
"""
def __init__(self):
self.pos = 0
self.vel = 0
self.eule... |
import keyword
import logging
from collections import namedtuple
from functools import partial
from prestring import PreString
from prestring.python import Module
from prestring.utils import LazyFormat, LazyKeywordsRepr
from dictknife import deepequal, deepmerge
from collections import defaultdict
from collections impo... |
def add_ee_layer(self, eeImageObject, visParams, name):
"""
Define a method for displaying Earth Engine image tiles to folium map.
"""
mapID = ee.Image(eeImageObject).getMapId(visParams)
folium.raster_layers.TileLayer(
tiles = mapID['tile_fetcher'].url_format,
attr = "Map Data © Goog... |
"""
semvermanager
=================
`semvermamager` exports a single class Version which implements
a restricted subset of the SEMVER_ standard.
.. _SEMVER: http://semver.org/
Version defines a Semantic version using the following field
structure:
.. code-block:: python
# MAJOR.MINOR.PATCH-TAG
int MAJOR ... |
import logging
from typing import List, Dict, Tuple
import numpy as np
import pandas as pd
from message_ix.utils import make_df
from pandas.io.json import json_normalize
from d2ix import Data, ModelPar, RawData
from d2ix.util import split_columns
from d2ix.util.acitve_year_vector import get_act_year_vector, get_years... |
# from https://github.com/amdegroot/ssd.pytorch
import cv2
import numpy as np
import torch
from imgaug import augmenters as iaa
from numpy import ndarray, random
def intersect(box_a, box_b):
max_xy = np.minimum(box_a[:, 2:], box_b[2:])
min_xy = np.maximum(box_a[:, :2], box_b[:2])
inter = np.clip((max_xy ... |
""" Tell the developer about general coding and documentation approaches for nodes
A very useful tutorial can be found under :ref:`t_new_node`.
"""
from pySPACE.missions.nodes.base_node import BaseNode
import warnings
import logging
import numpy
from pySPACE.resources.data_types.feature_vector import FeatureVector
fro... |
# Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARR... |
import random
import bisect
import math
import partitioning as Part
import itertools
import csv
import time
import numpy as np
import test_set
import numpy.random as npr
from seidel_tree import Segment, Line, to_line
from collections import deque
from geometric import approx_eq
def horizontal_split_vertices(points, ... |
import matplotlib
matplotlib.use('TkAgg')
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
# implement the default mpl key bindings
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Figure
from tkinter ... |
"""
Code to train a CycleGAN to remove degradations from manuscript images.
"""
import itertools
import logging
import time
from pathlib import Path
from typing import Tuple, Dict, Any
import numpy as np
import torch
from skimage.metrics import structural_similarity, normalized_root_mse
from torch import nn
from torch... |
"""ls: information about images and containers
Use 'dsco ls' to get information about images and containers running
on your localhost. Use 'dsco ls -r' to add information about machines
listed in $HOME/.dsco/settings.json
"""
from pathlib import Path
import concurrent.futures
import os
# import yaml
import subpro... |
#!/usr/bin/env python
import numpy as np
def cb_op(oper_A, t_mat):
"""
Change the basis of an operator :math:`\hat{O}` from one basis :math:`A`: :math:`\\psi^{A}_{i}` to another basis :math:`B`: :math:`\\phi^{B}_{j}`.
.. math::
O^{\\prime} = T^{\dagger} O T,
T_{ij} = <\\psi^{... |
from __future__ import division
import sys
import math
from numpy import(abs, amax, amin, arange, arccos, arctan, array, atleast_1d,
clip, copy, copyto, cos, cosh, exp, full_like, log, ndarray,
newaxis, pi, power, repeat, sin, sinh, squeeze, sqrt, sum,
tan, tanh, z... |
# --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import os
import time
import datetime
import numpy as np
import torch
... |
import numpy as np
import tensorflow as tf
import pickle
class CFTModelReddit:
def __init__(self,
embedding_layer_sizes=(),
encoder_layer_sizes=(),
decoder_layer_sizes=(),
dropout_pct=0., estimator='none',
n_samples=30, gs_temperature=1.,
fpr=5e-2,
fpr_likelihood=False,
prop_fpr=True,
censoring_fa... |
def dataCleaning(marriageNum='Full', classNum=2, dropColumns=True):
'''
This is the data cleaning function for the CE264 final project: Marriage Analysis
Return a pandas data frame and a numpy array: data (X) and observation (y)
The name of each column refers to the JGSS data codebook
For some ... |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from ..linalg.cholesky import ChoInv, ChoInvPivot, cholesky_factor, fixed_cholesky
from ..linalg.cholesky import jit_cholesky, _check_cholesky_inputs, pivot_cholesky, _pivot_transpose
from ..linalg.linalg_utils import calc_Ainv, calc_A_deriv, ca... |
"""
csv in format:
image_{img_counter}_{word_counter}.jpg, 32, stride_width, dots_number, X_center, char_value, char_code,
X_center, char_value, char_code etc
"""
import numpy as np
import math
import h5py
import re
import cv2
import rand... |
import socket
import vstruct
from vstruct.primitives import *
import vstruct.defs.inet as vs_inet
# only the currently parsed record types
DNS_TYPE_A = 1
DNS_TYPE_NS = 2
DNS_TYPE_CNAME = 5
DNS_TYPE_SOA = 6
DNS_TYPE_PTR = 12
DNS_TYPE_MX = 15
DNS_TYPE_TXT = 16
dns_type_names = {
DNS_TYPE_A: 'A'... |
# Copyright 2014 Baidu, 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 writing, softwa... |
import base64
import datetime
import json
import re
import time
import traceback
import unicodedata
from pypac import PACSession
import requests
from qcpump.core.json import QCPumpJSONEncoder
from qcpump.pumps.base import BOOLEAN, STRING, FLOAT, DIRECTORY
from qcpump.settings import Settings
settings = Settings()
H... |
import os
import numpy as np
import pandas as pd
import xgboost
from sklearn.metrics import accuracy_score
import streamlit as st
## Companies info
companies_dict = {"Phillips":'PHIA',
'Volkswagen':'VOW3',
'ING':'INGA',
'Credit Suisse':'CS',
'L\'Oreal... |
# -*- coding: utf-8 -*-
# @Author: patrick
# @Date: 2016-09-01 17:04:53
# @Last Modified by: <NAME>
# @Last Modified time: 2016-10-26 14:48:09
# as per tensorflow styleguide
# https://www.tensorflow.org/versions/r0.11/how_tos/style_guide.html
from __future__ import absolute_import
from __future__ import division
f... |
import cv2
import numpy as np
import tensorrt as trt
import pycuda.driver as cuda
from typing import List, Tuple
from numpy.lib.stride_tricks import as_strided
from mot.structures import Detection
from mot.detect import DETECTOR_REGISTRY, Detector
__all__ = ['TRTCenterNetDetector']
TRT_LOGGER = trt.Logger(trt.Logger... |
from glob import glob
from os import path
from PIL import Image
###
### Compile BDF fonts to c header files
###
# This code is available under the MIT license
# Copyright (c) 2019 <NAME> (Projectitis)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated do... |
"""empty message
Revision ID: 5aaeafd07224
Revises:
Create Date: 2018-07-05 21:03:07.048351+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '5aaeafd07224'
down_revision = None
branch_labels = None
depends_on = Non... |
from collections import defaultdict
from copy import deepcopy
import csv
from datetime import datetime
import os
from pprint import pformat
import re
import string
import time
from mintamazontagger.algorithm_u import algorithm_u
from mintamazontagger import category
from mintamazontagger.currency import micro_usd_near... |
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
YOLO-specific modules
Usage:
$ python path/to/models/yolo.py --cfg yolov5s.yaml
"""
import argparse
import sys
from copy import deepcopy
from pathlib import Path
FILE = Path(__file__).resolve()
ROOT = FILE.parents[1] # YOLOv5 root directory
if str(ROOT) not in sys... |
"""tests/test_output_format.py.
Tests the output format handlers included with Hug
Copyright (C) 2016 <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 withou... |
import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... |
# 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... |
'''
Image
=====
Core classes for loading images and converting them to a
:class:`~kivy.graphics.texture.Texture`. The raw image data can be keep in
memory for further access.
.. note::
Saving an image is not yet supported.
'''
__all__ = ('Image', 'ImageLoader', 'ImageData')
from kivy.event import EventDispatch... |
"""Helpers for listening to events."""
from datetime import datetime, timedelta
import functools as ft
from typing import Any, Callable, Dict, Iterable, Optional, Union, cast
import attr
from homeassistant.const import (
ATTR_NOW,
EVENT_CORE_CONFIG_UPDATE,
EVENT_STATE_CHANGED,
EVENT_TIME_CHANGED,
... |
# Copyright 2003-2008 by <NAME>. All rights reserved.
# Revisions copyright 2008-2017 by <NAME>.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of ... |
#!/usr/bin/python3
import argparse
import collections
from collections import defaultdict
import imageio
import numpy as np
from pathlib import Path
import pdb
from typing import Any, List, Mapping, Tuple
from mseg.utils.multiprocessing_utils import send_list_to_workers
from mseg.utils.txt_utils import generate_all_... |
# Copyright (c) Facebook, Inc. and its affiliates.
# Initial version was taken from https://github.com/uclanlp/visualbert
# which was cleaned up and adapted for MMF.
import os
from copy import deepcopy
from typing import Dict, List, Optional, Tuple
import torch
from mmf.common.registry import registry
from mmf.model... |
import numpy as np
import math
from numba import jit, prange
from utils import minimum, clip
dtype = np.float32 # float32 is much faster than float64 because of exp
parallel = False # and then it also depends on NUMBA_NUM_THREADS
nogil = True
@jit(nopython=True, nogil=nogil)
def fit_plain_stumps_iter(X_proj, y, g... |
#! /usr/bin/env python
import argparse,os,subprocess
from wpipe import *
from wingtips import WingTips as wtips
from wingtips import time, np, ascii
import gc
import pandas as pd
def register(PID,task_name):
myPipe = Pipeline.get(PID)
myTask = Task(task_name,myPipe).create()
_t = Task.add_mask(myTask,'*','sta... |
import math
import random
from typing import Dict, Iterable, Sequence, Tuple
from eth_typing import BLSPubkey, BLSSignature, Hash32
from eth_utils import to_tuple
from eth_utils.toolz import keymap as keymapper
from eth_utils.toolz import pipe
from eth2._utils.bitfield import get_empty_bitfield, set_voted
from eth2._... |
import logging
import typing as t
import cv2
import numpy as np
from opensfm import io
from opensfm import log
from opensfm import pydense
from opensfm import pymap
from opensfm import pysfm
from opensfm import tracking
from opensfm import types
from opensfm.context import parallel_map
from opensfm.dataset import Undi... |
import numpy as np
import lazy_dataset
from sms_wsj.database.create_intermediate_json import combine_rirs_and_sources
def filter_duplicates(l):
"""
>>> filter_duplicates([{'a': 1}, {'b': 1}, {'a': 1}])
[{'a': 1}, {'b': 1}]
"""
def make_hashable(o):
try:
hash(o)
ret... |
# -*- coding: utf-8 -*-
'''
@Time : 2020/05/06 21:09
@Author : Tianxiaomo
@File : dataset.py
@Noice :
@Modificattion :
@Author :
@Time :
@Detail :
'''
import os
import random
import sys
import cv2
import numpy as np
import torch
from torch.utils.data.dataset im... |
import sys, math
import numpy as np
import Box2D
from Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener)
import gym
from gym import spaces
from gym.utils import seeding, EzPickle
# Rocket trajectory optimization is a classic topic in Optimal Control.
#
# According t... |
from typing import Dict, List, Optional, Tuple, Union
import typing
import numpy as np
from ConfigSpace.hyperparameters import \
CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter,Constant
import sklearn.gaussian_process.kernels
from sklearn.decomposition import PCA
from sklearn.pre... |
#
# Copyright 2021 by <NAME>, Hitachi, Ltd.
# All rights reserved.
#
# This file is part of the KEMPNN package,
# and is released under the "BSD 3-Clause License". Please see the LICENSE
# file that should have been included as part of this package.
#
import os
from typing import Any, Collection, Dict, List, NamedTupl... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration."""
from __future__ import absolute_import, print_function
... |
import functools
import logging
import math
import os
import signal
import sys
import threading
import time
from concurrent.futures import Future, ThreadPoolExecutor
from contextlib import contextmanager
from typing import Any, Generator, Iterable, Set, Optional, cast
from urllib.parse import urlparse
import pendulum
... |
""" Functions that help with SKA simulations
"""
__all__ = ['plot_visibility', 'plot_visibility_pol', 'find_times_above_elevation_limit', 'plot_uvcoverage',
'plot_azel', 'plot_gaintable', 'plot_pointingtable', 'find_pb_width_null',
'create_simulation_components', 'plot_pa']
import logging
impo... |
# Copyright 2017 The AI Safety Gridworlds 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 b... |
from __future__ import unicode_literals
from django import forms
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as ... |
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
"""
File: Configuration.py
License: Part of the PIRA project. Licensed under BSD 3 clause license. See LICENSE.txt file at https://github.com/jplehr/pira/LICENSE.txt
Description: Module that provides to main data structures.
"""
import sys
sys.path.append('..')
import lib.Logging as log
import lib.Exception as PE
impo... |
# Lexer Implementation
import re
from .utils import Str, classify, get_regexp_width, Py36, Serialize, suppress
from .exceptions import UnexpectedCharacters, LexError, UnexpectedToken
###{standalone
from warnings import warn
from copy import copy
class Pattern(Serialize):
raw = None
type = None
def __i... |
"""ImbalancedEnsembleClassifierMixin: mixin class for all
imbalanced ensemble estimators.
BaseImbalancedEnsemble: a general base class for imbalanced ensemble.
"""
# Authors: <NAME> <<EMAIL>>
# License: MIT
from abc import ABCMeta, abstractmethod
import numpy as np
from collections import Counter
from joblib impor... |
# spicierModbus2mqtt - Modbus TCP/RTU to MQTT bridge (and vice versa)
# https://github.com/mbs38/spicierModbus2mqtt
#
# Written in 2018 by <NAME> <<EMAIL>>
#
#
# Provided under the terms of the MIT license.
# Contains a bunch of code taken from:
# modbus2mqtt - Modbus master with MQTT publishing
# Written and (C) 2... |
# Copyright (c) 2006-2011 <NAME> http://garnaat.org/
#
# 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... |
#!/usr/bin/env python3
"""Module containing the MDrun class and the command line interface."""
import os
import argparse
from biobb_common.generic.biobb_object import BiobbObject
from biobb_common.configuration import settings
from biobb_common.tools import file_utils as fu
from biobb_common.tools.file_utils import la... |
import sys
import re
import requests
from .payload import *
from .template import *
from .events import *
# See https://developers.facebook.com/docs/graph-api/changelog
SUPPORTED_API_VERS=[
"v2.11",
"v2.10",
"v2.9",
"v2.8",
"v2.7",
"v2.6",
]
# See https://developers.facebook.com/docs/messeng... |
import os
import warnings
import probfit
import iminuit
import json
from numpy import vectorize
from IPython.display import display
from ipywidgets import Text, FloatText, VBox, Button, HBox, Checkbox, FloatRangeSlider, Tab, IntRangeSlider
from glob import glob
from pandas import DataFrame
import matplotlib.pyplot as p... |
import asyncio
from asyncio.events import AbstractEventLoop
from genericpath import exists
import os
import operator
import pytest
import ray
import numpy as np
import pickle as pkl
from functools import reduce
from malib.utils.typing import BufferDescription, List, Any, Dict, Status, Tuple
from malib.utils.episode i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import sys
import numpy as np
import scipy.optimize
import matplotlib.pyplot as plt
import cv2
import ellipse
DEBUG_IMAGES = []
def debug_show(name, src):
global DEBUG_IMAGES
filename = 'debug{:02d}_{}.pn... |
import numpy as np
import pytest
from dask import is_dask_collection
from xarray.testing import assert_equal
import xskillscore as xs
from xskillscore import halfwidth_ci_test, mae, sign_test
OFFSET = -1
METRIC = "mae"
@pytest.fixture
def a_1d_worse(a_1d):
"""a_1d worsened by constant offset."""
return a_1d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''\
usage: venv-update [-hV] [options]
Update a (possibly non-existent) virtualenv directory using a pip requirements
file. When this script completes, the virtualenv directory should contain the
same packages as if it were deleted then rebuilt.
venv-update uses "traili... |
# -*- coding: utf-8 -*-
"""Validation classes for various types of data."""
from __future__ import unicode_literals
import re
from operator import attrgetter
from .compat import basestring, text_type, zip_longest
from .exceptions import ValidationError
class Validator(object):
"""Base abstract class for valida... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
# coding: utf-8
# In[ ]:
import numpy as np
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
import random
import cv2
from tensorflow.contrib.layers import flatten
import tensorflow as tf
import csv
from numpy import array
from sklearn.model_selection import train_test_split
fro... |
# -*- coding: utf-8 -*-
"""
Unit tests for the spectral module.
:copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
import unittest
import numpy as np
import scipy.signal as spsig
import quantities as pq
import neo.core as n
from numpy... |
import plotly.express as px
import numpy as np
import pytest
import xarray as xr
from PIL import Image
from io import BytesIO
import base64
import datetime
from plotly.express.imshow_utils import rescale_intensity
img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]]], dtype=np.uint8)
img_gray = np.arange(100, d... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.automation
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for automation scripting languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, com... |
import numpy as np
import torch
from ase import units
import h5py
import logging
import json
from schnetpack.data import Structure
class MDUnits:
"""
Basic conversion factors to atomic units used internally:
fs2atu (time): femtoseconds to atomic time units
eV2Ha (energy): electron Volt to Hart... |
#pyCGM
# Copyright (c) 2015 <NAME> <<EMAIL>>
# Core Developers: <NAME>, <NAME>
# Contributors <NAME>, <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 ... |
# 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 torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq.iterative_refinement_generator import DecoderOut
from... |
"""
################################################################################
Parallel-and-asynchronous Stitching Script - Parallel version
Author: <NAME>
This script pulls the data generated through TissueCyte (or another microscope system) and
can perfom image averaging correction on the images if requested,... |
import math
import itertools as it
import torch
from torch.optim.optimizer import Optimizer
import torch.nn as nn
from torch.nn.utils.rnn import PackedSequence
from typing import *
"""
File containing classes taken directly from other work to aid model training
"""
class RAdam(Optimizer):
"""
Directly from <... |
import os
import numpy as np
from astropy import table
import logging
from pathos.multiprocessing import Pool
import matplotlib.pyplot as plt
from dynamite import parameter_space
from dynamite import plotter
class ModelIterator(object):
"""Iterator for models
Creating this ``ModelIterator`` object will (i) g... |
from testutils import assert_raises
assert set([1,2]) == set([1,2])
assert not set([1,2,3]) == set([1,2])
assert set([1,2,3]) >= set([1,2])
assert set([1,2]) >= set([1,2])
assert not set([1,3]) >= set([1,2])
assert set([1,2,3]).issuperset(set([1,2]))
assert set([1,2]).issuperset(set([1,2]))
assert not set([1,3]).iss... |
from imblearn.over_sampling import SMOTE
from imblearn.under_sampling import RandomUnderSampler
from sklearn.linear_model import LinearRegression, Ridge, Lasso, ElasticNet, LogisticRegression
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.preprocessing import StandardScaler, MinMaxScale... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.