text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
"""Supports Kp index values. Downloads data from ftp.gfz-potsdam.de or SWPC.
Parameters
----------
platform
'sw'
name
'kp'
tag
- '' : Standard Kp data
- 'forecast' : Grab forecast data from SWPC (next 3 days)
- 'recent' : Grab last 30 days of Kp data from SWPC
Note
----
Sta... |
# %%
import numpy as np
import os,sys
import argparse
import numpy as np
from collections import defaultdict
from keras.models import Model, load_model, model_from_json
from datetime import datetime
import plotly.graph_objects as go
import base64
from dominate.util import raw
from dominate.tags import *
from dominate i... |
# -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Template settings for MAVC
"""
T ... |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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 python3
''' tsarchiver - Archive tagesschau, tagesthemen and nachtmagazin '''
import os
import sys
import json
import time
import re
from zipfile import ZipFile, ZIP_DEFLATED
from datetime import datetime
import subprocess
import shutil
import sqlite3
import hashlib
import pytz
from bs4 import Beautiful... |
from bisect import bisect_right
from collections import deque, namedtuple
from math import gcd, hypot, inf, sqrt
eps = 1e-14
Line2 = namedtuple("Line2", ["a", "b", "c"])
vec3_base = namedtuple("vec3_base", ["x", "y", "z"])
vec2_base = namedtuple("vec2_base", ["x", "y"])
class Vec2(vec2_base):
def __add__(self, o... |
import argparse
import ast
import collections
import configparser
import logging
import os
import sys
import typing
from abc import ABCMeta
from argparse import Action, ArgumentParser
from enum import Enum
from pathlib import Path
from types import MappingProxyType
from typing import (
Any, Callable, Dict, Iterable... |
# -*- coding: utf-8 -*-
#
# Author: <NAME>, Finland 2019
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waived all
# copyright and related or neighboring rights to Kunquat.
#
from collections impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Library with PME calculation functions, provides utility for Private Equity analysis.
@author: <NAME> (<EMAIL>)
"""
import pandas as pd
import numpy as np
import scipy.optimize
from datetime import date
#Helper functions
def nearest(series, lookup, debug = False):
... |
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. T... |
# (C) Copyright 2021 <NAME>
#
# Stack analysis classes and routines.
import elftools.dwarf.callframe as callframe
import arduino_dbg.binutils as binutils
from arduino_dbg.term import MsgLevel
import arduino_dbg.term as term
DEBUGGER_METHODS = [
"__vector_17", # AVR timer interrupt
"TC4_Handler", ... |
# Main driver file for user input and displaying
# Also checks legal moves and keep a move log
class GameState():
def __init__(self):
# Initial board state
# Board is 8x8 2d list with each element having 2 characters
# First character represents the color: w = white & b = black
# Se... |
# 15/05/2020, <NAME>, Edinburgh
# Tidying up codes that plot rho/Paulin-Henriksson stats
# by having some of the functions in here.
import numpy as np
from scipy.stats import binned_statistic_2d
from astropy.io import fits
import time
import glob
def interpolate2D(X, Y, grid): #(It's linear) ... |
#!/usr/bin/env python3
'''A reference implementation of Bloom filter-based Iris-Code indexing.'''
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2017 Hochschule Darmstadt"
__license__ = "License Agreement provided by Hochschule Darmstadt(https://github.com/dasec/bloom-filter-iris-indexing/blob/master/hda-license... |
"""Git specific support and addon."""
import argparse
import os
import pickle
import shlex
import subprocess
from collections import namedtuple, UserDict
from pathspec import PathSpec
from pkgcore.ebuild import cpv
from pkgcore.ebuild.atom import MalformedAtom
from pkgcore.ebuild.atom import atom as atom_cls
from pkg... |
"""Calendar PDF generation"""
import os
from dataclasses import dataclass
from typing import Optional, List
from reportlab.lib import colors
from reportlab.pdfgen import canvas
from reportlab.pdfbase.pdfmetrics import stringWidth
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
... |
# Copyright (c) 2019 <NAME> (<EMAIL>)
"""
@author: <NAME>
base class for CG models and solvers
"""
import abc
from typing import Iterable
import numpy as np
#from cgmodsel.models.model_base import get_modeltype
from cgmodsel.models.model_pwsl import ModelPWSL
from cgmodsel.models.model_pw import ModelPW
from cgmodsel... |
import random
import math
import torch
from PIL import Image, ImageOps, ImageEnhance, ImageDraw
from torchvision.transforms import functional as F
import transforms
from transforms import check_prob, PIL_INTER_MAP, RandomTransform
def rescale_float(level, max_val, param_max=10):
return float(level) ... |
'''
util.py
the utility functions of the project
'''
import os
import sys
from warnings import warn
from datetime import datetime
from pathlib import Path
from importlib import import_module
import torch
import torch.nn as nn
import frontend
import util.audio as audio
from config import config
import numpy as np
impor... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import json
import logging
import sys
import boto3
import research_pacs.shared.dicom_util as rpacs_dicom_util
import research_pacs.shared.util as rpacs_util
from research_pacs.de_identifier.dicom import DicomDeident... |
import logging
from collections import defaultdict
from concurrent.futures import FIRST_EXCEPTION, wait
from itertools import product
from pathlib import Path
from typing import Iterable, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
from hermes.typeo import typeo
from rich.progress imp... |
"""
Code based on random_transform in keras.processing.image from 2016.
(https://github.com/fchollet/keras)
Keras copyright:
All contributions by <NAME>: Copyright (c) 2015, <NAME>.
All contributions by Google: Copyright (c) 2015, Google, Inc.
All contributions by Microsoft: Copyright (c) 2017, Microsoft, Inc.
All oth... |
# Landmark extraction
# Steps
# Add new fields
# Check if fields exists
# Visual
# 3D Visibility 0.5 * 0.5 = 0.25
# Facade area 0.3 * 0.5 = 0.15
# Height 0.2 * 0.5 = 0.1
# Structural
# Area 0.3 * 0.3 = 0.09
# 2D-Advance visibility 0.3 * 0.3 = 0.09
# Neighbours 0.2 * 0.3 = 0.06
# Road dist... |
'''
Keep track of document and topic priors. Gradient updates performed by Theano.
<NAME>
'''
from functools import reduce
from scipy.special import digamma
import theano
from theano import config
import theano.tensor as T
import numpy as np
import mlp, opt
from _sample import _loglikelihood_marginalizeTopics
... |
from torch.nn import Sequential, Linear, ReLU, GRU
from torch_geometric.data import Dataset, Data, DataLoader
# from torch_geometric.datasets import QM9
from torch_geometric.nn import NNConv, Set2Set
from torch.nn import BCELoss, BCEWithLogitsLoss
from torch_geometric.utils import remove_self_loops
import numpy as np... |
import os
import julian
import datetime
import math
import pandas as pd
import numpy as np
from numpy import *
import pickle
from sklearn.model_selection import train_test_split
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import warnings
from sklearn.cluster import KMeans
import matplotlib.col... |
import tensorflow as tf
import numpy as np
class MultiHeadSelfAttention(tf.keras.layers.Layer):
def __init__(self, emb_dim = 768, n_head = 12, out_dim = None, relative_window_size = None, dropout_rate = 0., kernel_initializer = tf.keras.initializers.RandomNormal(mean = 0, stddev = 0.01), **kwargs):
#Scaled... |
import argparse
import os
import numpy as np
import sys
import json
from os import listdir
import csv
from os.path import isfile, join
from face_network import create_face_network
import cv2
import argparse
from keras.optimizers import Adam, SGD
from keras.models import load_model
from emotion_model import *
from u... |
'''Body Composition is a Slicer module that allows to segment different parts of the lungs in a manual or semi-automatic basis
with the help of a customized Slicer Editor.
It also performs a set of operations to analyze the different structures of
the volume based on its label map, like Area, Mean, Std.Dev., etc.
First... |
# -*- coding: utf-8 -*-
import operator
import sys
import numpy as np
import tensorflow as tf
from jtr.nn.models import get_total_trainable_variables
from jtr.util.tfutil import tfrun
class Vocab(object):
"""
Vocab objects for use in jtr pipelines.
Example:
>>> #Test Vocab without pre-trained ... |
import json
import uuid
import typer
import validators
from googleapiclient.discovery import build
from google.oauth2 import service_account
import yaml
from datetime import datetime, timedelta
from pathlib import Path
from enum import Enum
from typing import Optional, NamedTuple
extractor = typer.Typer()
APP_NAME = ... |
"""module containing the FatigueAnalysis class and
calc_kf for calculating dynamic stress concentration factor
"""
from math import log10
from sympy import sqrt
from me_toolbox.tools import NotInRangeError, print_atributes
from sympy import oo
from me_toolbox.fatigue import FailureCriteria
def calc_kf(q, Kt):
"""... |
import os
import mmap
import binascii
import os
import glob
import binascii
import datetime
import shutil
import mmap
import hashlib
import json
from py2neo import Graph, authenticate, Cursor, cypher
import logging
import csv
import pandas as pd
import numpy as np
#from bitcoinrpc.authproxy import AuthServiceProxy, JS... |
# Audio processing tools
#
# <NAME> 2020
#
# Some code modified from original MATLAB rastamat package.
#
import numpy as np
from scipy.signal import hanning, spectrogram, resample, hilbert, butter, filtfilt
from scipy.io import wavfile
# import spectools
# from .fbtools import fft2melmx
from matplotlib import pyplot... |
# Copyright 2012-2017, Intel Corporation, All Rights Reserved.
#
# This software is supplied under the terms of a license
# agreement or nondisclosure agreement with Intel Corp.
# and may not be copied or disclosed except in accordance
# with the terms of that agreement.
#
# Author: <NAME>
"""
Module containing the... |
import argparse
import glob
import os
import random
import logging
import numpy as np
import math
from tqdm import tqdm
import time
import torch
from transformers import AutoTokenizer, AutoModelForMaskedLM
from transformers import DataCollatorForLanguageModeling
from transformers.optimization import AdamW, get_linear_s... |
import sqlite3
import requests
import json
__all__=["bot","_DB_NAME","_time_out","_chunk_size","_no_api_exception"]
_BASE_ADDRESS='https://api.telegram.org/bot'
_DB_NAME="Pytbot_data.db"
_time_out=None
_chunk_size = 2048
_no_api_exception=True
###################### GLOBAL INTERNAL FUNCTIONS #####################... |
from ..gui.main_window import Ui_EditorMainWindow
from PySide.QtGui import QApplication, QMainWindow, QPixmap
from PySide import QtGui, QtCore
from PySide.QtCore import QObject
import sys
import numpy as np
from .. import util
from .brush_dialog import BrushDialog
from .about_dialog import AboutDialog
from .new_image_d... |
from tkinter import *
from PIL import Image, ImageTk
import random
import requests
import json
import time
import pandas as pd
import matplotlib
matplotlib.use("TkAgg") # allow matplotlib to display on tkinter
import matplotlib.pyplot as plt
import seaborn as sns
from speech import *
import duckduckgo
import re
import... |
import argparse
import string
from nltk.corpus import stopwords
from nltk.util import ngrams
from nltk.lm import NgramCounter
from sklearn.feature_extraction.text import CountVectorizer
import pandas as pd
import numpy as np
from tqdm import tqdm
import parmap
import os, pickle
from multiprocessing import Pool
from ite... |
#
# Copyright (C) 2014 Dell, 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 wri... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License
# Copyright (c) 2019 Ina (<NAME> & <NAME> - http://www.ina.fr/)
# 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 restrictio... |
"""
--<NAME>--
This program uses 6 classes to create the bricks / ball / paddle / string 'You are dead'/ string 'Congratulations'.
Control the size / color / initial position / initial speed of ball, paddle, bricks.
Also do mouse listeners to communicate with system.
A blinking message click to start as a prol... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python... |
# 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 (t... |
"""
This module holds default translations from pandas syntax to sql for 3 kinds of operations...
1. scalar - elementwise operations (e.g. array1 + array2)
2. aggregation - operations that result in a single number (e.g. array1.mean())
3. window - operations that do calculations across a window
(e.g. array... |
import numpy as np
import sys
pp = "/Users/andres.perez/source/parametric_spatial_audio_processing"
sys.path.append(pp)
import parametric_spatial_audio_processing as psa
import matplotlib.pyplot as plt
import scipy.stats
from utils import *
from file_utils import build_result_dict_from_metadata_array, build_metadata_r... |
import os
import time
import threading
import json
from datetime import datetime as dt, timedelta
from monthdelta import monthdelta
from dateutil.parser import parse as date_parse
from flask_production import TaskScheduler
from flask_production.hols import TradingHolidays
from flask_production.sched import LOGGER, BadS... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Util functions
# @author <EMAIL>
from lxml import etree
from lxml.etree import tostring
from itertools import chain
from nltk.tokenize import wordpunct_tokenize
from random import shuffle
from sklearn import metrics
import numpy
import operator
import pandas
import re
impor... |
import argparse
import numpy as np
import tensorflow as tf
from tensorflow.contrib.rnn import BasicLSTMCell, LSTMStateTuple
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import node_def_pb2
from tensorflow.python.framework import gra... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from mpl_toolkits.mplot3d import Axes3D
# Initialize webcam input
cap = cv2.VideoCapture(0)
# Initialize video input
####BSL Corpus#####
#cap = cv2.VideoCapture("C:/Users/liangx/Desktop/Trajectoreis_test/BSL Corpus Data Resul... |
# minqlx - Extends Quake Live's dedicated server with extra functionality and scripting.
# Copyright (C) 2015 Mino <<EMAIL>>
# This file is part of minqlx.
# minqlx 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 Founda... |
# -*- coding=utf-8 -*-
import socket
import sys
import threading
from time import sleep
from datetime import datetime
def connect_domain_socket(file="/tmp/pisugar-server.sock"):
"""Connect pisugar server via unix domain socket file"""
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
conn = s.connect... |
#!/usr/bin/python3 -u
import logging
import os
import sys
import time
import struct
from typing import Tuple, Any
from configparser import ConfigParser
from argparse import ArgumentParser, Namespace
from collections.abc import Mapping
from pathlib import Path
from attiny_i2c import ATTiny
#from attiny_i2c_new import A... |
import sys
import inspect
import textwrap
from collections import OrderedDict, UserString
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
# source for the accordion = https://stackoverflow.com/questions/32476006/how-to-make-an-expandable-collapsa... |
import getpass
import os
import sys
import math
from io import StringIO
import shutil
import datetime
from os.path import splitext
from difflib import unified_diff
import pytest
from astropy.io import fits
from astropy.io.fits import FITSDiff
from astropy.utils.data import conf
import numpy as np
import stwcs
from st... |
from typing import Tuple, Any, Dict, Optional, List
import numpy
import numpy as np
from plotly import graph_objects
from plotly.subplots import make_subplots
from plotly.tools import DEFAULT_PLOTLY_COLORS
from phi import math, field
from phi.field import SampledField, PointCloud, Grid, StaggeredGrid
from phi.geom im... |
import tensorflow as tf
import pandas as pd
from src.benchmarkLogger import benchThread
from trainers.model_utils import getOptimizer
import time
from datetime import datetime
from trainers.loadBinaryMovieLens import *
from trainers.topKmetrics import *
import tensorflow_recommenders as tfrs
import sys
from getpass im... |
import uuid
from unittest.mock import patch
import responses
from django.test import Client, TestCase
from parameterized import parameterized
from cards.models import Card, Color, ColorPair, Type, MagicSet, Printing
from cmdrjump.deckimporter import determine_colors_from_manacost, determine_category_from_card, colorp... |
# noinspection PyPackageRequirements
import pytest
from euler_python.utils import eulerlib
@pytest.mark.parametrize(
"input_x,expected_output", [
(10, 2),
(100, 3),
(450180, 10)])
def test_popcount(input_x, expected_output):
output = eulerlib.popcount(input_x)
print(output)
ass... |
"""
defines methods to access MPC/rigid element data:
- get_mpc_node_ids( mpc_id, stop_on_failure=True)
- get_mpc_node_ids_c1( mpc_id, stop_on_failure=True)
- get_rigid_elements_with_node_ids(self, node_ids)
- get_dependent_nid_to_components(self, mpc_id=None, stop_on_failure=True)
- get_lines_rigid(model: BD... |
import numpy as np
import pytest
from shapecheck import (ShapeError, check_shapes, is_checking_enabled, is_compatible,
set_checking_enabled, str_to_shape)
from .utils import CaptureStdOut
def test_basic():
@check_shapes('3', '4', out_='2')
def f(x, y):
return x[:2]**2 + y[:2]... |
import json
import random
import os
import logging
import pickle
import string
import re
from pathlib import Path
from collections import Counter, OrderedDict, defaultdict as ddict
import torch
import numpy as np
from tqdm.notebook import tqdm
from torch.utils.data import Dataset
def set_seed(seed):
random.seed(se... |
# FHIR Data Model Class
"""
Models for Patient Membership Data
All of the models are stored in this module
Models
------
Pat - A patient in membership list
Attributes:
-----------
Profile = a top-level model injerated from base model
resourceType (string) - the resource type, i.e. "Patient"
active (boolean)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 11 17:10:49 2020
@author: <NAME>
In this code a Hamiltonian Neural Network is designed and employed
to solve a system of four differential equations obtained by Hamilton's
equations for the Hamiltonian of Henon-Heiles chaotic dynamical.
"""
import ... |
import calendar
import json
import os
import re
from datetime import datetime
from urllib.parse import quote
import barcode
import qrcode
import requests
from barcode.writer import ImageWriter
from bs4 import BeautifulSoup
from PIL import Image, ImageColor
from telethon.errors.rpcerrorlist import YouBlockedUserError
... |
import os
import time
import logging
import unittest
import binascii
import contextlib
import dissect.formats.mbr as mbr
import dissect.formats.fat32 as fat32
TEST_IMAGE_PATH = "test.dd"
KILOBYTE = 1024
MEGABYTE = 1024 * KILOBYTE
GIGABYTE = 1024 * MEGABYTE
TERABYTE = 1024 * GIGABYTE
TEST_IMAGE_SIZE = 40 * MEGABYTE
T... |
# Author: <NAME>, Fall 2018
# Author worked as a one-person team and wrote all code within here.
# 'OCRB' is the font for the mine and time counters.
# Code here is mostly untounced, but lightly refactored for readability. Comments also made to indicate future changes and review the code. They begin with "###". <-... |
from enum import Enum, auto
class MCFragment:
def __init__(self):
self.section = None
class MCDataFragment(MCFragment):
def __init__(self):
super().__init__()
self.contents = bytearray()
self.fixups = []
class MCRelaxableFragment(MCFragment):
def __init__(self, inst):
... |
import math
from typing import Tuple
import numpy as np
from PIL import Image
# region Shift Hue
def rgb_to_hsv(rgb):
rgb = rgb.astype('float')
hsv = np.zeros_like(rgb)
hsv[..., 3:] = rgb[..., 3:]
if rgb.shape[2] == 4:
hsv[..., 3] = rgb[..., 3]
r, g, b = rgb[..., 0], rgb[..., 1], rgb[..., ... |
from fastapi import FastAPI, Request, Response
from fastapi.responses import JSONResponse, StreamingResponse
from starlette.status import *
from starlette.types import Scope, Receive, Send
import json
from argparse import ArgumentParser
import os
import uvicorn
import base64
from cryptography.fernet import Fernet
impor... |
'''Utils for gene expression
'''
import os, sys
import json
import hashlib
import math
from collections import OrderedDict
import h5py
import requests
import numpy as np
import pandas as pd
import scipy.sparse as sp
from scipy import io
from sklearn.preprocessing import scale
from bson.codec_options import CodecOptions... |
"""
Disctrict Cooling Network Calculations.
Calculate which technologies need to be activated to meet the cooling energy demand and determine the cost and emissions
that result from the activation of these cooling technologies.
"""
import numpy as np
import pandas as pd
from cea.constants import HOURS_IN_YEAR
from c... |
try:
from psutil import virtual_memory, net_if_addrs, cpu_percent, getloadavg, disk_usage
except:
from .mockpsutil import virtual_memory, net_if_addrs, cpu_percent, getloadavg, disk_usage
import logging
from enum import Enum
from pprint import PrettyPrinter
from sys import stdout
import socket
import requests
... |
import os
import glob
import picamera
import cv2
import numpy as np
import importlib.util
from datetime import datetime
import videorecorder as vr
import time
from collections import Counter
# If using TPU, need to load a different library
# from tensorflow.lite.python.interpreter import Interpreter
def take_picture... |
'''
MIT License
Optimal Testing and Containment Strategies for Universities in Mexico amid COVID-19
Copyright © 2021 Test and Contain. <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,and <NAME>. https://www.testandcontain.com/
Permission is hereby granted, free of charge, to any person obtaining a copy of thi... |
"""Query classes."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
import operator
import sys
from schevo.lib import optimize
from schevo import base
from schevo.constant import UNASSIGNED
import schevo.error
from schevo import field
from schevo.fieldspec import FieldMap, FieldSpecMap
from sc... |
# https://scikit-learn.org/stable/auto_examples/inspection/plot_permutation_importance_multicollinear.html#sphx-glr-auto-examples-inspection-plot-permutation-importance-multicollinear-py
# https://orbi.uliege.be/bitstream/2268/155642/1/louppe13.pdf
# https://proceedings.neurips.cc/paper/2019/file/702cafa3bb4c9c86e4a3b6... |
""" Define train and test data for One versus Rest or Rest versus One in cross validation fashion
The result summary of this operation contains one dataset for every
dataset of the *input_path*, which uses data from this dataset as test
data and the data of all other datasets as training data. For instance, if
the inp... |
#!/usr/bin/env python
import sys, os
import argparse
import numpy as np
#import atomsinmolecule as mol
import topology as topo
import math
import pandas as pd
class topologyDiff(object):
def __init__(self, molecule1, molecule2, covRadFactor=1.3):
errors = {}
requirements_for_comparison(molecule1, ... |
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request
import os,shutil
import numpy as np
import json
import collections
import time
# import tensorflow as tf
import argparse
import sys
import face_model
from flask_cors import *
import cv2
from annoy import AnnoyIndex
import datetime
import random... |
#-*-coding:utf-8-*-
# date:2020-03-02
# Author: X.li
# function: inference & eval CenterNet only support resnet backbone
import os
import glob
import cv2
import numpy as np
import time
import shutil
import torch
import json
import matplotlib.pyplot as plt
from data_iterator import LoadImagesAndLabels
from models.decod... |
#
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
#!/usr/bin/env python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 requi... |
import sys, random, time, pygame
from pygame.locals import *
from Pinyin2Hanzi import DefaultDagParams
from Pinyin2Hanzi import dag
dagparams = DefaultDagParams()
num = 0
flag = 0
x = 300
y = 350
words_list = [['老虎', '狮子', '蛇', '蛤蟆', '老鼠', '蜘蛛'],
['丑', '可爱', '美丽', '凶猛', '勤劳', '警觉'],
['头', ... |
"""Utility functions used across Myapp"""
from datetime import date, datetime, time, timedelta
import decimal
from email.mime.application import MIMEApplication
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formatdate
... |
import argparse
import datetime as dt
import errno
import glob
import json
import logging
import logging.config
import math
import multiprocessing
import ntpath
import os
import re
import shlex
import shutil
import signal
import subprocess
import time
from functools import wraps
from urllib.error import HTTPError, URLE... |
#!/usr/bin/env python
##updating 041121 add the read supporting information
##updation 110520 add the MAF filtration
##updation 110120 add an opt to generate vcf file
##import modules
from Bio import SeqIO
import re
import sys
import subprocess
def generate_sample_list (input_all_sample_list_file):
all_name_list... |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
import torch
import torch.nn as nn
import time
import sys, os
import numpy as np
import cv2
import scipy
import matplotlib.pyplot as plt
f... |
# 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... |
# -*- coding: utf-8 -*-
"""
This is a script for satellite image classification
Last updated on Aug 6 2019
@author: <NAME>
@Email: <EMAIL>
@functions
1. generate samples from satellite images
2. grid search SVM/random forest parameters
3. object-based post-classification refinement
superpixel-based regularization for... |
#!/usr/bin/env python3
import pickle
import os
import numpy as np
def get_sweep_parameters(parameters, env_config, index):
"""
Gets the parameters for the hyperparameter sweep defined by the index.
Each hyperparameter setting has a specific index number, and this function
will get the appropriate par... |
#! python
# -*- coding: utf-8 -*-
#
# $Id: fi.py 146 2006-11-07 07:44:29Z sgrayban $
#
g_strtable = -1
language_code = __name__.split('.')[-1]
def add(label, txt):
global g_strtable
g_strtable.AddText(language_code, label, txt)
def AddStrings(strtable):
global g_strtable
g_strtable = strtable
##... |
"""This submodule handles all interaction with the LALSuite C API.
It provides a class for inputs and a class for outputs and functions for
reading/writing/comparing them. The inputs method has a 'run' method
for calling the C API.
"""
import numpy as np
import glob
import math
import lal_cuda
# Generate mocks for... |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: kol
#
# Created: 06.02.2020
# Copyright: (c) kol 2020
# Licence: <your licence>
#-------------------------------------------------------------------------------
import sys
import... |
import abc
import csv
from curses import A_ATTRIBUTES
import typing
import numpy as np
from xbbo.core.trials import Trials
# from xbbo.surrogate.base import Surrogate
from xbbo.surrogate.gaussian_process import GPR_sklearn
from xbbo.surrogate.transfer.tst import BaseModel
from xbbo.utils.constants import VERY_SMALL_NU... |
import tensorflow as tf
from typing import Tuple
# Copyright 2019 Bisonai 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/licens... |
import bisect
import copy
import datetime
import uuid
import operator
import pytz
import calendar
from elasticsearch_dsl.query import Range, Terms
def string_to_datetime(timestamp):
try:
return datetime.datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%fZ")
except ValueError:
return datetime.da... |
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import threading
from threading import Lock, Thread
import random
import time as timeee
transactionCounter = 0
lock = Lock()
succesfulAttacks = 0
failedAttacks = 0
class User(object):
def __init__(self, id: int, malicious: bool):
s... |
import logging
import time
from pathlib import Path
from threading import Lock, Thread
from typing import Generator, List, Optional, Tuple
# import imageio
import numpy as np
import torch
from decord import cpu # , gpu
from decord import VideoReader
from imageio.plugins.ffmpeg import FfmpegFormat
from rich import get... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.