text stringlengths 8.04k 46.5k |
|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2018 <NAME>
# See LICENSE.md for details.
"""
Importing the module
--------------------
To import the OPi.GPIO module:
.. code:: python
import OPi.GPIO as GPIO
By doing it this way, you can refer to it as just GPIO through the rest of your
script.
Pin Numbering
----------... |
#! /usr/bin/env python
import sys
import inkex
from lxml import etree
import os
import subprocess
import tempfile
import shutil
import copy
import logging
import json
import glob
import shutil
class Options():
def __init__(self, svg_stencil_exporter):
self.current_file = svg_stencil_exporter.options.inpu... |
"""
Copyright (C) 2010-2022 Alibaba Group Holding Limited.
This file is modified from
https://github.com/open-mmlab/mmdetection3d
"""
import argparse
import mmcv
import numpy as np
import os
from nuscenes.nuscenes import NuScenes
from nuscenes.utils import splits
from nuscenes.utils.geometry_utils import view_points
f... |
from __future__ import absolute_import, division, print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import time
import cv2
import sys
import os
from collections import namedtuple
from torch.optim.lr_scheduler import ExponentialLR
from torch... |
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
Colmap specific database functions
"""
from kapture.io.tar import TarCollection
import logging
import numpy as np
import os
import os.path as path
from typing import List, Tuple, Dict, Optional, Set
from tqdm import tqdm
import sqlite3.dbapi2
# kap... |
"""
Provides rolling statistical moments and related descriptive
statistics implemented in Cython
"""
from __future__ import division
from functools import wraps
from numpy import NaN
import numpy as np
from pandas.core.api import DataFrame, Series, Panel, notnull
import pandas.algos as algos
import pandas.core.comm... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Test that the Stage class works correctly."""
import os
import collections
import shutil
import tempfile
import getpass... |
from functools import partial
from typing import Any, Callable, Dict, Generator, List, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerve... |
#!/usr/bin/env python3
# Identification of dvd/bluray
import os
import sys # noqa # pylint: disable=unused-import
import logging
import urllib
import re
import datetime
import pydvdid
import unicodedata
import xmltodict
import json
import requests
from arm.ripper import music_brainz
from arm.ripper import utils
from... |
"""M-tree data structure to perform k-NN searches
===
This is an implementation of the M-tree, a data structure to find the element(s) the most similar to a given element.
The M-tree is a tree based implementation of the concept of metric space
( http://en.wikipedia.org/wiki/Metric_space ), it is similar to b-tree.
I... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
import random
import logging
import json
import re
import numpy as np
from pokemon import Pokemon, Move, GameData
from dex import *
def parse_pokemon(s):
"""Get player num and pokemon nickname"""
m = re.match('p(1|2)a: (.*)', s)
return m.group(1), m.group(2)
class Agent:
def __init__(self, player_name... |
import logging
import math
from typing import Dict, List
import torch
from torch import Tensor, nn
import torch.distributed as dist
from detectron2.config import configurable
from detectron2.layers import ShapeSpec, cat, batched_nms
from detectron2.structures import Boxes, ImageList, Instances, pairwise_iou
from detec... |
'''
Copyright 2021 konawasabi
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 ... |
import random
from math import log
from multiprocessing import Process, Queue, cpu_count
import sys
if sys.version_info[0] >= 3:
from tkinter import *
from tkinter.filedialog import askopenfilename, asksaveasfilename
from tkinter.ttk import *
import PIL.Image as Image
else: # if python 2.x
from Tki... |
from dataclasses import dataclass, field
from PIL import Image
from torch.nn.init import kaiming_normal_
from typing import Any, List
from utils.atari_wrappers import MaxAndSkipEnv, NoopResetEnv
import argparse
import gym
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import model
import nump... |
from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
from astropy.io import fits
import astropy.units
from astropy.table import Table
from enum34 import Enum
import numpy as np
import copy
# FITS header keyword indicating 2-point data
TWOPOINT_SENTINEL = ... |
#!/usr/bin/env python3
#
# Copyright 2015 Dovetail Genomics LLC
#
#
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import map
from builtins import str
from builtins import range
from builtins import object
import pickle as pickle
debug=False
... |
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (c) 2018 McAfee LLC - All Rights Reserved.
###############################################################################
"""
Test cases for the CLI subcommands (generatecsr, provisionconfig, and
update... |
"""
TestMetricProducer
"""
import json
import logging
import os
import random
import time
from absl import app, flags
from retrying import retry
import kafka
from kafka.admin import KafkaAdminClient, NewTopic
from pyformance import meter_calls, time_calls
from nbdb.batch_consumer.utils import SparseBatchMessage
fr... |
from __future__ import division
import os
import sys
import time
import glob
import json
import logging
import argparse
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torch.optim as optim
import torch.distributed as dist
from tensorboardX import Summa... |
# -*- coding: utf-8 -*-
"""
Copyright <NAME> <<EMAIL>> 2020
Models to store objects in the DB
"""
from zipfile import ZipFile
import markdown
from lxml import html
from logzero import logger
from model_utils.managers import InheritanceManager
import django.utils.timezone
from django.contrib.auth import get_user_model... |
import argparse
import time
import torch.nn.init as init
import torch.optim as optim
from torch.utils.data import DataLoader
from parlai.core.torch_generator_agent import TorchGeneratorAgent
from parlai.utils.misc import warn_once
from .modules import *
from .util import *
from collections import Counter, namedtuple
... |
from typing import Any
import detectron2
import streamlit as st
import numpy as np
import os
import json
import random
from PIL import Image
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import time
import yaml
import subprocess
import albumentations as A
import cv2
from utils import get_... |
#!/usr/bin/env python
"""
findpkg.py
============
Note that the functionality here is used by::
find_package.py
pkg_config.py
After code changes make sure to do a --nocache or -C run with::
find_package.py -C
Otherwise old errors from the cache may linger.
Hmm this depends on cmake modules from t... |
from __future__ import print_function
import time
import pickle
import time
import numpy as np
import scipy.optimize, scipy.ndimage
from acq4.util import Qt
import acq4.pyqtgraph as pg
from acq4.Manager import getManager
class PipetteTracker(object):
"""Provides functionality for automated tracking and recalibrat... |
# imports - standard imports
import os
import json
import sqlite3
# imports - third party imports
from flask import Flask, url_for, request, redirect
from flask import render_template as render
# setting up Flask instance
app = Flask(__name__)
try:
app.config.from_pyfile('config.py')
(DATABASE_NAME, ) = app.c... |
"""
@authors: reubendo, aaronkujawa
Adapted from: https://github.com/SlicerRt/SlicerRT/edit/master/BatchProcessing/BatchStructureSetConversion.py
usage from command line:
[path_slicer] --python-script [path_to_this_python_file] --input-folder [path_input] --output-folder [path_output]
[optional] --register [T1 or T2] ... |
#!/usr/bin/env python3
# 234567890123456789012345678901234567890123456789012345678901234567890123456789
"""Download google search console data and augment for easy storage in a
relational schema.
To use:
1) Install the Google Python client library, as shown at
https://developers.google.com/webmaster-tools/v3/librar... |
# THIS SCRIPT SERVES TO TRANSLATE INDIVIDUAL DATASET ANNOTATIONS TO CELL TYPE ANNOTATIONS AS IMPLEMENTED BY SASHA AND MARTIJN! :)
import pandas as pd
import numpy as np
import scanpy as sc
import utils # this is a custom script from me
def nan_checker(entry):
"""replaces entry that is not a cell type label, but rathe... |
import base64
import logging
import os
import re
import sys
import json
import time
from abc import ABC
from datetime import datetime
from multiprocessing import Process, Queue
from urllib.parse import urlparse
import pandas as pd
import requests
import sqlalchemy as s
from github import Github
from sqlalchemy import ... |
"""
MIT License
Copyright (c) 2017 s0hvaperuna
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, d... |
###############################################################################
# Name: ctrlbox.py #
# Purpose: Container Window helper class #
# Author: <NAME> <<EMAIL>> #
# Copyright: (c) 2... |
"""
Provides utilities for running nussl algorithms that do not belong to
any specific algorithm or that are shared between algorithms.
"""
import warnings
import numpy as np
import torch
import random
from .. import musdb
import librosa
from . import constants
import os
from contextlib import contextmanager
def se... |
from numba import vectorize
from numba import njit
import numpy as np
import collections
import reptools
def derep_FASTQ(fn,clust_file):
seqs = collections.defaultdict(dict)
gene_ids = collections.defaultdict(list) # stored in a list to avoid repetition - slower, but saves memory
changes = collections.defa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 14 12:09:07 2021
@author: <NAME>
"""
import ee, csv
import matplotlib.pyplot as plt
import mod_ls as ls
import mod_dt as dt
import mod_mesma as mes
import mod_post as pst
# necessary for when I bring server side to client side:
#import numpy as np... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import numpy as np
import json
from rouge import Rouge
import os, sys
import jieba
import six
from collections import defaultdict
# 自定义词典
user_dict_path = '/new_disk2/zhongxiang_sun/code/explanation_project/SPACES_torch/datasets/user_dict.txt'
user_dict_path_2 = '/new_disk2/zhongxiang_sun/code/explanation_project/SP... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 27 13:08:45 2021
@author: MalvikaS
Build classifier on RNA seq data
"""
# Import
import os
import pandas as pd
import random
import numpy as np
from imblearn.ensemble import BalancedRandomForestClassifier
from imblearn.ensemble import BalancedBaggingClassifier
from imb... |
# coding=utf-8
# Copyright 2021 The jax_verify Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
from __future__ import absolute_import, division, print_function
import pytest
import tempfile
import pandas as pd
from operator import (add, sub, mul, floordiv, mod, pow, truediv, eq, ne, lt,
gt, le, ge)
try:
from operator import div
except ImportError:
from operator import truediv as d... |
# encoding: UTF-8
from __future__ import print_function
import json
import sys
import traceback
import zlib
from collections import defaultdict
from enum import Enum
from typing import Dict, List
from vnpy.api.rest import Request
from vnpy.trader.gateway.okexFuturesGateway.OkexFuturesBase import \
OkexFuturesRe... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ------------------------------------------------------------------... |
#!/usr/bin/env python
#coding: utf-8
__author__ = '<NAME> <<EMAIL>>'
__status__ = 'experimental'
import collections
import os
import sys
import datetime
from _utilities import sort_uniq
import asm_manip as am
import ope_manip as om
import precomp_manip as pm
UNTRACKED_CLAZS = frozenset([
"java/lang/StringBuild... |
"""Analysis of text input into executable blocks.
The main class in this module, :class:`InputSplitter`, is designed to break
input from either interactive, line-by-line environments or block-based ones,
into standalone blocks that can be executed by Python as 'single' statements
(thus triggering sys.displayhook).
A ... |
from __future__ import absolute_import
from __future__ import division
import torch
import torchvision.transforms.functional as F
from torchvision.transforms import *
from PIL import Image, ImageOps
import random
import math
import numbers
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from scip... |
"""
Construct standardized scales
"""
import numpy as np
from typing import Tuple, Union
""" Smallest number for 64-bit floats. Deploy to avoid division by zero or log zero singularities"""
EPSILON = np.finfo(np.float64).eps
MICROS_TO_S = 1E-6
MICROS_TO_MILLIS = 1E-3
KPA_TO_PA = 1E3
DEGREES_TO_KM = 111.
"""
Standardi... |
'''
AAA lllllll lllllll iiii
A:::A l:::::l l:::::l i::::i
A:::::A l:::::l l:::::l iiii
A:::::::A l:::::l l:::::l
... |
import plotly
import os, sys
import base64
import sklearn
import numpy as np
import pandas as pd
import streamlit as st
# Checkpoint for XGBoost
xgboost_installed = False
try:
import xgboost
from xgboost import XGBClassifier
xgboost_installed = True
except ModuleNotFoundError:
pass
# Widget for recordi... |
# -*- coding: utf-8 -*-
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... |
"""
models.py
=======================
Houses all of the PyTorch models to access and the corresponding Scikit-Learn like model trainer.
"""
import time
from apex import amp
from pathflowai.losses import GeneralizedDiceLoss, FocalLoss
from sklearn.metrics import roc_curve, confusion_matrix, classification_report, r2_sco... |
# -*- coding: utf-8 -*-
u"""zgoubi input file parser.
l:copyright: Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern.pkcollections import PKDict
from pykern.pkdebug import pk... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2019 <NAME>. All Rights Reserved.
# A copyright license is hereby granted for redistribution and use of the
# Software in source and binary forms, with or without modification, provided
# that the following conditions are met:
# • Redistributions of source co... |
import numlab.nl_ast as ast
def build_args(arg: ast.Arg, args: ast.Args = None) -> ast.Args:
if args is None:
args = ast.Args()
if arg.is_arg:
if args.vararg is not None:
raise ValueError("Only one *arg is allowed")
args.vararg = arg
if arg.is_kwarg:
if args.kw... |
# Copyright 2018-2021 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/usr/bin/env python
'''
Subroutines for estimating motion between images
'''
import os
import sys
import tqdm
import pdb
import math
import numpy as np
from scipy import linalg
from scipy import interpolate
import torch
from torch import nn
import torch.nn.functional as F
from torch.utils.data import DataLoad... |
import scipy
from scipy.signal import firwin2, stft, get_window, correlate, resample
from scipy.signal.windows import hann, hamming
from scipy.fftpack import fft, ifft
from numpy.lib.stride_tricks import as_strided
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from processor imp... |
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from django.utils import timezone
from rest_framework import pagination, generics, views, status, mixins
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.parsers import JSONPar... |
import math
import random
import sys
import time
from lib import game_object
from lib.map import zonemap, solved_places
from lib.npc import Bandit, Orc, Giant
from lib.player import myPlayer
from lib.static import clear, screen_width, speech_manipulation
def title_screen_selections():
option = input("> ")
if... |
#!/usr/bin/env python3
# Author: <NAME> (<EMAIL>)
# License: BSD-3-Clause
import logging, os, time, argparse, json
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from astropy.time import Time
from astropy import constants as const
from astropy.table import Table
from astro... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException, ElementNotInt... |
from __future__ import unicode_literals, print_function
import argparse
import logging
import re
from sklearn.feature_extraction.text import TfidfVectorizer#, TfidfTransformer, CountVectorizer
from sklearn.model_selection import GroupKFold
import numpy as np
import os
from sklearn.metrics import accuracy_score
from s... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
import numpy as np
from collections import OrderedDict
import torch
from torch import nn, Tensor
import warnings
from typing import Tuple, List, Dict, Optional, Union
sys.path.append("..")
from config import opt
# Nets
class PyramidFeature... |
"""Functions/classes for adding and removing seed data"""
import datetime
import os
import json
from types import SimpleNamespace
from collections import defaultdict, namedtuple
import pytz
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.contrib.contenttypes.models ... |
#!/usr/bin/env python3
from __future__ import annotations
import re
import string
from typing import Iterator, Optional
from itertools import product, combinations
from bs4 import BeautifulSoup
import httpx
import spacy
from pathlib import Path
from pydantic import BaseModel
from itertools import chain
import uvicorn... |
""" A table with WASM opcodes. """
import enum
class ArgType(enum.Enum):
TYPE = 1
BYTE = 2
U32 = 3
I32 = 10
I64 = 11
F32 = 12
F64 = 13
TYPEIDX = 20
TABLEIDX = 21
LOCALIDX = 22
BLOCKIDX = 23
FUNCIDX = 24
LABELIDX = 25
GLOBALIDX = 26
class Space(enum.Enum):
... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import pytest
import cv2
from bc_gym_planning_env.utilities.path_tools import blit, get_blit_values, ensure_float_numpy, orient_path, \
path_velocity, pose_distances, distance_to_segment... |
"""
This helm version is implemented from the thesis of Muthu Subramanian
Implementation by <NAME> 2017
"""
import time
import numpy as np
np.set_printoptions(linewidth=320)
from numpy import zeros, ones, mod, conj, array, r_, linalg, Inf, complex128, c_, r_, angle
from itertools import product
from numpy.linalg impo... |
from gym_electric_motor.physical_systems.electric_motors import *
from .conf import *
from gym_electric_motor.utils import make_module
import pytest
# region first Version
# global parameter
g_omega = [0, 15, 12.2, 13]
g_i_a = [0, 3, 40, 35.3, -3] # also used for permanently excited and series dc motor
g_i_e = [0, ... |
from __future__ import print_function
import numpy as np
import cv2
import os
import math
import sys
import random
from utils.config import config
def brightness_aug(src, x):
alpha = 1.0 + random.uniform(-x, x)
src *= alpha
return src
def contrast_aug(src, x):
alpha = 1.0 + random.uniform(-x, x)
coef = np.array(... |
"""
Models and managers for generic tagging.
"""
# Python 2.3 compatibility
from django.template.defaultfilters import slugify
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
try:
set
except NameError:
from sets import Set as... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
# Written by <NAME> <<EMAIL>>
#
"""Module description:
Create atom labels for wav files.
"""
# System imports.
import logging
import argparse
from collections import OrderedDict
import os
import sys... |
# main.py COPYRIGHT Fujitsu Limited 2022
import argparse
import os
import random
import shutil
import time
import warnings
from enum import Enum
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.multiproces... |
import csv
import sys
from dataclasses import dataclass
from typing import Optional, Union
from .autoabilities import AUTOABILITIES
from .characters import CHARACTERS, Character
from .constants import (Element, ElementalAffinity, EquipmentSlots,
EquipmentType, Rarity, Stat, Status)
from .file_f... |
from django.http import HttpResponseBadRequest, HttpResponseRedirect
from django.shortcuts import render, redirect
from django.utils import timezone, translation
from django.contrib.auth import authenticate, get_user_model, login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright (c) 2014 <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 u... |
# -*- coding: utf-8 -*-
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the various utilities to build Chrome with AFDO.
For a description of AFDO see gcc.gnu.org/wiki/AutoFDO.
"""... |
#
"""
Tool for injecting a point source into a MIRI MRS detector image in order to test
cube building algorithm performance.
Uses miricoord for the distortion transforms, and does not depend on the JWST pipeline.
Works by reading in a template Lvl2b file produced with mirisim and run through the JWST
pipeline, and the... |
import sys
sys.path.append("/home1/zhc/wsi-procesing-framework/Controller/nuclick/customImageGenerator.py")
from time import time
import numpy as np
import tensorflow as tf
from skimage import exposure
from skimage.filters import gaussian
from skimage.morphology import remove_small_objects, remove_small_holes, recon... |
"""
This module contains all the necessary functions, classes and methods
to take a file written in a given dialect and convert it into Python.
In doing so, it can identify some mistakes and raise some custom
exceptions which can be used to inform users in a way that is less
intimidating than the usual Python traceback... |
#!/usr/bin python
import random
import warnings
import torch
import torch.distributed as dist
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
import argparse
from disruptcnn.loader import data_generator, EceiDataset
... |
#!/usr/bin/env python
# coding: utf-8
# # MultiLLR: local linear regression with multitask feature selection
# In[ ]:
# Ensure notebook is being run from base repository directory
import os, sys
# Disable numpy multithreading
os.environ.update(
OMP_NUM_THREADS = '1',
OPENBLAS_NUM_THREADS = '1',
NUMEXPR_... |
#! /usr/bin/env python
import logging
import os
import pickle
import numpy as np
import pytest
from metal.label_model import LabelModel
from fonduer import Meta
from fonduer.candidates import CandidateExtractor, MentionExtractor
from fonduer.candidates.models import Candidate, candidate_subclass, mention_subclass
fro... |
#!/usr/bin/env python
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ).
#
# 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... |
"""
Bayesian Optimization experiment runner.
Relies heavily on BoTorch.
"""
import os
import logging
import matplotlib.pyplot as plt
import numpy as np
import torch
import sys
# sys.path.append("../")
import pickle as pkl
from botorch.models import SingleTaskGP
from botorch.fit import fit_gpytorch_model
from botorch... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from enum import Enum
import functools
from operator import add, mul
from typing import NamedTuple, Any
from mpyc.finfields import GF, PrimeFieldElement
from mpyc.gfpx import GFpX
from sec_groups.fingroups import (
EllipticCurve,
WEI_AFF,
ED_AFF,
ED_HOM_PROJ,
ED_EXT_HOM_PROJ,
WEI_H... |
#!/usr/bin/env python3
# -*- coding: iso-8859-1 -*-
# coding: utf-8
# pylint: disable=C0103
# pylint: disable=C0200
# pylint: disable=R0912
# pylint: disable=R0902
# pylint: disable=R0903
# pylint: disable=R0913
# pylint: disable=R0914
# pylint: disable=R0915
"""This provides core functions needed by t4iss."""
__au... |
import itertools
import os
import random
import xml.etree.ElementTree as ET
from pathlib import Path
import json
import more_itertools
import numpy as np
import dask
from PyQt5 import QtCore
from PyQt5.QtCore import QThreadPool, QSize, QObject, pyqtSignal
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QSc... |
import os
import time
import socket
from datetime import datetime
import logging
import pickle
import re
import pandas as pd
import numpy as np
from sklearn.mixture import GaussianMixture
import scipy.stats
from tqdm import tqdm
import holoclean
from holoclean.detect import NullDetector
from holoclean.repair import E... |
# -*- coding: utf-8 -*-
from explorepy.parser import Parser
import os.path
import csv
import bluetooth
import numpy as np
from explorepy.filters import Filter
from scipy import signal
import pyedflib
import datetime
def bt_scan():
""""Scan for bluetooth devices
Scans for available explore devices.
Prints ... |
from utils import *
from evae import *
from hvae import *
from drugdata import *
from metrics import fda_drug_rep, dendrogram_purity_score
import torch
import numpy as np
from torch.utils.data import DataLoader
from torch.utils.data.sampler import Sampler
import time
import json
import random
import math
from absl imp... |
import time
import numpy as np
import tensorflow as tf
import baselines.common.tf_util as U
from baselines import logger
from baselines.common import zipsame, dataset, colorize
from contextlib import contextmanager
class Model(object):
def __init__(self, env, world, policies, nsteps, load_path=None, admm_iter=10,... |
"""Wrappers for :mod:`numpy.linalg`."""
import numpy as np
import xarray as xr
__all__ = [
"matrix_power",
"matrix_transpose",
"cholesky",
"qr",
"svd",
"eig",
"eigh",
"eigvals",
"eigvalsh",
"norm",
"cond",
"det",
"matrix_rank",
"slogdet",
"trace",
"solve"... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import datetime
import unittest
from mock import MagicMock
import ddt
import freezegun
from ggrc import db
from ggrc.models import all_models
from integration.ggrc import TestCase
from integration.ggrc.ap... |
#
# PyGoWave Server - The Python Google Wave Server
# Copyright 2009 <NAME> <<EMAIL>>
#
# 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... |
#
# Copyright 2021 Splunk 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, so... |
import tensorflow as tf
from keras.layers import Dense, Embedding, Lambda
from keras.objectives import binary_crossentropy
from keras.metrics import binary_accuracy as accuracy
from keras import backend as K
from keras import activations, initializations, regularizers, constraints
from keras.engine.topology import Laye... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... |
import os
import os.path
import string
import logging
import datetime
import threading
from sqlalchemy import (
create_engine,
and_,
Column, Boolean, Integer, DateTime, ForeignKey,
String, Text, UnicodeText)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.